git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #93052 from danieldk/amd-blis-zen-only

amd-blis: init at 2.2

commit57d4c67fb8988306f807102480ad69a6d8480f92 authorDaniël de Kok <me@danieldk.eu> dateSat 8 Aug 2020, 20:01 (6 years ago) parenta2216074fbe92d
2 files changed+69
pkgs/development/libraries/science/math/amd-blis/default.nix+67 pkgs/top-level/all-packages.nix+2
pkgs/development/libraries/science/math/amd-blis/default.nixnew file+67
@@ -0,0 +1,67 @@
1+{ stdenv
2+, fetchFromGitHub
3+, perl
4+, python3
5+
6+# Enable BLAS interface with 64-bit integer width.
7+, blas64 ? false
8+
9+# Target architecture, use "zen" or "zen2", optimization for Zen and
10+# other families is pretty much mutually exclusive in the AMD fork of
11+# BLIS.
12+, withArchitecture ? "zen"
13+
14+# Enable OpenMP-based threading.
15+, withOpenMP ? true
16+}:
17+
18+let
19+ threadingSuffix = if withOpenMP then "-mt" else "";
20+ blasIntSize = if blas64 then "64" else "32";
21+in stdenv.mkDerivation rec {
22+ pname = "amd-blis";
23+ version = "2.2";
24+
25+ src = fetchFromGitHub {
26+ owner = "amd";
27+ repo = "blis";
28+ rev = version;
29+ sha256 = "1b2f5bwi0gkw2ih2rb7wfzn3m9hgg7k270kg43rmzpr2acpy86xa";
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+ ] ++ stdenv.lib.optionals withOpenMP [ "--enable-threading=openmp" ]
47+ ++ [ withArchitecture ];
48+
49+ postPatch = ''
50+ patchShebangs configure build/flatten-headers.py
51+ '';
52+
53+ postInstall = ''
54+ ln -s $out/lib/libblis${threadingSuffix}.so.2 $out/lib/libblas.so.3
55+ ln -s $out/lib/libblis${threadingSuffix}.so.2 $out/lib/libcblas.so.3
56+ ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
57+ ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
58+ '';
59+
60+ meta = with stdenv.lib; {
61+ description = "BLAS-compatible library optimized for AMD CPUs";
62+ homepage = "https://developer.amd.com/amd-aocl/blas-library/";
63+ license = licenses.bsd3;
64+ maintainers = [ maintainers.danieldk ];
65+ platforms = [ "x86_64-linux" ];
66+ };
67+}
pkgs/top-level/all-packages.nix+2
@@ -25305,6 +25305,8 @@ in
2530525305
2530625306 almonds = callPackage ../applications/science/math/almonds { };
2530725307
25308+ amd-blis = callPackage ../development/libraries/science/math/amd-blis { };
25309+
2530825310 arpack = callPackage ../development/libraries/science/math/arpack { };
2530925311
2531025312 blas = callPackage ../build-support/alternatives/blas { };