gnu: mpfi: Update to 1.5.3.
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
6 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
7 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages multiprecision)
25 #:use-module (guix licenses)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages m4)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu))
32
33 (define-public gmp
34 (package
35 (name "gmp")
36 (version "6.1.2")
37 (source (origin
38 (method url-fetch)
39 (uri
40 (string-append "mirror://gnu/gmp/gmp-"
41 version ".tar.xz"))
42 (sha256
43 (base32
44 "04hrwahdxyqdik559604r7wrj9ffklwvipgfxgj4ys4skbl6bdc7"))
45 (patches (search-patches "gmp-faulty-test.patch"))))
46 (build-system gnu-build-system)
47 (native-inputs `(("m4" ,m4)))
48 (outputs '("out" "debug"))
49 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
50 #:configure-flags
51 '(;; Build a "fat binary", with routines for several
52 ;; sub-architectures.
53 "--enable-fat"
54 "--enable-cxx"
55 ,@(cond ((target-mingw?)
56 ;; Static and shared cannot be built in one go:
57 ;; they produce different headers. We need shared.
58 `("--disable-static"
59 "--enable-shared"))
60 (else '())))))
61 (synopsis "Multiple-precision arithmetic library")
62 (description
63 "GMP is a library for arbitrary precision arithmetic, operating on
64 signed integers, rational numbers and floating point numbers. The precision
65 is only limited by the available memory. The library is highly optimized,
66 with a design focus on execution speed. It is aimed at use in, for example,
67 cryptography and computational algebra.")
68 (license lgpl3+)
69 (home-page "http://gmplib.org/")))
70
71 (define-public gmp-6.0
72 ;; We keep this one around to bootstrap GCC, to work around a compilation
73 ;; issue on ARM. See
74 ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
75 (package
76 (inherit gmp)
77 (version "6.0.0a")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "mirror://gnu/gmp/gmp-"
81 version ".tar.xz"))
82 (sha256
83 (base32
84 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
85 (patches (search-patches "gmp-arm-asm-nothumb.patch"
86 "gmp-faulty-test.patch"))))))
87
88 (define-public mpfr
89 (package
90 (name "mpfr")
91 (version "3.1.5")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
95 ".tar.xz"))
96 (sha256 (base32
97 "1g32l2fg8f62lcyzzh88y3fsh6rk539qc6ahhdgvx7wpnf1dwpq1"))))
98 (build-system gnu-build-system)
99 (outputs '("out" "debug"))
100 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
101 (synopsis "C library for arbitrary precision floating-point arithmetic")
102 (description
103 "GNU MPFR is a C library for performing multiple-precision,
104 floating-point computations with correct rounding.")
105 (license lgpl3+)
106 (home-page "http://www.mpfr.org/")))
107
108 (define-public mpc
109 (package
110 (name "mpc")
111 (version "1.0.3")
112 (source (origin
113 (method url-fetch)
114 (uri (string-append
115 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
116 (sha256
117 (base32
118 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
119 (build-system gnu-build-system)
120 (outputs '("out" "debug"))
121 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
122 ("mpfr" ,mpfr)))
123 (synopsis "C library for arbitrary precision complex arithmetic")
124 (description
125 "GNU MPC is a C library for performing arithmetic on complex numbers.
126 It supports arbitrarily high precision and it correctly rounds the results.")
127 (license lgpl3+)
128 (home-page "http://mpc.multiprecision.org/")))
129
130 (define-public mpfi
131 (package
132 (name "mpfi")
133 (version "1.5.3")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (string-append "https://gforge.inria.fr/frs/download.php"
138 "/latestfile/181/" name "-" version ".tar.bz2"))
139 (sha256
140 (base32 "0bqr8yibl7jbrp0bw7xk1lm7nis7rv26jsz6y8ycvih8n9bx90r3"))))
141 (build-system gnu-build-system)
142 (propagated-inputs `(("gmp" ,gmp) ; <mpfi.h> refers to both
143 ("mpfr" ,mpfr)))
144 (synopsis "C library for arbitrary precision interval arithmetic")
145 (description "MPFI is intended to be a portable library written in C for
146 arbitrary precision interval arithmetic with intervals represented using MPFR
147 reliable floating-point numbers. It is based on the GNU MP library and on the
148 MPFR library. The purpose of an arbitrary precision interval arithmetic is on
149 the one hand to get guaranteed results, thanks to interval computation, and on
150 the other hand to obtain accurate results, thanks to multiple precision
151 arithmetic.")
152 (license lgpl2.1+)
153 (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))