BwUniCluster2.0/Software/R/Rjags

From bwHPC Wiki
< BwUniCluster2.0‎ | Software‎ | R
Revision as of 13:14, 31 March 2021 by J Salk (talk | contribs) (Installation instructions: JAGS build using Intel Compiler & Intel MKL)
Jump to: navigation, 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.

# Load the R software module, e.g.
module load math/R/3.6.3

# 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 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp"
export CXXFLAGS="-O3  -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp"
./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")