Mac LightGBM安装坑较多,记录:
一、安装环境:
- OS 10.13.6
- virtualenv/python2.7
- xcode 10.1
- cmake 3.13.4
- gcc 7.3
二、安装实践
1、brew install lightgbm,此方法不行,image not found错误
2、源码编译安装
官网doc:https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#macos
源码编译安装官网介绍有两种方法:
- Cmake + Apple Clang
1.Install CMake (3.12 or higher):
brew install cmake
2.Install OpenMP:
brew install libomp
3. Run the following commands:
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
# For Mojave (10.14)
cmake \
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/incl