diff --git a/pkgs/development/libraries/fflas-ffpack/default.nix b/pkgs/development/libraries/fflas-ffpack/default.nix index 5f99f35a1599..bf7630608f7d 100644 --- a/pkgs/development/libraries/fflas-ffpack/default.nix +++ b/pkgs/development/libraries/fflas-ffpack/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, givaro, pkgconfig, openblas +{ stdenv, fetchFromGitHub, autoreconfHook, givaro, pkgconfig, blas , gmpxx , optimize ? false # impure }: @@ -6,23 +6,30 @@ stdenv.mkDerivation rec { name = "${pname}-${version}"; pname = "fflas-ffpack"; version = "2.3.2"; + src = fetchFromGitHub { owner = "linbox-team"; repo = "${pname}"; rev = "v${version}"; sha256 = "1cqhassj2dny3gx0iywvmnpq8ca0d6m82xl5rz4mb8gaxr2kwddl"; }; + checkInputs = [ gmpxx ]; + + enableParallelBuilding = true; + nativeBuildInputs = [ autoreconfHook pkgconfig ] ++ stdenv.lib.optionals doCheck checkInputs; - buildInputs = [ givaro openblas]; + + buildInputs = [ givaro blas ]; + configureFlags = [ - "--with-blas-libs=-lopenblas" - "--with-lapack-libs=-lopenblas" + "--with-blas-libs=-l${blas.linkName}" + "--with-lapack-libs=-l${blas.linkName}" ] ++ stdenv.lib.optionals (!optimize) [ # disable SIMD instructions (which are enabled *when available* by default) "--disable-sse" @@ -36,13 +43,15 @@ stdenv.mkDerivation rec { "--disable-fma" "--disable-fma4" ]; + doCheck = true; + meta = { inherit version; description = ''Finite Field Linear Algebra Subroutines''; license = stdenv.lib.licenses.lgpl21Plus; maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; homepage = https://linbox-team.github.io/fflas-ffpack/; }; } diff --git a/pkgs/development/libraries/science/math/blas/default.nix b/pkgs/development/libraries/science/math/blas/default.nix index 9955af046597..286be260052b 100644 --- a/pkgs/development/libraries/science/math/blas/default.nix +++ b/pkgs/development/libraries/science/math/blas/default.nix @@ -59,4 +59,10 @@ stdenv.mkDerivation rec { homepage = http://www.netlib.org/blas/; platforms = stdenv.lib.platforms.unix; }; + + # We use linkName to pass a different name to --with-blas-libs for + # fflas-ffpack and linbox, because we use blas on darwin but openblas + # elsewhere. + # See see https://github.com/NixOS/nixpkgs/pull/45013. + passthru.linkName = "blas"; } diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index e00a5ca9f8d9..18483f9e327c 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -143,4 +143,10 @@ stdenv.mkDerivation rec { platforms = platforms.unix; maintainers = with maintainers; [ ttuegel ]; }; + + # We use linkName to pass a different name to --with-blas-libs for + # fflas-ffpack and linbox, because we use blas on darwin but openblas + # elsewhere. + # See see https://github.com/NixOS/nixpkgs/pull/45013. + passthru.linkName = "openblas"; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 94a65d3bdf36..d65691ba2b7a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9195,7 +9195,12 @@ with pkgs; ffcast = callPackage ../tools/X11/ffcast { }; - fflas-ffpack = callPackage ../development/libraries/fflas-ffpack {}; + fflas-ffpack = callPackage ../development/libraries/fflas-ffpack { + # We need to use blas instead of openblas on darwin, + # see https://github.com/NixOS/nixpkgs/pull/45013. + blas = if stdenv.isDarwin then blas else openblas; + }; + fflas-ffpack_1 = callPackage ../development/libraries/fflas-ffpack/1.nix {}; linbox = callPackage ../development/libraries/linbox {};