Hi all, I’m having some difficulty installing Rstan to use on a HPC cluster. I have read a few similar posts from others on this page but nothing has worked so far. I’m struggling to install the ‘RccpParallel’ and ‘StanHeaders’ packages which are dependencies for rstan.
I first use
module add R
to loads R version 4.0.2 and gcc 8.2.0.
After doing
install.packages("rstan", dependencies = TRUE)
I get the following warnings:
1: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘RcppParallel’ had non-zero exit status
2: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘V8’ had non-zero exit status
3: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘StanHeaders’ had non-zero exit status
4: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘rstantools’ had non-zero exit status
5: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘rstan’ had non-zero exit status
6: In install.packages("rstan", dependencies = TRUE) :
installation of package ‘shinystan’ had non-zero exit status
If I focus on installing RcppParallel for instance, I get the following error:
> install.packages("RcppParallel", dependencies = TRUE)
Installing package into ‘/mnt/cephfs/ceph01/site-home/home/d420/d420/ryanchan/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/RcppParallel_5.1.5.tar.gz'
Content type 'application/x-gzip' length 1967672 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
* installing *source* package ‘RcppParallel’ ...
** package ‘RcppParallel’ successfully unpacked and MD5 sums checked
** using staged installation
Rscript execution error: No such file or directory
ERROR: configuration failed for package ‘RcppParallel’
* removing ‘/mnt/cephfs/ceph01/site-home/home/d420/d420/ryanchan/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel’
The downloaded source packages are in
‘/tmp/RtmpzsTS6o/downloaded_packages’
Warning message:
In install.packages("RcppParallel", dependencies = TRUE) :
installation of package ‘RcppParallel’ had non-zero exit status
I’m not sure why I’m getting the Rscript execution error: No such file or directory
error here. If I type
which Rscript
in the terminal, I get
/scratch/sw/R/4.0.2/bin/Rscript
and Rscript
works as a command here too.
[ryanchan@cirrus-login2 ~]$ Rscript
Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]
--options accepted are
--help Print usage and exit
--version Print version and exit
--verbose Print information on progress
--default-packages=list
Where 'list' is a comma-separated set
of package names, or 'NULL'
or options to R, in addition to --no-echo --no-restore, such as
--save Do save workspace at the end of the session
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--restore Do restore previously saved objects at startup
--vanilla Combine --no-save, --no-restore, --no-site-file
--no-init-file and --no-environ
'file' may contain spaces but not shell metacharacters
Expressions (one or more '-e <expr>') may be used *instead* of 'file'
See also ?Rscript from within R
If I look at the errors for installing V8
I have:
* installing *source* package ‘V8’ ...
** package ‘V8’ successfully unpacked and MD5 sums checked
** using staged installation
Found C++17 compiler: g++
Rscript execution error: No such file or directory
Unexpected architecture:
Using CXXCPP=g++ -std=gnu++17 -E
Using PKG_CFLAGS=-I/usr/include/v8 -I/usr/include/v8-3.14
Using PKG_LIBS=-lv8 -lv8_libplatform
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find the libv8 engine library. Try installing:
* deb: libv8-dev or libnode-dev (Debian / Ubuntu)
* rpm: v8-devel (Fedora, EPEL)
* brew: v8 (OSX)
* csw: libv8_dev (Solaris)
Alternatively, on Linux (x86_64) or MacOS you can set environment variable:
DOWNLOAD_STATIC_LIBV8=1
to automatically download a static version of libv8.
To use a custom libv8, set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
<stdin>:1:10: fatal error: v8.h: No such file or directory
compilation terminated.
------------------------------------------------------------------------
ERROR: configuration failed for package ‘V8’
* removing ‘/mnt/cephfs/ceph01/site-home/home/d420/d420/ryanchan/R/x86_64-pc-linux-gnu-library/4.0/V8’
The downloaded source packages are in
‘/tmp/RtmpRKxJCn/downloaded_packages’
Warning message:
In install.packages("V8") :
installation of package ‘V8’ had non-zero exit status
Anyone have similar problems or know what to do here? Apologies if this is not enough information, I can provide more details if needed.