Skip to content

Latest commit

 

History

History
163 lines (101 loc) · 3.79 KB

Installation_guide.rst

File metadata and controls

163 lines (101 loc) · 3.79 KB

Installation Guide

Contents

This is the guide for the build of GPBoost command line interface (CLI) version. For building the Python and R packages, please refer to Python-package and R-package.

All instructions below are aimed for compiling a 64-bit version. It is worth to compile 32-bit version only in very rare special cases of environmental limitations. 32-bit version is slow and untested, so use it on your own risk and don't forget to adjust some commands in this guide.

Windows

On Windows LightGBM can be built using

  • CMake and VS Build Tools or Visual Studio
  • CMake and MinGW

Visual Studio (or VS Build Tools)

  1. 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).

  2. Run the following commands:

    git clone --recursive https://github.com/fabsig/GPBoost
    cd GPBoost
    mkdir build
    cd build
    cmake -A x64 ..
    cmake --build . --target ALL_BUILD --config Release
    

Note: sometimes running cmake -A x64 .. gives an error Generator X does not support platform specification, but platform x64 was specified. In this case, you need to explicitly provide the generator, for instance:

cmake -G "Visual Studio 17 2022" ..

The .exe and .dll files will be in the GPBoost/Release folder.

MinGW-w64

  1. Install Git for Windows, CMake and MinGW-w64.

  2. Run the following commands:

    git clone --recursive https://github.com/fabsig/GPBoost
    cd LightGBM
    mkdir build
    cd build
    cmake -G "MinGW Makefiles" ..
    mingw32-make.exe -j4
    

The .exe and .dll files will be in the GPBoost/ folder.

Note: You may need to run the cmake -G "MinGW Makefiles" .. one more time if you encounter the sh.exe was found in your PATH error.

Linux

On Linux GPBoost can be built using CMake and gcc or Clang.

  1. Install CMake.

  2. Run the following commands:

    git clone --recursive https://github.com/fabsig/GPBoost
    cd GPBoost
    mkdir build
    cd build
    cmake ..
    make -j4
    

Note: glibc >= 2.14 is required.

Note: In some rare cases you may need to install OpenMP runtime library separately (use your package manager and search for lib[g|i]omp for doing this).

macOS

On macOS GPBoost can be built using CMake and Apple Clang or gcc.

Apple Clang

Only Apple Clang version 8.1 or higher is supported.

  1. Install CMake (3.16 or higher):

    brew install cmake
    
  2. Install OpenMP:

    brew install libomp
    
  3. Run the following commands:

    git clone --recursive https://github.com/fabsig/GPBoost
    cd GPBoost
    mkdir build
        cd build
        cmake ..
        make -j4
    

gcc

  1. Install CMake (3.2 or higher):

    brew install cmake
    
  2. Install gcc:

    brew install gcc
    
  3. Run the following commands:

    git clone --recursive https://github.com/fabsig/GPBoost
    cd GPBoost
    export CXX=g++-7 CC=gcc-7  # replace "7" with version of gcc installed on your machine
    mkdir build
    cd build
    cmake ..
    make -j4