Rstudio and R-4.2.2 source code install (20221229)

jsyu@Oreo:~$ sudo apt update

jsyu@Oreo:~$ sudo apt --fix-broken install

jsyu@Oreo:~$ sudo apt install xvfb xauth xfonts-base xorg-dev libtiff5 libtiff5-dev libcairo2 libghc-cairo-dev texlive-latex-base gsfonts-x11 t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi

jsyu@Oreo:~$ sudo apt install openssl libssl-dev xml2 libxml2-dev icu-devtools libicu-dev

For Ubuntu 18.04

jsyu@Oreo:~$ sudo apt install libreadline-dev libbz2-dev libpcre2 libpcre2-dev libpcre3-dev libpcre2-dev libcurl libcurl3 libcurl4 libcurl3-gnutls libcurl3-dev libcurl4-dev  libcurl4-gnutls-dev libcurl4-doc libgnutls28-dev libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev texlive texlive-fonts-extra texlive-fonts-extra-doc html2ps texinfo   libclang-dev

For Ubuntu 20.04

jsyu@Oreo:~$ sudo apt install libreadline-dev libbz2-dev libpcre2-dev libpcre3-dev libpcre2-dev libcurl3-gnutls libcurl3-dev libcurl4-doc libgnutls28-dev libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev texlive texlive-fonts-extra texlive-fonts-extra-doc html2ps texinfo libclang-dev libpq5

jsyu@Oreo:~$ sudo apt install openjdk-11-jre openjdk-11-jdk libblas-dev g++ gfortran libicu66 make aglfn git tk-dev liblapack-dev libopenblas-dev libharfbuzz-dev libfribidi-dev

jsyu@Oreo:~$ sudo apt install rsem trimmomatic fastqc rna-star

Check https://www.rstudio.com/products/rstudio/download/#download for the newest version of the IDE of RStudio that fits your Linux distribution. In our cases of Ubuntu 18.04 and 20.04, choose RSTUDIO-2022.12.0-353-AMD64.DEB for Ubuntu 18+/Debian 10+.

jsyu@Oreo:~$ wget \ https://download1.rstudio.org/electron/bionic/amd64/rstudio-2022.12.0-353-amd64.deb

jsyu@Oreo:~$ sudo dpkg -i rstudio-2022.12.0-353-amd64.deb

(Reading database ... 388651 files and directories currently installed.)

Preparing to unpack rstudio-2022.12.0-353-amd64.deb ...

Unpacking rstudio (2022.12.0+353) over (2021.09.1+372) ...

Setting up rstudio (2022.12.0+353) ...

Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...

Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...

Processing triggers for mime-support (3.60ubuntu1) ...

Processing triggers for hicolor-icon-theme (0.17-2) ...

Processing triggers for shared-mime-info (1.9-2) ...

This means installation successfully completed.

If you run into failure like the messages below:

(Reading database ... 156559 files and directories currently installed.)

Preparing to unpack rstudio-2021.09.1-372-amd64.deb ...

Unpacking rstudio (2021.09.1+372) over (2021.09.1+372) ...

dpkg: dependency problems prevent configuration of rstudio:

 rstudio depends on libclang-dev; however:

  Package libclang-dev is not installed.

 rstudio depends on libpq5; however:

  Package libpq5 is not installed.

dpkg: error processing package rstudio (--install):

 dependency problems - leaving unconfigured

Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...

Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

Processing triggers for mime-support (3.64ubuntu1) ...

Processing triggers for hicolor-icon-theme (0.17-2) ...

Processing triggers for shared-mime-info (1.15-1) ...

Errors were encountered while processing:

 rstudio

check the above dependency if installation failed. Install required packages and re-run

sudo dpkg -i rstudio-2022.12.0-353-amd64.deb 

again.

Check https://cran.r-project.org/sources.html for the newest version of source code of R (in our case, R-4.2.2)

jsyu@Oreo:~$ wget \

https://cran.r-project.org/src/base/R-4/R-4.2.2.tar.gz

jsyu@Oreo:~$ ls -al / | grep rwt

drwxrwxrwt  19 root root              4096 Dec 29 17:40 tmp

jsyu@Oreo:~$ tar zxvf R-4.2.2.tar.gz -C /tmp

jsyu@Oreo:/tmp/R-4.2.2$ cd /tmp/R-4.2.2

jsyu@Oreo:/tmp/R-4.2.2$ ./configure --prefix=/usr/local/R-4.2.2 --with-x \ --with-cairo --with-libtiff --with-libpng --with-jpeglib --enable-R-shlib \ --enable-BLAS-shlib --enable-memory-profiling

R is now configured for x86_64-pc-linux-gnu

  Source directory:            .

  Installation directory:      /usr/local/R-4.2.2

  C compiler:                  gcc  -g -O2

  Fortran fixed-form compiler: gfortran -fno-optimize-sibling-calls -g -O2

  Default C++ compiler:        g++ -std=gnu++14  -g -O2

  C++11 compiler:              g++ -std=gnu++11  -g -O2

  C++14 compiler:              g++ -std=gnu++14  -g -O2

  C++17 compiler:              g++ -std=gnu++17  -g -O2

  C++20 compiler:

  Fortran free-form compiler:  gfortran -fno-optimize-sibling-calls -g -O2

  Obj-C compiler:

  Interfaces supported:        X11, tcltk

  External libraries:          pcre2, readline, curl

  Additional capabilities:     PNG, JPEG, TIFF, NLS, cairo, ICU

  Options enabled:             shared R library, shared BLAS, R profiling, memory profiling

  Capabilities skipped:

  Options not enabled:

  Recommended packages:        yes

 

jsyu@Oreo:/tmp/R-4.2.2$ make -j 2 | tee make.log      

jsyu@Oreo:/tmp/R-4.2.2$ make check | tee check.log        

jsyu@Oreo:/tmp/R-4.2.2$ sudo make install

jsyu@Oreo:/tmp/R-4.2.2$ sudo ln -s /usr/local/R-4.2.2/bin/R /usr/bin

jsyu@Oreo:/tmp/R-4.2.2$ sudo ln -s /usr/local/R-4.2.2/bin/Rscript /usr/bin

jsyu@Oreo:/tmp/R-4.2.2$ lscpu

Architecture:                        x86_64

CPU op-mode(s):                      32-bit, 64-bit

Byte Order:                          Little Endian

Address sizes:                       39 bits physical, 48 bits virtual

CPU(s):                              4

On-line CPU(s) list:                 0-3

Thread(s) per core:                  2

Core(s) per socket:                  2

Socket(s):                           1

NUMA node(s):                        1

Vendor ID:                           GenuineIntel

CPU family:                          6

Model:                               142

Model name:                          Intel(R) Core(TM) i3-8109U CPU @ 3.00GHz

Stepping:                            10

CPU MHz:                             1128.259

CPU max MHz:                         3600.0000

CPU min MHz:                         400.0000

BogoMIPS:                            6000.00

Virtualization:                      VT-x

L1d cache:                           64 KiB

L1i cache:                           64 KiB

L2 cache:                            512 KiB

L3 cache:                            4 MiB

NUMA node0 CPU(s):                   0-3

Under R (Command line interface, CLI)

jsyu@Oreo:/tmp/R-4.2.2$ sudo R           # Install R packages for every user requires sudo

> sessionInfo()

R version 4.2.2 (2022-10-31)

Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu 18.04.1 LTS

Matrix products: default

BLAS:   /usr/local/R-4.2.2/lib/R/lib/libRblas.so

LAPACK: /usr/local/R-4.2.2/lib/R/lib/libRlapack.so

locale:

 [1] LC_CTYPE=en_US.UTF-8    LC_NUMERIC=C            LC_TIME=en_US.utf8

 [4] LC_COLLATE=en_US.UTF-8  LC_MONETARY=lzh_TW      LC_MESSAGES=en_US.UTF-8

 [7] LC_PAPER=lzh_TW         LC_NAME=C               LC_ADDRESS=C

[10] LC_TELEPHONE=C          LC_MEASUREMENT=lzh_TW   LC_IDENTIFICATION=C

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):

[1] compiler_4.2.2 tools_4.2.2

> capabilities()

       jpeg         png        tiff       tcltk         X11        aqua    http/ftp

       TRUE        TRUE        TRUE        TRUE        TRUE       FALSE        TRUE

    sockets      libxml        fifo      cledit       iconv         NLS       Rprof

       TRUE       FALSE        TRUE        TRUE        TRUE        TRUE        TRUE

    profmem       cairo         ICU long.double     libcurl

       TRUE        TRUE        TRUE        TRUE        TRUE

      # It seems normal that libxml fails to be built in R-4.2.2. Install it inside R.

      # Aqua is for MacOS.

> install.packages('XML')

       # Choose from source list 68: Taiwan (Taipei) [https]

> install.packages('extrafont')

> install.packages('ggplot2')

> install.packages("rJava")

> install.packages("xlsx")           # To read and export into Excel and XML formats

> install.packages("gdata")         # To read Excel files

> install.packages("devtools")  

> install.packages("gplots")

> install.packages("cowplot")

> install.packages("RColorBrewer")

> install.packages("reshape2")

> install.packages("plyr")

> install.packages("ggpubr")

> install.packages("circlize")

> install.packages("magrittr")

> install.packages("nlme")

> install.packages("org.Hs.eg.db")   # Okay if fail ; one of the following installs it too (likely clusterProfiler ).

## Packages of R that have been utilized in our class this semester:

## Must run   install.packages("devtools")   first  

genefilter

geneplotter

DESeq2

tximportData

tximport

apeglm

enrichplot

clusterProfiler    

ChIPpeakAnno  

pathview  

ConsensusClusterPlus

ComplexHeatmap

org.Hs.eg.db ?

# Install above components colored in teal

> devtools::install_bioc("genefilter")  

> devtools::install_bioc("geneplotter")   

> devtools::install_bioc("DESeq2")    

> devtools::install_bioc("tximportData")

… …

> devtools::install_bioc("ComplexHeatmap")

> installed.packages()        

   # Check installed R packages

> library('xlsx','gdata')

> sessionInfo()

R version 4.2.2 (2022-10-31)

Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu 18.04.1 LTS

Matrix products: default

BLAS:   /usr/local/R-4.2.2/lib/R/lib/libRblas.so

LAPACK: /usr/local/R-4.2.2/lib/R/lib/libRlapack.so

locale:

 [1] LC_CTYPE=en_US.UTF-8     LC_NUMERIC=C             LC_TIME=en_US.utf8

 [4] LC_COLLATE=en_US.UTF-8   LC_MONETARY=lzh_TW       LC_MESSAGES=en_US.UTF-8

 [7] LC_PAPER=lzh_TW          LC_NAME=lzh_TW           LC_ADDRESS=lzh_TW

[10] LC_TELEPHONE=lzh_TW      LC_MEASUREMENT=lzh_TW    LC_IDENTIFICATION=lzh_TW

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:

[1] xlsx_0.6.5

loaded via a namespace (and not attached):

 [1] Rcpp_1.0.9        compiler_4.2.2    later_1.3.0       urlchecker_1.0.1

 [5] prettyunits_1.1.1 profvis_0.3.7     remotes_2.4.2     tools_4.2.2

 [9] digest_0.6.31     pkgbuild_1.4.0    pkgload_1.3.2     memoise_2.0.1

[13] lifecycle_1.0.3   rlang_1.0.6       shiny_1.7.4       cli_3.5.0

[17] curl_4.3.3        fastmap_1.1.0     rJava_1.0-6       withr_2.5.0

[21] stringr_1.5.0     xlsxjars_0.6.1    desc_1.4.2        fs_1.5.2

[25] htmlwidgets_1.6.0 vctrs_0.5.1       devtools_2.4.5    rprojroot_2.0.3

[29] glue_1.6.2        R6_2.5.1          processx_3.8.0    sessioninfo_1.2.2

[33] callr_3.7.3       purrr_1.0.0       magrittr_2.0.3    ps_1.7.2

[37] promises_1.2.0.1  ellipsis_0.3.2    htmltools_0.5.4   usethis_2.1.6

[41] mime_0.12         xtable_1.8-4      httpuv_1.6.7      stringi_1.7.8

[45] miniUI_0.1.1.1    cachem_1.0.6      crayon_1.5.2

> q()               # Quit R.

jsyu@Oreo:/tmp/R-4.2.2$ du -sh /usr/local/R-4.2.2/lib

1.9G    /usr/local/R-4.2.2/lib

        # All of the above-installed R packages took about 2GB of disk space.