atlas: optionally build with full lapack

This commit is contained in:
Thomas Tuegel 2014-12-15 11:27:55 -06:00 committed by Peter Simons
parent 6e46a100b4
commit 32ffad3e6b
2 changed files with 12 additions and 4 deletions

View File

@ -2,6 +2,7 @@
, cpuConfig ? if stdenv.isi686 then "-b 32 -A 12 -V 1" else "-b 64 -A 14 -V 384"
, cacheEdge ? "262144"
, threads ? "0"
, liblapack, withLapack
}:
# Atlas detects the CPU and optimizes its build accordingly. This is great when
@ -48,7 +49,7 @@ let
in
stdenv.mkDerivation {
name = "atlas-${version}";
name = "atlas-${version}" + optionalString withLapack "-with-lapack";
src = fetchurl {
url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2";
@ -81,7 +82,8 @@ stdenv.mkDerivation {
"-fPIC"
"-t ${threads}"
cpuConfig
] ++ optional shared "--shared";
] ++ optional shared "--shared"
++ optional withLapack "--with-netlib-lapack-tarfile=${liblapack.src}";
postConfigure = ''
if [[ -n "${cacheEdge}" ]]; then
@ -94,8 +96,10 @@ stdenv.mkDerivation {
postInstall = ''
# Avoid name collision with the real lapack (ATLAS only builds a partial
# lapack).
mv $out/lib/liblapack.a $out/lib/liblapack_atlas.a
# lapack unless withLapack = true).
if ${if withLapack then "false" else "true"}; then
mv $out/lib/liblapack.a $out/lib/liblapack_atlas.a
fi
'';
meta = {

View File

@ -12173,8 +12173,12 @@ let
# great feature, but it's of limited use with pre-built binaries
# coming from a central build farm.
tolerateCpuTimingInaccuracy = true;
liblapack = liblapack_3_5_0;
withLapack = false;
};
atlasWithLapack = atlas.override { withLapack = true; };
blas = callPackage ../development/libraries/science/math/blas { };
content = builderDefsPackage ../applications/science/math/content {