1{
2 pkgsFun ? import ../..,
3 lib ? import ../../lib,
4 supportedSystems ? [ "x86_64-linux" ],
5 allowUnfree ? false,
6}:
7
8let
9
10 # called BLAS here, but also tests LAPACK
11 blasUsers = [
12 # "julia_07" "julia_10" "julia_11" "julia_13" "octave" "octaveFull"
13 "fflas-ffpack"
14 "linbox"
15 "R"
16 "ipopt"
17 "hpl"
18 "rspamd"
19 "octopus"
20 "superlu"
21 "suitesparse_5_3"
22 "scs"
23 "scalapack"
24 "petsc"
25 "cholmod-extra"
26 "arpack"
27 "qrupdate"
28 "libcint"
29 "iml"
30 "globalarrays"
31 "arrayfire"
32 "armadillo"
33 "xfitter"
34 "lammps"
35 "plink-ng"
36 "quantum-espresso"
37 "siesta"
38 "siesta-mpi"
39 "shogun"
40 "calculix"
41 "csdp"
42 "getdp"
43 "giac"
44 "gmsh"
45 "jags"
46 "lammps"
47 "lammps-mpi"
48
49 # requires openblas
50 # "caffe" "mxnet" "flint" "sage" "sageWithDoc"
51
52 # broken
53 # "gnss-sdr" "octave-jit" "openmodelica" "torch"
54
55 # subpackages
56 [
57 "pythonPackages"
58 "numpy"
59 ]
60 [
61 "pythonPackages"
62 "prox-tv"
63 ]
64 [
65 "pythonPackages"
66 "scs"
67 ]
68 [
69 "pythonPackages"
70 "pysparse"
71 ]
72 [
73 "pythonPackages"
74 "cvxopt"
75 ]
76 # ["pythonPackages" "fenics"]
77 [
78 "rPackages"
79 "slfm"
80 ]
81 [
82 "rPackages"
83 "SamplerCompare"
84 ]
85 # ["rPackages" "EMCluster"]
86 # ["ocamlPackages" "lacaml"]
87 # ["ocamlPackages" "owl"]
88 [
89 "haskellPackages"
90 "bindings-levmar"
91 ]
92 ]
93 ++ lib.optionals allowUnfree [ "magma" ];
94 blas64Users = [
95 "rspamd"
96 "sundials"
97 "suitesparse_5_3"
98 "petsc"
99 "cholmod-extra"
100 "arpack"
101 "qrupdate"
102 "iml"
103 "globalarrays"
104 "arrayfire"
105 "lammps"
106 "plink-ng"
107 "quantum-espresso"
108 "calculix"
109 "csdp"
110 "getdp"
111 "jags"
112 "lammps"
113 "lammps-mpi"
114 # ["ocamlPackages" "lacaml"]
115 [
116 "haskellPackages"
117 "bindings-levmar"
118 ]
119 ]
120 ++ lib.optionals allowUnfree [ "magma" ];
121 blasProviders =
122 system:
123 [
124 "openblasCompat"
125 "lapack-reference"
126 "openblas"
127 ]
128 ++ lib.optionals (allowUnfree && system.isx86) [
129 "mkl"
130 "mkl64"
131 ];
132
133 blas64Providers = [
134 "mkl64"
135 "openblas"
136 ];
137
138 mapListToAttrs =
139 xs: f:
140 builtins.listToAttrs (
141 map (name: {
142 name = if builtins.isList name then builtins.elemAt name (builtins.length name - 1) else name;
143 value = f name;
144 }) xs
145 );
146
147in
148
149{
150 blas =
151 mapListToAttrs supportedSystems (
152 system':
153 let
154 system = lib.systems.elaborate { system = system'; };
155 in
156 mapListToAttrs (blasProviders system) (
157 provider:
158 let
159 isILP64 = builtins.elem provider ([ "mkl64" ] ++ lib.optional system.is64bit "openblas");
160 pkgs = pkgsFun {
161 config = { inherit allowUnfree; };
162 system = system';
163 overlays = [
164 (self: super: {
165 lapack = super.lapack.override {
166 lapackProvider = if provider == "mkl64" then super.mkl else builtins.getAttr provider super;
167 inherit isILP64;
168 };
169 blas = super.blas.override {
170 blasProvider = if provider == "mkl64" then super.mkl else builtins.getAttr provider super;
171 inherit isILP64;
172 };
173 })
174 ];
175 };
176 in
177 mapListToAttrs (if builtins.elem provider blas64Providers then blas64Users else blasUsers) (
178 attr: if builtins.isList attr then lib.getAttrFromPath attr pkgs else builtins.getAttr attr pkgs
179 )
180
181 // {
182 recurseForDerivations = true;
183 }
184 )
185 // {
186 recurseForDerivations = true;
187 }
188 )
189 // {
190 recurseForDerivations = true;
191 };
192 recurseForDerivations = true;
193}