1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 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, 2020 Eric Bavier <bavier@posteo.net>
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, 2020 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, 2020 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, 2019 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 <mab@gnu.org>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
35 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
39 ;;; This file is part of GNU Guix.
41 ;;; GNU Guix is free software; you can redistribute it and/or modify it
42 ;;; under the terms of the GNU General Public License as published by
43 ;;; the Free Software Foundation; either version 3 of the License, or (at
44 ;;; your option) any later version.
46 ;;; GNU Guix is distributed in the hope that it will be useful, but
47 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
48 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 ;;; GNU General Public License for more details.
51 ;;; You should have received a copy of the GNU General Public License
52 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
54 (define-module (gnu packages maths)
55 #:use-module (ice-9 regex)
56 #:use-module (ice-9 match)
57 #:use-module (gnu packages)
58 #:use-module ((guix licenses) #:prefix license:)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix git-download)
62 #:use-module (guix utils)
63 #:use-module ((guix build utils) #:select (alist-replace))
64 #:use-module (guix build-system cmake)
65 #:use-module (guix build-system gnu)
66 #:use-module (guix build-system python)
67 #:use-module (guix build-system ruby)
68 #:use-module (gnu packages algebra)
69 #:use-module (gnu packages audio)
70 #:use-module (gnu packages autotools)
71 #:use-module (gnu packages base)
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages boost)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages cmake)
76 #:use-module (gnu packages compression)
77 #:use-module (gnu packages curl)
78 #:use-module (gnu packages cyrus-sasl)
79 #:use-module (gnu packages dbm)
80 #:use-module (gnu packages documentation)
81 #:use-module (gnu packages elf)
82 #:use-module (gnu packages flex)
83 #:use-module (gnu packages fltk)
84 #:use-module (gnu packages fontutils)
85 #:use-module (gnu packages gettext)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gd)
88 #:use-module (gnu packages ghostscript)
89 #:use-module (gnu packages graphviz)
90 #:use-module (gnu packages gtk)
91 #:use-module (gnu packages image)
92 #:use-module (gnu packages java)
93 #:use-module (gnu packages less)
94 #:use-module (gnu packages lisp)
95 #:use-module (gnu packages linux)
96 #:use-module (gnu packages logging)
97 #:use-module (gnu packages lua)
98 #:use-module (gnu packages gnome)
99 #:use-module (gnu packages guile)
100 #:use-module (gnu packages xorg)
101 #:use-module (gnu packages gl)
102 #:use-module (gnu packages imagemagick)
103 #:use-module (gnu packages m4)
104 #:use-module (gnu packages mpi)
105 #:use-module (gnu packages multiprecision)
106 #:use-module (gnu packages netpbm)
107 #:use-module (gnu packages onc-rpc)
108 #:use-module (gnu packages pcre)
109 #:use-module (gnu packages popt)
110 #:use-module (gnu packages perl)
111 #:use-module (gnu packages pkg-config)
112 #:use-module (gnu packages pulseaudio)
113 #:use-module (gnu packages python)
114 #:use-module (gnu packages python-web)
115 #:use-module (gnu packages python-xyz)
116 #:use-module (gnu packages qt)
117 #:use-module (gnu packages readline)
118 #:use-module (gnu packages ruby)
119 #:use-module (gnu packages tbb)
120 #:use-module (gnu packages scheme)
121 #:use-module (gnu packages shells)
122 #:use-module (gnu packages tcl)
123 #:use-module (gnu packages texinfo)
124 #:use-module (gnu packages tex)
125 #:use-module (gnu packages tls)
126 #:use-module (gnu packages version-control)
127 #:use-module (gnu packages wxwidgets)
128 #:use-module (gnu packages xml)
129 #:use-module (srfi srfi-1))
137 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
139 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
140 (build-system gnu-build-system)
141 (inputs `(("gtk+" ,gtk+)
142 ("libxml2" ,libxml2)))
143 (native-inputs `(("pkg-config" ,pkg-config)))
144 (synopsis "Natural deduction first-order logic interface")
145 (description "Aris is a program for performing logical proofs. It supports
146 propositional and predicate logic, as well as Boolean algebra and
147 arithmetical logic. In addition to its predefined inference and equivalence
148 rules, Aris also supports references to older proofs. Its use of standard
149 logical symbols and its natural deduction interface make it easy to use for
151 (license license:gpl3+)
152 (home-page "https://www.gnu.org/software/aris/")))
154 (define-public c-graph
160 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
163 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
164 (build-system gnu-build-system)
166 `(("fortran" ,gfortran)))
167 (synopsis "Visualizing and demonstrating convolution")
169 "GNU C-Graph is a tool for demonstrating the theory of convolution.
170 Thus, it can serve as an excellent aid to students of signal and systems
171 theory in visualizing the convolution process. Rather than forcing the
172 student to write code, the program offers an intuitive interface with
173 interactive dialogs to guide them.")
174 (license license:gpl3+)
175 (home-page "https://www.gnu.org/software/c-graph/")))
184 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
185 version "/coda-" version ".tar.gz"))
187 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
188 (patches (search-patches "coda-use-system-libs.patch"))
189 (modules '((guix build utils)))
191 ;; Make sure we don't use the bundled software.
193 (for-each (lambda (d)
194 (delete-file-recursively (string-append "libcoda/" d)))
195 '("zlib" "pcre" "expat"))
198 `(("fortran" ,gfortran)
200 ("python-numpy" ,python-numpy)))
207 (build-system gnu-build-system)
209 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
210 "LIBS= -lz -lpcre -lexpat")))
211 (synopsis "A common interface to various earth observation data formats")
213 "The Common Data Access toolbox (CODA) provides a set of interfaces for
214 reading remote sensing data from earth observation data files. It consists of
215 command line applications and interfaces to the C, Fortran, Python, and Java
216 programming languages.")
217 (home-page "https://stcorp.nl/coda")
218 (license license:gpl2+)))
226 (uri (string-append "http://www.qhull.org/download/qhull-"
227 (car (string-split version #\.))
231 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
232 (build-system cmake-build-system)
233 (synopsis "Calculate convex hulls and related structures")
235 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
236 diagram, halfspace intersection about a point, furthest-site Delaunay
237 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
238 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
239 algorithm for computing the convex hull. It handles roundoff errors from
240 floating point arithmetic. It computes volumes, surface areas, and
241 approximations to the convex hull.
243 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
244 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
245 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
247 (home-page "http://qhull.org")
248 (license (license:non-copyleft "file://COPYING.txt"
249 "See COPYING in the distribution."))))
251 (define-public python-cvxopt
253 (name "python-cvxopt")
258 (url "https://github.com/cvxopt/cvxopt.git")
260 (file-name (git-file-name name version))
263 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
264 (build-system python-build-system)
267 (modify-phases %standard-phases
268 (add-after 'unpack 'find-libraries
269 (lambda* (#:key inputs #:allow-other-keys)
270 (setenv "CVXOPT_BLAS_LIB" "openblas")
271 (setenv "CVXOPT_BUILD_FFTW" "1")
272 (setenv "CVXOPT_BUILD_GLPK" "1")
273 (setenv "CVXOPT_BUILD_GSL" "1")
280 ("openblas" ,openblas)
281 ("suitesparse" ,suitesparse)))
282 (home-page "https://www.cvxopt.org")
283 (synopsis "Python library for convex optimization")
285 "CVXOPT is a package for convex optimization based on the Python
286 programming language. Its main purpose is to make the development of software
287 for convex optimization applications straightforward by building on Python’s
288 extensive standard library and on the strengths of Python as a high-level
289 programming language.")
290 (license license:gpl3+)))
292 (define-public python2-cvxopt
293 (package-with-python2 python-cvxopt))
301 (uri (string-append "mirror://gnu/units/units-" version
304 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
305 (build-system gnu-build-system)
307 `(("readline" ,readline)
308 ("python" ,python-wrapper) ;for 'units_cur' script
309 ("python-requests" ,python-requests)))
311 `(#:phases (modify-phases %standard-phases
312 (add-after 'install 'wrap-units_cur
313 (lambda* (#:key outputs #:allow-other-keys)
314 (let* ((out (assoc-ref outputs "out"))
315 (bin (string-append out "/bin")))
316 (wrap-program (string-append bin "/units_cur")
317 `("PYTHONPATH" ":" prefix
318 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
320 (synopsis "Conversion between thousands of scales")
322 "GNU Units converts numeric quantities between units of measure. It
323 can handle scale changes through adaptive usage of standard scale
324 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
325 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
326 enough to be used effectively as a scientific calculator.")
327 (license license:gpl3+)
328 (home-page "https://www.gnu.org/software/units/")))
330 (define-public double-conversion
332 (name "double-conversion")
334 (home-page "https://github.com/google/double-conversion")
337 (uri (git-reference (url home-page)
338 (commit (string-append "v" version))))
339 (file-name (git-file-name name version))
342 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
343 (build-system cmake-build-system)
345 '(#:test-target "test"
346 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
347 "-DBUILD_TESTING=ON")))
348 (synopsis "Conversion routines for IEEE doubles")
350 "The double-conversion library provides binary-decimal and decimal-binary
351 routines for IEEE doubles. The library consists of efficient conversion
352 routines that have been extracted from the V8 JavaScript engine.")
353 (license license:bsd-3)))
355 (define-public dionysus
361 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
365 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
366 (build-system gnu-build-system)
367 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
368 (synopsis "Local search for universal constants and scientific values")
370 "GNU Dionysus is a convenient system for quickly retrieving the values of
371 mathematical constants used in science and engineering. Values can be
372 searched using a simple command-line tool, choosing from three databases:
373 universal constants, atomic numbers, and constants related to
375 (license license:gpl3+)
376 (home-page "https://www.gnu.org/software/dionysus/")))
384 (uri (string-append "mirror://gnu/gsl/gsl-"
388 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
389 (build-system gnu-build-system)
391 `(;; Currently there are numerous tests that fail on "exotic"
392 ;; architectures such as aarch64 and ppc64le.
393 ,@(if (string-prefix? "aarch64-linux"
394 (or (%current-target-system) (%current-system)))
397 (home-page "https://www.gnu.org/software/gsl/")
398 (synopsis "Numerical library for C and C++")
400 "The GNU Scientific Library is a library for numerical analysis in C
401 and C++. It includes a wide range of mathematical routines, with over 1000
402 functions in total. Subject areas covered by the library include:
403 differential equations, linear algebra, Fast Fourier Transforms and random
405 (license license:gpl3+)))
414 (uri (string-append "mirror://gnu/glpk/glpk-"
418 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
419 (build-system gnu-build-system)
423 `(#:configure-flags '("--with-gmp")))
424 (home-page "https://www.gnu.org/software/glpk/")
425 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
427 "GLPK is a C library for solving large-scale linear programming (LP),
428 mixed integer programming (MIP), and other related problems. It supports the
429 GNU MathProg modeling language, a subset of the AMPL language, and features a
430 translator for the language. In addition to the C library, a stand-alone
431 LP/MIP solver is included in the package.")
432 (license license:gpl3+)))
441 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
443 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
445 "/4ti2-" version ".tar.gz"))
447 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
448 (build-system gnu-build-system)
450 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
454 (home-page "http://www.4ti2.de/")
455 (synopsis "Mathematical tool suite for problems on linear spaces")
457 "4ti2 implements algorithms for solving algebraic, geometric and
458 combinatorial problems on linear spaces. Among others, it solves systems
459 of linear equations, computes extreme rays of polyhedral cones, solves
460 integer programming problems and computes Markov bases for statistics.")
461 (license license:gpl2+)))
463 (define-public cddlib
470 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
471 (string-delete #\. version) ".tar.gz"))
474 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
475 (build-system gnu-build-system)
478 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
479 (synopsis "Library for convex hulls and extreme rays of polyhedra")
481 "The C-library cddlib implements the Double Description Method of
482 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
483 rays of a general convex polyhedron given by a system of linear inequalities
484 in arbitrary dimension. It can also be used for the converse operation of
485 computing convex hulls.")
486 (license license:gpl2+)))
488 (define-public lrslib
495 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
497 (string-delete #\. version) ".tar.gz"))
500 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
501 (build-system gnu-build-system)
505 `(#:tests? #f ; no check phase
506 #:make-flags `("CC=gcc"
507 ,(string-append "prefix=" (assoc-ref %outputs "out"))
510 (modify-phases %standard-phases
513 (substitute* "makefile"
514 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
516 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
517 (synopsis "Convex hulls of polyhedra with exact arithmetic")
519 "The C code of lrslib implements the reverse search algorithm for
520 vertex enumeration and convex hull problems. Its input file format is
521 compatible with cddlib. All computations are done exactly in either
522 multiple precision or fixed integer arithmetic. Output is not stored
523 in memory, so even problems with very large output sizes can sometimes
525 (license license:gpl2+)))
534 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
535 "vinci/vinci-" version ".tar.gz"))
538 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
539 (build-system gnu-build-system)
541 `(("lrslib" ,lrslib)))
543 `(#:tests? #f ; no check phase
545 (modify-phases %standard-phases
547 ;; register the lrs location in the config file
548 (lambda* (#:key inputs #:allow-other-keys)
549 (let* ((lrs (assoc-ref inputs "lrslib"))
550 (lrsexec (string-append lrs "/bin/lrs")))
551 (substitute* "vinci.h"
552 (("#define LRS_EXEC \"lrs\"")
553 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
556 (lambda* (#:key outputs #:allow-other-keys)
557 (let* ((out (assoc-ref outputs "out"))
558 (bin (string-append out "/bin")))
559 (install-file "vinci" bin))
562 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
563 (synopsis "Volume computation for polytopes")
565 "Vinci implements a number of volume computation algorithms for convex
566 polytopes in arbitrary dimension. The polytopes can be given by their
567 V-representation (as the convex hull of a finite number of vertices), by
568 their H-representation (as the bounded intersection of a finite number of
569 halfspaces) or by their double description with both representations.")
570 (license license:gpl2+)))
572 (define-public arpack-ng
576 (home-page "https://github.com/opencollab/arpack-ng")
579 (uri (git-reference (url home-page) (commit version)))
580 (file-name (git-file-name name version))
583 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
584 (build-system gnu-build-system)
586 `(("autoconf" ,autoconf)
587 ("automake" ,automake)
588 ("libtool" ,libtool)))
591 ("fortran" ,gfortran)))
592 (synopsis "Fortran subroutines for solving eigenvalue problems")
594 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
595 large scale eigenvalue problems.")
596 (license (license:non-copyleft "file://COPYING"
597 "See COPYING in the distribution."))))
599 (define-public arpack-ng-3.3.0
603 (name (package-name arpack-ng))
604 (home-page (package-home-page arpack-ng))
608 (uri (string-append home-page "/archive/" version ".tar.gz"))
609 (file-name (string-append name "-" version ".tar.gz"))
612 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
614 (define-public arpack-ng-openmpi
615 (package (inherit arpack-ng)
616 (name "arpack-ng-openmpi")
619 ,@(package-inputs arpack-ng)))
621 (substitute-keyword-arguments (package-arguments arpack-ng)
622 ((#:configure-flags _ '())
624 ((#:phases phases '%standard-phases)
625 `(modify-phases ,phases
626 (add-before 'check 'mpi-setup
628 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
630 (define-public lapack
637 (uri (string-append "http://www.netlib.org/lapack/lapack-"
641 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
642 (build-system cmake-build-system)
643 (home-page "http://www.netlib.org/lapack/")
644 (inputs `(("fortran" ,gfortran)
645 ("python" ,python-wrapper)))
647 `(#:configure-flags (list
648 "-DBUILD_SHARED_LIBS:BOOL=YES"
650 ;; Build the 'LAPACKE_clatms' functions.
651 "-DLAPACKE_WITH_TMG=ON"
652 "-DBUILD_TESTING=ON")))
653 (synopsis "Library for numerical linear algebra")
655 "LAPACK is a Fortran 90 library for solving the most commonly occurring
656 problems in numerical linear algebra.")
657 (license (license:non-copyleft "file://LICENSE"
658 "See LICENSE in the distribution."))))
660 (define-public scalapack
667 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
671 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
672 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
673 (build-system cmake-build-system)
676 ("fortran" ,gfortran)
677 ("lapack" ,lapack))) ;for testing only
679 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
680 #:phases (modify-phases %standard-phases
681 (add-before 'check 'mpi-setup
683 (home-page "http://www.netlib.org/scalapack/")
684 (synopsis "Library for scalable numerical linear algebra")
686 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
687 routines on parallel distributed memory machines. ScaLAPACK solves dense and
688 banded linear systems, least squares problems, eigenvalue problems, and
689 singular value problems.")
690 (license (license:non-copyleft "file://LICENSE"
691 "See LICENSE in the distribution."))))
693 (define-public gnuplot
699 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
703 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
704 (build-system gnu-build-system)
705 (inputs `(("readline" ,readline)
711 `(("pkg-config" ,pkg-config)
712 ("texlive" ,texlive-tiny)))
713 (arguments `(#:configure-flags (list (string-append
714 "--with-texdir=" %output
715 "/texmf-local/tex/latex/gnuplot"))))
716 (home-page "http://www.gnuplot.info")
717 (synopsis "Command-line driven graphing utility")
718 (description "Gnuplot is a portable command-line driven graphing
719 utility. It was originally created to allow scientists and students to
720 visualize mathematical functions and data interactively, but has grown to
721 support many non-interactive uses such as web scripting. It is also used as a
722 plotting engine by third-party applications like Octave.")
723 ;; X11 Style with the additional restriction that derived works may only be
724 ;; distributed as patches to the original.
725 (license (license:fsf-free
726 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
736 (url "https://github.com/OkoSanto/GCTP.git")
737 (commit (string-append "v" version))))
738 (file-name (git-file-name name version))
740 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
742 `(("fortran" ,gfortran)))
743 (build-system gnu-build-system)
744 (synopsis "General Cartographic Transformation Package (GCTP)")
746 "The General Cartographic Transformation Package (GCTP) is a system of
747 software routines designed to permit the transformation of coordinate pairs
748 from one map projection to another. The GCTP is the standard computer
749 software used by the National Mapping Division for map projection
751 (home-page "https://github.com/OkoSanto/GCTP")
752 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
761 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
762 version "/src/hdf-" version ".tar.bz2"))
764 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
765 (patches (search-patches "hdf4-architectures.patch"
766 "hdf4-reproducibility.patch"
767 "hdf4-shared-fortran.patch"
768 "hdf4-tirpc.patch"))))
769 (build-system gnu-build-system)
771 `(("gfortran" ,gfortran)
776 ("libjpeg" ,libjpeg-turbo)
777 ("libtirpc" ,libtirpc)))
779 `(#:parallel-tests? #f
780 #:configure-flags (list "--enable-shared"
781 (string-append "CPPFLAGS=-I"
782 (assoc-ref %build-inputs "libtirpc")
785 (modify-phases %standard-phases
786 ;; This is inspired by two of Debian's patches.
787 (add-before 'configure 'add-more-aarch64-support
789 (substitute* '("mfhdf/ncgen/ncgen.l"
790 "mfhdf/ncgen/ncgenyy.c"
791 "mfhdf/libsrc/netcdf.h.in")
792 (("AIX5L64") "__aarch64__"))
794 (add-before 'configure 'patchbuild
797 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
799 (("/bin/mkdir") "mkdir"))
800 (substitute* (find-files "." "^Makefile\\.in$")
801 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
802 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
803 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
804 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
805 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
807 (add-after 'configure 'patch-settings
809 ;; libhdf4.settings contains the full path of the
810 ;; compilers used, and its contents are included in
811 ;; .so-files. We truncate the hashes to avoid
812 ;; unnecessary store references to those compilers:
813 (substitute* "libhdf4.settings"
814 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
815 (string-append prefix (string-take hash 10) "...")))
818 (home-page "https://www.hdfgroup.org/products/hdf4/")
820 "Library and multi-object file format for storing and managing data")
821 (description "HDF4 is a library and multi-object file format for storing
822 and managing data between machines. HDF4 is an older hierarchical data format,
823 incompatible with HDF5.")
825 (license:non-copyleft
826 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
828 (define-public hdf4-alt
833 (substitute-keyword-arguments (package-arguments hdf4)
834 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
836 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
845 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
846 "hdf5-" (version-major+minor version)
847 "/hdf5-" version "/src/hdf5-"
849 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
851 (match (string-split version #\.)
853 (string-append major minor)))
854 "/src/hdf5-" version ".tar.bz2")))
856 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
857 (patches (search-patches "hdf5-config-date.patch"
858 "hdf5-1.8-mpi-deprecations.patch"))))
859 (build-system gnu-build-system)
863 `(("gfortran" ,gfortran)
864 ("perl" ,perl))) ;part of the test machinery needs Perl
865 (outputs '("out" ; core library
866 "fortran")) ; fortran interface
868 `(;; Some of the users, notably Flann, need the C++ interface.
869 #:configure-flags '("--enable-cxx"
871 "--enable-fortran2003"
873 ;; Build a thread-safe library. Unfortunately,
874 ;; 'configure' invites you to either turn off C++,
875 ;; Fortran, and the high-level interface (HL), or
876 ;; to pass '--enable-unsupported'. Debian
877 ;; packagers chose to pass '--enable-unsupported'
878 ;; and we follow their lead here.
879 "--enable-threadsafe"
881 "--enable-unsupported")
882 ;; Use -fPIC to allow the R bindings to link with the static libraries
883 #:make-flags (list "CFLAGS=-fPIC"
886 (modify-phases %standard-phases
887 (add-before 'configure 'patch-configure
888 (lambda* (#:key outputs #:allow-other-keys)
889 (substitute* "configure"
891 (substitute* "fortran/src/Makefile.in"
892 (("libhdf5_fortran_la_LDFLAGS =")
893 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
894 (assoc-ref outputs "fortran") "/lib")))
895 (substitute* "hl/fortran/src/Makefile.in"
896 (("libhdf5hl_fortran_la_LDFLAGS =")
897 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
898 (assoc-ref outputs "fortran") "/lib")))
900 (add-after 'configure 'patch-settings
902 ;; libhdf5.settings contains the full path of the
903 ;; compilers used, and its contents are included in
904 ;; libhdf5.so. We truncate the hashes to avoid
905 ;; unnecessary store references to those compilers:
906 (substitute* "src/libhdf5.settings"
907 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
908 (string-append prefix (string-take hash 10) "..."))
909 ;; Don't record the build-time kernel version to make the
910 ;; settings file reproducible.
911 (("Uname information:.*")
912 "Uname information: Linux\n"))
914 (add-after 'install 'patch-references
915 (lambda* (#:key inputs outputs #:allow-other-keys)
916 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
917 (zlib (assoc-ref inputs "zlib")))
918 (substitute* (find-files bin "h5p?cc")
920 (string-append "-L" zlib "/lib " lib)))
922 (add-after 'install 'split
923 (lambda* (#:key inputs outputs #:allow-other-keys)
924 ;; Move all fortran-related files
925 (let* ((out (assoc-ref outputs "out"))
926 (bin (string-append out "/bin"))
927 (lib (string-append out "/lib"))
928 (inc (string-append out "/include"))
929 (ex (string-append out "/share/hdf5_examples/fortran"))
930 (fort (assoc-ref outputs "fortran"))
931 (fbin (string-append fort "/bin"))
932 (flib (string-append fort "/lib"))
933 (finc (string-append fort "/include"))
934 (fex (string-append fort "/share/hdf5_examples/fortran")))
939 ;; Note: When built with --enable-parallel, the 'h5fc' file
940 ;; doesn't exist, hence this condition.
941 (when (file-exists? (string-append bin "/h5fc"))
942 (rename-file (string-append bin "/h5fc")
943 (string-append fbin "/h5fc")))
944 (for-each (lambda (file)
946 (string-append flib "/" (basename file))))
947 (find-files lib ".*fortran.*"))
948 (for-each (lambda (file)
950 (string-append finc "/" (basename file))))
951 (find-files inc ".*mod"))
952 (for-each (lambda (file)
954 (string-append fex "/" (basename file))))
955 (find-files ex ".*"))
956 (delete-file-recursively ex))
958 (home-page "https://www.hdfgroup.org")
959 (synopsis "Management suite for extremely large and complex data")
960 (description "HDF5 is a suite that makes possible the management of
961 extremely large and complex data collections.")
962 (license (license:x11-style
963 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
965 (define-public hdf5-1.10
966 (package (inherit hdf5)
971 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
972 "hdf5-" (version-major+minor version)
973 "/hdf5-" version "/src/hdf5-"
975 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
978 (take (string-split version #\.) 2))
979 "/src/hdf5-" version ".tar.bz2")))
981 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
982 (patches (search-patches "hdf5-config-date.patch"))))))
984 (define-public hdf-java
992 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
993 version "/src/CMake-hdfjava-" version ".tar.gz"))
995 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
996 (modules '((guix build utils)))
997 (snippet ; Make sure we don't use the bundled sources and binaries.
999 (for-each delete-file
1000 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1001 "HDF4.tar.gz" "HDF5.tar.gz"))
1002 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1004 (build-system gnu-build-system)
1006 `(("jdk" ,icedtea "jdk")
1007 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1009 ("hamcrest-core" ,java-hamcrest-core)
1010 ("junit" ,java-junit)
1011 ("slf4j-simple" ,java-slf4j-simple)))
1016 ("libjpeg" ,libjpeg-turbo)
1017 ("slf4j-api" ,java-slf4j-api)))
1020 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1021 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1022 (assoc-ref %build-inputs "jdk") "/lib" )
1023 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1024 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1027 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1028 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1029 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1030 (string-append "JPEGLIB="
1031 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1035 (modify-phases %standard-phases
1036 (add-before 'configure 'chdir-to-source
1037 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1038 (add-before 'configure 'patch-build
1039 (lambda* (#:key inputs outputs #:allow-other-keys)
1040 (substitute* "configure"
1041 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1042 (("/bin/cat") (which "cat")))
1043 ;; Set classpath for compilation
1044 (substitute* '("hdf/hdf5lib/Makefile.in"
1045 "hdf/hdf5lib/exceptions/Makefile.in"
1046 "hdf/hdflib/Makefile.in")
1047 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1048 (string-append (assoc-ref inputs "slf4j-api")
1049 "/share/java/slf4j-api.jar")))
1050 ;; Replace outdated config.sub and config.guess:
1051 (with-directory-excursion "config"
1052 (for-each (lambda (file)
1054 (string-append (assoc-ref inputs "automake")
1056 ,(version-major+minor (package-version automake))
1058 '("config.sub" "config.guess")))
1060 ;; Fix embedded version number
1061 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1062 (substitute* "hdf/hdf5lib/H5.java"
1064 (string-join hdf5version ", "))))
1066 (mkdir-p (string-append (assoc-ref outputs "out")))
1067 ;; Set classpath for tests
1068 (let* ((build-dir (getcwd))
1069 (lib (string-append build-dir "/lib"))
1070 (jhdf (string-append lib "/jhdf.jar"))
1071 (jhdf5 (string-append lib "/jhdf5.jar"))
1074 (string-append (assoc-ref inputs i)
1075 "/share/java/" i ".jar"))
1076 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1078 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1080 (substitute* '("test/hdf5lib/Makefile.in"
1081 "test/hdf5lib/junit.sh.in"
1082 "examples/runExample.sh.in")
1084 (string-append (assoc-ref inputs "coreutils")
1087 (string-append (assoc-ref inputs "coreutils")
1089 (("CLASSPATH=[^\n]*")
1090 (string-append "CLASSPATH=" class-path)))
1091 (setenv "CLASSPATH" class-path))
1093 (add-before 'check 'build-examples
1095 (apply invoke `("javac"
1096 ,@(find-files "examples" ".*\\.java"))))))
1098 #:parallel-build? #f
1100 #:parallel-tests? #f ))
1101 (home-page "https://support.hdfgroup.org/products/java")
1102 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1103 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1104 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1107 ;; BSD-style license:
1108 (license (license:x11-style
1109 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1110 /current/src/unpacked/COPYING"))))
1112 (define-public hdf-eos2
1119 (uri "ftp://edhs1.gsfc.nasa.gov\
1120 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1122 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1123 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1124 "hdf-eos2-build-shared.patch"
1125 "hdf-eos2-fortrantests.patch"))))
1126 (build-system gnu-build-system)
1128 `(("gfortran" ,gfortran)))
1130 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1131 ;; XXX: These inputs are really dependencies of hdf4.
1133 ("libjpeg" ,libjpeg-turbo)
1134 ("libtirpc" ,libtirpc)
1138 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1139 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1140 #:parallel-tests? #f))
1141 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1142 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1143 (description "HDF-EOS2 is a software library built on HDF4 which supports
1144 the construction of data structures used in NASA's Earth Observing
1145 System (Grid, Point and Swath).")
1147 ;; Source files carry a permissive license header.
1148 (license (license:non-copyleft home-page))))
1150 (define-public hdf-eos5
1156 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1157 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1160 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1161 (patches (search-patches "hdf-eos5-build-shared.patch"
1162 "hdf-eos5-remove-gctp.patch"
1163 "hdf-eos5-fix-szip.patch"
1164 "hdf-eos5-fortrantests.patch"))))
1166 `(("gfortran" ,gfortran)))
1167 (build-system gnu-build-system)
1173 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1174 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1175 #:parallel-tests? #f))
1176 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1178 "HDF-EOS5 is a software library built on HDF5 to support the construction
1179 of data structures used in NASA's Earth Observing System (Grid, Point and
1181 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1183 ;; Source files carry a permissive license header.
1184 (license (license:non-copyleft home-page))))
1186 (define-public hdf5-parallel-openmpi
1187 (package (inherit hdf5)
1188 (name "hdf5-parallel-openmpi")
1191 ,@(package-inputs hdf5)))
1193 (substitute-keyword-arguments (package-arguments hdf5)
1194 ((#:configure-flags flags)
1195 ``("--enable-parallel"
1196 ,@(delete "--enable-cxx"
1197 (delete "--enable-threadsafe" ,flags))))
1199 `(modify-phases ,phases
1200 (add-after 'build 'mpi-setup
1202 (add-before 'check 'patch-tests
1204 ;; OpenMPI's mpirun will exit with non-zero status if it
1205 ;; detects an "abnormal termination", i.e. any process not
1206 ;; calling MPI_Finalize(). Since the test is explicitly
1207 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1208 ;; H5C_flush_cache from being called, mpirun will always
1209 ;; complain, so turn this test off.
1210 (substitute* "testpar/Makefile"
1211 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1212 (string-append front back "\n")))
1213 (substitute* "tools/h5diff/testph5diff.sh"
1214 (("/bin/sh") (which "sh")))
1216 (synopsis "Management suite for data with parallel IO support")))
1218 (define-public h5check
1225 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1226 "h5check/src/h5check-" version ".tar.gz"))
1229 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1230 (build-system gnu-build-system)
1231 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1232 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1233 (synopsis "HDF5 format checker")
1234 (description "@code{h5check} is a validation tool for verifying that an
1235 HDF5 file is encoded according to the HDF File Format Specification.")
1236 (license (license:x11-style "file://COPYING"))))
1244 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1249 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1250 (build-system cmake-build-system)
1251 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1252 (inputs `(("lapack" ,lapack)
1254 ;; FIXME: Even though the fonts are available dvips complains:
1255 ;; "Font cmmi10 not found; characters will be left blank."
1257 `(("texlive" ,texlive-tiny)
1258 ("ghostscript" ,ghostscript)
1259 ("doxygen" ,doxygen)))
1260 (home-page "http://itpp.sourceforge.net")
1261 (synopsis "C++ library of maths, signal processing and communication classes")
1262 (description "IT++ is a C++ library of mathematical, signal processing and
1263 communication classes and functions. Its main use is in simulation of
1264 communication systems and for performing research in the area of
1265 communications. The kernel of the library consists of generic vector and
1266 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1267 similar to MATLAB, GNU Octave or SciPy.")
1268 (license license:gpl3+)))
1270 (define-public netcdf
1277 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1278 "netcdf-" version ".tar.gz"))
1281 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1282 (patches (search-patches "netcdf-date-time.patch"
1283 "netcdf-tst_h_par.patch"))))
1284 (build-system gnu-build-system)
1287 ("doxygen" ,doxygen)
1288 ("graphviz" ,graphviz)))
1290 `(("hdf4" ,hdf4-alt)
1293 ("libjpeg" ,libjpeg-turbo)))
1295 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1297 #:phases (modify-phases %standard-phases
1298 (add-before 'configure 'fix-source-date
1300 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1301 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1302 ;; to '1st hour of the current day', and therefore makes the
1303 ;; package not reproducible.
1304 (substitute* "./configure"
1305 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1306 "date --date='@0'"))
1308 (add-after 'configure 'patch-settings
1310 ;; libnetcdf.settings contains the full filename of the compilers
1311 ;; used to build the library. We truncate the hashes of those
1312 ;; filenames to avoid unnecessary references to the corresponding
1314 (substitute* "libnetcdf.settings"
1315 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1316 (string-append prefix (string-take hash 10) "...")))
1319 #:parallel-tests? #f)) ;various race conditions
1320 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1321 (synopsis "Library for scientific data")
1322 (description "NetCDF is an interface for scientific data access and a
1323 software library that provides an implementation of the interface. The netCDF
1324 library defines a machine-independent format for representing scientific data.
1325 Together, the interface, library, and format support the creation, access, and
1326 sharing of scientific data.")
1327 (license (license:x11-style "file://COPYRIGHT"))))
1329 (define-public netcdf-parallel-openmpi
1330 (package (inherit netcdf)
1331 (name "netcdf-parallel-openmpi")
1334 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1335 (package-inputs netcdf))))
1336 ;; TODO: Replace pkg-config references in nc-config with absolute references
1338 (substitute-keyword-arguments (package-arguments netcdf)
1339 ((#:configure-flags flags)
1340 `(cons* "CC=mpicc" "CXX=mpicxx"
1341 "--enable-parallel-tests"
1342 ;; Shared libraries not supported with parallel IO.
1343 "--disable-shared" "--with-pic"
1346 (define-public netcdf-fortran
1348 (name "netcdf-fortran")
1353 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1357 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1358 (build-system gnu-build-system)
1360 `(#:parallel-tests? #f))
1362 `(("netcdf" ,netcdf)))
1364 `(("gfortran" ,gfortran)))
1365 (synopsis "Fortran interface for the netCDF library")
1366 (description (package-description netcdf))
1367 (home-page (package-home-page netcdf))
1368 (license (package-license netcdf))))
1370 (define-public nlopt
1376 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1379 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1380 (build-system gnu-build-system)
1382 `(;; Shared libraries are not built by default. They are required to
1383 ;; build the Guile, Octave, and Python bindings.
1384 #:configure-flags '("--enable-shared")
1387 (modify-phases %standard-phases
1388 (add-before 'configure 'set-libnlopt-file-name
1389 (lambda* (#:key outputs #:allow-other-keys)
1390 ;; Make sure the Scheme module refers to the library by its
1391 ;; absolute file name (we cannot do that from a snippet
1392 ;; because the expansion of @libdir@ contains
1394 (let ((out (assoc-ref outputs "out")))
1395 (substitute* "swig/nlopt.scm.in"
1397 (string-append out "/lib/libnlopt")))
1399 (inputs `(("guile" ,guile-2.0)))
1400 (native-inputs `(("pkg-config" ,pkg-config)))
1401 (home-page "http://ab-initio.mit.edu/wiki/")
1402 (synopsis "Library for nonlinear optimization")
1403 (description "NLopt is a library for nonlinear optimization, providing a
1404 common interface for a number of different free optimization routines available
1405 online as well as original implementations of various other algorithms.")
1406 (license license:lgpl2.1+)))
1408 (define-public ipopt
1415 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1419 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1420 (modules '((guix build utils)))
1422 ;; Make sure we don't use the bundled software.
1424 (delete-file-recursively "ThirdParty")
1426 (build-system gnu-build-system)
1428 '(#:phases (modify-phases %standard-phases
1429 (add-after 'install 'add--L-flags-in-ipopt.pc
1430 (lambda* (#:key inputs outputs #:allow-other-keys)
1431 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1432 ;; move it to "Libs.private" where it belongs, and add a
1433 ;; '-L' flag for LAPACK.
1434 (let ((out (assoc-ref outputs "out"))
1435 (lapack (assoc-ref inputs "lapack")))
1436 (substitute* (string-append out "/lib/pkgconfig/"
1438 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1439 (string-append "Libs: " before " " after "\n"
1440 "Libs.private: " before
1441 "-L" lapack "/lib -llapack -lblas "
1445 `(("gfortran" ,gfortran)))
1447 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1448 `(("lapack" ,lapack))) ;for both libblas and liblapack
1449 (home-page "http://www.coin-or.org")
1450 (synopsis "Large-scale nonlinear optimizer")
1452 "The Interior Point Optimizer (IPOPT) is a software package for
1453 large-scale nonlinear optimization. It provides C++, C, and Fortran
1455 (license license:epl1.0)))
1463 (uri (string-append "https://www.coin-or.org/download/source/"
1464 "Clp/Clp-" version ".tgz"))
1467 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1468 (modules '((guix build utils)))
1470 ;; Make sure we don't use the bundled software.
1472 (delete-file-recursively "ThirdParty")
1474 (build-system gnu-build-system)
1476 `(("gfortran" ,gfortran)
1477 ("pkg-config" ,pkg-config)))
1479 `(("openblas" ,openblas)))
1480 (home-page "https://www.coin-or.org")
1481 (synopsis "Linear programming solver")
1483 "CLP is a high quality linear programming solver. Its main strengths are
1484 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1485 linear and quadratic objectives. There are limited facilities for nonlinear
1486 and quadratic objectives using the Simplex algorithm.")
1487 (license license:epl1.0)))
1489 (define-public ceres
1491 (name "ceres-solver")
1493 (home-page "http://ceres-solver.org/")
1496 (uri (string-append home-page "ceres-solver-"
1500 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1501 (build-system cmake-build-system)
1503 ;; TODO: Build HTML user documentation and install separately.
1504 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1505 "-DBUILD_SHARED_LIBS=ON")
1507 #:phases (modify-phases %standard-phases
1508 (add-before 'configure 'set-library-directory
1510 ;; Install libraries to lib/, not lib64/.
1511 (substitute* "internal/ceres/CMakeLists.txt"
1512 (("set\\(LIB_SUFFIX \"64\"\\)")
1513 "set(LIB_SUFFIX \"\")"))
1516 `(("pkg-config" ,pkg-config)))
1518 `(("glog" ,glog))) ;for #include <glog/glog.h>
1523 ("suitesparse" ,suitesparse)
1524 ("gflags" ,gflags)))
1525 (synopsis "C++ library for solving large optimization problems")
1527 "Ceres Solver is a C++ library for modeling and solving large,
1528 complicated optimization problems. It is a feature rich, mature and
1529 performant library which has been used in production since 2010. Ceres Solver
1530 can solve two kinds of problems:
1532 @item non-linear least squares problems with bounds constraints;
1533 @item general unconstrained optimization problems.
1535 (license license:bsd-3)))
1537 ;; For a fully featured Octave, users are strongly recommended also to install
1538 ;; the following packages: less, ghostscript, gnuplot.
1539 (define-public octave-cli
1546 (uri (string-append "mirror://gnu/octave/octave-"
1550 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1551 (build-system gnu-build-system)
1553 `(("alsa-lib" ,alsa-lib)
1554 ("arpack" ,arpack-ng)
1560 ("fontconfig" ,fontconfig)
1561 ("freetype" ,freetype)
1565 ("graphicsmagick" ,graphicsmagick)
1568 ("libsndfile" ,libsndfile)
1572 ("portaudio" ,portaudio)
1574 ("readline" ,readline)
1575 ("suitesparse" ,suitesparse)
1576 ("texinfo" ,texinfo)
1580 ("gfortran" ,gfortran)
1581 ("pkg-config" ,pkg-config)
1583 ;; The following inputs are not actually used in the build process.
1584 ;; However, the ./configure gratuitously tests for their existence and
1585 ;; assumes that programs not present at build time are also not, and
1586 ;; can never be, available at run time! If these inputs are therefore
1587 ;; not present, support for them will be built out. However, Octave
1588 ;; will still run without them, albeit without the features they
1591 ("ghostscript" ,ghostscript)
1592 ("gnuplot" ,gnuplot)))
1593 ;; Octave code uses this variable to detect directories holding multiple CA
1594 ;; certificates to verify peers with. This is required for the networking
1595 ;; functions that require encryption to work properly.
1596 (native-search-paths
1597 (list (search-path-specification
1598 (variable "CURLOPT_CAPATH")
1599 (files '("etc/ssl/certs")))))
1602 (list (string-append "--with-shell="
1603 (assoc-ref %build-inputs "bash")
1606 (modify-phases %standard-phases
1607 (add-after 'configure 'configure-makeinfo
1608 (lambda* (#:key inputs #:allow-other-keys)
1609 (substitute* "libinterp/corefcn/help.h"
1612 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1614 (home-page "https://www.gnu.org/software/octave/")
1615 (synopsis "High-level language for numerical computation")
1616 (description "GNU Octave is a high-level interpreted language that is
1617 specialized for numerical computations. It can be used for both linear and
1618 non-linear applications and it provides great support for visualizing results.
1619 Work may be performed both at the interactive command-line as well as via
1621 (license license:gpl3+)))
1623 (define-public octave
1624 (package (inherit octave-cli)
1627 (inherit (package-source octave-cli))))
1629 `(("qscintilla" ,qscintilla)
1631 ,@(package-inputs octave-cli)))
1633 `(("qttools" , qttools) ;for lrelease
1634 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1635 ,@(package-native-inputs octave-cli)))
1637 (substitute-keyword-arguments (package-arguments octave-cli)
1639 `(modify-phases ,phases
1640 (add-before 'configure 'patch-qscintilla-library-name
1641 (lambda* (#:key inputs #:allow-other-keys)
1642 ;; The QScintilla library that the Octave configure script tries
1643 ;; to link with should be named libqscintilla-qt5.so, but the
1644 ;; QScintilla input provides the shared library as
1645 ;; libqscintilla2_qt5.so.
1646 (substitute* "configure"
1647 (("qscintilla2-qt5")
1651 (define-public qtoctave
1652 (deprecated-package "qtoctave" octave))
1654 (define-public opencascade-oce
1656 (name "opencascade-oce")
1662 (url "https://github.com/tpaviot/oce.git")
1663 (commit (string-append "OCE-" version))))
1664 (file-name (git-file-name name version))
1665 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1667 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1668 (build-system cmake-build-system)
1671 (list "-DOCE_TESTING:BOOL=ON"
1672 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1673 "-DOCE_DRAW:BOOL=ON"
1674 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1675 (assoc-ref %outputs "out"))
1676 "-UCMAKE_INSTALL_RPATH")))
1678 `(("freetype" ,freetype)
1685 `(("python" ,python-wrapper)))
1686 (home-page "https://github.com/tpaviot/oce")
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 ``Community Edition'' (OCE) of Open CASCADE, which gathers
1698 patches, improvements, and experiments contributed by users over the official
1699 Open CASCADE library.")
1700 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1701 ; use of header files; see
1702 ; OCCT_LGPL_EXCEPTION.txt
1703 license:public-domain; files
1704 ; src/Standard/Standard_StdAllocator.hxx and
1705 ; src/NCollection/NCollection_StdAllocator.hxx
1706 license:expat; file src/OpenGl/OpenGl_glext.h
1707 license:bsd-3)))); test framework gtest
1709 (define-public opencascade-occt
1711 (name "opencascade-occt")
1717 (url "https://git.dev.opencascade.org/repos/occt.git")
1720 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1722 (file-name (git-file-name name version))
1724 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1725 (modules '((guix build utils)))
1728 ;; Remove files specific to non-free operating systems.
1729 (delete-file-recursively "samples/ios")
1730 (delete-file-recursively "samples/mfc")
1731 (delete-file-recursively "samples/qt/FuncDemo")
1732 (delete-file "genconf.bat")
1733 (delete-file "gendoc.bat")
1734 (delete-file "genproj.bat")
1735 (delete-file "upgrade.bat")
1736 ;; Remove references to deleted files.
1737 (substitute* "dox/FILES_HTML.txt"
1738 ((".*standard.*") "" )
1739 ((".*UIKitSample.*") ""))
1741 (build-system cmake-build-system)
1743 '(;; There is no test target for make. OCCT provides an
1744 ;; 'Automated Testing System', which may be accessed after
1745 ;; installation via the draw.sh script. draw.sh is located in
1746 ;; the bin directory. For details see:
1747 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1748 ;; occt_dev_guides__tests.html
1750 ;; Configure without freeimage: attempting to link against the
1751 ;; freeimage version 3.17 library leads to 'undefined
1752 ;; reference' errors.
1754 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1756 "-DUSE_VTK:BOOL=OFF"
1757 "-DBUILD_DOC_Overview:BOOL=OFF"
1758 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1759 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1760 "-UCMAKE_INSTALL_LIBDIR")))
1762 `(("doxygen" ,doxygen)
1763 ;("freeimage" ,freeimage)
1764 ("freetype" ,freetype)
1766 ("libxext" ,libxext)
1773 ;; TODO: build Overview documentation and add 'doc' output.
1774 (home-page "https://www.opencascade.com")
1775 (synopsis "Libraries for 3D modeling and numerical simulation")
1777 "Open CASCADE is a set of libraries for the development of applications
1778 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1779 C++ class libraries providing services for 3D surface and solid modeling, CAD
1780 data exchange, and visualization. It is used for development of specialized
1781 software dealing with 3D models in design (CAD), manufacturing (CAM),
1782 numerical simulation (CAE), measurement equipment (CMM), and quality
1783 control (CAQ) domains.
1785 This is the certified version of the Open Cascade Technology (OCCT) library.")
1786 (license (list ;; OCCT library:
1787 license:lgpl2.1; with an exception for the use of header
1788 ; files, see OCCT_LGPL_EXCEPTION.txt.
1789 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1790 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1792 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1793 ;; src/StepFile/step.tab.*:
1794 license:gpl3+ ; with Bison 2.2 exception.
1795 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1796 (license:non-copyleft
1797 "https://www.unicode.org/license.html")
1798 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1799 license:public-domain))))
1809 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1811 (string-append "gmsh_"
1812 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1814 (file-name (git-file-name name version))
1816 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1817 (modules '((guix build utils)))
1819 ;; Remove non-free METIS code
1821 (delete-file-recursively "contrib/Metis")
1823 (build-system cmake-build-system)
1826 ("gfortran" ,gfortran)
1832 ("opencascade-oce" ,opencascade-oce)
1834 ("libxext" ,libxext)))
1836 `(("fontconfig" ,fontconfig)
1837 ("libxft" ,libxft)))
1839 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1840 "-DENABLE_BUILD_SHARED:BOOL=ON"
1841 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1842 (home-page "http://gmsh.info/")
1843 (synopsis "3D finite element grid generator")
1844 (description "Gmsh is a 3D finite element grid generator with a built-in
1845 CAD engine and post-processor. Its design goal is to provide a fast, light
1846 and user-friendly meshing tool with parametric input and advanced
1847 visualization capabilities. Gmsh is built around four modules: geometry,
1848 mesh, solver and post-processing. The specification of any input to these
1849 modules is done either interactively using the graphical user interface or in
1850 ASCII text files using Gmsh's own scripting language.")
1851 (license license:gpl2+)))
1853 (define-public maxflow
1856 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
1857 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
1862 (url "https://github.com/gerddie/maxflow.git")
1864 (file-name (git-file-name name version))
1867 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1868 (build-system cmake-build-system)
1869 (home-page "https://pub.ist.ac.at/~vnk/software.html")
1870 (synopsis "Library implementing Maxflow algorithm")
1871 (description "An implementation of the maxflow algorithm described in
1872 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1873 Energy Minimization in Computer Vision.\n
1874 Yuri Boykov and Vladimir Kolmogorov.\n
1875 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1877 (license license:gpl3+)))
1879 (define-public petsc
1886 ;; The *-lite-* tarball does not contain the *large* documentation
1887 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1888 "petsc-lite-" version ".tar.gz"))
1890 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1891 (outputs '("out" ; libraries and headers
1892 "examples")) ; ~30MiB of examples
1893 (build-system gnu-build-system)
1895 `(("python" ,python-2)))
1897 `(("gfortran" ,gfortran)
1899 ("superlu" ,superlu)
1900 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1901 ;; leaving out opengl, as configuration seems to only be for mac
1904 `(#:test-target "test"
1905 #:parallel-build? #f ; build is parallel by default
1911 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1912 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1913 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1915 (modify-phases %standard-phases
1917 ;; PETSc's configure script is actually a python script, so we can't
1918 ;; run it with bash.
1919 (lambda* (#:key outputs (configure-flags '())
1921 (let* ((prefix (assoc-ref outputs "out"))
1922 (flags `(,(string-append "--prefix=" prefix)
1923 ,@configure-flags)))
1924 (format #t "build directory: ~s~%" (getcwd))
1925 (format #t "configure flags: ~s~%" flags)
1926 (apply invoke "./configure" flags))))
1927 (add-after 'configure 'clean-local-references
1928 (lambda* (#:key outputs #:allow-other-keys)
1929 (let ((out (assoc-ref outputs "out")))
1930 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1931 ;; Prevent build directory from leaking into compiled code
1933 ;; Scrub timestamp for reproducibility
1934 ((".*Libraries compiled on.*") ""))
1935 (substitute* (find-files "." "petscvariables")
1936 ;; Do not expose build machine characteristics, set to defaults.
1937 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1938 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1940 (add-after 'install 'clean-install
1941 ;; Try to keep installed files from leaking build directory names.
1942 (lambda* (#:key inputs outputs #:allow-other-keys)
1943 (let ((out (assoc-ref outputs "out")))
1944 (substitute* (map (lambda (file)
1945 (string-append out "/lib/petsc/conf/" file))
1946 '("petscvariables"))
1948 ;; Make compiler references point to the store
1949 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1950 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1951 (string-append "= " (which compiler))))
1952 ;; PETSc installs some build logs, which aren't necessary.
1953 (for-each (lambda (file)
1954 (let ((f (string-append out "/lib/petsc/conf/" file)))
1955 (when (file-exists? f)
1957 '("configure.log" "make.log" "gmake.log"
1958 "test.log" "error.log" "RDict.db"
1959 "PETScBuildInternal.cmake"
1960 ;; Once installed, should uninstall with Guix
1963 (add-after 'install 'move-examples
1964 (lambda* (#:key outputs #:allow-other-keys)
1965 (let* ((out (assoc-ref outputs "out"))
1966 (examples (assoc-ref outputs "examples"))
1967 (exdir (string-append out "/share/petsc/examples"))
1968 (exdir' (string-append examples "/share/petsc/examples")))
1969 (copy-recursively exdir exdir')
1970 (delete-file-recursively exdir)
1972 (home-page "https://www.mcs.anl.gov/petsc")
1973 (synopsis "Library to solve PDEs")
1974 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1975 data structures and routines for the scalable (parallel) solution of
1976 scientific applications modeled by partial differential equations.")
1977 (license (license:non-copyleft
1978 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1980 (define-public petsc-complex
1981 (package (inherit petsc)
1982 (name "petsc-complex")
1984 (substitute-keyword-arguments (package-arguments petsc)
1985 ((#:configure-flags cf)
1986 `(cons "--with-scalar-type=complex" ,cf))))
1987 (synopsis "Library to solve PDEs (with complex scalars)")))
1989 (define-public petsc-openmpi
1990 (package (inherit petsc)
1991 (name "petsc-openmpi")
1993 `(("hdf5" ,hdf5-parallel-openmpi)
1994 ("hypre" ,hypre-openmpi)
1996 ("mumps" ,mumps-openmpi)
1997 ("openmpi" ,openmpi)
1998 ("scalapack" ,scalapack)
1999 ("scotch" ,pt-scotch32)
2000 ,@(package-inputs petsc)))
2002 (substitute-keyword-arguments (package-arguments petsc)
2003 ((#:configure-flags cf)
2005 "--with-mpiexec=mpirun"
2008 "--with-scalapack=1"
2010 ,(string-append "--with-mpi-dir="
2011 (assoc-ref %build-inputs "openmpi"))
2012 ,(string-append "--with-hdf5-include="
2013 (assoc-ref %build-inputs "hdf5") "/include")
2014 ,(string-append "--with-hdf5-lib="
2015 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2016 ,@(delete "--with-mpi=0" ,cf)))
2018 `(modify-phases ,phases
2019 (add-before 'configure 'mpi-setup
2020 ,%openmpi-setup)))))
2021 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2023 (define-public petsc-complex-openmpi
2024 (package (inherit petsc-complex)
2025 (name "petsc-complex-openmpi")
2027 `(("openmpi" ,openmpi)
2028 ,@(package-inputs petsc-complex)))
2030 (substitute-keyword-arguments (package-arguments petsc-complex)
2031 ((#:configure-flags cf)
2032 ``("--with-mpiexec=mpirun"
2033 ,(string-append "--with-mpi-dir="
2034 (assoc-ref %build-inputs "openmpi"))
2035 ,@(delete "--with-mpi=0" ,cf)))
2037 `(modify-phases ,phases
2038 (add-before 'configure 'mpi-setup
2039 ,%openmpi-setup)))))
2040 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2042 (define-public python-petsc4py
2044 (name "python-petsc4py")
2049 (uri (pypi-uri "petsc4py" version))
2052 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2053 (build-system python-build-system)
2056 (modify-phases %standard-phases
2057 (add-before 'build 'pre-build
2059 ;; Define path to PETSc installation.
2060 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2062 (add-before 'check 'mpi-setup
2065 `(("petsc" ,petsc-openmpi)
2066 ("python-numpy" ,python-numpy)))
2067 (home-page "https://bitbucket.org/petsc/petsc4py/")
2068 (synopsis "Python bindings for PETSc")
2069 (description "PETSc, the Portable, Extensible Toolkit for
2070 Scientific Computation, is a suite of data structures and routines for
2071 the scalable (parallel) solution of scientific applications modeled by
2072 partial differential equations. It employs the MPI standard for all
2073 message-passing communication. @code{petsc4py} provides Python
2074 bindings to almost all functions of PETSc.")
2075 (license license:bsd-3)))
2077 (define-public python-kiwisolver
2079 (name "python-kiwisolver")
2083 (uri (pypi-uri "kiwisolver" version))
2086 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2087 (build-system python-build-system)
2088 (home-page "https://github.com/nucleic/kiwi")
2089 (synopsis "Fast implementation of the Cassowary constraint solver")
2091 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2092 solving algorithm. Kiwi has been designed from the ground up to be
2093 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2094 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2095 savings are consistently > 5x.")
2096 (license license:bsd-3)))
2098 (define-public python2-kiwisolver
2099 (package-with-python2 python-kiwisolver))
2101 (define-public slepc
2108 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2112 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2113 (build-system gnu-build-system)
2115 `(("python" ,python-2)
2116 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2118 `(("arpack" ,arpack-ng)
2119 ("gfortran" ,gfortran)))
2121 `(("petsc" ,petsc)))
2123 `(#:parallel-build? #f ;build is parallel by default
2125 `(,(string-append "--with-arpack-dir="
2126 (assoc-ref %build-inputs "arpack") "/lib"))
2127 #:make-flags ;honor (parallel-job-count)
2128 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2129 ,(string-append "PETSCCONFIGDIR="
2130 (assoc-ref %build-inputs "petsc:examples")
2131 "/share/petsc/examples/config"))
2133 (modify-phases %standard-phases
2135 ;; configure is a python script, so we can't run it with bash.
2136 (lambda* (#:key inputs outputs (configure-flags '())
2138 (let* ((prefix (assoc-ref outputs "out"))
2139 (flags `(,(string-append "--prefix=" prefix)
2140 ,@configure-flags)))
2141 (format #t "build directory: ~s~%" (getcwd))
2142 (format #t "configure flags: ~s~%" flags)
2143 (setenv "SLEPC_DIR" (getcwd))
2144 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2145 (apply invoke "./configure" flags))))
2146 (add-after 'install 'delete-doc
2147 ;; TODO: SLEPc installs HTML documentation alongside headers in
2148 ;; $out/include. We'd like to move them to share/doc, but delete
2149 ;; them for now, as they are incomplete and installing the complete
2150 ;; documentation is difficult.
2151 (lambda* (#:key outputs #:allow-other-keys)
2152 (let* ((out (assoc-ref outputs "out")))
2153 (for-each delete-file (find-files out "\\.html$"))
2155 (add-after 'install 'clean-install
2156 ;; Clean up unnecessary build logs from installation.
2157 (lambda* (#:key outputs #:allow-other-keys)
2158 (let ((out (assoc-ref outputs "out")))
2159 (for-each (lambda (file)
2160 (let ((f (string-append out "/lib/slepc/conf/" file)))
2161 (when (file-exists? f)
2163 '("configure.log" "make.log" "gmake.log"
2164 "test.log" "error.log" "RDict.db"
2167 (home-page "http://slepc.upv.es")
2168 (synopsis "Scalable library for eigenproblems")
2169 (description "SLEPc is a software library for the solution of large sparse
2170 eigenproblems on parallel computers. It can be used for the solution of
2171 linear eigenvalue problems formulated in either standard or generalized form,
2172 as well as other related problems such as the singular value decomposition.
2173 The emphasis of the software is on methods and techniques appropriate for
2174 problems in which the associated matrices are sparse, for example, those
2175 arising after the discretization of partial differential equations.")
2176 (license license:bsd-2)))
2178 (define-public slepc-complex
2179 (package (inherit slepc)
2180 (name "slepc-complex")
2182 `(("petsc" ,petsc-complex)
2183 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2184 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2186 (define-public slepc-openmpi
2187 (package (inherit slepc)
2188 (name "slepc-openmpi")
2190 (substitute-keyword-arguments (package-arguments slepc)
2191 ((#:phases phases '%standard-phases)
2192 `(modify-phases ,phases
2193 (add-before 'check 'mpi-setup
2194 ,%openmpi-setup)))))
2197 ("arpack" ,arpack-ng-openmpi)
2198 ,@(alist-delete "arpack" (package-inputs slepc))))
2200 `(("petsc" ,petsc-openmpi)
2201 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2202 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2204 (define-public slepc-complex-openmpi
2205 (package (inherit slepc-openmpi)
2206 (name "slepc-complex-openmpi")
2208 `(("petsc" ,petsc-complex-openmpi)
2209 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2210 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2212 (define-public python-slepc4py
2214 (name "python-slepc4py")
2219 (uri (pypi-uri "slepc4py" version))
2222 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2223 (build-system python-build-system)
2226 (modify-phases %standard-phases
2227 (add-before 'build 'pre-build
2229 ;; Define path to PETSc installation.
2230 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2231 ;; Define path to SLEPc installation.
2232 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2234 (add-before 'check 'mpi-setup
2237 `(("python-numpy" ,python-numpy)
2238 ("python-petsc4py" ,python-petsc4py)
2239 ("slepc" ,slepc-openmpi)))
2240 (home-page "https://bitbucket.org/slepc/slepc4py/")
2241 (synopsis "Python bindings for SLEPc")
2242 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2243 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2244 Scientific Computation. It employs the MPI standard for all
2245 message-passing communication. @code{slepc4py} provides Python
2246 bindings to almost all functions of SLEPc.")
2247 (license license:bsd-3)))
2249 (define-public mumps
2256 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2260 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2261 (patches (search-patches "mumps-build-parallelism.patch"
2262 "mumps-shared-libseq.patch"
2263 "mumps-shared-mumps.patch"
2264 "mumps-shared-pord.patch"))))
2265 (build-system gnu-build-system)
2267 `(("fortran" ,gfortran)
2268 ;; These are required for linking against mumps, but we let the user
2269 ;; declare the dependency.
2272 ("scotch" ,scotch)))
2274 `(#:modules ((ice-9 match)
2277 ,@%gnu-build-system-modules)
2279 (modify-phases %standard-phases
2281 (lambda* (#:key inputs #:allow-other-keys)
2282 (call-with-output-file "Makefile.inc"
2293 INCSEQ = -I$(topdir)/libseq
2294 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2295 LIBSEQNEEDED = libseqneeded~;
2299 AR = ar vr # rules require trailing space, ugh...
2302 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2304 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2305 LIBOTHERS = -pthread
2308 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2312 LIBS = $(SCALAP) $(LIBSEQ)
2313 LPORDDIR = $(topdir)/PORD/lib
2314 IPORD = -I$(topdir)/PORD/include
2315 LPORD = $(LPORDDIR)/libpord.a
2316 ORDERINGSF = -Dpord~@[
2318 IMETIS = -I$(METISDIR)/include
2319 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2320 ORDERINGSF += -Dmetis~]~@[~:{
2322 ISCOTCH = -I$(SCOTCHDIR)/include
2323 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2324 ORDERINGSF += ~a~}~]
2325 ORDERINGSC = $(ORDERINGSF)
2326 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2327 IORDERINGSF = $(ISCOTCH)
2328 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2329 (assoc-ref inputs "mpi")
2330 (assoc-ref inputs "blas")
2331 (assoc-ref inputs "scalapack")
2332 (assoc-ref inputs "metis")
2333 (match (list (assoc-ref inputs "pt-scotch")
2334 (assoc-ref inputs "scotch"))
2338 `((,scotch "" "-Dscotch")))
2341 "-lptesmumps -lptscotch -lptscotcherr "
2342 "-Dptscotch")))))))))
2344 ;; By default only the d-precision library is built. Make with "all"
2345 ;; target so that all precision libraries and examples are built.
2347 (invoke "make" "all"
2348 (format #f "-j~a" (parallel-job-count)))))
2350 ;; Run the simple test drivers, which read test input from stdin:
2351 ;; from the "real" input for the single- and double-precision
2352 ;; testers, and from the "cmplx" input for complex-precision
2353 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2354 ;; package to prefix execution with "mpirun".
2355 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2356 (with-directory-excursion "examples"
2359 (let ((tester (apply open-pipe*
2362 ,(string-append "./" prec
2364 (input (open-input-file
2365 (string-append "input_simpletest_" type))))
2367 (dump-port input tester)
2369 (zero? (close-pipe tester)))))
2371 '("real" "real" "cmplx" "cmplx")))))
2373 (lambda* (#:key outputs #:allow-other-keys)
2374 (let* ((out (assoc-ref outputs "out"))
2375 (libdir (string-append out "/lib")))
2376 (copy-recursively "lib" libdir)
2377 (copy-recursively "include" (string-append out "/include"))
2378 (when (file-exists? "libseq/libmpiseq.a")
2379 (install-file "libseq/libmpiseq.a" libdir))
2380 (when (file-exists? "libseq/libmpiseq.so")
2381 (install-file "libseq/libmpiseq.so" libdir))
2383 (home-page "http://mumps.enseeiht.fr")
2384 (synopsis "Multifrontal sparse direct solver")
2386 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2387 sparse system of linear equations A x = b using Gaussian elimination.")
2388 (license license:cecill-c)))
2390 (define-public mumps-metis
2391 (package (inherit mumps)
2392 (name "mumps-metis")
2394 (alist-delete "scotch" (package-inputs mumps)))))
2396 (define-public mumps-openmpi
2397 (package (inherit mumps)
2398 (name "mumps-openmpi")
2401 ("scalapack" ,scalapack)
2402 ("pt-scotch" ,pt-scotch)
2403 ,@(alist-delete "scotch" (package-inputs mumps))))
2405 (substitute-keyword-arguments (package-arguments mumps)
2407 `(modify-phases ,phases
2408 (add-before 'check 'mpi-setup
2412 ((assoc-ref ,phases 'check)
2413 #:exec-prefix '("mpirun" "-n" "2"))))))))
2414 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2416 (define-public mumps-metis-openmpi
2417 (package (inherit mumps-openmpi)
2418 (name "mumps-metis-openmpi")
2420 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2422 (define-public ruby-asciimath
2424 (name "ruby-asciimath")
2429 (uri (rubygems-uri "asciimath" version))
2432 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2433 (build-system ruby-build-system)
2436 (modify-phases %standard-phases
2438 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2439 (add-after 'unpack 'patch-remove-spurious-backslashes
2441 (substitute* "spec/parser_spec.rb"
2446 `(("bundler" ,bundler)
2447 ("ruby-rspec" ,ruby-rspec)))
2448 (synopsis "AsciiMath parsing and conversion library")
2450 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2451 easy-to-write markup language for mathematics.")
2452 (home-page "https://github.com/asciidoctor/asciimath")
2453 (license license:expat)))
2455 (define-public superlu
2462 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2463 "superlu_" version ".tar.gz"))
2465 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2466 (modules '((guix build utils)))
2468 ;; Replace the non-free implementation of MC64 with a stub adapted
2471 (use-modules (ice-9 regex)
2473 (call-with-output-file "SRC/mc64ad.c"
2478 void mc64id_(int *a) {
2479 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2482 void mc64ad_ (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: non-free MC64 not available. Aborting.\\n\");
2487 ;; Remove the corresponding license verbiage. MC64 license follows
2488 ;; a "------" line separator.
2489 (with-atomic-file-replacement "License.txt"
2490 (let ((rx (make-regexp "-{8}")))
2493 (let ((line (read-line in 'concat)))
2494 (unless (regexp-exec rx line)
2498 (build-system cmake-build-system)
2502 `(("blas" ,openblas)
2503 ("gfortran" ,gfortran)))
2505 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2506 "-DTPL_BLAS_LIBRARIES=openblas"
2507 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2508 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2509 (synopsis "Supernodal direct solver for sparse linear systems")
2511 "SuperLU is a general purpose library for the direct solution of large,
2512 sparse, nonsymmetric systems of linear equations on high performance machines.
2513 The library is written in C and is callable from either C or Fortran. The
2514 library routines perform an LU decomposition with partial pivoting and
2515 triangular system solves through forward and back substitution. The library
2516 also provides threshold-based ILU factorization preconditioners.")
2517 (license (list license:bsd-3
2518 license:gpl2+ ;EXAMPLE/*fgmr.c
2519 (license:fsf-free "file://SRC/colamd.h")))))
2521 (define-public superlu-dist
2523 (name "superlu-dist")
2528 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2529 "superlu_dist_" version ".tar.gz"))
2531 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2532 (modules '((guix build utils)))
2534 ;; Replace the non-free implementation of MC64 with a stub
2536 (call-with-output-file "SRC/mc64ad_dist.c"
2541 void mc64id_dist(int *a) {
2542 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2545 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2546 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2547 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2550 (substitute* "SRC/util.c" ;adjust default algorithm
2551 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2552 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2553 ;; general (i.e. non-square) processor-grid support.
2554 "RowPerm = NOROWPERM;"))
2556 (patches (search-patches "superlu-dist-scotchmetis.patch"
2557 "superlu-dist-awpm-grid.patch"))))
2558 (build-system cmake-build-system)
2562 `(("gfortran" ,gfortran)
2565 ("combblas" ,combinatorial-blas)))
2567 `(("mpi" ,openmpi) ;headers include MPI heades
2568 ("parmetis" ,pt-scotch32 "metis")
2569 ("pt-scotch" ,pt-scotch32)))
2571 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2572 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2573 "-DTPL_ENABLE_COMBBLASLIB=YES"
2574 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2575 "-DTPL_LAPACK_LIBRARIES=-llapack"
2576 (string-append "-DTPL_PARMETIS_LIBRARIES="
2578 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2579 "scotchmetis" "scotch" "scotcherr")
2581 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2582 (assoc-ref %build-inputs "parmetis")
2584 "-DTPL_ENABLE_COMBBLASLIB=ON"
2585 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2586 (assoc-ref %build-inputs "combblas")
2587 "/include/CombBLAS;"
2588 (assoc-ref %build-inputs "combblas")
2589 "/include/BipartiteMatchings")
2590 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2592 (modify-phases %standard-phases
2593 (add-before 'configure 'set-c++-standard
2595 (substitute* "CMakeLists.txt"
2596 ;; AWPM headers require C++14
2597 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2598 (add-before 'check 'mpi-setup
2600 (add-before 'check 'omp-setup
2601 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2602 (home-page (package-home-page superlu))
2603 (synopsis "Parallel supernodal direct solver")
2605 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2606 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2607 implemented in ANSI C, and MPI for communications.")
2608 (license license:bsd-3)))
2610 (define-public scotch
2617 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2618 "latestfile/298/scotch_" version ".tar.gz"))
2620 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2621 (patches (search-patches "scotch-build-parallelism.patch"
2622 "scotch-integer-declarations.patch"))))
2623 (build-system gnu-build-system)
2628 (outputs '("out" "metis"))
2630 `(#:make-flags (list (string-append "prefix=" %output))
2632 (modify-phases %standard-phases
2634 'unpack 'chdir-to-src
2635 (lambda _ (chdir "src") #t))
2639 (call-with-output-file "Makefile.inc"
2653 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2654 LDFLAGS = -lz -lm -lrt -lpthread
2656 LEX = flex -Pscotchyy -olex.yy.c
2661 YACC = bison -pscotchyy -y -b y
2663 '("COMMON_FILE_COMPRESS_GZ"
2665 "COMMON_RANDOM_FIXED_SEED"
2666 "INTSIZE64" ;use 'int64_t'
2667 ;; Prevents symbolc clashes with libesmumps
2669 ;; XXX: Causes invalid frees in superlu-dist tests
2671 ;; "SCOTCH_PTHREAD_NUMBER=2"
2672 "restrict=__restrict"))))
2674 (add-after 'build 'build-esmumps
2677 (format #f "-j~a" (parallel-job-count))
2679 (add-before 'install 'make-install-dirs
2680 (lambda* (#:key outputs #:allow-other-keys)
2681 (mkdir (assoc-ref outputs "out"))))
2682 (add-after 'install 'install-metis
2683 (lambda* (#:key outputs #:allow-other-keys)
2684 (let ((out (assoc-ref outputs "metis")))
2686 ;; metis files are not installed with 'make install'
2687 (for-each (lambda (f)
2688 (install-file f (string-append out "/include")))
2689 (find-files "../include/" ".*metis\\.h"))
2690 (for-each (lambda (f)
2691 (install-file f (string-append out "/lib")))
2692 (find-files "../lib/" ".*metis\\..*"))
2694 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2695 (synopsis "Programs and libraries for graph algorithms")
2696 (description "SCOTCH is a set of programs and libraries which implement
2697 the static mapping and sparse matrix reordering algorithms developed within
2698 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2699 conquer approach, to scientific computing problems such as graph and mesh
2700 partitioning, static mapping, and sparse matrix ordering, in application
2701 domains ranging from structural mechanics to operating systems or
2703 ;; See LICENSE_en.txt
2704 (license license:cecill-c)))
2706 (define-public scotch32
2707 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2708 ;; some applications.
2709 (package (inherit scotch)
2712 (substitute-keyword-arguments (package-arguments scotch)
2713 ((#:phases scotch-phases)
2714 `(modify-phases ,scotch-phases
2718 (call-with-output-file "Makefile.inc"
2732 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2733 LDFLAGS = -lz -lm -lrt -lpthread
2735 LEX = flex -Pscotchyy -olex.yy.c
2740 YACC = bison -pscotchyy -y -b y
2742 '("COMMON_FILE_COMPRESS_GZ"
2744 "COMMON_RANDOM_FIXED_SEED"
2745 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2746 ;; Prevents symbolc clashes with libesmumps
2748 ;; XXX: Causes invalid frees in superlu-dist tests
2750 ;; "SCOTCH_PTHREAD_NUMBER=2"
2751 "restrict=__restrict"))))))))))
2753 "Programs and libraries for graph algorithms (32-bit integers)")))
2755 (define-public pt-scotch
2756 (package (inherit scotch)
2759 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2761 (substitute-keyword-arguments (package-arguments scotch)
2762 ((#:phases scotch-phases)
2763 `(modify-phases ,scotch-phases
2767 (invoke "make" (format #f "-j~a" (parallel-job-count))
2768 "ptscotch" "ptesmumps")
2770 ;; Install the serial metis compatibility library
2771 (invoke "make" "-C" "libscotchmetis" "install")))
2772 (add-before 'check 'mpi-setup
2776 (invoke "make" "ptcheck")))))))
2777 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2779 (define-public pt-scotch32
2780 (package (inherit scotch32)
2781 (name "pt-scotch32")
2783 `(("openmpi" ,openmpi))) ;headers include MPI headers
2785 (substitute-keyword-arguments (package-arguments scotch32)
2786 ((#:phases scotch32-phases)
2787 `(modify-phases ,scotch32-phases
2790 (invoke "make" (format #f "-j~a" (parallel-job-count))
2791 "ptscotch" "ptesmumps")
2792 ;; Install the serial metis compatibility library
2793 (invoke "make" "-C" "libscotchmetis" "install")))
2794 (add-before 'check 'mpi-setup
2798 (invoke "make" "ptcheck")))))))
2800 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2802 (define-public metis
2809 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2810 "metis-" version ".tar.gz"))
2813 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2814 (build-system cmake-build-system)
2816 `(("blas" ,openblas)))
2818 `(#:tests? #f ;no tests
2819 #:configure-flags `("-DSHARED=ON"
2820 ,(string-append "-DGKLIB_PATH=" (getcwd)
2821 "/metis-" ,version "/GKlib"))))
2822 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2823 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2825 "METIS is a set of serial programs for partitioning graphs, partitioning
2826 finite element meshes, and producing fill-reducing orderings for sparse
2827 matrices. The algorithms implemented in METIS are based on the multilevel
2828 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2830 (license license:asl2.0))) ;As of version 5.0.3
2832 (define-public p4est
2839 (uri (string-append "http://p4est.github.io/release/p4est-"
2843 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2844 (build-system gnu-build-system)
2846 `(("fortran" ,gfortran)
2851 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2852 (assoc-ref %build-inputs "blas")
2854 ,(string-append "LAPACK_LIBS=-L"
2855 (assoc-ref %build-inputs "lapack")
2857 #:phases (modify-phases %standard-phases
2858 (add-before 'check 'mpi-setup
2860 (home-page "http://www.p4est.org")
2861 (synopsis "Adaptive mesh refinement on forests of octrees")
2863 "The p4est software library enables the dynamic management of a
2864 collection of adaptive octrees, conveniently called a forest of octrees.
2865 p4est is designed to work in parallel and scales to hundreds of thousands of
2867 (license license:gpl2+)))
2869 (define-public p4est-openmpi
2870 (package (inherit p4est)
2871 (name "p4est-openmpi")
2874 ,@(package-inputs p4est)))
2876 (substitute-keyword-arguments (package-arguments p4est)
2877 ((#:configure-flags cf)
2878 ``("--enable-mpi" ,@,cf))))
2879 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2881 (define-public gsegrafix
2888 (uri (string-append "mirror://gnu/" name "/" name "-"
2892 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2893 (build-system gnu-build-system)
2895 `(#:configure-flags '("LDFLAGS=-lm")))
2897 `(("libgnomecanvas" ,libgnomecanvas)
2898 ("libbonoboui" ,libbonoboui)
2899 ("libgnomeui" ,libgnomeui)
2900 ("libgnomeprintui" ,libgnomeprintui)
2903 `(("pkg-config" ,pkg-config)))
2904 (home-page "https://www.gnu.org/software/gsegrafix/")
2905 (synopsis "GNOME application to create scientific and engineering plots")
2906 (description "GSEGrafix is an application which produces high-quality graphical
2907 plots for science and engineering. Plots are specified via simple ASCII
2908 parameter files and data files and are presented in an anti-aliased GNOME
2909 canvas. The program supports rectangular two-dimensional plots, histograms,
2910 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2911 to BMP, JPEG or PNG image formats.")
2912 (license license:gpl3+)))
2914 (define-public maxima
2921 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2922 version "-source/" name "-" version ".tar.gz"))
2925 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2926 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2927 (build-system gnu-build-system)
2930 ("gnuplot" ,gnuplot) ;for plots
2932 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2934 `(("texinfo" ,texinfo)
2936 ("python" ,python)))
2939 (list "--enable-gcl"
2940 (string-append "--with-posix-shell="
2941 (assoc-ref %build-inputs "bash")
2943 (string-append "--with-wish="
2944 (assoc-ref %build-inputs "tk")
2946 (let ((v ,(package-version tk)))
2947 (string-take v (string-index-right v #\.)))))
2948 ;; By default Maxima attempts to write temporary files to
2949 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2950 ;; Work around that.
2951 #:make-flags (list "TMPDIR=/tmp")
2953 (modify-phases %standard-phases
2954 (add-after 'unpack 'patch-paths
2955 (lambda* (#:key inputs #:allow-other-keys)
2956 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2957 (coreutils (assoc-ref inputs "coreutils"))
2958 (dirname (string-append coreutils "/bin/dirname"))
2959 (head (string-append coreutils "/bin/head"))
2960 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2961 (python (string-append (assoc-ref inputs "python")
2963 (substitute* "src/maxima.in"
2964 (("sed ") (string-append sed " "))
2965 (("dirname") dirname)
2967 (substitute* "doc/info/Makefile.in"
2968 (("/usr/bin/env perl") perl))
2969 (substitute* "doc/info/build_html.sh.in"
2970 (("python") python))
2972 (add-before 'check 'pre-check
2974 (chmod "src/maxima" #o555)
2978 ;; This is derived from the testing code in the "debian/rules" file
2979 ;; of Debian's Maxima package.
2980 ;; If Maxima can successfully run this, the binary to be installed
2986 "--batch-string=\"run_testsuite();\" "
2987 "| grep -q \"No unexpected errors found\""))))
2988 ;; Make sure the doc and emacs files are found in the
2989 ;; standard location. Also configure maxima to find gnuplot
2990 ;; without having it on the PATH.
2991 (add-after 'install 'post-install
2992 (lambda* (#:key outputs inputs #:allow-other-keys)
2993 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2994 (out (assoc-ref outputs "out"))
2995 (datadir (string-append out "/share/maxima/" ,version))
2996 (binutils (string-append (assoc-ref inputs "binutils")
2998 (with-directory-excursion out
2999 (mkdir-p "share/emacs")
3000 (mkdir-p "share/doc")
3002 (string-append datadir "/doc/")
3003 (string-append out "/share/doc/maxima"))
3004 (with-atomic-file-replacement
3005 (string-append datadir "/share/maxima-init.lisp")
3007 (format out "~a ~s~a~%"
3008 "(setf $gnuplot_command "
3009 (string-append gnuplot "/bin/gnuplot") ")")
3010 (dump-port in out))))
3011 ;; Ensure that Maxima will have access to the GNU binutils
3012 ;; components at runtime.
3013 (wrap-program (string-append out "/bin/maxima")
3014 `("PATH" prefix (,binutils))))
3016 (home-page "http://maxima.sourceforge.net")
3017 (synopsis "Numeric and symbolic expression manipulation")
3018 (description "Maxima is a system for the manipulation of symbolic and
3019 numerical expressions. It yields high precision numeric results by using
3020 exact fractions, arbitrary precision integers, and variable precision floating
3022 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3023 ;; Others simply say "GNU General Public License" without stating a
3024 ;; version (which implicitly means gpl1+).
3025 ;; At least one file (src/maxima.asd) says "version 2."
3026 ;; GPLv2 only is therefore the smallest subset.
3027 (license license:gpl2)))
3029 (define-public wxmaxima
3037 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
3038 (commit (string-append "Version-" version))))
3039 (file-name (git-file-name name version))
3041 (base32 "106a7jrjwfmymzj70nsv44fm3jbxngr8pmkaghhpwy0ln38lhf54"))))
3042 (build-system cmake-build-system)
3044 `(("gettext" ,gettext-minimal)
3045 ("xorg-server" ,xorg-server-for-tests)))
3046 ;; TODO: Add libomp for multithreading support.
3047 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3049 `(("wxwidgets" ,wxwidgets)
3052 ("adwaita-icon-theme" ,adwaita-icon-theme)
3054 ("shared-mime-info" ,shared-mime-info)))
3056 `(#:test-target "test"
3058 (modify-phases %standard-phases
3059 (add-before 'check 'pre-check
3061 ;; Tests require a running X server.
3062 (system "Xvfb :1 &")
3063 (setenv "DISPLAY" ":1")
3064 (setenv "HOME" (getcwd))
3066 (add-after 'install 'wrap-program
3067 (lambda* (#:key inputs outputs #:allow-other-keys)
3068 (wrap-program (string-append (assoc-ref outputs "out")
3071 (,(string-append (assoc-ref inputs "maxima")
3073 ;; For GtkFileChooserDialog.
3074 `("GSETTINGS_SCHEMA_DIR" =
3075 (,(string-append (assoc-ref inputs "gtk+")
3076 "/share/glib-2.0/schemas")))
3077 `("XDG_DATA_DIRS" ":" prefix
3078 (;; Needed by gdk-pixbuf to know supported icon formats.
3080 (assoc-ref inputs "shared-mime-info") "/share")
3081 ;; The default icon theme of GTK+.
3083 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3085 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3086 (synopsis "Graphical user interface for the Maxima computer algebra system")
3088 "wxMaxima is a graphical user interface for the Maxima computer algebra
3089 system. It eases the use of Maxima by making most of its commands available
3090 through a menu system and by providing input dialogs for commands that require
3091 more than one argument. It also implements its own display engine that
3092 outputs mathematical symbols directly instead of depicting them with ASCII
3095 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3096 text and mathematical calculations to create documents, exporting of input and
3097 output to TeX, and a browser for Maxima's manual including command index and
3098 full text searching.")
3099 (license license:gpl2+)))
3101 (define-public armadillo
3107 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3111 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3112 (build-system cmake-build-system)
3113 (arguments `(#:tests? #f)) ; no test target
3115 `(("openblas" ,openblas)
3117 ("arpack" ,arpack-ng)))
3118 (home-page "http://arma.sourceforge.net/")
3119 (synopsis "C++ linear algebra library")
3121 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3122 between speed and ease of use. It is useful for algorithm development
3123 directly in C++, or quick conversion of research code into production
3124 environments. It can be used for machine learning, pattern recognition,
3125 signal processing, bioinformatics, statistics, econometrics, etc. The library
3126 provides efficient classes for vectors, matrices and cubes, as well as 150+
3127 associated functions (eg. contiguous and non-contiguous submatrix views).")
3128 (license license:asl2.0)))
3130 (define-public muparser
3131 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3132 ;; different hash. In order to make `guix package --upgrade` work correctly,
3133 ;; we set a Guix packaging revision.
3134 ;; When the next version of muparser is released, we can remove
3135 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3136 (let ((upstream-version "2.2.5")
3140 (version (string-append upstream-version "-" revision))
3145 (url "https://github.com/beltoforion/muparser.git")
3146 (commit (string-append "v" upstream-version))))
3147 (file-name (git-file-name name version))
3149 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3150 (build-system gnu-build-system)
3152 `(#:configure-flags '("--enable-samples=no")
3153 #:tests? #f)) ;no "check" target
3154 (home-page "http://muparser.beltoforion.de/")
3155 (synopsis "Fast parser library for mathematical expressions")
3157 "muParser is an extensible high performance math parser library. It is
3158 based on transforming an expression into a bytecode and precalculating constant
3160 (license license:expat))))
3162 (define-public openblas
3169 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3170 version "%20version.tar.gz"))
3171 (file-name (string-append name "-" version ".tar.gz"))
3174 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3175 (build-system gnu-build-system)
3177 `(#:test-target "test"
3178 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3179 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3180 ;; we need to disable substitutions.
3182 ,(let ((system (or (%current-target-system) (%current-system))))
3183 (or (string-prefix? "x86_64" system)
3184 (string-prefix? "i686" system)
3185 (string-prefix? "mips" system)
3186 (string-prefix? "aarch64" system)))
3188 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3190 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3192 ;; This is the maximum number of threads OpenBLAS will ever use (that
3193 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3194 ;; is used.) If we don't set it, the makefile sets it to the number
3195 ;; of cores of the build machine, which is obviously wrong.
3198 ;; Build the library for all supported CPUs. This allows
3199 ;; switching CPU targets at runtime with the environment variable
3200 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3201 ;; Unfortunately, this is not supported on non-x86 architectures,
3202 ;; where it leads to failed builds.
3203 ,@(let ((system (or (%current-target-system) (%current-system))))
3205 ((or (string-prefix? "x86_64" system)
3206 (string-prefix? "i686" system))
3207 '("DYNAMIC_ARCH=1"))
3208 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3209 ;; two available MIPS targets special extended instructions
3210 ;; for Loongson cores are used.
3211 ((string-prefix? "mips" system)
3212 '("TARGET=SICORTEX"))
3213 ;; On aarch64 force the generic 'armv8-a' target
3214 ((string-prefix? "aarch64" system)
3217 ;; no configure script
3219 (modify-phases %standard-phases
3221 (add-before 'build 'set-extralib
3222 (lambda* (#:key inputs #:allow-other-keys)
3223 ;; Get libgfortran found when building in utest.
3225 (string-append "-L" (assoc-ref inputs "fortran-lib")
3229 `(("fortran-lib" ,gfortran "lib")))
3232 ("fortran" ,gfortran)
3234 (home-page "https://www.openblas.net/")
3235 (synopsis "Optimized BLAS library based on GotoBLAS")
3237 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3238 (license license:bsd-3)))
3240 (define-public openblas-ilp64
3241 (package/inherit openblas
3242 (name "openblas-ilp64")
3243 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3245 (substitute-keyword-arguments (package-arguments openblas)
3246 ((#:make-flags flags '())
3247 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3249 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3250 (license license:bsd-3)))
3252 (define* (make-blis implementation #:optional substitutable?)
3253 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3254 source tree for a list of implementations.)
3256 SUBSTITUTABLE? determines whether the package is made available as a
3259 Currently the specialization must be selected at configure-time, but work is
3260 underway to allow BLIS to select the right optimized kernels at run time:
3261 <https://github.com/flame/blis/issues/129>."
3263 (name (if (string=? implementation "reference")
3265 (string-append "blis-" implementation)))
3267 (home-page "https://github.com/flame/blis")
3270 (uri (git-reference (url home-page) (commit version)))
3273 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3274 (file-name (git-file-name "blis" version))))
3275 (build-system gnu-build-system)
3277 `(#:test-target "test"
3279 #:substitutable? ,substitutable?
3281 #:phases (modify-phases %standard-phases
3283 (lambda* (#:key outputs #:allow-other-keys)
3284 ;; This is a home-made 'configure' script.
3285 (let ((out (assoc-ref outputs "out")))
3286 (invoke "./configure" "-p" out
3290 "--enable-threading=openmp"
3293 (add-before 'check 'show-test-output
3295 ;; By default "make check" is silent. Make it verbose.
3296 (system "tail -F output.testsuite &")
3298 (synopsis "High-performance basic linear algebra (BLAS) routines")
3300 "BLIS is a portable software framework for instantiating high-performance
3301 BLAS-like dense linear algebra libraries. The framework was designed to
3302 isolate essential kernels of computation that, when optimized, immediately
3303 enable optimized implementations of most of its commonly used and
3304 computationally intensive operations. While BLIS exports a new BLAS-like API,
3305 it also includes a BLAS compatibility layer which gives application developers
3306 access to BLIS implementations via traditional BLAS routine calls.")
3307 (license license:bsd-3)))
3310 ;; This is the "reference" implementation, which is the non-optimized but
3311 ;; portable variant (no assembly).
3312 (make-blis "reference" #t))
3314 (define ignorance blis)
3316 (define-syntax-rule (blis/x86_64 processor)
3317 "Expand to a package specialized for PROCESSOR."
3319 (inherit (make-blis processor))
3320 (supported-systems '("x86_64-linux"))))
3322 (define-public blis-sandybridge
3323 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3324 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3325 (blis/x86_64 "sandybridge"))
3327 (define-public blis-haswell
3328 ;; BLIS specialized for Haswell processors (launched 2013):
3329 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3330 (blis/x86_64 "haswell"))
3332 (define-public blis-knl
3333 ;; BLIS specialized for Knights Landing processor (launched 2016):
3334 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3335 (blis/x86_64 "knl"))
3338 (define-public openlibm
3346 (url "https://github.com/JuliaLang/openlibm.git")
3347 (commit (string-append "v" version))))
3348 (file-name (git-file-name name version))
3350 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3351 (build-system gnu-build-system)
3354 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3356 ;; no configure script
3357 (modify-phases %standard-phases (delete 'configure))
3358 #:tests? #f)) ;the tests are part of the default target
3359 (home-page "http://openlibm.org/")
3360 (synopsis "Portable C mathematical library (libm)")
3362 "OpenLibm is an effort to have a high quality, portable, standalone C
3363 mathematical library (libm). It can be used standalone in applications and
3364 programming language implementations. The project was born out of a need to
3365 have a good libm for the Julia programming language that worked consistently
3366 across compilers and operating systems, and in 32-bit and 64-bit
3368 ;; Each architecture has its own make target, and there is none for mips.
3369 (supported-systems (delete "mips64el-linux" %supported-systems))
3370 ;; See LICENSE.md for details.
3371 (license (list license:expat
3374 license:public-domain
3375 license:lgpl2.1+))))
3377 (define-public openspecfun
3379 (name "openspecfun")
3385 (url "https://github.com/JuliaLang/openspecfun.git")
3386 (commit (string-append "v" version))))
3387 (file-name (git-file-name name version))
3389 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3390 (build-system gnu-build-system)
3392 '(#:tests? #f ; no "check" target
3394 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3396 (modify-phases %standard-phases
3397 (delete 'configure)))) ; no configure script
3399 `(("fortran" ,gfortran)))
3400 (home-page "https://github.com/JuliaLang/openspecfun")
3401 (synopsis "Collection of special mathematical functions")
3403 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3404 portable package for Bessel Functions of a Complex Argument and Nonnegative
3405 Order; it contains subroutines for computing Bessel functions and Airy
3406 functions. Faddeeva allows computing the various error functions of arbitrary
3407 complex arguments (Faddeeva function, error function, complementary error
3408 function, scaled complementary error function, imaginary error function, and
3409 Dawson function); given these, one can also easily compute Voigt functions,
3410 Fresnel integrals, and similar related functions as well.")
3411 ;; Faddeeva is released under the Expat license; AMOS is included as
3412 ;; public domain software.
3413 (license (list license:expat license:public-domain))))
3415 (define-public suitesparse
3417 (name "suitesparse")
3423 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse.git")
3424 (commit (string-append "v" version))))
3425 (file-name (git-file-name name version))
3428 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3429 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3430 (modules '((guix build utils)))
3432 ;; Remove bundled metis source
3434 (delete-file-recursively "metis-5.1.0")
3436 (build-system gnu-build-system)
3438 '(#:tests? #f ;no "check" target
3443 "MY_METIS_LIB=-lmetis"
3444 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3445 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3446 (assoc-ref %outputs "out")
3447 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3448 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3449 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3450 " -DCMAKE_SKIP_RPATH=TRUE"
3451 " -DCMAKE_BUILD_TYPE=Release")
3452 (string-append "INSTALL_LIB="
3453 (assoc-ref %outputs "out") "/lib")
3454 (string-append "INSTALL_INCLUDE="
3455 (assoc-ref %outputs "out") "/include")
3458 (modify-phases %standard-phases
3459 (delete 'configure)))) ;no configure script
3465 `(("cmake" ,cmake-minimal)
3467 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3468 (synopsis "Suite of sparse matrix software")
3470 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3471 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3472 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3473 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3474 CXSparse, a concise sparse Cholesky factorization package; and many other
3477 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3479 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3480 (license (list license:gpl2+ license:lgpl2.1+))))
3482 (define-public atlas
3488 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3489 version "/atlas" version ".tar.bz2"))
3492 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3493 (build-system gnu-build-system)
3494 (home-page "http://math-atlas.sourceforge.net/")
3495 (inputs `(("gfortran" ,gfortran)
3496 ("lapack-tar" ,(package-source lapack))))
3497 (outputs '("out" "doc"))
3498 ;; For the moment we drop support for MIPS at it fails to compile. See
3499 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3500 (supported-systems (delete "mips64el-linux" %supported-systems))
3502 `(#:parallel-build? #f
3503 #:parallel-tests? #f
3505 ;; ATLAS tunes itself for the machine it is built on, as explained at
3506 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3507 ;; For this reason, we want users to build it locally instead of using
3511 #:modules ((srfi srfi-26)
3512 (guix build gnu-build-system)
3515 `(;; Generate position independent code suitable for dynamic libraries
3516 ;; and use WALL timer to get more accurate timing.
3517 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3520 ,,(if (string-match "64" (%current-system))
3523 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3524 ;; needed to compile C files before it is generated.
3525 "-Ss" "pmake" "make -j 1"
3526 ;; Probe is failing for MIPS. We therefore define the system
3527 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3528 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3529 ,,@(if (string-prefix? "mips" (%current-system))
3530 (list "-A" "49" "-V" "1")
3532 ;; Generate shared libraries.
3534 ;; Build a full LAPACK library.
3535 ,(string-append "--with-netlib-lapack-tarfile="
3536 (assoc-ref %build-inputs "lapack-tar")))
3538 (modify-phases %standard-phases
3539 (add-after 'install 'install-doc
3540 (lambda* (#:key outputs inputs #:allow-other-keys)
3541 (let ((doc (string-append (assoc-ref outputs "doc")
3542 "/share/doc/atlas")))
3544 (for-each (cut install-file <> doc)
3545 (find-files "../ATLAS/doc" ".*"))
3547 (add-after 'check 'check-pt
3548 (lambda _ (invoke "make" "ptcheck")))
3549 ;; Fix files required to run configure.
3550 (add-before 'configure 'fix-/bin/sh
3552 ;; Use `sh', not `/bin/sh'.
3553 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3557 ;; Fix /bin/sh in generated make files.
3558 (add-after 'configure 'fix-/bin/sh-in-generated-files
3560 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3564 ;; ATLAS configure program does not accepts the default flags
3565 ;; passed by the 'gnu-build-system'.
3567 (lambda* (#:key native-inputs inputs outputs
3568 (configure-flags '())
3569 #:allow-other-keys #:rest args)
3570 (let* ((prefix (assoc-ref outputs "out"))
3571 (bash (or (and=> (assoc-ref
3572 (or native-inputs inputs) "bash")
3573 (cut string-append <> "/bin/bash"))
3575 (flags `(,(string-append "--prefix=" prefix)
3577 (abs-srcdir (getcwd))
3578 (srcdir (string-append "../" (basename abs-srcdir))))
3579 (format #t "source directory: ~s (relative from build: ~s)~%"
3583 (format #t "build directory: ~s~%" (getcwd))
3584 (format #t "configure flags: ~s~%" flags)
3586 (string-append srcdir "/configure")
3588 (synopsis "Automatically Tuned Linear Algebra Software")
3590 "ATLAS is an automatically tuned linear algebra software library
3591 providing C and Fortran77 interfaces to a portably efficient BLAS
3592 implementation, as well as a few routines from LAPACK.
3594 Optimization occurs at build time. For this reason, the library is built on
3595 the machine where it is installed, without resorting to pre-built substitutes.
3597 Before building the library, CPU throttling should be disabled. This can be
3598 done in the BIOS, or, on GNU/Linux, with the following command:
3601 # cpupower --governor performance
3604 Failure to do so will result in a library with poor performance.")
3605 (license license:bsd-3)))
3614 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3615 version "/glm-" version ".zip"))
3617 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3618 (patches (search-patches "glm-restore-install-target.patch"))))
3619 (build-system cmake-build-system)
3621 `(("unzip" ,unzip)))
3622 (home-page "https://glm.g-truc.net/")
3623 (synopsis "OpenGL Mathematics library")
3624 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3625 library for graphics software based on the OpenGL Shading Language (GLSL)
3627 (license license:expat)))
3629 (define-public lpsolve
3636 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3637 "/lp_solve_" version "_source.tar.gz"))
3640 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3641 (modules '((guix build utils)))
3644 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3646 ;; Pretend to be on a 64 bit platform to obtain a common directory
3647 ;; name for the build results on all architectures; nothing else
3648 ;; seems to depend on it.
3649 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3651 ;; The check for 'isnan' as it is written fails with
3652 ;; "non-floating-point argument in call to function
3653 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3654 ;; definition, which in turn leads to bad things. Fix the feature
3656 (("isnan\\(0\\)") "isnan(0.)"))
3658 (build-system gnu-build-system)
3660 `(#:tests? #f ; no check target
3662 (modify-phases %standard-phases
3663 (delete 'configure) ; no configure script
3666 (with-directory-excursion "lpsolve55"
3667 (invoke "bash" "ccc"))
3668 (with-directory-excursion "lp_solve"
3669 (invoke "bash" "ccc"))
3672 (lambda* (#:key outputs #:allow-other-keys)
3673 (let* ((out (assoc-ref outputs "out"))
3674 (bin (string-append out "/bin"))
3675 (lib (string-append out "/lib"))
3676 ;; This is where LibreOffice expects to find the header
3677 ;; files, and where they are installed by Debian.
3678 (include (string-append out "/include/lpsolve")))
3679 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3680 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3681 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3683 ;; Install a subset of the header files as on Debian
3684 ;; (plus lp_bit.h, which matches the regular expression).
3685 (for-each (lambda (name)
3686 (install-file name include))
3687 (find-files "." "lp_[HMSa-z].*\\.h$"))
3688 (with-directory-excursion "shared"
3689 (for-each (lambda (name)
3690 (install-file name include))
3691 (find-files "." "\\.h$")))
3693 (home-page "http://lpsolve.sourceforge.net/")
3694 (synopsis "Mixed integer linear programming (MILP) solver")
3696 "lp_solve is a mixed integer linear programming solver based on the
3697 revised simplex and the branch-and-bound methods.")
3698 (license license:lgpl2.1+)))
3700 (define-public dealii
3707 (uri (string-append "https://github.com/dealii/dealii/releases/"
3708 "download/v" version "/dealii-" version ".tar.gz"))
3711 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3712 (modules '((guix build utils)))
3714 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3716 (delete-file-recursively "bundled")
3718 (build-system cmake-build-system)
3726 ("arpack" ,arpack-ng)
3727 ("muparser" ,muparser)
3728 ("gfortran" ,gfortran)
3729 ("suitesparse" ,suitesparse))) ;for UMFPACK
3731 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3733 ;; Work around a bug in libsuitesparseconfig linking
3734 ;; see https://github.com/dealii/dealii/issues/4745
3735 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3736 (home-page "https://www.dealii.org")
3737 (synopsis "Finite element library")
3739 "Deal.II is a C++ program library targeted at the computational solution
3740 of partial differential equations using adaptive finite elements. The main
3741 aim of deal.II is to enable rapid development of modern finite element codes,
3742 using among other aspects adaptive meshes and a wide array of tools often used
3743 in finite element programs.")
3744 (license license:lgpl2.1+)))
3746 (define-public dealii-openmpi
3747 (package (inherit dealii)
3748 (name "dealii-openmpi")
3751 ;;Supported only with MPI:
3752 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3753 ("p4est" ,p4est-openmpi)
3754 ("petsc" ,petsc-openmpi)
3755 ("slepc" ,slepc-openmpi)
3756 ("metis" ,metis) ;for MUMPS
3757 ("scalapack" ,scalapack) ;for MUMPS
3758 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3759 ("arpack" ,arpack-ng-openmpi)
3760 ,@(fold alist-delete (package-inputs dealii)
3761 '("p4est" "arpack"))))
3763 (substitute-keyword-arguments (package-arguments dealii)
3764 ((#:configure-flags cf)
3765 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3767 ((#:phases phases '%standard-phases)
3768 `(modify-phases ,phases
3769 (add-before 'check 'mpi-setup
3770 ,%openmpi-setup)))))
3771 (synopsis "Finite element library (with MPI support)")))
3773 (define-public flann
3782 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3783 version "-src.zip"))
3786 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3787 (patches (search-patches "flann-cmake-3.11.patch"))))
3788 (build-system cmake-build-system)
3790 "octave")) ;46 MiB .mex file that pulls Octave
3792 `(("unzip" ,unzip)))
3795 ("octave" ,octave-cli)
3796 ("python" ,python-2) ; print syntax
3797 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3800 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3801 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3802 #:strip-directories '("lib" "lib64" "libexec"
3803 "bin" "sbin" "share/flann/octave")
3805 ;; Save 12 MiB by not installing .a files. Passing
3806 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3807 #:phases (modify-phases %standard-phases
3808 (add-before 'configure 'set-octave-directory
3809 (lambda* (#:key outputs #:allow-other-keys)
3810 ;; Install the .mex file in the "octave" output.
3811 (let ((out (assoc-ref outputs "octave")))
3812 (substitute* "src/matlab/CMakeLists.txt"
3813 (("share/flann/octave")
3814 (string-append out "/share/flann/octave")))
3816 (add-after 'install 'remove-static-libraries
3817 (lambda* (#:key outputs #:allow-other-keys)
3818 (let* ((out (assoc-ref outputs "out"))
3819 (lib (string-append out "/lib")))
3820 (for-each delete-file
3821 (find-files lib "\\.a$"))
3824 #:tests? #f)) ; The test data are downloaded from the Internet.
3825 (home-page "http://www.cs.ubc.ca/research/flann/")
3826 (synopsis "Library for approximate nearest neighbors computation")
3827 (description "FLANN is a library for performing fast approximate
3828 nearest neighbor searches in high dimensional spaces. It implements a
3829 collection of algorithms and a system for automatically choosing the best
3830 algorithm and optimum parameters depending on the dataset.
3832 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3833 (license (license:non-copyleft "file://COPYING"
3834 "See COPYING in the distribution."))))
3836 (define-public wcalc
3843 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3844 "wcalc-" version ".tar.bz2"))
3847 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3848 (build-system gnu-build-system)
3851 ("readline" ,readline)))
3852 (home-page "http://w-calc.sourceforge.net/index.php")
3853 (synopsis "Flexible command-line scientific calculator")
3854 (description "Wcalc is a very capable calculator. It has standard functions
3855 (sin, asin, and sinh for example, in either radians or degrees), many
3856 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3857 variables, a command history, hex/octal/binary input and output, unit
3858 conversions, embedded comments, and an expandable expression entry field. It
3859 evaluates expressions using the standard order of operations.")
3860 (license license:gpl2+)))
3868 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3869 "/xaos-" version ".tar.gz"))
3872 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3873 (build-system gnu-build-system)
3874 (native-inputs `(("gettext" ,gettext-minimal)))
3875 (inputs `(("libx11" ,libx11)
3880 `(#:tests? #f ;no "check" target
3881 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3882 (synopsis "Real-time fractal zoomer")
3883 (description "GNU XaoS is a graphical program that generates fractal
3884 patterns and allows you to zoom in and out of them infinitely in a fluid,
3885 continuous manner. It also includes tutorials that help to explain how fractals
3886 are built. It can generate many different fractal types such as the Mandelbrot
3888 (home-page "https://www.gnu.org/software/xaos/")
3889 (license license:gpl2+)))
3891 (define-public hypre
3899 (url "https://github.com/LLNL/hypre.git")
3900 (commit (string-append "v" version))))
3901 (file-name (git-file-name name version))
3903 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3904 (modules '((guix build utils)))
3907 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3908 ;; substitute the release date.
3909 (substitute* "src/utilities/HYPRE_utilities.h"
3910 (("Date Compiled: .*$")
3911 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3913 (build-system gnu-build-system)
3914 (outputs '("out" ; 6.1 MiB of headers and libraries
3915 "doc")) ; 4.8 MiB of documentation
3919 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3920 ("texlive" ,(texlive-union (list texlive-xypic
3922 texlive-latex-hyperref
3924 ("ghostscript" ,ghostscript)))
3926 `(("blas" ,openblas)
3927 ("lapack" ,lapack)))
3929 `(#:modules ((srfi srfi-1)
3930 ,@%gnu-build-system-modules)
3931 #:configure-flags '("--enable-shared"
3939 (modify-phases %standard-phases
3940 (add-before 'build 'set-HOME
3942 ;; FIXME: texlive-union does not find the built
3943 ;; metafonts, so it tries to generate them in HOME.
3944 (setenv "HOME" "/tmp")
3946 (add-before 'configure 'chdir-src
3947 (lambda _ (chdir "src")))
3949 (lambda* (#:key build target configure-flags
3950 #:allow-other-keys #:rest args)
3951 (let* ((configure (assoc-ref %standard-phases 'configure)))
3954 (list #:configure-flags
3955 (cons (string-append
3956 "--host=" (or target build))
3957 configure-flags)))))))
3958 (add-after 'build 'build-docs
3960 (invoke "make" "-Cdocs" "pdf" "html")))
3963 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3964 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3965 (invoke "make" "check" "CHECKRUN=")
3966 (for-each (lambda (filename)
3967 (let ((size (stat:size (stat filename))))
3968 (when (positive? size)
3969 (error (format #f "~a size ~d; error indication~%"
3971 (find-files "test" ".*\\.err$"))
3973 (add-after 'install 'install-docs
3974 (lambda* (#:key outputs #:allow-other-keys)
3975 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3976 (let* ((doc (assoc-ref outputs "doc"))
3977 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3978 (with-directory-excursion "docs"
3979 (for-each (lambda (base)
3980 (install-file (string-append base ".pdf") docdir)
3981 (copy-recursively base docdir)) ; html docs
3982 '("HYPRE_usr_manual"
3983 "HYPRE_ref_manual")))
3985 (home-page "http://www.llnl.gov/casc/hypre/")
3986 (synopsis "Library of solvers and preconditioners for linear equations")
3988 "HYPRE is a software library of high performance preconditioners and
3989 solvers for the solution of large, sparse linear systems of equations. It
3990 features multigrid solvers for both structured and unstructured grid
3992 (license license:lgpl2.1)))
3994 (define-public hypre-openmpi
3995 (package (inherit hypre)
3996 (name "hypre-openmpi")
3999 ,@(package-inputs hypre)))
4001 (substitute-keyword-arguments (package-arguments hypre)
4002 ((#:configure-flags flags)
4004 ,@(delete "--without-MPI" ,flags)))
4006 `(modify-phases ,phases
4007 (add-before 'check 'mpi-setup
4008 ,%openmpi-setup)))))
4009 (synopsis "Parallel solvers and preconditioners for linear equations")
4011 "HYPRE is a software library of high performance preconditioners and
4012 solvers for the solution of large, sparse linear systems of equations on
4013 parallel computers. It features parallel multigrid solvers for both
4014 structured and unstructured grid problems.")))
4016 (define-public matio
4023 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4024 "matio-" version ".tar.gz"))
4027 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4028 (build-system gnu-build-system)
4032 (home-page "http://matio.sourceforge.net/")
4033 (synopsis "Library for reading and writing MAT files")
4034 (description "Matio is a library for reading and writing MAT files. It
4035 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4036 (license license:bsd-2)))
4043 (origin (method url-fetch)
4044 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4045 "download/" version "/Vc-" version ".tar.gz"))
4048 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4049 (build-system cmake-build-system)
4052 '("-DBUILD_TESTING=ON"
4053 ;; By default, Vc will optimize for the CPU of the build machine.
4054 ;; Setting this to "none" makes it create portable binaries. See
4055 ;; "cmake/OptimizeForArchitecture.cmake".
4056 "-DTARGET_ARCHITECTURE=none")
4057 #:phases (modify-phases %standard-phases
4058 (add-after 'unpack 'copy-testdata
4059 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4060 (let ((testdata (assoc-ref (or native-inputs inputs)
4062 (copy-recursively testdata "tests/testdata")
4065 `(("virtest" ,virtest)
4067 ;; This is a submodule in the git project, but not part of the
4068 ;; released sources. See the git branch for the commit to take.
4069 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4073 (url "https://github.com/VcDevel/vc-testdata")
4074 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4075 (file-name (git-file-name "vc-testdata"
4076 (string-take commit 7)))
4079 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4080 (synopsis "SIMD vector classes for C++")
4081 (description "Vc provides portable, zero-overhead C++ types for explicitly
4082 data-parallel programming. It is a library designed to ease explicit
4083 vectorization of C++ code. Its types enable explicitly stating data-parallel
4084 operations on multiple values. The parallelism is therefore added via the type
4085 system. Vc has an intuitive API and provides portability between different
4086 compilers and compiler versions as well as portability between different vector
4087 instruction sets. Thus, an application written with Vc can be compiled for:
4090 @item SSE2 up to SSE4.2 or SSE4a
4093 @item NEON (in development)
4094 @item NVIDIA GPUs / CUDA (in development)
4096 (home-page "https://github.com/VcDevel/Vc")
4097 ;; "No support_???.cpp file exists for this architecture."
4098 (supported-systems '("x86_64-linux" "i686-linux"))
4099 (license license:bsd-3)))
4101 (define-public reducelcs
4102 ;; This is the last commit which is available upstream, no
4103 ;; release happened since 2010.
4104 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4108 (version (string-append "1.0-" revision "." (string-take commit 7)))
4113 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4115 (file-name (string-append name "-" version "-checkout"))
4118 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4119 (build-system gnu-build-system)
4121 `(("openlibm" ,openlibm)))
4123 `(#:tests? #f ; no tests
4125 (modify-phases %standard-phases
4126 (delete 'configure) ; No configure script exists.
4127 (replace 'install ; No install phase exists.
4128 (lambda* (#:key outputs #:allow-other-keys)
4129 (let* ((out (assoc-ref outputs "out"))
4130 (bin (string-append out "/bin")))
4131 (install-file "Approximation" bin)
4132 (install-file "CollectResults" bin)
4133 (install-file "GenerateInstances" bin)
4135 (synopsis "Approximate Longest Commons Subsequence computation tool")
4137 "@code{reduceLCS} is an implementation of the Reduce-Expand
4138 algorithm for LCS. It is a fast program to compute the approximate
4139 Longest Commons Subsequence of a set of strings.")
4140 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4141 (license license:gpl3+))))
4143 (define-public jacal
4150 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4153 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4154 (patches (search-patches "jacal-fix-texinfo.patch"))))
4155 (build-system gnu-build-system)
4158 (modify-phases %standard-phases
4159 (add-before 'build 'pre-build
4160 ;; Don't use upstream's script - it really doesn't fit into
4161 ;; Guix's functional paradigm.
4162 (lambda* (#:key inputs outputs #:allow-other-keys)
4163 (substitute* "Makefile"
4164 (("^install: install-script") "install: "))))
4165 (add-after 'install 'post-install
4166 ;; Instead, we provide our own simplified script.
4167 (lambda* (#:key inputs outputs #:allow-other-keys)
4168 (let ((wrapper (string-append (assoc-ref outputs "out")
4170 (format (open wrapper (logior O_WRONLY O_CREAT))
4171 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4172 "-e '(slib:load \"~a/lib/jacal/math\") "
4175 (assoc-ref inputs "scm")
4176 (assoc-ref outputs "out"))
4177 (chmod wrapper #o555))))
4179 (lambda* (#:key outputs #:allow-other-keys)
4180 (invoke "./configure"
4181 (string-append "--prefix="
4182 (assoc-ref outputs "out"))))))))
4183 (inputs `(("scm" ,scm)))
4184 (native-inputs `(("unzip" ,unzip)
4185 ("texinfo" ,texinfo)))
4186 (synopsis "Symbolic mathematics system")
4187 (description "GNU JACAL is an interactive symbolic mathematics program based on
4188 Scheme. It manipulate and simplify a range of mathematical expressions such
4189 as equations, scalars, vectors, and matrices.")
4190 (home-page "https://www.gnu.org/software/jacal/")
4191 (license license:gpl3+)))
4197 (home-page "https://github.com/Z3Prover/z3")
4200 (uri (git-reference (url home-page)
4201 (commit (string-append "z3-" version))))
4202 (file-name (git-file-name name version))
4205 "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q"))))
4206 (build-system gnu-build-system)
4208 `(#:imported-modules ((guix build python-build-system)
4209 ,@%gnu-build-system-modules)
4210 #:modules (((guix build python-build-system) #:select (site-packages))
4211 (guix build gnu-build-system)
4214 (modify-phases %standard-phases
4215 (add-after 'unpack 'fix-compatability
4216 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4218 (substitute* "src/util/mpz.cpp"
4219 (("#include <immintrin.h>") ""))
4221 (add-before 'configure 'bootstrap
4223 (invoke "python" "scripts/mk_make.py")))
4224 ;; work around gnu-build-system's setting --enable-fast-install
4225 ;; (z3's `configure' is a wrapper around the above python file,
4226 ;; which fails when passed --enable-fast-install)
4228 (lambda* (#:key inputs outputs #:allow-other-keys)
4229 (invoke "./configure"
4231 (string-append "--prefix=" (assoc-ref outputs "out"))
4232 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4233 (add-after 'configure 'change-directory
4237 (add-before 'check 'make-test-z3
4239 ;; Build the test suite executable.
4240 (invoke "make" "test-z3" "-j"
4241 (number->string (parallel-job-count)))))
4244 ;; Run all the tests that don't require arguments.
4245 (invoke "./test-z3" "/a"))))))
4248 ("python" ,python-wrapper)))
4249 (synopsis "Theorem prover")
4250 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4251 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4252 (license license:expat)))
4257 (version "2018.11.001")
4260 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4261 version "/elpa-" version ".tar.gz"))
4264 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4265 (build-system gnu-build-system)
4267 `(("fortran" ,gfortran)
4268 ("perl" ,perl))) ;for configure and deps
4270 `(("blas" ,openblas)))
4275 ;; ELPA unfortunately does not support runtime dispatch, so we can
4276 ;; only enable the "generic" kernels. See the "Cross compilation"
4277 ;; section of INSTALL.md.
4279 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4280 "--disable-avx" "--disable-avx2" "--disable-avx512"
4281 ,(string-append "CFLAGS=-O3 "
4282 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4283 "-ftree-vect-loop-version -ftree-vectorize "
4284 ,(let ((system (or (%current-target-system)
4285 (%current-system))))
4287 ((or (string-prefix? "x86_64" system)
4288 (string-prefix? "i686" system))
4291 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4293 (modify-phases %standard-phases
4294 (add-before 'configure 'patch-header-generation
4296 (substitute* "configure"
4297 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4298 (string-append & " CPP=\"$CPP\"")))
4300 (add-before 'check 'setup-tests
4302 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4303 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4304 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4305 ;; for Fortran. This also causes several tests to pass that
4306 ;; otherwise would otherwise fail with matrix size 5000; possibly
4307 ;; due to floating point tolerances that are too tight.
4308 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4309 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4310 (substitute* "Makefile"
4311 ;; Test scripts are generated, patch the shebang
4312 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4314 (home-page "http://elpa.mpcdf.mpg.de")
4315 (synopsis "Eigenvalue solvers for symmetric matrices")
4317 "The ELPA library provides efficient and scalable direct eigensolvers for
4318 symmetric matrices.")
4319 (license license:lgpl3)))
4321 (define-public elpa-openmpi
4322 (package (inherit elpa)
4323 (name "elpa-openmpi")
4326 ("scalapack" ,scalapack)
4327 ,@(package-inputs elpa)))
4329 (substitute-keyword-arguments (package-arguments elpa)
4330 ((#:configure-flags cf '())
4331 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4332 ((#:phases phases '%standard-phases)
4333 `(modify-phases ,phases
4334 (add-before 'check 'mpi-setup
4336 ;; Tests use 2 mpi tasks by default, use our remaining build
4337 ;; cores as OpenMP threads.
4338 (setenv "OMP_NUM_THREADS" (number->string
4339 (max (quotient (parallel-job-count) 2)
4341 (,%openmpi-setup)))))))
4342 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4344 (define-public elemental
4351 (url "https://github.com/elemental/Elemental.git")
4352 (commit (string-append "v" version))))
4353 (file-name (git-file-name name version))
4356 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4357 (build-system cmake-build-system)
4358 (home-page "https://github.com/elemental/Elemental")
4360 `(("gfortran" ,gfortran)))
4362 `(("blas" ,openblas)
4363 ("gfortran:lib" ,gfortran "lib")
4372 `(#:build-type "Release" ;default RelWithDebInfo not supported
4373 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4374 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4375 "-DEL_CACHE_WARNINGS:BOOL=YES"
4376 "-DEL_TESTS:BOOL=YES"
4377 "-DCMAKE_INSTALL_LIBDIR=lib"
4378 "-DGFORTRAN_LIB=gfortran")
4379 #:phases (modify-phases %standard-phases
4380 (add-before 'check 'mpi-setup
4382 (add-before 'check 'setup-tests
4384 ;; Parallelism is done at the MPI layer.
4385 (setenv "OMP_NUM_THREADS" "1")
4387 (add-after 'install 'remove-tests
4388 (lambda* (#:key outputs #:allow-other-keys)
4389 ;; Tests are installed, with no easy configuration
4390 ;; switch to prevent this, so delete them.
4391 (delete-file-recursively
4392 (string-append (assoc-ref outputs "out") "/bin"))
4394 (synopsis "Dense and sparse-direct linear algebra and optimization")
4395 (description "Elemental is a modern C++ library for distributed-memory
4396 dense and sparse-direct linear algebra, conic optimization, and lattice
4398 (license license:bsd-2)))
4400 (define-public mcrl2
4403 (version "201908.0")
4407 "https://www.mcrl2.org/download/release/mcrl2-"
4411 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4416 ("qtbase" ,qtbase)))
4417 (build-system cmake-build-system)
4418 (synopsis "Toolset for the mCRL2 formal specification language")
4420 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4421 specification language for describing concurrent discrete event systems. Its
4422 toolset supports analysis and automatic verification, linearisation, simulation,
4423 state-space exploration and generation, and tools to optimise and analyse
4424 specifications. Also, state spaces can be manipulated, visualised and
4426 (home-page "https://mcrl2.org")
4427 (license license:boost1.0)))
4429 (define-public mcrl2-minimal
4432 (name "mcrl2-minimal")
4434 `(("boost" ,boost)))
4436 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4438 (define-public tcalc
4445 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4449 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4450 (build-system gnu-build-system)
4451 (synopsis "The terminal calculator")
4453 "The terminal calculator is a small program to help users of the GNU/Linux
4454 terminal do calculations simply and quickly. The formula to be calculated can
4455 be fed to @command{tcalc} through the command line.")
4456 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4457 (license license:gpl3+)))
4459 (define-public sundials
4466 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4467 "sundials-" version ".tar.gz"))
4470 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4471 (build-system cmake-build-system)
4473 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4475 `(("fortran" ,gfortran) ;for fcmix
4477 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4479 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4480 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4481 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4482 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4483 "-DEXAMPLES_INSTALL:BOOL=OFF"
4485 "-DFCMIX_ENABLE:BOOL=ON"
4487 "-DKLU_ENABLE:BOOL=ON"
4488 ,(string-append "-DKLU_INCLUDE_DIR="
4489 (assoc-ref %build-inputs "suitesparse")
4491 ,(string-append "-DKLU_LIBRARY_DIR="
4492 (assoc-ref %build-inputs "suitesparse")
4494 (home-page "https://computation.llnl.gov/projects/sundials")
4495 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4496 (description "SUNDIALS is a family of software packages implemented with
4497 the goal of providing robust time integrators and nonlinear solvers that can
4498 easily be incorporated into existing simulation codes.")
4499 (license license:bsd-3)))
4501 (define-public sundials-openmpi
4502 (package (inherit sundials)
4503 (name "sundials-openmpi")
4506 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4507 ,@(package-inputs sundials)))
4509 (substitute-keyword-arguments (package-arguments sundials)
4510 ((#:configure-flags flags '())
4511 `(cons* "-DMPI_ENABLE:BOOL=ON"
4512 "-DPETSC_ENABLE:BOOL=ON"
4513 (string-append "-DPETSC_INCLUDE_DIR="
4514 (assoc-ref %build-inputs "petsc")
4516 (string-append "-DPETSC_LIBRARY_DIR="
4517 (assoc-ref %build-inputs "petsc")
4520 ((#:phases phases '%standard-phases)
4521 `(modify-phases ,phases
4522 (add-before 'check 'mpi-setup
4523 ,%openmpi-setup)))))
4524 (synopsis "SUNDIALS with OpenMPI support")))
4526 (define-public combinatorial-blas
4528 (name "combinatorial-blas")
4533 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4535 (match (string-split version #\.)
4536 ((major minor patch)
4537 (string-append major minor "_" patch))) ;e.g. "16_2"
4541 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4542 (patches (search-patches "combinatorial-blas-awpm.patch"
4543 "combinatorial-blas-io-fix.patch"))))
4544 (build-system cmake-build-system)
4547 ("test-data" ,(origin
4549 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4550 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4553 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4555 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4556 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4557 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4559 (modify-phases %standard-phases
4560 (add-before 'check 'mpi-setup
4562 (add-before 'check 'test-setup
4563 (lambda* (#:key inputs #:allow-other-keys)
4564 (setenv "OMP_NUM_THREADS" "2")
4565 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4566 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4567 (synopsis "Linear algebra primitives for graph analytics")
4568 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4569 distributed-memory parallel graph library offering a small but powerful set of
4570 linear algebra primitives specifically targeting graph analytics.")
4572 license:gpl2+ ;include/psort/(funnel|sort)*.h
4573 license:x11 ;usort and psort
4574 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4576 (define-public dune-common
4578 (name "dune-common")
4583 (uri (string-append "https://dune-project.org/download/"
4584 version "/dune-common-" version ".tar.gz"))
4587 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4588 (build-system cmake-build-system)
4591 (modify-phases %standard-phases
4592 (add-after 'build 'build-tests
4593 (lambda* (#:key make-flags #:allow-other-keys)
4594 (apply invoke "make" "build_tests" make-flags)))
4595 (add-before 'check 'mpi-setup
4600 ("openmpi" ,openmpi)
4601 ("openblas" ,openblas)
4603 ("superlu" ,superlu)))
4605 `(("gfortran" ,gfortran)
4606 ("pkg-config" ,pkg-config)))
4607 (home-page "https://dune-project.org/")
4608 (synopsis "Distributed and Unified Numerics Environment")
4609 (description "DUNE, the Distributed and Unified Numerics Environment is a
4610 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4611 grid-based methods. It supports the easy implementation of methods like
4612 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4613 Differences} (FD).")
4614 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4615 (license license:gpl2)))
4617 (define-public dune-geometry
4619 (name "dune-geometry")
4624 (uri (string-append "https://dune-project.org/download/"
4625 version "/dune-geometry-" version ".tar.gz"))
4628 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4629 (build-system cmake-build-system)
4632 (modify-phases %standard-phases
4633 (add-after 'build 'build-tests
4634 (lambda* (#:key make-flags #:allow-other-keys)
4635 (apply invoke "make" "build_tests" make-flags))))))
4637 `(("dune-common" ,dune-common)
4638 ("openmpi" ,openmpi)
4640 ("openblas" ,openblas)
4642 ("python" ,python)))
4644 `(("gfortran" ,gfortran)
4645 ("pkg-config" ,pkg-config)))
4646 (home-page "https://dune-project.org/")
4647 (synopsis "Distributed and Unified Numerics Environment")
4648 (description "DUNE, the Distributed and Unified Numerics Environment is a
4649 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4650 grid-based methods. It supports the easy implementation of methods like
4651 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4654 This package contains the basic DUNE geometry classes.")
4655 ;; GPL version 2 with "runtime exception"
4656 (license license:gpl2)))
4658 (define-public dune-uggrid
4660 (name "dune-uggrid")
4665 (uri (string-append "https://dune-project.org/download/"
4666 version "/dune-uggrid-" version ".tar.gz"))
4669 "05l7a1gb78mny49anyxk6rjvn66rhgm30y72v5cjg0m5kfgr1a1f"))))
4670 (build-system cmake-build-system)
4673 (modify-phases %standard-phases
4674 (add-after 'build 'build-tests
4675 (lambda* (#:key make-flags #:allow-other-keys)
4676 (apply invoke "make" "build_tests" make-flags))))))
4678 `(("dune-common" ,dune-common)
4679 ("openmpi" ,openmpi)))
4681 `(("gfortran" ,gfortran)
4682 ("pkg-config" ,pkg-config)))
4683 (home-page "https://dune-project.org/")
4684 (synopsis "Distributed and Unified Numerics Environment")
4685 (description "DUNE, the Distributed and Unified Numerics Environment is a
4686 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4687 grid-based methods. It supports the easy implementation of methods like
4688 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4691 This package contains the DUNE UG grid classes.")
4692 (license license:lgpl2.1)))
4694 (define-public dune-grid
4701 (uri (string-append "https://dune-project.org/download/"
4702 version "/dune-grid-" version ".tar.gz"))
4705 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4706 (build-system cmake-build-system)
4709 (modify-phases %standard-phases
4710 (add-after 'build 'build-tests
4711 (lambda* (#:key make-flags #:allow-other-keys)
4712 (apply invoke "make" "build_tests" make-flags)))
4713 (add-before 'check 'mpi-setup
4716 `(("dune-common" ,dune-common)
4717 ("dune-geometry" ,dune-geometry)
4720 ("openblas" ,openblas)
4721 ("openmpi" ,openmpi)
4722 ("python" ,python)))
4724 `(("dune-uggrid" ,dune-uggrid)))
4726 `(("gfortran" ,gfortran)
4727 ("pkg-config" ,pkg-config)))
4728 (home-page "https://dune-project.org/")
4729 (synopsis "Distributed and Unified Numerics Environment")
4730 (description "DUNE, the Distributed and Unified Numerics Environment is a
4731 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4732 grid-based methods. It supports the easy implementation of methods like
4733 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4736 This package contains the basic DUNE grid classes.")
4737 ;; GPL version 2 with "runtime exception"
4738 (license license:gpl2)))
4740 (define-public dune-istl
4747 (uri (string-append "https://dune-project.org/download/"
4748 version "/dune-istl-" version ".tar.gz"))
4751 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4752 (build-system cmake-build-system)
4755 (modify-phases %standard-phases
4756 (add-after 'build 'build-tests
4757 (lambda* (#:key make-flags #:allow-other-keys)
4758 (apply invoke "make" "build_tests" make-flags)))
4759 (add-before 'check 'mpi-setup
4762 `(("dune-common" ,dune-common)
4763 ("openmpi" ,openmpi)
4766 ("suitesparse" ,suitesparse)
4767 ("superlu" ,superlu)
4768 ("openblas" ,openblas)
4770 ("python" ,python)))
4772 `(("gfortran" ,gfortran)
4773 ("pkg-config" ,pkg-config)))
4774 (home-page "https://dune-project.org/")
4775 (synopsis "Distributed and Unified Numerics Environment")
4776 (description "DUNE, the Distributed and Unified Numerics Environment is a
4777 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4780 This is the iterative solver template library which provides generic sparse
4781 matrix/vector classes and a variety of solvers based on these classes. A
4782 special feature is the use of templates to exploit the recursive block
4783 structure of finite element matrices at compile time. Available solvers
4784 include Krylov methods, (block-) incomplete decompositions and
4785 aggregation-based algebraic multigrid.")
4786 ;; GPL version 2 with "runtime exception"
4787 (license license:gpl2)))
4789 (define-public dune-localfunctions
4791 (name "dune-localfunctions")
4796 (uri (string-append "https://dune-project.org/download/"
4797 version "/dune-localfunctions-" version ".tar.gz"))
4800 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4801 (build-system cmake-build-system)
4804 (modify-phases %standard-phases
4805 (add-after 'build 'build-tests
4806 (lambda* (#:key make-flags #:allow-other-keys)
4807 (apply invoke "make" "build_tests" make-flags))))))
4809 `(("dune-common" ,dune-common)
4810 ("dune-geometry" ,dune-geometry)
4811 ("openmpi" ,openmpi)
4814 ("superlu" ,superlu)
4817 `(("gfortran" ,gfortran)
4818 ("pkg-config" ,pkg-config)))
4819 (home-page "https://dune-project.org/")
4820 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4821 (description "This DUNE module provides interface and implementation for
4822 shape functions defined on the DUNE reference elements. In addition to the
4823 shape function, interpolation operators and special keys are provided which
4824 can be used to assemble global function spaces on finite-element grids.
4826 This package provides an interface and implementation for shape functions
4827 defined on the DUNE reference elements. In addition to the shape function,
4828 interpolation operators and special keys are provided which can be used to
4829 assemble global function spaces on finite-element grids.")
4830 ;; GPL version 2 with "runtime exception"
4831 (license license:gpl2)))
4833 (define-public dune-alugrid
4835 (name "dune-alugrid")
4840 (uri (string-append "https://dune-project.org/download/"
4841 version "/dune-alugrid-" version ".tar.gz"))
4844 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4845 (build-system cmake-build-system)
4848 (modify-phases %standard-phases
4849 (add-after 'unpack 'patch-include
4851 (substitute* "dune/alugrid/test/test-alugrid.cc"
4852 (("doc/grids/gridfactory/testgrids")
4853 "doc/dune-grid/grids/gridfactory/testgrids"))
4855 (add-after 'build 'build-tests
4856 (lambda* (#:key inputs make-flags #:allow-other-keys)
4857 (setenv "CPLUS_INCLUDE_PATH"
4858 (string-append (assoc-ref inputs "dune-grid") "/share"))
4859 (apply invoke "make" "build_tests" make-flags)))
4860 (add-before 'check 'mpi-setup
4863 `(("dune-common" ,dune-common)
4864 ("dune-geometry" ,dune-geometry)
4865 ("dune-grid" ,dune-grid)
4866 ("openmpi" ,openmpi)
4869 ("openblas" ,openblas)
4871 ("superlu" ,superlu)
4875 `(("gfortran" ,gfortran)
4876 ("pkg-config" ,pkg-config)))
4877 (home-page "https://dune-project.org/")
4878 (synopsis "Distributed and Unified Numerics Environment")
4879 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4880 implementation of the DUNE grid interface supporting either simplices or
4882 (license license:gpl2+)))
4884 (define-public dune-subgrid
4886 (name "dune-subgrid")
4892 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
4893 (commit "releases/2.6-1")))
4894 (file-name (git-file-name name version))
4897 "1gcv35rx3knqd54r4pp9rzd639db4j8w2r2ibq43w1mgwdcqhs64"))))
4898 (build-system cmake-build-system)
4901 (modify-phases %standard-phases
4902 (add-after 'build 'build-tests
4903 (lambda* (#:key make-flags #:allow-other-keys)
4904 (apply invoke "make" "build_tests" make-flags)))
4905 (add-before 'check 'mpi-setup
4908 `(("dune-common" ,dune-common)
4909 ("dune-geometry" ,dune-geometry)
4910 ("dune-grid" ,dune-grid)
4911 ("openmpi" ,openmpi)
4914 ("openblas" ,openblas)
4917 `(("gfortran" ,gfortran)
4918 ("pkg-config" ,pkg-config)))
4919 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
4920 (synopsis "Distributed and Unified Numerics Environment")
4921 (description "The dune-subgrid module allows to mark elements of
4922 another hierarchical dune grid. The set of marked elements can then be
4923 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
4924 provides the full grid interface including adaptive mesh refinement.")
4925 (license license:gpl2+)))
4927 (define-public dune-typetree
4929 (name "dune-typetree")
4935 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4936 (commit (string-append "v" version))))
4937 (file-name (git-file-name name version))
4940 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4941 (build-system cmake-build-system)
4944 (modify-phases %standard-phases
4945 (add-after 'build 'build-tests
4946 (lambda* (#:key make-flags #:allow-other-keys)
4947 (apply invoke "make" "build_tests" make-flags))))))
4949 `(("dune-common" ,dune-common)
4950 ("openmpi" ,openmpi)
4952 ("openblas" ,openblas)
4955 ("superlu" ,superlu)
4958 `(("gfortran" ,gfortran)
4959 ("pkg-config" ,pkg-config)))
4960 (home-page "https://dune-project.org/")
4961 (synopsis "Distributed and Unified Numerics Environment")
4962 (description "TypeTree is a template library for constructing and
4963 operating on statically typed trees of objects.")
4964 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4965 (license (list license:lgpl3+ license:gpl2))))
4967 (define-public dune-functions
4969 (name "dune-functions")
4975 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4976 (commit (string-append "v" version))))
4977 (file-name (git-file-name name version))
4980 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4981 (build-system cmake-build-system)
4984 (modify-phases %standard-phases
4985 (add-after 'unpack 'disable-failing-tests
4988 ;; unable to load GMSH file in this test
4989 "--exclude-regex gridviewfunctionspacebasistest")
4991 (add-after 'build 'build-tests
4992 (lambda* (#:key make-flags #:allow-other-keys)
4993 (apply invoke "make" "build_tests" make-flags)))
4994 (add-before 'check 'mpi-setup
4997 `(("dune-common" ,dune-common)
4998 ("dune-istl" ,dune-istl)
4999 ("dune-localfunctions" ,dune-localfunctions)
5000 ("dune-grid" ,dune-grid)
5001 ("dune-geometry" ,dune-geometry)
5002 ("dune-typetree" ,dune-typetree)
5003 ("openmpi" ,openmpi)
5004 ("openblas" ,openblas)
5007 ("superlu" ,superlu)
5010 `(("gfortran" ,gfortran)
5011 ("pkg-config" ,pkg-config)))
5012 (home-page "https://dune-project.org/")
5013 (synopsis "Distributed and Unified Numerics Environment")
5014 (description "The dune-functions module provides an abstraction layer for
5015 global finite element functions. Its two main concepts are functions
5016 implemented as callable objects, and bases of finite element spaces.")
5017 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5018 (license (list license:lgpl3+ license:gpl2))))
5020 (define-public dune-pdelab
5022 (name "dune-pdelab")
5023 (version "2.6.0-rc1")
5028 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5029 (commit (string-append "v" version))))
5030 (file-name (git-file-name name version))
5033 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
5034 (build-system cmake-build-system)
5035 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5037 `(("dune-common" ,dune-common)
5038 ("dune-istl" ,dune-istl)
5039 ("dune-localfunctions" ,dune-localfunctions)
5040 ("dune-geometry" ,dune-geometry)
5041 ("dune-grid" ,dune-grid)
5042 ("dune-typetree" ,dune-typetree)
5043 ("dune-functions" ,dune-functions)
5044 ("openmpi" ,openmpi)
5046 ("openblas" ,openblas)
5050 ("superlu" ,superlu)
5053 `(("gfortran" ,gfortran)
5054 ("pkg-config" ,pkg-config)))
5055 (home-page "https://dune-project.org/")
5056 (synopsis "Differential equations solver toolbox")
5057 (description "PDELab is a partial differential equations solver toolbox
5058 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5059 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5060 (license (list license:lgpl3+ license:gpl2))))
5062 (define-public mlucas
5070 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5072 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5073 (build-system gnu-build-system)
5075 `(("python2" ,python-2)))
5077 `(#:tests? #f ; no tests
5079 (modify-phases %standard-phases
5083 (call-with-output-file "Makefile"
5085 (format port "CC = gcc
5086 CFLAGS = -O3 ~a -DUSE_THREADS
5087 LDLIBS = -lm -lpthread -lrt
5088 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5090 ,(let ((system (or (%current-target-system)
5091 (%current-system))))
5093 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5097 (lambda* (#:key outputs #:allow-other-keys)
5098 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5099 (install-file "Mlucas" bin)
5100 (install-file "primenet.py" bin))
5102 (home-page "https://www.mersenne.org")
5103 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5104 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5105 numbers in search of a world-record prime. You may use it to test any
5106 suitable number as you wish, but it is preferable that you do so in a
5107 coordinated fashion, as part of the Great Internet Mersenne Prime
5108 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5109 management via the GIMPS project's Primenet server.")
5110 (license license:gpl2+)))
5112 (define-public nauty
5119 "https://pallini.di.uniroma1.it/"
5120 "nauty" (string-join (string-split version #\.) "")
5124 "1p4mxf8q5wm47nxyskxbqwa5p1vvkycv1zgswvnk9nsn6vff0al6"))))
5125 (build-system gnu-build-system)
5126 (outputs '("out" "lib"))
5128 `(#:test-target "checks"
5130 (modify-phases %standard-phases
5131 ;; Default make target does not build all available
5132 ;; executables. Create them now.
5133 (add-after 'build 'build-extra-programs
5135 (for-each (lambda (target) (invoke "make" target))
5136 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5138 ;; Upstream does not provide any install target.
5140 (lambda* (#:key outputs #:allow-other-keys)
5141 (let* ((out (assoc-ref outputs "out"))
5142 (lib-output (assoc-ref outputs "lib"))
5143 (bin (string-append out "/bin"))
5144 (doc (string-append out "/share/doc/nauty/"))
5145 (include (string-append lib-output "/include/nauty"))
5146 (lib (string-append lib-output "/lib/nauty")))
5147 (for-each (lambda (f) (install-file f bin))
5148 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5149 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5150 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5151 "delptg" "directg" "dretodot" "dretog" "genbg"
5152 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5153 "gentourng" "gentreeg" "hamheuristic" "labelg"
5154 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5155 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5156 "sumlines" "twohamg" "vcolg" "watercluster2"))
5157 (for-each (lambda (f) (install-file f include))
5158 (find-files "." "\\.h$"))
5159 (for-each (lambda (f) (install-file f lib))
5160 (find-files "." "\\.a$"))
5161 (for-each (lambda (f) (install-file f doc))
5162 (append '("formats.txt" "README" "schreier.txt")
5163 (find-files "." "\\.pdf$")))))))))
5165 `(("gmp" ,gmp))) ;for sumlines
5166 (home-page "https://pallini.di.uniroma1.it/")
5167 (synopsis "Library for graph automorphisms")
5168 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5169 procedures for computing automorphism groups of graphs and digraphs.
5171 @code{nauty} computes graph information in the form of a set of
5172 generators, the size of the group, and the orbits of the group; it can
5173 also produce a canonical label. The @code{nauty} suite is written in
5174 C and comes with a command-line interface, a collection of
5175 command-line tools, and an Application Programming Interface (API).
5177 This package provides the static libraries required to run programs
5178 compiled against the nauty library.")
5179 (license license:asl2.0)))
5188 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5189 "ftp/releases/" version
5190 "/ppl-" version ".tar.gz"))
5193 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5194 (build-system gnu-build-system)
5200 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5202 "Parma Polyhedra Library for computations with polyhedra")
5204 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5205 especially targeted at applications in the field of analysis and
5206 verification of complex systems. These abstractions include convex
5207 polyhedra, defined as the intersection of a finite number of (open or
5208 closed) halfspaces, each described by a linear inequality (strict or
5209 non-strict) with rational coefficients; some special classes of polyhedra
5210 shapes that offer interesting complexity/precision tradeoffs; and grids
5211 which represent regularly spaced points that satisfy a set of linear
5212 congruence relations. The library also supports finite powersets and
5213 products of (any kind of) polyhedra and grids, a mixed integer linear
5214 programming problem solver using an exact-arithmetic version of the simplex
5215 algorithm, a parametric integer programming solver, and primitives for
5216 termination analysis via the automatic synthesis of linear ranking
5218 (license license:gpl3+)))
5220 (define-public speedcrunch
5222 (name "speedcrunch")
5228 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5229 (commit (string-append "release-" version))))
5230 (file-name (git-file-name name version))
5233 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5234 (build-system cmake-build-system)
5235 (inputs `(("qtbase" ,qtbase)))
5236 (native-inputs `(("qttools" ,qttools)))
5239 (modify-phases %standard-phases
5240 (add-after 'unpack 'chdir-to-src
5241 (lambda _ (chdir "src") #t)))))
5242 (synopsis "High-precision scientific calculator")
5244 "SpeedCrunch is a high-precision scientific calculator. It features a
5245 syntax-highlighted scrollable display and is designed to be fully used via
5246 keyboard. Some distinctive features are auto-completion of functions and
5247 variables, a formula book, and quick insertion of constants from various
5248 fields of knowledge.")
5249 (home-page "https://speedcrunch.org/")
5250 (license license:gpl2+)))
5252 (define-public minisat
5253 ;; This is the last commit which is available upstream, no
5254 ;; release happened since 2010.
5255 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5259 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5264 (url "https://github.com/niklasso/minisat.git")
5266 (file-name (string-append name "-" version "-checkout"))
5269 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5271 (search-patches "minisat-friend-declaration.patch"
5272 "minisat-install.patch"))))
5273 (build-system gnu-build-system)
5275 '(#:make-flags (list (string-append "prefix=" %output))
5276 #:tests? #f ;no check target
5278 (modify-phases %standard-phases
5279 (delete 'configure))))
5281 `(("zlib:static" ,zlib "static")
5284 "Small, yet efficient, SAT solver")
5286 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5287 researchers and developers alike to get started on SAT.")
5289 "http://minisat.se/MiniSat.html")
5290 (license license:expat))))