btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / bl / blis / package.nix
blobb31de4b84a70ef52018536b0d91d406ca421ddeb
1 { lib, stdenv
2 , fetchFromGitHub
3 , perl
4 , python3
6 # Enable BLAS interface with 64-bit integer width.
7 , blas64 ? false
9 # Target architecture. x86_64 builds Intel and AMD kernels.
10 , withArchitecture ? "x86_64"
12 # Enable OpenMP-based threading.
13 , withOpenMP ? true
16 let
17   blasIntSize = if blas64 then "64" else "32";
18 in stdenv.mkDerivation rec {
19   pname = "blis";
20   version = "1.0";
22   src = fetchFromGitHub {
23     owner = "flame";
24     repo = "blis";
25     rev = version;
26     sha256 = "sha256-lAo6C34QQvXr3LmcsnTp4+Imi/lKxzcWu3EJkVgLvDI=";
27   };
29   inherit blas64;
31   nativeBuildInputs = [
32     perl
33     python3
34   ];
36   doCheck = true;
38   enableParallelBuilding = true;
40   configureFlags = [
41     "--enable-cblas"
42     "--blas-int-size=${blasIntSize}"
43   ] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
44     ++ [ withArchitecture ];
46   postPatch = ''
47     patchShebangs configure build/flatten-headers.py
48   '';
50   postInstall = ''
51     ln -s $out/lib/libblis.so.4 $out/lib/libblas.so.3
52     ln -s $out/lib/libblis.so.4 $out/lib/libcblas.so.3
53     ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
54     ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
55   '';
57   meta = with lib; {
58     description = "BLAS-compatible linear algebra library";
59     homepage = "https://github.com/flame/blis";
60     license = licenses.bsd3;
61     maintainers = with maintainers; [ stephen-huan ];
62     platforms = [ "x86_64-linux" ];
63   };