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