1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
35 ;;; This file is part of GNU Guix.
37 ;;; GNU Guix is free software; you can redistribute it and/or modify it
38 ;;; under the terms of the GNU General Public License as published by
39 ;;; the Free Software Foundation; either version 3 of the License, or (at
40 ;;; your option) any later version.
42 ;;; GNU Guix is distributed in the hope that it will be useful, but
43 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
44 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 ;;; GNU General Public License for more details.
47 ;;; You should have received a copy of the GNU General Public License
48 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50 (define-module (gnu packages maths)
51 #:use-module (ice-9 regex)
52 #:use-module (ice-9 match)
53 #:use-module (gnu packages)
54 #:use-module ((guix licenses) #:prefix license:)
55 #:use-module (guix packages)
56 #:use-module (guix download)
57 #:use-module (guix git-download)
58 #:use-module (guix utils)
59 #:use-module ((guix build utils) #:select (alist-replace))
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system python)
63 #:use-module (guix build-system r)
64 #:use-module (guix build-system ruby)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages audio)
67 #:use-module (gnu packages autotools)
68 #:use-module (gnu packages base)
69 #:use-module (gnu packages bison)
70 #:use-module (gnu packages boost)
71 #:use-module (gnu packages check)
72 #:use-module (gnu packages cmake)
73 #:use-module (gnu packages compression)
74 #:use-module (gnu packages curl)
75 #:use-module (gnu packages cyrus-sasl)
76 #:use-module (gnu packages documentation)
77 #:use-module (gnu packages elf)
78 #:use-module (gnu packages flex)
79 #:use-module (gnu packages fltk)
80 #:use-module (gnu packages fontutils)
81 #:use-module (gnu packages gettext)
82 #:use-module (gnu packages gcc)
83 #:use-module (gnu packages gd)
84 #:use-module (gnu packages ghostscript)
85 #:use-module (gnu packages graphviz)
86 #:use-module (gnu packages gtk)
87 #:use-module (gnu packages image)
88 #:use-module (gnu packages java)
89 #:use-module (gnu packages less)
90 #:use-module (gnu packages lisp)
91 #:use-module (gnu packages linux)
92 #:use-module (gnu packages logging)
93 #:use-module (gnu packages lua)
94 #:use-module (gnu packages gnome)
95 #:use-module (gnu packages guile)
96 #:use-module (gnu packages xorg)
97 #:use-module (gnu packages gl)
98 #:use-module (gnu packages imagemagick)
99 #:use-module (gnu packages m4)
100 #:use-module (gnu packages mpi)
101 #:use-module (gnu packages multiprecision)
102 #:use-module (gnu packages netpbm)
103 #:use-module (gnu packages pcre)
104 #:use-module (gnu packages popt)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pkg-config)
107 #:use-module (gnu packages pulseaudio)
108 #:use-module (gnu packages python)
109 #:use-module (gnu packages python-web)
110 #:use-module (gnu packages python-xyz)
111 #:use-module (gnu packages qt)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages ruby)
114 #:use-module (gnu packages tbb)
115 #:use-module (gnu packages scheme)
116 #:use-module (gnu packages shells)
117 #:use-module (gnu packages tcl)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tex)
120 #:use-module (gnu packages tls)
121 #:use-module (gnu packages version-control)
122 #:use-module (gnu packages wxwidgets)
123 #:use-module (gnu packages xml)
124 #:use-module (srfi srfi-1))
132 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
134 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
135 (build-system gnu-build-system)
136 (inputs `(("gtk+" ,gtk+)
137 ("libxml2" ,libxml2)))
138 (native-inputs `(("pkg-config" ,pkg-config)))
139 (synopsis "Natural deduction first-order logic interface")
140 (description "Aris is a program for performing logical proofs. It supports
141 propositional and predicate logic, as well as Boolean algebra and
142 arithmetical logic. In addition to its predefined inference and equivalence
143 rules, Aris also supports references to older proofs. Its use of standard
144 logical symbols and its natural deduction interface make it easy to use for
146 (license license:gpl3+)
147 (home-page "https://www.gnu.org/software/aris/")))
149 (define-public c-graph
155 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
158 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
159 (build-system gnu-build-system)
161 `(("fortran" ,gfortran)))
162 (synopsis "Visualizing and demonstrating convolution")
164 "GNU C-Graph is a tool for demonstrating the theory of convolution.
165 Thus, it can serve as an excellent aid to students of signal and systems
166 theory in visualizing the convolution process. Rather than forcing the
167 student to write code, the program offers an intuitive interface with
168 interactive dialogs to guide them.")
169 (license license:gpl3+)
170 (home-page "https://www.gnu.org/software/c-graph/")))
179 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
180 version "/coda-" version ".tar.gz"))
182 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
183 (patches (search-patches "coda-use-system-libs.patch"))
184 (modules '((guix build utils)))
186 ;; Make sure we don't use the bundled software.
188 (for-each (lambda (d)
189 (delete-file-recursively (string-append "libcoda/" d)))
190 '("zlib" "pcre" "expat"))
193 `(("fortran" ,gfortran)
195 ("python-numpy" ,python-numpy)))
202 (build-system gnu-build-system)
204 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
205 "LIBS= -lz -lpcre -lexpat")))
206 (synopsis "A common interface to various earth observation data formats")
208 "The Common Data Access toolbox (CODA) provides a set of interfaces for
209 reading remote sensing data from earth observation data files. It consists of
210 command line applications and interfaces to the C, Fortran, Python, and Java
211 programming languages.")
212 (home-page "https://stcorp.nl/coda")
213 (license license:gpl2+)))
221 (uri (string-append "http://www.qhull.org/download/qhull-"
222 (car (string-split version #\.))
226 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
227 (build-system cmake-build-system)
228 (synopsis "Calculate convex hulls and related structures")
230 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
231 diagram, halfspace intersection about a point, furthest-site Delaunay
232 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
233 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
234 algorithm for computing the convex hull. It handles roundoff errors from
235 floating point arithmetic. It computes volumes, surface areas, and
236 approximations to the convex hull.
238 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
239 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
240 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
242 (home-page "http://qhull.org")
243 (license (license:non-copyleft "file://COPYING.txt"
244 "See COPYING in the distribution."))))
246 (define-public python-cvxopt
248 (name "python-cvxopt")
253 (url "https://github.com/cvxopt/cvxopt.git")
255 (file-name (git-file-name name version))
258 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
259 (build-system python-build-system)
262 (modify-phases %standard-phases
263 (add-after 'unpack 'find-libraries
264 (lambda* (#:key inputs #:allow-other-keys)
265 (setenv "CVXOPT_BLAS_LIB" "openblas")
266 (setenv "CVXOPT_BUILD_FFTW" "1")
267 (setenv "CVXOPT_BUILD_GLPK" "1")
268 (setenv "CVXOPT_BUILD_GSL" "1")
275 ("openblas" ,openblas)
276 ("suitesparse" ,suitesparse)))
277 (home-page "https://www.cvxopt.org")
278 (synopsis "Python library for convex optimization")
280 "CVXOPT is a package for convex optimization based on the Python
281 programming language. Its main purpose is to make the development of software
282 for convex optimization applications straightforward by building on Python’s
283 extensive standard library and on the strengths of Python as a high-level
284 programming language.")
285 (license license:gpl3+)))
287 (define-public python2-cvxopt
288 (package-with-python2 python-cvxopt))
296 (uri (string-append "mirror://gnu/units/units-" version
299 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
300 (build-system gnu-build-system)
302 `(("readline" ,readline)
303 ("python" ,python-wrapper) ;for 'units_cur' script
304 ("python-requests" ,python-requests)))
306 `(#:phases (modify-phases %standard-phases
307 (add-after 'install 'wrap-units_cur
308 (lambda* (#:key outputs #:allow-other-keys)
309 (let* ((out (assoc-ref outputs "out"))
310 (bin (string-append out "/bin")))
311 (wrap-program (string-append bin "/units_cur")
312 `("PYTHONPATH" ":" prefix
313 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
315 (synopsis "Conversion between thousands of scales")
317 "GNU Units converts numeric quantities between units of measure. It
318 can handle scale changes through adaptive usage of standard scale
319 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
320 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
321 enough to be used effectively as a scientific calculator.")
322 (license license:gpl3+)
323 (home-page "https://www.gnu.org/software/units/")))
325 (define-public double-conversion
327 (name "double-conversion")
329 (home-page "https://github.com/google/double-conversion")
332 (uri (git-reference (url home-page)
333 (commit (string-append "v" version))))
334 (file-name (git-file-name name version))
337 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
338 (build-system cmake-build-system)
340 '(#:test-target "test"
341 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
342 "-DBUILD_TESTING=ON")))
343 (synopsis "Conversion routines for IEEE doubles")
345 "The double-conversion library provides binary-decimal and decimal-binary
346 routines for IEEE doubles. The library consists of efficient conversion
347 routines that have been extracted from the V8 JavaScript engine.")
348 (license license:bsd-3)))
350 (define-public dionysus
356 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
360 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
361 (build-system gnu-build-system)
362 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
363 (synopsis "Local search for universal constants and scientific values")
365 "GNU Dionysus is a convenient system for quickly retrieving the values of
366 mathematical constants used in science and engineering. Values can be
367 searched using a simple command-line tool, choosing from three databases:
368 universal constants, atomic numbers, and constants related to
370 (license license:gpl3+)
371 (home-page "https://www.gnu.org/software/dionysus/")))
379 (uri (string-append "mirror://gnu/gsl/gsl-"
383 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
384 (patches (search-patches "gsl-test-i686.patch"))))
385 (build-system gnu-build-system)
387 `(;; Currently there are numerous tests that fail on "exotic"
388 ;; architectures such as aarch64 and ppc64le.
389 ,@(if (string-prefix? "aarch64-linux"
390 (or (%current-target-system) (%current-system)))
393 (home-page "https://www.gnu.org/software/gsl/")
394 (synopsis "Numerical library for C and C++")
396 "The GNU Scientific Library is a library for numerical analysis in C
397 and C++. It includes a wide range of mathematical routines, with over 1000
398 functions in total. Subject areas covered by the library include:
399 differential equations, linear algebra, Fast Fourier Transforms and random
401 (license license:gpl3+)))
410 (uri (string-append "mirror://gnu/glpk/glpk-"
414 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
415 (build-system gnu-build-system)
419 `(#:configure-flags '("--with-gmp")))
420 (home-page "https://www.gnu.org/software/glpk/")
421 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
423 "GLPK is a C library for solving large-scale linear programming (LP),
424 mixed integer programming (MIP), and other related problems. It supports the
425 GNU MathProg modeling language, a subset of the AMPL language, and features a
426 translator for the language. In addition to the C library, a stand-alone
427 LP/MIP solver is included in the package.")
428 (license license:gpl3+)))
437 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
439 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
441 "/4ti2-" version ".tar.gz"))
443 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
444 (build-system gnu-build-system)
446 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
450 (home-page "http://www.4ti2.de/")
451 (synopsis "Mathematical tool suite for problems on linear spaces")
453 "4ti2 implements algorithms for solving algebraic, geometric and
454 combinatorial problems on linear spaces. Among others, it solves systems
455 of linear equations, computes extreme rays of polyhedral cones, solves
456 integer programming problems and computes Markov bases for statistics.")
457 (license license:gpl2+)))
459 (define-public cddlib
466 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
467 (string-delete #\. version) ".tar.gz"))
470 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
471 (build-system gnu-build-system)
474 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
475 (synopsis "Library for convex hulls and extreme rays of polyhedra")
477 "The C-library cddlib implements the Double Description Method of
478 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
479 rays of a general convex polyhedron given by a system of linear inequalities
480 in arbitrary dimension. It can also be used for the converse operation of
481 computing convex hulls.")
482 (license license:gpl2+)))
484 (define-public arpack-ng
488 (home-page "https://github.com/opencollab/arpack-ng")
491 (uri (git-reference (url home-page) (commit version)))
492 (file-name (git-file-name name version))
495 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
496 (build-system gnu-build-system)
498 `(("autoconf" ,autoconf)
499 ("automake" ,automake)
500 ("libtool" ,libtool)))
503 ("fortran" ,gfortran)))
504 (synopsis "Fortran subroutines for solving eigenvalue problems")
506 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
507 large scale eigenvalue problems.")
508 (license (license:non-copyleft "file://COPYING"
509 "See COPYING in the distribution."))))
511 (define-public arpack-ng-3.3.0
515 (name (package-name arpack-ng))
516 (home-page (package-home-page arpack-ng))
520 (uri (string-append home-page "/archive/" version ".tar.gz"))
521 (file-name (string-append name "-" version ".tar.gz"))
524 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
526 (define-public arpack-ng-openmpi
527 (package (inherit arpack-ng)
528 (name "arpack-ng-openmpi")
531 ,@(package-inputs arpack-ng)))
533 (substitute-keyword-arguments (package-arguments arpack-ng)
534 ((#:configure-flags _ '())
536 ((#:phases phases '%standard-phases)
537 `(modify-phases ,phases
538 (add-before 'check 'mpi-setup
540 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
542 (define-public lapack
549 (uri (string-append "http://www.netlib.org/lapack/lapack-"
553 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
554 (build-system cmake-build-system)
555 (home-page "http://www.netlib.org/lapack/")
556 (inputs `(("fortran" ,gfortran)
557 ("python" ,python-2)))
559 `(#:configure-flags (list
560 "-DBUILD_SHARED_LIBS:BOOL=YES"
563 ;; Build the 'LAPACKE_clatms' functions.
564 "-DLAPACKE_WITH_TMG=ON")
566 (modify-phases %standard-phases
567 (add-before 'check 'patch-python
568 (lambda* (#:key inputs #:allow-other-keys)
569 (let ((python (assoc-ref inputs "python")))
570 (substitute* "lapack_testing.py"
571 (("/usr/bin/env python") python)))
573 (synopsis "Library for numerical linear algebra")
575 "LAPACK is a Fortran 90 library for solving the most commonly occurring
576 problems in numerical linear algebra.")
577 (license (license:non-copyleft "file://LICENSE"
578 "See LICENSE in the distribution."))))
580 (define-public scalapack
587 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
591 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
592 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
593 (build-system cmake-build-system)
596 ("fortran" ,gfortran)
597 ("lapack" ,lapack))) ;for testing only
599 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
600 #:phases (modify-phases %standard-phases
601 (add-before 'check 'mpi-setup
603 (home-page "http://www.netlib.org/scalapack/")
604 (synopsis "Library for scalable numerical linear algebra")
606 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
607 routines on parallel distributed memory machines. ScaLAPACK solves dense and
608 banded linear systems, least squares problems, eigenvalue problems, and
609 singular value problems.")
610 (license (license:non-copyleft "file://LICENSE"
611 "See LICENSE in the distribution."))))
613 (define-public gnuplot
619 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
623 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
624 (build-system gnu-build-system)
625 (inputs `(("readline" ,readline)
631 `(("pkg-config" ,pkg-config)
632 ("texlive" ,texlive-tiny)))
633 (arguments `(#:configure-flags (list (string-append
634 "--with-texdir=" %output
635 "/texmf-local/tex/latex/gnuplot"))))
636 (home-page "http://www.gnuplot.info")
637 (synopsis "Command-line driven graphing utility")
638 (description "Gnuplot is a portable command-line driven graphing
639 utility. It was originally created to allow scientists and students to
640 visualize mathematical functions and data interactively, but has grown to
641 support many non-interactive uses such as web scripting. It is also used as a
642 plotting engine by third-party applications like Octave.")
643 ;; X11 Style with the additional restriction that derived works may only be
644 ;; distributed as patches to the original.
645 (license (license:fsf-free
646 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
656 (url "https://github.com/OkoSanto/GCTP.git")
657 (commit (string-append "v" version))))
658 (file-name (git-file-name name version))
660 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
662 `(("fortran" ,gfortran)))
663 (build-system gnu-build-system)
664 (synopsis "General Cartographic Transformation Package (GCTP)")
666 "The General Cartographic Transformation Package (GCTP) is a system of
667 software routines designed to permit the transformation of coordinate pairs
668 from one map projection to another. The GCTP is the standard computer
669 software used by the National Mapping Division for map projection
671 (home-page "https://github.com/OkoSanto/GCTP")
672 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
681 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
682 version "/src/hdf-" version ".tar.bz2"))
684 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
685 (patches (search-patches "hdf4-architectures.patch"
686 "hdf4-reproducibility.patch"
687 "hdf4-shared-fortran.patch"))))
688 (build-system gnu-build-system)
690 `(("gfortran" ,gfortran)
695 ("libjpeg" ,libjpeg)))
697 `(#:parallel-tests? #f
698 #:configure-flags '("--enable-shared")
700 (modify-phases %standard-phases
701 ;; This is inspired by two of Debian's patches.
702 (add-before 'configure 'add-more-aarch64-support
704 (substitute* '("mfhdf/ncgen/ncgen.l"
705 "mfhdf/ncgen/ncgenyy.c"
706 "mfhdf/libsrc/netcdf.h.in")
707 (("AIX5L64") "__aarch64__"))
709 (add-before 'configure 'patchbuild
712 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
714 (("/bin/mkdir") "mkdir"))
715 (substitute* (find-files "." "^Makefile\\.in$")
716 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
717 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
718 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
719 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
720 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
722 (add-after 'configure 'patch-settings
724 ;; libhdf4.settings contains the full path of the
725 ;; compilers used, and its contents are included in
726 ;; .so-files. We truncate the hashes to avoid
727 ;; unnecessary store references to those compilers:
728 (substitute* "libhdf4.settings"
729 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
730 (string-append prefix (string-take hash 10) "...")))
733 (home-page "https://www.hdfgroup.org/products/hdf4/")
735 "Library and multi-object file format for storing and managing data")
736 (description "HDF4 is a library and multi-object file format for storing
737 and managing data between machines. HDF4 is an older hierarchical data format,
738 incompatible with HDF5.")
740 (license:non-copyleft
741 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
743 (define-public hdf4-alt
748 (substitute-keyword-arguments (package-arguments hdf4)
749 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
751 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
760 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
761 "hdf5-" (version-major+minor version)
762 "/hdf5-" version "/src/hdf5-"
764 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
766 (match (string-split version #\.)
768 (string-append major minor)))
769 "/src/hdf5-" version ".tar.bz2")))
771 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
772 (patches (search-patches "hdf5-config-date.patch"
773 "hdf5-1.8-mpi-deprecations.patch"))))
774 (build-system gnu-build-system)
778 `(("gfortran" ,gfortran)
779 ("perl" ,perl))) ;part of the test machinery needs Perl
780 (outputs '("out" ; core library
781 "fortran")) ; fortran interface
783 `(;; Some of the users, notably Flann, need the C++ interface.
784 #:configure-flags '("--enable-cxx"
786 "--enable-fortran2003"
788 ;; Build a thread-safe library. Unfortunately,
789 ;; 'configure' invites you to either turn off C++,
790 ;; Fortran, and the high-level interface (HL), or
791 ;; to pass '--enable-unsupported'. Debian
792 ;; packagers chose to pass '--enable-unsupported'
793 ;; and we follow their lead here.
794 "--enable-threadsafe"
796 "--enable-unsupported")
797 ;; Use -fPIC to allow the R bindings to link with the static libraries
798 #:make-flags (list "CFLAGS=-fPIC"
801 (modify-phases %standard-phases
802 (add-before 'configure 'patch-configure
803 (lambda* (#:key outputs #:allow-other-keys)
804 (substitute* "configure"
806 (substitute* "fortran/src/Makefile.in"
807 (("libhdf5_fortran_la_LDFLAGS =")
808 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
809 (assoc-ref outputs "fortran") "/lib")))
810 (substitute* "hl/fortran/src/Makefile.in"
811 (("libhdf5hl_fortran_la_LDFLAGS =")
812 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
813 (assoc-ref outputs "fortran") "/lib")))
815 (add-after 'configure 'patch-settings
817 ;; libhdf5.settings contains the full path of the
818 ;; compilers used, and its contents are included in
819 ;; libhdf5.so. We truncate the hashes to avoid
820 ;; unnecessary store references to those compilers:
821 (substitute* "src/libhdf5.settings"
822 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
823 (string-append prefix (string-take hash 10) "..."))
824 ;; Don't record the build-time kernel version to make the
825 ;; settings file reproducible.
826 (("Uname information:.*")
827 "Uname information: Linux\n"))
829 (add-after 'install 'patch-references
830 (lambda* (#:key inputs outputs #:allow-other-keys)
831 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
832 (zlib (assoc-ref inputs "zlib")))
833 (substitute* (find-files bin "h5p?cc")
835 (string-append "-L" zlib "/lib " lib)))
837 (add-after 'install 'split
838 (lambda* (#:key inputs outputs #:allow-other-keys)
839 ;; Move all fortran-related files
840 (let* ((out (assoc-ref outputs "out"))
841 (bin (string-append out "/bin"))
842 (lib (string-append out "/lib"))
843 (inc (string-append out "/include"))
844 (ex (string-append out "/share/hdf5_examples/fortran"))
845 (fort (assoc-ref outputs "fortran"))
846 (fbin (string-append fort "/bin"))
847 (flib (string-append fort "/lib"))
848 (finc (string-append fort "/include"))
849 (fex (string-append fort "/share/hdf5_examples/fortran")))
854 ;; Note: When built with --enable-parallel, the 'h5fc' file
855 ;; doesn't exist, hence this condition.
856 (when (file-exists? (string-append bin "/h5fc"))
857 (rename-file (string-append bin "/h5fc")
858 (string-append fbin "/h5fc")))
859 (for-each (lambda (file)
861 (string-append flib "/" (basename file))))
862 (find-files lib ".*fortran.*"))
863 (for-each (lambda (file)
865 (string-append finc "/" (basename file))))
866 (find-files inc ".*mod"))
867 (for-each (lambda (file)
869 (string-append fex "/" (basename file))))
870 (find-files ex ".*"))
871 (delete-file-recursively ex))
873 (home-page "http://www.hdfgroup.org")
874 (synopsis "Management suite for extremely large and complex data")
875 (description "HDF5 is a suite that makes possible the management of
876 extremely large and complex data collections.")
877 (license (license:x11-style
878 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
880 (define-public hdf5-1.10
881 (package (inherit hdf5)
886 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
887 "hdf5-" (version-major+minor version)
888 "/hdf5-" version "/src/hdf5-"
890 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
893 (take (string-split version #\.) 2))
894 "/src/hdf5-" version ".tar.bz2")))
896 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
897 (patches (search-patches "hdf5-config-date.patch"
898 "hdf5-mpi-deprecations.patch"))))))
900 (define-public hdf-java
908 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
909 version "/src/CMake-hdfjava-" version ".tar.gz"))
911 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
912 (modules '((guix build utils)))
913 (snippet ; Make sure we don't use the bundled sources and binaries.
915 (for-each delete-file
916 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
917 "HDF4.tar.gz" "HDF5.tar.gz"))
918 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
920 (build-system gnu-build-system)
922 `(("jdk" ,icedtea "jdk")
923 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
925 ("hamcrest-core" ,java-hamcrest-core)
926 ("junit" ,java-junit)
927 ("slf4j-simple" ,java-slf4j-simple)))
933 ("slf4j-api" ,java-slf4j-api)))
936 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
937 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
938 (assoc-ref %build-inputs "jdk") "/lib" )
939 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
940 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
943 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
944 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
945 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
946 (string-append "JPEGLIB="
947 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
951 (modify-phases %standard-phases
952 (add-before 'configure 'chdir-to-source
953 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
954 (add-before 'configure 'patch-build
955 (lambda* (#:key inputs outputs #:allow-other-keys)
956 (substitute* "configure"
957 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
958 (("/bin/cat") (which "cat")))
959 ;; Set classpath for compilation
960 (substitute* '("hdf/hdf5lib/Makefile.in"
961 "hdf/hdf5lib/exceptions/Makefile.in"
962 "hdf/hdflib/Makefile.in")
963 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
964 (string-append (assoc-ref inputs "slf4j-api")
965 "/share/java/slf4j-api.jar")))
966 ;; Replace outdated config.sub and config.guess:
967 (with-directory-excursion "config"
968 (for-each (lambda (file)
970 (string-append (assoc-ref inputs "automake")
972 ,(version-major+minor (package-version automake))
974 '("config.sub" "config.guess")))
976 ;; Fix embedded version number
977 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
978 (substitute* "hdf/hdf5lib/H5.java"
980 (string-join hdf5version ", "))))
982 (mkdir-p (string-append (assoc-ref outputs "out")))
983 ;; Set classpath for tests
984 (let* ((build-dir (getcwd))
985 (lib (string-append build-dir "/lib"))
986 (jhdf (string-append lib "/jhdf.jar"))
987 (jhdf5 (string-append lib "/jhdf5.jar"))
990 (string-append (assoc-ref inputs i)
991 "/share/java/" i ".jar"))
992 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
994 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
996 (substitute* '("test/hdf5lib/Makefile.in"
997 "test/hdf5lib/junit.sh.in"
998 "examples/runExample.sh.in")
1000 (string-append (assoc-ref inputs "coreutils")
1003 (string-append (assoc-ref inputs "coreutils")
1005 (("CLASSPATH=[^\n]*")
1006 (string-append "CLASSPATH=" class-path)))
1007 (setenv "CLASSPATH" class-path))
1009 (add-before 'check 'build-examples
1011 (apply invoke `("javac"
1012 ,@(find-files "examples" ".*\\.java"))))))
1014 #:parallel-build? #f
1016 #:parallel-tests? #f ))
1017 (home-page "https://support.hdfgroup.org/products/java")
1018 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1019 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1020 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1023 ;; BSD-style license:
1024 (license (license:x11-style
1025 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1026 /current/src/unpacked/COPYING"))))
1028 (define-public hdf-eos2
1035 (uri "ftp://edhs1.gsfc.nasa.gov\
1036 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1038 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1039 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1040 "hdf-eos2-build-shared.patch"
1041 "hdf-eos2-fortrantests.patch"))))
1042 (build-system gnu-build-system)
1044 `(("gfortran" ,gfortran)))
1046 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1048 ("libjpeg" ,libjpeg)
1051 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1052 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1053 #:parallel-tests? #f))
1054 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1055 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1056 (description "HDF-EOS2 is a software library built on HDF4 which supports
1057 the construction of data structures used in NASA's Earth Observing
1058 System (Grid, Point and Swath).")
1060 ;; Source files carry a permissive license header.
1061 (license (license:non-copyleft home-page))))
1063 (define-public hdf-eos5
1069 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1070 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1073 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1074 (patches (search-patches "hdf-eos5-build-shared.patch"
1075 "hdf-eos5-remove-gctp.patch"
1076 "hdf-eos5-fix-szip.patch"
1077 "hdf-eos5-fortrantests.patch"))))
1079 `(("gfortran" ,gfortran)))
1080 (build-system gnu-build-system)
1086 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1087 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1088 #:parallel-tests? #f))
1089 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1091 "HDF-EOS5 is a software library built on HDF5 to support the construction
1092 of data structures used in NASA's Earth Observing System (Grid, Point and
1094 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1096 ;; Source files carry a permissive license header.
1097 (license (license:non-copyleft home-page))))
1099 (define-public hdf5-parallel-openmpi
1100 (package (inherit hdf5)
1101 (name "hdf5-parallel-openmpi")
1104 ,@(package-inputs hdf5)))
1106 (substitute-keyword-arguments (package-arguments hdf5)
1107 ((#:configure-flags flags)
1108 ``("--enable-parallel"
1109 ,@(delete "--enable-cxx"
1110 (delete "--enable-threadsafe" ,flags))))
1112 `(modify-phases ,phases
1113 (add-after 'build 'mpi-setup
1115 (add-before 'check 'patch-tests
1117 ;; OpenMPI's mpirun will exit with non-zero status if it
1118 ;; detects an "abnormal termination", i.e. any process not
1119 ;; calling MPI_Finalize(). Since the test is explicitly
1120 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1121 ;; H5C_flush_cache from being called, mpirun will always
1122 ;; complain, so turn this test off.
1123 (substitute* "testpar/Makefile"
1124 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1125 (string-append front back "\n")))
1126 (substitute* "tools/h5diff/testph5diff.sh"
1127 (("/bin/sh") (which "sh")))
1129 (synopsis "Management suite for data with parallel IO support")))
1131 (define-public h5check
1138 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1139 "h5check/src/h5check-" version ".tar.gz"))
1142 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1143 (build-system gnu-build-system)
1144 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1145 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1146 (synopsis "HDF5 format checker")
1147 (description "@code{h5check} is a validation tool for verifying that an
1148 HDF5 file is encoded according to the HDF File Format Specification.")
1149 (license (license:x11-style "file://COPYING"))))
1157 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1162 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1163 (build-system cmake-build-system)
1164 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1165 (inputs `(("lapack" ,lapack)
1167 ;; FIXME: Even though the fonts are available dvips complains:
1168 ;; "Font cmmi10 not found; characters will be left blank."
1170 `(("texlive" ,texlive-tiny)
1171 ("ghostscript" ,ghostscript)
1172 ("doxygen" ,doxygen)))
1173 (home-page "http://itpp.sourceforge.net")
1174 (synopsis "C++ library of maths, signal processing and communication classes")
1175 (description "IT++ is a C++ library of mathematical, signal processing and
1176 communication classes and functions. Its main use is in simulation of
1177 communication systems and for performing research in the area of
1178 communications. The kernel of the library consists of generic vector and
1179 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1180 similar to MATLAB, GNU Octave or SciPy.")
1181 (license license:gpl3+)))
1183 (define-public netcdf
1190 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1191 "netcdf-" version ".tar.gz"))
1194 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1195 (patches (search-patches "netcdf-date-time.patch"
1196 "netcdf-tst_h_par.patch"))))
1197 (build-system gnu-build-system)
1200 ("doxygen" ,doxygen)
1201 ("graphviz" ,graphviz)))
1203 `(("hdf4" ,hdf4-alt)
1206 ("libjpeg" ,libjpeg)))
1208 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1210 #:phases (modify-phases %standard-phases
1211 (add-before 'configure 'fix-source-date
1213 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1214 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1215 ;; to '1st hour of the current day', and therefore makes the
1216 ;; package not reproducible.
1217 (substitute* "./configure"
1218 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1219 "date --date='@0'"))
1221 (add-after 'configure 'patch-settings
1223 ;; libnetcdf.settings contains the full filename of the compilers
1224 ;; used to build the library. We truncate the hashes of those
1225 ;; filenames to avoid unnecessary references to the corresponding
1227 (substitute* "libnetcdf.settings"
1228 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1229 (string-append prefix (string-take hash 10) "...")))
1232 #:parallel-tests? #f)) ;various race conditions
1233 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1234 (synopsis "Library for scientific data")
1235 (description "NetCDF is an interface for scientific data access and a
1236 software library that provides an implementation of the interface. The netCDF
1237 library defines a machine-independent format for representing scientific data.
1238 Together, the interface, library, and format support the creation, access, and
1239 sharing of scientific data.")
1240 (license (license:x11-style "file://COPYRIGHT"))))
1242 (define-public netcdf-parallel-openmpi
1243 (package (inherit netcdf)
1244 (name "netcdf-parallel-openmpi")
1247 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1248 (package-inputs netcdf))))
1249 ;; TODO: Replace pkg-config references in nc-config with absolute references
1251 (substitute-keyword-arguments (package-arguments netcdf)
1252 ((#:configure-flags flags)
1253 `(cons* "CC=mpicc" "CXX=mpicxx"
1254 "--enable-parallel-tests"
1255 ;; Shared libraries not supported with parallel IO.
1256 "--disable-shared" "--with-pic"
1259 (define-public netcdf-fortran
1261 (name "netcdf-fortran")
1266 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1270 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1271 (build-system gnu-build-system)
1273 `(#:parallel-tests? #f))
1275 `(("netcdf" ,netcdf)))
1277 `(("gfortran" ,gfortran)))
1278 (synopsis "Fortran interface for the netCDF library")
1279 (description (package-description netcdf))
1280 (home-page (package-home-page netcdf))
1281 (license (package-license netcdf))))
1283 (define-public nlopt
1289 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1292 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1293 (build-system gnu-build-system)
1295 `(;; Shared libraries are not built by default. They are required to
1296 ;; build the Guile, Octave, and Python bindings.
1297 #:configure-flags '("--enable-shared")
1300 (modify-phases %standard-phases
1301 (add-before 'configure 'set-libnlopt-file-name
1302 (lambda* (#:key outputs #:allow-other-keys)
1303 ;; Make sure the Scheme module refers to the library by its
1304 ;; absolute file name (we cannot do that from a snippet
1305 ;; because the expansion of @libdir@ contains
1307 (let ((out (assoc-ref outputs "out")))
1308 (substitute* "swig/nlopt.scm.in"
1310 (string-append out "/lib/libnlopt")))
1312 (inputs `(("guile" ,guile-2.0)))
1313 (native-inputs `(("pkg-config" ,pkg-config)))
1314 (home-page "http://ab-initio.mit.edu/wiki/")
1315 (synopsis "Library for nonlinear optimization")
1316 (description "NLopt is a library for nonlinear optimization, providing a
1317 common interface for a number of different free optimization routines available
1318 online as well as original implementations of various other algorithms.")
1319 (license license:lgpl2.1+)))
1321 (define-public ipopt
1328 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1332 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1333 (modules '((guix build utils)))
1335 ;; Make sure we don't use the bundled software.
1337 (delete-file-recursively "ThirdParty")
1339 (build-system gnu-build-system)
1341 '(#:phases (modify-phases %standard-phases
1342 (add-after 'install 'add--L-flags-in-ipopt.pc
1343 (lambda* (#:key inputs outputs #:allow-other-keys)
1344 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1345 ;; move it to "Libs.private" where it belongs, and add a
1346 ;; '-L' flag for LAPACK.
1347 (let ((out (assoc-ref outputs "out"))
1348 (lapack (assoc-ref inputs "lapack")))
1349 (substitute* (string-append out "/lib/pkgconfig/"
1351 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1352 (string-append "Libs: " before " " after "\n"
1353 "Libs.private: " before
1354 "-L" lapack "/lib -llapack -lblas "
1358 `(("gfortran" ,gfortran)))
1360 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1361 `(("lapack" ,lapack))) ;for both libblas and liblapack
1362 (home-page "http://www.coin-or.org")
1363 (synopsis "Large-scale nonlinear optimizer")
1365 "The Interior Point Optimizer (IPOPT) is a software package for
1366 large-scale nonlinear optimization. It provides C++, C, and Fortran
1368 (license license:epl1.0)))
1376 (uri (string-append "https://www.coin-or.org/download/source/"
1377 "Clp/Clp-" version ".tgz"))
1380 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1381 (modules '((guix build utils)))
1383 ;; Make sure we don't use the bundled software.
1385 (delete-file-recursively "ThirdParty")
1387 (build-system gnu-build-system)
1389 `(("gfortran" ,gfortran)
1390 ("pkg-config" ,pkg-config)))
1392 `(("openblas" ,openblas)))
1393 (home-page "https://www.coin-or.org")
1394 (synopsis "Linear programming solver")
1396 "CLP is a high quality linear programming solver. Its main strengths are
1397 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1398 linear and quadratic objectives. There are limited facilities for nonlinear
1399 and quadratic objectives using the Simplex algorithm.")
1400 (license license:epl1.0)))
1402 (define-public ceres
1404 (name "ceres-solver")
1406 (home-page "http://ceres-solver.org/")
1409 (uri (string-append home-page "ceres-solver-"
1413 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1414 (build-system cmake-build-system)
1416 ;; TODO: Build HTML user documentation and install separately.
1417 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1418 "-DBUILD_SHARED_LIBS=ON")
1420 #:phases (modify-phases %standard-phases
1421 (add-before 'configure 'set-library-directory
1423 ;; Install libraries to lib/, not lib64/.
1424 (substitute* "internal/ceres/CMakeLists.txt"
1425 (("set\\(LIB_SUFFIX \"64\"\\)")
1426 "set(LIB_SUFFIX \"\")"))
1429 `(("pkg-config" ,pkg-config)))
1431 `(("glog" ,glog))) ;for #include <glog/glog.h>
1436 ("suitesparse" ,suitesparse)
1437 ("gflags" ,gflags)))
1438 (synopsis "C++ library for solving large optimization problems")
1440 "Ceres Solver is a C++ library for modeling and solving large,
1441 complicated optimization problems. It is a feature rich, mature and
1442 performant library which has been used in production since 2010. Ceres Solver
1443 can solve two kinds of problems:
1445 @item non-linear least squares problems with bounds constraints;
1446 @item general unconstrained optimization problems.
1448 (license license:bsd-3)))
1450 ;; For a fully featured Octave, users are strongly recommended also to install
1451 ;; the following packages: less, ghostscript, gnuplot.
1452 (define-public octave-cli
1459 (uri (string-append "mirror://gnu/octave/octave-"
1463 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1464 (build-system gnu-build-system)
1466 `(("alsa-lib" ,alsa-lib)
1467 ("arpack" ,arpack-ng)
1472 ("fontconfig" ,fontconfig)
1473 ("freetype" ,freetype)
1477 ("graphicsmagick" ,graphicsmagick)
1480 ("libsndfile" ,libsndfile)
1484 ("portaudio" ,portaudio)
1486 ("readline" ,readline)
1487 ("suitesparse" ,suitesparse)
1488 ("texinfo" ,texinfo)
1492 ("gfortran" ,gfortran)
1493 ("pkg-config" ,pkg-config)
1495 ;; The following inputs are not actually used in the build process.
1496 ;; However, the ./configure gratuitously tests for their existence and
1497 ;; assumes that programs not present at build time are also not, and
1498 ;; can never be, available at run time! If these inputs are therefore
1499 ;; not present, support for them will be built out. However, Octave
1500 ;; will still run without them, albeit without the features they
1503 ("ghostscript" ,ghostscript)
1504 ("gnuplot" ,gnuplot)))
1505 ;; Octave code uses this variable to detect directories holding multiple CA
1506 ;; certificates to verify peers with. This is required for the networking
1507 ;; functions that require encryption to work properly.
1508 (native-search-paths
1509 (list (search-path-specification
1510 (variable "CURLOPT_CAPATH")
1511 (files '("etc/ssl/certs")))))
1514 (list (string-append "--with-shell="
1515 (assoc-ref %build-inputs "bash")
1518 (modify-phases %standard-phases
1519 (add-after 'configure 'configure-makeinfo
1520 (lambda* (#:key inputs #:allow-other-keys)
1521 (substitute* "libinterp/corefcn/help.h"
1524 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1526 (home-page "https://www.gnu.org/software/octave/")
1527 (synopsis "High-level language for numerical computation")
1528 (description "GNU Octave is a high-level interpreted language that is
1529 specialized for numerical computations. It can be used for both linear and
1530 non-linear applications and it provides great support for visualizing results.
1531 Work may be performed both at the interactive command-line as well as via
1533 (license license:gpl3+)))
1535 (define-public octave
1536 (package (inherit octave-cli)
1539 (inherit (package-source octave-cli))))
1541 `(("qscintilla" ,qscintilla)
1543 ,@(package-inputs octave-cli)))
1545 `(("qttools" , qttools) ;for lrelease
1546 ("texlive" ,texlive) ;for texi2dvi
1547 ,@(package-native-inputs octave-cli)))
1549 (substitute-keyword-arguments (package-arguments octave-cli)
1551 `(modify-phases ,phases
1552 (add-before 'configure 'patch-qscintilla-library-name
1553 (lambda* (#:key inputs #:allow-other-keys)
1554 ;; The QScintilla library that the Octave configure script tries
1555 ;; to link with should be named libqscintilla-qt5.so, but the
1556 ;; QScintilla input provides the shared library as
1557 ;; libqscintilla2_qt5.so.
1558 (substitute* "configure"
1559 (("qscintilla2-qt5")
1563 (define-public qtoctave
1564 (deprecated-package "qtoctave" octave))
1566 (define-public opencascade-oce
1568 (name "opencascade-oce")
1574 (url "https://github.com/tpaviot/oce.git")
1575 (commit (string-append "OCE-" version))))
1576 (file-name (git-file-name name version))
1577 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1579 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1580 (build-system cmake-build-system)
1583 (list "-DOCE_TESTING:BOOL=ON"
1584 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1585 "-DOCE_DRAW:BOOL=ON"
1586 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1587 (assoc-ref %outputs "out"))
1588 "-UCMAKE_INSTALL_RPATH")))
1590 `(("freetype" ,freetype)
1597 `(("python" ,python-wrapper)))
1598 (home-page "https://github.com/tpaviot/oce")
1599 (synopsis "Libraries for 3D modeling and numerical simulation")
1601 "Open CASCADE is a set of libraries for the development of applications
1602 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1603 C++ class libraries providing services for 3D surface and solid modeling, CAD
1604 data exchange, and visualization. It is used for development of specialized
1605 software dealing with 3D models in design (CAD), manufacturing (CAM),
1606 numerical simulation (CAE), measurement equipment (CMM), and quality
1607 control (CAQ) domains.
1609 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1610 patches, improvements, and experiments contributed by users over the official
1611 Open CASCADE library.")
1612 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1613 ; use of header files; see
1614 ; OCCT_LGPL_EXCEPTION.txt
1615 license:public-domain; files
1616 ; src/Standard/Standard_StdAllocator.hxx and
1617 ; src/NCollection/NCollection_StdAllocator.hxx
1618 license:expat; file src/OpenGl/OpenGl_glext.h
1619 license:bsd-3)))); test framework gtest
1621 (define-public opencascade-occt
1623 (name "opencascade-occt")
1629 (url "https://git.dev.opencascade.org/repos/occt.git")
1632 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1634 (file-name (git-file-name name version))
1636 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1637 (modules '((guix build utils)))
1640 ;; Remove files specific to non-free operating systems.
1641 (delete-file-recursively "samples/ios")
1642 (delete-file-recursively "samples/mfc")
1643 (delete-file-recursively "samples/qt/FuncDemo")
1644 (delete-file "genconf.bat")
1645 (delete-file "gendoc.bat")
1646 (delete-file "genproj.bat")
1647 (delete-file "upgrade.bat")
1648 ;; Remove references to deleted files.
1649 (substitute* "dox/FILES_HTML.txt"
1650 ((".*standard.*") "" )
1651 ((".*UIKitSample.*") ""))
1653 (build-system cmake-build-system)
1655 '(;; There is no test target for make. OCCT provides an
1656 ;; 'Automated Testing System', which may be accessed after
1657 ;; installation via the draw.sh script. draw.sh is located in
1658 ;; the bin directory. For details see:
1659 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1660 ;; occt_dev_guides__tests.html
1662 ;; Configure without freeimage: attempting to link against the
1663 ;; freeimage version 3.17 library leads to 'undefined
1664 ;; reference' errors.
1666 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1668 "-DUSE_VTK:BOOL=OFF"
1669 "-DBUILD_DOC_Overview:BOOL=OFF"
1670 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1671 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1672 "-UCMAKE_INSTALL_LIBDIR")))
1674 `(("doxygen" ,doxygen)
1675 ;("freeimage" ,freeimage)
1676 ("freetype" ,freetype)
1678 ("libxext" ,libxext)
1685 ;; TODO: build Overview documentation and add 'doc' output.
1686 (home-page "https://www.opencascade.com")
1687 (synopsis "Libraries for 3D modeling and numerical simulation")
1689 "Open CASCADE is a set of libraries for the development of applications
1690 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1691 C++ class libraries providing services for 3D surface and solid modeling, CAD
1692 data exchange, and visualization. It is used for development of specialized
1693 software dealing with 3D models in design (CAD), manufacturing (CAM),
1694 numerical simulation (CAE), measurement equipment (CMM), and quality
1695 control (CAQ) domains.
1697 This is the certified version of the Open Cascade Technology (OCCT) library.")
1698 (license (list ;; OCCT library:
1699 license:lgpl2.1; with an exception for the use of header
1700 ; files, see OCCT_LGPL_EXCEPTION.txt.
1701 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1702 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1704 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1705 ;; src/StepFile/step.tab.*:
1706 license:gpl3+ ; with Bison 2.2 exception.
1707 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1708 (license:non-copyleft
1709 "https://www.unicode.org/license.html")
1710 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1711 license:public-domain))))
1720 (uri (string-append "http://gmsh.info/src/gmsh-"
1721 version "-source.tgz"))
1723 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1724 (modules '((guix build utils)))
1726 ;; Remove non-free METIS code
1728 (delete-file-recursively "contrib/Metis")
1730 (build-system cmake-build-system)
1733 ("gfortran" ,gfortran)
1739 ("opencascade-oce" ,opencascade-oce)
1741 ("libxext" ,libxext)))
1743 `(("fontconfig" ,fontconfig)
1744 ("libxft" ,libxft)))
1746 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1747 "-DENABLE_BUILD_SHARED:BOOL=ON"
1748 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1749 (home-page "http://www.geuz.org/gmsh/")
1750 (synopsis "3D finite element grid generator")
1751 (description "Gmsh is a 3D finite element grid generator with a built-in
1752 CAD engine and post-processor. Its design goal is to provide a fast, light
1753 and user-friendly meshing tool with parametric input and advanced
1754 visualization capabilities. Gmsh is built around four modules: geometry,
1755 mesh, solver and post-processing. The specification of any input to these
1756 modules is done either interactively using the graphical user interface or in
1757 ASCII text files using Gmsh's own scripting language.")
1758 (license license:gpl2+)))
1760 (define-public maxflow
1767 (url "https://github.com/gerddie/maxflow.git")
1768 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1769 (file-name (string-append name "-" version "-checkout"))
1772 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1773 (build-system cmake-build-system)
1774 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1775 (synopsis "Library implementing Maxflow algorithm")
1776 (description "An implementation of the maxflow algorithm described in
1777 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1778 Energy Minimization in Computer Vision.\n
1779 Yuri Boykov and Vladimir Kolmogorov.\n
1780 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1782 (license license:gpl3+)))
1784 (define-public petsc
1791 ;; The *-lite-* tarball does not contain the *large* documentation
1792 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1793 "petsc-lite-" version ".tar.gz"))
1795 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1796 (outputs '("out" ; libraries and headers
1797 "examples")) ; ~30MiB of examples
1798 (build-system gnu-build-system)
1800 `(("python" ,python-2)))
1802 `(("gfortran" ,gfortran)
1804 ("superlu" ,superlu)
1805 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1806 ;; leaving out opengl, as configuration seems to only be for mac
1809 `(#:test-target "test"
1810 #:parallel-build? #f ; build is parallel by default
1816 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1817 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1818 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1820 (modify-phases %standard-phases
1822 ;; PETSc's configure script is actually a python script, so we can't
1823 ;; run it with bash.
1824 (lambda* (#:key outputs (configure-flags '())
1826 (let* ((prefix (assoc-ref outputs "out"))
1827 (flags `(,(string-append "--prefix=" prefix)
1828 ,@configure-flags)))
1829 (format #t "build directory: ~s~%" (getcwd))
1830 (format #t "configure flags: ~s~%" flags)
1831 (apply invoke "./configure" flags))))
1832 (add-after 'configure 'clean-local-references
1833 (lambda* (#:key outputs #:allow-other-keys)
1834 (let ((out (assoc-ref outputs "out")))
1835 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1836 ;; Prevent build directory from leaking into compiled code
1838 ;; Scrub timestamp for reproducibility
1839 ((".*Libraries compiled on.*") ""))
1840 (substitute* (find-files "." "petscvariables")
1841 ;; Do not expose build machine characteristics, set to defaults.
1842 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1843 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1845 (add-after 'install 'clean-install
1846 ;; Try to keep installed files from leaking build directory names.
1847 (lambda* (#:key inputs outputs #:allow-other-keys)
1848 (let ((out (assoc-ref outputs "out")))
1849 (substitute* (map (lambda (file)
1850 (string-append out "/lib/petsc/conf/" file))
1851 '("petscvariables"))
1853 ;; Make compiler references point to the store
1854 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1855 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1856 (string-append "= " (which compiler))))
1857 ;; PETSc installs some build logs, which aren't necessary.
1858 (for-each (lambda (file)
1859 (let ((f (string-append out "/lib/petsc/conf/" file)))
1860 (when (file-exists? f)
1862 '("configure.log" "make.log" "gmake.log"
1863 "test.log" "error.log" "RDict.db"
1864 "PETScBuildInternal.cmake"
1865 ;; Once installed, should uninstall with Guix
1868 (add-after 'install 'move-examples
1869 (lambda* (#:key outputs #:allow-other-keys)
1870 (let* ((out (assoc-ref outputs "out"))
1871 (examples (assoc-ref outputs "examples"))
1872 (exdir (string-append out "/share/petsc/examples"))
1873 (exdir' (string-append examples "/share/petsc/examples")))
1874 (copy-recursively exdir exdir')
1875 (delete-file-recursively exdir)
1877 (home-page "http://www.mcs.anl.gov/petsc")
1878 (synopsis "Library to solve PDEs")
1879 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1880 data structures and routines for the scalable (parallel) solution of
1881 scientific applications modeled by partial differential equations.")
1882 (license (license:non-copyleft
1883 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1885 (define-public petsc-complex
1886 (package (inherit petsc)
1887 (name "petsc-complex")
1889 (substitute-keyword-arguments (package-arguments petsc)
1890 ((#:configure-flags cf)
1891 `(cons "--with-scalar-type=complex" ,cf))))
1892 (synopsis "Library to solve PDEs (with complex scalars)")))
1894 (define-public petsc-openmpi
1895 (package (inherit petsc)
1896 (name "petsc-openmpi")
1898 `(("hdf5" ,hdf5-parallel-openmpi)
1899 ("hypre" ,hypre-openmpi)
1901 ("mumps" ,mumps-openmpi)
1902 ("openmpi" ,openmpi)
1903 ("scalapack" ,scalapack)
1904 ("scotch" ,pt-scotch32)
1905 ,@(package-inputs petsc)))
1907 (substitute-keyword-arguments (package-arguments petsc)
1908 ((#:configure-flags cf)
1910 "--with-mpiexec=mpirun"
1913 "--with-scalapack=1"
1915 ,(string-append "--with-mpi-dir="
1916 (assoc-ref %build-inputs "openmpi"))
1917 ,(string-append "--with-hdf5-include="
1918 (assoc-ref %build-inputs "hdf5") "/include")
1919 ,(string-append "--with-hdf5-lib="
1920 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1921 ,@(delete "--with-mpi=0" ,cf)))
1923 `(modify-phases ,phases
1924 (add-before 'configure 'mpi-setup
1925 ,%openmpi-setup)))))
1926 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1928 (define-public petsc-complex-openmpi
1929 (package (inherit petsc-complex)
1930 (name "petsc-complex-openmpi")
1932 `(("openmpi" ,openmpi)
1933 ,@(package-inputs petsc-complex)))
1935 (substitute-keyword-arguments (package-arguments petsc-complex)
1936 ((#:configure-flags cf)
1937 ``("--with-mpiexec=mpirun"
1938 ,(string-append "--with-mpi-dir="
1939 (assoc-ref %build-inputs "openmpi"))
1940 ,@(delete "--with-mpi=0" ,cf)))
1942 `(modify-phases ,phases
1943 (add-before 'configure 'mpi-setup
1944 ,%openmpi-setup)))))
1945 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1947 (define-public python-petsc4py
1949 (name "python-petsc4py")
1954 (uri (pypi-uri "petsc4py" version))
1957 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1958 (build-system python-build-system)
1961 (modify-phases %standard-phases
1962 (add-before 'build 'pre-build
1964 ;; Define path to PETSc installation.
1965 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1967 (add-before 'check 'mpi-setup
1970 `(("petsc" ,petsc-openmpi)
1971 ("python-numpy" ,python-numpy)))
1972 (home-page "https://bitbucket.org/petsc/petsc4py/")
1973 (synopsis "Python bindings for PETSc")
1974 (description "PETSc, the Portable, Extensible Toolkit for
1975 Scientific Computation, is a suite of data structures and routines for
1976 the scalable (parallel) solution of scientific applications modeled by
1977 partial differential equations. It employs the MPI standard for all
1978 message-passing communication. @code{petsc4py} provides Python
1979 bindings to almost all functions of PETSc.")
1980 (license license:bsd-3)))
1982 (define-public python-kiwisolver
1984 (name "python-kiwisolver")
1988 (uri (pypi-uri "kiwisolver" version))
1991 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1992 (build-system python-build-system)
1993 (home-page "https://github.com/nucleic/kiwi")
1994 (synopsis "Fast implementation of the Cassowary constraint solver")
1996 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1997 solving algorithm. Kiwi has been designed from the ground up to be
1998 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1999 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2000 savings are consistently > 5x.")
2001 (license license:bsd-3)))
2003 (define-public python2-kiwisolver
2004 (package-with-python2 python-kiwisolver))
2006 (define-public slepc
2013 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2017 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2018 (build-system gnu-build-system)
2020 `(("python" ,python-2)
2021 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2023 `(("arpack" ,arpack-ng)
2024 ("gfortran" ,gfortran)))
2026 `(("petsc" ,petsc)))
2028 `(#:parallel-build? #f ;build is parallel by default
2030 `(,(string-append "--with-arpack-dir="
2031 (assoc-ref %build-inputs "arpack") "/lib"))
2032 #:make-flags ;honor (parallel-job-count)
2033 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2034 ,(string-append "PETSCCONFIGDIR="
2035 (assoc-ref %build-inputs "petsc:examples")
2036 "/share/petsc/examples/config"))
2038 (modify-phases %standard-phases
2040 ;; configure is a python script, so we can't run it with bash.
2041 (lambda* (#:key inputs outputs (configure-flags '())
2043 (let* ((prefix (assoc-ref outputs "out"))
2044 (flags `(,(string-append "--prefix=" prefix)
2045 ,@configure-flags)))
2046 (format #t "build directory: ~s~%" (getcwd))
2047 (format #t "configure flags: ~s~%" flags)
2048 (setenv "SLEPC_DIR" (getcwd))
2049 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2050 (apply invoke "./configure" flags))))
2051 (add-after 'install 'delete-doc
2052 ;; TODO: SLEPc installs HTML documentation alongside headers in
2053 ;; $out/include. We'd like to move them to share/doc, but delete
2054 ;; them for now, as they are incomplete and installing the complete
2055 ;; documentation is difficult.
2056 (lambda* (#:key outputs #:allow-other-keys)
2057 (let* ((out (assoc-ref outputs "out")))
2058 (for-each delete-file (find-files out "\\.html$"))
2060 (add-after 'install 'clean-install
2061 ;; Clean up unnecessary build logs from installation.
2062 (lambda* (#:key outputs #:allow-other-keys)
2063 (let ((out (assoc-ref outputs "out")))
2064 (for-each (lambda (file)
2065 (let ((f (string-append out "/lib/slepc/conf/" file)))
2066 (when (file-exists? f)
2068 '("configure.log" "make.log" "gmake.log"
2069 "test.log" "error.log" "RDict.db"
2072 (home-page "http://slepc.upv.es")
2073 (synopsis "Scalable library for eigenproblems")
2074 (description "SLEPc is a software library for the solution of large sparse
2075 eigenproblems on parallel computers. It can be used for the solution of
2076 linear eigenvalue problems formulated in either standard or generalized form,
2077 as well as other related problems such as the singular value decomposition.
2078 The emphasis of the software is on methods and techniques appropriate for
2079 problems in which the associated matrices are sparse, for example, those
2080 arising after the discretization of partial differential equations.")
2081 (license license:bsd-2)))
2083 (define-public slepc-complex
2084 (package (inherit slepc)
2085 (name "slepc-complex")
2087 `(("petsc" ,petsc-complex)
2088 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2089 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2091 (define-public slepc-openmpi
2092 (package (inherit slepc)
2093 (name "slepc-openmpi")
2095 (substitute-keyword-arguments (package-arguments slepc)
2096 ((#:phases phases '%standard-phases)
2097 `(modify-phases ,phases
2098 (add-before 'check 'mpi-setup
2099 ,%openmpi-setup)))))
2102 ("arpack" ,arpack-ng-openmpi)
2103 ,@(alist-delete "arpack" (package-inputs slepc))))
2105 `(("petsc" ,petsc-openmpi)
2106 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2107 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2109 (define-public slepc-complex-openmpi
2110 (package (inherit slepc-openmpi)
2111 (name "slepc-complex-openmpi")
2113 `(("petsc" ,petsc-complex-openmpi)
2114 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2115 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2117 (define-public python-slepc4py
2119 (name "python-slepc4py")
2124 (uri (pypi-uri "slepc4py" version))
2127 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2128 (build-system python-build-system)
2131 (modify-phases %standard-phases
2132 (add-before 'build 'pre-build
2134 ;; Define path to PETSc installation.
2135 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2136 ;; Define path to SLEPc installation.
2137 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2139 (add-before 'check 'mpi-setup
2142 `(("python-numpy" ,python-numpy)
2143 ("python-petsc4py" ,python-petsc4py)
2144 ("slepc" ,slepc-openmpi)))
2145 (home-page "https://bitbucket.org/slepc/slepc4py/")
2146 (synopsis "Python bindings for SLEPc")
2147 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2148 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2149 Scientific Computation. It employs the MPI standard for all
2150 message-passing communication. @code{slepc4py} provides Python
2151 bindings to almost all functions of SLEPc.")
2152 (license license:bsd-3)))
2154 (define-public mumps
2161 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2165 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2166 (patches (search-patches "mumps-build-parallelism.patch"))))
2167 (build-system gnu-build-system)
2169 `(("fortran" ,gfortran)
2170 ;; These are required for linking against mumps, but we let the user
2171 ;; declare the dependency.
2174 ("scotch" ,scotch)))
2176 `(#:modules ((ice-9 match)
2179 ,@%gnu-build-system-modules)
2181 (modify-phases %standard-phases
2183 (lambda* (#:key inputs #:allow-other-keys)
2184 (call-with-output-file "Makefile.inc"
2195 INCSEQ = -I$(topdir)/libseq
2196 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2197 LIBSEQNEEDED = libseqneeded~;
2201 AR = ar vr # rules require trailing space, ugh...
2203 LIBBLAS = -L~a -lopenblas~@[
2204 SCALAP = -L~a -lscalapack~]
2205 LIBOTHERS = -pthread
2208 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2212 LIBS = $(SCALAP) $(LIBSEQ)
2213 LPORDDIR = $(topdir)/PORD/lib
2214 IPORD = -I$(topdir)/PORD/include
2215 LPORD = -L$(LPORDDIR) -lpord
2216 ORDERINGSF = -Dpord~@[
2218 IMETIS = -I$(METISDIR)/include
2219 LMETIS = -L$(METISDIR)/lib -lmetis
2220 ORDERINGSF += -Dmetis~]~@[~:{
2222 ISCOTCH = -I$(SCOTCHDIR)/include
2223 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2224 ORDERINGSF += ~a~}~]
2225 ORDERINGSC = $(ORDERINGSF)
2226 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2227 IORDERINGSF = $(ISCOTCH)
2228 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2229 (assoc-ref inputs "mpi")
2230 (assoc-ref inputs "blas")
2231 (assoc-ref inputs "scalapack")
2232 (assoc-ref inputs "metis")
2233 (match (list (assoc-ref inputs "pt-scotch")
2234 (assoc-ref inputs "scotch"))
2238 `((,scotch "" "-Dscotch")))
2241 "-lptesmumps -lptscotch -lptscotcherr "
2242 "-Dptscotch")))))))))
2244 ;; By default only the d-precision library is built. Make with "all"
2245 ;; target so that all precision libraries and examples are built.
2247 (invoke "make" "all"
2248 (format #f "-j~a" (parallel-job-count)))))
2250 ;; Run the simple test drivers, which read test input from stdin:
2251 ;; from the "real" input for the single- and double-precision
2252 ;; testers, and from the "cmplx" input for complex-precision
2253 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2254 ;; package to prefix execution with "mpirun".
2255 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2256 (with-directory-excursion "examples"
2259 (let ((tester (apply open-pipe*
2262 ,(string-append "./" prec
2264 (input (open-input-file
2265 (string-append "input_simpletest_" type))))
2267 (dump-port input tester)
2269 (zero? (close-pipe tester)))))
2271 '("real" "real" "cmplx" "cmplx")))))
2273 (lambda* (#:key outputs #:allow-other-keys)
2274 (let* ((out (assoc-ref outputs "out"))
2275 (libdir (string-append out "/lib")))
2276 (copy-recursively "lib" libdir)
2277 (copy-recursively "include" (string-append out "/include"))
2278 (when (file-exists? "libseq/libmpiseq.a")
2279 (install-file "libseq/libmpiseq.a" libdir))
2281 (home-page "http://mumps.enseeiht.fr")
2282 (synopsis "Multifrontal sparse direct solver")
2284 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2285 sparse system of linear equations A x = b using Gaussian elimination.")
2286 (license license:cecill-c)))
2288 (define-public mumps-metis
2289 (package (inherit mumps)
2290 (name "mumps-metis")
2292 (alist-delete "scotch" (package-inputs mumps)))))
2294 (define-public mumps-openmpi
2295 (package (inherit mumps)
2296 (name "mumps-openmpi")
2299 ("scalapack" ,scalapack)
2300 ("pt-scotch" ,pt-scotch)
2301 ,@(alist-delete "scotch" (package-inputs mumps))))
2303 (substitute-keyword-arguments (package-arguments mumps)
2305 `(modify-phases ,phases
2306 (add-before 'check 'mpi-setup
2310 ((assoc-ref ,phases 'check)
2311 #:exec-prefix '("mpirun" "-n" "2"))))))))
2312 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2314 (define-public mumps-metis-openmpi
2315 (package (inherit mumps-openmpi)
2316 (name "mumps-metis-openmpi")
2318 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2320 (define-public r-quadprog
2327 (uri (cran-uri "quadprog" version))
2330 "0vg7i9p241bwvfdspjbydjrsvgipl6nsb8bjigp0hbbgvxbixx0s"))))
2331 (build-system r-build-system)
2333 `(("gfortran" ,gfortran)))
2334 (home-page "https://cran.r-project.org/web/packages/quadprog")
2335 (synopsis "Functions to solve quadratic programming problems")
2337 "This package contains routines and documentation for solving quadratic
2338 programming problems.")
2339 (license license:gpl3+)))
2341 (define-public r-pracma
2347 (uri (cran-uri "pracma" version))
2349 (base32 "0isd3s0i4mzmva8lkh0j76hwjy1w50q7d1n9lhxsnnkgalx3xs1g"))))
2350 (build-system r-build-system)
2351 (home-page "https://cran.r-project.org/web/packages/pracma/")
2352 (synopsis "Practical numerical math functions")
2353 (description "This package provides functions for numerical analysis and
2354 linear algebra, numerical optimization, differential equations, plus some
2355 special functions. It uses Matlab function names where appropriate to simplify
2357 (license license:gpl3+)))
2359 (define-public ruby-asciimath
2361 (name "ruby-asciimath")
2366 (uri (rubygems-uri "asciimath" version))
2369 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2370 (build-system ruby-build-system)
2373 (modify-phases %standard-phases
2375 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2376 (add-after 'unpack 'patch-remove-spurious-backslashes
2378 (substitute* "spec/parser_spec.rb"
2383 `(("bundler" ,bundler)
2384 ("ruby-rspec" ,ruby-rspec)))
2385 (synopsis "AsciiMath parsing and conversion library")
2387 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2388 easy-to-write markup language for mathematics.")
2389 (home-page "https://github.com/asciidoctor/asciimath")
2390 (license license:expat)))
2392 (define-public superlu
2399 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2400 "superlu_" version ".tar.gz"))
2402 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2403 (modules '((guix build utils)))
2405 ;; Replace the non-free implementation of MC64 with a stub adapted
2408 (use-modules (ice-9 regex)
2410 (call-with-output-file "SRC/mc64ad.c"
2415 void mc64id_(int *a) {
2416 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2419 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2420 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2421 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2424 ;; Remove the corresponding license verbiage. MC64 license follows
2425 ;; a "------" line separator.
2426 (with-atomic-file-replacement "License.txt"
2427 (let ((rx (make-regexp "-{8}")))
2430 (let ((line (read-line in 'concat)))
2431 (unless (regexp-exec rx line)
2435 (build-system cmake-build-system)
2439 `(("blas" ,openblas)
2440 ("gfortran" ,gfortran)))
2442 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2443 "-DTPL_BLAS_LIBRARIES=openblas"
2444 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2445 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2446 (synopsis "Supernodal direct solver for sparse linear systems")
2448 "SuperLU is a general purpose library for the direct solution of large,
2449 sparse, nonsymmetric systems of linear equations on high performance machines.
2450 The library is written in C and is callable from either C or Fortran. The
2451 library routines perform an LU decomposition with partial pivoting and
2452 triangular system solves through forward and back substitution. The library
2453 also provides threshold-based ILU factorization preconditioners.")
2454 (license (list license:bsd-3
2455 license:gpl2+ ;EXAMPLE/*fgmr.c
2456 (license:fsf-free "file://SRC/colamd.h")))))
2458 (define-public superlu-dist
2460 (name "superlu-dist")
2465 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2466 "superlu_dist_" version ".tar.gz"))
2468 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2469 (modules '((guix build utils)))
2471 ;; Replace the non-free implementation of MC64 with a stub
2473 (call-with-output-file "SRC/mc64ad_dist.c"
2478 void mc64id_dist(int *a) {
2479 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2482 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2483 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2484 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2487 (substitute* "SRC/util.c" ;adjust default algorithm
2488 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2489 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2490 ;; general (i.e. non-square) processor-grid support.
2491 "RowPerm = NOROWPERM;"))
2493 (patches (search-patches "superlu-dist-scotchmetis.patch"
2494 "superlu-dist-awpm-grid.patch"
2495 "superlu-dist-fix-mpi-deprecations.patch"))))
2496 (build-system cmake-build-system)
2500 `(("gfortran" ,gfortran)
2503 ("combblas" ,combinatorial-blas)))
2505 `(("mpi" ,openmpi) ;headers include MPI heades
2506 ("parmetis" ,pt-scotch32 "metis")
2507 ("pt-scotch" ,pt-scotch32)))
2509 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2510 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2511 "-DTPL_ENABLE_COMBBLASLIB=YES"
2512 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2513 "-DTPL_LAPACK_LIBRARIES=-llapack"
2514 (string-append "-DTPL_PARMETIS_LIBRARIES="
2516 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2517 "scotchmetis" "scotch" "scotcherr")
2519 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2520 (assoc-ref %build-inputs "parmetis")
2522 "-DTPL_ENABLE_COMBBLASLIB=ON"
2523 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2524 (assoc-ref %build-inputs "combblas")
2525 "/include/CombBLAS;"
2526 (assoc-ref %build-inputs "combblas")
2527 "/include/BipartiteMatchings")
2528 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2530 (modify-phases %standard-phases
2531 (add-before 'configure 'set-c++-standard
2533 (substitute* "CMakeLists.txt"
2534 ;; AWPM headers require C++14
2535 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2536 (add-before 'check 'mpi-setup
2538 (add-before 'check 'omp-setup
2539 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2540 (home-page (package-home-page superlu))
2541 (synopsis "Parallel supernodal direct solver")
2543 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2544 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2545 implemented in ANSI C, and MPI for communications.")
2546 (license license:bsd-3)))
2548 (define-public scotch
2555 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2556 "latestfile/298/scotch_" version ".tar.gz"))
2558 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2559 (patches (search-patches "scotch-build-parallelism.patch"
2560 "scotch-integer-declarations.patch"))))
2561 (build-system gnu-build-system)
2566 (outputs '("out" "metis"))
2568 `(#:make-flags (list (string-append "prefix=" %output))
2570 (modify-phases %standard-phases
2572 'unpack 'chdir-to-src
2573 (lambda _ (chdir "src") #t))
2577 (call-with-output-file "Makefile.inc"
2591 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2592 LDFLAGS = -lz -lm -lrt -lpthread
2594 LEX = flex -Pscotchyy -olex.yy.c
2599 YACC = bison -pscotchyy -y -b y
2601 '("COMMON_FILE_COMPRESS_GZ"
2603 "COMMON_RANDOM_FIXED_SEED"
2604 "INTSIZE64" ;use 'int64_t'
2605 ;; Prevents symbolc clashes with libesmumps
2607 ;; XXX: Causes invalid frees in superlu-dist tests
2609 ;; "SCOTCH_PTHREAD_NUMBER=2"
2610 "restrict=__restrict"))))
2612 (add-after 'build 'build-esmumps
2615 (format #f "-j~a" (parallel-job-count))
2617 (add-before 'install 'make-install-dirs
2618 (lambda* (#:key outputs #:allow-other-keys)
2619 (mkdir (assoc-ref outputs "out"))))
2620 (add-after 'install 'install-metis
2621 (lambda* (#:key outputs #:allow-other-keys)
2622 (let ((out (assoc-ref outputs "metis")))
2624 ;; metis files are not installed with 'make install'
2625 (for-each (lambda (f)
2626 (install-file f (string-append out "/include")))
2627 (find-files "../include/" ".*metis\\.h"))
2628 (for-each (lambda (f)
2629 (install-file f (string-append out "/lib")))
2630 (find-files "../lib/" ".*metis\\..*"))
2632 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2633 (synopsis "Programs and libraries for graph algorithms")
2634 (description "SCOTCH is a set of programs and libraries which implement
2635 the static mapping and sparse matrix reordering algorithms developed within
2636 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2637 conquer approach, to scientific computing problems such as graph and mesh
2638 partitioning, static mapping, and sparse matrix ordering, in application
2639 domains ranging from structural mechanics to operating systems or
2641 ;; See LICENSE_en.txt
2642 (license license:cecill-c)))
2644 (define-public scotch32
2645 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2646 ;; some applications.
2647 (package (inherit scotch)
2650 (substitute-keyword-arguments (package-arguments scotch)
2651 ((#:phases scotch-phases)
2652 `(modify-phases ,scotch-phases
2656 (call-with-output-file "Makefile.inc"
2670 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2671 LDFLAGS = -lz -lm -lrt -lpthread
2673 LEX = flex -Pscotchyy -olex.yy.c
2678 YACC = bison -pscotchyy -y -b y
2680 '("COMMON_FILE_COMPRESS_GZ"
2682 "COMMON_RANDOM_FIXED_SEED"
2683 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2684 ;; Prevents symbolc clashes with libesmumps
2686 ;; XXX: Causes invalid frees in superlu-dist tests
2688 ;; "SCOTCH_PTHREAD_NUMBER=2"
2689 "restrict=__restrict"))))))))))
2691 "Programs and libraries for graph algorithms (32-bit integers)")))
2693 (define-public pt-scotch
2694 (package (inherit scotch)
2697 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2699 (substitute-keyword-arguments (package-arguments scotch)
2700 ((#:phases scotch-phases)
2701 `(modify-phases ,scotch-phases
2705 (invoke "make" (format #f "-j~a" (parallel-job-count))
2706 "ptscotch" "ptesmumps")
2708 ;; Install the serial metis compatibility library
2709 (invoke "make" "-C" "libscotchmetis" "install")))
2710 (add-before 'check 'mpi-setup
2714 (invoke "make" "ptcheck")))))))
2715 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2717 (define-public pt-scotch32
2718 (package (inherit scotch32)
2719 (name "pt-scotch32")
2721 `(("openmpi" ,openmpi))) ;headers include MPI headers
2723 (substitute-keyword-arguments (package-arguments scotch32)
2724 ((#:phases scotch32-phases)
2725 `(modify-phases ,scotch32-phases
2728 (invoke "make" (format #f "-j~a" (parallel-job-count))
2729 "ptscotch" "ptesmumps")
2730 ;; Install the serial metis compatibility library
2731 (invoke "make" "-C" "libscotchmetis" "install")))
2732 (add-before 'check 'mpi-setup
2736 (invoke "make" "ptcheck")))))))
2738 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2740 (define-public metis
2747 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2748 "metis-" version ".tar.gz"))
2751 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2752 (build-system cmake-build-system)
2754 `(("blas" ,openblas)))
2756 `(#:tests? #f ;no tests
2757 #:configure-flags `("-DSHARED=ON"
2758 ,(string-append "-DGKLIB_PATH=" (getcwd)
2759 "/metis-" ,version "/GKlib"))))
2760 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2761 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2763 "METIS is a set of serial programs for partitioning graphs, partitioning
2764 finite element meshes, and producing fill-reducing orderings for sparse
2765 matrices. The algorithms implemented in METIS are based on the multilevel
2766 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2768 (license license:asl2.0))) ;As of version 5.0.3
2770 (define-public p4est
2777 (uri (string-append "http://p4est.github.io/release/p4est-"
2781 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2782 (build-system gnu-build-system)
2784 `(("fortran" ,gfortran)
2789 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2790 (assoc-ref %build-inputs "blas")
2792 ,(string-append "LAPACK_LIBS=-L"
2793 (assoc-ref %build-inputs "lapack")
2795 #:phases (modify-phases %standard-phases
2796 (add-before 'check 'mpi-setup
2798 (home-page "http://www.p4est.org")
2799 (synopsis "Adaptive mesh refinement on forests of octrees")
2801 "The p4est software library enables the dynamic management of a
2802 collection of adaptive octrees, conveniently called a forest of octrees.
2803 p4est is designed to work in parallel and scales to hundreds of thousands of
2805 (license license:gpl2+)))
2807 (define-public p4est-openmpi
2808 (package (inherit p4est)
2809 (name "p4est-openmpi")
2812 ,@(package-inputs p4est)))
2814 (substitute-keyword-arguments (package-arguments p4est)
2815 ((#:configure-flags cf)
2816 ``("--enable-mpi" ,@,cf))))
2817 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2819 (define-public gsegrafix
2826 (uri (string-append "mirror://gnu/" name "/" name "-"
2830 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2831 (build-system gnu-build-system)
2833 `(#:configure-flags '("LDFLAGS=-lm")))
2835 `(("libgnomecanvas" ,libgnomecanvas)
2836 ("libbonoboui" ,libbonoboui)
2837 ("libgnomeui" ,libgnomeui)
2838 ("libgnomeprintui" ,libgnomeprintui)
2841 `(("pkg-config" ,pkg-config)))
2842 (home-page "https://www.gnu.org/software/gsegrafix/")
2843 (synopsis "GNOME application to create scientific and engineering plots")
2844 (description "GSEGrafix is an application which produces high-quality graphical
2845 plots for science and engineering. Plots are specified via simple ASCII
2846 parameter files and data files and are presented in an anti-aliased GNOME
2847 canvas. The program supports rectangular two-dimensional plots, histograms,
2848 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2849 to BMP, JPEG or PNG image formats.")
2850 (license license:gpl3+)))
2852 (define-public maxima
2859 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2860 version "-source/" name "-" version ".tar.gz"))
2863 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2864 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2865 (build-system gnu-build-system)
2868 ("gnuplot" ,gnuplot) ;for plots
2870 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2872 `(("texinfo" ,texinfo)
2874 ("python" ,python)))
2877 (list "--enable-gcl"
2878 (string-append "--with-posix-shell="
2879 (assoc-ref %build-inputs "bash")
2881 (string-append "--with-wish="
2882 (assoc-ref %build-inputs "tk")
2884 (let ((v ,(package-version tk)))
2885 (string-take v (string-index-right v #\.)))))
2886 ;; By default Maxima attempts to write temporary files to
2887 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2888 ;; Work around that.
2889 #:make-flags (list "TMPDIR=/tmp")
2891 (modify-phases %standard-phases
2892 (add-after 'unpack 'patch-paths
2893 (lambda* (#:key inputs #:allow-other-keys)
2894 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2895 (coreutils (assoc-ref inputs "coreutils"))
2896 (dirname (string-append coreutils "/bin/dirname"))
2897 (head (string-append coreutils "/bin/head"))
2898 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2899 (python (string-append (assoc-ref inputs "python")
2901 (substitute* "src/maxima.in"
2902 (("sed ") (string-append sed " "))
2903 (("dirname") dirname)
2905 (substitute* "doc/info/Makefile.in"
2906 (("/usr/bin/env perl") perl))
2907 (substitute* "doc/info/build_html.sh.in"
2908 (("python") python))
2910 (add-before 'check 'pre-check
2912 (chmod "src/maxima" #o555)
2916 ;; This is derived from the testing code in the "debian/rules" file
2917 ;; of Debian's Maxima package.
2918 ;; If Maxima can successfully run this, the binary to be installed
2924 "--batch-string=\"run_testsuite();\" "
2925 "| grep -q \"No unexpected errors found\""))))
2926 ;; Make sure the doc and emacs files are found in the
2927 ;; standard location. Also configure maxima to find gnuplot
2928 ;; without having it on the PATH.
2929 (add-after 'install 'post-install
2930 (lambda* (#:key outputs inputs #:allow-other-keys)
2931 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2932 (out (assoc-ref outputs "out"))
2933 (datadir (string-append out "/share/maxima/" ,version))
2934 (binutils (string-append (assoc-ref inputs "binutils")
2936 (with-directory-excursion out
2937 (mkdir-p "share/emacs")
2938 (mkdir-p "share/doc")
2940 (string-append datadir "/doc/")
2941 (string-append out "/share/doc/maxima"))
2942 (with-atomic-file-replacement
2943 (string-append datadir "/share/maxima-init.lisp")
2945 (format out "~a ~s~a~%"
2946 "(setf $gnuplot_command "
2947 (string-append gnuplot "/bin/gnuplot") ")")
2948 (dump-port in out))))
2949 ;; Ensure that Maxima will have access to the GNU binutils
2950 ;; components at runtime.
2951 (wrap-program (string-append out "/bin/maxima")
2952 `("PATH" prefix (,binutils))))
2954 (home-page "http://maxima.sourceforge.net")
2955 (synopsis "Numeric and symbolic expression manipulation")
2956 (description "Maxima is a system for the manipulation of symbolic and
2957 numerical expressions. It yields high precision numeric results by using
2958 exact fractions, arbitrary precision integers, and variable precision floating
2960 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2961 ;; Others simply say "GNU General Public License" without stating a
2962 ;; version (which implicitly means gpl1+).
2963 ;; At least one file (src/maxima.asd) says "version 2."
2964 ;; GPLv2 only is therefore the smallest subset.
2965 (license license:gpl2)))
2967 (define-public wxmaxima
2975 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2976 (commit (string-append "Version-" version))))
2977 (file-name (git-file-name name version))
2980 "028g4g2081vsgslbdliskfy5q2wknvknw89lk3zp89py6wranxas"))))
2981 (build-system cmake-build-system)
2983 `(("gettext" ,gettext-minimal)))
2985 `(("wxwidgets" ,wxwidgets)
2988 ("adwaita-icon-theme" ,adwaita-icon-theme)
2990 ("shared-mime-info" ,shared-mime-info)))
2992 `(#:tests? #f ; no check target
2994 (modify-phases %standard-phases
2995 (add-after 'install 'wrap-program
2996 (lambda* (#:key inputs outputs #:allow-other-keys)
2997 (wrap-program (string-append (assoc-ref outputs "out")
3000 (,(string-append (assoc-ref inputs "maxima")
3002 ;; For GtkFileChooserDialog.
3003 `("GSETTINGS_SCHEMA_DIR" =
3004 (,(string-append (assoc-ref inputs "gtk+")
3005 "/share/glib-2.0/schemas")))
3006 `("XDG_DATA_DIRS" ":" prefix
3007 (;; Needed by gdk-pixbuf to know supported icon formats.
3009 (assoc-ref inputs "shared-mime-info") "/share")
3010 ;; The default icon theme of GTK+.
3012 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3014 (home-page "https://andrejv.github.io/wxmaxima/")
3015 (synopsis "Graphical user interface for the Maxima computer algebra system")
3017 "wxMaxima is a graphical user interface for the Maxima computer algebra
3018 system. It eases the use of Maxima by making most of its commands available
3019 through a menu system and by providing input dialogs for commands that require
3020 more than one argument. It also implements its own display engine that
3021 outputs mathematical symbols directly instead of depicting them with ASCII
3024 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3025 text and mathematical calculations to create documents, exporting of input and
3026 output to TeX, and a browser for Maxima's manual including command index and
3027 full text searching.")
3028 (license license:gpl2+)))
3030 (define-public armadillo
3036 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3040 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3041 (build-system cmake-build-system)
3042 (arguments `(#:tests? #f)) ; no test target
3044 `(("openblas" ,openblas)
3046 ("arpack" ,arpack-ng)))
3047 (home-page "http://arma.sourceforge.net/")
3048 (synopsis "C++ linear algebra library")
3050 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3051 between speed and ease of use. It is useful for algorithm development
3052 directly in C++, or quick conversion of research code into production
3053 environments. It can be used for machine learning, pattern recognition,
3054 signal processing, bioinformatics, statistics, econometrics, etc. The library
3055 provides efficient classes for vectors, matrices and cubes, as well as 150+
3056 associated functions (eg. contiguous and non-contiguous submatrix views).")
3057 (license license:asl2.0)))
3059 (define-public muparser
3060 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3061 ;; different hash. In order to make `guix package --upgrade` work correctly,
3062 ;; we set a Guix packaging revision.
3063 ;; When the next version of muparser is released, we can remove
3064 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3065 (let ((upstream-version "2.2.5")
3069 (version (string-append upstream-version "-" revision))
3074 (url "https://github.com/beltoforion/muparser.git")
3075 (commit (string-append "v" upstream-version))))
3076 (file-name (git-file-name name version))
3078 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3079 (build-system gnu-build-system)
3081 `(#:configure-flags '("--enable-samples=no")
3082 #:tests? #f)) ;no "check" target
3083 (home-page "http://muparser.beltoforion.de/")
3084 (synopsis "Fast parser library for mathematical expressions")
3086 "muParser is an extensible high performance math parser library. It is
3087 based on transforming an expression into a bytecode and precalculating constant
3089 (license license:expat))))
3091 (define-public openblas
3098 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3099 version "%20version.tar.gz"))
3100 (file-name (string-append name "-" version ".tar.gz"))
3103 "1r2g9zzwq5dm8vjd19pxwggfvfzy56cvkmpmp5d014qr3svgmsap"))))
3104 (build-system gnu-build-system)
3106 `(#:test-target "test"
3107 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3108 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3109 ;; we need to disable substitutions.
3111 ,(let ((system (or (%current-target-system) (%current-system))))
3112 (or (string-prefix? "x86_64" system)
3113 (string-prefix? "i686" system)
3114 (string-prefix? "mips" system)
3115 (string-prefix? "aarch64" system)))
3117 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3119 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3120 ;; Build the library for all supported CPUs. This allows
3121 ;; switching CPU targets at runtime with the environment variable
3122 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3123 ;; Unfortunately, this is not supported on non-x86 architectures,
3124 ;; where it leads to failed builds.
3125 ,@(let ((system (or (%current-target-system) (%current-system))))
3127 ((or (string-prefix? "x86_64" system)
3128 (string-prefix? "i686" system))
3129 '("DYNAMIC_ARCH=1"))
3130 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3131 ;; two available MIPS targets special extended instructions
3132 ;; for Loongson cores are used.
3133 ((string-prefix? "mips" system)
3134 '("TARGET=SICORTEX"))
3135 ;; On aarch64 force the generic 'armv8-a' target
3136 ((string-prefix? "aarch64" system)
3139 ;; no configure script
3141 (modify-phases %standard-phases
3143 (add-before 'build 'set-extralib
3144 (lambda* (#:key inputs #:allow-other-keys)
3145 ;; Get libgfortran found when building in utest.
3147 (string-append "-L" (assoc-ref inputs "fortran-lib")
3151 `(("fortran-lib" ,gfortran "lib")))
3154 ("fortran" ,gfortran)
3156 (home-page "http://www.openblas.net/")
3157 (synopsis "Optimized BLAS library based on GotoBLAS")
3159 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3160 (license license:bsd-3)))
3162 (define-public openblas-ilp64
3163 (package (inherit openblas)
3164 (name "openblas-ilp64")
3165 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3167 (substitute-keyword-arguments (package-arguments openblas)
3168 ((#:make-flags flags '())
3169 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3171 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3172 (license license:bsd-3)))
3174 (define* (make-blis implementation #:optional substitutable?)
3175 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3176 source tree for a list of implementations.)
3178 SUBSTITUTABLE? determines whether the package is made available as a
3181 Currently the specialization must be selected at configure-time, but work is
3182 underway to allow BLIS to select the right optimized kernels at run time:
3183 <https://github.com/flame/blis/issues/129>."
3185 (name (if (string=? implementation "reference")
3187 (string-append "blis-" implementation)))
3189 (home-page "https://github.com/flame/blis")
3192 (uri (git-reference (url home-page) (commit version)))
3195 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3196 (file-name (git-file-name "blis" version))))
3197 (build-system gnu-build-system)
3199 `(#:test-target "test"
3201 #:substitutable? ,substitutable?
3203 #:phases (modify-phases %standard-phases
3205 (lambda* (#:key outputs #:allow-other-keys)
3206 ;; This is a home-made 'configure' script.
3207 (let ((out (assoc-ref outputs "out")))
3208 (invoke "./configure" "-p" out
3212 "--enable-threading=openmp"
3215 (add-before 'check 'show-test-output
3217 ;; By default "make check" is silent. Make it verbose.
3218 (system "tail -F output.testsuite &")
3220 (synopsis "High-performance basic linear algebra (BLAS) routines")
3222 "BLIS is a portable software framework for instantiating high-performance
3223 BLAS-like dense linear algebra libraries. The framework was designed to
3224 isolate essential kernels of computation that, when optimized, immediately
3225 enable optimized implementations of most of its commonly used and
3226 computationally intensive operations. While BLIS exports a new BLAS-like API,
3227 it also includes a BLAS compatibility layer which gives application developers
3228 access to BLIS implementations via traditional BLAS routine calls.")
3229 (license license:bsd-3)))
3232 ;; This is the "reference" implementation, which is the non-optimized but
3233 ;; portable variant (no assembly).
3234 (make-blis "reference" #t))
3236 (define ignorance blis)
3238 (define-syntax-rule (blis/x86_64 processor)
3239 "Expand to a package specialized for PROCESSOR."
3241 (inherit (make-blis processor))
3242 (supported-systems '("x86_64-linux"))))
3244 (define-public blis-sandybridge
3245 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3246 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3247 (blis/x86_64 "sandybridge"))
3249 (define-public blis-haswell
3250 ;; BLIS specialized for Haswell processors (launched 2013):
3251 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3252 (blis/x86_64 "haswell"))
3254 (define-public blis-knl
3255 ;; BLIS specialized for Knights Landing processor (launched 2016):
3256 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3257 (blis/x86_64 "knl"))
3260 (define-public openlibm
3268 (url "https://github.com/JuliaLang/openlibm.git")
3269 (commit (string-append "v" version))))
3270 (file-name (git-file-name name version))
3272 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3273 (build-system gnu-build-system)
3276 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3278 ;; no configure script
3279 (modify-phases %standard-phases (delete 'configure))
3280 #:tests? #f)) ;the tests are part of the default target
3281 (home-page "http://openlibm.org/")
3282 (synopsis "Portable C mathematical library (libm)")
3284 "OpenLibm is an effort to have a high quality, portable, standalone C
3285 mathematical library (libm). It can be used standalone in applications and
3286 programming language implementations. The project was born out of a need to
3287 have a good libm for the Julia programming language that worked consistently
3288 across compilers and operating systems, and in 32-bit and 64-bit
3290 ;; Each architecture has its own make target, and there is none for mips.
3291 (supported-systems (delete "mips64el-linux" %supported-systems))
3292 ;; See LICENSE.md for details.
3293 (license (list license:expat
3296 license:public-domain
3297 license:lgpl2.1+))))
3299 (define-public openspecfun
3301 (name "openspecfun")
3307 (url "https://github.com/JuliaLang/openspecfun.git")
3308 (commit (string-append "v" version))))
3309 (file-name (git-file-name name version))
3311 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3312 (build-system gnu-build-system)
3314 '(#:tests? #f ; no "check" target
3316 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3318 (modify-phases %standard-phases
3319 (delete 'configure)))) ; no configure script
3321 `(("fortran" ,gfortran)))
3322 (home-page "https://github.com/JuliaLang/openspecfun")
3323 (synopsis "Collection of special mathematical functions")
3325 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3326 portable package for Bessel Functions of a Complex Argument and Nonnegative
3327 Order; it contains subroutines for computing Bessel functions and Airy
3328 functions. Faddeeva allows computing the various error functions of arbitrary
3329 complex arguments (Faddeeva function, error function, complementary error
3330 function, scaled complementary error function, imaginary error function, and
3331 Dawson function); given these, one can also easily compute Voigt functions,
3332 Fresnel integrals, and similar related functions as well.")
3333 ;; Faddeeva is released under the Expat license; AMOS is included as
3334 ;; public domain software.
3335 (license (list license:expat license:public-domain))))
3337 (define-public suitesparse
3339 (name "suitesparse")
3345 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3349 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3350 (modules '((guix build utils)))
3352 ;; Remove bundled metis source
3354 (delete-file-recursively "metis-5.1.0")
3356 (build-system gnu-build-system)
3358 '(#:tests? #f ;no "check" target
3363 "MY_METIS_LIB=-lmetis"
3364 (string-append "INSTALL_LIB="
3365 (assoc-ref %outputs "out") "/lib")
3366 (string-append "INSTALL_INCLUDE="
3367 (assoc-ref %outputs "out") "/include")
3370 (modify-phases %standard-phases
3371 (delete 'configure)))) ;no configure script
3376 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3377 (synopsis "Suite of sparse matrix software")
3379 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3380 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3381 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3382 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3383 CXSparse, a concise sparse Cholesky factorization package; and many other
3386 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3388 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3389 (license (list license:gpl2+ license:lgpl2.1+))))
3391 (define-public atlas
3397 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3398 version "/atlas" version ".tar.bz2"))
3401 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3402 (build-system gnu-build-system)
3403 (home-page "http://math-atlas.sourceforge.net/")
3404 (inputs `(("gfortran" ,gfortran)
3405 ("lapack-tar" ,(package-source lapack))))
3406 (outputs '("out" "doc"))
3407 ;; For the moment we drop support for MIPS at it fails to compile. See
3408 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3409 (supported-systems (delete "mips64el-linux" %supported-systems))
3411 `(#:parallel-build? #f
3412 #:parallel-tests? #f
3414 ;; ATLAS tunes itself for the machine it is built on, as explained at
3415 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3416 ;; For this reason, we want users to build it locally instead of using
3420 #:modules ((srfi srfi-26)
3421 (guix build gnu-build-system)
3424 `(;; Generate position independent code suitable for dynamic libraries
3425 ;; and use WALL timer to get more accurate timing.
3426 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3429 ,,(if (string-match "64" (%current-system))
3432 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3433 ;; needed to compile C files before it is generated.
3434 "-Ss" "pmake" "make -j 1"
3435 ;; Probe is failing for MIPS. We therefore define the system
3436 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3437 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3438 ,,@(if (string-prefix? "mips" (%current-system))
3439 (list "-A" "49" "-V" "1")
3441 ;; Generate shared libraries.
3443 ;; Build a full LAPACK library.
3444 ,(string-append "--with-netlib-lapack-tarfile="
3445 (assoc-ref %build-inputs "lapack-tar")))
3447 (modify-phases %standard-phases
3448 (add-after 'install 'install-doc
3449 (lambda* (#:key outputs inputs #:allow-other-keys)
3450 (let ((doc (string-append (assoc-ref outputs "doc")
3451 "/share/doc/atlas")))
3453 (for-each (cut install-file <> doc)
3454 (find-files "../ATLAS/doc" ".*"))
3456 (add-after 'check 'check-pt
3457 (lambda _ (invoke "make" "ptcheck")))
3458 ;; Fix files required to run configure.
3459 (add-before 'configure 'fix-/bin/sh
3461 ;; Use `sh', not `/bin/sh'.
3462 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3466 ;; Fix /bin/sh in generated make files.
3467 (add-after 'configure 'fix-/bin/sh-in-generated-files
3469 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3473 ;; ATLAS configure program does not accepts the default flags
3474 ;; passed by the 'gnu-build-system'.
3476 (lambda* (#:key native-inputs inputs outputs
3477 (configure-flags '())
3478 #:allow-other-keys #:rest args)
3479 (let* ((prefix (assoc-ref outputs "out"))
3480 (bash (or (and=> (assoc-ref
3481 (or native-inputs inputs) "bash")
3482 (cut string-append <> "/bin/bash"))
3484 (flags `(,(string-append "--prefix=" prefix)
3486 (abs-srcdir (getcwd))
3487 (srcdir (string-append "../" (basename abs-srcdir))))
3488 (format #t "source directory: ~s (relative from build: ~s)~%"
3492 (format #t "build directory: ~s~%" (getcwd))
3493 (format #t "configure flags: ~s~%" flags)
3495 (string-append srcdir "/configure")
3497 (synopsis "Automatically Tuned Linear Algebra Software")
3499 "ATLAS is an automatically tuned linear algebra software library
3500 providing C and Fortran77 interfaces to a portably efficient BLAS
3501 implementation, as well as a few routines from LAPACK.
3503 Optimization occurs at build time. For this reason, the library is built on
3504 the machine where it is installed, without resorting to pre-built substitutes.
3506 Before building the library, CPU throttling should be disabled. This can be
3507 done in the BIOS, or, on GNU/Linux, with the following command:
3510 # cpupower --governor performance
3513 Failure to do so will result in a library with poor performance.")
3514 (license license:bsd-3)))
3523 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3524 version "/glm-" version ".zip"))
3527 "1vmg7hb4xvsa77zpbwiw6lqc7pyaj56dihx6xriny5b9rrh4iqsg"))))
3528 (build-system cmake-build-system)
3530 `(("unzip" ,unzip)))
3531 (home-page "https://glm.g-truc.net/")
3532 (synopsis "OpenGL Mathematics library")
3533 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3534 library for graphics software based on the OpenGL Shading Language (GLSL)
3536 (license license:expat)))
3538 (define-public lpsolve
3545 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3546 "/lp_solve_" version "_source.tar.gz"))
3549 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3550 (modules '((guix build utils)))
3553 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3555 ;; Pretend to be on a 64 bit platform to obtain a common directory
3556 ;; name for the build results on all architectures; nothing else
3557 ;; seems to depend on it.
3558 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3560 ;; The check for 'isnan' as it is written fails with
3561 ;; "non-floating-point argument in call to function
3562 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3563 ;; definition, which in turn leads to bad things. Fix the feature
3565 (("isnan\\(0\\)") "isnan(0.)"))
3567 (build-system gnu-build-system)
3569 `(#:tests? #f ; no check target
3571 (modify-phases %standard-phases
3572 (delete 'configure) ; no configure script
3575 (with-directory-excursion "lpsolve55"
3576 (invoke "bash" "ccc"))
3577 (with-directory-excursion "lp_solve"
3578 (invoke "bash" "ccc"))
3581 (lambda* (#:key outputs #:allow-other-keys)
3582 (let* ((out (assoc-ref outputs "out"))
3583 (bin (string-append out "/bin"))
3584 (lib (string-append out "/lib"))
3585 ;; This is where LibreOffice expects to find the header
3586 ;; files, and where they are installed by Debian.
3587 (include (string-append out "/include/lpsolve")))
3588 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3589 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3590 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3592 ;; Install a subset of the header files as on Debian
3593 ;; (plus lp_bit.h, which matches the regular expression).
3594 (for-each (lambda (name)
3595 (install-file name include))
3596 (find-files "." "lp_[HMSa-z].*\\.h$"))
3597 (with-directory-excursion "shared"
3598 (for-each (lambda (name)
3599 (install-file name include))
3600 (find-files "." "\\.h$")))
3602 (home-page "http://lpsolve.sourceforge.net/")
3603 (synopsis "Mixed integer linear programming (MILP) solver")
3605 "lp_solve is a mixed integer linear programming solver based on the
3606 revised simplex and the branch-and-bound methods.")
3607 (license license:lgpl2.1+)))
3609 (define-public dealii
3616 (uri (string-append "https://github.com/dealii/dealii/releases/"
3617 "download/v" version "/dealii-" version ".tar.gz"))
3620 "0r7f8rhl3xr94imd372plizdcbqk0a70w73lwc3vw912dxk0sbyz"))
3621 (patches (search-patches "dealii-mpi-deprecations.patch"))
3622 (modules '((guix build utils)))
3624 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3626 (delete-file-recursively "bundled")
3628 (build-system cmake-build-system)
3636 ("arpack" ,arpack-ng)
3637 ("muparser" ,muparser)
3638 ("gfortran" ,gfortran)
3639 ("suitesparse" ,suitesparse))) ;for UMFPACK
3641 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3643 ;; Work around a bug in libsuitesparseconfig linking
3644 ;; see https://github.com/dealii/dealii/issues/4745
3645 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3646 (home-page "https://www.dealii.org")
3647 (synopsis "Finite element library")
3649 "Deal.II is a C++ program library targeted at the computational solution
3650 of partial differential equations using adaptive finite elements. The main
3651 aim of deal.II is to enable rapid development of modern finite element codes,
3652 using among other aspects adaptive meshes and a wide array of tools often used
3653 in finite element programs.")
3654 (license license:lgpl2.1+)))
3656 (define-public dealii-openmpi
3657 (package (inherit dealii)
3658 (name "dealii-openmpi")
3661 ;;Supported only with MPI:
3662 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3663 ("p4est" ,p4est-openmpi)
3664 ("petsc" ,petsc-openmpi)
3665 ("slepc" ,slepc-openmpi)
3666 ("metis" ,metis) ;for MUMPS
3667 ("scalapack" ,scalapack) ;for MUMPS
3668 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3669 ("arpack" ,arpack-ng-openmpi)
3670 ,@(fold alist-delete (package-inputs dealii)
3671 '("p4est" "arpack"))))
3673 (substitute-keyword-arguments (package-arguments dealii)
3674 ((#:configure-flags cf)
3675 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3677 ((#:phases phases '%standard-phases)
3678 `(modify-phases ,phases
3679 (add-before 'check 'mpi-setup
3680 ,%openmpi-setup)))))
3681 (synopsis "Finite element library (with MPI support)")))
3683 (define-public flann
3692 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3693 version "-src.zip"))
3696 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3697 (patches (search-patches "flann-cmake-3.11.patch"))))
3698 (build-system cmake-build-system)
3700 "octave")) ;46 MiB .mex file that pulls Octave
3702 `(("unzip" ,unzip)))
3705 ("octave" ,octave-cli)
3706 ("python" ,python-2) ; print syntax
3707 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3710 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3711 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3712 #:strip-directories '("lib" "lib64" "libexec"
3713 "bin" "sbin" "share/flann/octave")
3715 ;; Save 12 MiB by not installing .a files. Passing
3716 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3717 #:phases (modify-phases %standard-phases
3718 (add-before 'configure 'set-octave-directory
3719 (lambda* (#:key outputs #:allow-other-keys)
3720 ;; Install the .mex file in the "octave" output.
3721 (let ((out (assoc-ref outputs "octave")))
3722 (substitute* "src/matlab/CMakeLists.txt"
3723 (("share/flann/octave")
3724 (string-append out "/share/flann/octave")))
3726 (add-after 'install 'remove-static-libraries
3727 (lambda* (#:key outputs #:allow-other-keys)
3728 (let* ((out (assoc-ref outputs "out"))
3729 (lib (string-append out "/lib")))
3730 (for-each delete-file
3731 (find-files lib "\\.a$"))
3734 #:tests? #f)) ; The test data are downloaded from the Internet.
3735 (home-page "http://www.cs.ubc.ca/research/flann/")
3736 (synopsis "Library for approximate nearest neighbors computation")
3737 (description "FLANN is a library for performing fast approximate
3738 nearest neighbor searches in high dimensional spaces. It implements a
3739 collection of algorithms and a system for automatically choosing the best
3740 algorithm and optimum parameters depending on the dataset.
3742 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3743 (license (license:non-copyleft "file://COPYING"
3744 "See COPYING in the distribution."))))
3746 (define-public wcalc
3753 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3754 "wcalc-" version ".tar.bz2"))
3757 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3758 (build-system gnu-build-system)
3761 ("readline" ,readline)))
3762 (home-page "http://w-calc.sourceforge.net/index.php")
3763 (synopsis "Flexible command-line scientific calculator")
3764 (description "Wcalc is a very capable calculator. It has standard functions
3765 (sin, asin, and sinh for example, in either radians or degrees), many
3766 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3767 variables, a command history, hex/octal/binary input and output, unit
3768 conversions, embedded comments, and an expandable expression entry field. It
3769 evaluates expressions using the standard order of operations.")
3770 (license license:gpl2+)))
3778 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3779 "/xaos-" version ".tar.gz"))
3782 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3783 (build-system gnu-build-system)
3784 (native-inputs `(("gettext" ,gettext-minimal)))
3785 (inputs `(("libx11" ,libx11)
3790 `(#:tests? #f ;no "check" target
3791 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3792 (synopsis "Real-time fractal zoomer")
3793 (description "GNU XaoS is a graphical program that generates fractal
3794 patterns and allows you to zoom in and out of them infinitely in a fluid,
3795 continuous manner. It also includes tutorials that help to explain how fractals
3796 are built. It can generate many different fractal types such as the Mandelbrot
3798 (home-page "https://www.gnu.org/software/xaos/")
3799 (license license:gpl2+)))
3801 (define-public hypre
3809 (url "https://github.com/LLNL/hypre.git")
3810 (commit (string-append "v" version))))
3811 (file-name (git-file-name name version))
3813 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3814 (modules '((guix build utils)))
3817 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3818 ;; substitute the release date.
3819 (substitute* "src/utilities/HYPRE_utilities.h"
3820 (("Date Compiled: .*$")
3821 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3823 (build-system gnu-build-system)
3824 (outputs '("out" ; 6.1 MiB of headers and libraries
3825 "doc")) ; 4.8 MiB of documentation
3829 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3830 ("texlive" ,(texlive-union (list texlive-generic-xypic
3832 texlive-latex-hyperref
3834 ("ghostscript" ,ghostscript)))
3836 `(("blas" ,openblas)
3837 ("lapack" ,lapack)))
3839 `(#:modules ((srfi srfi-1)
3840 ,@%gnu-build-system-modules)
3841 #:configure-flags '("--enable-shared"
3849 (modify-phases %standard-phases
3850 (add-before 'build 'set-HOME
3852 ;; FIXME: texlive-union does not find the built
3853 ;; metafonts, so it tries to generate them in HOME.
3854 (setenv "HOME" "/tmp")
3856 (add-before 'configure 'chdir-src
3857 (lambda _ (chdir "src")))
3859 (lambda* (#:key build target configure-flags
3860 #:allow-other-keys #:rest args)
3861 (let* ((configure (assoc-ref %standard-phases 'configure)))
3864 (list #:configure-flags
3865 (cons (string-append
3866 "--host=" (or target build))
3867 configure-flags)))))))
3868 (add-after 'build 'build-docs
3870 (invoke "make" "-Cdocs" "pdf" "html")))
3873 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3874 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3875 (invoke "make" "check" "CHECKRUN=")
3876 (for-each (lambda (filename)
3877 (let ((size (stat:size (stat filename))))
3878 (when (positive? size)
3879 (error (format #f "~a size ~d; error indication~%"
3881 (find-files "test" ".*\\.err$"))
3883 (add-after 'install 'install-docs
3884 (lambda* (#:key outputs #:allow-other-keys)
3885 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3886 (let* ((doc (assoc-ref outputs "doc"))
3887 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3888 (with-directory-excursion "docs"
3889 (for-each (lambda (base)
3890 (install-file (string-append base ".pdf") docdir)
3891 (copy-recursively base docdir)) ; html docs
3892 '("HYPRE_usr_manual"
3893 "HYPRE_ref_manual")))
3895 (home-page "http://www.llnl.gov/casc/hypre/")
3896 (synopsis "Library of solvers and preconditioners for linear equations")
3898 "HYPRE is a software library of high performance preconditioners and
3899 solvers for the solution of large, sparse linear systems of equations. It
3900 features multigrid solvers for both structured and unstructured grid
3902 (license license:lgpl2.1)))
3904 (define-public hypre-openmpi
3905 (package (inherit hypre)
3906 (name "hypre-openmpi")
3909 ,@(package-inputs hypre)))
3911 (substitute-keyword-arguments (package-arguments hypre)
3912 ((#:configure-flags flags)
3914 ,@(delete "--without-MPI" ,flags)))
3916 `(modify-phases ,phases
3917 (add-before 'check 'mpi-setup
3918 ,%openmpi-setup)))))
3919 (synopsis "Parallel solvers and preconditioners for linear equations")
3921 "HYPRE is a software library of high performance preconditioners and
3922 solvers for the solution of large, sparse linear systems of equations on
3923 parallel computers. It features parallel multigrid solvers for both
3924 structured and unstructured grid problems.")))
3926 (define-public matio
3933 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3934 "matio-" version ".tar.gz"))
3937 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3938 (build-system gnu-build-system)
3942 (home-page "http://matio.sourceforge.net/")
3943 (synopsis "Library for reading and writing MAT files")
3944 (description "Matio is a library for reading and writing MAT files. It
3945 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3946 (license license:bsd-2)))
3953 (origin (method url-fetch)
3954 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3955 "download/" version "/Vc-" version ".tar.gz"))
3958 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3959 (build-system cmake-build-system)
3962 '("-DBUILD_TESTING=ON"
3963 ;; By default, Vc will optimize for the CPU of the build machine.
3964 ;; Setting this to "none" makes it create portable binaries. See
3965 ;; "cmake/OptimizeForArchitecture.cmake".
3966 "-DTARGET_ARCHITECTURE=none")))
3967 (synopsis "SIMD vector classes for C++")
3968 (description "Vc provides portable, zero-overhead C++ types for explicitly
3969 data-parallel programming. It is a library designed to ease explicit
3970 vectorization of C++ code. Its types enable explicitly stating data-parallel
3971 operations on multiple values. The parallelism is therefore added via the type
3972 system. Vc has an intuitive API and provides portability between different
3973 compilers and compiler versions as well as portability between different vector
3974 instruction sets. Thus, an application written with Vc can be compiled for:
3977 @item SSE2 up to SSE4.2 or SSE4a
3980 @item NEON (in development)
3981 @item NVIDIA GPUs / CUDA (in development)
3983 (home-page "https://github.com/VcDevel/Vc")
3984 ;; "No support_???.cpp file exists for this architecture."
3985 (supported-systems '("x86_64-linux" "i686-linux"))
3986 (license license:bsd-3)))
3988 (define-public reducelcs
3989 ;; This is the last commit which is available upstream, no
3990 ;; release happened since 2010.
3991 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3995 (version (string-append "1.0-" revision "." (string-take commit 7)))
4000 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4002 (file-name (string-append name "-" version "-checkout"))
4005 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4006 (build-system gnu-build-system)
4008 `(("openlibm" ,openlibm)))
4010 `(#:tests? #f ; no tests
4012 (modify-phases %standard-phases
4013 (delete 'configure) ; No configure script exists.
4014 (replace 'install ; No install phase exists.
4015 (lambda* (#:key outputs #:allow-other-keys)
4016 (let* ((out (assoc-ref outputs "out"))
4017 (bin (string-append out "/bin")))
4018 (install-file "Approximation" bin)
4019 (install-file "CollectResults" bin)
4020 (install-file "GenerateInstances" bin)
4022 (synopsis "Approximate Longest Commons Subsequence computation tool")
4024 "@code{reduceLCS} is an implementation of the Reduce-Expand
4025 algorithm for LCS. It is a fast program to compute the approximate
4026 Longest Commons Subsequence of a set of strings.")
4027 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4028 (license license:gpl3+))))
4030 (define-public jacal
4037 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4040 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4041 (patches (search-patches "jacal-fix-texinfo.patch"))))
4042 (build-system gnu-build-system)
4045 (modify-phases %standard-phases
4046 (add-before 'build 'pre-build
4047 ;; Don't use upstream's script - it really doesn't fit into
4048 ;; Guix's functional paradigm.
4049 (lambda* (#:key inputs outputs #:allow-other-keys)
4050 (substitute* "Makefile"
4051 (("^install: install-script") "install: "))))
4052 (add-after 'install 'post-install
4053 ;; Instead, we provide our own simplified script.
4054 (lambda* (#:key inputs outputs #:allow-other-keys)
4055 (let ((wrapper (string-append (assoc-ref outputs "out")
4057 (format (open wrapper (logior O_WRONLY O_CREAT))
4058 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4059 "-e '(slib:load \"~a/lib/jacal/math\") "
4062 (assoc-ref inputs "scm")
4063 (assoc-ref outputs "out"))
4064 (chmod wrapper #o555))))
4066 (lambda* (#:key outputs #:allow-other-keys)
4067 (invoke "./configure"
4068 (string-append "--prefix="
4069 (assoc-ref outputs "out"))))))))
4070 (inputs `(("scm" ,scm)))
4071 (native-inputs `(("unzip" ,unzip)
4072 ("texinfo" ,texinfo)))
4073 (synopsis "Symbolic mathematics system")
4074 (description "GNU JACAL is an interactive symbolic mathematics program based on
4075 Scheme. It manipulate and simplify a range of mathematical expressions such
4076 as equations, scalars, vectors, and matrices.")
4077 (home-page "https://www.gnu.org/software/jacal/")
4078 (license license:gpl3+)))
4084 (home-page "https://github.com/Z3Prover/z3")
4087 (uri (git-reference (url home-page)
4088 (commit (string-append "z3-" version))))
4089 (file-name (git-file-name name version))
4092 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
4093 (build-system gnu-build-system)
4096 (modify-phases %standard-phases
4097 (add-after 'unpack 'fix-compatability
4098 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4100 (substitute* "src/util/mpz.cpp"
4101 (("#include <immintrin.h>") ""))
4103 (add-before 'configure 'bootstrap
4105 (invoke "python" "scripts/mk_make.py")))
4106 ;; work around gnu-build-system's setting --enable-fast-install
4107 ;; (z3's `configure' is a wrapper around the above python file,
4108 ;; which fails when passed --enable-fast-install)
4110 (lambda* (#:key inputs outputs #:allow-other-keys)
4111 (invoke "./configure"
4112 (string-append "--prefix=" (assoc-ref outputs "out")))))
4113 (add-after 'configure 'change-directory
4117 (add-before 'check 'make-test-z3
4119 ;; Build the test suite executable.
4120 (invoke "make" "test-z3" "-j"
4121 (number->string (parallel-job-count)))))
4124 ;; Run all the tests that don't require arguments.
4125 (invoke "./test-z3" "/a"))))))
4128 ("python" ,python-wrapper)))
4129 (synopsis "Theorem prover")
4130 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4131 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4132 (license license:expat)))
4137 (version "2018.11.001")
4140 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4141 version "/elpa-" version ".tar.gz"))
4144 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4145 (build-system gnu-build-system)
4147 `(("fortran" ,gfortran)
4148 ("perl" ,perl))) ;for configure and deps
4150 `(("blas" ,openblas)))
4155 ;; ELPA unfortunately does not support runtime dispatch, so we can
4156 ;; only enable the "generic" kernels. See the "Cross compilation"
4157 ;; section of INSTALL.md.
4159 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4160 "--disable-avx" "--disable-avx2" "--disable-avx512"
4161 ,(string-append "CFLAGS=-O3 "
4162 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4163 "-ftree-vect-loop-version -ftree-vectorize "
4164 ,(let ((system (or (%current-target-system)
4165 (%current-system))))
4167 ((or (string-prefix? "x86_64" system)
4168 (string-prefix? "i686" system))
4171 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4173 (modify-phases %standard-phases
4174 (add-before 'configure 'patch-header-generation
4176 (substitute* "configure"
4177 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4178 (string-append & " CPP=\"$CPP\"")))
4180 (add-before 'check 'setup-tests
4182 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4183 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4184 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4185 ;; for Fortran. This also causes several tests to pass that
4186 ;; otherwise would otherwise fail with matrix size 5000; possibly
4187 ;; due to floating point tolerances that are too tight.
4188 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4189 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4190 (substitute* "Makefile"
4191 ;; Test scripts are generated, patch the shebang
4192 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4194 (home-page "http://elpa.mpcdf.mpg.de")
4195 (synopsis "Eigenvalue solvers for symmetric matrices")
4197 "The ELPA library provides efficient and scalable direct eigensolvers for
4198 symmetric matrices.")
4199 (license license:lgpl3)))
4201 (define-public elpa-openmpi
4202 (package (inherit elpa)
4203 (name "elpa-openmpi")
4206 ("scalapack" ,scalapack)
4207 ,@(package-inputs elpa)))
4209 (substitute-keyword-arguments (package-arguments elpa)
4210 ((#:configure-flags cf '())
4211 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4212 ((#:phases phases '%standard-phases)
4213 `(modify-phases ,phases
4214 (add-before 'check 'mpi-setup
4216 ;; Tests use 2 mpi tasks by default, use our remaining build
4217 ;; cores as OpenMP threads.
4218 (setenv "OMP_NUM_THREADS" (number->string
4219 (max (quotient (parallel-job-count) 2)
4221 (,%openmpi-setup)))))))
4222 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4224 (define-public elemental
4231 (url "https://github.com/elemental/Elemental.git")
4232 (commit (string-append "v" version))))
4233 (file-name (git-file-name name version))
4236 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4237 (build-system cmake-build-system)
4238 (home-page "http://libelemental.org")
4240 `(("gfortran" ,gfortran)))
4242 `(("blas" ,openblas)
4243 ("gfortran:lib" ,gfortran "lib")
4252 `(#:build-type "Release" ;default RelWithDebInfo not supported
4253 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4254 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4255 "-DEL_CACHE_WARNINGS:BOOL=YES"
4256 "-DEL_TESTS:BOOL=YES"
4257 "-DCMAKE_INSTALL_LIBDIR=lib"
4258 "-DGFORTRAN_LIB=gfortran")
4259 #:phases (modify-phases %standard-phases
4260 (add-before 'check 'mpi-setup
4262 (add-before 'check 'setup-tests
4264 ;; Parallelism is done at the MPI layer.
4265 (setenv "OMP_NUM_THREADS" "1")
4267 (add-after 'install 'remove-tests
4268 (lambda* (#:key outputs #:allow-other-keys)
4269 ;; Tests are installed, with no easy configuration
4270 ;; switch to prevent this, so delete them.
4271 (delete-file-recursively
4272 (string-append (assoc-ref outputs "out") "/bin"))
4274 (synopsis "Dense and sparse-direct linear algebra and optimization")
4275 (description "Elemental is a modern C++ library for distributed-memory
4276 dense and sparse-direct linear algebra, conic optimization, and lattice
4278 (license license:bsd-2)))
4280 (define-public mcrl2
4283 (version "201707.1.15162")
4286 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4291 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4293 `(("subversion" ,subversion)))
4298 ("qtbase" ,qtbase)))
4299 (build-system cmake-build-system)
4300 (synopsis "Toolset for the mCRL2 formal specification language")
4302 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4303 specification language for describing concurrent discrete event systems. Its
4304 toolset supports analysis and automatic verification, linearisation, simulation,
4305 state-space exploration and generation, and tools to optimise and analyse
4306 specifications. Also, state spaces can be manipulated, visualised and
4308 (home-page "https://mcrl2.org")
4309 (license license:boost1.0)))
4311 (define-public r-subplex
4318 (uri (cran-uri "subplex" version))
4321 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4322 (build-system r-build-system)
4324 `(("gfortran" ,gfortran)))
4325 (home-page "https://cran.r-project.org/web/packages/subplex")
4326 (synopsis "Unconstrained optimization using the subplex algorithm")
4327 (description "This package implements the Subplex optimization algorithm.
4328 It solves unconstrained optimization problems using a simplex method on
4329 subspaces. The method is well suited for optimizing objective functions that
4330 are noisy or are discontinuous at the solution.")
4331 (license license:gpl3+)))
4333 (define-public r-desolve
4340 (uri (cran-uri "deSolve" version))
4343 "0hkvspq0fp8j64l9zayab2l2nazazhwfgfym0jllh0xv5a12r99s"))))
4344 (properties `((upstream-name . "deSolve")))
4345 (build-system r-build-system)
4347 `(("gfortran" ,gfortran)))
4348 (home-page "https://desolve.r-forge.r-project.org/")
4349 (synopsis "Solvers for initial value problems of differential equations")
4350 (description "This package provides functions that solve initial
4351 value problems of a system of first-order ordinary differential equations (ODE),
4352 of partial differential equations (PDE), of differential algebraic equations
4353 (DAE), and of delay differential equations. The functions provide an interface
4354 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4355 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4356 the Runge-Kutta family with fixed or variable time steps. The package contains
4357 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4358 differential equations (PDE) that have been converted to ODEs by numerical
4360 (license license:gpl2+)))
4362 (define-public tcalc
4369 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4373 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4374 (build-system gnu-build-system)
4375 (synopsis "The terminal calculator")
4377 "The terminal calculator is a small program to help users of the GNU/Linux
4378 terminal do calculations simply and quickly. The formula to be calculated can
4379 be fed to @command{tcalc} through the command line.")
4380 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4381 (license license:gpl3+)))
4383 (define-public sundials
4390 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4391 "sundials-" version ".tar.gz"))
4394 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4395 (build-system cmake-build-system)
4397 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4399 `(("fortran" ,gfortran) ;for fcmix
4401 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4403 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4404 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4405 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4406 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4407 "-DEXAMPLES_INSTALL:BOOL=OFF"
4409 "-DFCMIX_ENABLE:BOOL=ON"
4411 "-DKLU_ENABLE:BOOL=ON"
4412 ,(string-append "-DKLU_INCLUDE_DIR="
4413 (assoc-ref %build-inputs "suitesparse")
4415 ,(string-append "-DKLU_LIBRARY_DIR="
4416 (assoc-ref %build-inputs "suitesparse")
4418 (home-page "https://computation.llnl.gov/projects/sundials")
4419 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4420 (description "SUNDIALS is a family of software packages implemented with
4421 the goal of providing robust time integrators and nonlinear solvers that can
4422 easily be incorporated into existing simulation codes.")
4423 (license license:bsd-3)))
4425 (define-public sundials-openmpi
4426 (package (inherit sundials)
4427 (name "sundials-openmpi")
4430 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4431 ,@(package-inputs sundials)))
4433 (substitute-keyword-arguments (package-arguments sundials)
4434 ((#:configure-flags flags '())
4435 `(cons* "-DMPI_ENABLE:BOOL=ON"
4436 "-DPETSC_ENABLE:BOOL=ON"
4437 (string-append "-DPETSC_INCLUDE_DIR="
4438 (assoc-ref %build-inputs "petsc")
4440 (string-append "-DPETSC_LIBRARY_DIR="
4441 (assoc-ref %build-inputs "petsc")
4444 ((#:phases phases '%standard-phases)
4445 `(modify-phases ,phases
4446 (add-before 'check 'mpi-setup
4447 ,%openmpi-setup)))))
4448 (synopsis "SUNDIALS with OpenMPI support")))
4450 (define-public combinatorial-blas
4452 (name "combinatorial-blas")
4457 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4459 (match (string-split version #\.)
4460 ((major minor patch)
4461 (string-append major minor "_" patch))) ;e.g. "16_2"
4465 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4466 (patches (search-patches "combinatorial-blas-awpm.patch"
4467 "combinatorial-blas-io-fix.patch"))))
4468 (build-system cmake-build-system)
4471 ("test-data" ,(origin
4473 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4474 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4477 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4479 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4480 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4481 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4483 (modify-phases %standard-phases
4484 (add-before 'check 'mpi-setup
4486 (add-before 'check 'test-setup
4487 (lambda* (#:key inputs #:allow-other-keys)
4488 (setenv "OMP_NUM_THREADS" "2")
4489 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4490 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4491 (synopsis "Linear algebra primitives for graph analytics")
4492 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4493 distributed-memory parallel graph library offering a small but powerful set of
4494 linear algebra primitives specifically targeting graph analytics.")
4496 license:gpl2+ ;include/psort/(funnel|sort)*.h
4497 license:x11 ;usort and psort
4498 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4500 (define-public dune-common
4502 (name "dune-common")
4507 (uri (string-append "https://dune-project.org/download/"
4508 version "/dune-common-" version ".tar.gz"))
4511 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4512 (build-system cmake-build-system)
4515 (modify-phases %standard-phases
4516 (add-after 'build 'build-tests
4517 (lambda* (#:key make-flags #:allow-other-keys)
4518 (apply invoke "make" "build_tests" make-flags)))
4519 ;; These tests fail because they require a fully functional MPI
4521 (add-after 'unpack 'disable-failing-tests
4524 (string-append "--exclude-regex '("
4528 "remoteindicestest-mpi-2"
4531 "variablesizecommunicatortest"
4532 "variablesizecommunicatortest-mpi-2"
4533 "arithmetictestsuitetest"
4534 "assertandreturntest"
4535 "assertandreturntest_ndebug"
4538 "mpicollectivecommunication"
4539 "mpicollectivecommunication-mpi-2"
4541 "mpiguardtest-mpi-2"
4543 "mpihelpertest-mpi-2"
4545 "mpihelpertest2-mpi-2")
4552 ("openmpi" ,openmpi)
4553 ("openblas" ,openblas)
4555 ("superlu" ,superlu)))
4557 `(("gfortran" ,gfortran)
4558 ("pkg-config" ,pkg-config)))
4559 (home-page "https://dune-project.org/")
4560 (synopsis "Distributed and Unified Numerics Environment")
4561 (description "DUNE, the Distributed and Unified Numerics Environment is a
4562 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4563 grid-based methods. It supports the easy implementation of methods like
4564 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4565 Differences} (FD).")
4566 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4567 (license license:gpl2)))
4569 (define-public dune-geometry
4571 (name "dune-geometry")
4576 (uri (string-append "https://dune-project.org/download/"
4577 version "/dune-geometry-" version ".tar.gz"))
4580 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4581 (build-system cmake-build-system)
4584 (modify-phases %standard-phases
4585 (add-after 'build 'build-tests
4586 (lambda* (#:key make-flags #:allow-other-keys)
4587 (apply invoke "make" "build_tests" make-flags))))))
4589 `(("dune-common" ,dune-common)
4590 ("openmpi" ,openmpi)
4592 ("openblas" ,openblas)
4594 ("python" ,python)))
4596 `(("gfortran" ,gfortran)
4597 ("pkg-config" ,pkg-config)))
4598 (home-page "https://dune-project.org/")
4599 (synopsis "Distributed and Unified Numerics Environment")
4600 (description "DUNE, the Distributed and Unified Numerics Environment is a
4601 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4602 grid-based methods. It supports the easy implementation of methods like
4603 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4606 This package contains the basic DUNE geometry classes.")
4607 ;; GPL version 2 with "runtime exception"
4608 (license license:gpl2)))
4610 (define-public dune-grid
4617 (uri (string-append "https://dune-project.org/download/"
4618 version "/dune-grid-" version ".tar.gz"))
4621 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4622 (build-system cmake-build-system)
4625 (modify-phases %standard-phases
4626 (add-after 'build 'build-tests
4627 (lambda* (#:key make-flags #:allow-other-keys)
4628 (apply invoke "make" "build_tests" make-flags)))
4629 ;; These tests fail because they require a fully functional MPI
4631 (add-after 'unpack 'disable-failing-tests
4634 (string-append "--exclude-regex '("
4638 "conformvolumevtktest"
4640 "nonconformboundaryvtktest"
4641 "subsamplingvtktest"
4647 "test-dgf-yasp-offset"
4649 "test-geogrid-yaspgrid"
4652 "testiteratorranges"
4653 "test-hierarchicsearch"
4654 "test-parallel-ug-mpi-2"
4655 "test-yaspgrid-backuprestore-equidistant"
4656 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4657 "test-yaspgrid-backuprestore-equidistantoffset"
4658 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4659 "test-yaspgrid-backuprestore-tensor"
4660 "test-yaspgrid-backuprestore-tensor-mpi-2"
4661 "test-yaspgrid-tensorgridfactory"
4662 "test-yaspgrid-tensorgridfactory-mpi-2"
4663 "test-yaspgrid-yaspfactory-1d"
4664 "test-yaspgrid-yaspfactory-1d-mpi-2"
4665 "test-yaspgrid-yaspfactory-2d"
4666 "test-yaspgrid-yaspfactory-2d-mpi-2"
4667 "test-yaspgrid-yaspfactory-3d"
4668 "test-yaspgrid-yaspfactory-3d-mpi-2"
4669 "globalindexsettest"
4670 "persistentcontainertest"
4671 "structuredgridfactorytest"
4672 "tensorgridfactorytest"
4678 `(("dune-common" ,dune-common)
4679 ("dune-geometry" ,dune-geometry)
4682 ("openblas" ,openblas)
4683 ("openmpi" ,openmpi)
4684 ("python" ,python)))
4686 `(("gfortran" ,gfortran)
4687 ("pkg-config" ,pkg-config)))
4688 (home-page "https://dune-project.org/")
4689 (synopsis "Distributed and Unified Numerics Environment")
4690 (description "DUNE, the Distributed and Unified Numerics Environment is a
4691 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4692 grid-based methods. It supports the easy implementation of methods like
4693 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4696 This package contains the basic DUNE grid classes.")
4697 ;; GPL version 2 with "runtime exception"
4698 (license license:gpl2)))
4700 (define-public dune-istl
4707 (uri (string-append "https://dune-project.org/download/"
4708 version "/dune-istl-" version ".tar.gz"))
4711 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4712 (build-system cmake-build-system)
4715 (modify-phases %standard-phases
4716 (add-after 'build 'build-tests
4717 (lambda* (#:key make-flags #:allow-other-keys)
4718 (apply invoke "make" "build_tests" make-flags)))
4719 ;; These tests fail because they require a fully functional MPI
4721 (add-after 'unpack 'disable-failing-tests
4724 (string-append "--exclude-regex '("
4730 "pamg_comm_repart_test"
4738 `(("dune-common" ,dune-common)
4739 ("openmpi" ,openmpi)
4742 ("superlu" ,superlu)
4743 ("openblas" ,openblas)
4745 ("python" ,python)))
4747 `(("gfortran" ,gfortran)
4748 ("pkg-config" ,pkg-config)))
4749 (home-page "https://dune-project.org/")
4750 (synopsis "Distributed and Unified Numerics Environment")
4751 (description "DUNE, the Distributed and Unified Numerics Environment is a
4752 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4755 This is the iterative solver template library which provides generic sparse
4756 matrix/vector classes and a variety of solvers based on these classes. A
4757 special feature is the use of templates to exploit the recursive block
4758 structure of finite element matrices at compile time. Available solvers
4759 include Krylov methods, (block-) incomplete decompositions and
4760 aggregation-based algebraic multigrid.")
4761 ;; GPL version 2 with "runtime exception"
4762 (license license:gpl2)))
4764 (define-public dune-localfunctions
4766 (name "dune-localfunctions")
4771 (uri (string-append "https://dune-project.org/download/"
4772 version "/dune-localfunctions-" version ".tar.gz"))
4775 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4776 (build-system cmake-build-system)
4779 (modify-phases %standard-phases
4780 (add-after 'build 'build-tests
4781 (lambda* (#:key make-flags #:allow-other-keys)
4782 (apply invoke "make" "build_tests" make-flags))))))
4784 `(("dune-common" ,dune-common)
4785 ("dune-geometry" ,dune-geometry)
4786 ("openmpi" ,openmpi)
4789 ("superlu" ,superlu)
4792 `(("gfortran" ,gfortran)
4793 ("pkg-config" ,pkg-config)))
4794 (home-page "https://dune-project.org/")
4795 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4796 (description "This DUNE module provides interface and implementation for
4797 shape functions defined on the DUNE reference elements. In addition to the
4798 shape function, interpolation operators and special keys are provided which
4799 can be used to assemble global function spaces on finite-element grids.
4801 This package provides an interface and implementation for shape functions
4802 defined on the DUNE reference elements. In addition to the shape function,
4803 interpolation operators and special keys are provided which can be used to
4804 assemble global function spaces on finite-element grids.")
4805 ;; GPL version 2 with "runtime exception"
4806 (license license:gpl2)))
4808 (define-public dune-alugrid
4810 (name "dune-alugrid")
4815 (uri (string-append "https://dune-project.org/download/"
4816 version "/dune-alugrid-" version ".tar.gz"))
4819 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4820 (build-system cmake-build-system)
4822 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4825 (modify-phases %standard-phases
4826 (add-after 'unpack 'patch-include
4828 (substitute* "dune/alugrid/test/test-alugrid.cc"
4829 (("doc/grids/gridfactory/testgrids")
4830 "doc/dune-grid/grids/gridfactory/testgrids"))
4832 (add-after 'build 'build-tests
4833 (lambda* (#:key inputs make-flags #:allow-other-keys)
4834 (setenv "CPLUS_INCLUDE_PATH"
4835 (string-append (assoc-ref inputs "dune-grid") "/share"))
4836 (apply invoke "make" "build_tests" make-flags))))))
4838 `(("dune-common" ,dune-common)
4839 ("dune-geometry" ,dune-geometry)
4840 ("dune-grid" ,dune-grid)
4841 ("openmpi" ,openmpi)
4844 ("openblas" ,openblas)
4846 ("superlu" ,superlu)
4850 `(("gfortran" ,gfortran)
4851 ("pkg-config" ,pkg-config)))
4852 (home-page "https://dune-project.org/")
4853 (synopsis "Distributed and Unified Numerics Environment")
4854 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4855 implementation of the DUNE grid interface supporting either simplices or
4857 (license license:gpl2+)))
4859 (define-public dune-typetree
4861 (name "dune-typetree")
4867 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4868 (commit (string-append "v" version))))
4869 (file-name (git-file-name name version))
4872 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4873 (build-system cmake-build-system)
4876 (modify-phases %standard-phases
4877 (add-after 'build 'build-tests
4878 (lambda* (#:key make-flags #:allow-other-keys)
4879 (apply invoke "make" "build_tests" make-flags))))))
4881 `(("dune-common" ,dune-common)
4882 ("openmpi" ,openmpi)
4884 ("openblas" ,openblas)
4887 ("superlu" ,superlu)
4890 `(("gfortran" ,gfortran)
4891 ("pkg-config" ,pkg-config)))
4892 (home-page "https://dune-project.org/")
4893 (synopsis "Distributed and Unified Numerics Environment")
4894 (description "TypeTree is a template library for constructing and
4895 operating on statically typed trees of objects.")
4896 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4897 (license (list license:lgpl3+ license:gpl2))))
4899 (define-public dune-functions
4901 (name "dune-functions")
4907 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4908 (commit (string-append "v" version))))
4909 (file-name (git-file-name name version))
4912 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4913 (build-system cmake-build-system)
4914 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4916 `(("dune-common" ,dune-common)
4917 ("dune-istl" ,dune-istl)
4918 ("dune-localfunctions" ,dune-localfunctions)
4919 ("dune-grid" ,dune-grid)
4920 ("dune-geometry" ,dune-geometry)
4921 ("dune-typetree" ,dune-typetree)
4922 ("openmpi" ,openmpi)
4923 ("openblas" ,openblas)
4926 ("superlu" ,superlu)
4929 `(("gfortran" ,gfortran)
4930 ("pkg-config" ,pkg-config)))
4931 (home-page "https://dune-project.org/")
4932 (synopsis "Distributed and Unified Numerics Environment")
4933 (description "The dune-functions module provides an abstraction layer for
4934 global finite element functions. Its two main concepts are functions
4935 implemented as callable objects, and bases of finite element spaces.")
4936 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4937 (license (list license:lgpl3+ license:gpl2))))
4939 (define-public dune-pdelab
4941 (name "dune-pdelab")
4942 (version "2.6.0-rc1")
4947 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4948 (commit (string-append "v" version))))
4949 (file-name (git-file-name name version))
4952 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4953 (build-system cmake-build-system)
4954 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4956 `(("dune-common" ,dune-common)
4957 ("dune-istl" ,dune-istl)
4958 ("dune-localfunctions" ,dune-localfunctions)
4959 ("dune-geometry" ,dune-geometry)
4960 ("dune-grid" ,dune-grid)
4961 ("dune-typetree" ,dune-typetree)
4962 ("dune-functions" ,dune-functions)
4963 ("openmpi" ,openmpi)
4965 ("openblas" ,openblas)
4969 ("superlu" ,superlu)
4972 `(("gfortran" ,gfortran)
4973 ("pkg-config" ,pkg-config)))
4974 (home-page "https://dune-project.org/")
4975 (synopsis "Differential equations solver toolbox")
4976 (description "PDELab is a partial differential equations solver toolbox
4977 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4978 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4979 (license (list license:lgpl3+ license:gpl2))))
4981 (define-public mlucas
4989 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4991 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
4992 (build-system gnu-build-system)
4994 `(("python2" ,python-2)))
4996 `(#:tests? #f ; no tests
4998 (modify-phases %standard-phases
5002 (call-with-output-file "Makefile"
5004 (format port "CC = gcc
5005 CFLAGS = -O3 ~a -DUSE_THREADS
5006 LDLIBS = -lm -lpthread -lrt
5007 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5009 ,(let ((system (or (%current-target-system)
5010 (%current-system))))
5012 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5016 (lambda* (#:key outputs #:allow-other-keys)
5017 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5018 (install-file "Mlucas" bin)
5019 (install-file "primenet.py" bin))
5021 (home-page "https://www.mersenne.org")
5022 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5023 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5024 numbers in search of a world-record prime. You may use it to test any
5025 suitable number as you wish, but it is preferable that you do so in a
5026 coordinated fashion, as part of the Great Internet Mersenne Prime
5027 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5028 management via the GIMPS project's Primenet server.")
5029 (license license:gpl2+)))
5031 (define-public nauty
5038 "https://pallini.di.uniroma1.it/"
5039 "nauty" (string-join (string-split version #\.) "")
5043 "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"))))
5044 (build-system gnu-build-system)
5045 (outputs '("out" "lib"))
5047 `(#:test-target "checks"
5049 (modify-phases %standard-phases
5050 ;; Default make target does not build all available
5051 ;; executables. Create them now.
5052 (add-after 'build 'build-extra-programs
5054 (for-each (lambda (target) (invoke "make" target))
5055 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5057 ;; Upstream does not provide any install target.
5059 (lambda* (#:key outputs #:allow-other-keys)
5060 (let* ((out (assoc-ref outputs "out"))
5061 (lib-output (assoc-ref outputs "lib"))
5062 (bin (string-append out "/bin"))
5063 (doc (string-append out "/share/doc/nauty/"))
5064 (include (string-append lib-output "/include/nauty"))
5065 (lib (string-append lib-output "/lib/nauty")))
5066 (for-each (lambda (f) (install-file f bin))
5067 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5068 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5069 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5070 "delptg" "directg" "dretodot" "dretog" "genbg"
5071 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5072 "gentourng" "gentreeg" "hamheuristic" "labelg"
5073 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5074 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5075 "sumlines" "twohamg" "vcolg" "watercluster2"))
5076 (for-each (lambda (f) (install-file f include))
5077 (find-files "." "\\.h$"))
5078 (for-each (lambda (f) (install-file f lib))
5079 (find-files "." "\\.a$"))
5080 (for-each (lambda (f) (install-file f doc))
5081 (append '("formats.txt" "README" "schreier.txt")
5082 (find-files "." "\\.pdf$")))))))))
5084 `(("gmp" ,gmp))) ;for sumlines
5085 (home-page "https://pallini.di.uniroma1.it/")
5086 (synopsis "Library for graph automorphisms")
5087 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5088 procedures for computing automorphism groups of graphs and digraphs.
5090 @code{nauty} computes graph information in the form of a set of
5091 generators, the size of the group, and the orbits of the group; it can
5092 also produce a canonical label. The @code{nauty} suite is written in
5093 C and comes with a command-line interface, a collection of
5094 command-line tools, and an Application Programming Interface (API).
5096 This package provides the static libraries required to run programs
5097 compiled against the nauty library.")
5098 (license license:asl2.0)))
5107 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5108 "ftp/releases/" version
5109 "/ppl-" version ".tar.gz"))
5112 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5113 (build-system gnu-build-system)
5119 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5121 "Parma Polyhedra Library for computations with polyhedra")
5123 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5124 especially targeted at applications in the field of analysis and
5125 verification of complex systems. These abstractions include convex
5126 polyhedra, defined as the intersection of a finite number of (open or
5127 closed) halfspaces, each described by a linear inequality (strict or
5128 non-strict) with rational coefficients; some special classes of polyhedra
5129 shapes that offer interesting complexity/precision tradeoffs; and grids
5130 which represent regularly spaced points that satisfy a set of linear
5131 congruence relations. The library also supports finite powersets and
5132 products of (any kind of) polyhedra and grids, a mixed integer linear
5133 programming problem solver using an exact-arithmetic version of the simplex
5134 algorithm, a parametric integer programming solver, and primitives for
5135 termination analysis via the automatic synthesis of linear ranking
5137 (license license:gpl3+)))