You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
7.4 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages algebra)
  20. #:use-module (gnu packages)
  21. #:use-module (gnu packages multiprecision)
  22. #:use-module (gnu packages perl)
  23. #:use-module (gnu packages readline)
  24. #:use-module (gnu packages flex)
  25. #:use-module (guix licenses)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix build-system gnu))
  29. (define-public mpfrcx
  30. (package
  31. (name "mpfrcx")
  32. (version "0.4.1")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (string-append
  36. "http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
  37. version ".tar.gz"))
  38. (sha256
  39. (base32
  40. "1rrc75chxyicqjgg5mfhgbz7p9mx1fgh0qlx14a82m25vfhifnd1"))))
  41. (build-system gnu-build-system)
  42. (inputs `(("gmp" ,gmp)
  43. ("mpfr" ,mpfr)
  44. ("mpc" ,mpc)))
  45. (synopsis "mpfrcx, a library for the arithmetic of univariate polynomials
  46. over arbitrary precision real or complex numbers")
  47. (description
  48. "mpfrcx is a library for the arithmetic of univariate polynomials over
  49. arbitrary precision real (mpfr) or complex (mpc) numbers, without control
  50. on the rounding. For the time being, only the few functions needed to
  51. implement the floating point approach to complex multiplication are
  52. implemented. On the other hand, these comprise asymptotically fast
  53. multiplication routines such as ToomCook and the FFT. ")
  54. (license lgpl2.1+)
  55. (home-page "http://mpfrcx.multiprecision.org/")))
  56. (define-public fplll
  57. (package
  58. (name "fplll")
  59. (version "4.0.1")
  60. (source (origin
  61. (method url-fetch)
  62. (uri (string-append
  63. "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
  64. version ".tar.gz"))
  65. (sha256 (base32
  66. "122bpqdlikshhd7nmq0l5qfc0agyk7x21gvplv1l9hb77l8cy9rw"))))
  67. (build-system gnu-build-system)
  68. (inputs `(("gmp" ,gmp)
  69. ("mpfr" ,mpfr)))
  70. (synopsis "fplll, a library for LLL-reduction of euclidean lattices")
  71. (description
  72. "fplll LLL-reduces euclidean lattices. Since version 3, it can also
  73. solve the shortest vector problem.")
  74. (license lgpl2.1+)
  75. (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
  76. (define-public gsl
  77. (package
  78. (name "gsl")
  79. (version "1.15")
  80. (source
  81. (origin
  82. (method url-fetch)
  83. (uri (string-append "mirror://gnu/gsl/gsl-"
  84. version ".tar.gz"))
  85. (sha256
  86. (base32
  87. "18qf6jzz1r3mzb5qynywv4xx3z9g61hgkbpkdrhbgqh2g7jhgfc5"))))
  88. (build-system gnu-build-system)
  89. (home-page "http://www.gnu.org/software/gsl/")
  90. (synopsis "The GNU Scientific Library, a large numerical library")
  91. (description
  92. "The GNU Scientific Library (GSL) is a numerical library for C
  93. and C++ programmers. It is free software under the GNU General
  94. Public License.
  95. The library provides a wide range of mathematical routines such
  96. as random number generators, special functions and least-squares
  97. fitting. There are over 1000 functions in total with an
  98. extensive test suite.")
  99. (license gpl3+)))
  100. (define-public pari-gp
  101. (package
  102. (name "pari-gp")
  103. (version "2.5.3")
  104. (source (origin
  105. (method url-fetch)
  106. (uri (string-append
  107. "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
  108. version ".tar.gz"))
  109. (sha256 (base32
  110. "0zsjccnnv00kwj2gk3ww2v530kjin1rgj8p8hbl4pwcnwc7m68gl"))))
  111. (build-system gnu-build-system)
  112. (inputs `(("gmp" ,gmp)
  113. ("perl" ,perl)
  114. ("readline" ,readline)))
  115. (arguments
  116. '(#:make-flags '("gp")
  117. ;; FIXME: building the documentation requires tex; once this is available,
  118. ;; replace "gp" by "all"
  119. #:test-target "dobench"
  120. #:phases
  121. (alist-replace
  122. 'configure
  123. (lambda* (#:key inputs outputs #:allow-other-keys)
  124. (let ((out (assoc-ref outputs "out"))
  125. (readline (assoc-ref inputs "readline"))
  126. (gmp (assoc-ref inputs "gmp")))
  127. (zero?
  128. (system* "./Configure"
  129. (string-append "--prefix=" out)
  130. (string-append "--with-readline=" readline)
  131. (string-append "--with-gmp=" gmp)))))
  132. ;; FIXME: readline and gmp will be detected automatically in the next
  133. ;; stable release
  134. %standard-phases)))
  135. (synopsis "PARI/GP, a computer algebra system for number theory")
  136. (description
  137. "PARI/GP is a widely used computer algebra system designed for fast
  138. computations in number theory (factorisations, algebraic number theory,
  139. elliptic curves...), but it also contains a large number of other useful
  140. functions to compute with mathematical entities such as matrices,
  141. polynomials, power series, algebraic numbers, etc., and a lot of
  142. transcendental functions.
  143. PARI is also available as a C library to allow for faster computations.")
  144. (license gpl2+)
  145. (home-page "http://pari.math.u-bordeaux.fr/")))
  146. (define-public bc
  147. (package
  148. (name "bc")
  149. (version "1.06")
  150. (source (origin
  151. (method url-fetch)
  152. (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
  153. (sha256
  154. (base32
  155. "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf"))))
  156. (build-system gnu-build-system)
  157. (inputs `(("readline" ,readline)
  158. ("flex" ,flex)))
  159. (arguments
  160. '(#:phases
  161. (alist-replace 'configure
  162. (lambda* (#:key outputs #:allow-other-keys)
  163. ;; This old `configure' script doesn't support
  164. ;; variables passed as arguments.
  165. (let ((out (assoc-ref outputs "out")))
  166. (setenv "CONFIG_SHELL" (which "bash"))
  167. (zero?
  168. (system* "./configure"
  169. (string-append "--prefix=" out)))))
  170. %standard-phases)))
  171. (home-page "http://www.gnu.org/software/bc/")
  172. (synopsis "GNU software calculator")
  173. (description
  174. "bc is an arbitrary precision numeric processing language. Syntax
  175. is similar to C, but differs in many substantial areas. It supports
  176. interactive execution of statements. bc is a utility included in the
  177. POSIX P1003.2/D11 draft standard.
  178. Since the POSIX document does not specify how bc must be implemented,
  179. this version does not use the historical method of having bc be a
  180. compiler for the dc calculator. This version has a single executable
  181. that both compiles the language and runs the resulting `byte code'. The
  182. byte code is not the dc language.")
  183. (license gpl2+)))