Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
42e735df 2;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
24aaf2f2 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
945562d4 4;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
61bb3555 5;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
7f1c32f0 6;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
f89cebb1 7;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
c44899a2 8;;;
233e7676 9;;; This file is part of GNU Guix.
c44899a2 10;;;
233e7676 11;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
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;;;
233e7676 16;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
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
233e7676 22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 23
1ffa7090 24(define-module (gnu packages multiprecision)
4a44e743 25 #:use-module (guix licenses)
59a43334 26 #:use-module (gnu packages)
1ffa7090 27 #:use-module (gnu packages m4)
c44899a2 28 #:use-module (guix packages)
87f5d366 29 #:use-module (guix download)
24aaf2f2 30 #:use-module (guix utils)
c44899a2
LC
31 #:use-module (guix build-system gnu))
32
33(define-public gmp
34 (package
35 (name "gmp")
89ccb1d8 36 (version "6.1.2")
c44899a2 37 (source (origin
87f5d366 38 (method url-fetch)
704197f4 39 (uri
93a6f552
AE
40 (string-append "mirror://gnu/gmp/gmp-"
41 version ".tar.xz"))
c44899a2
LC
42 (sha256
43 (base32
89ccb1d8 44 "04hrwahdxyqdik559604r7wrj9ffklwvipgfxgj4ys4skbl6bdc7"))
fc1adab1 45 (patches (search-patches "gmp-faulty-test.patch"))))
c44899a2
LC
46 (build-system gnu-build-system)
47 (native-inputs `(("m4" ,m4)))
9bf62d9b 48 (outputs '("out" "debug"))
4165fda2
AE
49 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
50 #:configure-flags
c44899a2
LC
51 '(;; Build a "fat binary", with routines for several
52 ;; sub-architectures.
53 "--enable-fat"
7f1c32f0
JN
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 '())))))
f50d2669 61 (synopsis "Multiple-precision arithmetic library")
c44899a2 62 (description
d62ab657
TGR
63 "@dfn{GMP} (the GNU Multiple Precision Arithmetic Library) is a library for
64arbitrary-precision arithmetic, operating on signed integers, rational numbers
65and floating point numbers. The precision is only limited by the available
66memory. The library is highly optimized, with a design focus on execution
67speed. It is aimed at use in, for example, cryptography and computational
68algebra.")
4a44e743 69 (license lgpl3+)
75213ad2 70 (home-page "https://gmplib.org/")))
c44899a2 71
8309c389
LC
72(define-public gmp-6.0
73 ;; We keep this one around to bootstrap GCC, to work around a compilation
74 ;; issue on ARM. See
75 ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
76 (package
77 (inherit gmp)
78 (version "6.0.0a")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "mirror://gnu/gmp/gmp-"
82 version ".tar.xz"))
83 (sha256
84 (base32
85 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
fc1adab1
AK
86 (patches (search-patches "gmp-arm-asm-nothumb.patch"
87 "gmp-faulty-test.patch"))))))
8309c389 88
c44899a2
LC
89(define-public mpfr
90 (package
91 (name "mpfr")
acfb9d96 92 (version "3.1.6")
c44899a2 93 (source (origin
87f5d366 94 (method url-fetch)
0db342a5 95 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
c44899a2
LC
96 ".tar.xz"))
97 (sha256 (base32
acfb9d96 98 "0l598h9klpgkz2bp0rxiqb90mkqh9f2f81n5rpy191j00hdaqqks"))))
c44899a2 99 (build-system gnu-build-system)
9bf62d9b 100 (outputs '("out" "debug"))
a6ef51e3 101 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
5b7900d7 102 (synopsis "C library for arbitrary-precision floating-point arithmetic")
c44899a2 103 (description
5b7900d7
TGR
104 "GNU@tie{}@dfn{MPFR} (Multiple Precision Floating-Point Reliably) is a C
105library for performing multiple-precision, floating-point computations with
106correct rounding.")
4a44e743 107 (license lgpl3+)
c44899a2
LC
108 (home-page "http://www.mpfr.org/")))
109
110(define-public mpc
111 (package
112 (name "mpc")
945562d4 113 (version "1.0.3")
c44899a2 114 (source (origin
87f5d366 115 (method url-fetch)
c44899a2 116 (uri (string-append
8e1cd713 117 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
945562d4
AE
118 (sha256
119 (base32
120 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
c44899a2 121 (build-system gnu-build-system)
9bf62d9b 122 (outputs '("out" "debug"))
a6ef51e3
LC
123 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
124 ("mpfr" ,mpfr)))
246db471 125 (synopsis "C library for arbitrary-precision complex arithmetic")
c44899a2 126 (description
246db471
TGR
127 "GNU@tie{}@dfn{MPC} (Multiple Precision Complex library) is a C library for
128performing arithmetic on complex numbers. It supports arbitrarily high
129precision and correctly rounds the results.")
4a44e743 130 (license lgpl3+)
45fc77e5 131 (home-page "http://multiprecision.org/mpc/")))
61bb3555
NG
132
133(define-public mpfi
134 (package
135 (name "mpfi")
f89cebb1
TGR
136 (version "1.5.3")
137 (source
138 (origin
139 (method url-fetch)
140 (uri (string-append "https://gforge.inria.fr/frs/download.php"
141 "/latestfile/181/" name "-" version ".tar.bz2"))
142 (sha256
143 (base32 "0bqr8yibl7jbrp0bw7xk1lm7nis7rv26jsz6y8ycvih8n9bx90r3"))))
61bb3555
NG
144 (build-system gnu-build-system)
145 (propagated-inputs `(("gmp" ,gmp) ; <mpfi.h> refers to both
146 ("mpfr" ,mpfr)))
24a87a14
TGR
147 (synopsis "C library for arbitrary-precision interval arithmetic")
148 (description
149 "@dfn{MPFI} (Multiple Precision Floating-point Interval) is a portable C
150library for arbitrary-precision interval arithmetic, with intervals represented
151using MPFR reliable floating-point numbers. It's based on the @dfn{GMP} (GNU
152Multiple Precision Arithmetic) and GNU@tie{}@dfn{MPFR} (Multiple Precision
153Floating-Point Reliably) libraries.
154
155The purpose of arbitrary-precision interval arithmetic is to get results that
156are both guaranteed, thanks to interval computation, and accurate, thanks to
157multiple-precision arithmetic.")
61bb3555
NG
158 (license lgpl2.1+)
159 (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))