BwUniCluster2.0/Software/R/Rjags

From bwHPC Wiki
Jump to navigation Jump to search

Installation instructions: JAGS build using Intel Compiler & Intel MKL

Requirements: R, Intel compiler >= 17.0, Intel MKL >= 2017

Consider starting an interactive job for compiling. Copy and paste the following to your shell.

module load math/R/3.5.1

# Check compiler and MKL version (see, requirements)
module list

# Set up JAGS installation directory
export JAGS_HOME=$HOME/sw/jags

# Prepare JAGS source directory
mkdir -p ~/src
cd ~/src

# Get JAGS
wget https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.0.tar.gz
tar xf JAGS-4.3.0.tar.gz
cd JAGS-4.3.0

# Build JAGS
export CFLAGS="-O3 -fPIC -fp-model strict -qopenmp -xHost"
export CXXFLAGS="-O3 -fPIC -std=c++11 -fp-model strict -qopenmp -xHost"
./configure  --prefix=$JAGS_HOME --with-blas="-lmkl_rt -lpthread -lm"
make -j8
make install
cd

# Set up environment
export PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig
export LD_RUN_PATH=$JAGS_HOME/lib

# Install rjags package from within R session
R -q
install.packages("rjags", configure.args="--enable-rpath")