multiprecision.scm 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
  5. ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  6. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages multiprecision)
  23. #:use-module (guix licenses)
  24. #:use-module (gnu packages)
  25. #:use-module (gnu packages m4)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix utils)
  29. #:use-module (guix build-system gnu))
  30. (define-public gmp
  31. (package
  32. (name "gmp")
  33. (version "6.1.2")
  34. (source (origin
  35. (method url-fetch)
  36. (uri
  37. (string-append "mirror://gnu/gmp/gmp-"
  38. version ".tar.xz"))
  39. (sha256
  40. (base32
  41. "04hrwahdxyqdik559604r7wrj9ffklwvipgfxgj4ys4skbl6bdc7"))
  42. (patches (search-patches "gmp-faulty-test.patch"))))
  43. (build-system gnu-build-system)
  44. (native-inputs `(("m4" ,m4)))
  45. (outputs '("out" "debug"))
  46. (arguments `(#:parallel-tests? #f ; mpz/reuse fails otherwise
  47. #:configure-flags
  48. '(;; Build a "fat binary", with routines for several
  49. ;; sub-architectures.
  50. "--enable-fat"
  51. "--enable-cxx"
  52. ,@(cond ((target-mingw?)
  53. ;; Static and shared cannot be built in one go:
  54. ;; they produce different headers. We need shared.
  55. `("--disable-static"
  56. "--enable-shared"))
  57. (else '())))))
  58. (synopsis "Multiple-precision arithmetic library")
  59. (description
  60. "GMP is a library for arbitrary precision arithmetic, operating on
  61. signed integers, rational numbers and floating point numbers. The precision
  62. is only limited by the available memory. The library is highly optimized,
  63. with a design focus on execution speed. It is aimed at use in, for example,
  64. cryptography and computational algebra.")
  65. (license lgpl3+)
  66. (home-page "http://gmplib.org/")))
  67. (define-public gmp-6.0
  68. ;; We keep this one around to bootstrap GCC, to work around a compilation
  69. ;; issue on ARM. See
  70. ;; <https://gmplib.org/list-archives/gmp-bugs/2015-December/003848.html>.
  71. (package
  72. (inherit gmp)
  73. (version "6.0.0a")
  74. (source (origin
  75. (method url-fetch)
  76. (uri (string-append "mirror://gnu/gmp/gmp-"
  77. version ".tar.xz"))
  78. (sha256
  79. (base32
  80. "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
  81. (patches (search-patches "gmp-arm-asm-nothumb.patch"
  82. "gmp-faulty-test.patch"))))))
  83. (define-public mpfr
  84. (package
  85. (name "mpfr")
  86. (version "3.1.5")
  87. (source (origin
  88. (method url-fetch)
  89. (uri (string-append "mirror://gnu/mpfr/mpfr-" version
  90. ".tar.xz"))
  91. (sha256 (base32
  92. "1g32l2fg8f62lcyzzh88y3fsh6rk539qc6ahhdgvx7wpnf1dwpq1"))))
  93. (build-system gnu-build-system)
  94. (outputs '("out" "debug"))
  95. (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
  96. (synopsis "C library for arbitrary precision floating-point arithmetic")
  97. (description
  98. "GNU MPFR is a C library for performing multiple-precision,
  99. floating-point computations with correct rounding.")
  100. (license lgpl3+)
  101. (home-page "http://www.mpfr.org/")))
  102. (define-public mpc
  103. (package
  104. (name "mpc")
  105. (version "1.0.3")
  106. (source (origin
  107. (method url-fetch)
  108. (uri (string-append
  109. "mirror://gnu/mpc/mpc-" version ".tar.gz"))
  110. (sha256
  111. (base32
  112. "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))
  113. (build-system gnu-build-system)
  114. (outputs '("out" "debug"))
  115. (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
  116. ("mpfr" ,mpfr)))
  117. (synopsis "C library for arbitrary precision complex arithmetic")
  118. (description
  119. "GNU MPC is a C library for performing arithmetic on complex numbers.
  120. It supports arbitrarily high precision and it correctly rounds the results.")
  121. (license lgpl3+)
  122. (home-page "http://mpc.multiprecision.org/")))
  123. (define-public mpfi
  124. (package
  125. (name "mpfi")
  126. (version "1.5.1")
  127. (source (origin
  128. (method url-fetch)
  129. (uri (string-append "https://gforge.inria.fr/frs/download.php/"
  130. "file/30130/mpfi-" version ".tar.gz"))
  131. (sha256
  132. (base32
  133. "1g2q6i7dqx40p4gw11da6jgfcbzmm26wxc69fwv8zpcdyg32a9za"))))
  134. (build-system gnu-build-system)
  135. (propagated-inputs `(("gmp" ,gmp) ; <mpfi.h> refers to both
  136. ("mpfr" ,mpfr)))
  137. (synopsis "C library for arbitrary precision interval arithmetic")
  138. (description "MPFI is intended to be a portable library written in C for
  139. arbitrary precision interval arithmetic with intervals represented using MPFR
  140. reliable floating-point numbers. It is based on the GNU MP library and on the
  141. MPFR library. The purpose of an arbitrary precision interval arithmetic is on
  142. the one hand to get guaranteed results, thanks to interval computation, and on
  143. the other hand to obtain accurate results, thanks to multiple precision
  144. arithmetic.")
  145. (license lgpl2.1+)
  146. (home-page "https://perso.ens-lyon.fr/nathalie.revol/software.html")))