1.安裝Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安裝最新版本gcc
brew install gcc --without-multilib
安裝最新版的gcc,安裝好以后確認是gcc7,g++7
git clone --recursive https://github.com/dmlc/xgboost
-
編譯xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4
這時候會報錯clang: error: : errorunsupported option '-fopenmp'
修改config.md
export CC = /usr/local/bin/gcc-7
export CXX = /usr/local/bin/g++-7
重新編譯成功了独旷。
4.在python中調(diào)用
cd python-package; sudo python setup.py install
終于安裝好了访雪。