- Homepage: R: The R Project for Statistical Computing
$ module spider r ---------------------------- r: ---------------------------- Versions: r/3.4.4 r/3.5.0-py27 r/3.5.0 r/3.5.1s r/3.5.2-py27 r/3.5.2 r/3.5.3-py27 r/3.5.3 r/3.6.1-intel r/3.6.1-py27 r/3.6.1 ---------------------------- For detailed information about a specific "r" module (including how to load the modules) use the module's full name. For example: $ module spider r/3.6.1 ---------------------------- $ module spider r/3.5.1s ---------------------------- r: r/3.5.1s ---------------------------- You will need to load all module(s) on any one of the lines below before the "r/3.5.1s" module is available to load. singularity/2.5.2 singularity/3.1.1 $ module spider r/3.6.1 ---------------------------- r: r/3.6.1 ---------------------------- You will need to load all module(s) on any one of the lines below before the "r/3.6.1" module is available to load. swset/2018.05 gcc/7.3.0
module load gcc/7.3.0 r/3.6.1
Once the modules have been loaded:
$ R R version 3.6.1 (2019-07-05) -- "Action of the Toes" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Storage Matrix products: default BLAS: /pfs/tsfs1/apps/el7-x86_64/u/gcc/7.3.0/r/3.6.1-3rtwrmw/rlib/R/lib/libRblas.so LAPACK: /pfs/tsfs1/apps/el7-x86_64/u/gcc/7.3.0/r/3.6.1-3rtwrmw/rlib/R/lib/libRlapack.so locale:  LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C  LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8  LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8  LC_PAPER=en_US.UTF-8 LC_NAME=C  LC_ADDRESS=C LC_TELEPHONE=C  LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages:  stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached):  compiler_3.6.1 > quit() Save workspace image? [y/n/c]: n [@tlog2 ~]$
- This software is dependent on the following modules:
- Due to the install process, at this moment in time you have to explicitly load gcc before loading r. If you try loading r before gcc you will see the following message:
$ module load r/3.6.1 Lmod has detected the following error: These module(s) exist but cannot be loaded as requested: "r/3.6.1" Try: "module spider r/3.6.1" to see how to load the module(s).
Below we will give some guidelines on how to install and use various R packages specifically on teton.
- Typically, packages will be installed in your home folder, within the
Rfolder, under the platform version
x86_64-pc-linux-gnu-library, then under a
major.minorversion (without the patch number) folder.
~/R/ x86_64-pc-linux-gnu-library/ 3.5/ 3.6/
- Packages installed/built with one
major.minorversion will typically not work under another.
R and Intel/MKL
We have a version of r3.6.1 built with the Intel compiler and related MKL (Maths Kernel Library) that follows a request relating to Improving R Perfomance by installing optimized BLAS/LAPACK libraries.
$ module load r/3.6.1-intel $ R R version 3.6.1 (2019-07-05) -- "Action of the Toes" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) ... > sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Storage Matrix products: default BLAS/LAPACK: /pfs/tsfs1/apps/el7-x86_64/u/intel/18.0.1/intel-mkl/2018.2.199-pti6y2y/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64_lin/libmkl_rt.so ...
- The Intel built version is dependent on the following modules:
module load r/3.6.1-intelline will automatically load these modules for you.
readline, bzip2, xzand
curllibraries are all versions that have also been built using the intel compiler.
Installing Packages to Use with Intel Version
The packages that you have installed for the standard versions of R will not work for the Intel version since they are built with different compilers. This means you will need to re-install the packages that you use.
If you potentially want to use both versions then you will need to create a second folder to install the Intel versions into.
On teton, R packages are typically installed into:
~/R/ x86_64-pc-linux-gnu-library/ 3.5/ 3.6/
One way to install the Intel packages is the following:
- Create a folder
~/R/ x86_64-pc-linux-gnu-library/ 3.5/ 3.6/ intel/ 3.6/
module load r/3.6.1-intelto load the Intel version.
- After starting R, use
.libPaths(c("~/R/intel/3.6/"))to set your environment to use this folder.
- If you run
.libPaths()you should see something of the form:
- If you run
> .libPaths()  "/pfs/tsfs1/home/salexan5/R/intel/3.6"  "/pfs/tsfs1/apps/el7-x86_64/u/opt/R/3.6.1/intel/R-3.6.1/library"
- Install packages as normal e.g.
install.packages("<the package's name>")
- When running your R scripts you need to set
.libPaths(c("~/R/intel/3.6/"))before loading any libraries to inform R where the appropriate packages can be found.
- Note: Currently R Package: RStan can not be installed using the intel version.
Installing Packages: Potential Problems
Trying to install
install.packages("labdsv") resulted in the following error:
/apps/u/gcc/4.8.5/intel/18.0.1-7cbw2rp/include/complex(77): error #308: member "std::complex<float>::_M_value" (declared at line 1187 of "/usr/include/c++/4.8.5/complex") is inaccessible _M_value = __z._M_value; ... compilation aborted for sptree.cpp (code 2) make: *** [sptree.o] Error 2 ERROR: compilation failed for package ‘Rtsne’ * removing ‘/pfs/tsfs1/home/salexan5/R/intel/3.6/Rtsne’ ERROR: dependency ‘Rtsne’ is not available for package ‘labdsv’ * removing ‘/pfs/tsfs1/home/salexan5/R/intel/3.6/labdsv’
This appears to be a reasonably common problem:
- Installing R `forecast` package on a Linux Cluster: compiler issues?
- CHPC Univ of Utah: R: Potential Problems
and is essentially a result of conflicts between compilers when using complex data types with the work around of disabling the diagnostic error.
To resolve the issue, create and/or update the
~/.R/Makevars file by adding the following lines:
CFLAGS += -wd308 CXXFLAGS += -wd308 CPPFLAGS += -wd308 PKG_CFLAGS += -wd308 PKG_CXXFLAGS += -wd308 PKG_CPPFLAGS += -wd308
Back to HPC Installed Software