1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages algebra)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages multiprecision)
24 #:use-module (gnu packages mpi)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages readline)
27 #:use-module (gnu packages flex)
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix utils))
42 "http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
46 "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy"))))
47 (build-system gnu-build-system)
48 (inputs `(("gmp" ,gmp)
51 (synopsis "mpfrcx, a library for the arithmetic of univariate polynomials
52 over arbitrary precision real or complex numbers")
54 "mpfrcx is a library for the arithmetic of univariate polynomials over
55 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
56 on the rounding. For the time being, only the few functions needed to
57 implement the floating point approach to complex multiplication are
58 implemented. On the other hand, these comprise asymptotically fast
59 multiplication routines such as Toom–Cook and the FFT. ")
61 (home-page "http://mpfrcx.multiprecision.org/")))
70 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
73 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
74 (build-system gnu-build-system)
75 (inputs `(("gmp" ,gmp)
77 (synopsis "fplll, a library for LLL-reduction of euclidean lattices")
79 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
80 solve the shortest vector problem.")
82 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
84 (define-public pari-gp
91 "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
94 "1hk7lmq09crr9jvia8nxzhvbwf8mw62xk456i96jg8dljh0r9sgz"))))
95 (build-system gnu-build-system)
96 (inputs `(("gmp" ,gmp)
98 ("readline" ,readline)))
100 '(#:make-flags '("gp")
101 ;; FIXME: building the documentation requires tex; once this is available,
102 ;; replace "gp" by "all"
103 #:test-target "dobench"
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out")))
110 (system* "./Configure" (string-append "--prefix=" out)))))
112 (synopsis "PARI/GP, a computer algebra system for number theory")
114 "PARI/GP is a widely used computer algebra system designed for fast
115 computations in number theory (factorisations, algebraic number theory,
116 elliptic curves...), but it also contains a large number of other useful
117 functions to compute with mathematical entities such as matrices,
118 polynomials, power series, algebraic numbers, etc., and a lot of
119 transcendental functions.
120 PARI is also available as a C library to allow for faster computations.")
122 (home-page "http://pari.math.u-bordeaux.fr/")))
131 "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
134 "1p36060vwhn38j77r4c3jqyaslvhvgm6fdw2486k7krxk5ai7ph5"))))
135 (build-system gnu-build-system)
136 (native-inputs `(("perl" ,perl)))
137 (inputs `(("pari-gp" ,pari-gp)))
140 (list (string-append "--with-paricfg="
141 (assoc-ref %build-inputs "pari-gp")
142 "/lib/pari/pari.cfg"))))
143 (synopsis "PARI/GP, a computer algebra system for number theory")
145 "PARI/GP is a widely used computer algebra system designed for fast
146 computations in number theory (factorisations, algebraic number theory,
147 elliptic curves...), but it also contains a large number of other useful
148 functions to compute with mathematical entities such as matrices,
149 polynomials, power series, algebraic numbers, etc., and a lot of
150 transcendental functions.
151 PARI is also available as a C library to allow for faster computations.
153 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
155 (home-page "http://pari.math.u-bordeaux.fr/")))
163 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
166 "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf"))))
167 (build-system gnu-build-system)
168 (inputs `(("readline" ,readline)))
169 (native-inputs `(("flex" ,flex)))
172 (alist-replace 'configure
173 (lambda* (#:key outputs #:allow-other-keys)
174 ;; This old `configure' script doesn't support
175 ;; variables passed as arguments.
176 (let ((out (assoc-ref outputs "out")))
177 (setenv "CONFIG_SHELL" (which "bash"))
181 (string-append "--prefix=" out)
182 ;; By default, man and info pages are put in
183 ;; PREFIX/{man,info}, but we want them in
184 ;; PREFIX/share/{man,info}.
185 (string-append "--mandir=" out "/share/man")
186 (string-append "--infodir=" out "/share/info")))))
188 (home-page "http://www.gnu.org/software/bc/")
189 (synopsis "Arbitrary precision numeric processing language")
191 "bc is an arbitrary precision numeric processing language. It includes
192 an interactive environment for evaluating mathematical statements. Its
193 syntax is similar to that of C, so basic usage is familiar. It also includes
194 \"dc\", a reverse-polish calculator.")
203 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
207 "10h9mzjxnwlsjziah4lri85scc05rlajz39nqf3mbh4vja8dw34g"))))
208 (build-system gnu-build-system)
210 '(#:configure-flags '("--enable-shared" "--enable-openmp")
211 #:phases (alist-cons-before
214 ;; By default '-mtune=native' is used. However, that may
215 ;; cause the use of ISA extensions (SSE2, etc.) that are
216 ;; not necessarily available on the user's machine when
217 ;; that package is built on a different machine.
218 (substitute* (find-files "." "Makefile$")
219 (("-mtune=native") "")))
221 (native-inputs `(("perl" ,perl)))
222 (home-page "http://fftw.org")
223 (synopsis "Computing the discrete Fourier transform")
225 "FFTW is a C subroutine library for computing the discrete Fourier
226 transform (DFT) in one or more dimensions, of arbitrary input size, and of
227 both real and complex data (as well as of even/odd data---i.e. the discrete
228 cosine/ sine transforms or DCT/DST).")
232 (package (inherit fftw)
235 (substitute-keyword-arguments (package-arguments fftw)
236 ((#:configure-flags cf)
237 `(cons "--enable-float" ,cf))))
239 (string-append (package-description fftw)
240 " Single-precision version."))))
242 (define-public fftw-openmpi
243 (package (inherit fftw)
244 (name "fftw-openmpi")
246 `(("openmpi" ,openmpi)
247 ,@(package-inputs fftw)))
249 (substitute-keyword-arguments (package-arguments fftw)
250 ((#:configure-flags cf)
251 `(cons "--enable-mpi" ,cf))))
253 (string-append (package-description fftw)
254 " With OpenMPI parallelism support."))))