aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/science/math/blis
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2020-09-04 18:43:43 +0200
committerDaniël de Kok <me@danieldk.eu>2020-09-04 18:44:01 +0200
commit863724b3f3a4727c2c9109ce6a29f6e7846089ca (patch)
tree4b32fe6c1fff8dc3da35316066608969f5b17ff9 /pkgs/development/libraries/science/math/blis
parent02a2649220887363e7730cfb2f0dcc3c4cf17f06 (diff)
blis: init at 0.7.0
Diffstat (limited to 'pkgs/development/libraries/science/math/blis')
-rw-r--r--pkgs/development/libraries/science/math/blis/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/libraries/science/math/blis/default.nix b/pkgs/development/libraries/science/math/blis/default.nix
new file mode 100644
index 000000000000..42ba4f25204e
--- /dev/null
+++ b/pkgs/development/libraries/science/math/blis/default.nix
@@ -0,0 +1,64 @@
+{ stdenv
+, 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";
+ version = "0.7.0";
+
+ src = fetchFromGitHub {
+ owner = "flame";
+ repo = "blis";
+ rev = version;
+ sha256 = "13g9kg7x8j9icg4frdq3wpl2cmp0jnh93mw48daa7ym399w17423";
+ };
+
+ inherit blas64;
+
+ nativeBuildInputs = [
+ perl
+ python3
+ ];
+
+ doCheck = true;
+
+ enableParallelBuilding = true;
+
+ configureFlags = [
+ "--enable-cblas"
+ "--blas-int-size=${blasIntSize}"
+ ] ++ stdenv.lib.optionals withOpenMP [ "--enable-threading=openmp" ]
+ ++ [ 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 stdenv.lib; {
+ description = "BLAS-compatible linear algebra library";
+ homepage = "https://github.com/flame/blis";
+ license = licenses.bsd3;
+ maintainers = [ maintainers.danieldk ];
+ platforms = [ "x86_64-linux" ];
+ };
+}