As the title suggests, this is the procedure (October 2016) when building XGBoost on Windows. To be honest, it was quite annoying, so I think it's better to do it on Linux. The environment is as follows.
Chocolatey Chocolatey is a Windows package manager. Even if you don't have it, you can do something about it, but it's convenient to have it, so I'll introduce it.
https://chocolatey.org/install
As for the installation, copy and paste the one liner to the command prompt as described above.
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
MSYS2 Install MSYS2 using Chocolatey.
choco install -y msys2
MSYS2 is installed in C: \ tools \ msys64.
Start MSYS2 and install Git and MinGW64 using the pacman command, which is MSYS2's package manager. If you already have Git Windows etc., you don't need to install Git again.
pacman -S git mingw-w64-x86_64-toolchain
I will continue to work with MSYS2. Let's clone the XGBoost repository.
git clone --recursive https://github.com/dmlc/xgboost
...
cd xgboost
git submodule init
git submodule update
Aliase through the path so that you can use the make and g ++ commands. Then copy the makefile for MinGW64 and execute make!
export PATH=${PATH}:/c/tools/msys64/mingw64/bin
alias make=mingw32-make.exe
cp make/mingw64.mk config.mk
make -j4
After building, install from Anaconda Prompt.
cd C:\tools\msys64\home\Administrator\xgboost\python-package
python setup.py install
Be aware that Dynamic Link will fail if the path is not in MinGW64. Add the MinGW64 bin directory to the environment variable Path and you're good to go!
Try importing from IPython or something and if you don't get any errors, you're good to go! Thank you for your hard work!
Recommended Posts