<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bwhpc.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=F+Freund</id>
	<title>bwHPC Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bwhpc.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=F+Freund"/>
	<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/e/Special:Contributions/F_Freund"/>
	<updated>2026-04-11T13:38:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Batch_Queues&amp;diff=11054</id>
		<title>BwUniCluster2.0/Batch Queues</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Batch_Queues&amp;diff=11054"/>
		<updated>2022-09-09T12:59:48Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* sbatch -p queue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== sbatch -p &#039;&#039;queue&#039;&#039; ===&lt;br /&gt;
Compute resources such as (wall-)time, nodes and memory are restricted and must fit into &#039;&#039;&#039;queues&#039;&#039;&#039;. Since requested compute resources are NOT always automatically mapped to the correct queue class, &#039;&#039;&#039;you must add the correct queue class to your sbatch command &#039;&#039;&#039;. &amp;lt;font color=red&amp;gt;The specification of a queue is obligatory on BwUniCluster 2.0.&amp;lt;/font&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Details are:&lt;br /&gt;
&lt;br /&gt;
{| width=750px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | bwUniCluster 2.0 &amp;lt;br&amp;gt; sbatch -p &#039;&#039;queue&#039;&#039;&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
! queue !! node !! default resources !! minimum resources !! maximum resources&lt;br /&gt;
|- style=&amp;quot;text-align:left&amp;quot;&lt;br /&gt;
| dev_single&lt;br /&gt;
| thin&lt;br /&gt;
| time=10, mem-per-cpu=1125mb&lt;br /&gt;
| &lt;br /&gt;
| time=30, nodes=1, mem=180000mb, ntasks-per-node=40, (threads-per-core=2)&amp;lt;br&amp;gt;6 nodes are reserved for this queue. &amp;lt;br&amp;gt; Only for development, i.e. debugging or performance optimization ...&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| single&lt;br /&gt;
| thin&lt;br /&gt;
| time=30, mem-per-cpu=1125mb&lt;br /&gt;
| &lt;br /&gt;
| time=72:00:00, nodes=1, mem=180000mb, ntasks-per-node=40, (threads-per-core)=2&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| dev_multiple&lt;br /&gt;
| thin&lt;br /&gt;
| time=10, mem-per-cpu=1125mb&lt;br /&gt;
| nodes=2&lt;br /&gt;
| time=30, nodes=4, mem=90000mb, ntasks-per-node=40, (threads-per-core=2)&amp;lt;br&amp;gt;8 nodes are reserved for this queue.&amp;lt;br&amp;gt; Only for development, i.e. debugging or performance optimization ...&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| multiple&lt;br /&gt;
| thin&lt;br /&gt;
| time=30, mem-per-cpu=1125mb&lt;br /&gt;
| nodes=2&lt;br /&gt;
| time=72:00:00, mem=90000mb, nodes=128, ntasks-per-node=40, (threads-per-core=2) &lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| dev_multiple_e&lt;br /&gt;
| thin (Broadwell)&lt;br /&gt;
| time=10, mem-per-cpu=2178mb&lt;br /&gt;
| nodes=2&lt;br /&gt;
| time=30, nodes=8, mem=122000, ntasks-per-node=28, (threads-per-core=2)&amp;lt;br&amp;gt;8 nodes are reserved for this queue &amp;lt;br&amp;gt; Only for development, i.e. debugging or performance optimization ...&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| multiple_e&lt;br /&gt;
| thin (Broadwell)&lt;br /&gt;
| time=10, mem-per-cpu=2178mb&lt;br /&gt;
| nodes=2&lt;br /&gt;
| time=72:00:00, nodes=128, mem=122000mb, ntasks-per-node=28, (threads-per-core=2)&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| dev_special&amp;lt;br/&amp;gt;(&amp;lt;i&amp;gt;restricted access!&amp;lt;/i&amp;gt;)&lt;br /&gt;
| thin (Broadwell)&lt;br /&gt;
| time=10, mem-per-cpu=2178mb&lt;br /&gt;
| &lt;br /&gt;
| time=30, nodes=1, mem=122000mb, ntasks-per-node=28, (threads-per-core=2)&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| special&amp;lt;br/&amp;gt;(&amp;lt;i&amp;gt;restricted access!&amp;lt;/i&amp;gt;)&lt;br /&gt;
| thin (Broadwell)&lt;br /&gt;
| time=10, mem-per-cpu=2178mb&lt;br /&gt;
| &lt;br /&gt;
| time=72:00:00, nodes=1, mem=122000mb, ntasks-per-node=28, (threads-per-core=2)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top; text-align:left&amp;quot;&lt;br /&gt;
| fat &lt;br /&gt;
| fat&lt;br /&gt;
| time=10, mem-per-cpu=18750mb&lt;br /&gt;
| mem=180001mb&lt;br /&gt;
| time=72:00:00, nodes=1, ntasks-per-node=80, (threads-per-core=2)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top; text-align:left&amp;quot;&lt;br /&gt;
| dev_gpu_4&lt;br /&gt;
| gpu_4&lt;br /&gt;
| time=10, mem-per-gpu=94000mb, cpu-per-gpu=20&lt;br /&gt;
| &lt;br /&gt;
| time=30, nodes=1, mem=376000, ntasks-per-node=40, (threads-per-core=2)&amp;lt;br&amp;gt;1 node is reserved for this queue &amp;lt;br&amp;gt; Only for development, i.e. debugging or performance optimization ...&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
| gpu_4&lt;br /&gt;
| gpu4&lt;br /&gt;
| time=10, mem-per-gpu=94000mb, cpu-per-gpu=20&lt;br /&gt;
| &lt;br /&gt;
| time=48:00:00, mem=376000, nodes=14, ntasks-per-node=40, (threads-per-core=2)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top; text-align:left&amp;quot;&lt;br /&gt;
| gpu_8&lt;br /&gt;
| gpu8&lt;br /&gt;
| time=10, mem-per-cpu=94000mb, cpu-per-gpu=10&lt;br /&gt;
|&lt;br /&gt;
| time=48:00:00, mem=752000, nodes=10, ntasks-per-node=40, (threads-per-core=2)&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default resources of a queue class defines time, #tasks and memory if not explicitly given with sbatch command. Resource list acronyms &#039;&#039;--time&#039;&#039;, &#039;&#039;--ntasks&#039;&#039;, &#039;&#039;--nodes&#039;&#039;, &#039;&#039;--mem&#039;&#039; and &#039;&#039;--mem-per-cpu&#039;&#039; are described [[BwUniCluster_2.0_Slurm_common_Features|here]].&lt;br /&gt;
&lt;br /&gt;
Access to the &amp;quot;special&amp;quot; and &amp;quot;dev_special&amp;quot; partitions on the bwUniCluster 2.0 is restricted to members of the institutions which participated in the procurement of the extension partition specifically for this purpose. Please contact the support team if your institution participated in the procurement and your account should be able to run jobs in this partition.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Queue class examples ====&lt;br /&gt;
To run your batch job on one of the thin nodes, please use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sbatch --partition=dev_multiple&lt;br /&gt;
     or &lt;br /&gt;
$ sbatch -p dev_multiple&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Interactive Jobs ====&lt;br /&gt;
On bwUniCluster 2.0 you are only allowed to run short jobs (&amp;lt;&amp;lt; 1 hour) with little memory requirements (&amp;lt;&amp;lt; 8 GByte) on the logins nodes. If you want to run longer jobs and/or jobs with a request of more than 8 GByte of memory, you must allocate resources for so-called interactive jobs by usage of the command salloc on a login node. Considering a serial application running on a compute node that requires 5000 MByte of memory and limiting the interactive run to 2 hours the following command has to be executed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ salloc -p single -n 1 -t 120 --mem=5000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you will get one core on a compute node within the partition &amp;quot;single&amp;quot;. After execution of this command &#039;&#039;&#039;DO NOT CLOSE&#039;&#039;&#039; your current terminal session but wait until the queueing system Slurm has granted you the requested resources on the compute system. You will be logged in automatically on the granted core! To run a serial program on the granted core you only have to type the name of the executable.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./&amp;lt;my_serial_program&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please be aware that your serial job must run less than 2 hours in this example, else the job will be killed during runtime by the system. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You can also start now a graphical X11-terminal connecting you to the dedicated resource that is available for 2 hours. You can start it by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ xterm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, once the walltime limit has been reached the resources - i.e. the compute node - will automatically be revoked.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
An interactive parallel application running on one compute node or on many compute nodes (e.g. here 5 nodes) with 40 cores each requires usually an amount of memory in GByte (e.g. 50 GByte) and a maximum time (e.g. 1 hour). E.g. 5 nodes can be allocated by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ salloc -p multiple -N 5 --ntasks-per-node=40 -t 01:00:00  --mem=50gb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now you can run parallel jobs on 200 cores requiring 50 GByte of memory per node. Please be aware that you will be logged in on core 0 of the first node.&lt;br /&gt;
If you want to have access to another node you have to open a new terminal, connect it also to BwUniCluster 2.0 and type the following commands to&lt;br /&gt;
connect to the running interactive job and then to a specific node:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ srun --jobid=XXXXXXXX --pty /bin/bash&lt;br /&gt;
$ srun --nodelist=uc2nXXX --pty /bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ squeue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the jobid and the nodelist can be shown.&lt;br /&gt;
&lt;br /&gt;
If you want to run MPI-programs, you can do it by simply typing mpirun &amp;lt;program_name&amp;gt;. Then your program will be run on 200 cores. A very simple example for starting a parallel job can be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun &amp;lt;my_mpi_program&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also start the debugger ddt by the commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module add devel/ddt&lt;br /&gt;
$ ddt &amp;lt;my_mpi_program&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above commands will execute the parallel program &amp;lt;my_mpi_program&amp;gt; on all available cores. You can also start parallel programs on a subset of cores; an example for this can be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mpirun -n 50 &amp;lt;my_mpi_program&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are using Intel MPI you must start &amp;lt;my_mpi_program&amp;gt; by the command mpiexec.hydra (instead of mpirun).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:bwUniCluster 2.0|Batch Jobs - bwUniCluster 2.0 Features]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10441</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10441"/>
		<updated>2022-07-06T06:54:20Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly in your shell/command line on bwUniCluster &lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following block of five commands. If this is not the case, enter the following commands in your shell (command line).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at most 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10440</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10440"/>
		<updated>2022-07-06T06:52:41Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Preparations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster &lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following five command block. If this is not the case, enter the following commands on your shell (command line).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at least 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rgdal&amp;diff=10392</id>
		<title>BwUniCluster2.0/Software/R/Rgdal</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rgdal&amp;diff=10392"/>
		<updated>2022-06-23T14:01:24Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Preparations to use the rgdal/rgeos packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= General information =&lt;br /&gt;
&lt;br /&gt;
Installation of rgdal and rgeos allows to use the following tools for handling spatial structures in R&lt;br /&gt;
 &lt;br /&gt;
* the &#039;Geospatial&#039; Data Abstraction Library [https://gdal.org/ GDAL] &lt;br /&gt;
* Projection/transformation operations from the [https://proj.org/ PROJ] library&lt;br /&gt;
* Interface to the open source Geometry Engine [https://libgeos.org/ GEOS]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster.&lt;br /&gt;
&lt;br /&gt;
== Install external programs ==&lt;br /&gt;
&lt;br /&gt;
First, we download the sources of GDAL, PROJ, GEOS and install the three programs.&lt;br /&gt;
&lt;br /&gt;
We will gather them in a folder src, unpack there and then compile.&lt;br /&gt;
&lt;br /&gt;
We strongly recommend to use a interactive session with multiple cores.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -n 4 -t 30 -p dev_single&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First, provide the source directory (if not yet existing)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/src&lt;br /&gt;
cd ~/src&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, download and install PROJ&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROJ_VER=6.3.2&lt;br /&gt;
wget http://download.osgeo.org/proj/proj-$PROJ_VER.tar.gz&lt;br /&gt;
tar xf proj-$PROJ_VER.tar.gz&lt;br /&gt;
cd proj-$PROJ_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R&lt;br /&gt;
make -j 8 &lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, install gdal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GDAL_VER=3.4.1&lt;br /&gt;
wget http://download.osgeo.org/gdal/$GDAL_VER/gdal-$GDAL_VER.tar.gz&lt;br /&gt;
tar xf gdal-$GDAL_VER.tar.gz&lt;br /&gt;
cd gdal-$GDAL_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R --with-proj=$HOME/sw/R&lt;br /&gt;
make -j 8&lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, install GEOS&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GEOS_VER=3.9.2&lt;br /&gt;
wget http://download.osgeo.org/geos/geos-$GEOS_VER.tar.bz2&lt;br /&gt;
tar xf geos-$GEOS_VER.tar.bz2&lt;br /&gt;
cd geos-$GEOS_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R&lt;br /&gt;
make -j 8 &lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R packages ==&lt;br /&gt;
&lt;br /&gt;
In order to install the two R packages, we need R to understand where we installed the 3 underlying programs, so we export the necessary paths. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export LD_LIBRARY_PATH=$HOME/sw/R/lib:$LD_LIBRARY_PATH&lt;br /&gt;
export PATH=$PATH:$HOME/sw/R/bin&lt;br /&gt;
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/sw/R/lib/pkgconfig&lt;br /&gt;
export GDAL_DATA=$HOME/sw/R/share/gdal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, the R package installation features compilation of built-in C++ code, for which we specify compilation options (&#039;compiler flags&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CFLAGS=-I$HOME/sw/R/include&lt;br /&gt;
export CXX=&amp;quot;icpc -std=c++11&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, we install rgdal and rgeos from within R&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rgdal&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rgeos&amp;quot;)&lt;br /&gt;
&amp;gt; library(&amp;quot;rgdal&amp;quot;)&lt;br /&gt;
&amp;gt; library(&amp;quot;rgeos&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparations to use the rgdal/rgeos packages ==&lt;br /&gt;
Since rgdal and rgeos depend on the external programs we installed, several environment variables have to be set before using the packages to allow R to address these programs.&lt;br /&gt;
&lt;br /&gt;
We recommend to add the export commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export LD_LIBRARY_PATH=$HOME/sw/R/lib:$LD_LIBRARY_PATH&lt;br /&gt;
export PATH=$PATH:$HOME/sw/R/bin&lt;br /&gt;
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/sw/R/lib/pkgconfig&lt;br /&gt;
export GDAL_DATA=$HOME/sw/R/share/gdal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rgdal and rgeos or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rgdal&amp;diff=10391</id>
		<title>BwUniCluster2.0/Software/R/Rgdal</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rgdal&amp;diff=10391"/>
		<updated>2022-06-23T13:59:39Z</updated>

		<summary type="html">&lt;p&gt;F Freund: Installation of rgdal/rgeos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= General information =&lt;br /&gt;
&lt;br /&gt;
Installation of rgdal and rgeos allows to use the following tools for handling spatial structures in R&lt;br /&gt;
 &lt;br /&gt;
* the &#039;Geospatial&#039; Data Abstraction Library [https://gdal.org/ GDAL] &lt;br /&gt;
* Projection/transformation operations from the [https://proj.org/ PROJ] library&lt;br /&gt;
* Interface to the open source Geometry Engine [https://libgeos.org/ GEOS]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster.&lt;br /&gt;
&lt;br /&gt;
== Install external programs ==&lt;br /&gt;
&lt;br /&gt;
First, we download the sources of GDAL, PROJ, GEOS and install the three programs.&lt;br /&gt;
&lt;br /&gt;
We will gather them in a folder src, unpack there and then compile.&lt;br /&gt;
&lt;br /&gt;
We strongly recommend to use a interactive session with multiple cores.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -n 4 -t 30 -p dev_single&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First, provide the source directory (if not yet existing)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/src&lt;br /&gt;
cd ~/src&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, download and install PROJ&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROJ_VER=6.3.2&lt;br /&gt;
wget http://download.osgeo.org/proj/proj-$PROJ_VER.tar.gz&lt;br /&gt;
tar xf proj-$PROJ_VER.tar.gz&lt;br /&gt;
cd proj-$PROJ_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R&lt;br /&gt;
make -j 8 &lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, install gdal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GDAL_VER=3.4.1&lt;br /&gt;
wget http://download.osgeo.org/gdal/$GDAL_VER/gdal-$GDAL_VER.tar.gz&lt;br /&gt;
tar xf gdal-$GDAL_VER.tar.gz&lt;br /&gt;
cd gdal-$GDAL_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R --with-proj=$HOME/sw/R&lt;br /&gt;
make -j 8&lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, install GEOS&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GEOS_VER=3.9.2&lt;br /&gt;
wget http://download.osgeo.org/geos/geos-$GEOS_VER.tar.bz2&lt;br /&gt;
tar xf geos-$GEOS_VER.tar.bz2&lt;br /&gt;
cd geos-$GEOS_VER&lt;br /&gt;
./configure --prefix=$HOME/sw/R&lt;br /&gt;
make -j 8 &lt;br /&gt;
make install&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R packages ==&lt;br /&gt;
&lt;br /&gt;
In order to install the two R packages, we need R to understand where we installed the 3 underlying programs, so we export the necessary paths. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export LD_LIBRARY_PATH=$HOME/sw/R/lib:$LD_LIBRARY_PATH&lt;br /&gt;
export PATH=$PATH:$HOME/sw/R/bin&lt;br /&gt;
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/sw/R/lib/pkgconfig&lt;br /&gt;
export GDAL_DATA=$HOME/sw/R/share/gdal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, the R package installation features compilation of built-in C++ code, for which we specify compilation options (&#039;compiler flags&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CFLAGS=-I$HOME/sw/R/include&lt;br /&gt;
export CXX=&amp;quot;icpc -std=c++11&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, we install rgdal and rgeos from within R&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rgdal&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rgeos&amp;quot;)&lt;br /&gt;
&amp;gt; library(&amp;quot;rgdal&amp;quot;)&lt;br /&gt;
&amp;gt; library(&amp;quot;rgeos&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparations to use the rgdal/rgeos packages ==&lt;br /&gt;
Since rgdal and rgeos depend on the external programs we installed, we recommend to add the export commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export LD_LIBRARY_PATH=$HOME/sw/R/lib:$LD_LIBRARY_PATH&lt;br /&gt;
export PATH=$PATH:$HOME/sw/R/bin&lt;br /&gt;
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/sw/R/lib/pkgconfig&lt;br /&gt;
export GDAL_DATA=$HOME/sw/R/share/gdal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rgdal and rgeos or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10390</id>
		<title>BwUniCluster2.0/Software/R/Rjags</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10390"/>
		<updated>2022-06-23T13:53:18Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= General information =&lt;br /&gt;
&lt;br /&gt;
rjags is a R interface to use JAGS, [https://mcmc-jags.sourceforge.io/ Just another Gibbs Sampler]. JAGS is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation&lt;br /&gt;
&lt;br /&gt;
rjags needs a JAGS installation on the side. We recommend to compile via Intel compiler and with the Intel MKL library (Intel Math Kernel Library), which allows JAGS to use various efficient implementations of mathematical computations. These are, as of now, loaded alongside with the module R 4.1.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Load R module&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set up JAGS installation directory &lt;br /&gt;
export JAGS_HOME=$HOME/sw/jags&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Prepare JAGS source directory (if not yet existing) &lt;br /&gt;
mkdir -p ~/src&lt;br /&gt;
cd ~/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Get JAGS source&lt;br /&gt;
wget https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.1.tar.gz&lt;br /&gt;
tar xf JAGS-4.3.1.tar.gz&lt;br /&gt;
cd JAGS-4.3.1&lt;br /&gt;
rm JAGS-4.3.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install JAGS &lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;-O3  -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
./configure  --prefix=$JAGS_HOME --with-blas=&amp;quot;-lmkl_rt -lpthread -lm&amp;quot;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
cd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set up environment&lt;br /&gt;
export PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig&lt;br /&gt;
export LD_RUN_PATH=$JAGS_HOME/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install rjags package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rjags&amp;quot;, configure.args=&amp;quot;--enable-rpath&amp;quot;)&lt;br /&gt;
&amp;gt; library(rjags)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10389</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10389"/>
		<updated>2022-06-23T13:52:36Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* General information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster &lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following five command block&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at least 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10388</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10388"/>
		<updated>2022-06-23T13:51:50Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Please enter the following code, presented in the boxes below, directly into your shell/command line on bwUniCluster &lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following five command block&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at least 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10387</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10387"/>
		<updated>2022-06-23T11:44:00Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following five command block&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at least 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10386</id>
		<title>BwUniCluster2.0/Software/R/Rstan</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rstan&amp;diff=10386"/>
		<updated>2022-06-23T11:41:54Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Installation instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
&lt;br /&gt;
rstan provides the R interface for [https://mc-stan.org/ Stan], a platform for statistical modeling and high-performance statistical computation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be compatible with our R installation, we recommend to install the development version of rstan.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
== Preparations ==&lt;br /&gt;
Prepare .R directory (if it does not already exists). This is then filled with information how R should compile the packages (&#039;compilation flags&#039;). These are written (and can be reviewed) into the (text) file Makevars. &lt;br /&gt;
&lt;br /&gt;
If you already have a .R/Makevars file, check whether these flags are already set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, skip the following five command block&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -wd308 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;PKG_CXXFLAGS += -std=c++14 -wd308&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installation of rstan and its dependencies makes use other libraries (TBB, Threading Building Blocks) which need to be loaded before installation (and R, of course).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module purge 	&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### 3a. Setting building environment &lt;br /&gt;
The installation process of rstan and its dependencies (Rcpp) needs input of how to use the TBB module. This is provided via specific environment variables. We also need to provide a further configuration information to install the R package v8 rstan depends on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
export DOWNLOAD_STATIC_LIBV8=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the R package(s) [takes roughly 20 min] ==&lt;br /&gt;
We can now install rstan (in its development version) and its dependencies within a R session&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. You need at least 5000MB total memory, e.g. start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
salloc -t 30 -n 1 --mem=5000 -p dev_single &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, start R and install &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;remotes&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;RcppParallel&amp;quot;)&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;V8&amp;quot;)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/StanHeaders@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;gt; remotes::install_github(&amp;quot;hsbadr/rstan/rstan/rstan@develop&amp;quot;, force = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the installation == &lt;br /&gt;
&lt;br /&gt;
To check whether the installation worked, make a test run in R&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library(rstan)&lt;br /&gt;
&amp;gt; example(stan_model, package = &amp;quot;rstan&amp;quot;, run.dontrun = TRUE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Preparations to use the rstan package = &lt;br /&gt;
To run its applications, rstan compiles new scripts. For this, it again uses TBB, so you need to set the corresponding environment variables whenever you use rstan - as well as to load the R and TBB modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this, we recommend to add the modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
module load devel/tbb/2021.4.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
as well as the three export commands &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export TBB_LIB=$TBB_LIB_DIR&lt;br /&gt;
export TBB_INC=$TBB_INC_DIR&lt;br /&gt;
export TBB_INTERFACE_NEW=&#039;true&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to your [[BwUniCluster_2.0_Slurm_common_Features#sbatch_Examples | batch job scripts]] that use rstan or to run them directly in the command line if you use an [[BwUniCluster_2.0_Batch_Queues | interactive session]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10385</id>
		<title>BwUniCluster2.0/Software/R/Glmnet</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10385"/>
		<updated>2022-06-23T10:19:25Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Installation instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
glmnet is a R library for lasso and elastic-net regularized generalized linear models&lt;br /&gt;
&lt;br /&gt;
= Installation instructions =&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. Copy and paste the following to your shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Load the R software module, e.g.&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
# Prepare .R directory (if it does not already exists)&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
&lt;br /&gt;
# Write the following environment variables to Makevars&lt;br /&gt;
# Skip the 2nd and 3rd commands below if Makevars already consist these variables (1st command shows content of Makevars)&lt;br /&gt;
cat ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&lt;br /&gt;
# Install the glmnet package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;glmnet&amp;quot;, dependencies=TRUE)&lt;br /&gt;
&lt;br /&gt;
# Run a quick test&lt;br /&gt;
&amp;gt; library(glmnet)&lt;br /&gt;
&amp;gt; data(QuickStartExample)&lt;br /&gt;
&amp;gt; x &amp;lt;- QuickStartExample$x&lt;br /&gt;
&amp;gt; y &amp;lt;- QuickStartExample$y&lt;br /&gt;
&amp;gt; fit &amp;lt;- glmnet(x, y)&lt;br /&gt;
&amp;gt; print(fit)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10383</id>
		<title>BwUniCluster2.0/Software/R/Rjags</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10383"/>
		<updated>2022-06-23T10:06:02Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= General information =&lt;br /&gt;
&lt;br /&gt;
rjags is a R interface to use JAGS, [https://mcmc-jags.sourceforge.io/ Just another Gibbs Sampler]. JAGS is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation&lt;br /&gt;
&lt;br /&gt;
rjags needs a JAGS installation on the side. We recommend to compile via Intel compiler and with the Intel MKL library (Intel Math Kernel Library), which allows JAGS to use various efficient implementations of mathematical computations. These are, as of now, loaded alongside with the module R 4.1.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Load R module&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set up JAGS installation directory &lt;br /&gt;
export JAGS_HOME=$HOME/sw/jags&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Prepare JAGS source directory (if not yet existing) &lt;br /&gt;
mkdir -p ~/src&lt;br /&gt;
cd ~/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Get JAGS source&lt;br /&gt;
wget https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.1.tar.gz&lt;br /&gt;
tar xf JAGS-4.3.1.tar.gz&lt;br /&gt;
cd JAGS-4.3.1&lt;br /&gt;
rm JAGS-4.3.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install JAGS &lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;-O3  -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
./configure  --prefix=$JAGS_HOME --with-blas=&amp;quot;-lmkl_rt -lpthread -lm&amp;quot;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
cd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set up environment&lt;br /&gt;
export PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig&lt;br /&gt;
export LD_RUN_PATH=$JAGS_HOME/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install rjags package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rjags&amp;quot;, configure.args=&amp;quot;--enable-rpath&amp;quot;)&lt;br /&gt;
&amp;gt; library(rjags)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10382</id>
		<title>BwUniCluster2.0/Software/R/Rjags</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Rjags&amp;diff=10382"/>
		<updated>2022-06-23T10:04:55Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= General information =&lt;br /&gt;
&lt;br /&gt;
rjags is a R interface to use JAGS, [https://mcmc-jags.sourceforge.io/ Just another Gibbs Sampler]. JAGS is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation&lt;br /&gt;
&lt;br /&gt;
rjags needs a JAGS installation on the side. We recommend to compile via Intel compiler and with the Intel MKL library (Intel Math Kernel Library), which allows JAGS to use various efficient implementations of mathematical computations. These are, as of now, loaded alongside with the module R 4.1.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Load R module&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
# Set up JAGS installation directory &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
export JAGS_HOME=$HOME/sw/jags&lt;br /&gt;
&lt;br /&gt;
# Prepare JAGS source directory (if not yet existing) &lt;br /&gt;
&lt;br /&gt;
mkdir -p ~/src&lt;br /&gt;
cd ~/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Get JAGS source&lt;br /&gt;
&lt;br /&gt;
wget https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.1.tar.gz&lt;br /&gt;
tar xf JAGS-4.3.1.tar.gz&lt;br /&gt;
cd JAGS-4.3.1&lt;br /&gt;
rm JAGS-4.3.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install JAGS &lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;-O3  -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot;&lt;br /&gt;
./configure  --prefix=$JAGS_HOME --with-blas=&amp;quot;-lmkl_rt -lpthread -lm&amp;quot;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
cd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set up environment&lt;br /&gt;
export PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig&lt;br /&gt;
export LD_RUN_PATH=$JAGS_HOME/lib&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Install rjags package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;rjags&amp;quot;, configure.args=&amp;quot;--enable-rpath&amp;quot;)&lt;br /&gt;
&amp;gt; library(rjags)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R&amp;diff=10379</id>
		<title>BwUniCluster2.0/Software/R</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R&amp;diff=10379"/>
		<updated>2022-06-23T09:33:06Z</updated>

		<summary type="html">&lt;p&gt;F Freund: /* Optional packages for R */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Softwarepage|math/R}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/R&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| GPL&lt;br /&gt;
|-&lt;br /&gt;
| Citing &lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [http://www.r-project.org/ Homepage] &amp;amp;#124; [http://cran.r-project.org/manuals.html  Documentation]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| Plugins&lt;br /&gt;
| User dependent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;R&#039;&#039;&#039; is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&amp;amp;T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.&lt;br /&gt;
&lt;br /&gt;
R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.&lt;br /&gt;
&lt;br /&gt;
One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.&lt;br /&gt;
&lt;br /&gt;
R is available as Free Software under the terms of the Free Software Foundation’s GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and MacOS.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
The R installation also provides the standalone library libRmath. This library allows you to access R routines from your own C or C++ programs (see section 9 of the &#039;R Installation and Administration&#039; manual).&lt;br /&gt;
&lt;br /&gt;
== Installing R-Packages into your home folder ==&lt;br /&gt;
Since we cannot provide a software module for every R package, we recommend to install special R packages locally into your home folder. One possibility doing this is from within an interactive R session: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library()                                                                # List preinstalled packages&lt;br /&gt;
&amp;gt; install.packages(&#039;package_name&#039;, repos=&amp;quot;http://cran.r-project.org&amp;quot;)      # Installing your R package and the dependencies &lt;br /&gt;
&amp;gt; library(package_name)                                                    # Loading the package into you R instance&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package is now installed permanently in your home folder and is available every time you start R. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default R uses a version (and platform) specific path for personal libraries, such as &lt;br /&gt;
&amp;quot;$HOME/R/x86_64-pc-linux-gnu-library/x.y&amp;quot; for R version x.y.z. This directory will be created automatically (after confirmation) when installing a personal package for the first time.&lt;br /&gt;
&lt;br /&gt;
Users can customize a common location of their personal library packages, e.g. ~/R_libs, rather than the default location. A customized directory must exist before installing a personal package for the first time, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir -p ~/R_libs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The location must also be defined in a configuration file ~/.Renviron within the home directory containing the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R_LIBS_USER=&amp;quot;~/R_libs&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By setting up a (fixed) custom location for personal library packages, any personal package installed into that directory will be visible across different R versions. This may be advantageous if the packages are to be used with different (future) R versions. &lt;br /&gt;
&lt;br /&gt;
A version specific path, such as the default path, allows users to maintain multiple personal library stacks for different (major and minor) R versions and does also prevent users from mixing their stack with libraries built with different R versions. &lt;br /&gt;
&lt;br /&gt;
The drawback is that, whenever switching to a new R release, the personal library stack &#039;&#039;&#039;must&#039;&#039;&#039; be rebuilt with that new R version into the corresponding (version specific) library path. This is considered good practice anyway in order to ensure a consistent personal library stack for any specific R version in use. Mixing libraries built with different major and minor R versions is discouraged, as this may (or may not) result in unpredictable and subtle errors. Packages that are built and installed with one version of R may be incompatible with a newer version of R, at least when the major or minor version changes. The same is true if several versions are used simultaneously, e.g. a newer R version for a more recently started project and and older version for another project (but eventually picking up libraries built with the newer R version).&lt;br /&gt;
&lt;br /&gt;
Special care has also to be taken by users who always load the default version, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load math/R&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
as the default version number may change any time. Is is therefore highly recommended to always load a specific version, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load math/R/3.6.3&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Pre-installed R-packages ==&lt;br /&gt;
* Rmpi&lt;br /&gt;
* iterators&lt;br /&gt;
* foreach&lt;br /&gt;
* doMPI&lt;br /&gt;
* doParallel&lt;br /&gt;
* [[CummeRbund_(R-package)|&#039;&#039;Bioinformatics&#039;&#039;: cummeRbund]]&lt;br /&gt;
&lt;br /&gt;
== Optional packages for R ==&lt;br /&gt;
&lt;br /&gt;
The following guides provide detailed instructions about how to build selected optional R packages on &#039;&#039;&#039;bwUniCluster&#039;&#039;&#039; for &#039;&#039;&#039;R version 4.1.2&#039;&#039;&#039;. Please write a [https://bw-support.scc.kit.edu/ ticket] if the instructions do not work for you or are outdated.&lt;br /&gt;
&lt;br /&gt;
* [[Rgdal]]&lt;br /&gt;
* [[Rjags]]&lt;br /&gt;
* [[Rstan]]&lt;br /&gt;
* [[glmnet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Mathematics software]]&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;br /&gt;
[[Category:BwForCluster_BinAC]]&lt;br /&gt;
[[Category:BwForCluster_MLS&amp;amp;WISO_Production]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10378</id>
		<title>BwUniCluster2.0/Software/R/Glmnet</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10378"/>
		<updated>2022-06-22T11:11:48Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
glmnet is a R library for lasso and elastic-net regularized generalized linear models&lt;br /&gt;
&lt;br /&gt;
= Installation instructions =&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. Copy and paste the following to your shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Load the R software module, e.g.&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
# Prepare .R directory (if it does not already exists)&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
&lt;br /&gt;
# Write the following environment variables to Makevars&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&lt;br /&gt;
# Install the glmnet package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;glmnet&amp;quot;, dependencies=TRUE)&lt;br /&gt;
&lt;br /&gt;
# Run a quick test&lt;br /&gt;
&amp;gt; library(glmnet)&lt;br /&gt;
&amp;gt; data(QuickStartExample)&lt;br /&gt;
&amp;gt; x &amp;lt;- QuickStartExample$x&lt;br /&gt;
&amp;gt; y &amp;lt;- QuickStartExample$y&lt;br /&gt;
&amp;gt; fit &amp;lt;- glmnet(x, y)&lt;br /&gt;
&amp;gt; print(fit)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10377</id>
		<title>BwUniCluster2.0/Software/R/Glmnet</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R/Glmnet&amp;diff=10377"/>
		<updated>2022-06-22T11:09:40Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General information =&lt;br /&gt;
glmnet is a R library for lasso and elastic-net regularized generalized linear models&lt;br /&gt;
&lt;br /&gt;
= Installation instructions =&lt;br /&gt;
&lt;br /&gt;
Consider starting an interactive job for compiling. Copy and paste the following to your shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Load the R software module, e.g.&lt;br /&gt;
module load math/R/4.1.2&lt;br /&gt;
&lt;br /&gt;
# Prepare .R directory (if it does not already exists)&lt;br /&gt;
mkdir -p ~/.R&lt;br /&gt;
&lt;br /&gt;
# Write the following environment variables to Makevars&lt;br /&gt;
echo &amp;quot;CXX14=icpc&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
echo &amp;quot;CXX14FLAGS=-O3 -fPIC -std=c++14 -axCORE-AVX512,CORE-AVX2,AVX -xSSE4.2 -fp-model strict -qopenmp&amp;quot; &amp;gt;&amp;gt; ~/.R/Makevars&lt;br /&gt;
&lt;br /&gt;
# Install the glmnet package from within R session&lt;br /&gt;
R -q&lt;br /&gt;
&amp;gt; install.packages(&amp;quot;glmnet&amp;quot;, dependencies=TRUE)&lt;br /&gt;
&lt;br /&gt;
# Run a quick test&lt;br /&gt;
&amp;gt; library(glmnet)&lt;br /&gt;
&amp;gt; data(QuickStartExample)&lt;br /&gt;
&amp;gt; x &amp;lt;- QuickStartExample$x&lt;br /&gt;
&amp;gt; y &amp;lt;- QuickStartExample$y&lt;br /&gt;
&amp;gt; fit &amp;lt;- glmnet(x, y)&lt;br /&gt;
&amp;gt; print(fit)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R&amp;diff=10376</id>
		<title>BwUniCluster2.0/Software/R</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster2.0/Software/R&amp;diff=10376"/>
		<updated>2022-06-22T11:08:17Z</updated>

		<summary type="html">&lt;p&gt;F Freund: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Softwarepage|math/R}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/R&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| GPL&lt;br /&gt;
|-&lt;br /&gt;
| Citing &lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [http://www.r-project.org/ Homepage] &amp;amp;#124; [http://cran.r-project.org/manuals.html  Documentation]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| Plugins&lt;br /&gt;
| User dependent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;R&#039;&#039;&#039; is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&amp;amp;T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.&lt;br /&gt;
&lt;br /&gt;
R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.&lt;br /&gt;
&lt;br /&gt;
One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.&lt;br /&gt;
&lt;br /&gt;
R is available as Free Software under the terms of the Free Software Foundation’s GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and MacOS.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
The R installation also provides the standalone library libRmath. This library allows you to access R routines from your own C or C++ programs (see section 9 of the &#039;R Installation and Administration&#039; manual).&lt;br /&gt;
&lt;br /&gt;
== Installing R-Packages into your home folder ==&lt;br /&gt;
Since we cannot provide a software module for every R package, we recommend to install special R packages locally into your home folder. One possibility doing this is from within an interactive R session: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; library()                                                                # List preinstalled packages&lt;br /&gt;
&amp;gt; install.packages(&#039;package_name&#039;, repos=&amp;quot;http://cran.r-project.org&amp;quot;)      # Installing your R package and the dependencies &lt;br /&gt;
&amp;gt; library(package_name)                                                    # Loading the package into you R instance&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The package is now installed permanently in your home folder and is available every time you start R. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By default R uses a version (and platform) specific path for personal libraries, such as &lt;br /&gt;
&amp;quot;$HOME/R/x86_64-pc-linux-gnu-library/x.y&amp;quot; for R version x.y.z. This directory will be created automatically (after confirmation) when installing a personal package for the first time.&lt;br /&gt;
&lt;br /&gt;
Users can customize a common location of their personal library packages, e.g. ~/R_libs, rather than the default location. A customized directory must exist before installing a personal package for the first time, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir -p ~/R_libs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The location must also be defined in a configuration file ~/.Renviron within the home directory containing the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R_LIBS_USER=&amp;quot;~/R_libs&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By setting up a (fixed) custom location for personal library packages, any personal package installed into that directory will be visible across different R versions. This may be advantageous if the packages are to be used with different (future) R versions. &lt;br /&gt;
&lt;br /&gt;
A version specific path, such as the default path, allows users to maintain multiple personal library stacks for different (major and minor) R versions and does also prevent users from mixing their stack with libraries built with different R versions. &lt;br /&gt;
&lt;br /&gt;
The drawback is that, whenever switching to a new R release, the personal library stack &#039;&#039;&#039;must&#039;&#039;&#039; be rebuilt with that new R version into the corresponding (version specific) library path. This is considered good practice anyway in order to ensure a consistent personal library stack for any specific R version in use. Mixing libraries built with different major and minor R versions is discouraged, as this may (or may not) result in unpredictable and subtle errors. Packages that are built and installed with one version of R may be incompatible with a newer version of R, at least when the major or minor version changes. The same is true if several versions are used simultaneously, e.g. a newer R version for a more recently started project and and older version for another project (but eventually picking up libraries built with the newer R version).&lt;br /&gt;
&lt;br /&gt;
Special care has also to be taken by users who always load the default version, i.e. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load math/R&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
as the default version number may change any time. Is is therefore highly recommended to always load a specific version, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ module load math/R/3.6.3&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Pre-installed R-packages ==&lt;br /&gt;
* Rmpi&lt;br /&gt;
* iterators&lt;br /&gt;
* foreach&lt;br /&gt;
* doMPI&lt;br /&gt;
* doParallel&lt;br /&gt;
* [[CummeRbund_(R-package)|&#039;&#039;Bioinformatics&#039;&#039;: cummeRbund]]&lt;br /&gt;
&lt;br /&gt;
== Optional packages for R ==&lt;br /&gt;
&lt;br /&gt;
The following guides provide detailed instructions about how to build selected optional R packages on &#039;&#039;&#039;bwUniCluster&#039;&#039;&#039;. Please write a [https://bw-support.scc.kit.edu/ ticket] if the instructions do not work for you or are outdated.&lt;br /&gt;
&lt;br /&gt;
* [[Rgdal]]&lt;br /&gt;
* [[Rjags]]&lt;br /&gt;
* [[Rstan]]&lt;br /&gt;
* [[glmnet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Mathematics software]]&lt;br /&gt;
[[Category:BwUniCluster]]&lt;br /&gt;
[[Category:BwUniCluster_2.0]]&lt;br /&gt;
[[Category:BwForCluster_BinAC]]&lt;br /&gt;
[[Category:BwForCluster_MLS&amp;amp;WISO_Production]]&lt;/div&gt;</summary>
		<author><name>F Freund</name></author>
	</entry>
</feed>