Installing package: auc_.cpp:2:10: fatal error: omp.h: No such file or directory

package-installation
#1

I'm trying to install ModelMetrics, but I get this error.

 Installing package into ‘/home/User/R/x86_64-pc-linux-gnu-library/3.5’
    (as ‘lib’ is unspecified)
    trying URL 'https://cran.rstudio.com/src/contrib/ModelMetrics_1.2.2.tar.gz'
    Content type 'application/x-gzip' length 16974 bytes (16 KB)
    ==================================================
    downloaded 16 KB
    
    * installing *source* package ‘ModelMetrics’ ...
    ** package ‘ModelMetrics’ successfully unpacked and MD5 sums checked
    ** libs
    g++  -I"/opt/R/3.5.3/lib64/R/include" -DNDEBUG  -I"/home/User/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
    g++  -I"/opt/R/3.5.3/lib64/R/include" -DNDEBUG  -I"/home/User/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include   -fpic  -g -O2  -c auc_.cpp -o auc_.o
    auc_.cpp:2:10: fatal error: omp.h: No such file or directory
     #include <omp.h>
              ^~~~~~~
    compilation terminated.
    make: *** [auc_.o] Error 1
    ERROR: compilation failed for package ‘ModelMetrics’
    * removing ‘/home/User/R/x86_64-pc-linux-gnu-library/3.5/ModelMetrics’
    Warning in install.packages :
      installation of package ‘ModelMetrics’ had non-zero exit status
    
    The downloaded source packages are in
    	‘/tmp/RtmpjjQEvF/downloaded_packages’

Here's my session info.

R version 3.5.3 (2019-03-11)
    Platform: x86_64-pc-linux-gnu (64-bit)
    Running under: Amazon Linux AMI 2018.03
    
    Matrix products: default
    BLAS: /opt/R/3.5.3/lib64/R/lib/libRblas.so
    LAPACK: /opt/R/3.5.3/lib64/R/lib/libRlapack.so
1 Like

Can I install `caret` on CentOS?
#2

Not sure the answer, but I'm running into a similar problem. +1

0 Likes

#3

The g++ version 7.2 used on Amazon Linux is not provide OpenMP support. Other compilers on Amazon Linux have that, though. See https://stackoverflow.com/q/55619370/8416610 for details and possible solutions.

0 Likes