at 18.03-beta 44 lines 1.2 kB view raw
1{ stdenv, lib, fetchgit, cmake 2, avxSupport ? false 3, cudaSupport ? false, cudatoolkit 4, ncclSupport ? false, nccl 5}: 6 7assert ncclSupport -> cudaSupport; 8 9stdenv.mkDerivation rec { 10 name = "xgboost-${version}"; 11 version = "0.7"; 12 13 # needs submodules 14 src = fetchgit { 15 url = "https://github.com/dmlc/xgboost"; 16 rev = "refs/tags/v${version}"; 17 sha256 = "1wxh020l4q037hc5z7vgxflb70l41a97anl8g6y4wxb74l5zv61l"; 18 }; 19 20 enableParallelBuilding = true; 21 22 nativeBuildInputs = [ cmake ]; 23 24 buildInputs = lib.optional cudaSupport cudatoolkit 25 ++ lib.optional ncclSupport nccl; 26 27 cmakeFlags = lib.optionals cudaSupport [ "-DUSE_CUDA=ON" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" ] 28 ++ lib.optional ncclSupport "-DUSE_NCCL=ON"; 29 30 installPhase = '' 31 mkdir -p $out 32 cp -r ../include $out 33 install -Dm755 ../lib/libxgboost.so $out/lib/libxgboost.so 34 install -Dm755 ../xgboost $out/bin/xgboost 35 ''; 36 37 meta = with stdenv.lib; { 38 description = "Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library"; 39 homepage = https://github.com/dmlc/xgboost; 40 license = licenses.asl20; 41 platforms = platforms.linux; 42 maintainers = with maintainers; [ abbradar ]; 43 }; 44}