summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/xgboost/default.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
committerRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
commit4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch)
treee2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/development/libraries/xgboost/default.nix
parentjq: fix build with structured-attrs on darwin (diff)
parentMerge pull request #123802 from superherointj/package-virtmanager-bugfix (diff)
downloadnixpkgs-origin/structured-attrs.tar.gz
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/development/libraries/xgboost/default.nix')
-rw-r--r--pkgs/development/libraries/xgboost/default.nix40
1 files changed, 27 insertions, 13 deletions
diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix
index 973e7dc028e0..26872565de8f 100644
--- a/pkgs/development/libraries/xgboost/default.nix
+++ b/pkgs/development/libraries/xgboost/default.nix
@@ -1,6 +1,14 @@
-{ config, stdenv, lib, fetchgit, cmake
-, cudaSupport ? config.cudaSupport or false, cudatoolkit
-, ncclSupport ? false, nccl
+{ config
+, stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, gtest
+, doCheck ? true
+, cudaSupport ? config.cudaSupport or false
+, cudatoolkit
+, ncclSupport ? false
+, nccl
, llvmPackages
}:
@@ -8,37 +16,43 @@ assert ncclSupport -> cudaSupport;
stdenv.mkDerivation rec {
pname = "xgboost";
- version = "0.90";
+ version = "1.4.1";
- # needs submodules
- src = fetchgit {
- url = "https://github.com/dmlc/xgboost";
- rev = "refs/tags/v${version}";
- sha256 = "1zs15k9crkiq7bnr4gqq53mkn3w8z9dq4nwlavmfcr5xr5gw2pw4";
+ src = fetchFromGitHub {
+ owner = "dmlc";
+ repo = pname;
+ rev = "v${version}";
+ fetchSubmodules = true;
+ sha256 = "12b1417dg8jqyxd72kg5a3xhg5h11vz0k7bkv72mzrv83jvgn5ci";
};
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
- buildInputs = lib.optional cudaSupport cudatoolkit
+ buildInputs = [ gtest ] ++ lib.optional cudaSupport cudatoolkit
++ lib.optional ncclSupport nccl;
- cmakeFlags = lib.optionals cudaSupport [ "-DUSE_CUDA=ON" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" ]
- ++ lib.optional ncclSupport "-DUSE_NCCL=ON";
+ cmakeFlags = lib.optionals doCheck [ "-DGOOGLE_TEST=ON" ]
+ ++ lib.optionals cudaSupport [ "-DUSE_CUDA=ON" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" ]
+ ++ lib.optionals ncclSupport [ "-DUSE_NCCL=ON" ];
+
+ inherit doCheck;
installPhase = let
libname = "libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}";
in ''
+ runHook preInstall
mkdir -p $out
cp -r ../include $out
install -Dm755 ../lib/${libname} $out/lib/${libname}
install -Dm755 ../xgboost $out/bin/xgboost
+ runHook postInstall
'';
meta = with lib; {
description = "Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library";
homepage = "https://github.com/dmlc/xgboost";
license = licenses.asl20;
- platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
+ platforms = platforms.unix;
maintainers = with maintainers; [ abbradar ];
};
}