xgboost: 0.60 -> 0.7

Fixes build error.
This commit is contained in:
Nikolay Amiantov 2018-03-05 04:55:24 +03:00
parent f03c5eb88a
commit eaed0ec08e
3 changed files with 24 additions and 8 deletions

View file

@ -1,23 +1,37 @@
{ stdenv, fetchgit }:
{ stdenv, lib, fetchgit, cmake
, avxSupport ? false
, cudaSupport ? false, cudatoolkit
, ncclSupport ? false, nccl
}:
assert ncclSupport -> cudaSupport;
stdenv.mkDerivation rec {
name = "xgboost-${version}";
version = "0.60";
version = "0.7";
# needs submodules
src = fetchgit {
url = "https://github.com/dmlc/xgboost";
rev = "refs/tags/v${version}";
sha256 = "0536vfl59n9vlagl1cpdl06c9y19dscwhwdzvi27zk5nc5qb6rdq";
sha256 = "1wxh020l4q037hc5z7vgxflb70l41a97anl8g6y4wxb74l5zv61l";
};
enableParallelBuilding = true;
nativeBuildInputs = [ cmake ];
buildInputs = 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";
installPhase = ''
mkdir -p $out
cp -r include $out
install -Dm755 lib/libxgboost.so $out/lib/libxgboost.so
install -Dm755 xgboost $out/bin/xgboost
cp -r ../include $out
install -Dm755 ../lib/libxgboost.so $out/lib/libxgboost.so
install -Dm755 ../xgboost $out/bin/xgboost
'';
meta = with stdenv.lib; {

View file

@ -11732,7 +11732,9 @@ with pkgs;
xalanc = callPackage ../development/libraries/xalanc {};
xgboost = callPackage ../development/libraries/xgboost { };
xgboost = callPackage ../development/libraries/xgboost {
cudaSupport = config.cudaSupport or false;
};
xgeometry-select = callPackage ../tools/X11/xgeometry-select { };

View file

@ -20286,7 +20286,7 @@ EOF
inherit (pkgs.xgboost) version src meta;
propagatedBuildInputs = with self; [ scipy ];
buildInputs = with self; [ nose ];
checkInputs = with self; [ nose ];
postPatch = ''
cd python-package