2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2018-03-30 12:40:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, gmp
|
|
|
|
, mpir
|
|
|
|
, mpfr
|
|
|
|
, ntl
|
2020-03-31 14:47:18 +00:00
|
|
|
, openblas ? null, blas, lapack
|
2018-03-30 12:40:52 +00:00
|
|
|
, withBlas ? true
|
|
|
|
}:
|
|
|
|
|
2020-03-31 14:47:18 +00:00
|
|
|
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
|
2018-03-30 12:40:52 +00:00
|
|
|
|
2016-10-10 17:31:19 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "flint";
|
2018-03-30 12:40:52 +00:00
|
|
|
version = "2.5.2"; # remove libflint.so.MAJOR patch when updating
|
2016-10-10 17:31:19 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.flintlib.org/flint-${version}.tar.gz";
|
|
|
|
sha256 = "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb";
|
|
|
|
};
|
2018-03-30 12:40:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
mpir
|
|
|
|
mpfr
|
|
|
|
ntl
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals withBlas [
|
2018-03-30 12:40:52 +00:00
|
|
|
openblas
|
|
|
|
];
|
2018-04-11 11:52:10 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mpfr # flint.h includes mpfr.h
|
|
|
|
];
|
2018-03-30 12:40:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-gmp=${gmp}"
|
|
|
|
"--with-mpir=${mpir}"
|
|
|
|
"--with-mpfr=${mpfr}"
|
|
|
|
"--with-ntl=${ntl}"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals withBlas [
|
2018-03-30 12:40:52 +00:00
|
|
|
"--with-blas=${openblas}"
|
|
|
|
];
|
2018-07-08 21:07:41 +00:00
|
|
|
|
|
|
|
# issues with ntl -- https://github.com/wbhart/flint2/issues/487
|
2019-12-31 00:00:46 +00:00
|
|
|
NIX_CXXSTDLIB_COMPILE = "-std=c++11";
|
2018-07-08 21:07:41 +00:00
|
|
|
|
2018-03-30 12:40:52 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Always produce libflint.so.MAJOR; will be included in the next flint version
|
|
|
|
# See https://github.com/wbhart/flint2/pull/347
|
|
|
|
url = "https://github.com/wbhart/flint2/commit/49fbcd8f736f847d3f9667f9f7d5567ef4550ecb.patch";
|
|
|
|
sha256 = "09w09bpq85kjf752bd3y3i5lvy59b8xjiy7qmrcxzibx2a21pj73";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
doCheck = true;
|
2016-10-10 17:31:19 +00:00
|
|
|
meta = {
|
|
|
|
inherit version;
|
2021-01-16 04:20:42 +00:00
|
|
|
description = "Fast Library for Number Theory";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [lib.maintainers.raskin];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.flintlib.org/";
|
2016-10-10 17:31:19 +00:00
|
|
|
downloadPage = "http://www.flintlib.org/downloads.html";
|
|
|
|
updateWalker = true;
|
|
|
|
};
|
|
|
|
}
|