dimanche 5 novembre 2023

Failed to install RcppArmadillo on Linux with OpenMP Error

I tried to install RcppArmadillo on a school Linux Hyper Cluster (which I do not have sudo access). I am installing via:

install.packages('RcppArmadillo')

in the R interface. The installation failed with the following error message:

using C++ compiler: ‘g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)’
g++ -std=gnu++11 -I"/home/yz909/R/lib64/R/include" -DNDEBUG -I../inst/include -I'/cache/home/yz909/R/lib64/R/library/Rcpp/include' -I/usr/local/include   -fopenmp -fpic  -g -O2  -c RcppArmadillo.cpp -o RcppArmadillo.o
RcppArmadillo.cpp: In function ‘int armadillo_get_number_of_omp_threads()’:
RcppArmadillo.cpp:103:32: error: ‘omp_get_max_threads’ was not declared in this scope
     return omp_get_max_threads();
                                ^
RcppArmadillo.cpp: In function ‘void armadillo_set_number_of_omp_threads(int)’:
RcppArmadillo.cpp:113:26: error: ‘omp_set_num_threads’ was not declared in this scope
     omp_set_num_threads(n);
                          ^
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/cache/home/yz909/R/lib64/R/library/RcppArmadillo’

The downloaded source packages are in
        ‘/tmp/Rtmpk3pNYK/downloaded_packages’
Warning message:
In install.packages("RcppArmadillo") :
  installation of package ‘RcppArmadillo’ had non-zero exit status

It seems to be a complier issue, could anyone help me with it?

I've tried both installing directly using

install.packages('RcppArmadillo')

and install using the github link, both yield to the same issue. My current R version is 4.3.1 and Rcpp version is 1.0.11.

Aucun commentaire:

Enregistrer un commentaire