Child pages
  • Mox_Rstan
Skip to end of metadata
Go to start of metadata

Below xyz is your hyak group and abc is your hyak userid.

(1) Get a build node:

srun -p build --time=2:00:00 --pty /bin/bash

(2) Enable g++ and gcc 6.3:

cd /opt/rh/devtoolset-6
source enable

(3) Remove old .RData and .R


cp -r .Rdata .Rdata_old

cp -r .R .R_old
rm -rf .RData
rm -rf .R

(4) Create the .R directory and cd to it:

mkdir .R
cd .R

Inside the .R directory, create a file called Makevars and put the below two lines in the file.

CXX14FLAGS=-O3 -march=native -mtune=native
CXX14=g++ -std=c++14

(5) Create R source code download directory and  R install directory.

(Below instructions are for R 3.5.1. You can change 3.5.1 to a later version of R.)

mkdir /gscratch/xyz/abc/rinstall3.5.1

mkdir /gscratch/xyz/abc/rstuff3.5.1
(6) Download R source code.

cd /gscratch/xyz/abc/rstuff3.5.1

(7) Untar source code tar.gz file.

cd /gscratch/xyz/abc/rstuff3.5.1

tar -xvf R-3.5.1.tar.gz

(8) Compile source code and install R.

cd /gscratch/xyz/abc/rstuff3.5.1
cd R-3.5.1
./configure --prefix=/gscratch/xyz/abc/rinstall3.5.1
make install

(9) Below command is run so that R can find .

module load icc_19

(10) Add the location of the installed R to your PATH

export PATH=/gscratch/xyz/abc/rinstall3.5.1/bin:$PATH

(11) Start R and install rstan.


(Below command will ask you to choose a R mirror. Choose the US(Oregon) mirror.)

install.packages("rstan", type = "source")

  • No labels