From 32ffad3e6b4a724ab32e92e9d5db4a42b8b0a869 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 15 Dec 2014 11:27:55 -0600 Subject: [PATCH] atlas: optionally build with full lapack --- .../libraries/science/math/atlas/default.nix | 12 ++++++++---- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix index 3cdab4df16f4..f4bda4f47358 100644 --- a/pkgs/development/libraries/science/math/atlas/default.nix +++ b/pkgs/development/libraries/science/math/atlas/default.nix @@ -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 = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 297a983be608..9e4acb23a7c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {