gnu: icecat: Use system harfbuzz and graphite2 libraries.
[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>
cbc084e1 8;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
c44899a2 9;;;
233e7676 10;;; This file is part of GNU Guix.
c44899a2 11;;;
233e7676 12;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
233e7676 17;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
233e7676 23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 24
1ffa7090 25(define-module (gnu packages multiprecision)
4a44e743 26 #:use-module (guix licenses)
59a43334 27 #:use-module (gnu packages)
1ffa7090 28 #:use-module (gnu packages m4)
cbc084e1 29 #:use-module (gnu packages gcc)
c44899a2 30 #:use-module (guix packages)
87f5d366 31 #:use-module (guix download)
24aaf2f2 32 #:use-module (guix utils)
c44899a2
LC
33 #:use-module (guix build-system gnu))
34
35(define-public gmp
36 (package
37 (name "gmp")
89ccb1d8 38 (version "6.1.2")
c44899a2 39 (source (origin
87f5d366 40 (method url-fetch)
704197f4 41 (uri
93a6f552
AE
42 (string-append "mirror://gnu/gmp/gmp-"
43 version ".tar.xz"))
c44899a2
LC
44 (sha256
45 (base32
89ccb1d8 46 "04hrwahdxyqdik559604r7wrj9ffklwvipgfxgj4ys4skbl6bdc7"))
fc1adab1 47 (patches (search-patches "gmp-faulty-test.patch"))))
c44899a2
LC
48 (build-system gnu-build-system)
49 (native-inputs `(("m4" ,m4)))
9bf62d9b 50 (outputs '("out" "debug"))
4165fda2
AE
51 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
52 #:configure-flags
c44899a2
LC
53 '(;; Build a "fat binary", with routines for several
54 ;; sub-architectures.
55 "--enable-fat"
7f1c32f0
JN
56 "--enable-cxx"
57 ,@(cond ((target-mingw?)
58 ;; Static and shared cannot be built in one go:
59 ;; they produce different headers. We need shared.
60 `("--disable-static"
61 "--enable-shared"))
62 (else '())))))
f50d2669 63 (synopsis "Multiple-precision arithmetic library")
c44899a2 64 (description
d62ab657
TGR
65 "@dfn{GMP} (the GNU Multiple Precision Arithmetic Library) is a library for
66arbitrary-precision arithmetic, operating on signed integers, rational numbers
67and floating point numbers. The precision is only limited by the available
68memory. The library is highly optimized, with a design focus on execution
69speed. It is aimed at use in, for example, cryptography and computational
70algebra.")
4a44e743 71 (license lgpl3+)
75213ad2 72 (home-page "https://gmplib.org/")))
c44899a2 73
8309c389
LC
74(define-public gmp-6.0
75 ;; We keep this one around to bootstrap GCC, to work around a compilation
76 ;; issue on ARM. See
77 ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
78 (package
79 (inherit gmp)
80 (version "6.0.0a")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "mirror://gnu/gmp/gmp-"
84 version ".tar.xz"))
85 (sha256
86 (base32
87 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
fc1adab1
AK
88 (patches (search-patches "gmp-arm-asm-nothumb.patch"
89 "gmp-faulty-test.patch"))))))
8309c389 90
c44899a2
LC
91(define-public mpfr
92 (package
93 (name "mpfr")
acfb9d96 94 (version "3.1.6")
c44899a2 95 (source (origin
87f5d366 96 (method url-fetch)
0db342a5 97 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
c44899a2
LC
98 ".tar.xz"))
99 (sha256 (base32
acfb9d96 100 "0l598h9klpgkz2bp0rxiqb90mkqh9f2f81n5rpy191j00hdaqqks"))))
c44899a2 101 (build-system gnu-build-system)
9bf62d9b 102 (outputs '("out" "debug"))
a6ef51e3 103 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
5b7900d7 104 (synopsis "C library for arbitrary-precision floating-point arithmetic")
c44899a2 105 (description
5b7900d7
TGR
106 "GNU@tie{}@dfn{MPFR} (Multiple Precision Floating-Point Reliably) is a C
107library for performing multiple-precision, floating-point computations with
108correct rounding.")
4a44e743 109 (license lgpl3+)
c44899a2
LC
110 (home-page "http://www.mpfr.org/")))
111
112(define-public mpc
113 (package
114 (name "mpc")
945562d4 115 (version "1.0.3")
c44899a2 116 (source (origin
87f5d366 117 (method url-fetch)
c44899a2 118 (uri (string-append
8e1cd713 119 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
945562d4
AE
120 (sha256
121 (base32
122 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
c44899a2 123 (build-system gnu-build-system)
9bf62d9b 124 (outputs '("out" "debug"))
a6ef51e3
LC
125 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
126 ("mpfr" ,mpfr)))
246db471 127 (synopsis "C library for arbitrary-precision complex arithmetic")
c44899a2 128 (description
246db471
TGR
129 "GNU@tie{}@dfn{MPC} (Multiple Precision Complex library) is a C library for
130performing arithmetic on complex numbers. It supports arbitrarily high
131precision and correctly rounds the results.")
4a44e743 132 (license lgpl3+)
45fc77e5 133 (home-page "http://multiprecision.org/mpc/")))
61bb3555
NG
134
135(define-public mpfi
136 (package
137 (name "mpfi")
f89cebb1
TGR
138 (version "1.5.3")
139 (source
140 (origin
141 (method url-fetch)
142 (uri (string-append "https://gforge.inria.fr/frs/download.php"
143 "/latestfile/181/" name "-" version ".tar.bz2"))
144 (sha256
145 (base32 "0bqr8yibl7jbrp0bw7xk1lm7nis7rv26jsz6y8ycvih8n9bx90r3"))))
61bb3555
NG
146 (build-system gnu-build-system)
147 (propagated-inputs `(("gmp" ,gmp) ; <mpfi.h> refers to both
148 ("mpfr" ,mpfr)))
24a87a14
TGR
149 (synopsis "C library for arbitrary-precision interval arithmetic")
150 (description
151 "@dfn{MPFI} (Multiple Precision Floating-point Interval) is a portable C
152library for arbitrary-precision interval arithmetic, with intervals represented
153using MPFR reliable floating-point numbers. It's based on the @dfn{GMP} (GNU
154Multiple Precision Arithmetic) and GNU@tie{}@dfn{MPFR} (Multiple Precision
155Floating-Point Reliably) libraries.
156
157The purpose of arbitrary-precision interval arithmetic is to get results that
158are both guaranteed, thanks to interval computation, and accurate, thanks to
159multiple-precision arithmetic.")
61bb3555
NG
160 (license lgpl2.1+)
161 (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))
cbc084e1
EB
162
163(define-public qd
164 (package
165 (name "qd")
166 (version "2.3.18")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "http://crd.lbl.gov/~dhbailey/mpdist/qd-"
170 version ".tar.gz"))
171 (sha256
172 (base32
173 "0vkihcj9fyv2cycq8515713gbs3yskhmivy8bznvx72i6ddnn2c1"))))
174 (build-system gnu-build-system)
175 (native-inputs
176 `(("gfortran" ,gfortran)))
177 (arguments
178 `(#:configure-flags `("--disable-enable_fma" ;weird :/
179 "--enable-shared"
180 ,,@(if (string-prefix? "aarch64"
181 (or (%current-target-system)
182 (%current-system)))
183 ;; XXX: The qd_test test fails numerical
184 ;; accuracy checks for 'dd_real::exp()' on
185 ;; aarch64 with GCC 5.4 at -O2. Disabling
186 ;; expensive optimizations lets it pass.
187 '("CXXFLAGS=-O3 -fno-expensive-optimizations")
188 '("CXXFLAGS=-O3")))))
189 (home-page "http://crd-legacy.lbl.gov/~dhbailey/mpdist/")
190 (synopsis "Double-double and quad-double library")
191 (description "This package supports both a double-double
192datatype (approx. 32 decimal digits) and a quad-double datatype (approx. 64
193decimal digits). The computational library is written in C++. Both C++ and
194Fortran-90 high-level language interfaces are provided to permit one to
195convert an existing C++ or Fortran-90 program to use the library with only
196minor changes to the source code. In most cases only a few type statements
197and (for Fortran-90 programs) read/write statements need to be changed. PSLQ
198and numerical quadrature programs are included.")
199 (license bsd-3)))