gnu: python-pandas: Fix build on 32-bit.
[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 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages multiprecision)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages m4)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu))
31
32 (define-public gmp
33 (package
34 (name "gmp")
35 (version "6.1.1")
36 (source (origin
37 (method url-fetch)
38 (uri
39 (string-append "mirror://gnu/gmp/gmp-"
40 version ".tar.xz"))
41 (sha256
42 (base32
43 "0cg84n482gcvl0s4xq4wgwsk4r0x0m8dnzpizwqdd2j8vw2rqvnk"))
44 (patches (search-patches "gmp-faulty-test.patch"))))
45 (build-system gnu-build-system)
46 (native-inputs `(("m4" ,m4)))
47 (outputs '("out" "debug"))
48 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
49 #:configure-flags
50 '(;; Build a "fat binary", with routines for several
51 ;; sub-architectures.
52 "--enable-fat"
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 '())))))
60 (synopsis "Multiple-precision arithmetic library")
61 (description
62 "GMP is a library for arbitrary precision arithmetic, operating on
63 signed integers, rational numbers and floating point numbers. The precision
64 is only limited by the available memory. The library is highly optimized,
65 with a design focus on execution speed. It is aimed at use in, for example,
66 cryptography and computational algebra.")
67 (license lgpl3+)
68 (home-page "http://gmplib.org/")))
69
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"))
84 (patches (search-patches "gmp-arm-asm-nothumb.patch"
85 "gmp-faulty-test.patch"))))))
86
87 (define-public mpfr
88 (package
89 (name "mpfr")
90 (version "3.1.4")
91 (source (origin
92 (method url-fetch)
93 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
94 ".tar.xz"))
95 (sha256 (base32
96 "1x8pcnpn1vxfzfsr0js07rwhwyq27fmdzcfjpzi5773ldnqi653n"))))
97 (build-system gnu-build-system)
98 (outputs '("out" "debug"))
99 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
100 (synopsis "C library for arbitrary precision floating-point arithmetic")
101 (description
102 "GNU MPFR is a C library for performing multiple-precision,
103 floating-point computations with correct rounding.")
104 (license lgpl3+)
105 (home-page "http://www.mpfr.org/")))
106
107 (define-public mpc
108 (package
109 (name "mpc")
110 (version "1.0.3")
111 (source (origin
112 (method url-fetch)
113 (uri (string-append
114 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
115 (sha256
116 (base32
117 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
118 (build-system gnu-build-system)
119 (outputs '("out" "debug"))
120 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
121 ("mpfr" ,mpfr)))
122 (synopsis "C library for arbitrary precision complex arithmetic")
123 (description
124 "GNU MPC is a C library for performing arithmetic on complex numbers.
125 It supports arbitrarily high precision and it correctly rounds the results.")
126 (license lgpl3+)
127 (home-page "http://mpc.multiprecision.org/")))
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
145 arbitrary precision interval arithmetic with intervals represented using MPFR
146 reliable floating-point numbers. It is based on the GNU MP library and on the
147 MPFR library. The purpose of an arbitrary precision interval arithmetic is on
148 the one hand to get guaranteed results, thanks to interval computation, and on
149 the other hand to obtain accurate results, thanks to multiple precision
150 arithmetic.")
151 (license lgpl2.1+)
152 (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))