2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, gmp
|
|
|
|
, mpir
|
|
|
|
, mpfr
|
|
|
|
, ntl
|
|
|
|
, openblas ? null, blas, lapack
|
|
|
|
, withBlas ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "flint";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "2.8.4";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "https://www.flintlib.org/flint-${version}.tar.gz";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-Yd+S6oyOncaS1Gxx1/UKqgmjPUugjQKheEcwpEXl5L4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
mpir
|
|
|
|
mpfr
|
|
|
|
ntl
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals withBlas [
|
2020-04-24 23:36:52 +00:00
|
|
|
openblas
|
|
|
|
];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mpfr # flint.h includes mpfr.h
|
|
|
|
];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-gmp=${gmp}"
|
|
|
|
"--with-mpir=${mpir}"
|
|
|
|
"--with-mpfr=${mpfr}"
|
|
|
|
"--with-ntl=${ntl}"
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals withBlas [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-blas=${openblas}"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "Fast Library for Number Theory";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = teams.sage.members;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
homepage = "https://www.flintlib.org/";
|
|
|
|
downloadPage = "https://www.flintlib.org/downloads.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|