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