xgboost在windows上的安装,用vs和cmake

官方安装教程在此

采用mingw安装教程在此

按mingw教程折腾了一个晚上,make -j4总是报错,第一次用mingw,找不到原因。

转而采用vs和cmake进行编译。

我的win10已装有cmake和vs2013 community版,安装了anaconda3.4.3.1

1,安装git,打开Git Bash下载xgboost:

1. git clone --recursive https://github.com/dmlc/xgboost 
2. cd xgboost
3. git submodule init
4. git submodule update

2,在xgboost打开cmake-->指定目录-->configure-->generate

xgboost在windows上的安装,用vs和cmake_第1张图片

3. 用vs打开xgboost.sln,右键点击all_build,选择build,(建议将默认编译选项的的debug改为release)

4. 在xgboost/python-package下win+r运行cmd,

输入python setup.py install

在python ide里运行import xgboost,如没有报错就成功了。


你可能感兴趣的:(xgboost在windows上的安装,用vs和cmake)