How to Install XGboost

背景

install speedml
1
2
3
```
报错: XGBoostLibraryNotFound

Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/mx/jr287k4x6x50nkb0t20x4lcc0000gn/T/pip-build-iulz4qok/xgboost/.

1
2
3
4
5
6
7
8
9
10
11
12
13
- 查到: [xgboost/build_trouble_shooting.md at master · dmlc/xgboost](https://github.com/dmlc/xgboost/blob/master/python-package/build_trouble_shooting.md)
- [Discussion and troubleshooting on PyPI (pip) installation (the newest 0.6 version) · Issue #1446 · dmlc/xgboost](https://github.com/dmlc/xgboost/issues/1446)
- 尝试 ```brew install gcc``` 和 ```clang-omg```, 找不到模块
## xgboost
- 要用到 [GCC](https://zh.wikipedia.org/wiki/GCC)
- GCC 之前要按照 xcode(苹果商店就有)
## 操作
- 安装时遵循 [xgboost官方github](https://github.com/dmlc/xgboost/tree/master/python-package), 不要使用 ```pip install xgboost```的方式, 而是使用 clone文件夹到本地的方式(from source).
- 先安装 gcc@5
- set compiler 的方法是: 在 config.mk(在 xgboost 里) 中添加: ```export CC = gcc-5 ,export CXX = g++-5