<?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-10-01T18:40:49Z</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/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/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>
</feed>