2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2018-03-30 13:40:52 +01:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, gmp
|
|
|
|
, mpir
|
|
|
|
, mpfr
|
|
|
|
, ntl
|
2020-03-31 15:47:18 +01:00
|
|
|
, openblas ? null, blas, lapack
|
2018-03-30 13:40:52 +01:00
|
|
|
, withBlas ? true
|
|
|
|
}:
|
|
|
|
|
2020-03-31 15:47:18 +01:00
|
|
|
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
|
2018-03-30 13:40:52 +01:00
|
|
|
|
2016-10-10 18:31:19 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "flint";
|
2018-03-30 13:40:52 +01:00
|
|
|
version = "2.5.2"; # remove libflint.so.MAJOR patch when updating
|
2016-10-10 18:31:19 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.flintlib.org/flint-${version}.tar.gz";
|
|
|
|
sha256 = "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb";
|
|
|
|
};
|
2018-03-30 13:40:52 +01:00
|
|
|
buildInputs = [
|
|
|
|
gmp
|
|
|
|
mpir
|
|
|
|
mpfr
|
|
|
|
ntl
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals withBlas [
|
2018-03-30 13:40:52 +01:00
|
|
|
openblas
|
|
|
|
];
|
2018-04-11 12:52:10 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mpfr # flint.h includes mpfr.h
|
|
|
|
];
|
2018-03-30 13:40:52 +01: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 13:40:52 +01:00
|
|
|
"--with-blas=${openblas}"
|
|
|
|
];
|
2018-07-08 22:07:41 +01: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 22:07:41 +01:00
|
|
|
|
2018-03-30 13:40:52 +01: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 18:31:19 +01: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 02:11:51 +01:00
|
|
|
homepage = "http://www.flintlib.org/";
|
2016-10-10 18:31:19 +01:00
|
|
|
downloadPage = "http://www.flintlib.org/downloads.html";
|
|
|
|
updateWalker = true;
|
|
|
|
};
|
|
|
|
}
|