Rstan - Compilation Error - features.h: no such file or directory

Viewed 123

I am working on Centos 7 HPC cluster and using Rstan for model compilation. Here are the steps I am following:

#loading required modules:

module load gcc/8.3.0
module load gsl/2.6

#submitting job file (bash script)

$ cat  dglnrt_re_conda.sh
#!/bin/bash
#BSUB -J cmd_stan
#BSUB -P testsecurity
#BSUB -R "span[hosts=1]"
#BSUB -q bigmem
#BSUB -n 3
#BSUB -B
#BSUB -u iverskyliners@hotmail.com
#BSUB -N
#BSUB -o cmd_stan.%J.out
#BSUB -e cmd_stan.%J.err
#BSUB -R "rusage[mem=4000]"

. "/nethome/mxk841/anaconda3/etc/profile.d/conda.sh"
conda activate r4_Mrt
cd /scratch/projects/testsecurity/dglnrt_re_conda.R

R CMD BATCH dglnrt_re_conda.R

After the job submission, following error produced:

Error in compileCode(f, code, language = language, verbose = verbose) : 
                   from <command-line>:/share/builds/spack-compilers/opt/spack/linux-centos7-sandybridge/gcc-8.3.1/gcc-8.3.0-mnwujmnexs6zvenuhlu5m4io2om4sg55/include/c++/8.3.0/x86_64-pc-linux-gnu/bits/os_defines.h:39:10: fatal error: features.h: No such file or directory #include <features.h>          ^~~~~~~~~~~~compilation terminated.make: *** [/nethome/mxk841/anaconda3/envs/r4_Mrt/lib/R/etc/Makeconf:177: file8c0218b5be9.o] Error 1
Calls: stan ... cxxfunctionplus -> <Anonymous> -> cxxfunction -> compileCode
Error in sink(type = "output") : invalid connection
Calls: stan -> stan_model -> cxxfunctionplus -> sink
Execution halted

I did build my own R directory with conda but got the same error. Also models were written for two stan packages (cmdstanr / rstan), but still same type of error. I am not the admin of the server so not able install certan dev tools or etc. One of the suggestions were about checking environmental variables and their path, but I don't know the exact steps. Thanks for the help.

0 Answers
Related