From 92a77abd31e6c252390b1baa8a25553909e3f344 Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Wed, 14 Mar 2018 18:17:55 -0700 Subject: xgboost: Enable building on Darwin (#37046) * xgboost: Enable building on Darwin * Review feedback: pass `xgboost` to the python package --- pkgs/development/libraries/xgboost/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pkgs/development/libraries/xgboost') diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index 0d86c8628913..7865724efa40 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -2,6 +2,7 @@ , avxSupport ? false , cudaSupport ? false, cudatoolkit , ncclSupport ? false, nccl +, llvmPackages }: assert ncclSupport -> cudaSupport; @@ -19,7 +20,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp; buildInputs = lib.optional cudaSupport cudatoolkit ++ lib.optional ncclSupport nccl; @@ -27,10 +28,12 @@ stdenv.mkDerivation rec { cmakeFlags = lib.optionals cudaSupport [ "-DUSE_CUDA=ON" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" ] ++ lib.optional ncclSupport "-DUSE_NCCL=ON"; - installPhase = '' + installPhase = let + libname = if stdenv.isDarwin then "libxgboost.dylib" else "libxgboost.so"; + in '' mkdir -p $out cp -r ../include $out - install -Dm755 ../lib/libxgboost.so $out/lib/libxgboost.so + install -Dm755 ../lib/${libname} $out/lib/${libname} install -Dm755 ../xgboost $out/bin/xgboost ''; @@ -38,7 +41,7 @@ stdenv.mkDerivation rec { 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" ]; + platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; maintainers = with maintainers; [ abbradar ]; }; } -- cgit 1.4.1