Merge pull request #45013 from jbaum98/fflas-ffpack_darwin

fflas-ffpack: Add darwin support
This commit is contained in:
Timo Kaufmann 2018-08-19 16:24:52 +02:00 committed by GitHub
commit 8014c7f186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 6 deletions

View File

@ -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/;
};
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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 {};