summary refs log tree commit diff
path: root/gnu/packages/algebra.scm
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2014-09-12 14:20:28 +0200
committerAndreas Enge <andreas@enge.fr>2014-09-13 18:55:21 +0200
commitd7ab698a620873c11103fa2bd082884f0198723a (patch)
tree4ee4428245e0adce7d34f17a4b532672a9efaa89 /gnu/packages/algebra.scm
parent9e771e3bb67361b509a6d4e9c00b9d21d7f9b123 (diff)
downloadguix-d7ab698a620873c11103fa2bd082884f0198723a.tar.gz
gnu: Add flint.
* gnu/packages/algebra.scm (flint): New variable.
Diffstat (limited to 'gnu/packages/algebra.scm')
-rw-r--r--gnu/packages/algebra.scm51
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 8c12eb604e..7fc31abae7 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -154,6 +154,57 @@ GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
    (license gpl2)
    (home-page "http://pari.math.u-bordeaux.fr/")))
 
+(define-public flint
+  (package
+   (name "flint")
+   (version "2.4.4")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append
+                  "http://flintlib.org/flint-"
+                  version ".tar.gz"))
+            (sha256 (base32
+                     "1isv1sfv8sg3qvf0d99apdfi3jnql95xfzszcawdf1pgjj9rwyf4"))))
+   (build-system gnu-build-system)
+   (inputs
+    `(("gmp" ,gmp)
+      ("mpfr" ,mpfr)))
+   (arguments
+    `(#:phases
+        (alist-replace
+         'configure
+         (lambda* (#:key inputs outputs #:allow-other-keys)
+           (let ((out (assoc-ref outputs "out"))
+                 (gmp (assoc-ref inputs "gmp"))
+                 (mpfr (assoc-ref inputs "mpfr")))
+             ;; Drop test failing with gmp-6 due to changed invertibility
+             ;; of 0 in Z/1 Z, which according to the flint authors has no
+             ;; impact on flint.
+             ;; FIXME: Drop with later version.
+             (delete-file "fmpz/test/t-invmod.c")
+             ;; do not pass "--enable-fast-install", which makes the
+             ;; homebrew configure process fail
+             (zero? (system*
+                     "./configure"
+                     (string-append "--prefix=" out)
+                     (string-append "--with-gmp=" gmp)
+                     (string-append "--with-mpfr=" mpfr)))))
+         %standard-phases)))
+   (synopsis "Fast library for number theory")
+   (description
+    "FLINT is a C library for number theory.  It supports arithmetic
+with numbers, polynomials, power series and matrices over many base
+rings, including multiprecision integers and rationals, integers
+modulo n, p-adic numbers, finite fields (prime and non-prime order)
+and real and complex numbers (via the Arb extension library).
+
+Operations that can be performed include conversions, arithmetic,
+GCDs, factoring, solving linear systems, and evaluating special
+functions.  In addition, FLINT provides various low-level routines for
+fast arithmetic.")
+   (license gpl2+)
+   (home-page "http://flintlib.org/")))
+
 (define-public bc
   (package
     (name "bc")