Build from source using Maven
Dependencies and requirements
Warning
CatBoost uses CMake-based build process since this commit. Previously Ya Make (Yandex's build system) had been used.
Select the appropriate build environment setup below accordingly.
-
Linux, macOS or Windows.
-
Set up build environment depending on build type:
-
Python. 3.6+
-
Maven 3.3.9+
-
JDK 8+
Set
JAVA_HOMEenvironment variable to point to the path of JDK installation
CUDA support
CUDA support is available for Linux and Windows target platforms.
It is disabled by default and can be enabled by adding --have-cuda flag to buildNative.extraArgs definition. See below for details.
CUDA architectures to generate device code for are specified using CMAKE_CUDA_ARCHITECTURES variable, although the default value is non-standard, specified in cuda.cmake. The default value is intended to provide broad GPU compatibility and supported only when building with CUDA 11.8.
The most convenient way to override the default value is to use CUDAARCHS environment variable.
Building steps
-
Clone the repository:
git clone https://github.com/catboost/catboost.git -
Go to the
catboost/catboost/jvm-packages/catboost4j-predictiondirectory from the local copy of the CatBoost repository. -
Use the usual maven build phases in this directory.
Additional flags for building native dynamic library part can specified using
buildNative.extraArgsdefinition.
Supported flags are:--build-system=<build_system>. Supported values areCMAKE(default),YA.--build-type=<build_type>. Supported values areRelease(default),Debug.--have-cuda. Add to enable CUDA support.
Example running tests with this definition:
mvn test -DbuildNative.extraArgs="--build-type=Debug"