2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2018-03-07 23:14:05 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, givaro
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2018-08-18 21:54:22 +01:00
|
|
|
, blas
|
2020-03-27 18:50:45 +00:00
|
|
|
, lapack
|
2018-03-07 23:14:05 +00:00
|
|
|
, fflas-ffpack
|
|
|
|
, gmpxx
|
|
|
|
, withSage ? false # sage support
|
|
|
|
}:
|
2020-03-27 18:50:45 +00:00
|
|
|
|
2020-04-20 21:50:55 +01:00
|
|
|
assert (!blas.isILP64) && (!lapack.isILP64);
|
2020-03-27 18:50:45 +00:00
|
|
|
|
2018-03-07 23:14:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "linbox";
|
2020-10-22 14:47:50 +01:00
|
|
|
version = "1.6.3"; # TODO: Check postPatch script on update
|
2018-03-07 23:14:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linbox-team";
|
2019-09-09 00:38:31 +01:00
|
|
|
repo = pname;
|
2018-03-07 23:14:05 +00:00
|
|
|
rev = "v${version}";
|
2019-06-17 21:08:03 +01:00
|
|
|
sha256 = "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571";
|
2018-03-07 23:14:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2018-03-07 23:14:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
givaro
|
2018-08-18 21:54:22 +01:00
|
|
|
blas
|
2018-03-07 23:14:05 +00:00
|
|
|
gmpxx
|
|
|
|
fflas-ffpack
|
|
|
|
];
|
|
|
|
|
2020-10-22 14:47:50 +01:00
|
|
|
patches = [
|
|
|
|
# Remove inappropriate `const &` qualifiers on data members that can be
|
|
|
|
# modified via member functions.
|
|
|
|
# See also: https://github.com/linbox-team/linbox/pull/256
|
|
|
|
./patches/linbox-pr256-part2.patch # TODO: Remove on 1.7.0 update
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Remove @LINBOXSAGE_LIBS@ that is actually undefined.
|
|
|
|
# See also: https://github.com/linbox-team/linbox/pull/249
|
|
|
|
# TODO: Remove on 1.7.0 update
|
|
|
|
find . -type f -exec sed -e 's/@LINBOXSAGE_LIBS@//' -i {} \;
|
|
|
|
'';
|
|
|
|
|
2018-03-07 23:14:05 +00:00
|
|
|
configureFlags = [
|
2020-03-27 18:50:45 +00:00
|
|
|
"--with-blas-libs=-lblas"
|
2018-03-07 23:14:05 +00:00
|
|
|
"--disable-optimization"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals stdenv.isx86_64 [
|
2018-03-07 23:14:05 +00:00
|
|
|
# disable SIMD instructions (which are enabled *when available* by default)
|
2020-08-05 03:32:41 +01:00
|
|
|
"--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3"
|
|
|
|
"--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3"
|
|
|
|
"--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
|
|
|
|
"--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
|
|
|
|
"--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx"
|
|
|
|
"--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2"
|
|
|
|
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
|
|
|
|
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals withSage [
|
2018-03-07 23:14:05 +00:00
|
|
|
"--enable-sage"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2018-08-18 21:54:22 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-03-07 23:14:05 +00:00
|
|
|
inherit version;
|
|
|
|
description = "C++ library for exact, high-performance linear algebra";
|
2020-11-17 19:41:33 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = teams.sage.members;
|
|
|
|
platforms = platforms.unix;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://linalg.org/";
|
2018-03-07 23:14:05 +00:00
|
|
|
};
|
|
|
|
}
|