1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, gfortran
, blas
, boost
, python3
, 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
(fetchpatch {
url = "https://github.com/clMathLibraries/clBLAS/commit/68ce5f0b824d7cf9d71b09bb235cf219defcc7b4.patch";
hash = "sha256-XoVcHgJ0kTPysZbM83mUX4/lvXVHKbl7s2Q8WWiUnMs=";
})
];
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 gfortran ];
buildInputs = [
blas
python3
boost
] ++ lib.optionals (!stdenv.isDarwin) [
ocl-icd
opencl-headers
] ++ lib.optionals stdenv.isDarwin [
Accelerate
CoreGraphics
CoreVideo
];
propagatedBuildInputs = lib.optionals stdenv.isDarwin [
OpenCL
];
strictDeps = true;
meta = with lib; {
homepage = "https://github.com/clMathLibraries/clBLAS";
description = "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;
};
}
|