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 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages multiprecision)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages m4)
29 #:use-module (gnu packages gcc)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system gnu))
42 (string-append "mirror://gnu/gmp/gmp-"
46 "04hrwahdxyqdik559604r7wrj9ffklwvipgfxgj4ys4skbl6bdc7"))
47 (patches (search-patches "gmp-faulty-test.patch"))))
48 (build-system gnu-build-system)
49 (native-inputs `(("m4" ,m4)))
50 (outputs '("out" "debug"))
51 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
53 '(;; Build a "fat binary", with routines for several
57 ,@(cond ((target-mingw?)
58 ;; Static and shared cannot be built in one go:
59 ;; they produce different headers. We need shared.
63 (synopsis "Multiple-precision arithmetic library")
65 "@dfn{GMP} (the GNU Multiple Precision Arithmetic Library) is a library for
66 arbitrary-precision arithmetic, operating on signed integers, rational numbers
67 and floating point numbers. The precision is only limited by the available
68 memory. The library is highly optimized, with a design focus on execution
69 speed. It is aimed at use in, for example, cryptography and computational
72 (home-page "https://gmplib.org/")))
74 (define-public gmp-6.0
75 ;; We keep this one around to bootstrap GCC, to work around a compilation
77 ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
83 (uri (string-append "mirror://gnu/gmp/gmp-"
87 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
88 (patches (search-patches "gmp-arm-asm-nothumb.patch"
89 "gmp-faulty-test.patch"))))))
97 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
100 "1g32l2fg8f62lcyzzh88y3fsh6rk539qc6ahhdgvx7wpnf1dwpq1"))))
101 (build-system gnu-build-system)
102 (outputs '("out" "debug"))
103 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
104 (synopsis "C library for arbitrary-precision floating-point arithmetic")
106 "GNU@tie{}@dfn{MPFR} (Multiple Precision Floating-Point Reliably) is a C
107 library for performing multiple-precision, floating-point computations with
110 (home-page "http://www.mpfr.org/")))
119 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
122 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
123 (build-system gnu-build-system)
124 (outputs '("out" "debug"))
125 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
127 (synopsis "C library for arbitrary-precision complex arithmetic")
129 "GNU@tie{}@dfn{MPC} (Multiple Precision Complex library) is a C library for
130 performing arithmetic on complex numbers. It supports arbitrarily high
131 precision and correctly rounds the results.")
133 (home-page "http://multiprecision.org/mpc/")))
142 (uri (string-append "https://gforge.inria.fr/frs/download.php"
143 "/latestfile/181/" name "-" version ".tar.bz2"))
145 (base32 "0bqr8yibl7jbrp0bw7xk1lm7nis7rv26jsz6y8ycvih8n9bx90r3"))))
146 (build-system gnu-build-system)
147 (propagated-inputs `(("gmp" ,gmp) ; <mpfi.h> refers to both
149 (synopsis "C library for arbitrary-precision interval arithmetic")
151 "@dfn{MPFI} (Multiple Precision Floating-point Interval) is a portable C
152 library for arbitrary-precision interval arithmetic, with intervals represented
153 using MPFR reliable floating-point numbers. It's based on the @dfn{GMP} (GNU
154 Multiple Precision Arithmetic) and GNU@tie{}@dfn{MPFR} (Multiple Precision
155 Floating-Point Reliably) libraries.
157 The purpose of arbitrary-precision interval arithmetic is to get results that
158 are both guaranteed, thanks to interval computation, and accurate, thanks to
159 multiple-precision arithmetic.")
161 (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))
169 (uri (string-append "http://crd.lbl.gov/~dhbailey/mpdist/qd-"
173 "0vkihcj9fyv2cycq8515713gbs3yskhmivy8bznvx72i6ddnn2c1"))))
174 (build-system gnu-build-system)
176 `(("gfortran" ,gfortran)))
178 `(#:configure-flags `("--disable-enable_fma" ;weird :/
180 ,,@(if (string-prefix? "aarch64"
181 (or (%current-target-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
192 datatype (approx. 32 decimal digits) and a quad-double datatype (approx. 64
193 decimal digits). The computational library is written in C++. Both C++ and
194 Fortran-90 high-level language interfaces are provided to permit one to
195 convert an existing C++ or Fortran-90 program to use the library with only
196 minor changes to the source code. In most cases only a few type statements
197 and (for Fortran-90 programs) read/write statements need to be changed. PSLQ
198 and numerical quadrature programs are included.")