Difference between revisions of "BwUniCluster2.0/Software/R/Rjags"
< BwUniCluster2.0 | Software | R
(Created page with "= Installation instructions = Consider starting an interactive job for compiling. Just copy paste this to your shell (please only copy line by line so you see errors fast). ...") |
(→Installation instructions) |
||
Line 1: | Line 1: | ||
− | = Installation instructions = |
+ | = Installation instructions: JAGS build using Intel Compiler & Intel MKL = |
+ | Requirements: R >= 3.4.4, Intel compiler >= 17.0, Intel MKL >= 2017 |
||
− | Consider starting an interactive job for compiling. Just copy paste this to your shell (please only copy line by line so you see errors fast). |
||
+ | |||
+ | Consider starting an interactive job for compiling. Copy and paste the following to your shell. |
||
<pre> |
<pre> |
||
− | module load math/R |
+ | 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 |
mkdir -p ~/src |
||
cd ~/src |
cd ~/src |
||
− | # copy the JAGS-4.3.0.tar.gz here |
||
− | # |
+ | # 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 |
tar xf JAGS-4.3.0.tar.gz |
||
cd JAGS-4.3.0 |
cd JAGS-4.3.0 |
||
+ | |||
− | ./configure --prefix=$HOME/sw |
||
+ | # Build JAGS |
||
− | make -j4 |
||
+ | 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 |
make install |
||
− | cd |
+ | cd |
− | # Set up environment |
+ | # Set up environment |
− | export |
+ | export PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig |
− | export |
+ | export LD_RUN_PATH=$JAGS_HOME/lib |
− | export MANPATH=$MANPATH:$HOME/sw/man |
||
− | export CFLAGS=-I$HOME/sw/include |
||
− | export JAGS_LIBDIR=~/sw/lib |
||
# Install rjags package from within R session |
# Install rjags package from within R session |
||
R -q |
R -q |
||
− | install.packages("rjags") |
+ | install.packages("rjags", configure.args="--enable-rpath") |
− | library("rjags") |
||
</pre> |
</pre> |
Revision as of 20:36, 18 October 2018
Installation instructions: JAGS build using Intel Compiler & Intel MKL
Requirements: R >= 3.4.4, 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")