R 错误:包‘;的编译失败;xgboost&x2019;

R 错误:包‘;的编译失败;xgboost&x2019;,r,gcc,xgboost,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 FITNES

我使用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

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

1.为您的系统安装带有存储库的软件包: 在CentOS上,安装CentOS存储库中提供的CentOS release scl软件包: 在RHEL上,为您的系统启用RHSCL存储库: 2.安装集合: 3.开始使用软件集合: 5.安装V8 RPM: 6.添加R模块:
$ sudo yum install centos-release-scl 
$ sudo yum-config-manager --enable rhel-server-rhscl-6-rpms
$ sudo yum install devtoolset-4 
$ scl enable devtoolset-4 bash
$ sudo yum install v8 v8-devel
$ sudo R
> install.packages("plotly")
> install.packages("forecast")
> install.packages("xgboost")
> q()