nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 perl,
6 python3,
7
8 # Enable BLAS interface with 64-bit integer width.
9 blas64 ? false,
10
11 # Target architecture. x86_64 builds Intel and AMD kernels.
12 withArchitecture ? "x86_64",
13
14 # Enable OpenMP-based threading.
15 withOpenMP ? true,
16}:
17
18let
19 blasIntSize = if blas64 then "64" else "32";
20in
21stdenv.mkDerivation rec {
22 pname = "blis";
23 version = "2.0";
24
25 src = fetchFromGitHub {
26 owner = "flame";
27 repo = "blis";
28 rev = version;
29 sha256 = "sha256-+n8SbiiEJDN4j1IPmZfI5g1i2J+jWrUXh7S48JEDTAE=";
30 };
31
32 inherit blas64;
33
34 nativeBuildInputs = [
35 perl
36 python3
37 ];
38
39 doCheck = true;
40
41 enableParallelBuilding = true;
42
43 configureFlags = [
44 "--enable-cblas"
45 "--blas-int-size=${blasIntSize}"
46 ]
47 ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
48 ++ [ withArchitecture ];
49
50 postPatch = ''
51 patchShebangs configure build/flatten-headers.py
52 '';
53
54 postInstall = ''
55 ln -s $out/lib/libblis.so.4 $out/lib/libblas.so.3
56 ln -s $out/lib/libblis.so.4 $out/lib/libcblas.so.3
57 ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
58 ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
59 '';
60
61 meta = with lib; {
62 description = "BLAS-compatible linear algebra library";
63 homepage = "https://github.com/flame/blis";
64 license = licenses.bsd3;
65 maintainers = with maintainers; [ stephen-huan ];
66 platforms = [ "x86_64-linux" ];
67 };
68}