@@ -2,6 +2,7 @@
2, cpuConfig ? if stdenv.isi686 then "-b 32 -A 12 -V 1" else "-b 64 -A 14 -V 384"
2, cpuConfig ? if stdenv.isi686 then "-b 32 -A 12 -V 1" else "-b 64 -A 14 -V 384"
3, cacheEdge ? "262144"
3, cacheEdge ? "262144"
4, threads ? "0"
4, threads ? "0"
5+, liblapack, withLapack
7# Atlas detects the CPU and optimizes its build accordingly. This is great when
8# Atlas detects the CPU and optimizes its build accordingly. This is great when
@@ -48,7 +49,7 @@ let
50stdenv.mkDerivation {
51stdenv.mkDerivation {
51− name = "atlas-${version}";
52+ name = "atlas-${version}" + optionalString withLapack "-with-lapack";
53 src = fetchurl {
54 src = fetchurl {
54 url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2";
55 url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2";
@@ -81,7 +82,8 @@ stdenv.mkDerivation {
82 "-t ${threads}"
83 "-t ${threads}"
84− ] ++ optional shared "--shared";
85+ ] ++ optional shared "--shared"
86+ ++ optional withLapack "--with-netlib-lapack-tarfile=${liblapack.src}";
86 postConfigure = ''
88 postConfigure = ''
87 if [[ -n "${cacheEdge}" ]]; then
89 if [[ -n "${cacheEdge}" ]]; then
@@ -94,8 +96,10 @@ stdenv.mkDerivation {
95 postInstall = ''
97 postInstall = ''
96 # Avoid name collision with the real lapack (ATLAS only builds a partial
98 # Avoid name collision with the real lapack (ATLAS only builds a partial
97− # lapack).
99+ # lapack unless withLapack = true).
100+ if ${if withLapack then "false" else "true"}; then
98− mv $out/lib/liblapack.a $out/lib/liblapack_atlas.a
101+ mv $out/lib/liblapack.a $out/lib/liblapack_atlas.a