git.iko.soy/typeable/nixpkgs
on master help sign in
amd-blis: init at 2.2

We compile specifically for Zen: - Zen/Zen2 are not included in the x86_64 or amd64 configurations. - Including them breaks AMD BLIS in other places, since some functions have Zen-specific definitions that fail on other platforms. Non-Zen CI runners will succeed when they are Haswell or later, since a Haswell kernel is compiled as a dependency.

commit4fbe92df092dc342299f003bc1385cd9d26d1e19 authorDaniël de Kok <me@danieldk.eu> dateSun 12 Jul 2020, 09:09 (6 years ago) parent386ebbc
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
@@ -25033,6 +25033,8 @@ in
2503325033
2503425034 almonds = callPackage ../applications/science/math/almonds { };
2503525035
25036+ amd-blis = callPackage ../development/libraries/science/math/amd-blis { };
25037+
2503625038 arpack = callPackage ../development/libraries/science/math/arpack { };
2503725039
2503825040 blas = callPackage ../build-support/alternatives/blas { };