From Command Line
-
Install Git for Windows, CMake (3.8 or higher) and VS Build Tools (VS Build Tools is not needed if Visual Studio (2015 or newer) is already installed).
-
Run the following commands:
git clone --recursive https://github.com/microsoft/LightGBM cd LightGBM mkdir build cd build cmake -A x64 .. cmake --build . --target ALL_BUILD --config Release
The .exe
and .dll
files will be in LightGBM/Release
folder.
注意事項:1,最好下載VS 2017以後的版本,需要安裝C++編譯器和windows 8.0 sdk。
2. 如果以前安裝過低版本的VS,後面安裝較新版本的VS,在Git bash裏面使用命令“cmake -A x64 ..”卻找不到編譯器或MSbulid.exe,則需要刪除LightBGM,再重新使用“git clone --recursive https://github.com/microsoft/LightGBM”下載一個新的。
如果還是找不到編譯器,可以將新版本的VS的路徑加入到系統path裏面。