distro: Change the module name space to (gnu ...).
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages multiprecision)
20 #:use-module (guix licenses)
21 #:use-module (distro)
22 #:use-module (gnu packages m4)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module (guix build-system gnu))
27
28 (define-public gmp
29 (package
30 (name "gmp")
31 (version "5.1.0")
32 (source (origin
33 (method url-fetch)
34 (uri
35 ;; Note: this version is not available from GNU mirrors
36 ;; because it was made with an Automake affected by
37 ;; CVE-2012-3386.
38 (string-append "ftp://ftp.gmplib.org/pub/gmp-"
39 version "/gmp-" version ".tar.bz2"))
40 (sha256
41 (base32
42 "15n7xxgasbxdch8ii8z9ic6fxc2ysk3q8iavf55abjp5iylspnfz"))))
43 (build-system gnu-build-system)
44 (native-inputs `(("m4" ,m4)))
45 (arguments `(#:configure-flags
46 '(;; Build a "fat binary", with routines for several
47 ;; sub-architectures.
48 "--enable-fat"
49 "--enable-cxx")))
50 (synopsis "GMP, the GNU multiple precision arithmetic library")
51 (description
52 "GMP is a free library for arbitrary precision arithmetic, operating on
53 signed integers, rational numbers, and floating point numbers. There is no
54 practical limit to the precision except the ones implied by the available
55 memory in the machine GMP runs on. GMP has a rich set of functions, and the
56 functions have a regular interface.
57
58 The main target applications for GMP are cryptography applications and
59 research, Internet security applications, algebra systems, computational
60 algebra research, etc.
61
62 GMP is carefully designed to be as fast as possible, both for small operands
63 and for huge operands. The speed is achieved by using fullwords as the basic
64 arithmetic type, by using fast algorithms, with highly optimised assembly
65 code for the most common inner loops for a lot of CPUs, and by a general
66 emphasis on speed.
67
68 GMP is faster than any other bignum library. The advantage for GMP increases
69 with the operand sizes for many operations, since GMP uses asymptotically
70 faster algorithms.")
71 (license lgpl3+)
72 (home-page "http://gmplib.org/")))
73
74 (define-public mpfr
75 (package
76 (name "mpfr")
77 (version "3.1.1")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
81 ".tar.xz"))
82 (sha256 (base32
83 "0ym1ylcq803n52qrggxqmkz66gbn8ncc3ybawal31v5y5p1srma9"))))
84 (build-system gnu-build-system)
85 (inputs `(("gmp" ,gmp)))
86 (synopsis "GNU MPFR, a library for multiple-precision floating-point
87 arithmetic")
88 (description
89 "The GNU MPFR library is a C library for multiple-precision
90 floating-point computations with correct rounding. MPFR is based on the GMP
91 multiple-precision library.
92
93 The main goal of MPFR is to provide a library for multiple-precision
94 floating-point computation which is both efficient and has a well-defined
95 semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
96 double-precision floating-point arithmetic (53-bit mantissa).")
97 (license lgpl3+)
98 (home-page "http://www.mpfr.org/")))
99
100 (define-public mpc
101 (package
102 (name "mpc")
103 (version "1.0.1")
104 (source (origin
105 (method url-fetch)
106 (uri (string-append
107 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
108 (sha256 (base32
109 "1zq0fidp1jii2j5k5n9hmx55a6wwid33gjzhimvxq9d5zrf82npd"))))
110 (build-system gnu-build-system)
111 (inputs `(("gmp" ,gmp)
112 ("mpfr" ,mpfr)))
113 (synopsis "GNU MPC, a library for multiprecision complex arithmetic
114 with exact rounding")
115 (description
116 "GNU MPC is a C library for the arithmetic of complex numbers with
117 arbitrarily high precision and correct rounding of the result. It extends
118 the principles of the IEEE-754 standard for fixed precision real floating
119 point numbers to complex numbers, providing well-defined semantics for
120 every operation. At the same time, speed of operation at high precision
121 is a major design goal. The library is built upon and follows the same
122 principles as GNU MPFR.")
123 (license lgpl3+)
124 (home-page "http://mpc.multiprecision.org/")))