1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 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 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>
37 ;;; This file is part of GNU Guix.
39 ;;; GNU Guix is free software; you can redistribute it and/or modify it
40 ;;; under the terms of the GNU General Public License as published by
41 ;;; the Free Software Foundation; either version 3 of the License, or (at
42 ;;; your option) any later version.
44 ;;; GNU Guix is distributed in the hope that it will be useful, but
45 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
46 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 ;;; GNU General Public License for more details.
49 ;;; You should have received a copy of the GNU General Public License
50 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
52 (define-module (gnu packages maths)
53 #:use-module (ice-9 regex)
54 #:use-module (ice-9 match)
55 #:use-module (gnu packages)
56 #:use-module ((guix licenses) #:prefix license:)
57 #:use-module (guix packages)
58 #:use-module (guix download)
59 #:use-module (guix git-download)
60 #:use-module (guix utils)
61 #:use-module ((guix build utils) #:select (alist-replace))
62 #:use-module (guix build-system cmake)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system python)
65 #:use-module (guix build-system ruby)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages bison)
71 #:use-module (gnu packages boost)
72 #:use-module (gnu packages check)
73 #:use-module (gnu packages cmake)
74 #:use-module (gnu packages compression)
75 #:use-module (gnu packages curl)
76 #:use-module (gnu packages cyrus-sasl)
77 #:use-module (gnu packages dbm)
78 #:use-module (gnu packages documentation)
79 #:use-module (gnu packages elf)
80 #:use-module (gnu packages flex)
81 #:use-module (gnu packages fltk)
82 #:use-module (gnu packages fontutils)
83 #:use-module (gnu packages gettext)
84 #:use-module (gnu packages gcc)
85 #:use-module (gnu packages gd)
86 #:use-module (gnu packages ghostscript)
87 #:use-module (gnu packages graphviz)
88 #:use-module (gnu packages gtk)
89 #:use-module (gnu packages image)
90 #:use-module (gnu packages java)
91 #:use-module (gnu packages less)
92 #:use-module (gnu packages lisp)
93 #:use-module (gnu packages linux)
94 #:use-module (gnu packages logging)
95 #:use-module (gnu packages lua)
96 #:use-module (gnu packages gnome)
97 #:use-module (gnu packages guile)
98 #:use-module (gnu packages xorg)
99 #:use-module (gnu packages gl)
100 #:use-module (gnu packages imagemagick)
101 #:use-module (gnu packages m4)
102 #:use-module (gnu packages mpi)
103 #:use-module (gnu packages multiprecision)
104 #:use-module (gnu packages netpbm)
105 #:use-module (gnu packages onc-rpc)
106 #:use-module (gnu packages pcre)
107 #:use-module (gnu packages popt)
108 #:use-module (gnu packages perl)
109 #:use-module (gnu packages pkg-config)
110 #:use-module (gnu packages pulseaudio)
111 #:use-module (gnu packages python)
112 #:use-module (gnu packages python-web)
113 #:use-module (gnu packages python-xyz)
114 #:use-module (gnu packages qt)
115 #:use-module (gnu packages readline)
116 #:use-module (gnu packages ruby)
117 #:use-module (gnu packages tbb)
118 #:use-module (gnu packages scheme)
119 #:use-module (gnu packages shells)
120 #:use-module (gnu packages tcl)
121 #:use-module (gnu packages texinfo)
122 #:use-module (gnu packages tex)
123 #:use-module (gnu packages tls)
124 #:use-module (gnu packages version-control)
125 #:use-module (gnu packages wxwidgets)
126 #:use-module (gnu packages xml)
127 #:use-module (srfi srfi-1))
135 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
137 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
138 (build-system gnu-build-system)
139 (inputs `(("gtk+" ,gtk+)
140 ("libxml2" ,libxml2)))
141 (native-inputs `(("pkg-config" ,pkg-config)))
142 (synopsis "Natural deduction first-order logic interface")
143 (description "Aris is a program for performing logical proofs. It supports
144 propositional and predicate logic, as well as Boolean algebra and
145 arithmetical logic. In addition to its predefined inference and equivalence
146 rules, Aris also supports references to older proofs. Its use of standard
147 logical symbols and its natural deduction interface make it easy to use for
149 (license license:gpl3+)
150 (home-page "https://www.gnu.org/software/aris/")))
152 (define-public c-graph
158 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
161 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
162 (build-system gnu-build-system)
164 `(("fortran" ,gfortran)))
165 (synopsis "Visualizing and demonstrating convolution")
167 "GNU C-Graph is a tool for demonstrating the theory of convolution.
168 Thus, it can serve as an excellent aid to students of signal and systems
169 theory in visualizing the convolution process. Rather than forcing the
170 student to write code, the program offers an intuitive interface with
171 interactive dialogs to guide them.")
172 (license license:gpl3+)
173 (home-page "https://www.gnu.org/software/c-graph/")))
182 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
183 version "/coda-" version ".tar.gz"))
185 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
186 (patches (search-patches "coda-use-system-libs.patch"))
187 (modules '((guix build utils)))
189 ;; Make sure we don't use the bundled software.
191 (for-each (lambda (d)
192 (delete-file-recursively (string-append "libcoda/" d)))
193 '("zlib" "pcre" "expat"))
196 `(("fortran" ,gfortran)
198 ("python-numpy" ,python-numpy)))
205 (build-system gnu-build-system)
207 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
208 "LIBS= -lz -lpcre -lexpat")))
209 (synopsis "A common interface to various earth observation data formats")
211 "The Common Data Access toolbox (CODA) provides a set of interfaces for
212 reading remote sensing data from earth observation data files. It consists of
213 command line applications and interfaces to the C, Fortran, Python, and Java
214 programming languages.")
215 (home-page "https://stcorp.nl/coda")
216 (license license:gpl2+)))
224 (uri (string-append "http://www.qhull.org/download/qhull-"
225 (car (string-split version #\.))
229 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
230 (build-system cmake-build-system)
231 (synopsis "Calculate convex hulls and related structures")
233 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
234 diagram, halfspace intersection about a point, furthest-site Delaunay
235 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
236 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
237 algorithm for computing the convex hull. It handles roundoff errors from
238 floating point arithmetic. It computes volumes, surface areas, and
239 approximations to the convex hull.
241 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
242 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
243 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
245 (home-page "http://qhull.org")
246 (license (license:non-copyleft "file://COPYING.txt"
247 "See COPYING in the distribution."))))
249 (define-public python-cvxopt
251 (name "python-cvxopt")
256 (url "https://github.com/cvxopt/cvxopt.git")
258 (file-name (git-file-name name version))
261 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
262 (build-system python-build-system)
265 (modify-phases %standard-phases
266 (add-after 'unpack 'find-libraries
267 (lambda* (#:key inputs #:allow-other-keys)
268 (setenv "CVXOPT_BLAS_LIB" "openblas")
269 (setenv "CVXOPT_BUILD_FFTW" "1")
270 (setenv "CVXOPT_BUILD_GLPK" "1")
271 (setenv "CVXOPT_BUILD_GSL" "1")
278 ("openblas" ,openblas)
279 ("suitesparse" ,suitesparse)))
280 (home-page "https://www.cvxopt.org")
281 (synopsis "Python library for convex optimization")
283 "CVXOPT is a package for convex optimization based on the Python
284 programming language. Its main purpose is to make the development of software
285 for convex optimization applications straightforward by building on Python’s
286 extensive standard library and on the strengths of Python as a high-level
287 programming language.")
288 (license license:gpl3+)))
290 (define-public python2-cvxopt
291 (package-with-python2 python-cvxopt))
299 (uri (string-append "mirror://gnu/units/units-" version
302 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
303 (build-system gnu-build-system)
305 `(("readline" ,readline)
306 ("python" ,python-wrapper) ;for 'units_cur' script
307 ("python-requests" ,python-requests)))
309 `(#:phases (modify-phases %standard-phases
310 (add-after 'install 'wrap-units_cur
311 (lambda* (#:key outputs #:allow-other-keys)
312 (let* ((out (assoc-ref outputs "out"))
313 (bin (string-append out "/bin")))
314 (wrap-program (string-append bin "/units_cur")
315 `("PYTHONPATH" ":" prefix
316 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
318 (synopsis "Conversion between thousands of scales")
320 "GNU Units converts numeric quantities between units of measure. It
321 can handle scale changes through adaptive usage of standard scale
322 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
323 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
324 enough to be used effectively as a scientific calculator.")
325 (license license:gpl3+)
326 (home-page "https://www.gnu.org/software/units/")))
328 (define-public double-conversion
330 (name "double-conversion")
332 (home-page "https://github.com/google/double-conversion")
335 (uri (git-reference (url home-page)
336 (commit (string-append "v" version))))
337 (file-name (git-file-name name version))
340 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
341 (build-system cmake-build-system)
343 '(#:test-target "test"
344 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
345 "-DBUILD_TESTING=ON")))
346 (synopsis "Conversion routines for IEEE doubles")
348 "The double-conversion library provides binary-decimal and decimal-binary
349 routines for IEEE doubles. The library consists of efficient conversion
350 routines that have been extracted from the V8 JavaScript engine.")
351 (license license:bsd-3)))
353 (define-public dionysus
359 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
363 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
364 (build-system gnu-build-system)
365 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
366 (synopsis "Local search for universal constants and scientific values")
368 "GNU Dionysus is a convenient system for quickly retrieving the values of
369 mathematical constants used in science and engineering. Values can be
370 searched using a simple command-line tool, choosing from three databases:
371 universal constants, atomic numbers, and constants related to
373 (license license:gpl3+)
374 (home-page "https://www.gnu.org/software/dionysus/")))
382 (uri (string-append "mirror://gnu/gsl/gsl-"
386 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
387 (patches (search-patches "gsl-test-i686.patch"))))
388 (build-system gnu-build-system)
390 `(;; Currently there are numerous tests that fail on "exotic"
391 ;; architectures such as aarch64 and ppc64le.
392 ,@(if (string-prefix? "aarch64-linux"
393 (or (%current-target-system) (%current-system)))
396 (home-page "https://www.gnu.org/software/gsl/")
397 (synopsis "Numerical library for C and C++")
399 "The GNU Scientific Library is a library for numerical analysis in C
400 and C++. It includes a wide range of mathematical routines, with over 1000
401 functions in total. Subject areas covered by the library include:
402 differential equations, linear algebra, Fast Fourier Transforms and random
404 (license license:gpl3+)))
413 (uri (string-append "mirror://gnu/glpk/glpk-"
417 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
418 (build-system gnu-build-system)
422 `(#:configure-flags '("--with-gmp")))
423 (home-page "https://www.gnu.org/software/glpk/")
424 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
426 "GLPK is a C library for solving large-scale linear programming (LP),
427 mixed integer programming (MIP), and other related problems. It supports the
428 GNU MathProg modeling language, a subset of the AMPL language, and features a
429 translator for the language. In addition to the C library, a stand-alone
430 LP/MIP solver is included in the package.")
431 (license license:gpl3+)))
440 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
442 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
444 "/4ti2-" version ".tar.gz"))
446 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
447 (build-system gnu-build-system)
449 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
453 (home-page "http://www.4ti2.de/")
454 (synopsis "Mathematical tool suite for problems on linear spaces")
456 "4ti2 implements algorithms for solving algebraic, geometric and
457 combinatorial problems on linear spaces. Among others, it solves systems
458 of linear equations, computes extreme rays of polyhedral cones, solves
459 integer programming problems and computes Markov bases for statistics.")
460 (license license:gpl2+)))
462 (define-public cddlib
469 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
470 (string-delete #\. version) ".tar.gz"))
473 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
474 (build-system gnu-build-system)
477 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
478 (synopsis "Library for convex hulls and extreme rays of polyhedra")
480 "The C-library cddlib implements the Double Description Method of
481 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
482 rays of a general convex polyhedron given by a system of linear inequalities
483 in arbitrary dimension. It can also be used for the converse operation of
484 computing convex hulls.")
485 (license license:gpl2+)))
487 (define-public lrslib
494 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
496 (string-delete #\. version) ".tar.gz"))
499 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
500 (build-system gnu-build-system)
504 `(#:tests? #f ; no check phase
505 #:make-flags `("CC=gcc"
506 ,(string-append "prefix=" (assoc-ref %outputs "out"))
509 (modify-phases %standard-phases
512 (substitute* "makefile"
513 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
515 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
516 (synopsis "Convex hulls of polyhedra with exact arithmetic")
518 "The C code of lrslib implements the reverse search algorithm for
519 vertex enumeration and convex hull problems. Its input file format is
520 compatible with cddlib. All computations are done exactly in either
521 multiple precision or fixed integer arithmetic. Output is not stored
522 in memory, so even problems with very large output sizes can sometimes
524 (license license:gpl2+)))
526 (define-public arpack-ng
530 (home-page "https://github.com/opencollab/arpack-ng")
533 (uri (git-reference (url home-page) (commit version)))
534 (file-name (git-file-name name version))
537 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
538 (build-system gnu-build-system)
540 `(("autoconf" ,autoconf)
541 ("automake" ,automake)
542 ("libtool" ,libtool)))
545 ("fortran" ,gfortran)))
546 (synopsis "Fortran subroutines for solving eigenvalue problems")
548 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
549 large scale eigenvalue problems.")
550 (license (license:non-copyleft "file://COPYING"
551 "See COPYING in the distribution."))))
553 (define-public arpack-ng-3.3.0
557 (name (package-name arpack-ng))
558 (home-page (package-home-page arpack-ng))
562 (uri (string-append home-page "/archive/" version ".tar.gz"))
563 (file-name (string-append name "-" version ".tar.gz"))
566 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
568 (define-public arpack-ng-openmpi
569 (package (inherit arpack-ng)
570 (name "arpack-ng-openmpi")
573 ,@(package-inputs arpack-ng)))
575 (substitute-keyword-arguments (package-arguments arpack-ng)
576 ((#:configure-flags _ '())
578 ((#:phases phases '%standard-phases)
579 `(modify-phases ,phases
580 (add-before 'check 'mpi-setup
582 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
584 (define-public lapack
591 (uri (string-append "http://www.netlib.org/lapack/lapack-"
595 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
596 (build-system cmake-build-system)
597 (home-page "http://www.netlib.org/lapack/")
598 (inputs `(("fortran" ,gfortran)
599 ("python" ,python-wrapper)))
601 `(#:configure-flags (list
602 "-DBUILD_SHARED_LIBS:BOOL=YES"
604 ;; Build the 'LAPACKE_clatms' functions.
605 "-DLAPACKE_WITH_TMG=ON"
606 "-DBUILD_TESTING=ON")))
607 (synopsis "Library for numerical linear algebra")
609 "LAPACK is a Fortran 90 library for solving the most commonly occurring
610 problems in numerical linear algebra.")
611 (license (license:non-copyleft "file://LICENSE"
612 "See LICENSE in the distribution."))))
614 (define-public scalapack
621 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
625 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
626 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
627 (build-system cmake-build-system)
630 ("fortran" ,gfortran)
631 ("lapack" ,lapack))) ;for testing only
633 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
634 #:phases (modify-phases %standard-phases
635 (add-before 'check 'mpi-setup
637 (home-page "http://www.netlib.org/scalapack/")
638 (synopsis "Library for scalable numerical linear algebra")
640 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
641 routines on parallel distributed memory machines. ScaLAPACK solves dense and
642 banded linear systems, least squares problems, eigenvalue problems, and
643 singular value problems.")
644 (license (license:non-copyleft "file://LICENSE"
645 "See LICENSE in the distribution."))))
647 (define-public gnuplot
653 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
657 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
658 (build-system gnu-build-system)
659 (inputs `(("readline" ,readline)
665 `(("pkg-config" ,pkg-config)
666 ("texlive" ,texlive-tiny)))
667 (arguments `(#:configure-flags (list (string-append
668 "--with-texdir=" %output
669 "/texmf-local/tex/latex/gnuplot"))))
670 (home-page "http://www.gnuplot.info")
671 (synopsis "Command-line driven graphing utility")
672 (description "Gnuplot is a portable command-line driven graphing
673 utility. It was originally created to allow scientists and students to
674 visualize mathematical functions and data interactively, but has grown to
675 support many non-interactive uses such as web scripting. It is also used as a
676 plotting engine by third-party applications like Octave.")
677 ;; X11 Style with the additional restriction that derived works may only be
678 ;; distributed as patches to the original.
679 (license (license:fsf-free
680 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
690 (url "https://github.com/OkoSanto/GCTP.git")
691 (commit (string-append "v" version))))
692 (file-name (git-file-name name version))
694 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
696 `(("fortran" ,gfortran)))
697 (build-system gnu-build-system)
698 (synopsis "General Cartographic Transformation Package (GCTP)")
700 "The General Cartographic Transformation Package (GCTP) is a system of
701 software routines designed to permit the transformation of coordinate pairs
702 from one map projection to another. The GCTP is the standard computer
703 software used by the National Mapping Division for map projection
705 (home-page "https://github.com/OkoSanto/GCTP")
706 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
715 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
716 version "/src/hdf-" version ".tar.bz2"))
718 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
719 (patches (search-patches "hdf4-architectures.patch"
720 "hdf4-reproducibility.patch"
721 "hdf4-shared-fortran.patch"
722 "hdf4-tirpc.patch"))))
723 (build-system gnu-build-system)
725 `(("gfortran" ,gfortran)
731 ("libtirpc" ,libtirpc)))
733 `(#:parallel-tests? #f
734 #:configure-flags (list "--enable-shared"
735 (string-append "CPPFLAGS=-I"
736 (assoc-ref %build-inputs "libtirpc")
739 (modify-phases %standard-phases
740 ;; This is inspired by two of Debian's patches.
741 (add-before 'configure 'add-more-aarch64-support
743 (substitute* '("mfhdf/ncgen/ncgen.l"
744 "mfhdf/ncgen/ncgenyy.c"
745 "mfhdf/libsrc/netcdf.h.in")
746 (("AIX5L64") "__aarch64__"))
748 (add-before 'configure 'patchbuild
751 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
753 (("/bin/mkdir") "mkdir"))
754 (substitute* (find-files "." "^Makefile\\.in$")
755 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
756 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
757 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
758 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
759 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
761 (add-after 'configure 'patch-settings
763 ;; libhdf4.settings contains the full path of the
764 ;; compilers used, and its contents are included in
765 ;; .so-files. We truncate the hashes to avoid
766 ;; unnecessary store references to those compilers:
767 (substitute* "libhdf4.settings"
768 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
769 (string-append prefix (string-take hash 10) "...")))
772 (home-page "https://www.hdfgroup.org/products/hdf4/")
774 "Library and multi-object file format for storing and managing data")
775 (description "HDF4 is a library and multi-object file format for storing
776 and managing data between machines. HDF4 is an older hierarchical data format,
777 incompatible with HDF5.")
779 (license:non-copyleft
780 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
782 (define-public hdf4-alt
787 (substitute-keyword-arguments (package-arguments hdf4)
788 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
790 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
799 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
800 "hdf5-" (version-major+minor version)
801 "/hdf5-" version "/src/hdf5-"
803 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
805 (match (string-split version #\.)
807 (string-append major minor)))
808 "/src/hdf5-" version ".tar.bz2")))
810 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
811 (patches (search-patches "hdf5-config-date.patch"
812 "hdf5-1.8-mpi-deprecations.patch"))))
813 (build-system gnu-build-system)
817 `(("gfortran" ,gfortran)
818 ("perl" ,perl))) ;part of the test machinery needs Perl
819 (outputs '("out" ; core library
820 "fortran")) ; fortran interface
822 `(;; Some of the users, notably Flann, need the C++ interface.
823 #:configure-flags '("--enable-cxx"
825 "--enable-fortran2003"
827 ;; Build a thread-safe library. Unfortunately,
828 ;; 'configure' invites you to either turn off C++,
829 ;; Fortran, and the high-level interface (HL), or
830 ;; to pass '--enable-unsupported'. Debian
831 ;; packagers chose to pass '--enable-unsupported'
832 ;; and we follow their lead here.
833 "--enable-threadsafe"
835 "--enable-unsupported")
836 ;; Use -fPIC to allow the R bindings to link with the static libraries
837 #:make-flags (list "CFLAGS=-fPIC"
840 (modify-phases %standard-phases
841 (add-before 'configure 'patch-configure
842 (lambda* (#:key outputs #:allow-other-keys)
843 (substitute* "configure"
845 (substitute* "fortran/src/Makefile.in"
846 (("libhdf5_fortran_la_LDFLAGS =")
847 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
848 (assoc-ref outputs "fortran") "/lib")))
849 (substitute* "hl/fortran/src/Makefile.in"
850 (("libhdf5hl_fortran_la_LDFLAGS =")
851 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
852 (assoc-ref outputs "fortran") "/lib")))
854 (add-after 'configure 'patch-settings
856 ;; libhdf5.settings contains the full path of the
857 ;; compilers used, and its contents are included in
858 ;; libhdf5.so. We truncate the hashes to avoid
859 ;; unnecessary store references to those compilers:
860 (substitute* "src/libhdf5.settings"
861 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
862 (string-append prefix (string-take hash 10) "..."))
863 ;; Don't record the build-time kernel version to make the
864 ;; settings file reproducible.
865 (("Uname information:.*")
866 "Uname information: Linux\n"))
868 (add-after 'install 'patch-references
869 (lambda* (#:key inputs outputs #:allow-other-keys)
870 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
871 (zlib (assoc-ref inputs "zlib")))
872 (substitute* (find-files bin "h5p?cc")
874 (string-append "-L" zlib "/lib " lib)))
876 (add-after 'install 'split
877 (lambda* (#:key inputs outputs #:allow-other-keys)
878 ;; Move all fortran-related files
879 (let* ((out (assoc-ref outputs "out"))
880 (bin (string-append out "/bin"))
881 (lib (string-append out "/lib"))
882 (inc (string-append out "/include"))
883 (ex (string-append out "/share/hdf5_examples/fortran"))
884 (fort (assoc-ref outputs "fortran"))
885 (fbin (string-append fort "/bin"))
886 (flib (string-append fort "/lib"))
887 (finc (string-append fort "/include"))
888 (fex (string-append fort "/share/hdf5_examples/fortran")))
893 ;; Note: When built with --enable-parallel, the 'h5fc' file
894 ;; doesn't exist, hence this condition.
895 (when (file-exists? (string-append bin "/h5fc"))
896 (rename-file (string-append bin "/h5fc")
897 (string-append fbin "/h5fc")))
898 (for-each (lambda (file)
900 (string-append flib "/" (basename file))))
901 (find-files lib ".*fortran.*"))
902 (for-each (lambda (file)
904 (string-append finc "/" (basename file))))
905 (find-files inc ".*mod"))
906 (for-each (lambda (file)
908 (string-append fex "/" (basename file))))
909 (find-files ex ".*"))
910 (delete-file-recursively ex))
912 (home-page "https://www.hdfgroup.org")
913 (synopsis "Management suite for extremely large and complex data")
914 (description "HDF5 is a suite that makes possible the management of
915 extremely large and complex data collections.")
916 (license (license:x11-style
917 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
919 (define-public hdf5-1.10
920 (package (inherit hdf5)
925 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
926 "hdf5-" (version-major+minor version)
927 "/hdf5-" version "/src/hdf5-"
929 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
932 (take (string-split version #\.) 2))
933 "/src/hdf5-" version ".tar.bz2")))
935 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
936 (patches (search-patches "hdf5-config-date.patch"))))))
938 (define-public hdf-java
946 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
947 version "/src/CMake-hdfjava-" version ".tar.gz"))
949 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
950 (modules '((guix build utils)))
951 (snippet ; Make sure we don't use the bundled sources and binaries.
953 (for-each delete-file
954 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
955 "HDF4.tar.gz" "HDF5.tar.gz"))
956 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
958 (build-system gnu-build-system)
960 `(("jdk" ,icedtea "jdk")
961 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
963 ("hamcrest-core" ,java-hamcrest-core)
964 ("junit" ,java-junit)
965 ("slf4j-simple" ,java-slf4j-simple)))
971 ("slf4j-api" ,java-slf4j-api)))
974 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
975 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
976 (assoc-ref %build-inputs "jdk") "/lib" )
977 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
978 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
981 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
982 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
983 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
984 (string-append "JPEGLIB="
985 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
989 (modify-phases %standard-phases
990 (add-before 'configure 'chdir-to-source
991 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
992 (add-before 'configure 'patch-build
993 (lambda* (#:key inputs outputs #:allow-other-keys)
994 (substitute* "configure"
995 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
996 (("/bin/cat") (which "cat")))
997 ;; Set classpath for compilation
998 (substitute* '("hdf/hdf5lib/Makefile.in"
999 "hdf/hdf5lib/exceptions/Makefile.in"
1000 "hdf/hdflib/Makefile.in")
1001 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1002 (string-append (assoc-ref inputs "slf4j-api")
1003 "/share/java/slf4j-api.jar")))
1004 ;; Replace outdated config.sub and config.guess:
1005 (with-directory-excursion "config"
1006 (for-each (lambda (file)
1008 (string-append (assoc-ref inputs "automake")
1010 ,(version-major+minor (package-version automake))
1012 '("config.sub" "config.guess")))
1014 ;; Fix embedded version number
1015 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1016 (substitute* "hdf/hdf5lib/H5.java"
1018 (string-join hdf5version ", "))))
1020 (mkdir-p (string-append (assoc-ref outputs "out")))
1021 ;; Set classpath for tests
1022 (let* ((build-dir (getcwd))
1023 (lib (string-append build-dir "/lib"))
1024 (jhdf (string-append lib "/jhdf.jar"))
1025 (jhdf5 (string-append lib "/jhdf5.jar"))
1028 (string-append (assoc-ref inputs i)
1029 "/share/java/" i ".jar"))
1030 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1032 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1034 (substitute* '("test/hdf5lib/Makefile.in"
1035 "test/hdf5lib/junit.sh.in"
1036 "examples/runExample.sh.in")
1038 (string-append (assoc-ref inputs "coreutils")
1041 (string-append (assoc-ref inputs "coreutils")
1043 (("CLASSPATH=[^\n]*")
1044 (string-append "CLASSPATH=" class-path)))
1045 (setenv "CLASSPATH" class-path))
1047 (add-before 'check 'build-examples
1049 (apply invoke `("javac"
1050 ,@(find-files "examples" ".*\\.java"))))))
1052 #:parallel-build? #f
1054 #:parallel-tests? #f ))
1055 (home-page "https://support.hdfgroup.org/products/java")
1056 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1057 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1058 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1061 ;; BSD-style license:
1062 (license (license:x11-style
1063 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1064 /current/src/unpacked/COPYING"))))
1066 (define-public hdf-eos2
1073 (uri "ftp://edhs1.gsfc.nasa.gov\
1074 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1076 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1077 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1078 "hdf-eos2-build-shared.patch"
1079 "hdf-eos2-fortrantests.patch"))))
1080 (build-system gnu-build-system)
1082 `(("gfortran" ,gfortran)))
1084 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1085 ;; XXX: These inputs are really dependencies of hdf4.
1087 ("libjpeg" ,libjpeg)
1088 ("libtirpc" ,libtirpc)
1092 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1093 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1094 #:parallel-tests? #f))
1095 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1096 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1097 (description "HDF-EOS2 is a software library built on HDF4 which supports
1098 the construction of data structures used in NASA's Earth Observing
1099 System (Grid, Point and Swath).")
1101 ;; Source files carry a permissive license header.
1102 (license (license:non-copyleft home-page))))
1104 (define-public hdf-eos5
1110 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1111 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1114 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1115 (patches (search-patches "hdf-eos5-build-shared.patch"
1116 "hdf-eos5-remove-gctp.patch"
1117 "hdf-eos5-fix-szip.patch"
1118 "hdf-eos5-fortrantests.patch"))))
1120 `(("gfortran" ,gfortran)))
1121 (build-system gnu-build-system)
1127 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1128 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1129 #:parallel-tests? #f))
1130 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1132 "HDF-EOS5 is a software library built on HDF5 to support the construction
1133 of data structures used in NASA's Earth Observing System (Grid, Point and
1135 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1137 ;; Source files carry a permissive license header.
1138 (license (license:non-copyleft home-page))))
1140 (define-public hdf5-parallel-openmpi
1141 (package (inherit hdf5)
1142 (name "hdf5-parallel-openmpi")
1145 ,@(package-inputs hdf5)))
1147 (substitute-keyword-arguments (package-arguments hdf5)
1148 ((#:configure-flags flags)
1149 ``("--enable-parallel"
1150 ,@(delete "--enable-cxx"
1151 (delete "--enable-threadsafe" ,flags))))
1153 `(modify-phases ,phases
1154 (add-after 'build 'mpi-setup
1156 (add-before 'check 'patch-tests
1158 ;; OpenMPI's mpirun will exit with non-zero status if it
1159 ;; detects an "abnormal termination", i.e. any process not
1160 ;; calling MPI_Finalize(). Since the test is explicitly
1161 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1162 ;; H5C_flush_cache from being called, mpirun will always
1163 ;; complain, so turn this test off.
1164 (substitute* "testpar/Makefile"
1165 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1166 (string-append front back "\n")))
1167 (substitute* "tools/h5diff/testph5diff.sh"
1168 (("/bin/sh") (which "sh")))
1170 (synopsis "Management suite for data with parallel IO support")))
1172 (define-public h5check
1179 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1180 "h5check/src/h5check-" version ".tar.gz"))
1183 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1184 (build-system gnu-build-system)
1185 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1186 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1187 (synopsis "HDF5 format checker")
1188 (description "@code{h5check} is a validation tool for verifying that an
1189 HDF5 file is encoded according to the HDF File Format Specification.")
1190 (license (license:x11-style "file://COPYING"))))
1198 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1203 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1204 (build-system cmake-build-system)
1205 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1206 (inputs `(("lapack" ,lapack)
1208 ;; FIXME: Even though the fonts are available dvips complains:
1209 ;; "Font cmmi10 not found; characters will be left blank."
1211 `(("texlive" ,texlive-tiny)
1212 ("ghostscript" ,ghostscript)
1213 ("doxygen" ,doxygen)))
1214 (home-page "http://itpp.sourceforge.net")
1215 (synopsis "C++ library of maths, signal processing and communication classes")
1216 (description "IT++ is a C++ library of mathematical, signal processing and
1217 communication classes and functions. Its main use is in simulation of
1218 communication systems and for performing research in the area of
1219 communications. The kernel of the library consists of generic vector and
1220 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1221 similar to MATLAB, GNU Octave or SciPy.")
1222 (license license:gpl3+)))
1224 (define-public netcdf
1231 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1232 "netcdf-" version ".tar.gz"))
1235 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1236 (patches (search-patches "netcdf-date-time.patch"
1237 "netcdf-tst_h_par.patch"))))
1238 (build-system gnu-build-system)
1241 ("doxygen" ,doxygen)
1242 ("graphviz" ,graphviz)))
1244 `(("hdf4" ,hdf4-alt)
1247 ("libjpeg" ,libjpeg)))
1249 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1251 #:phases (modify-phases %standard-phases
1252 (add-before 'configure 'fix-source-date
1254 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1255 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1256 ;; to '1st hour of the current day', and therefore makes the
1257 ;; package not reproducible.
1258 (substitute* "./configure"
1259 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1260 "date --date='@0'"))
1262 (add-after 'configure 'patch-settings
1264 ;; libnetcdf.settings contains the full filename of the compilers
1265 ;; used to build the library. We truncate the hashes of those
1266 ;; filenames to avoid unnecessary references to the corresponding
1268 (substitute* "libnetcdf.settings"
1269 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1270 (string-append prefix (string-take hash 10) "...")))
1273 #:parallel-tests? #f)) ;various race conditions
1274 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1275 (synopsis "Library for scientific data")
1276 (description "NetCDF is an interface for scientific data access and a
1277 software library that provides an implementation of the interface. The netCDF
1278 library defines a machine-independent format for representing scientific data.
1279 Together, the interface, library, and format support the creation, access, and
1280 sharing of scientific data.")
1281 (license (license:x11-style "file://COPYRIGHT"))))
1283 (define-public netcdf-parallel-openmpi
1284 (package (inherit netcdf)
1285 (name "netcdf-parallel-openmpi")
1288 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1289 (package-inputs netcdf))))
1290 ;; TODO: Replace pkg-config references in nc-config with absolute references
1292 (substitute-keyword-arguments (package-arguments netcdf)
1293 ((#:configure-flags flags)
1294 `(cons* "CC=mpicc" "CXX=mpicxx"
1295 "--enable-parallel-tests"
1296 ;; Shared libraries not supported with parallel IO.
1297 "--disable-shared" "--with-pic"
1300 (define-public netcdf-fortran
1302 (name "netcdf-fortran")
1307 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1311 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1312 (build-system gnu-build-system)
1314 `(#:parallel-tests? #f))
1316 `(("netcdf" ,netcdf)))
1318 `(("gfortran" ,gfortran)))
1319 (synopsis "Fortran interface for the netCDF library")
1320 (description (package-description netcdf))
1321 (home-page (package-home-page netcdf))
1322 (license (package-license netcdf))))
1324 (define-public nlopt
1330 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1333 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1334 (build-system gnu-build-system)
1336 `(;; Shared libraries are not built by default. They are required to
1337 ;; build the Guile, Octave, and Python bindings.
1338 #:configure-flags '("--enable-shared")
1341 (modify-phases %standard-phases
1342 (add-before 'configure 'set-libnlopt-file-name
1343 (lambda* (#:key outputs #:allow-other-keys)
1344 ;; Make sure the Scheme module refers to the library by its
1345 ;; absolute file name (we cannot do that from a snippet
1346 ;; because the expansion of @libdir@ contains
1348 (let ((out (assoc-ref outputs "out")))
1349 (substitute* "swig/nlopt.scm.in"
1351 (string-append out "/lib/libnlopt")))
1353 (inputs `(("guile" ,guile-2.0)))
1354 (native-inputs `(("pkg-config" ,pkg-config)))
1355 (home-page "http://ab-initio.mit.edu/wiki/")
1356 (synopsis "Library for nonlinear optimization")
1357 (description "NLopt is a library for nonlinear optimization, providing a
1358 common interface for a number of different free optimization routines available
1359 online as well as original implementations of various other algorithms.")
1360 (license license:lgpl2.1+)))
1362 (define-public ipopt
1369 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1373 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1374 (modules '((guix build utils)))
1376 ;; Make sure we don't use the bundled software.
1378 (delete-file-recursively "ThirdParty")
1380 (build-system gnu-build-system)
1382 '(#:phases (modify-phases %standard-phases
1383 (add-after 'install 'add--L-flags-in-ipopt.pc
1384 (lambda* (#:key inputs outputs #:allow-other-keys)
1385 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1386 ;; move it to "Libs.private" where it belongs, and add a
1387 ;; '-L' flag for LAPACK.
1388 (let ((out (assoc-ref outputs "out"))
1389 (lapack (assoc-ref inputs "lapack")))
1390 (substitute* (string-append out "/lib/pkgconfig/"
1392 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1393 (string-append "Libs: " before " " after "\n"
1394 "Libs.private: " before
1395 "-L" lapack "/lib -llapack -lblas "
1399 `(("gfortran" ,gfortran)))
1401 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1402 `(("lapack" ,lapack))) ;for both libblas and liblapack
1403 (home-page "http://www.coin-or.org")
1404 (synopsis "Large-scale nonlinear optimizer")
1406 "The Interior Point Optimizer (IPOPT) is a software package for
1407 large-scale nonlinear optimization. It provides C++, C, and Fortran
1409 (license license:epl1.0)))
1417 (uri (string-append "https://www.coin-or.org/download/source/"
1418 "Clp/Clp-" version ".tgz"))
1421 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1422 (modules '((guix build utils)))
1424 ;; Make sure we don't use the bundled software.
1426 (delete-file-recursively "ThirdParty")
1428 (build-system gnu-build-system)
1430 `(("gfortran" ,gfortran)
1431 ("pkg-config" ,pkg-config)))
1433 `(("openblas" ,openblas)))
1434 (home-page "https://www.coin-or.org")
1435 (synopsis "Linear programming solver")
1437 "CLP is a high quality linear programming solver. Its main strengths are
1438 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1439 linear and quadratic objectives. There are limited facilities for nonlinear
1440 and quadratic objectives using the Simplex algorithm.")
1441 (license license:epl1.0)))
1443 (define-public ceres
1445 (name "ceres-solver")
1447 (home-page "http://ceres-solver.org/")
1450 (uri (string-append home-page "ceres-solver-"
1454 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1455 (build-system cmake-build-system)
1457 ;; TODO: Build HTML user documentation and install separately.
1458 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1459 "-DBUILD_SHARED_LIBS=ON")
1461 #:phases (modify-phases %standard-phases
1462 (add-before 'configure 'set-library-directory
1464 ;; Install libraries to lib/, not lib64/.
1465 (substitute* "internal/ceres/CMakeLists.txt"
1466 (("set\\(LIB_SUFFIX \"64\"\\)")
1467 "set(LIB_SUFFIX \"\")"))
1470 `(("pkg-config" ,pkg-config)))
1472 `(("glog" ,glog))) ;for #include <glog/glog.h>
1477 ("suitesparse" ,suitesparse)
1478 ("gflags" ,gflags)))
1479 (synopsis "C++ library for solving large optimization problems")
1481 "Ceres Solver is a C++ library for modeling and solving large,
1482 complicated optimization problems. It is a feature rich, mature and
1483 performant library which has been used in production since 2010. Ceres Solver
1484 can solve two kinds of problems:
1486 @item non-linear least squares problems with bounds constraints;
1487 @item general unconstrained optimization problems.
1489 (license license:bsd-3)))
1491 ;; For a fully featured Octave, users are strongly recommended also to install
1492 ;; the following packages: less, ghostscript, gnuplot.
1493 (define-public octave-cli
1500 (uri (string-append "mirror://gnu/octave/octave-"
1504 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1505 (build-system gnu-build-system)
1507 `(("alsa-lib" ,alsa-lib)
1508 ("arpack" ,arpack-ng)
1514 ("fontconfig" ,fontconfig)
1515 ("freetype" ,freetype)
1519 ("graphicsmagick" ,graphicsmagick)
1522 ("libsndfile" ,libsndfile)
1526 ("portaudio" ,portaudio)
1528 ("readline" ,readline)
1529 ("suitesparse" ,suitesparse)
1530 ("texinfo" ,texinfo)
1534 ("gfortran" ,gfortran)
1535 ("pkg-config" ,pkg-config)
1537 ;; The following inputs are not actually used in the build process.
1538 ;; However, the ./configure gratuitously tests for their existence and
1539 ;; assumes that programs not present at build time are also not, and
1540 ;; can never be, available at run time! If these inputs are therefore
1541 ;; not present, support for them will be built out. However, Octave
1542 ;; will still run without them, albeit without the features they
1545 ("ghostscript" ,ghostscript)
1546 ("gnuplot" ,gnuplot)))
1547 ;; Octave code uses this variable to detect directories holding multiple CA
1548 ;; certificates to verify peers with. This is required for the networking
1549 ;; functions that require encryption to work properly.
1550 (native-search-paths
1551 (list (search-path-specification
1552 (variable "CURLOPT_CAPATH")
1553 (files '("etc/ssl/certs")))))
1556 (list (string-append "--with-shell="
1557 (assoc-ref %build-inputs "bash")
1560 (modify-phases %standard-phases
1561 (add-after 'configure 'configure-makeinfo
1562 (lambda* (#:key inputs #:allow-other-keys)
1563 (substitute* "libinterp/corefcn/help.h"
1566 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1568 (home-page "https://www.gnu.org/software/octave/")
1569 (synopsis "High-level language for numerical computation")
1570 (description "GNU Octave is a high-level interpreted language that is
1571 specialized for numerical computations. It can be used for both linear and
1572 non-linear applications and it provides great support for visualizing results.
1573 Work may be performed both at the interactive command-line as well as via
1575 (license license:gpl3+)))
1577 (define-public octave
1578 (package (inherit octave-cli)
1581 (inherit (package-source octave-cli))))
1583 `(("qscintilla" ,qscintilla)
1585 ,@(package-inputs octave-cli)))
1587 `(("qttools" , qttools) ;for lrelease
1588 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1589 ,@(package-native-inputs octave-cli)))
1591 (substitute-keyword-arguments (package-arguments octave-cli)
1593 `(modify-phases ,phases
1594 (add-before 'configure 'patch-qscintilla-library-name
1595 (lambda* (#:key inputs #:allow-other-keys)
1596 ;; The QScintilla library that the Octave configure script tries
1597 ;; to link with should be named libqscintilla-qt5.so, but the
1598 ;; QScintilla input provides the shared library as
1599 ;; libqscintilla2_qt5.so.
1600 (substitute* "configure"
1601 (("qscintilla2-qt5")
1605 (define-public qtoctave
1606 (deprecated-package "qtoctave" octave))
1608 (define-public opencascade-oce
1610 (name "opencascade-oce")
1616 (url "https://github.com/tpaviot/oce.git")
1617 (commit (string-append "OCE-" version))))
1618 (file-name (git-file-name name version))
1619 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1621 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1622 (build-system cmake-build-system)
1625 (list "-DOCE_TESTING:BOOL=ON"
1626 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1627 "-DOCE_DRAW:BOOL=ON"
1628 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1629 (assoc-ref %outputs "out"))
1630 "-UCMAKE_INSTALL_RPATH")))
1632 `(("freetype" ,freetype)
1639 `(("python" ,python-wrapper)))
1640 (home-page "https://github.com/tpaviot/oce")
1641 (synopsis "Libraries for 3D modeling and numerical simulation")
1643 "Open CASCADE is a set of libraries for the development of applications
1644 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1645 C++ class libraries providing services for 3D surface and solid modeling, CAD
1646 data exchange, and visualization. It is used for development of specialized
1647 software dealing with 3D models in design (CAD), manufacturing (CAM),
1648 numerical simulation (CAE), measurement equipment (CMM), and quality
1649 control (CAQ) domains.
1651 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1652 patches, improvements, and experiments contributed by users over the official
1653 Open CASCADE library.")
1654 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1655 ; use of header files; see
1656 ; OCCT_LGPL_EXCEPTION.txt
1657 license:public-domain; files
1658 ; src/Standard/Standard_StdAllocator.hxx and
1659 ; src/NCollection/NCollection_StdAllocator.hxx
1660 license:expat; file src/OpenGl/OpenGl_glext.h
1661 license:bsd-3)))); test framework gtest
1663 (define-public opencascade-occt
1665 (name "opencascade-occt")
1671 (url "https://git.dev.opencascade.org/repos/occt.git")
1674 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1676 (file-name (git-file-name name version))
1678 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1679 (modules '((guix build utils)))
1682 ;; Remove files specific to non-free operating systems.
1683 (delete-file-recursively "samples/ios")
1684 (delete-file-recursively "samples/mfc")
1685 (delete-file-recursively "samples/qt/FuncDemo")
1686 (delete-file "genconf.bat")
1687 (delete-file "gendoc.bat")
1688 (delete-file "genproj.bat")
1689 (delete-file "upgrade.bat")
1690 ;; Remove references to deleted files.
1691 (substitute* "dox/FILES_HTML.txt"
1692 ((".*standard.*") "" )
1693 ((".*UIKitSample.*") ""))
1695 (build-system cmake-build-system)
1697 '(;; There is no test target for make. OCCT provides an
1698 ;; 'Automated Testing System', which may be accessed after
1699 ;; installation via the draw.sh script. draw.sh is located in
1700 ;; the bin directory. For details see:
1701 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1702 ;; occt_dev_guides__tests.html
1704 ;; Configure without freeimage: attempting to link against the
1705 ;; freeimage version 3.17 library leads to 'undefined
1706 ;; reference' errors.
1708 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1710 "-DUSE_VTK:BOOL=OFF"
1711 "-DBUILD_DOC_Overview:BOOL=OFF"
1712 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1713 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1714 "-UCMAKE_INSTALL_LIBDIR")))
1716 `(("doxygen" ,doxygen)
1717 ;("freeimage" ,freeimage)
1718 ("freetype" ,freetype)
1720 ("libxext" ,libxext)
1727 ;; TODO: build Overview documentation and add 'doc' output.
1728 (home-page "https://www.opencascade.com")
1729 (synopsis "Libraries for 3D modeling and numerical simulation")
1731 "Open CASCADE is a set of libraries for the development of applications
1732 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1733 C++ class libraries providing services for 3D surface and solid modeling, CAD
1734 data exchange, and visualization. It is used for development of specialized
1735 software dealing with 3D models in design (CAD), manufacturing (CAM),
1736 numerical simulation (CAE), measurement equipment (CMM), and quality
1737 control (CAQ) domains.
1739 This is the certified version of the Open Cascade Technology (OCCT) library.")
1740 (license (list ;; OCCT library:
1741 license:lgpl2.1; with an exception for the use of header
1742 ; files, see OCCT_LGPL_EXCEPTION.txt.
1743 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1744 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1746 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1747 ;; src/StepFile/step.tab.*:
1748 license:gpl3+ ; with Bison 2.2 exception.
1749 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1750 (license:non-copyleft
1751 "https://www.unicode.org/license.html")
1752 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1753 license:public-domain))))
1763 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1765 (string-append "gmsh_"
1766 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1768 (file-name (git-file-name name version))
1770 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1771 (modules '((guix build utils)))
1773 ;; Remove non-free METIS code
1775 (delete-file-recursively "contrib/Metis")
1777 (build-system cmake-build-system)
1780 ("gfortran" ,gfortran)
1786 ("opencascade-oce" ,opencascade-oce)
1788 ("libxext" ,libxext)))
1790 `(("fontconfig" ,fontconfig)
1791 ("libxft" ,libxft)))
1793 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1794 "-DENABLE_BUILD_SHARED:BOOL=ON"
1795 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1796 (home-page "http://gmsh.info/")
1797 (synopsis "3D finite element grid generator")
1798 (description "Gmsh is a 3D finite element grid generator with a built-in
1799 CAD engine and post-processor. Its design goal is to provide a fast, light
1800 and user-friendly meshing tool with parametric input and advanced
1801 visualization capabilities. Gmsh is built around four modules: geometry,
1802 mesh, solver and post-processing. The specification of any input to these
1803 modules is done either interactively using the graphical user interface or in
1804 ASCII text files using Gmsh's own scripting language.")
1805 (license license:gpl2+)))
1807 (define-public maxflow
1810 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
1811 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
1816 (url "https://github.com/gerddie/maxflow.git")
1818 (file-name (git-file-name name version))
1821 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1822 (build-system cmake-build-system)
1823 (home-page "https://pub.ist.ac.at/~vnk/software.html")
1824 (synopsis "Library implementing Maxflow algorithm")
1825 (description "An implementation of the maxflow algorithm described in
1826 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1827 Energy Minimization in Computer Vision.\n
1828 Yuri Boykov and Vladimir Kolmogorov.\n
1829 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1831 (license license:gpl3+)))
1833 (define-public petsc
1840 ;; The *-lite-* tarball does not contain the *large* documentation
1841 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1842 "petsc-lite-" version ".tar.gz"))
1844 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1845 (outputs '("out" ; libraries and headers
1846 "examples")) ; ~30MiB of examples
1847 (build-system gnu-build-system)
1849 `(("python" ,python-2)))
1851 `(("gfortran" ,gfortran)
1853 ("superlu" ,superlu)
1854 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1855 ;; leaving out opengl, as configuration seems to only be for mac
1858 `(#:test-target "test"
1859 #:parallel-build? #f ; build is parallel by default
1865 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1866 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1867 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1869 (modify-phases %standard-phases
1871 ;; PETSc's configure script is actually a python script, so we can't
1872 ;; run it with bash.
1873 (lambda* (#:key outputs (configure-flags '())
1875 (let* ((prefix (assoc-ref outputs "out"))
1876 (flags `(,(string-append "--prefix=" prefix)
1877 ,@configure-flags)))
1878 (format #t "build directory: ~s~%" (getcwd))
1879 (format #t "configure flags: ~s~%" flags)
1880 (apply invoke "./configure" flags))))
1881 (add-after 'configure 'clean-local-references
1882 (lambda* (#:key outputs #:allow-other-keys)
1883 (let ((out (assoc-ref outputs "out")))
1884 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1885 ;; Prevent build directory from leaking into compiled code
1887 ;; Scrub timestamp for reproducibility
1888 ((".*Libraries compiled on.*") ""))
1889 (substitute* (find-files "." "petscvariables")
1890 ;; Do not expose build machine characteristics, set to defaults.
1891 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1892 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1894 (add-after 'install 'clean-install
1895 ;; Try to keep installed files from leaking build directory names.
1896 (lambda* (#:key inputs outputs #:allow-other-keys)
1897 (let ((out (assoc-ref outputs "out")))
1898 (substitute* (map (lambda (file)
1899 (string-append out "/lib/petsc/conf/" file))
1900 '("petscvariables"))
1902 ;; Make compiler references point to the store
1903 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1904 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1905 (string-append "= " (which compiler))))
1906 ;; PETSc installs some build logs, which aren't necessary.
1907 (for-each (lambda (file)
1908 (let ((f (string-append out "/lib/petsc/conf/" file)))
1909 (when (file-exists? f)
1911 '("configure.log" "make.log" "gmake.log"
1912 "test.log" "error.log" "RDict.db"
1913 "PETScBuildInternal.cmake"
1914 ;; Once installed, should uninstall with Guix
1917 (add-after 'install 'move-examples
1918 (lambda* (#:key outputs #:allow-other-keys)
1919 (let* ((out (assoc-ref outputs "out"))
1920 (examples (assoc-ref outputs "examples"))
1921 (exdir (string-append out "/share/petsc/examples"))
1922 (exdir' (string-append examples "/share/petsc/examples")))
1923 (copy-recursively exdir exdir')
1924 (delete-file-recursively exdir)
1926 (home-page "https://www.mcs.anl.gov/petsc")
1927 (synopsis "Library to solve PDEs")
1928 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1929 data structures and routines for the scalable (parallel) solution of
1930 scientific applications modeled by partial differential equations.")
1931 (license (license:non-copyleft
1932 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1934 (define-public petsc-complex
1935 (package (inherit petsc)
1936 (name "petsc-complex")
1938 (substitute-keyword-arguments (package-arguments petsc)
1939 ((#:configure-flags cf)
1940 `(cons "--with-scalar-type=complex" ,cf))))
1941 (synopsis "Library to solve PDEs (with complex scalars)")))
1943 (define-public petsc-openmpi
1944 (package (inherit petsc)
1945 (name "petsc-openmpi")
1947 `(("hdf5" ,hdf5-parallel-openmpi)
1948 ("hypre" ,hypre-openmpi)
1950 ("mumps" ,mumps-openmpi)
1951 ("openmpi" ,openmpi)
1952 ("scalapack" ,scalapack)
1953 ("scotch" ,pt-scotch32)
1954 ,@(package-inputs petsc)))
1956 (substitute-keyword-arguments (package-arguments petsc)
1957 ((#:configure-flags cf)
1959 "--with-mpiexec=mpirun"
1962 "--with-scalapack=1"
1964 ,(string-append "--with-mpi-dir="
1965 (assoc-ref %build-inputs "openmpi"))
1966 ,(string-append "--with-hdf5-include="
1967 (assoc-ref %build-inputs "hdf5") "/include")
1968 ,(string-append "--with-hdf5-lib="
1969 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1970 ,@(delete "--with-mpi=0" ,cf)))
1972 `(modify-phases ,phases
1973 (add-before 'configure 'mpi-setup
1974 ,%openmpi-setup)))))
1975 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1977 (define-public petsc-complex-openmpi
1978 (package (inherit petsc-complex)
1979 (name "petsc-complex-openmpi")
1981 `(("openmpi" ,openmpi)
1982 ,@(package-inputs petsc-complex)))
1984 (substitute-keyword-arguments (package-arguments petsc-complex)
1985 ((#:configure-flags cf)
1986 ``("--with-mpiexec=mpirun"
1987 ,(string-append "--with-mpi-dir="
1988 (assoc-ref %build-inputs "openmpi"))
1989 ,@(delete "--with-mpi=0" ,cf)))
1991 `(modify-phases ,phases
1992 (add-before 'configure 'mpi-setup
1993 ,%openmpi-setup)))))
1994 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1996 (define-public python-petsc4py
1998 (name "python-petsc4py")
2003 (uri (pypi-uri "petsc4py" version))
2006 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2007 (build-system python-build-system)
2010 (modify-phases %standard-phases
2011 (add-before 'build 'pre-build
2013 ;; Define path to PETSc installation.
2014 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2016 (add-before 'check 'mpi-setup
2019 `(("petsc" ,petsc-openmpi)
2020 ("python-numpy" ,python-numpy)))
2021 (home-page "https://bitbucket.org/petsc/petsc4py/")
2022 (synopsis "Python bindings for PETSc")
2023 (description "PETSc, the Portable, Extensible Toolkit for
2024 Scientific Computation, is a suite of data structures and routines for
2025 the scalable (parallel) solution of scientific applications modeled by
2026 partial differential equations. It employs the MPI standard for all
2027 message-passing communication. @code{petsc4py} provides Python
2028 bindings to almost all functions of PETSc.")
2029 (license license:bsd-3)))
2031 (define-public python-kiwisolver
2033 (name "python-kiwisolver")
2037 (uri (pypi-uri "kiwisolver" version))
2040 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2041 (build-system python-build-system)
2042 (home-page "https://github.com/nucleic/kiwi")
2043 (synopsis "Fast implementation of the Cassowary constraint solver")
2045 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2046 solving algorithm. Kiwi has been designed from the ground up to be
2047 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2048 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2049 savings are consistently > 5x.")
2050 (license license:bsd-3)))
2052 (define-public python2-kiwisolver
2053 (package-with-python2 python-kiwisolver))
2055 (define-public slepc
2062 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2066 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2067 (build-system gnu-build-system)
2069 `(("python" ,python-2)
2070 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2072 `(("arpack" ,arpack-ng)
2073 ("gfortran" ,gfortran)))
2075 `(("petsc" ,petsc)))
2077 `(#:parallel-build? #f ;build is parallel by default
2079 `(,(string-append "--with-arpack-dir="
2080 (assoc-ref %build-inputs "arpack") "/lib"))
2081 #:make-flags ;honor (parallel-job-count)
2082 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2083 ,(string-append "PETSCCONFIGDIR="
2084 (assoc-ref %build-inputs "petsc:examples")
2085 "/share/petsc/examples/config"))
2087 (modify-phases %standard-phases
2089 ;; configure is a python script, so we can't run it with bash.
2090 (lambda* (#:key inputs outputs (configure-flags '())
2092 (let* ((prefix (assoc-ref outputs "out"))
2093 (flags `(,(string-append "--prefix=" prefix)
2094 ,@configure-flags)))
2095 (format #t "build directory: ~s~%" (getcwd))
2096 (format #t "configure flags: ~s~%" flags)
2097 (setenv "SLEPC_DIR" (getcwd))
2098 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2099 (apply invoke "./configure" flags))))
2100 (add-after 'install 'delete-doc
2101 ;; TODO: SLEPc installs HTML documentation alongside headers in
2102 ;; $out/include. We'd like to move them to share/doc, but delete
2103 ;; them for now, as they are incomplete and installing the complete
2104 ;; documentation is difficult.
2105 (lambda* (#:key outputs #:allow-other-keys)
2106 (let* ((out (assoc-ref outputs "out")))
2107 (for-each delete-file (find-files out "\\.html$"))
2109 (add-after 'install 'clean-install
2110 ;; Clean up unnecessary build logs from installation.
2111 (lambda* (#:key outputs #:allow-other-keys)
2112 (let ((out (assoc-ref outputs "out")))
2113 (for-each (lambda (file)
2114 (let ((f (string-append out "/lib/slepc/conf/" file)))
2115 (when (file-exists? f)
2117 '("configure.log" "make.log" "gmake.log"
2118 "test.log" "error.log" "RDict.db"
2121 (home-page "http://slepc.upv.es")
2122 (synopsis "Scalable library for eigenproblems")
2123 (description "SLEPc is a software library for the solution of large sparse
2124 eigenproblems on parallel computers. It can be used for the solution of
2125 linear eigenvalue problems formulated in either standard or generalized form,
2126 as well as other related problems such as the singular value decomposition.
2127 The emphasis of the software is on methods and techniques appropriate for
2128 problems in which the associated matrices are sparse, for example, those
2129 arising after the discretization of partial differential equations.")
2130 (license license:bsd-2)))
2132 (define-public slepc-complex
2133 (package (inherit slepc)
2134 (name "slepc-complex")
2136 `(("petsc" ,petsc-complex)
2137 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2138 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2140 (define-public slepc-openmpi
2141 (package (inherit slepc)
2142 (name "slepc-openmpi")
2144 (substitute-keyword-arguments (package-arguments slepc)
2145 ((#:phases phases '%standard-phases)
2146 `(modify-phases ,phases
2147 (add-before 'check 'mpi-setup
2148 ,%openmpi-setup)))))
2151 ("arpack" ,arpack-ng-openmpi)
2152 ,@(alist-delete "arpack" (package-inputs slepc))))
2154 `(("petsc" ,petsc-openmpi)
2155 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2156 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2158 (define-public slepc-complex-openmpi
2159 (package (inherit slepc-openmpi)
2160 (name "slepc-complex-openmpi")
2162 `(("petsc" ,petsc-complex-openmpi)
2163 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2164 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2166 (define-public python-slepc4py
2168 (name "python-slepc4py")
2173 (uri (pypi-uri "slepc4py" version))
2176 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2177 (build-system python-build-system)
2180 (modify-phases %standard-phases
2181 (add-before 'build 'pre-build
2183 ;; Define path to PETSc installation.
2184 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2185 ;; Define path to SLEPc installation.
2186 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2188 (add-before 'check 'mpi-setup
2191 `(("python-numpy" ,python-numpy)
2192 ("python-petsc4py" ,python-petsc4py)
2193 ("slepc" ,slepc-openmpi)))
2194 (home-page "https://bitbucket.org/slepc/slepc4py/")
2195 (synopsis "Python bindings for SLEPc")
2196 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2197 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2198 Scientific Computation. It employs the MPI standard for all
2199 message-passing communication. @code{slepc4py} provides Python
2200 bindings to almost all functions of SLEPc.")
2201 (license license:bsd-3)))
2203 (define-public mumps
2210 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2214 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2215 (patches (search-patches "mumps-build-parallelism.patch"
2216 "mumps-shared-libseq.patch"
2217 "mumps-shared-mumps.patch"
2218 "mumps-shared-pord.patch"))))
2219 (build-system gnu-build-system)
2221 `(("fortran" ,gfortran)
2222 ;; These are required for linking against mumps, but we let the user
2223 ;; declare the dependency.
2226 ("scotch" ,scotch)))
2228 `(#:modules ((ice-9 match)
2231 ,@%gnu-build-system-modules)
2233 (modify-phases %standard-phases
2235 (lambda* (#:key inputs #:allow-other-keys)
2236 (call-with-output-file "Makefile.inc"
2247 INCSEQ = -I$(topdir)/libseq
2248 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2249 LIBSEQNEEDED = libseqneeded~;
2253 AR = ar vr # rules require trailing space, ugh...
2256 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2258 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2259 LIBOTHERS = -pthread
2262 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2266 LIBS = $(SCALAP) $(LIBSEQ)
2267 LPORDDIR = $(topdir)/PORD/lib
2268 IPORD = -I$(topdir)/PORD/include
2269 LPORD = $(LPORDDIR)/libpord.a
2270 ORDERINGSF = -Dpord~@[
2272 IMETIS = -I$(METISDIR)/include
2273 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2274 ORDERINGSF += -Dmetis~]~@[~:{
2276 ISCOTCH = -I$(SCOTCHDIR)/include
2277 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2278 ORDERINGSF += ~a~}~]
2279 ORDERINGSC = $(ORDERINGSF)
2280 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2281 IORDERINGSF = $(ISCOTCH)
2282 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2283 (assoc-ref inputs "mpi")
2284 (assoc-ref inputs "blas")
2285 (assoc-ref inputs "scalapack")
2286 (assoc-ref inputs "metis")
2287 (match (list (assoc-ref inputs "pt-scotch")
2288 (assoc-ref inputs "scotch"))
2292 `((,scotch "" "-Dscotch")))
2295 "-lptesmumps -lptscotch -lptscotcherr "
2296 "-Dptscotch")))))))))
2298 ;; By default only the d-precision library is built. Make with "all"
2299 ;; target so that all precision libraries and examples are built.
2301 (invoke "make" "all"
2302 (format #f "-j~a" (parallel-job-count)))))
2304 ;; Run the simple test drivers, which read test input from stdin:
2305 ;; from the "real" input for the single- and double-precision
2306 ;; testers, and from the "cmplx" input for complex-precision
2307 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2308 ;; package to prefix execution with "mpirun".
2309 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2310 (with-directory-excursion "examples"
2313 (let ((tester (apply open-pipe*
2316 ,(string-append "./" prec
2318 (input (open-input-file
2319 (string-append "input_simpletest_" type))))
2321 (dump-port input tester)
2323 (zero? (close-pipe tester)))))
2325 '("real" "real" "cmplx" "cmplx")))))
2327 (lambda* (#:key outputs #:allow-other-keys)
2328 (let* ((out (assoc-ref outputs "out"))
2329 (libdir (string-append out "/lib")))
2330 (copy-recursively "lib" libdir)
2331 (copy-recursively "include" (string-append out "/include"))
2332 (when (file-exists? "libseq/libmpiseq.a")
2333 (install-file "libseq/libmpiseq.a" libdir))
2334 (when (file-exists? "libseq/libmpiseq.so")
2335 (install-file "libseq/libmpiseq.so" libdir))
2337 (home-page "http://mumps.enseeiht.fr")
2338 (synopsis "Multifrontal sparse direct solver")
2340 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2341 sparse system of linear equations A x = b using Gaussian elimination.")
2342 (license license:cecill-c)))
2344 (define-public mumps-metis
2345 (package (inherit mumps)
2346 (name "mumps-metis")
2348 (alist-delete "scotch" (package-inputs mumps)))))
2350 (define-public mumps-openmpi
2351 (package (inherit mumps)
2352 (name "mumps-openmpi")
2355 ("scalapack" ,scalapack)
2356 ("pt-scotch" ,pt-scotch)
2357 ,@(alist-delete "scotch" (package-inputs mumps))))
2359 (substitute-keyword-arguments (package-arguments mumps)
2361 `(modify-phases ,phases
2362 (add-before 'check 'mpi-setup
2366 ((assoc-ref ,phases 'check)
2367 #:exec-prefix '("mpirun" "-n" "2"))))))))
2368 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2370 (define-public mumps-metis-openmpi
2371 (package (inherit mumps-openmpi)
2372 (name "mumps-metis-openmpi")
2374 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2376 (define-public ruby-asciimath
2378 (name "ruby-asciimath")
2383 (uri (rubygems-uri "asciimath" version))
2386 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2387 (build-system ruby-build-system)
2390 (modify-phases %standard-phases
2392 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2393 (add-after 'unpack 'patch-remove-spurious-backslashes
2395 (substitute* "spec/parser_spec.rb"
2400 `(("bundler" ,bundler)
2401 ("ruby-rspec" ,ruby-rspec)))
2402 (synopsis "AsciiMath parsing and conversion library")
2404 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2405 easy-to-write markup language for mathematics.")
2406 (home-page "https://github.com/asciidoctor/asciimath")
2407 (license license:expat)))
2409 (define-public superlu
2416 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2417 "superlu_" version ".tar.gz"))
2419 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2420 (modules '((guix build utils)))
2422 ;; Replace the non-free implementation of MC64 with a stub adapted
2425 (use-modules (ice-9 regex)
2427 (call-with-output-file "SRC/mc64ad.c"
2432 void mc64id_(int *a) {
2433 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2436 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2437 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2438 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2441 ;; Remove the corresponding license verbiage. MC64 license follows
2442 ;; a "------" line separator.
2443 (with-atomic-file-replacement "License.txt"
2444 (let ((rx (make-regexp "-{8}")))
2447 (let ((line (read-line in 'concat)))
2448 (unless (regexp-exec rx line)
2452 (build-system cmake-build-system)
2456 `(("blas" ,openblas)
2457 ("gfortran" ,gfortran)))
2459 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2460 "-DTPL_BLAS_LIBRARIES=openblas"
2461 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2462 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2463 (synopsis "Supernodal direct solver for sparse linear systems")
2465 "SuperLU is a general purpose library for the direct solution of large,
2466 sparse, nonsymmetric systems of linear equations on high performance machines.
2467 The library is written in C and is callable from either C or Fortran. The
2468 library routines perform an LU decomposition with partial pivoting and
2469 triangular system solves through forward and back substitution. The library
2470 also provides threshold-based ILU factorization preconditioners.")
2471 (license (list license:bsd-3
2472 license:gpl2+ ;EXAMPLE/*fgmr.c
2473 (license:fsf-free "file://SRC/colamd.h")))))
2475 (define-public superlu-dist
2477 (name "superlu-dist")
2482 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2483 "superlu_dist_" version ".tar.gz"))
2485 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2486 (modules '((guix build utils)))
2488 ;; Replace the non-free implementation of MC64 with a stub
2490 (call-with-output-file "SRC/mc64ad_dist.c"
2495 void mc64id_dist(int *a) {
2496 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2499 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2500 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2501 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2504 (substitute* "SRC/util.c" ;adjust default algorithm
2505 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2506 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2507 ;; general (i.e. non-square) processor-grid support.
2508 "RowPerm = NOROWPERM;"))
2510 (patches (search-patches "superlu-dist-scotchmetis.patch"
2511 "superlu-dist-awpm-grid.patch"))))
2512 (build-system cmake-build-system)
2516 `(("gfortran" ,gfortran)
2519 ("combblas" ,combinatorial-blas)))
2521 `(("mpi" ,openmpi) ;headers include MPI heades
2522 ("parmetis" ,pt-scotch32 "metis")
2523 ("pt-scotch" ,pt-scotch32)))
2525 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2526 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2527 "-DTPL_ENABLE_COMBBLASLIB=YES"
2528 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2529 "-DTPL_LAPACK_LIBRARIES=-llapack"
2530 (string-append "-DTPL_PARMETIS_LIBRARIES="
2532 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2533 "scotchmetis" "scotch" "scotcherr")
2535 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2536 (assoc-ref %build-inputs "parmetis")
2538 "-DTPL_ENABLE_COMBBLASLIB=ON"
2539 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2540 (assoc-ref %build-inputs "combblas")
2541 "/include/CombBLAS;"
2542 (assoc-ref %build-inputs "combblas")
2543 "/include/BipartiteMatchings")
2544 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2546 (modify-phases %standard-phases
2547 (add-before 'configure 'set-c++-standard
2549 (substitute* "CMakeLists.txt"
2550 ;; AWPM headers require C++14
2551 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2552 (add-before 'check 'mpi-setup
2554 (add-before 'check 'omp-setup
2555 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2556 (home-page (package-home-page superlu))
2557 (synopsis "Parallel supernodal direct solver")
2559 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2560 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2561 implemented in ANSI C, and MPI for communications.")
2562 (license license:bsd-3)))
2564 (define-public scotch
2571 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2572 "latestfile/298/scotch_" version ".tar.gz"))
2574 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2575 (patches (search-patches "scotch-build-parallelism.patch"
2576 "scotch-integer-declarations.patch"))))
2577 (build-system gnu-build-system)
2582 (outputs '("out" "metis"))
2584 `(#:make-flags (list (string-append "prefix=" %output))
2586 (modify-phases %standard-phases
2588 'unpack 'chdir-to-src
2589 (lambda _ (chdir "src") #t))
2593 (call-with-output-file "Makefile.inc"
2607 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2608 LDFLAGS = -lz -lm -lrt -lpthread
2610 LEX = flex -Pscotchyy -olex.yy.c
2615 YACC = bison -pscotchyy -y -b y
2617 '("COMMON_FILE_COMPRESS_GZ"
2619 "COMMON_RANDOM_FIXED_SEED"
2620 "INTSIZE64" ;use 'int64_t'
2621 ;; Prevents symbolc clashes with libesmumps
2623 ;; XXX: Causes invalid frees in superlu-dist tests
2625 ;; "SCOTCH_PTHREAD_NUMBER=2"
2626 "restrict=__restrict"))))
2628 (add-after 'build 'build-esmumps
2631 (format #f "-j~a" (parallel-job-count))
2633 (add-before 'install 'make-install-dirs
2634 (lambda* (#:key outputs #:allow-other-keys)
2635 (mkdir (assoc-ref outputs "out"))))
2636 (add-after 'install 'install-metis
2637 (lambda* (#:key outputs #:allow-other-keys)
2638 (let ((out (assoc-ref outputs "metis")))
2640 ;; metis files are not installed with 'make install'
2641 (for-each (lambda (f)
2642 (install-file f (string-append out "/include")))
2643 (find-files "../include/" ".*metis\\.h"))
2644 (for-each (lambda (f)
2645 (install-file f (string-append out "/lib")))
2646 (find-files "../lib/" ".*metis\\..*"))
2648 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2649 (synopsis "Programs and libraries for graph algorithms")
2650 (description "SCOTCH is a set of programs and libraries which implement
2651 the static mapping and sparse matrix reordering algorithms developed within
2652 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2653 conquer approach, to scientific computing problems such as graph and mesh
2654 partitioning, static mapping, and sparse matrix ordering, in application
2655 domains ranging from structural mechanics to operating systems or
2657 ;; See LICENSE_en.txt
2658 (license license:cecill-c)))
2660 (define-public scotch32
2661 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2662 ;; some applications.
2663 (package (inherit scotch)
2666 (substitute-keyword-arguments (package-arguments scotch)
2667 ((#:phases scotch-phases)
2668 `(modify-phases ,scotch-phases
2672 (call-with-output-file "Makefile.inc"
2686 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2687 LDFLAGS = -lz -lm -lrt -lpthread
2689 LEX = flex -Pscotchyy -olex.yy.c
2694 YACC = bison -pscotchyy -y -b y
2696 '("COMMON_FILE_COMPRESS_GZ"
2698 "COMMON_RANDOM_FIXED_SEED"
2699 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2700 ;; Prevents symbolc clashes with libesmumps
2702 ;; XXX: Causes invalid frees in superlu-dist tests
2704 ;; "SCOTCH_PTHREAD_NUMBER=2"
2705 "restrict=__restrict"))))))))))
2707 "Programs and libraries for graph algorithms (32-bit integers)")))
2709 (define-public pt-scotch
2710 (package (inherit scotch)
2713 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2715 (substitute-keyword-arguments (package-arguments scotch)
2716 ((#:phases scotch-phases)
2717 `(modify-phases ,scotch-phases
2721 (invoke "make" (format #f "-j~a" (parallel-job-count))
2722 "ptscotch" "ptesmumps")
2724 ;; Install the serial metis compatibility library
2725 (invoke "make" "-C" "libscotchmetis" "install")))
2726 (add-before 'check 'mpi-setup
2730 (invoke "make" "ptcheck")))))))
2731 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2733 (define-public pt-scotch32
2734 (package (inherit scotch32)
2735 (name "pt-scotch32")
2737 `(("openmpi" ,openmpi))) ;headers include MPI headers
2739 (substitute-keyword-arguments (package-arguments scotch32)
2740 ((#:phases scotch32-phases)
2741 `(modify-phases ,scotch32-phases
2744 (invoke "make" (format #f "-j~a" (parallel-job-count))
2745 "ptscotch" "ptesmumps")
2746 ;; Install the serial metis compatibility library
2747 (invoke "make" "-C" "libscotchmetis" "install")))
2748 (add-before 'check 'mpi-setup
2752 (invoke "make" "ptcheck")))))))
2754 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2756 (define-public metis
2763 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2764 "metis-" version ".tar.gz"))
2767 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2768 (build-system cmake-build-system)
2770 `(("blas" ,openblas)))
2772 `(#:tests? #f ;no tests
2773 #:configure-flags `("-DSHARED=ON"
2774 ,(string-append "-DGKLIB_PATH=" (getcwd)
2775 "/metis-" ,version "/GKlib"))))
2776 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2777 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2779 "METIS is a set of serial programs for partitioning graphs, partitioning
2780 finite element meshes, and producing fill-reducing orderings for sparse
2781 matrices. The algorithms implemented in METIS are based on the multilevel
2782 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2784 (license license:asl2.0))) ;As of version 5.0.3
2786 (define-public p4est
2793 (uri (string-append "http://p4est.github.io/release/p4est-"
2797 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2798 (build-system gnu-build-system)
2800 `(("fortran" ,gfortran)
2805 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2806 (assoc-ref %build-inputs "blas")
2808 ,(string-append "LAPACK_LIBS=-L"
2809 (assoc-ref %build-inputs "lapack")
2811 #:phases (modify-phases %standard-phases
2812 (add-before 'check 'mpi-setup
2814 (home-page "http://www.p4est.org")
2815 (synopsis "Adaptive mesh refinement on forests of octrees")
2817 "The p4est software library enables the dynamic management of a
2818 collection of adaptive octrees, conveniently called a forest of octrees.
2819 p4est is designed to work in parallel and scales to hundreds of thousands of
2821 (license license:gpl2+)))
2823 (define-public p4est-openmpi
2824 (package (inherit p4est)
2825 (name "p4est-openmpi")
2828 ,@(package-inputs p4est)))
2830 (substitute-keyword-arguments (package-arguments p4est)
2831 ((#:configure-flags cf)
2832 ``("--enable-mpi" ,@,cf))))
2833 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2835 (define-public gsegrafix
2842 (uri (string-append "mirror://gnu/" name "/" name "-"
2846 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2847 (build-system gnu-build-system)
2849 `(#:configure-flags '("LDFLAGS=-lm")))
2851 `(("libgnomecanvas" ,libgnomecanvas)
2852 ("libbonoboui" ,libbonoboui)
2853 ("libgnomeui" ,libgnomeui)
2854 ("libgnomeprintui" ,libgnomeprintui)
2857 `(("pkg-config" ,pkg-config)))
2858 (home-page "https://www.gnu.org/software/gsegrafix/")
2859 (synopsis "GNOME application to create scientific and engineering plots")
2860 (description "GSEGrafix is an application which produces high-quality graphical
2861 plots for science and engineering. Plots are specified via simple ASCII
2862 parameter files and data files and are presented in an anti-aliased GNOME
2863 canvas. The program supports rectangular two-dimensional plots, histograms,
2864 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2865 to BMP, JPEG or PNG image formats.")
2866 (license license:gpl3+)))
2868 (define-public maxima
2875 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2876 version "-source/" name "-" version ".tar.gz"))
2879 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2880 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2881 (build-system gnu-build-system)
2884 ("gnuplot" ,gnuplot) ;for plots
2886 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2888 `(("texinfo" ,texinfo)
2890 ("python" ,python)))
2893 (list "--enable-gcl"
2894 (string-append "--with-posix-shell="
2895 (assoc-ref %build-inputs "bash")
2897 (string-append "--with-wish="
2898 (assoc-ref %build-inputs "tk")
2900 (let ((v ,(package-version tk)))
2901 (string-take v (string-index-right v #\.)))))
2902 ;; By default Maxima attempts to write temporary files to
2903 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2904 ;; Work around that.
2905 #:make-flags (list "TMPDIR=/tmp")
2907 (modify-phases %standard-phases
2908 (add-after 'unpack 'patch-paths
2909 (lambda* (#:key inputs #:allow-other-keys)
2910 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2911 (coreutils (assoc-ref inputs "coreutils"))
2912 (dirname (string-append coreutils "/bin/dirname"))
2913 (head (string-append coreutils "/bin/head"))
2914 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2915 (python (string-append (assoc-ref inputs "python")
2917 (substitute* "src/maxima.in"
2918 (("sed ") (string-append sed " "))
2919 (("dirname") dirname)
2921 (substitute* "doc/info/Makefile.in"
2922 (("/usr/bin/env perl") perl))
2923 (substitute* "doc/info/build_html.sh.in"
2924 (("python") python))
2926 (add-before 'check 'pre-check
2928 (chmod "src/maxima" #o555)
2932 ;; This is derived from the testing code in the "debian/rules" file
2933 ;; of Debian's Maxima package.
2934 ;; If Maxima can successfully run this, the binary to be installed
2940 "--batch-string=\"run_testsuite();\" "
2941 "| grep -q \"No unexpected errors found\""))))
2942 ;; Make sure the doc and emacs files are found in the
2943 ;; standard location. Also configure maxima to find gnuplot
2944 ;; without having it on the PATH.
2945 (add-after 'install 'post-install
2946 (lambda* (#:key outputs inputs #:allow-other-keys)
2947 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2948 (out (assoc-ref outputs "out"))
2949 (datadir (string-append out "/share/maxima/" ,version))
2950 (binutils (string-append (assoc-ref inputs "binutils")
2952 (with-directory-excursion out
2953 (mkdir-p "share/emacs")
2954 (mkdir-p "share/doc")
2956 (string-append datadir "/doc/")
2957 (string-append out "/share/doc/maxima"))
2958 (with-atomic-file-replacement
2959 (string-append datadir "/share/maxima-init.lisp")
2961 (format out "~a ~s~a~%"
2962 "(setf $gnuplot_command "
2963 (string-append gnuplot "/bin/gnuplot") ")")
2964 (dump-port in out))))
2965 ;; Ensure that Maxima will have access to the GNU binutils
2966 ;; components at runtime.
2967 (wrap-program (string-append out "/bin/maxima")
2968 `("PATH" prefix (,binutils))))
2970 (home-page "http://maxima.sourceforge.net")
2971 (synopsis "Numeric and symbolic expression manipulation")
2972 (description "Maxima is a system for the manipulation of symbolic and
2973 numerical expressions. It yields high precision numeric results by using
2974 exact fractions, arbitrary precision integers, and variable precision floating
2976 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2977 ;; Others simply say "GNU General Public License" without stating a
2978 ;; version (which implicitly means gpl1+).
2979 ;; At least one file (src/maxima.asd) says "version 2."
2980 ;; GPLv2 only is therefore the smallest subset.
2981 (license license:gpl2)))
2983 (define-public wxmaxima
2991 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2992 (commit (string-append "Version-" version))))
2993 (file-name (git-file-name name version))
2995 (base32 "18fj2m1qwlbavivpixph112wq9hxy3hh7c8q07djc3bhrzf2a7v7"))))
2996 (build-system cmake-build-system)
2998 `(("gettext" ,gettext-minimal)))
3000 `(("wxwidgets" ,wxwidgets)
3003 ("adwaita-icon-theme" ,adwaita-icon-theme)
3005 ("shared-mime-info" ,shared-mime-info)))
3007 `(#:tests? #f ; no check target
3009 (modify-phases %standard-phases
3010 (add-after 'install 'wrap-program
3011 (lambda* (#:key inputs outputs #:allow-other-keys)
3012 (wrap-program (string-append (assoc-ref outputs "out")
3015 (,(string-append (assoc-ref inputs "maxima")
3017 ;; For GtkFileChooserDialog.
3018 `("GSETTINGS_SCHEMA_DIR" =
3019 (,(string-append (assoc-ref inputs "gtk+")
3020 "/share/glib-2.0/schemas")))
3021 `("XDG_DATA_DIRS" ":" prefix
3022 (;; Needed by gdk-pixbuf to know supported icon formats.
3024 (assoc-ref inputs "shared-mime-info") "/share")
3025 ;; The default icon theme of GTK+.
3027 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3029 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3030 (synopsis "Graphical user interface for the Maxima computer algebra system")
3032 "wxMaxima is a graphical user interface for the Maxima computer algebra
3033 system. It eases the use of Maxima by making most of its commands available
3034 through a menu system and by providing input dialogs for commands that require
3035 more than one argument. It also implements its own display engine that
3036 outputs mathematical symbols directly instead of depicting them with ASCII
3039 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3040 text and mathematical calculations to create documents, exporting of input and
3041 output to TeX, and a browser for Maxima's manual including command index and
3042 full text searching.")
3043 (license license:gpl2+)))
3045 (define-public armadillo
3051 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3055 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3056 (build-system cmake-build-system)
3057 (arguments `(#:tests? #f)) ; no test target
3059 `(("openblas" ,openblas)
3061 ("arpack" ,arpack-ng)))
3062 (home-page "http://arma.sourceforge.net/")
3063 (synopsis "C++ linear algebra library")
3065 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3066 between speed and ease of use. It is useful for algorithm development
3067 directly in C++, or quick conversion of research code into production
3068 environments. It can be used for machine learning, pattern recognition,
3069 signal processing, bioinformatics, statistics, econometrics, etc. The library
3070 provides efficient classes for vectors, matrices and cubes, as well as 150+
3071 associated functions (eg. contiguous and non-contiguous submatrix views).")
3072 (license license:asl2.0)))
3074 (define-public muparser
3075 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3076 ;; different hash. In order to make `guix package --upgrade` work correctly,
3077 ;; we set a Guix packaging revision.
3078 ;; When the next version of muparser is released, we can remove
3079 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3080 (let ((upstream-version "2.2.5")
3084 (version (string-append upstream-version "-" revision))
3089 (url "https://github.com/beltoforion/muparser.git")
3090 (commit (string-append "v" upstream-version))))
3091 (file-name (git-file-name name version))
3093 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3094 (build-system gnu-build-system)
3096 `(#:configure-flags '("--enable-samples=no")
3097 #:tests? #f)) ;no "check" target
3098 (home-page "http://muparser.beltoforion.de/")
3099 (synopsis "Fast parser library for mathematical expressions")
3101 "muParser is an extensible high performance math parser library. It is
3102 based on transforming an expression into a bytecode and precalculating constant
3104 (license license:expat))))
3106 (define-public openblas
3113 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3114 version "%20version.tar.gz"))
3115 (file-name (string-append name "-" version ".tar.gz"))
3118 "0jbdjsi0qsxahdcm42agnn1y7xpmg0hrhwjsxg0zbhs9wwy3p568"))))
3119 (build-system gnu-build-system)
3121 `(#:test-target "test"
3122 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3123 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3124 ;; we need to disable substitutions.
3126 ,(let ((system (or (%current-target-system) (%current-system))))
3127 (or (string-prefix? "x86_64" system)
3128 (string-prefix? "i686" system)
3129 (string-prefix? "mips" system)
3130 (string-prefix? "aarch64" system)))
3132 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3134 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3136 ;; This is the maximum number of threads OpenBLAS will ever use (that
3137 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3138 ;; is used.) If we don't set it, the makefile sets it to the number
3139 ;; of cores of the build machine, which is obviously wrong.
3142 ;; Build the library for all supported CPUs. This allows
3143 ;; switching CPU targets at runtime with the environment variable
3144 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3145 ;; Unfortunately, this is not supported on non-x86 architectures,
3146 ;; where it leads to failed builds.
3147 ,@(let ((system (or (%current-target-system) (%current-system))))
3149 ((or (string-prefix? "x86_64" system)
3150 (string-prefix? "i686" system))
3151 '("DYNAMIC_ARCH=1"))
3152 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3153 ;; two available MIPS targets special extended instructions
3154 ;; for Loongson cores are used.
3155 ((string-prefix? "mips" system)
3156 '("TARGET=SICORTEX"))
3157 ;; On aarch64 force the generic 'armv8-a' target
3158 ((string-prefix? "aarch64" system)
3161 ;; no configure script
3163 (modify-phases %standard-phases
3165 (add-before 'build 'set-extralib
3166 (lambda* (#:key inputs #:allow-other-keys)
3167 ;; Get libgfortran found when building in utest.
3169 (string-append "-L" (assoc-ref inputs "fortran-lib")
3173 `(("fortran-lib" ,gfortran "lib")))
3176 ("fortran" ,gfortran)
3178 (home-page "http://www.openblas.net/")
3179 (synopsis "Optimized BLAS library based on GotoBLAS")
3181 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3182 (license license:bsd-3)))
3184 (define-public openblas-ilp64
3185 (package/inherit openblas
3186 (name "openblas-ilp64")
3187 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3189 (substitute-keyword-arguments (package-arguments openblas)
3190 ((#:make-flags flags '())
3191 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3193 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3194 (license license:bsd-3)))
3196 (define* (make-blis implementation #:optional substitutable?)
3197 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3198 source tree for a list of implementations.)
3200 SUBSTITUTABLE? determines whether the package is made available as a
3203 Currently the specialization must be selected at configure-time, but work is
3204 underway to allow BLIS to select the right optimized kernels at run time:
3205 <https://github.com/flame/blis/issues/129>."
3207 (name (if (string=? implementation "reference")
3209 (string-append "blis-" implementation)))
3211 (home-page "https://github.com/flame/blis")
3214 (uri (git-reference (url home-page) (commit version)))
3217 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3218 (file-name (git-file-name "blis" version))))
3219 (build-system gnu-build-system)
3221 `(#:test-target "test"
3223 #:substitutable? ,substitutable?
3225 #:phases (modify-phases %standard-phases
3227 (lambda* (#:key outputs #:allow-other-keys)
3228 ;; This is a home-made 'configure' script.
3229 (let ((out (assoc-ref outputs "out")))
3230 (invoke "./configure" "-p" out
3234 "--enable-threading=openmp"
3237 (add-before 'check 'show-test-output
3239 ;; By default "make check" is silent. Make it verbose.
3240 (system "tail -F output.testsuite &")
3242 (synopsis "High-performance basic linear algebra (BLAS) routines")
3244 "BLIS is a portable software framework for instantiating high-performance
3245 BLAS-like dense linear algebra libraries. The framework was designed to
3246 isolate essential kernels of computation that, when optimized, immediately
3247 enable optimized implementations of most of its commonly used and
3248 computationally intensive operations. While BLIS exports a new BLAS-like API,
3249 it also includes a BLAS compatibility layer which gives application developers
3250 access to BLIS implementations via traditional BLAS routine calls.")
3251 (license license:bsd-3)))
3254 ;; This is the "reference" implementation, which is the non-optimized but
3255 ;; portable variant (no assembly).
3256 (make-blis "reference" #t))
3258 (define ignorance blis)
3260 (define-syntax-rule (blis/x86_64 processor)
3261 "Expand to a package specialized for PROCESSOR."
3263 (inherit (make-blis processor))
3264 (supported-systems '("x86_64-linux"))))
3266 (define-public blis-sandybridge
3267 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3268 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3269 (blis/x86_64 "sandybridge"))
3271 (define-public blis-haswell
3272 ;; BLIS specialized for Haswell processors (launched 2013):
3273 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3274 (blis/x86_64 "haswell"))
3276 (define-public blis-knl
3277 ;; BLIS specialized for Knights Landing processor (launched 2016):
3278 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3279 (blis/x86_64 "knl"))
3282 (define-public openlibm
3290 (url "https://github.com/JuliaLang/openlibm.git")
3291 (commit (string-append "v" version))))
3292 (file-name (git-file-name name version))
3294 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3295 (build-system gnu-build-system)
3298 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3300 ;; no configure script
3301 (modify-phases %standard-phases (delete 'configure))
3302 #:tests? #f)) ;the tests are part of the default target
3303 (home-page "http://openlibm.org/")
3304 (synopsis "Portable C mathematical library (libm)")
3306 "OpenLibm is an effort to have a high quality, portable, standalone C
3307 mathematical library (libm). It can be used standalone in applications and
3308 programming language implementations. The project was born out of a need to
3309 have a good libm for the Julia programming language that worked consistently
3310 across compilers and operating systems, and in 32-bit and 64-bit
3312 ;; Each architecture has its own make target, and there is none for mips.
3313 (supported-systems (delete "mips64el-linux" %supported-systems))
3314 ;; See LICENSE.md for details.
3315 (license (list license:expat
3318 license:public-domain
3319 license:lgpl2.1+))))
3321 (define-public openspecfun
3323 (name "openspecfun")
3329 (url "https://github.com/JuliaLang/openspecfun.git")
3330 (commit (string-append "v" version))))
3331 (file-name (git-file-name name version))
3333 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3334 (build-system gnu-build-system)
3336 '(#:tests? #f ; no "check" target
3338 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3340 (modify-phases %standard-phases
3341 (delete 'configure)))) ; no configure script
3343 `(("fortran" ,gfortran)))
3344 (home-page "https://github.com/JuliaLang/openspecfun")
3345 (synopsis "Collection of special mathematical functions")
3347 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3348 portable package for Bessel Functions of a Complex Argument and Nonnegative
3349 Order; it contains subroutines for computing Bessel functions and Airy
3350 functions. Faddeeva allows computing the various error functions of arbitrary
3351 complex arguments (Faddeeva function, error function, complementary error
3352 function, scaled complementary error function, imaginary error function, and
3353 Dawson function); given these, one can also easily compute Voigt functions,
3354 Fresnel integrals, and similar related functions as well.")
3355 ;; Faddeeva is released under the Expat license; AMOS is included as
3356 ;; public domain software.
3357 (license (list license:expat license:public-domain))))
3359 (define-public suitesparse
3361 (name "suitesparse")
3367 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3371 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3372 (modules '((guix build utils)))
3374 ;; Remove bundled metis source
3376 (delete-file-recursively "metis-5.1.0")
3378 (build-system gnu-build-system)
3380 '(#:tests? #f ;no "check" target
3385 "MY_METIS_LIB=-lmetis"
3386 (string-append "INSTALL_LIB="
3387 (assoc-ref %outputs "out") "/lib")
3388 (string-append "INSTALL_INCLUDE="
3389 (assoc-ref %outputs "out") "/include")
3392 (modify-phases %standard-phases
3393 (delete 'configure)))) ;no configure script
3398 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3399 (synopsis "Suite of sparse matrix software")
3401 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3402 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3403 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3404 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3405 CXSparse, a concise sparse Cholesky factorization package; and many other
3408 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3410 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3411 (license (list license:gpl2+ license:lgpl2.1+))))
3413 (define-public atlas
3419 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3420 version "/atlas" version ".tar.bz2"))
3423 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3424 (build-system gnu-build-system)
3425 (home-page "http://math-atlas.sourceforge.net/")
3426 (inputs `(("gfortran" ,gfortran)
3427 ("lapack-tar" ,(package-source lapack))))
3428 (outputs '("out" "doc"))
3429 ;; For the moment we drop support for MIPS at it fails to compile. See
3430 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3431 (supported-systems (delete "mips64el-linux" %supported-systems))
3433 `(#:parallel-build? #f
3434 #:parallel-tests? #f
3436 ;; ATLAS tunes itself for the machine it is built on, as explained at
3437 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3438 ;; For this reason, we want users to build it locally instead of using
3442 #:modules ((srfi srfi-26)
3443 (guix build gnu-build-system)
3446 `(;; Generate position independent code suitable for dynamic libraries
3447 ;; and use WALL timer to get more accurate timing.
3448 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3451 ,,(if (string-match "64" (%current-system))
3454 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3455 ;; needed to compile C files before it is generated.
3456 "-Ss" "pmake" "make -j 1"
3457 ;; Probe is failing for MIPS. We therefore define the system
3458 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3459 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3460 ,,@(if (string-prefix? "mips" (%current-system))
3461 (list "-A" "49" "-V" "1")
3463 ;; Generate shared libraries.
3465 ;; Build a full LAPACK library.
3466 ,(string-append "--with-netlib-lapack-tarfile="
3467 (assoc-ref %build-inputs "lapack-tar")))
3469 (modify-phases %standard-phases
3470 (add-after 'install 'install-doc
3471 (lambda* (#:key outputs inputs #:allow-other-keys)
3472 (let ((doc (string-append (assoc-ref outputs "doc")
3473 "/share/doc/atlas")))
3475 (for-each (cut install-file <> doc)
3476 (find-files "../ATLAS/doc" ".*"))
3478 (add-after 'check 'check-pt
3479 (lambda _ (invoke "make" "ptcheck")))
3480 ;; Fix files required to run configure.
3481 (add-before 'configure 'fix-/bin/sh
3483 ;; Use `sh', not `/bin/sh'.
3484 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3488 ;; Fix /bin/sh in generated make files.
3489 (add-after 'configure 'fix-/bin/sh-in-generated-files
3491 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3495 ;; ATLAS configure program does not accepts the default flags
3496 ;; passed by the 'gnu-build-system'.
3498 (lambda* (#:key native-inputs inputs outputs
3499 (configure-flags '())
3500 #:allow-other-keys #:rest args)
3501 (let* ((prefix (assoc-ref outputs "out"))
3502 (bash (or (and=> (assoc-ref
3503 (or native-inputs inputs) "bash")
3504 (cut string-append <> "/bin/bash"))
3506 (flags `(,(string-append "--prefix=" prefix)
3508 (abs-srcdir (getcwd))
3509 (srcdir (string-append "../" (basename abs-srcdir))))
3510 (format #t "source directory: ~s (relative from build: ~s)~%"
3514 (format #t "build directory: ~s~%" (getcwd))
3515 (format #t "configure flags: ~s~%" flags)
3517 (string-append srcdir "/configure")
3519 (synopsis "Automatically Tuned Linear Algebra Software")
3521 "ATLAS is an automatically tuned linear algebra software library
3522 providing C and Fortran77 interfaces to a portably efficient BLAS
3523 implementation, as well as a few routines from LAPACK.
3525 Optimization occurs at build time. For this reason, the library is built on
3526 the machine where it is installed, without resorting to pre-built substitutes.
3528 Before building the library, CPU throttling should be disabled. This can be
3529 done in the BIOS, or, on GNU/Linux, with the following command:
3532 # cpupower --governor performance
3535 Failure to do so will result in a library with poor performance.")
3536 (license license:bsd-3)))
3545 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3546 version "/glm-" version ".zip"))
3548 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3549 (patches (search-patches "glm-restore-install-target.patch"))))
3550 (build-system cmake-build-system)
3552 `(("unzip" ,unzip)))
3553 (home-page "https://glm.g-truc.net/")
3554 (synopsis "OpenGL Mathematics library")
3555 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3556 library for graphics software based on the OpenGL Shading Language (GLSL)
3558 (license license:expat)))
3560 (define-public lpsolve
3567 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3568 "/lp_solve_" version "_source.tar.gz"))
3571 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3572 (modules '((guix build utils)))
3575 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3577 ;; Pretend to be on a 64 bit platform to obtain a common directory
3578 ;; name for the build results on all architectures; nothing else
3579 ;; seems to depend on it.
3580 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3582 ;; The check for 'isnan' as it is written fails with
3583 ;; "non-floating-point argument in call to function
3584 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3585 ;; definition, which in turn leads to bad things. Fix the feature
3587 (("isnan\\(0\\)") "isnan(0.)"))
3589 (build-system gnu-build-system)
3591 `(#:tests? #f ; no check target
3593 (modify-phases %standard-phases
3594 (delete 'configure) ; no configure script
3597 (with-directory-excursion "lpsolve55"
3598 (invoke "bash" "ccc"))
3599 (with-directory-excursion "lp_solve"
3600 (invoke "bash" "ccc"))
3603 (lambda* (#:key outputs #:allow-other-keys)
3604 (let* ((out (assoc-ref outputs "out"))
3605 (bin (string-append out "/bin"))
3606 (lib (string-append out "/lib"))
3607 ;; This is where LibreOffice expects to find the header
3608 ;; files, and where they are installed by Debian.
3609 (include (string-append out "/include/lpsolve")))
3610 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3611 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3612 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3614 ;; Install a subset of the header files as on Debian
3615 ;; (plus lp_bit.h, which matches the regular expression).
3616 (for-each (lambda (name)
3617 (install-file name include))
3618 (find-files "." "lp_[HMSa-z].*\\.h$"))
3619 (with-directory-excursion "shared"
3620 (for-each (lambda (name)
3621 (install-file name include))
3622 (find-files "." "\\.h$")))
3624 (home-page "http://lpsolve.sourceforge.net/")
3625 (synopsis "Mixed integer linear programming (MILP) solver")
3627 "lp_solve is a mixed integer linear programming solver based on the
3628 revised simplex and the branch-and-bound methods.")
3629 (license license:lgpl2.1+)))
3631 (define-public dealii
3638 (uri (string-append "https://github.com/dealii/dealii/releases/"
3639 "download/v" version "/dealii-" version ".tar.gz"))
3642 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3643 (modules '((guix build utils)))
3645 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3647 (delete-file-recursively "bundled")
3649 (build-system cmake-build-system)
3657 ("arpack" ,arpack-ng)
3658 ("muparser" ,muparser)
3659 ("gfortran" ,gfortran)
3660 ("suitesparse" ,suitesparse))) ;for UMFPACK
3662 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3664 ;; Work around a bug in libsuitesparseconfig linking
3665 ;; see https://github.com/dealii/dealii/issues/4745
3666 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3667 (home-page "https://www.dealii.org")
3668 (synopsis "Finite element library")
3670 "Deal.II is a C++ program library targeted at the computational solution
3671 of partial differential equations using adaptive finite elements. The main
3672 aim of deal.II is to enable rapid development of modern finite element codes,
3673 using among other aspects adaptive meshes and a wide array of tools often used
3674 in finite element programs.")
3675 (license license:lgpl2.1+)))
3677 (define-public dealii-openmpi
3678 (package (inherit dealii)
3679 (name "dealii-openmpi")
3682 ;;Supported only with MPI:
3683 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3684 ("p4est" ,p4est-openmpi)
3685 ("petsc" ,petsc-openmpi)
3686 ("slepc" ,slepc-openmpi)
3687 ("metis" ,metis) ;for MUMPS
3688 ("scalapack" ,scalapack) ;for MUMPS
3689 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3690 ("arpack" ,arpack-ng-openmpi)
3691 ,@(fold alist-delete (package-inputs dealii)
3692 '("p4est" "arpack"))))
3694 (substitute-keyword-arguments (package-arguments dealii)
3695 ((#:configure-flags cf)
3696 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3698 ((#:phases phases '%standard-phases)
3699 `(modify-phases ,phases
3700 (add-before 'check 'mpi-setup
3701 ,%openmpi-setup)))))
3702 (synopsis "Finite element library (with MPI support)")))
3704 (define-public flann
3713 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3714 version "-src.zip"))
3717 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3718 (patches (search-patches "flann-cmake-3.11.patch"))))
3719 (build-system cmake-build-system)
3721 "octave")) ;46 MiB .mex file that pulls Octave
3723 `(("unzip" ,unzip)))
3726 ("octave" ,octave-cli)
3727 ("python" ,python-2) ; print syntax
3728 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3731 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3732 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3733 #:strip-directories '("lib" "lib64" "libexec"
3734 "bin" "sbin" "share/flann/octave")
3736 ;; Save 12 MiB by not installing .a files. Passing
3737 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3738 #:phases (modify-phases %standard-phases
3739 (add-before 'configure 'set-octave-directory
3740 (lambda* (#:key outputs #:allow-other-keys)
3741 ;; Install the .mex file in the "octave" output.
3742 (let ((out (assoc-ref outputs "octave")))
3743 (substitute* "src/matlab/CMakeLists.txt"
3744 (("share/flann/octave")
3745 (string-append out "/share/flann/octave")))
3747 (add-after 'install 'remove-static-libraries
3748 (lambda* (#:key outputs #:allow-other-keys)
3749 (let* ((out (assoc-ref outputs "out"))
3750 (lib (string-append out "/lib")))
3751 (for-each delete-file
3752 (find-files lib "\\.a$"))
3755 #:tests? #f)) ; The test data are downloaded from the Internet.
3756 (home-page "http://www.cs.ubc.ca/research/flann/")
3757 (synopsis "Library for approximate nearest neighbors computation")
3758 (description "FLANN is a library for performing fast approximate
3759 nearest neighbor searches in high dimensional spaces. It implements a
3760 collection of algorithms and a system for automatically choosing the best
3761 algorithm and optimum parameters depending on the dataset.
3763 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3764 (license (license:non-copyleft "file://COPYING"
3765 "See COPYING in the distribution."))))
3767 (define-public wcalc
3774 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3775 "wcalc-" version ".tar.bz2"))
3778 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3779 (build-system gnu-build-system)
3782 ("readline" ,readline)))
3783 (home-page "http://w-calc.sourceforge.net/index.php")
3784 (synopsis "Flexible command-line scientific calculator")
3785 (description "Wcalc is a very capable calculator. It has standard functions
3786 (sin, asin, and sinh for example, in either radians or degrees), many
3787 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3788 variables, a command history, hex/octal/binary input and output, unit
3789 conversions, embedded comments, and an expandable expression entry field. It
3790 evaluates expressions using the standard order of operations.")
3791 (license license:gpl2+)))
3799 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3800 "/xaos-" version ".tar.gz"))
3803 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3804 (build-system gnu-build-system)
3805 (native-inputs `(("gettext" ,gettext-minimal)))
3806 (inputs `(("libx11" ,libx11)
3811 `(#:tests? #f ;no "check" target
3812 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3813 (synopsis "Real-time fractal zoomer")
3814 (description "GNU XaoS is a graphical program that generates fractal
3815 patterns and allows you to zoom in and out of them infinitely in a fluid,
3816 continuous manner. It also includes tutorials that help to explain how fractals
3817 are built. It can generate many different fractal types such as the Mandelbrot
3819 (home-page "https://www.gnu.org/software/xaos/")
3820 (license license:gpl2+)))
3822 (define-public hypre
3830 (url "https://github.com/LLNL/hypre.git")
3831 (commit (string-append "v" version))))
3832 (file-name (git-file-name name version))
3834 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3835 (modules '((guix build utils)))
3838 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3839 ;; substitute the release date.
3840 (substitute* "src/utilities/HYPRE_utilities.h"
3841 (("Date Compiled: .*$")
3842 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3844 (build-system gnu-build-system)
3845 (outputs '("out" ; 6.1 MiB of headers and libraries
3846 "doc")) ; 4.8 MiB of documentation
3850 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3851 ("texlive" ,(texlive-union (list texlive-xypic
3853 texlive-latex-hyperref
3855 ("ghostscript" ,ghostscript)))
3857 `(("blas" ,openblas)
3858 ("lapack" ,lapack)))
3860 `(#:modules ((srfi srfi-1)
3861 ,@%gnu-build-system-modules)
3862 #:configure-flags '("--enable-shared"
3870 (modify-phases %standard-phases
3871 (add-before 'build 'set-HOME
3873 ;; FIXME: texlive-union does not find the built
3874 ;; metafonts, so it tries to generate them in HOME.
3875 (setenv "HOME" "/tmp")
3877 (add-before 'configure 'chdir-src
3878 (lambda _ (chdir "src")))
3880 (lambda* (#:key build target configure-flags
3881 #:allow-other-keys #:rest args)
3882 (let* ((configure (assoc-ref %standard-phases 'configure)))
3885 (list #:configure-flags
3886 (cons (string-append
3887 "--host=" (or target build))
3888 configure-flags)))))))
3889 (add-after 'build 'build-docs
3891 (invoke "make" "-Cdocs" "pdf" "html")))
3894 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3895 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3896 (invoke "make" "check" "CHECKRUN=")
3897 (for-each (lambda (filename)
3898 (let ((size (stat:size (stat filename))))
3899 (when (positive? size)
3900 (error (format #f "~a size ~d; error indication~%"
3902 (find-files "test" ".*\\.err$"))
3904 (add-after 'install 'install-docs
3905 (lambda* (#:key outputs #:allow-other-keys)
3906 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3907 (let* ((doc (assoc-ref outputs "doc"))
3908 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3909 (with-directory-excursion "docs"
3910 (for-each (lambda (base)
3911 (install-file (string-append base ".pdf") docdir)
3912 (copy-recursively base docdir)) ; html docs
3913 '("HYPRE_usr_manual"
3914 "HYPRE_ref_manual")))
3916 (home-page "http://www.llnl.gov/casc/hypre/")
3917 (synopsis "Library of solvers and preconditioners for linear equations")
3919 "HYPRE is a software library of high performance preconditioners and
3920 solvers for the solution of large, sparse linear systems of equations. It
3921 features multigrid solvers for both structured and unstructured grid
3923 (license license:lgpl2.1)))
3925 (define-public hypre-openmpi
3926 (package (inherit hypre)
3927 (name "hypre-openmpi")
3930 ,@(package-inputs hypre)))
3932 (substitute-keyword-arguments (package-arguments hypre)
3933 ((#:configure-flags flags)
3935 ,@(delete "--without-MPI" ,flags)))
3937 `(modify-phases ,phases
3938 (add-before 'check 'mpi-setup
3939 ,%openmpi-setup)))))
3940 (synopsis "Parallel solvers and preconditioners for linear equations")
3942 "HYPRE is a software library of high performance preconditioners and
3943 solvers for the solution of large, sparse linear systems of equations on
3944 parallel computers. It features parallel multigrid solvers for both
3945 structured and unstructured grid problems.")))
3947 (define-public matio
3954 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3955 "matio-" version ".tar.gz"))
3958 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3959 (build-system gnu-build-system)
3963 (home-page "http://matio.sourceforge.net/")
3964 (synopsis "Library for reading and writing MAT files")
3965 (description "Matio is a library for reading and writing MAT files. It
3966 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3967 (license license:bsd-2)))
3974 (origin (method url-fetch)
3975 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3976 "download/" version "/Vc-" version ".tar.gz"))
3979 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
3980 (build-system cmake-build-system)
3983 '("-DBUILD_TESTING=ON"
3984 ;; By default, Vc will optimize for the CPU of the build machine.
3985 ;; Setting this to "none" makes it create portable binaries. See
3986 ;; "cmake/OptimizeForArchitecture.cmake".
3987 "-DTARGET_ARCHITECTURE=none")
3988 #:phases (modify-phases %standard-phases
3989 (add-after 'unpack 'copy-testdata
3990 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3991 (let ((testdata (assoc-ref (or native-inputs inputs)
3993 (copy-recursively testdata "tests/testdata")
3996 `(("virtest" ,virtest)
3998 ;; This is a submodule in the git project, but not part of the
3999 ;; released sources. See the git branch for the commit to take.
4000 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4004 (url "https://github.com/VcDevel/vc-testdata")
4005 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4006 (file-name (git-file-name "vc-testdata"
4007 (string-take commit 7)))
4010 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4011 (synopsis "SIMD vector classes for C++")
4012 (description "Vc provides portable, zero-overhead C++ types for explicitly
4013 data-parallel programming. It is a library designed to ease explicit
4014 vectorization of C++ code. Its types enable explicitly stating data-parallel
4015 operations on multiple values. The parallelism is therefore added via the type
4016 system. Vc has an intuitive API and provides portability between different
4017 compilers and compiler versions as well as portability between different vector
4018 instruction sets. Thus, an application written with Vc can be compiled for:
4021 @item SSE2 up to SSE4.2 or SSE4a
4024 @item NEON (in development)
4025 @item NVIDIA GPUs / CUDA (in development)
4027 (home-page "https://github.com/VcDevel/Vc")
4028 ;; "No support_???.cpp file exists for this architecture."
4029 (supported-systems '("x86_64-linux" "i686-linux"))
4030 (license license:bsd-3)))
4032 (define-public reducelcs
4033 ;; This is the last commit which is available upstream, no
4034 ;; release happened since 2010.
4035 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4039 (version (string-append "1.0-" revision "." (string-take commit 7)))
4044 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4046 (file-name (string-append name "-" version "-checkout"))
4049 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4050 (build-system gnu-build-system)
4052 `(("openlibm" ,openlibm)))
4054 `(#:tests? #f ; no tests
4056 (modify-phases %standard-phases
4057 (delete 'configure) ; No configure script exists.
4058 (replace 'install ; No install phase exists.
4059 (lambda* (#:key outputs #:allow-other-keys)
4060 (let* ((out (assoc-ref outputs "out"))
4061 (bin (string-append out "/bin")))
4062 (install-file "Approximation" bin)
4063 (install-file "CollectResults" bin)
4064 (install-file "GenerateInstances" bin)
4066 (synopsis "Approximate Longest Commons Subsequence computation tool")
4068 "@code{reduceLCS} is an implementation of the Reduce-Expand
4069 algorithm for LCS. It is a fast program to compute the approximate
4070 Longest Commons Subsequence of a set of strings.")
4071 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4072 (license license:gpl3+))))
4074 (define-public jacal
4081 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4084 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4085 (patches (search-patches "jacal-fix-texinfo.patch"))))
4086 (build-system gnu-build-system)
4089 (modify-phases %standard-phases
4090 (add-before 'build 'pre-build
4091 ;; Don't use upstream's script - it really doesn't fit into
4092 ;; Guix's functional paradigm.
4093 (lambda* (#:key inputs outputs #:allow-other-keys)
4094 (substitute* "Makefile"
4095 (("^install: install-script") "install: "))))
4096 (add-after 'install 'post-install
4097 ;; Instead, we provide our own simplified script.
4098 (lambda* (#:key inputs outputs #:allow-other-keys)
4099 (let ((wrapper (string-append (assoc-ref outputs "out")
4101 (format (open wrapper (logior O_WRONLY O_CREAT))
4102 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4103 "-e '(slib:load \"~a/lib/jacal/math\") "
4106 (assoc-ref inputs "scm")
4107 (assoc-ref outputs "out"))
4108 (chmod wrapper #o555))))
4110 (lambda* (#:key outputs #:allow-other-keys)
4111 (invoke "./configure"
4112 (string-append "--prefix="
4113 (assoc-ref outputs "out"))))))))
4114 (inputs `(("scm" ,scm)))
4115 (native-inputs `(("unzip" ,unzip)
4116 ("texinfo" ,texinfo)))
4117 (synopsis "Symbolic mathematics system")
4118 (description "GNU JACAL is an interactive symbolic mathematics program based on
4119 Scheme. It manipulate and simplify a range of mathematical expressions such
4120 as equations, scalars, vectors, and matrices.")
4121 (home-page "https://www.gnu.org/software/jacal/")
4122 (license license:gpl3+)))
4128 (home-page "https://github.com/Z3Prover/z3")
4131 (uri (git-reference (url home-page)
4132 (commit (string-append "z3-" version))))
4133 (file-name (git-file-name name version))
4136 "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q"))))
4137 (build-system gnu-build-system)
4140 (modify-phases %standard-phases
4141 (add-after 'unpack 'fix-compatability
4142 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4144 (substitute* "src/util/mpz.cpp"
4145 (("#include <immintrin.h>") ""))
4147 (add-before 'configure 'bootstrap
4149 (invoke "python" "scripts/mk_make.py")))
4150 ;; work around gnu-build-system's setting --enable-fast-install
4151 ;; (z3's `configure' is a wrapper around the above python file,
4152 ;; which fails when passed --enable-fast-install)
4154 (lambda* (#:key inputs outputs #:allow-other-keys)
4155 (invoke "./configure"
4156 (string-append "--prefix=" (assoc-ref outputs "out")))))
4157 (add-after 'configure 'change-directory
4161 (add-before 'check 'make-test-z3
4163 ;; Build the test suite executable.
4164 (invoke "make" "test-z3" "-j"
4165 (number->string (parallel-job-count)))))
4168 ;; Run all the tests that don't require arguments.
4169 (invoke "./test-z3" "/a"))))))
4172 ("python" ,python-wrapper)))
4173 (synopsis "Theorem prover")
4174 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4175 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4176 (license license:expat)))
4181 (version "2018.11.001")
4184 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4185 version "/elpa-" version ".tar.gz"))
4188 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4189 (build-system gnu-build-system)
4191 `(("fortran" ,gfortran)
4192 ("perl" ,perl))) ;for configure and deps
4194 `(("blas" ,openblas)))
4199 ;; ELPA unfortunately does not support runtime dispatch, so we can
4200 ;; only enable the "generic" kernels. See the "Cross compilation"
4201 ;; section of INSTALL.md.
4203 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4204 "--disable-avx" "--disable-avx2" "--disable-avx512"
4205 ,(string-append "CFLAGS=-O3 "
4206 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4207 "-ftree-vect-loop-version -ftree-vectorize "
4208 ,(let ((system (or (%current-target-system)
4209 (%current-system))))
4211 ((or (string-prefix? "x86_64" system)
4212 (string-prefix? "i686" system))
4215 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4217 (modify-phases %standard-phases
4218 (add-before 'configure 'patch-header-generation
4220 (substitute* "configure"
4221 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4222 (string-append & " CPP=\"$CPP\"")))
4224 (add-before 'check 'setup-tests
4226 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4227 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4228 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4229 ;; for Fortran. This also causes several tests to pass that
4230 ;; otherwise would otherwise fail with matrix size 5000; possibly
4231 ;; due to floating point tolerances that are too tight.
4232 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4233 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4234 (substitute* "Makefile"
4235 ;; Test scripts are generated, patch the shebang
4236 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4238 (home-page "http://elpa.mpcdf.mpg.de")
4239 (synopsis "Eigenvalue solvers for symmetric matrices")
4241 "The ELPA library provides efficient and scalable direct eigensolvers for
4242 symmetric matrices.")
4243 (license license:lgpl3)))
4245 (define-public elpa-openmpi
4246 (package (inherit elpa)
4247 (name "elpa-openmpi")
4250 ("scalapack" ,scalapack)
4251 ,@(package-inputs elpa)))
4253 (substitute-keyword-arguments (package-arguments elpa)
4254 ((#:configure-flags cf '())
4255 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4256 ((#:phases phases '%standard-phases)
4257 `(modify-phases ,phases
4258 (add-before 'check 'mpi-setup
4260 ;; Tests use 2 mpi tasks by default, use our remaining build
4261 ;; cores as OpenMP threads.
4262 (setenv "OMP_NUM_THREADS" (number->string
4263 (max (quotient (parallel-job-count) 2)
4265 (,%openmpi-setup)))))))
4266 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4268 (define-public elemental
4275 (url "https://github.com/elemental/Elemental.git")
4276 (commit (string-append "v" version))))
4277 (file-name (git-file-name name version))
4280 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4281 (build-system cmake-build-system)
4282 (home-page "https://github.com/elemental/Elemental")
4284 `(("gfortran" ,gfortran)))
4286 `(("blas" ,openblas)
4287 ("gfortran:lib" ,gfortran "lib")
4296 `(#:build-type "Release" ;default RelWithDebInfo not supported
4297 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4298 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4299 "-DEL_CACHE_WARNINGS:BOOL=YES"
4300 "-DEL_TESTS:BOOL=YES"
4301 "-DCMAKE_INSTALL_LIBDIR=lib"
4302 "-DGFORTRAN_LIB=gfortran")
4303 #:phases (modify-phases %standard-phases
4304 (add-before 'check 'mpi-setup
4306 (add-before 'check 'setup-tests
4308 ;; Parallelism is done at the MPI layer.
4309 (setenv "OMP_NUM_THREADS" "1")
4311 (add-after 'install 'remove-tests
4312 (lambda* (#:key outputs #:allow-other-keys)
4313 ;; Tests are installed, with no easy configuration
4314 ;; switch to prevent this, so delete them.
4315 (delete-file-recursively
4316 (string-append (assoc-ref outputs "out") "/bin"))
4318 (synopsis "Dense and sparse-direct linear algebra and optimization")
4319 (description "Elemental is a modern C++ library for distributed-memory
4320 dense and sparse-direct linear algebra, conic optimization, and lattice
4322 (license license:bsd-2)))
4324 (define-public mcrl2
4327 (version "201908.0")
4331 "https://www.mcrl2.org/download/release/mcrl2-"
4335 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4340 ("qtbase" ,qtbase)))
4341 (build-system cmake-build-system)
4342 (synopsis "Toolset for the mCRL2 formal specification language")
4344 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4345 specification language for describing concurrent discrete event systems. Its
4346 toolset supports analysis and automatic verification, linearisation, simulation,
4347 state-space exploration and generation, and tools to optimise and analyse
4348 specifications. Also, state spaces can be manipulated, visualised and
4350 (home-page "https://mcrl2.org")
4351 (license license:boost1.0)))
4353 (define-public mcrl2-minimal
4356 (name "mcrl2-minimal")
4358 `(("boost" ,boost)))
4360 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4362 (define-public tcalc
4369 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4373 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4374 (build-system gnu-build-system)
4375 (synopsis "The terminal calculator")
4377 "The terminal calculator is a small program to help users of the GNU/Linux
4378 terminal do calculations simply and quickly. The formula to be calculated can
4379 be fed to @command{tcalc} through the command line.")
4380 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4381 (license license:gpl3+)))
4383 (define-public sundials
4390 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4391 "sundials-" version ".tar.gz"))
4394 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4395 (build-system cmake-build-system)
4397 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4399 `(("fortran" ,gfortran) ;for fcmix
4401 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4403 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4404 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4405 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4406 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4407 "-DEXAMPLES_INSTALL:BOOL=OFF"
4409 "-DFCMIX_ENABLE:BOOL=ON"
4411 "-DKLU_ENABLE:BOOL=ON"
4412 ,(string-append "-DKLU_INCLUDE_DIR="
4413 (assoc-ref %build-inputs "suitesparse")
4415 ,(string-append "-DKLU_LIBRARY_DIR="
4416 (assoc-ref %build-inputs "suitesparse")
4418 (home-page "https://computation.llnl.gov/projects/sundials")
4419 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4420 (description "SUNDIALS is a family of software packages implemented with
4421 the goal of providing robust time integrators and nonlinear solvers that can
4422 easily be incorporated into existing simulation codes.")
4423 (license license:bsd-3)))
4425 (define-public sundials-openmpi
4426 (package (inherit sundials)
4427 (name "sundials-openmpi")
4430 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4431 ,@(package-inputs sundials)))
4433 (substitute-keyword-arguments (package-arguments sundials)
4434 ((#:configure-flags flags '())
4435 `(cons* "-DMPI_ENABLE:BOOL=ON"
4436 "-DPETSC_ENABLE:BOOL=ON"
4437 (string-append "-DPETSC_INCLUDE_DIR="
4438 (assoc-ref %build-inputs "petsc")
4440 (string-append "-DPETSC_LIBRARY_DIR="
4441 (assoc-ref %build-inputs "petsc")
4444 ((#:phases phases '%standard-phases)
4445 `(modify-phases ,phases
4446 (add-before 'check 'mpi-setup
4447 ,%openmpi-setup)))))
4448 (synopsis "SUNDIALS with OpenMPI support")))
4450 (define-public combinatorial-blas
4452 (name "combinatorial-blas")
4457 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4459 (match (string-split version #\.)
4460 ((major minor patch)
4461 (string-append major minor "_" patch))) ;e.g. "16_2"
4465 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4466 (patches (search-patches "combinatorial-blas-awpm.patch"
4467 "combinatorial-blas-io-fix.patch"))))
4468 (build-system cmake-build-system)
4471 ("test-data" ,(origin
4473 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4474 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4477 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4479 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4480 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4481 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4483 (modify-phases %standard-phases
4484 (add-before 'check 'mpi-setup
4486 (add-before 'check 'test-setup
4487 (lambda* (#:key inputs #:allow-other-keys)
4488 (setenv "OMP_NUM_THREADS" "2")
4489 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4490 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4491 (synopsis "Linear algebra primitives for graph analytics")
4492 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4493 distributed-memory parallel graph library offering a small but powerful set of
4494 linear algebra primitives specifically targeting graph analytics.")
4496 license:gpl2+ ;include/psort/(funnel|sort)*.h
4497 license:x11 ;usort and psort
4498 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4500 (define-public dune-common
4502 (name "dune-common")
4507 (uri (string-append "https://dune-project.org/download/"
4508 version "/dune-common-" version ".tar.gz"))
4511 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4512 (build-system cmake-build-system)
4515 (modify-phases %standard-phases
4516 (add-after 'build 'build-tests
4517 (lambda* (#:key make-flags #:allow-other-keys)
4518 (apply invoke "make" "build_tests" make-flags)))
4519 ;; These tests fail because they require a fully functional MPI
4521 (add-after 'unpack 'disable-failing-tests
4524 (string-append "--exclude-regex '("
4528 "remoteindicestest-mpi-2"
4531 "variablesizecommunicatortest"
4532 "variablesizecommunicatortest-mpi-2"
4533 "arithmetictestsuitetest"
4534 "assertandreturntest"
4535 "assertandreturntest_ndebug"
4538 "mpicollectivecommunication"
4539 "mpicollectivecommunication-mpi-2"
4541 "mpiguardtest-mpi-2"
4543 "mpihelpertest-mpi-2"
4545 "mpihelpertest2-mpi-2")
4552 ("openmpi" ,openmpi)
4553 ("openblas" ,openblas)
4555 ("superlu" ,superlu)))
4557 `(("gfortran" ,gfortran)
4558 ("pkg-config" ,pkg-config)))
4559 (home-page "https://dune-project.org/")
4560 (synopsis "Distributed and Unified Numerics Environment")
4561 (description "DUNE, the Distributed and Unified Numerics Environment is a
4562 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4563 grid-based methods. It supports the easy implementation of methods like
4564 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4565 Differences} (FD).")
4566 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4567 (license license:gpl2)))
4569 (define-public dune-geometry
4571 (name "dune-geometry")
4576 (uri (string-append "https://dune-project.org/download/"
4577 version "/dune-geometry-" version ".tar.gz"))
4580 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4581 (build-system cmake-build-system)
4584 (modify-phases %standard-phases
4585 (add-after 'build 'build-tests
4586 (lambda* (#:key make-flags #:allow-other-keys)
4587 (apply invoke "make" "build_tests" make-flags))))))
4589 `(("dune-common" ,dune-common)
4590 ("openmpi" ,openmpi)
4592 ("openblas" ,openblas)
4594 ("python" ,python)))
4596 `(("gfortran" ,gfortran)
4597 ("pkg-config" ,pkg-config)))
4598 (home-page "https://dune-project.org/")
4599 (synopsis "Distributed and Unified Numerics Environment")
4600 (description "DUNE, the Distributed and Unified Numerics Environment is a
4601 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4602 grid-based methods. It supports the easy implementation of methods like
4603 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4606 This package contains the basic DUNE geometry classes.")
4607 ;; GPL version 2 with "runtime exception"
4608 (license license:gpl2)))
4610 (define-public dune-grid
4617 (uri (string-append "https://dune-project.org/download/"
4618 version "/dune-grid-" version ".tar.gz"))
4621 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4622 (build-system cmake-build-system)
4625 (modify-phases %standard-phases
4626 (add-after 'build 'build-tests
4627 (lambda* (#:key make-flags #:allow-other-keys)
4628 (apply invoke "make" "build_tests" make-flags)))
4629 ;; These tests fail because they require a fully functional MPI
4631 (add-after 'unpack 'disable-failing-tests
4634 (string-append "--exclude-regex '("
4638 "conformvolumevtktest"
4640 "nonconformboundaryvtktest"
4641 "subsamplingvtktest"
4647 "test-dgf-yasp-offset"
4649 "test-geogrid-yaspgrid"
4652 "testiteratorranges"
4653 "test-hierarchicsearch"
4654 "test-parallel-ug-mpi-2"
4655 "test-yaspgrid-backuprestore-equidistant"
4656 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4657 "test-yaspgrid-backuprestore-equidistantoffset"
4658 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4659 "test-yaspgrid-backuprestore-tensor"
4660 "test-yaspgrid-backuprestore-tensor-mpi-2"
4661 "test-yaspgrid-tensorgridfactory"
4662 "test-yaspgrid-tensorgridfactory-mpi-2"
4663 "test-yaspgrid-yaspfactory-1d"
4664 "test-yaspgrid-yaspfactory-1d-mpi-2"
4665 "test-yaspgrid-yaspfactory-2d"
4666 "test-yaspgrid-yaspfactory-2d-mpi-2"
4667 "test-yaspgrid-yaspfactory-3d"
4668 "test-yaspgrid-yaspfactory-3d-mpi-2"
4669 "globalindexsettest"
4670 "persistentcontainertest"
4671 "structuredgridfactorytest"
4672 "tensorgridfactorytest"
4678 `(("dune-common" ,dune-common)
4679 ("dune-geometry" ,dune-geometry)
4682 ("openblas" ,openblas)
4683 ("openmpi" ,openmpi)
4684 ("python" ,python)))
4686 `(("gfortran" ,gfortran)
4687 ("pkg-config" ,pkg-config)))
4688 (home-page "https://dune-project.org/")
4689 (synopsis "Distributed and Unified Numerics Environment")
4690 (description "DUNE, the Distributed and Unified Numerics Environment is a
4691 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4692 grid-based methods. It supports the easy implementation of methods like
4693 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4696 This package contains the basic DUNE grid classes.")
4697 ;; GPL version 2 with "runtime exception"
4698 (license license:gpl2)))
4700 (define-public dune-istl
4707 (uri (string-append "https://dune-project.org/download/"
4708 version "/dune-istl-" version ".tar.gz"))
4711 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4712 (build-system cmake-build-system)
4715 (modify-phases %standard-phases
4716 (add-after 'build 'build-tests
4717 (lambda* (#:key make-flags #:allow-other-keys)
4718 (apply invoke "make" "build_tests" make-flags)))
4719 ;; These tests fail because they require a fully functional MPI
4721 (add-after 'unpack 'disable-failing-tests
4724 (string-append "--exclude-regex '("
4730 "pamg_comm_repart_test"
4738 `(("dune-common" ,dune-common)
4739 ("openmpi" ,openmpi)
4742 ("superlu" ,superlu)
4743 ("openblas" ,openblas)
4745 ("python" ,python)))
4747 `(("gfortran" ,gfortran)
4748 ("pkg-config" ,pkg-config)))
4749 (home-page "https://dune-project.org/")
4750 (synopsis "Distributed and Unified Numerics Environment")
4751 (description "DUNE, the Distributed and Unified Numerics Environment is a
4752 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4755 This is the iterative solver template library which provides generic sparse
4756 matrix/vector classes and a variety of solvers based on these classes. A
4757 special feature is the use of templates to exploit the recursive block
4758 structure of finite element matrices at compile time. Available solvers
4759 include Krylov methods, (block-) incomplete decompositions and
4760 aggregation-based algebraic multigrid.")
4761 ;; GPL version 2 with "runtime exception"
4762 (license license:gpl2)))
4764 (define-public dune-localfunctions
4766 (name "dune-localfunctions")
4771 (uri (string-append "https://dune-project.org/download/"
4772 version "/dune-localfunctions-" version ".tar.gz"))
4775 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4776 (build-system cmake-build-system)
4779 (modify-phases %standard-phases
4780 (add-after 'build 'build-tests
4781 (lambda* (#:key make-flags #:allow-other-keys)
4782 (apply invoke "make" "build_tests" make-flags))))))
4784 `(("dune-common" ,dune-common)
4785 ("dune-geometry" ,dune-geometry)
4786 ("openmpi" ,openmpi)
4789 ("superlu" ,superlu)
4792 `(("gfortran" ,gfortran)
4793 ("pkg-config" ,pkg-config)))
4794 (home-page "https://dune-project.org/")
4795 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4796 (description "This DUNE module provides interface and implementation for
4797 shape functions defined on the DUNE reference elements. In addition to the
4798 shape function, interpolation operators and special keys are provided which
4799 can be used to assemble global function spaces on finite-element grids.
4801 This package provides an interface and implementation for shape functions
4802 defined on the DUNE reference elements. In addition to the shape function,
4803 interpolation operators and special keys are provided which can be used to
4804 assemble global function spaces on finite-element grids.")
4805 ;; GPL version 2 with "runtime exception"
4806 (license license:gpl2)))
4808 (define-public dune-alugrid
4810 (name "dune-alugrid")
4815 (uri (string-append "https://dune-project.org/download/"
4816 version "/dune-alugrid-" version ".tar.gz"))
4819 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4820 (build-system cmake-build-system)
4822 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4825 (modify-phases %standard-phases
4826 (add-after 'unpack 'patch-include
4828 (substitute* "dune/alugrid/test/test-alugrid.cc"
4829 (("doc/grids/gridfactory/testgrids")
4830 "doc/dune-grid/grids/gridfactory/testgrids"))
4832 (add-after 'build 'build-tests
4833 (lambda* (#:key inputs make-flags #:allow-other-keys)
4834 (setenv "CPLUS_INCLUDE_PATH"
4835 (string-append (assoc-ref inputs "dune-grid") "/share"))
4836 (apply invoke "make" "build_tests" make-flags))))))
4838 `(("dune-common" ,dune-common)
4839 ("dune-geometry" ,dune-geometry)
4840 ("dune-grid" ,dune-grid)
4841 ("openmpi" ,openmpi)
4844 ("openblas" ,openblas)
4846 ("superlu" ,superlu)
4850 `(("gfortran" ,gfortran)
4851 ("pkg-config" ,pkg-config)))
4852 (home-page "https://dune-project.org/")
4853 (synopsis "Distributed and Unified Numerics Environment")
4854 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4855 implementation of the DUNE grid interface supporting either simplices or
4857 (license license:gpl2+)))
4859 (define-public dune-typetree
4861 (name "dune-typetree")
4867 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4868 (commit (string-append "v" version))))
4869 (file-name (git-file-name name version))
4872 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4873 (build-system cmake-build-system)
4876 (modify-phases %standard-phases
4877 (add-after 'build 'build-tests
4878 (lambda* (#:key make-flags #:allow-other-keys)
4879 (apply invoke "make" "build_tests" make-flags))))))
4881 `(("dune-common" ,dune-common)
4882 ("openmpi" ,openmpi)
4884 ("openblas" ,openblas)
4887 ("superlu" ,superlu)
4890 `(("gfortran" ,gfortran)
4891 ("pkg-config" ,pkg-config)))
4892 (home-page "https://dune-project.org/")
4893 (synopsis "Distributed and Unified Numerics Environment")
4894 (description "TypeTree is a template library for constructing and
4895 operating on statically typed trees of objects.")
4896 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4897 (license (list license:lgpl3+ license:gpl2))))
4899 (define-public dune-functions
4901 (name "dune-functions")
4907 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4908 (commit (string-append "v" version))))
4909 (file-name (git-file-name name version))
4912 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4913 (build-system cmake-build-system)
4914 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4916 `(("dune-common" ,dune-common)
4917 ("dune-istl" ,dune-istl)
4918 ("dune-localfunctions" ,dune-localfunctions)
4919 ("dune-grid" ,dune-grid)
4920 ("dune-geometry" ,dune-geometry)
4921 ("dune-typetree" ,dune-typetree)
4922 ("openmpi" ,openmpi)
4923 ("openblas" ,openblas)
4926 ("superlu" ,superlu)
4929 `(("gfortran" ,gfortran)
4930 ("pkg-config" ,pkg-config)))
4931 (home-page "https://dune-project.org/")
4932 (synopsis "Distributed and Unified Numerics Environment")
4933 (description "The dune-functions module provides an abstraction layer for
4934 global finite element functions. Its two main concepts are functions
4935 implemented as callable objects, and bases of finite element spaces.")
4936 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4937 (license (list license:lgpl3+ license:gpl2))))
4939 (define-public dune-pdelab
4941 (name "dune-pdelab")
4942 (version "2.6.0-rc1")
4947 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4948 (commit (string-append "v" version))))
4949 (file-name (git-file-name name version))
4952 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4953 (build-system cmake-build-system)
4954 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4956 `(("dune-common" ,dune-common)
4957 ("dune-istl" ,dune-istl)
4958 ("dune-localfunctions" ,dune-localfunctions)
4959 ("dune-geometry" ,dune-geometry)
4960 ("dune-grid" ,dune-grid)
4961 ("dune-typetree" ,dune-typetree)
4962 ("dune-functions" ,dune-functions)
4963 ("openmpi" ,openmpi)
4965 ("openblas" ,openblas)
4969 ("superlu" ,superlu)
4972 `(("gfortran" ,gfortran)
4973 ("pkg-config" ,pkg-config)))
4974 (home-page "https://dune-project.org/")
4975 (synopsis "Differential equations solver toolbox")
4976 (description "PDELab is a partial differential equations solver toolbox
4977 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4978 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4979 (license (list license:lgpl3+ license:gpl2))))
4981 (define-public mlucas
4989 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4991 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
4992 (build-system gnu-build-system)
4994 `(("python2" ,python-2)))
4996 `(#:tests? #f ; no tests
4998 (modify-phases %standard-phases
5002 (call-with-output-file "Makefile"
5004 (format port "CC = gcc
5005 CFLAGS = -O3 ~a -DUSE_THREADS
5006 LDLIBS = -lm -lpthread -lrt
5007 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5009 ,(let ((system (or (%current-target-system)
5010 (%current-system))))
5012 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5016 (lambda* (#:key outputs #:allow-other-keys)
5017 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5018 (install-file "Mlucas" bin)
5019 (install-file "primenet.py" bin))
5021 (home-page "https://www.mersenne.org")
5022 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5023 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5024 numbers in search of a world-record prime. You may use it to test any
5025 suitable number as you wish, but it is preferable that you do so in a
5026 coordinated fashion, as part of the Great Internet Mersenne Prime
5027 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5028 management via the GIMPS project's Primenet server.")
5029 (license license:gpl2+)))
5031 (define-public nauty
5038 "https://pallini.di.uniroma1.it/"
5039 "nauty" (string-join (string-split version #\.) "")
5043 "1p4mxf8q5wm47nxyskxbqwa5p1vvkycv1zgswvnk9nsn6vff0al6"))))
5044 (build-system gnu-build-system)
5045 (outputs '("out" "lib"))
5047 `(#:test-target "checks"
5049 (modify-phases %standard-phases
5050 ;; Default make target does not build all available
5051 ;; executables. Create them now.
5052 (add-after 'build 'build-extra-programs
5054 (for-each (lambda (target) (invoke "make" target))
5055 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5057 ;; Upstream does not provide any install target.
5059 (lambda* (#:key outputs #:allow-other-keys)
5060 (let* ((out (assoc-ref outputs "out"))
5061 (lib-output (assoc-ref outputs "lib"))
5062 (bin (string-append out "/bin"))
5063 (doc (string-append out "/share/doc/nauty/"))
5064 (include (string-append lib-output "/include/nauty"))
5065 (lib (string-append lib-output "/lib/nauty")))
5066 (for-each (lambda (f) (install-file f bin))
5067 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5068 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5069 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5070 "delptg" "directg" "dretodot" "dretog" "genbg"
5071 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5072 "gentourng" "gentreeg" "hamheuristic" "labelg"
5073 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5074 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5075 "sumlines" "twohamg" "vcolg" "watercluster2"))
5076 (for-each (lambda (f) (install-file f include))
5077 (find-files "." "\\.h$"))
5078 (for-each (lambda (f) (install-file f lib))
5079 (find-files "." "\\.a$"))
5080 (for-each (lambda (f) (install-file f doc))
5081 (append '("formats.txt" "README" "schreier.txt")
5082 (find-files "." "\\.pdf$")))))))))
5084 `(("gmp" ,gmp))) ;for sumlines
5085 (home-page "https://pallini.di.uniroma1.it/")
5086 (synopsis "Library for graph automorphisms")
5087 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5088 procedures for computing automorphism groups of graphs and digraphs.
5090 @code{nauty} computes graph information in the form of a set of
5091 generators, the size of the group, and the orbits of the group; it can
5092 also produce a canonical label. The @code{nauty} suite is written in
5093 C and comes with a command-line interface, a collection of
5094 command-line tools, and an Application Programming Interface (API).
5096 This package provides the static libraries required to run programs
5097 compiled against the nauty library.")
5098 (license license:asl2.0)))
5107 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5108 "ftp/releases/" version
5109 "/ppl-" version ".tar.gz"))
5112 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5113 (build-system gnu-build-system)
5119 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5121 "Parma Polyhedra Library for computations with polyhedra")
5123 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5124 especially targeted at applications in the field of analysis and
5125 verification of complex systems. These abstractions include convex
5126 polyhedra, defined as the intersection of a finite number of (open or
5127 closed) halfspaces, each described by a linear inequality (strict or
5128 non-strict) with rational coefficients; some special classes of polyhedra
5129 shapes that offer interesting complexity/precision tradeoffs; and grids
5130 which represent regularly spaced points that satisfy a set of linear
5131 congruence relations. The library also supports finite powersets and
5132 products of (any kind of) polyhedra and grids, a mixed integer linear
5133 programming problem solver using an exact-arithmetic version of the simplex
5134 algorithm, a parametric integer programming solver, and primitives for
5135 termination analysis via the automatic synthesis of linear ranking
5137 (license license:gpl3+)))
5139 (define-public speedcrunch
5141 (name "speedcrunch")
5147 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5148 (commit (string-append "release-" version))))
5149 (file-name (git-file-name name version))
5152 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5153 (build-system cmake-build-system)
5154 (inputs `(("qtbase" ,qtbase)))
5155 (native-inputs `(("qttools" ,qttools)))
5158 (modify-phases %standard-phases
5159 (add-after 'unpack 'chdir-to-src
5160 (lambda _ (chdir "src") #t)))))
5161 (synopsis "High-precision scientific calculator")
5163 "SpeedCrunch is a high-precision scientific calculator. It features a
5164 syntax-highlighted scrollable display and is designed to be fully used via
5165 keyboard. Some distinctive features are auto-completion of functions and
5166 variables, a formula book, and quick insertion of constants from various
5167 fields of knowledge.")
5168 (home-page "http://speedcrunch.org/")
5169 (license license:gpl2+)))
5171 (define-public minisat
5172 ;; This is the last commit which is available upstream, no
5173 ;; release happened since 2010.
5174 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5178 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5183 (url "https://github.com/niklasso/minisat.git")
5185 (file-name (string-append name "-" version "-checkout"))
5188 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5190 (search-patches "minisat-friend-declaration.patch"
5191 "minisat-install.patch"))))
5192 (build-system gnu-build-system)
5194 '(#:make-flags (list (string-append "prefix=" %output))
5195 #:tests? #f ;no check target
5197 (modify-phases %standard-phases
5198 (delete 'configure))))
5200 `(("zlib:static" ,zlib "static")
5203 "Small, yet efficient, SAT solver")
5205 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5206 researchers and developers alike to get started on SAT.")
5208 "http://minisat.se/MiniSat.html")
5209 (license license:expat))))