簡體   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