3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/science/math/blis/default.nix

65 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-09-04 17:43:43 +01:00
, fetchFromGitHub
, perl
, python3
# Enable BLAS interface with 64-bit integer width.
, blas64 ? false
# Target architecture. x86_64 builds Intel and AMD kernels.
, withArchitecture ? "x86_64"
# Enable OpenMP-based threading.
, withOpenMP ? true
}:
let
blasIntSize = if blas64 then "64" else "32";
in stdenv.mkDerivation rec {
pname = "blis";
2021-03-25 02:54:40 +00:00
version = "0.8.1";
2020-09-04 17:43:43 +01:00
src = fetchFromGitHub {
owner = "flame";
repo = "blis";
rev = version;
2021-03-25 02:54:40 +00:00
sha256 = "sha256-D5T/itq9zyD5TkeJ4Ae1vS4yEWU51omyJoIkKQ2NLhY=";
2020-09-04 17:43:43 +01:00
};
inherit blas64;
nativeBuildInputs = [
perl
python3
];
doCheck = true;
enableParallelBuilding = true;
configureFlags = [
"--enable-cblas"
"--blas-int-size=${blasIntSize}"
] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
2020-09-04 17:43:43 +01:00
++ [ withArchitecture ];
postPatch = ''
patchShebangs configure build/flatten-headers.py
'';
postInstall = ''
ln -s $out/lib/libblis.so.3 $out/lib/libblas.so.3
ln -s $out/lib/libblis.so.3 $out/lib/libcblas.so.3
ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
'';
meta = with lib; {
2020-09-04 17:43:43 +01:00
description = "BLAS-compatible linear algebra library";
homepage = "https://github.com/flame/blis";
license = licenses.bsd3;
maintainers = [ ];
2020-09-04 17:43:43 +01:00
platforms = [ "x86_64-linux" ];
};
}