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, 2021 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, 2021 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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) 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, 2021 Marius Bakke <marius@gnu.org>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018, 2021 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, 2021 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>
48 ;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
49 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
50 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
51 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
53 ;;; This file is part of GNU Guix.
55 ;;; GNU Guix is free software; you can redistribute it and/or modify it
56 ;;; under the terms of the GNU General Public License as published by
57 ;;; the Free Software Foundation; either version 3 of the License, or (at
58 ;;; your option) any later version.
60 ;;; GNU Guix is distributed in the hope that it will be useful, but
61 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
62 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63 ;;; GNU General Public License for more details.
65 ;;; You should have received a copy of the GNU General Public License
66 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
68 (define-module (gnu packages maths)
69 #:use-module (ice-9 regex)
70 #:use-module (ice-9 match)
71 #:use-module (gnu packages)
72 #:use-module ((guix licenses) #:prefix license:)
73 #:use-module (guix packages)
74 #:use-module (guix download)
75 #:use-module (guix git-download)
76 #:use-module (guix gexp)
77 #:use-module (guix utils)
78 #:use-module ((guix build utils) #:select (alist-replace))
79 #:use-module (guix build-system cmake)
80 #:use-module (guix build-system glib-or-gtk)
81 #:use-module (guix build-system gnu)
82 #:use-module (guix build-system ocaml)
83 #:use-module (guix build-system python)
84 #:use-module (guix build-system ruby)
85 #:use-module (gnu packages algebra)
86 #:use-module (gnu packages audio)
87 #:use-module (gnu packages autotools)
88 #:use-module (gnu packages base)
89 #:use-module (gnu packages bash)
90 #:use-module (gnu packages bison)
91 #:use-module (gnu packages boost)
92 #:use-module (gnu packages check)
93 #:use-module (gnu packages cmake)
94 #:use-module (gnu packages compression)
95 #:use-module (gnu packages coq)
96 #:use-module (gnu packages curl)
97 #:use-module (gnu packages cyrus-sasl)
98 #:use-module (gnu packages dbm)
99 #:use-module (gnu packages documentation)
100 #:use-module (gnu packages elf)
101 #:use-module (gnu packages emacs)
102 #:use-module (gnu packages file)
103 #:use-module (gnu packages flex)
104 #:use-module (gnu packages fltk)
105 #:use-module (gnu packages fontutils)
106 #:use-module (gnu packages gettext)
107 #:use-module (gnu packages gcc)
108 #:use-module (gnu packages gd)
109 #:use-module (gnu packages ghostscript)
110 #:use-module (gnu packages glib)
111 #:use-module (gnu packages graphviz)
112 #:use-module (gnu packages gtk)
113 #:use-module (gnu packages icu4c)
114 #:use-module (gnu packages image)
115 #:use-module (gnu packages java)
116 #:use-module (gnu packages less)
117 #:use-module (gnu packages lisp)
118 #:use-module (gnu packages linux)
119 #:use-module (gnu packages llvm)
120 #:use-module (gnu packages logging)
121 #:use-module (gnu packages lua)
122 #:use-module (gnu packages gnome)
123 #:use-module (gnu packages guile)
124 #:use-module (gnu packages xorg)
125 #:use-module (gnu packages gl)
126 #:use-module (gnu packages imagemagick)
127 #:use-module (gnu packages m4)
128 #:use-module (gnu packages mpi)
129 #:use-module (gnu packages multiprecision)
130 #:use-module (gnu packages ncurses)
131 #:use-module (gnu packages netpbm)
132 #:use-module (gnu packages ocaml)
133 #:use-module (gnu packages onc-rpc)
134 #:use-module (gnu packages parallel)
135 #:use-module (gnu packages pcre)
136 #:use-module (gnu packages popt)
137 #:use-module (gnu packages perl)
138 #:use-module (gnu packages pkg-config)
139 #:use-module (gnu packages pulseaudio)
140 #:use-module (gnu packages python)
141 #:use-module (gnu packages python-web)
142 #:use-module (gnu packages python-xyz)
143 #:use-module (gnu packages qt)
144 #:use-module (gnu packages readline)
145 #:use-module (gnu packages ruby)
146 #:use-module (gnu packages tbb)
147 #:use-module (gnu packages scheme)
148 #:use-module (gnu packages serialization)
149 #:use-module (gnu packages shells)
150 #:use-module (gnu packages sphinx)
151 #:use-module (gnu packages tcl)
152 #:use-module (gnu packages texinfo)
153 #:use-module (gnu packages tex)
154 #:use-module (gnu packages tls)
155 #:use-module (gnu packages version-control)
156 #:use-module (gnu packages wxwidgets)
157 #:use-module (gnu packages xml)
158 #:use-module (srfi srfi-1)
159 #:use-module (srfi srfi-26))
167 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
169 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
170 (build-system gnu-build-system)
171 (inputs `(("gtk+" ,gtk+)
172 ("libxml2" ,libxml2)))
173 (native-inputs `(("pkg-config" ,pkg-config)))
175 `(#:configure-flags '("CFLAGS=-fcommon")))
176 (synopsis "Natural deduction first-order logic interface")
177 (description "Aris is a program for performing logical proofs. It supports
178 propositional and predicate logic, as well as Boolean algebra and
179 arithmetical logic. In addition to its predefined inference and equivalence
180 rules, Aris also supports references to older proofs. Its use of standard
181 logical symbols and its natural deduction interface make it easy to use for
183 (license license:gpl3+)
184 (home-page "https://www.gnu.org/software/aris/")))
186 (define-public bitwise
192 (uri (string-append "https://github.com/mellowcandle/bitwise"
193 "/releases/download/v" version
194 "/bitwise-v" version ".tar.gz"))
196 (base32 "1lniw4bsb5qs5ybf018qllf95pzixb1q3lvybzl4k3xz8zpkrm6k"))))
197 (build-system gnu-build-system)
199 `(("ncurses" ,ncurses)
200 ("readline" ,readline)))
203 ("pkg-config" ,pkg-config)))
204 (synopsis "Terminal based bit manipulator in ncurses")
205 (description "Bitwise is a multi base interactive calculator supporting
206 dynamic base conversion and bit manipulation. It's a handy tool for low level
207 hackers, kernel developers and device drivers developers.
209 Some of the features include:
211 @item Interactive ncurses interface.
212 @item Command line calculator supporting all bitwise operations.
213 @item Individual bit manipulator.
214 @item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
216 (license license:gpl3+)
217 (home-page "https://github.com/mellowcandle/bitwise/")))
219 (define-public c-graph
225 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
228 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
229 (build-system gnu-build-system)
231 `(("fortran" ,gfortran)))
232 (synopsis "Visualizing and demonstrating convolution")
234 "GNU C-Graph is a tool for demonstrating the theory of convolution.
235 Thus, it can serve as an excellent aid to students of signal and systems
236 theory in visualizing the convolution process. Rather than forcing the
237 student to write code, the program offers an intuitive interface with
238 interactive dialogs to guide them.")
239 (license license:gpl3+)
240 (home-page "https://www.gnu.org/software/c-graph/")))
249 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
250 version "/coda-" version ".tar.gz"))
252 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
253 (patches (search-patches "coda-use-system-libs.patch"))
254 (modules '((guix build utils)))
256 ;; Make sure we don't use the bundled software.
258 (for-each (lambda (d)
259 (delete-file-recursively (string-append "libcoda/" d)))
260 '("zlib" "pcre" "expat"))
263 `(("fortran" ,gfortran)
265 ("python-numpy" ,python-numpy)))
272 (build-system gnu-build-system)
274 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
275 "LIBS= -lz -lpcre -lexpat")))
276 (synopsis "A common interface to various earth observation data formats")
278 "The Common Data Access toolbox (CODA) provides a set of interfaces for
279 reading remote sensing data from earth observation data files. It consists of
280 command line applications and interfaces to the C, Fortran, Python, and Java
281 programming languages.")
282 (home-page "https://stcorp.nl/coda")
283 (license license:gpl2+)))
291 (uri (string-append "http://www.qhull.org/download/qhull-"
292 (car (string-split version #\.))
296 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
297 (build-system cmake-build-system)
299 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
300 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
301 (synopsis "Calculate convex hulls and related structures")
303 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
304 diagram, halfspace intersection about a point, furthest-site Delaunay
305 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
306 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
307 algorithm for computing the convex hull. It handles roundoff errors from
308 floating point arithmetic. It computes volumes, surface areas, and
309 approximations to the convex hull.
311 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
312 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
313 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
315 (home-page "http://qhull.org")
316 (license (license:non-copyleft "file://COPYING.txt"
317 "See COPYING in the distribution."))))
319 (define-public python-cvxopt
321 (name "python-cvxopt")
326 (url "https://github.com/cvxopt/cvxopt")
328 (file-name (git-file-name name version))
331 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
332 (build-system python-build-system)
335 (modify-phases %standard-phases
336 (add-after 'unpack 'find-libraries
337 (lambda* (#:key inputs #:allow-other-keys)
338 (setenv "CVXOPT_BLAS_LIB" "openblas")
339 (setenv "CVXOPT_BUILD_FFTW" "1")
340 (setenv "CVXOPT_BUILD_GLPK" "1")
341 (setenv "CVXOPT_BUILD_GSL" "1")
348 ("openblas" ,openblas)
349 ("suitesparse" ,suitesparse)))
350 (home-page "https://www.cvxopt.org")
351 (synopsis "Python library for convex optimization")
353 "CVXOPT is a package for convex optimization based on the Python
354 programming language. Its main purpose is to make the development of software
355 for convex optimization applications straightforward by building on Python’s
356 extensive standard library and on the strengths of Python as a high-level
357 programming language.")
358 (license license:gpl3+)))
360 (define-public python2-cvxopt
361 (package-with-python2 python-cvxopt))
369 (uri (string-append "mirror://gnu/units/units-" version
372 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
373 (build-system gnu-build-system)
375 `(("readline" ,readline)
376 ("python" ,python-wrapper) ;for 'units_cur' script
377 ("python-requests" ,python-requests)))
379 `(#:phases (modify-phases %standard-phases
380 (add-after 'install 'wrap-units_cur
381 (lambda* (#:key outputs #:allow-other-keys)
382 (let* ((out (assoc-ref outputs "out"))
383 (bin (string-append out "/bin")))
384 (wrap-program (string-append bin "/units_cur")
385 `("GUIX_PYTHONPATH" ":" prefix
386 ,(search-path-as-string->list (getenv "GUIX_PYTHONPATH"))))
388 (synopsis "Conversion between thousands of scales")
390 "GNU Units converts numeric quantities between units of measure. It
391 can handle scale changes through adaptive usage of standard scale
392 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
393 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
394 enough to be used effectively as a scientific calculator.")
395 (license license:gpl3+)
396 (home-page "https://www.gnu.org/software/units/")))
398 (define-public double-conversion
400 (name "double-conversion")
402 (home-page "https://github.com/google/double-conversion")
405 (uri (git-reference (url home-page)
406 (commit (string-append "v" version))))
407 (file-name (git-file-name name version))
410 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
411 (build-system cmake-build-system)
413 '(#:test-target "test"
414 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
415 "-DBUILD_TESTING=ON")))
416 (synopsis "Conversion routines for IEEE doubles")
418 "The double-conversion library provides binary-decimal and decimal-binary
419 routines for IEEE doubles. The library consists of efficient conversion
420 routines that have been extracted from the V8 JavaScript engine.")
421 (license license:bsd-3)))
423 (define-public dionysus
429 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
433 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
434 (build-system gnu-build-system)
435 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
436 (synopsis "Local search for universal constants and scientific values")
438 "GNU Dionysus is a convenient system for quickly retrieving the values of
439 mathematical constants used in science and engineering. Values can be
440 searched using a simple command-line tool, choosing from three databases:
441 universal constants, atomic numbers, and constants related to
443 (license license:gpl3+)
444 (home-page "https://www.gnu.org/software/dionysus/")))
455 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
456 "dSFMT-src-" version ".tar.gz"))
459 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
460 (modules '((guix build utils)))
461 ;; Don't distribute html documentation with bundled jquery.
464 (delete-file-recursively "html") #t))
465 ;; Add patches borrowed from Julia.
471 "https://raw.githubusercontent.com/JuliaLang/julia/"
472 "v1.3.0/deps/patches/dSFMT.c.patch"))
474 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
475 (file-name "dSFMT.c.patch"))
479 "https://raw.githubusercontent.com/JuliaLang/julia/"
480 "v1.3.0/deps/patches/dSFMT.h.patch"))
482 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
483 (file-name "dSFMT.h.patch"))))))
484 (build-system gnu-build-system)
487 (modify-phases %standard-phases
488 (delete 'configure) ; no configure script
490 ;; Upstream Makefile does not build a shared library. Borrow from Julia
491 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
494 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
495 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
496 "-O3" "-finline-functions" "-fomit-frame-pointer"
497 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
498 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
499 "-o" "libdSFMT.so")))
500 (replace 'install ; no "install" target
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let* ((out (assoc-ref outputs "out"))
503 (lib (string-append out "/lib"))
504 (inc (string-append out "/include"))
505 (doc (string-append out "/share/doc/" ,name "-" ,version)))
506 (install-file "libdSFMT.so" lib)
507 (install-file "dSFMT.h" inc)
508 (install-file "LICENSE.txt" doc)
510 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
512 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
513 the expensive conversion of integer to double (floating point). dSFMT directly
514 generates double precision floating point pseudorandom numbers which have the
515 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
516 format. dSFMT is only available on the CPUs which use IEEE 754 format double
517 precision floating point numbers.")
518 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
519 (license license:bsd-3)))
527 (uri (string-append "mirror://gnu/gsl/gsl-"
531 "0av04cpblphvvs3kl5rwphniarml503501vrpqw31rd0bmwg7fzg"))))
532 (build-system gnu-build-system)
534 (let ((system (%current-system)))
535 `(#:configure-flags (list "--disable-static") ;halves package size
537 (modify-phases %standard-phases
539 ((or (string-prefix? "aarch64" system)
540 (string-prefix? "powerpc" system))
541 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
542 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
543 '((add-before 'check 'disable-failing-tests
545 (substitute* "spmatrix/test.c"
546 ((".*test_complex.*") "\n"))))))
548 ((string-prefix? "i686" system)
549 ;; There are rounding issues with these tests on i686:
550 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
551 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
552 '((add-before 'check 'disable-failing-tests
554 (substitute* "linalg/test.c"
555 ((".*gsl_test\\(test_LU_decomp.*") "\n")
556 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
557 ((".*gsl_test\\(test_QR_decomp_r.*") "\n")
558 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
559 ((".*gsl_test\\(test_pcholesky_solve.*") "\n")
560 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
561 (substitute* "spmatrix/test.c"
562 ((".*test_all.*") "\n")
563 ((".*test_float.*") "\n")
564 ((".*test_complex.*") "\n"))
566 ;; XXX: These tests abort with:
567 ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
568 (substitute* '("multifit_nlinear/test.c"
569 "multilarge_nlinear/test.c")
570 (("gsl_ieee_env_setup.*" all)
571 (string-append "exit (77);\n" all)))))))
574 (home-page "https://www.gnu.org/software/gsl/")
575 (synopsis "Numerical library for C and C++")
577 "The GNU Scientific Library is a library for numerical analysis in C
578 and C++. It includes a wide range of mathematical routines, with over 1000
579 functions in total. Subject areas covered by the library include:
580 differential equations, linear algebra, Fast Fourier Transforms and random
582 (license license:gpl3+)))
592 (url "https://github.com/shibatch/sleef")
594 (file-name (git-file-name name version))
596 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
597 (build-system cmake-build-system)
599 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
600 (string-append "-DCMAKE_INSTALL_LIBDIR="
601 (assoc-ref %outputs "out")
603 (string-append "-DCMAKE_INSTALL_PREFIX="
604 (assoc-ref %outputs "out")))
606 (modify-phases %standard-phases
607 ;; SLEEF generates a header library during the build process and writes
608 ;; to it via shell redirection. Make the checkout writable so the
609 ;; build can succeed.
610 (add-after 'unpack 'make-git-checkout-writable
612 (for-each make-file-writable (find-files "."))
618 ("openssl" ,openssl)))
619 (home-page "https://sleef.org/")
620 (synopsis "SIMD library for evaluating elementary functions and DFT")
622 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
623 implements vectorized versions of all C99 real floating point math functions.
624 It can utilize SIMD instructions that are available on modern processors.")
625 (license (list license:boost1.0 ;sleef
626 license:cc-by4.0)))) ;simplex algorithm
635 (uri (string-append "mirror://gnu/glpk/glpk-"
639 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
640 (build-system gnu-build-system)
644 `(#:configure-flags '("--with-gmp"
645 "--disable-static")))
646 (home-page "https://www.gnu.org/software/glpk/")
647 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
649 "GLPK is a C library for solving large-scale linear programming (LP),
650 mixed integer programming (MIP), and other related problems. It supports the
651 GNU MathProg modeling language, a subset of the AMPL language, and features a
652 translator for the language. In addition to the C library, a stand-alone
653 LP/MIP solver is included in the package.")
654 (license license:gpl3+)))
656 (define-public glpk-4
664 (uri (string-append "mirror://gnu/glpk/glpk-"
668 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
677 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
679 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
681 "/4ti2-" version ".tar.gz"))
683 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
684 (build-system gnu-build-system)
686 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
690 (home-page "http://www.4ti2.de/")
691 (synopsis "Mathematical tool suite for problems on linear spaces")
693 "4ti2 implements algorithms for solving algebraic, geometric and
694 combinatorial problems on linear spaces. Among others, it solves systems
695 of linear equations, computes extreme rays of polyhedral cones, solves
696 integer programming problems and computes Markov bases for statistics.")
697 (license license:gpl2+)))
699 (define-public cddlib
706 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
707 (string-delete #\. version) ".tar.gz"))
710 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
711 (build-system gnu-build-system)
714 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
715 (synopsis "Library for convex hulls and extreme rays of polyhedra")
717 "The C-library cddlib implements the Double Description Method of
718 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
719 rays of a general convex polyhedron given by a system of linear inequalities
720 in arbitrary dimension. It can also be used for the converse operation of
721 computing convex hulls.")
722 (license license:gpl2+)))
724 (define-public lrslib
731 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
733 (string-delete #\. version) ".tar.gz"))
736 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
737 (build-system gnu-build-system)
741 `(#:tests? #f ; no check phase
742 #:make-flags `("CC=gcc"
743 ,(string-append "prefix=" (assoc-ref %outputs "out"))
746 (modify-phases %standard-phases
749 (substitute* "makefile"
750 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
752 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
753 (synopsis "Convex hulls of polyhedra with exact arithmetic")
755 "The C code of lrslib implements the reverse search algorithm for
756 vertex enumeration and convex hull problems. Its input file format is
757 compatible with cddlib. All computations are done exactly in either
758 multiple precision or fixed integer arithmetic. Output is not stored
759 in memory, so even problems with very large output sizes can sometimes
761 (license license:gpl2+)))
763 (define-public libcerf
771 (url "https://jugit.fz-juelich.de/mlz/libcerf")
772 (commit (string-append "v" version))))
773 (file-name (git-file-name name version))
775 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
776 (build-system cmake-build-system)
779 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
780 (synopsis "Library for complex error functions")
782 "@code{libcerf} is a self-contained numeric library that provides an
783 efficient and accurate implementation of complex error functions, along with
784 Dawson, Faddeeva, and Voigt functions.")
785 (license license:expat)))
794 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
795 "vinci/vinci-" version ".tar.gz"))
798 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
799 (build-system gnu-build-system)
801 `(("lrslib" ,lrslib)))
803 `(#:tests? #f ; no check phase
805 (modify-phases %standard-phases
807 ;; register the lrs location in the config file
808 (lambda* (#:key inputs #:allow-other-keys)
809 (let* ((lrs (assoc-ref inputs "lrslib"))
810 (lrsexec (string-append lrs "/bin/lrs")))
811 (substitute* "vinci.h"
812 (("#define LRS_EXEC \"lrs\"")
813 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
816 (lambda* (#:key outputs #:allow-other-keys)
817 (let* ((out (assoc-ref outputs "out"))
818 (bin (string-append out "/bin")))
819 (install-file "vinci" bin))
822 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
823 (synopsis "Volume computation for polytopes")
825 "Vinci implements a number of volume computation algorithms for convex
826 polytopes in arbitrary dimension. The polytopes can be given by their
827 V-representation (as the convex hull of a finite number of vertices), by
828 their H-representation (as the bounded intersection of a finite number of
829 halfspaces) or by their double description with both representations.")
830 (license license:gpl2+)))
832 (define-public arpack-ng
836 (home-page "https://github.com/opencollab/arpack-ng")
839 (uri (git-reference (url home-page) (commit version)))
840 (file-name (git-file-name name version))
843 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
844 (build-system gnu-build-system)
846 `(("autoconf" ,autoconf)
847 ("automake" ,automake)
849 ("pkg-config" ,pkg-config)))
853 ("fortran" ,gfortran)))
854 (synopsis "Fortran subroutines for solving eigenvalue problems")
856 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
857 large scale eigenvalue problems.")
858 (license (license:non-copyleft "file://COPYING"
859 "See COPYING in the distribution."))))
861 (define-public arpack-ng-3.3.0
868 (uri (git-reference (url (package-home-page arpack-ng))
870 (file-name (git-file-name (package-name arpack-ng) version))
873 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
875 (define-public arpack-ng-openmpi
876 (package (inherit arpack-ng)
877 (name "arpack-ng-openmpi")
880 ,@(package-inputs arpack-ng)))
882 (substitute-keyword-arguments (package-arguments arpack-ng)
883 ((#:configure-flags _ '())
885 ((#:phases phases '%standard-phases)
886 `(modify-phases ,phases
887 (add-before 'check 'mpi-setup
889 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
891 (define-public lapack
898 (uri (string-append "http://www.netlib.org/lapack/lapack-"
902 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
903 (build-system cmake-build-system)
904 (home-page "http://www.netlib.org/lapack/")
905 (inputs `(("fortran" ,gfortran)
906 ("python" ,python-wrapper)))
908 `(#:configure-flags (list
909 "-DBUILD_SHARED_LIBS:BOOL=YES"
911 ;; Build the 'LAPACKE_clatms' functions.
912 "-DLAPACKE_WITH_TMG=ON"
913 "-DBUILD_TESTING=ON")))
914 (synopsis "Library for numerical linear algebra")
916 "LAPACK is a Fortran 90 library for solving the most commonly occurring
917 problems in numerical linear algebra.")
918 (license (license:non-copyleft "file://LICENSE"
919 "See LICENSE in the distribution."))))
921 (define-public clapack
928 (uri (string-append "http://www.netlib.org/clapack/clapack-"
929 version "-CMAKE.tgz"))
932 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
933 (build-system cmake-build-system)
936 (modify-phases %standard-phases
937 ;; These tests use a lot of stack variables and segfault without
938 ;; lifting resource limits.
939 (add-after 'unpack 'disable-broken-tests
941 (substitute* "TESTING/CMakeLists.txt"
942 (("add_lapack_test.* xeigtstz\\)") ""))
945 (lambda* (#:key outputs #:allow-other-keys)
946 (let* ((out (assoc-ref outputs "out"))
947 (libdir (string-append out "/lib"))
948 (f2cinc (string-append out "/include/libf2c")))
951 (for-each (lambda (file)
952 (install-file file libdir))
954 "F2CLIBS/libf2c/libf2c.a"
955 "TESTING/MATGEN/libtmglib.a"
956 "BLAS/SRC/libblas.a"))
957 (for-each (lambda (file)
958 (install-file file f2cinc))
959 (cons "F2CLIBS/libf2c/arith.h"
960 (find-files (string-append "../clapack-"
961 ,version "-CMAKE/F2CLIBS/libf2c")
963 (copy-recursively (string-append "../clapack-"
964 ,version "-CMAKE/INCLUDE")
965 (string-append out "/include"))
967 (home-page "https://www.netlib.org/clapack/")
968 (synopsis "Numerical linear algebra library for C")
970 "The CLAPACK library was built using a Fortran to C conversion utility
971 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
972 C code, and then modified to improve readability. CLAPACK's goal is to
973 provide LAPACK for someone who does not have access to a Fortran compiler.")
974 (license (license:non-copyleft "file://LICENSE"
975 "See LICENSE in the distribution."))))
977 (define-public scalapack
984 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
988 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
989 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
990 (build-system cmake-build-system)
993 ("fortran" ,gfortran)
994 ("lapack" ,lapack))) ;for testing only
996 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
997 #:phases (modify-phases %standard-phases
998 (add-before 'check 'mpi-setup
1000 (home-page "http://www.netlib.org/scalapack/")
1001 (synopsis "Library for scalable numerical linear algebra")
1003 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
1004 routines on parallel distributed memory machines. ScaLAPACK solves dense and
1005 banded linear systems, least squares problems, eigenvalue problems, and
1006 singular value problems.")
1007 (license (license:non-copyleft "file://LICENSE"
1008 "See LICENSE in the distribution."))))
1010 (define-public gnuplot
1016 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1020 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
1021 (build-system gnu-build-system)
1022 (inputs `(("readline" ,readline)
1028 `(("pkg-config" ,pkg-config)
1029 ("texlive" ,texlive-tiny)))
1030 (arguments `(#:configure-flags (list (string-append
1031 "--with-texdir=" %output
1032 "/texmf-local/tex/latex/gnuplot"))
1033 ;; Plot on a dumb terminal during tests.
1034 #:make-flags '("GNUTERM=dumb")))
1035 (home-page "http://www.gnuplot.info")
1036 (synopsis "Command-line driven graphing utility")
1037 (description "Gnuplot is a portable command-line driven graphing
1038 utility. It was originally created to allow scientists and students to
1039 visualize mathematical functions and data interactively, but has grown to
1040 support many non-interactive uses such as web scripting. It is also used as a
1041 plotting engine by third-party applications like Octave.")
1042 ;; X11 Style with the additional restriction that derived works may only be
1043 ;; distributed as patches to the original.
1044 (license (license:fsf-free
1045 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1055 (url "https://github.com/OkoSanto/GCTP")
1056 (commit (string-append "v" version))))
1057 (file-name (git-file-name name version))
1059 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1061 `(("fortran" ,gfortran)))
1062 (build-system gnu-build-system)
1063 (synopsis "General Cartographic Transformation Package (GCTP)")
1065 "The General Cartographic Transformation Package (GCTP) is a system of
1066 software routines designed to permit the transformation of coordinate pairs
1067 from one map projection to another. The GCTP is the standard computer
1068 software used by the National Mapping Division for map projection
1070 (home-page "https://github.com/OkoSanto/GCTP")
1071 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1080 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1081 version "/src/hdf-" version ".tar.bz2"))
1083 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1084 (patches (search-patches "hdf4-architectures.patch"
1085 "hdf4-reproducibility.patch"
1086 "hdf4-shared-fortran.patch"
1087 "hdf4-tirpc.patch"))))
1088 (build-system gnu-build-system)
1090 `(("gfortran" ,gfortran)
1095 ("libjpeg" ,libjpeg-turbo)
1096 ("libtirpc" ,libtirpc)))
1098 `(#:parallel-tests? #f
1099 #:configure-flags (list "--enable-shared"
1100 "FCFLAGS=-fallow-argument-mismatch"
1101 "FFLAGS=-fallow-argument-mismatch"
1102 (string-append "CPPFLAGS=-I"
1103 (assoc-ref %build-inputs "libtirpc")
1106 (modify-phases %standard-phases
1107 ;; This is inspired by two of Debian's patches.
1108 (add-before 'configure 'add-more-aarch64-support
1110 (substitute* '("mfhdf/ncgen/ncgen.l"
1111 "mfhdf/ncgen/ncgenyy.c"
1112 "mfhdf/libsrc/netcdf.h.in")
1113 (("AIX5L64") "__aarch64__"))
1115 (add-before 'configure 'patchbuild
1118 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1120 (("/bin/mkdir") "mkdir"))
1121 (substitute* (find-files "." "^Makefile\\.in$")
1122 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1123 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1124 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1125 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1126 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1128 (add-after 'configure 'patch-settings
1130 ;; libhdf4.settings contains the full path of the
1131 ;; compilers used, and its contents are included in
1132 ;; .so-files. We truncate the hashes to avoid
1133 ;; unnecessary store references to those compilers:
1134 (substitute* "libhdf4.settings"
1135 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1136 (string-append prefix (string-take hash 10) "...")))
1138 (add-after 'install 'provide-absolute-libjpeg-reference
1139 (lambda* (#:key inputs outputs #:allow-other-keys)
1140 (let ((out (assoc-ref outputs "out"))
1141 (libjpeg (assoc-ref inputs "libjpeg")))
1142 ;; libjpeg-turbo does not provide a .la file, so libtool is
1143 ;; unable to add an absolute reference for -ljpeg in the .la
1144 ;; files. Fix it manually to avoid having to propagate it.
1145 (substitute* (find-files (string-append out "/lib") "\\.la$")
1147 (string-append "-L" libjpeg "/lib -ljpeg")))
1149 (home-page "https://www.hdfgroup.org/products/hdf4/")
1151 "Library and multi-object file format for storing and managing data")
1152 (description "HDF4 is a library and multi-object file format for storing
1153 and managing data between machines. HDF4 is an older hierarchical data format,
1154 incompatible with HDF5.")
1156 (license:non-copyleft
1157 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1159 (define-public hdf4-alt
1164 (substitute-keyword-arguments (package-arguments hdf4)
1165 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1167 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1169 (define-public hdf5-1.8
1176 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1177 "hdf5-" (version-major+minor version)
1178 "/hdf5-" version "/src/hdf5-"
1180 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1182 (match (string-split version #\.)
1183 ((major minor _ ...)
1184 (string-append major minor)))
1185 "/src/hdf5-" version ".tar.bz2")))
1187 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1188 (patches (search-patches "hdf5-config-date.patch"))))
1189 (build-system gnu-build-system)
1193 `(("gfortran" ,gfortran)
1194 ("perl" ,perl))) ;part of the test machinery needs Perl
1195 (outputs '("out" ; core library
1196 "fortran")) ; fortran interface
1198 `(;; Some of the users, notably Flann, need the C++ interface.
1199 #:configure-flags '("--enable-cxx"
1201 "--enable-fortran2003"
1203 ;; Build a thread-safe library. Unfortunately,
1204 ;; 'configure' invites you to either turn off C++,
1205 ;; Fortran, and the high-level interface (HL), or
1206 ;; to pass '--enable-unsupported'. Debian
1207 ;; packagers chose to pass '--enable-unsupported'
1208 ;; and we follow their lead here.
1209 "--enable-threadsafe"
1211 "--enable-unsupported")
1212 ;; Use -fPIC to allow the R bindings to link with the static libraries
1213 #:make-flags (list "CFLAGS=-fPIC"
1216 (modify-phases %standard-phases
1217 (add-before 'configure 'patch-configure
1218 (lambda* (#:key outputs #:allow-other-keys)
1219 (substitute* "configure"
1221 (substitute* "fortran/src/Makefile.in"
1222 (("libhdf5_fortran_la_LDFLAGS =")
1223 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1224 (assoc-ref outputs "fortran") "/lib")))
1225 (substitute* "hl/fortran/src/Makefile.in"
1226 (("libhdf5hl_fortran_la_LDFLAGS =")
1227 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1228 (assoc-ref outputs "fortran") "/lib")))
1230 (add-after 'configure 'patch-settings
1232 ;; libhdf5.settings contains the full path of the
1233 ;; compilers used, and its contents are included in
1234 ;; libhdf5.so. We truncate the hashes to avoid
1235 ;; unnecessary store references to those compilers:
1236 (substitute* "src/libhdf5.settings"
1237 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1238 (string-append prefix (string-take hash 10) "..."))
1239 ;; Don't record the build-time kernel version to make the
1240 ;; settings file reproducible.
1241 (("Uname information:.*")
1242 "Uname information: Linux\n"))
1244 (add-after 'install 'patch-references
1245 (lambda* (#:key inputs outputs #:allow-other-keys)
1246 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1247 (zlib (assoc-ref inputs "zlib")))
1248 (substitute* (find-files bin "h5p?cc")
1250 (string-append "-L" zlib "/lib " lib)))
1252 (add-after 'install 'split
1253 (lambda* (#:key inputs outputs #:allow-other-keys)
1254 ;; Move all fortran-related files
1255 (let* ((out (assoc-ref outputs "out"))
1256 (bin (string-append out "/bin"))
1257 (lib (string-append out "/lib"))
1258 (inc (string-append out "/include"))
1259 (ex (string-append out "/share/hdf5_examples/fortran"))
1260 (fort (assoc-ref outputs "fortran"))
1261 (fbin (string-append fort "/bin"))
1262 (flib (string-append fort "/lib"))
1263 (finc (string-append fort "/include"))
1264 (fex (string-append fort "/share/hdf5_examples/fortran")))
1269 ;; Note: When built with --enable-parallel, the 'h5fc' file
1270 ;; doesn't exist, hence this condition.
1271 (when (file-exists? (string-append bin "/h5fc"))
1272 (rename-file (string-append bin "/h5fc")
1273 (string-append fbin "/h5fc")))
1274 (for-each (lambda (file)
1276 (string-append flib "/" (basename file))))
1277 (find-files lib ".*fortran.*"))
1278 (for-each (lambda (file)
1280 (string-append finc "/" (basename file))))
1281 (find-files inc ".*mod"))
1282 (for-each (lambda (file)
1284 (string-append fex "/" (basename file))))
1285 (find-files ex ".*"))
1286 (delete-file-recursively ex))
1288 (home-page "https://www.hdfgroup.org")
1289 (synopsis "Management suite for extremely large and complex data")
1290 (description "HDF5 is a suite that makes possible the management of
1291 extremely large and complex data collections.")
1292 (license (license:x11-style
1293 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1295 (define-public hdf5-1.10
1302 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1303 "hdf5-" (version-major+minor version)
1304 "/hdf5-" version "/src/hdf5-"
1306 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1308 (apply string-append
1309 (take (string-split version #\.) 2))
1310 "/src/hdf5-" version ".tar.bz2")))
1312 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1313 (patches (search-patches "hdf5-config-date.patch"))))))
1315 (define-public hdf5-1.12
1322 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1323 "hdf5-" (version-major+minor version)
1324 "/hdf5-" version "/src/hdf5-"
1326 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1328 (apply string-append
1329 (take (string-split version #\.) 2))
1330 "/src/hdf5-" version ".tar.bz2")))
1332 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1333 (patches (search-patches "hdf5-config-date.patch"))))))
1336 ;; Default version of HDF5.
1339 (define-public hdf-java
1347 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1348 version "/src/CMake-hdfjava-" version ".tar.gz"))
1350 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1351 (modules '((guix build utils)))
1352 (snippet ; Make sure we don't use the bundled sources and binaries.
1354 (for-each delete-file
1355 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1356 "HDF4.tar.gz" "HDF5.tar.gz"))
1357 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1359 (build-system gnu-build-system)
1361 `(("jdk" ,icedtea "jdk")
1362 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1364 ("hamcrest-core" ,java-hamcrest-core)
1365 ("junit" ,java-junit)
1366 ("slf4j-simple" ,java-slf4j-simple)))
1371 ("libjpeg" ,libjpeg-turbo)
1372 ("slf4j-api" ,java-slf4j-api)))
1375 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1376 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1377 (assoc-ref %build-inputs "jdk") "/lib" )
1378 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1379 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1382 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1383 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1384 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1385 (string-append "JPEGLIB="
1386 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1390 (modify-phases %standard-phases
1391 (add-before 'configure 'chdir-to-source
1392 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1393 (add-before 'configure 'patch-build
1394 (lambda* (#:key inputs outputs #:allow-other-keys)
1395 (substitute* "configure"
1396 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1397 (("/bin/cat") (which "cat")))
1398 ;; Set classpath for compilation
1399 (substitute* '("hdf/hdf5lib/Makefile.in"
1400 "hdf/hdf5lib/exceptions/Makefile.in"
1401 "hdf/hdflib/Makefile.in")
1402 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1403 (search-input-file inputs "/share/java/slf4j-api.jar")))
1404 ;; Replace outdated config.sub and config.guess:
1405 (with-directory-excursion "config"
1406 (for-each (lambda (file)
1408 (search-input-file inputs
1411 ,(version-major+minor (package-version automake))
1414 '("config.sub" "config.guess")))
1416 ;; Fix embedded version number
1417 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1418 (substitute* "hdf/hdf5lib/H5.java"
1420 (string-join hdf5version ", "))))
1422 (mkdir-p (string-append (assoc-ref outputs "out")))
1423 ;; Set classpath for tests
1424 (let* ((build-dir (getcwd))
1425 (lib (string-append build-dir "/lib"))
1426 (jhdf (string-append lib "/jhdf.jar"))
1427 (jhdf5 (string-append lib "/jhdf5.jar"))
1431 (string-append (assoc-ref inputs i)
1432 "/share/java/" i ".jar"))
1433 '("slf4j-api" "slf4j-simple"))
1435 (car (find-files (assoc-ref inputs "junit") "jar$"))
1436 (car (find-files (assoc-ref inputs "hamcrest-core")
1439 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1441 (substitute* '("test/hdf5lib/Makefile.in"
1442 "test/hdf5lib/junit.sh.in"
1443 "examples/runExample.sh.in")
1445 (search-input-file inputs "/bin/test"))
1447 (search-input-file inputs "/bin/uname"))
1448 (("CLASSPATH=[^\n]*")
1449 (string-append "CLASSPATH=" class-path)))
1450 (setenv "CLASSPATH" class-path))
1452 (add-before 'check 'build-examples
1454 (apply invoke `("javac"
1455 ,@(find-files "examples" ".*\\.java"))))))
1457 #:parallel-build? #f
1459 #:parallel-tests? #f ))
1460 (home-page "https://support.hdfgroup.org/products/java")
1461 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1462 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1463 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1466 ;; BSD-style license:
1467 (license (license:x11-style
1468 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1469 /current/src/unpacked/COPYING"))))
1471 (define-public hdf-eos2
1478 (uri "ftp://edhs1.gsfc.nasa.gov\
1479 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1481 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1482 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1483 "hdf-eos2-build-shared.patch"
1484 "hdf-eos2-fortrantests.patch"))))
1485 (build-system gnu-build-system)
1487 `(("gfortran" ,gfortran)))
1489 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1490 ;; XXX: These inputs are really dependencies of hdf4.
1492 ("libjpeg" ,libjpeg-turbo)
1493 ("libtirpc" ,libtirpc)
1497 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1498 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1499 #:parallel-tests? #f))
1500 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1501 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1502 (description "HDF-EOS2 is a software library built on HDF4 which supports
1503 the construction of data structures used in NASA's Earth Observing
1504 System (Grid, Point and Swath).")
1506 ;; Source files carry a permissive license header.
1507 (license (license:non-copyleft home-page))))
1509 (define-public hdf-eos5
1515 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1516 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1519 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1520 (patches (search-patches "hdf-eos5-build-shared.patch"
1521 "hdf-eos5-remove-gctp.patch"
1522 "hdf-eos5-fix-szip.patch"
1523 "hdf-eos5-fortrantests.patch"))))
1525 `(("gfortran" ,gfortran)))
1526 (build-system gnu-build-system)
1528 `(("hdf5" ,hdf5-1.8)
1532 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1533 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1534 #:parallel-tests? #f))
1535 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1537 "HDF-EOS5 is a software library built on HDF5 to support the construction
1538 of data structures used in NASA's Earth Observing System (Grid, Point and
1540 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1542 ;; Source files carry a permissive license header.
1543 (license (license:non-copyleft home-page))))
1545 (define-public hdf5-parallel-openmpi
1546 (package/inherit hdf5-1.10 ;use the latest
1547 (name "hdf5-parallel-openmpi")
1550 ,@(package-inputs hdf5)))
1552 (substitute-keyword-arguments (package-arguments hdf5)
1553 ((#:configure-flags flags)
1554 ``("--enable-parallel"
1555 ,@(delete "--enable-cxx"
1556 (delete "--enable-threadsafe" ,flags))))
1558 `(modify-phases ,phases
1559 (add-after 'build 'mpi-setup
1561 (add-before 'check 'patch-tests
1563 ;; OpenMPI's mpirun will exit with non-zero status if it
1564 ;; detects an "abnormal termination", i.e. any process not
1565 ;; calling MPI_Finalize(). Since the test is explicitly
1566 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1567 ;; H5C_flush_cache from being called, mpirun will always
1568 ;; complain, so turn this test off.
1569 (substitute* "testpar/Makefile"
1570 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1571 (string-append front back "\n")))
1572 (substitute* "tools/test/h5diff/testph5diff.sh"
1573 (("/bin/sh") (which "sh")))
1575 (synopsis "Management suite for data with parallel IO support")))
1577 (define-public hdf5-blosc
1585 (url "https://github.com/Blosc/hdf5-blosc")
1586 (commit (string-append "v" version))))
1587 (file-name (git-file-name name version))
1589 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1590 (build-system cmake-build-system)
1593 (list (string-append "-DBLOSC_INSTALL_DIR="
1594 (assoc-ref %build-inputs "c-blosc"))
1595 (string-append "-DPLUGIN_INSTALL_PATH="
1596 (assoc-ref %outputs "out")
1597 "/hdf5/lib/plugin"))
1599 (modify-phases %standard-phases
1600 (add-after 'unpack 'do-not-build-blosc
1602 (substitute* "CMakeLists.txt"
1603 (("set\\(BLOSC_INSTALL_DIR.*") "")
1604 (("ExternalProject_Add\\(project_blosc") "message("))
1607 `(("c-blosc" ,c-blosc)
1608 ("hdf5" ,hdf5-1.10)))
1609 (home-page "https://github.com/Blosc/hdf5-blosc")
1610 (synopsis "Filter for HDF5 using the Blosc compressor")
1611 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1612 installing this filter, you can read and write HDF5 files with
1613 Blosc-compressed datasets.")
1614 (license license:expat)))
1616 (define-public h5check
1623 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1624 "h5check/src/h5check-" version ".tar.gz"))
1627 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1628 (build-system gnu-build-system)
1629 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1630 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1631 (synopsis "HDF5 format checker")
1632 (description "@code{h5check} is a validation tool for verifying that an
1633 HDF5 file is encoded according to the HDF File Format Specification.")
1634 (license (license:x11-style "file://COPYING"))))
1642 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1647 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1648 (build-system cmake-build-system)
1649 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1650 (inputs `(("lapack" ,lapack)
1652 ;; FIXME: Even though the fonts are available dvips complains:
1653 ;; "Font cmmi10 not found; characters will be left blank."
1655 `(("texlive" ,texlive-tiny)
1656 ("ghostscript" ,ghostscript)
1657 ("doxygen" ,doxygen)))
1658 (home-page "http://itpp.sourceforge.net")
1659 (synopsis "C++ library of maths, signal processing and communication classes")
1660 (description "IT++ is a C++ library of mathematical, signal processing and
1661 communication classes and functions. Its main use is in simulation of
1662 communication systems and for performing research in the area of
1663 communications. The kernel of the library consists of generic vector and
1664 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1665 similar to MATLAB, GNU Octave or SciPy.")
1666 (license license:gpl3+)))
1668 (define-public netcdf
1676 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1677 "netcdf-c-" version ".tar.gz"))
1680 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1681 (modules '((guix build utils)))
1683 ;; Make sure this variable is defined only once. Failing to do so
1684 ;; would break builds of 'netcdf-parallel-openmpi' with a
1685 ;; multiple-definition link error with GCC 10.
1686 '(substitute* "ncdump/ocprint.c"
1687 (("^int ocdebug") "static int ocdebug")))
1688 (patches (search-patches "netcdf-date-time.patch"))))
1689 (build-system gnu-build-system)
1692 ("doxygen" ,doxygen)
1693 ("graphviz" ,graphviz)))
1695 `(("hdf4" ,hdf4-alt)
1699 ("libjpeg" ,libjpeg-turbo)))
1701 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1703 #:phases (modify-phases %standard-phases
1704 (add-before 'configure 'fix-source-date
1706 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1707 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1708 ;; to '1st hour of the current day', and therefore makes the
1709 ;; package not reproducible.
1710 (substitute* "./configure"
1711 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1712 "date --date='@0'"))
1714 (add-after 'configure 'patch-settings
1716 ;; libnetcdf.settings contains the full filename of the compilers
1717 ;; used to build the library. We truncate the hashes of those
1718 ;; filenames to avoid unnecessary references to the corresponding
1720 (substitute* "libnetcdf.settings"
1721 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1722 (string-append prefix (string-take hash 10) "...")))
1725 #:parallel-tests? #f)) ;various race conditions
1726 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1727 (synopsis "Library for scientific data")
1728 (description "NetCDF is an interface for scientific data access and a
1729 software library that provides an implementation of the interface. The netCDF
1730 library defines a machine-independent format for representing scientific data.
1731 Together, the interface, library, and format support the creation, access, and
1732 sharing of scientific data.")
1733 (license (license:x11-style "file://COPYRIGHT"))))
1735 (define-public netcdf-parallel-openmpi
1736 (package (inherit netcdf)
1737 (name "netcdf-parallel-openmpi")
1740 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1741 (package-inputs netcdf))))
1742 ;; TODO: Replace pkg-config references in nc-config with absolute references
1744 (substitute-keyword-arguments (package-arguments netcdf)
1745 ((#:configure-flags flags)
1746 `(cons* "CC=mpicc" "CXX=mpicxx"
1747 "--enable-parallel-tests"
1748 ;; Shared libraries not supported with parallel IO.
1749 "--disable-shared" "--with-pic"
1751 ((#:phases phases '%standard-phases)
1752 `(modify-phases ,phases
1753 (add-after 'build 'mpi-setup
1754 ,%openmpi-setup)))))))
1756 (define-public netcdf-fortran
1758 (name "netcdf-fortran")
1763 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1767 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1768 (build-system gnu-build-system)
1770 `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
1771 "FFLAGS=-fallow-argument-mismatch")
1772 #:parallel-tests? #f))
1774 `(("netcdf" ,netcdf)))
1776 `(("gfortran" ,gfortran)))
1777 (synopsis "Fortran interface for the netCDF library")
1778 (description (package-description netcdf))
1779 (home-page (package-home-page netcdf))
1780 (license (package-license netcdf))))
1782 (define-public nlopt
1788 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1791 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1792 (build-system gnu-build-system)
1794 `(;; Shared libraries are not built by default. They are required to
1795 ;; build the Guile, Octave, and Python bindings.
1796 #:configure-flags '("--enable-shared")
1799 (modify-phases %standard-phases
1800 (add-before 'configure 'set-libnlopt-file-name
1801 (lambda* (#:key outputs #:allow-other-keys)
1802 ;; Make sure the Scheme module refers to the library by its
1803 ;; absolute file name (we cannot do that from a snippet
1804 ;; because the expansion of @libdir@ contains
1806 (let ((out (assoc-ref outputs "out")))
1807 (substitute* "swig/nlopt.scm.in"
1809 (string-append out "/lib/libnlopt")))
1811 (inputs `(("guile" ,guile-2.0)))
1812 (native-inputs `(("pkg-config" ,pkg-config)))
1813 (home-page "http://ab-initio.mit.edu/wiki/")
1814 (synopsis "Library for nonlinear optimization")
1815 (description "NLopt is a library for nonlinear optimization, providing a
1816 common interface for a number of different free optimization routines available
1817 online as well as original implementations of various other algorithms.")
1818 (license license:lgpl2.1+)))
1820 (define-public ipopt
1827 (url "https://github.com/coin-or/Ipopt")
1828 (commit (string-append "releases/" version))))
1829 (file-name (git-file-name name version))
1832 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1833 (build-system gnu-build-system)
1835 '(#:phases (modify-phases %standard-phases
1836 (add-after 'install 'add--L-flags-in-ipopt.pc
1837 (lambda* (#:key inputs outputs #:allow-other-keys)
1838 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1839 ;; move it to "Libs.private" where it belongs, and add a
1840 ;; '-L' flag for LAPACK.
1841 (let ((out (assoc-ref outputs "out"))
1842 (lapack (assoc-ref inputs "lapack")))
1843 (substitute* (string-append out "/lib/pkgconfig/"
1845 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1846 (string-append "Libs: " before " " after "\n"
1847 "Libs.private: " before
1848 "-L" lapack "/lib -llapack -lblas "
1852 `(("gfortran" ,gfortran)
1853 ("pkg-config" ,pkg-config)))
1855 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1856 `(("lapack" ,lapack))) ;for both libblas and liblapack
1857 (home-page "https://www.coin-or.org")
1858 (synopsis "Large-scale nonlinear optimizer")
1860 "The Interior Point Optimizer (IPOPT) is a software package for
1861 large-scale nonlinear optimization. It provides C++, C, and Fortran
1863 (license license:epl2.0)))
1865 (define-public nomad-optimizer
1867 (name "nomad-optimizer")
1873 (url "https://github.com/bbopt/nomad/")
1874 (commit (string-append "v" version))))
1875 (file-name (git-file-name name version))
1878 "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
1879 (build-system cmake-build-system)
1881 `(("python" ,python-wrapper)
1882 ("python-cython" ,python-cython)))
1884 `(#:imported-modules ((guix build python-build-system)
1885 ,@%cmake-build-system-modules)
1886 #:modules (((guix build python-build-system)
1887 #:select (python-version site-packages))
1888 (guix build cmake-build-system)
1891 '("-DBUILD_INTERFACES=ON"
1894 (modify-phases %standard-phases
1895 (add-after 'unpack 'fix-sources-for-build
1896 (lambda* (#:key outputs #:allow-other-keys)
1897 (substitute* "CMakeLists.txt"
1898 ;; CMAKE_INSTALL_PREFIX is accidentally hardcoded.
1899 (("set\\(CMAKE_INSTALL_PREFIX .* FORCE\\)") "")
1900 ;; Requiring GCC version 8 or later is unwarranted.
1901 (("message\\(FATAL_ERROR \"GCC version < 8")
1902 "message(STATUS \"GCC version < 8"))
1904 (let ((out (assoc-ref outputs "out")))
1905 (substitute* "interfaces/PyNomad/CMakeLists.txt"
1906 ;; We don't want to build in-place, and anyway the install
1907 ;; command further below runs build_ext as a prerequisite.
1908 (("COMMAND python setup_PyNomad\\.py .* build_ext --inplace\n")
1910 ;; Don't install locally.
1911 (("COMMAND python (setup_PyNomad\\.py .* install) --user\n"
1913 (string-append "COMMAND ${CMAKE_COMMAND} -E env"
1914 " CC=" ,(cc-for-target)
1915 " CXX=" ,(cxx-for-target)
1916 " " (which "python")
1920 ;; Fix erroneous assumptions about the paths of the include and
1921 ;; library directories.
1922 (substitute* "interfaces/PyNomad/setup_PyNomad.py"
1923 (("^( +os_include_dirs = ).*" _ prefix)
1924 (string-append prefix "[\"../../src\"]\n"))
1925 (("^(installed_lib_dir = ).*" _ prefix)
1926 (string-append prefix "\"" out "/lib\"\n"))))
1929 ;; Fix the tests so they run in out-of-source builds.
1930 (add-after 'fix-sources-for-build 'fix-sources-for-tests
1933 (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
1935 (map (lambda (d) (string-append "basic/library/" d))
1936 '("example1" "example2" "example3"
1937 "single_obj_parallel"))
1938 (map (lambda (d) (string-append "advanced/library/" d))
1939 '("FixedVariable" "NMonly" "PSDMads" "Restart"
1940 "c_api/example1" "c_api/example2"
1941 "exampleSuggestAndObserve"))))
1942 ;; The built examples are assumed to be in the source tree
1943 ;; (which isn't the case here).
1944 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
1946 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
1947 ;; (Unrelated to support for out-of-source testing.)
1949 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
1951 (let* ((builddir (string-append (getcwd) "/../build"))
1952 ;; The BB_EXE and SURROGATE_EXE paths are interpreted
1953 ;; relative to the configuration file provided to NOMAD.
1954 ;; However, the configuration files are all in the source
1955 ;; tree rather than in the build tree (unlike the compiled
1957 (fix-exe-path (lambda* (dir #:optional
1960 (substitute* (string-append dir "/" file)
1961 (((string-append "^" exe-opt " +"))
1962 ;; The $ prevents NOMAD from prefixing
1963 ;; the executable with the path of the
1964 ;; parent directory of the configuration
1965 ;; file NOMAD was provided with as
1966 ;; argument (param.txt or some such).
1967 (string-append exe-opt " $"
1968 builddir "/" dir "/"))))))
1971 (let ((dir (string-append "examples/" dir)))
1972 (substitute* (string-append dir "/CMakeLists.txt")
1973 ;; The install phase has not yet run.
1974 (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
1975 "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
1977 (when (equal? dir "examples/basic/batch/surrogate_sort")
1978 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
1979 (append (map (lambda (d) (string-append "basic/batch/" d))
1980 '("example1" "example2"
1981 "single_obj" "single_obj_parallel"
1983 '("advanced/batch/LHonly")))
1985 (let ((dir "examples/advanced/batch/FixedVariable"))
1986 (substitute* (string-append dir "/runFixed.sh")
1987 ;; Hardcoded path to NOMAD executable.
1988 (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
1989 (string-append builddir "/src/nomad ")))
1991 (lambda (f) (fix-exe-path dir f))
1992 '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))
1995 ;; The information in the .egg-info file is not kept up to date.
1996 (add-after 'install 'delete-superfluous-egg-info
1997 (lambda* (#:key inputs outputs #:allow-other-keys)
1998 (delete-file (string-append
1999 (site-packages inputs outputs)
2001 (python-version (assoc-ref inputs "python"))
2004 (home-page "https://www.gerad.ca/nomad/")
2005 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
2007 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
2008 algorithm, designed for difficult blackbox optimization problems. These
2009 problems occur when the functions defining the objective and constraints are
2010 the result of costly computer simulations.")
2011 (license license:lgpl3+)))
2019 (uri (string-append "https://www.coin-or.org/download/source/"
2020 "Cbc/Cbc-" version ".tgz"))
2023 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
2024 (modules '((guix build utils)))
2026 ;; Make sure we don't use the bundled software.
2027 '(delete-file-recursively "ThirdParty"))))
2028 (build-system gnu-build-system)
2030 `(("gfortran" ,gfortran)
2031 ("pkg-config" ,pkg-config)))
2033 `(("openblas" ,openblas)))
2034 (home-page "https://www.coin-or.org")
2035 (synopsis "Branch-and-cut solver")
2037 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
2038 solver written in C++. It can be used as a library or as a standalone
2040 (license license:epl1.0)))
2048 (uri (string-append "https://www.coin-or.org/download/source/"
2049 "Clp/Clp-" version ".tgz"))
2052 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
2053 (modules '((guix build utils)))
2055 ;; Make sure we don't use the bundled software.
2057 (delete-file-recursively "ThirdParty")
2059 (build-system gnu-build-system)
2061 `(("gfortran" ,gfortran)
2062 ("pkg-config" ,pkg-config)))
2064 `(("openblas" ,openblas)))
2065 (home-page "https://www.coin-or.org")
2066 (synopsis "Linear programming solver")
2068 "CLP is a high quality linear programming solver. Its main strengths are
2069 its dual and primal Simplex algorithms. It also has a barrier algorithm for
2070 linear and quadratic objectives. There are limited facilities for nonlinear
2071 and quadratic objectives using the Simplex algorithm.")
2072 (license license:epl1.0)))
2074 (define-public libflame
2078 (outputs '("out" "static"))
2083 (url "https://github.com/flame/libflame")
2085 (file-name (git-file-name name version))
2088 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
2089 (build-system gnu-build-system)
2092 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
2093 (list "--enable-dynamic-build"
2094 "--enable-max-arg-list-hack"
2095 "--enable-lapack2flame"
2096 "--enable-verbose-make-output"
2097 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
2098 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
2101 '("--enable-vector-intrinsics=sse")
2103 "--enable-supermatrix"
2104 "--enable-memory-alignment=16"
2105 "--enable-ldim-alignment")
2107 (modify-phases %standard-phases
2108 (add-after 'unpack 'patch-/usr/bin/env-bash
2110 (substitute* "build/config.mk.in"
2111 (("/usr/bin/env bash") (which "bash")))
2114 (lambda* (#:key tests? #:allow-other-keys)
2115 (substitute* "test/Makefile"
2116 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
2117 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
2119 (with-directory-excursion "test"
2122 (invoke "./test_libflame.x"))
2124 (add-after 'install 'install-static
2125 (lambda* (#:key outputs #:allow-other-keys)
2126 (let ((out (assoc-ref outputs "out"))
2127 (static (assoc-ref outputs "static")))
2128 (mkdir-p (string-append static "/lib"))
2129 (rename-file (string-append out "/lib/libflame.a")
2130 (string-append static "/lib/libflame.a"))
2131 (install-file (string-append out "/include/FLAME.h")
2132 (string-append static "/include"))
2135 `(("gfortran" ,gfortran)))
2137 `(("lapack" ,lapack)
2138 ("openblas" ,openblas)
2140 ("python" ,python-wrapper)))
2141 (home-page "https://github.com/flame/libflame")
2142 (synopsis "High-performance object-based library for DLA computations")
2143 (description "@code{libflame} is a portable library for dense matrix
2144 computations, providing much of the functionality present in LAPACK, developed
2145 by current and former members of the @acronym{SHPC, Science of High-Performance
2146 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
2147 Computational Engineering and Sciences} at The University of Texas at Austin.
2148 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
2149 includes a complete LAPACK implementation.")
2150 (license license:bsd-3)))
2152 (define-public ceres
2154 (name "ceres-solver")
2156 (home-page "http://ceres-solver.org/")
2159 (uri (string-append home-page "ceres-solver-"
2163 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
2164 (build-system cmake-build-system)
2166 ;; TODO: Build HTML user documentation and install separately.
2167 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
2168 "-DBUILD_SHARED_LIBS=ON")
2170 #:phases (modify-phases %standard-phases
2171 (add-before 'configure 'set-library-directory
2173 ;; Install libraries to lib/, not lib64/.
2174 (substitute* "internal/ceres/CMakeLists.txt"
2175 (("set\\(LIB_SUFFIX \"64\"\\)")
2176 "set(LIB_SUFFIX \"\")"))
2179 `(("pkg-config" ,pkg-config)))
2181 `(("glog" ,glog))) ;for #include <glog/glog.h>
2186 ("suitesparse" ,suitesparse)
2187 ("gflags" ,gflags)))
2188 (synopsis "C++ library for solving large optimization problems")
2190 "Ceres Solver is a C++ library for modeling and solving large,
2191 complicated optimization problems. It is a feature rich, mature and
2192 performant library which has been used in production since 2010. Ceres Solver
2193 can solve two kinds of problems:
2195 @item non-linear least squares problems with bounds constraints;
2196 @item general unconstrained optimization problems.
2198 (license license:bsd-3)))
2200 ;; For a fully featured Octave, users are strongly recommended also to install
2201 ;; the following packages: less, ghostscript, gnuplot.
2202 (define-public octave-cli
2209 (uri (string-append "mirror://gnu/octave/octave-"
2213 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2214 (build-system gnu-build-system)
2216 `(("alsa-lib" ,alsa-lib)
2217 ("arpack" ,arpack-ng)
2223 ("fontconfig" ,fontconfig)
2224 ("freetype" ,freetype)
2228 ("graphicsmagick" ,graphicsmagick)
2230 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2231 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2232 ;; libtiff.la instead of having to provide it here.
2233 ("libjpeg" ,libjpeg-turbo)
2237 ("libsndfile" ,libsndfile)
2241 ("portaudio" ,portaudio)
2243 ("readline" ,readline)
2244 ("suitesparse" ,suitesparse)
2245 ("texinfo" ,texinfo)
2248 `(("gfortran" ,gfortran)
2249 ("pkg-config" ,pkg-config)
2251 ;; The following inputs are not actually used in the build process.
2252 ;; However, the ./configure gratuitously tests for their existence and
2253 ;; assumes that programs not present at build time are also not, and
2254 ;; can never be, available at run time! If these inputs are therefore
2255 ;; not present, support for them will be built out. However, Octave
2256 ;; will still run without them, albeit without the features they
2259 ("ghostscript" ,ghostscript)
2260 ("gnuplot" ,gnuplot)))
2261 ;; Octave code uses this variable to detect directories holding multiple CA
2262 ;; certificates to verify peers with. This is required for the networking
2263 ;; functions that require encryption to work properly.
2264 (native-search-paths
2265 (list (search-path-specification
2266 (variable "CURLOPT_CAPATH")
2267 (files '("etc/ssl/certs")))))
2270 (list (string-append "--with-shell="
2271 (assoc-ref %build-inputs "bash")
2274 ;; XXX: Without this flag, linking octave-cli fails with
2275 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2276 ;; not pulling in liboctinterp.la for -lstdc++.
2277 "--enable-link-all-dependencies")
2279 (modify-phases %standard-phases
2280 (add-after 'configure 'configure-makeinfo
2281 (lambda* (#:key inputs #:allow-other-keys)
2282 (substitute* "libinterp/corefcn/help.h"
2285 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2287 (home-page "https://www.gnu.org/software/octave/")
2288 (synopsis "High-level language for numerical computation (no GUI)")
2289 (description "GNU Octave is a high-level interpreted language that is
2290 specialized for numerical computations. It can be used for both linear and
2291 non-linear applications and it provides great support for visualizing results.
2292 Work may be performed both at the interactive command-line as well as via
2294 (license license:gpl3+)))
2296 (define-public octave
2297 (package (inherit octave-cli)
2300 `(("qscintilla" ,qscintilla)
2302 ,@(package-inputs octave-cli)))
2304 `(("qttools" , qttools) ;for lrelease
2305 ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
2306 ,@(package-native-inputs octave-cli)))
2308 (substitute-keyword-arguments (package-arguments octave-cli)
2310 `(modify-phases ,phases
2311 (add-before 'configure 'patch-qscintilla-library-name
2312 (lambda* (#:key inputs #:allow-other-keys)
2313 ;; The QScintilla library that the Octave configure script tries
2314 ;; to link with should be named libqscintilla-qt5.so, but the
2315 ;; QScintilla input provides the shared library as
2316 ;; libqscintilla2_qt5.so.
2317 (substitute* "configure"
2318 (("qscintilla2-qt5")
2321 (synopsis "High-level language for numerical computation (with GUI)")))
2323 (define-public opencascade-oce
2325 (name "opencascade-oce")
2331 (url "https://github.com/tpaviot/oce")
2332 (commit (string-append "OCE-" version))))
2333 (file-name (git-file-name name version))
2334 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2336 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2337 (build-system cmake-build-system)
2340 (list "-DOCE_TESTING:BOOL=ON"
2341 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2342 "-DOCE_DRAW:BOOL=ON"
2343 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2344 (assoc-ref %outputs "out"))
2345 "-UCMAKE_INSTALL_RPATH")))
2347 `(("freetype" ,freetype)
2354 `(("python" ,python-wrapper)))
2355 (home-page "https://github.com/tpaviot/oce")
2356 (synopsis "Libraries for 3D modeling and numerical simulation")
2358 "Open CASCADE is a set of libraries for the development of applications
2359 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2360 C++ class libraries providing services for 3D surface and solid modeling, CAD
2361 data exchange, and visualization. It is used for development of specialized
2362 software dealing with 3D models in design (CAD), manufacturing (CAM),
2363 numerical simulation (CAE), measurement equipment (CMM), and quality
2364 control (CAQ) domains.
2366 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2367 patches, improvements, and experiments contributed by users over the official
2368 Open CASCADE library.")
2369 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2370 ; use of header files; see
2371 ; OCCT_LGPL_EXCEPTION.txt
2372 license:public-domain; files
2373 ; src/Standard/Standard_StdAllocator.hxx and
2374 ; src/NCollection/NCollection_StdAllocator.hxx
2375 license:expat; file src/OpenGl/OpenGl_glext.h
2376 license:bsd-3)))); test framework gtest
2378 (define-public opencascade-occt
2380 (name "opencascade-occt")
2386 (url "https://git.dev.opencascade.org/repos/occt.git")
2389 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2391 (file-name (git-file-name name version))
2393 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2394 (modules '((guix build utils)))
2397 ;; Remove files specific to non-free operating systems.
2398 (delete-file-recursively "samples/ios")
2399 (delete-file-recursively "samples/mfc")
2400 (delete-file-recursively "samples/qt/FuncDemo")
2401 (delete-file "genconf.bat")
2402 (delete-file "gendoc.bat")
2403 (delete-file "genproj.bat")
2404 (delete-file "upgrade.bat")
2405 ;; Remove references to deleted files.
2406 (substitute* "dox/FILES_HTML.txt"
2407 ((".*standard.*") "" )
2408 ((".*UIKitSample.*") ""))
2410 (build-system cmake-build-system)
2412 '(;; There is no test target for make. OCCT provides an
2413 ;; 'Automated Testing System', which may be accessed after
2414 ;; installation via the draw.sh script. draw.sh is located in
2415 ;; the bin directory. For details see:
2416 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2417 ;; occt_dev_guides__tests.html
2419 ;; Configure without freeimage: attempting to link against the
2420 ;; freeimage version 3.17 library leads to 'undefined
2421 ;; reference' errors.
2423 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2425 "-DUSE_VTK:BOOL=OFF"
2426 "-DBUILD_DOC_Overview:BOOL=OFF"
2427 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2428 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2429 "-UCMAKE_INSTALL_LIBDIR")))
2431 `(("doxygen" ,doxygen)
2432 ;("freeimage" ,freeimage)
2433 ("freetype" ,freetype)
2435 ("libxext" ,libxext)
2442 ;; TODO: build Overview documentation and add 'doc' output.
2443 (home-page "https://www.opencascade.com")
2444 (synopsis "Libraries for 3D modeling and numerical simulation")
2446 "Open CASCADE is a set of libraries for the development of applications
2447 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2448 C++ class libraries providing services for 3D surface and solid modeling, CAD
2449 data exchange, and visualization. It is used for development of specialized
2450 software dealing with 3D models in design (CAD), manufacturing (CAM),
2451 numerical simulation (CAE), measurement equipment (CMM), and quality
2452 control (CAQ) domains.
2454 This is the certified version of the Open Cascade Technology (OCCT) library.")
2455 (license (list ;; OCCT library:
2456 license:lgpl2.1; with an exception for the use of header
2457 ; files, see OCCT_LGPL_EXCEPTION.txt.
2458 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2459 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2461 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2462 ;; src/StepFile/step.tab.*:
2463 license:gpl3+ ; with Bison 2.2 exception.
2464 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2465 (license:non-copyleft
2466 "https://www.unicode.org/license.html")
2467 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2468 license:public-domain))))
2478 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2480 (string-append "gmsh_"
2481 (string-replace-substring version "." "_")))))
2482 (file-name (git-file-name name version))
2484 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2485 (modules '((guix build utils)))
2488 (delete-file-recursively "contrib/metis")
2490 (build-system cmake-build-system)
2493 ("gfortran" ,gfortran)
2499 ("libxext" ,libxext)
2502 ("opencascade-occt" ,opencascade-occt)))
2504 `(("fontconfig" ,fontconfig)
2506 ("python" ,python)))
2508 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2509 "-DENABLE_BUILD_SHARED:BOOL=ON"
2510 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2511 #:imported-modules (,@%cmake-build-system-modules
2512 (guix build python-build-system))
2513 #:modules (((guix build python-build-system) #:select (site-packages))
2514 (guix build cmake-build-system)
2517 (modify-phases %standard-phases
2518 (add-after 'unpack 'patch-paths
2519 (lambda* (#:key inputs outputs #:allow-other-keys)
2520 ;; Use the standard Guix site-package path for
2521 ;; installation of the Python API.
2522 (substitute* "CMakeLists.txt"
2523 (("include\\(GNUInstallDirs\\)\n")
2524 (string-append "include(GNUInstallDirs)\n"
2526 (site-packages inputs outputs) ")\n"))
2527 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2528 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2529 ;; Find the shared library.
2530 (let ((libgmsh (string-append (assoc-ref outputs "out")
2531 "/lib/libgmsh.so")))
2532 (substitute* "api/gmsh.py"
2533 (("find_library\\(\"gmsh\"\\)")
2534 (simple-format #f "\"~a\"" libgmsh))))
2536 (home-page "http://gmsh.info/")
2537 (synopsis "3D finite element grid generator")
2538 (description "Gmsh is a 3D finite element grid generator with a built-in
2539 CAD engine and post-processor. Its design goal is to provide a fast, light
2540 and user-friendly meshing tool with parametric input and advanced
2541 visualization capabilities. Gmsh is built around four modules: geometry,
2542 mesh, solver and post-processing. The specification of any input to these
2543 modules is done either interactively using the graphical user interface or in
2544 ASCII text files using Gmsh's own scripting language.")
2545 (license license:gpl2+)))
2547 (define-public veusz
2554 (uri (pypi-uri "veusz" version))
2556 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2557 (build-system python-build-system)
2559 `(;; Tests will fail because they depend on optional packages like
2560 ;; python-astropy, which is not packaged.
2563 (modify-phases %standard-phases
2564 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2565 ;; the path is defined in Guix, therefore we have to change it.
2566 (add-after 'unpack 'fix-sip-dir
2568 (substitute* "pyqtdistutils.py"
2569 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2571 ;; Now we have to pass the correct sip_dir to setup.py.
2573 (lambda* (#:key inputs #:allow-other-keys)
2574 ;; We need to tell setup.py where to locate QtCoremod.sip
2575 ((@@ (guix build python-build-system) call-setuppy)
2577 (list (string-append "--sip-dir="
2578 (assoc-ref inputs "python-pyqt")
2581 ;; Ensure that icons are found at runtime.
2582 (add-after 'install 'wrap-executable
2583 (lambda* (#:key inputs outputs #:allow-other-keys)
2584 (let ((out (assoc-ref outputs "out")))
2585 (wrap-program (string-append out "/bin/veusz")
2586 `("QT_PLUGIN_PATH" prefix
2587 ,(list (string-append (assoc-ref inputs "qtsvg")
2588 "/lib/qt5/plugins/"))))))))))
2590 `(("pkg-config" ,pkg-config)
2591 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2592 ("qttools" ,qttools)
2593 ("python-sip" ,python-sip-4)))
2595 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2596 ("python-dbus" ,python-dbus)
2597 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2598 ("python-pyqt" ,python-pyqt)
2599 ("qtbase" ,qtbase-5)
2602 `(("python-numpy" ,python-numpy)))
2603 (home-page "https://veusz.github.io/")
2604 (synopsis "Scientific plotting package")
2606 "Veusz is a scientific plotting and graphing program with a graphical
2607 user interface, designed to produce publication-ready 2D and 3D plots. In
2608 addition it can be used as a module in Python for plotting. It supports
2609 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2610 (license license:gpl2+)))
2612 (define-public maxflow
2615 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2616 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2621 (url "https://github.com/gerddie/maxflow")
2623 (file-name (git-file-name name version))
2626 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2627 (build-system cmake-build-system)
2628 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2629 (synopsis "Library implementing Maxflow algorithm")
2630 (description "An implementation of the maxflow algorithm described in
2631 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2632 Energy Minimization in Computer Vision.\n
2633 Yuri Boykov and Vladimir Kolmogorov.\n
2634 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2636 (license license:gpl3+)))
2638 (define-public petsc
2645 ;; The *-lite-* tarball does not contain the *large* documentation
2646 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2647 "petsc-lite-" version ".tar.gz"))
2649 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2650 (outputs '("out" ; libraries and headers
2651 "examples")) ; ~30MiB of examples
2652 (build-system gnu-build-system)
2654 `(("python" ,python-2)))
2656 `(("gfortran" ,gfortran)
2657 ("openblas" ,openblas)
2658 ("superlu" ,superlu)
2659 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2660 ;; leaving out opengl, as configuration seems to only be for mac
2663 `(#:test-target "test"
2664 #:parallel-build? #f ; build is parallel by default
2671 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2672 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2673 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2675 (modify-phases %standard-phases
2677 ;; PETSc's configure script is actually a python script, so we can't
2678 ;; run it with bash.
2679 (lambda* (#:key outputs (configure-flags '())
2681 (let* ((prefix (assoc-ref outputs "out"))
2682 (flags `(,(string-append "--prefix=" prefix)
2683 ,@configure-flags)))
2684 (format #t "build directory: ~s~%" (getcwd))
2685 (format #t "configure flags: ~s~%" flags)
2686 (apply invoke "./configure" flags))))
2687 (add-after 'configure 'clean-local-references
2688 (lambda* (#:key outputs #:allow-other-keys)
2689 (let ((out (assoc-ref outputs "out")))
2690 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2691 ;; Prevent build directory from leaking into compiled code
2693 ;; Scrub timestamp for reproducibility
2694 ((".*Libraries compiled on.*") ""))
2695 (substitute* (find-files "." "petscvariables")
2696 ;; Do not expose build machine characteristics, set to defaults.
2697 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2698 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2700 (add-after 'install 'clean-install
2701 ;; Try to keep installed files from leaking build directory names.
2702 (lambda* (#:key inputs outputs #:allow-other-keys)
2703 (let ((out (assoc-ref outputs "out")))
2704 (substitute* (map (lambda (file)
2705 (string-append out "/lib/petsc/conf/" file))
2706 '("petscvariables"))
2708 ;; Make compiler references point to the store
2709 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2710 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2711 (string-append "= " (which compiler))))
2712 ;; PETSc installs some build logs, which aren't necessary.
2713 (for-each (lambda (file)
2714 (let ((f (string-append out "/lib/petsc/conf/" file)))
2715 (when (file-exists? f)
2717 '("configure.log" "make.log" "gmake.log"
2718 "test.log" "error.log" "RDict.db"
2719 "PETScBuildInternal.cmake"
2720 ;; Once installed, should uninstall with Guix
2723 (add-after 'install 'move-examples
2724 (lambda* (#:key outputs #:allow-other-keys)
2725 (let* ((out (assoc-ref outputs "out"))
2726 (examples (assoc-ref outputs "examples"))
2727 (exdir (string-append out "/share/petsc/examples"))
2728 (exdir' (string-append examples "/share/petsc/examples")))
2729 (copy-recursively exdir exdir')
2730 (delete-file-recursively exdir)
2732 (home-page "https://www.mcs.anl.gov/petsc")
2733 (synopsis "Library to solve PDEs")
2734 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2735 data structures and routines for the scalable (parallel) solution of
2736 scientific applications modeled by partial differential equations.")
2737 (license (license:non-copyleft
2738 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2740 (define-public petsc-complex
2741 (package (inherit petsc)
2742 (name "petsc-complex")
2744 (substitute-keyword-arguments (package-arguments petsc)
2745 ((#:configure-flags cf)
2746 `(cons "--with-scalar-type=complex" ,cf))))
2747 (synopsis "Library to solve PDEs (with complex scalars)")))
2749 (define-public petsc-openmpi
2750 (package (inherit petsc)
2751 (name "petsc-openmpi")
2753 `(("hdf5" ,hdf5-parallel-openmpi)
2754 ("hypre" ,hypre-openmpi)
2756 ("mumps" ,mumps-openmpi)
2757 ("openmpi" ,openmpi)
2758 ("scalapack" ,scalapack)
2759 ("scotch" ,pt-scotch32)
2760 ,@(package-inputs petsc)))
2762 (substitute-keyword-arguments (package-arguments petsc)
2763 ((#:configure-flags cf)
2765 "--with-mpiexec=mpirun"
2768 "--with-scalapack=1"
2770 ,(string-append "--with-mpi-dir="
2771 (assoc-ref %build-inputs "openmpi"))
2772 ,(string-append "--with-hdf5-include="
2773 (assoc-ref %build-inputs "hdf5") "/include")
2774 ,(string-append "--with-hdf5-lib="
2775 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2776 ,@(delete "--with-mpi=0" ,cf)))
2778 `(modify-phases ,phases
2779 (add-before 'configure 'mpi-setup
2780 ,%openmpi-setup)))))
2781 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2783 (define-public petsc-complex-openmpi
2784 (package (inherit petsc-complex)
2785 (name "petsc-complex-openmpi")
2787 `(("openmpi" ,openmpi)
2788 ,@(package-inputs petsc-complex)))
2790 (substitute-keyword-arguments (package-arguments petsc-complex)
2791 ((#:configure-flags cf)
2792 ``("--with-mpiexec=mpirun"
2793 ,(string-append "--with-mpi-dir="
2794 (assoc-ref %build-inputs "openmpi"))
2795 ,@(delete "--with-mpi=0" ,cf)))
2797 `(modify-phases ,phases
2798 (add-before 'configure 'mpi-setup
2799 ,%openmpi-setup)))))
2800 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2802 (define-public python-petsc4py
2804 (name "python-petsc4py")
2809 (uri (pypi-uri "petsc4py" version))
2812 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2813 (modules '((guix build utils)))
2816 ;; Ensure source file is regenerated in the build phase.
2817 (delete-file "src/petsc4py.PETSc.c")
2818 ;; Remove legacy GC code. See
2819 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2820 (substitute* "src/PETSc/cyclicgc.pxi"
2821 ((".*gc_refs.*") "" )
2822 ((".*PyGC_Head.*") ""))
2824 (build-system python-build-system)
2827 (modify-phases %standard-phases
2828 (add-before 'build 'pre-build
2830 ;; Define path to PETSc installation.
2831 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2833 (add-before 'check 'mpi-setup
2836 `(("python-cython" ,python-cython)))
2838 `(("petsc" ,petsc-openmpi)
2839 ("python-numpy" ,python-numpy)))
2840 (home-page "https://bitbucket.org/petsc/petsc4py/")
2841 (synopsis "Python bindings for PETSc")
2842 (description "PETSc, the Portable, Extensible Toolkit for
2843 Scientific Computation, is a suite of data structures and routines for
2844 the scalable (parallel) solution of scientific applications modeled by
2845 partial differential equations. It employs the MPI standard for all
2846 message-passing communication. @code{petsc4py} provides Python
2847 bindings to almost all functions of PETSc.")
2848 (license license:bsd-3)))
2850 (define-public python-kiwisolver
2852 (name "python-kiwisolver")
2856 (uri (pypi-uri "kiwisolver" version))
2859 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2860 (build-system python-build-system)
2861 (home-page "https://github.com/nucleic/kiwi")
2862 (synopsis "Fast implementation of the Cassowary constraint solver")
2864 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2865 solving algorithm. Kiwi has been designed from the ground up to be
2866 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2867 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2868 savings are consistently > 5x.")
2869 (license license:bsd-3)))
2871 (define-public python2-kiwisolver
2872 (package-with-python2 python-kiwisolver))
2874 (define-public slepc
2881 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2885 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2886 (build-system gnu-build-system)
2888 `(("python" ,python-2)
2889 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2891 `(("arpack" ,arpack-ng)
2892 ("gfortran" ,gfortran)))
2894 `(("petsc" ,petsc)))
2896 `(#:parallel-build? #f ;build is parallel by default
2898 `(,(string-append "--with-arpack-dir="
2899 (assoc-ref %build-inputs "arpack") "/lib"))
2900 #:make-flags ;honor (parallel-job-count)
2901 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2902 ,(string-append "PETSCCONFIGDIR="
2903 (assoc-ref %build-inputs "petsc:examples")
2904 "/share/petsc/examples/config"))
2906 (modify-phases %standard-phases
2908 ;; configure is a python script, so we can't run it with bash.
2909 (lambda* (#:key inputs outputs (configure-flags '())
2911 (let* ((prefix (assoc-ref outputs "out"))
2912 (flags `(,(string-append "--prefix=" prefix)
2913 ,@configure-flags)))
2914 (format #t "build directory: ~s~%" (getcwd))
2915 (format #t "configure flags: ~s~%" flags)
2916 (setenv "SLEPC_DIR" (getcwd))
2917 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2918 (apply invoke "./configure" flags))))
2919 (add-after 'install 'delete-doc
2920 ;; TODO: SLEPc installs HTML documentation alongside headers in
2921 ;; $out/include. We'd like to move them to share/doc, but delete
2922 ;; them for now, as they are incomplete and installing the complete
2923 ;; documentation is difficult.
2924 (lambda* (#:key outputs #:allow-other-keys)
2925 (let* ((out (assoc-ref outputs "out")))
2926 (for-each delete-file (find-files out "\\.html$"))
2928 (add-after 'install 'clean-install
2929 ;; Clean up unnecessary build logs from installation.
2930 (lambda* (#:key outputs #:allow-other-keys)
2931 (let ((out (assoc-ref outputs "out")))
2932 (for-each (lambda (file)
2933 (let ((f (string-append out "/lib/slepc/conf/" file)))
2934 (when (file-exists? f)
2936 '("configure.log" "make.log" "gmake.log"
2937 "test.log" "error.log" "RDict.db"
2940 (home-page "https://slepc.upv.es")
2941 (synopsis "Scalable library for eigenproblems")
2942 (description "SLEPc is a software library for the solution of large sparse
2943 eigenproblems on parallel computers. It can be used for the solution of
2944 linear eigenvalue problems formulated in either standard or generalized form,
2945 as well as other related problems such as the singular value decomposition.
2946 The emphasis of the software is on methods and techniques appropriate for
2947 problems in which the associated matrices are sparse, for example, those
2948 arising after the discretization of partial differential equations.")
2949 (license license:bsd-2)))
2951 (define-public slepc-complex
2952 (package (inherit slepc)
2953 (name "slepc-complex")
2955 `(("petsc" ,petsc-complex)
2956 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2957 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2959 (define-public slepc-openmpi
2960 (package (inherit slepc)
2961 (name "slepc-openmpi")
2963 (substitute-keyword-arguments (package-arguments slepc)
2964 ((#:phases phases '%standard-phases)
2965 `(modify-phases ,phases
2966 (add-before 'check 'mpi-setup
2967 ,%openmpi-setup)))))
2970 ("arpack" ,arpack-ng-openmpi)
2971 ,@(alist-delete "arpack" (package-inputs slepc))))
2973 `(("petsc" ,petsc-openmpi)
2974 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2975 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2977 (define-public slepc-complex-openmpi
2978 (package (inherit slepc-openmpi)
2979 (name "slepc-complex-openmpi")
2981 `(("petsc" ,petsc-complex-openmpi)
2982 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2983 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2985 (define-public python-slepc4py
2987 (name "python-slepc4py")
2992 (uri (pypi-uri "slepc4py" version))
2995 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2996 (build-system python-build-system)
2999 (modify-phases %standard-phases
3000 (add-before 'build 'pre-build
3002 ;; Define path to PETSc installation.
3003 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3004 ;; Define path to SLEPc installation.
3005 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3007 (add-before 'check 'mpi-setup
3010 `(("python-numpy" ,python-numpy)
3011 ("python-petsc4py" ,python-petsc4py)
3012 ("slepc" ,slepc-openmpi)))
3013 (home-page "https://bitbucket.org/slepc/slepc4py/")
3014 (synopsis "Python bindings for SLEPc")
3015 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3016 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3017 Scientific Computation. It employs the MPI standard for all
3018 message-passing communication. @code{slepc4py} provides Python
3019 bindings to almost all functions of SLEPc.")
3020 (license license:bsd-3)))
3022 (define-public metamath
3030 (url "https://github.com/metamath/metamath-exe")
3031 (commit (string-append "v" version))))
3032 (file-name (git-file-name name version))
3034 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3035 (build-system gnu-build-system)
3037 `(("autoconf" ,autoconf)
3038 ("automake" ,automake)))
3039 (home-page "http://us.metamath.org/")
3040 (synopsis "Proof verifier based on a minimalistic formalism")
3042 "Metamath is a tiny formal language and that can express theorems in
3043 abstract mathematics, with an accompyaning @command{metamath} executable that
3044 verifies databases of these proofs. There is a public database,
3045 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3046 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3047 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3048 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3050 (license license:gpl2+)))
3052 (define-public mumps
3059 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
3063 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
3064 (patches (search-patches "mumps-build-parallelism.patch"
3065 "mumps-shared-libseq.patch"
3066 "mumps-shared-mumps.patch"
3067 "mumps-shared-pord.patch"))))
3068 (build-system gnu-build-system)
3070 `(("fortran" ,gfortran)
3071 ;; These are required for linking against mumps, but we let the user
3072 ;; declare the dependency.
3075 ("scotch" ,scotch)))
3077 `(#:modules ((ice-9 match)
3080 ,@%gnu-build-system-modules)
3082 (modify-phases %standard-phases
3084 (lambda* (#:key inputs #:allow-other-keys)
3085 (call-with-output-file "Makefile.inc"
3096 INCSEQ = -I$(topdir)/libseq
3097 LIBSEQ = $(topdir)/libseq/libmpiseq.a
3098 LIBSEQNEEDED = libseqneeded~;
3102 AR = ar vr # rules require trailing space, ugh...
3105 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
3107 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
3108 LIBOTHERS = -pthread
3111 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
3115 LIBS = $(SCALAP) $(LIBSEQ)
3116 LPORDDIR = $(topdir)/PORD/lib
3117 IPORD = -I$(topdir)/PORD/include
3118 LPORD = $(LPORDDIR)/libpord.a
3119 ORDERINGSF = -Dpord~@[
3121 IMETIS = -I$(METISDIR)/include
3122 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3123 ORDERINGSF += -Dmetis~]~@[~:{
3125 ISCOTCH = -I$(SCOTCHDIR)/include
3126 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
3127 ORDERINGSF += ~a~}~]
3128 ORDERINGSC = $(ORDERINGSF)
3129 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
3130 IORDERINGSF = $(ISCOTCH)
3131 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3132 (assoc-ref inputs "mpi")
3133 (assoc-ref inputs "blas")
3134 (assoc-ref inputs "scalapack")
3135 (assoc-ref inputs "metis")
3136 (match (list (assoc-ref inputs "pt-scotch")
3137 (assoc-ref inputs "scotch"))
3141 `((,scotch "" "-Dscotch")))
3144 "-lptesmumps -lptscotch -lptscotcherr "
3145 "-Dptscotch")))))))))
3147 ;; By default only the d-precision library is built. Make with "all"
3148 ;; target so that all precision libraries and examples are built.
3150 (invoke "make" "all"
3151 (format #f "-j~a" (parallel-job-count)))))
3153 ;; Run the simple test drivers, which read test input from stdin:
3154 ;; from the "real" input for the single- and double-precision
3155 ;; testers, and from the "cmplx" input for complex-precision
3156 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3157 ;; package to prefix execution with "mpirun".
3158 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3159 (with-directory-excursion "examples"
3162 (let ((tester (apply open-pipe*
3165 ,(string-append "./" prec
3167 (input (open-input-file
3168 (string-append "input_simpletest_" type))))
3170 (dump-port input tester)
3172 (zero? (close-pipe tester)))))
3174 '("real" "real" "cmplx" "cmplx")))))
3176 (lambda* (#:key outputs #:allow-other-keys)
3177 (let* ((out (assoc-ref outputs "out"))
3178 (libdir (string-append out "/lib")))
3179 (copy-recursively "lib" libdir)
3180 (copy-recursively "include" (string-append out "/include"))
3181 (when (file-exists? "libseq/libmpiseq.a")
3182 (install-file "libseq/libmpiseq.a" libdir))
3183 (when (file-exists? "libseq/libmpiseq.so")
3184 (install-file "libseq/libmpiseq.so" libdir))
3186 (home-page "http://mumps.enseeiht.fr")
3187 (synopsis "Multifrontal sparse direct solver")
3189 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3190 sparse system of linear equations A x = b using Gaussian elimination.")
3191 (license license:cecill-c)))
3193 (define-public mumps-metis
3194 (package (inherit mumps)
3195 (name "mumps-metis")
3197 (alist-delete "scotch" (package-inputs mumps)))))
3199 (define-public mumps-openmpi
3200 (package (inherit mumps)
3201 (name "mumps-openmpi")
3204 ("scalapack" ,scalapack)
3205 ("pt-scotch" ,pt-scotch)
3206 ,@(alist-delete "scotch" (package-inputs mumps))))
3208 (substitute-keyword-arguments (package-arguments mumps)
3210 `(modify-phases ,phases
3211 (add-before 'check 'mpi-setup
3215 ((assoc-ref ,phases 'check)
3216 #:exec-prefix '("mpirun" "-n" "2"))))))))
3217 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3219 (define-public mumps-metis-openmpi
3220 (package (inherit mumps-openmpi)
3221 (name "mumps-metis-openmpi")
3223 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3225 (define-public ruby-asciimath
3227 (name "ruby-asciimath")
3232 (uri (rubygems-uri "asciimath" version))
3235 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3236 (build-system ruby-build-system)
3238 `(("ruby-nokogiri" ,ruby-nokogiri)
3239 ("ruby-rspec" ,ruby-rspec)))
3240 (synopsis "AsciiMath parsing and conversion library")
3242 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3243 easy-to-write markup language for mathematics.")
3244 (home-page "https://github.com/asciidoctor/asciimath")
3245 (license license:expat)))
3247 (define-public superlu
3254 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3255 "superlu_" version ".tar.gz"))
3257 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3258 (modules '((guix build utils)))
3260 ;; Replace the non-free implementation of MC64 with a stub adapted
3263 (use-modules (ice-9 regex)
3265 (call-with-output-file "SRC/mc64ad.c"
3270 void mc64id_(int *a) {
3271 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3274 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3275 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3276 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3279 ;; Remove the corresponding license verbiage. MC64 license follows
3280 ;; a "------" line separator.
3281 (with-atomic-file-replacement "License.txt"
3282 (let ((rx (make-regexp "-{8}")))
3285 (let ((line (read-line in 'concat)))
3286 (unless (regexp-exec rx line)
3290 (build-system cmake-build-system)
3294 `(("blas" ,openblas)
3295 ("gfortran" ,gfortran)))
3297 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3298 "-DTPL_BLAS_LIBRARIES=openblas"
3299 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3300 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3301 (synopsis "Supernodal direct solver for sparse linear systems")
3303 "SuperLU is a general purpose library for the direct solution of large,
3304 sparse, nonsymmetric systems of linear equations on high performance machines.
3305 The library is written in C and is callable from either C or Fortran. The
3306 library routines perform an LU decomposition with partial pivoting and
3307 triangular system solves through forward and back substitution. The library
3308 also provides threshold-based ILU factorization preconditioners.")
3309 (license (list license:bsd-3
3310 license:gpl2+ ;EXAMPLE/*fgmr.c
3311 (license:fsf-free "file://SRC/colamd.h")))))
3313 (define-public superlu-dist
3315 (name "superlu-dist")
3321 (url "https://github.com/xiaoyeli/superlu_dist")
3322 (commit (string-append "v" version))))
3323 (file-name (git-file-name name version))
3325 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3326 (modules '((guix build utils)))
3328 ;; Replace the non-free implementation of MC64 with a stub
3330 (make-file-writable "SRC/mc64ad_dist.c")
3331 (call-with-output-file "SRC/mc64ad_dist.c"
3336 void mc64id_dist(int *a) {
3337 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3340 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3341 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3342 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3345 (substitute* "SRC/util.c" ;adjust default algorithm
3346 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3347 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3348 ;; general (i.e. non-square) processor-grid support.
3349 "RowPerm = NOROWPERM;"))
3351 (patches (search-patches "superlu-dist-scotchmetis.patch"
3352 "superlu-dist-awpm-grid.patch"))))
3353 (build-system cmake-build-system)
3357 `(("gfortran" ,gfortran)
3360 ("combblas" ,combinatorial-blas)))
3362 `(("mpi" ,openmpi) ;headers include MPI heades
3363 ("parmetis" ,pt-scotch32 "metis")
3364 ("pt-scotch" ,pt-scotch32)))
3366 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3367 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3368 "-DTPL_ENABLE_COMBBLASLIB=YES"
3369 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3370 "-DTPL_LAPACK_LIBRARIES=-llapack"
3371 (string-append "-DTPL_PARMETIS_LIBRARIES="
3373 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3374 "scotchmetis" "scotch" "scotcherr")
3376 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3377 (assoc-ref %build-inputs "parmetis")
3379 "-DTPL_ENABLE_COMBBLASLIB=ON"
3380 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3381 (assoc-ref %build-inputs "combblas")
3382 "/include/CombBLAS;"
3383 (assoc-ref %build-inputs "combblas")
3384 "/include/BipartiteMatchings")
3385 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3387 (modify-phases %standard-phases
3388 (add-before 'configure 'set-c++-standard
3390 (substitute* "CMakeLists.txt"
3391 ;; AWPM headers require C++14
3392 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3393 (add-before 'check 'mpi-setup
3395 (add-before 'check 'omp-setup
3396 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3397 (home-page (package-home-page superlu))
3398 (synopsis "Parallel supernodal direct solver")
3400 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3401 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3402 implemented in ANSI C, and MPI for communications.")
3403 (license license:bsd-3)))
3405 (define-public scotch
3412 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3413 "latestfile/298/scotch_" version ".tar.gz"))
3415 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3416 (patches (search-patches "scotch-build-parallelism.patch"
3417 "scotch-integer-declarations.patch"))))
3418 (build-system gnu-build-system)
3424 ("gfortran" ,gfortran)))
3425 (outputs '("out" "metis"))
3427 `(#:make-flags (list (string-append "prefix=" %output))
3429 (modify-phases %standard-phases
3431 'unpack 'chdir-to-src
3432 (lambda _ (chdir "src") #t))
3436 (call-with-output-file "Makefile.inc"
3451 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3452 LDFLAGS = -lz -lm -lrt -lpthread
3454 LEX = flex -Pscotchyy -olex.yy.c
3459 YACC = bison -pscotchyy -y -b y
3461 '("COMMON_FILE_COMPRESS_GZ"
3463 "COMMON_RANDOM_FIXED_SEED"
3464 "INTSIZE64" ;use 'int64_t'
3465 ;; Prevents symbol clashes with libesmumps
3467 ;; XXX: Causes invalid frees in superlu-dist tests
3469 ;; "SCOTCH_PTHREAD_NUMBER=2"
3470 "restrict=__restrict"))))
3472 (add-after 'build 'build-esmumps
3475 (format #f "-j~a" (parallel-job-count))
3477 (add-before 'install 'make-install-dirs
3478 (lambda* (#:key outputs #:allow-other-keys)
3479 (mkdir (assoc-ref outputs "out"))))
3480 (add-after 'install 'install-metis
3481 (lambda* (#:key outputs #:allow-other-keys)
3482 (let ((out (assoc-ref outputs "metis")))
3484 ;; metis files are not installed with 'make install'
3485 (for-each (lambda (f)
3486 (install-file f (string-append out "/include")))
3487 (find-files "../include/" ".*metis\\.h"))
3488 (for-each (lambda (f)
3489 (install-file f (string-append out "/lib")))
3490 (find-files "../lib/" ".*metis\\..*"))
3492 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3494 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3495 (synopsis "Programs and libraries for graph algorithms")
3496 (description "SCOTCH is a set of programs and libraries which implement
3497 the static mapping and sparse matrix reordering algorithms developed within
3498 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3499 conquer approach, to scientific computing problems such as graph and mesh
3500 partitioning, static mapping, and sparse matrix ordering, in application
3501 domains ranging from structural mechanics to operating systems or
3503 ;; See LICENSE_en.txt
3504 (license license:cecill-c)))
3506 (define-public scotch32
3507 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3508 ;; some applications.
3509 (package (inherit scotch)
3512 (substitute-keyword-arguments (package-arguments scotch)
3513 ((#:phases scotch-phases)
3514 `(modify-phases ,scotch-phases
3518 (call-with-output-file "Makefile.inc"
3533 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3534 LDFLAGS = -lz -lm -lrt -lpthread
3536 LEX = flex -Pscotchyy -olex.yy.c
3541 YACC = bison -pscotchyy -y -b y
3543 '("COMMON_FILE_COMPRESS_GZ"
3545 "COMMON_RANDOM_FIXED_SEED"
3546 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3547 ;; Prevents symbolc clashes with libesmumps
3549 ;; XXX: Causes invalid frees in superlu-dist tests
3551 ;; "SCOTCH_PTHREAD_NUMBER=2"
3552 "restrict=__restrict"))))))))))
3554 "Programs and libraries for graph algorithms (32-bit integers)")))
3556 (define-public scotch-shared
3557 (package (inherit scotch)
3558 (name "scotch-shared")
3564 (substitute-keyword-arguments (package-arguments scotch)
3565 ((#:phases scotch-shared-phases)
3566 `(modify-phases ,scotch-shared-phases
3570 ;; Otherwise, the RUNPATH will lack the final path component.
3571 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3572 (assoc-ref %outputs "out") "/lib"))
3573 (call-with-output-file "Makefile.inc"
3581 ARFLAGS = -shared -o
3588 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3589 CLIBFLAGS = -shared -fPIC
3590 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3592 LEX = flex -Pscotchyy -olex.yy.c
3597 YACC = bison -pscotchyy -y -b y
3599 '("COMMON_FILE_COMPRESS_GZ"
3601 "COMMON_RANDOM_FIXED_SEED"
3602 "INTSIZE64" ;use 'int64_t'
3603 ;; Prevents symbolc clashes with libesmumps
3605 ;; XXX: Causes invalid frees in superlu-dist tests
3607 ;; "SCOTCH_PTHREAD_NUMBER=2"
3608 "restrict=__restrict"
3612 "Programs and libraries for graph algorithms (shared libraries version)")))
3614 (define-public pt-scotch
3615 (package (inherit scotch)
3618 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3620 (substitute-keyword-arguments (package-arguments scotch)
3621 ((#:phases scotch-phases)
3622 `(modify-phases ,scotch-phases
3626 (invoke "make" (format #f "-j~a" (parallel-job-count))
3627 "ptscotch" "ptesmumps")
3629 ;; Install the serial metis compatibility library
3630 (invoke "make" "-C" "libscotchmetis" "install")))
3631 (add-before 'check 'mpi-setup
3635 (invoke "make" "ptcheck")))))))
3636 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3638 (define-public pt-scotch32
3639 (package (inherit scotch32)
3640 (name "pt-scotch32")
3642 `(("openmpi" ,openmpi))) ;headers include MPI headers
3644 (substitute-keyword-arguments (package-arguments scotch32)
3645 ((#:phases scotch32-phases)
3646 `(modify-phases ,scotch32-phases
3649 (invoke "make" (format #f "-j~a" (parallel-job-count))
3650 "ptscotch" "ptesmumps")
3651 ;; Install the serial metis compatibility library
3652 (invoke "make" "-C" "libscotchmetis" "install")))
3653 (add-before 'check 'mpi-setup
3657 (invoke "make" "ptcheck")))))))
3659 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3661 (define-public pt-scotch-shared
3662 (package (inherit scotch-shared)
3663 (name "pt-scotch-shared")
3665 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3667 (substitute-keyword-arguments (package-arguments scotch-shared)
3668 ((#:phases scotch-shared-phases)
3669 `(modify-phases ,scotch-shared-phases
3673 (invoke "make" (format #f "-j~a" (parallel-job-count))
3674 "ptscotch" "ptesmumps")
3676 ;; Install the serial metis compatibility library
3677 (invoke "make" "-C" "libscotchmetis" "install")))
3678 (add-before 'check 'mpi-setup
3679 ,%openmpi-setup)))))
3680 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3683 (define-public metis
3690 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3691 "metis-" version ".tar.gz"))
3694 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3696 `((release-monitoring-url
3697 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3698 (build-system cmake-build-system)
3700 `(("blas" ,openblas)))
3702 `(#:tests? #f ;no tests
3703 #:configure-flags `("-DSHARED=ON"
3704 ,(string-append "-DGKLIB_PATH=" (getcwd)
3705 "/metis-" ,version "/GKlib"))))
3706 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3707 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3709 "METIS is a set of serial programs for partitioning graphs, partitioning
3710 finite element meshes, and producing fill-reducing orderings for sparse
3711 matrices. The algorithms implemented in METIS are based on the multilevel
3712 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3714 (license license:asl2.0))) ;As of version 5.0.3
3716 (define-public p4est
3723 (uri (string-append "http://p4est.github.io/release/p4est-"
3727 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3728 (build-system gnu-build-system)
3730 `(("fortran" ,gfortran)
3735 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3736 (assoc-ref %build-inputs "blas")
3738 ,(string-append "LAPACK_LIBS=-L"
3739 (assoc-ref %build-inputs "lapack")
3741 #:phases (modify-phases %standard-phases
3742 (add-before 'check 'mpi-setup
3744 (home-page "http://www.p4est.org")
3745 (synopsis "Adaptive mesh refinement on forests of octrees")
3747 "The p4est software library enables the dynamic management of a
3748 collection of adaptive octrees, conveniently called a forest of octrees.
3749 p4est is designed to work in parallel and scales to hundreds of thousands of
3751 (license license:gpl2+)))
3753 (define-public p4est-openmpi
3754 (package (inherit p4est)
3755 (name "p4est-openmpi")
3758 ,@(package-inputs p4est)))
3760 (substitute-keyword-arguments (package-arguments p4est)
3761 ((#:configure-flags cf)
3762 ``("--enable-mpi" ,@,cf))))
3763 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3765 (define-public gsegrafix
3766 ;; This is an old and equally dead "experimental fork" of the longer-dead
3767 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
3768 ;; libraries, instead rendering plots with Pango.
3775 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
3776 "gsegrafix-experimental-" version ".tar.gz"))
3778 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
3779 (build-system gnu-build-system)
3782 (list "--disable-static")))
3787 `(("pkg-config" ,pkg-config)))
3788 (home-page "https://www.gnu.org/software/gsegrafix/")
3789 (synopsis "GNOME application to create scientific and engineering plots")
3791 "GSEGrafix is an application which produces high-quality graphical
3792 plots for science and engineering. Plots are specified via simple ASCII
3793 parameter files and data files and are presented in an anti-aliased GNOME
3794 canvas. The program supports rectangular two-dimensional plots, histograms,
3795 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3796 to BMP, JPEG or PNG image formats.")
3797 (license license:gpl3+)))
3799 (define-public maxima
3806 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3807 version "-source/" name "-" version ".tar.gz"))
3810 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
3811 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3812 (build-system gnu-build-system)
3814 `(("bash" ,bash-minimal)
3815 ("gnuplot" ,gnuplot) ;for plots
3818 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3820 `(("texinfo" ,texinfo)
3822 ("python" ,python)))
3825 ,#~(list "--enable-sbcl"
3826 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
3827 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
3828 (string-append "--with-wish=" #$tk "/bin/wish"
3829 #$(version-major+minor (package-version tk))))
3830 ;; By default Maxima attempts to write temporary files to
3831 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3832 ;; Work around that.
3833 #:make-flags (list "TMPDIR=/tmp")
3835 (modify-phases %standard-phases
3836 (add-after 'unpack 'patch-paths
3837 (lambda* (#:key inputs #:allow-other-keys)
3838 (let* ((sed (search-input-file inputs "/bin/sed"))
3839 (coreutils (assoc-ref inputs "coreutils"))
3840 (dirname (string-append coreutils "/bin/dirname"))
3841 (head (string-append coreutils "/bin/head"))
3842 (perl (search-input-file inputs "/bin/perl"))
3843 (python (search-input-file inputs "/bin/python3")))
3844 (substitute* "src/maxima.in"
3845 (("sed ") (string-append sed " "))
3846 (("dirname") dirname)
3848 (substitute* "doc/info/Makefile.in"
3849 (("/usr/bin/env perl") perl))
3850 (substitute* "doc/info/build_html.sh.in"
3851 (("python") python))
3853 (add-before 'check 'pre-check
3855 (chmod "src/maxima" #o555)
3859 ;; This is derived from the testing code in the "debian/rules" file
3860 ;; of Debian's Maxima package.
3861 ;; If Maxima can successfully run this, the binary to be installed
3867 "--batch-string=\"run_testsuite();\" "
3868 "| grep -q \"No unexpected errors found\""))))
3869 ;; Make sure the doc and emacs files are found in the
3870 ;; standard location. Also configure maxima to find gnuplot
3871 ;; without having it on the PATH.
3872 (add-after 'install 'post-install
3873 (lambda* (#:key outputs inputs #:allow-other-keys)
3874 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3875 (out (assoc-ref outputs "out"))
3876 (datadir (string-append out "/share/maxima/" ,version))
3877 (binutils (dirname (search-input-file inputs "/bin/as"))))
3878 (with-directory-excursion out
3879 (mkdir-p "share/emacs")
3880 (mkdir-p "share/doc")
3882 (string-append datadir "/doc/")
3883 (string-append out "/share/doc/maxima"))
3884 (with-atomic-file-replacement
3885 (string-append datadir "/share/maxima-init.lisp")
3887 (format out "~a ~s~a~%"
3888 "(setf $gnuplot_command "
3889 (string-append gnuplot "/bin/gnuplot") ")")
3890 (dump-port in out))))
3891 ;; Ensure that Maxima will have access to the GNU binutils
3892 ;; components at runtime.
3893 (wrap-program (string-append out "/bin/maxima")
3894 `("PATH" prefix (,binutils))))
3896 (home-page "https://maxima.sourceforge.io")
3897 (synopsis "Numeric and symbolic expression manipulation")
3898 (description "Maxima is a system for the manipulation of symbolic and
3899 numerical expressions. It yields high precision numeric results by using
3900 exact fractions, arbitrary precision integers, and variable precision floating
3902 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3903 ;; Others simply say "GNU General Public License" without stating a
3904 ;; version (which implicitly means gpl1+).
3905 ;; At least one file (src/maxima.asd) says "version 2."
3906 ;; GPLv2 only is therefore the smallest subset.
3907 (license license:gpl2)))
3909 (define-public wxmaxima
3917 (url "https://github.com/wxMaxima-developers/wxmaxima")
3918 (commit (string-append "Version-" version))))
3919 (file-name (git-file-name name version))
3921 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
3922 (build-system cmake-build-system)
3924 `(("gettext" ,gettext-minimal)))
3926 `(("wxwidgets" ,wxwidgets)
3929 ("adwaita-icon-theme" ,adwaita-icon-theme)
3931 ("shared-mime-info" ,shared-mime-info)))
3933 `(#:tests? #f ; tests fail non-deterministically
3935 (modify-phases %standard-phases
3936 (add-after 'unpack 'patch-doc-path
3938 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3939 ;; documentation. Only licensing information is placed there by
3941 (substitute* "src/Dirstructure.cpp"
3942 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3944 (add-after 'install 'wrap-program
3945 (lambda* (#:key inputs outputs #:allow-other-keys)
3946 (wrap-program (string-append (assoc-ref outputs "out")
3949 (,(string-append (assoc-ref inputs "maxima")
3951 ;; For GtkFileChooserDialog.
3952 `("GSETTINGS_SCHEMA_DIR" =
3953 (,(string-append (assoc-ref inputs "gtk+")
3954 "/share/glib-2.0/schemas")))
3955 `("XDG_DATA_DIRS" ":" prefix
3956 (;; Needed by gdk-pixbuf to know supported icon formats.
3958 (assoc-ref inputs "shared-mime-info") "/share")
3959 ;; The default icon theme of GTK+.
3961 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3963 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3964 (synopsis "Graphical user interface for the Maxima computer algebra system")
3966 "wxMaxima is a graphical user interface for the Maxima computer algebra
3967 system. It eases the use of Maxima by making most of its commands available
3968 through a menu system and by providing input dialogs for commands that require
3969 more than one argument. It also implements its own display engine that
3970 outputs mathematical symbols directly instead of depicting them with ASCII
3973 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3974 text and mathematical calculations to create documents, exporting of input and
3975 output to TeX, and a browser for Maxima's manual including command index and
3976 full text searching.")
3977 (license license:gpl2+)))
3979 (define-public armadillo
3985 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3989 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3990 (build-system cmake-build-system)
3991 (arguments `(#:tests? #f)) ; no test target
3993 `(("openblas" ,openblas)
3995 ("arpack" ,arpack-ng)))
3996 (home-page "http://arma.sourceforge.net/")
3997 (synopsis "C++ linear algebra library")
3999 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4000 between speed and ease of use. It is useful for algorithm development
4001 directly in C++, or quick conversion of research code into production
4002 environments. It can be used for machine learning, pattern recognition,
4003 signal processing, bioinformatics, statistics, econometrics, etc. The library
4004 provides efficient classes for vectors, matrices and cubes, as well as 150+
4005 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4006 (license license:asl2.0)))
4008 (define-public muparser
4009 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4010 ;; different hash. In order to make `guix package --upgrade` work correctly,
4011 ;; we set a Guix packaging revision.
4012 ;; When the next version of muparser is released, we can remove
4013 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4014 (let ((upstream-version "2.2.5")
4018 (version (string-append upstream-version "-" revision))
4023 (url "https://github.com/beltoforion/muparser")
4024 (commit (string-append "v" upstream-version))))
4025 (file-name (git-file-name name version))
4027 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4028 (build-system gnu-build-system)
4030 `(#:configure-flags '("--enable-samples=no")
4031 #:tests? #f)) ;no "check" target
4032 (home-page "http://muparser.beltoforion.de/")
4033 (synopsis "Fast parser library for mathematical expressions")
4035 "muParser is an extensible high performance math parser library. It is
4036 based on transforming an expression into a bytecode and precalculating constant
4038 (license license:expat))))
4040 (define-public openblas
4048 (url "https://github.com/xianyi/OpenBLAS")
4049 (commit (string-append "v" version))))
4050 (file-name (git-file-name name version))
4053 "14jxh0v3jfbw4mfjx4mcz4dd51lyq7pqvh9k8dg94539ypzjr2lj"))))
4054 (build-system gnu-build-system)
4056 `(#:test-target "test"
4057 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4058 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4059 ;; we need to disable substitutions.
4061 ,(let ((system (or (%current-target-system) (%current-system))))
4062 (or (string-prefix? "x86_64" system)
4063 (string-prefix? "i686" system)
4064 (string-prefix? "mips" system)
4065 (string-prefix? "aarch64" system)))
4067 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4069 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4071 ;; This is the maximum number of threads OpenBLAS will ever use (that
4072 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4073 ;; is used.) If we don't set it, the makefile sets it to the number
4074 ;; of cores of the build machine, which is obviously wrong.
4077 ;; Build the library for all supported CPUs. This allows
4078 ;; switching CPU targets at runtime with the environment variable
4079 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4080 ;; Unfortunately, this is not supported on all architectures,
4081 ;; where it leads to failed builds.
4082 ,@(let ((system (or (%current-target-system) (%current-system))))
4084 ((or (string-prefix? "x86_64" system)
4085 (string-prefix? "i686" system))
4086 '("DYNAMIC_ARCH=1"))
4087 ;; On some of these architectures the CPU can't be detected.
4088 ((or (string-prefix? "powerpc64le" system)
4089 (string-prefix? "aarch64" system))
4092 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4093 ;; two available MIPS targets special extended instructions
4094 ;; for Loongson cores are used.
4095 ((string-prefix? "mips" system)
4096 '("TARGET=SICORTEX"))
4097 ;; Failed to detect CPU.
4098 ((string-prefix? "armhf" system)
4101 ;; no configure script
4103 (modify-phases %standard-phases
4105 (add-before 'build 'set-extralib
4106 (lambda* (#:key inputs #:allow-other-keys)
4107 ;; Get libgfortran found when building in utest.
4109 (string-append "-L" (assoc-ref inputs "fortran-lib")
4113 `(("fortran-lib" ,gfortran "lib")))
4116 ("fortran" ,gfortran)
4118 (home-page "https://www.openblas.net/")
4119 (synopsis "Optimized BLAS library based on GotoBLAS")
4121 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4122 (license license:bsd-3)))
4124 (define-public openblas-ilp64
4125 (package/inherit openblas
4126 (name "openblas-ilp64")
4127 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4129 (substitute-keyword-arguments (package-arguments openblas)
4130 ((#:make-flags flags '())
4131 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4133 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4134 (license license:bsd-3)))
4140 (home-page "https://github.com/flame/blis")
4143 (uri (git-reference (url home-page) (commit version)))
4146 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4147 (file-name (git-file-name "blis" version))))
4149 `(("python" ,python)
4151 (build-system gnu-build-system)
4154 ((guix build gnu-build-system)
4157 #:test-target "test"
4159 (modify-phases %standard-phases
4161 (lambda* (#:key outputs
4164 (configure-flags '())
4166 ;; This is a home-made 'configure' script.
4167 (let* ((out (assoc-ref outputs "out"))
4168 ;; Guix-specific support for choosing the configuration
4169 ;; via #:configure-flags: see below for details.
4170 (config-flag-prefix "--blis-config=")
4171 (maybe-config-flag (find
4173 (string-prefix? config-flag-prefix s))
4175 (configure-flags (if maybe-config-flag
4176 (delete maybe-config-flag
4179 ;; Select the "configuration" to build.
4180 ;; The "generic" configuration is non-optimized but
4181 ;; portable (no assembly).
4182 ;; The "x86_64" configuration family includes
4183 ;; sub-configurations for all supported
4184 ;; x86_64 microarchitectures.
4185 ;; BLIS currently lacks runtime hardware detection
4186 ;; for other architectures: see
4187 ;; <https://github.com/flame/blis/commit/c534da6>.
4188 ;; Conservatively, we stick to "generic" on armhf,
4189 ;; aarch64, and ppc64le for now. (But perhaps
4190 ;; "power9", "cortexa9", and "cortexa57" might be
4191 ;; general enough to use?)
4192 ;; Another approach would be to use the "auto"
4193 ;; configuration and make this package
4194 ;; non-substitutable.
4195 ;; The build is fairly intensive, though.
4199 (substring maybe-config-flag
4200 (string-length config-flag-prefix)))
4201 ((string-prefix? "x86_64" (or target system))
4210 "--enable-threading=openmp"
4211 "--enable-verbose-make"
4214 (format #t "configure args: ~s~%" configure-args)
4219 (add-before 'check 'show-test-output
4221 ;; By default "make check" is silent. Make it verbose.
4222 (system "tail -F output.testsuite &")
4224 (synopsis "High-performance basic linear algebra (BLAS) routines")
4226 "BLIS is a portable software framework for instantiating high-performance
4227 BLAS-like dense linear algebra libraries. The framework was designed to
4228 isolate essential kernels of computation that, when optimized, immediately
4229 enable optimized implementations of most of its commonly used and
4230 computationally intensive operations. While BLIS exports a new BLAS-like API,
4231 it also includes a BLAS compatibility layer which gives application developers
4232 access to BLIS implementations via traditional BLAS routine calls.")
4233 (license license:bsd-3)))
4235 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4236 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4237 (define-public blis-knl (deprecated-package "blis-knl" blis))
4239 (define ignorance blis)
4241 (define-public openlibm
4249 (url "https://github.com/JuliaLang/openlibm")
4250 (commit (string-append "v" version))))
4251 (file-name (git-file-name name version))
4253 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4254 (build-system gnu-build-system)
4257 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4258 ,(string-append "CC=" (cc-for-target)))
4260 ;; no configure script
4261 (modify-phases %standard-phases (delete 'configure))
4262 #:tests? #f)) ;the tests are part of the default target
4263 (home-page "https://openlibm.org/")
4264 (synopsis "Portable C mathematical library (libm)")
4266 "OpenLibm is an effort to have a high quality, portable, standalone C
4267 mathematical library (libm). It can be used standalone in applications and
4268 programming language implementations. The project was born out of a need to
4269 have a good libm for the Julia programming language that worked consistently
4270 across compilers and operating systems, and in 32-bit and 64-bit
4272 ;; Each architecture has its own make target, and there is none for mips.
4273 (supported-systems (delete "mips64el-linux" %supported-systems))
4274 ;; See LICENSE.md for details.
4275 (license (list license:expat
4278 license:public-domain
4279 license:lgpl2.1+))))
4281 (define-public openspecfun
4283 (name "openspecfun")
4289 (url "https://github.com/JuliaLang/openspecfun")
4290 (commit (string-append "v" version))))
4291 (file-name (git-file-name name version))
4293 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4294 (build-system gnu-build-system)
4296 '(#:tests? #f ; no "check" target
4298 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4300 (modify-phases %standard-phases
4301 (delete 'configure)))) ; no configure script
4303 `(("fortran" ,gfortran)))
4304 (home-page "https://github.com/JuliaLang/openspecfun")
4305 (synopsis "Collection of special mathematical functions")
4307 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4308 portable package for Bessel Functions of a Complex Argument and Nonnegative
4309 Order; it contains subroutines for computing Bessel functions and Airy
4310 functions. Faddeeva allows computing the various error functions of arbitrary
4311 complex arguments (Faddeeva function, error function, complementary error
4312 function, scaled complementary error function, imaginary error function, and
4313 Dawson function); given these, one can also easily compute Voigt functions,
4314 Fresnel integrals, and similar related functions as well.")
4315 ;; Faddeeva is released under the Expat license; AMOS is included as
4316 ;; public domain software.
4317 (license (list license:expat license:public-domain))))
4319 (define-public suitesparse
4321 (name "suitesparse")
4327 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4328 (commit (string-append "v" version))))
4329 (file-name (git-file-name name version))
4332 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4333 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4334 (modules '((guix build utils)))
4336 ;; Remove bundled metis source
4338 (delete-file-recursively "metis-5.1.0")
4340 (build-system gnu-build-system)
4342 `(#:tests? #f ;no "check" target
4344 (list (string-append "CC=" ,(cc-for-target))
4346 "MY_METIS_LIB=-lmetis"
4348 ;; The default is to link against netlib lapack. Use OpenBLAS
4350 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4352 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4353 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4354 (assoc-ref %outputs "out")
4355 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4356 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4357 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4358 " -DCMAKE_SKIP_RPATH=TRUE"
4359 " -DCMAKE_BUILD_TYPE=Release"
4360 " -DCMAKE_INSTALL_LIBDIR=lib")
4361 (string-append "INSTALL_LIB="
4362 (assoc-ref %outputs "out") "/lib")
4363 (string-append "INSTALL_INCLUDE="
4364 (assoc-ref %outputs "out") "/include")
4367 (modify-phases %standard-phases
4368 (delete 'configure)))) ;no configure script
4371 ("openblas" ,openblas)
4376 `(("cmake" ,cmake-minimal)
4378 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4379 (synopsis "Suite of sparse matrix software")
4381 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4382 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4383 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4384 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4385 CXSparse, a concise sparse Cholesky factorization package; and many other
4388 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4390 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4391 (license (list license:gpl2+ license:lgpl2.1+))))
4393 (define-public atlas
4399 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4400 version "/atlas" version ".tar.bz2"))
4401 (patches (search-patches "atlas-gfortran-compat.patch"))
4404 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4405 (build-system gnu-build-system)
4406 (home-page "http://math-atlas.sourceforge.net/")
4407 (inputs `(("gfortran" ,gfortran)
4408 ("lapack-tar" ,(package-source lapack))))
4409 (outputs '("out" "doc"))
4410 ;; For the moment we drop support for MIPS at it fails to compile. See
4411 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4412 (supported-systems (delete "mips64el-linux" %supported-systems))
4414 `(#:parallel-build? #f
4415 #:parallel-tests? #f
4417 ;; ATLAS tunes itself for the machine it is built on, as explained at
4418 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4419 ;; For this reason, we want users to build it locally instead of using
4423 #:modules ((srfi srfi-26)
4424 (guix build gnu-build-system)
4427 `(;; Generate position independent code suitable for dynamic libraries
4428 ;; and use WALL timer to get more accurate timing.
4429 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4432 ,,(if (string-match "64" (%current-system))
4435 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4436 ;; needed to compile C files before it is generated.
4437 "-Ss" "pmake" "make -j 1"
4438 ;; Probe is failing for MIPS. We therefore define the system
4439 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4440 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4441 ,,@(if (string-prefix? "mips" (%current-system))
4442 (list "-A" "49" "-V" "1")
4444 ;; Generate shared libraries.
4446 ;; Build a full LAPACK library.
4447 ,(string-append "--with-netlib-lapack-tarfile="
4448 (assoc-ref %build-inputs "lapack-tar")))
4450 (modify-phases %standard-phases
4451 (add-after 'install 'install-doc
4452 (lambda* (#:key outputs inputs #:allow-other-keys)
4453 (let ((doc (string-append (assoc-ref outputs "doc")
4454 "/share/doc/atlas")))
4456 (for-each (cut install-file <> doc)
4457 (find-files "../ATLAS/doc" ".*"))
4459 (add-after 'check 'check-pt
4460 (lambda _ (invoke "make" "ptcheck")))
4461 ;; Fix files required to run configure.
4462 (add-before 'configure 'fix-/bin/sh
4464 ;; Use `sh', not `/bin/sh'.
4465 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4469 ;; Fix /bin/sh in generated make files.
4470 (add-after 'configure 'fix-/bin/sh-in-generated-files
4472 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4476 ;; ATLAS configure program does not accepts the default flags
4477 ;; passed by the 'gnu-build-system'.
4479 (lambda* (#:key native-inputs inputs outputs
4480 (configure-flags '())
4481 #:allow-other-keys #:rest args)
4482 (let* ((prefix (assoc-ref outputs "out"))
4483 (bash (or (and=> (assoc-ref
4484 (or native-inputs inputs) "bash")
4485 (cut string-append <> "/bin/bash"))
4487 (flags `(,(string-append "--prefix=" prefix)
4489 (abs-srcdir (getcwd))
4490 (srcdir (string-append "../" (basename abs-srcdir))))
4491 (format #t "source directory: ~s (relative from build: ~s)~%"
4495 (format #t "build directory: ~s~%" (getcwd))
4496 (format #t "configure flags: ~s~%" flags)
4498 (string-append srcdir "/configure")
4500 (synopsis "Automatically Tuned Linear Algebra Software")
4502 "ATLAS is an automatically tuned linear algebra software library
4503 providing C and Fortran77 interfaces to a portably efficient BLAS
4504 implementation, as well as a few routines from LAPACK.
4506 Optimization occurs at build time. For this reason, the library is built on
4507 the machine where it is installed, without resorting to pre-built substitutes.
4509 Before building the library, CPU throttling should be disabled. This can be
4510 done in the BIOS, or, on GNU/Linux, with the following command:
4513 # cpupower --governor performance
4516 Failure to do so will result in a library with poor performance.")
4517 ;; The test suite is notoriously lengthy and routinely exceeds the default
4518 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4519 (properties '((timeout . 86400))) ; 1 day
4520 (license license:bsd-3)))
4530 (url "https://github.com/recp/cglm")
4531 (commit (string-append "v" version))))
4532 (file-name (git-file-name name version))
4534 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4535 (build-system cmake-build-system)
4538 (list "-DCGLM_USE_TEST=ON")))
4539 (home-page "https://github.com/recp/cglm")
4540 (synopsis "Mathematics C library for graphics programming")
4542 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4543 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4546 It's similar to the original C++ GLM library but written in C99 and compatible
4548 (license license:expat)))
4557 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4558 version "/glm-" version ".zip"))
4560 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4561 (build-system cmake-build-system)
4563 `(#:phases (modify-phases %standard-phases
4565 (lambda* (#:key outputs #:allow-other-keys)
4566 ;; Since version 0.9.9.6, 'make install' is not supported
4567 ;; and we have to do it "manually". Upstream discussion:
4568 ;; <https://github.com/g-truc/glm/pull/968>.
4569 (let* ((source (string-append "../glm"))
4570 (out (assoc-ref outputs "out"))
4571 (inc (string-append out "/include"))
4572 (lib (string-append out "/lib"))
4573 (pkgconfig (string-append lib "/pkgconfig")))
4574 (with-directory-excursion source
4577 (copy-recursively "glm" (string-append inc "/glm"))
4578 (copy-recursively "cmake" (string-append lib "/cmake"))
4579 (call-with-output-file (string-append pkgconfig "/glm.pc")
4583 includedir=${prefix}/include
4586 Description: OpenGL Mathematics
4588 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4591 `(("unzip" ,unzip)))
4592 (home-page "https://glm.g-truc.net/")
4593 (synopsis "OpenGL Mathematics library")
4594 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4595 library for graphics software based on the OpenGL Shading Language (GLSL)
4597 (license license:expat)))
4599 (define-public lpsolve
4606 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4607 "/lp_solve_" version "_source.tar.gz"))
4610 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4611 (modules '((guix build utils)))
4614 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4616 ;; Pretend to be on a 64 bit platform to obtain a common directory
4617 ;; name for the build results on all architectures; nothing else
4618 ;; seems to depend on it.
4619 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4621 ;; The check for 'isnan' as it is written fails with
4622 ;; "non-floating-point argument in call to function
4623 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4624 ;; definition, which in turn leads to bad things. Fix the feature
4626 (("isnan\\(0\\)") "isnan(0.)"))
4628 (build-system gnu-build-system)
4630 `(#:tests? #f ; no check target
4632 (modify-phases %standard-phases
4633 (delete 'configure) ; no configure script
4636 (with-directory-excursion "lpsolve55"
4637 (invoke "bash" "ccc"))
4638 (with-directory-excursion "lp_solve"
4639 (invoke "bash" "ccc"))
4642 (lambda* (#:key outputs #:allow-other-keys)
4643 (let* ((out (assoc-ref outputs "out"))
4644 (bin (string-append out "/bin"))
4645 (lib (string-append out "/lib"))
4646 ;; This is where LibreOffice expects to find the header
4647 ;; files, and where they are installed by Debian.
4648 (include (string-append out "/include/lpsolve")))
4649 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4650 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4651 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4653 ;; Install a subset of the header files as on Debian
4654 ;; (plus lp_bit.h, which matches the regular expression).
4655 (for-each (lambda (name)
4656 (install-file name include))
4657 (find-files "." "lp_[HMSa-z].*\\.h$"))
4658 (with-directory-excursion "shared"
4659 (for-each (lambda (name)
4660 (install-file name include))
4661 (find-files "." "\\.h$")))
4663 (home-page "http://lpsolve.sourceforge.net/")
4664 (synopsis "Mixed integer linear programming (MILP) solver")
4666 "lp_solve is a mixed integer linear programming solver based on the
4667 revised simplex and the branch-and-bound methods.")
4668 (license license:lgpl2.1+)))
4670 ;; Private Trilinos package for dealii-openmpi (similar to
4671 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
4672 ;; This version is the latest known to be compatible with deal.II [1].
4673 ;; Since the latest version of Trilinos is not necessarily supported by
4674 ;; deal.II, it may be worth keeping this package even if and when Trilinos
4675 ;; gets packaged separately for Guix (unless various versions of Trilinos are
4678 ;; An insightful source of information for building Trilinos for deal.II lies
4679 ;; in the Trilinos package for candi [2], which is a source-based installer
4680 ;; for deal.II and its dependencies.
4682 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
4683 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
4684 (define trilinos-for-dealii-openmpi
4686 (name "trilinos-for-dealii-openmpi")
4692 (url "https://github.com/trilinos/Trilinos/")
4694 (string-append "trilinos-release-"
4695 (string-replace-substring version "." "-")))))
4696 (file-name (git-file-name "trilinos" version))
4698 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
4699 (build-system cmake-build-system)
4701 `(("gfortran" ,gfortran)
4702 ;; Trilinos's repository contains several C-shell scripts, but adding
4703 ;; tcsh to the native inputs does not result in the check phase running
4704 ;; any more tests than without it (nor is tcsh required to build
4706 ;; It seems that Trilinos has replaced its use of C-shell test scripts
4707 ;; with CMake's testing facilities.
4709 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
4710 ;; states that Zoltan's C-shell test script
4711 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
4712 ;; performed through CMake.
4714 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
4716 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
4718 ("python" ,python-2)))
4720 `(("blas" ,openblas)
4722 ("mumps" ,mumps-openmpi)
4723 ("scalapack" ,scalapack)))
4725 `(("mpi" ,openmpi)))
4727 `(#:build-type "Release"
4729 `("-DBUILD_SHARED_LIBS=ON"
4730 ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release
4731 ;; default) rather than -O2 (the RelWithDebInfo default), to conform
4732 ;; to candi's trilinos.package's compilation flags, which are -g -O3.
4733 "-DCMAKE_C_FLAGS=-g"
4734 "-DCMAKE_CXX_FLAGS=-g"
4735 "-DCMAKE_Fortran_FLAGS=-g"
4737 ;; Trilinos libraries that deal.II can interface with.
4738 "-DTrilinos_ENABLE_Amesos=ON"
4739 "-DTrilinos_ENABLE_AztecOO=ON"
4740 "-DTrilinos_ENABLE_Epetra=ON"
4741 "-DTrilinos_ENABLE_EpetraExt=ON"
4742 "-DTrilinos_ENABLE_Ifpack=ON"
4743 "-DTrilinos_ENABLE_ML=ON"
4744 "-DTrilinos_ENABLE_MueLu=ON"
4745 "-DTrilinos_ENABLE_ROL=ON"
4746 ;; Optional; required for deal.II's GridIn::read_exodusii, but
4747 ;; depends on netcdf.
4748 ;; Enable if and when someone needs it.
4749 ;;"-DTrilinos_ENABLE_SEACAS=ON"
4750 "-DTrilinos_ENABLE_Sacado=ON"
4751 "-DTrilinos_ENABLE_Teuchos=ON"
4752 "-DTrilinos_ENABLE_Tpetra=ON"
4753 "-DTrilinos_ENABLE_Zoltan=ON"
4755 ;; Third-party libraries (TPLs) that Trilinos can interface with.
4756 "-DBLAS_LIBRARY_NAMES=openblas"
4757 "-DTPL_ENABLE_MPI=ON"
4758 "-DTPL_ENABLE_MUMPS=ON"
4759 "-DTPL_ENABLE_SCALAPACK=ON"
4761 ;; Enable the tests but not the examples (which are enabled by
4762 ;; default when enabling tests).
4763 ;; Although some examples are run as tests, they are otherwise
4764 ;; unnecessary since this is a private package meant for
4766 ;; Besides, some MueLu and ROL examples require a lot of memory to
4769 ;; (For future reference, note that some ROL and SEACAS examples
4770 ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the
4771 ;; dune-istl, dune-localfunctions and dune-alugrid packages.)
4772 "-DTrilinos_ENABLE_TESTS=ON"
4773 "-DTrilinos_ENABLE_EXAMPLES=OFF"
4774 ;; MueLu tests require considerably more time and memory to compile
4775 ;; than the rest of the tests.
4776 "-DMueLu_ENABLE_TESTS=OFF"
4778 ;; The following options were gleaned from candi's trilinos.package.
4779 ;; (We do not enable the complex instantiations, which are anyway
4780 ;; provided only as an option in trilinos.package, because they are
4781 ;; costly in compilation time and memory usage, and disk space [1].)
4783 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
4784 "-DTrilinos_ENABLE_Ifpack2=OFF"
4785 "-DTeuchos_ENABLE_FLOAT=ON"
4786 "-DTpetra_INST_INT_LONG=ON"
4787 "-DTPL_ENABLE_Boost=OFF")
4789 (modify-phases %standard-phases
4790 (add-after 'configure 'fix-kokkos-config
4792 ;; GNU Make 4.3 accidentally leaves the backslash preceding the
4793 ;; number sign in strings containing a literal backslash–number
4794 ;; sign (\#) [1, 2].
4795 ;; This is still an issue in Trilinos 13.0.1, but should be fixed
4796 ;; in the following version.
4797 ;; (The latest versions of Kokkos incorporate the fix [2].)
4799 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
4800 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
4801 (substitute* "KokkosCore_config.h"
4804 (add-before 'check 'mpi-setup
4806 (home-page "https://trilinos.github.io/")
4807 (synopsis "Algorithms for engineering and scientific problems")
4809 "The Trilinos Project is an effort to develop algorithms and enabling
4810 technologies within an object-oriented software framework for the solution of
4811 large-scale, complex multi-physics engineering and scientific problems.
4812 A unique design feature of Trilinos is its focus on packages.")
4813 ;; The packages are variously licensed under more than just BSD-3 and
4814 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
4815 ;; See https://trilinos.github.io/license.html.
4816 (license (list license:bsd-3 license:lgpl2.1+))))
4818 (define-public dealii
4825 (uri (string-append "https://github.com/dealii/dealii/releases/"
4826 "download/v" version "/dealii-" version ".tar.gz"))
4828 (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
4829 (modules '((guix build utils)))
4832 ;; Remove bundled boost, muparser, TBB and UMFPACK.
4833 (delete-file-recursively "bundled")
4835 (build-system cmake-build-system)
4836 (outputs '("out" "doc"))
4838 ;; Required to build the documentation.
4840 ("doxygen" ,doxygen)
4843 `(("arpack" ,arpack-ng)
4845 ("gfortran" ,gfortran)
4847 ("muparser" ,muparser)
4850 ;; Some scripts are installed into share/deal.II/scripts that require
4851 ;; perl and python, but they are not executable (and some are missing the
4852 ;; shebang line) and therefore must be explicitly passed to the
4854 ;; Anyway, they are meant to be used at build time, so rather than adding
4855 ;; the interpreters here, any package depending on them should just add
4856 ;; the requisite interpreter to its native inputs.
4859 ("suitesparse" ,suitesparse) ; For UMFPACK.
4862 `(#:build-type "DebugRelease" ; Supports only Debug, Release and DebugRelease.
4863 ;; The tests take too long and must be explicitly enabled with "make
4865 ;; See https://www.dealii.org/developer/developers/testsuite.html.
4866 ;; (They can also be run for an already installed deal.II.)
4869 (let ((doc (string-append (assoc-ref %outputs "doc")
4870 "/share/doc/" ,name "-" ,version)))
4871 `("-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
4872 ,(string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
4873 ,(string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
4874 ;; Don't compile the examples because the source and CMakeLists.txt
4875 ;; are installed anyway, allowing users to do so for themselves.
4876 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
4877 ,(string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc "/examples")))
4879 (modify-phases %standard-phases
4880 (add-after 'install 'remove-build-logs
4881 ;; These build logs leak the name of the build directory by storing
4882 ;; the values of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.
4883 (lambda* (#:key outputs #:allow-other-keys)
4884 (let ((doc (string-append (assoc-ref outputs "doc")
4885 "/share/doc/" ,name "-" ,version)))
4886 (for-each delete-file (map (lambda (f) (string-append doc "/" f))
4887 '("detailed.log" "summary.log"))))
4889 (home-page "https://www.dealii.org/")
4890 (synopsis "Finite element library")
4892 "Deal.II is a C++ program library targeted at the computational solution
4893 of partial differential equations using adaptive finite elements. The main
4894 aim of deal.II is to enable rapid development of modern finite element codes,
4895 using among other aspects adaptive meshes and a wide array of tools often used
4896 in finite element programs.")
4897 (license license:lgpl2.1+)))
4899 (define-public dealii-openmpi
4900 (package/inherit dealii
4901 (name "dealii-openmpi")
4903 `(("arpack" ,arpack-ng-openmpi)
4905 ("scalapack" ,scalapack)
4906 ,@(alist-delete "arpack" (package-inputs dealii))))
4908 `(("hdf5" ,hdf5-parallel-openmpi)
4910 ("p4est" ,p4est-openmpi)
4911 ("petsc" ,petsc-openmpi)
4912 ("slepc" ,slepc-openmpi)
4913 ("trilinos" ,trilinos-for-dealii-openmpi)
4914 ,@(alist-delete "hdf5" (package-propagated-inputs dealii))))
4916 (substitute-keyword-arguments (package-arguments dealii)
4917 ((#:configure-flags flags)
4918 `(cons "-DDEAL_II_WITH_MPI=ON" ,flags))))
4919 (synopsis "Finite element library (with MPI support)")))
4921 (define-public flann
4925 (home-page "https://github.com/mariusmuja/flann/")
4929 (uri (git-reference (url home-page) (commit version)))
4930 (file-name (git-file-name name version))
4933 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4934 (patches (search-patches "flann-cmake-3.11.patch"))))
4935 (build-system cmake-build-system)
4938 `(("unzip" ,unzip)))
4941 ;; FIXME: 'mkoctfile' fails with a linker error:
4942 ;; ld: cannot find -loctinterp
4943 ;; ld: cannot find -loctave
4944 ;; Disable it for now.
4945 ;;("octave" ,octave-cli)
4946 ("python" ,python-2) ; print syntax
4947 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4950 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4951 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4952 #:strip-directories '("lib" "lib64" "libexec"
4953 "bin" "sbin" "share/flann/octave")
4955 ;; Save 12 MiB by not installing .a files. Passing
4956 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4957 #:phases (modify-phases %standard-phases
4958 (add-after 'install 'remove-static-libraries
4959 (lambda* (#:key outputs #:allow-other-keys)
4960 (let* ((out (assoc-ref outputs "out"))
4961 (lib (string-append out "/lib")))
4962 (for-each delete-file
4963 (find-files lib "\\.a$"))
4966 #:tests? #f)) ; The test data are downloaded from the Internet.
4967 (synopsis "Library for approximate nearest neighbors computation")
4968 (description "FLANN is a library for performing fast approximate
4969 nearest neighbor searches in high dimensional spaces. It implements a
4970 collection of algorithms and a system for automatically choosing the best
4971 algorithm and optimum parameters depending on the dataset.
4973 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4974 (license (license:non-copyleft "file://COPYING"
4975 "See COPYING in the distribution."))))
4977 (define-public wcalc
4984 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4985 "wcalc-" version ".tar.bz2"))
4988 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4989 (build-system gnu-build-system)
4992 ("readline" ,readline)))
4993 (home-page "http://w-calc.sourceforge.net/index.php")
4994 (synopsis "Flexible command-line scientific calculator")
4995 (description "Wcalc is a very capable calculator. It has standard functions
4996 (sin, asin, and sinh for example, in either radians or degrees), many
4997 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4998 variables, a command history, hex/octal/binary input and output, unit
4999 conversions, embedded comments, and an expandable expression entry field. It
5000 evaluates expressions using the standard order of operations.")
5001 (license license:gpl2+)))
5010 (url "https://github.com/xaos-project/XaoS")
5011 (commit (string-append "release-" version))))
5012 (file-name (git-file-name name version))
5015 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5016 (build-system gnu-build-system)
5017 (native-inputs `(("gettext" ,gettext-minimal)
5018 ("qtbase" ,qtbase-5)
5019 ("qttools" ,qttools)))
5020 (inputs `(("libx11" ,libx11)
5024 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5025 ;; not enough for this package to install properly. These phases fix that.
5027 `(#:tests? #f ;no "check" target
5029 (modify-phases %standard-phases
5030 (add-before 'configure 'make-qt-deterministic
5032 ;; Make Qt deterministic.
5033 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5036 (lambda* (#:key outputs #:allow-other-keys)
5037 (let ((out (assoc-ref outputs "out")))
5038 (substitute* "XaoS.pro"
5039 ;; The DESTDIR is originally set to install the xaos binary to
5040 ;; the "bin" folder inside the build directory. Setting make
5041 ;; flags doesn't seem to change this.
5043 (string-append "DESTDIR=" out "/bin"))
5044 ;; Set the correct path to the lrelease binary.
5045 (("lrelease-qt5") "lrelease"))
5046 (substitute* "src/include/config.h"
5047 (("/usr/share/XaoS")
5048 (string-append out "/share/XaoS")))
5050 (add-after 'install 'install-data
5051 (lambda* (#:key outputs #:allow-other-keys)
5052 (let* ((out (assoc-ref outputs "out"))
5053 (share (string-append out "/share")))
5057 (copy-recursively folder
5058 (string-append share "/XaoS/" folder)))
5059 '("catalogs" "examples" "tutorial"))
5060 (install-file "xdg/xaos.png"
5061 (string-append share "/pixmaps"))
5062 (install-file "xdg/xaos.desktop"
5063 (string-append share "/applications")))
5065 (synopsis "Real-time fractal zoomer")
5066 (description "GNU XaoS is a graphical program that generates fractal
5067 patterns and allows you to zoom in and out of them infinitely in a fluid,
5068 continuous manner. It also includes tutorials that help to explain how fractals
5069 are built. It can generate many different fractal types such as the Mandelbrot
5071 (home-page "https://xaos-project.github.io/")
5072 (license license:gpl2+)))
5074 (define-public hypre
5082 (url "https://github.com/hypre-space/hypre")
5083 (commit (string-append "v" version))))
5084 (file-name (git-file-name name version))
5086 (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
5087 (build-system gnu-build-system)
5088 (outputs '("out" ;5.3 MiB of headers and libraries
5089 "doc")) ;12 MiB of documentation
5092 ("doxygen" ,doxygen)
5094 ("python-breathe" ,python-breathe)
5095 ("python-sphinx" ,python-sphinx)
5096 ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
5108 texlive-generic-listofitems
5109 texlive-generic-ulem
5110 texlive-latex-capt-of
5112 texlive-latex-colortbl
5114 texlive-latex-fancyhdr
5115 texlive-latex-fancyvrb
5117 texlive-latex-fncychap
5118 texlive-latex-framed
5119 texlive-latex-geometry
5120 texlive-latex-hanging
5122 texlive-latex-multirow
5123 texlive-latex-natbib
5124 texlive-latex-needspace
5125 texlive-latex-newunicodechar
5126 texlive-latex-parskip
5127 texlive-latex-stackengine
5128 texlive-latex-tabulary
5129 texlive-latex-titlesec
5130 texlive-latex-tocloft
5131 texlive-latex-upquote
5132 texlive-latex-varwidth
5134 texlive-latex-wrapfig)))))
5136 `(("blas" ,openblas)
5137 ("lapack" ,lapack)))
5139 `(#:modules ((srfi srfi-1)
5140 ,@%gnu-build-system-modules)
5141 #:configure-flags '("--enable-shared"
5149 (modify-phases %standard-phases
5150 (add-before 'configure 'chdir-src
5151 (lambda _ (chdir "src")))
5153 (lambda* (#:key build target configure-flags
5154 #:allow-other-keys #:rest args)
5155 (let* ((configure (assoc-ref %standard-phases 'configure)))
5158 (list #:configure-flags
5159 (cons (string-append
5160 "--host=" (or target build))
5161 configure-flags)))))))
5162 (add-after 'build 'build-docs
5164 (invoke "make" "-C" "docs")))
5167 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5168 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5169 (invoke "make" "check" "CHECKRUN=")
5170 (for-each (lambda (filename)
5171 (let ((size (stat:size (stat filename))))
5172 (when (positive? size)
5173 (error (format #f "~a size ~d; error indication~%"
5175 (find-files "test" ".*\\.err$"))))
5176 (add-after 'install 'install-docs
5177 (lambda* (#:key outputs #:allow-other-keys)
5178 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5179 (let* ((doc (assoc-ref outputs "doc"))
5180 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5181 (with-directory-excursion "docs"
5182 (for-each (lambda (base)
5183 (install-file (string-append base ".pdf") docdir)
5184 (copy-recursively (string-append base "-html")
5185 (string-append docdir "/" base)))
5186 '("usr-manual" "ref-manual")))))))))
5187 (home-page "https://computing.llnl.gov/projects\
5188 /hypre-scalable-linear-solvers-multigrid-methods")
5189 (synopsis "Library of solvers and preconditioners for linear equations")
5191 "HYPRE is a software library of high performance preconditioners and
5192 solvers for the solution of large, sparse linear systems of equations. It
5193 features multigrid solvers for both structured and unstructured grid
5195 (license license:lgpl2.1)))
5197 (define-public hypre-openmpi
5198 (package (inherit hypre)
5199 (name "hypre-openmpi")
5202 ,@(package-inputs hypre)))
5204 (substitute-keyword-arguments (package-arguments hypre)
5205 ((#:configure-flags flags)
5207 ,@(delete "--without-MPI" ,flags)))
5209 `(modify-phases ,phases
5210 (add-before 'check 'mpi-setup
5211 ,%openmpi-setup)))))
5212 (synopsis "Parallel solvers and preconditioners for linear equations")
5214 "HYPRE is a software library of high performance preconditioners and
5215 solvers for the solution of large, sparse linear systems of equations on
5216 parallel computers. It features parallel multigrid solvers for both
5217 structured and unstructured grid problems.")))
5219 (define-public matio
5226 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5227 "matio-" version ".tar.gz"))
5230 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5231 (build-system gnu-build-system)
5234 ("hdf5" ,hdf5-1.8)))
5235 (home-page "http://matio.sourceforge.net/")
5236 (synopsis "Library for reading and writing MAT files")
5237 (description "Matio is a library for reading and writing MAT files. It
5238 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5239 (license license:bsd-2)))
5246 (origin (method url-fetch)
5247 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5248 "download/" version "/Vc-" version ".tar.gz"))
5251 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5252 (build-system cmake-build-system)
5255 '("-DBUILD_TESTING=ON"
5256 ;; By default, Vc will optimize for the CPU of the build machine.
5257 ;; Setting this to "none" makes it create portable binaries. See
5258 ;; "cmake/OptimizeForArchitecture.cmake".
5259 "-DTARGET_ARCHITECTURE=none")
5260 #:phases (modify-phases %standard-phases
5261 (add-after 'unpack 'copy-testdata
5262 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5263 (let ((testdata (assoc-ref (or native-inputs inputs)
5265 (copy-recursively testdata "tests/testdata")
5268 `(("virtest" ,virtest)
5270 ;; This is a submodule in the git project, but not part of the
5271 ;; released sources. See the git branch for the commit to take.
5272 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5276 (url "https://github.com/VcDevel/vc-testdata")
5277 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5278 (file-name (git-file-name "vc-testdata"
5279 (string-take commit 7)))
5282 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5283 (synopsis "SIMD vector classes for C++")
5284 (description "Vc provides portable, zero-overhead C++ types for explicitly
5285 data-parallel programming. It is a library designed to ease explicit
5286 vectorization of C++ code. Its types enable explicitly stating data-parallel
5287 operations on multiple values. The parallelism is therefore added via the type
5288 system. Vc has an intuitive API and provides portability between different
5289 compilers and compiler versions as well as portability between different vector
5290 instruction sets. Thus, an application written with Vc can be compiled for:
5293 @item SSE2 up to SSE4.2 or SSE4a
5296 @item NEON (in development)
5297 @item NVIDIA GPUs / CUDA (in development)
5299 (home-page "https://github.com/VcDevel/Vc")
5300 ;; "No support_???.cpp file exists for this architecture."
5301 (supported-systems '("x86_64-linux" "i686-linux"))
5302 (license license:bsd-3)))
5304 (define-public reducelcs
5305 ;; This is the last commit which is available upstream, no
5306 ;; release happened since 2010.
5307 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5311 (version (string-append "1.0-" revision "." (string-take commit 7)))
5316 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5318 (file-name (string-append name "-" version "-checkout"))
5321 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5322 (build-system gnu-build-system)
5324 `(("openlibm" ,openlibm)))
5326 `(#:tests? #f ; no tests
5328 (modify-phases %standard-phases
5329 (delete 'configure) ; No configure script exists.
5330 (replace 'install ; No install phase exists.
5331 (lambda* (#:key outputs #:allow-other-keys)
5332 (let* ((out (assoc-ref outputs "out"))
5333 (bin (string-append out "/bin")))
5334 (install-file "Approximation" bin)
5335 (install-file "CollectResults" bin)
5336 (install-file "GenerateInstances" bin)
5338 (synopsis "Approximate Longest Commons Subsequence computation tool")
5340 "@code{reduceLCS} is an implementation of the Reduce-Expand
5341 algorithm for LCS. It is a fast program to compute the approximate
5342 Longest Commons Subsequence of a set of strings.")
5343 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5344 (license license:gpl3+))))
5346 (define-public jacal
5353 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5356 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
5357 (patches (search-patches "jacal-fix-texinfo.patch"))))
5358 (build-system gnu-build-system)
5361 (modify-phases %standard-phases
5362 (add-before 'build 'pre-build
5363 ;; Don't use upstream's script - it really doesn't fit into
5364 ;; Guix's functional paradigm.
5365 (lambda* (#:key inputs outputs #:allow-other-keys)
5366 (substitute* "Makefile"
5367 (("^install: install-script") "install: "))))
5368 (add-after 'install 'post-install
5369 ;; Instead, we provide our own simplified script.
5370 (lambda* (#:key inputs outputs #:allow-other-keys)
5371 (let ((wrapper (string-append (assoc-ref outputs "out")
5373 (format (open wrapper (logior O_WRONLY O_CREAT))
5374 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5375 "-e '(slib:load \"~a/lib/jacal/math\") "
5378 (assoc-ref inputs "scm")
5379 (assoc-ref outputs "out"))
5380 (chmod wrapper #o555))))
5382 (lambda* (#:key outputs #:allow-other-keys)
5383 (invoke "./configure"
5384 (string-append "--prefix="
5385 (assoc-ref outputs "out"))))))))
5386 (inputs `(("scm" ,scm)))
5387 (native-inputs `(("unzip" ,unzip)
5388 ("texinfo" ,texinfo)))
5389 (synopsis "Symbolic mathematics system")
5390 (description "GNU JACAL is an interactive symbolic mathematics program based on
5391 Scheme. It manipulate and simplify a range of mathematical expressions such
5392 as equations, scalars, vectors, and matrices.")
5393 (home-page "https://www.gnu.org/software/jacal/")
5394 (license license:gpl3+)))
5400 (home-page "https://github.com/Z3Prover/z3")
5403 (uri (git-reference (url home-page)
5404 (commit (string-append "z3-" version))))
5405 (file-name (git-file-name name version))
5408 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5409 (build-system gnu-build-system)
5411 `(#:imported-modules ((guix build python-build-system)
5412 ,@%gnu-build-system-modules)
5413 #:modules (((guix build python-build-system) #:select (site-packages))
5414 (guix build gnu-build-system)
5417 (modify-phases %standard-phases
5418 (add-after 'unpack 'enable-bytecode-determinism
5420 (setenv "PYTHONHASHSEED" "0")
5422 (add-after 'unpack 'fix-compatability
5423 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5425 (substitute* "src/util/mpz.cpp"
5426 (("#include <immintrin.h>") ""))
5428 (add-before 'configure 'bootstrap
5430 (invoke "python" "scripts/mk_make.py")))
5431 ;; work around gnu-build-system's setting --enable-fast-install
5432 ;; (z3's `configure' is a wrapper around the above python file,
5433 ;; which fails when passed --enable-fast-install)
5435 (lambda* (#:key inputs outputs #:allow-other-keys)
5436 (invoke "./configure"
5438 (string-append "--prefix=" (assoc-ref outputs "out"))
5439 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5440 (add-after 'configure 'change-directory
5444 (add-before 'check 'make-test-z3
5446 ;; Build the test suite executable.
5447 (invoke "make" "test-z3" "-j"
5448 (number->string (parallel-job-count)))))
5451 ;; Run all the tests that don't require arguments.
5452 (invoke "./test-z3" "/a"))))))
5455 ("python" ,python-wrapper)))
5456 (synopsis "Theorem prover")
5457 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5458 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5459 (license license:expat)))
5464 (version "2018.11.001")
5467 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5468 version "/elpa-" version ".tar.gz"))
5471 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5472 (build-system gnu-build-system)
5474 `(("fortran" ,gfortran)
5475 ("perl" ,perl))) ;for configure and deps
5477 `(("blas" ,openblas)))
5482 ;; ELPA unfortunately does not support runtime dispatch, so we can
5483 ;; only enable the "generic" kernels. See the "Cross compilation"
5484 ;; section of INSTALL.md.
5486 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5487 "--disable-avx" "--disable-avx2" "--disable-avx512"
5488 ,(string-append "CFLAGS=-O3 "
5489 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5490 "-ftree-vect-loop-version -ftree-vectorize "
5491 ,(let ((system (or (%current-target-system)
5492 (%current-system))))
5494 ((or (string-prefix? "x86_64" system)
5495 (string-prefix? "i686" system))
5498 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5500 (modify-phases %standard-phases
5501 (add-before 'configure 'patch-header-generation
5503 (substitute* "configure"
5504 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5505 (string-append & " CPP=\"$CPP\"")))
5507 (add-before 'check 'setup-tests
5509 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5510 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5511 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5512 ;; for Fortran. This also causes several tests to pass that
5513 ;; otherwise would otherwise fail with matrix size 5000; possibly
5514 ;; due to floating point tolerances that are too tight.
5515 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5516 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5517 (substitute* "Makefile"
5518 ;; Test scripts are generated, patch the shebang
5519 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5521 (home-page "https://elpa.mpcdf.mpg.de")
5522 (synopsis "Eigenvalue solvers for symmetric matrices")
5524 "The ELPA library provides efficient and scalable direct eigensolvers for
5525 symmetric matrices.")
5526 (license license:lgpl3)))
5528 (define-public elpa-openmpi
5529 (package (inherit elpa)
5530 (name "elpa-openmpi")
5533 ("scalapack" ,scalapack)
5534 ,@(package-inputs elpa)))
5536 (substitute-keyword-arguments (package-arguments elpa)
5537 ((#:configure-flags cf '())
5538 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5539 ((#:phases phases '%standard-phases)
5540 `(modify-phases ,phases
5541 (add-before 'check 'mpi-setup
5543 ;; Tests use 2 mpi tasks by default, use our remaining build
5544 ;; cores as OpenMP threads.
5545 (setenv "OMP_NUM_THREADS" (number->string
5546 (max (quotient (parallel-job-count) 2)
5548 (,%openmpi-setup)))))))
5549 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5551 (define-public elemental
5558 (url "https://github.com/elemental/Elemental")
5559 (commit (string-append "v" version))))
5560 (file-name (git-file-name name version))
5563 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5564 (build-system cmake-build-system)
5565 (home-page "https://github.com/elemental/Elemental")
5567 `(("gfortran" ,gfortran)))
5569 `(("blas" ,openblas)
5570 ("gfortran:lib" ,gfortran "lib")
5579 `(#:build-type "Release" ;default RelWithDebInfo not supported
5580 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5581 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5582 "-DEL_CACHE_WARNINGS:BOOL=YES"
5583 "-DEL_TESTS:BOOL=YES"
5584 "-DCMAKE_INSTALL_LIBDIR=lib"
5585 "-DGFORTRAN_LIB=gfortran")
5586 #:phases (modify-phases %standard-phases
5587 (add-before 'check 'mpi-setup
5589 (add-before 'check 'setup-tests
5591 ;; Parallelism is done at the MPI layer.
5592 (setenv "OMP_NUM_THREADS" "1")
5594 (add-after 'install 'remove-tests
5595 (lambda* (#:key outputs #:allow-other-keys)
5596 ;; Tests are installed, with no easy configuration
5597 ;; switch to prevent this, so delete them.
5598 (delete-file-recursively
5599 (string-append (assoc-ref outputs "out") "/bin"))
5601 (synopsis "Dense and sparse-direct linear algebra and optimization")
5602 (description "Elemental is a modern C++ library for distributed-memory
5603 dense and sparse-direct linear algebra, conic optimization, and lattice
5605 (license license:bsd-2)))
5607 (define-public mcrl2
5610 (version "202106.0")
5614 "https://www.mcrl2.org/download/release/mcrl2-"
5618 "0db9wgy9spwm76mgfisnifrlg69y9cadjgxjr4gdwzfgg6wgqf6d"))))
5623 ("qtbase" ,qtbase-5)))
5624 (build-system cmake-build-system)
5625 (synopsis "Toolset for the mCRL2 formal specification language")
5627 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5628 specification language for describing concurrent discrete event systems. Its
5629 toolset supports analysis and automatic verification, linearisation, simulation,
5630 state-space exploration and generation, and tools to optimise and analyse
5631 specifications. Also, state spaces can be manipulated, visualised and
5633 (home-page "https://mcrl2.org")
5634 (license license:boost1.0)))
5636 (define-public mcrl2-minimal
5639 (name "mcrl2-minimal")
5641 `(("boost" ,boost)))
5643 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5645 (define-public tcalc
5652 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5656 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5657 (build-system gnu-build-system)
5658 (synopsis "The terminal calculator")
5660 "The terminal calculator is a small program to help users of the GNU/Linux
5661 terminal do calculations simply and quickly. The formula to be calculated can
5662 be fed to @command{tcalc} through the command line.")
5663 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5664 (license license:gpl3+)))
5666 (define-public tiny-bignum
5667 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5669 (name "tiny-bignum")
5670 (version (git-version "0" "0" commit))
5675 (url "https://github.com/kokke/tiny-bignum-c")
5677 (file-name (git-file-name "tiny-bignum" commit))
5679 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5680 (build-system gnu-build-system)
5683 (modify-phases %standard-phases
5685 (add-after 'unpack 'patch-tests
5687 (substitute* "scripts/test_rand.py"
5689 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5692 (lambda* (#:key tests? #:allow-other-keys)
5694 (invoke "make" "test"))
5697 (lambda* (#:key outputs #:allow-other-keys)
5698 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5699 (doc (string-append (assoc-ref outputs "out") "/doc")))
5701 (install-file "bn.c" share)
5702 (install-file "bn.h" share)
5704 (install-file "LICENSE" doc)
5705 (install-file "README.md" doc))
5708 `(("python" ,python-wrapper)))
5709 (home-page "https://github.com/kokke/tiny-bignum-c")
5710 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5712 "This library provides portable Arbitrary-precision unsigned integer
5713 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5714 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5715 and comparisons are supported.")
5716 (license license:unlicense))))
5718 (define-public sundials
5725 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5726 "sundials-" version ".tar.gz"))
5729 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5730 (build-system cmake-build-system)
5732 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5734 `(("fortran" ,gfortran) ;for fcmix
5736 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5738 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5739 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5740 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5741 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5742 "-DEXAMPLES_INSTALL:BOOL=OFF"
5744 "-DFCMIX_ENABLE:BOOL=ON"
5746 "-DKLU_ENABLE:BOOL=ON"
5747 ,(string-append "-DKLU_INCLUDE_DIR="
5748 (assoc-ref %build-inputs "suitesparse")
5750 ,(string-append "-DKLU_LIBRARY_DIR="
5751 (assoc-ref %build-inputs "suitesparse")
5753 (home-page "https://computation.llnl.gov/projects/sundials")
5754 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5755 (description "SUNDIALS is a family of software packages implemented with
5756 the goal of providing robust time integrators and nonlinear solvers that can
5757 easily be incorporated into existing simulation codes.")
5758 (license license:bsd-3)))
5760 (define-public sundials-openmpi
5761 (package (inherit sundials)
5762 (name "sundials-openmpi")
5765 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5766 ,@(package-inputs sundials)))
5768 (substitute-keyword-arguments (package-arguments sundials)
5769 ((#:configure-flags flags '())
5770 `(cons* "-DMPI_ENABLE:BOOL=ON"
5771 "-DPETSC_ENABLE:BOOL=ON"
5772 (string-append "-DPETSC_INCLUDE_DIR="
5773 (assoc-ref %build-inputs "petsc")
5775 (string-append "-DPETSC_LIBRARY_DIR="
5776 (assoc-ref %build-inputs "petsc")
5779 ((#:phases phases '%standard-phases)
5780 `(modify-phases ,phases
5781 (add-before 'check 'mpi-setup
5782 ,%openmpi-setup)))))
5783 (synopsis "SUNDIALS with OpenMPI support")))
5785 (define-public combinatorial-blas
5787 (name "combinatorial-blas")
5792 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5794 (match (string-split version #\.)
5795 ((major minor patch)
5796 (string-append major minor "_" patch))) ;e.g. "16_2"
5800 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5801 (patches (search-patches "combinatorial-blas-awpm.patch"
5802 "combinatorial-blas-io-fix.patch"))))
5803 (build-system cmake-build-system)
5806 ("test-data" ,(origin
5808 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5809 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5812 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5814 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5815 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5816 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5818 (modify-phases %standard-phases
5819 (add-before 'check 'mpi-setup
5821 (add-before 'check 'test-setup
5822 (lambda* (#:key inputs #:allow-other-keys)
5823 (setenv "OMP_NUM_THREADS" "2")
5824 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5825 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5826 (synopsis "Linear algebra primitives for graph analytics")
5827 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5828 distributed-memory parallel graph library offering a small but powerful set of
5829 linear algebra primitives specifically targeting graph analytics.")
5831 license:gpl2+ ;include/psort/(funnel|sort)*.h
5832 license:x11 ;usort and psort
5833 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5835 (define-public dune-common
5837 (name "dune-common")
5842 (uri (string-append "https://dune-project.org/download/"
5843 version "/dune-common-" version ".tar.gz"))
5846 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5847 (build-system cmake-build-system)
5850 (modify-phases %standard-phases
5851 (add-after 'build 'build-tests
5852 (lambda* (#:key make-flags #:allow-other-keys)
5853 (apply invoke "make" "build_tests" make-flags))))))
5857 ("openblas" ,openblas)
5859 ("superlu" ,superlu)))
5861 `(("gfortran" ,gfortran)
5862 ("pkg-config" ,pkg-config)))
5863 (home-page "https://dune-project.org/")
5864 (synopsis "Distributed and Unified Numerics Environment")
5865 (description "DUNE, the Distributed and Unified Numerics Environment is a
5866 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5867 grid-based methods. It supports the easy implementation of methods like
5868 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5869 Differences} (FD).")
5870 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5871 (license license:gpl2)))
5873 (define-public dune-geometry
5875 (name "dune-geometry")
5880 (uri (string-append "https://dune-project.org/download/"
5881 version "/dune-geometry-" version ".tar.gz"))
5884 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5885 (build-system cmake-build-system)
5888 (modify-phases %standard-phases
5889 (add-after 'build 'build-tests
5890 (lambda* (#:key make-flags #:allow-other-keys)
5891 (apply invoke "make" "build_tests" make-flags))))))
5893 `(("dune-common" ,dune-common)
5895 ("openblas" ,openblas)
5897 ("python" ,python)))
5899 `(("gfortran" ,gfortran)
5900 ("pkg-config" ,pkg-config)))
5901 (home-page "https://dune-project.org/")
5902 (synopsis "Distributed and Unified Numerics Environment")
5903 (description "DUNE, the Distributed and Unified Numerics Environment is a
5904 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5905 grid-based methods. It supports the easy implementation of methods like
5906 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5909 This package contains the basic DUNE geometry classes.")
5910 ;; GPL version 2 with "runtime exception"
5911 (license license:gpl2)))
5913 (define-public dune-uggrid
5915 (name "dune-uggrid")
5921 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5922 (commit (string-append "v" version))))
5923 (file-name (git-file-name name version))
5926 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5927 (build-system cmake-build-system)
5930 (modify-phases %standard-phases
5931 (add-after 'build 'build-tests
5932 (lambda* (#:key make-flags #:allow-other-keys)
5933 (apply invoke "make" "build_tests" make-flags))))))
5935 `(("dune-common" ,dune-common)))
5937 `(("gfortran" ,gfortran)
5938 ("pkg-config" ,pkg-config)))
5939 (home-page "https://dune-project.org/")
5940 (synopsis "Distributed and Unified Numerics Environment")
5941 (description "DUNE, the Distributed and Unified Numerics Environment is a
5942 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5943 grid-based methods. It supports the easy implementation of methods like
5944 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5947 This package contains the DUNE UG grid classes.")
5948 (license license:lgpl2.1)))
5950 (define-public dune-grid
5957 (uri (string-append "https://dune-project.org/download/"
5958 version "/dune-grid-" version ".tar.gz"))
5961 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5962 (build-system cmake-build-system)
5965 (modify-phases %standard-phases
5966 (add-after 'build 'build-tests
5967 (lambda* (#:key make-flags #:allow-other-keys)
5968 (apply invoke "make" "build_tests" make-flags))))))
5970 `(("dune-common" ,dune-common)
5971 ("dune-geometry" ,dune-geometry)
5974 ("openblas" ,openblas)
5975 ("python" ,python)))
5977 `(("dune-uggrid" ,dune-uggrid)))
5979 `(("gfortran" ,gfortran)
5980 ("pkg-config" ,pkg-config)))
5981 (home-page "https://dune-project.org/")
5982 (synopsis "Distributed and Unified Numerics Environment")
5983 (description "DUNE, the Distributed and Unified Numerics Environment is a
5984 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5985 grid-based methods. It supports the easy implementation of methods like
5986 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5989 This package contains the basic DUNE grid classes.")
5990 ;; GPL version 2 with "runtime exception"
5991 (license license:gpl2)))
5993 (define-public dune-istl
6000 (uri (string-append "https://dune-project.org/download/"
6001 version "/dune-istl-" version ".tar.gz"))
6004 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
6005 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
6006 (build-system cmake-build-system)
6009 (modify-phases %standard-phases
6010 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6011 ;; the stdlib types when the gfortran header is used. Remove gfortran
6012 ;; from CPLUS_INCLUDE_PATH as a workaround.
6013 (add-after 'set-paths 'hide-gfortran
6014 (lambda* (#:key inputs #:allow-other-keys)
6015 (let ((gfortran (assoc-ref inputs "gfortran")))
6016 (setenv "CPLUS_INCLUDE_PATH"
6018 (delete (string-append gfortran "/include/c++")
6019 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6022 (add-after 'build 'build-tests
6023 (lambda* (#:key make-flags #:allow-other-keys)
6024 (apply invoke "make" "build_tests" make-flags))))))
6026 `(("dune-common" ,dune-common)
6029 ("suitesparse" ,suitesparse)
6030 ("superlu" ,superlu)
6031 ("openblas" ,openblas)
6033 ("python" ,python)))
6035 `(("gfortran" ,gfortran)
6036 ("pkg-config" ,pkg-config)))
6037 (home-page "https://dune-project.org/")
6038 (synopsis "Distributed and Unified Numerics Environment")
6039 (description "DUNE, the Distributed and Unified Numerics Environment is a
6040 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6043 This is the iterative solver template library which provides generic sparse
6044 matrix/vector classes and a variety of solvers based on these classes. A
6045 special feature is the use of templates to exploit the recursive block
6046 structure of finite element matrices at compile time. Available solvers
6047 include Krylov methods, (block-) incomplete decompositions and
6048 aggregation-based algebraic multigrid.")
6049 ;; GPL version 2 with "runtime exception"
6050 (license license:gpl2)))
6052 (define-public dune-localfunctions
6054 (name "dune-localfunctions")
6059 (uri (string-append "https://dune-project.org/download/"
6060 version "/dune-localfunctions-" version ".tar.gz"))
6063 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
6064 (build-system cmake-build-system)
6067 (modify-phases %standard-phases
6068 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6069 ;; and fails to find the stdlib types when the gfortran header is used.
6070 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6071 (add-after 'set-paths 'hide-gfortran
6072 (lambda* (#:key inputs #:allow-other-keys)
6073 (let ((gfortran (assoc-ref inputs "gfortran")))
6074 (setenv "CPLUS_INCLUDE_PATH"
6076 (delete (string-append gfortran "/include/c++")
6077 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6080 (add-after 'build 'build-tests
6081 (lambda* (#:key make-flags #:allow-other-keys)
6082 (apply invoke "make" "build_tests" make-flags))))))
6084 `(("dune-common" ,dune-common)
6085 ("dune-geometry" ,dune-geometry)
6088 ("superlu" ,superlu)
6091 `(("gfortran" ,gfortran)
6092 ("pkg-config" ,pkg-config)))
6093 (home-page "https://dune-project.org/")
6094 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6095 (description "This DUNE module provides interface and implementation for
6096 shape functions defined on the DUNE reference elements. In addition to the
6097 shape function, interpolation operators and special keys are provided which
6098 can be used to assemble global function spaces on finite-element grids.
6100 This package provides an interface and implementation for shape functions
6101 defined on the DUNE reference elements. In addition to the shape function,
6102 interpolation operators and special keys are provided which can be used to
6103 assemble global function spaces on finite-element grids.")
6104 ;; GPL version 2 with "runtime exception"
6105 (license license:gpl2)))
6107 (define-public dune-alugrid
6109 (name "dune-alugrid")
6110 (version "2.7.0-git-81d35682")
6115 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6116 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
6117 (file-name (git-file-name name version))
6120 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
6121 (build-system cmake-build-system)
6124 (modify-phases %standard-phases
6125 (add-after 'unpack 'patch-include
6127 (substitute* "dune/alugrid/test/test-alugrid.cc"
6128 (("doc/grids/gridfactory/testgrids")
6129 "doc/dune-grid/grids/gridfactory/testgrids"))
6131 (add-after 'build 'build-tests
6132 (lambda* (#:key inputs make-flags #:allow-other-keys)
6133 (setenv "CPLUS_INCLUDE_PATH"
6134 (string-append (assoc-ref inputs "dune-grid") "/share"))
6135 (apply invoke "make" "build_tests" make-flags))))))
6137 `(("dune-common" ,dune-common)
6138 ("dune-geometry" ,dune-geometry)
6139 ("dune-grid" ,dune-grid)
6142 ("openblas" ,openblas)
6144 ("superlu" ,superlu)
6148 `(("gfortran" ,gfortran)
6149 ("pkg-config" ,pkg-config)))
6150 (home-page "https://dune-project.org/")
6151 (synopsis "Distributed and Unified Numerics Environment")
6152 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6153 implementation of the DUNE grid interface supporting either simplices or
6155 (license license:gpl2+)))
6157 (define-public dune-subgrid
6159 (name "dune-subgrid")
6160 (version "2.7.0-git-2103a363")
6165 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6166 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
6167 (file-name (git-file-name name version))
6170 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
6171 (build-system cmake-build-system)
6174 (modify-phases %standard-phases
6175 (add-after 'build 'build-tests
6176 (lambda* (#:key make-flags #:allow-other-keys)
6177 (apply invoke "make" "build_tests" make-flags))))))
6179 `(("dune-common" ,dune-common)
6180 ("dune-geometry" ,dune-geometry)
6181 ("dune-grid" ,dune-grid)
6184 ("openblas" ,openblas)
6187 `(("gfortran" ,gfortran)
6188 ("pkg-config" ,pkg-config)))
6189 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6190 (synopsis "Distributed and Unified Numerics Environment")
6191 (description "The dune-subgrid module marks elements of
6192 another hierarchical dune grid. The set of marked elements can then be
6193 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6194 provides the full grid interface including adaptive mesh refinement.")
6195 (license license:gpl2+)))
6197 (define-public dune-typetree
6199 (name "dune-typetree")
6205 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6206 (commit (string-append "v" version))))
6207 (file-name (git-file-name name version))
6210 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
6211 (build-system cmake-build-system)
6214 (modify-phases %standard-phases
6215 (add-after 'build 'build-tests
6216 (lambda* (#:key make-flags #:allow-other-keys)
6217 (apply invoke "make" "build_tests" make-flags))))))
6219 `(("dune-common" ,dune-common)
6221 ("openblas" ,openblas)
6224 ("superlu" ,superlu)
6227 `(("gfortran" ,gfortran)
6228 ("pkg-config" ,pkg-config)))
6229 (home-page "https://dune-project.org/")
6230 (synopsis "Distributed and Unified Numerics Environment")
6231 (description "TypeTree is a template library for constructing and
6232 operating on statically typed trees of objects.")
6233 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6234 (license (list license:lgpl3+ license:gpl2))))
6236 (define-public dune-functions
6238 (name "dune-functions")
6244 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6245 (commit (string-append "v" version))))
6246 (file-name (git-file-name name version))
6249 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
6250 (build-system cmake-build-system)
6253 (modify-phases %standard-phases
6254 (add-after 'unpack 'disable-failing-tests
6257 ;; unable to load GMSH file in this test
6258 "--exclude-regex gridviewfunctionspacebasistest")
6260 (add-after 'build 'build-tests
6261 (lambda* (#:key make-flags #:allow-other-keys)
6262 (apply invoke "make" "build_tests" make-flags))))))
6264 `(("dune-common" ,dune-common)
6265 ("dune-istl" ,dune-istl)
6266 ("dune-localfunctions" ,dune-localfunctions)
6267 ("dune-grid" ,dune-grid)
6268 ("dune-geometry" ,dune-geometry)
6269 ("dune-typetree" ,dune-typetree)
6270 ("openblas" ,openblas)
6273 ("superlu" ,superlu)
6276 `(("gfortran" ,gfortran)
6277 ("pkg-config" ,pkg-config)))
6278 (home-page "https://dune-project.org/")
6279 (synopsis "Distributed and Unified Numerics Environment")
6280 (description "The dune-functions module provides an abstraction layer for
6281 global finite element functions. Its two main concepts are functions
6282 implemented as callable objects, and bases of finite element spaces.")
6283 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6284 (license (list license:lgpl3+ license:gpl2))))
6286 (define-public dune-pdelab
6288 (name "dune-pdelab")
6289 (version "2.7.0-git-476fe437")
6294 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6295 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
6296 (file-name (git-file-name name version))
6299 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
6300 (build-system cmake-build-system)
6301 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
6303 `(("dune-common" ,dune-common)
6304 ("dune-istl" ,dune-istl)
6305 ("dune-localfunctions" ,dune-localfunctions)
6306 ("dune-geometry" ,dune-geometry)
6307 ("dune-grid" ,dune-grid)
6308 ("dune-typetree" ,dune-typetree)
6309 ("dune-functions" ,dune-functions)
6311 ("openblas" ,openblas)
6315 ("superlu" ,superlu)
6318 `(("gfortran" ,gfortran)
6319 ("pkg-config" ,pkg-config)))
6320 (home-page "https://dune-project.org/")
6321 (synopsis "Differential equations solver toolbox")
6322 (description "PDELab is a partial differential equations solver toolbox
6323 built on top of DUNE, the Distributed and Unified Numerics Environment.")
6324 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6325 (license (list license:lgpl3+ license:gpl2))))
6327 (define add-openmpi-to-dune-package
6328 (let ((dune-package?
6329 (lambda (p) (string-prefix? "dune-" (package-name p)))))
6332 (if (dune-package? p)
6333 (package (inherit p)
6334 (name (string-append (package-name p) "-openmpi"))
6335 (inputs `(,@(package-inputs p)
6336 ("openmpi" ,openmpi)))
6338 (substitute-keyword-arguments (package-arguments p)
6339 ((#:phases phases '%standard-phases)
6340 `(modify-phases ,phases
6341 (add-before 'check 'mpi-setup
6342 ,%openmpi-setup)))))
6343 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
6345 (negate dune-package?))))
6347 (define-public dune-common-openmpi
6348 (add-openmpi-to-dune-package dune-common))
6350 (define-public dune-geometry-openmpi
6351 (add-openmpi-to-dune-package dune-geometry))
6353 (define-public dune-istl-openmpi
6354 (add-openmpi-to-dune-package dune-istl))
6356 (define-public dune-typetree-openmpi
6357 (add-openmpi-to-dune-package dune-typetree))
6359 (define-public dune-uggrid-openmpi
6360 (add-openmpi-to-dune-package dune-uggrid))
6362 (define-public dune-grid-openmpi
6363 (add-openmpi-to-dune-package dune-grid))
6365 (define-public dune-alugrid-openmpi
6366 (add-openmpi-to-dune-package dune-alugrid))
6368 (define-public dune-subgrid-openmpi
6369 (add-openmpi-to-dune-package dune-subgrid))
6371 (define-public dune-localfunctions-openmpi
6372 (add-openmpi-to-dune-package dune-localfunctions))
6374 (define-public dune-functions-openmpi
6375 (add-openmpi-to-dune-package dune-functions))
6377 (define-public dune-pdelab-openmpi
6378 (add-openmpi-to-dune-package dune-pdelab))
6380 (define-public mlucas
6388 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
6390 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
6391 (build-system gnu-build-system)
6393 `(("python2" ,python-2)))
6395 `(#:tests? #f ; no tests
6397 (modify-phases %standard-phases
6401 (call-with-output-file "Makefile"
6403 (format port "CC = gcc
6404 CFLAGS = -O3 ~a -DUSE_THREADS
6405 LDLIBS = -lm -lpthread -lrt
6406 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6408 ,(let ((system (or (%current-target-system)
6409 (%current-system))))
6411 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6415 (lambda* (#:key outputs #:allow-other-keys)
6416 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6417 (install-file "Mlucas" bin)
6418 (install-file "primenet.py" bin))
6420 (home-page "https://www.mersenne.org")
6421 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6422 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6423 numbers in search of a world-record prime. You may use it to test any
6424 suitable number as you wish, but it is preferable that you do so in a
6425 coordinated fashion, as part of the Great Internet Mersenne Prime
6426 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6427 management via the GIMPS project's Primenet server.")
6428 (license license:gpl2+)))
6430 (define-public nauty
6438 "https://pallini.di.uniroma1.it/"
6439 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6441 (base32 "1hl81gpf3xjf809w04jczvilq1ixy9ch1qrax8a7lgx52svna1jg"))))
6442 (build-system gnu-build-system)
6443 (outputs '("out" "lib"))
6445 `(#:test-target "checks"
6446 #:configure-flags '("--enable-generic") ;prevent -march-native
6448 (modify-phases %standard-phases
6449 ;; Default make target does not build all available
6450 ;; executables. Create them now.
6451 (add-after 'build 'build-extra-programs
6453 (for-each (lambda (target) (invoke "make" target))
6454 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6456 ;; Upstream does not provide any install target.
6458 (lambda* (#:key outputs #:allow-other-keys)
6459 (let* ((out (assoc-ref outputs "out"))
6460 (lib-output (assoc-ref outputs "lib"))
6461 (bin (string-append out "/bin"))
6462 (doc (string-append out "/share/doc/nauty/"))
6463 (include (string-append lib-output "/include/nauty"))
6464 (lib (string-append lib-output "/lib/nauty")))
6465 (for-each (lambda (f) (install-file f bin))
6466 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6467 "bliss2dre" "catg" "checks6" "complg" "converseg"
6468 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6469 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6470 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6471 "gentourng" "gentreeg" "hamheuristic" "labelg"
6472 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6473 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6474 "sumlines" "twohamg" "underlyingg" "vcolg"
6475 "watercluster2" "NRswitchg"))
6476 (for-each (lambda (f) (install-file f include))
6477 (find-files "." "\\.h$"))
6478 (for-each (lambda (f) (install-file f lib))
6479 (find-files "." "\\.a$"))
6480 (for-each (lambda (f) (install-file f doc))
6481 (append '("formats.txt" "README" "schreier.txt")
6482 (find-files "." "\\.pdf$")))))))))
6484 `(("gmp" ,gmp))) ;for sumlines
6485 (home-page "https://pallini.di.uniroma1.it/")
6486 (synopsis "Library for graph automorphisms")
6487 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6488 procedures for computing automorphism groups of graphs and digraphs.
6490 @code{nauty} computes graph information in the form of a set of
6491 generators, the size of the group, and the orbits of the group; it can
6492 also produce a canonical label. The @code{nauty} suite is written in
6493 C and comes with a command-line interface, a collection of
6494 command-line tools, and an Application Programming Interface (API).
6496 This package provides the static libraries required to run programs
6497 compiled against the nauty library.")
6498 (license license:asl2.0)))
6507 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6508 "ftp/releases/" version
6509 "/ppl-" version ".tar.gz"))
6512 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6513 (build-system gnu-build-system)
6519 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6521 "Parma Polyhedra Library for computations with polyhedra")
6523 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6524 especially targeted at applications in the field of analysis and
6525 verification of complex systems. These abstractions include convex
6526 polyhedra, defined as the intersection of a finite number of (open or
6527 closed) halfspaces, each described by a linear inequality (strict or
6528 non-strict) with rational coefficients; some special classes of polyhedra
6529 shapes that offer interesting complexity/precision tradeoffs; and grids
6530 which represent regularly spaced points that satisfy a set of linear
6531 congruence relations. The library also supports finite powersets and
6532 products of (any kind of) polyhedra and grids, a mixed integer linear
6533 programming problem solver using an exact-arithmetic version of the simplex
6534 algorithm, a parametric integer programming solver, and primitives for
6535 termination analysis via the automatic synthesis of linear ranking
6537 (license license:gpl3+)))
6539 (define-public speedcrunch
6541 (name "speedcrunch")
6547 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6548 (commit (string-append "release-" version))))
6549 (file-name (git-file-name name version))
6552 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6553 (build-system cmake-build-system)
6554 (inputs `(("qtbase" ,qtbase-5)))
6555 (native-inputs `(("qttools" ,qttools)))
6558 (modify-phases %standard-phases
6559 (add-after 'unpack 'chdir-to-src
6560 (lambda _ (chdir "src") #t)))))
6561 (synopsis "High-precision scientific calculator")
6563 "SpeedCrunch is a high-precision scientific calculator. It features a
6564 syntax-highlighted scrollable display and is designed to be fully used via
6565 keyboard. Some distinctive features are auto-completion of functions and
6566 variables, a formula book, and quick insertion of constants from various
6567 fields of knowledge.")
6568 (home-page "https://speedcrunch.org/")
6569 (license license:gpl2+)))
6571 (define-public minisat
6572 ;; This is the last commit which is available upstream, no
6573 ;; release happened since 2010.
6574 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6578 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6583 (url "https://github.com/niklasso/minisat")
6585 (file-name (string-append name "-" version "-checkout"))
6588 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6590 (search-patches "minisat-friend-declaration.patch"
6591 "minisat-install.patch"))))
6592 (build-system gnu-build-system)
6594 '(#:make-flags (list (string-append "prefix=" %output))
6595 #:tests? #f ;no check target
6597 (modify-phases %standard-phases
6598 (delete 'configure))))
6600 `(("zlib:static" ,zlib "static")
6603 "Small, yet efficient, SAT solver")
6605 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6606 researchers and developers alike to get started on SAT.")
6608 "http://minisat.se/MiniSat.html")
6609 (license license:expat))))
6611 (define-public libqalculate
6613 (name "libqalculate")
6619 (url "https://github.com/Qalculate/libqalculate/")
6620 (commit (string-append "v" version))))
6621 (file-name (git-file-name name version))
6623 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
6625 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6626 (build-system gnu-build-system)
6628 `(("pkg-config" ,pkg-config)
6629 ("gettext" ,gettext-minimal)
6630 ("intltool" ,intltool)
6631 ("automake" ,automake)
6632 ("autoconf" ,autoconf)
6633 ("libtool" ,libtool)
6634 ("doxygen" ,doxygen)
6639 ("libxml2" ,libxml2)
6642 ("gnuplot" ,gnuplot)
6643 ("readline" ,readline)
6644 ("libiconv" ,libiconv)))
6647 (modify-phases %standard-phases
6648 (add-before 'bootstrap 'setenv
6649 ;; Prevent the autogen.sh script to carry out the configure
6650 ;; script, which has not yet been patched to replace /bin/sh.
6652 (setenv "NOCONFIGURE" "TRUE")
6654 (home-page "https://qalculate.github.io/")
6655 (synopsis "Multi-purpose cli desktop calculator and library")
6657 "Libqalculate is a multi-purpose cli desktop calculator and library.
6658 It provides basic and advanced functionality. Features include customizable
6659 functions, unit calculations, and conversions, physical constants, symbolic
6660 calculations (including integrals and equations), arbitrary precision,
6661 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6663 (license license:gpl2+)))
6665 (define-public qalculate-gtk
6667 (name "qalculate-gtk")
6673 (url "https://github.com/Qalculate/qalculate-gtk/")
6674 (commit (string-append "v" version))))
6675 (file-name (git-file-name name version))
6677 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
6678 (build-system glib-or-gtk-build-system)
6680 `(("pkg-config" ,pkg-config)
6681 ("intltool" ,intltool)
6682 ("automake" ,automake)
6683 ("autoconf" ,autoconf)
6684 ("libtool" ,libtool)
6689 ("libqalculate" ,libqalculate)
6690 ("libxml2" ,libxml2)
6695 (modify-phases %standard-phases
6696 (add-before 'bootstrap 'setenv
6697 ;; Prevent the autogen.sh script to carry out the configure
6698 ;; script, which has not yet been patched to replace /bin/sh.
6700 (setenv "NOCONFIGURE" "TRUE")
6702 (home-page "https://qalculate.github.io/")
6703 (synopsis "Multi-purpose graphical desktop calculator")
6705 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6706 multi-purpose GUI desktop calculator. It provides basic and advanced
6707 functionality. Features include customizable functions, unit calculations,
6708 and conversions, physical constants, symbolic calculations (including
6709 integrals and equations), arbitrary precision, uncertainty propagation,
6710 interval arithmetic, plotting.")
6711 (license license:gpl2+)))
6713 (define-public numdiff
6720 (uri (string-append "mirror://savannah/numdiff/numdiff-"
6724 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
6725 (build-system gnu-build-system)
6727 '(#:tests? #f ; There are no tests.
6729 (modify-phases %standard-phases
6730 (add-before 'compress-documentation 'delete-precompressed-info-file
6732 (delete-file (string-append (assoc-ref %outputs "out")
6733 "/share/info/numdiff.info.gz"))
6735 (home-page "https://nongnu.org/numdiff/")
6736 (synopsis "Compare files with numeric fields")
6738 "Numdiff compares files line by line and field by field, ignoring small
6739 numeric differences and differences in numeric formats.")
6740 (license license:gpl3+)))
6748 (uri (string-append "https://gforge.inria.fr/frs/download.php/file"
6749 "/38367/why3-" version ".tar.gz"))
6752 "1n0a2nn1gnk0zg339lh698g4wpk7m8m1vyi2yvifd5adqvk4milw"))))
6753 (build-system ocaml-build-system)
6759 `(("camlzip" ,camlzip)
6760 ("ocaml-graph" ,ocaml-graph)
6761 ("ocaml-menhir" ,ocaml-menhir)
6762 ("ocaml-num" ,ocaml-num)
6763 ("ocaml-zarith" ,ocaml-zarith)))
6765 `(("coq-flocq" ,coq-flocq)
6766 ("emacs-minimal" ,emacs-minimal)
6770 (modify-phases %standard-phases
6771 (add-before 'configure 'fix-configure
6773 (setenv "CONFIG_SHELL" (which "sh"))
6774 (substitute* "configure"
6775 ;; find ocaml-num in the correct directory
6776 (("\\$DIR/nums.cma") "$DIR/num.cma")
6777 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
6779 (add-after 'configure 'fix-makefile
6781 (substitute* "Makefile"
6782 ;; find ocaml-num in the correct directory
6783 (("site-lib/num") "site-lib"))
6785 (add-after 'install 'install-lib
6787 (invoke "make" "byte")
6788 (invoke "make" "install-lib")
6790 (home-page "http://why3.lri.fr")
6791 (synopsis "Deductive program verification")
6792 (description "Why3 provides a language for specification and programming,
6793 called WhyML, and relies on external theorem provers, both automated and
6794 interactive, to discharge verification conditions. Why3 comes with a standard
6795 library of logical theories (integer and real arithmetic, Boolean operations,
6796 sets and maps, etc.) and basic programming data structures (arrays, queues,
6797 hash tables, etc.). A user can write WhyML programs directly and get
6798 correct-by-construction OCaml programs through an automated extraction
6799 mechanism. WhyML is also used as an intermediate language for the verification
6800 of C, Java, or Ada programs.")
6801 (license license:lgpl2.1)))
6803 (define-public frama-c
6809 (uri (string-append "http://frama-c.com/download/frama-c-"
6810 version "-Titanium.tar.gz"))
6813 "1mq1fijka95ydrla486yr4w6wdl9l7vmp512s1q00b0p6lmfwmkh"))))
6814 (build-system ocaml-build-system)
6816 `(#:tests? #f; no test target in Makefile
6818 (modify-phases %standard-phases
6819 (add-before 'configure 'export-shell
6820 (lambda* (#:key inputs #:allow-other-keys)
6821 (setenv "CONFIG_SHELL"
6822 (search-input-file inputs "/bin/sh")))))))
6826 `(("ocaml-biniou" ,ocaml-biniou)
6827 ("ocaml-easy-format" ,ocaml-easy-format)
6828 ("ocaml-graph" ,ocaml-graph)
6829 ("ocaml-yojson" ,ocaml-yojson)
6830 ("ocaml-zarith" ,ocaml-zarith)
6832 (native-search-paths
6833 (list (search-path-specification
6834 (variable "FRAMAC_SHARE")
6835 (files '("share/frama-c"))
6837 (search-path-specification
6838 (variable "FRAMAC_LIB")
6839 (files '("lib/frama-c"))
6841 (home-page "http://frama-c.com")
6842 (synopsis "C source code analysis platform")
6843 (description "Frama-C is an extensible and collaborative platform dedicated
6844 to source-code analysis of C software. The Frama-C analyzers assist you in
6845 various source-code-related activities, from the navigation through unfamiliar
6846 projects up to the certification of critical software.")
6847 (license license:lgpl2.1+)))
6849 (define-public blitz
6857 (url "https://github.com/blitzpp/blitz")
6859 (file-name (git-file-name name version))
6861 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
6862 (build-system cmake-build-system)
6864 `(#:configure-flags '("-DBUILD_DOC=ON"
6865 "-DBUILD_TESTING=ON")
6866 ;; The default "check" target also includes examples and benchmarks.
6867 #:test-target "check-testsuite"
6869 (modify-phases %standard-phases
6870 (add-after 'build 'build-doc
6872 (invoke "make" "-j" (number->string (parallel-job-count))
6875 `(("python" ,python)
6876 ("texinfo" ,texinfo)))
6877 (synopsis "C++ template class library for multidimensional arrays")
6878 (description "Blitz++ is a C++ template class library that provides
6879 high-performance multidimensional array containers for scientific computing.")
6880 (home-page "https://github.com/blitzpp/blitz")
6881 (license (list license:artistic2.0
6885 (define-public fxdiv
6886 ;; There is currently no tag in this repo.
6887 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
6892 (version (git-version version revision commit))
6893 (home-page "https://github.com/Maratyszcza/FXdiv")
6896 (uri (git-reference (url home-page) (commit commit)))
6897 (file-name (git-file-name name version))
6900 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
6901 (patches (search-patches "fxdiv-system-libraries.patch"))))
6902 (build-system cmake-build-system)
6904 `(("googletest" ,googletest)
6905 ("googlebenchmark" ,googlebenchmark)))
6907 "C++ library for division via fixed-point multiplication by inverse")
6909 "On modern CPUs and GPUs, integer division is several times slower than
6910 multiplication. FXdiv implements an algorithm to replace an integer division
6911 with a multiplication and two shifts. This algorithm improves performance
6912 when an application performs repeated divisions by the same divisor.")
6913 (license license:expat))))
6916 ;; There is currently no tag in this repo.
6917 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
6922 (version (git-version version revision commit))
6923 (home-page "https://github.com/Maratyszcza/FP16")
6926 (uri (git-reference (url home-page) (commit commit)))
6927 (file-name (git-file-name name version))
6930 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
6931 (patches (search-patches "fp16-system-libraries.patch"))))
6932 (build-system cmake-build-system)
6934 `(("python-wrapper" ,python-wrapper)))
6937 ("googletest" ,googletest)
6938 ("googlebenchmark" ,googlebenchmark)))
6939 (synopsis "C++ library for half-precision floating point formats")
6941 "This header-only C++ library implements conversion to and from
6942 half-precision floating point formats.")
6943 (license license:expat))))
6945 (define-public optizelle
6946 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
6949 (version (git-version "1.3.0" "0" commit))
6954 (url "https://github.com/OptimoJoe/Optizelle")
6956 (file-name (git-file-name "optizelle" commit))
6959 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
6960 (modules '((guix build utils)))
6963 ;; Reduce the stopping tolerance in one test so that the
6964 ;; convergence check returns the correct stopping
6967 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
6968 (("1e-13") "5e-14"))
6969 ;; Skip one set of python tests. See
6970 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
6972 "src/examples/inequality_scaling/CMakeLists.txt"
6973 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
6974 (string-append "add_unit" middle "\"cpp\"" end)))
6975 ;; Install the licence for Optizelle, without also
6976 ;; including the licences for the dependencies.
6977 (substitute* "licenses/CMakeLists.txt"
6978 (("file.*package.*$" all)
6979 (string-append "# " all))
6980 ((".*[^l].[.]txt\\)\n") "")
6981 (("add_license.*\"\n") ""))
6983 (build-system cmake-build-system)
6985 `(#:imported-modules ((guix build python-build-system)
6986 ,@%cmake-build-system-modules)
6987 #:modules (((guix build python-build-system) #:select
6989 (guix build cmake-build-system)
6991 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
6992 "-DENABLE_CPP_UNIT:BOOL=ON"
6993 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
6994 "-DENABLE_PYTHON:BOOL=ON"
6995 "-DENABLE_PYTHON_UNIT:BOOL=ON"
6996 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
6997 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
6998 (assoc-ref %build-inputs
7000 "/lib/libopenblas.so")
7001 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7002 (assoc-ref %build-inputs
7004 "/lib/libgfortran.so;"
7005 (assoc-ref %build-inputs
7007 "/lib/libquadmath.so"))
7009 (modify-phases %standard-phases
7010 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7011 (lambda* (#:key inputs #:allow-other-keys)
7012 (let* ((pyver (python-version (assoc-ref inputs "python")))
7013 (npdir (string-append (assoc-ref inputs "numpy")
7016 (substitute* "src/cmake/Modules/Optizelle.cmake"
7018 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7019 "PYTHONPATH=" npdir ":"))))))
7020 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7022 `(("blas/lapack" ,openblas)
7023 ("fortran:lib" ,gfortran "lib")
7024 ("jsoncpp" ,jsoncpp)
7025 ("numpy" ,python-numpy)
7026 ("python" ,python)))
7028 `(("fortran" ,gfortran)
7029 ("pkg-config" ,pkg-config)))
7030 (home-page "https://www.optimojoe.com/products/optizelle/")
7031 (synopsis "Mathematical optimization library")
7032 (description "@code{optizelle} is a software library designed to
7033 solve nonlinear optimization problems. Four types of problem are
7034 considered: unconstrained, equality constrained, inequality
7035 constrained and constrained. Constraints may be applied as values of
7036 functions or sets of partial differential equations (PDEs).
7038 Solution algorithms such as the preconditioned nonlinear conjugate
7039 gradient method, sequential quadratic programming (SQP) and the
7040 primal-dual interior-point method are made available. Interfaces are
7041 provided for applications written in C++ and Python. Parallel
7042 computation is supported via MPI.")
7043 (license license:bsd-2))))