Build XGBoost on Windows

Introduction

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.

Things to prepare

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.

Git and MinGW64

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

Build work

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

Installation

After building, install from Anaconda Prompt.

cd C:\tools\msys64\home\Administrator\xgboost\python-package
python setup.py install

Verification

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!

image

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!

image

Recommended Posts

Build XGBoost on Windows
Build TensorFlow on Windows
Build Python environment on Windows
Build python environment on windows
Install xgboost (python version) on Windows
Build and install OpenCV on Windows
Run XGBoost on Bash on Ubuntu on Windows
Python on Windows
[UE4] Build DedicatedServer on Windows and Linux
Python 2.7, 3.4, 3.5 extension module build environment on Windows
Simply build a Python 3 execution environment on Windows
Pylint on Windows Atom
Linux (WSL) on Windows
Use pyvenv on Windows
Anaconda on Windows Terminal
python basic on windows ②
Try FEniCS on Windows!
Install pygraphviz on Windows 10
Use Ansible on Windows
build Python on Ubuntu
Try Poerty on Windows
Install Chainer 1.5.0 on Windows
Use QuTiP on Windows
Use pip on Windows
OpneJDK8 build on CentOS7_x86_64
Steps to build PyTorch 1.5 for CUDA 10.2 on Windows
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Build a GVim-based Python development environment on Windows 10 (1) Installation
Build a machine learning environment natively on Windows 10 (x64)
Install Numpy on virtualenv on Windows
Set-enable Python virtualenv on Windows
Run Jupyter on Ubuntu on Windows
Run Openpose on Python (Windows)
Install watchdog on Windows + Python 3.3
Install Win-Kex (kali-linux) on Windows 10.
Before trying Veriloggen on Windows
Python + Kivy development on Windows
Prepare Chainer environment on Windows
Try using OpenCV on Windows
F2py on Miniconda for Windows
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Make Cython available on Windows.
Fastest Python installation on Windows
Operate ubuntu on VScode (windows10)
Django environment development on Windows 10
Install Chainer 1.6 (GPU) on Windows 7.
Set up Polyglot on Windows
Linux on Windows -1-: debian introduction
I ran python on windows
[Tensorflow] Tensorflow environment construction on Windows 10
Notes on installing Anaconda 3 on Windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Use Python on Windows (PyCharm)
Run Jupyter Notebook on windows
Use Linux on Windows 10 (WSL2)
Blogging with Pelican on Windows
Introducing Kaggle's Docker Image on Windows to build an environment
Build an environment on windows10 where you can try MXNet
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
Python environment construction memo on Windows 10