Difference between revisions of "BwUniCluster2.0/Software/R/Rjags"

From bwHPC Wiki
Jump to: navigation, search
(Installation instructions: JAGS build using Intel Compiler & Intel MKL)
(Installation instructions: JAGS build using Intel Compiler & Intel MKL)
Line 6: Line 6:
   
 
<pre>
 
<pre>
  +
# Load the R software module, e.g.
module load math/R/3.5.1
 
  +
module load math/R/3.6.3
   
 
# Check compiler and MKL version (see, requirements)
 
# Check compiler and MKL version (see, requirements)
Line 24: Line 25:
   
 
# Build JAGS
 
# Build JAGS
export CFLAGS="-O3 -fPIC -fp-model strict -qopenmp -xHost"
+
export CFLAGS="-O3 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp"
export CXXFLAGS="-O3 -fPIC -std=c++11 -fp-model strict -qopenmp -xHost"
+
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"
 
./configure --prefix=$JAGS_HOME --with-blas="-lmkl_rt -lpthread -lm"
 
make -j8
 
make -j8

Revision as of 13:14, 31 March 2021

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")