Machine Configuration:
- OS: Ubuntu 16.04
- Cuda: 8.0
- GPU: K520
Run the pre-requisite:
- Essential
- $ sudo apt-get update
- $ sudo apt-get install -y build-essential git l
- $ sudo apt-get install -y python-numpy unzip
- $ sudo apt-get install libboost-dev
- Optional:
- $ sudo apt-get install libatlas-base-dev
- $ sudo apt-get install libopencv-dev
- $ sudo apt-get install libcurl4-openssl-dev
Get your gcc and g++:
- $ gcc-4.9
- $ g++-4.9
- Note: In my case i have gcc4.9 and g++ 4.9 so my commands are gcc-4.9 and g++-4.9 respectively.
Get xgboost source from git:
- $ git clone –recursive https://github.com/dmlc/xgboost
Edit make file to set gcc/g++ properly:
- $ vi make/config.mk
- Set your gcc/g++ as below:
- export CC = gcc-4.9
- export CXX = g++-4.9
- Note: you can change gcc/g++ link (ln -s /usr/bin/gcc & /usr/bin/g++ with your gcc-4.9 and g++-4.9 files)
Make now:
- $ make -j8
- $ make -j(sysctl -n hw.ncpu)
- Note: I have 8 cpu cores so i am building it using 8 cores, you can build using specific number of cores you have in your machine
Success Verification:
- You will see a xgboost file is created at the root of your xgboost source tree
- $ ll xgboost
- -rwxrwxr-x 1 ubuntu ubuntu 2350720 Nov 20 18:16 xgboost*
Install python package:
- $ cd python-package/
- $ sudo python setup.py install
- You will see the following source where the installtion begin:
- Install libxgboost from: [‘/home/ubuntu/xgboost/python-package/xgboost/../../lib/libxgboost.so’]
- ….
- Finished processing dependencies for xgboost==0.6
GPU Support:
- AFAIK, GPU support for xgboost is not available yet: https://github.com/dmlc/xgboost/issues/470