build-system/gnu: Write debug files to the "debug" sub-derivation, if any.
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
704197f4 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
c44899a2 3;;;
233e7676 4;;; This file is part of GNU Guix.
c44899a2 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 18
1ffa7090 19(define-module (gnu packages multiprecision)
4a44e743 20 #:use-module (guix licenses)
59a43334 21 #:use-module (gnu packages)
1ffa7090 22 #:use-module (gnu packages m4)
c44899a2 23 #:use-module (guix packages)
87f5d366 24 #:use-module (guix download)
c44899a2
LC
25 #:use-module (guix build-system gnu))
26
27(define-public gmp
28 (package
29 (name "gmp")
8572bf5e 30 (version "5.1.2")
c44899a2 31 (source (origin
87f5d366 32 (method url-fetch)
704197f4 33 (uri
93a6f552
AE
34 (string-append "mirror://gnu/gmp/gmp-"
35 version ".tar.xz"))
c44899a2
LC
36 (sha256
37 (base32
8572bf5e 38 "1hnbxz7a6jrli8ph27i8zb6k2f456zn6l5xi78yhskzbxjk47nf7"))))
c44899a2
LC
39 (build-system gnu-build-system)
40 (native-inputs `(("m4" ,m4)))
41 (arguments `(#:configure-flags
42 '(;; Build a "fat binary", with routines for several
43 ;; sub-architectures.
44 "--enable-fat"
45 "--enable-cxx")))
f50d2669 46 (synopsis "Multiple-precision arithmetic library")
c44899a2
LC
47 (description
48 "GMP is a free library for arbitrary precision arithmetic, operating on
49signed integers, rational numbers, and floating point numbers. There is no
50practical limit to the precision except the ones implied by the available
51memory in the machine GMP runs on. GMP has a rich set of functions, and the
52functions have a regular interface.
53
54The main target applications for GMP are cryptography applications and
55research, Internet security applications, algebra systems, computational
56algebra research, etc.
57
58GMP is carefully designed to be as fast as possible, both for small operands
59and for huge operands. The speed is achieved by using fullwords as the basic
60arithmetic type, by using fast algorithms, with highly optimised assembly
61code for the most common inner loops for a lot of CPUs, and by a general
62emphasis on speed.
63
64GMP is faster than any other bignum library. The advantage for GMP increases
65with the operand sizes for many operations, since GMP uses asymptotically
66faster algorithms.")
4a44e743 67 (license lgpl3+)
c44899a2
LC
68 (home-page "http://gmplib.org/")))
69
70(define-public mpfr
71 (package
72 (name "mpfr")
14a3a673 73 (version "3.1.2")
c44899a2 74 (source (origin
87f5d366 75 (method url-fetch)
0db342a5 76 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
c44899a2
LC
77 ".tar.xz"))
78 (sha256 (base32
14a3a673 79 "0fs501qi8l523gs3cpy4jjcnvwxggyfbklcys80wq236xx3hz79r"))))
c44899a2 80 (build-system gnu-build-system)
a6ef51e3 81 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
f50d2669 82 (synopsis "C library for arbitrary precision floating-point arithmetic")
c44899a2
LC
83 (description
84 "The GNU MPFR library is a C library for multiple-precision
85floating-point computations with correct rounding. MPFR is based on the GMP
86multiple-precision library.
87
88The main goal of MPFR is to provide a library for multiple-precision
89floating-point computation which is both efficient and has a well-defined
90semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
91double-precision floating-point arithmetic (53-bit mantissa).")
4a44e743 92 (license lgpl3+)
c44899a2
LC
93 (home-page "http://www.mpfr.org/")))
94
95(define-public mpc
96 (package
97 (name "mpc")
8e1cd713 98 (version "1.0.1")
c44899a2 99 (source (origin
87f5d366 100 (method url-fetch)
c44899a2 101 (uri (string-append
8e1cd713 102 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
c44899a2 103 (sha256 (base32
8e1cd713 104 "1zq0fidp1jii2j5k5n9hmx55a6wwid33gjzhimvxq9d5zrf82npd"))))
c44899a2 105 (build-system gnu-build-system)
a6ef51e3
LC
106 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
107 ("mpfr" ,mpfr)))
f50d2669 108 (synopsis "C library for arbitrary precision complex arithmetic")
c44899a2
LC
109 (description
110 "GNU MPC is a C library for the arithmetic of complex numbers with
8e1cd713
AE
111arbitrarily high precision and correct rounding of the result. It extends
112the principles of the IEEE-754 standard for fixed precision real floating
113point numbers to complex numbers, providing well-defined semantics for
114every operation. At the same time, speed of operation at high precision
115is a major design goal. The library is built upon and follows the same
116principles as GNU MPFR.")
4a44e743 117 (license lgpl3+)
c44899a2 118 (home-page "http://mpc.multiprecision.org/")))