使用64位mingw g++构建xgboost时失败

Fail when building xgboost using 64-bit mingw g++

本文关键字:xgboost 失败 构建 g++ 64位 mingw 使用      更新时间:2023-10-16

我想在64位Windows 10中为Anaconda Python 3.x编译xgboost,所以我遵循了以下步骤-https://xgboost.readthedocs.org/en/latest/build.html#building-在windows和这里-在python下安装xgboost,64位msys失败。使用64位的mingw g++,当使用mingw64.mk"make-j4"时,我得到了以下错误消息:

g++: error: dmlc-core/libdmlc.a: No such file or directory
g++: error: rabit/lib/librabit_empty.a: No such file or directory
Makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1

你能告诉我发生了什么以及我如何解决这个问题吗?

非常感谢。

您必须首先转到dmlc核心和rabit子目录,并在那里执行make。然后进入xgboost库并执行build.sh.

也许您在运行安装时不在正确的文件夹中。请尝试以下操作。

调出Anaconda提示符,运行:

cd xgboostpython-package  
python setup.py install 

如果仍然失败,请从头开始尝试这个链接中的过程,它应该可以工作。链接中的报价:

首先按照官方指南进行以下程序(在Git中Windows上的Bash):

git clone --recursive https://github.com/dmlc/xgboost
git submodule init
git submodule update

然后在这里安装TDM-GCC,并在Git Bash中执行以下操作:

alias make='mingw32-make'
cp make/mingw64.mk config.mk; make -j4

最后,使用anaconda提示符或Git Bash执行以下操作:

cd xgboostpython-package  
python setup.py install

目录中缺少这些库。您必须递归地克隆xgboost才能包含它们。只需按照安装指南中提到的克隆过程进行即可!