作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在AWS的Linux机器上运行RServer Studio。
我尝试安装ModelMetrics
的依赖项caret
,并收到此错误:
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’
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/Rtmpr06k8i/downloaded_packages’
yum groupinstall 'Development Tools'
mkdir ~/.R
echo "CC=gcc64" >> ~/.R/Makevars
sudo sed -i 's/CC = gcc -m64/CC = gcc64 -m64/g' /usr/lib64/R/etc/Makeconf
/usr/lib/gcc/x86_64-amazon-linux/4.4.6/include/omp.h
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/include/omp.h
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/include/omp.h
Developer Tools
并使用这些命令更新了
Makeconf
文件。
sudo sed -i 's/CC = gcc -m64/CC = gcc64 -m64/g' /usr/lib64/R/etc/Makeconf
sudo yum groupinstall 'Development Tools'
Makevars
配置文件中。
mkdir ~/.R
vi ~/.R/Makevars
CC=gcc
VER=64
CC=gcc$(VER)
CXX=g++$(VER)
CXX11=g++$(VER)
CXX14=g++$(VER)
ModelMetrics
并收到此错误,与以前相同。
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/RtmpTSUlz4/downloaded_packages’
最佳答案
您已将R配置为在编译C文件时使用gcc64
,但是C++文件仍将使用g++
而不是g++64
进行编译。 ~/.R/Makevars
中的以下配置将始终对此进行更改:
VER=64
CC=gcc$(VER)
CXX=g++$(VER)
CXX11=g++$(VER)
CXX14=g++$(VER)
Makeconf
文件
sudo sed -i 's/g++/g++64/' $(R RHOME)/etc/Makeconf
gcc
更改为
gcc64
)
关于c++ - fatal error : auc_.cpp:2:10: fatal error: omp.h: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55619370/
我正在AWS的Linux机器上运行RServer Studio。 我尝试安装ModelMetrics的依赖项caret,并收到此错误: auc_.cpp:2:10: fatal error: omp.
我是一名优秀的程序员,十分优秀!