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, 2021 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, 2020 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, 2020, 2021 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, 2020, 2021 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 Nikita <nikita@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, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020 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, 2020 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, 2021 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, 2021 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>
41 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
42 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
43 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
44 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
45 ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
46 ;;; Copyright © 2021 Franck Pérignon <franck.perignon@univ-grenoble-alpes.fr>
47 ;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
49 ;;; This file is part of GNU Guix.
51 ;;; GNU Guix is free software; you can redistribute it and/or modify it
52 ;;; under the terms of the GNU General Public License as published by
53 ;;; the Free Software Foundation; either version 3 of the License, or (at
54 ;;; your option) any later version.
56 ;;; GNU Guix is distributed in the hope that it will be useful, but
57 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
58 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59 ;;; GNU General Public License for more details.
61 ;;; You should have received a copy of the GNU General Public License
62 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
64 (define-module (gnu packages maths)
65 #:use-module (ice-9 regex)
66 #:use-module (ice-9 match)
67 #:use-module (gnu packages)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix git-download)
72 #:use-module (guix utils)
73 #:use-module ((guix build utils) #:select (alist-replace))
74 #:use-module (guix build-system cmake)
75 #:use-module (guix build-system glib-or-gtk)
76 #:use-module (guix build-system gnu)
77 #:use-module (guix build-system python)
78 #:use-module (guix build-system ruby)
79 #:use-module (gnu packages algebra)
80 #:use-module (gnu packages audio)
81 #:use-module (gnu packages autotools)
82 #:use-module (gnu packages base)
83 #:use-module (gnu packages bison)
84 #:use-module (gnu packages boost)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages cmake)
87 #:use-module (gnu packages compression)
88 #:use-module (gnu packages curl)
89 #:use-module (gnu packages cyrus-sasl)
90 #:use-module (gnu packages dbm)
91 #:use-module (gnu packages documentation)
92 #:use-module (gnu packages elf)
93 #:use-module (gnu packages file)
94 #:use-module (gnu packages flex)
95 #:use-module (gnu packages fltk)
96 #:use-module (gnu packages fontutils)
97 #:use-module (gnu packages gettext)
98 #:use-module (gnu packages gcc)
99 #:use-module (gnu packages gd)
100 #:use-module (gnu packages ghostscript)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages graphviz)
103 #:use-module (gnu packages gtk)
104 #:use-module (gnu packages icu4c)
105 #:use-module (gnu packages image)
106 #:use-module (gnu packages java)
107 #:use-module (gnu packages less)
108 #:use-module (gnu packages lisp)
109 #:use-module (gnu packages linux)
110 #:use-module (gnu packages llvm)
111 #:use-module (gnu packages logging)
112 #:use-module (gnu packages lua)
113 #:use-module (gnu packages gnome)
114 #:use-module (gnu packages guile)
115 #:use-module (gnu packages xorg)
116 #:use-module (gnu packages gl)
117 #:use-module (gnu packages imagemagick)
118 #:use-module (gnu packages m4)
119 #:use-module (gnu packages mpi)
120 #:use-module (gnu packages multiprecision)
121 #:use-module (gnu packages netpbm)
122 #:use-module (gnu packages onc-rpc)
123 #:use-module (gnu packages pcre)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages perl)
126 #:use-module (gnu packages pkg-config)
127 #:use-module (gnu packages pulseaudio)
128 #:use-module (gnu packages python)
129 #:use-module (gnu packages python-web)
130 #:use-module (gnu packages python-xyz)
131 #:use-module (gnu packages qt)
132 #:use-module (gnu packages readline)
133 #:use-module (gnu packages ruby)
134 #:use-module (gnu packages tbb)
135 #:use-module (gnu packages scheme)
136 #:use-module (gnu packages shells)
137 #:use-module (gnu packages tcl)
138 #:use-module (gnu packages texinfo)
139 #:use-module (gnu packages tex)
140 #:use-module (gnu packages tls)
141 #:use-module (gnu packages version-control)
142 #:use-module (gnu packages wxwidgets)
143 #:use-module (gnu packages xml)
144 #:use-module (srfi srfi-1)
145 #:use-module (srfi srfi-26))
153 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
155 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
156 (build-system gnu-build-system)
157 (inputs `(("gtk+" ,gtk+)
158 ("libxml2" ,libxml2)))
159 (native-inputs `(("pkg-config" ,pkg-config)))
160 (synopsis "Natural deduction first-order logic interface")
161 (description "Aris is a program for performing logical proofs. It supports
162 propositional and predicate logic, as well as Boolean algebra and
163 arithmetical logic. In addition to its predefined inference and equivalence
164 rules, Aris also supports references to older proofs. Its use of standard
165 logical symbols and its natural deduction interface make it easy to use for
167 (license license:gpl3+)
168 (home-page "https://www.gnu.org/software/aris/")))
170 (define-public c-graph
176 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
179 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
180 (build-system gnu-build-system)
182 `(("fortran" ,gfortran)))
183 (synopsis "Visualizing and demonstrating convolution")
185 "GNU C-Graph is a tool for demonstrating the theory of convolution.
186 Thus, it can serve as an excellent aid to students of signal and systems
187 theory in visualizing the convolution process. Rather than forcing the
188 student to write code, the program offers an intuitive interface with
189 interactive dialogs to guide them.")
190 (license license:gpl3+)
191 (home-page "https://www.gnu.org/software/c-graph/")))
200 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
201 version "/coda-" version ".tar.gz"))
203 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
204 (patches (search-patches "coda-use-system-libs.patch"))
205 (modules '((guix build utils)))
207 ;; Make sure we don't use the bundled software.
209 (for-each (lambda (d)
210 (delete-file-recursively (string-append "libcoda/" d)))
211 '("zlib" "pcre" "expat"))
214 `(("fortran" ,gfortran)
216 ("python-numpy" ,python-numpy)))
223 (build-system gnu-build-system)
225 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
226 "LIBS= -lz -lpcre -lexpat")))
227 (synopsis "A common interface to various earth observation data formats")
229 "The Common Data Access toolbox (CODA) provides a set of interfaces for
230 reading remote sensing data from earth observation data files. It consists of
231 command line applications and interfaces to the C, Fortran, Python, and Java
232 programming languages.")
233 (home-page "https://stcorp.nl/coda")
234 (license license:gpl2+)))
242 (uri (string-append "http://www.qhull.org/download/qhull-"
243 (car (string-split version #\.))
247 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
248 (build-system cmake-build-system)
249 (synopsis "Calculate convex hulls and related structures")
251 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
252 diagram, halfspace intersection about a point, furthest-site Delaunay
253 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
254 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
255 algorithm for computing the convex hull. It handles roundoff errors from
256 floating point arithmetic. It computes volumes, surface areas, and
257 approximations to the convex hull.
259 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
260 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
261 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
263 (home-page "http://qhull.org")
264 (license (license:non-copyleft "file://COPYING.txt"
265 "See COPYING in the distribution."))))
267 (define-public python-cvxopt
269 (name "python-cvxopt")
274 (url "https://github.com/cvxopt/cvxopt")
276 (file-name (git-file-name name version))
279 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
280 (build-system python-build-system)
283 (modify-phases %standard-phases
284 (add-after 'unpack 'find-libraries
285 (lambda* (#:key inputs #:allow-other-keys)
286 (setenv "CVXOPT_BLAS_LIB" "openblas")
287 (setenv "CVXOPT_BUILD_FFTW" "1")
288 (setenv "CVXOPT_BUILD_GLPK" "1")
289 (setenv "CVXOPT_BUILD_GSL" "1")
296 ("openblas" ,openblas)
297 ("suitesparse" ,suitesparse)))
298 (home-page "https://www.cvxopt.org")
299 (synopsis "Python library for convex optimization")
301 "CVXOPT is a package for convex optimization based on the Python
302 programming language. Its main purpose is to make the development of software
303 for convex optimization applications straightforward by building on Python’s
304 extensive standard library and on the strengths of Python as a high-level
305 programming language.")
306 (license license:gpl3+)))
308 (define-public python2-cvxopt
309 (package-with-python2 python-cvxopt))
317 (uri (string-append "mirror://gnu/units/units-" version
320 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
321 (build-system gnu-build-system)
323 `(("readline" ,readline)
324 ("python" ,python-wrapper) ;for 'units_cur' script
325 ("python-requests" ,python-requests)))
327 `(#:phases (modify-phases %standard-phases
328 (add-after 'install 'wrap-units_cur
329 (lambda* (#:key outputs #:allow-other-keys)
330 (let* ((out (assoc-ref outputs "out"))
331 (bin (string-append out "/bin")))
332 (wrap-program (string-append bin "/units_cur")
333 `("PYTHONPATH" ":" prefix
334 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
336 (synopsis "Conversion between thousands of scales")
338 "GNU Units converts numeric quantities between units of measure. It
339 can handle scale changes through adaptive usage of standard scale
340 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
341 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
342 enough to be used effectively as a scientific calculator.")
343 (license license:gpl3+)
344 (home-page "https://www.gnu.org/software/units/")))
346 (define-public double-conversion
348 (name "double-conversion")
350 (home-page "https://github.com/google/double-conversion")
353 (uri (git-reference (url home-page)
354 (commit (string-append "v" version))))
355 (file-name (git-file-name name version))
358 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
359 (build-system cmake-build-system)
361 '(#:test-target "test"
362 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
363 "-DBUILD_TESTING=ON")))
364 (synopsis "Conversion routines for IEEE doubles")
366 "The double-conversion library provides binary-decimal and decimal-binary
367 routines for IEEE doubles. The library consists of efficient conversion
368 routines that have been extracted from the V8 JavaScript engine.")
369 (license license:bsd-3)))
371 (define-public dionysus
377 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
381 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
382 (build-system gnu-build-system)
383 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
384 (synopsis "Local search for universal constants and scientific values")
386 "GNU Dionysus is a convenient system for quickly retrieving the values of
387 mathematical constants used in science and engineering. Values can be
388 searched using a simple command-line tool, choosing from three databases:
389 universal constants, atomic numbers, and constants related to
391 (license license:gpl3+)
392 (home-page "https://www.gnu.org/software/dionysus/")))
403 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
404 "dSFMT-src-" version ".tar.gz"))
407 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
408 (modules '((guix build utils)))
409 ;; Don't distribute html documentation with bundled jquery.
412 (delete-file-recursively "html") #t))
413 ;; Add patches borrowed from Julia.
419 "https://raw.githubusercontent.com/JuliaLang/julia/"
420 "v1.3.0/deps/patches/dSFMT.c.patch"))
422 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
423 (file-name "dSFMT.c.patch"))
427 "https://raw.githubusercontent.com/JuliaLang/julia/"
428 "v1.3.0/deps/patches/dSFMT.h.patch"))
430 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
431 (file-name "dSFMT.h.patch"))))))
432 (build-system gnu-build-system)
435 (modify-phases %standard-phases
436 (delete 'configure) ; no configure script
438 ;; Upstream Makefile does not build a shared library. Borrow from Julia
439 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
442 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
443 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
444 "-O3" "-finline-functions" "-fomit-frame-pointer"
445 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
446 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
447 "-o" "libdSFMT.so")))
448 (replace 'install ; no "install" target
449 (lambda* (#:key outputs #:allow-other-keys)
450 (let* ((out (assoc-ref outputs "out"))
451 (lib (string-append out "/lib"))
452 (inc (string-append out "/include"))
453 (doc (string-append out "/share/doc/" ,name "-" ,version)))
454 (install-file "libdSFMT.so" lib)
455 (install-file "dSFMT.h" inc)
456 (install-file "LICENSE.txt" doc)
458 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
460 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
461 the expensive conversion of integer to double (floating point). dSFMT directly
462 generates double precision floating point pseudorandom numbers which have the
463 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
464 format. dSFMT is only available on the CPUs which use IEEE 754 format double
465 precision floating point numbers.")
466 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
467 (license license:bsd-3)))
475 (uri (string-append "mirror://gnu/gsl/gsl-"
479 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
480 (build-system gnu-build-system)
482 (let ((system (%current-system)))
484 ((or (string-prefix? "aarch64" system)
485 (string-prefix? "powerpc" system))
486 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
487 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
488 '(#:phases (modify-phases %standard-phases
489 (add-before 'check 'disable-failing-tests
491 (substitute* "spmatrix/test.c"
492 ((".*test_complex.*") "\n"))
494 ((string-prefix? "i686" system)
495 ;; There are rounding issues with these tests on i686:
496 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
497 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
498 '(#:phases (modify-phases %standard-phases
499 (add-before 'check 'disable-failing-tests
501 (substitute* "linalg/test.c"
502 ((".*gsl_test\\(test_LU_decomp.*") "\n")
503 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
504 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
505 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
506 (substitute* "spmatrix/test.c"
507 ((".*test_all.*") "\n")
508 ((".*test_float.*") "\n")
509 ((".*test_complex.*") "\n"))
512 (home-page "https://www.gnu.org/software/gsl/")
513 (synopsis "Numerical library for C and C++")
515 "The GNU Scientific Library is a library for numerical analysis in C
516 and C++. It includes a wide range of mathematical routines, with over 1000
517 functions in total. Subject areas covered by the library include:
518 differential equations, linear algebra, Fast Fourier Transforms and random
520 (license license:gpl3+)))
530 (url "https://github.com/shibatch/sleef")
532 (file-name (git-file-name name version))
534 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
535 (build-system cmake-build-system)
537 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
538 (string-append "-DCMAKE_INSTALL_LIBDIR="
539 (assoc-ref %outputs "out")
541 (string-append "-DCMAKE_INSTALL_PREFIX="
542 (assoc-ref %outputs "out")))
544 (modify-phases %standard-phases
545 ;; SLEEF generates a header library during the build process and writes
546 ;; to it via shell redirection. Make the checkout writable so the
547 ;; build can succeed.
548 (add-after 'unpack 'make-git-checkout-writable
550 (for-each make-file-writable (find-files "."))
556 ("openssl" ,openssl)))
557 (home-page "https://sleef.org/")
558 (synopsis "SIMD library for evaluating elementary functions and DFT")
560 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
561 implements vectorized versions of all C99 real floating point math functions.
562 It can utilize SIMD instructions that are available on modern processors.")
563 (license (list license:boost1.0 ;sleef
564 license:cc-by4.0)))) ;simplex algorithm
573 (uri (string-append "mirror://gnu/glpk/glpk-"
577 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
578 (build-system gnu-build-system)
582 `(#:configure-flags '("--with-gmp"
583 "--disable-static")))
584 (home-page "https://www.gnu.org/software/glpk/")
585 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
587 "GLPK is a C library for solving large-scale linear programming (LP),
588 mixed integer programming (MIP), and other related problems. It supports the
589 GNU MathProg modeling language, a subset of the AMPL language, and features a
590 translator for the language. In addition to the C library, a stand-alone
591 LP/MIP solver is included in the package.")
592 (license license:gpl3+)))
594 (define-public glpk-4
602 (uri (string-append "mirror://gnu/glpk/glpk-"
606 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
615 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
617 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
619 "/4ti2-" version ".tar.gz"))
621 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
622 (build-system gnu-build-system)
624 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
628 (home-page "http://www.4ti2.de/")
629 (synopsis "Mathematical tool suite for problems on linear spaces")
631 "4ti2 implements algorithms for solving algebraic, geometric and
632 combinatorial problems on linear spaces. Among others, it solves systems
633 of linear equations, computes extreme rays of polyhedral cones, solves
634 integer programming problems and computes Markov bases for statistics.")
635 (license license:gpl2+)))
637 (define-public cddlib
644 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
645 (string-delete #\. version) ".tar.gz"))
648 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
649 (build-system gnu-build-system)
652 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
653 (synopsis "Library for convex hulls and extreme rays of polyhedra")
655 "The C-library cddlib implements the Double Description Method of
656 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
657 rays of a general convex polyhedron given by a system of linear inequalities
658 in arbitrary dimension. It can also be used for the converse operation of
659 computing convex hulls.")
660 (license license:gpl2+)))
662 (define-public lrslib
669 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
671 (string-delete #\. version) ".tar.gz"))
674 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
675 (build-system gnu-build-system)
679 `(#:tests? #f ; no check phase
680 #:make-flags `("CC=gcc"
681 ,(string-append "prefix=" (assoc-ref %outputs "out"))
684 (modify-phases %standard-phases
687 (substitute* "makefile"
688 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
690 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
691 (synopsis "Convex hulls of polyhedra with exact arithmetic")
693 "The C code of lrslib implements the reverse search algorithm for
694 vertex enumeration and convex hull problems. Its input file format is
695 compatible with cddlib. All computations are done exactly in either
696 multiple precision or fixed integer arithmetic. Output is not stored
697 in memory, so even problems with very large output sizes can sometimes
699 (license license:gpl2+)))
708 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
709 "vinci/vinci-" version ".tar.gz"))
712 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
713 (build-system gnu-build-system)
715 `(("lrslib" ,lrslib)))
717 `(#:tests? #f ; no check phase
719 (modify-phases %standard-phases
721 ;; register the lrs location in the config file
722 (lambda* (#:key inputs #:allow-other-keys)
723 (let* ((lrs (assoc-ref inputs "lrslib"))
724 (lrsexec (string-append lrs "/bin/lrs")))
725 (substitute* "vinci.h"
726 (("#define LRS_EXEC \"lrs\"")
727 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
730 (lambda* (#:key outputs #:allow-other-keys)
731 (let* ((out (assoc-ref outputs "out"))
732 (bin (string-append out "/bin")))
733 (install-file "vinci" bin))
736 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
737 (synopsis "Volume computation for polytopes")
739 "Vinci implements a number of volume computation algorithms for convex
740 polytopes in arbitrary dimension. The polytopes can be given by their
741 V-representation (as the convex hull of a finite number of vertices), by
742 their H-representation (as the bounded intersection of a finite number of
743 halfspaces) or by their double description with both representations.")
744 (license license:gpl2+)))
746 (define-public arpack-ng
750 (home-page "https://github.com/opencollab/arpack-ng")
753 (uri (git-reference (url home-page) (commit version)))
754 (file-name (git-file-name name version))
757 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
758 (build-system gnu-build-system)
760 `(("autoconf" ,autoconf)
761 ("automake" ,automake)
762 ("libtool" ,libtool)))
765 ("fortran" ,gfortran)))
766 (synopsis "Fortran subroutines for solving eigenvalue problems")
768 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
769 large scale eigenvalue problems.")
770 (license (license:non-copyleft "file://COPYING"
771 "See COPYING in the distribution."))))
773 (define-public arpack-ng-3.3.0
777 (name (package-name arpack-ng))
778 (home-page (package-home-page arpack-ng))
782 (uri (string-append home-page "/archive/" version ".tar.gz"))
783 (file-name (string-append name "-" version ".tar.gz"))
786 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
788 (define-public arpack-ng-openmpi
789 (package (inherit arpack-ng)
790 (name "arpack-ng-openmpi")
793 ,@(package-inputs arpack-ng)))
795 (substitute-keyword-arguments (package-arguments arpack-ng)
796 ((#:configure-flags _ '())
798 ((#:phases phases '%standard-phases)
799 `(modify-phases ,phases
800 (add-before 'check 'mpi-setup
802 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
804 (define-public lapack
811 (uri (string-append "http://www.netlib.org/lapack/lapack-"
815 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
816 (build-system cmake-build-system)
817 (home-page "http://www.netlib.org/lapack/")
818 (inputs `(("fortran" ,gfortran)
819 ("python" ,python-wrapper)))
821 `(#:configure-flags (list
822 "-DBUILD_SHARED_LIBS:BOOL=YES"
824 ;; Build the 'LAPACKE_clatms' functions.
825 "-DLAPACKE_WITH_TMG=ON"
826 "-DBUILD_TESTING=ON")))
827 (synopsis "Library for numerical linear algebra")
829 "LAPACK is a Fortran 90 library for solving the most commonly occurring
830 problems in numerical linear algebra.")
831 (license (license:non-copyleft "file://LICENSE"
832 "See LICENSE in the distribution."))))
834 (define-public clapack
841 (uri (string-append "http://www.netlib.org/clapack/clapack-"
842 version "-CMAKE.tgz"))
845 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
846 (build-system cmake-build-system)
849 (modify-phases %standard-phases
850 ;; These tests use a lot of stack variables and segfault without
851 ;; lifting resource limits.
852 (add-after 'unpack 'disable-broken-tests
854 (substitute* "TESTING/CMakeLists.txt"
855 (("add_lapack_test.* xeigtstz\\)") ""))
858 (lambda* (#:key outputs #:allow-other-keys)
859 (let* ((out (assoc-ref outputs "out"))
860 (libdir (string-append out "/lib"))
861 (f2cinc (string-append out "/include/libf2c")))
864 (for-each (lambda (file)
865 (install-file file libdir))
867 "F2CLIBS/libf2c/libf2c.a"
868 "TESTING/MATGEN/libtmglib.a"
869 "BLAS/SRC/libblas.a"))
870 (for-each (lambda (file)
871 (install-file file f2cinc))
872 (cons "F2CLIBS/libf2c/arith.h"
873 (find-files (string-append "../clapack-"
874 ,version "-CMAKE/F2CLIBS/libf2c")
876 (copy-recursively (string-append "../clapack-"
877 ,version "-CMAKE/INCLUDE")
878 (string-append out "/include"))
880 (home-page "https://www.netlib.org/clapack/")
881 (synopsis "Numerical linear algebra library for C")
883 "The CLAPACK library was built using a Fortran to C conversion utility
884 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
885 C code, and then modified to improve readability. CLAPACK's goal is to
886 provide LAPACK for someone who does not have access to a Fortran compiler.")
887 (license (license:non-copyleft "file://LICENSE"
888 "See LICENSE in the distribution."))))
890 (define-public scalapack
897 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
901 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
902 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
903 (build-system cmake-build-system)
906 ("fortran" ,gfortran)
907 ("lapack" ,lapack))) ;for testing only
909 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
910 #:phases (modify-phases %standard-phases
911 (add-before 'check 'mpi-setup
913 (home-page "http://www.netlib.org/scalapack/")
914 (synopsis "Library for scalable numerical linear algebra")
916 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
917 routines on parallel distributed memory machines. ScaLAPACK solves dense and
918 banded linear systems, least squares problems, eigenvalue problems, and
919 singular value problems.")
920 (license (license:non-copyleft "file://LICENSE"
921 "See LICENSE in the distribution."))))
923 (define-public gnuplot
929 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
933 (base32 "03jrqs5lvxmbbz2c4g17dn2hrxqwd3hfadk9q8wbkbkyas2h8sbb"))))
934 (build-system gnu-build-system)
935 (inputs `(("readline" ,readline)
941 `(("pkg-config" ,pkg-config)
942 ("texlive" ,texlive-tiny)))
943 (arguments `(#:configure-flags (list (string-append
944 "--with-texdir=" %output
945 "/texmf-local/tex/latex/gnuplot"))
946 ;; Plot on a dumb terminal during tests.
947 #:make-flags '("GNUTERM=dumb")))
948 (home-page "http://www.gnuplot.info")
949 (synopsis "Command-line driven graphing utility")
950 (description "Gnuplot is a portable command-line driven graphing
951 utility. It was originally created to allow scientists and students to
952 visualize mathematical functions and data interactively, but has grown to
953 support many non-interactive uses such as web scripting. It is also used as a
954 plotting engine by third-party applications like Octave.")
955 ;; X11 Style with the additional restriction that derived works may only be
956 ;; distributed as patches to the original.
957 (license (license:fsf-free
958 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
968 (url "https://github.com/OkoSanto/GCTP")
969 (commit (string-append "v" version))))
970 (file-name (git-file-name name version))
972 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
974 `(("fortran" ,gfortran)))
975 (build-system gnu-build-system)
976 (synopsis "General Cartographic Transformation Package (GCTP)")
978 "The General Cartographic Transformation Package (GCTP) is a system of
979 software routines designed to permit the transformation of coordinate pairs
980 from one map projection to another. The GCTP is the standard computer
981 software used by the National Mapping Division for map projection
983 (home-page "https://github.com/OkoSanto/GCTP")
984 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
993 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
994 version "/src/hdf-" version ".tar.bz2"))
996 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
997 (patches (search-patches "hdf4-architectures.patch"
998 "hdf4-reproducibility.patch"
999 "hdf4-shared-fortran.patch"
1000 "hdf4-tirpc.patch"))))
1001 (build-system gnu-build-system)
1003 `(("gfortran" ,gfortran)
1008 ("libjpeg" ,libjpeg-turbo)
1009 ("libtirpc" ,libtirpc)))
1011 `(#:parallel-tests? #f
1012 #:configure-flags (list "--enable-shared"
1013 (string-append "CPPFLAGS=-I"
1014 (assoc-ref %build-inputs "libtirpc")
1017 (modify-phases %standard-phases
1018 ;; This is inspired by two of Debian's patches.
1019 (add-before 'configure 'add-more-aarch64-support
1021 (substitute* '("mfhdf/ncgen/ncgen.l"
1022 "mfhdf/ncgen/ncgenyy.c"
1023 "mfhdf/libsrc/netcdf.h.in")
1024 (("AIX5L64") "__aarch64__"))
1026 (add-before 'configure 'patchbuild
1029 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1031 (("/bin/mkdir") "mkdir"))
1032 (substitute* (find-files "." "^Makefile\\.in$")
1033 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1034 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1035 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1036 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1037 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1039 (add-after 'configure 'patch-settings
1041 ;; libhdf4.settings contains the full path of the
1042 ;; compilers used, and its contents are included in
1043 ;; .so-files. We truncate the hashes to avoid
1044 ;; unnecessary store references to those compilers:
1045 (substitute* "libhdf4.settings"
1046 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1047 (string-append prefix (string-take hash 10) "...")))
1049 (add-after 'install 'provide-absolute-libjpeg-reference
1050 (lambda* (#:key inputs outputs #:allow-other-keys)
1051 (let ((out (assoc-ref outputs "out"))
1052 (libjpeg (assoc-ref inputs "libjpeg")))
1053 ;; libjpeg-turbo does not provide a .la file, so libtool is
1054 ;; unable to add an absolute reference for -ljpeg in the .la
1055 ;; files. Fix it manually to avoid having to propagate it.
1056 (substitute* (find-files (string-append out "/lib") "\\.la$")
1058 (string-append "-L" libjpeg "/lib -ljpeg")))
1060 (home-page "https://www.hdfgroup.org/products/hdf4/")
1062 "Library and multi-object file format for storing and managing data")
1063 (description "HDF4 is a library and multi-object file format for storing
1064 and managing data between machines. HDF4 is an older hierarchical data format,
1065 incompatible with HDF5.")
1067 (license:non-copyleft
1068 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1070 (define-public hdf4-alt
1075 (substitute-keyword-arguments (package-arguments hdf4)
1076 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1078 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1080 (define-public hdf5-1.8
1087 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1088 "hdf5-" (version-major+minor version)
1089 "/hdf5-" version "/src/hdf5-"
1091 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1093 (match (string-split version #\.)
1094 ((major minor _ ...)
1095 (string-append major minor)))
1096 "/src/hdf5-" version ".tar.bz2")))
1098 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1099 (patches (search-patches "hdf5-config-date.patch"))))
1100 (build-system gnu-build-system)
1104 `(("gfortran" ,gfortran)
1105 ("perl" ,perl))) ;part of the test machinery needs Perl
1106 (outputs '("out" ; core library
1107 "fortran")) ; fortran interface
1109 `(;; Some of the users, notably Flann, need the C++ interface.
1110 #:configure-flags '("--enable-cxx"
1112 "--enable-fortran2003"
1114 ;; Build a thread-safe library. Unfortunately,
1115 ;; 'configure' invites you to either turn off C++,
1116 ;; Fortran, and the high-level interface (HL), or
1117 ;; to pass '--enable-unsupported'. Debian
1118 ;; packagers chose to pass '--enable-unsupported'
1119 ;; and we follow their lead here.
1120 "--enable-threadsafe"
1122 "--enable-unsupported")
1123 ;; Use -fPIC to allow the R bindings to link with the static libraries
1124 #:make-flags (list "CFLAGS=-fPIC"
1127 (modify-phases %standard-phases
1128 (add-before 'configure 'patch-configure
1129 (lambda* (#:key outputs #:allow-other-keys)
1130 (substitute* "configure"
1132 (substitute* "fortran/src/Makefile.in"
1133 (("libhdf5_fortran_la_LDFLAGS =")
1134 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1135 (assoc-ref outputs "fortran") "/lib")))
1136 (substitute* "hl/fortran/src/Makefile.in"
1137 (("libhdf5hl_fortran_la_LDFLAGS =")
1138 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1139 (assoc-ref outputs "fortran") "/lib")))
1141 (add-after 'configure 'patch-settings
1143 ;; libhdf5.settings contains the full path of the
1144 ;; compilers used, and its contents are included in
1145 ;; libhdf5.so. We truncate the hashes to avoid
1146 ;; unnecessary store references to those compilers:
1147 (substitute* "src/libhdf5.settings"
1148 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1149 (string-append prefix (string-take hash 10) "..."))
1150 ;; Don't record the build-time kernel version to make the
1151 ;; settings file reproducible.
1152 (("Uname information:.*")
1153 "Uname information: Linux\n"))
1155 (add-after 'install 'patch-references
1156 (lambda* (#:key inputs outputs #:allow-other-keys)
1157 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1158 (zlib (assoc-ref inputs "zlib")))
1159 (substitute* (find-files bin "h5p?cc")
1161 (string-append "-L" zlib "/lib " lib)))
1163 (add-after 'install 'split
1164 (lambda* (#:key inputs outputs #:allow-other-keys)
1165 ;; Move all fortran-related files
1166 (let* ((out (assoc-ref outputs "out"))
1167 (bin (string-append out "/bin"))
1168 (lib (string-append out "/lib"))
1169 (inc (string-append out "/include"))
1170 (ex (string-append out "/share/hdf5_examples/fortran"))
1171 (fort (assoc-ref outputs "fortran"))
1172 (fbin (string-append fort "/bin"))
1173 (flib (string-append fort "/lib"))
1174 (finc (string-append fort "/include"))
1175 (fex (string-append fort "/share/hdf5_examples/fortran")))
1180 ;; Note: When built with --enable-parallel, the 'h5fc' file
1181 ;; doesn't exist, hence this condition.
1182 (when (file-exists? (string-append bin "/h5fc"))
1183 (rename-file (string-append bin "/h5fc")
1184 (string-append fbin "/h5fc")))
1185 (for-each (lambda (file)
1187 (string-append flib "/" (basename file))))
1188 (find-files lib ".*fortran.*"))
1189 (for-each (lambda (file)
1191 (string-append finc "/" (basename file))))
1192 (find-files inc ".*mod"))
1193 (for-each (lambda (file)
1195 (string-append fex "/" (basename file))))
1196 (find-files ex ".*"))
1197 (delete-file-recursively ex))
1199 (home-page "https://www.hdfgroup.org")
1200 (synopsis "Management suite for extremely large and complex data")
1201 (description "HDF5 is a suite that makes possible the management of
1202 extremely large and complex data collections.")
1203 (license (license:x11-style
1204 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1206 (define-public hdf5-1.10
1207 (package/inherit hdf5-1.8
1212 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1213 "hdf5-" (version-major+minor version)
1214 "/hdf5-" version "/src/hdf5-"
1216 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1218 (apply string-append
1219 (take (string-split version #\.) 2))
1220 "/src/hdf5-" version ".tar.bz2")))
1222 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1223 (patches (search-patches "hdf5-config-date.patch"))))))
1225 (define-public hdf5-1.12
1226 (package/inherit hdf5-1.8
1231 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1232 "hdf5-" (version-major+minor version)
1233 "/hdf5-" version "/src/hdf5-"
1235 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1237 (apply string-append
1238 (take (string-split version #\.) 2))
1239 "/src/hdf5-" version ".tar.bz2")))
1241 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1242 (patches (search-patches "hdf5-config-date.patch"))))))
1245 ;; Default version of HDF5.
1248 (define-public hdf-java
1256 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1257 version "/src/CMake-hdfjava-" version ".tar.gz"))
1259 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1260 (modules '((guix build utils)))
1261 (snippet ; Make sure we don't use the bundled sources and binaries.
1263 (for-each delete-file
1264 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1265 "HDF4.tar.gz" "HDF5.tar.gz"))
1266 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1268 (build-system gnu-build-system)
1270 `(("jdk" ,icedtea "jdk")
1271 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1273 ("hamcrest-core" ,java-hamcrest-core)
1274 ("junit" ,java-junit)
1275 ("slf4j-simple" ,java-slf4j-simple)))
1280 ("libjpeg" ,libjpeg-turbo)
1281 ("slf4j-api" ,java-slf4j-api)))
1284 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1285 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1286 (assoc-ref %build-inputs "jdk") "/lib" )
1287 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1288 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1291 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1292 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1293 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1294 (string-append "JPEGLIB="
1295 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1299 (modify-phases %standard-phases
1300 (add-before 'configure 'chdir-to-source
1301 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1302 (add-before 'configure 'patch-build
1303 (lambda* (#:key inputs outputs #:allow-other-keys)
1304 (substitute* "configure"
1305 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1306 (("/bin/cat") (which "cat")))
1307 ;; Set classpath for compilation
1308 (substitute* '("hdf/hdf5lib/Makefile.in"
1309 "hdf/hdf5lib/exceptions/Makefile.in"
1310 "hdf/hdflib/Makefile.in")
1311 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1312 (string-append (assoc-ref inputs "slf4j-api")
1313 "/share/java/slf4j-api.jar")))
1314 ;; Replace outdated config.sub and config.guess:
1315 (with-directory-excursion "config"
1316 (for-each (lambda (file)
1318 (string-append (assoc-ref inputs "automake")
1320 ,(version-major+minor (package-version automake))
1322 '("config.sub" "config.guess")))
1324 ;; Fix embedded version number
1325 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1326 (substitute* "hdf/hdf5lib/H5.java"
1328 (string-join hdf5version ", "))))
1330 (mkdir-p (string-append (assoc-ref outputs "out")))
1331 ;; Set classpath for tests
1332 (let* ((build-dir (getcwd))
1333 (lib (string-append build-dir "/lib"))
1334 (jhdf (string-append lib "/jhdf.jar"))
1335 (jhdf5 (string-append lib "/jhdf5.jar"))
1339 (string-append (assoc-ref inputs i)
1340 "/share/java/" i ".jar"))
1341 '("slf4j-api" "slf4j-simple"))
1343 (car (find-files (assoc-ref inputs "junit") "jar$"))
1344 (car (find-files (assoc-ref inputs "hamcrest-core")
1347 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1349 (substitute* '("test/hdf5lib/Makefile.in"
1350 "test/hdf5lib/junit.sh.in"
1351 "examples/runExample.sh.in")
1353 (string-append (assoc-ref inputs "coreutils")
1356 (string-append (assoc-ref inputs "coreutils")
1358 (("CLASSPATH=[^\n]*")
1359 (string-append "CLASSPATH=" class-path)))
1360 (setenv "CLASSPATH" class-path))
1362 (add-before 'check 'build-examples
1364 (apply invoke `("javac"
1365 ,@(find-files "examples" ".*\\.java"))))))
1367 #:parallel-build? #f
1369 #:parallel-tests? #f ))
1370 (home-page "https://support.hdfgroup.org/products/java")
1371 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1372 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1373 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1376 ;; BSD-style license:
1377 (license (license:x11-style
1378 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1379 /current/src/unpacked/COPYING"))))
1381 (define-public hdf-eos2
1388 (uri "ftp://edhs1.gsfc.nasa.gov\
1389 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1391 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1392 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1393 "hdf-eos2-build-shared.patch"
1394 "hdf-eos2-fortrantests.patch"))))
1395 (build-system gnu-build-system)
1397 `(("gfortran" ,gfortran)))
1399 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1400 ;; XXX: These inputs are really dependencies of hdf4.
1402 ("libjpeg" ,libjpeg-turbo)
1403 ("libtirpc" ,libtirpc)
1407 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1408 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1409 #:parallel-tests? #f))
1410 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1411 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1412 (description "HDF-EOS2 is a software library built on HDF4 which supports
1413 the construction of data structures used in NASA's Earth Observing
1414 System (Grid, Point and Swath).")
1416 ;; Source files carry a permissive license header.
1417 (license (license:non-copyleft home-page))))
1419 (define-public hdf-eos5
1425 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1426 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1429 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1430 (patches (search-patches "hdf-eos5-build-shared.patch"
1431 "hdf-eos5-remove-gctp.patch"
1432 "hdf-eos5-fix-szip.patch"
1433 "hdf-eos5-fortrantests.patch"))))
1435 `(("gfortran" ,gfortran)))
1436 (build-system gnu-build-system)
1438 `(("hdf5" ,hdf5-1.8)
1442 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1443 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1444 #:parallel-tests? #f))
1445 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1447 "HDF-EOS5 is a software library built on HDF5 to support the construction
1448 of data structures used in NASA's Earth Observing System (Grid, Point and
1450 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1452 ;; Source files carry a permissive license header.
1453 (license (license:non-copyleft home-page))))
1455 (define-public hdf5-parallel-openmpi
1456 (package/inherit hdf5-1.10 ;use the latest
1457 (name "hdf5-parallel-openmpi")
1460 ,@(package-inputs hdf5)))
1462 (substitute-keyword-arguments (package-arguments hdf5)
1463 ((#:configure-flags flags)
1464 ``("--enable-parallel"
1465 ,@(delete "--enable-cxx"
1466 (delete "--enable-threadsafe" ,flags))))
1468 `(modify-phases ,phases
1469 (add-after 'build 'mpi-setup
1471 (add-before 'check 'patch-tests
1473 ;; OpenMPI's mpirun will exit with non-zero status if it
1474 ;; detects an "abnormal termination", i.e. any process not
1475 ;; calling MPI_Finalize(). Since the test is explicitly
1476 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1477 ;; H5C_flush_cache from being called, mpirun will always
1478 ;; complain, so turn this test off.
1479 (substitute* "testpar/Makefile"
1480 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1481 (string-append front back "\n")))
1482 (substitute* "tools/test/h5diff/testph5diff.sh"
1483 (("/bin/sh") (which "sh")))
1485 (synopsis "Management suite for data with parallel IO support")))
1487 (define-public hdf5-blosc
1495 (url "https://github.com/Blosc/hdf5-blosc")
1496 (commit (string-append "v" version))))
1497 (file-name (git-file-name name version))
1499 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1500 (build-system cmake-build-system)
1503 (list (string-append "-DBLOSC_INSTALL_DIR="
1504 (assoc-ref %build-inputs "c-blosc"))
1505 (string-append "-DPLUGIN_INSTALL_PATH="
1506 (assoc-ref %outputs "out")
1507 "/hdf5/lib/plugin"))
1509 (modify-phases %standard-phases
1510 (add-after 'unpack 'do-not-build-blosc
1512 (substitute* "CMakeLists.txt"
1513 (("set\\(BLOSC_INSTALL_DIR.*") "")
1514 (("ExternalProject_Add\\(project_blosc") "message("))
1517 `(("c-blosc" ,c-blosc)
1518 ("hdf5" ,hdf5-1.10)))
1519 (home-page "https://github.com/Blosc/hdf5-blosc")
1520 (synopsis "Filter for HDF5 using the Blosc compressor")
1521 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1522 installing this filter, you can read and write HDF5 files with
1523 Blosc-compressed datasets.")
1524 (license license:expat)))
1526 (define-public h5check
1533 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1534 "h5check/src/h5check-" version ".tar.gz"))
1537 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1538 (build-system gnu-build-system)
1539 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1540 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1541 (synopsis "HDF5 format checker")
1542 (description "@code{h5check} is a validation tool for verifying that an
1543 HDF5 file is encoded according to the HDF File Format Specification.")
1544 (license (license:x11-style "file://COPYING"))))
1552 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1557 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1558 (build-system cmake-build-system)
1559 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1560 (inputs `(("lapack" ,lapack)
1562 ;; FIXME: Even though the fonts are available dvips complains:
1563 ;; "Font cmmi10 not found; characters will be left blank."
1565 `(("texlive" ,texlive-tiny)
1566 ("ghostscript" ,ghostscript)
1567 ("doxygen" ,doxygen)))
1568 (home-page "http://itpp.sourceforge.net")
1569 (synopsis "C++ library of maths, signal processing and communication classes")
1570 (description "IT++ is a C++ library of mathematical, signal processing and
1571 communication classes and functions. Its main use is in simulation of
1572 communication systems and for performing research in the area of
1573 communications. The kernel of the library consists of generic vector and
1574 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1575 similar to MATLAB, GNU Octave or SciPy.")
1576 (license license:gpl3+)))
1578 (define-public netcdf
1586 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1587 "netcdf-c-" version ".tar.gz"))
1590 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1591 (patches (search-patches "netcdf-date-time.patch"))))
1592 (build-system gnu-build-system)
1595 ("doxygen" ,doxygen)
1596 ("graphviz" ,graphviz)))
1598 `(("hdf4" ,hdf4-alt)
1602 ("libjpeg" ,libjpeg-turbo)))
1604 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1606 #:phases (modify-phases %standard-phases
1607 (add-before 'configure 'fix-source-date
1609 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1610 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1611 ;; to '1st hour of the current day', and therefore makes the
1612 ;; package not reproducible.
1613 (substitute* "./configure"
1614 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1615 "date --date='@0'"))
1617 (add-after 'configure 'patch-settings
1619 ;; libnetcdf.settings contains the full filename of the compilers
1620 ;; used to build the library. We truncate the hashes of those
1621 ;; filenames to avoid unnecessary references to the corresponding
1623 (substitute* "libnetcdf.settings"
1624 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1625 (string-append prefix (string-take hash 10) "...")))
1628 #:parallel-tests? #f)) ;various race conditions
1629 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1630 (synopsis "Library for scientific data")
1631 (description "NetCDF is an interface for scientific data access and a
1632 software library that provides an implementation of the interface. The netCDF
1633 library defines a machine-independent format for representing scientific data.
1634 Together, the interface, library, and format support the creation, access, and
1635 sharing of scientific data.")
1636 (license (license:x11-style "file://COPYRIGHT"))))
1638 (define-public netcdf-parallel-openmpi
1639 (package (inherit netcdf)
1640 (name "netcdf-parallel-openmpi")
1643 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1644 (package-inputs netcdf))))
1645 ;; TODO: Replace pkg-config references in nc-config with absolute references
1647 (substitute-keyword-arguments (package-arguments netcdf)
1648 ((#:configure-flags flags)
1649 `(cons* "CC=mpicc" "CXX=mpicxx"
1650 "--enable-parallel-tests"
1651 ;; Shared libraries not supported with parallel IO.
1652 "--disable-shared" "--with-pic"
1654 ((#:phases phases '%standard-phases)
1655 `(modify-phases ,phases
1656 (add-after 'build 'mpi-setup
1657 ,%openmpi-setup)))))))
1659 (define-public netcdf-fortran
1661 (name "netcdf-fortran")
1666 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1670 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1671 (build-system gnu-build-system)
1673 `(#:parallel-tests? #f))
1675 `(("netcdf" ,netcdf)))
1677 `(("gfortran" ,gfortran)))
1678 (synopsis "Fortran interface for the netCDF library")
1679 (description (package-description netcdf))
1680 (home-page (package-home-page netcdf))
1681 (license (package-license netcdf))))
1683 (define-public nlopt
1689 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1692 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1693 (build-system gnu-build-system)
1695 `(;; Shared libraries are not built by default. They are required to
1696 ;; build the Guile, Octave, and Python bindings.
1697 #:configure-flags '("--enable-shared")
1700 (modify-phases %standard-phases
1701 (add-before 'configure 'set-libnlopt-file-name
1702 (lambda* (#:key outputs #:allow-other-keys)
1703 ;; Make sure the Scheme module refers to the library by its
1704 ;; absolute file name (we cannot do that from a snippet
1705 ;; because the expansion of @libdir@ contains
1707 (let ((out (assoc-ref outputs "out")))
1708 (substitute* "swig/nlopt.scm.in"
1710 (string-append out "/lib/libnlopt")))
1712 (inputs `(("guile" ,guile-2.0)))
1713 (native-inputs `(("pkg-config" ,pkg-config)))
1714 (home-page "http://ab-initio.mit.edu/wiki/")
1715 (synopsis "Library for nonlinear optimization")
1716 (description "NLopt is a library for nonlinear optimization, providing a
1717 common interface for a number of different free optimization routines available
1718 online as well as original implementations of various other algorithms.")
1719 (license license:lgpl2.1+)))
1721 (define-public ipopt
1728 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1732 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1733 (modules '((guix build utils)))
1735 ;; Make sure we don't use the bundled software.
1737 (delete-file-recursively "ThirdParty")
1739 (build-system gnu-build-system)
1741 '(#:phases (modify-phases %standard-phases
1742 (add-after 'install 'add--L-flags-in-ipopt.pc
1743 (lambda* (#:key inputs outputs #:allow-other-keys)
1744 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1745 ;; move it to "Libs.private" where it belongs, and add a
1746 ;; '-L' flag for LAPACK.
1747 (let ((out (assoc-ref outputs "out"))
1748 (lapack (assoc-ref inputs "lapack")))
1749 (substitute* (string-append out "/lib/pkgconfig/"
1751 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1752 (string-append "Libs: " before " " after "\n"
1753 "Libs.private: " before
1754 "-L" lapack "/lib -llapack -lblas "
1758 `(("gfortran" ,gfortran)))
1760 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1761 `(("lapack" ,lapack))) ;for both libblas and liblapack
1762 (home-page "https://www.coin-or.org")
1763 (synopsis "Large-scale nonlinear optimizer")
1765 "The Interior Point Optimizer (IPOPT) is a software package for
1766 large-scale nonlinear optimization. It provides C++, C, and Fortran
1768 (license license:epl1.0)))
1776 (uri (string-append "https://www.coin-or.org/download/source/"
1777 "Clp/Clp-" version ".tgz"))
1780 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1781 (modules '((guix build utils)))
1783 ;; Make sure we don't use the bundled software.
1785 (delete-file-recursively "ThirdParty")
1787 (build-system gnu-build-system)
1789 `(("gfortran" ,gfortran)
1790 ("pkg-config" ,pkg-config)))
1792 `(("openblas" ,openblas)))
1793 (home-page "https://www.coin-or.org")
1794 (synopsis "Linear programming solver")
1796 "CLP is a high quality linear programming solver. Its main strengths are
1797 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1798 linear and quadratic objectives. There are limited facilities for nonlinear
1799 and quadratic objectives using the Simplex algorithm.")
1800 (license license:epl1.0)))
1802 (define-public libflame
1806 (outputs '("out" "static"))
1811 (url "https://github.com/flame/libflame")
1813 (file-name (git-file-name name version))
1816 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1817 (build-system gnu-build-system)
1820 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1821 (list "--enable-dynamic-build"
1822 "--enable-max-arg-list-hack"
1823 "--enable-lapack2flame"
1824 "--enable-verbose-make-output"
1825 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1826 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1829 '("--enable-vector-intrinsics=sse")
1831 "--enable-supermatrix"
1832 "--enable-memory-alignment=16"
1833 "--enable-ldim-alignment")
1835 (modify-phases %standard-phases
1836 (add-after 'unpack 'patch-/usr/bin/env-bash
1838 (substitute* "build/config.mk.in"
1839 (("/usr/bin/env bash") (which "bash")))
1842 (lambda* (#:key tests? #:allow-other-keys)
1843 (substitute* "test/Makefile"
1844 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1845 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1847 (with-directory-excursion "test"
1850 (invoke "./test_libflame.x"))
1852 (add-after 'install 'install-static
1853 (lambda* (#:key outputs #:allow-other-keys)
1854 (let ((out (assoc-ref outputs "out"))
1855 (static (assoc-ref outputs "static")))
1856 (mkdir-p (string-append static "/lib"))
1857 (rename-file (string-append out "/lib/libflame.a")
1858 (string-append static "/lib/libflame.a"))
1859 (install-file (string-append out "/include/FLAME.h")
1860 (string-append static "/include"))
1863 `(("gfortran" ,gfortran)))
1865 `(("lapack" ,lapack)
1866 ("openblas" ,openblas)
1868 ("python" ,python-wrapper)))
1869 (home-page "https://github.com/flame/libflame")
1870 (synopsis "High-performance object-based library for DLA computations")
1871 (description "@code{libflame} is a portable library for dense matrix
1872 computations, providing much of the functionality present in LAPACK, developed
1873 by current and former members of the @acronym{SHPC, Science of High-Performance
1874 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1875 Computational Engineering and Sciences} at The University of Texas at Austin.
1876 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1877 includes a complete LAPACK implementation.")
1878 (license license:bsd-3)))
1880 (define-public ceres
1882 (name "ceres-solver")
1884 (home-page "http://ceres-solver.org/")
1887 (uri (string-append home-page "ceres-solver-"
1891 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1892 (build-system cmake-build-system)
1894 ;; TODO: Build HTML user documentation and install separately.
1895 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1896 "-DBUILD_SHARED_LIBS=ON")
1898 #:phases (modify-phases %standard-phases
1899 (add-before 'configure 'set-library-directory
1901 ;; Install libraries to lib/, not lib64/.
1902 (substitute* "internal/ceres/CMakeLists.txt"
1903 (("set\\(LIB_SUFFIX \"64\"\\)")
1904 "set(LIB_SUFFIX \"\")"))
1907 `(("pkg-config" ,pkg-config)))
1909 `(("glog" ,glog))) ;for #include <glog/glog.h>
1914 ("suitesparse" ,suitesparse)
1915 ("gflags" ,gflags)))
1916 (synopsis "C++ library for solving large optimization problems")
1918 "Ceres Solver is a C++ library for modeling and solving large,
1919 complicated optimization problems. It is a feature rich, mature and
1920 performant library which has been used in production since 2010. Ceres Solver
1921 can solve two kinds of problems:
1923 @item non-linear least squares problems with bounds constraints;
1924 @item general unconstrained optimization problems.
1926 (license license:bsd-3)))
1928 ;; For a fully featured Octave, users are strongly recommended also to install
1929 ;; the following packages: less, ghostscript, gnuplot.
1930 (define-public octave-cli
1937 (uri (string-append "mirror://gnu/octave/octave-"
1941 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
1942 (build-system gnu-build-system)
1944 `(("alsa-lib" ,alsa-lib)
1945 ("arpack" ,arpack-ng)
1951 ("fontconfig" ,fontconfig)
1952 ("freetype" ,freetype)
1956 ("graphicsmagick" ,graphicsmagick)
1958 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1959 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1960 ;; libtiff.la instead of having to provide it here.
1961 ("libjpeg" ,libjpeg-turbo)
1965 ("libsndfile" ,libsndfile)
1969 ("portaudio" ,portaudio)
1971 ("readline" ,readline)
1972 ("suitesparse" ,suitesparse)
1973 ("texinfo" ,texinfo)
1976 `(("gfortran" ,gfortran)
1977 ("pkg-config" ,pkg-config)
1979 ;; The following inputs are not actually used in the build process.
1980 ;; However, the ./configure gratuitously tests for their existence and
1981 ;; assumes that programs not present at build time are also not, and
1982 ;; can never be, available at run time! If these inputs are therefore
1983 ;; not present, support for them will be built out. However, Octave
1984 ;; will still run without them, albeit without the features they
1987 ("ghostscript" ,ghostscript)
1988 ("gnuplot" ,gnuplot)))
1989 ;; Octave code uses this variable to detect directories holding multiple CA
1990 ;; certificates to verify peers with. This is required for the networking
1991 ;; functions that require encryption to work properly.
1992 (native-search-paths
1993 (list (search-path-specification
1994 (variable "CURLOPT_CAPATH")
1995 (files '("etc/ssl/certs")))))
1998 (list (string-append "--with-shell="
1999 (assoc-ref %build-inputs "bash")
2002 ;; XXX: Without this flag, linking octave-cli fails with
2003 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2004 ;; not pulling in liboctinterp.la for -lstdc++.
2005 "--enable-link-all-dependencies")
2007 (modify-phases %standard-phases
2008 (add-after 'configure 'configure-makeinfo
2009 (lambda* (#:key inputs #:allow-other-keys)
2010 (substitute* "libinterp/corefcn/help.h"
2013 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2015 (home-page "https://www.gnu.org/software/octave/")
2016 (synopsis "High-level language for numerical computation")
2017 (description "GNU Octave is a high-level interpreted language that is
2018 specialized for numerical computations. It can be used for both linear and
2019 non-linear applications and it provides great support for visualizing results.
2020 Work may be performed both at the interactive command-line as well as via
2022 (license license:gpl3+)))
2024 (define-public octave
2025 (package (inherit octave-cli)
2028 `(("qscintilla" ,qscintilla)
2030 ,@(package-inputs octave-cli)))
2032 `(("qttools" , qttools) ;for lrelease
2033 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2034 ,@(package-native-inputs octave-cli)))
2036 (substitute-keyword-arguments (package-arguments octave-cli)
2038 `(modify-phases ,phases
2039 (add-before 'configure 'patch-qscintilla-library-name
2040 (lambda* (#:key inputs #:allow-other-keys)
2041 ;; The QScintilla library that the Octave configure script tries
2042 ;; to link with should be named libqscintilla-qt5.so, but the
2043 ;; QScintilla input provides the shared library as
2044 ;; libqscintilla2_qt5.so.
2045 (substitute* "configure"
2046 (("qscintilla2-qt5")
2050 (define-public opencascade-oce
2052 (name "opencascade-oce")
2058 (url "https://github.com/tpaviot/oce")
2059 (commit (string-append "OCE-" version))))
2060 (file-name (git-file-name name version))
2061 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2063 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2064 (build-system cmake-build-system)
2067 (list "-DOCE_TESTING:BOOL=ON"
2068 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2069 "-DOCE_DRAW:BOOL=ON"
2070 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2071 (assoc-ref %outputs "out"))
2072 "-UCMAKE_INSTALL_RPATH")))
2074 `(("freetype" ,freetype)
2081 `(("python" ,python-wrapper)))
2082 (home-page "https://github.com/tpaviot/oce")
2083 (synopsis "Libraries for 3D modeling and numerical simulation")
2085 "Open CASCADE is a set of libraries for the development of applications
2086 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2087 C++ class libraries providing services for 3D surface and solid modeling, CAD
2088 data exchange, and visualization. It is used for development of specialized
2089 software dealing with 3D models in design (CAD), manufacturing (CAM),
2090 numerical simulation (CAE), measurement equipment (CMM), and quality
2091 control (CAQ) domains.
2093 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2094 patches, improvements, and experiments contributed by users over the official
2095 Open CASCADE library.")
2096 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2097 ; use of header files; see
2098 ; OCCT_LGPL_EXCEPTION.txt
2099 license:public-domain; files
2100 ; src/Standard/Standard_StdAllocator.hxx and
2101 ; src/NCollection/NCollection_StdAllocator.hxx
2102 license:expat; file src/OpenGl/OpenGl_glext.h
2103 license:bsd-3)))); test framework gtest
2105 (define-public opencascade-occt
2107 (name "opencascade-occt")
2113 (url "https://git.dev.opencascade.org/repos/occt.git")
2116 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2118 (file-name (git-file-name name version))
2120 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2121 (modules '((guix build utils)))
2124 ;; Remove files specific to non-free operating systems.
2125 (delete-file-recursively "samples/ios")
2126 (delete-file-recursively "samples/mfc")
2127 (delete-file-recursively "samples/qt/FuncDemo")
2128 (delete-file "genconf.bat")
2129 (delete-file "gendoc.bat")
2130 (delete-file "genproj.bat")
2131 (delete-file "upgrade.bat")
2132 ;; Remove references to deleted files.
2133 (substitute* "dox/FILES_HTML.txt"
2134 ((".*standard.*") "" )
2135 ((".*UIKitSample.*") ""))
2137 (build-system cmake-build-system)
2139 '(;; There is no test target for make. OCCT provides an
2140 ;; 'Automated Testing System', which may be accessed after
2141 ;; installation via the draw.sh script. draw.sh is located in
2142 ;; the bin directory. For details see:
2143 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2144 ;; occt_dev_guides__tests.html
2146 ;; Configure without freeimage: attempting to link against the
2147 ;; freeimage version 3.17 library leads to 'undefined
2148 ;; reference' errors.
2150 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2152 "-DUSE_VTK:BOOL=OFF"
2153 "-DBUILD_DOC_Overview:BOOL=OFF"
2154 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2155 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2156 "-UCMAKE_INSTALL_LIBDIR")))
2158 `(("doxygen" ,doxygen)
2159 ;("freeimage" ,freeimage)
2160 ("freetype" ,freetype)
2162 ("libxext" ,libxext)
2169 ;; TODO: build Overview documentation and add 'doc' output.
2170 (home-page "https://www.opencascade.com")
2171 (synopsis "Libraries for 3D modeling and numerical simulation")
2173 "Open CASCADE is a set of libraries for the development of applications
2174 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2175 C++ class libraries providing services for 3D surface and solid modeling, CAD
2176 data exchange, and visualization. It is used for development of specialized
2177 software dealing with 3D models in design (CAD), manufacturing (CAM),
2178 numerical simulation (CAE), measurement equipment (CMM), and quality
2179 control (CAQ) domains.
2181 This is the certified version of the Open Cascade Technology (OCCT) library.")
2182 (license (list ;; OCCT library:
2183 license:lgpl2.1; with an exception for the use of header
2184 ; files, see OCCT_LGPL_EXCEPTION.txt.
2185 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2186 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2188 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2189 ;; src/StepFile/step.tab.*:
2190 license:gpl3+ ; with Bison 2.2 exception.
2191 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2192 (license:non-copyleft
2193 "https://www.unicode.org/license.html")
2194 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2195 license:public-domain))))
2205 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2207 (string-append "gmsh_"
2208 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2210 (file-name (git-file-name name version))
2212 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2213 (modules '((guix build utils)))
2216 (delete-file-recursively "contrib/metis")
2218 (build-system cmake-build-system)
2221 ("gfortran" ,gfortran)
2228 ("opencascade-occt" ,opencascade-occt)
2230 ("libxext" ,libxext)))
2232 `(("fontconfig" ,fontconfig)
2233 ("libxft" ,libxft)))
2235 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2236 "-DENABLE_BUILD_SHARED:BOOL=ON"
2237 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2238 (home-page "http://gmsh.info/")
2239 (synopsis "3D finite element grid generator")
2240 (description "Gmsh is a 3D finite element grid generator with a built-in
2241 CAD engine and post-processor. Its design goal is to provide a fast, light
2242 and user-friendly meshing tool with parametric input and advanced
2243 visualization capabilities. Gmsh is built around four modules: geometry,
2244 mesh, solver and post-processing. The specification of any input to these
2245 modules is done either interactively using the graphical user interface or in
2246 ASCII text files using Gmsh's own scripting language.")
2247 (license license:gpl2+)))
2249 (define-public veusz
2256 (uri (pypi-uri "veusz" version))
2258 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2259 (build-system python-build-system)
2261 `(;; Tests will fail because they depend on optional packages like
2262 ;; python-astropy, which is not packaged.
2265 (modify-phases %standard-phases
2266 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2267 ;; the path is defined in Guix, therefore we have to change it.
2268 (add-after 'unpack 'fix-sip-dir
2270 (substitute* "pyqtdistutils.py"
2271 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2273 ;; Now we have to pass the correct sip_dir to setup.py.
2275 (lambda* (#:key inputs #:allow-other-keys)
2276 ;; We need to tell setup.py where to locate QtCoremod.sip
2277 ((@@ (guix build python-build-system) call-setuppy)
2279 (list (string-append "--sip-dir="
2280 (assoc-ref inputs "python-pyqt")
2283 ;; Ensure that icons are found at runtime.
2284 (add-after 'install 'wrap-executable
2285 (lambda* (#:key inputs outputs #:allow-other-keys)
2286 (let ((out (assoc-ref outputs "out")))
2287 (wrap-program (string-append out "/bin/veusz")
2288 `("QT_PLUGIN_PATH" prefix
2289 ,(list (string-append (assoc-ref inputs "qtsvg")
2290 "/lib/qt5/plugins/"))))))))))
2292 `(("pkg-config" ,pkg-config)
2293 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2294 ("qttools" ,qttools)
2295 ("python-sip" ,python-sip-4)))
2297 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2298 ("python-dbus" ,python-dbus)
2299 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2300 ("python-pyqt" ,python-pyqt)
2304 `(("python-numpy" ,python-numpy)))
2305 (home-page "https://veusz.github.io/")
2306 (synopsis "Scientific plotting package")
2308 "Veusz is a scientific plotting and graphing program with a graphical
2309 user interface, designed to produce publication-ready 2D and 3D plots. In
2310 addition it can be used as a module in Python for plotting. It supports
2311 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2312 (license license:gpl2+)))
2314 (define-public maxflow
2317 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2318 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2323 (url "https://github.com/gerddie/maxflow")
2325 (file-name (git-file-name name version))
2328 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2329 (build-system cmake-build-system)
2330 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2331 (synopsis "Library implementing Maxflow algorithm")
2332 (description "An implementation of the maxflow algorithm described in
2333 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2334 Energy Minimization in Computer Vision.\n
2335 Yuri Boykov and Vladimir Kolmogorov.\n
2336 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2338 (license license:gpl3+)))
2340 (define-public petsc
2347 ;; The *-lite-* tarball does not contain the *large* documentation
2348 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2349 "petsc-lite-" version ".tar.gz"))
2351 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2352 (outputs '("out" ; libraries and headers
2353 "examples")) ; ~30MiB of examples
2354 (build-system gnu-build-system)
2356 `(("python" ,python-2)))
2358 `(("gfortran" ,gfortran)
2360 ("superlu" ,superlu)
2361 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2362 ;; leaving out opengl, as configuration seems to only be for mac
2365 `(#:test-target "test"
2366 #:parallel-build? #f ; build is parallel by default
2372 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2373 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2374 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2376 (modify-phases %standard-phases
2378 ;; PETSc's configure script is actually a python script, so we can't
2379 ;; run it with bash.
2380 (lambda* (#:key outputs (configure-flags '())
2382 (let* ((prefix (assoc-ref outputs "out"))
2383 (flags `(,(string-append "--prefix=" prefix)
2384 ,@configure-flags)))
2385 (format #t "build directory: ~s~%" (getcwd))
2386 (format #t "configure flags: ~s~%" flags)
2387 (apply invoke "./configure" flags))))
2388 (add-after 'configure 'clean-local-references
2389 (lambda* (#:key outputs #:allow-other-keys)
2390 (let ((out (assoc-ref outputs "out")))
2391 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2392 ;; Prevent build directory from leaking into compiled code
2394 ;; Scrub timestamp for reproducibility
2395 ((".*Libraries compiled on.*") ""))
2396 (substitute* (find-files "." "petscvariables")
2397 ;; Do not expose build machine characteristics, set to defaults.
2398 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2399 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2401 (add-after 'install 'clean-install
2402 ;; Try to keep installed files from leaking build directory names.
2403 (lambda* (#:key inputs outputs #:allow-other-keys)
2404 (let ((out (assoc-ref outputs "out")))
2405 (substitute* (map (lambda (file)
2406 (string-append out "/lib/petsc/conf/" file))
2407 '("petscvariables"))
2409 ;; Make compiler references point to the store
2410 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2411 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2412 (string-append "= " (which compiler))))
2413 ;; PETSc installs some build logs, which aren't necessary.
2414 (for-each (lambda (file)
2415 (let ((f (string-append out "/lib/petsc/conf/" file)))
2416 (when (file-exists? f)
2418 '("configure.log" "make.log" "gmake.log"
2419 "test.log" "error.log" "RDict.db"
2420 "PETScBuildInternal.cmake"
2421 ;; Once installed, should uninstall with Guix
2424 (add-after 'install 'move-examples
2425 (lambda* (#:key outputs #:allow-other-keys)
2426 (let* ((out (assoc-ref outputs "out"))
2427 (examples (assoc-ref outputs "examples"))
2428 (exdir (string-append out "/share/petsc/examples"))
2429 (exdir' (string-append examples "/share/petsc/examples")))
2430 (copy-recursively exdir exdir')
2431 (delete-file-recursively exdir)
2433 (home-page "https://www.mcs.anl.gov/petsc")
2434 (synopsis "Library to solve PDEs")
2435 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2436 data structures and routines for the scalable (parallel) solution of
2437 scientific applications modeled by partial differential equations.")
2438 (license (license:non-copyleft
2439 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2441 (define-public petsc-complex
2442 (package (inherit petsc)
2443 (name "petsc-complex")
2445 (substitute-keyword-arguments (package-arguments petsc)
2446 ((#:configure-flags cf)
2447 `(cons "--with-scalar-type=complex" ,cf))))
2448 (synopsis "Library to solve PDEs (with complex scalars)")))
2450 (define-public petsc-openmpi
2451 (package (inherit petsc)
2452 (name "petsc-openmpi")
2454 `(("hdf5" ,hdf5-parallel-openmpi)
2455 ("hypre" ,hypre-openmpi)
2457 ("mumps" ,mumps-openmpi)
2458 ("openmpi" ,openmpi)
2459 ("scalapack" ,scalapack)
2460 ("scotch" ,pt-scotch32)
2461 ,@(package-inputs petsc)))
2463 (substitute-keyword-arguments (package-arguments petsc)
2464 ((#:configure-flags cf)
2466 "--with-mpiexec=mpirun"
2469 "--with-scalapack=1"
2471 ,(string-append "--with-mpi-dir="
2472 (assoc-ref %build-inputs "openmpi"))
2473 ,(string-append "--with-hdf5-include="
2474 (assoc-ref %build-inputs "hdf5") "/include")
2475 ,(string-append "--with-hdf5-lib="
2476 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2477 ,@(delete "--with-mpi=0" ,cf)))
2479 `(modify-phases ,phases
2480 (add-before 'configure 'mpi-setup
2481 ,%openmpi-setup)))))
2482 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2484 (define-public petsc-complex-openmpi
2485 (package (inherit petsc-complex)
2486 (name "petsc-complex-openmpi")
2488 `(("openmpi" ,openmpi)
2489 ,@(package-inputs petsc-complex)))
2491 (substitute-keyword-arguments (package-arguments petsc-complex)
2492 ((#:configure-flags cf)
2493 ``("--with-mpiexec=mpirun"
2494 ,(string-append "--with-mpi-dir="
2495 (assoc-ref %build-inputs "openmpi"))
2496 ,@(delete "--with-mpi=0" ,cf)))
2498 `(modify-phases ,phases
2499 (add-before 'configure 'mpi-setup
2500 ,%openmpi-setup)))))
2501 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2503 (define-public python-petsc4py
2505 (name "python-petsc4py")
2510 (uri (pypi-uri "petsc4py" version))
2513 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2514 (modules '((guix build utils)))
2517 ;; Ensure source file is regenerated in the build phase.
2518 (delete-file "src/petsc4py.PETSc.c")
2519 ;; Remove legacy GC code. See
2520 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2521 (substitute* "src/PETSc/cyclicgc.pxi"
2522 ((".*gc_refs.*") "" )
2523 ((".*PyGC_Head.*") ""))
2525 (build-system python-build-system)
2528 (modify-phases %standard-phases
2529 (add-before 'build 'pre-build
2531 ;; Define path to PETSc installation.
2532 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2534 (add-before 'check 'mpi-setup
2537 `(("python-cython" ,python-cython)))
2539 `(("petsc" ,petsc-openmpi)
2540 ("python-numpy" ,python-numpy)))
2541 (home-page "https://bitbucket.org/petsc/petsc4py/")
2542 (synopsis "Python bindings for PETSc")
2543 (description "PETSc, the Portable, Extensible Toolkit for
2544 Scientific Computation, is a suite of data structures and routines for
2545 the scalable (parallel) solution of scientific applications modeled by
2546 partial differential equations. It employs the MPI standard for all
2547 message-passing communication. @code{petsc4py} provides Python
2548 bindings to almost all functions of PETSc.")
2549 (license license:bsd-3)))
2551 (define-public python-kiwisolver
2553 (name "python-kiwisolver")
2557 (uri (pypi-uri "kiwisolver" version))
2560 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2561 (build-system python-build-system)
2562 (home-page "https://github.com/nucleic/kiwi")
2563 (synopsis "Fast implementation of the Cassowary constraint solver")
2565 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2566 solving algorithm. Kiwi has been designed from the ground up to be
2567 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2568 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2569 savings are consistently > 5x.")
2570 (license license:bsd-3)))
2572 (define-public python2-kiwisolver
2573 (package-with-python2 python-kiwisolver))
2575 (define-public slepc
2582 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2586 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2587 (build-system gnu-build-system)
2589 `(("python" ,python-2)
2590 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2592 `(("arpack" ,arpack-ng)
2593 ("gfortran" ,gfortran)))
2595 `(("petsc" ,petsc)))
2597 `(#:parallel-build? #f ;build is parallel by default
2599 `(,(string-append "--with-arpack-dir="
2600 (assoc-ref %build-inputs "arpack") "/lib"))
2601 #:make-flags ;honor (parallel-job-count)
2602 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2603 ,(string-append "PETSCCONFIGDIR="
2604 (assoc-ref %build-inputs "petsc:examples")
2605 "/share/petsc/examples/config"))
2607 (modify-phases %standard-phases
2609 ;; configure is a python script, so we can't run it with bash.
2610 (lambda* (#:key inputs outputs (configure-flags '())
2612 (let* ((prefix (assoc-ref outputs "out"))
2613 (flags `(,(string-append "--prefix=" prefix)
2614 ,@configure-flags)))
2615 (format #t "build directory: ~s~%" (getcwd))
2616 (format #t "configure flags: ~s~%" flags)
2617 (setenv "SLEPC_DIR" (getcwd))
2618 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2619 (apply invoke "./configure" flags))))
2620 (add-after 'install 'delete-doc
2621 ;; TODO: SLEPc installs HTML documentation alongside headers in
2622 ;; $out/include. We'd like to move them to share/doc, but delete
2623 ;; them for now, as they are incomplete and installing the complete
2624 ;; documentation is difficult.
2625 (lambda* (#:key outputs #:allow-other-keys)
2626 (let* ((out (assoc-ref outputs "out")))
2627 (for-each delete-file (find-files out "\\.html$"))
2629 (add-after 'install 'clean-install
2630 ;; Clean up unnecessary build logs from installation.
2631 (lambda* (#:key outputs #:allow-other-keys)
2632 (let ((out (assoc-ref outputs "out")))
2633 (for-each (lambda (file)
2634 (let ((f (string-append out "/lib/slepc/conf/" file)))
2635 (when (file-exists? f)
2637 '("configure.log" "make.log" "gmake.log"
2638 "test.log" "error.log" "RDict.db"
2641 (home-page "https://slepc.upv.es")
2642 (synopsis "Scalable library for eigenproblems")
2643 (description "SLEPc is a software library for the solution of large sparse
2644 eigenproblems on parallel computers. It can be used for the solution of
2645 linear eigenvalue problems formulated in either standard or generalized form,
2646 as well as other related problems such as the singular value decomposition.
2647 The emphasis of the software is on methods and techniques appropriate for
2648 problems in which the associated matrices are sparse, for example, those
2649 arising after the discretization of partial differential equations.")
2650 (license license:bsd-2)))
2652 (define-public slepc-complex
2653 (package (inherit slepc)
2654 (name "slepc-complex")
2656 `(("petsc" ,petsc-complex)
2657 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2658 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2660 (define-public slepc-openmpi
2661 (package (inherit slepc)
2662 (name "slepc-openmpi")
2664 (substitute-keyword-arguments (package-arguments slepc)
2665 ((#:phases phases '%standard-phases)
2666 `(modify-phases ,phases
2667 (add-before 'check 'mpi-setup
2668 ,%openmpi-setup)))))
2671 ("arpack" ,arpack-ng-openmpi)
2672 ,@(alist-delete "arpack" (package-inputs slepc))))
2674 `(("petsc" ,petsc-openmpi)
2675 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2676 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2678 (define-public slepc-complex-openmpi
2679 (package (inherit slepc-openmpi)
2680 (name "slepc-complex-openmpi")
2682 `(("petsc" ,petsc-complex-openmpi)
2683 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2684 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2686 (define-public python-slepc4py
2688 (name "python-slepc4py")
2693 (uri (pypi-uri "slepc4py" version))
2696 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2697 (build-system python-build-system)
2700 (modify-phases %standard-phases
2701 (add-before 'build 'pre-build
2703 ;; Define path to PETSc installation.
2704 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2705 ;; Define path to SLEPc installation.
2706 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2708 (add-before 'check 'mpi-setup
2711 `(("python-numpy" ,python-numpy)
2712 ("python-petsc4py" ,python-petsc4py)
2713 ("slepc" ,slepc-openmpi)))
2714 (home-page "https://bitbucket.org/slepc/slepc4py/")
2715 (synopsis "Python bindings for SLEPc")
2716 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2717 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2718 Scientific Computation. It employs the MPI standard for all
2719 message-passing communication. @code{slepc4py} provides Python
2720 bindings to almost all functions of SLEPc.")
2721 (license license:bsd-3)))
2723 (define-public metamath
2731 (url "https://github.com/metamath/metamath-exe")
2732 (commit (string-append "v" version))))
2733 (file-name (git-file-name name version))
2735 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2736 (build-system gnu-build-system)
2738 `(("autoconf" ,autoconf)
2739 ("automake" ,automake)))
2740 (home-page "http://us.metamath.org/")
2741 (synopsis "Proof verifier based on a minimalistic formalism")
2743 "Metamath is a tiny formal language and that can express theorems in
2744 abstract mathematics, with an accompyaning @command{metamath} executable that
2745 verifies databases of these proofs. There is a public database,
2746 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2747 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2748 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2749 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2751 (license license:gpl2+)))
2753 (define-public mumps
2760 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2764 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2765 (patches (search-patches "mumps-build-parallelism.patch"
2766 "mumps-shared-libseq.patch"
2767 "mumps-shared-mumps.patch"
2768 "mumps-shared-pord.patch"))))
2769 (build-system gnu-build-system)
2771 `(("fortran" ,gfortran)
2772 ;; These are required for linking against mumps, but we let the user
2773 ;; declare the dependency.
2776 ("scotch" ,scotch)))
2778 `(#:modules ((ice-9 match)
2781 ,@%gnu-build-system-modules)
2783 (modify-phases %standard-phases
2785 (lambda* (#:key inputs #:allow-other-keys)
2786 (call-with-output-file "Makefile.inc"
2797 INCSEQ = -I$(topdir)/libseq
2798 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2799 LIBSEQNEEDED = libseqneeded~;
2803 AR = ar vr # rules require trailing space, ugh...
2806 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2808 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2809 LIBOTHERS = -pthread
2812 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2816 LIBS = $(SCALAP) $(LIBSEQ)
2817 LPORDDIR = $(topdir)/PORD/lib
2818 IPORD = -I$(topdir)/PORD/include
2819 LPORD = $(LPORDDIR)/libpord.a
2820 ORDERINGSF = -Dpord~@[
2822 IMETIS = -I$(METISDIR)/include
2823 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2824 ORDERINGSF += -Dmetis~]~@[~:{
2826 ISCOTCH = -I$(SCOTCHDIR)/include
2827 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2828 ORDERINGSF += ~a~}~]
2829 ORDERINGSC = $(ORDERINGSF)
2830 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2831 IORDERINGSF = $(ISCOTCH)
2832 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2833 (assoc-ref inputs "mpi")
2834 (assoc-ref inputs "blas")
2835 (assoc-ref inputs "scalapack")
2836 (assoc-ref inputs "metis")
2837 (match (list (assoc-ref inputs "pt-scotch")
2838 (assoc-ref inputs "scotch"))
2842 `((,scotch "" "-Dscotch")))
2845 "-lptesmumps -lptscotch -lptscotcherr "
2846 "-Dptscotch")))))))))
2848 ;; By default only the d-precision library is built. Make with "all"
2849 ;; target so that all precision libraries and examples are built.
2851 (invoke "make" "all"
2852 (format #f "-j~a" (parallel-job-count)))))
2854 ;; Run the simple test drivers, which read test input from stdin:
2855 ;; from the "real" input for the single- and double-precision
2856 ;; testers, and from the "cmplx" input for complex-precision
2857 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2858 ;; package to prefix execution with "mpirun".
2859 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2860 (with-directory-excursion "examples"
2863 (let ((tester (apply open-pipe*
2866 ,(string-append "./" prec
2868 (input (open-input-file
2869 (string-append "input_simpletest_" type))))
2871 (dump-port input tester)
2873 (zero? (close-pipe tester)))))
2875 '("real" "real" "cmplx" "cmplx")))))
2877 (lambda* (#:key outputs #:allow-other-keys)
2878 (let* ((out (assoc-ref outputs "out"))
2879 (libdir (string-append out "/lib")))
2880 (copy-recursively "lib" libdir)
2881 (copy-recursively "include" (string-append out "/include"))
2882 (when (file-exists? "libseq/libmpiseq.a")
2883 (install-file "libseq/libmpiseq.a" libdir))
2884 (when (file-exists? "libseq/libmpiseq.so")
2885 (install-file "libseq/libmpiseq.so" libdir))
2887 (home-page "http://mumps.enseeiht.fr")
2888 (synopsis "Multifrontal sparse direct solver")
2890 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2891 sparse system of linear equations A x = b using Gaussian elimination.")
2892 (license license:cecill-c)))
2894 (define-public mumps-metis
2895 (package (inherit mumps)
2896 (name "mumps-metis")
2898 (alist-delete "scotch" (package-inputs mumps)))))
2900 (define-public mumps-openmpi
2901 (package (inherit mumps)
2902 (name "mumps-openmpi")
2905 ("scalapack" ,scalapack)
2906 ("pt-scotch" ,pt-scotch)
2907 ,@(alist-delete "scotch" (package-inputs mumps))))
2909 (substitute-keyword-arguments (package-arguments mumps)
2911 `(modify-phases ,phases
2912 (add-before 'check 'mpi-setup
2916 ((assoc-ref ,phases 'check)
2917 #:exec-prefix '("mpirun" "-n" "2"))))))))
2918 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2920 (define-public mumps-metis-openmpi
2921 (package (inherit mumps-openmpi)
2922 (name "mumps-metis-openmpi")
2924 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2926 (define-public ruby-asciimath
2928 (name "ruby-asciimath")
2933 (uri (rubygems-uri "asciimath" version))
2936 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2937 (build-system ruby-build-system)
2939 `(("ruby-nokogiri" ,ruby-nokogiri)
2940 ("ruby-rspec" ,ruby-rspec)))
2941 (synopsis "AsciiMath parsing and conversion library")
2943 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2944 easy-to-write markup language for mathematics.")
2945 (home-page "https://github.com/asciidoctor/asciimath")
2946 (license license:expat)))
2948 (define-public superlu
2955 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2956 "superlu_" version ".tar.gz"))
2958 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
2959 (modules '((guix build utils)))
2961 ;; Replace the non-free implementation of MC64 with a stub adapted
2964 (use-modules (ice-9 regex)
2966 (call-with-output-file "SRC/mc64ad.c"
2971 void mc64id_(int *a) {
2972 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2975 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2976 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2977 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2980 ;; Remove the corresponding license verbiage. MC64 license follows
2981 ;; a "------" line separator.
2982 (with-atomic-file-replacement "License.txt"
2983 (let ((rx (make-regexp "-{8}")))
2986 (let ((line (read-line in 'concat)))
2987 (unless (regexp-exec rx line)
2991 (build-system cmake-build-system)
2995 `(("blas" ,openblas)
2996 ("gfortran" ,gfortran)))
2998 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2999 "-DTPL_BLAS_LIBRARIES=openblas"
3000 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3001 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3002 (synopsis "Supernodal direct solver for sparse linear systems")
3004 "SuperLU is a general purpose library for the direct solution of large,
3005 sparse, nonsymmetric systems of linear equations on high performance machines.
3006 The library is written in C and is callable from either C or Fortran. The
3007 library routines perform an LU decomposition with partial pivoting and
3008 triangular system solves through forward and back substitution. The library
3009 also provides threshold-based ILU factorization preconditioners.")
3010 (license (list license:bsd-3
3011 license:gpl2+ ;EXAMPLE/*fgmr.c
3012 (license:fsf-free "file://SRC/colamd.h")))))
3014 (define-public superlu-dist
3016 (name "superlu-dist")
3022 (url "https://github.com/xiaoyeli/superlu_dist")
3023 (commit (string-append "v" version))))
3024 (file-name (git-file-name name version))
3026 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3027 (modules '((guix build utils)))
3029 ;; Replace the non-free implementation of MC64 with a stub
3031 (make-file-writable "SRC/mc64ad_dist.c")
3032 (call-with-output-file "SRC/mc64ad_dist.c"
3037 void mc64id_dist(int *a) {
3038 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3041 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3042 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3043 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3046 (substitute* "SRC/util.c" ;adjust default algorithm
3047 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3048 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3049 ;; general (i.e. non-square) processor-grid support.
3050 "RowPerm = NOROWPERM;"))
3052 (patches (search-patches "superlu-dist-scotchmetis.patch"
3053 "superlu-dist-awpm-grid.patch"))))
3054 (build-system cmake-build-system)
3058 `(("gfortran" ,gfortran)
3061 ("combblas" ,combinatorial-blas)))
3063 `(("mpi" ,openmpi) ;headers include MPI heades
3064 ("parmetis" ,pt-scotch32 "metis")
3065 ("pt-scotch" ,pt-scotch32)))
3067 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3068 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3069 "-DTPL_ENABLE_COMBBLASLIB=YES"
3070 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3071 "-DTPL_LAPACK_LIBRARIES=-llapack"
3072 (string-append "-DTPL_PARMETIS_LIBRARIES="
3074 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3075 "scotchmetis" "scotch" "scotcherr")
3077 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3078 (assoc-ref %build-inputs "parmetis")
3080 "-DTPL_ENABLE_COMBBLASLIB=ON"
3081 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3082 (assoc-ref %build-inputs "combblas")
3083 "/include/CombBLAS;"
3084 (assoc-ref %build-inputs "combblas")
3085 "/include/BipartiteMatchings")
3086 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3088 (modify-phases %standard-phases
3089 (add-before 'configure 'set-c++-standard
3091 (substitute* "CMakeLists.txt"
3092 ;; AWPM headers require C++14
3093 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3094 (add-before 'check 'mpi-setup
3096 (add-before 'check 'omp-setup
3097 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3098 (home-page (package-home-page superlu))
3099 (synopsis "Parallel supernodal direct solver")
3101 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3102 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3103 implemented in ANSI C, and MPI for communications.")
3104 (license license:bsd-3)))
3106 (define-public scotch
3113 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3114 "latestfile/298/scotch_" version ".tar.gz"))
3116 (base32 "1184fcv4wa2df8szb5lan6pjh0raarr45pk8ilpvbz23naikzg53"))
3117 (patches (search-patches "scotch-build-parallelism.patch"
3118 "scotch-integer-declarations.patch"))))
3119 (build-system gnu-build-system)
3125 (outputs '("out" "metis"))
3127 `(#:make-flags (list (string-append "prefix=" %output))
3129 (modify-phases %standard-phases
3131 'unpack 'chdir-to-src
3132 (lambda _ (chdir "src") #t))
3136 (call-with-output-file "Makefile.inc"
3150 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3151 LDFLAGS = -lz -lm -lrt -lpthread
3153 LEX = flex -Pscotchyy -olex.yy.c
3158 YACC = bison -pscotchyy -y -b y
3160 '("COMMON_FILE_COMPRESS_GZ"
3162 "COMMON_RANDOM_FIXED_SEED"
3163 "INTSIZE64" ;use 'int64_t'
3164 ;; Prevents symbol clashes with libesmumps
3166 ;; XXX: Causes invalid frees in superlu-dist tests
3168 ;; "SCOTCH_PTHREAD_NUMBER=2"
3169 "restrict=__restrict"))))
3171 (add-after 'build 'build-esmumps
3174 (format #f "-j~a" (parallel-job-count))
3176 (add-before 'install 'make-install-dirs
3177 (lambda* (#:key outputs #:allow-other-keys)
3178 (mkdir (assoc-ref outputs "out"))))
3179 (add-after 'install 'install-metis
3180 (lambda* (#:key outputs #:allow-other-keys)
3181 (let ((out (assoc-ref outputs "metis")))
3183 ;; metis files are not installed with 'make install'
3184 (for-each (lambda (f)
3185 (install-file f (string-append out "/include")))
3186 (find-files "../include/" ".*metis\\.h"))
3187 (for-each (lambda (f)
3188 (install-file f (string-append out "/lib")))
3189 (find-files "../lib/" ".*metis\\..*"))
3191 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3192 (synopsis "Programs and libraries for graph algorithms")
3193 (description "SCOTCH is a set of programs and libraries which implement
3194 the static mapping and sparse matrix reordering algorithms developed within
3195 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3196 conquer approach, to scientific computing problems such as graph and mesh
3197 partitioning, static mapping, and sparse matrix ordering, in application
3198 domains ranging from structural mechanics to operating systems or
3200 ;; See LICENSE_en.txt
3201 (license license:cecill-c)))
3203 (define-public scotch32
3204 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3205 ;; some applications.
3206 (package (inherit scotch)
3209 (substitute-keyword-arguments (package-arguments scotch)
3210 ((#:phases scotch-phases)
3211 `(modify-phases ,scotch-phases
3215 (call-with-output-file "Makefile.inc"
3229 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3230 LDFLAGS = -lz -lm -lrt -lpthread
3232 LEX = flex -Pscotchyy -olex.yy.c
3237 YACC = bison -pscotchyy -y -b y
3239 '("COMMON_FILE_COMPRESS_GZ"
3241 "COMMON_RANDOM_FIXED_SEED"
3242 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3243 ;; Prevents symbolc clashes with libesmumps
3245 ;; XXX: Causes invalid frees in superlu-dist tests
3247 ;; "SCOTCH_PTHREAD_NUMBER=2"
3248 "restrict=__restrict"))))))))))
3250 "Programs and libraries for graph algorithms (32-bit integers)")))
3252 (define-public scotch-shared
3253 (package (inherit scotch)
3254 (name "scotch-shared")
3260 (substitute-keyword-arguments (package-arguments scotch)
3261 ((#:phases scotch-shared-phases)
3262 `(modify-phases ,scotch-shared-phases
3266 ;; Otherwise, the RUNPATH will lack the final path component.
3267 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3268 (assoc-ref %outputs "out") "/lib"))
3269 (call-with-output-file "Makefile.inc"
3277 ARFLAGS = -shared -o
3283 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3284 CLIBFLAGS = -shared -fPIC
3285 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3287 LEX = flex -Pscotchyy -olex.yy.c
3292 YACC = bison -pscotchyy -y -b y
3294 '("COMMON_FILE_COMPRESS_GZ"
3296 "COMMON_RANDOM_FIXED_SEED"
3297 "INTSIZE64" ;use 'int64_t'
3298 ;; Prevents symbolc clashes with libesmumps
3300 ;; XXX: Causes invalid frees in superlu-dist tests
3302 ;; "SCOTCH_PTHREAD_NUMBER=2"
3303 "restrict=__restrict"
3307 "Programs and libraries for graph algorithms (shared libraries version)")))
3309 (define-public pt-scotch
3310 (package (inherit scotch)
3313 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3315 (substitute-keyword-arguments (package-arguments scotch)
3316 ((#:phases scotch-phases)
3317 `(modify-phases ,scotch-phases
3321 (invoke "make" (format #f "-j~a" (parallel-job-count))
3322 "ptscotch" "ptesmumps")
3324 ;; Install the serial metis compatibility library
3325 (invoke "make" "-C" "libscotchmetis" "install")))
3326 (add-before 'check 'mpi-setup
3330 (invoke "make" "ptcheck")))))))
3331 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3333 (define-public pt-scotch32
3334 (package (inherit scotch32)
3335 (name "pt-scotch32")
3337 `(("openmpi" ,openmpi))) ;headers include MPI headers
3339 (substitute-keyword-arguments (package-arguments scotch32)
3340 ((#:phases scotch32-phases)
3341 `(modify-phases ,scotch32-phases
3344 (invoke "make" (format #f "-j~a" (parallel-job-count))
3345 "ptscotch" "ptesmumps")
3346 ;; Install the serial metis compatibility library
3347 (invoke "make" "-C" "libscotchmetis" "install")))
3348 (add-before 'check 'mpi-setup
3352 (invoke "make" "ptcheck")))))))
3354 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3356 (define-public pt-scotch-shared
3357 (package (inherit scotch-shared)
3358 (name "pt-scotch-shared")
3360 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3362 (substitute-keyword-arguments (package-arguments scotch-shared)
3363 ((#:phases scotch-shared-phases)
3364 `(modify-phases ,scotch-shared-phases
3368 (invoke "make" (format #f "-j~a" (parallel-job-count))
3369 "ptscotch" "ptesmumps")
3371 ;; Install the serial metis compatibility library
3372 (invoke "make" "-C" "libscotchmetis" "install")))
3373 (add-before 'check 'mpi-setup
3374 ,%openmpi-setup)))))
3375 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3378 (define-public metis
3385 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3386 "metis-" version ".tar.gz"))
3389 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3391 `((release-monitoring-url
3392 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3393 (build-system cmake-build-system)
3395 `(("blas" ,openblas)))
3397 `(#:tests? #f ;no tests
3398 #:configure-flags `("-DSHARED=ON"
3399 ,(string-append "-DGKLIB_PATH=" (getcwd)
3400 "/metis-" ,version "/GKlib"))))
3401 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3402 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3404 "METIS is a set of serial programs for partitioning graphs, partitioning
3405 finite element meshes, and producing fill-reducing orderings for sparse
3406 matrices. The algorithms implemented in METIS are based on the multilevel
3407 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3409 (license license:asl2.0))) ;As of version 5.0.3
3411 (define-public p4est
3418 (uri (string-append "http://p4est.github.io/release/p4est-"
3422 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3423 (build-system gnu-build-system)
3425 `(("fortran" ,gfortran)
3430 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3431 (assoc-ref %build-inputs "blas")
3433 ,(string-append "LAPACK_LIBS=-L"
3434 (assoc-ref %build-inputs "lapack")
3436 #:phases (modify-phases %standard-phases
3437 (add-before 'check 'mpi-setup
3439 (home-page "http://www.p4est.org")
3440 (synopsis "Adaptive mesh refinement on forests of octrees")
3442 "The p4est software library enables the dynamic management of a
3443 collection of adaptive octrees, conveniently called a forest of octrees.
3444 p4est is designed to work in parallel and scales to hundreds of thousands of
3446 (license license:gpl2+)))
3448 (define-public p4est-openmpi
3449 (package (inherit p4est)
3450 (name "p4est-openmpi")
3453 ,@(package-inputs p4est)))
3455 (substitute-keyword-arguments (package-arguments p4est)
3456 ((#:configure-flags cf)
3457 ``("--enable-mpi" ,@,cf))))
3458 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3460 (define-public gsegrafix
3467 (uri (string-append "mirror://gnu/" name "/" name "-"
3471 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3472 (build-system gnu-build-system)
3474 `(#:configure-flags '("LDFLAGS=-lm")))
3476 `(("libgnomecanvas" ,libgnomecanvas)
3477 ("libbonoboui" ,libbonoboui)
3478 ("libgnomeui" ,libgnomeui)
3479 ("libgnomeprintui" ,libgnomeprintui)
3482 `(("pkg-config" ,pkg-config)))
3483 (home-page "https://www.gnu.org/software/gsegrafix/")
3484 (synopsis "GNOME application to create scientific and engineering plots")
3485 (description "GSEGrafix is an application which produces high-quality graphical
3486 plots for science and engineering. Plots are specified via simple ASCII
3487 parameter files and data files and are presented in an anti-aliased GNOME
3488 canvas. The program supports rectangular two-dimensional plots, histograms,
3489 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3490 to BMP, JPEG or PNG image formats.")
3491 (license license:gpl3+)))
3493 (define-public maxima
3500 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3501 version "-source/" name "-" version ".tar.gz"))
3504 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3505 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3506 (build-system gnu-build-system)
3509 ("gnuplot" ,gnuplot) ;for plots
3511 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3513 `(("texinfo" ,texinfo)
3515 ("python" ,python)))
3518 (list "--enable-gcl"
3519 (string-append "--with-posix-shell="
3520 (assoc-ref %build-inputs "bash")
3522 (string-append "--with-wish="
3523 (assoc-ref %build-inputs "tk")
3525 (let ((v ,(package-version tk)))
3526 (string-take v (string-index-right v #\.)))))
3527 ;; By default Maxima attempts to write temporary files to
3528 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3529 ;; Work around that.
3530 #:make-flags (list "TMPDIR=/tmp")
3532 (modify-phases %standard-phases
3533 (add-after 'unpack 'patch-paths
3534 (lambda* (#:key inputs #:allow-other-keys)
3535 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3536 (coreutils (assoc-ref inputs "coreutils"))
3537 (dirname (string-append coreutils "/bin/dirname"))
3538 (head (string-append coreutils "/bin/head"))
3539 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3540 (python (string-append (assoc-ref inputs "python")
3542 (substitute* "src/maxima.in"
3543 (("sed ") (string-append sed " "))
3544 (("dirname") dirname)
3546 (substitute* "doc/info/Makefile.in"
3547 (("/usr/bin/env perl") perl))
3548 (substitute* "doc/info/build_html.sh.in"
3549 (("python") python))
3551 (add-before 'check 'pre-check
3553 (chmod "src/maxima" #o555)
3557 ;; This is derived from the testing code in the "debian/rules" file
3558 ;; of Debian's Maxima package.
3559 ;; If Maxima can successfully run this, the binary to be installed
3565 "--batch-string=\"run_testsuite();\" "
3566 "| grep -q \"No unexpected errors found\""))))
3567 ;; Make sure the doc and emacs files are found in the
3568 ;; standard location. Also configure maxima to find gnuplot
3569 ;; without having it on the PATH.
3570 (add-after 'install 'post-install
3571 (lambda* (#:key outputs inputs #:allow-other-keys)
3572 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3573 (out (assoc-ref outputs "out"))
3574 (datadir (string-append out "/share/maxima/" ,version))
3575 (binutils (string-append (assoc-ref inputs "binutils")
3577 (with-directory-excursion out
3578 (mkdir-p "share/emacs")
3579 (mkdir-p "share/doc")
3581 (string-append datadir "/doc/")
3582 (string-append out "/share/doc/maxima"))
3583 (with-atomic-file-replacement
3584 (string-append datadir "/share/maxima-init.lisp")
3586 (format out "~a ~s~a~%"
3587 "(setf $gnuplot_command "
3588 (string-append gnuplot "/bin/gnuplot") ")")
3589 (dump-port in out))))
3590 ;; Ensure that Maxima will have access to the GNU binutils
3591 ;; components at runtime.
3592 (wrap-program (string-append out "/bin/maxima")
3593 `("PATH" prefix (,binutils))))
3595 (home-page "http://maxima.sourceforge.net")
3596 (synopsis "Numeric and symbolic expression manipulation")
3597 (description "Maxima is a system for the manipulation of symbolic and
3598 numerical expressions. It yields high precision numeric results by using
3599 exact fractions, arbitrary precision integers, and variable precision floating
3601 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3602 ;; Others simply say "GNU General Public License" without stating a
3603 ;; version (which implicitly means gpl1+).
3604 ;; At least one file (src/maxima.asd) says "version 2."
3605 ;; GPLv2 only is therefore the smallest subset.
3606 (license license:gpl2)))
3608 (define-public wxmaxima
3616 (url "https://github.com/wxMaxima-developers/wxmaxima")
3617 (commit (string-append "Version-" version))))
3618 (file-name (git-file-name name version))
3620 (base32 "0xj95zk16x8kac8qhzd5kvf3b00x7hgdw85da9ww63xyndvhh2lw"))))
3621 (build-system cmake-build-system)
3623 `(("gettext" ,gettext-minimal)))
3625 `(("wxwidgets" ,wxwidgets)
3628 ("adwaita-icon-theme" ,adwaita-icon-theme)
3630 ("shared-mime-info" ,shared-mime-info)))
3632 `(#:tests? #f ; tests fail non-deterministically
3634 (modify-phases %standard-phases
3635 (add-after 'unpack 'patch-doc-path
3637 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3638 ;; documentation. Only licensing information is placed there by
3640 (substitute* "src/Dirstructure.cpp"
3641 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3643 (add-after 'install 'wrap-program
3644 (lambda* (#:key inputs outputs #:allow-other-keys)
3645 (wrap-program (string-append (assoc-ref outputs "out")
3648 (,(string-append (assoc-ref inputs "maxima")
3650 ;; For GtkFileChooserDialog.
3651 `("GSETTINGS_SCHEMA_DIR" =
3652 (,(string-append (assoc-ref inputs "gtk+")
3653 "/share/glib-2.0/schemas")))
3654 `("XDG_DATA_DIRS" ":" prefix
3655 (;; Needed by gdk-pixbuf to know supported icon formats.
3657 (assoc-ref inputs "shared-mime-info") "/share")
3658 ;; The default icon theme of GTK+.
3660 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3662 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3663 (synopsis "Graphical user interface for the Maxima computer algebra system")
3665 "wxMaxima is a graphical user interface for the Maxima computer algebra
3666 system. It eases the use of Maxima by making most of its commands available
3667 through a menu system and by providing input dialogs for commands that require
3668 more than one argument. It also implements its own display engine that
3669 outputs mathematical symbols directly instead of depicting them with ASCII
3672 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3673 text and mathematical calculations to create documents, exporting of input and
3674 output to TeX, and a browser for Maxima's manual including command index and
3675 full text searching.")
3676 (license license:gpl2+)))
3678 (define-public armadillo
3684 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3688 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3689 (build-system cmake-build-system)
3690 (arguments `(#:tests? #f)) ; no test target
3692 `(("openblas" ,openblas)
3694 ("arpack" ,arpack-ng)))
3695 (home-page "http://arma.sourceforge.net/")
3696 (synopsis "C++ linear algebra library")
3698 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3699 between speed and ease of use. It is useful for algorithm development
3700 directly in C++, or quick conversion of research code into production
3701 environments. It can be used for machine learning, pattern recognition,
3702 signal processing, bioinformatics, statistics, econometrics, etc. The library
3703 provides efficient classes for vectors, matrices and cubes, as well as 150+
3704 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3705 (license license:asl2.0)))
3707 (define-public muparser
3708 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3709 ;; different hash. In order to make `guix package --upgrade` work correctly,
3710 ;; we set a Guix packaging revision.
3711 ;; When the next version of muparser is released, we can remove
3712 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3713 (let ((upstream-version "2.2.5")
3717 (version (string-append upstream-version "-" revision))
3722 (url "https://github.com/beltoforion/muparser")
3723 (commit (string-append "v" upstream-version))))
3724 (file-name (git-file-name name version))
3726 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3727 (build-system gnu-build-system)
3729 `(#:configure-flags '("--enable-samples=no")
3730 #:tests? #f)) ;no "check" target
3731 (home-page "http://muparser.beltoforion.de/")
3732 (synopsis "Fast parser library for mathematical expressions")
3734 "muParser is an extensible high performance math parser library. It is
3735 based on transforming an expression into a bytecode and precalculating constant
3737 (license license:expat))))
3739 (define-public openblas
3746 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3747 version "%20version.tar.gz"))
3748 (file-name (string-append name "-" version ".tar.gz"))
3751 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3752 (build-system gnu-build-system)
3754 `(#:test-target "test"
3755 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3756 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3757 ;; we need to disable substitutions.
3759 ,(let ((system (or (%current-target-system) (%current-system))))
3760 (or (string-prefix? "x86_64" system)
3761 (string-prefix? "i686" system)
3762 (string-prefix? "mips" system)
3763 (string-prefix? "aarch64" system)))
3765 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3767 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3769 ;; This is the maximum number of threads OpenBLAS will ever use (that
3770 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3771 ;; is used.) If we don't set it, the makefile sets it to the number
3772 ;; of cores of the build machine, which is obviously wrong.
3775 ;; Build the library for all supported CPUs. This allows
3776 ;; switching CPU targets at runtime with the environment variable
3777 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3778 ;; Unfortunately, this is not supported on non-x86 architectures,
3779 ;; where it leads to failed builds.
3780 ,@(let ((system (or (%current-target-system) (%current-system))))
3782 ((or (string-prefix? "x86_64" system)
3783 (string-prefix? "i686" system))
3784 '("DYNAMIC_ARCH=1"))
3785 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3786 ;; two available MIPS targets special extended instructions
3787 ;; for Loongson cores are used.
3788 ((string-prefix? "mips" system)
3789 '("TARGET=SICORTEX"))
3790 ;; On aarch64 force the generic 'armv8-a' target
3791 ((string-prefix? "aarch64" system)
3794 ;; no configure script
3796 (modify-phases %standard-phases
3798 (add-before 'build 'set-extralib
3799 (lambda* (#:key inputs #:allow-other-keys)
3800 ;; Get libgfortran found when building in utest.
3802 (string-append "-L" (assoc-ref inputs "fortran-lib")
3806 `(("fortran-lib" ,gfortran "lib")))
3809 ("fortran" ,gfortran)
3811 (home-page "https://www.openblas.net/")
3812 (synopsis "Optimized BLAS library based on GotoBLAS")
3814 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3815 (license license:bsd-3)))
3817 (define-public openblas-ilp64
3818 (package/inherit openblas
3819 (name "openblas-ilp64")
3820 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3822 (substitute-keyword-arguments (package-arguments openblas)
3823 ((#:make-flags flags '())
3824 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3826 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3827 (license license:bsd-3)))
3833 (home-page "https://github.com/flame/blis")
3836 (uri (git-reference (url home-page) (commit version)))
3839 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
3840 (file-name (git-file-name "blis" version))))
3842 `(("python" ,python)
3844 (build-system gnu-build-system)
3847 ((guix build gnu-build-system)
3850 #:test-target "test"
3852 (modify-phases %standard-phases
3854 (lambda* (#:key outputs
3857 (configure-flags '())
3859 ;; This is a home-made 'configure' script.
3860 (let* ((out (assoc-ref outputs "out"))
3861 ;; Guix-specific support for choosing the configuration
3862 ;; via #:configure-flags: see below for details.
3863 (config-flag-prefix "--blis-config=")
3864 (maybe-config-flag (find
3866 (string-prefix? config-flag-prefix s))
3868 (configure-flags (if maybe-config-flag
3869 (delete maybe-config-flag
3872 ;; Select the "configuration" to build.
3873 ;; The "generic" configuration is non-optimized but
3874 ;; portable (no assembly).
3875 ;; The "x86_64" configuration family includes
3876 ;; sub-configurations for all supported
3877 ;; x86_64 microarchitectures.
3878 ;; BLIS currently lacks runtime hardware detection
3879 ;; for other architectures: see
3880 ;; <https://github.com/flame/blis/commit/c534da6>.
3881 ;; Conservatively, we stick to "generic" on armhf,
3882 ;; aarch64, and ppc64le for now. (But perhaps
3883 ;; "power9", "cortexa9", and "cortexa57" might be
3884 ;; general enough to use?)
3885 ;; Another approach would be to use the "auto"
3886 ;; configuration and make this package
3887 ;; non-substitutable.
3888 ;; The build is fairly intensive, though.
3892 (substring maybe-config-flag
3893 (string-length config-flag-prefix)))
3894 ((string-prefix? "x86_64" (or target system))
3903 "--enable-threading=openmp"
3904 "--enable-verbose-make"
3907 (format #t "configure args: ~s~%" configure-args)
3912 (add-before 'check 'show-test-output
3914 ;; By default "make check" is silent. Make it verbose.
3915 (system "tail -F output.testsuite &")
3917 (synopsis "High-performance basic linear algebra (BLAS) routines")
3919 "BLIS is a portable software framework for instantiating high-performance
3920 BLAS-like dense linear algebra libraries. The framework was designed to
3921 isolate essential kernels of computation that, when optimized, immediately
3922 enable optimized implementations of most of its commonly used and
3923 computationally intensive operations. While BLIS exports a new BLAS-like API,
3924 it also includes a BLAS compatibility layer which gives application developers
3925 access to BLIS implementations via traditional BLAS routine calls.")
3926 (license license:bsd-3)))
3928 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
3929 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
3930 (define-public blis-knl (deprecated-package "blis-knl" blis))
3932 (define ignorance blis)
3934 (define-public openlibm
3942 (url "https://github.com/JuliaLang/openlibm")
3943 (commit (string-append "v" version))))
3944 (file-name (git-file-name name version))
3946 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3947 (build-system gnu-build-system)
3950 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3952 ;; no configure script
3953 (modify-phases %standard-phases (delete 'configure))
3954 #:tests? #f)) ;the tests are part of the default target
3955 (home-page "https://openlibm.org/")
3956 (synopsis "Portable C mathematical library (libm)")
3958 "OpenLibm is an effort to have a high quality, portable, standalone C
3959 mathematical library (libm). It can be used standalone in applications and
3960 programming language implementations. The project was born out of a need to
3961 have a good libm for the Julia programming language that worked consistently
3962 across compilers and operating systems, and in 32-bit and 64-bit
3964 ;; Each architecture has its own make target, and there is none for mips.
3965 (supported-systems (delete "mips64el-linux" %supported-systems))
3966 ;; See LICENSE.md for details.
3967 (license (list license:expat
3970 license:public-domain
3971 license:lgpl2.1+))))
3973 (define-public openspecfun
3975 (name "openspecfun")
3981 (url "https://github.com/JuliaLang/openspecfun")
3982 (commit (string-append "v" version))))
3983 (file-name (git-file-name name version))
3985 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3986 (build-system gnu-build-system)
3988 '(#:tests? #f ; no "check" target
3990 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3992 (modify-phases %standard-phases
3993 (delete 'configure)))) ; no configure script
3995 `(("fortran" ,gfortran)))
3996 (home-page "https://github.com/JuliaLang/openspecfun")
3997 (synopsis "Collection of special mathematical functions")
3999 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4000 portable package for Bessel Functions of a Complex Argument and Nonnegative
4001 Order; it contains subroutines for computing Bessel functions and Airy
4002 functions. Faddeeva allows computing the various error functions of arbitrary
4003 complex arguments (Faddeeva function, error function, complementary error
4004 function, scaled complementary error function, imaginary error function, and
4005 Dawson function); given these, one can also easily compute Voigt functions,
4006 Fresnel integrals, and similar related functions as well.")
4007 ;; Faddeeva is released under the Expat license; AMOS is included as
4008 ;; public domain software.
4009 (license (list license:expat license:public-domain))))
4011 (define-public suitesparse
4013 (name "suitesparse")
4019 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4020 (commit (string-append "v" version))))
4021 (file-name (git-file-name name version))
4024 "1zhkix58afw92s7p291prljdm3yi0pjg1kbi3lczdb8rb14jkz5n"))
4025 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4026 (modules '((guix build utils)))
4028 ;; Remove bundled metis source
4030 (delete-file-recursively "metis-5.1.0")
4032 (build-system gnu-build-system)
4034 `(#:tests? #f ;no "check" target
4036 (list (string-append "CC=" ,(cc-for-target))
4038 "MY_METIS_LIB=-lmetis"
4039 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4040 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4041 (assoc-ref %outputs "out")
4042 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4043 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4044 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4045 " -DCMAKE_SKIP_RPATH=TRUE"
4046 " -DCMAKE_BUILD_TYPE=Release"
4047 " -DCMAKE_INSTALL_LIBDIR=lib")
4048 (string-append "INSTALL_LIB="
4049 (assoc-ref %outputs "out") "/lib")
4050 (string-append "INSTALL_INCLUDE="
4051 (assoc-ref %outputs "out") "/include")
4054 (modify-phases %standard-phases
4055 (delete 'configure)))) ;no configure script
4063 `(("cmake" ,cmake-minimal)
4065 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4066 (synopsis "Suite of sparse matrix software")
4068 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4069 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4070 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4071 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4072 CXSparse, a concise sparse Cholesky factorization package; and many other
4075 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4077 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4078 (license (list license:gpl2+ license:lgpl2.1+))))
4080 (define-public atlas
4086 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4087 version "/atlas" version ".tar.bz2"))
4090 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4091 (build-system gnu-build-system)
4092 (home-page "http://math-atlas.sourceforge.net/")
4093 (inputs `(("gfortran" ,gfortran)
4094 ("lapack-tar" ,(package-source lapack))))
4095 (outputs '("out" "doc"))
4096 ;; For the moment we drop support for MIPS at it fails to compile. See
4097 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4098 (supported-systems (delete "mips64el-linux" %supported-systems))
4100 `(#:parallel-build? #f
4101 #:parallel-tests? #f
4103 ;; ATLAS tunes itself for the machine it is built on, as explained at
4104 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4105 ;; For this reason, we want users to build it locally instead of using
4109 #:modules ((srfi srfi-26)
4110 (guix build gnu-build-system)
4113 `(;; Generate position independent code suitable for dynamic libraries
4114 ;; and use WALL timer to get more accurate timing.
4115 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4118 ,,(if (string-match "64" (%current-system))
4121 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4122 ;; needed to compile C files before it is generated.
4123 "-Ss" "pmake" "make -j 1"
4124 ;; Probe is failing for MIPS. We therefore define the system
4125 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4126 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4127 ,,@(if (string-prefix? "mips" (%current-system))
4128 (list "-A" "49" "-V" "1")
4130 ;; Generate shared libraries.
4132 ;; Build a full LAPACK library.
4133 ,(string-append "--with-netlib-lapack-tarfile="
4134 (assoc-ref %build-inputs "lapack-tar")))
4136 (modify-phases %standard-phases
4137 (add-after 'install 'install-doc
4138 (lambda* (#:key outputs inputs #:allow-other-keys)
4139 (let ((doc (string-append (assoc-ref outputs "doc")
4140 "/share/doc/atlas")))
4142 (for-each (cut install-file <> doc)
4143 (find-files "../ATLAS/doc" ".*"))
4145 (add-after 'check 'check-pt
4146 (lambda _ (invoke "make" "ptcheck")))
4147 ;; Fix files required to run configure.
4148 (add-before 'configure 'fix-/bin/sh
4150 ;; Use `sh', not `/bin/sh'.
4151 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4155 ;; Fix /bin/sh in generated make files.
4156 (add-after 'configure 'fix-/bin/sh-in-generated-files
4158 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4162 ;; ATLAS configure program does not accepts the default flags
4163 ;; passed by the 'gnu-build-system'.
4165 (lambda* (#:key native-inputs inputs outputs
4166 (configure-flags '())
4167 #:allow-other-keys #:rest args)
4168 (let* ((prefix (assoc-ref outputs "out"))
4169 (bash (or (and=> (assoc-ref
4170 (or native-inputs inputs) "bash")
4171 (cut string-append <> "/bin/bash"))
4173 (flags `(,(string-append "--prefix=" prefix)
4175 (abs-srcdir (getcwd))
4176 (srcdir (string-append "../" (basename abs-srcdir))))
4177 (format #t "source directory: ~s (relative from build: ~s)~%"
4181 (format #t "build directory: ~s~%" (getcwd))
4182 (format #t "configure flags: ~s~%" flags)
4184 (string-append srcdir "/configure")
4186 (synopsis "Automatically Tuned Linear Algebra Software")
4188 "ATLAS is an automatically tuned linear algebra software library
4189 providing C and Fortran77 interfaces to a portably efficient BLAS
4190 implementation, as well as a few routines from LAPACK.
4192 Optimization occurs at build time. For this reason, the library is built on
4193 the machine where it is installed, without resorting to pre-built substitutes.
4195 Before building the library, CPU throttling should be disabled. This can be
4196 done in the BIOS, or, on GNU/Linux, with the following command:
4199 # cpupower --governor performance
4202 Failure to do so will result in a library with poor performance.")
4203 (license license:bsd-3)))
4212 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4213 version "/glm-" version ".zip"))
4215 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4216 (build-system cmake-build-system)
4218 `(#:phases (modify-phases %standard-phases
4220 (lambda* (#:key outputs #:allow-other-keys)
4221 ;; Since version 0.9.9.6, 'make install' is not supported
4222 ;; and we have to do it "manually". Upstream discussion:
4223 ;; <https://github.com/g-truc/glm/pull/968>.
4224 (let* ((source (string-append "../glm"))
4225 (out (assoc-ref outputs "out"))
4226 (inc (string-append out "/include"))
4227 (lib (string-append out "/lib"))
4228 (pkgconfig (string-append lib "/pkgconfig")))
4229 (with-directory-excursion source
4232 (copy-recursively "glm" (string-append inc "/glm"))
4233 (copy-recursively "cmake" (string-append lib "/cmake"))
4234 (call-with-output-file (string-append pkgconfig "/glm.pc")
4238 includedir=${prefix}/include
4241 Description: OpenGL Mathematics
4243 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4246 `(("unzip" ,unzip)))
4247 (home-page "https://glm.g-truc.net/")
4248 (synopsis "OpenGL Mathematics library")
4249 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4250 library for graphics software based on the OpenGL Shading Language (GLSL)
4252 (license license:expat)))
4254 (define-public lpsolve
4261 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4262 "/lp_solve_" version "_source.tar.gz"))
4265 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4266 (modules '((guix build utils)))
4269 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4271 ;; Pretend to be on a 64 bit platform to obtain a common directory
4272 ;; name for the build results on all architectures; nothing else
4273 ;; seems to depend on it.
4274 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4276 ;; The check for 'isnan' as it is written fails with
4277 ;; "non-floating-point argument in call to function
4278 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4279 ;; definition, which in turn leads to bad things. Fix the feature
4281 (("isnan\\(0\\)") "isnan(0.)"))
4283 (build-system gnu-build-system)
4285 `(#:tests? #f ; no check target
4287 (modify-phases %standard-phases
4288 (delete 'configure) ; no configure script
4291 (with-directory-excursion "lpsolve55"
4292 (invoke "bash" "ccc"))
4293 (with-directory-excursion "lp_solve"
4294 (invoke "bash" "ccc"))
4297 (lambda* (#:key outputs #:allow-other-keys)
4298 (let* ((out (assoc-ref outputs "out"))
4299 (bin (string-append out "/bin"))
4300 (lib (string-append out "/lib"))
4301 ;; This is where LibreOffice expects to find the header
4302 ;; files, and where they are installed by Debian.
4303 (include (string-append out "/include/lpsolve")))
4304 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4305 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4306 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4308 ;; Install a subset of the header files as on Debian
4309 ;; (plus lp_bit.h, which matches the regular expression).
4310 (for-each (lambda (name)
4311 (install-file name include))
4312 (find-files "." "lp_[HMSa-z].*\\.h$"))
4313 (with-directory-excursion "shared"
4314 (for-each (lambda (name)
4315 (install-file name include))
4316 (find-files "." "\\.h$")))
4318 (home-page "http://lpsolve.sourceforge.net/")
4319 (synopsis "Mixed integer linear programming (MILP) solver")
4321 "lp_solve is a mixed integer linear programming solver based on the
4322 revised simplex and the branch-and-bound methods.")
4323 (license license:lgpl2.1+)))
4325 (define-public dealii
4332 (uri (string-append "https://github.com/dealii/dealii/releases/"
4333 "download/v" version "/dealii-" version ".tar.gz"))
4336 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4337 (modules '((guix build utils)))
4339 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4341 (delete-file-recursively "bundled")
4343 (build-system cmake-build-system)
4351 ("arpack" ,arpack-ng)
4352 ("muparser" ,muparser)
4353 ("gfortran" ,gfortran)
4354 ("suitesparse" ,suitesparse))) ;for UMFPACK
4356 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4358 ;; Work around a bug in libsuitesparseconfig linking
4359 ;; see https://github.com/dealii/dealii/issues/4745
4360 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4361 (home-page "https://www.dealii.org")
4362 (synopsis "Finite element library")
4364 "Deal.II is a C++ program library targeted at the computational solution
4365 of partial differential equations using adaptive finite elements. The main
4366 aim of deal.II is to enable rapid development of modern finite element codes,
4367 using among other aspects adaptive meshes and a wide array of tools often used
4368 in finite element programs.")
4369 (license license:lgpl2.1+)))
4371 (define-public dealii-openmpi
4372 (package (inherit dealii)
4373 (name "dealii-openmpi")
4376 ;;Supported only with MPI:
4377 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4378 ("p4est" ,p4est-openmpi)
4379 ("petsc" ,petsc-openmpi)
4380 ("slepc" ,slepc-openmpi)
4381 ("metis" ,metis) ;for MUMPS
4382 ("scalapack" ,scalapack) ;for MUMPS
4383 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4384 ("arpack" ,arpack-ng-openmpi)
4385 ,@(fold alist-delete (package-inputs dealii)
4386 '("p4est" "arpack"))))
4388 (substitute-keyword-arguments (package-arguments dealii)
4389 ((#:configure-flags cf)
4390 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4392 ((#:phases phases '%standard-phases)
4393 `(modify-phases ,phases
4394 (add-before 'check 'mpi-setup
4395 ,%openmpi-setup)))))
4396 (synopsis "Finite element library (with MPI support)")))
4398 (define-public flann
4402 (home-page "https://github.com/mariusmuja/flann/")
4406 (uri (git-reference (url home-page) (commit version)))
4407 (file-name (git-file-name name version))
4410 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4411 (patches (search-patches "flann-cmake-3.11.patch"))))
4412 (build-system cmake-build-system)
4415 `(("unzip" ,unzip)))
4418 ;; FIXME: 'mkoctfile' fails with a linker error:
4419 ;; ld: cannot find -loctinterp
4420 ;; ld: cannot find -loctave
4421 ;; Disable it for now.
4422 ;;("octave" ,octave-cli)
4423 ("python" ,python-2) ; print syntax
4424 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4427 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4428 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4429 #:strip-directories '("lib" "lib64" "libexec"
4430 "bin" "sbin" "share/flann/octave")
4432 ;; Save 12 MiB by not installing .a files. Passing
4433 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4434 #:phases (modify-phases %standard-phases
4435 (add-after 'install 'remove-static-libraries
4436 (lambda* (#:key outputs #:allow-other-keys)
4437 (let* ((out (assoc-ref outputs "out"))
4438 (lib (string-append out "/lib")))
4439 (for-each delete-file
4440 (find-files lib "\\.a$"))
4443 #:tests? #f)) ; The test data are downloaded from the Internet.
4444 (synopsis "Library for approximate nearest neighbors computation")
4445 (description "FLANN is a library for performing fast approximate
4446 nearest neighbor searches in high dimensional spaces. It implements a
4447 collection of algorithms and a system for automatically choosing the best
4448 algorithm and optimum parameters depending on the dataset.
4450 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4451 (license (license:non-copyleft "file://COPYING"
4452 "See COPYING in the distribution."))))
4454 (define-public wcalc
4461 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4462 "wcalc-" version ".tar.bz2"))
4465 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4466 (build-system gnu-build-system)
4469 ("readline" ,readline)))
4470 (home-page "http://w-calc.sourceforge.net/index.php")
4471 (synopsis "Flexible command-line scientific calculator")
4472 (description "Wcalc is a very capable calculator. It has standard functions
4473 (sin, asin, and sinh for example, in either radians or degrees), many
4474 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4475 variables, a command history, hex/octal/binary input and output, unit
4476 conversions, embedded comments, and an expandable expression entry field. It
4477 evaluates expressions using the standard order of operations.")
4478 (license license:gpl2+)))
4487 (url "https://github.com/xaos-project/XaoS")
4488 (commit (string-append "release-" version))))
4489 (file-name (git-file-name name version))
4492 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4493 (build-system gnu-build-system)
4494 (native-inputs `(("gettext" ,gettext-minimal)
4496 ("qttools" ,qttools)))
4497 (inputs `(("libx11" ,libx11)
4501 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4502 ;; not enough for this package to install properly. These phases fix that.
4504 `(#:tests? #f ;no "check" target
4506 (modify-phases %standard-phases
4507 (add-before 'configure 'make-qt-deterministic
4509 ;; Make Qt deterministic.
4510 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4513 (lambda* (#:key outputs #:allow-other-keys)
4514 (let ((out (assoc-ref outputs "out")))
4515 ;; The DESTDIR is originally set to install the xaos binary to
4516 ;; the "bin" folder inside the build directory. Setting make
4517 ;; flags doesn't seem to change this.
4518 (substitute* "XaoS.pro"
4520 (string-append "DESTDIR=" out "/bin")))
4521 (substitute* "src/include/config.h"
4522 (("/usr/share/XaoS")
4523 (string-append out "/share/XaoS")))
4525 (add-after 'install 'install-data
4526 (lambda* (#:key outputs #:allow-other-keys)
4527 (let* ((out (assoc-ref outputs "out"))
4528 (share (string-append out "/share")))
4532 (copy-recursively folder
4533 (string-append share "/XaoS/" folder)))
4534 '("catalogs" "examples" "tutorial"))
4535 (install-file "xdg/xaos.png"
4536 (string-append share "/pixmaps"))
4537 (install-file "xdg/xaos.desktop"
4538 (string-append share "/applications")))
4540 (synopsis "Real-time fractal zoomer")
4541 (description "GNU XaoS is a graphical program that generates fractal
4542 patterns and allows you to zoom in and out of them infinitely in a fluid,
4543 continuous manner. It also includes tutorials that help to explain how fractals
4544 are built. It can generate many different fractal types such as the Mandelbrot
4546 (home-page "https://xaos-project.github.io/")
4547 (license license:gpl2+)))
4549 (define-public hypre
4557 (url "https://github.com/LLNL/hypre")
4558 (commit (string-append "v" version))))
4559 (file-name (git-file-name name version))
4561 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4562 (modules '((guix build utils)))
4565 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4566 ;; substitute the release date.
4567 (substitute* "src/utilities/HYPRE_utilities.h"
4568 (("Date Compiled: .*$")
4569 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4571 (build-system gnu-build-system)
4572 (outputs '("out" ; 6.1 MiB of headers and libraries
4573 "doc")) ; 4.8 MiB of documentation
4577 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4578 ("texlive" ,(texlive-union (list texlive-xypic
4580 texlive-latex-hyperref
4582 ("ghostscript" ,ghostscript)))
4584 `(("blas" ,openblas)
4585 ("lapack" ,lapack)))
4587 `(#:modules ((srfi srfi-1)
4588 ,@%gnu-build-system-modules)
4589 #:configure-flags '("--enable-shared"
4597 (modify-phases %standard-phases
4598 (add-before 'build 'set-HOME
4600 ;; FIXME: texlive-union does not find the built
4601 ;; metafonts, so it tries to generate them in HOME.
4602 (setenv "HOME" "/tmp")
4604 (add-before 'configure 'chdir-src
4605 (lambda _ (chdir "src")))
4607 (lambda* (#:key build target configure-flags
4608 #:allow-other-keys #:rest args)
4609 (let* ((configure (assoc-ref %standard-phases 'configure)))
4612 (list #:configure-flags
4613 (cons (string-append
4614 "--host=" (or target build))
4615 configure-flags)))))))
4616 (add-after 'build 'build-docs
4618 (invoke "make" "-Cdocs" "pdf" "html")))
4621 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4622 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4623 (invoke "make" "check" "CHECKRUN=")
4624 (for-each (lambda (filename)
4625 (let ((size (stat:size (stat filename))))
4626 (when (positive? size)
4627 (error (format #f "~a size ~d; error indication~%"
4629 (find-files "test" ".*\\.err$"))
4631 (add-after 'install 'install-docs
4632 (lambda* (#:key outputs #:allow-other-keys)
4633 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4634 (let* ((doc (assoc-ref outputs "doc"))
4635 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4636 (with-directory-excursion "docs"
4637 (for-each (lambda (base)
4638 (install-file (string-append base ".pdf") docdir)
4639 (copy-recursively base docdir)) ; html docs
4640 '("HYPRE_usr_manual"
4641 "HYPRE_ref_manual")))
4643 (home-page "http://www.llnl.gov/casc/hypre/")
4644 (synopsis "Library of solvers and preconditioners for linear equations")
4646 "HYPRE is a software library of high performance preconditioners and
4647 solvers for the solution of large, sparse linear systems of equations. It
4648 features multigrid solvers for both structured and unstructured grid
4650 (license license:lgpl2.1)))
4652 (define-public hypre-openmpi
4653 (package (inherit hypre)
4654 (name "hypre-openmpi")
4657 ,@(package-inputs hypre)))
4659 (substitute-keyword-arguments (package-arguments hypre)
4660 ((#:configure-flags flags)
4662 ,@(delete "--without-MPI" ,flags)))
4664 `(modify-phases ,phases
4665 (add-before 'check 'mpi-setup
4666 ,%openmpi-setup)))))
4667 (synopsis "Parallel solvers and preconditioners for linear equations")
4669 "HYPRE is a software library of high performance preconditioners and
4670 solvers for the solution of large, sparse linear systems of equations on
4671 parallel computers. It features parallel multigrid solvers for both
4672 structured and unstructured grid problems.")))
4674 (define-public matio
4681 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4682 "matio-" version ".tar.gz"))
4685 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
4686 (build-system gnu-build-system)
4689 ("hdf5" ,hdf5-1.8)))
4690 (home-page "http://matio.sourceforge.net/")
4691 (synopsis "Library for reading and writing MAT files")
4692 (description "Matio is a library for reading and writing MAT files. It
4693 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4694 (license license:bsd-2)))
4701 (origin (method url-fetch)
4702 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4703 "download/" version "/Vc-" version ".tar.gz"))
4706 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4707 (build-system cmake-build-system)
4710 '("-DBUILD_TESTING=ON"
4711 ;; By default, Vc will optimize for the CPU of the build machine.
4712 ;; Setting this to "none" makes it create portable binaries. See
4713 ;; "cmake/OptimizeForArchitecture.cmake".
4714 "-DTARGET_ARCHITECTURE=none")
4715 #:phases (modify-phases %standard-phases
4716 (add-after 'unpack 'copy-testdata
4717 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4718 (let ((testdata (assoc-ref (or native-inputs inputs)
4720 (copy-recursively testdata "tests/testdata")
4723 `(("virtest" ,virtest)
4725 ;; This is a submodule in the git project, but not part of the
4726 ;; released sources. See the git branch for the commit to take.
4727 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4731 (url "https://github.com/VcDevel/vc-testdata")
4732 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4733 (file-name (git-file-name "vc-testdata"
4734 (string-take commit 7)))
4737 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4738 (synopsis "SIMD vector classes for C++")
4739 (description "Vc provides portable, zero-overhead C++ types for explicitly
4740 data-parallel programming. It is a library designed to ease explicit
4741 vectorization of C++ code. Its types enable explicitly stating data-parallel
4742 operations on multiple values. The parallelism is therefore added via the type
4743 system. Vc has an intuitive API and provides portability between different
4744 compilers and compiler versions as well as portability between different vector
4745 instruction sets. Thus, an application written with Vc can be compiled for:
4748 @item SSE2 up to SSE4.2 or SSE4a
4751 @item NEON (in development)
4752 @item NVIDIA GPUs / CUDA (in development)
4754 (home-page "https://github.com/VcDevel/Vc")
4755 ;; "No support_???.cpp file exists for this architecture."
4756 (supported-systems '("x86_64-linux" "i686-linux"))
4757 (license license:bsd-3)))
4759 (define-public reducelcs
4760 ;; This is the last commit which is available upstream, no
4761 ;; release happened since 2010.
4762 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4766 (version (string-append "1.0-" revision "." (string-take commit 7)))
4771 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4773 (file-name (string-append name "-" version "-checkout"))
4776 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4777 (build-system gnu-build-system)
4779 `(("openlibm" ,openlibm)))
4781 `(#:tests? #f ; no tests
4783 (modify-phases %standard-phases
4784 (delete 'configure) ; No configure script exists.
4785 (replace 'install ; No install phase exists.
4786 (lambda* (#:key outputs #:allow-other-keys)
4787 (let* ((out (assoc-ref outputs "out"))
4788 (bin (string-append out "/bin")))
4789 (install-file "Approximation" bin)
4790 (install-file "CollectResults" bin)
4791 (install-file "GenerateInstances" bin)
4793 (synopsis "Approximate Longest Commons Subsequence computation tool")
4795 "@code{reduceLCS} is an implementation of the Reduce-Expand
4796 algorithm for LCS. It is a fast program to compute the approximate
4797 Longest Commons Subsequence of a set of strings.")
4798 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4799 (license license:gpl3+))))
4801 (define-public jacal
4808 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4811 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4812 (patches (search-patches "jacal-fix-texinfo.patch"))))
4813 (build-system gnu-build-system)
4816 (modify-phases %standard-phases
4817 (add-before 'build 'pre-build
4818 ;; Don't use upstream's script - it really doesn't fit into
4819 ;; Guix's functional paradigm.
4820 (lambda* (#:key inputs outputs #:allow-other-keys)
4821 (substitute* "Makefile"
4822 (("^install: install-script") "install: "))))
4823 (add-after 'install 'post-install
4824 ;; Instead, we provide our own simplified script.
4825 (lambda* (#:key inputs outputs #:allow-other-keys)
4826 (let ((wrapper (string-append (assoc-ref outputs "out")
4828 (format (open wrapper (logior O_WRONLY O_CREAT))
4829 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4830 "-e '(slib:load \"~a/lib/jacal/math\") "
4833 (assoc-ref inputs "scm")
4834 (assoc-ref outputs "out"))
4835 (chmod wrapper #o555))))
4837 (lambda* (#:key outputs #:allow-other-keys)
4838 (invoke "./configure"
4839 (string-append "--prefix="
4840 (assoc-ref outputs "out"))))))))
4841 (inputs `(("scm" ,scm)))
4842 (native-inputs `(("unzip" ,unzip)
4843 ("texinfo" ,texinfo)))
4844 (synopsis "Symbolic mathematics system")
4845 (description "GNU JACAL is an interactive symbolic mathematics program based on
4846 Scheme. It manipulate and simplify a range of mathematical expressions such
4847 as equations, scalars, vectors, and matrices.")
4848 (home-page "https://www.gnu.org/software/jacal/")
4849 (license license:gpl3+)))
4855 (home-page "https://github.com/Z3Prover/z3")
4858 (uri (git-reference (url home-page)
4859 (commit (string-append "z3-" version))))
4860 (file-name (git-file-name name version))
4863 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4864 (build-system gnu-build-system)
4866 `(#:imported-modules ((guix build python-build-system)
4867 ,@%gnu-build-system-modules)
4868 #:modules (((guix build python-build-system) #:select (site-packages))
4869 (guix build gnu-build-system)
4872 (modify-phases %standard-phases
4873 (add-after 'unpack 'enable-bytecode-determinism
4875 (setenv "PYTHONHASHSEED" "0")
4877 (add-after 'unpack 'fix-compatability
4878 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4880 (substitute* "src/util/mpz.cpp"
4881 (("#include <immintrin.h>") ""))
4883 (add-before 'configure 'bootstrap
4885 (invoke "python" "scripts/mk_make.py")))
4886 ;; work around gnu-build-system's setting --enable-fast-install
4887 ;; (z3's `configure' is a wrapper around the above python file,
4888 ;; which fails when passed --enable-fast-install)
4890 (lambda* (#:key inputs outputs #:allow-other-keys)
4891 (invoke "./configure"
4893 (string-append "--prefix=" (assoc-ref outputs "out"))
4894 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4895 (add-after 'configure 'change-directory
4899 (add-before 'check 'make-test-z3
4901 ;; Build the test suite executable.
4902 (invoke "make" "test-z3" "-j"
4903 (number->string (parallel-job-count)))))
4906 ;; Run all the tests that don't require arguments.
4907 (invoke "./test-z3" "/a"))))))
4910 ("python" ,python-wrapper)))
4911 (synopsis "Theorem prover")
4912 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4913 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4914 (license license:expat)))
4919 (version "2018.11.001")
4922 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4923 version "/elpa-" version ".tar.gz"))
4926 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4927 (build-system gnu-build-system)
4929 `(("fortran" ,gfortran)
4930 ("perl" ,perl))) ;for configure and deps
4932 `(("blas" ,openblas)))
4937 ;; ELPA unfortunately does not support runtime dispatch, so we can
4938 ;; only enable the "generic" kernels. See the "Cross compilation"
4939 ;; section of INSTALL.md.
4941 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4942 "--disable-avx" "--disable-avx2" "--disable-avx512"
4943 ,(string-append "CFLAGS=-O3 "
4944 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4945 "-ftree-vect-loop-version -ftree-vectorize "
4946 ,(let ((system (or (%current-target-system)
4947 (%current-system))))
4949 ((or (string-prefix? "x86_64" system)
4950 (string-prefix? "i686" system))
4953 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4955 (modify-phases %standard-phases
4956 (add-before 'configure 'patch-header-generation
4958 (substitute* "configure"
4959 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4960 (string-append & " CPP=\"$CPP\"")))
4962 (add-before 'check 'setup-tests
4964 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4965 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4966 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4967 ;; for Fortran. This also causes several tests to pass that
4968 ;; otherwise would otherwise fail with matrix size 5000; possibly
4969 ;; due to floating point tolerances that are too tight.
4970 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4971 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4972 (substitute* "Makefile"
4973 ;; Test scripts are generated, patch the shebang
4974 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4976 (home-page "https://elpa.mpcdf.mpg.de")
4977 (synopsis "Eigenvalue solvers for symmetric matrices")
4979 "The ELPA library provides efficient and scalable direct eigensolvers for
4980 symmetric matrices.")
4981 (license license:lgpl3)))
4983 (define-public elpa-openmpi
4984 (package (inherit elpa)
4985 (name "elpa-openmpi")
4988 ("scalapack" ,scalapack)
4989 ,@(package-inputs elpa)))
4991 (substitute-keyword-arguments (package-arguments elpa)
4992 ((#:configure-flags cf '())
4993 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4994 ((#:phases phases '%standard-phases)
4995 `(modify-phases ,phases
4996 (add-before 'check 'mpi-setup
4998 ;; Tests use 2 mpi tasks by default, use our remaining build
4999 ;; cores as OpenMP threads.
5000 (setenv "OMP_NUM_THREADS" (number->string
5001 (max (quotient (parallel-job-count) 2)
5003 (,%openmpi-setup)))))))
5004 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5006 (define-public elemental
5013 (url "https://github.com/elemental/Elemental")
5014 (commit (string-append "v" version))))
5015 (file-name (git-file-name name version))
5018 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5019 (build-system cmake-build-system)
5020 (home-page "https://github.com/elemental/Elemental")
5022 `(("gfortran" ,gfortran)))
5024 `(("blas" ,openblas)
5025 ("gfortran:lib" ,gfortran "lib")
5034 `(#:build-type "Release" ;default RelWithDebInfo not supported
5035 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5036 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5037 "-DEL_CACHE_WARNINGS:BOOL=YES"
5038 "-DEL_TESTS:BOOL=YES"
5039 "-DCMAKE_INSTALL_LIBDIR=lib"
5040 "-DGFORTRAN_LIB=gfortran")
5041 #:phases (modify-phases %standard-phases
5042 (add-before 'check 'mpi-setup
5044 (add-before 'check 'setup-tests
5046 ;; Parallelism is done at the MPI layer.
5047 (setenv "OMP_NUM_THREADS" "1")
5049 (add-after 'install 'remove-tests
5050 (lambda* (#:key outputs #:allow-other-keys)
5051 ;; Tests are installed, with no easy configuration
5052 ;; switch to prevent this, so delete them.
5053 (delete-file-recursively
5054 (string-append (assoc-ref outputs "out") "/bin"))
5056 (synopsis "Dense and sparse-direct linear algebra and optimization")
5057 (description "Elemental is a modern C++ library for distributed-memory
5058 dense and sparse-direct linear algebra, conic optimization, and lattice
5060 (license license:bsd-2)))
5062 (define-public mcrl2
5065 (version "202006.0")
5069 "https://www.mcrl2.org/download/release/mcrl2-"
5073 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
5078 ("qtbase" ,qtbase)))
5079 (build-system cmake-build-system)
5080 (synopsis "Toolset for the mCRL2 formal specification language")
5082 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5083 specification language for describing concurrent discrete event systems. Its
5084 toolset supports analysis and automatic verification, linearisation, simulation,
5085 state-space exploration and generation, and tools to optimise and analyse
5086 specifications. Also, state spaces can be manipulated, visualised and
5088 (home-page "https://mcrl2.org")
5089 (license license:boost1.0)))
5091 (define-public mcrl2-minimal
5094 (name "mcrl2-minimal")
5096 `(("boost" ,boost)))
5098 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5100 (define-public tcalc
5107 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5111 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5112 (build-system gnu-build-system)
5113 (synopsis "The terminal calculator")
5115 "The terminal calculator is a small program to help users of the GNU/Linux
5116 terminal do calculations simply and quickly. The formula to be calculated can
5117 be fed to @command{tcalc} through the command line.")
5118 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5119 (license license:gpl3+)))
5121 (define-public tiny-bignum
5122 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5124 (name "tiny-bignum")
5125 (version (git-version "0" "0" commit))
5130 (url "https://github.com/kokke/tiny-bignum-c")
5132 (file-name (git-file-name "tiny-bignum" commit))
5134 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5135 (build-system gnu-build-system)
5138 (modify-phases %standard-phases
5140 (add-after 'unpack 'patch-tests
5142 (substitute* "scripts/test_rand.py"
5144 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5147 (lambda* (#:key tests? #:allow-other-keys)
5149 (invoke "make" "test"))
5152 (lambda* (#:key outputs #:allow-other-keys)
5153 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5154 (doc (string-append (assoc-ref outputs "out") "/doc")))
5156 (install-file "bn.c" share)
5157 (install-file "bn.h" share)
5159 (install-file "LICENSE" doc)
5160 (install-file "README.md" doc))
5163 `(("python" ,python-wrapper)))
5164 (home-page "https://github.com/kokke/tiny-bignum-c")
5165 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5167 "This library provides portable Arbitrary-precision unsigned integer
5168 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5169 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5170 and comparisons are supported.")
5171 (license license:unlicense))))
5173 (define-public sundials
5180 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5181 "sundials-" version ".tar.gz"))
5184 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5185 (build-system cmake-build-system)
5187 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5189 `(("fortran" ,gfortran) ;for fcmix
5191 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5193 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5194 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5195 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5196 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5197 "-DEXAMPLES_INSTALL:BOOL=OFF"
5199 "-DFCMIX_ENABLE:BOOL=ON"
5201 "-DKLU_ENABLE:BOOL=ON"
5202 ,(string-append "-DKLU_INCLUDE_DIR="
5203 (assoc-ref %build-inputs "suitesparse")
5205 ,(string-append "-DKLU_LIBRARY_DIR="
5206 (assoc-ref %build-inputs "suitesparse")
5208 (home-page "https://computation.llnl.gov/projects/sundials")
5209 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5210 (description "SUNDIALS is a family of software packages implemented with
5211 the goal of providing robust time integrators and nonlinear solvers that can
5212 easily be incorporated into existing simulation codes.")
5213 (license license:bsd-3)))
5215 (define-public sundials-openmpi
5216 (package (inherit sundials)
5217 (name "sundials-openmpi")
5220 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5221 ,@(package-inputs sundials)))
5223 (substitute-keyword-arguments (package-arguments sundials)
5224 ((#:configure-flags flags '())
5225 `(cons* "-DMPI_ENABLE:BOOL=ON"
5226 "-DPETSC_ENABLE:BOOL=ON"
5227 (string-append "-DPETSC_INCLUDE_DIR="
5228 (assoc-ref %build-inputs "petsc")
5230 (string-append "-DPETSC_LIBRARY_DIR="
5231 (assoc-ref %build-inputs "petsc")
5234 ((#:phases phases '%standard-phases)
5235 `(modify-phases ,phases
5236 (add-before 'check 'mpi-setup
5237 ,%openmpi-setup)))))
5238 (synopsis "SUNDIALS with OpenMPI support")))
5240 (define-public combinatorial-blas
5242 (name "combinatorial-blas")
5247 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5249 (match (string-split version #\.)
5250 ((major minor patch)
5251 (string-append major minor "_" patch))) ;e.g. "16_2"
5255 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5256 (patches (search-patches "combinatorial-blas-awpm.patch"
5257 "combinatorial-blas-io-fix.patch"))))
5258 (build-system cmake-build-system)
5261 ("test-data" ,(origin
5263 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5264 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5267 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5269 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5270 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5271 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5273 (modify-phases %standard-phases
5274 (add-before 'check 'mpi-setup
5276 (add-before 'check 'test-setup
5277 (lambda* (#:key inputs #:allow-other-keys)
5278 (setenv "OMP_NUM_THREADS" "2")
5279 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5280 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5281 (synopsis "Linear algebra primitives for graph analytics")
5282 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5283 distributed-memory parallel graph library offering a small but powerful set of
5284 linear algebra primitives specifically targeting graph analytics.")
5286 license:gpl2+ ;include/psort/(funnel|sort)*.h
5287 license:x11 ;usort and psort
5288 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5290 (define-public dune-common
5292 (name "dune-common")
5297 (uri (string-append "https://dune-project.org/download/"
5298 version "/dune-common-" version ".tar.gz"))
5301 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5302 (build-system cmake-build-system)
5305 (modify-phases %standard-phases
5306 (add-after 'build 'build-tests
5307 (lambda* (#:key make-flags #:allow-other-keys)
5308 (apply invoke "make" "build_tests" make-flags))))))
5312 ("openblas" ,openblas)
5314 ("superlu" ,superlu)))
5316 `(("gfortran" ,gfortran)
5317 ("pkg-config" ,pkg-config)))
5318 (home-page "https://dune-project.org/")
5319 (synopsis "Distributed and Unified Numerics Environment")
5320 (description "DUNE, the Distributed and Unified Numerics Environment is a
5321 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5322 grid-based methods. It supports the easy implementation of methods like
5323 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5324 Differences} (FD).")
5325 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5326 (license license:gpl2)))
5328 (define-public dune-geometry
5330 (name "dune-geometry")
5335 (uri (string-append "https://dune-project.org/download/"
5336 version "/dune-geometry-" version ".tar.gz"))
5339 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5340 (build-system cmake-build-system)
5343 (modify-phases %standard-phases
5344 (add-after 'build 'build-tests
5345 (lambda* (#:key make-flags #:allow-other-keys)
5346 (apply invoke "make" "build_tests" make-flags))))))
5348 `(("dune-common" ,dune-common)
5350 ("openblas" ,openblas)
5352 ("python" ,python)))
5354 `(("gfortran" ,gfortran)
5355 ("pkg-config" ,pkg-config)))
5356 (home-page "https://dune-project.org/")
5357 (synopsis "Distributed and Unified Numerics Environment")
5358 (description "DUNE, the Distributed and Unified Numerics Environment is a
5359 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5360 grid-based methods. It supports the easy implementation of methods like
5361 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5364 This package contains the basic DUNE geometry classes.")
5365 ;; GPL version 2 with "runtime exception"
5366 (license license:gpl2)))
5368 (define-public dune-uggrid
5370 (name "dune-uggrid")
5376 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5377 (commit (string-append "v" version))))
5378 (file-name (git-file-name name version))
5381 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5382 (build-system cmake-build-system)
5385 (modify-phases %standard-phases
5386 (add-after 'build 'build-tests
5387 (lambda* (#:key make-flags #:allow-other-keys)
5388 (apply invoke "make" "build_tests" make-flags))))))
5390 `(("dune-common" ,dune-common)))
5392 `(("gfortran" ,gfortran)
5393 ("pkg-config" ,pkg-config)))
5394 (home-page "https://dune-project.org/")
5395 (synopsis "Distributed and Unified Numerics Environment")
5396 (description "DUNE, the Distributed and Unified Numerics Environment is a
5397 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5398 grid-based methods. It supports the easy implementation of methods like
5399 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5402 This package contains the DUNE UG grid classes.")
5403 (license license:lgpl2.1)))
5405 (define-public dune-grid
5412 (uri (string-append "https://dune-project.org/download/"
5413 version "/dune-grid-" version ".tar.gz"))
5416 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5417 (build-system cmake-build-system)
5420 (modify-phases %standard-phases
5421 (add-after 'build 'build-tests
5422 (lambda* (#:key make-flags #:allow-other-keys)
5423 (apply invoke "make" "build_tests" make-flags))))))
5425 `(("dune-common" ,dune-common)
5426 ("dune-geometry" ,dune-geometry)
5429 ("openblas" ,openblas)
5430 ("python" ,python)))
5432 `(("dune-uggrid" ,dune-uggrid)))
5434 `(("gfortran" ,gfortran)
5435 ("pkg-config" ,pkg-config)))
5436 (home-page "https://dune-project.org/")
5437 (synopsis "Distributed and Unified Numerics Environment")
5438 (description "DUNE, the Distributed and Unified Numerics Environment is a
5439 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5440 grid-based methods. It supports the easy implementation of methods like
5441 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5444 This package contains the basic DUNE grid classes.")
5445 ;; GPL version 2 with "runtime exception"
5446 (license license:gpl2)))
5448 (define-public dune-istl
5455 (uri (string-append "https://dune-project.org/download/"
5456 version "/dune-istl-" version ".tar.gz"))
5459 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5460 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5461 (build-system cmake-build-system)
5464 (modify-phases %standard-phases
5465 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5466 ;; the stdlib types when the gfortran header is used. Remove gfortran
5467 ;; from CPLUS_INCLUDE_PATH as a workaround.
5468 (add-after 'set-paths 'hide-gfortran
5469 (lambda* (#:key inputs #:allow-other-keys)
5470 (let ((gfortran (assoc-ref inputs "gfortran")))
5471 (setenv "CPLUS_INCLUDE_PATH"
5473 (delete (string-append gfortran "/include/c++")
5474 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5477 (add-after 'build 'build-tests
5478 (lambda* (#:key make-flags #:allow-other-keys)
5479 (apply invoke "make" "build_tests" make-flags))))))
5481 `(("dune-common" ,dune-common)
5484 ("suitesparse" ,suitesparse)
5485 ("superlu" ,superlu)
5486 ("openblas" ,openblas)
5488 ("python" ,python)))
5490 `(("gfortran" ,gfortran)
5491 ("pkg-config" ,pkg-config)))
5492 (home-page "https://dune-project.org/")
5493 (synopsis "Distributed and Unified Numerics Environment")
5494 (description "DUNE, the Distributed and Unified Numerics Environment is a
5495 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5498 This is the iterative solver template library which provides generic sparse
5499 matrix/vector classes and a variety of solvers based on these classes. A
5500 special feature is the use of templates to exploit the recursive block
5501 structure of finite element matrices at compile time. Available solvers
5502 include Krylov methods, (block-) incomplete decompositions and
5503 aggregation-based algebraic multigrid.")
5504 ;; GPL version 2 with "runtime exception"
5505 (license license:gpl2)))
5507 (define-public dune-localfunctions
5509 (name "dune-localfunctions")
5514 (uri (string-append "https://dune-project.org/download/"
5515 version "/dune-localfunctions-" version ".tar.gz"))
5518 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5519 (build-system cmake-build-system)
5522 (modify-phases %standard-phases
5523 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5524 ;; and fails to find the stdlib types when the gfortran header is used.
5525 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5526 (add-after 'set-paths 'hide-gfortran
5527 (lambda* (#:key inputs #:allow-other-keys)
5528 (let ((gfortran (assoc-ref inputs "gfortran")))
5529 (setenv "CPLUS_INCLUDE_PATH"
5531 (delete (string-append gfortran "/include/c++")
5532 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5535 (add-after 'build 'build-tests
5536 (lambda* (#:key make-flags #:allow-other-keys)
5537 (apply invoke "make" "build_tests" make-flags))))))
5539 `(("dune-common" ,dune-common)
5540 ("dune-geometry" ,dune-geometry)
5543 ("superlu" ,superlu)
5546 `(("gfortran" ,gfortran)
5547 ("pkg-config" ,pkg-config)))
5548 (home-page "https://dune-project.org/")
5549 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5550 (description "This DUNE module provides interface and implementation for
5551 shape functions defined on the DUNE reference elements. In addition to the
5552 shape function, interpolation operators and special keys are provided which
5553 can be used to assemble global function spaces on finite-element grids.
5555 This package provides an interface and implementation for shape functions
5556 defined on the DUNE reference elements. In addition to the shape function,
5557 interpolation operators and special keys are provided which can be used to
5558 assemble global function spaces on finite-element grids.")
5559 ;; GPL version 2 with "runtime exception"
5560 (license license:gpl2)))
5562 (define-public dune-alugrid
5564 (name "dune-alugrid")
5565 (version "2.7.0-git-81d35682")
5570 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5571 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5572 (file-name (git-file-name name version))
5575 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5576 (build-system cmake-build-system)
5579 (modify-phases %standard-phases
5580 (add-after 'unpack 'patch-include
5582 (substitute* "dune/alugrid/test/test-alugrid.cc"
5583 (("doc/grids/gridfactory/testgrids")
5584 "doc/dune-grid/grids/gridfactory/testgrids"))
5586 (add-after 'build 'build-tests
5587 (lambda* (#:key inputs make-flags #:allow-other-keys)
5588 (setenv "CPLUS_INCLUDE_PATH"
5589 (string-append (assoc-ref inputs "dune-grid") "/share"))
5590 (apply invoke "make" "build_tests" make-flags))))))
5592 `(("dune-common" ,dune-common)
5593 ("dune-geometry" ,dune-geometry)
5594 ("dune-grid" ,dune-grid)
5597 ("openblas" ,openblas)
5599 ("superlu" ,superlu)
5603 `(("gfortran" ,gfortran)
5604 ("pkg-config" ,pkg-config)))
5605 (home-page "https://dune-project.org/")
5606 (synopsis "Distributed and Unified Numerics Environment")
5607 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5608 implementation of the DUNE grid interface supporting either simplices or
5610 (license license:gpl2+)))
5612 (define-public dune-subgrid
5614 (name "dune-subgrid")
5615 (version "2.7.0-git-2103a363")
5620 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5621 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5622 (file-name (git-file-name name version))
5625 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5626 (build-system cmake-build-system)
5629 (modify-phases %standard-phases
5630 (add-after 'build 'build-tests
5631 (lambda* (#:key make-flags #:allow-other-keys)
5632 (apply invoke "make" "build_tests" make-flags))))))
5634 `(("dune-common" ,dune-common)
5635 ("dune-geometry" ,dune-geometry)
5636 ("dune-grid" ,dune-grid)
5639 ("openblas" ,openblas)
5642 `(("gfortran" ,gfortran)
5643 ("pkg-config" ,pkg-config)))
5644 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5645 (synopsis "Distributed and Unified Numerics Environment")
5646 (description "The dune-subgrid module marks elements of
5647 another hierarchical dune grid. The set of marked elements can then be
5648 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5649 provides the full grid interface including adaptive mesh refinement.")
5650 (license license:gpl2+)))
5652 (define-public dune-typetree
5654 (name "dune-typetree")
5660 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5661 (commit (string-append "v" version))))
5662 (file-name (git-file-name name version))
5665 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5666 (build-system cmake-build-system)
5669 (modify-phases %standard-phases
5670 (add-after 'build 'build-tests
5671 (lambda* (#:key make-flags #:allow-other-keys)
5672 (apply invoke "make" "build_tests" make-flags))))))
5674 `(("dune-common" ,dune-common)
5676 ("openblas" ,openblas)
5679 ("superlu" ,superlu)
5682 `(("gfortran" ,gfortran)
5683 ("pkg-config" ,pkg-config)))
5684 (home-page "https://dune-project.org/")
5685 (synopsis "Distributed and Unified Numerics Environment")
5686 (description "TypeTree is a template library for constructing and
5687 operating on statically typed trees of objects.")
5688 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5689 (license (list license:lgpl3+ license:gpl2))))
5691 (define-public dune-functions
5693 (name "dune-functions")
5699 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5700 (commit (string-append "v" version))))
5701 (file-name (git-file-name name version))
5704 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5705 (build-system cmake-build-system)
5708 (modify-phases %standard-phases
5709 (add-after 'unpack 'disable-failing-tests
5712 ;; unable to load GMSH file in this test
5713 "--exclude-regex gridviewfunctionspacebasistest")
5715 (add-after 'build 'build-tests
5716 (lambda* (#:key make-flags #:allow-other-keys)
5717 (apply invoke "make" "build_tests" make-flags))))))
5719 `(("dune-common" ,dune-common)
5720 ("dune-istl" ,dune-istl)
5721 ("dune-localfunctions" ,dune-localfunctions)
5722 ("dune-grid" ,dune-grid)
5723 ("dune-geometry" ,dune-geometry)
5724 ("dune-typetree" ,dune-typetree)
5725 ("openblas" ,openblas)
5728 ("superlu" ,superlu)
5731 `(("gfortran" ,gfortran)
5732 ("pkg-config" ,pkg-config)))
5733 (home-page "https://dune-project.org/")
5734 (synopsis "Distributed and Unified Numerics Environment")
5735 (description "The dune-functions module provides an abstraction layer for
5736 global finite element functions. Its two main concepts are functions
5737 implemented as callable objects, and bases of finite element spaces.")
5738 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5739 (license (list license:lgpl3+ license:gpl2))))
5741 (define-public dune-pdelab
5743 (name "dune-pdelab")
5744 (version "2.7.0-git-476fe437")
5749 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5750 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5751 (file-name (git-file-name name version))
5754 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5755 (build-system cmake-build-system)
5756 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5758 `(("dune-common" ,dune-common)
5759 ("dune-istl" ,dune-istl)
5760 ("dune-localfunctions" ,dune-localfunctions)
5761 ("dune-geometry" ,dune-geometry)
5762 ("dune-grid" ,dune-grid)
5763 ("dune-typetree" ,dune-typetree)
5764 ("dune-functions" ,dune-functions)
5766 ("openblas" ,openblas)
5770 ("superlu" ,superlu)
5773 `(("gfortran" ,gfortran)
5774 ("pkg-config" ,pkg-config)))
5775 (home-page "https://dune-project.org/")
5776 (synopsis "Differential equations solver toolbox")
5777 (description "PDELab is a partial differential equations solver toolbox
5778 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5779 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5780 (license (list license:lgpl3+ license:gpl2))))
5782 (define add-openmpi-to-dune-package
5783 (let ((dune-package?
5784 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5787 (if (dune-package? p)
5788 (package (inherit p)
5789 (name (string-append (package-name p) "-openmpi"))
5790 (inputs `(,@(package-inputs p)
5791 ("openmpi" ,openmpi)))
5793 (substitute-keyword-arguments (package-arguments p)
5794 ((#:phases phases '%standard-phases)
5795 `(modify-phases ,phases
5796 (add-before 'check 'mpi-setup
5797 ,%openmpi-setup)))))
5798 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5800 (negate dune-package?))))
5802 (define-public dune-common-openmpi
5803 (add-openmpi-to-dune-package dune-common))
5805 (define-public dune-geometry-openmpi
5806 (add-openmpi-to-dune-package dune-geometry))
5808 (define-public dune-istl-openmpi
5809 (add-openmpi-to-dune-package dune-istl))
5811 (define-public dune-typetree-openmpi
5812 (add-openmpi-to-dune-package dune-typetree))
5814 (define-public dune-uggrid-openmpi
5815 (add-openmpi-to-dune-package dune-uggrid))
5817 (define-public dune-grid-openmpi
5818 (add-openmpi-to-dune-package dune-grid))
5820 (define-public dune-alugrid-openmpi
5821 (add-openmpi-to-dune-package dune-alugrid))
5823 (define-public dune-subgrid-openmpi
5824 (add-openmpi-to-dune-package dune-subgrid))
5826 (define-public dune-localfunctions-openmpi
5827 (add-openmpi-to-dune-package dune-localfunctions))
5829 (define-public dune-functions-openmpi
5830 (add-openmpi-to-dune-package dune-functions))
5832 (define-public dune-pdelab-openmpi
5833 (add-openmpi-to-dune-package dune-pdelab))
5835 (define-public mlucas
5843 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5845 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5846 (build-system gnu-build-system)
5848 `(("python2" ,python-2)))
5850 `(#:tests? #f ; no tests
5852 (modify-phases %standard-phases
5856 (call-with-output-file "Makefile"
5858 (format port "CC = gcc
5859 CFLAGS = -O3 ~a -DUSE_THREADS
5860 LDLIBS = -lm -lpthread -lrt
5861 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5863 ,(let ((system (or (%current-target-system)
5864 (%current-system))))
5866 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5870 (lambda* (#:key outputs #:allow-other-keys)
5871 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5872 (install-file "Mlucas" bin)
5873 (install-file "primenet.py" bin))
5875 (home-page "https://www.mersenne.org")
5876 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5877 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5878 numbers in search of a world-record prime. You may use it to test any
5879 suitable number as you wish, but it is preferable that you do so in a
5880 coordinated fashion, as part of the Great Internet Mersenne Prime
5881 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5882 management via the GIMPS project's Primenet server.")
5883 (license license:gpl2+)))
5885 (define-public nauty
5893 "https://pallini.di.uniroma1.it/"
5894 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5896 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5897 (build-system gnu-build-system)
5898 (outputs '("out" "lib"))
5900 `(#:test-target "checks"
5901 #:configure-flags '("--enable-generic") ;prevent -march-native
5903 (modify-phases %standard-phases
5904 ;; Default make target does not build all available
5905 ;; executables. Create them now.
5906 (add-after 'build 'build-extra-programs
5908 (for-each (lambda (target) (invoke "make" target))
5909 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5911 ;; Upstream does not provide any install target.
5913 (lambda* (#:key outputs #:allow-other-keys)
5914 (let* ((out (assoc-ref outputs "out"))
5915 (lib-output (assoc-ref outputs "lib"))
5916 (bin (string-append out "/bin"))
5917 (doc (string-append out "/share/doc/nauty/"))
5918 (include (string-append lib-output "/include/nauty"))
5919 (lib (string-append lib-output "/lib/nauty")))
5920 (for-each (lambda (f) (install-file f bin))
5921 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5922 "bliss2dre" "catg" "checks6" "complg" "converseg"
5923 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5924 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5925 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5926 "gentourng" "gentreeg" "hamheuristic" "labelg"
5927 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5928 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5929 "sumlines" "twohamg" "underlyingg" "vcolg"
5930 "watercluster2" "NRswitchg"))
5931 (for-each (lambda (f) (install-file f include))
5932 (find-files "." "\\.h$"))
5933 (for-each (lambda (f) (install-file f lib))
5934 (find-files "." "\\.a$"))
5935 (for-each (lambda (f) (install-file f doc))
5936 (append '("formats.txt" "README" "schreier.txt")
5937 (find-files "." "\\.pdf$")))))))))
5939 `(("gmp" ,gmp))) ;for sumlines
5940 (home-page "https://pallini.di.uniroma1.it/")
5941 (synopsis "Library for graph automorphisms")
5942 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5943 procedures for computing automorphism groups of graphs and digraphs.
5945 @code{nauty} computes graph information in the form of a set of
5946 generators, the size of the group, and the orbits of the group; it can
5947 also produce a canonical label. The @code{nauty} suite is written in
5948 C and comes with a command-line interface, a collection of
5949 command-line tools, and an Application Programming Interface (API).
5951 This package provides the static libraries required to run programs
5952 compiled against the nauty library.")
5953 (license license:asl2.0)))
5962 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5963 "ftp/releases/" version
5964 "/ppl-" version ".tar.gz"))
5967 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5968 (build-system gnu-build-system)
5974 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5976 "Parma Polyhedra Library for computations with polyhedra")
5978 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5979 especially targeted at applications in the field of analysis and
5980 verification of complex systems. These abstractions include convex
5981 polyhedra, defined as the intersection of a finite number of (open or
5982 closed) halfspaces, each described by a linear inequality (strict or
5983 non-strict) with rational coefficients; some special classes of polyhedra
5984 shapes that offer interesting complexity/precision tradeoffs; and grids
5985 which represent regularly spaced points that satisfy a set of linear
5986 congruence relations. The library also supports finite powersets and
5987 products of (any kind of) polyhedra and grids, a mixed integer linear
5988 programming problem solver using an exact-arithmetic version of the simplex
5989 algorithm, a parametric integer programming solver, and primitives for
5990 termination analysis via the automatic synthesis of linear ranking
5992 (license license:gpl3+)))
5994 (define-public speedcrunch
5996 (name "speedcrunch")
6002 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6003 (commit (string-append "release-" version))))
6004 (file-name (git-file-name name version))
6007 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6008 (build-system cmake-build-system)
6009 (inputs `(("qtbase" ,qtbase)))
6010 (native-inputs `(("qttools" ,qttools)))
6013 (modify-phases %standard-phases
6014 (add-after 'unpack 'chdir-to-src
6015 (lambda _ (chdir "src") #t)))))
6016 (synopsis "High-precision scientific calculator")
6018 "SpeedCrunch is a high-precision scientific calculator. It features a
6019 syntax-highlighted scrollable display and is designed to be fully used via
6020 keyboard. Some distinctive features are auto-completion of functions and
6021 variables, a formula book, and quick insertion of constants from various
6022 fields of knowledge.")
6023 (home-page "https://speedcrunch.org/")
6024 (license license:gpl2+)))
6026 (define-public minisat
6027 ;; This is the last commit which is available upstream, no
6028 ;; release happened since 2010.
6029 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6033 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6038 (url "https://github.com/niklasso/minisat")
6040 (file-name (string-append name "-" version "-checkout"))
6043 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6045 (search-patches "minisat-friend-declaration.patch"
6046 "minisat-install.patch"))))
6047 (build-system gnu-build-system)
6049 '(#:make-flags (list (string-append "prefix=" %output))
6050 #:tests? #f ;no check target
6052 (modify-phases %standard-phases
6053 (delete 'configure))))
6055 `(("zlib:static" ,zlib "static")
6058 "Small, yet efficient, SAT solver")
6060 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6061 researchers and developers alike to get started on SAT.")
6063 "http://minisat.se/MiniSat.html")
6064 (license license:expat))))
6066 (define-public libqalculate
6068 (name "libqalculate")
6074 (url "https://github.com/Qalculate/libqalculate/")
6075 (commit (string-append "v" version))))
6076 (file-name (git-file-name name version))
6078 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
6080 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6081 (build-system gnu-build-system)
6083 `(("pkg-config" ,pkg-config)
6084 ("gettext" ,gettext-minimal)
6085 ("intltool" ,intltool)
6086 ("automake" ,automake)
6087 ("autoconf" ,autoconf)
6088 ("libtool" ,libtool)
6089 ("doxygen" ,doxygen)
6094 ("libxml2" ,libxml2)
6097 ("gnuplot" ,gnuplot)
6098 ("readline" ,readline)
6099 ("libiconv" ,libiconv)))
6102 (modify-phases %standard-phases
6103 (add-before 'bootstrap 'setenv
6104 ;; Prevent the autogen.sh script to carry out the configure
6105 ;; script, which has not yet been patched to replace /bin/sh.
6107 (setenv "NOCONFIGURE" "TRUE")
6109 (home-page "https://qalculate.github.io/")
6110 (synopsis "Multi-purpose cli desktop calculator and library")
6112 "Libqalculate is a multi-purpose cli desktop calculator and library.
6113 It provides basic and advanced functionality. Features include customizable
6114 functions, unit calculations, and conversions, physical constants, symbolic
6115 calculations (including integrals and equations), arbitrary precision,
6116 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6118 (license license:gpl2+)))
6120 (define-public qalculate-gtk
6122 (name "qalculate-gtk")
6128 (url "https://github.com/Qalculate/qalculate-gtk/")
6129 (commit (string-append "v" version))))
6130 (file-name (git-file-name name version))
6132 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
6133 (build-system glib-or-gtk-build-system)
6135 `(("pkg-config" ,pkg-config)
6136 ("intltool" ,intltool)
6137 ("automake" ,automake)
6138 ("autoconf" ,autoconf)
6139 ("libtool" ,libtool)
6144 ("libqalculate" ,libqalculate)
6145 ("libxml2" ,libxml2)
6150 (modify-phases %standard-phases
6151 (add-before 'bootstrap 'setenv
6152 ;; Prevent the autogen.sh script to carry out the configure
6153 ;; script, which has not yet been patched to replace /bin/sh.
6155 (setenv "NOCONFIGURE" "TRUE")
6157 (add-before 'check 'add-pot-file
6158 ;; the file contains translations and are currently not in use
6159 ;; left out on purpose so add it to POTFILES.skip
6161 (with-output-to-file "po/POTFILES.skip"
6163 (format #t "data/shortcuts.ui~%")
6166 (home-page "https://qalculate.github.io/")
6167 (synopsis "Multi-purpose graphical desktop calculator")
6169 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6170 multi-purpose GUI desktop calculator. It provides basic and advanced
6171 functionality. Features include customizable functions, unit calculations,
6172 and conversions, physical constants, symbolic calculations (including
6173 integrals and equations), arbitrary precision, uncertainty propagation,
6174 interval arithmetic, plotting.")
6175 (license license:gpl2+)))