32 gpuSupport ? stdenv.hostPlatform.isLinux && !cudaSupport,
33 cudaSupport ? config.cudaSupport,
37 assert gpuSupport -> !cudaSupport;
38 assert cudaSupport -> !gpuSupport;
40 buildPythonPackage rec {
45 disabled = pythonOlder "3.7";
48 inherit pname version;
49 hash = "sha256-4c17rwMY1OMIomV1pjpGNfCN+GatNiKp2OPXHZY3obo=";
58 ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ];
60 dontUseCmakeConfigure = true;
63 (lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ])
64 ++ (lib.optionals gpuSupport [
69 ++ lib.optionals cudaSupport [
70 cudaPackages.cuda_nvcc
71 cudaPackages.cuda_cudart
74 propagatedBuildInputs = [
80 lib.optionals gpuSupport [ "--config-setting=cmake.define.USE_GPU=ON" ]
81 ++ lib.optionals cudaSupport [ "--config-setting=cmake.define.USE_CUDA=ON" ];
84 export HOME=$(mktemp -d)
87 optional-dependencies = {
97 ++ dask.optional-dependencies.array
98 ++ dask.optional-dependencies.dataframe
99 ++ dask.optional-dependencies.distributed;
101 scikit-learn = [ scikit-learn ];
104 # The pypi package doesn't distribute the tests from the GitHub
105 # repository. It contains c++ tests which don't seem to wired up to
109 pythonImportsCheck = [ "lightgbm" ];
112 description = "Fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework";
113 homepage = "https://github.com/Microsoft/LightGBM";
114 changelog = "https://github.com/microsoft/LightGBM/releases/tag/v${version}";
115 license = lib.licenses.mit;
116 maintainers = with lib.maintainers; [ teh ];