Merge branch 'master' into core-updates
[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 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages multiprecision)
22 #:use-module (guix licenses)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages m4)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu))
29
30 (define-public gmp
31 (package
32 (name "gmp")
33 (version "6.1.0")
34 (source (origin
35 (method url-fetch)
36 (uri
37 (string-append "mirror://gnu/gmp/gmp-"
38 version ".tar.xz"))
39 (sha256
40 (base32
41 "12b9s4jn48gbar6dbs5qrlmljdmnq43xy3ji9yjzic0mwp6dmnk8"))
42 (patches (map search-patch
43 '("gmp-faulty-test.patch")))))
44 (build-system gnu-build-system)
45 (native-inputs `(("m4" ,m4)))
46 (outputs '("out" "debug"))
47 (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
48 #:configure-flags
49 '(;; Build a "fat binary", with routines for several
50 ;; sub-architectures.
51 "--enable-fat"
52 "--enable-cxx")))
53 (synopsis "Multiple-precision arithmetic library")
54 (description
55 "GMP is a library for arbitrary precision arithmetic, operating on
56 signed integers, rational numbers and floating point numbers. The precision
57 is only limited by the available memory. The library is highly optimized,
58 with a design focus on execution speed. It is aimed at use in, for example,
59 cryptography and computational algebra.")
60 (license lgpl3+)
61 (home-page "http://gmplib.org/")))
62
63 (define-public gmp-6.0
64 ;; We keep this one around to bootstrap GCC, to work around a compilation
65 ;; issue on ARM. See
66 ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
67 (package
68 (inherit gmp)
69 (version "6.0.0a")
70 (source (origin
71 (method url-fetch)
72 (uri (string-append "mirror://gnu/gmp/gmp-"
73 version ".tar.xz"))
74 (sha256
75 (base32
76 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
77 (patches (map search-patch
78 '("gmp-arm-asm-nothumb.patch"
79 "gmp-faulty-test.patch")))))))
80
81 (define-public mpfr
82 (package
83 (name "mpfr")
84 (version "3.1.4")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
88 ".tar.xz"))
89 (sha256 (base32
90 "1x8pcnpn1vxfzfsr0js07rwhwyq27fmdzcfjpzi5773ldnqi653n"))))
91 (build-system gnu-build-system)
92 (outputs '("out" "debug"))
93 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
94 (synopsis "C library for arbitrary precision floating-point arithmetic")
95 (description
96 "GNU MPFR is a C library for performing multiple-precision,
97 floating-point computations with correct rounding.")
98 (license lgpl3+)
99 (home-page "http://www.mpfr.org/")))
100
101 (define-public mpc
102 (package
103 (name "mpc")
104 (version "1.0.3")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
109 (sha256
110 (base32
111 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
112 (build-system gnu-build-system)
113 (outputs '("out" "debug"))
114 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
115 ("mpfr" ,mpfr)))
116 (synopsis "C library for arbitrary precision complex arithmetic")
117 (description
118 "GNU MPC is a C library for performing arithmetic on complex numbers.
119 It supports arbitrarily high precision and it correctly rounds the results.")
120 (license lgpl3+)
121 (home-page "http://mpc.multiprecision.org/")))