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