Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / distro / packages / multiprecision.scm
1 ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2 ;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of Guix.
5 ;;;
6 ;;; 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 ;;; 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 Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (distro packages multiprecision)
20 #:use-module (guix licenses)
21 #:use-module (distro)
22 #:use-module (distro 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.0.5")
32 (source (origin
33 (method url-fetch)
34 (uri (string-append "mirror://gnu/gmp/gmp-" version
35 ".tar.bz2"))
36 (sha256
37 (base32
38 "1jfymbr90mpn0zw5sg001llqnvf2462y77vgjknrmfs1rjn8ln0z"))))
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")))
46 (synopsis "GMP, the GNU multiple precision arithmetic library")
47 (description
48 "GMP is a free library for arbitrary precision arithmetic, operating on
49 signed integers, rational numbers, and floating point numbers. There is no
50 practical limit to the precision except the ones implied by the available
51 memory in the machine GMP runs on. GMP has a rich set of functions, and the
52 functions have a regular interface.
53
54 The main target applications for GMP are cryptography applications and
55 research, Internet security applications, algebra systems, computational
56 algebra research, etc.
57
58 GMP is carefully designed to be as fast as possible, both for small operands
59 and for huge operands. The speed is achieved by using fullwords as the basic
60 arithmetic type, by using fast algorithms, with highly optimised assembly
61 code for the most common inner loops for a lot of CPUs, and by a general
62 emphasis on speed.
63
64 GMP is faster than any other bignum library. The advantage for GMP increases
65 with the operand sizes for many operations, since GMP uses asymptotically
66 faster algorithms.")
67 (license lgpl3+)
68 (home-page "http://gmplib.org/")))
69
70 (define-public mpfr
71 (package
72 (name "mpfr")
73 (version "3.1.1")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
77 ".tar.xz"))
78 (sha256 (base32
79 "0ym1ylcq803n52qrggxqmkz66gbn8ncc3ybawal31v5y5p1srma9"))))
80 (build-system gnu-build-system)
81 (inputs `(("gmp" ,gmp)))
82 (synopsis "GNU MPFR, a library for multiple-precision floating-point
83 arithmetic")
84 (description
85 "The GNU MPFR library is a C library for multiple-precision
86 floating-point computations with correct rounding. MPFR is based on the GMP
87 multiple-precision library.
88
89 The main goal of MPFR is to provide a library for multiple-precision
90 floating-point computation which is both efficient and has a well-defined
91 semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
92 double-precision floating-point arithmetic (53-bit mantissa).")
93 (license lgpl3+)
94 (home-page "http://www.mpfr.org/")))
95
96 (define-public mpc
97 (package
98 (name "mpc")
99 (version "1.0.1")
100 (source (origin
101 (method url-fetch)
102 (uri (string-append
103 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
104 (sha256 (base32
105 "1zq0fidp1jii2j5k5n9hmx55a6wwid33gjzhimvxq9d5zrf82npd"))))
106 (build-system gnu-build-system)
107 (inputs `(("gmp" ,gmp)
108 ("mpfr" ,mpfr)))
109 (synopsis "GNU MPC, a library for multiprecision complex arithmetic
110 with exact rounding")
111 (description
112 "GNU MPC is a C library for the arithmetic of complex numbers with
113 arbitrarily high precision and correct rounding of the result. It extends
114 the principles of the IEEE-754 standard for fixed precision real floating
115 point numbers to complex numbers, providing well-defined semantics for
116 every operation. At the same time, speed of operation at high precision
117 is a major design goal. The library is built upon and follows the same
118 principles as GNU MPFR.")
119 (license lgpl3+)
120 (home-page "http://mpc.multiprecision.org/")))