distro: Use `mirror://' URLs.
[jackhill/guix/guix.git] / distro / packages / multiprecision.scm
CommitLineData
c44899a2
LC
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 (distro)
21 #:use-module (distro packages m4)
22 #:use-module (guix packages)
87f5d366 23 #:use-module (guix download)
c44899a2
LC
24 #:use-module (guix utils)
25 #:use-module (guix build-system gnu))
26
27(define-public gmp
28 (package
29 (name "gmp")
30 (version "5.0.5")
31 (source (origin
87f5d366 32 (method url-fetch)
0db342a5 33 (uri (string-append "mirror://gnu/gmp/gmp-" version
c44899a2
LC
34 ".tar.bz2"))
35 (sha256
36 (base32
37 "1jfymbr90mpn0zw5sg001llqnvf2462y77vgjknrmfs1rjn8ln0z"))))
38 (build-system gnu-build-system)
39 (native-inputs `(("m4" ,m4)))
40 (arguments `(#:configure-flags
41 '(;; Build a "fat binary", with routines for several
42 ;; sub-architectures.
43 "--enable-fat"
44 "--enable-cxx")))
45 (synopsis "GMP, the GNU multiple precision arithmetic library")
46 (description
47 "GMP is a free library for arbitrary precision arithmetic, operating on
48signed integers, rational numbers, and floating point numbers. There is no
49practical limit to the precision except the ones implied by the available
50memory in the machine GMP runs on. GMP has a rich set of functions, and the
51functions have a regular interface.
52
53The main target applications for GMP are cryptography applications and
54research, Internet security applications, algebra systems, computational
55algebra research, etc.
56
57GMP is carefully designed to be as fast as possible, both for small operands
58and for huge operands. The speed is achieved by using fullwords as the basic
59arithmetic type, by using fast algorithms, with highly optimised assembly
60code for the most common inner loops for a lot of CPUs, and by a general
61emphasis on speed.
62
63GMP is faster than any other bignum library. The advantage for GMP increases
64with the operand sizes for many operations, since GMP uses asymptotically
65faster algorithms.")
66 (license "LGPLv3+")
67 (home-page "http://gmplib.org/")))
68
69(define-public mpfr
70 (package
71 (name "mpfr")
72 (version "3.1.1")
73 (source (origin
87f5d366 74 (method url-fetch)
0db342a5 75 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
c44899a2
LC
76 ".tar.xz"))
77 (sha256 (base32
78 "0ym1ylcq803n52qrggxqmkz66gbn8ncc3ybawal31v5y5p1srma9"))))
79 (build-system gnu-build-system)
80 (inputs `(("gmp" ,gmp)))
81 (synopsis "GNU MPFR, a library for multiple-precision floating-point
82arithmetic")
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).")
92 (license "LGPLv3+")
93 (home-page "http://www.mpfr.org/")))
94
95(define-public mpc
96 (package
97 (name "mpc")
98 (version "1.0")
99 (source (origin
87f5d366 100 (method url-fetch)
c44899a2
LC
101 (uri (string-append
102 "http://www.multiprecision.org/mpc/download/mpc-"
103 version ".tar.gz"))
104 (sha256 (base32
105 "00rxjmkpqnv6zzcyw9aa5w6rzaav32ys87km25zgfcv9i32km5cw"))))
106 (build-system gnu-build-system)
107 (inputs `(("gmp" ,gmp)
108 ("mpfr" ,mpfr)))
109 (synopsis "GNU MPC, a library for multiprecision complex arithmetic
110with exact rounding")
111 (description
112 "GNU MPC is a C library for the arithmetic of complex numbers with
113arbitrarily high precision and correct rounding of the result. It is built
114upon and follows the same principles as GNU MPFR.")
115 (license "LGPLv3+")
116 (home-page "http://mpc.multiprecision.org/")))