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

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 ''
    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

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/
    LAPACK: /opt/R/3.5.3/lib64/R/lib/
1 Like

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

The g++ version 7.2 used on Amazon Linux is not provide OpenMP support. Other compilers on Amazon Linux have that, though. See for details and possible solutions.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.