1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

Merge pull request #38971 from knedlsepp/fix-darwin-gpu-stuff

Fix clblas and libgpuarray on darwin
This commit is contained in:
Jörg Thalheim 2018-04-17 13:58:54 +01:00 committed by GitHub
commit be5ad658df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 8 deletions

View file

@ -7,6 +7,7 @@
, python
, ocl-icd
, opencl-headers
, Accelerate, CoreGraphics, CoreVideo, OpenCL
, gtest
}:
@ -40,11 +41,19 @@ stdenv.mkDerivation rec {
gfortran
blas
python
ocl-icd
opencl-headers
boost
gtest
];
] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
ocl-icd
opencl-headers
] ++ stdenv.lib.optionals stdenv.isDarwin [
Accelerate
CoreGraphics
CoreVideo
];
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [
OpenCL
];
enableParallelBuilding = true;
@ -56,7 +65,7 @@ stdenv.mkDerivation rec {
'';
license = licenses.asl20;
maintainers = with maintainers; [ artuuge ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View file

@ -33,7 +33,7 @@ buildPythonPackage rec {
libraryPath = lib.makeLibraryPath (
[]
++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out ]
++ lib.optionals openclSupport [ ocl-icd clblas ]
++ lib.optionals openclSupport ([ clblas ] ++ lib.optional (!stdenv.isDarwin) ocl-icd)
);
preBuild = ''
@ -47,7 +47,7 @@ buildPythonPackage rec {
postFixup = ''
rm $out/lib/libgpuarray-static.a
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
function fixRunPath {
p=$(patchelf --print-rpath $1)
patchelf --set-rpath "$p:$libraryPath" $1
@ -75,7 +75,7 @@ buildPythonPackage rec {
description = "Library to manipulate tensors on GPU.";
license = licenses.free;
maintainers = with maintainers; [ artuuge ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View file

@ -19783,7 +19783,9 @@ with pkgs;
blas = callPackage ../development/libraries/science/math/blas { };
clblas = callPackage ../development/libraries/science/math/clblas { };
clblas = callPackage ../development/libraries/science/math/clblas {
inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo OpenCL;
};
cliquer = callPackage ../development/libraries/science/math/cliquer { };