gnu: bluez: Remove leftover patch.
[jackhill/guix/guix.git] / gnu / packages / algebra.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
21abf092 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Andreas Enge <andreas@enge.fr>
7355634d 3;;; Copyright © 2013, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
2f36d90f 4;;; Copyright © 2016, 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
e2ca23c5 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
3b13c3c0 6;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
ecc5bc33 7;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
f0bacad6 8;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
f71f29ca 9;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
2ed139c4 10;;;
233e7676 11;;; This file is part of GNU Guix.
2ed139c4 12;;;
233e7676 13;;; GNU Guix is free software; you can redistribute it and/or modify it
2ed139c4
AE
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
233e7676 18;;; GNU Guix is distributed in the hope that it will be useful, but
2ed139c4
AE
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
233e7676 24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
2ed139c4 25
1ffa7090 26(define-module (gnu packages algebra)
59a43334 27 #:use-module (gnu packages)
14e6520e 28 #:use-module (gnu packages autotools)
10b1f688 29 #:use-module (gnu packages compression)
99828fa7 30 #:use-module (gnu packages documentation)
f71f29ca 31 #:use-module (gnu packages ed)
5894b604 32 #:use-module (gnu packages flex)
57497c57
NG
33 #:use-module (gnu packages fltk)
34 #:use-module (gnu packages gl)
aae03c48 35 #:use-module (gnu packages graphviz)
57497c57 36 #:use-module (gnu packages image)
aae03c48 37 #:use-module (gnu packages maths)
0fc54d4b 38 #:use-module (gnu packages mpi)
5894b604 39 #:use-module (gnu packages multiprecision)
1ffa7090 40 #:use-module (gnu packages perl)
aae03c48 41 #:use-module (gnu packages python)
5894b604 42 #:use-module (gnu packages readline)
b7194849 43 #:use-module (gnu packages shells)
8f9ac901 44 #:use-module (gnu packages tex)
f71f29ca 45 #:use-module (gnu packages texinfo)
57497c57 46 #:use-module (gnu packages xiph)
fb8d1be8 47 #:use-module (gnu packages xorg)
7569c5cb 48 #:use-module (guix build-system gnu)
8f4b1dfb 49 #:use-module (guix build-system cmake)
5894b604
TGR
50 #:use-module (guix download)
51 #:use-module ((guix licenses) #:prefix license:)
52 #:use-module (guix packages)
7569c5cb 53 #:use-module (guix utils))
2ed139c4
AE
54
55
56(define-public mpfrcx
57 (package
58 (name "mpfrcx")
9c68798d 59 (version "0.4.2")
2ed139c4
AE
60 (source (origin
61 (method url-fetch)
62 (uri (string-append
63 "http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
64 version ".tar.gz"))
65 (sha256
66 (base32
9c68798d 67 "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy"))))
2ed139c4 68 (build-system gnu-build-system)
878c8f3f
AE
69 (propagated-inputs
70 `(("gmp" ,gmp)
71 ("mpfr" ,mpfr)
72 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
35b9e423 73 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
2ed139c4 74 (description
35b9e423 75 "Mpfrcx is a library for the arithmetic of univariate polynomials over
2ed139c4 76arbitrary precision real (mpfr) or complex (mpc) numbers, without control
35b9e423 77on the rounding. For the time being, only the few functions needed to
2ed139c4 78implement the floating point approach to complex multiplication are
35b9e423 79implemented. On the other hand, these comprise asymptotically fast
e881752c 80multiplication routines such as Toom–Cook and the FFT.")
9f51293c 81 (license license:lgpl2.1+)
2ed139c4
AE
82 (home-page "http://mpfrcx.multiprecision.org/")))
83
10b1f688
AE
84(define-public cm
85 (package
86 (name "cm")
81b55bf7 87 (version "0.3")
10b1f688
AE
88 (source (origin
89 (method url-fetch)
90 (uri (string-append
91 "http://www.multiprecision.org/cm/download/cm-"
92 version ".tar.gz"))
93 (sha256
94 (base32
81b55bf7 95 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
10b1f688
AE
96 (build-system gnu-build-system)
97 (propagated-inputs
98 `(("mpfrcx" ,mpfrcx)
99 ("zlib" ,zlib))) ; Header files included from cm_common.h.
100 (inputs
101 `(("pari-gp" ,pari-gp)))
102 (synopsis "CM constructions for elliptic curves")
103 (description
104 "The CM software implements the construction of ring class fields of
105imaginary quadratic number fields and of elliptic curves with complex
106multiplication via floating point approximations. It consists of libraries
107that can be called from within a C program and of executable command
108line applications.")
81b55bf7 109 (license license:gpl3+)
10b1f688
AE
110 (home-page "http://cm.multiprecision.org/")))
111
2ed139c4
AE
112(define-public fplll
113 (package
114 (name "fplll")
5a15ed50 115 (version "4.0.4")
2ed139c4
AE
116 (source (origin
117 (method url-fetch)
118 (uri (string-append
119 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
120 version ".tar.gz"))
121 (sha256 (base32
5a15ed50 122 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
2ed139c4
AE
123 (build-system gnu-build-system)
124 (inputs `(("gmp" ,gmp)
125 ("mpfr" ,mpfr)))
35b9e423 126 (synopsis "Library for LLL-reduction of euclidean lattices")
2ed139c4 127 (description
35b9e423 128 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
2ed139c4 129solve the shortest vector problem.")
9f51293c 130 (license license:lgpl2.1+)
2ed139c4 131 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
4e6b699d 132
90a6d47c
AE
133(define-public pari-gp
134 (package
135 (name "pari-gp")
c64692a7 136 (version "2.9.3")
90a6d47c
AE
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
140 "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
141 version ".tar.gz"))
f78c66aa
AE
142 (sha256
143 (base32
c64692a7 144 "0qqal1lpggd6dvs19svnz0dil86xk0xkcj5s3b7104ibkmvjfsp7"))))
90a6d47c 145 (build-system gnu-build-system)
a8b0948b 146 (native-inputs `(("texlive" ,texlive-tiny)))
90a6d47c 147 (inputs `(("gmp" ,gmp)
fb8d1be8 148 ("libx11" ,libx11)
90a6d47c
AE
149 ("perl" ,perl)
150 ("readline" ,readline)))
151 (arguments
9bd9486d 152 '(#:make-flags '("all")
12abb19d 153 #:test-target "dobench"
08595262
AE
154 #:phases (modify-phases %standard-phases
155 (replace 'configure
156 (lambda* (#:key outputs #:allow-other-keys)
157 (let ((out (assoc-ref outputs "out")))
158 (zero?
159 (system* "./Configure"
160 (string-append "--prefix=" out)))))))))
90a6d47c
AE
161 (synopsis "PARI/GP, a computer algebra system for number theory")
162 (description
163 "PARI/GP is a widely used computer algebra system designed for fast
164computations in number theory (factorisations, algebraic number theory,
165elliptic curves...), but it also contains a large number of other useful
166functions to compute with mathematical entities such as matrices,
167polynomials, power series, algebraic numbers, etc., and a lot of
168transcendental functions.
169PARI is also available as a C library to allow for faster computations.")
9f51293c 170 (license license:gpl2+)
90a6d47c 171 (home-page "http://pari.math.u-bordeaux.fr/")))
ed9f9a77 172
f854a8c1
AE
173(define-public gp2c
174 (package
175 (name "gp2c")
0a77fdf4 176 (version "0.0.10")
f854a8c1
AE
177 (source (origin
178 (method url-fetch)
179 (uri (string-append
180 "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
181 version ".tar.gz"))
324bdcd8
AE
182 (sha256
183 (base32
0a77fdf4 184 "1xhpz5p81iw261ay1kip283ggr0ir8ydz8qx3v24z8jfms1r3y70"))))
f854a8c1 185 (build-system gnu-build-system)
c67ccedd 186 (native-inputs `(("perl" ,perl)))
f854a8c1
AE
187 (inputs `(("pari-gp" ,pari-gp)))
188 (arguments
189 '(#:configure-flags
190 (list (string-append "--with-paricfg="
191 (assoc-ref %build-inputs "pari-gp")
192 "/lib/pari/pari.cfg"))))
193 (synopsis "PARI/GP, a computer algebra system for number theory")
194 (description
195 "PARI/GP is a widely used computer algebra system designed for fast
196computations in number theory (factorisations, algebraic number theory,
197elliptic curves...), but it also contains a large number of other useful
198functions to compute with mathematical entities such as matrices,
199polynomials, power series, algebraic numbers, etc., and a lot of
200transcendental functions.
201PARI is also available as a C library to allow for faster computations.
202
203GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
9f51293c 204 (license license:gpl2)
f854a8c1
AE
205 (home-page "http://pari.math.u-bordeaux.fr/")))
206
57497c57
NG
207(define-public giac-xcas
208 (package
209 (name "giac-xcas")
1286ff61 210 (version "1.2.3-57")
57497c57
NG
211 (source (origin
212 (method url-fetch)
213 ;; "~parisse/giac" is not used because the maintainer regularly
214 ;; overwrites the release tarball there, introducing a checksum
215 ;; mismatch every time. See
216 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
217 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
218 "~parisse/debian/dists/stable/main/"
219 "source/giac_" version ".tar.gz"))
220 (sha256
221 (base32
1286ff61 222 "0a7c1r2rgsin671qy98yvwgkg6a81d0pp0p4p7sydhrfi1k9xpr1"))))
57497c57
NG
223 (build-system gnu-build-system)
224 (arguments
225 `(#:phases
226 (modify-phases %standard-phases
227 (add-after 'unpack 'patch-bin-cp
228 (lambda _
229 ;; Some Makefiles contain hard-coded "/bin/cp".
230 (substitute* (find-files "doc" "^Makefile")
231 (("/bin/cp") (which "cp")))
232 #t))
233 (add-after 'unpack 'disable-broken-test
234 (lambda _
235 ;; Disable failing test. Actually, the results are correct but
236 ;; a sorting discrepancy prevents the test from being validated.
237 (substitute* "check/Makefile.in"
238 (("chk_fhan16") ""))
239 #t)))))
240 (inputs
241 `(("fltk" ,fltk)
242 ("gmp" ,gmp)
243 ("gsl" ,gsl)
244 ("lapack" ,lapack)
245 ("libao" ,ao)
246 ("libjpeg" ,libjpeg)
247 ("libpng" ,libpng)
248 ("libx11" ,libx11)
99a00446 249 ("libxinerama" ,libxinerama)
57497c57
NG
250 ("libxft" ,libxft)
251 ("libxt" ,libxt)
252 ("mesa" ,mesa)
253 ("mpfi" ,mpfi)
254 ("mpfr" ,mpfr)
255 ("ntl" ,ntl)
256 ("perl" ,perl)
257 ("pari-gp" ,pari-gp)
258 ("tcsh" ,tcsh)
a023ec6e 259 ("texlive" ,texlive-tiny)))
57497c57
NG
260 (native-inputs `(("readline" ,readline)))
261 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
262 (synopsis "Computer algebra system")
263 (description
264 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
265maple, mupad and the TI89. It is available as a standalone program (graphic
266or text interfaces) or as a C++ library.")
267 (license license:gpl3+)))
268
d7ab698a
AE
269(define-public flint
270 (package
271 (name "flint")
6c591c8e 272 (version "2.5.2")
d7ab698a
AE
273 (source (origin
274 (method url-fetch)
275 (uri (string-append
276 "http://flintlib.org/flint-"
277 version ".tar.gz"))
278 (sha256 (base32
6c591c8e 279 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
fc1adab1 280 (patches (search-patches "flint-ldconfig.patch"))))
d7ab698a 281 (build-system gnu-build-system)
df15d17d 282 (propagated-inputs
d7ab698a 283 `(("gmp" ,gmp)
df15d17d 284 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
d7ab698a 285 (arguments
ad11974e
AE
286 `(#:parallel-tests? #f ; seems to be necessary on arm
287 #:phases
91430de6
AE
288 (modify-phases %standard-phases
289 (replace 'configure
290 (lambda* (#:key inputs outputs #:allow-other-keys)
291 (let ((out (assoc-ref outputs "out"))
292 (gmp (assoc-ref inputs "gmp"))
293 (mpfr (assoc-ref inputs "mpfr")))
91430de6
AE
294 ;; do not pass "--enable-fast-install", which makes the
295 ;; homebrew configure process fail
296 (zero? (system*
297 "./configure"
298 (string-append "--prefix=" out)
299 (string-append "--with-gmp=" gmp)
300 (string-append "--with-mpfr=" mpfr)))))))))
d7ab698a
AE
301 (synopsis "Fast library for number theory")
302 (description
303 "FLINT is a C library for number theory. It supports arithmetic
304with numbers, polynomials, power series and matrices over many base
305rings, including multiprecision integers and rationals, integers
306modulo n, p-adic numbers, finite fields (prime and non-prime order)
307and real and complex numbers (via the Arb extension library).
308
309Operations that can be performed include conversions, arithmetic,
310GCDs, factoring, solving linear systems, and evaluating special
311functions. In addition, FLINT provides various low-level routines for
312fast arithmetic.")
9f51293c 313 (license license:gpl2+)
d7ab698a
AE
314 (home-page "http://flintlib.org/")))
315
6b8e8285
AE
316(define-public arb
317 (package
318 (name "arb")
21abf092 319 (version "2.10.0")
6b8e8285
AE
320 (source (origin
321 (method url-fetch)
322 (uri (string-append
323 "https://github.com/fredrik-johansson/arb/archive/"
324 version ".tar.gz"))
f586c877 325 (file-name (string-append name "-" version ".tar.gz"))
424ce93d
AE
326 (sha256
327 (base32
21abf092 328 "0jwcv9ssvi8axb1y7m2h4ykgyl015cl6g28gfl92l4dgnag585ak"))))
6b8e8285 329 (build-system gnu-build-system)
480d19e6
AE
330 (propagated-inputs
331 `(("flint" ,flint))) ; flint.h is included by arf.h
6b8e8285 332 (inputs
480d19e6 333 `(("gmp" ,gmp)
6b8e8285
AE
334 ("mpfr" ,mpfr)))
335 (arguments
336 `(#:phases
337 (alist-replace
338 'configure
339 (lambda* (#:key inputs outputs #:allow-other-keys)
340 (let ((out (assoc-ref outputs "out"))
341 (flint (assoc-ref inputs "flint"))
342 (gmp (assoc-ref inputs "gmp"))
343 (mpfr (assoc-ref inputs "mpfr")))
344 ;; do not pass "--enable-fast-install", which makes the
345 ;; homebrew configure process fail
346 (zero? (system*
347 "./configure"
348 (string-append "--prefix=" out)
349 (string-append "--with-flint=" flint)
350 (string-append "--with-gmp=" gmp)
351 (string-append "--with-mpfr=" mpfr)))))
352 %standard-phases)))
353 (synopsis "Arbitrary precision floating-point ball arithmetic")
354 (description
355 "Arb is a C library for arbitrary-precision floating-point ball
356arithmetic. It supports efficient high-precision computation with
357polynomials, power series, matrices and special functions over the
358real and complex numbers, with automatic, rigorous error control.")
9f51293c 359 (license license:gpl2+)
6b8e8285
AE
360 (home-page "http://fredrikj.net/arb/")))
361
14e6520e
AE
362(define-public ntl
363 (package
364 (name "ntl")
365 (version "9.7.0")
366 (source (origin
367 (method url-fetch)
368 (uri (string-append "http://shoup.net/ntl/ntl-"
369 version ".tar.gz"))
370 (sha256 (base32
371 "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq"))))
372 (build-system gnu-build-system)
373 (native-inputs
374 `(("libtool" ,libtool)
375 ("perl" ,perl))) ; for configuration
376 ;; FIXME: Add optional input gf2x once available; then also add
377 ;; configure flag "NTL_GF2X_LIB=on".
378 (inputs
379 `(("gmp" ,gmp)))
380 (arguments
381 `(#:phases
382 (modify-phases %standard-phases
383 (replace 'configure
384 (lambda* (#:key outputs #:allow-other-keys)
385 (chdir "src")
386 (system* "./configure"
387 (string-append "PREFIX=" (assoc-ref outputs "out"))
388 ;; Do not build especially for the build machine.
389 "NATIVE=off"
390 ;; Also do not tune to the build machine.
391 "WIZARD=off"
392 "SHARED=on")
393 #t)))))
394 (synopsis "C++ library for number theory")
395 (description
396 "NTL is a C++ library providing data structures and algorithms
397for manipulating signed, arbitrary length integers, and for vectors,
398matrices, and polynomials over the integers and over finite fields.")
399 (license license:gpl2+)
400 (home-page "http://shoup.net/ntl/")))
401
aae03c48
AE
402(define-public singular
403 (package
404 (name "singular")
405 (version "4.0.3")
406 (source (origin
407 (method url-fetch)
408 (uri (string-append "http://www.mathematik.uni-kl.de/ftp/pub/"
409 "Math/Singular/SOURCES/"
410 (string-join (string-split version #\.) "-")
411 "/singular-" version ".tar.gz"))
412 (sha256 (base32
7d4c6ee8 413 "0viidy2fz62rln9p0s9qfs7fnm55c6fw1agydd1py26gxylp1ksc"))))
aae03c48
AE
414 (build-system gnu-build-system)
415 (native-inputs
416 `(("doxygen" ,doxygen)
417 ("graphviz" ,graphviz)
418 ("perl" ,perl)))
419 (inputs
420 `(("cddlib" ,cddlib)
421 ("gmp" ,gmp)
422 ("flint" ,flint)
423 ("mpfr" ,mpfr)
424 ("ntl" ,ntl)
425 ("python" ,python-2)
426 ("readline" ,readline)))
427 (arguments
428 `(#:configure-flags
429 (list (string-append "--with-ntl="
430 (assoc-ref %build-inputs "ntl")))))
431 (synopsis "Computer algebra system for polynomial computations")
432 (description
433 "Singular is a computer algebra system for polynomial computations,
434with special emphasis on commutative and non-commutative algebra, algebraic
435geometry and singularity theory.")
436 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
437 ;; libraries with which it links are licensed under lgpl3+, so the
438 ;; combined work becomes gpl3. See COPYING in the source code.
439 (license license:gpl3)
440 (home-page "http://www.singular.uni-kl.de/index.php")))
441
57c9c349
AE
442(define-public gmp-ecm
443 (package
444 (name "gmp-ecm")
445 (version "7.0")
446 (source (origin
447 (method url-fetch)
448 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
449 "file/35642/ecm-"
450 version ".tar.gz"))
451 (sha256 (base32
452 "00jzzwqp49m01vwsr9z1w7bvm8lb69l3f62x7qr8sfz0xiczxnpm"))))
453 (build-system gnu-build-system)
454 (inputs
455 `(("gmp" ,gmp)))
456 (arguments
457 `(#:configure-flags '("--enable-shared"
458 ;; Disable specific assembly routines, which depend
459 ;; on the subarchitecture of the build machine,
460 ;; and use gmp instead.
461 "--disable-asm-redc")))
462 (synopsis "Integer factorization library using the elliptic curve method")
463 (description
464 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
465as the P-1 and P+1 algorithms. It provides a library and a stand-alone
466binary.")
467 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
468 ;; so the combined work is under gpl3+.
469 (license license:gpl3+)
470 (home-page "http://ecm.gforge.inria.fr/")))
471
ed9f9a77
LC
472(define-public bc
473 (package
474 (name "bc")
f71f29ca 475 (version "1.07.1")
ed9f9a77
LC
476 (source (origin
477 (method url-fetch)
478 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
479 (sha256
480 (base32
f71f29ca 481 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
ed9f9a77 482 (build-system gnu-build-system)
f71f29ca
MB
483 (native-inputs
484 `(("ed" ,ed)
485 ("flex" ,flex)
486 ("texinfo" ,texinfo)))
ed9f9a77 487 (arguments
f71f29ca 488 '(#:configure-flags
f0bacad6 489 (list "--with-readline")))
6fd52309 490 (home-page "https://www.gnu.org/software/bc/")
f50d2669 491 (synopsis "Arbitrary precision numeric processing language")
ed9f9a77 492 (description
a22dc0c4
LC
493 "bc is an arbitrary precision numeric processing language. It includes
494an interactive environment for evaluating mathematical statements. Its
495syntax is similar to that of C, so basic usage is familiar. It also includes
496\"dc\", a reverse-polish calculator.")
9f51293c 497 (license license:gpl2+)))
37e6cdcd 498
2a9b10c7
RW
499;; The original kiss-fft does not have a complete build system and does not
500;; build any shared libraries. This is a fork used by Extempore.
501(define-public kiss-fft-for-extempore
502 (package
503 (name "kiss-fft-for-extempore")
504 (version "1.3.0")
505 (source (origin
506 (method url-fetch)
507 (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/"
508 version ".tar.gz"))
509 (file-name (string-append name "-" version ".tar.gz"))
510 (sha256
511 (base32
512 "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv"))))
513 (build-system cmake-build-system)
514 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
515 ;; Extempore refuses to build on architectures other than x86_64
516 (supported-systems '("x86_64-linux"))
2a9b10c7
RW
517 (home-page "https://github.com/extemporelang/kiss_fft")
518 (synopsis "Mixed-radix Fast Fourier Transform")
519 (description
520 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
521that can use fixed or floating data types and can easily be incorporated into
522a C program.")
523 (license license:bsd-3)))
524
37e6cdcd
LC
525(define-public fftw
526 (package
527 (name "fftw")
1ebb9a27 528 (version "3.3.5")
37e6cdcd
LC
529 (source (origin
530 (method url-fetch)
531 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
532 version".tar.gz"))
533 (sha256
534 (base32
1ebb9a27 535 "1kwbx92ps0r7s2mqy7lxbxanslxdzj7dp7r7gmdkzv1j8yqf3kwf"))))
37e6cdcd
LC
536 (build-system gnu-build-system)
537 (arguments
86f4e9d7
RW
538 '(#:configure-flags
539 '("--enable-shared" "--enable-openmp" "--enable-threads")
37e6cdcd
LC
540 #:phases (alist-cons-before
541 'build 'no-native
542 (lambda _
543 ;; By default '-mtune=native' is used. However, that may
544 ;; cause the use of ISA extensions (SSE2, etc.) that are
545 ;; not necessarily available on the user's machine when
546 ;; that package is built on a different machine.
547 (substitute* (find-files "." "Makefile$")
548 (("-mtune=native") "")))
549 %standard-phases)))
550 (native-inputs `(("perl" ,perl)))
551 (home-page "http://fftw.org")
552 (synopsis "Computing the discrete Fourier transform")
553 (description
554 "FFTW is a C subroutine library for computing the discrete Fourier
555transform (DFT) in one or more dimensions, of arbitrary input size, and of
556both real and complex data (as well as of even/odd data---i.e. the discrete
557cosine/ sine transforms or DCT/DST).")
9f51293c 558 (license license:gpl2+)))
7569c5cb
EB
559
560(define-public fftwf
561 (package (inherit fftw)
562 (name "fftwf")
563 (arguments
564 (substitute-keyword-arguments (package-arguments fftw)
565 ((#:configure-flags cf)
566 `(cons "--enable-float" ,cf))))
567 (description
568 (string-append (package-description fftw)
569 " Single-precision version."))))
e5c66f8c
EB
570
571(define-public fftw-openmpi
572 (package (inherit fftw)
573 (name "fftw-openmpi")
574 (inputs
575 `(("openmpi" ,openmpi)
576 ,@(package-inputs fftw)))
577 (arguments
578 (substitute-keyword-arguments (package-arguments fftw)
579 ((#:configure-flags cf)
580 `(cons "--enable-mpi" ,cf))))
581 (description
582 (string-append (package-description fftw)
583 " With OpenMPI parallelism support."))))
8f4b1dfb
LC
584
585(define-public eigen
586 (package
587 (name "eigen")
89fa2219 588 (version "3.2.9")
8f4b1dfb
LC
589 (source (origin
590 (method url-fetch)
591 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
9b268f12 592 version ".tar.bz2"))
8f4b1dfb
LC
593 (sha256
594 (base32
89fa2219 595 "1zs5b210mq7nyanky07li6456rrd0xv2nxf6sl2lhkzdq5p067jd"))
2abcc935 596 (file-name (string-append name "-" version ".tar.bz2"))
8f4b1dfb
LC
597 (modules '((guix build utils)))
598 (snippet
599 ;; There are 3 test failures in the "unsupported" directory,
600 ;; but maintainers say it's a known issue and it's unsupported
601 ;; anyway, so just skip them.
602 '(substitute* "CMakeLists.txt"
603 (("add_subdirectory\\(unsupported\\)")
a4eb83b7
LC
604 "# Do not build the tests for unsupported features.\n")
605 ;; Work around
606 ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>.
607 (("\"include/eigen3\"")
608 "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\"")))))
8f4b1dfb
LC
609 (build-system cmake-build-system)
610 (arguments
611 '(;; Turn off debugging symbols to save space.
612 #:build-type "Release"
613
354f4fe2 614 #:phases (modify-phases %standard-phases
ef8742ea 615 (replace 'check
354f4fe2 616 (lambda _
354f4fe2
LC
617 (let* ((cores (parallel-job-count))
618 (dash-j (format #f "-j~a" cores)))
ef8742ea
LC
619 ;; First build the tests, in parallel. See
620 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
621 (and (zero? (system* "make" "buildtests" dash-j))
8f4b1dfb 622
ef8742ea
LC
623 ;; Then run 'CTest' with -V so we get more
624 ;; details upon failure.
625 (zero? (system* "ctest" "-V" dash-j)))))))))
8f4b1dfb
LC
626 (home-page "http://eigen.tuxfamily.org")
627 (synopsis "C++ template library for linear algebra")
628 (description
629 "Eigen is a C++ template library for linear algebra: matrices, vectors,
630numerical solvers, and related algorithms. It provides an elegant API based
631on \"expression templates\". It is versatile: it supports all matrix sizes,
632all standard numeric types, various matrix decompositions and geometry
633features, and more.")
634
635 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
636 ;; See 'COPYING.README' for details.
9f51293c 637 (license license:mpl2.0)))