繁体   English   中英

在 R CentOS Linux 系统上的 xgboost 安装错误

[英]Install error in xgboost on R CentOS Linux system

我正在尝试在 centOS 系统上的 R 中安装 xgboost。 我是如何结束这一点的,我无法解码。 有人可以帮我理解和解决它。

the Log

install.packages("xgboost",lib = "/opt/mount1/muthyalv/vm_packages") 尝试 URL 'https://cran.rstudio.com/src/contrib/xgboost_1.3.1.1.tar' 类型。 'application/x-gzip' 长度 966952 字节 (944 KB) ==================================== ============== 已下载 944 KB

最近的更新我在 R 中执行了以下步骤,我收到了这个错误

* installing *source* package ‘xgboost’ ...
** package ‘xgboost’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking Backtrace lib... 
checking for backtrace in -lexecinfo... no
checking endian... 
configure: creating ./config.status
config.status: creating src/Makevars
** libs
Makevars:17: -DXGBOOST_STRICT_R_MODE=1
Makevars:17: -DDMLC_LOG_BEFORE_THROW=0
Makevars:17: -DDMLC_ENABLE_STD_THREAD=1
Makevars:17: -DDMLC_DISABLE_STDIN=1
Makevars:17: -DDMLC_LOG_CUSTOMIZE=1
Makevars:17: -DXGBOOST_CUSTOMIZE_LOGGER=1
Makevars:17: -DRABIT_CUSTOMIZE_MSG_
g++ -std=c++1y  -I"/opt/R/3.6.3/lib/R/include" -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=1 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_  -I/usr/local/include -fopenmp -DDMLC_CMAKE_LITTLE_ENDIAN=1 -pthread   -O3 -Wno-unused-variable -Wno-unused-function -c xgboost_R.cc -o xgboost_R.o
g++ -std=c++1y  -I"/opt/R/3.6.3/lib/R/include" -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=1 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_  -I/usr/local/include -fopenmp -DDMLC_CMAKE_LITTLE_ENDIAN=1 -pthread   -O3 -Wno-unused-variable -Wno-unused-function -c xgboost_custom.cc -o xgboost_custom.o
In file included from xgboost_custom.cc:6:0:
./dmlc-core/include/../../src/common/random.h: In function ‘std::vector<T> xgboost::common::WeightedSamplingWithoutReplacement(const std::vector<T>&, const std::vector<float>&, size_t)’:
./dmlc-core/include/../../src/common/random.h:102:49: error: wrong number of template arguments (0, should be 1)
   auto ind = ArgSort<size_t>(keys, std::greater<>{});
                                                 ^
In file included from /usr/include/c++/4.8.2/string:48:0,
                 from ./dmlc-core/include/dmlc/logging.h:12,
                 from ./include/xgboost/logging.h:11,
                 from xgboost_custom.cc:5:
/usr/include/c++/4.8.2/bits/stl_function.h:222:12: error: provided for ‘template<class _Tp> struct std::greater’
     struct greater : public binary_function<_Tp, _Tp, bool>
            ^
make: *** [xgboost_custom.o] Error 1
ERROR: compilation failed for package ‘xgboost’
* removing ‘/opt/mount1/muthyalv/vm_packages/xgboost’
Warning in install.packages :
  installation of package ‘xgboost’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpaV4zRj/downloaded_packages’

在此之前,我遇到了一个 c14xx 错误,我通过创建 Makevars 来解决这个错误。

在此处输入图像描述 我目前在这里感到震惊。 你能帮我么在此处输入图像描述

在这里也附上我的 Makevars 内容。

这取决于您使用的编译器。

XGBoost 需要支持 C++14 标准的最新 C++ 编译器:例如,GCC 5。

我不确定,但这可能是您的问题的原因,因为 std::greater<> 是 C++14 中更改的函数之一。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM