gnu: wxmaxima: Wrap with GSETTINGS_SCHEMA_DIR and XDG_DATA_DIRS.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
b146763a 2;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
9c45c519 4;;; Copyright © 2014, 2016 John Darrington <jmd@gnu.org>
dfdf5716 5;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
df354a77 6;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
182d6311 7;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
458b47e3 8;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
32158110 9;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9aafbc0c 10;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
723a6910 11;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
45147b0c 12;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
ec8c7e47 13;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
b7b27a8f 14;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
39b30337 15;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
8f8b2451
AE
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages maths)
ec322be2 33 #:use-module (ice-9 regex)
8f8b2451 34 #:use-module (gnu packages)
b5b73a82 35 #:use-module ((guix licenses) #:prefix license:)
8f8b2451
AE
36 #:use-module (guix packages)
37 #:use-module (guix download)
279663ef 38 #:use-module (guix svn-download)
0e2672ae 39 #:use-module (guix utils)
cec86422 40 #:use-module (guix build utils)
da95c817 41 #:use-module (guix build-system cmake)
c9dfa3c7 42 #:use-module (guix build-system gnu)
ec8c7e47 43 #:use-module (guix build-system r)
3de01d3f
EB
44 #:use-module (gnu packages algebra)
45 #:use-module (gnu packages bison)
a17d4564 46 #:use-module (gnu packages boost)
e73b49fb 47 #:use-module (gnu packages check)
3de01d3f 48 #:use-module (gnu packages cmake)
c9dfa3c7 49 #:use-module (gnu packages compression)
668c06ac 50 #:use-module (gnu packages curl)
b7b27a8f 51 #:use-module (gnu packages cyrus-sasl)
528bb464 52 #:use-module (gnu packages documentation)
57e544e8 53 #:use-module (gnu packages elf)
3de01d3f 54 #:use-module (gnu packages flex)
668c06ac 55 #:use-module (gnu packages fltk)
f3929800 56 #:use-module (gnu packages fontutils)
1dba6407 57 #:use-module (gnu packages gettext)
da95c817 58 #:use-module (gnu packages gcc)
73fed4f8 59 #:use-module (gnu packages gd)
668c06ac 60 #:use-module (gnu packages ghostscript)
889187a4 61 #:use-module (gnu packages graphviz)
f3929800 62 #:use-module (gnu packages gtk)
45147b0c 63 #:use-module (gnu packages image)
668c06ac 64 #:use-module (gnu packages less)
8731e527 65 #:use-module (gnu packages lisp)
5698b8b8 66 #:use-module (gnu packages gnome)
1b39a196 67 #:use-module (gnu packages guile)
668c06ac
JD
68 #:use-module (gnu packages xorg)
69 #:use-module (gnu packages gl)
8731e527 70 #:use-module (gnu packages m4)
d8c7eeb9 71 #:use-module (gnu packages mpi)
b92eee75 72 #:use-module (gnu packages multiprecision)
528bb464 73 #:use-module (gnu packages netpbm)
668c06ac 74 #:use-module (gnu packages pcre)
5698b8b8 75 #:use-module (gnu packages popt)
c9dfa3c7
AE
76 #:use-module (gnu packages perl)
77 #:use-module (gnu packages pkg-config)
da95c817 78 #:use-module (gnu packages python)
c9dfa3c7 79 #:use-module (gnu packages readline)
2742f87e 80 #:use-module (gnu packages tbb)
183e44ae 81 #:use-module (gnu packages tcsh)
df354a77 82 #:use-module (gnu packages tcl)
668c06ac 83 #:use-module (gnu packages texinfo)
8f9ac901 84 #:use-module (gnu packages tex)
b7b27a8f 85 #:use-module (gnu packages tls)
9aafbc0c 86 #:use-module (gnu packages wxwidgets)
c12efc72 87 #:use-module (gnu packages xml)
a17d4564
EB
88 #:use-module (gnu packages zip)
89 #:use-module (srfi srfi-1))
8f8b2451 90
9c45c519
JD
91(define-public c-graph
92 (package
93 (name "c-graph")
94 (version "2.0")
95 (source (origin
96 (method url-fetch)
97 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
98 ".tar.gz"))
99 (sha256 (base32
100 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
101 (build-system gnu-build-system)
102 (inputs
103 `(("fortran" ,gfortran)))
104 (synopsis "Visualize and analyze convolution operations")
105 (description
106 "GNU C-Graph demonstrates the theory of convolution underlying
107engineering systems and signal analysis.")
108 (license license:gpl3+)
109 (home-page "http://www.gnu.org/software/c-graph/")))
110
8f8b2451
AE
111(define-public units
112 (package
113 (name "units")
cbe95057 114 (version "2.12")
8f8b2451
AE
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "mirror://gnu/units/units-" version
118 ".tar.gz"))
119 (sha256 (base32
cbe95057 120 "1jxvjknz2jhq773jrwx9gc1df3gfy73yqmkjkygqxzpi318yls3q"))))
8f8b2451
AE
121 (build-system gnu-build-system)
122 (synopsis "Conversion between thousands of scales")
123 (description
574e86f9 124 "GNU Units converts numeric quantities between units of measure. It
7c125ce0
AK
125can handle scale changes through adaptive usage of standard scale
126prefixes (micro-, kilo-, etc.). It can also handle nonlinear
127conversions such as Fahrenheit to Celsius. Its interpreter is powerful
128enough to be used effectively as a scientific calculator.")
8f8b2451
AE
129 (license license:gpl3+)
130 (home-page "http://www.gnu.org/software/units/")))
c9dfa3c7 131
61a529b4
RW
132(define-public double-conversion
133 (package
134 (name "double-conversion")
135 (version "1.1.5")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append
139 "https://github.com/floitsch/double-conversion/archive/v"
140 version ".tar.gz"))
141 (file-name (string-append name "-" version ".tar.gz"))
142 (sha256
143 (base32
144 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
145 (build-system cmake-build-system)
146 (arguments
147 '(#:test-target "test"
148 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
149 "-DBUILD_TESTING=ON")))
150 (home-page "https://github.com/floitsch/double-conversion")
151 (synopsis "Conversion routines for IEEE doubles")
152 (description
153 "The double-conversion library provides binary-decimal and decimal-binary
154routines for IEEE doubles. The library consists of efficient conversion
155routines that have been extracted from the V8 JavaScript engine.")
156 (license license:bsd-3)))
157
182d6311
ML
158(define-public dionysus
159 (package
160 (name "dionysus")
161 (version "1.3.0")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
165 ".tar.gz"))
166 (sha256
167 (base32
168 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
169 (build-system gnu-build-system)
170 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
171 (synopsis "Local search for universal constants and scientific values")
172 (description
173 "GNU Dionysus is a convenient system for quickly retrieving the values of
174mathematical constants used in science and engineering. Values can be
175searched using a simple command-line tool, choosing from three databases:
176universal constants, atomic numbers, and constants related to
177semiconductors.")
178 (license license:gpl3+)
179 (home-page "http://www.gnu.org/software/dionysus/")))
180
88bd1804
AE
181(define-public gsl
182 (package
183 (name "gsl")
0534dd93 184 (version "2.1")
88bd1804
AE
185 (source
186 (origin
187 (method url-fetch)
188 (uri (string-append "mirror://gnu/gsl/gsl-"
189 version ".tar.gz"))
190 (sha256
191 (base32
0534dd93 192 "0rhcia9jhr3p1f1wybwyllwqfs9bggz99i3mi5lpyqcpff1hdbar"))))
88bd1804 193 (build-system gnu-build-system)
71e0f288 194 (arguments
5adbe65f 195 `(#:parallel-tests? #f))
88bd1804
AE
196 (home-page "http://www.gnu.org/software/gsl/")
197 (synopsis "Numerical library for C and C++")
198 (description
a22dc0c4
LC
199 "The GNU Scientific Library is a library for numerical analysis in C
200and C++. It includes a wide range of mathematical routines, with over 1000
201functions in total. Subject areas covered by the library include:
202differential equations, linear algebra, Fast Fourier Transforms and random
203numbers.")
88bd1804
AE
204 (license license:gpl3+)))
205
b92eee75
AE
206(define-public glpk
207 (package
208 (name "glpk")
f0443377 209 (version "4.60")
b92eee75
AE
210 (source
211 (origin
212 (method url-fetch)
213 (uri (string-append "mirror://gnu/glpk/glpk-"
214 version ".tar.gz"))
215 (sha256
216 (base32
f0443377 217 "15z2ymzqhxwss6wgdj5f7vkyqlqdsjgrvm0x871kmlx0n0664mhk"))))
b92eee75
AE
218 (build-system gnu-build-system)
219 (inputs
220 `(("gmp" ,gmp)))
221 (arguments
222 `(#:configure-flags '("--with-gmp")))
223 (home-page "http://www.gnu.org/software/glpk/")
79c311b8 224 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
225 (description
226 "GLPK is a C library for solving large-scale linear programming (LP),
227mixed integer programming (MIP), and other related problems. It supports the
228GNU MathProg modeling language, a subset of the AMPL language, and features a
229translator for the language. In addition to the C library, a stand-alone
230LP/MIP solver is included in the package.")
231 (license license:gpl3+)))
232
b146763a
AE
233(define-public 4ti2
234 (package
235 (name "4ti2")
236 (version "1.6.7")
237 (source
238 (origin
239 (method url-fetch)
240 (uri (string-append "http://www.4ti2.de/version_" version
241 "/4ti2-" version ".tar.gz"))
242 (sha256
243 (base32
244 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
245 (build-system gnu-build-system)
246 (native-inputs
247 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
248 (inputs
249 `(("glpk" ,glpk)
250 ("gmp" ,gmp)))
251 (home-page "http://www.4ti2.de/")
252 (synopsis "Mathematical tool suite for problems on linear spaces")
253 (description
254 "4ti2 implements algorithms for solving algebraic, geometric and
255combinatorial problems on linear spaces. Among others, it solves systems
256of linear equations, computes extreme rays of polyhedral cones, solves
257integer programming problems and computes Markov bases for statistics.")
258 (license license:gpl2+)))
259
53696f10
AE
260(define-public cddlib
261 (package
262 (name "cddlib")
263 (version "0.94h")
264 (source
265 (origin
266 (method url-fetch)
267 (uri (string-append "ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/cddlib-"
268 (string-delete #\. version) ".tar.gz"))
269 (sha256
270 (base32
271 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
272 (build-system gnu-build-system)
273 (inputs
274 `(("gmp" ,gmp)))
275 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
276 (synopsis "Library for convex hulls and extreme rays of polyhedra")
277 (description
278 "The C-library cddlib implements the Double Description Method of
279Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
280rays of a general convex polyhedron given by a system of linear inequalities
281in arbitrary dimension. It can also be used for the converse operation of
282computing convex hulls.")
283 (license license:gpl2+)))
284
865a69dd
RW
285(define-public arpack-ng
286 (package
287 (name "arpack-ng")
288 (version "3.2.0")
289 (source
290 (origin
291 (method url-fetch)
292 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
293 version ".tar.gz"))
f586c877 294 (file-name (string-append name "-" version ".tar.gz"))
865a69dd
RW
295 (sha256
296 (base32
297 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
298 (build-system gnu-build-system)
299 (home-page "https://github.com/opencollab/arpack-ng")
300 (inputs
301 `(("lapack" ,lapack)
19afbea1 302 ("fortran" ,gfortran)))
865a69dd
RW
303 (synopsis "Fortran subroutines for solving eigenvalue problems")
304 (description
305 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
306large scale eigenvalue problems.")
166191b3 307 (license (license:non-copyleft "file://COPYING"
865a69dd
RW
308 "See COPYING in the distribution."))))
309
8c94c886
EB
310(define-public arpack-ng-openmpi
311 (package (inherit arpack-ng)
312 (name "arpack-ng-openmpi")
313 (inputs
314 `(("mpi" ,openmpi)
315 ,@(package-inputs arpack-ng)))
316 (arguments `(#:configure-flags '("--enable-mpi")))
317 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
318
da95c817
NK
319(define-public lapack
320 (package
321 (name "lapack")
566146ab 322 (version "3.5.0")
da95c817
NK
323 (source
324 (origin
325 (method url-fetch)
326 (uri (string-append "http://www.netlib.org/lapack/lapack-"
327 version ".tgz"))
328 (sha256
329 (base32
566146ab 330 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
da95c817
NK
331 (build-system cmake-build-system)
332 (home-page "http://www.netlib.org/lapack/")
19afbea1 333 (inputs `(("fortran" ,gfortran)
da95c817
NK
334 ("python" ,python-2)))
335 (arguments
06ed5982 336 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
da95c817 337 #:phases (alist-cons-before
6a995754
LC
338 'check 'patch-python
339 (lambda* (#:key inputs #:allow-other-keys)
340 (let ((python (assoc-ref inputs "python")))
341 (substitute* "lapack_testing.py"
342 (("/usr/bin/env python") python))))
06ed5982 343 %standard-phases)))
da95c817
NK
344 (synopsis "Library for numerical linear algebra")
345 (description
346 "LAPACK is a Fortran 90 library for solving the most commonly occurring
347problems in numerical linear algebra.")
166191b3 348 (license (license:non-copyleft "file://LICENSE"
da95c817 349 "See LICENSE in the distribution."))))
73fed4f8 350
e1ff597a
EB
351(define-public scalapack
352 (package
353 (name "scalapack")
354 (version "2.0.2")
355 (source
356 (origin
357 (method url-fetch)
358 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
359 version ".tgz"))
360 (sha256
361 (base32
362 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
363 (build-system cmake-build-system)
364 (inputs
365 `(("mpi" ,openmpi)
366 ("fortran" ,gfortran)
367 ("lapack" ,lapack))) ;for testing only
368 (arguments
369 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
370 (home-page "http://www.netlib.org/scalapack/")
371 (synopsis "Library for scalable numerical linear algebra")
372 (description
373 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
374routines on parallel distributed memory machines. ScaLAPACK solves dense and
375banded linear systems, least squares problems, eigenvalue problems, and
376singular value problems.")
377 (license (license:bsd-style "file://LICENSE"
378 "See LICENSE in the distribution."))))
379
73fed4f8
JD
380(define-public gnuplot
381 (package
382 (name "gnuplot")
ec4130b7 383 (version "5.0.2")
73fed4f8
JD
384 (source
385 (origin
386 (method url-fetch)
387 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
97003b5c 388 version "/gnuplot-" version ".tar.gz"))
73fed4f8
JD
389 (sha256
390 (base32
ec4130b7 391 "146qn414z96c7cc42a1kb9a4kpjc2q2hfdwk44kjjvgmfp9k2ass"))))
73fed4f8
JD
392 (build-system gnu-build-system)
393 (inputs `(("readline" ,readline)
394 ("cairo" ,cairo)
395 ("pango" ,pango)
396 ("gd" ,gd)))
97003b5c 397 (native-inputs `(("pkg-config" ,pkg-config)
289adba7 398 ("texlive" ,texlive-minimal)))
73fed4f8
JD
399 (home-page "http://www.gnuplot.info")
400 (synopsis "Command-line driven graphing utility")
401 (description "Gnuplot is a portable command-line driven graphing
35b9e423 402utility. It was originally created to allow scientists and students to
73fed4f8 403visualize mathematical functions and data interactively, but has grown to
35b9e423 404support many non-interactive uses such as web scripting. It is also used as a
73fed4f8
JD
405plotting engine by third-party applications like Octave.")
406 ;; X11 Style with the additional restriction that derived works may only be
407 ;; distributed as patches to the original.
408 (license (license:fsf-free
a124bbd2 409 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
668c06ac 410
7ee3f1a2
JD
411(define-public hdf5
412 (package
413 (name "hdf5")
04b7a7cd 414 (version "1.8.17")
7ee3f1a2
JD
415 (source
416 (origin
417 (method url-fetch)
93c3de92
AE
418 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-"
419 version "/src/hdf5-"
7ee3f1a2
JD
420 version ".tar.bz2"))
421 (sha256
b8d9c93b
EB
422 (base32 "0sj8x0gfs5fb28gipnynb9wpkz113h8wq9sva9mxx66kv27xsdgw"))
423 (patches (list (search-patch "hdf5-config-date.patch")))))
7ee3f1a2 424 (build-system gnu-build-system)
12ed1216
AE
425 (inputs
426 `(("zlib" ,zlib)))
7ee3f1a2
JD
427 (arguments
428 `(#:phases
f622e212
EB
429 (modify-phases %standard-phases
430 (add-before 'configure 'patch-configure
431 (lambda _
432 (substitute* "configure"
b8d9c93b
EB
433 (("/bin/mv") "mv"))
434 #t))
f622e212
EB
435 (add-after 'install 'patch-references
436 (lambda* (#:key inputs outputs #:allow-other-keys)
437 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
438 (zlib (assoc-ref inputs "zlib")))
439 (substitute* (find-files bin "h5p?cc")
440 (("-lz" lib)
441 (string-append "-L" zlib "/lib " lib)))
442 #t))))))
7ee3f1a2 443 (home-page "http://www.hdfgroup.org")
516e93f8 444 (synopsis "Management suite for extremely large and complex data")
7ee3f1a2
JD
445 (description "HDF5 is a suite that makes possible the management of
446extremely large and complex data collections.")
d4bf49b1
EB
447 (license (license:x11-style
448 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2 449
c8378eea
EB
450(define-public hdf5-parallel-openmpi
451 (package (inherit hdf5)
452 (name "hdf5-parallel-openmpi")
453 (inputs
454 `(("mpi" ,openmpi)
455 ,@(package-inputs hdf5)))
456 (arguments
457 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
458 ,@(package-arguments hdf5))
459 ((#:phases phases)
460 `(modify-phases ,phases
461 (add-before 'check 'patch-tests
462 (lambda _
463 ;; OpenMPI's mpirun will exit with non-zero status if it
464 ;; detects an "abnormal termination", i.e. any process not
465 ;; calling MPI_Finalize(). Since the test is explicitely
466 ;; avoiding MPI_Finalize so as not to have at_exit and thus
467 ;; H5C_flush_cache from being called, mpirun will always
468 ;; complain, so turn this test off.
469 (substitute* "testpar/Makefile"
470 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
471 (string-append front back "\n")))
472 (substitute* "tools/h5diff/testph5diff.sh"
473 (("/bin/sh") (which "sh")))
474 #t))))))
475 (synopsis "Management suite for data with parallel IO support")))
476
00775104
EB
477(define-public h5check
478 (package
479 (name "h5check")
480 (version "2.0.1")
481 (source
482 (origin
483 (method url-fetch)
484 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
485 "h5check/src/h5check-" version ".tar.gz"))
486 (sha256
487 (base32
488 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
489 (build-system gnu-build-system)
490 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
491 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
492 (synopsis "HDF5 format checker")
493 (description "@code{h5check} is a validation tool for verifying that an
494HDF5 file is encoded according to the HDF File Format Specification.")
495 (license (license:x11-style "file://COPYING"))))
496
889187a4
EB
497(define-public netcdf
498 (package
499 (name "netcdf")
500 (version "4.4.0")
501 (source
502 (origin
503 (method url-fetch)
504 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
505 "netcdf-" version ".tar.gz"))
506 (sha256
507 (base32
508 "0y6gdcplarwqqnrav2xg1xd6ih732rzzbmdw78v3rl5b8mwcnh0d"))
509 (patches (list (search-patch "netcdf-config-date.patch")))))
510 (build-system gnu-build-system)
511 (native-inputs
512 `(("m4" ,m4)
513 ("doxygen" ,doxygen)
514 ("graphviz" ,graphviz)))
515 (inputs
516 `(("hdf5" ,hdf5)
517 ("zlib" ,zlib)))
518 (arguments
519 `(#:configure-flags '("--enable-doxygen" "--enable-dot")
520 #:parallel-tests? #f)) ;various race conditions
521 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
522 (synopsis "Library for scientific data")
523 (description "NetCDF is an interface for scientific data access and a
524software library that provides an implementation of the interface. The netCDF
525library defines a machine-independent format for representing scientific data.
526Together, the interface, library, and format support the creation, access, and
527sharing of scientific data.")
528 (license (license:x11-style "file://COPYRIGHT"))))
529
530(define-public netcdf-parallel-openmpi
531 (package (inherit netcdf)
532 (name "netcdf-parallel-openmpi")
533 (inputs
534 `(("mpi" ,openmpi)
535 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
536 (package-inputs netcdf))))
537 ;; TODO: Replace pkg-config references in nc-config with absolute references
538 (arguments
539 (substitute-keyword-arguments (package-arguments netcdf)
540 ((#:configure-flags flags)
541 `(cons* "CC=mpicc" "CXX=mpicxx"
542 "--enable-parallel-tests"
543 ;; Shared libraries not supported with parallel IO.
544 "--disable-shared" "--with-pic"
545 ,flags))))))
546
1b39a196
RJ
547(define-public nlopt
548 (package
549 (name "nlopt")
550 (version "2.4.2")
551 (source (origin
552 (method url-fetch)
553 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
554 version ".tar.gz"))
555 (sha256
556 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
557 (build-system gnu-build-system)
558 (arguments
559 `(;; Shared libraries are not built by default. They are required to
560 ;; build the Guile, Octave, and Python bindings.
561 #:configure-flags '("--enable-shared")
562
563 #:phases
564 (modify-phases %standard-phases
565 (add-before 'configure 'set-libnlopt-file-name
566 (lambda* (#:key outputs #:allow-other-keys)
567 ;; Make sure the Scheme module refers to the library by its
568 ;; absolute file name (we cannot do that from a snippet
569 ;; because the expansion of @libdir@ contains
570 ;; ${exec_prefix}.)
571 (let ((out (assoc-ref outputs "out")))
572 (substitute* "swig/nlopt.scm.in"
573 (("libnlopt")
574 (string-append out "/lib/libnlopt")))
575 #t))))))
576 (inputs `(("guile" ,guile-2.0)))
577 (native-inputs `(("pkg-config" ,pkg-config)))
578 (home-page "http://ab-initio.mit.edu/wiki/")
579 (synopsis "Library for nonlinear optimization")
580 (description "NLopt is a library for nonlinear optimization, providing a
581common interface for a number of different free optimization routines available
582online as well as original implementations of various other algorithms.")
583 (license license:lgpl2.1+)))
584
668c06ac
JD
585;; For a fully featured Octave, users are strongly recommended also to install
586;; the following packages: texinfo, less, ghostscript, gnuplot.
587(define-public octave
588 (package
589 (name "octave")
b7b27a8f 590 (version "4.0.2")
668c06ac
JD
591 (source
592 (origin
593 (method url-fetch)
594 (uri (string-append "mirror://gnu/octave/octave-"
a124bbd2 595 version ".tar.gz"))
668c06ac
JD
596 (sha256
597 (base32
b7b27a8f 598 "1hdxap3j88rpqjimnfhinym6z73wdi5dfa6fv85c13r1dk9qzk9r"))))
668c06ac
JD
599 (build-system gnu-build-system)
600 (inputs
601 `(("lapack" ,lapack)
602 ("readline" ,readline)
603 ("glpk" ,glpk)
1ec78e9d
EB
604 ("fftw" ,fftw)
605 ("fftwf" ,fftwf)
606 ("arpack" ,arpack-ng)
668c06ac
JD
607 ("curl" ,curl)
608 ("pcre" ,pcre)
b7b27a8f 609 ("cyrus-sasl" ,cyrus-sasl)
668c06ac
JD
610 ("fltk" ,fltk)
611 ("fontconfig" ,fontconfig)
612 ("freetype" ,freetype)
40029cbe 613 ("hdf5" ,hdf5)
668c06ac
JD
614 ("libxft" ,libxft)
615 ("mesa" ,mesa)
1ec78e9d 616 ("glu" ,glu)
b7b27a8f 617 ("openssl" ,openssl)
668c06ac
JD
618 ("zlib" ,zlib)))
619 (native-inputs
19afbea1 620 `(("gfortran" ,gfortran)
668c06ac
JD
621 ("pkg-config" ,pkg-config)
622 ("perl" ,perl)
1ec78e9d
EB
623 ;; The following inputs are not actually used in the build process.
624 ;; However, the ./configure gratuitously tests for their existence and
625 ;; assumes that programs not present at build time are also not, and
626 ;; can never be, available at run time! If these inputs are therefore
627 ;; not present, support for them will be built out. However, Octave
628 ;; will still run without them, albeit without the features they
668c06ac
JD
629 ;; provide.
630 ("less" ,less)
631 ("texinfo" ,texinfo)
632 ("ghostscript" ,ghostscript)
633 ("gnuplot" ,gnuplot)))
634 (arguments
b7b27a8f
KY
635 `(#:configure-flags
636 (list (string-append "--with-shell="
637 (assoc-ref %build-inputs "bash")
638 "/bin/sh"))))
668c06ac
JD
639 (home-page "http://www.gnu.org/software/octave/")
640 (synopsis "High-level language for numerical computation")
1ec78e9d
EB
641 (description "GNU Octave is a high-level interpreted language that is
642specialized for numerical computations. It can be used for both linear and
643non-linear applications and it provides great support for visualizing results.
644Work may be performed both at the interactive command-line as well as via
645script files.")
668c06ac 646 (license license:gpl3+)))
3de01d3f
EB
647
648(define-public gmsh
649 (package
650 (name "gmsh")
c7b08410 651 (version "2.11.0")
3de01d3f
EB
652 (source
653 (origin
654 (method url-fetch)
655 (uri (string-append "http://www.geuz.org/gmsh/src/gmsh-"
656 version "-source.tgz"))
657 (sha256
c7b08410 658 (base32 "1ilplibvjgf7a905grpnclrvkmqy9fgrpl7xyp3w4yl1qc682v9b"))
3de01d3f
EB
659 (modules '((guix build utils)))
660 (snippet
661 ;; Remove non-free METIS code
662 '(delete-file-recursively "contrib/Metis"))))
663 (build-system cmake-build-system)
3de01d3f
EB
664 (propagated-inputs
665 `(("fltk" ,fltk)
19afbea1 666 ("gfortran" ,gfortran)
3de01d3f 667 ("gmp" ,gmp)
40029cbe 668 ("hdf5" ,hdf5)
3de01d3f
EB
669 ("lapack" ,lapack)
670 ("mesa" ,mesa)
85f41902 671 ("glu" ,glu)
3de01d3f
EB
672 ("libx11" ,libx11)
673 ("libxext" ,libxext)))
66395a61
EF
674 (inputs
675 `(("fontconfig" ,fontconfig)
676 ("libxft" ,libxft)))
3de01d3f
EB
677 (arguments
678 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
679 "-DENABLE_BUILD_SHARED:BOOL=ON"
c7b08410
EB
680 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
681 #:phases (modify-phases %standard-phases
682 (replace
683 'check
684 (lambda _
685 (zero? (system* "make" "test"
686 ;; Disable this test. See
687 ;; https://geuz.org/trac/gmsh/ticket/271
688 "ARGS=-E component8_in_a_box")))))))
3de01d3f
EB
689 (home-page "http://www.geuz.org/gmsh/")
690 (synopsis "3D finite element grid generator")
edf684ef
EB
691 (description "Gmsh is a 3D finite element grid generator with a built-in
692CAD engine and post-processor. Its design goal is to provide a fast, light
693and user-friendly meshing tool with parametric input and advanced
694visualization capabilities. Gmsh is built around four modules: geometry,
695mesh, solver and post-processing. The specification of any input to these
696modules is done either interactively using the graphical user interface or in
697ASCII text files using Gmsh's own scripting language.")
3de01d3f 698 (license license:gpl2+)))
b9100e2f
EB
699
700(define-public petsc
701 (package
702 (name "petsc")
32187d99 703 (version "3.6.2")
b9100e2f
EB
704 (source
705 (origin
706 (method url-fetch)
707 ;; The *-lite-* tarball does not contain the *large* documentation
708 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
709 "petsc-lite-" version ".tar.gz"))
710 (sha256
32187d99 711 (base32 "13h0m5f9xsdpps4lsp59iz2m7zkapwavq2zfkfvs3ab6sndla0l9"))))
b9100e2f
EB
712 (build-system gnu-build-system)
713 (native-inputs
714 `(("python" ,python-2)
715 ("perl" ,perl)))
716 (inputs
19afbea1 717 `(("gfortran" ,gfortran)
b9100e2f 718 ("lapack" ,lapack)
f258212d 719 ("superlu" ,superlu)
b9100e2f
EB
720 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
721 ;; leaving out opengl, as configuration seems to only be for mac
722 ))
723 (arguments
724 `(#:test-target "test"
9a899cce 725 #:parallel-build? #f ;build is parallel by default
b9100e2f
EB
726 #:configure-flags
727 `("--with-mpi=0"
f258212d
EB
728 "--with-openmp=1"
729 "--with-superlu=1"
730 ,(string-append "--with-superlu-include="
731 (assoc-ref %build-inputs "superlu") "/include")
732 ,(string-append "--with-superlu-lib="
733 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
b9100e2f
EB
734 #:phases
735 (alist-replace
736 'configure
737 ;; PETSc's configure script is actually a python script, so we can't
738 ;; run it with bash.
739 (lambda* (#:key outputs (configure-flags '())
740 #:allow-other-keys)
741 (let* ((prefix (assoc-ref outputs "out"))
742 (flags `(,(string-append "--prefix=" prefix)
743 ,@configure-flags)))
744 (format #t "build directory: ~s~%" (getcwd))
745 (format #t "configure flags: ~s~%" flags)
746 (zero? (apply system* "./configure" flags))))
747 (alist-cons-after
10b11968
EB
748 'configure 'clean-local-references
749 ;; Try to keep build directory names from leaking into compiled code
b9100e2f 750 (lambda* (#:key inputs outputs #:allow-other-keys)
10b11968
EB
751 (let ((out (assoc-ref outputs "out")))
752 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
753 (((getcwd)) out))))
754 (alist-cons-after
755 'install 'clean-install
756 ;; Try to keep installed files from leaking build directory names.
757 (lambda* (#:key inputs outputs #:allow-other-keys)
dfdf5716 758 (let ((out (assoc-ref outputs "out")))
10b11968 759 (substitute* (map (lambda (file)
9a899cce
EB
760 (string-append out "/lib/petsc/conf/" file))
761 '("petscvariables" "PETScConfig.cmake"))
10b11968
EB
762 (((getcwd)) out))
763 ;; Make compiler references point to the store
9a899cce 764 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
765 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
766 (string-append "= " (which compiler))))
10b11968
EB
767 ;; PETSc installs some build logs, which aren't necessary.
768 (for-each (lambda (file)
9a899cce 769 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
770 (when (file-exists? f)
771 (delete-file f))))
9a899cce
EB
772 '("configure.log" "make.log" "gmake.log"
773 "test.log" "error.log" "RDict.db"
10b11968 774 ;; Once installed, should uninstall with Guix
9a899cce 775 "uninstall.py"))))
10b11968 776 %standard-phases)))))
b9100e2f 777 (home-page "http://www.mcs.anl.gov/petsc")
16ecf3ff 778 (synopsis "Library to solve PDEs")
b9100e2f
EB
779 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
780data structures and routines for the scalable (parallel) solution of
781scientific applications modeled by partial differential equations.")
166191b3 782 (license (license:non-copyleft
b9100e2f
EB
783 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
784
785(define-public petsc-complex
786 (package (inherit petsc)
787 (name "petsc-complex")
788 (arguments
789 (substitute-keyword-arguments (package-arguments petsc)
790 ((#:configure-flags cf)
791 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 792 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 793
d8c7eeb9
EB
794(define-public petsc-openmpi
795 (package (inherit petsc)
796 (name "petsc-openmpi")
797 (inputs
798 `(("openmpi" ,openmpi)
799 ,@(package-inputs petsc)))
800 (arguments
801 (substitute-keyword-arguments (package-arguments petsc)
802 ((#:configure-flags cf)
803 ``("--with-mpiexec=mpirun"
804 ,(string-append "--with-mpi-dir="
805 (assoc-ref %build-inputs "openmpi"))
806 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 807 (synopsis "Library to solve PDEs (with MPI support)")))
d8c7eeb9
EB
808
809(define-public petsc-complex-openmpi
810 (package (inherit petsc-complex)
811 (name "petsc-complex-openmpi")
812 (inputs
813 `(("openmpi" ,openmpi)
814 ,@(package-inputs petsc-complex)))
815 (arguments
816 (substitute-keyword-arguments (package-arguments petsc-complex)
817 ((#:configure-flags cf)
818 ``("--with-mpiexec=mpirun"
819 ,(string-append "--with-mpi-dir="
820 (assoc-ref %build-inputs "openmpi"))
821 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 822 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 823
a7f01414
EB
824(define-public slepc
825 (package
826 (name "slepc")
9cf52454 827 (version "3.6.2")
a7f01414
EB
828 (source
829 (origin
830 (method url-fetch)
831 (uri (string-append "http://slepc.upv.es/download/download.php?"
832 "filename=slepc-" version ".tar.gz"))
d588422e 833 (file-name (string-append name "-" version ".tar.gz"))
a7f01414
EB
834 (sha256
835 (base32
9cf52454 836 "1pv5iqz2kc8sj49zsabyz4arnfpana8mjrhq31vzgk16xldk3d1a"))))
a7f01414
EB
837 (build-system gnu-build-system)
838 (native-inputs
839 `(("python" ,python-2)))
840 (inputs
841 `(("arpack" ,arpack-ng)
842 ("gfortran" ,gfortran)))
843 (propagated-inputs
844 `(("petsc" ,petsc)))
845 (arguments
846 `(#:parallel-build? #f ;build is parallel by default
847 #:configure-flags
848 `(,(string-append "--with-arpack-dir="
9cf52454 849 (assoc-ref %build-inputs "arpack") "/lib"))
a7f01414
EB
850 #:phases
851 (modify-phases %standard-phases
852 (replace
853 'configure
854 ;; configure is a python script, so we can't run it with bash.
855 (lambda* (#:key inputs outputs (configure-flags '())
856 #:allow-other-keys)
857 (let* ((prefix (assoc-ref outputs "out"))
858 (flags `(,(string-append "--prefix=" prefix)
859 ,@configure-flags)))
860 (format #t "build directory: ~s~%" (getcwd))
861 (format #t "configure flags: ~s~%" flags)
862 (setenv "SLEPC_DIR" (getcwd))
9cf52454 863 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
a7f01414
EB
864 (zero? (apply system* "./configure" flags)))))
865 (add-after
866 'install 'delete-doc
867 ;; TODO: SLEPc installs HTML documentation alongside headers in
868 ;; $out/include. We'd like to move them to share/doc, but delete
869 ;; them for now, as they are incomplete and installing the complete
870 ;; documentation is difficult.
871 (lambda* (#:key outputs #:allow-other-keys)
872 (let* ((out (assoc-ref outputs "out")))
873 (for-each delete-file (find-files out "\\.html$")))))
874 (add-after
875 'install 'clean-install
876 ;; Clean up unnecessary build logs from installation.
877 (lambda* (#:key outputs #:allow-other-keys)
878 (let ((out (assoc-ref outputs "out")))
879 (for-each (lambda (file)
880 (let ((f (string-append out "/lib/slepc/conf/" file)))
881 (when (file-exists? f)
882 (delete-file f))))
883 '("configure.log" "make.log" "gmake.log"
884 "test.log" "error.log" "RDict.db"
885 "uninstall.py"))))))))
886 (home-page "http://slepc.upv.es")
887 (synopsis "Scalable library for eigenproblems")
888 (description "SLEPc is a software library for the solution of large sparse
889eigenproblems on parallel computers. It can be used for the solution of
890linear eigenvalue problems formulated in either standard or generalized form,
891as well as other related problems such as the singular value decomposition.
892The emphasis of the software is on methods and techniques appropriate for
893problems in which the associated matrices are sparse, for example, those
894arising after the discretization of partial differential equations.")
895 (license license:lgpl3)))
896
897(define-public slepc-complex
898 (package (inherit slepc)
899 (name "slepc-complex")
900 (propagated-inputs
901 `(("petsc" ,petsc-complex)
902 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
903 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
904
905(define-public slepc-openmpi
906 (package (inherit slepc)
907 (name "slepc-openmpi")
908 (inputs
909 `(("mpi" ,openmpi)
910 ("arpack" ,arpack-ng-openmpi)
911 ,@(alist-delete "arpack" (package-inputs slepc))))
912 (propagated-inputs
913 `(("petsc" ,petsc-openmpi)
914 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
915 (synopsis "Scalable library for eigenproblems (with MPI support)")))
916
917(define-public slepc-complex-openmpi
918 (package (inherit slepc-openmpi)
919 (name "slepc-complex-openmpi")
920 (propagated-inputs
921 `(("petsc" ,petsc-complex-openmpi)
922 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
923 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
924
cec86422
EB
925(define-public mumps
926 (package
927 (name "mumps")
c69fa438 928 (version "5.0.1")
cec86422
EB
929 (source
930 (origin
931 (method url-fetch)
932 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
933 version ".tar.gz"))
934 (sha256
935 (base32
c69fa438 936 "1820jfp3mbl7n85765v5mp6p0gzqpgr4d2lrnhwj4gl7cwp5ndah"))
fc1adab1 937 (patches (search-patches "mumps-build-parallelism.patch"))))
cec86422
EB
938 (build-system gnu-build-system)
939 (inputs
940 `(("fortran" ,gfortran)
941 ;; These are required for linking against mumps, but we let the user
942 ;; declare the dependency.
943 ("blas" ,openblas)
944 ("metis" ,metis)
945 ("scotch" ,scotch)))
946 (arguments
947 `(#:modules ((ice-9 match)
948 (ice-9 popen)
949 (srfi srfi-1)
950 ,@%gnu-build-system-modules)
951 #:phases
952 (modify-phases %standard-phases
953 (replace
954 'configure
955 (lambda* (#:key inputs #:allow-other-keys)
956 (call-with-output-file "Makefile.inc"
957 (lambda (port)
958 (format port "
959PLAT =
960LIBEXT = .a
961OUTC = -o
962OUTF = -o
963RM = rm -f~:[
964CC = gcc
965FC = gfortran
966FL = gfortran
967INCSEQ = -I$(topdir)/libseq
968LIBSEQ = -L$(topdir)/libseq -lmpiseq
969LIBSEQNEEDED = libseqneeded~;
970CC = mpicc
971FC = mpifort
972FL = mpifort~]
973AR = ar vr # rules require trailing space, ugh...
974RANLIB = ranlib
975LIBBLAS = -L~a -lopenblas~@[
976SCALAP = -L~a -lscalapack~]
977LIBOTHERS = -pthread
978CDEFS = -DAdd_
979PIC = -fPIC
980OPTF = -O2 -DALLOW_NON_INIT $(PIC)
981OPTL = -O2 $(PIC)
982OPTC = -O2 $(PIC)
983INCS = $(INCSEQ)
984LIBS = $(SCALAP) $(LIBSEQ)
985LPORDDIR = $(topdir)/PORD/lib
986IPORD = -I$(topdir)/PORD/include
987LPORD = -L$(LPORDDIR) -lpord
988ORDERINGSF = -Dpord~@[
989METISDIR = ~a
990IMETIS = -I$(METISDIR)/include
991LMETIS = -L$(METISDIR)/lib -lmetis
992ORDERINGSF += -Dmetis~]~@[~:{
993SCOTCHDIR = ~a
994ISCOTCH = -I$(SCOTCHDIR)/include
995LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
996ORDERINGSF += ~a~}~]
997ORDERINGSC = $(ORDERINGSF)
998LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
999IORDERINGSF = $(ISCOTCH)
1000IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1001 (assoc-ref inputs "mpi")
1002 (assoc-ref inputs "blas")
1003 (assoc-ref inputs "scalapack")
1004 (assoc-ref inputs "metis")
1005 (match (list (assoc-ref inputs "pt-scotch")
1006 (assoc-ref inputs "scotch"))
1007 ((#f #f)
1008 #f)
1009 ((#f scotch)
1010 `((,scotch "" "-Dscotch")))
1011 ((ptscotch _)
1012 `((,ptscotch
1013 "-lptesmumps -lptscotch -lptscotcherr "
1014 "-Dptscotch")))))))))
1015 (replace
1016 'build
1017 ;; By default only the d-precision library is built. Make with "all"
1018 ;; target so that all precision libraries and examples are built.
1019 (lambda _
1020 (zero? (system* "make" "all"
1021 (format #f "-j~a" (parallel-job-count))))))
1022 (replace
1023 'check
1024 ;; Run the simple test drivers, which read test input from stdin:
1025 ;; from the "real" input for the single- and double-precision
1026 ;; testers, and from the "cmplx" input for complex-precision
1027 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1028 ;; package to prefix execution with "mpirun".
1029 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1030 (with-directory-excursion "examples"
1031 (every
1032 (lambda (prec type)
1033 (let ((tester (apply open-pipe*
1034 `(,OPEN_WRITE
1035 ,@exec-prefix
1036 ,(string-append "./" prec
1037 "simpletest"))))
1038 (input (open-input-file
1039 (string-append "input_simpletest_" type))))
1040 (begin
1041 (dump-port input tester)
1042 (close-port input)
1043 (zero? (close-pipe tester)))))
1044 '("s" "d" "c" "z")
1045 '("real" "real" "cmplx" "cmplx")))))
1046 (replace
1047 'install
1048 (lambda* (#:key outputs #:allow-other-keys)
1049 (let ((out (assoc-ref outputs "out")))
1050 (copy-recursively "lib" (string-append out "/lib"))
1051 (copy-recursively "include" (string-append out "/include"))
1052 (when (file-exists? "libseq/libmpiseq.a")
1053 (copy-file "libseq/libmpiseq.a"
1054 (string-append out "/lib/libmpiseq.a")))))))))
1055 (home-page "http://mumps.enseeiht.fr")
1056 (synopsis "Multifrontal sparse direct solver")
1057 (description
1058 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1059sparse system of linear equations A x = b using Guassian elimination.")
1060 (license license:cecill-c)))
1061
1062(define-public mumps-metis
1063 (package (inherit mumps)
1064 (name "mumps-metis")
1065 (inputs
1066 (alist-delete "scotch" (package-inputs mumps)))))
1067
1068(define-public mumps-openmpi
1069 (package (inherit mumps)
1070 (name "mumps-openmpi")
1071 (inputs
1072 `(("mpi" ,openmpi)
1073 ("scalapack" ,scalapack)
1074 ("pt-scotch" ,pt-scotch)
1075 ,@(alist-delete "scotch" (package-inputs mumps))))
1076 (arguments
1077 (substitute-keyword-arguments (package-arguments mumps)
1078 ((#:phases phases)
1079 `(modify-phases ,phases
1080 (replace
1081 'check
1082 (lambda _
1083 ((assoc-ref ,phases 'check)
1084 #:exec-prefix '("mpirun" "-n" "2"))))))))
1085 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1086
1087(define-public mumps-metis-openmpi
1088 (package (inherit mumps-openmpi)
1089 (name "mumps-metis-openmpi")
1090 (inputs
1091 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1092
ec8c7e47
RJ
1093(define-public r-pracma
1094 (package
1095 (name "r-pracma")
1096 (version "1.8.8")
1097 (source (origin
1098 (method url-fetch)
1099 (uri (cran-uri "pracma" version))
1100 (sha256
1101 (base32 "0ans9l5rrb7a38gyi4qx4258sd5r5668vyrk02yzjpg9k3h8l165"))))
1102 (build-system r-build-system)
1103 (home-page "http://cran.r-project.org/web/packages/pracma")
1104 (synopsis "Practical numerical math functions")
1105 (description "This package provides functions for numerical analysis and
1106linear algebra, numerical optimization, differential equations, plus some
1107special functions. It uses Matlab function names where appropriate to simplify
1108porting.")
1109 (license license:gpl3+)))
1110
183e44ae
EB
1111(define-public superlu
1112 (package
1113 (name "superlu")
1114 (version "4.3")
1115 (source
1116 (origin
1117 (method url-fetch)
1118 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1119 "superlu_" version ".tar.gz"))
1120 (sha256
1121 (base32 "10b785s9s4x0m9q7ihap09275pq4km3k2hk76jiwdfdr5qr2168n"))))
1122 (build-system gnu-build-system)
1123 (native-inputs
1124 `(("tcsh" ,tcsh)))
1125 (inputs
1126 `(("lapack" ,lapack)
19afbea1 1127 ("gfortran" ,gfortran)))
183e44ae
EB
1128 (arguments
1129 `(#:parallel-build? #f
1130 #:tests? #f ;tests are run as part of `make all`
1131 #:phases
1132 (alist-replace
1133 'configure
1134 (lambda* (#:key inputs outputs #:allow-other-keys)
1135 (call-with-output-file "make.inc"
1136 (lambda (port)
1137 (format port "
1138PLAT =
1139SuperLUroot = ~a
1140SUPERLULIB = ~a/lib/libsuperlu.a
1141TMGLIB = libtmglib.a
1142BLASDEF = -DUSE_VENDOR_BLAS
1143BLASLIB = -L~a/lib -lblas
1144LIBS = $(SUPERLULIB) $(BLASLIB)
1145ARCH = ar
1146ARCHFLAGS = cr
1147RANLIB = ranlib
1148CC = gcc
1149PIC = -fPIC
1150CFLAGS = -O3 -DPRNTlevel=0 $(PIC)
1151NOOPTS = -O0 $(PIC)
1152FORTRAN = gfortran
1153FFLAGS = -O2 $(PIC)
1154LOADER = $(CC)
1155CDEFS = -DAdd_"
1156 (getcwd)
1157 (assoc-ref outputs "out")
1158 (assoc-ref inputs "lapack")))))
1159 (alist-cons-before
1160 'build 'create-install-directories
1161 (lambda* (#:key outputs #:allow-other-keys)
1162 (for-each
1163 (lambda (dir)
1164 (mkdir-p (string-append (assoc-ref outputs "out")
1165 "/" dir)))
1166 '("lib" "include")))
1167 (alist-replace
1168 'install
1169 (lambda* (#:key outputs #:allow-other-keys)
1170 ;; Library is placed in lib during the build phase. Copy over
1171 ;; headers to include.
1172 (let* ((out (assoc-ref outputs "out"))
1173 (incdir (string-append out "/include")))
1174 (for-each (lambda (file)
1175 (let ((base (basename file)))
1176 (format #t "installing `~a' to `~a'~%"
1177 base incdir)
1178 (copy-file file
1179 (string-append incdir "/" base))))
1180 (find-files "SRC" ".*\\.h$"))))
1181 %standard-phases)))))
1182 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1183 (synopsis "Supernodal direct solver for sparse linear systems")
1184 (description
1185 "SuperLU is a general purpose library for the direct solution of large,
1186sparse, nonsymmetric systems of linear equations on high performance machines.
1187The library is written in C and is callable from either C or Fortran. The
1188library routines perform an LU decomposition with partial pivoting and
1189triangular system solves through forward and back substitution. The library
1190also provides threshold-based ILU factorization preconditioners.")
1191 (license license:bsd-3)))
f8ed036a 1192
a54aefea
EB
1193(define-public superlu-dist
1194 (package
1195 (name "superlu-dist")
1196 (version "3.3")
1197 (source
1198 (origin
1199 (method url-fetch)
1200 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1201 "superlu_dist_" version ".tar.gz"))
1202 (sha256
1203 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
fc1adab1 1204 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
a54aefea
EB
1205 (build-system gnu-build-system)
1206 (native-inputs
1207 `(("tcsh" ,tcsh)))
1208 (inputs
19afbea1 1209 `(("gfortran" ,gfortran)))
a54aefea
EB
1210 (propagated-inputs
1211 `(("openmpi" ,openmpi) ;headers include MPI heades
1212 ("lapack" ,lapack) ;required to link with output library
1213 ("pt-scotch" ,pt-scotch))) ;same
1214 (arguments
1215 `(#:parallel-build? #f ;race conditions using ar
1216 #:phases
1217 (alist-replace
1218 'configure
1219 (lambda* (#:key inputs outputs #:allow-other-keys)
1220 (call-with-output-file "make.inc"
1221 (lambda (port)
1222 (format port "
1223PLAT =
1224DSuperLUroot = ~a
1225DSUPERLULIB = ~a/lib/libsuperlu_dist.a
1226BLASDEF = -DUSE_VENDOR_BLAS
1227BLASLIB = -L~a/lib -lblas
1228PARMETISLIB = -L~a/lib \
1229 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
1230 -lscotch -lscotcherr -lscotcherrexit
1231METISLIB = -L~:*~a/lib \
1232 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
1233LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
1234ARCH = ar
1235ARCHFLAGS = cr
1236RANLIB = ranlib
1237CC = mpicc
1238PIC = -fPIC
1239CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
1240NOOPTS = -O0 -g $(PIC)
1241FORTRAN = mpifort
1242FFLAGS = -O2 -g $(PIC)
1243LOADER = $(CC)
1244CDEFS = -DAdd_"
1245 (getcwd)
1246 (assoc-ref outputs "out")
1247 (assoc-ref inputs "lapack")
1248 (assoc-ref inputs "pt-scotch")))))
1249 (alist-cons-after
1250 'unpack 'remove-broken-symlinks
1251 (lambda _
1252 (for-each delete-file
1253 (find-files "MAKE_INC" "\\.#make\\..*")))
1254 (alist-cons-before
1255 'build 'create-install-directories
1256 (lambda* (#:key outputs #:allow-other-keys)
1257 (for-each
1258 (lambda (dir)
1259 (mkdir-p (string-append (assoc-ref outputs "out")
1260 "/" dir)))
1261 '("lib" "include")))
1262 (alist-replace
1263 'check
1264 (lambda _
1265 (with-directory-excursion "EXAMPLE"
1266 (and
1267 (zero? (system* "mpirun" "-n" "2"
1268 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
1269 (zero? (system* "mpirun" "-n" "2"
1270 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))
1271 (alist-replace
1272 'install
1273 (lambda* (#:key outputs #:allow-other-keys)
1274 ;; Library is placed in lib during the build phase. Copy over
1275 ;; headers to include.
1276 (let* ((out (assoc-ref outputs "out"))
1277 (incdir (string-append out "/include")))
1278 (for-each (lambda (file)
1279 (let ((base (basename file)))
1280 (format #t "installing `~a' to `~a'~%"
1281 base incdir)
1282 (copy-file file
1283 (string-append incdir "/" base))))
1284 (find-files "SRC" ".*\\.h$"))))
1285 %standard-phases)))))))
1286 (home-page (package-home-page superlu))
1287 (synopsis "Parallel supernodal direct solver")
1288 (description
1289 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
1290It is targeted for distributed memory parallel machines. SuperLU_DIST is
1291implemented in ANSI C, and MPI for communications.")
1292 (license license:bsd-3)))
1293
f8ed036a
EB
1294(define-public scotch
1295 (package
1296 (name "scotch")
6c798540 1297 (version "6.0.4")
f8ed036a
EB
1298 (source
1299 (origin
1300 (method url-fetch)
6c798540 1301 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
f8ed036a
EB
1302 "scotch_" version ".tar.gz"))
1303 (sha256
6c798540 1304 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
fc1adab1
AK
1305 (patches (search-patches "scotch-test-threading.patch"
1306 "pt-scotch-build-parallelism.patch"))))
f8ed036a
EB
1307 (build-system gnu-build-system)
1308 (inputs
1309 `(("zlib" ,zlib)
1310 ("flex" ,flex)
1311 ("bison" ,bison)))
1312 (arguments
1313 `(#:phases
d6602ee9
EB
1314 (modify-phases %standard-phases
1315 (add-after
1316 'unpack 'chdir-to-src
1317 (lambda _ (chdir "src")))
1318 (replace
1319 'configure
1320 (lambda _
1321 (call-with-output-file "Makefile.inc"
1322 (lambda (port)
1323 (format port "
f8ed036a
EB
1324EXE =
1325LIB = .a
1326OBJ = .o
1327MAKE = make
1328AR = ar
1329ARFLAGS = -ruv
cf0ec6c4 1330CAT = cat
f8ed036a
EB
1331CCS = gcc
1332CCP = mpicc
1333CCD = gcc
1334CPPFLAGS =~{ -D~a~}
6c798540 1335CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
1336LDFLAGS = -lz -lm -lrt -lpthread
1337CP = cp
1338LEX = flex -Pscotchyy -olex.yy.c
1339LN = ln
1340MKDIR = mkdir
1341MV = mv
1342RANLIB = ranlib
1343YACC = bison -pscotchyy -y -b y
1344"
d6602ee9
EB
1345 '("COMMON_FILE_COMPRESS_GZ"
1346 "COMMON_PTHREAD"
1347 "COMMON_RANDOM_FIXED_SEED"
cf0ec6c4
EB
1348 ;; Prevents symbolc clashes with libesmumps
1349 "SCOTCH_RENAME"
d6602ee9
EB
1350 ;; XXX: Causes invalid frees in superlu-dist tests
1351 ;; "SCOTCH_PTHREAD"
1352 ;; "SCOTCH_PTHREAD_NUMBER=2"
1353 "restrict=__restrict"))))))
cf0ec6c4
EB
1354 (add-after
1355 'build 'build-esmumps
1356 (lambda _
1357 (zero? (system* "make"
1358 (format #f "-j~a" (parallel-job-count))
1359 "esmumps"))))
d6602ee9 1360 (replace
f8ed036a
EB
1361 'install
1362 (lambda* (#:key outputs #:allow-other-keys)
1363 (let ((out (assoc-ref outputs "out")))
1364 (mkdir out)
1365 (zero? (system* "make"
1366 (string-append "prefix=" out)
cf0ec6c4
EB
1367 "install"))
1368 ;; esmumps files are not installed with the above
1369 (for-each (lambda (f)
1370 (copy-file f (string-append out "/include/" f)))
1371 (find-files "../include" ".*esmumps.h$"))
1372 (for-each (lambda (f)
1373 (copy-file f (string-append out "/lib/" f)))
1374 (find-files "../lib" "^lib.*esmumps.*"))))))))
f8ed036a
EB
1375 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
1376 (synopsis "Programs and libraries for graph algorithms")
1377 (description "SCOTCH is a set of programs and libraries which implement
1378the static mapping and sparse matrix reordering algorithms developed within
1379the SCOTCH project. Its purpose is to apply graph theory, with a divide and
1380conquer approach, to scientific computing problems such as graph and mesh
1381partitioning, static mapping, and sparse matrix ordering, in application
1382domains ranging from structural mechanics to operating systems or
1383bio-chemistry.")
1384 ;; See LICENSE_en.txt
1385 (license license:cecill-c)))
6acb4adb
EB
1386
1387(define-public pt-scotch
1388 (package (inherit scotch)
1389 (name "pt-scotch")
1390 (propagated-inputs
1391 `(("openmpi" ,openmpi))) ;Headers include MPI headers
1392 (arguments
1393 (substitute-keyword-arguments (package-arguments scotch)
1394 ((#:phases scotch-phases)
d6602ee9
EB
1395 `(modify-phases ,scotch-phases
1396 (replace
1397 'build
d6602ee9
EB
1398 (lambda _
1399 (and
cf0ec6c4
EB
1400 (zero? (system* "make"
1401 (format #f "-j~a" (parallel-job-count))
1402 "ptscotch" "ptesmumps"))
d6602ee9
EB
1403 ;; Install the serial metis compatibility library
1404 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
1405 (replace
1406 'check
1407 (lambda _ (zero? (system* "make" "ptcheck"))))))))
6acb4adb 1408 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 1409
aa75ad00
EB
1410(define-public metis
1411 (package
1412 (name "metis")
1413 (version "5.1.0")
1414 (source
1415 (origin
1416 (method url-fetch)
1417 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
1418 "metis-" version ".tar.gz"))
1419 (sha256
1420 (base32
1421 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
1422 (build-system cmake-build-system)
1423 (inputs
1424 `(("blas" ,openblas)))
1425 (arguments
1426 `(#:tests? #f ;no tests
1427 #:configure-flags `("-DSHARED=ON"
1428 ,(string-append "-DGKLIB_PATH=" (getcwd)
1429 "/metis-" ,version "/GKlib"))))
1430 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
1431 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
1432 (description
1433 "METIS is a set of serial programs for partitioning graphs, partitioning
1434finite element meshes, and producing fill-reducing orderings for sparse
1435matrices. The algorithms implemented in METIS are based on the multilevel
1436recursive-bisection, multilevel k-way, and multi-constraint partitioning
1437schemes.")
1438 (license license:asl2.0))) ;As of version 5.0.3
1439
700ff222
EB
1440(define-public p4est
1441 (package
1442 (name "p4est")
1443 (version "1.1")
1444 (source
1445 (origin
1446 (method url-fetch)
1447 (uri (string-append "http://p4est.github.io/release/p4est-"
1448 version ".tar.gz"))
1449 (sha256
1450 (base32
1451 "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"))))
1452 (build-system gnu-build-system)
1453 (inputs
1454 `(("fortran" ,gfortran)
1455 ("blas" ,openblas)
1456 ("lapack" ,lapack)
1457 ("zlib" ,zlib)))
1458 (arguments
1459 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
1460 (assoc-ref %build-inputs "blas")
1461 " -lopenblas")
1462 ,(string-append "LAPACK_LIBS=-L"
1463 (assoc-ref %build-inputs "lapack")
1464 " -llapack"))))
1465 (home-page "http://www.p4est.org")
1466 (synopsis "Adaptive mesh refinement on forests of octrees")
1467 (description
1468 "The p4est software library enables the dynamic management of a
1469collection of adaptive octrees, conveniently called a forest of octrees.
1470p4est is designed to work in parallel and scales to hundreds of thousands of
1471processor cores.")
1472 (license license:gpl2+)))
1473
1474(define-public p4est-openmpi
1475 (package (inherit p4est)
1476 (name "p4est-openmpi")
1477 (inputs
1478 `(("mpi" ,openmpi)
1479 ,@(package-inputs p4est)))
1480 (arguments
1481 (substitute-keyword-arguments (package-arguments p4est)
1482 ((#:configure-flags cf)
1483 ``("--enable-mpi" ,@,cf))))
1484 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
1485
5698b8b8
JD
1486(define-public gsegrafix
1487 (package
1488 (name "gsegrafix")
1489 (version "1.0.6")
1490 (source
1491 (origin
1492 (method url-fetch)
1493 (uri (string-append "mirror://gnu/" name "/" name "-"
1494 version ".tar.gz"))
1495 (sha256
1496 (base32
1497 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
1498 (build-system gnu-build-system)
1499 (arguments
1500 `(#:configure-flags '("LDFLAGS=-lm")))
1501 (inputs
1502 `(("libgnomecanvas" ,libgnomecanvas)
1503 ("libbonoboui" ,libbonoboui)
1504 ("libgnomeui" ,libgnomeui)
1505 ("libgnomeprintui" ,libgnomeprintui)
1506 ("popt" ,popt)))
1507 (native-inputs
1508 `(("pkg-config" ,pkg-config)))
1509 (home-page "http://www.gnu.org/software/gsegrafix/")
1510 (synopsis "GNOME application to create scientific and engineering plots")
1511 (description "GSEGrafix is an application which produces high-quality graphical
1512plots for science and engineering. Plots are specified via simple ASCII
1513parameter files and data files and are presented in an anti-aliased GNOME
1514canvas. The program supports rectangular two-dimensional plots, histograms,
1515polar-axis plots and three-dimensional plots. Plots can be printed or saved
1516to BMP, JPEG or PNG image formats.")
1517 (license license:gpl3+)))
8731e527
JD
1518
1519(define-public maxima
1520 (package
1521 (name "maxima")
77af7b24 1522 (version "5.36.1")
8731e527
JD
1523 (source
1524 (origin
1525 (method url-fetch)
1526 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
1527 version "-source/" name "-" version ".tar.gz"))
1528 (sha256
1529 (base32
77af7b24 1530 "0x1rk659sn3cq0n5c90848ilzr1gb1wf0072fl6jhkdq00qgh2s0"))
fc1adab1 1531 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 1532 (build-system gnu-build-system)
df354a77
FB
1533 (inputs
1534 `(("gcl" ,gcl)
1535 ("gnuplot" ,gnuplot) ;for plots
f36afe4d 1536 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
1537 (native-inputs
1538 `(("texinfo" ,texinfo)
1539 ("perl" ,perl)))
8731e527 1540 (arguments
df354a77
FB
1541 `(#:configure-flags
1542 (list "--enable-gcl"
1543 (string-append "--with-posix-shell="
1544 (assoc-ref %build-inputs "bash")
1545 "/bin/sh")
1546 (string-append "--with-wish="
1547 (assoc-ref %build-inputs "tk")
1548 "/bin/wish"
1549 (let ((v ,(package-version tk)))
1550 (string-take v (string-index-right v #\.)))))
df354a77 1551 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
1552 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
1553 ;; Work around that.
df354a77 1554 #:make-flags (list "TMPDIR=/tmp")
df354a77 1555 #:phases (alist-cons-before
8731e527 1556 'check 'pre-check
df354a77 1557 (lambda _
8731e527 1558 (chmod "src/maxima" #o555))
f36afe4d
FB
1559 ;; Make sure the doc and emacs files are found in the
1560 ;; standard location. Also configure maxima to find gnuplot
1561 ;; without having it on the PATH.
1562 (alist-cons-after
1563 'install 'post-install
1564 (lambda* (#:key outputs inputs #:allow-other-keys)
1565 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
1566 (out (assoc-ref outputs "out"))
1567 (datadir (string-append out "/share/maxima/" ,version)))
1568 (with-directory-excursion out
1569 (mkdir-p "share/emacs")
1570 (mkdir-p "share/doc")
1571 (symlink
1572 (string-append datadir "/emacs/")
1573 (string-append out "/share/emacs/site-lisp"))
1574 (symlink
1575 (string-append datadir "/doc/")
1576 (string-append out "/share/doc/maxima"))
1577 (with-atomic-file-replacement
1578 (string-append datadir "/share/maxima-init.lisp")
1579 (lambda (in out)
1580 (format out "~a ~s~a~%"
1581 "(setf $gnuplot_command "
1582 (string-append gnuplot "/bin/gnuplot") ")")
1583 (dump-port in out))))))
1584 %standard-phases))))
8731e527
JD
1585 (home-page "http://maxima.sourceforge.net")
1586 (synopsis "Numeric and symbolic expression manipulation")
1587 (description "Maxima is a system for the manipulation of symbolic and
1588numerical expressions. It yields high precision numeric results by using
1589exact fractions, arbitrary precision integers, and variable precision floating
e881752c 1590point numbers.")
8731e527
JD
1591 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
1592 ;; Others simply say "GNU General Public License" without stating a
1593 ;; version (which implicitly means gpl1+).
1594 ;; At least one file (src/maxima.asd) says "version 2."
1595 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 1596 (license license:gpl2)))
ec322be2 1597
9aafbc0c
MW
1598(define-public wxmaxima
1599 (package
1600 (name "wxmaxima")
e6a90507 1601 (version "16.04.2")
9aafbc0c
MW
1602 (source
1603 (origin
1604 (method url-fetch)
1605 (uri (string-append "mirror://sourceforge/wxmaxima/wxMaxima/"
1606 version "/" name "-" version ".tar.gz"))
1607 (sha256
1608 (base32
e6a90507 1609 "1fpqzk1921isiqrpgpf433ldq41924qs9sy99fl1zn5661b2l73n"))))
9aafbc0c
MW
1610 (build-system gnu-build-system)
1611 (inputs
1612 `(("wxwidgets" ,wxwidgets)
de477809
SB
1613 ("maxima" ,maxima)
1614 ;; Runtime support.
1615 ("adwaita-icon-theme" ,adwaita-icon-theme)
1616 ("gtk+" ,gtk+)
1617 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c
MW
1618 (arguments
1619 `(#:phases (modify-phases %standard-phases
1620 (add-after
1621 'install 'wrap-program
1622 (lambda* (#:key inputs outputs #:allow-other-keys)
1623 (wrap-program (string-append (assoc-ref outputs "out")
1624 "/bin/wxmaxima")
1625 `("PATH" ":" prefix
1626 (,(string-append (assoc-ref inputs "maxima")
de477809
SB
1627 "/bin")))
1628 ;; For GtkFileChooserDialog.
1629 `("GSETTINGS_SCHEMA_DIR" =
1630 (,(string-append (assoc-ref inputs "gtk+")
1631 "/share/glib-2.0/schemas")))
1632 `("XDG_DATA_DIRS" ":" prefix
1633 (;; Needed by gdk-pixbuf to know supported icon formats.
1634 ,(string-append
1635 (assoc-ref inputs "shared-mime-info") "/share")
1636 ;; The default icon theme of GTK+.
1637 ,(string-append
1638 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
9aafbc0c
MW
1639 #t)))))
1640 (home-page "https://andrejv.github.io/wxmaxima/")
1641 (synopsis "Graphical user interface for the Maxima computer algebra system")
1642 (description
1643 "wxMaxima is a graphical user interface for the Maxima computer algebra
1644system. It eases the use of Maxima by making most of its commands available
1645through a menu system and by providing input dialogs for commands that require
1646more than one argument. It also implements its own display engine that
1647outputs mathematical symbols directly instead of depicting them with ASCII
1648characters.
1649
1650wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
1651text and mathematical calculations to create documents, exporting of input and
1652output to TeX, and a browser for Maxima's manual including command index and
1653full text searching.")
1654 (license license:gpl2+)))
1655
b15e47f9
RW
1656(define-public armadillo
1657 (package
1658 (name "armadillo")
945eef85 1659 (version "6.700.7")
b15e47f9
RW
1660 (source (origin
1661 (method url-fetch)
1662 (uri (string-append "mirror://sourceforge/arma/armadillo-"
1663 version ".tar.gz"))
1664 (sha256
1665 (base32
945eef85 1666 "0xbidcxrvbq33xf7iysg2nic2ai9a043psl33kiv6ifkk7p8hcra"))))
b15e47f9
RW
1667 (build-system cmake-build-system)
1668 (arguments `(#:tests? #f)) ;no test target
1669 (inputs
1670 `(("openblas" ,openblas)
1671 ("lapack" ,lapack)
1672 ("arpack" ,arpack-ng)))
1673 (home-page "http://arma.sourceforge.net/")
1674 (synopsis "C++ linear algebra library")
1675 (description
1676 "Armadillo is a C++ linear algebra library, aiming towards a good balance
1677between speed and ease of use. It is useful for algorithm development
1678directly in C++, or quick conversion of research code into production
1679environments. It can be used for machine learning, pattern recognition,
1680signal processing, bioinformatics, statistics, econometrics, etc. The library
1681provides efficient classes for vectors, matrices and cubes, as well as 150+
1682associated functions (eg. contiguous and non-contiguous submatrix views).")
1683 (license license:mpl2.0)))
1684
e22d4ca4
RW
1685(define-public armadillo-for-rcpparmadillo
1686 (package (inherit armadillo)
813efdde 1687 (version "6.700.6")
e22d4ca4
RW
1688 (source (origin
1689 (method url-fetch)
1690 (uri (string-append "mirror://sourceforge/arma/armadillo-"
1691 version ".tar.gz"))
1692 (sha256
1693 (base32
813efdde 1694 "1cdpjxb0fz5f28y5qrqgpw53s7qi8s2v3al9lfdldqxngb21vpx8"))))))
e22d4ca4 1695
279663ef
RW
1696(define-public muparser
1697 (package
1698 (name "muparser")
1699 (version "2.2.5")
1700 (source
1701 (origin
1702 (method svn-fetch)
1703 (uri (svn-reference
1704 (url "http://muparser.googlecode.com/svn/trunk/")
1705 (revision 34)))
1706 (sha256
1707 (base32
1708 "1d6bdbhx9zj3srwj3m7c9hvr18gnx1fx43h6d25my7q85gicpcwn"))))
1709 (build-system gnu-build-system)
1710 (arguments
1711 `(#:configure-flags '("--enable-samples=no")
1712 #:tests? #f)) ;no "check" target
1713 (home-page "http://muparser.beltoforion.de/")
1714 (synopsis "Fast parser library for mathematical expressions")
1715 (description
1716 "muParser is an extensible high performance math parser library. It is
1717based on transforming an expression into a bytecode and precalculating
1718constant parts of it.")
1719 (license license:expat)))
1720
e73b49fb
RW
1721(define-public openblas
1722 (package
1723 (name "openblas")
69851c59 1724 (version "0.2.15")
e73b49fb
RW
1725 (source
1726 (origin
1727 (method url-fetch)
1728 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
1729 version))
1730 (file-name (string-append name "-" version ".tar.gz"))
1731 (sha256
1732 (base32
69851c59 1733 "1k5f6vjlk54qlplk5m7xkbaw6g2y7dl50lwwdv6xsbcsgsbxfcpy"))))
e73b49fb
RW
1734 (build-system gnu-build-system)
1735 (arguments
5b5ea159 1736 `(#:tests? #f ;no "check" target
bd0b4379
RW
1737 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
1738 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
1739 ;; we need to disable substitutions.
71923a91
AE
1740 #:substitutable?
1741 ,(let ((system (or (%current-target-system) (%current-system))))
1742 (or (string-prefix? "x86_64" system)
bd0b4379
RW
1743 (string-prefix? "i686" system)
1744 (string-prefix? "mips" system)))
e73b49fb
RW
1745 #:make-flags
1746 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1747 "SHELL=bash"
af5b817e
RW
1748 "NO_LAPACK=1"
1749 ;; Build the library for all supported CPUs. This allows
1750 ;; switching CPU targets at runtime with the environment variable
1751 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
1752 ;; Unfortunately, this is not supported on non-x86 architectures,
1753 ;; where it leads to failed builds.
1754 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
1755 (cond
1756 ((or (string-prefix? "x86_64" system)
71923a91 1757 (string-prefix? "i686" system))
8a637e79
RW
1758 '("DYNAMIC_ARCH=1"))
1759 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
1760 ;; two available MIPS targets special extended instructions
1761 ;; for Loongson cores are used.
1762 ((string-prefix? "mips" system)
1763 '("TARGET=SICORTEX"))
1764 (else '()))))
e73b49fb
RW
1765 ;; no configure script
1766 #:phases (alist-delete 'configure %standard-phases)))
1767 (inputs
19afbea1 1768 `(("fortran" ,gfortran)))
e73b49fb
RW
1769 (native-inputs
1770 `(("cunit" ,cunit)
1771 ("perl" ,perl)))
1772 (home-page "http://www.openblas.net/")
1773 (synopsis "Optimized BLAS library based on GotoBLAS")
1774 (description
1775 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
1776 (license license:bsd-3)))
1777
e1605e36
RW
1778(define-public openlibm
1779 (package
1780 (name "openlibm")
1781 (version "0.4.1")
1782 (source
1783 (origin
1784 (method url-fetch)
1785 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
1786 version ".tar.gz"))
1787 (file-name (string-append name "-" version ".tar.gz"))
1788 (sha256
1789 (base32
1790 "0cwqqqlblj3kzp9aq1wnpfs1fl0qd1wp1xzm5shb09w06i4rh9nn"))))
1791 (build-system gnu-build-system)
1792 (arguments
1793 `(#:make-flags
1794 (list (string-append "prefix=" (assoc-ref %outputs "out")))
1795 #:phases
1796 ;; no configure script
1797 (alist-delete 'configure %standard-phases)
1798 #:tests? #f)) ;the tests are part of the default target
1799 (home-page "http://openlibm.org/")
1800 (synopsis "Portable C mathematical library (libm)")
1801 (description
1802 "OpenLibm is an effort to have a high quality, portable, standalone C
1803mathematical library (libm). It can be used standalone in applications and
1804programming language implementations. The project was born out of a need to
e881752c 1805have a good libm for the Julia programming language that worked consistently
e1605e36
RW
1806across compilers and operating systems, and in 32-bit and 64-bit
1807environments.")
1808 ;; See LICENSE.md for details.
1809 (license (list license:expat
1810 license:isc
1811 license:bsd-2
1812 license:public-domain
1813 license:lgpl2.1+))))
1814
e62be58f
RW
1815(define-public openspecfun
1816 (package
1817 (name "openspecfun")
1818 (version "0.4")
1819 (source
1820 (origin
1821 (method url-fetch)
1822 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
1823 version ".tar.gz"))
1824 (file-name (string-append name "-" version ".tar.gz"))
1825 (sha256
1826 (base32
1827 "0nsa3jjmlhcqkw5ba5ypbn3n0c8b6lc22zzlxnmxkxi9shhdx65z"))))
1828 (build-system gnu-build-system)
1829 (arguments
1830 '(#:tests? #f ;no "check" target
1831 #:make-flags
1832 (list (string-append "prefix=" (assoc-ref %outputs "out")))
1833 ;; no configure script
1834 #:phases (alist-delete 'configure %standard-phases)))
1835 (inputs
19afbea1 1836 `(("fortran" ,gfortran)))
e62be58f
RW
1837 (home-page "https://github.com/JuliaLang/openspecfun")
1838 (synopsis "Collection of special mathematical functions")
1839 (description
1840 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
1841portable package for Bessel Functions of a Complex Argument and Nonnegative
1842Order; it contains subroutines for computing Bessel functions and Airy
1843functions. Faddeeva allows computing the various error functions of arbitrary
1844complex arguments (Faddeeva function, error function, complementary error
1845function, scaled complementary error function, imaginary error function, and
1846Dawson function); given these, one can also easily compute Voigt functions,
1847Fresnel integrals, and similar related functions as well.")
1848 ;; Faddeeva is released under the Expat license; AMOS is included as
1849 ;; public domain software.
1850 (license (list license:expat license:public-domain))))
1851
2742f87e
RW
1852(define-public suitesparse
1853 (package
1854 (name "suitesparse")
1855 (version "4.4.3")
1856 (source
1857 (origin
1858 (method url-fetch)
1859 (uri (string-append
1860 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
1861 version ".tar.gz"))
1862 (sha256
1863 (base32
1864 "100hdzr0mf4mzlwnqpmwpfw4pymgsf9n3g0ywb1yps2nk1zbkdy5"))))
1865 (build-system gnu-build-system)
1866 (arguments
1867 '(#:parallel-build? #f ;cholmod build fails otherwise
1868 #:tests? #f ;no "check" target
1869 #:make-flags
1870 (list "CC=gcc"
1871 "BLAS=-lblas"
1872 "TBB=-ltbb"
1873 "CHOLMOD_CONFIG=-DNPARTITION" ;required when METIS is not used
1874 (string-append "INSTALL_LIB="
1875 (assoc-ref %outputs "out") "/lib")
1876 (string-append "INSTALL_INCLUDE="
1877 (assoc-ref %outputs "out") "/include"))
1878 #:phases
1879 (alist-cons-before
1880 'install 'prepare-out
1881 ;; README.txt states that the target directories must exist prior to
1882 ;; running "make install".
1883 (lambda _
1884 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1885 (mkdir-p (string-append (assoc-ref %outputs "out") "/include")))
1886 ;; no configure script
1887 (alist-delete 'configure %standard-phases))))
1888 (inputs
1889 `(("tbb" ,tbb)
1890 ("lapack" ,lapack)))
1891 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
1892 (synopsis "Suite of sparse matrix software")
1893 (description
1894 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
1895multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
1896multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
1897simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
1898CXSparse, a concise sparse Cholesky factorization package; and many other
1899packages.")
1900 ;; LGPLv2.1+:
1901 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
1902 ;; GPLv2+:
1903 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
1904 (license (list license:gpl2+ license:lgpl2.1+))))
1905
ec322be2
FB
1906(define-public atlas
1907 (package
1908 (name "atlas")
1909 (version "3.10.2")
1910 (source (origin
1911 (method url-fetch)
1912 (uri (string-append "mirror://sourceforge/math-atlas/atlas"
1913 version ".tar.bz2"))
1914 (sha256
1915 (base32
1916 "0bqh4bdnjdyww4mcpg6kn0x7338mfqbdgysn97dzrwwb26di7ars"))))
1917 (build-system gnu-build-system)
1918 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 1919 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
1920 ("lapack-tar" ,(package-source lapack))))
1921 (outputs '("out" "doc"))
01480b9e
FB
1922 ;; For the moment we drop support for MIPS at it fails to compile. See
1923 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
1924 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
1925 (arguments
1926 `(#:parallel-build? #f
1927 #:parallel-tests? #f
f15615b1
LC
1928
1929 ;; ATLAS tunes itself for the machine it is built on, as explained at
1930 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
1931 ;; For this reason, we want users to build it locally instead of using
1932 ;; substitutes.
1933 #:substitutable? #f
1934
ec322be2
FB
1935 #:modules ((srfi srfi-26)
1936 (srfi srfi-1)
1937 (guix build gnu-build-system)
1938 (guix build utils))
40029cbe 1939 #:configure-flags
ec322be2
FB
1940 `(;; Generate position independent code suitable for dynamic libraries
1941 ;; and use WALL timer to get more accurate timing.
1942 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
1943 ;; Set word width.
1944 "-b"
1945 ,,(if (string-match "64" (%current-system))
1946 "64"
1947 "32")
1948 ;; Disable parallel build as it gives errors: atlas_pthread.h is
1949 ;; needed to compile C files before it is generated.
1950 "-Ss" "pmake" "make -j 1"
af89a667
FB
1951 ;; Probe is failing for MIPS. We therefore define the system
1952 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
1953 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
1954 ,,@(if (string-prefix? "mips" (%current-system))
1955 (list "-A" "49" "-V" "1")
1956 (list))
ec322be2
FB
1957 ;; Generate shared libraries.
1958 "--shared"
1959 ;; Build a full LAPACK library.
1960 ,(string-append "--with-netlib-lapack-tarfile="
1961 (assoc-ref %build-inputs "lapack-tar")))
1962 #:phases
1963 (alist-cons-after
1964 'install 'install-doc
1965 (lambda* (#:key outputs inputs #:allow-other-keys)
40029cbe 1966 (let ((doc (string-append (assoc-ref outputs "doc")
ec322be2
FB
1967 "/share/doc/atlas")))
1968 (mkdir-p doc)
40029cbe 1969 (fold (lambda (file previous)
ec322be2
FB
1970 (and previous (zero? (system* "cp" file doc))))
1971 #t (find-files "../ATLAS/doc" ".*"))))
1972 (alist-cons-after
1973 'check 'check-pt
1974 (lambda _ (zero? (system* "make" "ptcheck")))
1975 ;; Fix files required to run configure.
1976 (alist-cons-before
1977 'configure 'fix-/bin/sh
1978 (lambda _
1979 ;; Use `sh', not `/bin/sh'.
1980 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
1981 (("/bin/sh")
1982 "sh")))
1983 ;; Fix /bin/sh in generated make files.
1984 (alist-cons-after
1985 'configure 'fix-/bin/sh-in-generated-files
1986 (lambda _
1987 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
1988 (("/bin/sh")
1989 "sh")))
1990 ;; ATLAS configure program does not accepts the default flags
1991 ;; passed by the 'gnu-build-system'.
1992 (alist-replace
1993 'configure
1994 (lambda* (#:key native-inputs inputs outputs
1995 (configure-flags '())
1996 #:allow-other-keys #:rest args)
1997 (let* ((prefix (assoc-ref outputs "out"))
1998 (bash (or (and=> (assoc-ref
1999 (or native-inputs inputs) "bash")
2000 (cut string-append <> "/bin/bash"))
2001 "/bin/sh"))
2002 (flags `(,(string-append "--prefix=" prefix)
2003 ,@configure-flags))
2004 (abs-srcdir (getcwd))
2005 (srcdir (string-append "../" (basename abs-srcdir))))
2006 (format #t "source directory: ~s (relative from build: ~s)~%"
2007 abs-srcdir srcdir)
2008 (mkdir "../build")
2009 (chdir "../build")
2010 (format #t "build directory: ~s~%" (getcwd))
2011 (format #t "configure flags: ~s~%" flags)
2012 (zero? (apply system* bash
2013 (string-append srcdir "/configure")
2014 flags))))
2015 %standard-phases)))))))
2016 (synopsis "Automatically Tuned Linear Algebra Software")
2017 (description
2018 "ATLAS is an automatically tuned linear algebra software library
2019providing C and Fortran77 interfaces to a portably efficient BLAS
2020implementation, as well as a few routines from LAPACK.
2021
f15615b1
LC
2022Optimization occurs at build time. For this reason, the library is built on
2023the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 2024
f15615b1
LC
2025Before building the library, CPU throttling should be disabled. This can be
2026done in the BIOS, or, on GNU/Linux, with the following commands:
ec322be2
FB
2027
2028cpufreq-selector -g performance -c 0
2029...
2030cpufreq-selector -g performance -c N-1
2031
2032where N is the number of cores of your CPU. Failure to do so will result in a
2033library with poor performance.")
2034 (license license:bsd-3)))
c12efc72
AE
2035
2036(define-public glm
2037 (package
2038 (name "glm")
2039 (version "0.9.6.3")
2040 (source
2041 (origin
2042 (method url-fetch)
2043 (uri (string-append "mirror://sourceforge/ogl-math/glm-"
2044 version ".zip"))
2045 (sha256
2046 (base32
2047 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
2048 (build-system cmake-build-system)
2049 (native-inputs
2050 `(("unzip" ,unzip)))
2051 (home-page "http://glm.g-truc.net")
2052 (synopsis "OpenGL Mathematics library")
2053 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
2054library for graphics software based on the OpenGL Shading Language (GLSL)
2055specifications.")
2056 (license license:expat)))
7f18257b
AE
2057
2058(define-public lpsolve
2059 (package
2060 (name "lpsolve")
2061 (version "5.5.2.0")
2062 (source
2063 (origin
2064 (method url-fetch)
2065 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
2066 "/lp_solve_" version "_source.tar.gz"))
2067 (sha256
2068 (base32
2069 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
2070 (modules '((guix build utils)))
2071 (snippet
2072 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
2073 (("^c=cc") "c=gcc")
2074 ;; Pretend to be on a 64 bit platform to obtain a common directory
2075 ;; name for the build results on all architectures; nothing else
2076 ;; seems to depend on it.
2077 (("^PLATFORM=.*$") "PLATFORM=ux64\n")))))
2078 (build-system gnu-build-system)
2079 (arguments
2080 `(#:tests? #f ; no check target
2081 #:phases
2082 (modify-phases %standard-phases
2083 (delete 'configure)
2084 (replace 'build
2085 (lambda _
2086 (with-directory-excursion "lpsolve55"
2087 (system* "bash" "ccc"))
2088 (with-directory-excursion "lp_solve"
2089 (system* "bash" "ccc"))
2090 #t))
2091 (replace 'install
2092 (lambda* (#:key outputs #:allow-other-keys)
2093 (let* ((out (assoc-ref outputs "out"))
2094 (bin (string-append out "/bin"))
2095 (lib (string-append out "/lib"))
2096 ;; This is where LibreOffice expects to find the header
2097 ;; files, and where they are installed by Debian.
2098 (include (string-append out "/include/lpsolve")))
2099 (mkdir-p lib)
2100 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
2101 (string-append lib "/liblpsolve55.a"))
2102 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
2103 (string-append lib "/liblpsolve55.so"))
96c46210
LC
2104 (install-file "lp_solve/bin/ux64/lp_solve" bin)
2105
7f18257b
AE
2106 ;; Install a subset of the header files as on Debian
2107 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
2108 (for-each (lambda (name)
2109 (install-file name include))
2110 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 2111 (with-directory-excursion "shared"
96c46210
LC
2112 (for-each (lambda (name)
2113 (install-file name include))
2114 (find-files "." "\\.h$")))
7f18257b
AE
2115 #t))))))
2116 (home-page "http://lpsolve.sourceforge.net/")
2117 (synopsis "Mixed integer linear programming (MILP) solver")
2118 (description
2119 "lp_solve is a mixed integer linear programming solver based on the
2120revised simplex and the branch-and-bound methods.")
2121 (license license:lgpl2.1+)))
a17d4564
EB
2122
2123(define-public dealii
2124 (package
2125 (name "dealii")
2126 (version "8.2.1")
2127 (source
2128 (origin
2129 (method url-fetch)
2130 (uri (string-append "https://github.com/dealii/dealii/releases/"
2131 "download/v" version "/dealii-" version ".tar.gz"))
2132 (sha256
2133 (base32
2134 "185jych0gdnpkjwxni7pd0dda149492zwq2457xdjg76bzj78mnp"))
fc1adab1 2135 (patches (search-patches "dealii-p4est-interface.patch"))
a17d4564
EB
2136 (modules '((guix build utils)))
2137 (snippet
2138 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
2139 '(delete-file-recursively "bundled"))))
2140 (build-system cmake-build-system)
2141 (inputs
2142 `(("tbb" ,tbb)
2143 ("zlib" ,zlib)
2144 ("boost" ,boost)
2145 ("p4est" ,p4est)
2146 ("blas" ,openblas)
2147 ("lapack" ,lapack)
2148 ("arpack" ,arpack-ng)
2149 ("muparser" ,muparser)
2150 ("gfortran" ,gfortran)
2151 ("suitesparse" ,suitesparse))) ;for UMFPACK
2152 (arguments
2153 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
2154 #:configure-flags '("-DCOMPAT_FILES=OFF") ;Follow new directory structure
2155 #:phases (modify-phases %standard-phases
2156 (add-after
2157 'install 'hint-example-prefix
2158 ;; Set Cmake hints in examples so that they can find this
2159 ;; deal.II when configuring.
2160 (lambda* (#:key outputs #:allow-other-keys)
2161 (let* ((out (assoc-ref %outputs "out"))
2162 (exmpl (string-append out "/share/doc"
2163 "/dealii/examples")))
2164 (substitute* (find-files exmpl "CMakeLists.txt")
2165 (("([[:space:]]*HINTS.*)\n" _ line)
2166 (string-append line " $ENV{HOME}/.guix-profile "
2167 out "\n")))
2168 #t))))))
2169 (home-page "https://www.dealii.org")
2170 (synopsis "Finite element library")
2171 (description
2172 "Deal.II is a C++ program library targeted at the computational solution
2173of partial differential equations using adaptive finite elements. The main
2174aim of deal.II is to enable rapid development of modern finite element codes,
2175using among other aspects adaptive meshes and a wide array of tools often used
2176in finite element programs.")
2177 (license license:lgpl2.1+)))
2178
2179(define-public dealii-openmpi
2180 (package (inherit dealii)
2181 (name "dealii-openmpi")
2182 (inputs
2183 `(("mpi" ,openmpi)
2184 ;;Supported only with MPI:
2185 ("p4est" ,p4est-openmpi)
2186 ("petsc" ,petsc-openmpi)
2187 ("slepc" ,slepc-openmpi)
2188 ("metis" ,metis) ;for MUMPS
2189 ("scalapack" ,scalapack) ;for MUMPS
2190 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
2191 ("arpack" ,arpack-ng-openmpi)
2192 ,@(fold alist-delete (package-inputs dealii)
2193 '("p4est" "arpack"))))
2194 (arguments
2195 (substitute-keyword-arguments (package-arguments dealii)
2196 ((#:configure-flags cf)
2197 ``("-DMPI_C_COMPILER=mpicc"
2198 "-DMPI_CXX_COMPILER=mpicxx"
2199 "-DMPI_Fortran_COMPILER=mpifort"
2200 ,@,cf))))
2201 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
2202
2203(define-public flann
2204 (package
2205 (name "flann")
2206 (version "1.8.4")
2207 (source
2208 (origin
2209 (method url-fetch)
2210 (uri
2211 (string-append
2212 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
2213 version "-src.zip"))
2214 (sha256
2215 (base32
2216 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
2217 (build-system cmake-build-system)
2218 (native-inputs
2219 `(("unzip" ,unzip)))
2220 (inputs
2221 `(("hdf5" ,hdf5)
2222 ("octave" ,octave)
2223 ("python" ,python-2) ; print syntax
2224 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
2225 ("zlib" ,zlib)))
2226 (arguments
39b30337
LC
2227 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
2228 ;; taken 46 MiB unstripped, and 6 MiB stripped.
2229 #:strip-directories '("lib" "lib64" "libexec"
2230 "bin" "sbin" "share/flann/octave")
2231
9684e30b
LC
2232 ;; Save 12 MiB by not installing .a files. Passing
2233 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
2234 #:phases (modify-phases %standard-phases
2235 (add-after 'install 'remove-static-libraries
2236 (lambda* (#:key outputs #:allow-other-keys)
2237 (let* ((out (assoc-ref outputs "out"))
2238 (lib (string-append out "/lib")))
2239 (for-each delete-file
2240 (find-files lib "\\.a$"))
2241 #t))))
2242
39b30337 2243 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
2244 (home-page "http://www.cs.ubc.ca/research/flann/")
2245 (synopsis "Library for approximate nearest neighbors computation")
2246 (description "FLANN is a library for performing fast approximate
2247nearest neighbor searches in high dimensional spaces. It implements a
2248collection of algorithms and a system for automatically choosing the best
2249algorithm and optimum parameters depending on the dataset.
2250
2251FLANN is written in C++ and contains bindings for C, Octave and Python.")
2252 (license (license:non-copyleft "file://COPYING"
2253 "See COPYING in the distribution."))))
d8c97beb
EF
2254
2255(define-public wcalc
2256 (package
2257 (name "wcalc")
2258 (version "2.5")
2259 (source
2260 (origin
2261 (method url-fetch)
2262 (uri
2263 (string-append
2264 "mirror://sourceforge/w-calc/wcalc-" version ".tar.bz2"))
2265 (sha256
2266 (base32
2267 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
2268 (build-system gnu-build-system)
2269 (inputs
2270 `(("mpfr" ,mpfr)
2271 ("readline" ,readline)))
2272 (home-page "http://w-calc.sourceforge.net/index.php")
2273 (synopsis "Flexible command-line scientific calculator")
2274 (description "Wcalc is a very capable calculator. It has standard functions
2275(sin, asin, and sinh for example, in either radians or degrees), many
2276pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
2277variables, a command history, hex/octal/binary input and output, unit
2278conversions, embedded comments, and an expandable expression entry field. It
2279evaluates expressions using the standard order of operations.")
2280 (license license:gpl2+)))
45147b0c
FH
2281
2282(define-public xaos
2283 (package
2284 (name "xaos")
2285 (version "3.6")
2286 (source (origin
2287 (method url-fetch)
2288 (uri (string-append "mirror://sourceforge/xaos/xaos-"
2289 version ".tar.gz"))
2290 (sha256
2291 (base32
2292 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
2293 (build-system gnu-build-system)
2294 (native-inputs `(("gettext" ,gnu-gettext)))
2295 (inputs `(("libx11" ,libx11)
2296 ("zlib" ,zlib)
2297 ("libpng" ,libpng)
2298 ("gsl" ,gsl)))
2299 (arguments
2300 `(#:tests? #f ;no "check" target
2301 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
2302 (synopsis "Real-time fractal zoomer")
2303 (description "GNU XaoS is a graphical program that generates fractal
2304patterns and allows you to zoom in and out of them infinitely in a fluid,
2305continuous manner. It also includes tutorials that help to explain how fractals
2306are built. It can generate many different fractal types such as the Mandelbrot
2307set.")
2308 (home-page "http://www.gnu.org/software/xaos/")
2309 (license license:gpl2+)))
528bb464
EB
2310
2311(define-public hypre
2312 (package
2313 (name "hypre")
2314 (version "2.11.0")
2315 (source (origin
2316 (method url-fetch)
2317 (uri (string-append "https://github.com/LLNL/hypre/archive/"
2318 "v" version ".tar.gz"))
2319 (file-name (string-append name "-" version ".tar.gz"))
2320 (sha256
2321 (base32
2322 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
2323 (modules '((guix build utils)))
2324 (snippet
2325 '(begin
2326 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
2327 ;; substitute the tarball creation time.
2328 (substitute* "src/utilities/HYPRE_utilities.h"
2329 (("Date Compiled: .*$")
2330 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
2331 #t))))
2332 (build-system gnu-build-system)
2333 (outputs '("out" ;6.1 MiB of headers and libraries
2334 "doc")) ;4.8 MiB of documentation
2335 (native-inputs
2336 `(("doc++" ,doc++)
2337 ("netpbm" ,netpbm)
2338 ("texlive" ,texlive) ;full package required for fonts
2339 ("ghostscript" ,ghostscript)))
2340 (inputs
2341 `(("blas" ,openblas)
2342 ("lapack" ,lapack)))
2343 (arguments
2344 `(#:modules ((srfi srfi-1)
2345 ,@%gnu-build-system-modules)
2346 #:configure-flags '("--enable-shared"
2347 "--disable-fortran"
2348 "--without-MPI"
2349 "--with-openmp"
2350 "--with-fei"
2351 "--with-lapack"
2352 "--with-blas")
2353 #:phases
2354 (modify-phases %standard-phases
2355 (add-before 'configure 'chdir-src
2356 (lambda _ (chdir "src")))
2357 (replace 'configure
2358 (lambda* (#:key build target configure-flags
2359 #:allow-other-keys #:rest args)
2360 (let* ((configure (assoc-ref %standard-phases 'configure)))
2361 (apply configure
2362 (append args
2363 (list #:configure-flags
2364 (cons (string-append
2365 "--host=" (or target build))
2366 configure-flags)))))))
2367 (add-after 'build 'build-docs
2368 (lambda _
2369 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
2370 (replace 'check
2371 (lambda _
2372 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
2373 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
2374 (and (system* "make" "check" "CHECKRUN=")
2375 (fold (lambda (filename result)
2376 (and result
2377 (let ((size (stat:size (stat filename))))
2378 (when (not (zero? size))
2379 (format #t "~a size ~d; error indication~%"
2380 filename size))
2381 (zero? size))))
2382 #t
2383 (find-files "test" ".*\\.err$")))))
2384 (add-after 'install 'install-docs
2385 (lambda* (#:key outputs #:allow-other-keys)
2386 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
2387 (let* ((doc (assoc-ref outputs "doc"))
2388 (docdir (string-append doc "/share/doc/hypre-" ,version)))
2389 (mkdir-p docdir)
2390 (with-directory-excursion "docs"
2391 (for-each (lambda (base)
2392 (install-file (string-append base ".pdf") docdir)
2393 (copy-recursively base docdir)) ;html docs
2394 '("HYPRE_usr_manual"
2395 "HYPRE_ref_manual")))
2396 #t))))))
2397 (home-page "http://www.llnl.gov/casc/hypre/")
2398 (synopsis "Library of solvers and preconditioners for linear equations")
2399 (description
2400 "HYPRE is a software library of high performance preconditioners and
2401solvers for the solution of large, sparse linear systems of equations. It
2402features multigrid solvers for both structured and unstructured grid
2403problems.")
2404 (license license:lgpl2.1)))
2405
2406(define-public hypre-openmpi
2407 (package (inherit hypre)
2408 (name "hypre-openmpi")
2409 (inputs
2410 `(("mpi" ,openmpi)
2411 ,@(package-inputs hypre)))
2412 (arguments
2413 (substitute-keyword-arguments (package-arguments hypre)
2414 ((#:configure-flags flags)
2415 ``("--with-MPI"
2416 ,@(delete "--without-MPI" ,flags)))))
2417 (synopsis "Parallel solvers and preconditioners for linear equations")
2418 (description
2419 "HYPRE is a software library of high performance preconditioners and
2420solvers for the solution of large, sparse linear systems of equations on
2421parallel computers. It features parallel multigrid solvers for both
2422structured and unstructured grid problems.")))
6c90e183
EB
2423
2424(define-public matio
2425 (package
2426 (name "matio")
2427 (version "1.5.6")
2428 (source
2429 (origin
2430 (method url-fetch)
2431 (uri (string-append "mirror://sourceforge/matio/" version "/"
2432 "matio-" version ".tar.gz"))
2433 (sha256
2434 (base32
2435 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
2436 (build-system gnu-build-system)
2437 (inputs
2438 `(("zlib" ,zlib)
2439 ("hdf5" ,hdf5)))
2440 (home-page "http://matio.sourceforge.net/")
2441 (synopsis "Library for reading and writing MAT files")
2442 (description "Matio is a library for reading and writing MAT files. It
2443supports compressed MAT files, as well as newer (version 7.3) MAT files.")
2444 (license license:bsd-2)))