Merge pull request #221775 from illustris/lightgbm-gpu

This commit is contained in:
Sandro 2023-04-15 00:03:39 +02:00 committed by GitHub
commit b75e0f61cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,11 @@
, scikit-learn , scikit-learn
, llvmPackages ? null , llvmPackages ? null
, pythonOlder , pythonOlder
, python
, ocl-icd
, opencl-headers
, boost
, gpuSupport ? true
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -28,9 +33,13 @@ buildPythonPackage rec {
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
buildInputs = lib.optionals stdenv.cc.isClang [ buildInputs = (lib.optionals stdenv.cc.isClang [
llvmPackages.openmp llvmPackages.openmp
]; ]) ++ (lib.optionals gpuSupport [
boost
ocl-icd
opencl-headers
]);
propagatedBuildInputs = [ propagatedBuildInputs = [
numpy numpy
@ -38,6 +47,10 @@ buildPythonPackage rec {
scikit-learn scikit-learn
]; ];
buildPhase = ''
${python.pythonForBuild.interpreter} setup.py bdist_wheel ${lib.optionalString gpuSupport "--gpu"}
'';
postConfigure = '' postConfigure = ''
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
''; '';
@ -51,11 +64,11 @@ buildPythonPackage rec {
"lightgbm" "lightgbm"
]; ];
meta = with lib; { meta = {
description = "A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework"; description = "A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework";
homepage = "https://github.com/Microsoft/LightGBM"; homepage = "https://github.com/Microsoft/LightGBM";
changelog = "https://github.com/microsoft/LightGBM/releases/tag/v${version}"; changelog = "https://github.com/microsoft/LightGBM/releases/tag/v${version}";
license = licenses.mit; license = lib.licenses.mit;
maintainers = with maintainers; [ teh costrouc ]; maintainers = with lib.maintainers; [ teh costrouc ];
}; };
} }