3
0
Fork 0
forked from mirrors/nixpkgs

fflas-ffpack: Add darwin support

This commit is contained in:
Jake Waksbaum 2018-08-14 02:00:54 -04:00
parent cd951e39f2
commit 8374400cec
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

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