错误:包'xgboost'的编译失败

时间:2017-02-06 19:18:38

标签: r gcc xgboost

我正在使用GCC 4.4.7如下:

gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

在RHEL计算机上:

uname -a
Linux qalhdpap002 2.6.32-642.6.1.el6.x86_64 #1 SMP Thu Aug 25 12:42:19 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

当我安装xgboost包时,我收到此错误。不确定如何修改make文件以禁用此设置。有什么想法吗?

* installing *source* package ‘xgboost’ ...
** package ‘xgboost’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include   -fopenmp  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c xgboost_R.cc -o xgboost_R.o
In file included from ./dmlc-core/include/dmlc/logging.h:15,
                 from xgboost_R.cc:2:
./dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
xgboost_R.cc: In function ‘SEXPREC* XGBoosterSetAttr_R(SEXPREC*, SEXPREC*, SEXPREC*)’:
xgboost_R.cc:412: error: ‘nullptr’ was not declared in this scope
make: *** [xgboost_R.o] Error 1
ERROR: compilation failed for package ‘xgboost’

具体来说,我该怎么做:

compile without c++0x

1 个答案:

答案 0 :(得分:1)

假设您是具有管理员权限的root用户,请希望以下步骤有所帮助。

1。安装包含系统存储库的软件包:

在CentOS上,安装CentOS存储库中提供的centos-release-scl软件包:

$ sudo yum install centos-release-scl 

在RHEL上,为您的系统启用RHSCL存储库:

$ sudo yum-config-manager --enable rhel-server-rhscl-6-rpms

2。安装集合:

$ sudo yum install devtoolset-4 

3。开始使用软件集合:

$ scl enable devtoolset-4 bash

5。安装V8 RPMS:

$ sudo yum install v8 v8-devel

6。添加R模块:

$ sudo R
> install.packages("plotly")
> install.packages("forecast")
> install.packages("xgboost")
> q()