繁体   English   中英

在 R 中安装最新版本的 xgboost 时出错

[英]Error while installing the latest version of xgboost in R

嗨,尝试时遇到以下错误

    `install.packages("xgboost")`

错误信息:

`In file included from amalgamation/xgboost-all0.cc:68:0:
 amalgamation/../src/learner.cc: In member function ‘virtual void 
 xgboost::LearnerImpl::SaveModel(xgboost::Json*) const’:
 amalgamation/../src/learner.cc:378:24: error: invalid initialization of non-const reference of type 
 ‘xgboost::Json&’ from an rvalue of type ‘<brace-enclosed initializer list>’
 Json& out { *p_out };
                    ^
 amalgamation/../src/learner.cc: In member function ‘virtual void 
 xgboost::LearnerImpl::SaveConfig(xgboost::Json*) const’:
 amalgamation/../src/learner.cc:441:24: error: invalid initialization of non-const reference of type 
 ‘xgboost::Json&’ from an rvalue of type ‘<brace-enclosed initializer list>’
 Json& out { *p_out };
                    ^
 make: *** [amalgamation/xgboost-all0.o] Error 1
 ERROR: compilation failed for package ‘xgboost’`

─ Session 资料 ──────────────────────────────────────────── ────────────────────────────────

setting  value                       
version  R version 3.6.0 (2019-04-26)
os       Red Hat Enterprise Linux    
system   x86_64, linux-gnu           
ui       RStudio                     
language (EN)                        
collate  en_AU.UTF-8                 
ctype    en_AU.UTF-8                 
tz       Australia/Brisbane          
date     2020-06-08  

但是,可以安装较旧的存档版本

packageurl <- "http://cran.r- 
project.org/src/contrib/Archive/xgboost/xgboost_0.90.0.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

If you're building from source, perhaps it would be worth trying the dev package from github via the command line ( https://xgboost.readthedocs.io/en/latest/build.html#installing-the-development-version ) :

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
mkdir build
cd build
cmake .. -DR_LIB=ON
make -j$(nproc)
make install

暂无
暂无

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

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