第一步:安裝brew(如果電腦已經(jīng)有brew可略過(guò))
在終端輸入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
第二步:用brew 安裝cmake
brew install cmake
brew install gcc --without-multilib
第三部:配置
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7
cmake ..
make -j4
最后:用pip安裝
pip install lightgbm
會(huì)出現(xiàn)一個(gè)問(wèn)題:
在第三部會(huì)出現(xiàn)問(wèn)題:Could not find compiler set in environment variable CC: gcc-7
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-8 CC=gcc-8
mkdir build ; cd build
cmake ..
make -j4