1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 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 <bandali@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 documentation)
78 #:use-module (gnu packages elf)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages fltk)
81 #:use-module (gnu packages fontutils)
82 #:use-module (gnu packages gettext)
83 #:use-module (gnu packages gcc)
84 #:use-module (gnu packages gd)
85 #:use-module (gnu packages ghostscript)
86 #:use-module (gnu packages graphviz)
87 #:use-module (gnu packages gtk)
88 #:use-module (gnu packages image)
89 #:use-module (gnu packages java)
90 #:use-module (gnu packages less)
91 #:use-module (gnu packages lisp)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages logging)
94 #:use-module (gnu packages lua)
95 #:use-module (gnu packages gnome)
96 #:use-module (gnu packages guile)
97 #:use-module (gnu packages xorg)
98 #:use-module (gnu packages gl)
99 #:use-module (gnu packages imagemagick)
100 #:use-module (gnu packages m4)
101 #:use-module (gnu packages mpi)
102 #:use-module (gnu packages multiprecision)
103 #:use-module (gnu packages netpbm)
104 #:use-module (gnu packages onc-rpc)
105 #:use-module (gnu packages pcre)
106 #:use-module (gnu packages popt)
107 #:use-module (gnu packages perl)
108 #:use-module (gnu packages pkg-config)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-web)
112 #:use-module (gnu packages python-xyz)
113 #:use-module (gnu packages qt)
114 #:use-module (gnu packages readline)
115 #:use-module (gnu packages ruby)
116 #:use-module (gnu packages tbb)
117 #:use-module (gnu packages scheme)
118 #:use-module (gnu packages shells)
119 #:use-module (gnu packages tcl)
120 #:use-module (gnu packages texinfo)
121 #:use-module (gnu packages tex)
122 #:use-module (gnu packages tls)
123 #:use-module (gnu packages version-control)
124 #:use-module (gnu packages wxwidgets)
125 #:use-module (gnu packages xml)
126 #:use-module (srfi srfi-1))
134 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
136 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
137 (build-system gnu-build-system)
138 (inputs `(("gtk+" ,gtk+)
139 ("libxml2" ,libxml2)))
140 (native-inputs `(("pkg-config" ,pkg-config)))
141 (synopsis "Natural deduction first-order logic interface")
142 (description "Aris is a program for performing logical proofs. It supports
143 propositional and predicate logic, as well as Boolean algebra and
144 arithmetical logic. In addition to its predefined inference and equivalence
145 rules, Aris also supports references to older proofs. Its use of standard
146 logical symbols and its natural deduction interface make it easy to use for
148 (license license:gpl3+)
149 (home-page "https://www.gnu.org/software/aris/")))
151 (define-public c-graph
157 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
160 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
161 (build-system gnu-build-system)
163 `(("fortran" ,gfortran)))
164 (synopsis "Visualizing and demonstrating convolution")
166 "GNU C-Graph is a tool for demonstrating the theory of convolution.
167 Thus, it can serve as an excellent aid to students of signal and systems
168 theory in visualizing the convolution process. Rather than forcing the
169 student to write code, the program offers an intuitive interface with
170 interactive dialogs to guide them.")
171 (license license:gpl3+)
172 (home-page "https://www.gnu.org/software/c-graph/")))
181 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
182 version "/coda-" version ".tar.gz"))
184 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
185 (patches (search-patches "coda-use-system-libs.patch"))
186 (modules '((guix build utils)))
188 ;; Make sure we don't use the bundled software.
190 (for-each (lambda (d)
191 (delete-file-recursively (string-append "libcoda/" d)))
192 '("zlib" "pcre" "expat"))
195 `(("fortran" ,gfortran)
197 ("python-numpy" ,python-numpy)))
204 (build-system gnu-build-system)
206 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
207 "LIBS= -lz -lpcre -lexpat")))
208 (synopsis "A common interface to various earth observation data formats")
210 "The Common Data Access toolbox (CODA) provides a set of interfaces for
211 reading remote sensing data from earth observation data files. It consists of
212 command line applications and interfaces to the C, Fortran, Python, and Java
213 programming languages.")
214 (home-page "https://stcorp.nl/coda")
215 (license license:gpl2+)))
223 (uri (string-append "http://www.qhull.org/download/qhull-"
224 (car (string-split version #\.))
228 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
229 (build-system cmake-build-system)
230 (synopsis "Calculate convex hulls and related structures")
232 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
233 diagram, halfspace intersection about a point, furthest-site Delaunay
234 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
235 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
236 algorithm for computing the convex hull. It handles roundoff errors from
237 floating point arithmetic. It computes volumes, surface areas, and
238 approximations to the convex hull.
240 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
241 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
242 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
244 (home-page "http://qhull.org")
245 (license (license:non-copyleft "file://COPYING.txt"
246 "See COPYING in the distribution."))))
248 (define-public python-cvxopt
250 (name "python-cvxopt")
255 (url "https://github.com/cvxopt/cvxopt.git")
257 (file-name (git-file-name name version))
260 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
261 (build-system python-build-system)
264 (modify-phases %standard-phases
265 (add-after 'unpack 'find-libraries
266 (lambda* (#:key inputs #:allow-other-keys)
267 (setenv "CVXOPT_BLAS_LIB" "openblas")
268 (setenv "CVXOPT_BUILD_FFTW" "1")
269 (setenv "CVXOPT_BUILD_GLPK" "1")
270 (setenv "CVXOPT_BUILD_GSL" "1")
277 ("openblas" ,openblas)
278 ("suitesparse" ,suitesparse)))
279 (home-page "https://www.cvxopt.org")
280 (synopsis "Python library for convex optimization")
282 "CVXOPT is a package for convex optimization based on the Python
283 programming language. Its main purpose is to make the development of software
284 for convex optimization applications straightforward by building on Python’s
285 extensive standard library and on the strengths of Python as a high-level
286 programming language.")
287 (license license:gpl3+)))
289 (define-public python2-cvxopt
290 (package-with-python2 python-cvxopt))
298 (uri (string-append "mirror://gnu/units/units-" version
301 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
302 (build-system gnu-build-system)
304 `(("readline" ,readline)
305 ("python" ,python-wrapper) ;for 'units_cur' script
306 ("python-requests" ,python-requests)))
308 `(#:phases (modify-phases %standard-phases
309 (add-after 'install 'wrap-units_cur
310 (lambda* (#:key outputs #:allow-other-keys)
311 (let* ((out (assoc-ref outputs "out"))
312 (bin (string-append out "/bin")))
313 (wrap-program (string-append bin "/units_cur")
314 `("PYTHONPATH" ":" prefix
315 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
317 (synopsis "Conversion between thousands of scales")
319 "GNU Units converts numeric quantities between units of measure. It
320 can handle scale changes through adaptive usage of standard scale
321 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
322 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
323 enough to be used effectively as a scientific calculator.")
324 (license license:gpl3+)
325 (home-page "https://www.gnu.org/software/units/")))
327 (define-public double-conversion
329 (name "double-conversion")
331 (home-page "https://github.com/google/double-conversion")
334 (uri (git-reference (url home-page)
335 (commit (string-append "v" version))))
336 (file-name (git-file-name name version))
339 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
340 (build-system cmake-build-system)
342 '(#:test-target "test"
343 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
344 "-DBUILD_TESTING=ON")))
345 (synopsis "Conversion routines for IEEE doubles")
347 "The double-conversion library provides binary-decimal and decimal-binary
348 routines for IEEE doubles. The library consists of efficient conversion
349 routines that have been extracted from the V8 JavaScript engine.")
350 (license license:bsd-3)))
352 (define-public dionysus
358 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
362 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
363 (build-system gnu-build-system)
364 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
365 (synopsis "Local search for universal constants and scientific values")
367 "GNU Dionysus is a convenient system for quickly retrieving the values of
368 mathematical constants used in science and engineering. Values can be
369 searched using a simple command-line tool, choosing from three databases:
370 universal constants, atomic numbers, and constants related to
372 (license license:gpl3+)
373 (home-page "https://www.gnu.org/software/dionysus/")))
381 (uri (string-append "mirror://gnu/gsl/gsl-"
385 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
386 (patches (search-patches "gsl-test-i686.patch"))))
387 (build-system gnu-build-system)
389 `(;; Currently there are numerous tests that fail on "exotic"
390 ;; architectures such as aarch64 and ppc64le.
391 ,@(if (string-prefix? "aarch64-linux"
392 (or (%current-target-system) (%current-system)))
395 (home-page "https://www.gnu.org/software/gsl/")
396 (synopsis "Numerical library for C and C++")
398 "The GNU Scientific Library is a library for numerical analysis in C
399 and C++. It includes a wide range of mathematical routines, with over 1000
400 functions in total. Subject areas covered by the library include:
401 differential equations, linear algebra, Fast Fourier Transforms and random
403 (license license:gpl3+)))
412 (uri (string-append "mirror://gnu/glpk/glpk-"
416 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
417 (build-system gnu-build-system)
421 `(#:configure-flags '("--with-gmp")))
422 (home-page "https://www.gnu.org/software/glpk/")
423 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
425 "GLPK is a C library for solving large-scale linear programming (LP),
426 mixed integer programming (MIP), and other related problems. It supports the
427 GNU MathProg modeling language, a subset of the AMPL language, and features a
428 translator for the language. In addition to the C library, a stand-alone
429 LP/MIP solver is included in the package.")
430 (license license:gpl3+)))
439 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
441 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
443 "/4ti2-" version ".tar.gz"))
445 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
446 (build-system gnu-build-system)
448 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
452 (home-page "http://www.4ti2.de/")
453 (synopsis "Mathematical tool suite for problems on linear spaces")
455 "4ti2 implements algorithms for solving algebraic, geometric and
456 combinatorial problems on linear spaces. Among others, it solves systems
457 of linear equations, computes extreme rays of polyhedral cones, solves
458 integer programming problems and computes Markov bases for statistics.")
459 (license license:gpl2+)))
461 (define-public cddlib
468 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
469 (string-delete #\. version) ".tar.gz"))
472 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
473 (build-system gnu-build-system)
476 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
477 (synopsis "Library for convex hulls and extreme rays of polyhedra")
479 "The C-library cddlib implements the Double Description Method of
480 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
481 rays of a general convex polyhedron given by a system of linear inequalities
482 in arbitrary dimension. It can also be used for the converse operation of
483 computing convex hulls.")
484 (license license:gpl2+)))
486 (define-public lrslib
493 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
495 (string-delete #\. version) ".tar.gz"))
498 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
499 (build-system gnu-build-system)
503 `(#:tests? #f ; no check phase
504 #:make-flags `("CC=gcc"
505 ,(string-append "prefix=" (assoc-ref %outputs "out"))
508 (modify-phases %standard-phases
511 (substitute* "makefile"
512 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
514 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
515 (synopsis "Convex hulls of polyhedra with exact arithmetic")
517 "The C code of lrslib implements the reverse search algorithm for
518 vertex enumeration and convex hull problems. Its input file format is
519 compatible with cddlib. All computations are done exactly in either
520 multiple precision or fixed integer arithmetic. Output is not stored
521 in memory, so even problems with very large output sizes can sometimes
523 (license license:gpl2+)))
525 (define-public arpack-ng
529 (home-page "https://github.com/opencollab/arpack-ng")
532 (uri (git-reference (url home-page) (commit version)))
533 (file-name (git-file-name name version))
536 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
537 (build-system gnu-build-system)
539 `(("autoconf" ,autoconf)
540 ("automake" ,automake)
541 ("libtool" ,libtool)))
544 ("fortran" ,gfortran)))
545 (synopsis "Fortran subroutines for solving eigenvalue problems")
547 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
548 large scale eigenvalue problems.")
549 (license (license:non-copyleft "file://COPYING"
550 "See COPYING in the distribution."))))
552 (define-public arpack-ng-3.3.0
556 (name (package-name arpack-ng))
557 (home-page (package-home-page arpack-ng))
561 (uri (string-append home-page "/archive/" version ".tar.gz"))
562 (file-name (string-append name "-" version ".tar.gz"))
565 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
567 (define-public arpack-ng-openmpi
568 (package (inherit arpack-ng)
569 (name "arpack-ng-openmpi")
572 ,@(package-inputs arpack-ng)))
574 (substitute-keyword-arguments (package-arguments arpack-ng)
575 ((#:configure-flags _ '())
577 ((#:phases phases '%standard-phases)
578 `(modify-phases ,phases
579 (add-before 'check 'mpi-setup
581 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
583 (define-public lapack
590 (uri (string-append "http://www.netlib.org/lapack/lapack-"
594 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
595 (build-system cmake-build-system)
596 (home-page "http://www.netlib.org/lapack/")
597 (inputs `(("fortran" ,gfortran)
598 ("python" ,python-2)))
600 `(#:configure-flags (list
601 "-DBUILD_SHARED_LIBS:BOOL=YES"
604 ;; Build the 'LAPACKE_clatms' functions.
605 "-DLAPACKE_WITH_TMG=ON")
607 (modify-phases %standard-phases
608 (add-before 'check 'patch-python
609 (lambda* (#:key inputs #:allow-other-keys)
610 (let ((python (assoc-ref inputs "python")))
611 (substitute* "lapack_testing.py"
612 (("/usr/bin/env python") python)))
614 (synopsis "Library for numerical linear algebra")
616 "LAPACK is a Fortran 90 library for solving the most commonly occurring
617 problems in numerical linear algebra.")
618 (license (license:non-copyleft "file://LICENSE"
619 "See LICENSE in the distribution."))))
621 (define-public scalapack
628 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
632 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
633 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
634 (build-system cmake-build-system)
637 ("fortran" ,gfortran)
638 ("lapack" ,lapack))) ;for testing only
640 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
641 #:phases (modify-phases %standard-phases
642 (add-before 'check 'mpi-setup
644 (home-page "http://www.netlib.org/scalapack/")
645 (synopsis "Library for scalable numerical linear algebra")
647 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
648 routines on parallel distributed memory machines. ScaLAPACK solves dense and
649 banded linear systems, least squares problems, eigenvalue problems, and
650 singular value problems.")
651 (license (license:non-copyleft "file://LICENSE"
652 "See LICENSE in the distribution."))))
654 (define-public gnuplot
660 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
664 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
665 (build-system gnu-build-system)
666 (inputs `(("readline" ,readline)
672 `(("pkg-config" ,pkg-config)
673 ("texlive" ,texlive-tiny)))
674 (arguments `(#:configure-flags (list (string-append
675 "--with-texdir=" %output
676 "/texmf-local/tex/latex/gnuplot"))))
677 (home-page "http://www.gnuplot.info")
678 (synopsis "Command-line driven graphing utility")
679 (description "Gnuplot is a portable command-line driven graphing
680 utility. It was originally created to allow scientists and students to
681 visualize mathematical functions and data interactively, but has grown to
682 support many non-interactive uses such as web scripting. It is also used as a
683 plotting engine by third-party applications like Octave.")
684 ;; X11 Style with the additional restriction that derived works may only be
685 ;; distributed as patches to the original.
686 (license (license:fsf-free
687 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
697 (url "https://github.com/OkoSanto/GCTP.git")
698 (commit (string-append "v" version))))
699 (file-name (git-file-name name version))
701 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
703 `(("fortran" ,gfortran)))
704 (build-system gnu-build-system)
705 (synopsis "General Cartographic Transformation Package (GCTP)")
707 "The General Cartographic Transformation Package (GCTP) is a system of
708 software routines designed to permit the transformation of coordinate pairs
709 from one map projection to another. The GCTP is the standard computer
710 software used by the National Mapping Division for map projection
712 (home-page "https://github.com/OkoSanto/GCTP")
713 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
722 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
723 version "/src/hdf-" version ".tar.bz2"))
725 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
726 (patches (search-patches "hdf4-architectures.patch"
727 "hdf4-reproducibility.patch"
728 "hdf4-shared-fortran.patch"
729 "hdf4-tirpc.patch"))))
730 (build-system gnu-build-system)
732 `(("gfortran" ,gfortran)
738 ("libtirpc" ,libtirpc)))
740 `(#:parallel-tests? #f
741 #:configure-flags (list "--enable-shared"
742 (string-append "CPPFLAGS=-I"
743 (assoc-ref %build-inputs "libtirpc")
746 (modify-phases %standard-phases
747 ;; This is inspired by two of Debian's patches.
748 (add-before 'configure 'add-more-aarch64-support
750 (substitute* '("mfhdf/ncgen/ncgen.l"
751 "mfhdf/ncgen/ncgenyy.c"
752 "mfhdf/libsrc/netcdf.h.in")
753 (("AIX5L64") "__aarch64__"))
755 (add-before 'configure 'patchbuild
758 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
760 (("/bin/mkdir") "mkdir"))
761 (substitute* (find-files "." "^Makefile\\.in$")
762 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
763 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
764 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
765 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
766 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
768 (add-after 'configure 'patch-settings
770 ;; libhdf4.settings contains the full path of the
771 ;; compilers used, and its contents are included in
772 ;; .so-files. We truncate the hashes to avoid
773 ;; unnecessary store references to those compilers:
774 (substitute* "libhdf4.settings"
775 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
776 (string-append prefix (string-take hash 10) "...")))
779 (home-page "https://www.hdfgroup.org/products/hdf4/")
781 "Library and multi-object file format for storing and managing data")
782 (description "HDF4 is a library and multi-object file format for storing
783 and managing data between machines. HDF4 is an older hierarchical data format,
784 incompatible with HDF5.")
786 (license:non-copyleft
787 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
789 (define-public hdf4-alt
794 (substitute-keyword-arguments (package-arguments hdf4)
795 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
797 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
806 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
807 "hdf5-" (version-major+minor version)
808 "/hdf5-" version "/src/hdf5-"
810 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
812 (match (string-split version #\.)
814 (string-append major minor)))
815 "/src/hdf5-" version ".tar.bz2")))
817 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
818 (patches (search-patches "hdf5-config-date.patch"
819 "hdf5-1.8-mpi-deprecations.patch"))))
820 (build-system gnu-build-system)
824 `(("gfortran" ,gfortran)
825 ("perl" ,perl))) ;part of the test machinery needs Perl
826 (outputs '("out" ; core library
827 "fortran")) ; fortran interface
829 `(;; Some of the users, notably Flann, need the C++ interface.
830 #:configure-flags '("--enable-cxx"
832 "--enable-fortran2003"
834 ;; Build a thread-safe library. Unfortunately,
835 ;; 'configure' invites you to either turn off C++,
836 ;; Fortran, and the high-level interface (HL), or
837 ;; to pass '--enable-unsupported'. Debian
838 ;; packagers chose to pass '--enable-unsupported'
839 ;; and we follow their lead here.
840 "--enable-threadsafe"
842 "--enable-unsupported")
843 ;; Use -fPIC to allow the R bindings to link with the static libraries
844 #:make-flags (list "CFLAGS=-fPIC"
847 (modify-phases %standard-phases
848 (add-before 'configure 'patch-configure
849 (lambda* (#:key outputs #:allow-other-keys)
850 (substitute* "configure"
852 (substitute* "fortran/src/Makefile.in"
853 (("libhdf5_fortran_la_LDFLAGS =")
854 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
855 (assoc-ref outputs "fortran") "/lib")))
856 (substitute* "hl/fortran/src/Makefile.in"
857 (("libhdf5hl_fortran_la_LDFLAGS =")
858 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
859 (assoc-ref outputs "fortran") "/lib")))
861 (add-after 'configure 'patch-settings
863 ;; libhdf5.settings contains the full path of the
864 ;; compilers used, and its contents are included in
865 ;; libhdf5.so. We truncate the hashes to avoid
866 ;; unnecessary store references to those compilers:
867 (substitute* "src/libhdf5.settings"
868 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
869 (string-append prefix (string-take hash 10) "..."))
870 ;; Don't record the build-time kernel version to make the
871 ;; settings file reproducible.
872 (("Uname information:.*")
873 "Uname information: Linux\n"))
875 (add-after 'install 'patch-references
876 (lambda* (#:key inputs outputs #:allow-other-keys)
877 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
878 (zlib (assoc-ref inputs "zlib")))
879 (substitute* (find-files bin "h5p?cc")
881 (string-append "-L" zlib "/lib " lib)))
883 (add-after 'install 'split
884 (lambda* (#:key inputs outputs #:allow-other-keys)
885 ;; Move all fortran-related files
886 (let* ((out (assoc-ref outputs "out"))
887 (bin (string-append out "/bin"))
888 (lib (string-append out "/lib"))
889 (inc (string-append out "/include"))
890 (ex (string-append out "/share/hdf5_examples/fortran"))
891 (fort (assoc-ref outputs "fortran"))
892 (fbin (string-append fort "/bin"))
893 (flib (string-append fort "/lib"))
894 (finc (string-append fort "/include"))
895 (fex (string-append fort "/share/hdf5_examples/fortran")))
900 ;; Note: When built with --enable-parallel, the 'h5fc' file
901 ;; doesn't exist, hence this condition.
902 (when (file-exists? (string-append bin "/h5fc"))
903 (rename-file (string-append bin "/h5fc")
904 (string-append fbin "/h5fc")))
905 (for-each (lambda (file)
907 (string-append flib "/" (basename file))))
908 (find-files lib ".*fortran.*"))
909 (for-each (lambda (file)
911 (string-append finc "/" (basename file))))
912 (find-files inc ".*mod"))
913 (for-each (lambda (file)
915 (string-append fex "/" (basename file))))
916 (find-files ex ".*"))
917 (delete-file-recursively ex))
919 (home-page "http://www.hdfgroup.org")
920 (synopsis "Management suite for extremely large and complex data")
921 (description "HDF5 is a suite that makes possible the management of
922 extremely large and complex data collections.")
923 (license (license:x11-style
924 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
926 (define-public hdf5-1.10
927 (package (inherit hdf5)
932 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
933 "hdf5-" (version-major+minor version)
934 "/hdf5-" version "/src/hdf5-"
936 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
939 (take (string-split version #\.) 2))
940 "/src/hdf5-" version ".tar.bz2")))
942 (base32 "0i3g6v521vigzbx8wpd32ibsiiw92r65ca3qdbn0d8fj8f4fmmk8"))
943 (patches (search-patches "hdf5-config-date.patch"))))))
945 (define-public hdf-java
953 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
954 version "/src/CMake-hdfjava-" version ".tar.gz"))
956 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
957 (modules '((guix build utils)))
958 (snippet ; Make sure we don't use the bundled sources and binaries.
960 (for-each delete-file
961 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
962 "HDF4.tar.gz" "HDF5.tar.gz"))
963 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
965 (build-system gnu-build-system)
967 `(("jdk" ,icedtea "jdk")
968 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
970 ("hamcrest-core" ,java-hamcrest-core)
971 ("junit" ,java-junit)
972 ("slf4j-simple" ,java-slf4j-simple)))
978 ("slf4j-api" ,java-slf4j-api)))
981 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
982 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
983 (assoc-ref %build-inputs "jdk") "/lib" )
984 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
985 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
988 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
989 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
990 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
991 (string-append "JPEGLIB="
992 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
996 (modify-phases %standard-phases
997 (add-before 'configure 'chdir-to-source
998 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
999 (add-before 'configure 'patch-build
1000 (lambda* (#:key inputs outputs #:allow-other-keys)
1001 (substitute* "configure"
1002 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1003 (("/bin/cat") (which "cat")))
1004 ;; Set classpath for compilation
1005 (substitute* '("hdf/hdf5lib/Makefile.in"
1006 "hdf/hdf5lib/exceptions/Makefile.in"
1007 "hdf/hdflib/Makefile.in")
1008 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1009 (string-append (assoc-ref inputs "slf4j-api")
1010 "/share/java/slf4j-api.jar")))
1011 ;; Replace outdated config.sub and config.guess:
1012 (with-directory-excursion "config"
1013 (for-each (lambda (file)
1015 (string-append (assoc-ref inputs "automake")
1017 ,(version-major+minor (package-version automake))
1019 '("config.sub" "config.guess")))
1021 ;; Fix embedded version number
1022 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1023 (substitute* "hdf/hdf5lib/H5.java"
1025 (string-join hdf5version ", "))))
1027 (mkdir-p (string-append (assoc-ref outputs "out")))
1028 ;; Set classpath for tests
1029 (let* ((build-dir (getcwd))
1030 (lib (string-append build-dir "/lib"))
1031 (jhdf (string-append lib "/jhdf.jar"))
1032 (jhdf5 (string-append lib "/jhdf5.jar"))
1035 (string-append (assoc-ref inputs i)
1036 "/share/java/" i ".jar"))
1037 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1039 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1041 (substitute* '("test/hdf5lib/Makefile.in"
1042 "test/hdf5lib/junit.sh.in"
1043 "examples/runExample.sh.in")
1045 (string-append (assoc-ref inputs "coreutils")
1048 (string-append (assoc-ref inputs "coreutils")
1050 (("CLASSPATH=[^\n]*")
1051 (string-append "CLASSPATH=" class-path)))
1052 (setenv "CLASSPATH" class-path))
1054 (add-before 'check 'build-examples
1056 (apply invoke `("javac"
1057 ,@(find-files "examples" ".*\\.java"))))))
1059 #:parallel-build? #f
1061 #:parallel-tests? #f ))
1062 (home-page "https://support.hdfgroup.org/products/java")
1063 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1064 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1065 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1068 ;; BSD-style license:
1069 (license (license:x11-style
1070 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1071 /current/src/unpacked/COPYING"))))
1073 (define-public hdf-eos2
1080 (uri "ftp://edhs1.gsfc.nasa.gov\
1081 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1083 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1084 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1085 "hdf-eos2-build-shared.patch"
1086 "hdf-eos2-fortrantests.patch"))))
1087 (build-system gnu-build-system)
1089 `(("gfortran" ,gfortran)))
1091 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1092 ;; XXX: These inputs are really dependencies of hdf4.
1094 ("libjpeg" ,libjpeg)
1095 ("libtirpc" ,libtirpc)
1099 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1100 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1101 #:parallel-tests? #f))
1102 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1103 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1104 (description "HDF-EOS2 is a software library built on HDF4 which supports
1105 the construction of data structures used in NASA's Earth Observing
1106 System (Grid, Point and Swath).")
1108 ;; Source files carry a permissive license header.
1109 (license (license:non-copyleft home-page))))
1111 (define-public hdf-eos5
1117 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1118 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1121 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1122 (patches (search-patches "hdf-eos5-build-shared.patch"
1123 "hdf-eos5-remove-gctp.patch"
1124 "hdf-eos5-fix-szip.patch"
1125 "hdf-eos5-fortrantests.patch"))))
1127 `(("gfortran" ,gfortran)))
1128 (build-system gnu-build-system)
1134 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1135 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1136 #:parallel-tests? #f))
1137 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1139 "HDF-EOS5 is a software library built on HDF5 to support the construction
1140 of data structures used in NASA's Earth Observing System (Grid, Point and
1142 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1144 ;; Source files carry a permissive license header.
1145 (license (license:non-copyleft home-page))))
1147 (define-public hdf5-parallel-openmpi
1148 (package (inherit hdf5)
1149 (name "hdf5-parallel-openmpi")
1152 ,@(package-inputs hdf5)))
1154 (substitute-keyword-arguments (package-arguments hdf5)
1155 ((#:configure-flags flags)
1156 ``("--enable-parallel"
1157 ,@(delete "--enable-cxx"
1158 (delete "--enable-threadsafe" ,flags))))
1160 `(modify-phases ,phases
1161 (add-after 'build 'mpi-setup
1163 (add-before 'check 'patch-tests
1165 ;; OpenMPI's mpirun will exit with non-zero status if it
1166 ;; detects an "abnormal termination", i.e. any process not
1167 ;; calling MPI_Finalize(). Since the test is explicitly
1168 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1169 ;; H5C_flush_cache from being called, mpirun will always
1170 ;; complain, so turn this test off.
1171 (substitute* "testpar/Makefile"
1172 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1173 (string-append front back "\n")))
1174 (substitute* "tools/h5diff/testph5diff.sh"
1175 (("/bin/sh") (which "sh")))
1177 (synopsis "Management suite for data with parallel IO support")))
1179 (define-public h5check
1186 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1187 "h5check/src/h5check-" version ".tar.gz"))
1190 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1191 (build-system gnu-build-system)
1192 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1193 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1194 (synopsis "HDF5 format checker")
1195 (description "@code{h5check} is a validation tool for verifying that an
1196 HDF5 file is encoded according to the HDF File Format Specification.")
1197 (license (license:x11-style "file://COPYING"))))
1205 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1210 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1211 (build-system cmake-build-system)
1212 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1213 (inputs `(("lapack" ,lapack)
1215 ;; FIXME: Even though the fonts are available dvips complains:
1216 ;; "Font cmmi10 not found; characters will be left blank."
1218 `(("texlive" ,texlive-tiny)
1219 ("ghostscript" ,ghostscript)
1220 ("doxygen" ,doxygen)))
1221 (home-page "http://itpp.sourceforge.net")
1222 (synopsis "C++ library of maths, signal processing and communication classes")
1223 (description "IT++ is a C++ library of mathematical, signal processing and
1224 communication classes and functions. Its main use is in simulation of
1225 communication systems and for performing research in the area of
1226 communications. The kernel of the library consists of generic vector and
1227 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1228 similar to MATLAB, GNU Octave or SciPy.")
1229 (license license:gpl3+)))
1231 (define-public netcdf
1238 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1239 "netcdf-" version ".tar.gz"))
1242 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1243 (patches (search-patches "netcdf-date-time.patch"
1244 "netcdf-tst_h_par.patch"))))
1245 (build-system gnu-build-system)
1248 ("doxygen" ,doxygen)
1249 ("graphviz" ,graphviz)))
1251 `(("hdf4" ,hdf4-alt)
1254 ("libjpeg" ,libjpeg)))
1256 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1258 #:phases (modify-phases %standard-phases
1259 (add-before 'configure 'fix-source-date
1261 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1262 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1263 ;; to '1st hour of the current day', and therefore makes the
1264 ;; package not reproducible.
1265 (substitute* "./configure"
1266 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1267 "date --date='@0'"))
1269 (add-after 'configure 'patch-settings
1271 ;; libnetcdf.settings contains the full filename of the compilers
1272 ;; used to build the library. We truncate the hashes of those
1273 ;; filenames to avoid unnecessary references to the corresponding
1275 (substitute* "libnetcdf.settings"
1276 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1277 (string-append prefix (string-take hash 10) "...")))
1280 #:parallel-tests? #f)) ;various race conditions
1281 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1282 (synopsis "Library for scientific data")
1283 (description "NetCDF is an interface for scientific data access and a
1284 software library that provides an implementation of the interface. The netCDF
1285 library defines a machine-independent format for representing scientific data.
1286 Together, the interface, library, and format support the creation, access, and
1287 sharing of scientific data.")
1288 (license (license:x11-style "file://COPYRIGHT"))))
1290 (define-public netcdf-parallel-openmpi
1291 (package (inherit netcdf)
1292 (name "netcdf-parallel-openmpi")
1295 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1296 (package-inputs netcdf))))
1297 ;; TODO: Replace pkg-config references in nc-config with absolute references
1299 (substitute-keyword-arguments (package-arguments netcdf)
1300 ((#:configure-flags flags)
1301 `(cons* "CC=mpicc" "CXX=mpicxx"
1302 "--enable-parallel-tests"
1303 ;; Shared libraries not supported with parallel IO.
1304 "--disable-shared" "--with-pic"
1307 (define-public netcdf-fortran
1309 (name "netcdf-fortran")
1314 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1318 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1319 (build-system gnu-build-system)
1321 `(#:parallel-tests? #f))
1323 `(("netcdf" ,netcdf)))
1325 `(("gfortran" ,gfortran)))
1326 (synopsis "Fortran interface for the netCDF library")
1327 (description (package-description netcdf))
1328 (home-page (package-home-page netcdf))
1329 (license (package-license netcdf))))
1331 (define-public nlopt
1337 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1340 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1341 (build-system gnu-build-system)
1343 `(;; Shared libraries are not built by default. They are required to
1344 ;; build the Guile, Octave, and Python bindings.
1345 #:configure-flags '("--enable-shared")
1348 (modify-phases %standard-phases
1349 (add-before 'configure 'set-libnlopt-file-name
1350 (lambda* (#:key outputs #:allow-other-keys)
1351 ;; Make sure the Scheme module refers to the library by its
1352 ;; absolute file name (we cannot do that from a snippet
1353 ;; because the expansion of @libdir@ contains
1355 (let ((out (assoc-ref outputs "out")))
1356 (substitute* "swig/nlopt.scm.in"
1358 (string-append out "/lib/libnlopt")))
1360 (inputs `(("guile" ,guile-2.0)))
1361 (native-inputs `(("pkg-config" ,pkg-config)))
1362 (home-page "http://ab-initio.mit.edu/wiki/")
1363 (synopsis "Library for nonlinear optimization")
1364 (description "NLopt is a library for nonlinear optimization, providing a
1365 common interface for a number of different free optimization routines available
1366 online as well as original implementations of various other algorithms.")
1367 (license license:lgpl2.1+)))
1369 (define-public ipopt
1376 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1380 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1381 (modules '((guix build utils)))
1383 ;; Make sure we don't use the bundled software.
1385 (delete-file-recursively "ThirdParty")
1387 (build-system gnu-build-system)
1389 '(#:phases (modify-phases %standard-phases
1390 (add-after 'install 'add--L-flags-in-ipopt.pc
1391 (lambda* (#:key inputs outputs #:allow-other-keys)
1392 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1393 ;; move it to "Libs.private" where it belongs, and add a
1394 ;; '-L' flag for LAPACK.
1395 (let ((out (assoc-ref outputs "out"))
1396 (lapack (assoc-ref inputs "lapack")))
1397 (substitute* (string-append out "/lib/pkgconfig/"
1399 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1400 (string-append "Libs: " before " " after "\n"
1401 "Libs.private: " before
1402 "-L" lapack "/lib -llapack -lblas "
1406 `(("gfortran" ,gfortran)))
1408 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1409 `(("lapack" ,lapack))) ;for both libblas and liblapack
1410 (home-page "http://www.coin-or.org")
1411 (synopsis "Large-scale nonlinear optimizer")
1413 "The Interior Point Optimizer (IPOPT) is a software package for
1414 large-scale nonlinear optimization. It provides C++, C, and Fortran
1416 (license license:epl1.0)))
1424 (uri (string-append "https://www.coin-or.org/download/source/"
1425 "Clp/Clp-" version ".tgz"))
1428 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1429 (modules '((guix build utils)))
1431 ;; Make sure we don't use the bundled software.
1433 (delete-file-recursively "ThirdParty")
1435 (build-system gnu-build-system)
1437 `(("gfortran" ,gfortran)
1438 ("pkg-config" ,pkg-config)))
1440 `(("openblas" ,openblas)))
1441 (home-page "https://www.coin-or.org")
1442 (synopsis "Linear programming solver")
1444 "CLP is a high quality linear programming solver. Its main strengths are
1445 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1446 linear and quadratic objectives. There are limited facilities for nonlinear
1447 and quadratic objectives using the Simplex algorithm.")
1448 (license license:epl1.0)))
1450 (define-public ceres
1452 (name "ceres-solver")
1454 (home-page "http://ceres-solver.org/")
1457 (uri (string-append home-page "ceres-solver-"
1461 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1462 (build-system cmake-build-system)
1464 ;; TODO: Build HTML user documentation and install separately.
1465 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1466 "-DBUILD_SHARED_LIBS=ON")
1468 #:phases (modify-phases %standard-phases
1469 (add-before 'configure 'set-library-directory
1471 ;; Install libraries to lib/, not lib64/.
1472 (substitute* "internal/ceres/CMakeLists.txt"
1473 (("set\\(LIB_SUFFIX \"64\"\\)")
1474 "set(LIB_SUFFIX \"\")"))
1477 `(("pkg-config" ,pkg-config)))
1479 `(("glog" ,glog))) ;for #include <glog/glog.h>
1484 ("suitesparse" ,suitesparse)
1485 ("gflags" ,gflags)))
1486 (synopsis "C++ library for solving large optimization problems")
1488 "Ceres Solver is a C++ library for modeling and solving large,
1489 complicated optimization problems. It is a feature rich, mature and
1490 performant library which has been used in production since 2010. Ceres Solver
1491 can solve two kinds of problems:
1493 @item non-linear least squares problems with bounds constraints;
1494 @item general unconstrained optimization problems.
1496 (license license:bsd-3)))
1498 ;; For a fully featured Octave, users are strongly recommended also to install
1499 ;; the following packages: less, ghostscript, gnuplot.
1500 (define-public octave-cli
1507 (uri (string-append "mirror://gnu/octave/octave-"
1511 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1512 (build-system gnu-build-system)
1514 `(("alsa-lib" ,alsa-lib)
1515 ("arpack" ,arpack-ng)
1520 ("fontconfig" ,fontconfig)
1521 ("freetype" ,freetype)
1525 ("graphicsmagick" ,graphicsmagick)
1528 ("libsndfile" ,libsndfile)
1532 ("portaudio" ,portaudio)
1534 ("readline" ,readline)
1535 ("suitesparse" ,suitesparse)
1536 ("texinfo" ,texinfo)
1540 ("gfortran" ,gfortran)
1541 ("pkg-config" ,pkg-config)
1543 ;; The following inputs are not actually used in the build process.
1544 ;; However, the ./configure gratuitously tests for their existence and
1545 ;; assumes that programs not present at build time are also not, and
1546 ;; can never be, available at run time! If these inputs are therefore
1547 ;; not present, support for them will be built out. However, Octave
1548 ;; will still run without them, albeit without the features they
1551 ("ghostscript" ,ghostscript)
1552 ("gnuplot" ,gnuplot)))
1553 ;; Octave code uses this variable to detect directories holding multiple CA
1554 ;; certificates to verify peers with. This is required for the networking
1555 ;; functions that require encryption to work properly.
1556 (native-search-paths
1557 (list (search-path-specification
1558 (variable "CURLOPT_CAPATH")
1559 (files '("etc/ssl/certs")))))
1562 (list (string-append "--with-shell="
1563 (assoc-ref %build-inputs "bash")
1566 (modify-phases %standard-phases
1567 (add-after 'configure 'configure-makeinfo
1568 (lambda* (#:key inputs #:allow-other-keys)
1569 (substitute* "libinterp/corefcn/help.h"
1572 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1574 (home-page "https://www.gnu.org/software/octave/")
1575 (synopsis "High-level language for numerical computation")
1576 (description "GNU Octave is a high-level interpreted language that is
1577 specialized for numerical computations. It can be used for both linear and
1578 non-linear applications and it provides great support for visualizing results.
1579 Work may be performed both at the interactive command-line as well as via
1581 (license license:gpl3+)))
1583 (define-public octave
1584 (package (inherit octave-cli)
1587 (inherit (package-source octave-cli))))
1589 `(("qscintilla" ,qscintilla)
1591 ,@(package-inputs octave-cli)))
1593 `(("qttools" , qttools) ;for lrelease
1594 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1595 ,@(package-native-inputs octave-cli)))
1597 (substitute-keyword-arguments (package-arguments octave-cli)
1599 `(modify-phases ,phases
1600 (add-before 'configure 'patch-qscintilla-library-name
1601 (lambda* (#:key inputs #:allow-other-keys)
1602 ;; The QScintilla library that the Octave configure script tries
1603 ;; to link with should be named libqscintilla-qt5.so, but the
1604 ;; QScintilla input provides the shared library as
1605 ;; libqscintilla2_qt5.so.
1606 (substitute* "configure"
1607 (("qscintilla2-qt5")
1611 (define-public qtoctave
1612 (deprecated-package "qtoctave" octave))
1614 (define-public opencascade-oce
1616 (name "opencascade-oce")
1622 (url "https://github.com/tpaviot/oce.git")
1623 (commit (string-append "OCE-" version))))
1624 (file-name (git-file-name name version))
1625 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1627 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1628 (build-system cmake-build-system)
1631 (list "-DOCE_TESTING:BOOL=ON"
1632 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1633 "-DOCE_DRAW:BOOL=ON"
1634 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1635 (assoc-ref %outputs "out"))
1636 "-UCMAKE_INSTALL_RPATH")))
1638 `(("freetype" ,freetype)
1645 `(("python" ,python-wrapper)))
1646 (home-page "https://github.com/tpaviot/oce")
1647 (synopsis "Libraries for 3D modeling and numerical simulation")
1649 "Open CASCADE is a set of libraries for the development of applications
1650 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1651 C++ class libraries providing services for 3D surface and solid modeling, CAD
1652 data exchange, and visualization. It is used for development of specialized
1653 software dealing with 3D models in design (CAD), manufacturing (CAM),
1654 numerical simulation (CAE), measurement equipment (CMM), and quality
1655 control (CAQ) domains.
1657 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1658 patches, improvements, and experiments contributed by users over the official
1659 Open CASCADE library.")
1660 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1661 ; use of header files; see
1662 ; OCCT_LGPL_EXCEPTION.txt
1663 license:public-domain; files
1664 ; src/Standard/Standard_StdAllocator.hxx and
1665 ; src/NCollection/NCollection_StdAllocator.hxx
1666 license:expat; file src/OpenGl/OpenGl_glext.h
1667 license:bsd-3)))); test framework gtest
1669 (define-public opencascade-occt
1671 (name "opencascade-occt")
1677 (url "https://git.dev.opencascade.org/repos/occt.git")
1680 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1682 (file-name (git-file-name name version))
1684 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1685 (modules '((guix build utils)))
1688 ;; Remove files specific to non-free operating systems.
1689 (delete-file-recursively "samples/ios")
1690 (delete-file-recursively "samples/mfc")
1691 (delete-file-recursively "samples/qt/FuncDemo")
1692 (delete-file "genconf.bat")
1693 (delete-file "gendoc.bat")
1694 (delete-file "genproj.bat")
1695 (delete-file "upgrade.bat")
1696 ;; Remove references to deleted files.
1697 (substitute* "dox/FILES_HTML.txt"
1698 ((".*standard.*") "" )
1699 ((".*UIKitSample.*") ""))
1701 (build-system cmake-build-system)
1703 '(;; There is no test target for make. OCCT provides an
1704 ;; 'Automated Testing System', which may be accessed after
1705 ;; installation via the draw.sh script. draw.sh is located in
1706 ;; the bin directory. For details see:
1707 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1708 ;; occt_dev_guides__tests.html
1710 ;; Configure without freeimage: attempting to link against the
1711 ;; freeimage version 3.17 library leads to 'undefined
1712 ;; reference' errors.
1714 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1716 "-DUSE_VTK:BOOL=OFF"
1717 "-DBUILD_DOC_Overview:BOOL=OFF"
1718 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1719 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1720 "-UCMAKE_INSTALL_LIBDIR")))
1722 `(("doxygen" ,doxygen)
1723 ;("freeimage" ,freeimage)
1724 ("freetype" ,freetype)
1726 ("libxext" ,libxext)
1733 ;; TODO: build Overview documentation and add 'doc' output.
1734 (home-page "https://www.opencascade.com")
1735 (synopsis "Libraries for 3D modeling and numerical simulation")
1737 "Open CASCADE is a set of libraries for the development of applications
1738 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1739 C++ class libraries providing services for 3D surface and solid modeling, CAD
1740 data exchange, and visualization. It is used for development of specialized
1741 software dealing with 3D models in design (CAD), manufacturing (CAM),
1742 numerical simulation (CAE), measurement equipment (CMM), and quality
1743 control (CAQ) domains.
1745 This is the certified version of the Open Cascade Technology (OCCT) library.")
1746 (license (list ;; OCCT library:
1747 license:lgpl2.1; with an exception for the use of header
1748 ; files, see OCCT_LGPL_EXCEPTION.txt.
1749 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1750 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1752 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1753 ;; src/StepFile/step.tab.*:
1754 license:gpl3+ ; with Bison 2.2 exception.
1755 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1756 (license:non-copyleft
1757 "https://www.unicode.org/license.html")
1758 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1759 license:public-domain))))
1769 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1771 (string-append "gmsh_"
1772 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1774 (file-name (git-file-name name version))
1776 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1777 (modules '((guix build utils)))
1779 ;; Remove non-free METIS code
1781 (delete-file-recursively "contrib/Metis")
1783 (build-system cmake-build-system)
1786 ("gfortran" ,gfortran)
1792 ("opencascade-oce" ,opencascade-oce)
1794 ("libxext" ,libxext)))
1796 `(("fontconfig" ,fontconfig)
1797 ("libxft" ,libxft)))
1799 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1800 "-DENABLE_BUILD_SHARED:BOOL=ON"
1801 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1802 (home-page "http://gmsh.info/")
1803 (synopsis "3D finite element grid generator")
1804 (description "Gmsh is a 3D finite element grid generator with a built-in
1805 CAD engine and post-processor. Its design goal is to provide a fast, light
1806 and user-friendly meshing tool with parametric input and advanced
1807 visualization capabilities. Gmsh is built around four modules: geometry,
1808 mesh, solver and post-processing. The specification of any input to these
1809 modules is done either interactively using the graphical user interface or in
1810 ASCII text files using Gmsh's own scripting language.")
1811 (license license:gpl2+)))
1813 (define-public maxflow
1816 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
1817 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
1822 (url "https://github.com/gerddie/maxflow.git")
1824 (file-name (git-file-name name version))
1827 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1828 (build-system cmake-build-system)
1829 (home-page "https://pub.ist.ac.at/~vnk/software.html")
1830 (synopsis "Library implementing Maxflow algorithm")
1831 (description "An implementation of the maxflow algorithm described in
1832 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1833 Energy Minimization in Computer Vision.\n
1834 Yuri Boykov and Vladimir Kolmogorov.\n
1835 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1837 (license license:gpl3+)))
1839 (define-public petsc
1846 ;; The *-lite-* tarball does not contain the *large* documentation
1847 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1848 "petsc-lite-" version ".tar.gz"))
1850 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1851 (outputs '("out" ; libraries and headers
1852 "examples")) ; ~30MiB of examples
1853 (build-system gnu-build-system)
1855 `(("python" ,python-2)))
1857 `(("gfortran" ,gfortran)
1859 ("superlu" ,superlu)
1860 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1861 ;; leaving out opengl, as configuration seems to only be for mac
1864 `(#:test-target "test"
1865 #:parallel-build? #f ; build is parallel by default
1871 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1872 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1873 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1875 (modify-phases %standard-phases
1877 ;; PETSc's configure script is actually a python script, so we can't
1878 ;; run it with bash.
1879 (lambda* (#:key outputs (configure-flags '())
1881 (let* ((prefix (assoc-ref outputs "out"))
1882 (flags `(,(string-append "--prefix=" prefix)
1883 ,@configure-flags)))
1884 (format #t "build directory: ~s~%" (getcwd))
1885 (format #t "configure flags: ~s~%" flags)
1886 (apply invoke "./configure" flags))))
1887 (add-after 'configure 'clean-local-references
1888 (lambda* (#:key outputs #:allow-other-keys)
1889 (let ((out (assoc-ref outputs "out")))
1890 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1891 ;; Prevent build directory from leaking into compiled code
1893 ;; Scrub timestamp for reproducibility
1894 ((".*Libraries compiled on.*") ""))
1895 (substitute* (find-files "." "petscvariables")
1896 ;; Do not expose build machine characteristics, set to defaults.
1897 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1898 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1900 (add-after 'install 'clean-install
1901 ;; Try to keep installed files from leaking build directory names.
1902 (lambda* (#:key inputs outputs #:allow-other-keys)
1903 (let ((out (assoc-ref outputs "out")))
1904 (substitute* (map (lambda (file)
1905 (string-append out "/lib/petsc/conf/" file))
1906 '("petscvariables"))
1908 ;; Make compiler references point to the store
1909 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1910 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1911 (string-append "= " (which compiler))))
1912 ;; PETSc installs some build logs, which aren't necessary.
1913 (for-each (lambda (file)
1914 (let ((f (string-append out "/lib/petsc/conf/" file)))
1915 (when (file-exists? f)
1917 '("configure.log" "make.log" "gmake.log"
1918 "test.log" "error.log" "RDict.db"
1919 "PETScBuildInternal.cmake"
1920 ;; Once installed, should uninstall with Guix
1923 (add-after 'install 'move-examples
1924 (lambda* (#:key outputs #:allow-other-keys)
1925 (let* ((out (assoc-ref outputs "out"))
1926 (examples (assoc-ref outputs "examples"))
1927 (exdir (string-append out "/share/petsc/examples"))
1928 (exdir' (string-append examples "/share/petsc/examples")))
1929 (copy-recursively exdir exdir')
1930 (delete-file-recursively exdir)
1932 (home-page "http://www.mcs.anl.gov/petsc")
1933 (synopsis "Library to solve PDEs")
1934 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1935 data structures and routines for the scalable (parallel) solution of
1936 scientific applications modeled by partial differential equations.")
1937 (license (license:non-copyleft
1938 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1940 (define-public petsc-complex
1941 (package (inherit petsc)
1942 (name "petsc-complex")
1944 (substitute-keyword-arguments (package-arguments petsc)
1945 ((#:configure-flags cf)
1946 `(cons "--with-scalar-type=complex" ,cf))))
1947 (synopsis "Library to solve PDEs (with complex scalars)")))
1949 (define-public petsc-openmpi
1950 (package (inherit petsc)
1951 (name "petsc-openmpi")
1953 `(("hdf5" ,hdf5-parallel-openmpi)
1954 ("hypre" ,hypre-openmpi)
1956 ("mumps" ,mumps-openmpi)
1957 ("openmpi" ,openmpi)
1958 ("scalapack" ,scalapack)
1959 ("scotch" ,pt-scotch32)
1960 ,@(package-inputs petsc)))
1962 (substitute-keyword-arguments (package-arguments petsc)
1963 ((#:configure-flags cf)
1965 "--with-mpiexec=mpirun"
1968 "--with-scalapack=1"
1970 ,(string-append "--with-mpi-dir="
1971 (assoc-ref %build-inputs "openmpi"))
1972 ,(string-append "--with-hdf5-include="
1973 (assoc-ref %build-inputs "hdf5") "/include")
1974 ,(string-append "--with-hdf5-lib="
1975 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1976 ,@(delete "--with-mpi=0" ,cf)))
1978 `(modify-phases ,phases
1979 (add-before 'configure 'mpi-setup
1980 ,%openmpi-setup)))))
1981 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1983 (define-public petsc-complex-openmpi
1984 (package (inherit petsc-complex)
1985 (name "petsc-complex-openmpi")
1987 `(("openmpi" ,openmpi)
1988 ,@(package-inputs petsc-complex)))
1990 (substitute-keyword-arguments (package-arguments petsc-complex)
1991 ((#:configure-flags cf)
1992 ``("--with-mpiexec=mpirun"
1993 ,(string-append "--with-mpi-dir="
1994 (assoc-ref %build-inputs "openmpi"))
1995 ,@(delete "--with-mpi=0" ,cf)))
1997 `(modify-phases ,phases
1998 (add-before 'configure 'mpi-setup
1999 ,%openmpi-setup)))))
2000 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2002 (define-public python-petsc4py
2004 (name "python-petsc4py")
2009 (uri (pypi-uri "petsc4py" version))
2012 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
2013 (build-system python-build-system)
2016 (modify-phases %standard-phases
2017 (add-before 'build 'pre-build
2019 ;; Define path to PETSc installation.
2020 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2022 (add-before 'check 'mpi-setup
2025 `(("petsc" ,petsc-openmpi)
2026 ("python-numpy" ,python-numpy)))
2027 (home-page "https://bitbucket.org/petsc/petsc4py/")
2028 (synopsis "Python bindings for PETSc")
2029 (description "PETSc, the Portable, Extensible Toolkit for
2030 Scientific Computation, is a suite of data structures and routines for
2031 the scalable (parallel) solution of scientific applications modeled by
2032 partial differential equations. It employs the MPI standard for all
2033 message-passing communication. @code{petsc4py} provides Python
2034 bindings to almost all functions of PETSc.")
2035 (license license:bsd-3)))
2037 (define-public python-kiwisolver
2039 (name "python-kiwisolver")
2043 (uri (pypi-uri "kiwisolver" version))
2046 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2047 (build-system python-build-system)
2048 (home-page "https://github.com/nucleic/kiwi")
2049 (synopsis "Fast implementation of the Cassowary constraint solver")
2051 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2052 solving algorithm. Kiwi has been designed from the ground up to be
2053 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2054 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2055 savings are consistently > 5x.")
2056 (license license:bsd-3)))
2058 (define-public python2-kiwisolver
2059 (package-with-python2 python-kiwisolver))
2061 (define-public slepc
2068 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2072 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2073 (build-system gnu-build-system)
2075 `(("python" ,python-2)
2076 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2078 `(("arpack" ,arpack-ng)
2079 ("gfortran" ,gfortran)))
2081 `(("petsc" ,petsc)))
2083 `(#:parallel-build? #f ;build is parallel by default
2085 `(,(string-append "--with-arpack-dir="
2086 (assoc-ref %build-inputs "arpack") "/lib"))
2087 #:make-flags ;honor (parallel-job-count)
2088 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2089 ,(string-append "PETSCCONFIGDIR="
2090 (assoc-ref %build-inputs "petsc:examples")
2091 "/share/petsc/examples/config"))
2093 (modify-phases %standard-phases
2095 ;; configure is a python script, so we can't run it with bash.
2096 (lambda* (#:key inputs outputs (configure-flags '())
2098 (let* ((prefix (assoc-ref outputs "out"))
2099 (flags `(,(string-append "--prefix=" prefix)
2100 ,@configure-flags)))
2101 (format #t "build directory: ~s~%" (getcwd))
2102 (format #t "configure flags: ~s~%" flags)
2103 (setenv "SLEPC_DIR" (getcwd))
2104 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2105 (apply invoke "./configure" flags))))
2106 (add-after 'install 'delete-doc
2107 ;; TODO: SLEPc installs HTML documentation alongside headers in
2108 ;; $out/include. We'd like to move them to share/doc, but delete
2109 ;; them for now, as they are incomplete and installing the complete
2110 ;; documentation is difficult.
2111 (lambda* (#:key outputs #:allow-other-keys)
2112 (let* ((out (assoc-ref outputs "out")))
2113 (for-each delete-file (find-files out "\\.html$"))
2115 (add-after 'install 'clean-install
2116 ;; Clean up unnecessary build logs from installation.
2117 (lambda* (#:key outputs #:allow-other-keys)
2118 (let ((out (assoc-ref outputs "out")))
2119 (for-each (lambda (file)
2120 (let ((f (string-append out "/lib/slepc/conf/" file)))
2121 (when (file-exists? f)
2123 '("configure.log" "make.log" "gmake.log"
2124 "test.log" "error.log" "RDict.db"
2127 (home-page "http://slepc.upv.es")
2128 (synopsis "Scalable library for eigenproblems")
2129 (description "SLEPc is a software library for the solution of large sparse
2130 eigenproblems on parallel computers. It can be used for the solution of
2131 linear eigenvalue problems formulated in either standard or generalized form,
2132 as well as other related problems such as the singular value decomposition.
2133 The emphasis of the software is on methods and techniques appropriate for
2134 problems in which the associated matrices are sparse, for example, those
2135 arising after the discretization of partial differential equations.")
2136 (license license:bsd-2)))
2138 (define-public slepc-complex
2139 (package (inherit slepc)
2140 (name "slepc-complex")
2142 `(("petsc" ,petsc-complex)
2143 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2144 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2146 (define-public slepc-openmpi
2147 (package (inherit slepc)
2148 (name "slepc-openmpi")
2150 (substitute-keyword-arguments (package-arguments slepc)
2151 ((#:phases phases '%standard-phases)
2152 `(modify-phases ,phases
2153 (add-before 'check 'mpi-setup
2154 ,%openmpi-setup)))))
2157 ("arpack" ,arpack-ng-openmpi)
2158 ,@(alist-delete "arpack" (package-inputs slepc))))
2160 `(("petsc" ,petsc-openmpi)
2161 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2162 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2164 (define-public slepc-complex-openmpi
2165 (package (inherit slepc-openmpi)
2166 (name "slepc-complex-openmpi")
2168 `(("petsc" ,petsc-complex-openmpi)
2169 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2170 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2172 (define-public python-slepc4py
2174 (name "python-slepc4py")
2179 (uri (pypi-uri "slepc4py" version))
2182 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2183 (build-system python-build-system)
2186 (modify-phases %standard-phases
2187 (add-before 'build 'pre-build
2189 ;; Define path to PETSc installation.
2190 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2191 ;; Define path to SLEPc installation.
2192 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2194 (add-before 'check 'mpi-setup
2197 `(("python-numpy" ,python-numpy)
2198 ("python-petsc4py" ,python-petsc4py)
2199 ("slepc" ,slepc-openmpi)))
2200 (home-page "https://bitbucket.org/slepc/slepc4py/")
2201 (synopsis "Python bindings for SLEPc")
2202 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2203 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2204 Scientific Computation. It employs the MPI standard for all
2205 message-passing communication. @code{slepc4py} provides Python
2206 bindings to almost all functions of SLEPc.")
2207 (license license:bsd-3)))
2209 (define-public mumps
2216 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2220 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2221 (patches (search-patches "mumps-build-parallelism.patch"
2222 "mumps-shared-libseq.patch"
2223 "mumps-shared-mumps.patch"
2224 "mumps-shared-pord.patch"))))
2225 (build-system gnu-build-system)
2227 `(("fortran" ,gfortran)
2228 ;; These are required for linking against mumps, but we let the user
2229 ;; declare the dependency.
2232 ("scotch" ,scotch)))
2234 `(#:modules ((ice-9 match)
2237 ,@%gnu-build-system-modules)
2239 (modify-phases %standard-phases
2241 (lambda* (#:key inputs #:allow-other-keys)
2242 (call-with-output-file "Makefile.inc"
2253 INCSEQ = -I$(topdir)/libseq
2254 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2255 LIBSEQNEEDED = libseqneeded~;
2259 AR = ar vr # rules require trailing space, ugh...
2262 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2264 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2265 LIBOTHERS = -pthread
2268 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2272 LIBS = $(SCALAP) $(LIBSEQ)
2273 LPORDDIR = $(topdir)/PORD/lib
2274 IPORD = -I$(topdir)/PORD/include
2275 LPORD = $(LPORDDIR)/libpord.a
2276 ORDERINGSF = -Dpord~@[
2278 IMETIS = -I$(METISDIR)/include
2279 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2280 ORDERINGSF += -Dmetis~]~@[~:{
2282 ISCOTCH = -I$(SCOTCHDIR)/include
2283 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2284 ORDERINGSF += ~a~}~]
2285 ORDERINGSC = $(ORDERINGSF)
2286 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2287 IORDERINGSF = $(ISCOTCH)
2288 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2289 (assoc-ref inputs "mpi")
2290 (assoc-ref inputs "blas")
2291 (assoc-ref inputs "scalapack")
2292 (assoc-ref inputs "metis")
2293 (match (list (assoc-ref inputs "pt-scotch")
2294 (assoc-ref inputs "scotch"))
2298 `((,scotch "" "-Dscotch")))
2301 "-lptesmumps -lptscotch -lptscotcherr "
2302 "-Dptscotch")))))))))
2304 ;; By default only the d-precision library is built. Make with "all"
2305 ;; target so that all precision libraries and examples are built.
2307 (invoke "make" "all"
2308 (format #f "-j~a" (parallel-job-count)))))
2310 ;; Run the simple test drivers, which read test input from stdin:
2311 ;; from the "real" input for the single- and double-precision
2312 ;; testers, and from the "cmplx" input for complex-precision
2313 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2314 ;; package to prefix execution with "mpirun".
2315 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2316 (with-directory-excursion "examples"
2319 (let ((tester (apply open-pipe*
2322 ,(string-append "./" prec
2324 (input (open-input-file
2325 (string-append "input_simpletest_" type))))
2327 (dump-port input tester)
2329 (zero? (close-pipe tester)))))
2331 '("real" "real" "cmplx" "cmplx")))))
2333 (lambda* (#:key outputs #:allow-other-keys)
2334 (let* ((out (assoc-ref outputs "out"))
2335 (libdir (string-append out "/lib")))
2336 (copy-recursively "lib" libdir)
2337 (copy-recursively "include" (string-append out "/include"))
2338 (when (file-exists? "libseq/libmpiseq.a")
2339 (install-file "libseq/libmpiseq.a" libdir))
2340 (when (file-exists? "libseq/libmpiseq.so")
2341 (install-file "libseq/libmpiseq.so" libdir))
2343 (home-page "http://mumps.enseeiht.fr")
2344 (synopsis "Multifrontal sparse direct solver")
2346 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2347 sparse system of linear equations A x = b using Gaussian elimination.")
2348 (license license:cecill-c)))
2350 (define-public mumps-metis
2351 (package (inherit mumps)
2352 (name "mumps-metis")
2354 (alist-delete "scotch" (package-inputs mumps)))))
2356 (define-public mumps-openmpi
2357 (package (inherit mumps)
2358 (name "mumps-openmpi")
2361 ("scalapack" ,scalapack)
2362 ("pt-scotch" ,pt-scotch)
2363 ,@(alist-delete "scotch" (package-inputs mumps))))
2365 (substitute-keyword-arguments (package-arguments mumps)
2367 `(modify-phases ,phases
2368 (add-before 'check 'mpi-setup
2372 ((assoc-ref ,phases 'check)
2373 #:exec-prefix '("mpirun" "-n" "2"))))))))
2374 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2376 (define-public mumps-metis-openmpi
2377 (package (inherit mumps-openmpi)
2378 (name "mumps-metis-openmpi")
2380 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2382 (define-public ruby-asciimath
2384 (name "ruby-asciimath")
2389 (uri (rubygems-uri "asciimath" version))
2392 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2393 (build-system ruby-build-system)
2396 (modify-phases %standard-phases
2398 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2399 (add-after 'unpack 'patch-remove-spurious-backslashes
2401 (substitute* "spec/parser_spec.rb"
2406 `(("bundler" ,bundler)
2407 ("ruby-rspec" ,ruby-rspec)))
2408 (synopsis "AsciiMath parsing and conversion library")
2410 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2411 easy-to-write markup language for mathematics.")
2412 (home-page "https://github.com/asciidoctor/asciimath")
2413 (license license:expat)))
2415 (define-public superlu
2422 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2423 "superlu_" version ".tar.gz"))
2425 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2426 (modules '((guix build utils)))
2428 ;; Replace the non-free implementation of MC64 with a stub adapted
2431 (use-modules (ice-9 regex)
2433 (call-with-output-file "SRC/mc64ad.c"
2438 void mc64id_(int *a) {
2439 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2442 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2443 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2444 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2447 ;; Remove the corresponding license verbiage. MC64 license follows
2448 ;; a "------" line separator.
2449 (with-atomic-file-replacement "License.txt"
2450 (let ((rx (make-regexp "-{8}")))
2453 (let ((line (read-line in 'concat)))
2454 (unless (regexp-exec rx line)
2458 (build-system cmake-build-system)
2462 `(("blas" ,openblas)
2463 ("gfortran" ,gfortran)))
2465 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2466 "-DTPL_BLAS_LIBRARIES=openblas"
2467 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2468 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2469 (synopsis "Supernodal direct solver for sparse linear systems")
2471 "SuperLU is a general purpose library for the direct solution of large,
2472 sparse, nonsymmetric systems of linear equations on high performance machines.
2473 The library is written in C and is callable from either C or Fortran. The
2474 library routines perform an LU decomposition with partial pivoting and
2475 triangular system solves through forward and back substitution. The library
2476 also provides threshold-based ILU factorization preconditioners.")
2477 (license (list license:bsd-3
2478 license:gpl2+ ;EXAMPLE/*fgmr.c
2479 (license:fsf-free "file://SRC/colamd.h")))))
2481 (define-public superlu-dist
2483 (name "superlu-dist")
2488 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2489 "superlu_dist_" version ".tar.gz"))
2491 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2492 (modules '((guix build utils)))
2494 ;; Replace the non-free implementation of MC64 with a stub
2496 (call-with-output-file "SRC/mc64ad_dist.c"
2501 void mc64id_dist(int *a) {
2502 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2505 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2506 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2507 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2510 (substitute* "SRC/util.c" ;adjust default algorithm
2511 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2512 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2513 ;; general (i.e. non-square) processor-grid support.
2514 "RowPerm = NOROWPERM;"))
2516 (patches (search-patches "superlu-dist-scotchmetis.patch"
2517 "superlu-dist-awpm-grid.patch"
2518 "superlu-dist-fix-mpi-deprecations.patch"))))
2519 (build-system cmake-build-system)
2523 `(("gfortran" ,gfortran)
2526 ("combblas" ,combinatorial-blas)))
2528 `(("mpi" ,openmpi) ;headers include MPI heades
2529 ("parmetis" ,pt-scotch32 "metis")
2530 ("pt-scotch" ,pt-scotch32)))
2532 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2533 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2534 "-DTPL_ENABLE_COMBBLASLIB=YES"
2535 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2536 "-DTPL_LAPACK_LIBRARIES=-llapack"
2537 (string-append "-DTPL_PARMETIS_LIBRARIES="
2539 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2540 "scotchmetis" "scotch" "scotcherr")
2542 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2543 (assoc-ref %build-inputs "parmetis")
2545 "-DTPL_ENABLE_COMBBLASLIB=ON"
2546 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2547 (assoc-ref %build-inputs "combblas")
2548 "/include/CombBLAS;"
2549 (assoc-ref %build-inputs "combblas")
2550 "/include/BipartiteMatchings")
2551 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2553 (modify-phases %standard-phases
2554 (add-before 'configure 'set-c++-standard
2556 (substitute* "CMakeLists.txt"
2557 ;; AWPM headers require C++14
2558 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2559 (add-before 'check 'mpi-setup
2561 (add-before 'check 'omp-setup
2562 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2563 (home-page (package-home-page superlu))
2564 (synopsis "Parallel supernodal direct solver")
2566 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2567 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2568 implemented in ANSI C, and MPI for communications.")
2569 (license license:bsd-3)))
2571 (define-public scotch
2578 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2579 "latestfile/298/scotch_" version ".tar.gz"))
2581 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2582 (patches (search-patches "scotch-build-parallelism.patch"
2583 "scotch-integer-declarations.patch"))))
2584 (build-system gnu-build-system)
2589 (outputs '("out" "metis"))
2591 `(#:make-flags (list (string-append "prefix=" %output))
2593 (modify-phases %standard-phases
2595 'unpack 'chdir-to-src
2596 (lambda _ (chdir "src") #t))
2600 (call-with-output-file "Makefile.inc"
2614 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2615 LDFLAGS = -lz -lm -lrt -lpthread
2617 LEX = flex -Pscotchyy -olex.yy.c
2622 YACC = bison -pscotchyy -y -b y
2624 '("COMMON_FILE_COMPRESS_GZ"
2626 "COMMON_RANDOM_FIXED_SEED"
2627 "INTSIZE64" ;use 'int64_t'
2628 ;; Prevents symbolc clashes with libesmumps
2630 ;; XXX: Causes invalid frees in superlu-dist tests
2632 ;; "SCOTCH_PTHREAD_NUMBER=2"
2633 "restrict=__restrict"))))
2635 (add-after 'build 'build-esmumps
2638 (format #f "-j~a" (parallel-job-count))
2640 (add-before 'install 'make-install-dirs
2641 (lambda* (#:key outputs #:allow-other-keys)
2642 (mkdir (assoc-ref outputs "out"))))
2643 (add-after 'install 'install-metis
2644 (lambda* (#:key outputs #:allow-other-keys)
2645 (let ((out (assoc-ref outputs "metis")))
2647 ;; metis files are not installed with 'make install'
2648 (for-each (lambda (f)
2649 (install-file f (string-append out "/include")))
2650 (find-files "../include/" ".*metis\\.h"))
2651 (for-each (lambda (f)
2652 (install-file f (string-append out "/lib")))
2653 (find-files "../lib/" ".*metis\\..*"))
2655 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2656 (synopsis "Programs and libraries for graph algorithms")
2657 (description "SCOTCH is a set of programs and libraries which implement
2658 the static mapping and sparse matrix reordering algorithms developed within
2659 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2660 conquer approach, to scientific computing problems such as graph and mesh
2661 partitioning, static mapping, and sparse matrix ordering, in application
2662 domains ranging from structural mechanics to operating systems or
2664 ;; See LICENSE_en.txt
2665 (license license:cecill-c)))
2667 (define-public scotch32
2668 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2669 ;; some applications.
2670 (package (inherit scotch)
2673 (substitute-keyword-arguments (package-arguments scotch)
2674 ((#:phases scotch-phases)
2675 `(modify-phases ,scotch-phases
2679 (call-with-output-file "Makefile.inc"
2693 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2694 LDFLAGS = -lz -lm -lrt -lpthread
2696 LEX = flex -Pscotchyy -olex.yy.c
2701 YACC = bison -pscotchyy -y -b y
2703 '("COMMON_FILE_COMPRESS_GZ"
2705 "COMMON_RANDOM_FIXED_SEED"
2706 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2707 ;; Prevents symbolc clashes with libesmumps
2709 ;; XXX: Causes invalid frees in superlu-dist tests
2711 ;; "SCOTCH_PTHREAD_NUMBER=2"
2712 "restrict=__restrict"))))))))))
2714 "Programs and libraries for graph algorithms (32-bit integers)")))
2716 (define-public pt-scotch
2717 (package (inherit scotch)
2720 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2722 (substitute-keyword-arguments (package-arguments scotch)
2723 ((#:phases scotch-phases)
2724 `(modify-phases ,scotch-phases
2728 (invoke "make" (format #f "-j~a" (parallel-job-count))
2729 "ptscotch" "ptesmumps")
2731 ;; Install the serial metis compatibility library
2732 (invoke "make" "-C" "libscotchmetis" "install")))
2733 (add-before 'check 'mpi-setup
2737 (invoke "make" "ptcheck")))))))
2738 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2740 (define-public pt-scotch32
2741 (package (inherit scotch32)
2742 (name "pt-scotch32")
2744 `(("openmpi" ,openmpi))) ;headers include MPI headers
2746 (substitute-keyword-arguments (package-arguments scotch32)
2747 ((#:phases scotch32-phases)
2748 `(modify-phases ,scotch32-phases
2751 (invoke "make" (format #f "-j~a" (parallel-job-count))
2752 "ptscotch" "ptesmumps")
2753 ;; Install the serial metis compatibility library
2754 (invoke "make" "-C" "libscotchmetis" "install")))
2755 (add-before 'check 'mpi-setup
2759 (invoke "make" "ptcheck")))))))
2761 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2763 (define-public metis
2770 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2771 "metis-" version ".tar.gz"))
2774 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2775 (build-system cmake-build-system)
2777 `(("blas" ,openblas)))
2779 `(#:tests? #f ;no tests
2780 #:configure-flags `("-DSHARED=ON"
2781 ,(string-append "-DGKLIB_PATH=" (getcwd)
2782 "/metis-" ,version "/GKlib"))))
2783 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2784 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2786 "METIS is a set of serial programs for partitioning graphs, partitioning
2787 finite element meshes, and producing fill-reducing orderings for sparse
2788 matrices. The algorithms implemented in METIS are based on the multilevel
2789 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2791 (license license:asl2.0))) ;As of version 5.0.3
2793 (define-public p4est
2800 (uri (string-append "http://p4est.github.io/release/p4est-"
2804 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2805 (build-system gnu-build-system)
2807 `(("fortran" ,gfortran)
2812 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2813 (assoc-ref %build-inputs "blas")
2815 ,(string-append "LAPACK_LIBS=-L"
2816 (assoc-ref %build-inputs "lapack")
2818 #:phases (modify-phases %standard-phases
2819 (add-before 'check 'mpi-setup
2821 (home-page "http://www.p4est.org")
2822 (synopsis "Adaptive mesh refinement on forests of octrees")
2824 "The p4est software library enables the dynamic management of a
2825 collection of adaptive octrees, conveniently called a forest of octrees.
2826 p4est is designed to work in parallel and scales to hundreds of thousands of
2828 (license license:gpl2+)))
2830 (define-public p4est-openmpi
2831 (package (inherit p4est)
2832 (name "p4est-openmpi")
2835 ,@(package-inputs p4est)))
2837 (substitute-keyword-arguments (package-arguments p4est)
2838 ((#:configure-flags cf)
2839 ``("--enable-mpi" ,@,cf))))
2840 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2842 (define-public gsegrafix
2849 (uri (string-append "mirror://gnu/" name "/" name "-"
2853 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2854 (build-system gnu-build-system)
2856 `(#:configure-flags '("LDFLAGS=-lm")))
2858 `(("libgnomecanvas" ,libgnomecanvas)
2859 ("libbonoboui" ,libbonoboui)
2860 ("libgnomeui" ,libgnomeui)
2861 ("libgnomeprintui" ,libgnomeprintui)
2864 `(("pkg-config" ,pkg-config)))
2865 (home-page "https://www.gnu.org/software/gsegrafix/")
2866 (synopsis "GNOME application to create scientific and engineering plots")
2867 (description "GSEGrafix is an application which produces high-quality graphical
2868 plots for science and engineering. Plots are specified via simple ASCII
2869 parameter files and data files and are presented in an anti-aliased GNOME
2870 canvas. The program supports rectangular two-dimensional plots, histograms,
2871 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2872 to BMP, JPEG or PNG image formats.")
2873 (license license:gpl3+)))
2875 (define-public maxima
2882 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2883 version "-source/" name "-" version ".tar.gz"))
2886 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2887 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2888 (build-system gnu-build-system)
2891 ("gnuplot" ,gnuplot) ;for plots
2893 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2895 `(("texinfo" ,texinfo)
2897 ("python" ,python)))
2900 (list "--enable-gcl"
2901 (string-append "--with-posix-shell="
2902 (assoc-ref %build-inputs "bash")
2904 (string-append "--with-wish="
2905 (assoc-ref %build-inputs "tk")
2907 (let ((v ,(package-version tk)))
2908 (string-take v (string-index-right v #\.)))))
2909 ;; By default Maxima attempts to write temporary files to
2910 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2911 ;; Work around that.
2912 #:make-flags (list "TMPDIR=/tmp")
2914 (modify-phases %standard-phases
2915 (add-after 'unpack 'patch-paths
2916 (lambda* (#:key inputs #:allow-other-keys)
2917 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2918 (coreutils (assoc-ref inputs "coreutils"))
2919 (dirname (string-append coreutils "/bin/dirname"))
2920 (head (string-append coreutils "/bin/head"))
2921 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2922 (python (string-append (assoc-ref inputs "python")
2924 (substitute* "src/maxima.in"
2925 (("sed ") (string-append sed " "))
2926 (("dirname") dirname)
2928 (substitute* "doc/info/Makefile.in"
2929 (("/usr/bin/env perl") perl))
2930 (substitute* "doc/info/build_html.sh.in"
2931 (("python") python))
2933 (add-before 'check 'pre-check
2935 (chmod "src/maxima" #o555)
2939 ;; This is derived from the testing code in the "debian/rules" file
2940 ;; of Debian's Maxima package.
2941 ;; If Maxima can successfully run this, the binary to be installed
2947 "--batch-string=\"run_testsuite();\" "
2948 "| grep -q \"No unexpected errors found\""))))
2949 ;; Make sure the doc and emacs files are found in the
2950 ;; standard location. Also configure maxima to find gnuplot
2951 ;; without having it on the PATH.
2952 (add-after 'install 'post-install
2953 (lambda* (#:key outputs inputs #:allow-other-keys)
2954 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2955 (out (assoc-ref outputs "out"))
2956 (datadir (string-append out "/share/maxima/" ,version))
2957 (binutils (string-append (assoc-ref inputs "binutils")
2959 (with-directory-excursion out
2960 (mkdir-p "share/emacs")
2961 (mkdir-p "share/doc")
2963 (string-append datadir "/doc/")
2964 (string-append out "/share/doc/maxima"))
2965 (with-atomic-file-replacement
2966 (string-append datadir "/share/maxima-init.lisp")
2968 (format out "~a ~s~a~%"
2969 "(setf $gnuplot_command "
2970 (string-append gnuplot "/bin/gnuplot") ")")
2971 (dump-port in out))))
2972 ;; Ensure that Maxima will have access to the GNU binutils
2973 ;; components at runtime.
2974 (wrap-program (string-append out "/bin/maxima")
2975 `("PATH" prefix (,binutils))))
2977 (home-page "http://maxima.sourceforge.net")
2978 (synopsis "Numeric and symbolic expression manipulation")
2979 (description "Maxima is a system for the manipulation of symbolic and
2980 numerical expressions. It yields high precision numeric results by using
2981 exact fractions, arbitrary precision integers, and variable precision floating
2983 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2984 ;; Others simply say "GNU General Public License" without stating a
2985 ;; version (which implicitly means gpl1+).
2986 ;; At least one file (src/maxima.asd) says "version 2."
2987 ;; GPLv2 only is therefore the smallest subset.
2988 (license license:gpl2)))
2990 (define-public wxmaxima
2998 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2999 (commit (string-append "Version-" version))))
3000 (file-name (git-file-name name version))
3002 (base32 "16xizaddb27432n1083y89ir5zdqvllsgbwrzzk4jc2rw1ldxfsv"))))
3003 (build-system cmake-build-system)
3005 `(("gettext" ,gettext-minimal)))
3007 `(("wxwidgets" ,wxwidgets)
3010 ("adwaita-icon-theme" ,adwaita-icon-theme)
3012 ("shared-mime-info" ,shared-mime-info)))
3014 `(#:tests? #f ; no check target
3016 (modify-phases %standard-phases
3017 (add-after 'install 'wrap-program
3018 (lambda* (#:key inputs outputs #:allow-other-keys)
3019 (wrap-program (string-append (assoc-ref outputs "out")
3022 (,(string-append (assoc-ref inputs "maxima")
3024 ;; For GtkFileChooserDialog.
3025 `("GSETTINGS_SCHEMA_DIR" =
3026 (,(string-append (assoc-ref inputs "gtk+")
3027 "/share/glib-2.0/schemas")))
3028 `("XDG_DATA_DIRS" ":" prefix
3029 (;; Needed by gdk-pixbuf to know supported icon formats.
3031 (assoc-ref inputs "shared-mime-info") "/share")
3032 ;; The default icon theme of GTK+.
3034 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3036 (home-page "https://andrejv.github.io/wxmaxima/")
3037 (synopsis "Graphical user interface for the Maxima computer algebra system")
3039 "wxMaxima is a graphical user interface for the Maxima computer algebra
3040 system. It eases the use of Maxima by making most of its commands available
3041 through a menu system and by providing input dialogs for commands that require
3042 more than one argument. It also implements its own display engine that
3043 outputs mathematical symbols directly instead of depicting them with ASCII
3046 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3047 text and mathematical calculations to create documents, exporting of input and
3048 output to TeX, and a browser for Maxima's manual including command index and
3049 full text searching.")
3050 (license license:gpl2+)))
3052 (define-public armadillo
3058 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3062 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3063 (build-system cmake-build-system)
3064 (arguments `(#:tests? #f)) ; no test target
3066 `(("openblas" ,openblas)
3068 ("arpack" ,arpack-ng)))
3069 (home-page "http://arma.sourceforge.net/")
3070 (synopsis "C++ linear algebra library")
3072 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3073 between speed and ease of use. It is useful for algorithm development
3074 directly in C++, or quick conversion of research code into production
3075 environments. It can be used for machine learning, pattern recognition,
3076 signal processing, bioinformatics, statistics, econometrics, etc. The library
3077 provides efficient classes for vectors, matrices and cubes, as well as 150+
3078 associated functions (eg. contiguous and non-contiguous submatrix views).")
3079 (license license:asl2.0)))
3081 (define-public muparser
3082 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3083 ;; different hash. In order to make `guix package --upgrade` work correctly,
3084 ;; we set a Guix packaging revision.
3085 ;; When the next version of muparser is released, we can remove
3086 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3087 (let ((upstream-version "2.2.5")
3091 (version (string-append upstream-version "-" revision))
3096 (url "https://github.com/beltoforion/muparser.git")
3097 (commit (string-append "v" upstream-version))))
3098 (file-name (git-file-name name version))
3100 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3101 (build-system gnu-build-system)
3103 `(#:configure-flags '("--enable-samples=no")
3104 #:tests? #f)) ;no "check" target
3105 (home-page "http://muparser.beltoforion.de/")
3106 (synopsis "Fast parser library for mathematical expressions")
3108 "muParser is an extensible high performance math parser library. It is
3109 based on transforming an expression into a bytecode and precalculating constant
3111 (license license:expat))))
3113 (define-public openblas
3120 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3121 version "%20version.tar.gz"))
3122 (file-name (string-append name "-" version ".tar.gz"))
3125 "0jbdjsi0qsxahdcm42agnn1y7xpmg0hrhwjsxg0zbhs9wwy3p568"))))
3126 (build-system gnu-build-system)
3128 `(#:test-target "test"
3129 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3130 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3131 ;; we need to disable substitutions.
3133 ,(let ((system (or (%current-target-system) (%current-system))))
3134 (or (string-prefix? "x86_64" system)
3135 (string-prefix? "i686" system)
3136 (string-prefix? "mips" system)
3137 (string-prefix? "aarch64" system)))
3139 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3141 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3143 ;; This is the maximum number of threads OpenBLAS will ever use (that
3144 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3145 ;; is used.) If we don't set it, the makefile sets it to the number
3146 ;; of cores of the build machine, which is obviously wrong.
3149 ;; Build the library for all supported CPUs. This allows
3150 ;; switching CPU targets at runtime with the environment variable
3151 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3152 ;; Unfortunately, this is not supported on non-x86 architectures,
3153 ;; where it leads to failed builds.
3154 ,@(let ((system (or (%current-target-system) (%current-system))))
3156 ((or (string-prefix? "x86_64" system)
3157 (string-prefix? "i686" system))
3158 '("DYNAMIC_ARCH=1"))
3159 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3160 ;; two available MIPS targets special extended instructions
3161 ;; for Loongson cores are used.
3162 ((string-prefix? "mips" system)
3163 '("TARGET=SICORTEX"))
3164 ;; On aarch64 force the generic 'armv8-a' target
3165 ((string-prefix? "aarch64" system)
3168 ;; no configure script
3170 (modify-phases %standard-phases
3172 (add-before 'build 'set-extralib
3173 (lambda* (#:key inputs #:allow-other-keys)
3174 ;; Get libgfortran found when building in utest.
3176 (string-append "-L" (assoc-ref inputs "fortran-lib")
3180 `(("fortran-lib" ,gfortran "lib")))
3183 ("fortran" ,gfortran)
3185 (home-page "http://www.openblas.net/")
3186 (synopsis "Optimized BLAS library based on GotoBLAS")
3188 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3189 (license license:bsd-3)))
3191 (define-public openblas-ilp64
3192 (package/inherit openblas
3193 (name "openblas-ilp64")
3194 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3196 (substitute-keyword-arguments (package-arguments openblas)
3197 ((#:make-flags flags '())
3198 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3200 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3201 (license license:bsd-3)))
3203 (define* (make-blis implementation #:optional substitutable?)
3204 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3205 source tree for a list of implementations.)
3207 SUBSTITUTABLE? determines whether the package is made available as a
3210 Currently the specialization must be selected at configure-time, but work is
3211 underway to allow BLIS to select the right optimized kernels at run time:
3212 <https://github.com/flame/blis/issues/129>."
3214 (name (if (string=? implementation "reference")
3216 (string-append "blis-" implementation)))
3218 (home-page "https://github.com/flame/blis")
3221 (uri (git-reference (url home-page) (commit version)))
3224 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3225 (file-name (git-file-name "blis" version))))
3226 (build-system gnu-build-system)
3228 `(#:test-target "test"
3230 #:substitutable? ,substitutable?
3232 #:phases (modify-phases %standard-phases
3234 (lambda* (#:key outputs #:allow-other-keys)
3235 ;; This is a home-made 'configure' script.
3236 (let ((out (assoc-ref outputs "out")))
3237 (invoke "./configure" "-p" out
3241 "--enable-threading=openmp"
3244 (add-before 'check 'show-test-output
3246 ;; By default "make check" is silent. Make it verbose.
3247 (system "tail -F output.testsuite &")
3249 (synopsis "High-performance basic linear algebra (BLAS) routines")
3251 "BLIS is a portable software framework for instantiating high-performance
3252 BLAS-like dense linear algebra libraries. The framework was designed to
3253 isolate essential kernels of computation that, when optimized, immediately
3254 enable optimized implementations of most of its commonly used and
3255 computationally intensive operations. While BLIS exports a new BLAS-like API,
3256 it also includes a BLAS compatibility layer which gives application developers
3257 access to BLIS implementations via traditional BLAS routine calls.")
3258 (license license:bsd-3)))
3261 ;; This is the "reference" implementation, which is the non-optimized but
3262 ;; portable variant (no assembly).
3263 (make-blis "reference" #t))
3265 (define ignorance blis)
3267 (define-syntax-rule (blis/x86_64 processor)
3268 "Expand to a package specialized for PROCESSOR."
3270 (inherit (make-blis processor))
3271 (supported-systems '("x86_64-linux"))))
3273 (define-public blis-sandybridge
3274 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3275 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3276 (blis/x86_64 "sandybridge"))
3278 (define-public blis-haswell
3279 ;; BLIS specialized for Haswell processors (launched 2013):
3280 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3281 (blis/x86_64 "haswell"))
3283 (define-public blis-knl
3284 ;; BLIS specialized for Knights Landing processor (launched 2016):
3285 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3286 (blis/x86_64 "knl"))
3289 (define-public openlibm
3297 (url "https://github.com/JuliaLang/openlibm.git")
3298 (commit (string-append "v" version))))
3299 (file-name (git-file-name name version))
3301 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3302 (build-system gnu-build-system)
3305 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3307 ;; no configure script
3308 (modify-phases %standard-phases (delete 'configure))
3309 #:tests? #f)) ;the tests are part of the default target
3310 (home-page "http://openlibm.org/")
3311 (synopsis "Portable C mathematical library (libm)")
3313 "OpenLibm is an effort to have a high quality, portable, standalone C
3314 mathematical library (libm). It can be used standalone in applications and
3315 programming language implementations. The project was born out of a need to
3316 have a good libm for the Julia programming language that worked consistently
3317 across compilers and operating systems, and in 32-bit and 64-bit
3319 ;; Each architecture has its own make target, and there is none for mips.
3320 (supported-systems (delete "mips64el-linux" %supported-systems))
3321 ;; See LICENSE.md for details.
3322 (license (list license:expat
3325 license:public-domain
3326 license:lgpl2.1+))))
3328 (define-public openspecfun
3330 (name "openspecfun")
3336 (url "https://github.com/JuliaLang/openspecfun.git")
3337 (commit (string-append "v" version))))
3338 (file-name (git-file-name name version))
3340 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3341 (build-system gnu-build-system)
3343 '(#:tests? #f ; no "check" target
3345 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3347 (modify-phases %standard-phases
3348 (delete 'configure)))) ; no configure script
3350 `(("fortran" ,gfortran)))
3351 (home-page "https://github.com/JuliaLang/openspecfun")
3352 (synopsis "Collection of special mathematical functions")
3354 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3355 portable package for Bessel Functions of a Complex Argument and Nonnegative
3356 Order; it contains subroutines for computing Bessel functions and Airy
3357 functions. Faddeeva allows computing the various error functions of arbitrary
3358 complex arguments (Faddeeva function, error function, complementary error
3359 function, scaled complementary error function, imaginary error function, and
3360 Dawson function); given these, one can also easily compute Voigt functions,
3361 Fresnel integrals, and similar related functions as well.")
3362 ;; Faddeeva is released under the Expat license; AMOS is included as
3363 ;; public domain software.
3364 (license (list license:expat license:public-domain))))
3366 (define-public suitesparse
3368 (name "suitesparse")
3374 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3378 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3379 (modules '((guix build utils)))
3381 ;; Remove bundled metis source
3383 (delete-file-recursively "metis-5.1.0")
3385 (build-system gnu-build-system)
3387 '(#:tests? #f ;no "check" target
3392 "MY_METIS_LIB=-lmetis"
3393 (string-append "INSTALL_LIB="
3394 (assoc-ref %outputs "out") "/lib")
3395 (string-append "INSTALL_INCLUDE="
3396 (assoc-ref %outputs "out") "/include")
3399 (modify-phases %standard-phases
3400 (delete 'configure)))) ;no configure script
3405 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3406 (synopsis "Suite of sparse matrix software")
3408 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3409 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3410 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3411 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3412 CXSparse, a concise sparse Cholesky factorization package; and many other
3415 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3417 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3418 (license (list license:gpl2+ license:lgpl2.1+))))
3420 (define-public atlas
3426 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3427 version "/atlas" version ".tar.bz2"))
3430 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3431 (build-system gnu-build-system)
3432 (home-page "http://math-atlas.sourceforge.net/")
3433 (inputs `(("gfortran" ,gfortran)
3434 ("lapack-tar" ,(package-source lapack))))
3435 (outputs '("out" "doc"))
3436 ;; For the moment we drop support for MIPS at it fails to compile. See
3437 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3438 (supported-systems (delete "mips64el-linux" %supported-systems))
3440 `(#:parallel-build? #f
3441 #:parallel-tests? #f
3443 ;; ATLAS tunes itself for the machine it is built on, as explained at
3444 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3445 ;; For this reason, we want users to build it locally instead of using
3449 #:modules ((srfi srfi-26)
3450 (guix build gnu-build-system)
3453 `(;; Generate position independent code suitable for dynamic libraries
3454 ;; and use WALL timer to get more accurate timing.
3455 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3458 ,,(if (string-match "64" (%current-system))
3461 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3462 ;; needed to compile C files before it is generated.
3463 "-Ss" "pmake" "make -j 1"
3464 ;; Probe is failing for MIPS. We therefore define the system
3465 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3466 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3467 ,,@(if (string-prefix? "mips" (%current-system))
3468 (list "-A" "49" "-V" "1")
3470 ;; Generate shared libraries.
3472 ;; Build a full LAPACK library.
3473 ,(string-append "--with-netlib-lapack-tarfile="
3474 (assoc-ref %build-inputs "lapack-tar")))
3476 (modify-phases %standard-phases
3477 (add-after 'install 'install-doc
3478 (lambda* (#:key outputs inputs #:allow-other-keys)
3479 (let ((doc (string-append (assoc-ref outputs "doc")
3480 "/share/doc/atlas")))
3482 (for-each (cut install-file <> doc)
3483 (find-files "../ATLAS/doc" ".*"))
3485 (add-after 'check 'check-pt
3486 (lambda _ (invoke "make" "ptcheck")))
3487 ;; Fix files required to run configure.
3488 (add-before 'configure 'fix-/bin/sh
3490 ;; Use `sh', not `/bin/sh'.
3491 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3495 ;; Fix /bin/sh in generated make files.
3496 (add-after 'configure 'fix-/bin/sh-in-generated-files
3498 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3502 ;; ATLAS configure program does not accepts the default flags
3503 ;; passed by the 'gnu-build-system'.
3505 (lambda* (#:key native-inputs inputs outputs
3506 (configure-flags '())
3507 #:allow-other-keys #:rest args)
3508 (let* ((prefix (assoc-ref outputs "out"))
3509 (bash (or (and=> (assoc-ref
3510 (or native-inputs inputs) "bash")
3511 (cut string-append <> "/bin/bash"))
3513 (flags `(,(string-append "--prefix=" prefix)
3515 (abs-srcdir (getcwd))
3516 (srcdir (string-append "../" (basename abs-srcdir))))
3517 (format #t "source directory: ~s (relative from build: ~s)~%"
3521 (format #t "build directory: ~s~%" (getcwd))
3522 (format #t "configure flags: ~s~%" flags)
3524 (string-append srcdir "/configure")
3526 (synopsis "Automatically Tuned Linear Algebra Software")
3528 "ATLAS is an automatically tuned linear algebra software library
3529 providing C and Fortran77 interfaces to a portably efficient BLAS
3530 implementation, as well as a few routines from LAPACK.
3532 Optimization occurs at build time. For this reason, the library is built on
3533 the machine where it is installed, without resorting to pre-built substitutes.
3535 Before building the library, CPU throttling should be disabled. This can be
3536 done in the BIOS, or, on GNU/Linux, with the following command:
3539 # cpupower --governor performance
3542 Failure to do so will result in a library with poor performance.")
3543 (license license:bsd-3)))
3552 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3553 version "/glm-" version ".zip"))
3555 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3556 (patches (search-patches "glm-restore-install-target.patch"))))
3557 (build-system cmake-build-system)
3559 `(("unzip" ,unzip)))
3560 (home-page "https://glm.g-truc.net/")
3561 (synopsis "OpenGL Mathematics library")
3562 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3563 library for graphics software based on the OpenGL Shading Language (GLSL)
3565 (license license:expat)))
3567 (define-public lpsolve
3574 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3575 "/lp_solve_" version "_source.tar.gz"))
3578 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3579 (modules '((guix build utils)))
3582 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3584 ;; Pretend to be on a 64 bit platform to obtain a common directory
3585 ;; name for the build results on all architectures; nothing else
3586 ;; seems to depend on it.
3587 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3589 ;; The check for 'isnan' as it is written fails with
3590 ;; "non-floating-point argument in call to function
3591 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3592 ;; definition, which in turn leads to bad things. Fix the feature
3594 (("isnan\\(0\\)") "isnan(0.)"))
3596 (build-system gnu-build-system)
3598 `(#:tests? #f ; no check target
3600 (modify-phases %standard-phases
3601 (delete 'configure) ; no configure script
3604 (with-directory-excursion "lpsolve55"
3605 (invoke "bash" "ccc"))
3606 (with-directory-excursion "lp_solve"
3607 (invoke "bash" "ccc"))
3610 (lambda* (#:key outputs #:allow-other-keys)
3611 (let* ((out (assoc-ref outputs "out"))
3612 (bin (string-append out "/bin"))
3613 (lib (string-append out "/lib"))
3614 ;; This is where LibreOffice expects to find the header
3615 ;; files, and where they are installed by Debian.
3616 (include (string-append out "/include/lpsolve")))
3617 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3618 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3619 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3621 ;; Install a subset of the header files as on Debian
3622 ;; (plus lp_bit.h, which matches the regular expression).
3623 (for-each (lambda (name)
3624 (install-file name include))
3625 (find-files "." "lp_[HMSa-z].*\\.h$"))
3626 (with-directory-excursion "shared"
3627 (for-each (lambda (name)
3628 (install-file name include))
3629 (find-files "." "\\.h$")))
3631 (home-page "http://lpsolve.sourceforge.net/")
3632 (synopsis "Mixed integer linear programming (MILP) solver")
3634 "lp_solve is a mixed integer linear programming solver based on the
3635 revised simplex and the branch-and-bound methods.")
3636 (license license:lgpl2.1+)))
3638 (define-public dealii
3645 (uri (string-append "https://github.com/dealii/dealii/releases/"
3646 "download/v" version "/dealii-" version ".tar.gz"))
3649 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3650 (modules '((guix build utils)))
3652 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3654 (delete-file-recursively "bundled")
3656 (build-system cmake-build-system)
3664 ("arpack" ,arpack-ng)
3665 ("muparser" ,muparser)
3666 ("gfortran" ,gfortran)
3667 ("suitesparse" ,suitesparse))) ;for UMFPACK
3669 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3671 ;; Work around a bug in libsuitesparseconfig linking
3672 ;; see https://github.com/dealii/dealii/issues/4745
3673 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3674 (home-page "https://www.dealii.org")
3675 (synopsis "Finite element library")
3677 "Deal.II is a C++ program library targeted at the computational solution
3678 of partial differential equations using adaptive finite elements. The main
3679 aim of deal.II is to enable rapid development of modern finite element codes,
3680 using among other aspects adaptive meshes and a wide array of tools often used
3681 in finite element programs.")
3682 (license license:lgpl2.1+)))
3684 (define-public dealii-openmpi
3685 (package (inherit dealii)
3686 (name "dealii-openmpi")
3689 ;;Supported only with MPI:
3690 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3691 ("p4est" ,p4est-openmpi)
3692 ("petsc" ,petsc-openmpi)
3693 ("slepc" ,slepc-openmpi)
3694 ("metis" ,metis) ;for MUMPS
3695 ("scalapack" ,scalapack) ;for MUMPS
3696 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3697 ("arpack" ,arpack-ng-openmpi)
3698 ,@(fold alist-delete (package-inputs dealii)
3699 '("p4est" "arpack"))))
3701 (substitute-keyword-arguments (package-arguments dealii)
3702 ((#:configure-flags cf)
3703 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3705 ((#:phases phases '%standard-phases)
3706 `(modify-phases ,phases
3707 (add-before 'check 'mpi-setup
3708 ,%openmpi-setup)))))
3709 (synopsis "Finite element library (with MPI support)")))
3711 (define-public flann
3720 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3721 version "-src.zip"))
3724 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3725 (patches (search-patches "flann-cmake-3.11.patch"))))
3726 (build-system cmake-build-system)
3728 "octave")) ;46 MiB .mex file that pulls Octave
3730 `(("unzip" ,unzip)))
3733 ("octave" ,octave-cli)
3734 ("python" ,python-2) ; print syntax
3735 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3738 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3739 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3740 #:strip-directories '("lib" "lib64" "libexec"
3741 "bin" "sbin" "share/flann/octave")
3743 ;; Save 12 MiB by not installing .a files. Passing
3744 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3745 #:phases (modify-phases %standard-phases
3746 (add-before 'configure 'set-octave-directory
3747 (lambda* (#:key outputs #:allow-other-keys)
3748 ;; Install the .mex file in the "octave" output.
3749 (let ((out (assoc-ref outputs "octave")))
3750 (substitute* "src/matlab/CMakeLists.txt"
3751 (("share/flann/octave")
3752 (string-append out "/share/flann/octave")))
3754 (add-after 'install 'remove-static-libraries
3755 (lambda* (#:key outputs #:allow-other-keys)
3756 (let* ((out (assoc-ref outputs "out"))
3757 (lib (string-append out "/lib")))
3758 (for-each delete-file
3759 (find-files lib "\\.a$"))
3762 #:tests? #f)) ; The test data are downloaded from the Internet.
3763 (home-page "http://www.cs.ubc.ca/research/flann/")
3764 (synopsis "Library for approximate nearest neighbors computation")
3765 (description "FLANN is a library for performing fast approximate
3766 nearest neighbor searches in high dimensional spaces. It implements a
3767 collection of algorithms and a system for automatically choosing the best
3768 algorithm and optimum parameters depending on the dataset.
3770 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3771 (license (license:non-copyleft "file://COPYING"
3772 "See COPYING in the distribution."))))
3774 (define-public wcalc
3781 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3782 "wcalc-" version ".tar.bz2"))
3785 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3786 (build-system gnu-build-system)
3789 ("readline" ,readline)))
3790 (home-page "http://w-calc.sourceforge.net/index.php")
3791 (synopsis "Flexible command-line scientific calculator")
3792 (description "Wcalc is a very capable calculator. It has standard functions
3793 (sin, asin, and sinh for example, in either radians or degrees), many
3794 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3795 variables, a command history, hex/octal/binary input and output, unit
3796 conversions, embedded comments, and an expandable expression entry field. It
3797 evaluates expressions using the standard order of operations.")
3798 (license license:gpl2+)))
3806 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3807 "/xaos-" version ".tar.gz"))
3810 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3811 (build-system gnu-build-system)
3812 (native-inputs `(("gettext" ,gettext-minimal)))
3813 (inputs `(("libx11" ,libx11)
3818 `(#:tests? #f ;no "check" target
3819 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3820 (synopsis "Real-time fractal zoomer")
3821 (description "GNU XaoS is a graphical program that generates fractal
3822 patterns and allows you to zoom in and out of them infinitely in a fluid,
3823 continuous manner. It also includes tutorials that help to explain how fractals
3824 are built. It can generate many different fractal types such as the Mandelbrot
3826 (home-page "https://www.gnu.org/software/xaos/")
3827 (license license:gpl2+)))
3829 (define-public hypre
3837 (url "https://github.com/LLNL/hypre.git")
3838 (commit (string-append "v" version))))
3839 (file-name (git-file-name name version))
3841 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3842 (modules '((guix build utils)))
3845 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3846 ;; substitute the release date.
3847 (substitute* "src/utilities/HYPRE_utilities.h"
3848 (("Date Compiled: .*$")
3849 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3851 (build-system gnu-build-system)
3852 (outputs '("out" ; 6.1 MiB of headers and libraries
3853 "doc")) ; 4.8 MiB of documentation
3857 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3858 ("texlive" ,(texlive-union (list texlive-xypic
3860 texlive-latex-hyperref
3862 ("ghostscript" ,ghostscript)))
3864 `(("blas" ,openblas)
3865 ("lapack" ,lapack)))
3867 `(#:modules ((srfi srfi-1)
3868 ,@%gnu-build-system-modules)
3869 #:configure-flags '("--enable-shared"
3877 (modify-phases %standard-phases
3878 (add-before 'build 'set-HOME
3880 ;; FIXME: texlive-union does not find the built
3881 ;; metafonts, so it tries to generate them in HOME.
3882 (setenv "HOME" "/tmp")
3884 (add-before 'configure 'chdir-src
3885 (lambda _ (chdir "src")))
3887 (lambda* (#:key build target configure-flags
3888 #:allow-other-keys #:rest args)
3889 (let* ((configure (assoc-ref %standard-phases 'configure)))
3892 (list #:configure-flags
3893 (cons (string-append
3894 "--host=" (or target build))
3895 configure-flags)))))))
3896 (add-after 'build 'build-docs
3898 (invoke "make" "-Cdocs" "pdf" "html")))
3901 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3902 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3903 (invoke "make" "check" "CHECKRUN=")
3904 (for-each (lambda (filename)
3905 (let ((size (stat:size (stat filename))))
3906 (when (positive? size)
3907 (error (format #f "~a size ~d; error indication~%"
3909 (find-files "test" ".*\\.err$"))
3911 (add-after 'install 'install-docs
3912 (lambda* (#:key outputs #:allow-other-keys)
3913 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3914 (let* ((doc (assoc-ref outputs "doc"))
3915 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3916 (with-directory-excursion "docs"
3917 (for-each (lambda (base)
3918 (install-file (string-append base ".pdf") docdir)
3919 (copy-recursively base docdir)) ; html docs
3920 '("HYPRE_usr_manual"
3921 "HYPRE_ref_manual")))
3923 (home-page "http://www.llnl.gov/casc/hypre/")
3924 (synopsis "Library of solvers and preconditioners for linear equations")
3926 "HYPRE is a software library of high performance preconditioners and
3927 solvers for the solution of large, sparse linear systems of equations. It
3928 features multigrid solvers for both structured and unstructured grid
3930 (license license:lgpl2.1)))
3932 (define-public hypre-openmpi
3933 (package (inherit hypre)
3934 (name "hypre-openmpi")
3937 ,@(package-inputs hypre)))
3939 (substitute-keyword-arguments (package-arguments hypre)
3940 ((#:configure-flags flags)
3942 ,@(delete "--without-MPI" ,flags)))
3944 `(modify-phases ,phases
3945 (add-before 'check 'mpi-setup
3946 ,%openmpi-setup)))))
3947 (synopsis "Parallel solvers and preconditioners for linear equations")
3949 "HYPRE is a software library of high performance preconditioners and
3950 solvers for the solution of large, sparse linear systems of equations on
3951 parallel computers. It features parallel multigrid solvers for both
3952 structured and unstructured grid problems.")))
3954 (define-public matio
3961 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3962 "matio-" version ".tar.gz"))
3965 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3966 (build-system gnu-build-system)
3970 (home-page "http://matio.sourceforge.net/")
3971 (synopsis "Library for reading and writing MAT files")
3972 (description "Matio is a library for reading and writing MAT files. It
3973 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3974 (license license:bsd-2)))
3981 (origin (method url-fetch)
3982 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3983 "download/" version "/Vc-" version ".tar.gz"))
3986 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
3987 (build-system cmake-build-system)
3990 '("-DBUILD_TESTING=ON"
3991 ;; By default, Vc will optimize for the CPU of the build machine.
3992 ;; Setting this to "none" makes it create portable binaries. See
3993 ;; "cmake/OptimizeForArchitecture.cmake".
3994 "-DTARGET_ARCHITECTURE=none")
3995 #:phases (modify-phases %standard-phases
3996 (add-after 'unpack 'copy-testdata
3997 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3998 (let ((testdata (assoc-ref (or native-inputs inputs)
4000 (copy-recursively testdata "tests/testdata")
4003 `(("virtest" ,virtest)
4005 ;; This is a submodule in the git project, but not part of the
4006 ;; released sources. See the git branch for the commit to take.
4007 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4011 (url "https://github.com/VcDevel/vc-testdata")
4012 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4013 (file-name (git-file-name "vc-testdata"
4014 (string-take commit 7)))
4017 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4018 (synopsis "SIMD vector classes for C++")
4019 (description "Vc provides portable, zero-overhead C++ types for explicitly
4020 data-parallel programming. It is a library designed to ease explicit
4021 vectorization of C++ code. Its types enable explicitly stating data-parallel
4022 operations on multiple values. The parallelism is therefore added via the type
4023 system. Vc has an intuitive API and provides portability between different
4024 compilers and compiler versions as well as portability between different vector
4025 instruction sets. Thus, an application written with Vc can be compiled for:
4028 @item SSE2 up to SSE4.2 or SSE4a
4031 @item NEON (in development)
4032 @item NVIDIA GPUs / CUDA (in development)
4034 (home-page "https://github.com/VcDevel/Vc")
4035 ;; "No support_???.cpp file exists for this architecture."
4036 (supported-systems '("x86_64-linux" "i686-linux"))
4037 (license license:bsd-3)))
4039 (define-public reducelcs
4040 ;; This is the last commit which is available upstream, no
4041 ;; release happened since 2010.
4042 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4046 (version (string-append "1.0-" revision "." (string-take commit 7)))
4051 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4053 (file-name (string-append name "-" version "-checkout"))
4056 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4057 (build-system gnu-build-system)
4059 `(("openlibm" ,openlibm)))
4061 `(#:tests? #f ; no tests
4063 (modify-phases %standard-phases
4064 (delete 'configure) ; No configure script exists.
4065 (replace 'install ; No install phase exists.
4066 (lambda* (#:key outputs #:allow-other-keys)
4067 (let* ((out (assoc-ref outputs "out"))
4068 (bin (string-append out "/bin")))
4069 (install-file "Approximation" bin)
4070 (install-file "CollectResults" bin)
4071 (install-file "GenerateInstances" bin)
4073 (synopsis "Approximate Longest Commons Subsequence computation tool")
4075 "@code{reduceLCS} is an implementation of the Reduce-Expand
4076 algorithm for LCS. It is a fast program to compute the approximate
4077 Longest Commons Subsequence of a set of strings.")
4078 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4079 (license license:gpl3+))))
4081 (define-public jacal
4088 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4091 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4092 (patches (search-patches "jacal-fix-texinfo.patch"))))
4093 (build-system gnu-build-system)
4096 (modify-phases %standard-phases
4097 (add-before 'build 'pre-build
4098 ;; Don't use upstream's script - it really doesn't fit into
4099 ;; Guix's functional paradigm.
4100 (lambda* (#:key inputs outputs #:allow-other-keys)
4101 (substitute* "Makefile"
4102 (("^install: install-script") "install: "))))
4103 (add-after 'install 'post-install
4104 ;; Instead, we provide our own simplified script.
4105 (lambda* (#:key inputs outputs #:allow-other-keys)
4106 (let ((wrapper (string-append (assoc-ref outputs "out")
4108 (format (open wrapper (logior O_WRONLY O_CREAT))
4109 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4110 "-e '(slib:load \"~a/lib/jacal/math\") "
4113 (assoc-ref inputs "scm")
4114 (assoc-ref outputs "out"))
4115 (chmod wrapper #o555))))
4117 (lambda* (#:key outputs #:allow-other-keys)
4118 (invoke "./configure"
4119 (string-append "--prefix="
4120 (assoc-ref outputs "out"))))))))
4121 (inputs `(("scm" ,scm)))
4122 (native-inputs `(("unzip" ,unzip)
4123 ("texinfo" ,texinfo)))
4124 (synopsis "Symbolic mathematics system")
4125 (description "GNU JACAL is an interactive symbolic mathematics program based on
4126 Scheme. It manipulate and simplify a range of mathematical expressions such
4127 as equations, scalars, vectors, and matrices.")
4128 (home-page "https://www.gnu.org/software/jacal/")
4129 (license license:gpl3+)))
4135 (home-page "https://github.com/Z3Prover/z3")
4138 (uri (git-reference (url home-page)
4139 (commit (string-append "z3-" version))))
4140 (file-name (git-file-name name version))
4143 "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q"))))
4144 (build-system gnu-build-system)
4147 (modify-phases %standard-phases
4148 (add-after 'unpack 'fix-compatability
4149 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4151 (substitute* "src/util/mpz.cpp"
4152 (("#include <immintrin.h>") ""))
4154 (add-before 'configure 'bootstrap
4156 (invoke "python" "scripts/mk_make.py")))
4157 ;; work around gnu-build-system's setting --enable-fast-install
4158 ;; (z3's `configure' is a wrapper around the above python file,
4159 ;; which fails when passed --enable-fast-install)
4161 (lambda* (#:key inputs outputs #:allow-other-keys)
4162 (invoke "./configure"
4163 (string-append "--prefix=" (assoc-ref outputs "out")))))
4164 (add-after 'configure 'change-directory
4168 (add-before 'check 'make-test-z3
4170 ;; Build the test suite executable.
4171 (invoke "make" "test-z3" "-j"
4172 (number->string (parallel-job-count)))))
4175 ;; Run all the tests that don't require arguments.
4176 (invoke "./test-z3" "/a"))))))
4179 ("python" ,python-wrapper)))
4180 (synopsis "Theorem prover")
4181 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4182 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4183 (license license:expat)))
4188 (version "2018.11.001")
4191 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4192 version "/elpa-" version ".tar.gz"))
4195 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4196 (build-system gnu-build-system)
4198 `(("fortran" ,gfortran)
4199 ("perl" ,perl))) ;for configure and deps
4201 `(("blas" ,openblas)))
4206 ;; ELPA unfortunately does not support runtime dispatch, so we can
4207 ;; only enable the "generic" kernels. See the "Cross compilation"
4208 ;; section of INSTALL.md.
4210 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4211 "--disable-avx" "--disable-avx2" "--disable-avx512"
4212 ,(string-append "CFLAGS=-O3 "
4213 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4214 "-ftree-vect-loop-version -ftree-vectorize "
4215 ,(let ((system (or (%current-target-system)
4216 (%current-system))))
4218 ((or (string-prefix? "x86_64" system)
4219 (string-prefix? "i686" system))
4222 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4224 (modify-phases %standard-phases
4225 (add-before 'configure 'patch-header-generation
4227 (substitute* "configure"
4228 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4229 (string-append & " CPP=\"$CPP\"")))
4231 (add-before 'check 'setup-tests
4233 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4234 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4235 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4236 ;; for Fortran. This also causes several tests to pass that
4237 ;; otherwise would otherwise fail with matrix size 5000; possibly
4238 ;; due to floating point tolerances that are too tight.
4239 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4240 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4241 (substitute* "Makefile"
4242 ;; Test scripts are generated, patch the shebang
4243 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4245 (home-page "http://elpa.mpcdf.mpg.de")
4246 (synopsis "Eigenvalue solvers for symmetric matrices")
4248 "The ELPA library provides efficient and scalable direct eigensolvers for
4249 symmetric matrices.")
4250 (license license:lgpl3)))
4252 (define-public elpa-openmpi
4253 (package (inherit elpa)
4254 (name "elpa-openmpi")
4257 ("scalapack" ,scalapack)
4258 ,@(package-inputs elpa)))
4260 (substitute-keyword-arguments (package-arguments elpa)
4261 ((#:configure-flags cf '())
4262 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4263 ((#:phases phases '%standard-phases)
4264 `(modify-phases ,phases
4265 (add-before 'check 'mpi-setup
4267 ;; Tests use 2 mpi tasks by default, use our remaining build
4268 ;; cores as OpenMP threads.
4269 (setenv "OMP_NUM_THREADS" (number->string
4270 (max (quotient (parallel-job-count) 2)
4272 (,%openmpi-setup)))))))
4273 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4275 (define-public elemental
4282 (url "https://github.com/elemental/Elemental.git")
4283 (commit (string-append "v" version))))
4284 (file-name (git-file-name name version))
4287 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4288 (build-system cmake-build-system)
4289 (home-page "http://libelemental.org")
4291 `(("gfortran" ,gfortran)))
4293 `(("blas" ,openblas)
4294 ("gfortran:lib" ,gfortran "lib")
4303 `(#:build-type "Release" ;default RelWithDebInfo not supported
4304 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4305 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4306 "-DEL_CACHE_WARNINGS:BOOL=YES"
4307 "-DEL_TESTS:BOOL=YES"
4308 "-DCMAKE_INSTALL_LIBDIR=lib"
4309 "-DGFORTRAN_LIB=gfortran")
4310 #:phases (modify-phases %standard-phases
4311 (add-before 'check 'mpi-setup
4313 (add-before 'check 'setup-tests
4315 ;; Parallelism is done at the MPI layer.
4316 (setenv "OMP_NUM_THREADS" "1")
4318 (add-after 'install 'remove-tests
4319 (lambda* (#:key outputs #:allow-other-keys)
4320 ;; Tests are installed, with no easy configuration
4321 ;; switch to prevent this, so delete them.
4322 (delete-file-recursively
4323 (string-append (assoc-ref outputs "out") "/bin"))
4325 (synopsis "Dense and sparse-direct linear algebra and optimization")
4326 (description "Elemental is a modern C++ library for distributed-memory
4327 dense and sparse-direct linear algebra, conic optimization, and lattice
4329 (license license:bsd-2)))
4331 (define-public mcrl2
4334 (version "201908.0")
4338 "https://www.mcrl2.org/download/release/mcrl2-"
4342 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4347 ("qtbase" ,qtbase)))
4348 (build-system cmake-build-system)
4349 (synopsis "Toolset for the mCRL2 formal specification language")
4351 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4352 specification language for describing concurrent discrete event systems. Its
4353 toolset supports analysis and automatic verification, linearisation, simulation,
4354 state-space exploration and generation, and tools to optimise and analyse
4355 specifications. Also, state spaces can be manipulated, visualised and
4357 (home-page "https://mcrl2.org")
4358 (license license:boost1.0)))
4360 (define-public mcrl2-minimal
4363 (name "mcrl2-minimal")
4365 `(("boost" ,boost)))
4367 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4369 (define-public tcalc
4376 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4380 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4381 (build-system gnu-build-system)
4382 (synopsis "The terminal calculator")
4384 "The terminal calculator is a small program to help users of the GNU/Linux
4385 terminal do calculations simply and quickly. The formula to be calculated can
4386 be fed to @command{tcalc} through the command line.")
4387 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4388 (license license:gpl3+)))
4390 (define-public sundials
4397 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4398 "sundials-" version ".tar.gz"))
4401 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4402 (build-system cmake-build-system)
4404 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4406 `(("fortran" ,gfortran) ;for fcmix
4408 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4410 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4411 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4412 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4413 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4414 "-DEXAMPLES_INSTALL:BOOL=OFF"
4416 "-DFCMIX_ENABLE:BOOL=ON"
4418 "-DKLU_ENABLE:BOOL=ON"
4419 ,(string-append "-DKLU_INCLUDE_DIR="
4420 (assoc-ref %build-inputs "suitesparse")
4422 ,(string-append "-DKLU_LIBRARY_DIR="
4423 (assoc-ref %build-inputs "suitesparse")
4425 (home-page "https://computation.llnl.gov/projects/sundials")
4426 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4427 (description "SUNDIALS is a family of software packages implemented with
4428 the goal of providing robust time integrators and nonlinear solvers that can
4429 easily be incorporated into existing simulation codes.")
4430 (license license:bsd-3)))
4432 (define-public sundials-openmpi
4433 (package (inherit sundials)
4434 (name "sundials-openmpi")
4437 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4438 ,@(package-inputs sundials)))
4440 (substitute-keyword-arguments (package-arguments sundials)
4441 ((#:configure-flags flags '())
4442 `(cons* "-DMPI_ENABLE:BOOL=ON"
4443 "-DPETSC_ENABLE:BOOL=ON"
4444 (string-append "-DPETSC_INCLUDE_DIR="
4445 (assoc-ref %build-inputs "petsc")
4447 (string-append "-DPETSC_LIBRARY_DIR="
4448 (assoc-ref %build-inputs "petsc")
4451 ((#:phases phases '%standard-phases)
4452 `(modify-phases ,phases
4453 (add-before 'check 'mpi-setup
4454 ,%openmpi-setup)))))
4455 (synopsis "SUNDIALS with OpenMPI support")))
4457 (define-public combinatorial-blas
4459 (name "combinatorial-blas")
4464 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4466 (match (string-split version #\.)
4467 ((major minor patch)
4468 (string-append major minor "_" patch))) ;e.g. "16_2"
4472 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4473 (patches (search-patches "combinatorial-blas-awpm.patch"
4474 "combinatorial-blas-io-fix.patch"))))
4475 (build-system cmake-build-system)
4478 ("test-data" ,(origin
4480 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4481 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4484 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4486 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4487 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4488 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4490 (modify-phases %standard-phases
4491 (add-before 'check 'mpi-setup
4493 (add-before 'check 'test-setup
4494 (lambda* (#:key inputs #:allow-other-keys)
4495 (setenv "OMP_NUM_THREADS" "2")
4496 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4497 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4498 (synopsis "Linear algebra primitives for graph analytics")
4499 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4500 distributed-memory parallel graph library offering a small but powerful set of
4501 linear algebra primitives specifically targeting graph analytics.")
4503 license:gpl2+ ;include/psort/(funnel|sort)*.h
4504 license:x11 ;usort and psort
4505 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4507 (define-public dune-common
4509 (name "dune-common")
4514 (uri (string-append "https://dune-project.org/download/"
4515 version "/dune-common-" version ".tar.gz"))
4518 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4519 (build-system cmake-build-system)
4522 (modify-phases %standard-phases
4523 (add-after 'build 'build-tests
4524 (lambda* (#:key make-flags #:allow-other-keys)
4525 (apply invoke "make" "build_tests" make-flags)))
4526 ;; These tests fail because they require a fully functional MPI
4528 (add-after 'unpack 'disable-failing-tests
4531 (string-append "--exclude-regex '("
4535 "remoteindicestest-mpi-2"
4538 "variablesizecommunicatortest"
4539 "variablesizecommunicatortest-mpi-2"
4540 "arithmetictestsuitetest"
4541 "assertandreturntest"
4542 "assertandreturntest_ndebug"
4545 "mpicollectivecommunication"
4546 "mpicollectivecommunication-mpi-2"
4548 "mpiguardtest-mpi-2"
4550 "mpihelpertest-mpi-2"
4552 "mpihelpertest2-mpi-2")
4559 ("openmpi" ,openmpi)
4560 ("openblas" ,openblas)
4562 ("superlu" ,superlu)))
4564 `(("gfortran" ,gfortran)
4565 ("pkg-config" ,pkg-config)))
4566 (home-page "https://dune-project.org/")
4567 (synopsis "Distributed and Unified Numerics Environment")
4568 (description "DUNE, the Distributed and Unified Numerics Environment is a
4569 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4570 grid-based methods. It supports the easy implementation of methods like
4571 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4572 Differences} (FD).")
4573 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4574 (license license:gpl2)))
4576 (define-public dune-geometry
4578 (name "dune-geometry")
4583 (uri (string-append "https://dune-project.org/download/"
4584 version "/dune-geometry-" version ".tar.gz"))
4587 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4588 (build-system cmake-build-system)
4591 (modify-phases %standard-phases
4592 (add-after 'build 'build-tests
4593 (lambda* (#:key make-flags #:allow-other-keys)
4594 (apply invoke "make" "build_tests" make-flags))))))
4596 `(("dune-common" ,dune-common)
4597 ("openmpi" ,openmpi)
4599 ("openblas" ,openblas)
4601 ("python" ,python)))
4603 `(("gfortran" ,gfortran)
4604 ("pkg-config" ,pkg-config)))
4605 (home-page "https://dune-project.org/")
4606 (synopsis "Distributed and Unified Numerics Environment")
4607 (description "DUNE, the Distributed and Unified Numerics Environment is a
4608 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4609 grid-based methods. It supports the easy implementation of methods like
4610 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4613 This package contains the basic DUNE geometry classes.")
4614 ;; GPL version 2 with "runtime exception"
4615 (license license:gpl2)))
4617 (define-public dune-grid
4624 (uri (string-append "https://dune-project.org/download/"
4625 version "/dune-grid-" version ".tar.gz"))
4628 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4629 (build-system cmake-build-system)
4632 (modify-phases %standard-phases
4633 (add-after 'build 'build-tests
4634 (lambda* (#:key make-flags #:allow-other-keys)
4635 (apply invoke "make" "build_tests" make-flags)))
4636 ;; These tests fail because they require a fully functional MPI
4638 (add-after 'unpack 'disable-failing-tests
4641 (string-append "--exclude-regex '("
4645 "conformvolumevtktest"
4647 "nonconformboundaryvtktest"
4648 "subsamplingvtktest"
4654 "test-dgf-yasp-offset"
4656 "test-geogrid-yaspgrid"
4659 "testiteratorranges"
4660 "test-hierarchicsearch"
4661 "test-parallel-ug-mpi-2"
4662 "test-yaspgrid-backuprestore-equidistant"
4663 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4664 "test-yaspgrid-backuprestore-equidistantoffset"
4665 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4666 "test-yaspgrid-backuprestore-tensor"
4667 "test-yaspgrid-backuprestore-tensor-mpi-2"
4668 "test-yaspgrid-tensorgridfactory"
4669 "test-yaspgrid-tensorgridfactory-mpi-2"
4670 "test-yaspgrid-yaspfactory-1d"
4671 "test-yaspgrid-yaspfactory-1d-mpi-2"
4672 "test-yaspgrid-yaspfactory-2d"
4673 "test-yaspgrid-yaspfactory-2d-mpi-2"
4674 "test-yaspgrid-yaspfactory-3d"
4675 "test-yaspgrid-yaspfactory-3d-mpi-2"
4676 "globalindexsettest"
4677 "persistentcontainertest"
4678 "structuredgridfactorytest"
4679 "tensorgridfactorytest"
4685 `(("dune-common" ,dune-common)
4686 ("dune-geometry" ,dune-geometry)
4689 ("openblas" ,openblas)
4690 ("openmpi" ,openmpi)
4691 ("python" ,python)))
4693 `(("gfortran" ,gfortran)
4694 ("pkg-config" ,pkg-config)))
4695 (home-page "https://dune-project.org/")
4696 (synopsis "Distributed and Unified Numerics Environment")
4697 (description "DUNE, the Distributed and Unified Numerics Environment is a
4698 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4699 grid-based methods. It supports the easy implementation of methods like
4700 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4703 This package contains the basic DUNE grid classes.")
4704 ;; GPL version 2 with "runtime exception"
4705 (license license:gpl2)))
4707 (define-public dune-istl
4714 (uri (string-append "https://dune-project.org/download/"
4715 version "/dune-istl-" version ".tar.gz"))
4718 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4719 (build-system cmake-build-system)
4722 (modify-phases %standard-phases
4723 (add-after 'build 'build-tests
4724 (lambda* (#:key make-flags #:allow-other-keys)
4725 (apply invoke "make" "build_tests" make-flags)))
4726 ;; These tests fail because they require a fully functional MPI
4728 (add-after 'unpack 'disable-failing-tests
4731 (string-append "--exclude-regex '("
4737 "pamg_comm_repart_test"
4745 `(("dune-common" ,dune-common)
4746 ("openmpi" ,openmpi)
4749 ("superlu" ,superlu)
4750 ("openblas" ,openblas)
4752 ("python" ,python)))
4754 `(("gfortran" ,gfortran)
4755 ("pkg-config" ,pkg-config)))
4756 (home-page "https://dune-project.org/")
4757 (synopsis "Distributed and Unified Numerics Environment")
4758 (description "DUNE, the Distributed and Unified Numerics Environment is a
4759 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4762 This is the iterative solver template library which provides generic sparse
4763 matrix/vector classes and a variety of solvers based on these classes. A
4764 special feature is the use of templates to exploit the recursive block
4765 structure of finite element matrices at compile time. Available solvers
4766 include Krylov methods, (block-) incomplete decompositions and
4767 aggregation-based algebraic multigrid.")
4768 ;; GPL version 2 with "runtime exception"
4769 (license license:gpl2)))
4771 (define-public dune-localfunctions
4773 (name "dune-localfunctions")
4778 (uri (string-append "https://dune-project.org/download/"
4779 version "/dune-localfunctions-" version ".tar.gz"))
4782 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4783 (build-system cmake-build-system)
4786 (modify-phases %standard-phases
4787 (add-after 'build 'build-tests
4788 (lambda* (#:key make-flags #:allow-other-keys)
4789 (apply invoke "make" "build_tests" make-flags))))))
4791 `(("dune-common" ,dune-common)
4792 ("dune-geometry" ,dune-geometry)
4793 ("openmpi" ,openmpi)
4796 ("superlu" ,superlu)
4799 `(("gfortran" ,gfortran)
4800 ("pkg-config" ,pkg-config)))
4801 (home-page "https://dune-project.org/")
4802 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4803 (description "This DUNE module provides interface and implementation for
4804 shape functions defined on the DUNE reference elements. In addition to the
4805 shape function, interpolation operators and special keys are provided which
4806 can be used to assemble global function spaces on finite-element grids.
4808 This package provides an interface and implementation for shape functions
4809 defined on the DUNE reference elements. In addition to the shape function,
4810 interpolation operators and special keys are provided which can be used to
4811 assemble global function spaces on finite-element grids.")
4812 ;; GPL version 2 with "runtime exception"
4813 (license license:gpl2)))
4815 (define-public dune-alugrid
4817 (name "dune-alugrid")
4822 (uri (string-append "https://dune-project.org/download/"
4823 version "/dune-alugrid-" version ".tar.gz"))
4826 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4827 (build-system cmake-build-system)
4829 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4832 (modify-phases %standard-phases
4833 (add-after 'unpack 'patch-include
4835 (substitute* "dune/alugrid/test/test-alugrid.cc"
4836 (("doc/grids/gridfactory/testgrids")
4837 "doc/dune-grid/grids/gridfactory/testgrids"))
4839 (add-after 'build 'build-tests
4840 (lambda* (#:key inputs make-flags #:allow-other-keys)
4841 (setenv "CPLUS_INCLUDE_PATH"
4842 (string-append (assoc-ref inputs "dune-grid") "/share"))
4843 (apply invoke "make" "build_tests" make-flags))))))
4845 `(("dune-common" ,dune-common)
4846 ("dune-geometry" ,dune-geometry)
4847 ("dune-grid" ,dune-grid)
4848 ("openmpi" ,openmpi)
4851 ("openblas" ,openblas)
4853 ("superlu" ,superlu)
4857 `(("gfortran" ,gfortran)
4858 ("pkg-config" ,pkg-config)))
4859 (home-page "https://dune-project.org/")
4860 (synopsis "Distributed and Unified Numerics Environment")
4861 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4862 implementation of the DUNE grid interface supporting either simplices or
4864 (license license:gpl2+)))
4866 (define-public dune-typetree
4868 (name "dune-typetree")
4874 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4875 (commit (string-append "v" version))))
4876 (file-name (git-file-name name version))
4879 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4880 (build-system cmake-build-system)
4883 (modify-phases %standard-phases
4884 (add-after 'build 'build-tests
4885 (lambda* (#:key make-flags #:allow-other-keys)
4886 (apply invoke "make" "build_tests" make-flags))))))
4888 `(("dune-common" ,dune-common)
4889 ("openmpi" ,openmpi)
4891 ("openblas" ,openblas)
4894 ("superlu" ,superlu)
4897 `(("gfortran" ,gfortran)
4898 ("pkg-config" ,pkg-config)))
4899 (home-page "https://dune-project.org/")
4900 (synopsis "Distributed and Unified Numerics Environment")
4901 (description "TypeTree is a template library for constructing and
4902 operating on statically typed trees of objects.")
4903 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4904 (license (list license:lgpl3+ license:gpl2))))
4906 (define-public dune-functions
4908 (name "dune-functions")
4914 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4915 (commit (string-append "v" version))))
4916 (file-name (git-file-name name version))
4919 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4920 (build-system cmake-build-system)
4921 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4923 `(("dune-common" ,dune-common)
4924 ("dune-istl" ,dune-istl)
4925 ("dune-localfunctions" ,dune-localfunctions)
4926 ("dune-grid" ,dune-grid)
4927 ("dune-geometry" ,dune-geometry)
4928 ("dune-typetree" ,dune-typetree)
4929 ("openmpi" ,openmpi)
4930 ("openblas" ,openblas)
4933 ("superlu" ,superlu)
4936 `(("gfortran" ,gfortran)
4937 ("pkg-config" ,pkg-config)))
4938 (home-page "https://dune-project.org/")
4939 (synopsis "Distributed and Unified Numerics Environment")
4940 (description "The dune-functions module provides an abstraction layer for
4941 global finite element functions. Its two main concepts are functions
4942 implemented as callable objects, and bases of finite element spaces.")
4943 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4944 (license (list license:lgpl3+ license:gpl2))))
4946 (define-public dune-pdelab
4948 (name "dune-pdelab")
4949 (version "2.6.0-rc1")
4954 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4955 (commit (string-append "v" version))))
4956 (file-name (git-file-name name version))
4959 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4960 (build-system cmake-build-system)
4961 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4963 `(("dune-common" ,dune-common)
4964 ("dune-istl" ,dune-istl)
4965 ("dune-localfunctions" ,dune-localfunctions)
4966 ("dune-geometry" ,dune-geometry)
4967 ("dune-grid" ,dune-grid)
4968 ("dune-typetree" ,dune-typetree)
4969 ("dune-functions" ,dune-functions)
4970 ("openmpi" ,openmpi)
4972 ("openblas" ,openblas)
4976 ("superlu" ,superlu)
4979 `(("gfortran" ,gfortran)
4980 ("pkg-config" ,pkg-config)))
4981 (home-page "https://dune-project.org/")
4982 (synopsis "Differential equations solver toolbox")
4983 (description "PDELab is a partial differential equations solver toolbox
4984 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4985 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4986 (license (list license:lgpl3+ license:gpl2))))
4988 (define-public mlucas
4996 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4998 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
4999 (build-system gnu-build-system)
5001 `(("python2" ,python-2)))
5003 `(#:tests? #f ; no tests
5005 (modify-phases %standard-phases
5009 (call-with-output-file "Makefile"
5011 (format port "CC = gcc
5012 CFLAGS = -O3 ~a -DUSE_THREADS
5013 LDLIBS = -lm -lpthread -lrt
5014 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5016 ,(let ((system (or (%current-target-system)
5017 (%current-system))))
5019 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5023 (lambda* (#:key outputs #:allow-other-keys)
5024 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5025 (install-file "Mlucas" bin)
5026 (install-file "primenet.py" bin))
5028 (home-page "https://www.mersenne.org")
5029 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5030 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5031 numbers in search of a world-record prime. You may use it to test any
5032 suitable number as you wish, but it is preferable that you do so in a
5033 coordinated fashion, as part of the Great Internet Mersenne Prime
5034 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5035 management via the GIMPS project's Primenet server.")
5036 (license license:gpl2+)))
5038 (define-public nauty
5045 "https://pallini.di.uniroma1.it/"
5046 "nauty" (string-join (string-split version #\.) "")
5050 "1p4mxf8q5wm47nxyskxbqwa5p1vvkycv1zgswvnk9nsn6vff0al6"))))
5051 (build-system gnu-build-system)
5052 (outputs '("out" "lib"))
5054 `(#:test-target "checks"
5056 (modify-phases %standard-phases
5057 ;; Default make target does not build all available
5058 ;; executables. Create them now.
5059 (add-after 'build 'build-extra-programs
5061 (for-each (lambda (target) (invoke "make" target))
5062 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5064 ;; Upstream does not provide any install target.
5066 (lambda* (#:key outputs #:allow-other-keys)
5067 (let* ((out (assoc-ref outputs "out"))
5068 (lib-output (assoc-ref outputs "lib"))
5069 (bin (string-append out "/bin"))
5070 (doc (string-append out "/share/doc/nauty/"))
5071 (include (string-append lib-output "/include/nauty"))
5072 (lib (string-append lib-output "/lib/nauty")))
5073 (for-each (lambda (f) (install-file f bin))
5074 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5075 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5076 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5077 "delptg" "directg" "dretodot" "dretog" "genbg"
5078 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5079 "gentourng" "gentreeg" "hamheuristic" "labelg"
5080 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5081 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5082 "sumlines" "twohamg" "vcolg" "watercluster2"))
5083 (for-each (lambda (f) (install-file f include))
5084 (find-files "." "\\.h$"))
5085 (for-each (lambda (f) (install-file f lib))
5086 (find-files "." "\\.a$"))
5087 (for-each (lambda (f) (install-file f doc))
5088 (append '("formats.txt" "README" "schreier.txt")
5089 (find-files "." "\\.pdf$")))))))))
5091 `(("gmp" ,gmp))) ;for sumlines
5092 (home-page "https://pallini.di.uniroma1.it/")
5093 (synopsis "Library for graph automorphisms")
5094 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5095 procedures for computing automorphism groups of graphs and digraphs.
5097 @code{nauty} computes graph information in the form of a set of
5098 generators, the size of the group, and the orbits of the group; it can
5099 also produce a canonical label. The @code{nauty} suite is written in
5100 C and comes with a command-line interface, a collection of
5101 command-line tools, and an Application Programming Interface (API).
5103 This package provides the static libraries required to run programs
5104 compiled against the nauty library.")
5105 (license license:asl2.0)))
5114 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5115 "ftp/releases/" version
5116 "/ppl-" version ".tar.gz"))
5119 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5120 (build-system gnu-build-system)
5126 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5128 "Parma Polyhedra Library for computations with polyhedra")
5130 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5131 especially targeted at applications in the field of analysis and
5132 verification of complex systems. These abstractions include convex
5133 polyhedra, defined as the intersection of a finite number of (open or
5134 closed) halfspaces, each described by a linear inequality (strict or
5135 non-strict) with rational coefficients; some special classes of polyhedra
5136 shapes that offer interesting complexity/precision tradeoffs; and grids
5137 which represent regularly spaced points that satisfy a set of linear
5138 congruence relations. The library also supports finite powersets and
5139 products of (any kind of) polyhedra and grids, a mixed integer linear
5140 programming problem solver using an exact-arithmetic version of the simplex
5141 algorithm, a parametric integer programming solver, and primitives for
5142 termination analysis via the automatic synthesis of linear ranking
5144 (license license:gpl3+)))
5146 (define-public speedcrunch
5148 (name "speedcrunch")
5154 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5155 (commit (string-append "release-" version))))
5156 (file-name (git-file-name name version))
5159 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5160 (build-system cmake-build-system)
5161 (inputs `(("qtbase" ,qtbase)))
5162 (native-inputs `(("qttools" ,qttools)))
5165 (modify-phases %standard-phases
5166 (add-after 'unpack 'chdir-to-src
5167 (lambda _ (chdir "src") #t)))))
5168 (synopsis "High-precision scientific calculator")
5170 "SpeedCrunch is a high-precision scientific calculator. It features a
5171 syntax-highlighted scrollable display and is designed to be fully used via
5172 keyboard. Some distinctive features are auto-completion of functions and
5173 variables, a formula book, and quick insertion of constants from various
5174 fields of knowledge.")
5175 (home-page "http://speedcrunch.org/")
5176 (license license:gpl2+)))
5178 (define-public minisat
5179 ;; This is the last commit which is available upstream, no
5180 ;; release happened since 2010.
5181 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5185 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5190 (url "https://github.com/niklasso/minisat.git")
5192 (file-name (string-append name "-" version "-checkout"))
5195 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5197 (search-patches "minisat-friend-declaration.patch"
5198 "minisat-install.patch"))))
5199 (build-system gnu-build-system)
5201 '(#:make-flags (list (string-append "prefix=" %output))
5202 #:tests? #f ;no check target
5204 (modify-phases %standard-phases
5205 (delete 'configure))))
5207 `(("zlib:static" ,zlib "static")
5210 "Small, yet efficient, SAT solver")
5212 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5213 researchers and developers alike to get started on SAT.")
5215 "http://minisat.se/MiniSat.html")
5216 (license license:expat))))