1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <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>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
42 ;;; This file is part of GNU Guix.
44 ;;; GNU Guix is free software; you can redistribute it and/or modify it
45 ;;; under the terms of the GNU General Public License as published by
46 ;;; the Free Software Foundation; either version 3 of the License, or (at
47 ;;; your option) any later version.
49 ;;; GNU Guix is distributed in the hope that it will be useful, but
50 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
51 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ;;; GNU General Public License for more details.
54 ;;; You should have received a copy of the GNU General Public License
55 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
57 (define-module (gnu packages maths)
58 #:use-module (ice-9 regex)
59 #:use-module (ice-9 match)
60 #:use-module (gnu packages)
61 #:use-module ((guix licenses) #:prefix license:)
62 #:use-module (guix packages)
63 #:use-module (guix download)
64 #:use-module (guix git-download)
65 #:use-module (guix utils)
66 #:use-module ((guix build utils) #:select (alist-replace))
67 #:use-module (guix build-system cmake)
68 #:use-module (guix build-system glib-or-gtk)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system python)
71 #:use-module (guix build-system ruby)
72 #:use-module (gnu packages algebra)
73 #:use-module (gnu packages audio)
74 #:use-module (gnu packages autotools)
75 #:use-module (gnu packages base)
76 #:use-module (gnu packages bison)
77 #:use-module (gnu packages boost)
78 #:use-module (gnu packages check)
79 #:use-module (gnu packages cmake)
80 #:use-module (gnu packages compression)
81 #:use-module (gnu packages curl)
82 #:use-module (gnu packages cyrus-sasl)
83 #:use-module (gnu packages dbm)
84 #:use-module (gnu packages documentation)
85 #:use-module (gnu packages elf)
86 #:use-module (gnu packages file)
87 #:use-module (gnu packages flex)
88 #:use-module (gnu packages fltk)
89 #:use-module (gnu packages fontutils)
90 #:use-module (gnu packages gettext)
91 #:use-module (gnu packages gcc)
92 #:use-module (gnu packages gd)
93 #:use-module (gnu packages ghostscript)
94 #:use-module (gnu packages glib)
95 #:use-module (gnu packages graphviz)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages icu4c)
98 #:use-module (gnu packages image)
99 #:use-module (gnu packages java)
100 #:use-module (gnu packages less)
101 #:use-module (gnu packages lisp)
102 #:use-module (gnu packages linux)
103 #:use-module (gnu packages logging)
104 #:use-module (gnu packages lua)
105 #:use-module (gnu packages gnome)
106 #:use-module (gnu packages guile)
107 #:use-module (gnu packages xorg)
108 #:use-module (gnu packages gl)
109 #:use-module (gnu packages imagemagick)
110 #:use-module (gnu packages m4)
111 #:use-module (gnu packages mpi)
112 #:use-module (gnu packages multiprecision)
113 #:use-module (gnu packages netpbm)
114 #:use-module (gnu packages onc-rpc)
115 #:use-module (gnu packages pcre)
116 #:use-module (gnu packages popt)
117 #:use-module (gnu packages perl)
118 #:use-module (gnu packages pkg-config)
119 #:use-module (gnu packages pulseaudio)
120 #:use-module (gnu packages python)
121 #:use-module (gnu packages python-web)
122 #:use-module (gnu packages python-xyz)
123 #:use-module (gnu packages qt)
124 #:use-module (gnu packages readline)
125 #:use-module (gnu packages ruby)
126 #:use-module (gnu packages tbb)
127 #:use-module (gnu packages scheme)
128 #:use-module (gnu packages shells)
129 #:use-module (gnu packages tcl)
130 #:use-module (gnu packages texinfo)
131 #:use-module (gnu packages tex)
132 #:use-module (gnu packages tls)
133 #:use-module (gnu packages version-control)
134 #:use-module (gnu packages wxwidgets)
135 #:use-module (gnu packages xml)
136 #:use-module (srfi srfi-1))
144 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
146 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
147 (build-system gnu-build-system)
148 (inputs `(("gtk+" ,gtk+)
149 ("libxml2" ,libxml2)))
150 (native-inputs `(("pkg-config" ,pkg-config)))
151 (synopsis "Natural deduction first-order logic interface")
152 (description "Aris is a program for performing logical proofs. It supports
153 propositional and predicate logic, as well as Boolean algebra and
154 arithmetical logic. In addition to its predefined inference and equivalence
155 rules, Aris also supports references to older proofs. Its use of standard
156 logical symbols and its natural deduction interface make it easy to use for
158 (license license:gpl3+)
159 (home-page "https://www.gnu.org/software/aris/")))
161 (define-public c-graph
167 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
170 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
171 (build-system gnu-build-system)
173 `(("fortran" ,gfortran)))
174 (synopsis "Visualizing and demonstrating convolution")
176 "GNU C-Graph is a tool for demonstrating the theory of convolution.
177 Thus, it can serve as an excellent aid to students of signal and systems
178 theory in visualizing the convolution process. Rather than forcing the
179 student to write code, the program offers an intuitive interface with
180 interactive dialogs to guide them.")
181 (license license:gpl3+)
182 (home-page "https://www.gnu.org/software/c-graph/")))
191 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
192 version "/coda-" version ".tar.gz"))
194 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
195 (patches (search-patches "coda-use-system-libs.patch"))
196 (modules '((guix build utils)))
198 ;; Make sure we don't use the bundled software.
200 (for-each (lambda (d)
201 (delete-file-recursively (string-append "libcoda/" d)))
202 '("zlib" "pcre" "expat"))
205 `(("fortran" ,gfortran)
207 ("python-numpy" ,python-numpy)))
214 (build-system gnu-build-system)
216 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
217 "LIBS= -lz -lpcre -lexpat")))
218 (synopsis "A common interface to various earth observation data formats")
220 "The Common Data Access toolbox (CODA) provides a set of interfaces for
221 reading remote sensing data from earth observation data files. It consists of
222 command line applications and interfaces to the C, Fortran, Python, and Java
223 programming languages.")
224 (home-page "https://stcorp.nl/coda")
225 (license license:gpl2+)))
233 (uri (string-append "http://www.qhull.org/download/qhull-"
234 (car (string-split version #\.))
238 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
239 (build-system cmake-build-system)
240 (synopsis "Calculate convex hulls and related structures")
242 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
243 diagram, halfspace intersection about a point, furthest-site Delaunay
244 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
245 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
246 algorithm for computing the convex hull. It handles roundoff errors from
247 floating point arithmetic. It computes volumes, surface areas, and
248 approximations to the convex hull.
250 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
251 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
252 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
254 (home-page "http://qhull.org")
255 (license (license:non-copyleft "file://COPYING.txt"
256 "See COPYING in the distribution."))))
258 (define-public python-cvxopt
260 (name "python-cvxopt")
265 (url "https://github.com/cvxopt/cvxopt.git")
267 (file-name (git-file-name name version))
270 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
271 (build-system python-build-system)
274 (modify-phases %standard-phases
275 (add-after 'unpack 'find-libraries
276 (lambda* (#:key inputs #:allow-other-keys)
277 (setenv "CVXOPT_BLAS_LIB" "openblas")
278 (setenv "CVXOPT_BUILD_FFTW" "1")
279 (setenv "CVXOPT_BUILD_GLPK" "1")
280 (setenv "CVXOPT_BUILD_GSL" "1")
287 ("openblas" ,openblas)
288 ("suitesparse" ,suitesparse)))
289 (home-page "https://www.cvxopt.org")
290 (synopsis "Python library for convex optimization")
292 "CVXOPT is a package for convex optimization based on the Python
293 programming language. Its main purpose is to make the development of software
294 for convex optimization applications straightforward by building on Python’s
295 extensive standard library and on the strengths of Python as a high-level
296 programming language.")
297 (license license:gpl3+)))
299 (define-public python2-cvxopt
300 (package-with-python2 python-cvxopt))
308 (uri (string-append "mirror://gnu/units/units-" version
311 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
312 (build-system gnu-build-system)
314 `(("readline" ,readline)
315 ("python" ,python-wrapper) ;for 'units_cur' script
316 ("python-requests" ,python-requests)))
318 `(#:phases (modify-phases %standard-phases
319 (add-after 'install 'wrap-units_cur
320 (lambda* (#:key outputs #:allow-other-keys)
321 (let* ((out (assoc-ref outputs "out"))
322 (bin (string-append out "/bin")))
323 (wrap-program (string-append bin "/units_cur")
324 `("PYTHONPATH" ":" prefix
325 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
327 (synopsis "Conversion between thousands of scales")
329 "GNU Units converts numeric quantities between units of measure. It
330 can handle scale changes through adaptive usage of standard scale
331 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
332 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
333 enough to be used effectively as a scientific calculator.")
334 (license license:gpl3+)
335 (home-page "https://www.gnu.org/software/units/")))
337 (define-public double-conversion
339 (name "double-conversion")
341 (home-page "https://github.com/google/double-conversion")
344 (uri (git-reference (url home-page)
345 (commit (string-append "v" version))))
346 (file-name (git-file-name name version))
349 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
350 (build-system cmake-build-system)
352 '(#:test-target "test"
353 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
354 "-DBUILD_TESTING=ON")))
355 (synopsis "Conversion routines for IEEE doubles")
357 "The double-conversion library provides binary-decimal and decimal-binary
358 routines for IEEE doubles. The library consists of efficient conversion
359 routines that have been extracted from the V8 JavaScript engine.")
360 (license license:bsd-3)))
362 (define-public dionysus
368 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
372 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
373 (build-system gnu-build-system)
374 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
375 (synopsis "Local search for universal constants and scientific values")
377 "GNU Dionysus is a convenient system for quickly retrieving the values of
378 mathematical constants used in science and engineering. Values can be
379 searched using a simple command-line tool, choosing from three databases:
380 universal constants, atomic numbers, and constants related to
382 (license license:gpl3+)
383 (home-page "https://www.gnu.org/software/dionysus/")))
394 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
395 "dSFMT-src-" version ".tar.gz"))
398 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
399 (modules '((guix build utils)))
400 ;; Don't distribute html documentation with bundled jquery.
403 (delete-file-recursively "html") #t))
404 ;; Add patches borrowed from Julia.
410 "https://raw.githubusercontent.com/JuliaLang/julia/"
411 "v1.3.0/deps/patches/dSFMT.c.patch"))
413 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
414 (file-name "dSFMT.c.patch"))
418 "https://raw.githubusercontent.com/JuliaLang/julia/"
419 "v1.3.0/deps/patches/dSFMT.h.patch"))
421 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
422 (file-name "dSFMT.h.patch"))))))
423 (build-system gnu-build-system)
426 (modify-phases %standard-phases
427 (delete 'configure) ; no configure script
429 ;; Upstream Makefile does not build a shared library. Borrow from Julia
430 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
433 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
434 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
435 "-O3" "-finline-functions" "-fomit-frame-pointer"
436 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
437 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
438 "-o" "libdSFMT.so")))
439 (replace 'install ; no "install" target
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let* ((out (assoc-ref outputs "out"))
442 (lib (string-append out "/lib"))
443 (inc (string-append out "/include"))
444 (doc (string-append out "/share/doc/" ,name "-" ,version)))
445 (install-file "libdSFMT.so" lib)
446 (install-file "dSFMT.h" inc)
447 (install-file "LICENSE.txt" doc)
449 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
451 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
452 the expensive conversion of integer to double (floating point). dSFMT directly
453 generates double precision floating point pseudorandom numbers which have the
454 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
455 format. dSFMT is only available on the CPUs which use IEEE 754 format double
456 precision floating point numbers.")
457 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
458 (license license:bsd-3)))
466 (uri (string-append "mirror://gnu/gsl/gsl-"
470 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
471 (patches (search-patches "gsl-test-i686.patch"))))
472 (build-system gnu-build-system)
474 `(;; Currently there are numerous tests that fail on "exotic"
475 ;; architectures such as aarch64 and ppc64le.
476 ,@(if (string-prefix? "aarch64-linux"
477 (or (%current-target-system) (%current-system)))
480 (home-page "https://www.gnu.org/software/gsl/")
481 (synopsis "Numerical library for C and C++")
483 "The GNU Scientific Library is a library for numerical analysis in C
484 and C++. It includes a wide range of mathematical routines, with over 1000
485 functions in total. Subject areas covered by the library include:
486 differential equations, linear algebra, Fast Fourier Transforms and random
488 (license license:gpl3+)))
497 (uri (string-append "mirror://gnu/glpk/glpk-"
501 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
502 (build-system gnu-build-system)
506 `(#:configure-flags '("--with-gmp")))
507 (home-page "https://www.gnu.org/software/glpk/")
508 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
510 "GLPK is a C library for solving large-scale linear programming (LP),
511 mixed integer programming (MIP), and other related problems. It supports the
512 GNU MathProg modeling language, a subset of the AMPL language, and features a
513 translator for the language. In addition to the C library, a stand-alone
514 LP/MIP solver is included in the package.")
515 (license license:gpl3+)))
524 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
526 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
528 "/4ti2-" version ".tar.gz"))
530 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
531 (build-system gnu-build-system)
533 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
537 (home-page "http://www.4ti2.de/")
538 (synopsis "Mathematical tool suite for problems on linear spaces")
540 "4ti2 implements algorithms for solving algebraic, geometric and
541 combinatorial problems on linear spaces. Among others, it solves systems
542 of linear equations, computes extreme rays of polyhedral cones, solves
543 integer programming problems and computes Markov bases for statistics.")
544 (license license:gpl2+)))
546 (define-public cddlib
553 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
554 (string-delete #\. version) ".tar.gz"))
557 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
558 (build-system gnu-build-system)
561 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
562 (synopsis "Library for convex hulls and extreme rays of polyhedra")
564 "The C-library cddlib implements the Double Description Method of
565 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
566 rays of a general convex polyhedron given by a system of linear inequalities
567 in arbitrary dimension. It can also be used for the converse operation of
568 computing convex hulls.")
569 (license license:gpl2+)))
571 (define-public lrslib
578 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
580 (string-delete #\. version) ".tar.gz"))
583 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
584 (build-system gnu-build-system)
588 `(#:tests? #f ; no check phase
589 #:make-flags `("CC=gcc"
590 ,(string-append "prefix=" (assoc-ref %outputs "out"))
593 (modify-phases %standard-phases
596 (substitute* "makefile"
597 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
599 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
600 (synopsis "Convex hulls of polyhedra with exact arithmetic")
602 "The C code of lrslib implements the reverse search algorithm for
603 vertex enumeration and convex hull problems. Its input file format is
604 compatible with cddlib. All computations are done exactly in either
605 multiple precision or fixed integer arithmetic. Output is not stored
606 in memory, so even problems with very large output sizes can sometimes
608 (license license:gpl2+)))
617 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
618 "vinci/vinci-" version ".tar.gz"))
621 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
622 (build-system gnu-build-system)
624 `(("lrslib" ,lrslib)))
626 `(#:tests? #f ; no check phase
628 (modify-phases %standard-phases
630 ;; register the lrs location in the config file
631 (lambda* (#:key inputs #:allow-other-keys)
632 (let* ((lrs (assoc-ref inputs "lrslib"))
633 (lrsexec (string-append lrs "/bin/lrs")))
634 (substitute* "vinci.h"
635 (("#define LRS_EXEC \"lrs\"")
636 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
639 (lambda* (#:key outputs #:allow-other-keys)
640 (let* ((out (assoc-ref outputs "out"))
641 (bin (string-append out "/bin")))
642 (install-file "vinci" bin))
645 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
646 (synopsis "Volume computation for polytopes")
648 "Vinci implements a number of volume computation algorithms for convex
649 polytopes in arbitrary dimension. The polytopes can be given by their
650 V-representation (as the convex hull of a finite number of vertices), by
651 their H-representation (as the bounded intersection of a finite number of
652 halfspaces) or by their double description with both representations.")
653 (license license:gpl2+)))
655 (define-public arpack-ng
659 (home-page "https://github.com/opencollab/arpack-ng")
662 (uri (git-reference (url home-page) (commit version)))
663 (file-name (git-file-name name version))
666 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
667 (build-system gnu-build-system)
669 `(("autoconf" ,autoconf)
670 ("automake" ,automake)
671 ("libtool" ,libtool)))
674 ("fortran" ,gfortran)))
675 (synopsis "Fortran subroutines for solving eigenvalue problems")
677 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
678 large scale eigenvalue problems.")
679 (license (license:non-copyleft "file://COPYING"
680 "See COPYING in the distribution."))))
682 (define-public arpack-ng-3.3.0
686 (name (package-name arpack-ng))
687 (home-page (package-home-page arpack-ng))
691 (uri (string-append home-page "/archive/" version ".tar.gz"))
692 (file-name (string-append name "-" version ".tar.gz"))
695 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
697 (define-public arpack-ng-openmpi
698 (package (inherit arpack-ng)
699 (name "arpack-ng-openmpi")
702 ,@(package-inputs arpack-ng)))
704 (substitute-keyword-arguments (package-arguments arpack-ng)
705 ((#:configure-flags _ '())
707 ((#:phases phases '%standard-phases)
708 `(modify-phases ,phases
709 (add-before 'check 'mpi-setup
711 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
713 (define-public lapack
720 (uri (string-append "http://www.netlib.org/lapack/lapack-"
724 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
725 (build-system cmake-build-system)
726 (home-page "http://www.netlib.org/lapack/")
727 (inputs `(("fortran" ,gfortran)
728 ("python" ,python-wrapper)))
730 `(#:configure-flags (list
731 "-DBUILD_SHARED_LIBS:BOOL=YES"
733 ;; Build the 'LAPACKE_clatms' functions.
734 "-DLAPACKE_WITH_TMG=ON"
735 "-DBUILD_TESTING=ON")))
736 (synopsis "Library for numerical linear algebra")
738 "LAPACK is a Fortran 90 library for solving the most commonly occurring
739 problems in numerical linear algebra.")
740 (license (license:non-copyleft "file://LICENSE"
741 "See LICENSE in the distribution."))))
743 (define-public scalapack
750 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
754 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
755 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
756 (build-system cmake-build-system)
759 ("fortran" ,gfortran)
760 ("lapack" ,lapack))) ;for testing only
762 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
763 #:phases (modify-phases %standard-phases
764 (add-before 'check 'mpi-setup
766 (home-page "http://www.netlib.org/scalapack/")
767 (synopsis "Library for scalable numerical linear algebra")
769 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
770 routines on parallel distributed memory machines. ScaLAPACK solves dense and
771 banded linear systems, least squares problems, eigenvalue problems, and
772 singular value problems.")
773 (license (license:non-copyleft "file://LICENSE"
774 "See LICENSE in the distribution."))))
776 (define-public gnuplot
782 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
786 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
787 (build-system gnu-build-system)
788 (inputs `(("readline" ,readline)
794 `(("pkg-config" ,pkg-config)
795 ("texlive" ,texlive-tiny)))
796 (arguments `(#:configure-flags (list (string-append
797 "--with-texdir=" %output
798 "/texmf-local/tex/latex/gnuplot"))))
799 (home-page "http://www.gnuplot.info")
800 (synopsis "Command-line driven graphing utility")
801 (description "Gnuplot is a portable command-line driven graphing
802 utility. It was originally created to allow scientists and students to
803 visualize mathematical functions and data interactively, but has grown to
804 support many non-interactive uses such as web scripting. It is also used as a
805 plotting engine by third-party applications like Octave.")
806 ;; X11 Style with the additional restriction that derived works may only be
807 ;; distributed as patches to the original.
808 (license (license:fsf-free
809 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
819 (url "https://github.com/OkoSanto/GCTP.git")
820 (commit (string-append "v" version))))
821 (file-name (git-file-name name version))
823 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
825 `(("fortran" ,gfortran)))
826 (build-system gnu-build-system)
827 (synopsis "General Cartographic Transformation Package (GCTP)")
829 "The General Cartographic Transformation Package (GCTP) is a system of
830 software routines designed to permit the transformation of coordinate pairs
831 from one map projection to another. The GCTP is the standard computer
832 software used by the National Mapping Division for map projection
834 (home-page "https://github.com/OkoSanto/GCTP")
835 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
844 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
845 version "/src/hdf-" version ".tar.bz2"))
847 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
848 (patches (search-patches "hdf4-architectures.patch"
849 "hdf4-reproducibility.patch"
850 "hdf4-shared-fortran.patch"
851 "hdf4-tirpc.patch"))))
852 (build-system gnu-build-system)
854 `(("gfortran" ,gfortran)
860 ("libtirpc" ,libtirpc)))
862 `(#:parallel-tests? #f
863 #:configure-flags (list "--enable-shared"
864 (string-append "CPPFLAGS=-I"
865 (assoc-ref %build-inputs "libtirpc")
868 (modify-phases %standard-phases
869 ;; This is inspired by two of Debian's patches.
870 (add-before 'configure 'add-more-aarch64-support
872 (substitute* '("mfhdf/ncgen/ncgen.l"
873 "mfhdf/ncgen/ncgenyy.c"
874 "mfhdf/libsrc/netcdf.h.in")
875 (("AIX5L64") "__aarch64__"))
877 (add-before 'configure 'patchbuild
880 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
882 (("/bin/mkdir") "mkdir"))
883 (substitute* (find-files "." "^Makefile\\.in$")
884 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
885 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
886 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
887 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
888 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
890 (add-after 'configure 'patch-settings
892 ;; libhdf4.settings contains the full path of the
893 ;; compilers used, and its contents are included in
894 ;; .so-files. We truncate the hashes to avoid
895 ;; unnecessary store references to those compilers:
896 (substitute* "libhdf4.settings"
897 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
898 (string-append prefix (string-take hash 10) "...")))
901 (home-page "https://www.hdfgroup.org/products/hdf4/")
903 "Library and multi-object file format for storing and managing data")
904 (description "HDF4 is a library and multi-object file format for storing
905 and managing data between machines. HDF4 is an older hierarchical data format,
906 incompatible with HDF5.")
908 (license:non-copyleft
909 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
911 (define-public hdf4-alt
916 (substitute-keyword-arguments (package-arguments hdf4)
917 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
919 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
928 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
929 "hdf5-" (version-major+minor version)
930 "/hdf5-" version "/src/hdf5-"
932 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
934 (match (string-split version #\.)
936 (string-append major minor)))
937 "/src/hdf5-" version ".tar.bz2")))
939 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
940 (patches (search-patches "hdf5-config-date.patch"
941 "hdf5-1.8-mpi-deprecations.patch"))))
942 (build-system gnu-build-system)
946 `(("gfortran" ,gfortran)
947 ("perl" ,perl))) ;part of the test machinery needs Perl
948 (outputs '("out" ; core library
949 "fortran")) ; fortran interface
951 `(;; Some of the users, notably Flann, need the C++ interface.
952 #:configure-flags '("--enable-cxx"
954 "--enable-fortran2003"
956 ;; Build a thread-safe library. Unfortunately,
957 ;; 'configure' invites you to either turn off C++,
958 ;; Fortran, and the high-level interface (HL), or
959 ;; to pass '--enable-unsupported'. Debian
960 ;; packagers chose to pass '--enable-unsupported'
961 ;; and we follow their lead here.
962 "--enable-threadsafe"
964 "--enable-unsupported")
965 ;; Use -fPIC to allow the R bindings to link with the static libraries
966 #:make-flags (list "CFLAGS=-fPIC"
969 (modify-phases %standard-phases
970 (add-before 'configure 'patch-configure
971 (lambda* (#:key outputs #:allow-other-keys)
972 (substitute* "configure"
974 (substitute* "fortran/src/Makefile.in"
975 (("libhdf5_fortran_la_LDFLAGS =")
976 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
977 (assoc-ref outputs "fortran") "/lib")))
978 (substitute* "hl/fortran/src/Makefile.in"
979 (("libhdf5hl_fortran_la_LDFLAGS =")
980 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
981 (assoc-ref outputs "fortran") "/lib")))
983 (add-after 'configure 'patch-settings
985 ;; libhdf5.settings contains the full path of the
986 ;; compilers used, and its contents are included in
987 ;; libhdf5.so. We truncate the hashes to avoid
988 ;; unnecessary store references to those compilers:
989 (substitute* "src/libhdf5.settings"
990 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
991 (string-append prefix (string-take hash 10) "..."))
992 ;; Don't record the build-time kernel version to make the
993 ;; settings file reproducible.
994 (("Uname information:.*")
995 "Uname information: Linux\n"))
997 (add-after 'install 'patch-references
998 (lambda* (#:key inputs outputs #:allow-other-keys)
999 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1000 (zlib (assoc-ref inputs "zlib")))
1001 (substitute* (find-files bin "h5p?cc")
1003 (string-append "-L" zlib "/lib " lib)))
1005 (add-after 'install 'split
1006 (lambda* (#:key inputs outputs #:allow-other-keys)
1007 ;; Move all fortran-related files
1008 (let* ((out (assoc-ref outputs "out"))
1009 (bin (string-append out "/bin"))
1010 (lib (string-append out "/lib"))
1011 (inc (string-append out "/include"))
1012 (ex (string-append out "/share/hdf5_examples/fortran"))
1013 (fort (assoc-ref outputs "fortran"))
1014 (fbin (string-append fort "/bin"))
1015 (flib (string-append fort "/lib"))
1016 (finc (string-append fort "/include"))
1017 (fex (string-append fort "/share/hdf5_examples/fortran")))
1022 ;; Note: When built with --enable-parallel, the 'h5fc' file
1023 ;; doesn't exist, hence this condition.
1024 (when (file-exists? (string-append bin "/h5fc"))
1025 (rename-file (string-append bin "/h5fc")
1026 (string-append fbin "/h5fc")))
1027 (for-each (lambda (file)
1029 (string-append flib "/" (basename file))))
1030 (find-files lib ".*fortran.*"))
1031 (for-each (lambda (file)
1033 (string-append finc "/" (basename file))))
1034 (find-files inc ".*mod"))
1035 (for-each (lambda (file)
1037 (string-append fex "/" (basename file))))
1038 (find-files ex ".*"))
1039 (delete-file-recursively ex))
1041 (home-page "https://www.hdfgroup.org")
1042 (synopsis "Management suite for extremely large and complex data")
1043 (description "HDF5 is a suite that makes possible the management of
1044 extremely large and complex data collections.")
1045 (license (license:x11-style
1046 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1048 (define-public hdf5-1.10
1049 (package (inherit hdf5)
1054 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1055 "hdf5-" (version-major+minor version)
1056 "/hdf5-" version "/src/hdf5-"
1058 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1060 (apply string-append
1061 (take (string-split version #\.) 2))
1062 "/src/hdf5-" version ".tar.bz2")))
1064 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
1065 (patches (search-patches "hdf5-config-date.patch"))))))
1067 (define-public hdf-java
1075 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1076 version "/src/CMake-hdfjava-" version ".tar.gz"))
1078 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1079 (modules '((guix build utils)))
1080 (snippet ; Make sure we don't use the bundled sources and binaries.
1082 (for-each delete-file
1083 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1084 "HDF4.tar.gz" "HDF5.tar.gz"))
1085 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1087 (build-system gnu-build-system)
1089 `(("jdk" ,icedtea "jdk")
1090 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1092 ("hamcrest-core" ,java-hamcrest-core)
1093 ("junit" ,java-junit)
1094 ("slf4j-simple" ,java-slf4j-simple)))
1099 ("libjpeg" ,libjpeg)
1100 ("slf4j-api" ,java-slf4j-api)))
1103 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1104 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1105 (assoc-ref %build-inputs "jdk") "/lib" )
1106 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1107 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1110 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1111 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1112 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1113 (string-append "JPEGLIB="
1114 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1118 (modify-phases %standard-phases
1119 (add-before 'configure 'chdir-to-source
1120 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1121 (add-before 'configure 'patch-build
1122 (lambda* (#:key inputs outputs #:allow-other-keys)
1123 (substitute* "configure"
1124 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1125 (("/bin/cat") (which "cat")))
1126 ;; Set classpath for compilation
1127 (substitute* '("hdf/hdf5lib/Makefile.in"
1128 "hdf/hdf5lib/exceptions/Makefile.in"
1129 "hdf/hdflib/Makefile.in")
1130 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1131 (string-append (assoc-ref inputs "slf4j-api")
1132 "/share/java/slf4j-api.jar")))
1133 ;; Replace outdated config.sub and config.guess:
1134 (with-directory-excursion "config"
1135 (for-each (lambda (file)
1137 (string-append (assoc-ref inputs "automake")
1139 ,(version-major+minor (package-version automake))
1141 '("config.sub" "config.guess")))
1143 ;; Fix embedded version number
1144 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1145 (substitute* "hdf/hdf5lib/H5.java"
1147 (string-join hdf5version ", "))))
1149 (mkdir-p (string-append (assoc-ref outputs "out")))
1150 ;; Set classpath for tests
1151 (let* ((build-dir (getcwd))
1152 (lib (string-append build-dir "/lib"))
1153 (jhdf (string-append lib "/jhdf.jar"))
1154 (jhdf5 (string-append lib "/jhdf5.jar"))
1157 (string-append (assoc-ref inputs i)
1158 "/share/java/" i ".jar"))
1159 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1161 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1163 (substitute* '("test/hdf5lib/Makefile.in"
1164 "test/hdf5lib/junit.sh.in"
1165 "examples/runExample.sh.in")
1167 (string-append (assoc-ref inputs "coreutils")
1170 (string-append (assoc-ref inputs "coreutils")
1172 (("CLASSPATH=[^\n]*")
1173 (string-append "CLASSPATH=" class-path)))
1174 (setenv "CLASSPATH" class-path))
1176 (add-before 'check 'build-examples
1178 (apply invoke `("javac"
1179 ,@(find-files "examples" ".*\\.java"))))))
1181 #:parallel-build? #f
1183 #:parallel-tests? #f ))
1184 (home-page "https://support.hdfgroup.org/products/java")
1185 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1186 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1187 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1190 ;; BSD-style license:
1191 (license (license:x11-style
1192 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1193 /current/src/unpacked/COPYING"))))
1195 (define-public hdf-eos2
1202 (uri "ftp://edhs1.gsfc.nasa.gov\
1203 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1205 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1206 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1207 "hdf-eos2-build-shared.patch"
1208 "hdf-eos2-fortrantests.patch"))))
1209 (build-system gnu-build-system)
1211 `(("gfortran" ,gfortran)))
1213 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1214 ;; XXX: These inputs are really dependencies of hdf4.
1216 ("libjpeg" ,libjpeg)
1217 ("libtirpc" ,libtirpc)
1221 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1222 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1223 #:parallel-tests? #f))
1224 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1225 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1226 (description "HDF-EOS2 is a software library built on HDF4 which supports
1227 the construction of data structures used in NASA's Earth Observing
1228 System (Grid, Point and Swath).")
1230 ;; Source files carry a permissive license header.
1231 (license (license:non-copyleft home-page))))
1233 (define-public hdf-eos5
1239 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1240 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1243 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1244 (patches (search-patches "hdf-eos5-build-shared.patch"
1245 "hdf-eos5-remove-gctp.patch"
1246 "hdf-eos5-fix-szip.patch"
1247 "hdf-eos5-fortrantests.patch"))))
1249 `(("gfortran" ,gfortran)))
1250 (build-system gnu-build-system)
1256 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1257 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1258 #:parallel-tests? #f))
1259 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1261 "HDF-EOS5 is a software library built on HDF5 to support the construction
1262 of data structures used in NASA's Earth Observing System (Grid, Point and
1264 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1266 ;; Source files carry a permissive license header.
1267 (license (license:non-copyleft home-page))))
1269 (define-public hdf5-parallel-openmpi
1270 (package (inherit hdf5)
1271 (name "hdf5-parallel-openmpi")
1274 ,@(package-inputs hdf5)))
1276 (substitute-keyword-arguments (package-arguments hdf5)
1277 ((#:configure-flags flags)
1278 ``("--enable-parallel"
1279 ,@(delete "--enable-cxx"
1280 (delete "--enable-threadsafe" ,flags))))
1282 `(modify-phases ,phases
1283 (add-after 'build 'mpi-setup
1285 (add-before 'check 'patch-tests
1287 ;; OpenMPI's mpirun will exit with non-zero status if it
1288 ;; detects an "abnormal termination", i.e. any process not
1289 ;; calling MPI_Finalize(). Since the test is explicitly
1290 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1291 ;; H5C_flush_cache from being called, mpirun will always
1292 ;; complain, so turn this test off.
1293 (substitute* "testpar/Makefile"
1294 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1295 (string-append front back "\n")))
1296 (substitute* "tools/h5diff/testph5diff.sh"
1297 (("/bin/sh") (which "sh")))
1299 (synopsis "Management suite for data with parallel IO support")))
1301 (define-public h5check
1308 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1309 "h5check/src/h5check-" version ".tar.gz"))
1312 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1313 (build-system gnu-build-system)
1314 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1315 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1316 (synopsis "HDF5 format checker")
1317 (description "@code{h5check} is a validation tool for verifying that an
1318 HDF5 file is encoded according to the HDF File Format Specification.")
1319 (license (license:x11-style "file://COPYING"))))
1327 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1332 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1333 (build-system cmake-build-system)
1334 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1335 (inputs `(("lapack" ,lapack)
1337 ;; FIXME: Even though the fonts are available dvips complains:
1338 ;; "Font cmmi10 not found; characters will be left blank."
1340 `(("texlive" ,texlive-tiny)
1341 ("ghostscript" ,ghostscript)
1342 ("doxygen" ,doxygen)))
1343 (home-page "http://itpp.sourceforge.net")
1344 (synopsis "C++ library of maths, signal processing and communication classes")
1345 (description "IT++ is a C++ library of mathematical, signal processing and
1346 communication classes and functions. Its main use is in simulation of
1347 communication systems and for performing research in the area of
1348 communications. The kernel of the library consists of generic vector and
1349 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1350 similar to MATLAB, GNU Octave or SciPy.")
1351 (license license:gpl3+)))
1353 (define-public netcdf
1360 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1361 "netcdf-" version ".tar.gz"))
1364 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1365 (patches (search-patches "netcdf-date-time.patch"
1366 "netcdf-tst_h_par.patch"))))
1367 (build-system gnu-build-system)
1370 ("doxygen" ,doxygen)
1371 ("graphviz" ,graphviz)))
1373 `(("hdf4" ,hdf4-alt)
1376 ("libjpeg" ,libjpeg)))
1378 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1380 #:phases (modify-phases %standard-phases
1381 (add-before 'configure 'fix-source-date
1383 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1384 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1385 ;; to '1st hour of the current day', and therefore makes the
1386 ;; package not reproducible.
1387 (substitute* "./configure"
1388 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1389 "date --date='@0'"))
1391 (add-after 'configure 'patch-settings
1393 ;; libnetcdf.settings contains the full filename of the compilers
1394 ;; used to build the library. We truncate the hashes of those
1395 ;; filenames to avoid unnecessary references to the corresponding
1397 (substitute* "libnetcdf.settings"
1398 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1399 (string-append prefix (string-take hash 10) "...")))
1402 #:parallel-tests? #f)) ;various race conditions
1403 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1404 (synopsis "Library for scientific data")
1405 (description "NetCDF is an interface for scientific data access and a
1406 software library that provides an implementation of the interface. The netCDF
1407 library defines a machine-independent format for representing scientific data.
1408 Together, the interface, library, and format support the creation, access, and
1409 sharing of scientific data.")
1410 (license (license:x11-style "file://COPYRIGHT"))))
1412 (define-public netcdf-parallel-openmpi
1413 (package (inherit netcdf)
1414 (name "netcdf-parallel-openmpi")
1417 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1418 (package-inputs netcdf))))
1419 ;; TODO: Replace pkg-config references in nc-config with absolute references
1421 (substitute-keyword-arguments (package-arguments netcdf)
1422 ((#:configure-flags flags)
1423 `(cons* "CC=mpicc" "CXX=mpicxx"
1424 "--enable-parallel-tests"
1425 ;; Shared libraries not supported with parallel IO.
1426 "--disable-shared" "--with-pic"
1429 (define-public netcdf-fortran
1431 (name "netcdf-fortran")
1436 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1440 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1441 (build-system gnu-build-system)
1443 `(#:parallel-tests? #f))
1445 `(("netcdf" ,netcdf)))
1447 `(("gfortran" ,gfortran)))
1448 (synopsis "Fortran interface for the netCDF library")
1449 (description (package-description netcdf))
1450 (home-page (package-home-page netcdf))
1451 (license (package-license netcdf))))
1453 (define-public nlopt
1459 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1462 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1463 (build-system gnu-build-system)
1465 `(;; Shared libraries are not built by default. They are required to
1466 ;; build the Guile, Octave, and Python bindings.
1467 #:configure-flags '("--enable-shared")
1470 (modify-phases %standard-phases
1471 (add-before 'configure 'set-libnlopt-file-name
1472 (lambda* (#:key outputs #:allow-other-keys)
1473 ;; Make sure the Scheme module refers to the library by its
1474 ;; absolute file name (we cannot do that from a snippet
1475 ;; because the expansion of @libdir@ contains
1477 (let ((out (assoc-ref outputs "out")))
1478 (substitute* "swig/nlopt.scm.in"
1480 (string-append out "/lib/libnlopt")))
1482 (inputs `(("guile" ,guile-2.0)))
1483 (native-inputs `(("pkg-config" ,pkg-config)))
1484 (home-page "http://ab-initio.mit.edu/wiki/")
1485 (synopsis "Library for nonlinear optimization")
1486 (description "NLopt is a library for nonlinear optimization, providing a
1487 common interface for a number of different free optimization routines available
1488 online as well as original implementations of various other algorithms.")
1489 (license license:lgpl2.1+)))
1491 (define-public ipopt
1498 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1502 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1503 (modules '((guix build utils)))
1505 ;; Make sure we don't use the bundled software.
1507 (delete-file-recursively "ThirdParty")
1509 (build-system gnu-build-system)
1511 '(#:phases (modify-phases %standard-phases
1512 (add-after 'install 'add--L-flags-in-ipopt.pc
1513 (lambda* (#:key inputs outputs #:allow-other-keys)
1514 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1515 ;; move it to "Libs.private" where it belongs, and add a
1516 ;; '-L' flag for LAPACK.
1517 (let ((out (assoc-ref outputs "out"))
1518 (lapack (assoc-ref inputs "lapack")))
1519 (substitute* (string-append out "/lib/pkgconfig/"
1521 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1522 (string-append "Libs: " before " " after "\n"
1523 "Libs.private: " before
1524 "-L" lapack "/lib -llapack -lblas "
1528 `(("gfortran" ,gfortran)))
1530 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1531 `(("lapack" ,lapack))) ;for both libblas and liblapack
1532 (home-page "http://www.coin-or.org")
1533 (synopsis "Large-scale nonlinear optimizer")
1535 "The Interior Point Optimizer (IPOPT) is a software package for
1536 large-scale nonlinear optimization. It provides C++, C, and Fortran
1538 (license license:epl1.0)))
1546 (uri (string-append "https://www.coin-or.org/download/source/"
1547 "Clp/Clp-" version ".tgz"))
1550 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1551 (modules '((guix build utils)))
1553 ;; Make sure we don't use the bundled software.
1555 (delete-file-recursively "ThirdParty")
1557 (build-system gnu-build-system)
1559 `(("gfortran" ,gfortran)
1560 ("pkg-config" ,pkg-config)))
1562 `(("openblas" ,openblas)))
1563 (home-page "https://www.coin-or.org")
1564 (synopsis "Linear programming solver")
1566 "CLP is a high quality linear programming solver. Its main strengths are
1567 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1568 linear and quadratic objectives. There are limited facilities for nonlinear
1569 and quadratic objectives using the Simplex algorithm.")
1570 (license license:epl1.0)))
1572 (define-public ceres
1574 (name "ceres-solver")
1576 (home-page "http://ceres-solver.org/")
1579 (uri (string-append home-page "ceres-solver-"
1583 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1584 (build-system cmake-build-system)
1586 ;; TODO: Build HTML user documentation and install separately.
1587 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1588 "-DBUILD_SHARED_LIBS=ON")
1590 #:phases (modify-phases %standard-phases
1591 (add-before 'configure 'set-library-directory
1593 ;; Install libraries to lib/, not lib64/.
1594 (substitute* "internal/ceres/CMakeLists.txt"
1595 (("set\\(LIB_SUFFIX \"64\"\\)")
1596 "set(LIB_SUFFIX \"\")"))
1599 `(("pkg-config" ,pkg-config)))
1601 `(("glog" ,glog))) ;for #include <glog/glog.h>
1606 ("suitesparse" ,suitesparse)
1607 ("gflags" ,gflags)))
1608 (synopsis "C++ library for solving large optimization problems")
1610 "Ceres Solver is a C++ library for modeling and solving large,
1611 complicated optimization problems. It is a feature rich, mature and
1612 performant library which has been used in production since 2010. Ceres Solver
1613 can solve two kinds of problems:
1615 @item non-linear least squares problems with bounds constraints;
1616 @item general unconstrained optimization problems.
1618 (license license:bsd-3)))
1620 ;; For a fully featured Octave, users are strongly recommended also to install
1621 ;; the following packages: less, ghostscript, gnuplot.
1622 (define-public octave-cli
1629 (uri (string-append "mirror://gnu/octave/octave-"
1633 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1634 (build-system gnu-build-system)
1636 `(("alsa-lib" ,alsa-lib)
1637 ("arpack" ,arpack-ng)
1643 ("fontconfig" ,fontconfig)
1644 ("freetype" ,freetype)
1648 ("graphicsmagick" ,graphicsmagick)
1651 ("libsndfile" ,libsndfile)
1655 ("portaudio" ,portaudio)
1657 ("readline" ,readline)
1658 ("suitesparse" ,suitesparse)
1659 ("texinfo" ,texinfo)
1663 ("gfortran" ,gfortran)
1664 ("pkg-config" ,pkg-config)
1666 ;; The following inputs are not actually used in the build process.
1667 ;; However, the ./configure gratuitously tests for their existence and
1668 ;; assumes that programs not present at build time are also not, and
1669 ;; can never be, available at run time! If these inputs are therefore
1670 ;; not present, support for them will be built out. However, Octave
1671 ;; will still run without them, albeit without the features they
1674 ("ghostscript" ,ghostscript)
1675 ("gnuplot" ,gnuplot)))
1676 ;; Octave code uses this variable to detect directories holding multiple CA
1677 ;; certificates to verify peers with. This is required for the networking
1678 ;; functions that require encryption to work properly.
1679 (native-search-paths
1680 (list (search-path-specification
1681 (variable "CURLOPT_CAPATH")
1682 (files '("etc/ssl/certs")))))
1685 (list (string-append "--with-shell="
1686 (assoc-ref %build-inputs "bash")
1689 (modify-phases %standard-phases
1690 (add-after 'configure 'configure-makeinfo
1691 (lambda* (#:key inputs #:allow-other-keys)
1692 (substitute* "libinterp/corefcn/help.h"
1695 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1697 (home-page "https://www.gnu.org/software/octave/")
1698 (synopsis "High-level language for numerical computation")
1699 (description "GNU Octave is a high-level interpreted language that is
1700 specialized for numerical computations. It can be used for both linear and
1701 non-linear applications and it provides great support for visualizing results.
1702 Work may be performed both at the interactive command-line as well as via
1704 (license license:gpl3+)))
1706 (define-public octave
1707 (package (inherit octave-cli)
1710 (inherit (package-source octave-cli))))
1712 `(("qscintilla" ,qscintilla)
1714 ,@(package-inputs octave-cli)))
1716 `(("qttools" , qttools) ;for lrelease
1717 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1718 ,@(package-native-inputs octave-cli)))
1720 (substitute-keyword-arguments (package-arguments octave-cli)
1722 `(modify-phases ,phases
1723 (add-before 'configure 'patch-qscintilla-library-name
1724 (lambda* (#:key inputs #:allow-other-keys)
1725 ;; The QScintilla library that the Octave configure script tries
1726 ;; to link with should be named libqscintilla-qt5.so, but the
1727 ;; QScintilla input provides the shared library as
1728 ;; libqscintilla2_qt5.so.
1729 (substitute* "configure"
1730 (("qscintilla2-qt5")
1734 (define-public opencascade-oce
1736 (name "opencascade-oce")
1742 (url "https://github.com/tpaviot/oce.git")
1743 (commit (string-append "OCE-" version))))
1744 (file-name (git-file-name name version))
1745 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1747 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1748 (build-system cmake-build-system)
1751 (list "-DOCE_TESTING:BOOL=ON"
1752 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1753 "-DOCE_DRAW:BOOL=ON"
1754 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1755 (assoc-ref %outputs "out"))
1756 "-UCMAKE_INSTALL_RPATH")))
1758 `(("freetype" ,freetype)
1765 `(("python" ,python-wrapper)))
1766 (home-page "https://github.com/tpaviot/oce")
1767 (synopsis "Libraries for 3D modeling and numerical simulation")
1769 "Open CASCADE is a set of libraries for the development of applications
1770 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1771 C++ class libraries providing services for 3D surface and solid modeling, CAD
1772 data exchange, and visualization. It is used for development of specialized
1773 software dealing with 3D models in design (CAD), manufacturing (CAM),
1774 numerical simulation (CAE), measurement equipment (CMM), and quality
1775 control (CAQ) domains.
1777 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1778 patches, improvements, and experiments contributed by users over the official
1779 Open CASCADE library.")
1780 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1781 ; use of header files; see
1782 ; OCCT_LGPL_EXCEPTION.txt
1783 license:public-domain; files
1784 ; src/Standard/Standard_StdAllocator.hxx and
1785 ; src/NCollection/NCollection_StdAllocator.hxx
1786 license:expat; file src/OpenGl/OpenGl_glext.h
1787 license:bsd-3)))); test framework gtest
1789 (define-public opencascade-occt
1791 (name "opencascade-occt")
1797 (url "https://git.dev.opencascade.org/repos/occt.git")
1800 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1802 (file-name (git-file-name name version))
1804 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1805 (modules '((guix build utils)))
1808 ;; Remove files specific to non-free operating systems.
1809 (delete-file-recursively "samples/ios")
1810 (delete-file-recursively "samples/mfc")
1811 (delete-file-recursively "samples/qt/FuncDemo")
1812 (delete-file "genconf.bat")
1813 (delete-file "gendoc.bat")
1814 (delete-file "genproj.bat")
1815 (delete-file "upgrade.bat")
1816 ;; Remove references to deleted files.
1817 (substitute* "dox/FILES_HTML.txt"
1818 ((".*standard.*") "" )
1819 ((".*UIKitSample.*") ""))
1821 (build-system cmake-build-system)
1823 '(;; There is no test target for make. OCCT provides an
1824 ;; 'Automated Testing System', which may be accessed after
1825 ;; installation via the draw.sh script. draw.sh is located in
1826 ;; the bin directory. For details see:
1827 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1828 ;; occt_dev_guides__tests.html
1830 ;; Configure without freeimage: attempting to link against the
1831 ;; freeimage version 3.17 library leads to 'undefined
1832 ;; reference' errors.
1834 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1836 "-DUSE_VTK:BOOL=OFF"
1837 "-DBUILD_DOC_Overview:BOOL=OFF"
1838 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1839 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1840 "-UCMAKE_INSTALL_LIBDIR")))
1842 `(("doxygen" ,doxygen)
1843 ;("freeimage" ,freeimage)
1844 ("freetype" ,freetype)
1846 ("libxext" ,libxext)
1853 ;; TODO: build Overview documentation and add 'doc' output.
1854 (home-page "https://www.opencascade.com")
1855 (synopsis "Libraries for 3D modeling and numerical simulation")
1857 "Open CASCADE is a set of libraries for the development of applications
1858 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1859 C++ class libraries providing services for 3D surface and solid modeling, CAD
1860 data exchange, and visualization. It is used for development of specialized
1861 software dealing with 3D models in design (CAD), manufacturing (CAM),
1862 numerical simulation (CAE), measurement equipment (CMM), and quality
1863 control (CAQ) domains.
1865 This is the certified version of the Open Cascade Technology (OCCT) library.")
1866 (license (list ;; OCCT library:
1867 license:lgpl2.1; with an exception for the use of header
1868 ; files, see OCCT_LGPL_EXCEPTION.txt.
1869 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1870 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1872 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1873 ;; src/StepFile/step.tab.*:
1874 license:gpl3+ ; with Bison 2.2 exception.
1875 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1876 (license:non-copyleft
1877 "https://www.unicode.org/license.html")
1878 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1879 license:public-domain))))
1889 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1891 (string-append "gmsh_"
1892 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1894 (file-name (git-file-name name version))
1896 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1897 (modules '((guix build utils)))
1899 ;; Remove non-free METIS code
1901 (delete-file-recursively "contrib/Metis")
1903 (build-system cmake-build-system)
1906 ("gfortran" ,gfortran)
1912 ("opencascade-oce" ,opencascade-oce)
1914 ("libxext" ,libxext)))
1916 `(("fontconfig" ,fontconfig)
1917 ("libxft" ,libxft)))
1919 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1920 "-DENABLE_BUILD_SHARED:BOOL=ON"
1921 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1922 (home-page "http://gmsh.info/")
1923 (synopsis "3D finite element grid generator")
1924 (description "Gmsh is a 3D finite element grid generator with a built-in
1925 CAD engine and post-processor. Its design goal is to provide a fast, light
1926 and user-friendly meshing tool with parametric input and advanced
1927 visualization capabilities. Gmsh is built around four modules: geometry,
1928 mesh, solver and post-processing. The specification of any input to these
1929 modules is done either interactively using the graphical user interface or in
1930 ASCII text files using Gmsh's own scripting language.")
1931 (license license:gpl2+)))
1933 (define-public maxflow
1936 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
1937 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
1942 (url "https://github.com/gerddie/maxflow.git")
1944 (file-name (git-file-name name version))
1947 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1948 (build-system cmake-build-system)
1949 (home-page "https://pub.ist.ac.at/~vnk/software.html")
1950 (synopsis "Library implementing Maxflow algorithm")
1951 (description "An implementation of the maxflow algorithm described in
1952 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1953 Energy Minimization in Computer Vision.\n
1954 Yuri Boykov and Vladimir Kolmogorov.\n
1955 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1957 (license license:gpl3+)))
1959 (define-public petsc
1966 ;; The *-lite-* tarball does not contain the *large* documentation
1967 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1968 "petsc-lite-" version ".tar.gz"))
1970 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1971 (outputs '("out" ; libraries and headers
1972 "examples")) ; ~30MiB of examples
1973 (build-system gnu-build-system)
1975 `(("python" ,python-2)))
1977 `(("gfortran" ,gfortran)
1979 ("superlu" ,superlu)
1980 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1981 ;; leaving out opengl, as configuration seems to only be for mac
1984 `(#:test-target "test"
1985 #:parallel-build? #f ; build is parallel by default
1991 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1992 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1993 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1995 (modify-phases %standard-phases
1997 ;; PETSc's configure script is actually a python script, so we can't
1998 ;; run it with bash.
1999 (lambda* (#:key outputs (configure-flags '())
2001 (let* ((prefix (assoc-ref outputs "out"))
2002 (flags `(,(string-append "--prefix=" prefix)
2003 ,@configure-flags)))
2004 (format #t "build directory: ~s~%" (getcwd))
2005 (format #t "configure flags: ~s~%" flags)
2006 (apply invoke "./configure" flags))))
2007 (add-after 'configure 'clean-local-references
2008 (lambda* (#:key outputs #:allow-other-keys)
2009 (let ((out (assoc-ref outputs "out")))
2010 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2011 ;; Prevent build directory from leaking into compiled code
2013 ;; Scrub timestamp for reproducibility
2014 ((".*Libraries compiled on.*") ""))
2015 (substitute* (find-files "." "petscvariables")
2016 ;; Do not expose build machine characteristics, set to defaults.
2017 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2018 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2020 (add-after 'install 'clean-install
2021 ;; Try to keep installed files from leaking build directory names.
2022 (lambda* (#:key inputs outputs #:allow-other-keys)
2023 (let ((out (assoc-ref outputs "out")))
2024 (substitute* (map (lambda (file)
2025 (string-append out "/lib/petsc/conf/" file))
2026 '("petscvariables"))
2028 ;; Make compiler references point to the store
2029 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2030 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2031 (string-append "= " (which compiler))))
2032 ;; PETSc installs some build logs, which aren't necessary.
2033 (for-each (lambda (file)
2034 (let ((f (string-append out "/lib/petsc/conf/" file)))
2035 (when (file-exists? f)
2037 '("configure.log" "make.log" "gmake.log"
2038 "test.log" "error.log" "RDict.db"
2039 "PETScBuildInternal.cmake"
2040 ;; Once installed, should uninstall with Guix
2043 (add-after 'install 'move-examples
2044 (lambda* (#:key outputs #:allow-other-keys)
2045 (let* ((out (assoc-ref outputs "out"))
2046 (examples (assoc-ref outputs "examples"))
2047 (exdir (string-append out "/share/petsc/examples"))
2048 (exdir' (string-append examples "/share/petsc/examples")))
2049 (copy-recursively exdir exdir')
2050 (delete-file-recursively exdir)
2052 (home-page "https://www.mcs.anl.gov/petsc")
2053 (synopsis "Library to solve PDEs")
2054 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2055 data structures and routines for the scalable (parallel) solution of
2056 scientific applications modeled by partial differential equations.")
2057 (license (license:non-copyleft
2058 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2060 (define-public petsc-complex
2061 (package (inherit petsc)
2062 (name "petsc-complex")
2064 (substitute-keyword-arguments (package-arguments petsc)
2065 ((#:configure-flags cf)
2066 `(cons "--with-scalar-type=complex" ,cf))))
2067 (synopsis "Library to solve PDEs (with complex scalars)")))
2069 (define-public petsc-openmpi
2070 (package (inherit petsc)
2071 (name "petsc-openmpi")
2073 `(("hdf5" ,hdf5-parallel-openmpi)
2074 ("hypre" ,hypre-openmpi)
2076 ("mumps" ,mumps-openmpi)
2077 ("openmpi" ,openmpi)
2078 ("scalapack" ,scalapack)
2079 ("scotch" ,pt-scotch32)
2080 ,@(package-inputs petsc)))
2082 (substitute-keyword-arguments (package-arguments petsc)
2083 ((#:configure-flags cf)
2085 "--with-mpiexec=mpirun"
2088 "--with-scalapack=1"
2090 ,(string-append "--with-mpi-dir="
2091 (assoc-ref %build-inputs "openmpi"))
2092 ,(string-append "--with-hdf5-include="
2093 (assoc-ref %build-inputs "hdf5") "/include")
2094 ,(string-append "--with-hdf5-lib="
2095 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2096 ,@(delete "--with-mpi=0" ,cf)))
2098 `(modify-phases ,phases
2099 (add-before 'configure 'mpi-setup
2100 ,%openmpi-setup)))))
2101 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2103 (define-public petsc-complex-openmpi
2104 (package (inherit petsc-complex)
2105 (name "petsc-complex-openmpi")
2107 `(("openmpi" ,openmpi)
2108 ,@(package-inputs petsc-complex)))
2110 (substitute-keyword-arguments (package-arguments petsc-complex)
2111 ((#:configure-flags cf)
2112 ``("--with-mpiexec=mpirun"
2113 ,(string-append "--with-mpi-dir="
2114 (assoc-ref %build-inputs "openmpi"))
2115 ,@(delete "--with-mpi=0" ,cf)))
2117 `(modify-phases ,phases
2118 (add-before 'configure 'mpi-setup
2119 ,%openmpi-setup)))))
2120 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2122 (define-public python-petsc4py
2124 (name "python-petsc4py")
2129 (uri (pypi-uri "petsc4py" version))
2132 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2133 (build-system python-build-system)
2136 (modify-phases %standard-phases
2137 (add-before 'build 'pre-build
2139 ;; Define path to PETSc installation.
2140 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2142 (add-before 'check 'mpi-setup
2145 `(("petsc" ,petsc-openmpi)
2146 ("python-numpy" ,python-numpy)))
2147 (home-page "https://bitbucket.org/petsc/petsc4py/")
2148 (synopsis "Python bindings for PETSc")
2149 (description "PETSc, the Portable, Extensible Toolkit for
2150 Scientific Computation, is a suite of data structures and routines for
2151 the scalable (parallel) solution of scientific applications modeled by
2152 partial differential equations. It employs the MPI standard for all
2153 message-passing communication. @code{petsc4py} provides Python
2154 bindings to almost all functions of PETSc.")
2155 (license license:bsd-3)))
2157 (define-public python-kiwisolver
2159 (name "python-kiwisolver")
2163 (uri (pypi-uri "kiwisolver" version))
2166 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2167 (build-system python-build-system)
2168 (home-page "https://github.com/nucleic/kiwi")
2169 (synopsis "Fast implementation of the Cassowary constraint solver")
2171 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2172 solving algorithm. Kiwi has been designed from the ground up to be
2173 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2174 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2175 savings are consistently > 5x.")
2176 (license license:bsd-3)))
2178 (define-public python2-kiwisolver
2179 (package-with-python2 python-kiwisolver))
2181 (define-public slepc
2188 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2192 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2193 (build-system gnu-build-system)
2195 `(("python" ,python-2)
2196 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2198 `(("arpack" ,arpack-ng)
2199 ("gfortran" ,gfortran)))
2201 `(("petsc" ,petsc)))
2203 `(#:parallel-build? #f ;build is parallel by default
2205 `(,(string-append "--with-arpack-dir="
2206 (assoc-ref %build-inputs "arpack") "/lib"))
2207 #:make-flags ;honor (parallel-job-count)
2208 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2209 ,(string-append "PETSCCONFIGDIR="
2210 (assoc-ref %build-inputs "petsc:examples")
2211 "/share/petsc/examples/config"))
2213 (modify-phases %standard-phases
2215 ;; configure is a python script, so we can't run it with bash.
2216 (lambda* (#:key inputs outputs (configure-flags '())
2218 (let* ((prefix (assoc-ref outputs "out"))
2219 (flags `(,(string-append "--prefix=" prefix)
2220 ,@configure-flags)))
2221 (format #t "build directory: ~s~%" (getcwd))
2222 (format #t "configure flags: ~s~%" flags)
2223 (setenv "SLEPC_DIR" (getcwd))
2224 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2225 (apply invoke "./configure" flags))))
2226 (add-after 'install 'delete-doc
2227 ;; TODO: SLEPc installs HTML documentation alongside headers in
2228 ;; $out/include. We'd like to move them to share/doc, but delete
2229 ;; them for now, as they are incomplete and installing the complete
2230 ;; documentation is difficult.
2231 (lambda* (#:key outputs #:allow-other-keys)
2232 (let* ((out (assoc-ref outputs "out")))
2233 (for-each delete-file (find-files out "\\.html$"))
2235 (add-after 'install 'clean-install
2236 ;; Clean up unnecessary build logs from installation.
2237 (lambda* (#:key outputs #:allow-other-keys)
2238 (let ((out (assoc-ref outputs "out")))
2239 (for-each (lambda (file)
2240 (let ((f (string-append out "/lib/slepc/conf/" file)))
2241 (when (file-exists? f)
2243 '("configure.log" "make.log" "gmake.log"
2244 "test.log" "error.log" "RDict.db"
2247 (home-page "http://slepc.upv.es")
2248 (synopsis "Scalable library for eigenproblems")
2249 (description "SLEPc is a software library for the solution of large sparse
2250 eigenproblems on parallel computers. It can be used for the solution of
2251 linear eigenvalue problems formulated in either standard or generalized form,
2252 as well as other related problems such as the singular value decomposition.
2253 The emphasis of the software is on methods and techniques appropriate for
2254 problems in which the associated matrices are sparse, for example, those
2255 arising after the discretization of partial differential equations.")
2256 (license license:bsd-2)))
2258 (define-public slepc-complex
2259 (package (inherit slepc)
2260 (name "slepc-complex")
2262 `(("petsc" ,petsc-complex)
2263 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2264 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2266 (define-public slepc-openmpi
2267 (package (inherit slepc)
2268 (name "slepc-openmpi")
2270 (substitute-keyword-arguments (package-arguments slepc)
2271 ((#:phases phases '%standard-phases)
2272 `(modify-phases ,phases
2273 (add-before 'check 'mpi-setup
2274 ,%openmpi-setup)))))
2277 ("arpack" ,arpack-ng-openmpi)
2278 ,@(alist-delete "arpack" (package-inputs slepc))))
2280 `(("petsc" ,petsc-openmpi)
2281 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2282 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2284 (define-public slepc-complex-openmpi
2285 (package (inherit slepc-openmpi)
2286 (name "slepc-complex-openmpi")
2288 `(("petsc" ,petsc-complex-openmpi)
2289 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2290 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2292 (define-public python-slepc4py
2294 (name "python-slepc4py")
2299 (uri (pypi-uri "slepc4py" version))
2302 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2303 (build-system python-build-system)
2306 (modify-phases %standard-phases
2307 (add-before 'build 'pre-build
2309 ;; Define path to PETSc installation.
2310 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2311 ;; Define path to SLEPc installation.
2312 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2314 (add-before 'check 'mpi-setup
2317 `(("python-numpy" ,python-numpy)
2318 ("python-petsc4py" ,python-petsc4py)
2319 ("slepc" ,slepc-openmpi)))
2320 (home-page "https://bitbucket.org/slepc/slepc4py/")
2321 (synopsis "Python bindings for SLEPc")
2322 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2323 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2324 Scientific Computation. It employs the MPI standard for all
2325 message-passing communication. @code{slepc4py} provides Python
2326 bindings to almost all functions of SLEPc.")
2327 (license license:bsd-3)))
2329 (define-public mumps
2336 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2340 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2341 (patches (search-patches "mumps-build-parallelism.patch"
2342 "mumps-shared-libseq.patch"
2343 "mumps-shared-mumps.patch"
2344 "mumps-shared-pord.patch"))))
2345 (build-system gnu-build-system)
2347 `(("fortran" ,gfortran)
2348 ;; These are required for linking against mumps, but we let the user
2349 ;; declare the dependency.
2352 ("scotch" ,scotch)))
2354 `(#:modules ((ice-9 match)
2357 ,@%gnu-build-system-modules)
2359 (modify-phases %standard-phases
2361 (lambda* (#:key inputs #:allow-other-keys)
2362 (call-with-output-file "Makefile.inc"
2373 INCSEQ = -I$(topdir)/libseq
2374 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2375 LIBSEQNEEDED = libseqneeded~;
2379 AR = ar vr # rules require trailing space, ugh...
2382 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2384 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2385 LIBOTHERS = -pthread
2388 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2392 LIBS = $(SCALAP) $(LIBSEQ)
2393 LPORDDIR = $(topdir)/PORD/lib
2394 IPORD = -I$(topdir)/PORD/include
2395 LPORD = $(LPORDDIR)/libpord.a
2396 ORDERINGSF = -Dpord~@[
2398 IMETIS = -I$(METISDIR)/include
2399 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2400 ORDERINGSF += -Dmetis~]~@[~:{
2402 ISCOTCH = -I$(SCOTCHDIR)/include
2403 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2404 ORDERINGSF += ~a~}~]
2405 ORDERINGSC = $(ORDERINGSF)
2406 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2407 IORDERINGSF = $(ISCOTCH)
2408 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2409 (assoc-ref inputs "mpi")
2410 (assoc-ref inputs "blas")
2411 (assoc-ref inputs "scalapack")
2412 (assoc-ref inputs "metis")
2413 (match (list (assoc-ref inputs "pt-scotch")
2414 (assoc-ref inputs "scotch"))
2418 `((,scotch "" "-Dscotch")))
2421 "-lptesmumps -lptscotch -lptscotcherr "
2422 "-Dptscotch")))))))))
2424 ;; By default only the d-precision library is built. Make with "all"
2425 ;; target so that all precision libraries and examples are built.
2427 (invoke "make" "all"
2428 (format #f "-j~a" (parallel-job-count)))))
2430 ;; Run the simple test drivers, which read test input from stdin:
2431 ;; from the "real" input for the single- and double-precision
2432 ;; testers, and from the "cmplx" input for complex-precision
2433 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2434 ;; package to prefix execution with "mpirun".
2435 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2436 (with-directory-excursion "examples"
2439 (let ((tester (apply open-pipe*
2442 ,(string-append "./" prec
2444 (input (open-input-file
2445 (string-append "input_simpletest_" type))))
2447 (dump-port input tester)
2449 (zero? (close-pipe tester)))))
2451 '("real" "real" "cmplx" "cmplx")))))
2453 (lambda* (#:key outputs #:allow-other-keys)
2454 (let* ((out (assoc-ref outputs "out"))
2455 (libdir (string-append out "/lib")))
2456 (copy-recursively "lib" libdir)
2457 (copy-recursively "include" (string-append out "/include"))
2458 (when (file-exists? "libseq/libmpiseq.a")
2459 (install-file "libseq/libmpiseq.a" libdir))
2460 (when (file-exists? "libseq/libmpiseq.so")
2461 (install-file "libseq/libmpiseq.so" libdir))
2463 (home-page "http://mumps.enseeiht.fr")
2464 (synopsis "Multifrontal sparse direct solver")
2466 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2467 sparse system of linear equations A x = b using Gaussian elimination.")
2468 (license license:cecill-c)))
2470 (define-public mumps-metis
2471 (package (inherit mumps)
2472 (name "mumps-metis")
2474 (alist-delete "scotch" (package-inputs mumps)))))
2476 (define-public mumps-openmpi
2477 (package (inherit mumps)
2478 (name "mumps-openmpi")
2481 ("scalapack" ,scalapack)
2482 ("pt-scotch" ,pt-scotch)
2483 ,@(alist-delete "scotch" (package-inputs mumps))))
2485 (substitute-keyword-arguments (package-arguments mumps)
2487 `(modify-phases ,phases
2488 (add-before 'check 'mpi-setup
2492 ((assoc-ref ,phases 'check)
2493 #:exec-prefix '("mpirun" "-n" "2"))))))))
2494 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2496 (define-public mumps-metis-openmpi
2497 (package (inherit mumps-openmpi)
2498 (name "mumps-metis-openmpi")
2500 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2502 (define-public ruby-asciimath
2504 (name "ruby-asciimath")
2509 (uri (rubygems-uri "asciimath" version))
2512 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2513 (build-system ruby-build-system)
2516 (modify-phases %standard-phases
2518 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2519 (add-after 'unpack 'patch-remove-spurious-backslashes
2521 (substitute* "spec/parser_spec.rb"
2526 `(("bundler" ,bundler)
2527 ("ruby-rspec" ,ruby-rspec)))
2528 (synopsis "AsciiMath parsing and conversion library")
2530 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2531 easy-to-write markup language for mathematics.")
2532 (home-page "https://github.com/asciidoctor/asciimath")
2533 (license license:expat)))
2535 (define-public superlu
2542 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2543 "superlu_" version ".tar.gz"))
2545 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2546 (modules '((guix build utils)))
2548 ;; Replace the non-free implementation of MC64 with a stub adapted
2551 (use-modules (ice-9 regex)
2553 (call-with-output-file "SRC/mc64ad.c"
2558 void mc64id_(int *a) {
2559 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2562 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2563 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2564 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2567 ;; Remove the corresponding license verbiage. MC64 license follows
2568 ;; a "------" line separator.
2569 (with-atomic-file-replacement "License.txt"
2570 (let ((rx (make-regexp "-{8}")))
2573 (let ((line (read-line in 'concat)))
2574 (unless (regexp-exec rx line)
2578 (build-system cmake-build-system)
2582 `(("blas" ,openblas)
2583 ("gfortran" ,gfortran)))
2585 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2586 "-DTPL_BLAS_LIBRARIES=openblas"
2587 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2588 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2589 (synopsis "Supernodal direct solver for sparse linear systems")
2591 "SuperLU is a general purpose library for the direct solution of large,
2592 sparse, nonsymmetric systems of linear equations on high performance machines.
2593 The library is written in C and is callable from either C or Fortran. The
2594 library routines perform an LU decomposition with partial pivoting and
2595 triangular system solves through forward and back substitution. The library
2596 also provides threshold-based ILU factorization preconditioners.")
2597 (license (list license:bsd-3
2598 license:gpl2+ ;EXAMPLE/*fgmr.c
2599 (license:fsf-free "file://SRC/colamd.h")))))
2601 (define-public superlu-dist
2603 (name "superlu-dist")
2608 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2609 "superlu_dist_" version ".tar.gz"))
2611 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2612 (modules '((guix build utils)))
2614 ;; Replace the non-free implementation of MC64 with a stub
2616 (call-with-output-file "SRC/mc64ad_dist.c"
2621 void mc64id_dist(int *a) {
2622 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2625 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2626 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2627 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2630 (substitute* "SRC/util.c" ;adjust default algorithm
2631 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2632 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2633 ;; general (i.e. non-square) processor-grid support.
2634 "RowPerm = NOROWPERM;"))
2636 (patches (search-patches "superlu-dist-scotchmetis.patch"
2637 "superlu-dist-awpm-grid.patch"))))
2638 (build-system cmake-build-system)
2642 `(("gfortran" ,gfortran)
2645 ("combblas" ,combinatorial-blas)))
2647 `(("mpi" ,openmpi) ;headers include MPI heades
2648 ("parmetis" ,pt-scotch32 "metis")
2649 ("pt-scotch" ,pt-scotch32)))
2651 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2652 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2653 "-DTPL_ENABLE_COMBBLASLIB=YES"
2654 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2655 "-DTPL_LAPACK_LIBRARIES=-llapack"
2656 (string-append "-DTPL_PARMETIS_LIBRARIES="
2658 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2659 "scotchmetis" "scotch" "scotcherr")
2661 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2662 (assoc-ref %build-inputs "parmetis")
2664 "-DTPL_ENABLE_COMBBLASLIB=ON"
2665 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2666 (assoc-ref %build-inputs "combblas")
2667 "/include/CombBLAS;"
2668 (assoc-ref %build-inputs "combblas")
2669 "/include/BipartiteMatchings")
2670 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2672 (modify-phases %standard-phases
2673 (add-before 'configure 'set-c++-standard
2675 (substitute* "CMakeLists.txt"
2676 ;; AWPM headers require C++14
2677 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2678 (add-before 'check 'mpi-setup
2680 (add-before 'check 'omp-setup
2681 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2682 (home-page (package-home-page superlu))
2683 (synopsis "Parallel supernodal direct solver")
2685 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2686 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2687 implemented in ANSI C, and MPI for communications.")
2688 (license license:bsd-3)))
2690 (define-public scotch
2697 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2698 "latestfile/298/scotch_" version ".tar.gz"))
2700 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2701 (patches (search-patches "scotch-build-parallelism.patch"
2702 "scotch-integer-declarations.patch"))))
2703 (build-system gnu-build-system)
2709 (outputs '("out" "metis"))
2711 `(#:make-flags (list (string-append "prefix=" %output))
2713 (modify-phases %standard-phases
2715 'unpack 'chdir-to-src
2716 (lambda _ (chdir "src") #t))
2720 (call-with-output-file "Makefile.inc"
2734 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2735 LDFLAGS = -lz -lm -lrt -lpthread
2737 LEX = flex -Pscotchyy -olex.yy.c
2742 YACC = bison -pscotchyy -y -b y
2744 '("COMMON_FILE_COMPRESS_GZ"
2746 "COMMON_RANDOM_FIXED_SEED"
2747 "INTSIZE64" ;use 'int64_t'
2748 ;; Prevents symbolc clashes with libesmumps
2750 ;; XXX: Causes invalid frees in superlu-dist tests
2752 ;; "SCOTCH_PTHREAD_NUMBER=2"
2753 "restrict=__restrict"))))
2755 (add-after 'build 'build-esmumps
2758 (format #f "-j~a" (parallel-job-count))
2760 (add-before 'install 'make-install-dirs
2761 (lambda* (#:key outputs #:allow-other-keys)
2762 (mkdir (assoc-ref outputs "out"))))
2763 (add-after 'install 'install-metis
2764 (lambda* (#:key outputs #:allow-other-keys)
2765 (let ((out (assoc-ref outputs "metis")))
2767 ;; metis files are not installed with 'make install'
2768 (for-each (lambda (f)
2769 (install-file f (string-append out "/include")))
2770 (find-files "../include/" ".*metis\\.h"))
2771 (for-each (lambda (f)
2772 (install-file f (string-append out "/lib")))
2773 (find-files "../lib/" ".*metis\\..*"))
2775 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2776 (synopsis "Programs and libraries for graph algorithms")
2777 (description "SCOTCH is a set of programs and libraries which implement
2778 the static mapping and sparse matrix reordering algorithms developed within
2779 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2780 conquer approach, to scientific computing problems such as graph and mesh
2781 partitioning, static mapping, and sparse matrix ordering, in application
2782 domains ranging from structural mechanics to operating systems or
2784 ;; See LICENSE_en.txt
2785 (license license:cecill-c)))
2787 (define-public scotch32
2788 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2789 ;; some applications.
2790 (package (inherit scotch)
2793 (substitute-keyword-arguments (package-arguments scotch)
2794 ((#:phases scotch-phases)
2795 `(modify-phases ,scotch-phases
2799 (call-with-output-file "Makefile.inc"
2813 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2814 LDFLAGS = -lz -lm -lrt -lpthread
2816 LEX = flex -Pscotchyy -olex.yy.c
2821 YACC = bison -pscotchyy -y -b y
2823 '("COMMON_FILE_COMPRESS_GZ"
2825 "COMMON_RANDOM_FIXED_SEED"
2826 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2827 ;; Prevents symbolc clashes with libesmumps
2829 ;; XXX: Causes invalid frees in superlu-dist tests
2831 ;; "SCOTCH_PTHREAD_NUMBER=2"
2832 "restrict=__restrict"))))))))))
2834 "Programs and libraries for graph algorithms (32-bit integers)")))
2836 (define-public pt-scotch
2837 (package (inherit scotch)
2840 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2842 (substitute-keyword-arguments (package-arguments scotch)
2843 ((#:phases scotch-phases)
2844 `(modify-phases ,scotch-phases
2848 (invoke "make" (format #f "-j~a" (parallel-job-count))
2849 "ptscotch" "ptesmumps")
2851 ;; Install the serial metis compatibility library
2852 (invoke "make" "-C" "libscotchmetis" "install")))
2853 (add-before 'check 'mpi-setup
2857 (invoke "make" "ptcheck")))))))
2858 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2860 (define-public pt-scotch32
2861 (package (inherit scotch32)
2862 (name "pt-scotch32")
2864 `(("openmpi" ,openmpi))) ;headers include MPI headers
2866 (substitute-keyword-arguments (package-arguments scotch32)
2867 ((#:phases scotch32-phases)
2868 `(modify-phases ,scotch32-phases
2871 (invoke "make" (format #f "-j~a" (parallel-job-count))
2872 "ptscotch" "ptesmumps")
2873 ;; Install the serial metis compatibility library
2874 (invoke "make" "-C" "libscotchmetis" "install")))
2875 (add-before 'check 'mpi-setup
2879 (invoke "make" "ptcheck")))))))
2881 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2883 (define-public metis
2890 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2891 "metis-" version ".tar.gz"))
2894 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2895 (build-system cmake-build-system)
2897 `(("blas" ,openblas)))
2899 `(#:tests? #f ;no tests
2900 #:configure-flags `("-DSHARED=ON"
2901 ,(string-append "-DGKLIB_PATH=" (getcwd)
2902 "/metis-" ,version "/GKlib"))))
2903 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2904 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2906 "METIS is a set of serial programs for partitioning graphs, partitioning
2907 finite element meshes, and producing fill-reducing orderings for sparse
2908 matrices. The algorithms implemented in METIS are based on the multilevel
2909 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2911 (license license:asl2.0))) ;As of version 5.0.3
2913 (define-public p4est
2920 (uri (string-append "http://p4est.github.io/release/p4est-"
2924 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2925 (build-system gnu-build-system)
2927 `(("fortran" ,gfortran)
2932 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2933 (assoc-ref %build-inputs "blas")
2935 ,(string-append "LAPACK_LIBS=-L"
2936 (assoc-ref %build-inputs "lapack")
2938 #:phases (modify-phases %standard-phases
2939 (add-before 'check 'mpi-setup
2941 (home-page "http://www.p4est.org")
2942 (synopsis "Adaptive mesh refinement on forests of octrees")
2944 "The p4est software library enables the dynamic management of a
2945 collection of adaptive octrees, conveniently called a forest of octrees.
2946 p4est is designed to work in parallel and scales to hundreds of thousands of
2948 (license license:gpl2+)))
2950 (define-public p4est-openmpi
2951 (package (inherit p4est)
2952 (name "p4est-openmpi")
2955 ,@(package-inputs p4est)))
2957 (substitute-keyword-arguments (package-arguments p4est)
2958 ((#:configure-flags cf)
2959 ``("--enable-mpi" ,@,cf))))
2960 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2962 (define-public gsegrafix
2969 (uri (string-append "mirror://gnu/" name "/" name "-"
2973 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2974 (build-system gnu-build-system)
2976 `(#:configure-flags '("LDFLAGS=-lm")))
2978 `(("libgnomecanvas" ,libgnomecanvas)
2979 ("libbonoboui" ,libbonoboui)
2980 ("libgnomeui" ,libgnomeui)
2981 ("libgnomeprintui" ,libgnomeprintui)
2984 `(("pkg-config" ,pkg-config)))
2985 (home-page "https://www.gnu.org/software/gsegrafix/")
2986 (synopsis "GNOME application to create scientific and engineering plots")
2987 (description "GSEGrafix is an application which produces high-quality graphical
2988 plots for science and engineering. Plots are specified via simple ASCII
2989 parameter files and data files and are presented in an anti-aliased GNOME
2990 canvas. The program supports rectangular two-dimensional plots, histograms,
2991 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2992 to BMP, JPEG or PNG image formats.")
2993 (license license:gpl3+)))
2995 (define-public maxima
3002 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3003 version "-source/" name "-" version ".tar.gz"))
3006 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
3007 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3008 (build-system gnu-build-system)
3011 ("gnuplot" ,gnuplot) ;for plots
3013 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3015 `(("texinfo" ,texinfo)
3017 ("python" ,python)))
3020 (list "--enable-gcl"
3021 (string-append "--with-posix-shell="
3022 (assoc-ref %build-inputs "bash")
3024 (string-append "--with-wish="
3025 (assoc-ref %build-inputs "tk")
3027 (let ((v ,(package-version tk)))
3028 (string-take v (string-index-right v #\.)))))
3029 ;; By default Maxima attempts to write temporary files to
3030 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3031 ;; Work around that.
3032 #:make-flags (list "TMPDIR=/tmp")
3034 (modify-phases %standard-phases
3035 (add-after 'unpack 'patch-paths
3036 (lambda* (#:key inputs #:allow-other-keys)
3037 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3038 (coreutils (assoc-ref inputs "coreutils"))
3039 (dirname (string-append coreutils "/bin/dirname"))
3040 (head (string-append coreutils "/bin/head"))
3041 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3042 (python (string-append (assoc-ref inputs "python")
3044 (substitute* "src/maxima.in"
3045 (("sed ") (string-append sed " "))
3046 (("dirname") dirname)
3048 (substitute* "doc/info/Makefile.in"
3049 (("/usr/bin/env perl") perl))
3050 (substitute* "doc/info/build_html.sh.in"
3051 (("python") python))
3053 (add-before 'check 'pre-check
3055 (chmod "src/maxima" #o555)
3059 ;; This is derived from the testing code in the "debian/rules" file
3060 ;; of Debian's Maxima package.
3061 ;; If Maxima can successfully run this, the binary to be installed
3067 "--batch-string=\"run_testsuite();\" "
3068 "| grep -q \"No unexpected errors found\""))))
3069 ;; Make sure the doc and emacs files are found in the
3070 ;; standard location. Also configure maxima to find gnuplot
3071 ;; without having it on the PATH.
3072 (add-after 'install 'post-install
3073 (lambda* (#:key outputs inputs #:allow-other-keys)
3074 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3075 (out (assoc-ref outputs "out"))
3076 (datadir (string-append out "/share/maxima/" ,version))
3077 (binutils (string-append (assoc-ref inputs "binutils")
3079 (with-directory-excursion out
3080 (mkdir-p "share/emacs")
3081 (mkdir-p "share/doc")
3083 (string-append datadir "/doc/")
3084 (string-append out "/share/doc/maxima"))
3085 (with-atomic-file-replacement
3086 (string-append datadir "/share/maxima-init.lisp")
3088 (format out "~a ~s~a~%"
3089 "(setf $gnuplot_command "
3090 (string-append gnuplot "/bin/gnuplot") ")")
3091 (dump-port in out))))
3092 ;; Ensure that Maxima will have access to the GNU binutils
3093 ;; components at runtime.
3094 (wrap-program (string-append out "/bin/maxima")
3095 `("PATH" prefix (,binutils))))
3097 (home-page "http://maxima.sourceforge.net")
3098 (synopsis "Numeric and symbolic expression manipulation")
3099 (description "Maxima is a system for the manipulation of symbolic and
3100 numerical expressions. It yields high precision numeric results by using
3101 exact fractions, arbitrary precision integers, and variable precision floating
3103 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3104 ;; Others simply say "GNU General Public License" without stating a
3105 ;; version (which implicitly means gpl1+).
3106 ;; At least one file (src/maxima.asd) says "version 2."
3107 ;; GPLv2 only is therefore the smallest subset.
3108 (license license:gpl2)))
3110 (define-public wxmaxima
3118 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
3119 (commit (string-append "Version-" version))))
3120 (file-name (git-file-name name version))
3122 (base32 "09ciip0wkahps5jdsqqr72bwjrd15bacw38zp23v3hm71xfk8hky"))))
3123 (build-system cmake-build-system)
3125 `(("gettext" ,gettext-minimal)
3126 ("xorg-server" ,xorg-server-for-tests)))
3127 ;; TODO: Add libomp for multithreading support.
3128 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3130 `(("wxwidgets" ,wxwidgets)
3133 ("adwaita-icon-theme" ,adwaita-icon-theme)
3135 ("shared-mime-info" ,shared-mime-info)))
3137 `(#:test-target "test"
3139 (modify-phases %standard-phases
3140 (add-before 'check 'pre-check
3142 ;; Tests require a running X server.
3143 (system "Xvfb :1 &")
3144 (setenv "DISPLAY" ":1")
3145 (setenv "HOME" (getcwd))
3147 (add-after 'install 'wrap-program
3148 (lambda* (#:key inputs outputs #:allow-other-keys)
3149 (wrap-program (string-append (assoc-ref outputs "out")
3152 (,(string-append (assoc-ref inputs "maxima")
3154 ;; For GtkFileChooserDialog.
3155 `("GSETTINGS_SCHEMA_DIR" =
3156 (,(string-append (assoc-ref inputs "gtk+")
3157 "/share/glib-2.0/schemas")))
3158 `("XDG_DATA_DIRS" ":" prefix
3159 (;; Needed by gdk-pixbuf to know supported icon formats.
3161 (assoc-ref inputs "shared-mime-info") "/share")
3162 ;; The default icon theme of GTK+.
3164 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3166 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3167 (synopsis "Graphical user interface for the Maxima computer algebra system")
3169 "wxMaxima is a graphical user interface for the Maxima computer algebra
3170 system. It eases the use of Maxima by making most of its commands available
3171 through a menu system and by providing input dialogs for commands that require
3172 more than one argument. It also implements its own display engine that
3173 outputs mathematical symbols directly instead of depicting them with ASCII
3176 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3177 text and mathematical calculations to create documents, exporting of input and
3178 output to TeX, and a browser for Maxima's manual including command index and
3179 full text searching.")
3180 (license license:gpl2+)))
3182 (define-public armadillo
3188 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3192 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3193 (build-system cmake-build-system)
3194 (arguments `(#:tests? #f)) ; no test target
3196 `(("openblas" ,openblas)
3198 ("arpack" ,arpack-ng)))
3199 (home-page "http://arma.sourceforge.net/")
3200 (synopsis "C++ linear algebra library")
3202 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3203 between speed and ease of use. It is useful for algorithm development
3204 directly in C++, or quick conversion of research code into production
3205 environments. It can be used for machine learning, pattern recognition,
3206 signal processing, bioinformatics, statistics, econometrics, etc. The library
3207 provides efficient classes for vectors, matrices and cubes, as well as 150+
3208 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3209 (license license:asl2.0)))
3211 (define-public muparser
3212 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3213 ;; different hash. In order to make `guix package --upgrade` work correctly,
3214 ;; we set a Guix packaging revision.
3215 ;; When the next version of muparser is released, we can remove
3216 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3217 (let ((upstream-version "2.2.5")
3221 (version (string-append upstream-version "-" revision))
3226 (url "https://github.com/beltoforion/muparser.git")
3227 (commit (string-append "v" upstream-version))))
3228 (file-name (git-file-name name version))
3230 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3231 (build-system gnu-build-system)
3233 `(#:configure-flags '("--enable-samples=no")
3234 #:tests? #f)) ;no "check" target
3235 (home-page "http://muparser.beltoforion.de/")
3236 (synopsis "Fast parser library for mathematical expressions")
3238 "muParser is an extensible high performance math parser library. It is
3239 based on transforming an expression into a bytecode and precalculating constant
3241 (license license:expat))))
3243 (define-public openblas
3250 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3251 version "%20version.tar.gz"))
3252 (file-name (string-append name "-" version ".tar.gz"))
3255 "0jbdjsi0qsxahdcm42agnn1y7xpmg0hrhwjsxg0zbhs9wwy3p568"))))
3256 (build-system gnu-build-system)
3258 `(#:test-target "test"
3259 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3260 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3261 ;; we need to disable substitutions.
3263 ,(let ((system (or (%current-target-system) (%current-system))))
3264 (or (string-prefix? "x86_64" system)
3265 (string-prefix? "i686" system)
3266 (string-prefix? "mips" system)
3267 (string-prefix? "aarch64" system)))
3269 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3271 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3273 ;; This is the maximum number of threads OpenBLAS will ever use (that
3274 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3275 ;; is used.) If we don't set it, the makefile sets it to the number
3276 ;; of cores of the build machine, which is obviously wrong.
3279 ;; Build the library for all supported CPUs. This allows
3280 ;; switching CPU targets at runtime with the environment variable
3281 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3282 ;; Unfortunately, this is not supported on non-x86 architectures,
3283 ;; where it leads to failed builds.
3284 ,@(let ((system (or (%current-target-system) (%current-system))))
3286 ((or (string-prefix? "x86_64" system)
3287 (string-prefix? "i686" system))
3288 '("DYNAMIC_ARCH=1"))
3289 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3290 ;; two available MIPS targets special extended instructions
3291 ;; for Loongson cores are used.
3292 ((string-prefix? "mips" system)
3293 '("TARGET=SICORTEX"))
3294 ;; On aarch64 force the generic 'armv8-a' target
3295 ((string-prefix? "aarch64" system)
3298 ;; no configure script
3300 (modify-phases %standard-phases
3302 (add-before 'build 'set-extralib
3303 (lambda* (#:key inputs #:allow-other-keys)
3304 ;; Get libgfortran found when building in utest.
3306 (string-append "-L" (assoc-ref inputs "fortran-lib")
3310 `(("fortran-lib" ,gfortran "lib")))
3313 ("fortran" ,gfortran)
3315 (home-page "https://www.openblas.net/")
3316 (synopsis "Optimized BLAS library based on GotoBLAS")
3318 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3319 (license license:bsd-3)))
3321 (define-public openblas-ilp64
3322 (package/inherit openblas
3323 (name "openblas-ilp64")
3324 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3326 (substitute-keyword-arguments (package-arguments openblas)
3327 ((#:make-flags flags '())
3328 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3330 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3331 (license license:bsd-3)))
3333 (define* (make-blis implementation #:optional substitutable?)
3334 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3335 source tree for a list of implementations.)
3337 SUBSTITUTABLE? determines whether the package is made available as a
3340 Currently the specialization must be selected at configure-time, but work is
3341 underway to allow BLIS to select the right optimized kernels at run time:
3342 <https://github.com/flame/blis/issues/129>."
3344 (name (if (string=? implementation "reference")
3346 (string-append "blis-" implementation)))
3348 (home-page "https://github.com/flame/blis")
3351 (uri (git-reference (url home-page) (commit version)))
3354 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3355 (file-name (git-file-name "blis" version))))
3356 (build-system gnu-build-system)
3358 `(#:test-target "test"
3360 #:substitutable? ,substitutable?
3362 #:phases (modify-phases %standard-phases
3364 (lambda* (#:key outputs #:allow-other-keys)
3365 ;; This is a home-made 'configure' script.
3366 (let ((out (assoc-ref outputs "out")))
3367 (invoke "./configure" "-p" out
3371 "--enable-threading=openmp"
3374 (add-before 'check 'show-test-output
3376 ;; By default "make check" is silent. Make it verbose.
3377 (system "tail -F output.testsuite &")
3379 (synopsis "High-performance basic linear algebra (BLAS) routines")
3381 "BLIS is a portable software framework for instantiating high-performance
3382 BLAS-like dense linear algebra libraries. The framework was designed to
3383 isolate essential kernels of computation that, when optimized, immediately
3384 enable optimized implementations of most of its commonly used and
3385 computationally intensive operations. While BLIS exports a new BLAS-like API,
3386 it also includes a BLAS compatibility layer which gives application developers
3387 access to BLIS implementations via traditional BLAS routine calls.")
3388 (license license:bsd-3)))
3391 ;; This is the "reference" implementation, which is the non-optimized but
3392 ;; portable variant (no assembly).
3393 (make-blis "reference" #t))
3395 (define ignorance blis)
3397 (define-syntax-rule (blis/x86_64 processor)
3398 "Expand to a package specialized for PROCESSOR."
3400 (inherit (make-blis processor))
3401 (supported-systems '("x86_64-linux"))))
3403 (define-public blis-sandybridge
3404 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3405 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3406 (blis/x86_64 "sandybridge"))
3408 (define-public blis-haswell
3409 ;; BLIS specialized for Haswell processors (launched 2013):
3410 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3411 (blis/x86_64 "haswell"))
3413 (define-public blis-knl
3414 ;; BLIS specialized for Knights Landing processor (launched 2016):
3415 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3416 (blis/x86_64 "knl"))
3419 (define-public openlibm
3427 (url "https://github.com/JuliaLang/openlibm.git")
3428 (commit (string-append "v" version))))
3429 (file-name (git-file-name name version))
3431 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3432 (build-system gnu-build-system)
3435 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3437 ;; no configure script
3438 (modify-phases %standard-phases (delete 'configure))
3439 #:tests? #f)) ;the tests are part of the default target
3440 (home-page "https://openlibm.org/")
3441 (synopsis "Portable C mathematical library (libm)")
3443 "OpenLibm is an effort to have a high quality, portable, standalone C
3444 mathematical library (libm). It can be used standalone in applications and
3445 programming language implementations. The project was born out of a need to
3446 have a good libm for the Julia programming language that worked consistently
3447 across compilers and operating systems, and in 32-bit and 64-bit
3449 ;; Each architecture has its own make target, and there is none for mips.
3450 (supported-systems (delete "mips64el-linux" %supported-systems))
3451 ;; See LICENSE.md for details.
3452 (license (list license:expat
3455 license:public-domain
3456 license:lgpl2.1+))))
3458 (define-public openspecfun
3460 (name "openspecfun")
3466 (url "https://github.com/JuliaLang/openspecfun.git")
3467 (commit (string-append "v" version))))
3468 (file-name (git-file-name name version))
3470 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3471 (build-system gnu-build-system)
3473 '(#:tests? #f ; no "check" target
3475 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3477 (modify-phases %standard-phases
3478 (delete 'configure)))) ; no configure script
3480 `(("fortran" ,gfortran)))
3481 (home-page "https://github.com/JuliaLang/openspecfun")
3482 (synopsis "Collection of special mathematical functions")
3484 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3485 portable package for Bessel Functions of a Complex Argument and Nonnegative
3486 Order; it contains subroutines for computing Bessel functions and Airy
3487 functions. Faddeeva allows computing the various error functions of arbitrary
3488 complex arguments (Faddeeva function, error function, complementary error
3489 function, scaled complementary error function, imaginary error function, and
3490 Dawson function); given these, one can also easily compute Voigt functions,
3491 Fresnel integrals, and similar related functions as well.")
3492 ;; Faddeeva is released under the Expat license; AMOS is included as
3493 ;; public domain software.
3494 (license (list license:expat license:public-domain))))
3496 (define-public suitesparse
3498 (name "suitesparse")
3504 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse.git")
3505 (commit (string-append "v" version))))
3506 (file-name (git-file-name name version))
3509 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3510 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3511 (modules '((guix build utils)))
3513 ;; Remove bundled metis source
3515 (delete-file-recursively "metis-5.1.0")
3517 (build-system gnu-build-system)
3519 '(#:tests? #f ;no "check" target
3524 "MY_METIS_LIB=-lmetis"
3525 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3526 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3527 (assoc-ref %outputs "out")
3528 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3529 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3530 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3531 " -DCMAKE_SKIP_RPATH=TRUE"
3532 " -DCMAKE_BUILD_TYPE=Release")
3533 (string-append "INSTALL_LIB="
3534 (assoc-ref %outputs "out") "/lib")
3535 (string-append "INSTALL_INCLUDE="
3536 (assoc-ref %outputs "out") "/include")
3539 (modify-phases %standard-phases
3540 (delete 'configure)))) ;no configure script
3546 `(("cmake" ,cmake-minimal)
3548 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3549 (synopsis "Suite of sparse matrix software")
3551 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3552 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3553 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3554 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3555 CXSparse, a concise sparse Cholesky factorization package; and many other
3558 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3560 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3561 (license (list license:gpl2+ license:lgpl2.1+))))
3563 (define-public atlas
3569 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3570 version "/atlas" version ".tar.bz2"))
3573 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3574 (build-system gnu-build-system)
3575 (home-page "http://math-atlas.sourceforge.net/")
3576 (inputs `(("gfortran" ,gfortran)
3577 ("lapack-tar" ,(package-source lapack))))
3578 (outputs '("out" "doc"))
3579 ;; For the moment we drop support for MIPS at it fails to compile. See
3580 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3581 (supported-systems (delete "mips64el-linux" %supported-systems))
3583 `(#:parallel-build? #f
3584 #:parallel-tests? #f
3586 ;; ATLAS tunes itself for the machine it is built on, as explained at
3587 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3588 ;; For this reason, we want users to build it locally instead of using
3592 #:modules ((srfi srfi-26)
3593 (guix build gnu-build-system)
3596 `(;; Generate position independent code suitable for dynamic libraries
3597 ;; and use WALL timer to get more accurate timing.
3598 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3601 ,,(if (string-match "64" (%current-system))
3604 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3605 ;; needed to compile C files before it is generated.
3606 "-Ss" "pmake" "make -j 1"
3607 ;; Probe is failing for MIPS. We therefore define the system
3608 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3609 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3610 ,,@(if (string-prefix? "mips" (%current-system))
3611 (list "-A" "49" "-V" "1")
3613 ;; Generate shared libraries.
3615 ;; Build a full LAPACK library.
3616 ,(string-append "--with-netlib-lapack-tarfile="
3617 (assoc-ref %build-inputs "lapack-tar")))
3619 (modify-phases %standard-phases
3620 (add-after 'install 'install-doc
3621 (lambda* (#:key outputs inputs #:allow-other-keys)
3622 (let ((doc (string-append (assoc-ref outputs "doc")
3623 "/share/doc/atlas")))
3625 (for-each (cut install-file <> doc)
3626 (find-files "../ATLAS/doc" ".*"))
3628 (add-after 'check 'check-pt
3629 (lambda _ (invoke "make" "ptcheck")))
3630 ;; Fix files required to run configure.
3631 (add-before 'configure 'fix-/bin/sh
3633 ;; Use `sh', not `/bin/sh'.
3634 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3638 ;; Fix /bin/sh in generated make files.
3639 (add-after 'configure 'fix-/bin/sh-in-generated-files
3641 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3645 ;; ATLAS configure program does not accepts the default flags
3646 ;; passed by the 'gnu-build-system'.
3648 (lambda* (#:key native-inputs inputs outputs
3649 (configure-flags '())
3650 #:allow-other-keys #:rest args)
3651 (let* ((prefix (assoc-ref outputs "out"))
3652 (bash (or (and=> (assoc-ref
3653 (or native-inputs inputs) "bash")
3654 (cut string-append <> "/bin/bash"))
3656 (flags `(,(string-append "--prefix=" prefix)
3658 (abs-srcdir (getcwd))
3659 (srcdir (string-append "../" (basename abs-srcdir))))
3660 (format #t "source directory: ~s (relative from build: ~s)~%"
3664 (format #t "build directory: ~s~%" (getcwd))
3665 (format #t "configure flags: ~s~%" flags)
3667 (string-append srcdir "/configure")
3669 (synopsis "Automatically Tuned Linear Algebra Software")
3671 "ATLAS is an automatically tuned linear algebra software library
3672 providing C and Fortran77 interfaces to a portably efficient BLAS
3673 implementation, as well as a few routines from LAPACK.
3675 Optimization occurs at build time. For this reason, the library is built on
3676 the machine where it is installed, without resorting to pre-built substitutes.
3678 Before building the library, CPU throttling should be disabled. This can be
3679 done in the BIOS, or, on GNU/Linux, with the following command:
3682 # cpupower --governor performance
3685 Failure to do so will result in a library with poor performance.")
3686 (license license:bsd-3)))
3695 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3696 version "/glm-" version ".zip"))
3698 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3699 (patches (search-patches "glm-restore-install-target.patch"))))
3700 (build-system cmake-build-system)
3702 `(("unzip" ,unzip)))
3703 (home-page "https://glm.g-truc.net/")
3704 (synopsis "OpenGL Mathematics library")
3705 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3706 library for graphics software based on the OpenGL Shading Language (GLSL)
3708 (license license:expat)))
3710 (define-public lpsolve
3717 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3718 "/lp_solve_" version "_source.tar.gz"))
3721 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3722 (modules '((guix build utils)))
3725 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3727 ;; Pretend to be on a 64 bit platform to obtain a common directory
3728 ;; name for the build results on all architectures; nothing else
3729 ;; seems to depend on it.
3730 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3732 ;; The check for 'isnan' as it is written fails with
3733 ;; "non-floating-point argument in call to function
3734 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3735 ;; definition, which in turn leads to bad things. Fix the feature
3737 (("isnan\\(0\\)") "isnan(0.)"))
3739 (build-system gnu-build-system)
3741 `(#:tests? #f ; no check target
3743 (modify-phases %standard-phases
3744 (delete 'configure) ; no configure script
3747 (with-directory-excursion "lpsolve55"
3748 (invoke "bash" "ccc"))
3749 (with-directory-excursion "lp_solve"
3750 (invoke "bash" "ccc"))
3753 (lambda* (#:key outputs #:allow-other-keys)
3754 (let* ((out (assoc-ref outputs "out"))
3755 (bin (string-append out "/bin"))
3756 (lib (string-append out "/lib"))
3757 ;; This is where LibreOffice expects to find the header
3758 ;; files, and where they are installed by Debian.
3759 (include (string-append out "/include/lpsolve")))
3760 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3761 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3762 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3764 ;; Install a subset of the header files as on Debian
3765 ;; (plus lp_bit.h, which matches the regular expression).
3766 (for-each (lambda (name)
3767 (install-file name include))
3768 (find-files "." "lp_[HMSa-z].*\\.h$"))
3769 (with-directory-excursion "shared"
3770 (for-each (lambda (name)
3771 (install-file name include))
3772 (find-files "." "\\.h$")))
3774 (home-page "http://lpsolve.sourceforge.net/")
3775 (synopsis "Mixed integer linear programming (MILP) solver")
3777 "lp_solve is a mixed integer linear programming solver based on the
3778 revised simplex and the branch-and-bound methods.")
3779 (license license:lgpl2.1+)))
3781 (define-public dealii
3788 (uri (string-append "https://github.com/dealii/dealii/releases/"
3789 "download/v" version "/dealii-" version ".tar.gz"))
3792 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3793 (modules '((guix build utils)))
3795 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3797 (delete-file-recursively "bundled")
3799 (build-system cmake-build-system)
3807 ("arpack" ,arpack-ng)
3808 ("muparser" ,muparser)
3809 ("gfortran" ,gfortran)
3810 ("suitesparse" ,suitesparse))) ;for UMFPACK
3812 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3814 ;; Work around a bug in libsuitesparseconfig linking
3815 ;; see https://github.com/dealii/dealii/issues/4745
3816 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3817 (home-page "https://www.dealii.org")
3818 (synopsis "Finite element library")
3820 "Deal.II is a C++ program library targeted at the computational solution
3821 of partial differential equations using adaptive finite elements. The main
3822 aim of deal.II is to enable rapid development of modern finite element codes,
3823 using among other aspects adaptive meshes and a wide array of tools often used
3824 in finite element programs.")
3825 (license license:lgpl2.1+)))
3827 (define-public dealii-openmpi
3828 (package (inherit dealii)
3829 (name "dealii-openmpi")
3832 ;;Supported only with MPI:
3833 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3834 ("p4est" ,p4est-openmpi)
3835 ("petsc" ,petsc-openmpi)
3836 ("slepc" ,slepc-openmpi)
3837 ("metis" ,metis) ;for MUMPS
3838 ("scalapack" ,scalapack) ;for MUMPS
3839 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3840 ("arpack" ,arpack-ng-openmpi)
3841 ,@(fold alist-delete (package-inputs dealii)
3842 '("p4est" "arpack"))))
3844 (substitute-keyword-arguments (package-arguments dealii)
3845 ((#:configure-flags cf)
3846 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3848 ((#:phases phases '%standard-phases)
3849 `(modify-phases ,phases
3850 (add-before 'check 'mpi-setup
3851 ,%openmpi-setup)))))
3852 (synopsis "Finite element library (with MPI support)")))
3854 (define-public flann
3863 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3864 version "-src.zip"))
3867 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3868 (patches (search-patches "flann-cmake-3.11.patch"))))
3869 (build-system cmake-build-system)
3871 "octave")) ;46 MiB .mex file that pulls Octave
3873 `(("unzip" ,unzip)))
3876 ("octave" ,octave-cli)
3877 ("python" ,python-2) ; print syntax
3878 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3881 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3882 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3883 #:strip-directories '("lib" "lib64" "libexec"
3884 "bin" "sbin" "share/flann/octave")
3886 ;; Save 12 MiB by not installing .a files. Passing
3887 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3888 #:phases (modify-phases %standard-phases
3889 (add-before 'configure 'set-octave-directory
3890 (lambda* (#:key outputs #:allow-other-keys)
3891 ;; Install the .mex file in the "octave" output.
3892 (let ((out (assoc-ref outputs "octave")))
3893 (substitute* "src/matlab/CMakeLists.txt"
3894 (("share/flann/octave")
3895 (string-append out "/share/flann/octave")))
3897 (add-after 'install 'remove-static-libraries
3898 (lambda* (#:key outputs #:allow-other-keys)
3899 (let* ((out (assoc-ref outputs "out"))
3900 (lib (string-append out "/lib")))
3901 (for-each delete-file
3902 (find-files lib "\\.a$"))
3905 #:tests? #f)) ; The test data are downloaded from the Internet.
3906 (home-page "http://www.cs.ubc.ca/research/flann/")
3907 (synopsis "Library for approximate nearest neighbors computation")
3908 (description "FLANN is a library for performing fast approximate
3909 nearest neighbor searches in high dimensional spaces. It implements a
3910 collection of algorithms and a system for automatically choosing the best
3911 algorithm and optimum parameters depending on the dataset.
3913 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3914 (license (license:non-copyleft "file://COPYING"
3915 "See COPYING in the distribution."))))
3917 (define-public wcalc
3924 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3925 "wcalc-" version ".tar.bz2"))
3928 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3929 (build-system gnu-build-system)
3932 ("readline" ,readline)))
3933 (home-page "http://w-calc.sourceforge.net/index.php")
3934 (synopsis "Flexible command-line scientific calculator")
3935 (description "Wcalc is a very capable calculator. It has standard functions
3936 (sin, asin, and sinh for example, in either radians or degrees), many
3937 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3938 variables, a command history, hex/octal/binary input and output, unit
3939 conversions, embedded comments, and an expandable expression entry field. It
3940 evaluates expressions using the standard order of operations.")
3941 (license license:gpl2+)))
3949 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3950 "/xaos-" version ".tar.gz"))
3953 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3954 (build-system gnu-build-system)
3955 (native-inputs `(("gettext" ,gettext-minimal)))
3956 (inputs `(("libx11" ,libx11)
3961 `(#:tests? #f ;no "check" target
3962 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3963 (synopsis "Real-time fractal zoomer")
3964 (description "GNU XaoS is a graphical program that generates fractal
3965 patterns and allows you to zoom in and out of them infinitely in a fluid,
3966 continuous manner. It also includes tutorials that help to explain how fractals
3967 are built. It can generate many different fractal types such as the Mandelbrot
3969 (home-page "https://www.gnu.org/software/xaos/")
3970 (license license:gpl2+)))
3972 (define-public hypre
3980 (url "https://github.com/LLNL/hypre.git")
3981 (commit (string-append "v" version))))
3982 (file-name (git-file-name name version))
3984 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3985 (modules '((guix build utils)))
3988 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3989 ;; substitute the release date.
3990 (substitute* "src/utilities/HYPRE_utilities.h"
3991 (("Date Compiled: .*$")
3992 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3994 (build-system gnu-build-system)
3995 (outputs '("out" ; 6.1 MiB of headers and libraries
3996 "doc")) ; 4.8 MiB of documentation
4000 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4001 ("texlive" ,(texlive-union (list texlive-xypic
4003 texlive-latex-hyperref
4005 ("ghostscript" ,ghostscript)))
4007 `(("blas" ,openblas)
4008 ("lapack" ,lapack)))
4010 `(#:modules ((srfi srfi-1)
4011 ,@%gnu-build-system-modules)
4012 #:configure-flags '("--enable-shared"
4020 (modify-phases %standard-phases
4021 (add-before 'build 'set-HOME
4023 ;; FIXME: texlive-union does not find the built
4024 ;; metafonts, so it tries to generate them in HOME.
4025 (setenv "HOME" "/tmp")
4027 (add-before 'configure 'chdir-src
4028 (lambda _ (chdir "src")))
4030 (lambda* (#:key build target configure-flags
4031 #:allow-other-keys #:rest args)
4032 (let* ((configure (assoc-ref %standard-phases 'configure)))
4035 (list #:configure-flags
4036 (cons (string-append
4037 "--host=" (or target build))
4038 configure-flags)))))))
4039 (add-after 'build 'build-docs
4041 (invoke "make" "-Cdocs" "pdf" "html")))
4044 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4045 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4046 (invoke "make" "check" "CHECKRUN=")
4047 (for-each (lambda (filename)
4048 (let ((size (stat:size (stat filename))))
4049 (when (positive? size)
4050 (error (format #f "~a size ~d; error indication~%"
4052 (find-files "test" ".*\\.err$"))
4054 (add-after 'install 'install-docs
4055 (lambda* (#:key outputs #:allow-other-keys)
4056 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4057 (let* ((doc (assoc-ref outputs "doc"))
4058 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4059 (with-directory-excursion "docs"
4060 (for-each (lambda (base)
4061 (install-file (string-append base ".pdf") docdir)
4062 (copy-recursively base docdir)) ; html docs
4063 '("HYPRE_usr_manual"
4064 "HYPRE_ref_manual")))
4066 (home-page "http://www.llnl.gov/casc/hypre/")
4067 (synopsis "Library of solvers and preconditioners for linear equations")
4069 "HYPRE is a software library of high performance preconditioners and
4070 solvers for the solution of large, sparse linear systems of equations. It
4071 features multigrid solvers for both structured and unstructured grid
4073 (license license:lgpl2.1)))
4075 (define-public hypre-openmpi
4076 (package (inherit hypre)
4077 (name "hypre-openmpi")
4080 ,@(package-inputs hypre)))
4082 (substitute-keyword-arguments (package-arguments hypre)
4083 ((#:configure-flags flags)
4085 ,@(delete "--without-MPI" ,flags)))
4087 `(modify-phases ,phases
4088 (add-before 'check 'mpi-setup
4089 ,%openmpi-setup)))))
4090 (synopsis "Parallel solvers and preconditioners for linear equations")
4092 "HYPRE is a software library of high performance preconditioners and
4093 solvers for the solution of large, sparse linear systems of equations on
4094 parallel computers. It features parallel multigrid solvers for both
4095 structured and unstructured grid problems.")))
4097 (define-public matio
4104 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4105 "matio-" version ".tar.gz"))
4108 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4109 (build-system gnu-build-system)
4113 (home-page "http://matio.sourceforge.net/")
4114 (synopsis "Library for reading and writing MAT files")
4115 (description "Matio is a library for reading and writing MAT files. It
4116 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4117 (license license:bsd-2)))
4124 (origin (method url-fetch)
4125 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4126 "download/" version "/Vc-" version ".tar.gz"))
4129 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4130 (build-system cmake-build-system)
4133 '("-DBUILD_TESTING=ON"
4134 ;; By default, Vc will optimize for the CPU of the build machine.
4135 ;; Setting this to "none" makes it create portable binaries. See
4136 ;; "cmake/OptimizeForArchitecture.cmake".
4137 "-DTARGET_ARCHITECTURE=none")
4138 #:phases (modify-phases %standard-phases
4139 (add-after 'unpack 'copy-testdata
4140 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4141 (let ((testdata (assoc-ref (or native-inputs inputs)
4143 (copy-recursively testdata "tests/testdata")
4146 `(("virtest" ,virtest)
4148 ;; This is a submodule in the git project, but not part of the
4149 ;; released sources. See the git branch for the commit to take.
4150 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4154 (url "https://github.com/VcDevel/vc-testdata")
4155 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4156 (file-name (git-file-name "vc-testdata"
4157 (string-take commit 7)))
4160 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4161 (synopsis "SIMD vector classes for C++")
4162 (description "Vc provides portable, zero-overhead C++ types for explicitly
4163 data-parallel programming. It is a library designed to ease explicit
4164 vectorization of C++ code. Its types enable explicitly stating data-parallel
4165 operations on multiple values. The parallelism is therefore added via the type
4166 system. Vc has an intuitive API and provides portability between different
4167 compilers and compiler versions as well as portability between different vector
4168 instruction sets. Thus, an application written with Vc can be compiled for:
4171 @item SSE2 up to SSE4.2 or SSE4a
4174 @item NEON (in development)
4175 @item NVIDIA GPUs / CUDA (in development)
4177 (home-page "https://github.com/VcDevel/Vc")
4178 ;; "No support_???.cpp file exists for this architecture."
4179 (supported-systems '("x86_64-linux" "i686-linux"))
4180 (license license:bsd-3)))
4182 (define-public reducelcs
4183 ;; This is the last commit which is available upstream, no
4184 ;; release happened since 2010.
4185 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4189 (version (string-append "1.0-" revision "." (string-take commit 7)))
4194 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4196 (file-name (string-append name "-" version "-checkout"))
4199 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4200 (build-system gnu-build-system)
4202 `(("openlibm" ,openlibm)))
4204 `(#:tests? #f ; no tests
4206 (modify-phases %standard-phases
4207 (delete 'configure) ; No configure script exists.
4208 (replace 'install ; No install phase exists.
4209 (lambda* (#:key outputs #:allow-other-keys)
4210 (let* ((out (assoc-ref outputs "out"))
4211 (bin (string-append out "/bin")))
4212 (install-file "Approximation" bin)
4213 (install-file "CollectResults" bin)
4214 (install-file "GenerateInstances" bin)
4216 (synopsis "Approximate Longest Commons Subsequence computation tool")
4218 "@code{reduceLCS} is an implementation of the Reduce-Expand
4219 algorithm for LCS. It is a fast program to compute the approximate
4220 Longest Commons Subsequence of a set of strings.")
4221 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4222 (license license:gpl3+))))
4224 (define-public jacal
4231 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4234 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4235 (patches (search-patches "jacal-fix-texinfo.patch"))))
4236 (build-system gnu-build-system)
4239 (modify-phases %standard-phases
4240 (add-before 'build 'pre-build
4241 ;; Don't use upstream's script - it really doesn't fit into
4242 ;; Guix's functional paradigm.
4243 (lambda* (#:key inputs outputs #:allow-other-keys)
4244 (substitute* "Makefile"
4245 (("^install: install-script") "install: "))))
4246 (add-after 'install 'post-install
4247 ;; Instead, we provide our own simplified script.
4248 (lambda* (#:key inputs outputs #:allow-other-keys)
4249 (let ((wrapper (string-append (assoc-ref outputs "out")
4251 (format (open wrapper (logior O_WRONLY O_CREAT))
4252 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4253 "-e '(slib:load \"~a/lib/jacal/math\") "
4256 (assoc-ref inputs "scm")
4257 (assoc-ref outputs "out"))
4258 (chmod wrapper #o555))))
4260 (lambda* (#:key outputs #:allow-other-keys)
4261 (invoke "./configure"
4262 (string-append "--prefix="
4263 (assoc-ref outputs "out"))))))))
4264 (inputs `(("scm" ,scm)))
4265 (native-inputs `(("unzip" ,unzip)
4266 ("texinfo" ,texinfo)))
4267 (synopsis "Symbolic mathematics system")
4268 (description "GNU JACAL is an interactive symbolic mathematics program based on
4269 Scheme. It manipulate and simplify a range of mathematical expressions such
4270 as equations, scalars, vectors, and matrices.")
4271 (home-page "https://www.gnu.org/software/jacal/")
4272 (license license:gpl3+)))
4278 (home-page "https://github.com/Z3Prover/z3")
4281 (uri (git-reference (url home-page)
4282 (commit (string-append "z3-" version))))
4283 (file-name (git-file-name name version))
4286 "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q"))))
4287 (build-system gnu-build-system)
4289 `(#:imported-modules ((guix build python-build-system)
4290 ,@%gnu-build-system-modules)
4291 #:modules (((guix build python-build-system) #:select (site-packages))
4292 (guix build gnu-build-system)
4295 (modify-phases %standard-phases
4296 (add-after 'unpack 'enable-bytecode-determinism
4298 (setenv "PYTHONHASHSEED" "0")
4300 (add-after 'unpack 'fix-compatability
4301 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4303 (substitute* "src/util/mpz.cpp"
4304 (("#include <immintrin.h>") ""))
4306 (add-before 'configure 'bootstrap
4308 (invoke "python" "scripts/mk_make.py")))
4309 ;; work around gnu-build-system's setting --enable-fast-install
4310 ;; (z3's `configure' is a wrapper around the above python file,
4311 ;; which fails when passed --enable-fast-install)
4313 (lambda* (#:key inputs outputs #:allow-other-keys)
4314 (invoke "./configure"
4316 (string-append "--prefix=" (assoc-ref outputs "out"))
4317 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4318 (add-after 'configure 'change-directory
4322 (add-before 'check 'make-test-z3
4324 ;; Build the test suite executable.
4325 (invoke "make" "test-z3" "-j"
4326 (number->string (parallel-job-count)))))
4329 ;; Run all the tests that don't require arguments.
4330 (invoke "./test-z3" "/a"))))))
4333 ("python" ,python-wrapper)))
4334 (synopsis "Theorem prover")
4335 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4336 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4337 (license license:expat)))
4342 (version "2018.11.001")
4345 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4346 version "/elpa-" version ".tar.gz"))
4349 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4350 (build-system gnu-build-system)
4352 `(("fortran" ,gfortran)
4353 ("perl" ,perl))) ;for configure and deps
4355 `(("blas" ,openblas)))
4360 ;; ELPA unfortunately does not support runtime dispatch, so we can
4361 ;; only enable the "generic" kernels. See the "Cross compilation"
4362 ;; section of INSTALL.md.
4364 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4365 "--disable-avx" "--disable-avx2" "--disable-avx512"
4366 ,(string-append "CFLAGS=-O3 "
4367 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4368 "-ftree-vect-loop-version -ftree-vectorize "
4369 ,(let ((system (or (%current-target-system)
4370 (%current-system))))
4372 ((or (string-prefix? "x86_64" system)
4373 (string-prefix? "i686" system))
4376 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4378 (modify-phases %standard-phases
4379 (add-before 'configure 'patch-header-generation
4381 (substitute* "configure"
4382 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4383 (string-append & " CPP=\"$CPP\"")))
4385 (add-before 'check 'setup-tests
4387 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4388 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4389 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4390 ;; for Fortran. This also causes several tests to pass that
4391 ;; otherwise would otherwise fail with matrix size 5000; possibly
4392 ;; due to floating point tolerances that are too tight.
4393 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4394 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4395 (substitute* "Makefile"
4396 ;; Test scripts are generated, patch the shebang
4397 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4399 (home-page "http://elpa.mpcdf.mpg.de")
4400 (synopsis "Eigenvalue solvers for symmetric matrices")
4402 "The ELPA library provides efficient and scalable direct eigensolvers for
4403 symmetric matrices.")
4404 (license license:lgpl3)))
4406 (define-public elpa-openmpi
4407 (package (inherit elpa)
4408 (name "elpa-openmpi")
4411 ("scalapack" ,scalapack)
4412 ,@(package-inputs elpa)))
4414 (substitute-keyword-arguments (package-arguments elpa)
4415 ((#:configure-flags cf '())
4416 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4417 ((#:phases phases '%standard-phases)
4418 `(modify-phases ,phases
4419 (add-before 'check 'mpi-setup
4421 ;; Tests use 2 mpi tasks by default, use our remaining build
4422 ;; cores as OpenMP threads.
4423 (setenv "OMP_NUM_THREADS" (number->string
4424 (max (quotient (parallel-job-count) 2)
4426 (,%openmpi-setup)))))))
4427 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4429 (define-public elemental
4436 (url "https://github.com/elemental/Elemental.git")
4437 (commit (string-append "v" version))))
4438 (file-name (git-file-name name version))
4441 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4442 (build-system cmake-build-system)
4443 (home-page "https://github.com/elemental/Elemental")
4445 `(("gfortran" ,gfortran)))
4447 `(("blas" ,openblas)
4448 ("gfortran:lib" ,gfortran "lib")
4457 `(#:build-type "Release" ;default RelWithDebInfo not supported
4458 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4459 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4460 "-DEL_CACHE_WARNINGS:BOOL=YES"
4461 "-DEL_TESTS:BOOL=YES"
4462 "-DCMAKE_INSTALL_LIBDIR=lib"
4463 "-DGFORTRAN_LIB=gfortran")
4464 #:phases (modify-phases %standard-phases
4465 (add-before 'check 'mpi-setup
4467 (add-before 'check 'setup-tests
4469 ;; Parallelism is done at the MPI layer.
4470 (setenv "OMP_NUM_THREADS" "1")
4472 (add-after 'install 'remove-tests
4473 (lambda* (#:key outputs #:allow-other-keys)
4474 ;; Tests are installed, with no easy configuration
4475 ;; switch to prevent this, so delete them.
4476 (delete-file-recursively
4477 (string-append (assoc-ref outputs "out") "/bin"))
4479 (synopsis "Dense and sparse-direct linear algebra and optimization")
4480 (description "Elemental is a modern C++ library for distributed-memory
4481 dense and sparse-direct linear algebra, conic optimization, and lattice
4483 (license license:bsd-2)))
4485 (define-public mcrl2
4488 (version "201908.0")
4492 "https://www.mcrl2.org/download/release/mcrl2-"
4496 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4501 ("qtbase" ,qtbase)))
4502 (build-system cmake-build-system)
4503 (synopsis "Toolset for the mCRL2 formal specification language")
4505 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4506 specification language for describing concurrent discrete event systems. Its
4507 toolset supports analysis and automatic verification, linearisation, simulation,
4508 state-space exploration and generation, and tools to optimise and analyse
4509 specifications. Also, state spaces can be manipulated, visualised and
4511 (home-page "https://mcrl2.org")
4512 (license license:boost1.0)))
4514 (define-public mcrl2-minimal
4517 (name "mcrl2-minimal")
4519 `(("boost" ,boost)))
4521 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4523 (define-public tcalc
4530 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4534 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4535 (build-system gnu-build-system)
4536 (synopsis "The terminal calculator")
4538 "The terminal calculator is a small program to help users of the GNU/Linux
4539 terminal do calculations simply and quickly. The formula to be calculated can
4540 be fed to @command{tcalc} through the command line.")
4541 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4542 (license license:gpl3+)))
4544 (define-public sundials
4551 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4552 "sundials-" version ".tar.gz"))
4555 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4556 (build-system cmake-build-system)
4558 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4560 `(("fortran" ,gfortran) ;for fcmix
4562 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4564 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4565 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4566 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4567 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4568 "-DEXAMPLES_INSTALL:BOOL=OFF"
4570 "-DFCMIX_ENABLE:BOOL=ON"
4572 "-DKLU_ENABLE:BOOL=ON"
4573 ,(string-append "-DKLU_INCLUDE_DIR="
4574 (assoc-ref %build-inputs "suitesparse")
4576 ,(string-append "-DKLU_LIBRARY_DIR="
4577 (assoc-ref %build-inputs "suitesparse")
4579 (home-page "https://computation.llnl.gov/projects/sundials")
4580 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4581 (description "SUNDIALS is a family of software packages implemented with
4582 the goal of providing robust time integrators and nonlinear solvers that can
4583 easily be incorporated into existing simulation codes.")
4584 (license license:bsd-3)))
4586 (define-public sundials-openmpi
4587 (package (inherit sundials)
4588 (name "sundials-openmpi")
4591 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4592 ,@(package-inputs sundials)))
4594 (substitute-keyword-arguments (package-arguments sundials)
4595 ((#:configure-flags flags '())
4596 `(cons* "-DMPI_ENABLE:BOOL=ON"
4597 "-DPETSC_ENABLE:BOOL=ON"
4598 (string-append "-DPETSC_INCLUDE_DIR="
4599 (assoc-ref %build-inputs "petsc")
4601 (string-append "-DPETSC_LIBRARY_DIR="
4602 (assoc-ref %build-inputs "petsc")
4605 ((#:phases phases '%standard-phases)
4606 `(modify-phases ,phases
4607 (add-before 'check 'mpi-setup
4608 ,%openmpi-setup)))))
4609 (synopsis "SUNDIALS with OpenMPI support")))
4611 (define-public combinatorial-blas
4613 (name "combinatorial-blas")
4618 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4620 (match (string-split version #\.)
4621 ((major minor patch)
4622 (string-append major minor "_" patch))) ;e.g. "16_2"
4626 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4627 (patches (search-patches "combinatorial-blas-awpm.patch"
4628 "combinatorial-blas-io-fix.patch"))))
4629 (build-system cmake-build-system)
4632 ("test-data" ,(origin
4634 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4635 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4638 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4640 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4641 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4642 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4644 (modify-phases %standard-phases
4645 (add-before 'check 'mpi-setup
4647 (add-before 'check 'test-setup
4648 (lambda* (#:key inputs #:allow-other-keys)
4649 (setenv "OMP_NUM_THREADS" "2")
4650 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4651 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4652 (synopsis "Linear algebra primitives for graph analytics")
4653 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4654 distributed-memory parallel graph library offering a small but powerful set of
4655 linear algebra primitives specifically targeting graph analytics.")
4657 license:gpl2+ ;include/psort/(funnel|sort)*.h
4658 license:x11 ;usort and psort
4659 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4661 (define-public dune-common
4663 (name "dune-common")
4668 (uri (string-append "https://dune-project.org/download/"
4669 version "/dune-common-" version ".tar.gz"))
4672 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4673 (build-system cmake-build-system)
4676 (modify-phases %standard-phases
4677 (add-after 'build 'build-tests
4678 (lambda* (#:key make-flags #:allow-other-keys)
4679 (apply invoke "make" "build_tests" make-flags))))))
4683 ("openblas" ,openblas)
4685 ("superlu" ,superlu)))
4687 `(("gfortran" ,gfortran)
4688 ("pkg-config" ,pkg-config)))
4689 (home-page "https://dune-project.org/")
4690 (synopsis "Distributed and Unified Numerics Environment")
4691 (description "DUNE, the Distributed and Unified Numerics Environment is a
4692 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4693 grid-based methods. It supports the easy implementation of methods like
4694 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4695 Differences} (FD).")
4696 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4697 (license license:gpl2)))
4699 (define-public dune-geometry
4701 (name "dune-geometry")
4706 (uri (string-append "https://dune-project.org/download/"
4707 version "/dune-geometry-" version ".tar.gz"))
4710 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4711 (build-system cmake-build-system)
4714 (modify-phases %standard-phases
4715 (add-after 'build 'build-tests
4716 (lambda* (#:key make-flags #:allow-other-keys)
4717 (apply invoke "make" "build_tests" make-flags))))))
4719 `(("dune-common" ,dune-common)
4721 ("openblas" ,openblas)
4723 ("python" ,python)))
4725 `(("gfortran" ,gfortran)
4726 ("pkg-config" ,pkg-config)))
4727 (home-page "https://dune-project.org/")
4728 (synopsis "Distributed and Unified Numerics Environment")
4729 (description "DUNE, the Distributed and Unified Numerics Environment is a
4730 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4731 grid-based methods. It supports the easy implementation of methods like
4732 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4735 This package contains the basic DUNE geometry classes.")
4736 ;; GPL version 2 with "runtime exception"
4737 (license license:gpl2)))
4739 (define-public dune-uggrid
4741 (name "dune-uggrid")
4746 (uri (string-append "https://dune-project.org/download/"
4747 version "/dune-uggrid-" version ".tar.gz"))
4750 "05l7a1gb78mny49anyxk6rjvn66rhgm30y72v5cjg0m5kfgr1a1f"))))
4751 (build-system cmake-build-system)
4754 (modify-phases %standard-phases
4755 (add-after 'build 'build-tests
4756 (lambda* (#:key make-flags #:allow-other-keys)
4757 (apply invoke "make" "build_tests" make-flags))))))
4759 `(("dune-common" ,dune-common)))
4761 `(("gfortran" ,gfortran)
4762 ("pkg-config" ,pkg-config)))
4763 (home-page "https://dune-project.org/")
4764 (synopsis "Distributed and Unified Numerics Environment")
4765 (description "DUNE, the Distributed and Unified Numerics Environment is a
4766 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4767 grid-based methods. It supports the easy implementation of methods like
4768 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4771 This package contains the DUNE UG grid classes.")
4772 (license license:lgpl2.1)))
4774 (define-public dune-grid
4781 (uri (string-append "https://dune-project.org/download/"
4782 version "/dune-grid-" version ".tar.gz"))
4785 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4786 (build-system cmake-build-system)
4789 (modify-phases %standard-phases
4790 (add-after 'build 'build-tests
4791 (lambda* (#:key make-flags #:allow-other-keys)
4792 (apply invoke "make" "build_tests" make-flags))))))
4794 `(("dune-common" ,dune-common)
4795 ("dune-geometry" ,dune-geometry)
4798 ("openblas" ,openblas)
4799 ("python" ,python)))
4801 `(("dune-uggrid" ,dune-uggrid)))
4803 `(("gfortran" ,gfortran)
4804 ("pkg-config" ,pkg-config)))
4805 (home-page "https://dune-project.org/")
4806 (synopsis "Distributed and Unified Numerics Environment")
4807 (description "DUNE, the Distributed and Unified Numerics Environment is a
4808 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4809 grid-based methods. It supports the easy implementation of methods like
4810 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4813 This package contains the basic DUNE grid classes.")
4814 ;; GPL version 2 with "runtime exception"
4815 (license license:gpl2)))
4817 (define-public dune-istl
4824 (uri (string-append "https://dune-project.org/download/"
4825 version "/dune-istl-" version ".tar.gz"))
4828 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4829 (build-system cmake-build-system)
4832 (modify-phases %standard-phases
4833 (add-after 'build 'build-tests
4834 (lambda* (#:key make-flags #:allow-other-keys)
4835 (apply invoke "make" "build_tests" make-flags))))))
4837 `(("dune-common" ,dune-common)
4840 ("suitesparse" ,suitesparse)
4841 ("superlu" ,superlu)
4842 ("openblas" ,openblas)
4844 ("python" ,python)))
4846 `(("gfortran" ,gfortran)
4847 ("pkg-config" ,pkg-config)))
4848 (home-page "https://dune-project.org/")
4849 (synopsis "Distributed and Unified Numerics Environment")
4850 (description "DUNE, the Distributed and Unified Numerics Environment is a
4851 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4854 This is the iterative solver template library which provides generic sparse
4855 matrix/vector classes and a variety of solvers based on these classes. A
4856 special feature is the use of templates to exploit the recursive block
4857 structure of finite element matrices at compile time. Available solvers
4858 include Krylov methods, (block-) incomplete decompositions and
4859 aggregation-based algebraic multigrid.")
4860 ;; GPL version 2 with "runtime exception"
4861 (license license:gpl2)))
4863 (define-public dune-localfunctions
4865 (name "dune-localfunctions")
4870 (uri (string-append "https://dune-project.org/download/"
4871 version "/dune-localfunctions-" version ".tar.gz"))
4874 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4875 (build-system cmake-build-system)
4878 (modify-phases %standard-phases
4879 (add-after 'build 'build-tests
4880 (lambda* (#:key make-flags #:allow-other-keys)
4881 (apply invoke "make" "build_tests" make-flags))))))
4883 `(("dune-common" ,dune-common)
4884 ("dune-geometry" ,dune-geometry)
4887 ("superlu" ,superlu)
4890 `(("gfortran" ,gfortran)
4891 ("pkg-config" ,pkg-config)))
4892 (home-page "https://dune-project.org/")
4893 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4894 (description "This DUNE module provides interface and implementation for
4895 shape functions defined on the DUNE reference elements. In addition to the
4896 shape function, interpolation operators and special keys are provided which
4897 can be used to assemble global function spaces on finite-element grids.
4899 This package provides an interface and implementation for shape functions
4900 defined on the DUNE reference elements. In addition to the shape function,
4901 interpolation operators and special keys are provided which can be used to
4902 assemble global function spaces on finite-element grids.")
4903 ;; GPL version 2 with "runtime exception"
4904 (license license:gpl2)))
4906 (define-public dune-alugrid
4908 (name "dune-alugrid")
4913 (uri (string-append "https://dune-project.org/download/"
4914 version "/dune-alugrid-" version ".tar.gz"))
4917 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4918 (build-system cmake-build-system)
4921 (modify-phases %standard-phases
4922 (add-after 'unpack 'patch-include
4924 (substitute* "dune/alugrid/test/test-alugrid.cc"
4925 (("doc/grids/gridfactory/testgrids")
4926 "doc/dune-grid/grids/gridfactory/testgrids"))
4928 (add-after 'build 'build-tests
4929 (lambda* (#:key inputs make-flags #:allow-other-keys)
4930 (setenv "CPLUS_INCLUDE_PATH"
4931 (string-append (assoc-ref inputs "dune-grid") "/share"))
4932 (apply invoke "make" "build_tests" make-flags))))))
4934 `(("dune-common" ,dune-common)
4935 ("dune-geometry" ,dune-geometry)
4936 ("dune-grid" ,dune-grid)
4939 ("openblas" ,openblas)
4941 ("superlu" ,superlu)
4945 `(("gfortran" ,gfortran)
4946 ("pkg-config" ,pkg-config)))
4947 (home-page "https://dune-project.org/")
4948 (synopsis "Distributed and Unified Numerics Environment")
4949 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4950 implementation of the DUNE grid interface supporting either simplices or
4952 (license license:gpl2+)))
4954 (define-public dune-subgrid
4956 (name "dune-subgrid")
4962 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
4963 (commit "releases/2.6-1")))
4964 (file-name (git-file-name name version))
4967 "1gcv35rx3knqd54r4pp9rzd639db4j8w2r2ibq43w1mgwdcqhs64"))))
4968 (build-system cmake-build-system)
4971 (modify-phases %standard-phases
4972 (add-after 'build 'build-tests
4973 (lambda* (#:key make-flags #:allow-other-keys)
4974 (apply invoke "make" "build_tests" make-flags))))))
4976 `(("dune-common" ,dune-common)
4977 ("dune-geometry" ,dune-geometry)
4978 ("dune-grid" ,dune-grid)
4981 ("openblas" ,openblas)
4984 `(("gfortran" ,gfortran)
4985 ("pkg-config" ,pkg-config)))
4986 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
4987 (synopsis "Distributed and Unified Numerics Environment")
4988 (description "The dune-subgrid module marks elements of
4989 another hierarchical dune grid. The set of marked elements can then be
4990 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
4991 provides the full grid interface including adaptive mesh refinement.")
4992 (license license:gpl2+)))
4994 (define-public dune-typetree
4996 (name "dune-typetree")
5002 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5003 (commit (string-append "v" version))))
5004 (file-name (git-file-name name version))
5007 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
5008 (build-system cmake-build-system)
5011 (modify-phases %standard-phases
5012 (add-after 'build 'build-tests
5013 (lambda* (#:key make-flags #:allow-other-keys)
5014 (apply invoke "make" "build_tests" make-flags))))))
5016 `(("dune-common" ,dune-common)
5018 ("openblas" ,openblas)
5021 ("superlu" ,superlu)
5024 `(("gfortran" ,gfortran)
5025 ("pkg-config" ,pkg-config)))
5026 (home-page "https://dune-project.org/")
5027 (synopsis "Distributed and Unified Numerics Environment")
5028 (description "TypeTree is a template library for constructing and
5029 operating on statically typed trees of objects.")
5030 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5031 (license (list license:lgpl3+ license:gpl2))))
5033 (define-public dune-functions
5035 (name "dune-functions")
5041 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5042 (commit (string-append "v" version))))
5043 (file-name (git-file-name name version))
5046 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
5047 (build-system cmake-build-system)
5050 (modify-phases %standard-phases
5051 (add-after 'unpack 'disable-failing-tests
5054 ;; unable to load GMSH file in this test
5055 "--exclude-regex gridviewfunctionspacebasistest")
5057 (add-after 'build 'build-tests
5058 (lambda* (#:key make-flags #:allow-other-keys)
5059 (apply invoke "make" "build_tests" make-flags))))))
5061 `(("dune-common" ,dune-common)
5062 ("dune-istl" ,dune-istl)
5063 ("dune-localfunctions" ,dune-localfunctions)
5064 ("dune-grid" ,dune-grid)
5065 ("dune-geometry" ,dune-geometry)
5066 ("dune-typetree" ,dune-typetree)
5067 ("openblas" ,openblas)
5070 ("superlu" ,superlu)
5073 `(("gfortran" ,gfortran)
5074 ("pkg-config" ,pkg-config)))
5075 (home-page "https://dune-project.org/")
5076 (synopsis "Distributed and Unified Numerics Environment")
5077 (description "The dune-functions module provides an abstraction layer for
5078 global finite element functions. Its two main concepts are functions
5079 implemented as callable objects, and bases of finite element spaces.")
5080 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5081 (license (list license:lgpl3+ license:gpl2))))
5083 (define-public dune-pdelab
5085 (name "dune-pdelab")
5086 (version "2.6.0-rc1")
5091 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5092 (commit (string-append "v" version))))
5093 (file-name (git-file-name name version))
5096 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
5097 (build-system cmake-build-system)
5098 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5100 `(("dune-common" ,dune-common)
5101 ("dune-istl" ,dune-istl)
5102 ("dune-localfunctions" ,dune-localfunctions)
5103 ("dune-geometry" ,dune-geometry)
5104 ("dune-grid" ,dune-grid)
5105 ("dune-typetree" ,dune-typetree)
5106 ("dune-functions" ,dune-functions)
5108 ("openblas" ,openblas)
5112 ("superlu" ,superlu)
5115 `(("gfortran" ,gfortran)
5116 ("pkg-config" ,pkg-config)))
5117 (home-page "https://dune-project.org/")
5118 (synopsis "Differential equations solver toolbox")
5119 (description "PDELab is a partial differential equations solver toolbox
5120 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5121 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5122 (license (list license:lgpl3+ license:gpl2))))
5124 (define add-openmpi-to-dune-package
5125 (let ((dune-package?
5126 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5129 (if (dune-package? p)
5130 (package (inherit p)
5131 (name (string-append (package-name p) "-openmpi"))
5132 (inputs `(,@(package-inputs p)
5133 ("openmpi" ,openmpi)))
5135 (substitute-keyword-arguments (package-arguments p)
5136 ((#:phases phases '%standard-phases)
5137 `(modify-phases ,phases
5138 (add-before 'check 'mpi-setup
5139 ,%openmpi-setup)))))
5140 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5142 (negate dune-package?))))
5144 (define-public dune-common-openmpi
5145 (add-openmpi-to-dune-package dune-common))
5147 (define-public dune-geometry-openmpi
5148 (add-openmpi-to-dune-package dune-geometry))
5150 (define-public dune-istl-openmpi
5151 (add-openmpi-to-dune-package dune-istl))
5153 (define-public dune-typetree-openmpi
5154 (add-openmpi-to-dune-package dune-typetree))
5156 (define-public dune-uggrid-openmpi
5157 (add-openmpi-to-dune-package dune-uggrid))
5159 (define-public dune-grid-openmpi
5160 (add-openmpi-to-dune-package dune-grid))
5162 (define-public dune-alugrid-openmpi
5163 (add-openmpi-to-dune-package dune-alugrid))
5165 (define-public dune-subgrid-openmpi
5166 (add-openmpi-to-dune-package dune-subgrid))
5168 (define-public dune-localfunctions-openmpi
5169 (add-openmpi-to-dune-package dune-localfunctions))
5171 (define-public dune-functions-openmpi
5172 (add-openmpi-to-dune-package dune-functions))
5174 (define-public dune-pdelab-openmpi
5175 (add-openmpi-to-dune-package dune-pdelab))
5177 (define-public mlucas
5185 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5187 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5188 (build-system gnu-build-system)
5190 `(("python2" ,python-2)))
5192 `(#:tests? #f ; no tests
5194 (modify-phases %standard-phases
5198 (call-with-output-file "Makefile"
5200 (format port "CC = gcc
5201 CFLAGS = -O3 ~a -DUSE_THREADS
5202 LDLIBS = -lm -lpthread -lrt
5203 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5205 ,(let ((system (or (%current-target-system)
5206 (%current-system))))
5208 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5212 (lambda* (#:key outputs #:allow-other-keys)
5213 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5214 (install-file "Mlucas" bin)
5215 (install-file "primenet.py" bin))
5217 (home-page "https://www.mersenne.org")
5218 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5219 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5220 numbers in search of a world-record prime. You may use it to test any
5221 suitable number as you wish, but it is preferable that you do so in a
5222 coordinated fashion, as part of the Great Internet Mersenne Prime
5223 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5224 management via the GIMPS project's Primenet server.")
5225 (license license:gpl2+)))
5227 (define-public nauty
5234 "https://pallini.di.uniroma1.it/"
5235 "nauty" (string-join (string-split version #\.) "")
5239 "1p4mxf8q5wm47nxyskxbqwa5p1vvkycv1zgswvnk9nsn6vff0al6"))))
5240 (build-system gnu-build-system)
5241 (outputs '("out" "lib"))
5243 `(#:test-target "checks"
5245 (modify-phases %standard-phases
5246 ;; Default make target does not build all available
5247 ;; executables. Create them now.
5248 (add-after 'build 'build-extra-programs
5250 (for-each (lambda (target) (invoke "make" target))
5251 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5253 ;; Upstream does not provide any install target.
5255 (lambda* (#:key outputs #:allow-other-keys)
5256 (let* ((out (assoc-ref outputs "out"))
5257 (lib-output (assoc-ref outputs "lib"))
5258 (bin (string-append out "/bin"))
5259 (doc (string-append out "/share/doc/nauty/"))
5260 (include (string-append lib-output "/include/nauty"))
5261 (lib (string-append lib-output "/lib/nauty")))
5262 (for-each (lambda (f) (install-file f bin))
5263 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5264 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5265 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5266 "delptg" "directg" "dretodot" "dretog" "genbg"
5267 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5268 "gentourng" "gentreeg" "hamheuristic" "labelg"
5269 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5270 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5271 "sumlines" "twohamg" "vcolg" "watercluster2"))
5272 (for-each (lambda (f) (install-file f include))
5273 (find-files "." "\\.h$"))
5274 (for-each (lambda (f) (install-file f lib))
5275 (find-files "." "\\.a$"))
5276 (for-each (lambda (f) (install-file f doc))
5277 (append '("formats.txt" "README" "schreier.txt")
5278 (find-files "." "\\.pdf$")))))))))
5280 `(("gmp" ,gmp))) ;for sumlines
5281 (home-page "https://pallini.di.uniroma1.it/")
5282 (synopsis "Library for graph automorphisms")
5283 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5284 procedures for computing automorphism groups of graphs and digraphs.
5286 @code{nauty} computes graph information in the form of a set of
5287 generators, the size of the group, and the orbits of the group; it can
5288 also produce a canonical label. The @code{nauty} suite is written in
5289 C and comes with a command-line interface, a collection of
5290 command-line tools, and an Application Programming Interface (API).
5292 This package provides the static libraries required to run programs
5293 compiled against the nauty library.")
5294 (license license:asl2.0)))
5303 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5304 "ftp/releases/" version
5305 "/ppl-" version ".tar.gz"))
5308 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5309 (build-system gnu-build-system)
5315 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5317 "Parma Polyhedra Library for computations with polyhedra")
5319 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5320 especially targeted at applications in the field of analysis and
5321 verification of complex systems. These abstractions include convex
5322 polyhedra, defined as the intersection of a finite number of (open or
5323 closed) halfspaces, each described by a linear inequality (strict or
5324 non-strict) with rational coefficients; some special classes of polyhedra
5325 shapes that offer interesting complexity/precision tradeoffs; and grids
5326 which represent regularly spaced points that satisfy a set of linear
5327 congruence relations. The library also supports finite powersets and
5328 products of (any kind of) polyhedra and grids, a mixed integer linear
5329 programming problem solver using an exact-arithmetic version of the simplex
5330 algorithm, a parametric integer programming solver, and primitives for
5331 termination analysis via the automatic synthesis of linear ranking
5333 (license license:gpl3+)))
5335 (define-public speedcrunch
5337 (name "speedcrunch")
5343 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5344 (commit (string-append "release-" version))))
5345 (file-name (git-file-name name version))
5348 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5349 (build-system cmake-build-system)
5350 (inputs `(("qtbase" ,qtbase)))
5351 (native-inputs `(("qttools" ,qttools)))
5354 (modify-phases %standard-phases
5355 (add-after 'unpack 'chdir-to-src
5356 (lambda _ (chdir "src") #t)))))
5357 (synopsis "High-precision scientific calculator")
5359 "SpeedCrunch is a high-precision scientific calculator. It features a
5360 syntax-highlighted scrollable display and is designed to be fully used via
5361 keyboard. Some distinctive features are auto-completion of functions and
5362 variables, a formula book, and quick insertion of constants from various
5363 fields of knowledge.")
5364 (home-page "https://speedcrunch.org/")
5365 (license license:gpl2+)))
5367 (define-public minisat
5368 ;; This is the last commit which is available upstream, no
5369 ;; release happened since 2010.
5370 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5374 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5379 (url "https://github.com/niklasso/minisat.git")
5381 (file-name (string-append name "-" version "-checkout"))
5384 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5386 (search-patches "minisat-friend-declaration.patch"
5387 "minisat-install.patch"))))
5388 (build-system gnu-build-system)
5390 '(#:make-flags (list (string-append "prefix=" %output))
5391 #:tests? #f ;no check target
5393 (modify-phases %standard-phases
5394 (delete 'configure))))
5396 `(("zlib:static" ,zlib "static")
5399 "Small, yet efficient, SAT solver")
5401 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5402 researchers and developers alike to get started on SAT.")
5404 "http://minisat.se/MiniSat.html")
5405 (license license:expat))))
5407 (define-public libqalculate
5409 (name "libqalculate")
5415 (url "https://github.com/Qalculate/libqalculate/")
5416 (commit (string-append "v" version))))
5417 (file-name (git-file-name name version))
5419 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5421 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5422 (build-system gnu-build-system)
5424 `(("pkg-config" ,pkg-config)
5425 ("gettext" ,gettext-minimal)
5426 ("intltool" ,intltool)
5427 ("automake" ,automake)
5428 ("autoconf" ,autoconf)
5429 ("libtool" ,libtool)
5430 ("doxygen" ,doxygen)
5435 ("libxml2" ,libxml2)
5438 ("gnuplot" ,gnuplot)
5439 ("readline" ,readline)
5440 ("libiconv" ,libiconv)))
5443 (modify-phases %standard-phases
5444 (add-before 'bootstrap 'setenv
5445 ;; Prevent the autogen.sh script to carry out the configure
5446 ;; script, which has not yet been patched to replace /bin/sh.
5448 (setenv "NOCONFIGURE" "TRUE")
5450 (home-page "https://qalculate.github.io/")
5451 (synopsis "Multi-purpose cli desktop calculator and library")
5453 "Libqalculate is a multi-purpose cli desktop calculator and library.
5454 It provides basic and advanced functionality. Features include customizable
5455 functions, unit calculations, and conversions, physical constants, symbolic
5456 calculations (including integrals and equations), arbitrary precision,
5457 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5459 (license license:gpl2+)))
5461 (define-public qalculate-gtk
5463 (name "qalculate-gtk")
5469 (url "https://github.com/Qalculate/qalculate-gtk/")
5470 (commit (string-append "v" version))))
5471 (file-name (git-file-name name version))
5473 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5474 (build-system glib-or-gtk-build-system)
5476 `(("pkg-config" ,pkg-config)
5477 ("intltool" ,intltool)
5478 ("automake" ,automake)
5479 ("autoconf" ,autoconf)
5480 ("libtool" ,libtool)
5485 ("libqalculate" ,libqalculate)
5486 ("libxml2" ,libxml2)
5491 (modify-phases %standard-phases
5492 (add-before 'bootstrap 'setenv
5493 ;; Prevent the autogen.sh script to carry out the configure
5494 ;; script, which has not yet been patched to replace /bin/sh.
5496 (setenv "NOCONFIGURE" "TRUE")
5498 (add-before 'check 'add-pot-file
5499 ;; the file contains translations and are currently not in use
5500 ;; left out on purpose so add it to POTFILES.skip
5502 (with-output-to-file "po/POTFILES.skip"
5504 (format #t "data/shortcuts.ui~%")
5507 (home-page "https://qalculate.github.io/")
5508 (synopsis "Multi-purpose graphical desktop calculator")
5510 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5511 multi-purpose GUI desktop calculator. It provides basic and advanced
5512 functionality. Features include customizable functions, unit calculations,
5513 and conversions, physical constants, symbolic calculations (including
5514 integrals and equations), arbitrary precision, uncertainity propagation,
5515 interval arithmetic, plotting.")
5516 (license license:gpl2+)))