about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
new file mode 100644
index 000000000000..aca395001f96
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, gfortran
+, blas
+, boost
+, python
+, ocl-icd
+, opencl-headers
+, Accelerate, CoreGraphics, CoreVideo, OpenCL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "clblas";
+  version = "2.12";
+
+  src = fetchFromGitHub {
+    owner = "clMathLibraries";
+    repo = "clBLAS";
+    rev = "v${version}";
+    sha256 = "154mz52r5hm0jrp5fqrirzzbki14c1jkacj75flplnykbl36ibjs";
+  };
+
+  patches = [ ./platform.patch ];
+
+  postPatch = ''
+    sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
+  '';
+
+  preConfigure = ''
+    cd src
+  '';
+
+  cmakeFlags = [
+     "-DBUILD_TEST=OFF"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    gfortran
+    blas
+    python
+    boost
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    ocl-icd
+    opencl-headers
+  ] ++ lib.optionals stdenv.isDarwin [
+    Accelerate
+    CoreGraphics
+    CoreVideo
+  ];
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [
+    OpenCL
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/clMathLibraries/clBLAS";
+    description = "A software library containing BLAS functions written in OpenCL";
+    longDescription = ''
+      This package contains a library of BLAS functions on top of OpenCL.
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ artuuge ];
+    platforms = platforms.unix;
+  };
+
+}