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