簡體   English   中英

xgboost R 包安裝失敗

[英]xgboost R package installation fails

我想將 xgboost R 包從 0.4-4 更新到最新的 CRAN 版本。 啟動安裝

options(repos = c(CRAN = "https://mran.microsoft.com/snapshot/2017-01-19"))
install.packages("xgboost")

導致以下消息

installing *source* package 'xgboost' ...
** package 'xgboost' successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c xgboost_R.cc -o xgboost_R.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'xgboost_R.o' failed
make: [xgboost_R.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c xgboost_custom.cc -o xgboost_custom.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'xgboost_custom.o' failed
make: [xgboost_custom.o] Error 127 (ignored)
gcc -std=gnu99 -I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION    -fpic  -DU_STATIC_IMPLEMENTATION -O2 -g  -c xgboost_assert.c -o xgboost_assert.o
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c amalgamation/xgboost-all0.cc -o amalgamation/xgboost-all0.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'amalgamation/xgboost-all0.o' failed
make: [amalgamation/xgboost-all0.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c amalgamation/dmlc-minimum0.cc -o amalgamation/dmlc-minimum0.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'amalgamation/dmlc-minimum0.o' failed
make: [amalgamation/dmlc-minimum0.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c rabit/src/engine_empty.cc -o rabit/src/engine_empty.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'rabit/src/engine_empty.o' failed
make: [rabit/src/engine_empty.o] Error 127 (ignored)
I/usr/lib64/microsoft-r/3.3/lib64/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=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -DU_STATIC_IMPLEMENTATION   -fopenmp     -c rabit/src/c_api.cc -o rabit/src/c_api.o
sh: I/usr/lib64/microsoft-r/3.3/lib64/R/include: No such file or directory
/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf:139: recipe for target 'rabit/src/c_api.o' failed
make: [rabit/src/c_api.o] Error 127 (ignored)
-shared -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -o xgboost.so ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./amalgamation/xgboost-all0.o ./amalgamation/dmlc-minimum0.o ./rabit/src/engine_empty.o ./rabit/src/c_api.o -fopenmp -L/usr/lib64/microsoft-r/3.3/lib64/R/lib -lR
sh: line 2: -shared: command not found
/usr/lib64/microsoft-r/3.3/lib64/R/share/make/shlib.mk:6: recipe for target 'xgboost.so' failed
make: *** [xgboost.so] Error 127
ERROR: compilation failed for package 'xgboost'
* removing '/home/norbert/R/x86_64-pc-linux-gnu-library/3.3/xgboost'
* restoring previous '/home/norbert/R/x86_64-pc-linux-gnu-library/3.3/xgboost'
Warning in install.packages :
  installation of package ‘xgboost’ had non-zero exit status

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

似乎 xgboost_assert.c 編譯正確,但用於編譯文件 *.cc 的命令不正確 - 命令的開頭丟失。 最后的鏈接命令也是如此。

sessionInfo()

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS

locale:
 [1] LC_CTYPE=pl_PL.UTF-8       LC_NUMERIC=C                  LC_TIME=pl_PL.UTF-8        LC_COLLATE=pl_PL.UTF-8    
 [5] LC_MONETARY=pl_PL.UTF-8    LC_MESSAGES=pl_PL.UTF-8    LC_PAPER=pl_PL.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=pl_PL.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RevoUtilsMath_10.0.0

loaded via a namespace (and not attached):
[1] RevoUtils_10.0.2 tools_3.3.2     

知道該怎么做嗎?

這在 Microsoft R 上很常見,問題是 Microsoft-R 無法檢測到 c++11

要解決此問題,請編輯“/usr/lib64/microsoft-r/3.3/lib64/R/etc/Makeconf”

將此添加到底部
CXX1X=gcc -std=c++0x
CXX1XSTD=-std=c++0x -fPIC

希望這有幫助,

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM