R package installation guide

A guide for installing certain R packages using the modules available on CARC systems.

The following instructions are based on the R 4.2.1 module:

module purge
module load gcc/11.3.0
module load openblas/0.3.20
module load r/4.2.1

Older R versions may require different steps.

R packages

XML

module load pkgconf libxml2 xz libiconv

And install:

install.packages("XML")

openssl

module load openssl

And install:

install.packages("openssl")

curl

module load curl

And install:

install.packages("curl")

RCurl

module load curl libxml2

And install:

install.packages("RCurl")

systemfonts

module unload pkgconf
module load fontconfig freetype libxml2

And install:

install.packages("systemfonts")

png

module load libpng

And install:

install.packages("png")

jpeg

module load libjpeg
export JPEG_CFLAGS=-I$LIBJPEG_ROOT/include
export JPEG_LIBS=-L$LIBJPEG_ROOT/lib

And install:

install.packages("jpeg")

ncdf4

module load openmpi/4.1.4 netcdf-c

And install:

install.packages("ncdf4")

bigmemory

Modify ~/.R/Makevars to include:

CPPFLAGS = -I${LIBUUID_ROOT}/include
LDFLAGS = -L${LIBUUID_ROOT}/lib

Then:

module load libuuid

And install:

install.packages("bigmemory")

gurobi

module load gurobi/9.5.2

And install:

install.packages("slam")
install.packages("/spack/generic/gurobi/9.5.2/R/gurobi_9.5-2_R_4.2.0.tar.gz", repos = NULL)

Bioconductor packages

Rhtslib

Modify ~/.R/Makevars to include:

CPPFLAGS = -I${BZIP2_ROOT}/include -I${CURL_ROOT}/include
LDFLAGS = -L${BZIP2_ROOT}/lib -L${CURL_ROOT}/lib

Then:

module load bzip2 curl

And install:

BiocManager::install("Rhtslib")