From b6923404411fc79ea915485aa3de7ef165b67f94 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 26 Feb 2015 06:44:03 -0600 Subject: [PATCH] openblas: fix build on i686 --- .../science/math/openblas/default.nix | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index a452037a235e..8dc2b542be75 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -1,5 +1,15 @@ { stdenv, fetchurl, gfortran, perl, liblapack, config }: +# Minimum CPU requirements: +# x86: Pentium 4 (Prescott, circa 2004) +# x86_64: Opteron (circa 2003) +# These are the settings used for the generic builds. Performance will +# be poor on modern systems. The goal of the Hydra builds is simply to +# support as many systems as possible. OpenBLAS may support older +# CPU architectures, but you will need to set 'config.openblas.target' +# and 'config.openblas.preferLocalBuild', which will build it on your +# local machine. + let local = config.openblas.preferLocalBuild or false; localTarget = config.openblas.target or ""; in @@ -20,18 +30,24 @@ stdenv.mkDerivation rec { cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system); target = if local then localTarget else - if cpu == "i686" then "P2" else - if cpu == "x86_64" then "CORE2" else + if cpu == "i686" then "PRESCOTT" else + if cpu == "x86_64" then "OPTERON" else # allow autodetect ""; - makeFlags = "${if target != "" then "TARGET=" else ""}${target} FC=gfortran CC=cc PREFIX=\"\$(out)\" INTERFACE64=1"; + makeFlags = [ + "${if target != "" then "TARGET=" else ""}${target}" + "FC=gfortran" + "CC=gcc" + ''PREFIX="''$(out)"'' + "INTERFACE64=1" + ]; meta = with stdenv.lib; { description = "Basic Linear Algebra Subprograms"; license = licenses.bsd3; homepage = "https://github.com/xianyi/OpenBLAS"; - platforms = [ "x86_64-linux" ]; + platforms = with platforms; linux; maintainers = with maintainers; [ ttuegel ]; }; }