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–2021 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 (list gtk+ libxml2))
172 (native-inputs (list pkg-config))
174 `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
175 (synopsis "Natural deduction first-order logic interface")
176 (description "Aris is a program for performing logical proofs. It supports
177 propositional and predicate logic, as well as Boolean algebra and
178 arithmetical logic. In addition to its predefined inference and equivalence
179 rules, Aris also supports references to older proofs. Its use of standard
180 logical symbols and its natural deduction interface make it easy to use for
182 (license license:gpl3+)
183 (home-page "https://www.gnu.org/software/aris/")))
185 (define-public bitwise
191 (uri (string-append "https://github.com/mellowcandle/bitwise"
192 "/releases/download/v" version
193 "/bitwise-v" version ".tar.gz"))
195 (base32 "1lniw4bsb5qs5ybf018qllf95pzixb1q3lvybzl4k3xz8zpkrm6k"))))
196 (build-system gnu-build-system)
198 (list ncurses readline))
200 (list cunit pkg-config))
201 (synopsis "Terminal based bit manipulator in ncurses")
202 (description "Bitwise is a multi base interactive calculator supporting
203 dynamic base conversion and bit manipulation. It's a handy tool for low level
204 hackers, kernel developers and device drivers developers.
206 Some of the features include:
208 @item Interactive ncurses interface.
209 @item Command line calculator supporting all bitwise operations.
210 @item Individual bit manipulator.
211 @item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
213 (license license:gpl3+)
214 (home-page "https://github.com/mellowcandle/bitwise/")))
216 (define-public c-graph
222 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
225 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
226 (build-system gnu-build-system)
229 (synopsis "Visualizing and demonstrating convolution")
231 "GNU C-Graph is a tool for demonstrating the theory of convolution.
232 Thus, it can serve as an excellent aid to students of signal and systems
233 theory in visualizing the convolution process. Rather than forcing the
234 student to write code, the program offers an intuitive interface with
235 interactive dialogs to guide them.")
236 (license license:gpl3+)
237 (home-page "https://www.gnu.org/software/c-graph/")))
246 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
247 version "/coda-" version ".tar.gz"))
249 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
250 (patches (search-patches "coda-use-system-libs.patch"))
251 (modules '((guix build utils)))
253 ;; Make sure we don't use the bundled software.
255 (for-each (lambda (d)
256 (delete-file-recursively (string-append "libcoda/" d)))
257 '("zlib" "pcre" "expat"))
260 `(("fortran" ,gfortran)
262 ("python-numpy" ,python-numpy)))
269 (build-system gnu-build-system)
271 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
272 "LIBS= -lz -lpcre -lexpat")))
273 (synopsis "A common interface to various earth observation data formats")
275 "The Common Data Access toolbox (CODA) provides a set of interfaces for
276 reading remote sensing data from earth observation data files. It consists of
277 command line applications and interfaces to the C, Fortran, Python, and Java
278 programming languages.")
279 (home-page "https://stcorp.nl/coda")
280 (license license:gpl2+)))
288 (uri (string-append "http://www.qhull.org/download/qhull-"
289 (car (string-split version #\.))
293 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
294 (build-system cmake-build-system)
296 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
297 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
298 (synopsis "Calculate convex hulls and related structures")
300 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
301 diagram, halfspace intersection about a point, furthest-site Delaunay
302 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
303 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
304 algorithm for computing the convex hull. It handles roundoff errors from
305 floating point arithmetic. It computes volumes, surface areas, and
306 approximations to the convex hull.
308 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
309 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
310 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
312 (home-page "http://qhull.org")
313 (license (license:non-copyleft "file://COPYING.txt"
314 "See COPYING in the distribution."))))
316 (define-public python-cvxopt
318 (name "python-cvxopt")
323 (url "https://github.com/cvxopt/cvxopt")
325 (file-name (git-file-name name version))
328 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
329 (build-system python-build-system)
332 (modify-phases %standard-phases
333 (add-after 'unpack 'find-libraries
334 (lambda* (#:key inputs #:allow-other-keys)
335 (setenv "CVXOPT_BLAS_LIB" "openblas")
336 (setenv "CVXOPT_BUILD_FFTW" "1")
337 (setenv "CVXOPT_BUILD_GLPK" "1")
338 (setenv "CVXOPT_BUILD_GSL" "1")
347 (home-page "https://www.cvxopt.org")
348 (synopsis "Python library for convex optimization")
350 "CVXOPT is a package for convex optimization based on the Python
351 programming language. Its main purpose is to make the development of software
352 for convex optimization applications straightforward by building on Python’s
353 extensive standard library and on the strengths of Python as a high-level
354 programming language.")
355 (license license:gpl3+)))
357 (define-public python2-cvxopt
358 (package-with-python2 python-cvxopt))
366 (uri (string-append "mirror://gnu/units/units-" version
369 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
370 (build-system gnu-build-system)
372 `(("readline" ,readline)
373 ("python" ,python-wrapper) ;for 'units_cur' script
374 ("python-requests" ,python-requests)))
376 `(#:phases (modify-phases %standard-phases
377 (add-after 'install 'wrap-units_cur
378 (lambda* (#:key outputs #:allow-other-keys)
379 (let* ((out (assoc-ref outputs "out"))
380 (bin (string-append out "/bin")))
381 (wrap-program (string-append bin "/units_cur")
382 `("GUIX_PYTHONPATH" ":" prefix
383 ,(search-path-as-string->list (getenv "GUIX_PYTHONPATH"))))
385 (synopsis "Conversion between thousands of scales")
387 "GNU Units converts numeric quantities between units of measure. It
388 can handle scale changes through adaptive usage of standard scale
389 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
390 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
391 enough to be used effectively as a scientific calculator.")
392 (license license:gpl3+)
393 (home-page "https://www.gnu.org/software/units/")))
395 (define-public double-conversion
397 (name "double-conversion")
399 (home-page "https://github.com/google/double-conversion")
402 (uri (git-reference (url home-page)
403 (commit (string-append "v" version))))
404 (file-name (git-file-name name version))
407 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
408 (build-system cmake-build-system)
410 '(#:test-target "test"
411 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
412 "-DBUILD_TESTING=ON")))
413 (synopsis "Conversion routines for IEEE doubles")
415 "The double-conversion library provides binary-decimal and decimal-binary
416 routines for IEEE doubles. The library consists of efficient conversion
417 routines that have been extracted from the V8 JavaScript engine.")
418 (license license:bsd-3)))
420 (define-public dionysus
426 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
430 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
431 (build-system gnu-build-system)
432 (inputs (list tcl)) ;for 'tclsh'
433 (synopsis "Local search for universal constants and scientific values")
435 "GNU Dionysus is a convenient system for quickly retrieving the values of
436 mathematical constants used in science and engineering. Values can be
437 searched using a simple command-line tool, choosing from three databases:
438 universal constants, atomic numbers, and constants related to
440 (license license:gpl3+)
441 (home-page "https://www.gnu.org/software/dionysus/")))
452 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
453 "dSFMT-src-" version ".tar.gz"))
456 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
457 (modules '((guix build utils)))
458 ;; Don't distribute html documentation with bundled jquery.
461 (delete-file-recursively "html") #t))
462 ;; Add patches borrowed from Julia.
468 "https://raw.githubusercontent.com/JuliaLang/julia/"
469 "v1.3.0/deps/patches/dSFMT.c.patch"))
471 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
472 (file-name "dSFMT.c.patch"))
476 "https://raw.githubusercontent.com/JuliaLang/julia/"
477 "v1.3.0/deps/patches/dSFMT.h.patch"))
479 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
480 (file-name "dSFMT.h.patch"))))))
481 (build-system gnu-build-system)
484 (modify-phases %standard-phases
485 (delete 'configure) ; no configure script
487 ;; Upstream Makefile does not build a shared library. Borrow from Julia
488 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
491 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
492 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
493 "-O3" "-finline-functions" "-fomit-frame-pointer"
494 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
495 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
496 "-o" "libdSFMT.so")))
497 (replace 'install ; no "install" target
498 (lambda* (#:key outputs #:allow-other-keys)
499 (let* ((out (assoc-ref outputs "out"))
500 (lib (string-append out "/lib"))
501 (inc (string-append out "/include"))
502 (doc (string-append out "/share/doc/" ,name "-" ,version)))
503 (install-file "libdSFMT.so" lib)
504 (install-file "dSFMT.h" inc)
505 (install-file "LICENSE.txt" doc)
507 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
509 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
510 the expensive conversion of integer to double (floating point). dSFMT directly
511 generates double precision floating point pseudorandom numbers which have the
512 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
513 format. dSFMT is only available on the CPUs which use IEEE 754 format double
514 precision floating point numbers.")
515 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
516 (license license:bsd-3)))
524 (uri (string-append "mirror://gnu/gsl/gsl-"
528 "0av04cpblphvvs3kl5rwphniarml503501vrpqw31rd0bmwg7fzg"))))
529 (build-system gnu-build-system)
531 (let ((system (%current-system)))
532 `(#:configure-flags (list "--disable-static") ;halves package size
534 (modify-phases %standard-phases
536 ((or (string-prefix? "aarch64" system)
537 (string-prefix? "powerpc" system))
538 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
539 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
540 '((add-before 'check 'disable-failing-tests
542 (substitute* "spmatrix/test.c"
543 ((".*test_complex.*") "\n"))))))
545 ((string-prefix? "i686" system)
546 ;; There are rounding issues with these tests on i686:
547 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
548 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
549 '((add-before 'check 'disable-failing-tests
551 (substitute* "linalg/test.c"
552 ((".*gsl_test\\(test_LU_decomp.*") "\n")
553 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
554 ((".*gsl_test\\(test_QR_decomp_r.*") "\n")
555 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
556 ((".*gsl_test\\(test_pcholesky_solve.*") "\n")
557 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
558 (substitute* "spmatrix/test.c"
559 ((".*test_all.*") "\n")
560 ((".*test_float.*") "\n")
561 ((".*test_complex.*") "\n"))
563 ;; XXX: These tests abort with:
564 ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
565 (substitute* '("multifit_nlinear/test.c"
566 "multilarge_nlinear/test.c")
567 (("gsl_ieee_env_setup.*" all)
568 (string-append "exit (77);\n" all)))))))
571 (home-page "https://www.gnu.org/software/gsl/")
572 (synopsis "Numerical library for C and C++")
574 "The GNU Scientific Library is a library for numerical analysis in C
575 and C++. It includes a wide range of mathematical routines, with over 1000
576 functions in total. Subject areas covered by the library include:
577 differential equations, linear algebra, Fast Fourier Transforms and random
579 (license license:gpl3+)))
581 ;; TODO: Merge back into the gsl package as a separate output.
582 (define-public gsl-static
586 `(,@(package-arguments gsl)
587 #:configure-flags (list "--disable-shared")
588 #:make-flags (list "CFLAGS=-fPIC")))))
598 (url "https://github.com/shibatch/sleef")
600 (file-name (git-file-name name version))
602 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
603 (build-system cmake-build-system)
605 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
606 (string-append "-DCMAKE_INSTALL_LIBDIR="
607 (assoc-ref %outputs "out")
609 (string-append "-DCMAKE_INSTALL_PREFIX="
610 (assoc-ref %outputs "out")))
612 (modify-phases %standard-phases
613 ;; SLEEF generates a header library during the build process and writes
614 ;; to it via shell redirection. Make the checkout writable so the
615 ;; build can succeed.
616 (add-after 'unpack 'make-git-checkout-writable
618 (for-each make-file-writable (find-files "."))
621 (list fftw gmp mpfr openssl))
622 (home-page "https://sleef.org/")
623 (synopsis "SIMD library for evaluating elementary functions and DFT")
625 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
626 implements vectorized versions of all C99 real floating point math functions.
627 It can utilize SIMD instructions that are available on modern processors.")
628 (license (list license:boost1.0 ;sleef
629 license:cc-by4.0)))) ;simplex algorithm
638 (uri (string-append "mirror://gnu/glpk/glpk-"
642 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
643 (build-system gnu-build-system)
647 `(#:configure-flags '("--with-gmp"
648 "--disable-static")))
649 (home-page "https://www.gnu.org/software/glpk/")
650 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
652 "GLPK is a C library for solving large-scale linear programming (LP),
653 mixed integer programming (MIP), and other related problems. It supports the
654 GNU MathProg modeling language, a subset of the AMPL language, and features a
655 translator for the language. In addition to the C library, a stand-alone
656 LP/MIP solver is included in the package.")
657 (license license:gpl3+)))
659 (define-public glpk-4
667 (uri (string-append "mirror://gnu/glpk/glpk-"
671 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
680 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
682 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
684 "/4ti2-" version ".tar.gz"))
686 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
687 (build-system gnu-build-system)
689 (list (@ (gnu packages base) which))) ; for the tests
692 (home-page "http://www.4ti2.de/")
693 (synopsis "Mathematical tool suite for problems on linear spaces")
695 "4ti2 implements algorithms for solving algebraic, geometric and
696 combinatorial problems on linear spaces. Among others, it solves systems
697 of linear equations, computes extreme rays of polyhedral cones, solves
698 integer programming problems and computes Markov bases for statistics.")
699 (license license:gpl2+)))
701 (define-public cddlib
708 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
709 (string-delete #\. version) ".tar.gz"))
712 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
713 (build-system gnu-build-system)
716 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
717 (synopsis "Library for convex hulls and extreme rays of polyhedra")
719 "The C-library cddlib implements the Double Description Method of
720 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
721 rays of a general convex polyhedron given by a system of linear inequalities
722 in arbitrary dimension. It can also be used for the converse operation of
723 computing convex hulls.")
724 (license license:gpl2+)))
726 (define-public lrslib
733 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
735 (string-delete #\. version) ".tar.gz"))
738 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
739 (build-system gnu-build-system)
743 `(#:tests? #f ; no check phase
744 #:make-flags `("CC=gcc"
745 ,(string-append "prefix=" (assoc-ref %outputs "out"))
748 (modify-phases %standard-phases
751 (substitute* "makefile"
752 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
754 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
755 (synopsis "Convex hulls of polyhedra with exact arithmetic")
757 "The C code of lrslib implements the reverse search algorithm for
758 vertex enumeration and convex hull problems. Its input file format is
759 compatible with cddlib. All computations are done exactly in either
760 multiple precision or fixed integer arithmetic. Output is not stored
761 in memory, so even problems with very large output sizes can sometimes
763 (license license:gpl2+)))
765 (define-public libcerf
773 (url "https://jugit.fz-juelich.de/mlz/libcerf")
774 (commit (string-append "v" version))))
775 (file-name (git-file-name name version))
777 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
778 (build-system cmake-build-system)
781 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
782 (synopsis "Library for complex error functions")
784 "@code{libcerf} is a self-contained numeric library that provides an
785 efficient and accurate implementation of complex error functions, along with
786 Dawson, Faddeeva, and Voigt functions.")
787 (license license:expat)))
796 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
797 "vinci/vinci-" version ".tar.gz"))
800 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
801 (build-system gnu-build-system)
805 `(#:tests? #f ; no check phase
807 (modify-phases %standard-phases
809 ;; register the lrs location in the config file
810 (lambda* (#:key inputs #:allow-other-keys)
811 (let* ((lrs (assoc-ref inputs "lrslib"))
812 (lrsexec (string-append lrs "/bin/lrs")))
813 (substitute* "vinci.h"
814 (("#define LRS_EXEC \"lrs\"")
815 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
818 (lambda* (#:key outputs #:allow-other-keys)
819 (let* ((out (assoc-ref outputs "out"))
820 (bin (string-append out "/bin")))
821 (install-file "vinci" bin))
824 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
825 (synopsis "Volume computation for polytopes")
827 "Vinci implements a number of volume computation algorithms for convex
828 polytopes in arbitrary dimension. The polytopes can be given by their
829 V-representation (as the convex hull of a finite number of vertices), by
830 their H-representation (as the bounded intersection of a finite number of
831 halfspaces) or by their double description with both representations.")
832 (license license:gpl2+)))
834 (define-public arpack-ng
838 (home-page "https://github.com/opencollab/arpack-ng")
841 (uri (git-reference (url home-page) (commit version)))
842 (file-name (git-file-name name version))
845 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
846 (build-system gnu-build-system)
848 (list autoconf automake libtool pkg-config))
850 (list eigen lapack gfortran))
851 (synopsis "Fortran subroutines for solving eigenvalue problems")
853 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
854 large scale eigenvalue problems.")
855 (license (license:non-copyleft "file://COPYING"
856 "See COPYING in the distribution."))))
858 (define-public arpack-ng-3.3.0
865 (uri (git-reference (url (package-home-page arpack-ng))
867 (file-name (git-file-name (package-name arpack-ng) version))
870 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
872 (define-public arpack-ng-openmpi
873 (package (inherit arpack-ng)
874 (name "arpack-ng-openmpi")
877 ,@(package-inputs arpack-ng)))
879 (substitute-keyword-arguments (package-arguments arpack-ng)
880 ((#:configure-flags _ '())
882 ((#:phases phases '%standard-phases)
883 `(modify-phases ,phases
884 (add-before 'check 'mpi-setup
886 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
888 (define-public lapack
895 (uri (string-append "http://www.netlib.org/lapack/lapack-"
899 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
900 (build-system cmake-build-system)
901 (home-page "http://www.netlib.org/lapack/")
902 (inputs `(("fortran" ,gfortran)
903 ("python" ,python-wrapper)))
905 `(#:configure-flags (list
906 "-DBUILD_SHARED_LIBS:BOOL=YES"
908 ;; Build the 'LAPACKE_clatms' functions.
909 "-DLAPACKE_WITH_TMG=ON"
910 "-DBUILD_TESTING=ON")))
911 (synopsis "Library for numerical linear algebra")
913 "LAPACK is a Fortran 90 library for solving the most commonly occurring
914 problems in numerical linear algebra.")
915 (license (license:non-copyleft "file://LICENSE"
916 "See LICENSE in the distribution."))))
918 (define-public clapack
925 (uri (string-append "http://www.netlib.org/clapack/clapack-"
926 version "-CMAKE.tgz"))
929 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
930 (build-system cmake-build-system)
932 `(#:configure-flags '("-DCMAKE_C_FLAGS=-fcommon -O2")
934 (modify-phases %standard-phases
935 ;; These tests use a lot of stack variables and segfault without
936 ;; lifting resource limits.
937 (add-after 'unpack 'disable-broken-tests
939 (substitute* "TESTING/CMakeLists.txt"
940 (("add_lapack_test.* xeigtstz\\)") ""))))
942 (lambda* (#:key outputs #:allow-other-keys)
943 (let* ((out (assoc-ref outputs "out"))
944 (libdir (string-append out "/lib"))
945 (f2cinc (string-append out "/include/libf2c")))
948 (for-each (lambda (file)
949 (install-file file libdir))
951 "F2CLIBS/libf2c/libf2c.a"
952 "TESTING/MATGEN/libtmglib.a"
953 "BLAS/SRC/libblas.a"))
954 (for-each (lambda (file)
955 (install-file file f2cinc))
956 (cons "F2CLIBS/libf2c/arith.h"
957 (find-files (string-append "../clapack-"
958 ,version "-CMAKE/F2CLIBS/libf2c")
960 (copy-recursively (string-append "../clapack-"
961 ,version "-CMAKE/INCLUDE")
962 (string-append out "/include"))))))))
963 (home-page "https://www.netlib.org/clapack/")
964 (synopsis "Numerical linear algebra library for C")
966 "The CLAPACK library was built using a Fortran to C conversion utility
967 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
968 C code, and then modified to improve readability. CLAPACK's goal is to
969 provide LAPACK for someone who does not have access to a Fortran compiler.")
970 (license (license:non-copyleft "file://LICENSE"
971 "See LICENSE in the distribution."))))
973 (define-public scalapack
980 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
984 "19i0h9vdc3zsy58r6fy1vs2kz2l7amifkz0cf926j90xz1n23nb1"))
985 (patches (search-patches "scalapack-gcc-10-compilation.patch"))))
986 (build-system cmake-build-system)
989 ("fortran" ,gfortran)
990 ("lapack" ,lapack))) ;for testing only
992 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
993 #:phases (modify-phases %standard-phases
994 (add-before 'check 'mpi-setup
996 (add-after 'unpack 'skip-faulty-test
998 ;; FIXME: Skip these two tests that fail to complete for
1000 ;; <https://github.com/Reference-ScaLAPACK/scalapack/issues/43>.
1001 (substitute* "TESTING/CMakeLists.txt"
1002 (("^add_test\\(x[sd]hseqr.*" all)
1003 (string-append "# " all "\n"))))))))
1004 (home-page "http://www.netlib.org/scalapack/")
1005 (synopsis "Library for scalable numerical linear algebra")
1007 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
1008 routines on parallel distributed memory machines. ScaLAPACK solves dense and
1009 banded linear systems, least squares problems, eigenvalue problems, and
1010 singular value problems.")
1011 (license (license:non-copyleft "file://LICENSE"
1012 "See LICENSE in the distribution."))))
1014 (define-public gnuplot
1020 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1024 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
1025 (build-system gnu-build-system)
1026 (inputs (list readline cairo pango gd lua))
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"))))
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 (list gfortran bison flex))
1093 ("libjpeg" ,libjpeg-turbo)
1094 ("libtirpc" ,libtirpc)))
1096 `(#:parallel-tests? #f
1097 #:configure-flags (list "--enable-shared"
1098 "FCFLAGS=-fallow-argument-mismatch"
1099 "FFLAGS=-fallow-argument-mismatch"
1100 (string-append "CPPFLAGS=-I"
1101 (assoc-ref %build-inputs "libtirpc")
1104 (modify-phases %standard-phases
1105 ;; This is inspired by two of Debian's patches.
1106 (add-before 'configure 'add-more-aarch64-support
1108 (substitute* '("mfhdf/ncgen/ncgen.l"
1109 "mfhdf/ncgen/ncgenyy.c"
1110 "mfhdf/libsrc/netcdf.h.in")
1111 (("AIX5L64") "__aarch64__"))
1113 (add-before 'configure 'patchbuild
1116 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1118 (("/bin/mkdir") "mkdir"))
1119 (substitute* (find-files "." "^Makefile\\.in$")
1120 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1121 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1122 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1123 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1124 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1126 (add-after 'configure 'patch-settings
1128 ;; libhdf4.settings contains the full path of the
1129 ;; compilers used, and its contents are included in
1130 ;; .so-files. We truncate the hashes to avoid
1131 ;; unnecessary store references to those compilers:
1132 (substitute* "libhdf4.settings"
1133 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1134 (string-append prefix (string-take hash 10) "...")))
1136 (add-after 'install 'provide-absolute-libjpeg-reference
1137 (lambda* (#:key inputs outputs #:allow-other-keys)
1138 (let ((out (assoc-ref outputs "out"))
1139 (libjpeg (assoc-ref inputs "libjpeg")))
1140 ;; libjpeg-turbo does not provide a .la file, so libtool is
1141 ;; unable to add an absolute reference for -ljpeg in the .la
1142 ;; files. Fix it manually to avoid having to propagate it.
1143 (substitute* (find-files (string-append out "/lib") "\\.la$")
1145 (string-append "-L" libjpeg "/lib -ljpeg")))
1147 (home-page "https://www.hdfgroup.org/products/hdf4/")
1149 "Library and multi-object file format for storing and managing data")
1150 (description "HDF4 is a library and multi-object file format for storing
1151 and managing data between machines. HDF4 is an older hierarchical data format,
1152 incompatible with HDF5.")
1154 (license:non-copyleft
1155 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1157 (define-public hdf4-alt
1162 (substitute-keyword-arguments (package-arguments hdf4)
1163 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1165 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1167 (define-public hdf5-1.8
1174 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1175 "hdf5-" (version-major+minor version)
1176 "/hdf5-" version "/src/hdf5-"
1178 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1180 (match (string-split version #\.)
1181 ((major minor _ ...)
1182 (string-append major minor)))
1183 "/src/hdf5-" version ".tar.bz2")))
1185 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1186 (patches (search-patches "hdf5-config-date.patch"))))
1187 (build-system gnu-build-system)
1191 (list gfortran perl)) ;part of the test machinery needs Perl
1192 (outputs '("out" ; core library
1193 "fortran")) ; fortran interface
1195 `(;; Some of the users, notably Flann, need the C++ interface.
1196 #:configure-flags '("--enable-cxx"
1198 "--enable-fortran2003"
1200 ;; Build a thread-safe library. Unfortunately,
1201 ;; 'configure' invites you to either turn off C++,
1202 ;; Fortran, and the high-level interface (HL), or
1203 ;; to pass '--enable-unsupported'. Debian
1204 ;; packagers chose to pass '--enable-unsupported'
1205 ;; and we follow their lead here.
1206 "--enable-threadsafe"
1208 "--enable-unsupported")
1209 ;; Use -fPIC to allow the R bindings to link with the static libraries
1210 #:make-flags (list "CFLAGS=-fPIC"
1213 (modify-phases %standard-phases
1214 (add-before 'configure 'patch-configure
1215 (lambda* (#:key outputs #:allow-other-keys)
1216 (substitute* "configure"
1218 (substitute* "fortran/src/Makefile.in"
1219 (("libhdf5_fortran_la_LDFLAGS =")
1220 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1221 (assoc-ref outputs "fortran") "/lib")))
1222 (substitute* "hl/fortran/src/Makefile.in"
1223 (("libhdf5hl_fortran_la_LDFLAGS =")
1224 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1225 (assoc-ref outputs "fortran") "/lib")))
1227 (add-after 'configure 'patch-settings
1229 ;; libhdf5.settings contains the full path of the
1230 ;; compilers used, and its contents are included in
1231 ;; libhdf5.so. We truncate the hashes to avoid
1232 ;; unnecessary store references to those compilers:
1233 (substitute* "src/libhdf5.settings"
1234 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1235 (string-append prefix (string-take hash 10) "..."))
1236 ;; Don't record the build-time kernel version to make the
1237 ;; settings file reproducible.
1238 (("Uname information:.*")
1239 "Uname information: Linux\n"))
1241 (add-after 'install 'patch-references
1242 (lambda* (#:key inputs outputs #:allow-other-keys)
1243 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1244 (zlib (assoc-ref inputs "zlib")))
1245 (substitute* (find-files bin "h5p?cc")
1247 (string-append "-L" zlib "/lib " lib)))
1249 (add-after 'install 'split
1250 (lambda* (#:key inputs outputs #:allow-other-keys)
1251 ;; Move all fortran-related files
1252 (let* ((out (assoc-ref outputs "out"))
1253 (bin (string-append out "/bin"))
1254 (lib (string-append out "/lib"))
1255 (inc (string-append out "/include"))
1256 (ex (string-append out "/share/hdf5_examples/fortran"))
1257 (fort (assoc-ref outputs "fortran"))
1258 (fbin (string-append fort "/bin"))
1259 (flib (string-append fort "/lib"))
1260 (finc (string-append fort "/include"))
1261 (fex (string-append fort "/share/hdf5_examples/fortran")))
1266 ;; Note: When built with --enable-parallel, the 'h5fc' file
1267 ;; doesn't exist, hence this condition.
1268 (when (file-exists? (string-append bin "/h5fc"))
1269 (rename-file (string-append bin "/h5fc")
1270 (string-append fbin "/h5fc")))
1271 (for-each (lambda (file)
1273 (string-append flib "/" (basename file))))
1274 (find-files lib ".*fortran.*"))
1275 (for-each (lambda (file)
1277 (string-append finc "/" (basename file))))
1278 (find-files inc ".*mod"))
1279 (for-each (lambda (file)
1281 (string-append fex "/" (basename file))))
1282 (find-files ex ".*"))
1283 (delete-file-recursively ex))
1285 (home-page "https://www.hdfgroup.org")
1286 (synopsis "Management suite for extremely large and complex data")
1287 (description "HDF5 is a suite that makes possible the management of
1288 extremely large and complex data collections.")
1289 (license (license:x11-style
1290 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1292 (define-public hdf5-1.10
1299 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1300 "hdf5-" (version-major+minor version)
1301 "/hdf5-" version "/src/hdf5-"
1303 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1305 (apply string-append
1306 (take (string-split version #\.) 2))
1307 "/src/hdf5-" version ".tar.bz2")))
1309 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1310 (patches (search-patches "hdf5-config-date.patch"))))))
1312 (define-public hdf5-1.12
1319 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1320 "hdf5-" (version-major+minor version)
1321 "/hdf5-" version "/src/hdf5-"
1323 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1325 (apply string-append
1326 (take (string-split version #\.) 2))
1327 "/src/hdf5-" version ".tar.bz2")))
1329 (base32 "074g3z504xf77ff38igs30i1aqxpm508p7yw78ykva7dncrgbyda"))
1330 (patches (search-patches "hdf5-config-date.patch"))))))
1333 ;; Default version of HDF5.
1336 (define-public hdf-java
1344 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1345 version "/src/CMake-hdfjava-" version ".tar.gz"))
1347 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1348 (modules '((guix build utils)))
1349 (snippet ; Make sure we don't use the bundled sources and binaries.
1351 (for-each delete-file
1352 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1353 "HDF4.tar.gz" "HDF5.tar.gz"))
1354 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1356 (build-system gnu-build-system)
1358 `(("jdk" ,icedtea "jdk")
1359 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1361 ("hamcrest-core" ,java-hamcrest-core)
1362 ("junit" ,java-junit)
1363 ("slf4j-simple" ,java-slf4j-simple)))
1368 ("libjpeg" ,libjpeg-turbo)
1369 ("slf4j-api" ,java-slf4j-api)))
1372 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1373 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1374 (assoc-ref %build-inputs "jdk") "/lib" )
1375 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1376 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1379 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1380 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1381 (string-append "ZLIB=" (search-input-file %build-inputs "/lib/libz.so"))
1382 (string-append "JPEGLIB="
1383 (search-input-file %build-inputs "/lib/libjpeg.so"))
1387 (modify-phases %standard-phases
1388 (add-before 'configure 'chdir-to-source
1389 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1390 (add-before 'configure 'patch-build
1391 (lambda* (#:key inputs outputs #:allow-other-keys)
1392 (substitute* "configure"
1393 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1394 (("/bin/cat") (which "cat")))
1395 ;; Set classpath for compilation
1396 (substitute* '("hdf/hdf5lib/Makefile.in"
1397 "hdf/hdf5lib/exceptions/Makefile.in"
1398 "hdf/hdflib/Makefile.in")
1399 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1400 ;; 'slf4j-api-X.Y.Z.jar' is installed in a Maven-style
1401 ;; directory, so use 'find-files' to find it.
1402 (car (find-files (assoc-ref inputs "slf4j-api")
1403 "^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 (car (find-files (assoc-ref inputs i)
1432 (string-append "^" i
1434 '("slf4j-api" "slf4j-simple"))
1436 (car (find-files (assoc-ref inputs "junit") "jar$"))
1437 (car (find-files (assoc-ref inputs "hamcrest-core")
1440 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1442 (substitute* '("test/hdf5lib/Makefile.in"
1443 "test/hdf5lib/junit.sh.in"
1444 "examples/runExample.sh.in")
1446 (search-input-file inputs "/bin/test"))
1448 (search-input-file inputs "/bin/uname"))
1449 (("CLASSPATH=[^\n]*")
1450 (string-append "CLASSPATH=" class-path)))
1451 (setenv "CLASSPATH" class-path))
1453 (add-before 'check 'build-examples
1455 (apply invoke `("javac"
1456 ,@(find-files "examples" ".*\\.java"))))))
1458 #:parallel-build? #f
1460 #:parallel-tests? #f ))
1461 (home-page "https://support.hdfgroup.org/products/java")
1462 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1463 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1464 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1467 ;; BSD-style license:
1468 (license (license:x11-style
1469 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1470 /current/src/unpacked/COPYING"))))
1472 (define-public hdf-eos2
1479 (uri "ftp://edhs1.gsfc.nasa.gov\
1480 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1482 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1483 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1484 "hdf-eos2-build-shared.patch"
1485 "hdf-eos2-fortrantests.patch"))))
1486 (build-system gnu-build-system)
1490 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1491 ;; XXX: These inputs are really dependencies of hdf4.
1493 ("libjpeg" ,libjpeg-turbo)
1494 ("libtirpc" ,libtirpc)
1498 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1499 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1500 #:parallel-tests? #f))
1501 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1502 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1503 (description "HDF-EOS2 is a software library built on HDF4 which supports
1504 the construction of data structures used in NASA's Earth Observing
1505 System (Grid, Point and Swath).")
1507 ;; Source files carry a permissive license header.
1508 (license (license:non-copyleft home-page))))
1510 (define-public hdf-eos5
1516 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1517 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1520 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1521 (patches (search-patches "hdf-eos5-build-shared.patch"
1522 "hdf-eos5-remove-gctp.patch"
1523 "hdf-eos5-fix-szip.patch"
1524 "hdf-eos5-fortrantests.patch"))))
1527 (build-system gnu-build-system)
1529 (list hdf5-1.8 zlib gctp))
1531 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1532 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1533 #:parallel-tests? #f))
1534 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1536 "HDF-EOS5 is a software library built on HDF5 to support the construction
1537 of data structures used in NASA's Earth Observing System (Grid, Point and
1539 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1541 ;; Source files carry a permissive license header.
1542 (license (license:non-copyleft home-page))))
1544 (define-public hdf5-parallel-openmpi
1545 (package/inherit hdf5-1.10 ;use the latest
1546 (name "hdf5-parallel-openmpi")
1549 ,@(package-inputs hdf5)))
1551 (substitute-keyword-arguments (package-arguments hdf5)
1552 ((#:configure-flags flags)
1553 ``("--enable-parallel"
1554 ,@(delete "--enable-cxx"
1555 (delete "--enable-threadsafe" ,flags))))
1557 `(modify-phases ,phases
1558 (add-after 'build 'mpi-setup
1560 (add-before 'check 'patch-tests
1562 ;; OpenMPI's mpirun will exit with non-zero status if it
1563 ;; detects an "abnormal termination", i.e. any process not
1564 ;; calling MPI_Finalize(). Since the test is explicitly
1565 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1566 ;; H5C_flush_cache from being called, mpirun will always
1567 ;; complain, so turn this test off.
1568 (substitute* "testpar/Makefile"
1569 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1570 (string-append front back "\n")))
1571 (substitute* "tools/test/h5diff/testph5diff.sh"
1572 (("/bin/sh") (which "sh")))
1574 (synopsis "Management suite for data with parallel IO support")))
1576 (define-public hdf5-blosc
1584 (url "https://github.com/Blosc/hdf5-blosc")
1585 (commit (string-append "v" version))))
1586 (file-name (git-file-name name version))
1588 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1589 (build-system cmake-build-system)
1592 (list (string-append "-DBLOSC_INSTALL_DIR="
1593 (assoc-ref %build-inputs "c-blosc"))
1594 (string-append "-DPLUGIN_INSTALL_PATH="
1595 (assoc-ref %outputs "out")
1596 "/hdf5/lib/plugin"))
1598 (modify-phases %standard-phases
1599 (add-after 'unpack 'do-not-build-blosc
1601 (substitute* "CMakeLists.txt"
1602 (("set\\(BLOSC_INSTALL_DIR.*") "")
1603 (("ExternalProject_Add\\(project_blosc") "message("))
1606 (list c-blosc hdf5-1.10))
1607 (home-page "https://github.com/Blosc/hdf5-blosc")
1608 (synopsis "Filter for HDF5 using the Blosc compressor")
1609 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1610 installing this filter, you can read and write HDF5 files with
1611 Blosc-compressed datasets.")
1612 (license license:expat)))
1614 (define-public h5check
1621 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1622 "h5check/src/h5check-" version ".tar.gz"))
1625 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1626 (build-system gnu-build-system)
1627 (inputs (list hdf5-1.8)) ;h5cc for tests
1628 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1629 (synopsis "HDF5 format checker")
1630 (description "@code{h5check} is a validation tool for verifying that an
1631 HDF5 file is encoded according to the HDF File Format Specification.")
1632 (license (license:x11-style "file://COPYING"))))
1640 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1645 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1646 (build-system cmake-build-system)
1647 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1648 (inputs (list lapack fftw))
1649 ;; FIXME: Even though the fonts are available dvips complains:
1650 ;; "Font cmmi10 not found; characters will be left blank."
1652 `(("texlive" ,texlive-tiny)
1653 ("ghostscript" ,ghostscript)
1654 ("doxygen" ,doxygen)))
1655 (home-page "http://itpp.sourceforge.net")
1656 (synopsis "C++ library of maths, signal processing and communication classes")
1657 (description "IT++ is a C++ library of mathematical, signal processing and
1658 communication classes and functions. Its main use is in simulation of
1659 communication systems and for performing research in the area of
1660 communications. The kernel of the library consists of generic vector and
1661 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1662 similar to MATLAB, GNU Octave or SciPy.")
1663 (license license:gpl3+)))
1665 (define-public netcdf
1673 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1674 "netcdf-c-" version ".tar.gz"))
1677 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1678 (modules '((guix build utils)))
1680 ;; Make sure this variable is defined only once. Failing to do so
1681 ;; would break builds of 'netcdf-parallel-openmpi' with a
1682 ;; multiple-definition link error with GCC 10.
1683 '(substitute* "ncdump/ocprint.c"
1684 (("^int ocdebug") "static int ocdebug")))
1685 (patches (search-patches "netcdf-date-time.patch"))))
1686 (build-system gnu-build-system)
1688 (list m4 doxygen graphviz))
1690 `(("hdf4" ,hdf4-alt)
1694 ("libjpeg" ,libjpeg-turbo)))
1696 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1698 #:phases (modify-phases %standard-phases
1699 (add-before 'configure 'fix-source-date
1701 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1702 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1703 ;; to '1st hour of the current day', and therefore makes the
1704 ;; package not reproducible.
1705 (substitute* "./configure"
1706 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1707 "date --date='@0'"))
1709 (add-after 'configure 'patch-settings
1711 ;; libnetcdf.settings contains the full filename of the compilers
1712 ;; used to build the library. We truncate the hashes of those
1713 ;; filenames to avoid unnecessary references to the corresponding
1715 (substitute* "libnetcdf.settings"
1716 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1717 (string-append prefix (string-take hash 10) "...")))
1720 #:parallel-tests? #f)) ;various race conditions
1721 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1722 (synopsis "Library for scientific data")
1723 (description "NetCDF is an interface for scientific data access and a
1724 software library that provides an implementation of the interface. The netCDF
1725 library defines a machine-independent format for representing scientific data.
1726 Together, the interface, library, and format support the creation, access, and
1727 sharing of scientific data.")
1728 (license (license:x11-style "file://COPYRIGHT"))))
1730 (define-public netcdf-parallel-openmpi
1731 (package (inherit netcdf)
1732 (name "netcdf-parallel-openmpi")
1735 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1736 (package-inputs netcdf))))
1737 ;; TODO: Replace pkg-config references in nc-config with absolute references
1739 (substitute-keyword-arguments (package-arguments netcdf)
1740 ((#:configure-flags flags)
1741 `(cons* "CC=mpicc" "CXX=mpicxx"
1742 "--enable-parallel-tests"
1743 ;; Shared libraries not supported with parallel IO.
1744 "--disable-shared" "--with-pic"
1746 ((#:phases phases '%standard-phases)
1747 `(modify-phases ,phases
1748 (add-after 'build 'mpi-setup
1749 ,%openmpi-setup)))))))
1751 (define-public netcdf-fortran
1753 (name "netcdf-fortran")
1758 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1762 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1763 (build-system gnu-build-system)
1765 `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
1766 "FFLAGS=-fallow-argument-mismatch")
1767 #:parallel-tests? #f))
1772 (synopsis "Fortran interface for the netCDF library")
1773 (description (package-description netcdf))
1774 (home-page (package-home-page netcdf))
1775 (license (package-license netcdf))))
1777 (define-public nlopt
1783 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1786 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1787 (build-system gnu-build-system)
1789 `(;; Shared libraries are not built by default. They are required to
1790 ;; build the Guile, Octave, and Python bindings.
1791 #:configure-flags '("--enable-shared")
1794 (modify-phases %standard-phases
1795 (add-before 'configure 'set-libnlopt-file-name
1796 (lambda* (#:key outputs #:allow-other-keys)
1797 ;; Make sure the Scheme module refers to the library by its
1798 ;; absolute file name (we cannot do that from a snippet
1799 ;; because the expansion of @libdir@ contains
1801 (let ((out (assoc-ref outputs "out")))
1802 (substitute* "swig/nlopt.scm.in"
1804 (string-append out "/lib/libnlopt")))
1806 (inputs (list guile-2.0))
1807 (native-inputs (list pkg-config))
1808 (home-page "http://ab-initio.mit.edu/wiki/")
1809 (synopsis "Library for nonlinear optimization")
1810 (description "NLopt is a library for nonlinear optimization, providing a
1811 common interface for a number of different free optimization routines available
1812 online as well as original implementations of various other algorithms.")
1813 (license license:lgpl2.1+)))
1815 (define-public ipopt
1822 (url "https://github.com/coin-or/Ipopt")
1823 (commit (string-append "releases/" version))))
1824 (file-name (git-file-name name version))
1827 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1828 (build-system gnu-build-system)
1830 '(#:phases (modify-phases %standard-phases
1831 (add-after 'install 'add--L-flags-in-ipopt.pc
1832 (lambda* (#:key inputs outputs #:allow-other-keys)
1833 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1834 ;; move it to "Libs.private" where it belongs, and add a
1835 ;; '-L' flag for LAPACK.
1836 (let ((out (assoc-ref outputs "out"))
1837 (lapack (assoc-ref inputs "lapack")))
1838 (substitute* (string-append out "/lib/pkgconfig/"
1840 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1841 (string-append "Libs: " before " " after "\n"
1842 "Libs.private: " before
1843 "-L" lapack "/lib -llapack -lblas "
1847 (list gfortran pkg-config))
1849 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1850 (list lapack)) ;for both libblas and liblapack
1851 (home-page "https://www.coin-or.org")
1852 (synopsis "Large-scale nonlinear optimizer")
1854 "The Interior Point Optimizer (IPOPT) is a software package for
1855 large-scale nonlinear optimization. It provides C++, C, and Fortran
1857 (license license:epl2.0)))
1859 (define-public nomad-optimizer
1861 (name "nomad-optimizer")
1867 (url "https://github.com/bbopt/nomad/")
1868 (commit (string-append "v" version))))
1869 (file-name (git-file-name name version))
1872 "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
1873 (build-system cmake-build-system)
1875 `(("python" ,python-wrapper)
1876 ("python-cython" ,python-cython)))
1878 `(#:imported-modules ((guix build python-build-system)
1879 ,@%cmake-build-system-modules)
1880 #:modules (((guix build python-build-system)
1881 #:select (python-version site-packages))
1882 (guix build cmake-build-system)
1885 '("-DBUILD_INTERFACES=ON"
1888 (modify-phases %standard-phases
1889 (add-after 'unpack 'fix-sources-for-build
1890 (lambda* (#:key outputs #:allow-other-keys)
1891 (substitute* "CMakeLists.txt"
1892 ;; CMAKE_INSTALL_PREFIX is accidentally hardcoded.
1893 (("set\\(CMAKE_INSTALL_PREFIX .* FORCE\\)") "")
1894 ;; Requiring GCC version 8 or later is unwarranted.
1895 (("message\\(FATAL_ERROR \"GCC version < 8")
1896 "message(STATUS \"GCC version < 8"))
1898 (let ((out (assoc-ref outputs "out")))
1899 (substitute* "interfaces/PyNomad/CMakeLists.txt"
1900 ;; We don't want to build in-place, and anyway the install
1901 ;; command further below runs build_ext as a prerequisite.
1902 (("COMMAND python setup_PyNomad\\.py .* build_ext --inplace\n")
1904 ;; Don't install locally.
1905 (("COMMAND python (setup_PyNomad\\.py .* install) --user\n"
1907 (string-append "COMMAND ${CMAKE_COMMAND} -E env"
1908 " CC=" ,(cc-for-target)
1909 " CXX=" ,(cxx-for-target)
1910 " " (which "python")
1914 ;; Fix erroneous assumptions about the paths of the include and
1915 ;; library directories.
1916 (substitute* "interfaces/PyNomad/setup_PyNomad.py"
1917 (("^( +os_include_dirs = ).*" _ prefix)
1918 (string-append prefix "[\"../../src\"]\n"))
1919 (("^(installed_lib_dir = ).*" _ prefix)
1920 (string-append prefix "\"" out "/lib\"\n"))))
1923 ;; Fix the tests so they run in out-of-source builds.
1924 (add-after 'fix-sources-for-build 'fix-sources-for-tests
1927 (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
1929 (map (lambda (d) (string-append "basic/library/" d))
1930 '("example1" "example2" "example3"
1931 "single_obj_parallel"))
1932 (map (lambda (d) (string-append "advanced/library/" d))
1933 '("FixedVariable" "NMonly" "PSDMads" "Restart"
1934 "c_api/example1" "c_api/example2"
1935 "exampleSuggestAndObserve"))))
1936 ;; The built examples are assumed to be in the source tree
1937 ;; (which isn't the case here).
1938 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
1940 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
1941 ;; (Unrelated to support for out-of-source testing.)
1943 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
1945 (let* ((builddir (string-append (getcwd) "/../build"))
1946 ;; The BB_EXE and SURROGATE_EXE paths are interpreted
1947 ;; relative to the configuration file provided to NOMAD.
1948 ;; However, the configuration files are all in the source
1949 ;; tree rather than in the build tree (unlike the compiled
1951 (fix-exe-path (lambda* (dir #:optional
1954 (substitute* (string-append dir "/" file)
1955 (((string-append "^" exe-opt " +"))
1956 ;; The $ prevents NOMAD from prefixing
1957 ;; the executable with the path of the
1958 ;; parent directory of the configuration
1959 ;; file NOMAD was provided with as
1960 ;; argument (param.txt or some such).
1961 (string-append exe-opt " $"
1962 builddir "/" dir "/"))))))
1965 (let ((dir (string-append "examples/" dir)))
1966 (substitute* (string-append dir "/CMakeLists.txt")
1967 ;; The install phase has not yet run.
1968 (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
1969 "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
1971 (when (equal? dir "examples/basic/batch/surrogate_sort")
1972 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
1973 (append (map (lambda (d) (string-append "basic/batch/" d))
1974 '("example1" "example2"
1975 "single_obj" "single_obj_parallel"
1977 '("advanced/batch/LHonly")))
1979 (let ((dir "examples/advanced/batch/FixedVariable"))
1980 (substitute* (string-append dir "/runFixed.sh")
1981 ;; Hardcoded path to NOMAD executable.
1982 (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
1983 (string-append builddir "/src/nomad ")))
1985 (lambda (f) (fix-exe-path dir f))
1986 '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))
1989 ;; The information in the .egg-info file is not kept up to date.
1990 (add-after 'install 'delete-superfluous-egg-info
1991 (lambda* (#:key inputs outputs #:allow-other-keys)
1992 (delete-file (string-append
1993 (site-packages inputs outputs)
1995 (python-version (assoc-ref inputs "python"))
1998 (home-page "https://www.gerad.ca/nomad/")
1999 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
2001 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
2002 algorithm, designed for difficult blackbox optimization problems. These
2003 problems occur when the functions defining the objective and constraints are
2004 the result of costly computer simulations.")
2005 (license license:lgpl3+)))
2013 (uri (string-append "https://www.coin-or.org/download/source/"
2014 "Cbc/Cbc-" version ".tgz"))
2017 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
2018 (modules '((guix build utils)))
2020 ;; Make sure we don't use the bundled software.
2021 '(delete-file-recursively "ThirdParty"))))
2022 (build-system gnu-build-system)
2024 (list gfortran pkg-config))
2027 (home-page "https://www.coin-or.org")
2028 (synopsis "Branch-and-cut solver")
2030 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
2031 solver written in C++. It can be used as a library or as a standalone
2033 (license license:epl1.0)))
2041 (uri (string-append "https://www.coin-or.org/download/source/"
2042 "Clp/Clp-" version ".tgz"))
2045 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
2046 (modules '((guix build utils)))
2048 ;; Make sure we don't use the bundled software.
2050 (delete-file-recursively "ThirdParty")
2052 (build-system gnu-build-system)
2054 (list gfortran pkg-config))
2057 (home-page "https://www.coin-or.org")
2058 (synopsis "Linear programming solver")
2060 "CLP is a high quality linear programming solver. Its main strengths are
2061 its dual and primal Simplex algorithms. It also has a barrier algorithm for
2062 linear and quadratic objectives. There are limited facilities for nonlinear
2063 and quadratic objectives using the Simplex algorithm.")
2064 (license license:epl1.0)))
2066 (define-public gecode
2073 (url "https://github.com/Gecode/gecode")
2074 (commit (string-append "release-" version))))
2075 (file-name (git-file-name name version))
2078 "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
2079 (modules '((guix build utils)))
2082 ;; delete generated sources
2083 (for-each delete-file
2084 '("gecode/kernel/var-imp.hpp"
2085 "gecode/kernel/var-type.hpp"))))))
2086 (outputs '("out" "examples"))
2087 (build-system gnu-build-system)
2090 (list (string-append "GLDFLAGS=-Wl,-rpath="
2091 (assoc-ref %outputs "out")
2093 "--enable-examples=no")
2094 #:modules ((guix build gnu-build-system)
2099 (modify-phases %standard-phases
2100 (add-after 'build 'build-examples
2101 (lambda* (#:key outputs #:allow-other-keys)
2102 (invoke "make" "compileexamples")))
2103 ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
2104 ;; patch it ourselves... *sigh*
2105 (add-after 'install 'fix-rpath
2106 (lambda* (#:key outputs #:allow-other-keys)
2107 (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
2110 (let* ((pipe (open-pipe* OPEN_READ "patchelf"
2111 "--print-rpath" file))
2112 (line (read-line pipe)))
2113 (and (zero? (close-pipe pipe))
2114 (invoke "patchelf" "--set-rpath"
2115 (string-append libdir ":" line)
2117 (find-files libdir ".*\\.so$")))))
2118 (add-after 'install 'install-examples
2119 (lambda* (#:key outputs #:allow-other-keys)
2120 (invoke "make" "installexamples"
2121 (string-append "bindir=" (assoc-ref outputs "examples")
2123 ;; Tests depend on installed libraries.
2125 (add-after 'fix-rpath 'check
2126 (assoc-ref %standard-phases 'check)))))
2128 (list patchelf perl sed))
2129 (home-page "https://www.gecode.org")
2130 (synopsis "Toolkit for developing constraint-based systems")
2131 (description "Gecode is a C++ toolkit for developing constraint-based
2132 systems and applications. It provides a modular and extensible solver.")
2133 (license license:expat)))
2135 (define-public libflame
2139 (outputs '("out" "static"))
2144 (url "https://github.com/flame/libflame")
2146 (file-name (git-file-name name version))
2149 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
2150 (build-system gnu-build-system)
2153 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
2154 (list "--enable-dynamic-build"
2155 "--enable-max-arg-list-hack"
2156 "--enable-lapack2flame"
2157 "--enable-verbose-make-output"
2158 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
2159 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
2162 '("--enable-vector-intrinsics=sse")
2164 "--enable-supermatrix"
2165 "--enable-memory-alignment=16"
2166 "--enable-ldim-alignment")
2168 (modify-phases %standard-phases
2169 (add-after 'unpack 'patch-/usr/bin/env-bash
2171 (substitute* "build/config.mk.in"
2172 (("/usr/bin/env bash") (which "bash")))
2175 (lambda* (#:key tests? #:allow-other-keys)
2176 (substitute* "test/Makefile"
2177 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
2178 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
2180 (with-directory-excursion "test"
2183 (invoke "./test_libflame.x"))
2185 (add-after 'install 'install-static
2186 (lambda* (#:key outputs #:allow-other-keys)
2187 (let ((out (assoc-ref outputs "out"))
2188 (static (assoc-ref outputs "static")))
2189 (mkdir-p (string-append static "/lib"))
2190 (rename-file (string-append out "/lib/libflame.a")
2191 (string-append static "/lib/libflame.a"))
2192 (install-file (string-append out "/include/FLAME.h")
2193 (string-append static "/include"))
2198 `(("lapack" ,lapack)
2199 ("openblas" ,openblas)
2201 ("python" ,python-wrapper)))
2202 (home-page "https://github.com/flame/libflame")
2203 (synopsis "High-performance object-based library for DLA computations")
2204 (description "@code{libflame} is a portable library for dense matrix
2205 computations, providing much of the functionality present in LAPACK, developed
2206 by current and former members of the @acronym{SHPC, Science of High-Performance
2207 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
2208 Computational Engineering and Sciences} at The University of Texas at Austin.
2209 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
2210 includes a complete LAPACK implementation.")
2211 (license license:bsd-3)))
2213 (define-public libpotassco
2214 ;; No public release, update together with clasp
2215 (let ((revision "1")
2216 (commit "2f9fb7ca2c202f1b47643aa414054f2f4f9c1821"))
2218 (name "libpotassco")
2219 (version (git-version "0.0" revision commit))
2223 (url "https://github.com/potassco/libpotassco")
2225 (file-name (git-file-name name version))
2228 "1c32f9gqclf7qx07lpx8wd720vfhkjqhzc6nyy8mjmgwpmb3iyyn"))))
2230 `(#:configure-flags '("-DLIB_POTASSCO_BUILD_TESTS=on"
2231 "-DLIB_POTASSCO_INSTALL_LIB=on"
2232 "-DBUILD_SHARED_LIBS=on")
2234 (modify-phases %standard-phases
2235 (add-after 'unpack 'patch-cmake
2237 (substitute* "CMakeLists.txt"
2238 ;; clasp expects lowercase potassco and include directory is
2239 ;; lowercase as well, so let's use that
2240 (("\"cmake/Potassco\"") "\"cmake/potassco\"")
2241 (("PotasscoConfig\\.cmake") "potassco-config.cmake")
2242 (("PotasscoConfigVersion\\.cmake")
2243 "potassco-config-version.cmake"))
2244 (rename-file "cmake/PotasscoConfig.cmake.in"
2245 "cmake/potassco-config.cmake.in"))))))
2246 (build-system cmake-build-system)
2247 (home-page "https://potassco.org/")
2248 (synopsis "Utility library for Potassco's projects")
2249 (description "@code{libpotassco} is a utility library providing functions
2252 @item parsing, writing, and converting logic programs in aspif and smodels
2254 @item passing information between a grounder and a solver,
2255 @item and defining and parsing command-line options and for creating
2256 command-line applications.
2258 Furthermore, it comes with the tool @command{lpconvert} that converts either
2259 between aspif and smodels format or to a human-readable text format.")
2260 (license license:expat))))
2262 (define-public clasp
2269 (url "https://github.com/potassco/clasp")
2270 (commit (string-append "v" version))))
2271 (file-name (git-file-name name version))
2274 "0rahqiq530jckvx717858h1q5p8znp1kb6sjm95p8blkr4n3pvmj"))))
2275 (build-system cmake-build-system)
2277 `(#:configure-flags '("-DCLASP_BUILD_TESTS=on"
2278 "-DCLASP_INSTALL_LIB=on"
2279 "-DCLASP_USE_LOCAL_LIB_POTASSCO=off"
2280 "-DBUILD_SHARED_LIBS=on")
2282 (modify-phases %standard-phases
2283 (add-after 'unpack 'patch-cmake
2285 (substitute* "CMakeLists.txt"
2286 ;; Use lowercase to be consistent with libpotassco
2287 (("\"cmake/Clasp\"") "\"cmake/clasp\"")
2288 (("ClaspConfig\\.cmake") "clasp-config.cmake")
2289 (("ClaspConfigVersion\\.cmake")
2290 "clasp-config-version.cmake"))
2291 (substitute* "cmake/ClaspConfig.cmake.in"
2292 (("find_package\\(Potassco") "find_package(potassco"))
2293 (rename-file "cmake/ClaspConfig.cmake.in"
2294 "cmake/clasp-config.cmake.in"))))))
2297 (home-page "https://potassco.org/")
2298 (synopsis "Answer set solver")
2299 (description "clasp is an answer set solver for (extended) normal and
2300 disjunctive logic programs. The primary algorithm of clasp relies on
2301 conflict-driven nogood learning, a technique that proved very successful for
2302 satisfiability checking (SAT).")
2303 (license license:expat)))
2305 (define-public clingo
2312 (url "https://github.com/potassco/clingo")
2313 (commit (string-append "v" version))))
2314 (file-name (git-file-name name version))
2317 "0rfjwkcwm0mmf3r4i7asyjwb6cia4i7px7fn2kdbi9j85qvas4pb"))))
2318 (build-system cmake-build-system)
2320 `(#:configure-flags `("-DCLINGO_BUILD_TESTS=on"
2321 "-DCLINGO_INSTALL_LIB=on"
2322 "-DCLINGO_BUILD_STATIC=off"
2323 "-DCLINGO_BUILD_SHARED=on"
2324 ;; XXX: Clingo requries private headers and
2325 ;; sources from clasp
2327 "-DCLASP_SOURCE_DIR="
2328 (assoc-ref %build-inputs "clasp-src")))
2330 (modify-phases %standard-phases
2331 (add-after 'unpack 'patch-cmake
2333 (substitute* "CMakeLists.txt"
2334 (("add_subdirectory\\(clasp\\)")
2335 "find_package(clasp REQUIRED)"))
2336 (substitute* "libclingo/CMakeLists.txt"
2337 (("\"cmake/Clingo\"") "\"cmake/clingo\"")
2338 (("ClingoConfig\\.cmake") "clingo-config.cmake")
2339 (("ClingoConfigVersion\\.cmake")
2340 "clingo-config-version.cmake"))
2341 (substitute* "cmake/ClingoConfig.cmake.in"
2342 (("find_package\\(Clasp") "find_package(clasp"))
2343 (rename-file "cmake/ClingoConfig.cmake.in"
2344 "cmake/clingo-config.cmake.in")))
2345 (add-after 'unpack 'skip-failing-tests
2347 (with-directory-excursion "libclingo/tests"
2348 (substitute* "CMakeLists.txt"
2349 (("COMMAND test_clingo" all)
2352 "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\"")))
2353 (call-with-output-file "good.txt"
2355 (for-each (lambda (test) (format port "~s~%" test))
2356 '("parse-ast-v2" "add-ast-v2" "build-ast-v2"
2357 "unpool-ast-v2" "parse_term"
2358 "propagator" "propgator-sequence-mining"
2359 "symbol" "visitor"))))))))))
2361 (list clasp libpotassco))
2363 `(("clasp-src" ,(package-source clasp))))
2364 (home-page "https://potassco.org/")
2365 (synopsis "Grounder and solver for logic programs")
2366 (description "Clingo computes answer sets for a given logic program.")
2367 (license license:expat)))
2369 (define-public ceres
2371 (name "ceres-solver")
2373 (home-page "http://ceres-solver.org/")
2376 (uri (string-append home-page "ceres-solver-"
2380 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
2381 (build-system cmake-build-system)
2383 ;; TODO: Build HTML user documentation and install separately.
2384 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
2385 "-DBUILD_SHARED_LIBS=ON")
2387 #:phases (modify-phases %standard-phases
2388 (add-before 'configure 'set-library-directory
2390 ;; Install libraries to lib/, not lib64/.
2391 (substitute* "CMakeLists.txt"
2392 (("set\\(LIB_SUFFIX \"64\"\\)")
2393 "set(LIB_SUFFIX \"\")")))))))
2397 (list glog)) ;for #include <glog/glog.h>
2402 ("suitesparse" ,suitesparse)
2403 ("gflags" ,gflags)))
2404 (synopsis "C++ library for solving large optimization problems")
2406 "Ceres Solver is a C++ library for modeling and solving large,
2407 complicated optimization problems. It is a feature rich, mature and
2408 performant library which has been used in production since 2010. Ceres Solver
2409 can solve two kinds of problems:
2411 @item non-linear least squares problems with bounds constraints;
2412 @item general unconstrained optimization problems.
2414 (license license:bsd-3)))
2416 ;; For a fully featured Octave, users are strongly recommended also to install
2417 ;; the following packages: less, ghostscript, gnuplot.
2418 (define-public octave-cli
2425 (uri (string-append "mirror://gnu/octave/octave-"
2429 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2430 (build-system gnu-build-system)
2432 `(("alsa-lib" ,alsa-lib)
2433 ("arpack" ,arpack-ng)
2439 ("fontconfig" ,fontconfig)
2440 ("freetype" ,freetype)
2444 ("graphicsmagick" ,graphicsmagick)
2446 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2447 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2448 ;; libtiff.la instead of having to provide it here.
2449 ("libjpeg" ,libjpeg-turbo)
2453 ("libsndfile" ,libsndfile)
2457 ("portaudio" ,portaudio)
2459 ("readline" ,readline)
2460 ("suitesparse" ,suitesparse)
2461 ("texinfo" ,texinfo)
2467 ;; The following inputs are not actually used in the build process.
2468 ;; However, the ./configure gratuitously tests for their existence and
2469 ;; assumes that programs not present at build time are also not, and
2470 ;; can never be, available at run time! If these inputs are therefore
2471 ;; not present, support for them will be built out. However, Octave
2472 ;; will still run without them, albeit without the features they
2477 ;; Octave code uses this variable to detect directories holding multiple CA
2478 ;; certificates to verify peers with. This is required for the networking
2479 ;; functions that require encryption to work properly.
2480 (native-search-paths
2481 (list (search-path-specification
2482 (variable "CURLOPT_CAPATH")
2483 (files '("etc/ssl/certs")))))
2486 (list (string-append "--with-shell="
2487 (assoc-ref %build-inputs "bash")
2490 ;; XXX: Without this flag, linking octave-cli fails with
2491 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2492 ;; not pulling in liboctinterp.la for -lstdc++.
2493 "--enable-link-all-dependencies")
2495 (modify-phases %standard-phases
2496 (add-after 'configure 'configure-makeinfo
2497 (lambda* (#:key inputs #:allow-other-keys)
2498 (substitute* "libinterp/corefcn/help.h"
2501 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2503 (home-page "https://www.gnu.org/software/octave/")
2504 (synopsis "High-level language for numerical computation (no GUI)")
2505 (description "GNU Octave is a high-level interpreted language that is
2506 specialized for numerical computations. It can be used for both linear and
2507 non-linear applications and it provides great support for visualizing results.
2508 Work may be performed both at the interactive command-line as well as via
2510 (license license:gpl3+)))
2512 (define-public octave
2513 (package (inherit octave-cli)
2516 `(("qscintilla" ,qscintilla)
2518 ,@(package-inputs octave-cli)))
2520 `(("qttools" , qttools) ;for lrelease
2521 ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
2522 ,@(package-native-inputs octave-cli)))
2524 (substitute-keyword-arguments (package-arguments octave-cli)
2526 `(modify-phases ,phases
2527 (add-before 'configure 'patch-qscintilla-library-name
2528 (lambda* (#:key inputs #:allow-other-keys)
2529 ;; The QScintilla library that the Octave configure script tries
2530 ;; to link with should be named libqscintilla-qt5.so, but the
2531 ;; QScintilla input provides the shared library as
2532 ;; libqscintilla2_qt5.so.
2533 (substitute* "configure"
2534 (("qscintilla2-qt5")
2537 (synopsis "High-level language for numerical computation (with GUI)")))
2539 (define-public opencascade-oce
2541 (name "opencascade-oce")
2547 (url "https://github.com/tpaviot/oce")
2548 (commit (string-append "OCE-" version))))
2549 (file-name (git-file-name name version))
2550 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2552 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2553 (build-system cmake-build-system)
2556 (list "-DOCE_TESTING:BOOL=ON"
2557 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2558 "-DOCE_DRAW:BOOL=ON"
2559 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2560 (assoc-ref %outputs "out"))
2561 "-UCMAKE_INSTALL_RPATH")))
2570 `(("python" ,python-wrapper)))
2571 (home-page "https://github.com/tpaviot/oce")
2572 (synopsis "Libraries for 3D modeling and numerical simulation")
2574 "Open CASCADE is a set of libraries for the development of applications
2575 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2576 C++ class libraries providing services for 3D surface and solid modeling, CAD
2577 data exchange, and visualization. It is used for development of specialized
2578 software dealing with 3D models in design (CAD), manufacturing (CAM),
2579 numerical simulation (CAE), measurement equipment (CMM), and quality
2580 control (CAQ) domains.
2582 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2583 patches, improvements, and experiments contributed by users over the official
2584 Open CASCADE library.")
2585 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2586 ; use of header files; see
2587 ; OCCT_LGPL_EXCEPTION.txt
2588 license:public-domain; files
2589 ; src/Standard/Standard_StdAllocator.hxx and
2590 ; src/NCollection/NCollection_StdAllocator.hxx
2591 license:expat; file src/OpenGl/OpenGl_glext.h
2592 license:bsd-3)))); test framework gtest
2594 (define-public opencascade-occt
2596 (name "opencascade-occt")
2602 (url "https://git.dev.opencascade.org/repos/occt.git")
2605 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2607 (file-name (git-file-name name version))
2609 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2610 (modules '((guix build utils)))
2613 ;; Remove files specific to non-free operating systems.
2614 (delete-file-recursively "samples/ios")
2615 (delete-file-recursively "samples/mfc")
2616 (delete-file-recursively "samples/qt/FuncDemo")
2617 (delete-file "genconf.bat")
2618 (delete-file "gendoc.bat")
2619 (delete-file "genproj.bat")
2620 (delete-file "upgrade.bat")
2621 ;; Remove references to deleted files.
2622 (substitute* "dox/FILES_HTML.txt"
2623 ((".*standard.*") "" )
2624 ((".*UIKitSample.*") ""))
2626 (build-system cmake-build-system)
2628 '(;; There is no test target for make. OCCT provides an
2629 ;; 'Automated Testing System', which may be accessed after
2630 ;; installation via the draw.sh script. draw.sh is located in
2631 ;; the bin directory. For details see:
2632 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2633 ;; occt_dev_guides__tests.html
2635 ;; Configure without freeimage: attempting to link against the
2636 ;; freeimage version 3.17 library leads to 'undefined
2637 ;; reference' errors.
2639 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2641 "-DUSE_VTK:BOOL=OFF"
2642 "-DBUILD_DOC_Overview:BOOL=OFF"
2643 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2644 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2645 "-UCMAKE_INSTALL_LIBDIR")))
2648 ;("freeimage" ,freeimage)
2658 ;; TODO: build Overview documentation and add 'doc' output.
2659 (home-page "https://www.opencascade.com")
2660 (synopsis "Libraries for 3D modeling and numerical simulation")
2662 "Open CASCADE is a set of libraries for the development of applications
2663 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2664 C++ class libraries providing services for 3D surface and solid modeling, CAD
2665 data exchange, and visualization. It is used for development of specialized
2666 software dealing with 3D models in design (CAD), manufacturing (CAM),
2667 numerical simulation (CAE), measurement equipment (CMM), and quality
2668 control (CAQ) domains.
2670 This is the certified version of the Open Cascade Technology (OCCT) library.")
2671 (license (list ;; OCCT library:
2672 license:lgpl2.1; with an exception for the use of header
2673 ; files, see OCCT_LGPL_EXCEPTION.txt.
2674 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2675 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2677 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2678 ;; src/StepFile/step.tab.*:
2679 license:gpl3+ ; with Bison 2.2 exception.
2680 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2681 (license:non-copyleft
2682 "https://www.unicode.org/license.html")
2683 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2684 license:public-domain))))
2694 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2696 (string-append "gmsh_"
2697 (string-replace-substring version "." "_")))))
2698 (file-name (git-file-name name version))
2700 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2701 (modules '((guix build utils)))
2704 (delete-file-recursively "contrib/metis")
2706 (build-system cmake-build-system)
2720 `(("fontconfig" ,fontconfig)
2722 ("python" ,python)))
2724 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2725 "-DENABLE_BUILD_SHARED:BOOL=ON"
2726 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2727 #:imported-modules (,@%cmake-build-system-modules
2728 (guix build python-build-system))
2729 #:modules (((guix build python-build-system) #:select (site-packages))
2730 (guix build cmake-build-system)
2733 (modify-phases %standard-phases
2734 (add-after 'unpack 'patch-paths
2735 (lambda* (#:key inputs outputs #:allow-other-keys)
2736 ;; Use the standard Guix site-package path for
2737 ;; installation of the Python API.
2738 (substitute* "CMakeLists.txt"
2739 (("include\\(GNUInstallDirs\\)\n")
2740 (string-append "include(GNUInstallDirs)\n"
2742 (site-packages inputs outputs) ")\n"))
2743 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2744 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2745 ;; Find the shared library.
2746 (let ((libgmsh (string-append (assoc-ref outputs "out")
2747 "/lib/libgmsh.so")))
2748 (substitute* "api/gmsh.py"
2749 (("find_library\\(\"gmsh\"\\)")
2750 (simple-format #f "\"~a\"" libgmsh))))
2752 (home-page "http://gmsh.info/")
2753 (synopsis "3D finite element grid generator")
2754 (description "Gmsh is a 3D finite element grid generator with a built-in
2755 CAD engine and post-processor. Its design goal is to provide a fast, light
2756 and user-friendly meshing tool with parametric input and advanced
2757 visualization capabilities. Gmsh is built around four modules: geometry,
2758 mesh, solver and post-processing. The specification of any input to these
2759 modules is done either interactively using the graphical user interface or in
2760 ASCII text files using Gmsh's own scripting language.")
2761 (license license:gpl2+)))
2763 (define-public veusz
2770 (uri (pypi-uri "veusz" version))
2772 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2773 (build-system python-build-system)
2775 `(;; Tests will fail because they depend on optional packages like
2776 ;; python-astropy, which is not packaged.
2779 (modify-phases %standard-phases
2780 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2781 ;; the path is defined in Guix, therefore we have to change it.
2782 (add-after 'unpack 'fix-sip-dir
2784 (substitute* "pyqtdistutils.py"
2785 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2787 ;; Now we have to pass the correct sip_dir to setup.py.
2789 (lambda* (#:key inputs #:allow-other-keys)
2790 ;; We need to tell setup.py where to locate QtCoremod.sip
2791 ((@@ (guix build python-build-system) call-setuppy)
2793 (list (string-append "--sip-dir="
2794 (assoc-ref inputs "python-pyqt")
2797 ;; Ensure that icons are found at runtime.
2798 (add-after 'install 'wrap-executable
2799 (lambda* (#:key inputs outputs #:allow-other-keys)
2800 (let ((out (assoc-ref outputs "out")))
2801 (wrap-program (string-append out "/bin/veusz")
2802 `("QT_PLUGIN_PATH" prefix
2803 ,(list (string-append (assoc-ref inputs "qtsvg")
2804 "/lib/qt5/plugins/"))))))))))
2807 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2808 qttools python-sip-4))
2810 (list ghostscript ;optional, for EPS/PS output
2812 python-h5py ;optional, for HDF5 data
2817 (list python-numpy))
2818 (home-page "https://veusz.github.io/")
2819 (synopsis "Scientific plotting package")
2821 "Veusz is a scientific plotting and graphing program with a graphical
2822 user interface, designed to produce publication-ready 2D and 3D plots. In
2823 addition it can be used as a module in Python for plotting. It supports
2824 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2825 (license license:gpl2+)))
2827 (define-public maxflow
2830 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2831 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2836 (url "https://github.com/gerddie/maxflow")
2838 (file-name (git-file-name name version))
2841 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2842 (build-system cmake-build-system)
2843 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2844 (synopsis "Library implementing Maxflow algorithm")
2845 (description "An implementation of the maxflow algorithm described in
2846 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2847 Energy Minimization in Computer Vision.\n
2848 Yuri Boykov and Vladimir Kolmogorov.\n
2849 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2851 (license license:gpl3+)))
2853 (define-public petsc
2860 ;; The *-lite-* tarball does not contain the *large* documentation
2861 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2862 "petsc-lite-" version ".tar.gz"))
2864 (base32 "0sm03vpg010q9icidiq587n325m0598cj6hab2rdv85nwyygg74h"))))
2865 (outputs '("out" ; libraries and headers
2866 "examples")) ; ~30MiB of examples
2867 (build-system gnu-build-system)
2869 (list python which))
2871 (list gfortran openblas superlu
2872 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2873 ;; leaving out opengl, as configuration seems to only be for mac
2877 #:test-target "test"
2878 #:parallel-build? #f ; build is parallel by default
2880 #~(list "--with-mpi=0"
2883 (string-append "--with-openblas-dir="
2884 #$(this-package-input "openblas"))
2887 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2888 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2889 #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
2891 #~(modify-phases %standard-phases
2893 ;; PETSc's configure script is actually a python script, so we can't
2894 ;; run it with bash.
2895 (lambda* (#:key outputs (configure-flags '())
2897 (let* ((prefix (assoc-ref outputs "out"))
2898 (flags `(,(string-append "--prefix=" prefix)
2899 ,@configure-flags)))
2900 (format #t "build directory: ~s~%" (getcwd))
2901 (format #t "configure flags: ~s~%" flags)
2902 (apply invoke "./configure" flags)
2904 ;; Generate test scripts with the right shebang.
2905 (substitute* "config/example_template.py"
2906 (("#!/usr/bin/env bash")
2907 (string-append "#!" (which "bash")))))))
2908 (add-after 'configure 'clean-local-references
2909 (lambda* (#:key outputs #:allow-other-keys)
2910 (let ((out (assoc-ref outputs "out")))
2911 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2912 ;; Prevent build directory from leaking into compiled code
2914 ;; Scrub timestamp for reproducibility
2915 ((".*Libraries compiled on.*") ""))
2916 (substitute* (find-files "." "petscvariables")
2917 ;; Do not expose build machine characteristics, set to defaults.
2918 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2919 (("NPMAX = [:digit:]+") "NPMAX = 2")))))
2920 (add-after 'install 'clean-install
2921 ;; Try to keep installed files from leaking build directory names.
2922 (lambda* (#:key inputs outputs #:allow-other-keys)
2923 (let ((out (assoc-ref outputs "out")))
2924 (substitute* (map (lambda (file)
2925 (string-append out "/lib/petsc/conf/" file))
2926 '("petscvariables"))
2928 ;; Make compiler references point to the store
2929 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2930 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2931 (string-append "= " (which compiler))))
2932 ;; PETSc installs some build logs, which aren't necessary.
2933 (for-each (lambda (file)
2934 (let ((f (string-append out "/lib/petsc/conf/" file)))
2935 (when (file-exists? f)
2937 '("configure.log" "make.log" "gmake.log"
2938 "test.log" "error.log" "RDict.db"
2939 "PETScBuildInternal.cmake"
2940 ;; Once installed, should uninstall with Guix
2942 (add-after 'install 'move-examples
2943 (lambda* (#:key outputs #:allow-other-keys)
2944 (let* ((out (assoc-ref outputs "out"))
2945 (examples (assoc-ref outputs "examples"))
2946 (exdir (string-append out "/share/petsc/examples"))
2947 (exdir' (string-append examples "/share/petsc/examples")))
2948 (copy-recursively exdir exdir')
2949 (delete-file-recursively exdir)))))))
2950 (home-page "https://www.mcs.anl.gov/petsc")
2951 (synopsis "Library to solve PDEs")
2952 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2953 data structures and routines for the scalable (parallel) solution of
2954 scientific applications modeled by partial differential equations.")
2955 (license (license:non-copyleft
2956 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2958 (define-public petsc-complex
2961 (name "petsc-complex")
2963 (substitute-keyword-arguments (package-arguments petsc)
2964 ((#:configure-flags cf)
2965 #~(cons "--with-scalar-type=complex" #$cf))))
2966 (synopsis "Library to solve PDEs (with complex scalars)")))
2968 (define-public petsc-openmpi
2971 (name "petsc-openmpi")
2973 `(("hdf5" ,hdf5-parallel-openmpi)
2974 ("hypre" ,hypre-openmpi)
2976 ("mumps" ,mumps-openmpi)
2977 ("openmpi" ,openmpi)
2978 ("scalapack" ,scalapack)
2979 ("scotch" ,pt-scotch32)
2980 ,@(package-inputs petsc)))
2982 (substitute-keyword-arguments (package-arguments petsc)
2983 ((#:configure-flags cf)
2984 #~`("--with-hypre=1"
2985 "--with-mpiexec=mpirun"
2988 "--with-scalapack=1"
2990 ,(string-append "--with-mpi-dir="
2991 #$(this-package-input "openmpi"))
2992 ,(string-append "--with-hdf5-include="
2993 #$(this-package-input "hdf5") "/include")
2994 ,(string-append "--with-hdf5-lib="
2995 #$(this-package-input "hdf5") "/lib/libhdf5.a")
2996 ,@(delete "--with-mpi=0" #$cf)))
2998 #~(modify-phases #$phases
2999 (add-before 'configure 'mpi-setup
3000 #$%openmpi-setup)))))
3001 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
3003 (define-public petsc-complex-openmpi
3005 (inherit petsc-complex)
3006 (name "petsc-complex-openmpi")
3008 (modify-inputs (package-inputs petsc-complex)
3011 (substitute-keyword-arguments (package-arguments petsc-complex)
3012 ((#:configure-flags cf)
3013 #~`("--with-mpiexec=mpirun"
3014 ,(string-append "--with-mpi-dir="
3015 #$(this-package-input "openmpi"))
3016 ,@(delete "--with-mpi=0" #$cf)))
3018 #~(modify-phases #$phases
3019 (add-before 'configure 'mpi-setup
3020 #$%openmpi-setup)))))
3021 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
3023 (define-public python-petsc4py
3025 (name "python-petsc4py")
3030 (uri (pypi-uri "petsc4py" version))
3033 "0pxr6qa7p0pmpq0av29lx8lzlrdcfdzj87ynixzr8dn42y13a662"))
3034 (modules '((guix build utils)))
3037 ;; Ensure source file is regenerated in the build phase.
3038 (delete-file "src/petsc4py.PETSc.c")
3039 ;; Remove legacy GC code. See
3040 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
3041 (substitute* "src/PETSc/cyclicgc.pxi"
3042 ((".*gc_refs.*") "" )
3043 ((".*PyGC_Head.*") ""))
3045 (build-system python-build-system)
3048 (modify-phases %standard-phases
3049 (add-before 'build 'pre-build
3051 ;; Define path to PETSc installation.
3052 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3054 (add-before 'check 'mpi-setup
3057 (list python-cython))
3059 `(("petsc" ,petsc-openmpi)
3060 ("python-numpy" ,python-numpy)))
3061 (home-page "https://bitbucket.org/petsc/petsc4py/")
3062 (synopsis "Python bindings for PETSc")
3063 (description "PETSc, the Portable, Extensible Toolkit for
3064 Scientific Computation, is a suite of data structures and routines for
3065 the scalable (parallel) solution of scientific applications modeled by
3066 partial differential equations. It employs the MPI standard for all
3067 message-passing communication. @code{petsc4py} provides Python
3068 bindings to almost all functions of PETSc.")
3069 (license license:bsd-3)))
3071 (define-public python-kiwisolver
3073 (name "python-kiwisolver")
3077 (uri (pypi-uri "kiwisolver" version))
3080 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
3081 (build-system python-build-system)
3082 (home-page "https://github.com/nucleic/kiwi")
3083 (synopsis "Fast implementation of the Cassowary constraint solver")
3085 "Kiwi is an efficient C++ implementation of the Cassowary constraint
3086 solving algorithm. Kiwi has been designed from the ground up to be
3087 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
3088 Cassowary solver with typical use cases gaining a 40x improvement. Memory
3089 savings are consistently > 5x.")
3090 (license license:bsd-3)))
3092 (define-public python2-kiwisolver
3093 (package-with-python2 python-kiwisolver))
3095 (define-public slepc
3102 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
3106 "1ysfm77s5fcissv3q0k5d65mlp93zi4anqg62q3cd25dn66sva5i"))))
3107 (build-system gnu-build-system)
3109 `(("python" ,python)
3111 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
3113 `(("arpack" ,arpack-ng)
3114 ("gfortran" ,gfortran)))
3118 `(#:parallel-build? #f ;build is parallel by default
3120 `(,(string-append "--with-arpack-dir="
3121 (assoc-ref %build-inputs "arpack") "/lib"))
3122 #:make-flags ;honor (parallel-job-count)
3123 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
3124 ,(string-append "PETSCCONFIGDIR="
3125 (assoc-ref %build-inputs "petsc:examples")
3126 "/share/petsc/examples/config"))
3128 (modify-phases %standard-phases
3130 ;; configure is a python script, so we can't run it with bash.
3131 (lambda* (#:key inputs outputs (configure-flags '())
3133 (let* ((prefix (assoc-ref outputs "out"))
3134 (flags `(,(string-append "--prefix=" prefix)
3135 ,@configure-flags)))
3136 (format #t "build directory: ~s~%" (getcwd))
3137 (format #t "configure flags: ~s~%" flags)
3138 (setenv "SLEPC_DIR" (getcwd))
3139 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
3140 (apply invoke "./configure" flags))))
3141 (add-after 'install 'delete-doc
3142 ;; TODO: SLEPc installs HTML documentation alongside headers in
3143 ;; $out/include. We'd like to move them to share/doc, but delete
3144 ;; them for now, as they are incomplete and installing the complete
3145 ;; documentation is difficult.
3146 (lambda* (#:key outputs #:allow-other-keys)
3147 (let* ((out (assoc-ref outputs "out")))
3148 (for-each delete-file (find-files out "\\.html$"))
3150 (add-after 'install 'clean-install
3151 ;; Clean up unnecessary build logs from installation.
3152 (lambda* (#:key outputs #:allow-other-keys)
3153 (let ((out (assoc-ref outputs "out")))
3154 (for-each (lambda (file)
3155 (let ((f (string-append out "/lib/slepc/conf/" file)))
3156 (when (file-exists? f)
3158 '("configure.log" "make.log" "gmake.log"
3159 "test.log" "error.log" "RDict.db"
3162 (home-page "https://slepc.upv.es")
3163 (synopsis "Scalable library for eigenproblems")
3164 (description "SLEPc is a software library for the solution of large sparse
3165 eigenproblems on parallel computers. It can be used for the solution of
3166 linear eigenvalue problems formulated in either standard or generalized form,
3167 as well as other related problems such as the singular value decomposition.
3168 The emphasis of the software is on methods and techniques appropriate for
3169 problems in which the associated matrices are sparse, for example, those
3170 arising after the discretization of partial differential equations.")
3171 (license license:bsd-2)
3173 `((release-monitoring-url . "http://slepc.upv.es/download/")))))
3175 (define-public slepc-complex
3176 (package (inherit slepc)
3177 (name "slepc-complex")
3179 `(("petsc" ,petsc-complex)
3180 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3181 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
3183 (define-public slepc-openmpi
3184 (package (inherit slepc)
3185 (name "slepc-openmpi")
3187 (substitute-keyword-arguments (package-arguments slepc)
3188 ((#:phases phases '%standard-phases)
3189 `(modify-phases ,phases
3190 (add-before 'check 'mpi-setup
3191 ,%openmpi-setup)))))
3194 ,@(alist-delete "arpack" (package-inputs slepc))))
3196 `(("petsc" ,petsc-openmpi)
3197 ("arpack" ,arpack-ng-openmpi)
3198 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3199 (synopsis "Scalable library for eigenproblems (with MPI support)")))
3201 (define-public slepc-complex-openmpi
3202 (package (inherit slepc-openmpi)
3203 (name "slepc-complex-openmpi")
3205 `(("petsc" ,petsc-complex-openmpi)
3206 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
3207 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
3209 (define-public python-slepc4py
3211 (name "python-slepc4py")
3216 (uri (pypi-uri "slepc4py" version))
3219 "0fq997y73ymvcvdrxycp450pxwdgnqaw62gv9rwncfgsfplkvs9w"))))
3220 (build-system python-build-system)
3223 (modify-phases %standard-phases
3224 (add-before 'build 'pre-build
3226 ;; Define path to PETSc installation.
3227 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3228 ;; Define path to SLEPc installation.
3229 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3231 (add-before 'check 'mpi-setup
3234 `(("python-numpy" ,python-numpy)
3235 ("python-petsc4py" ,python-petsc4py)
3236 ("slepc" ,slepc-openmpi)))
3237 (home-page "https://bitbucket.org/slepc/slepc4py/")
3238 (synopsis "Python bindings for SLEPc")
3239 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3240 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3241 Scientific Computation. It employs the MPI standard for all
3242 message-passing communication. @code{slepc4py} provides Python
3243 bindings to almost all functions of SLEPc.")
3244 (license license:bsd-3)))
3246 (define-public metamath
3254 (url "https://github.com/metamath/metamath-exe")
3255 (commit (string-append "v" version))))
3256 (file-name (git-file-name name version))
3258 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3259 (build-system gnu-build-system)
3261 (list autoconf automake))
3262 (home-page "http://us.metamath.org/")
3263 (synopsis "Proof verifier based on a minimalistic formalism")
3265 "Metamath is a tiny formal language and that can express theorems in
3266 abstract mathematics, with an accompyaning @command{metamath} executable that
3267 verifies databases of these proofs. There is a public database,
3268 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3269 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3270 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3271 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3273 (license license:gpl2+)))
3275 (define-public minizinc
3282 (url "https://github.com/MiniZinc/libminizinc")
3284 (file-name (git-file-name name version))
3287 "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
3288 (modules '((guix build utils)
3293 ;; Do not advertise proprietary solvers
3294 (with-directory-excursion "cmake/targets"
3295 (let ((targets '("libminizinc_fzn.cmake"
3296 "libminizinc_gecode.cmake"
3297 "libminizinc_mip.cmake"
3298 "libminizinc_nl.cmake"
3299 "libminizinc_osicbc.cmake"
3300 "libminizinc_parser.cmake"
3304 (for-each delete-file
3307 (member file (cons* "." ".." targets)))
3309 (substitute* "libmzn.cmake"
3310 (("include\\(cmake/targets/(.*)\\)" all target)
3311 (if (member target targets) all "")))))
3312 (with-directory-excursion "include/minizinc/solvers/MIP"
3313 (for-each delete-file
3316 (member file '("." ".."
3317 "MIP_osicbc_solverfactory.hh"
3318 "MIP_osicbc_wrap.hh"
3319 "MIP_solverinstance.hh"
3320 "MIP_solverinstance.hpp"
3323 (with-directory-excursion "solvers/MIP"
3324 (for-each delete-file
3327 (member file '("." ".."
3328 "MIP_osicbc_solverfactory.cpp"
3329 "MIP_osicbc_wrap.cpp"
3330 "MIP_solverinstance.cpp"
3333 (substitute* "CMakeLists.txt"
3334 (("find_package\\(([^ ]*).*\\)" all pkg)
3335 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
3338 ;; TODO: swap out miniz for zlib
3340 (build-system cmake-build-system)
3342 `(#:tests? #f ; no ‘check’ target
3343 #:modules ((guix build cmake-build-system)
3347 (modify-phases %standard-phases
3348 (add-after 'install 'install-solver-configs
3349 (lambda* (#:key inputs outputs #:allow-other-keys)
3350 (let ((gecode (assoc-ref inputs "gecode"))
3351 (pkgdatadir (string-append (assoc-ref outputs "out")
3352 "/share/minizinc")))
3353 (call-with-output-file (string-append pkgdatadir
3354 "/Preferences.json")
3359 [\"\", \"org.gecode.gecode\"],
3360 [\"gecode\", \"org.gecode.gecode\"]
3362 \"solverDefaults\": []
3367 (mkdir-p (string-append pkgdatadir "/solvers"))
3368 (call-with-output-file (string-append pkgdatadir
3369 "/solvers/gecode.msc")
3374 \"id\": \"org.gecode.gecode\",
3375 \"name\": \"Gecode\",
3376 \"description\": \"Gecode FlatZinc executable\",
3380 \"supportsMzn\": false,
3381 \"supportsFzn\": true,
3382 \"needsSolns2Out\": true,
3383 \"needsMznExecutable\": false,
3384 \"needsStdlibDir\": false,
3385 \"isGUIApplication\": false
3387 (last (string-split gecode #\-))
3388 (string-append gecode "/share/gecode/mznlib")
3389 (string-append gecode "/bin/fzn-gecode"))
3390 (newline port)))))))))
3394 (list cbc gecode zlib))
3395 (home-page "https://www.minizinc.org")
3396 (synopsis "High-level constraint modeling language")
3397 (description "MiniZinc is a high-level modeling language for constraint
3398 satisfaction and optimization problems. Models are compiled to FlatZinc, a
3399 language understood by many solvers.")
3400 (license license:mpl2.0)))
3402 (define-public mumps
3409 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
3413 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
3414 (patches (search-patches "mumps-build-parallelism.patch"
3415 "mumps-shared-libseq.patch"
3416 "mumps-shared-mumps.patch"
3417 "mumps-shared-pord.patch"))))
3418 (build-system gnu-build-system)
3420 `(("fortran" ,gfortran)
3421 ;; These are required for linking against mumps, but we let the user
3422 ;; declare the dependency.
3425 ("scotch" ,scotch)))
3427 `(#:modules ((ice-9 match)
3430 ,@%gnu-build-system-modules)
3432 (modify-phases %standard-phases
3434 (lambda* (#:key inputs #:allow-other-keys)
3435 (call-with-output-file "Makefile.inc"
3446 INCSEQ = -I$(topdir)/libseq
3447 LIBSEQ = $(topdir)/libseq/libmpiseq.a
3448 LIBSEQNEEDED = libseqneeded~;
3452 AR = ar vr # rules require trailing space, ugh...
3455 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
3457 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
3458 LIBOTHERS = -pthread
3461 OPTF = -O2 -DALLOW_NON_INIT -fallow-argument-mismatch $(PIC)
3465 LIBS = $(SCALAP) $(LIBSEQ)
3466 LPORDDIR = $(topdir)/PORD/lib
3467 IPORD = -I$(topdir)/PORD/include
3468 LPORD = $(LPORDDIR)/libpord.a
3469 ORDERINGSF = -Dpord~@[
3471 IMETIS = -I$(METISDIR)/include
3472 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3473 ORDERINGSF += -Dmetis~]~@[~:{
3475 ISCOTCH = -I$(SCOTCHDIR)/include
3476 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
3477 ORDERINGSF += ~a~}~]
3478 ORDERINGSC = $(ORDERINGSF)
3479 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
3480 IORDERINGSF = $(ISCOTCH)
3481 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3482 (assoc-ref inputs "mpi")
3483 (assoc-ref inputs "blas")
3484 (assoc-ref inputs "scalapack")
3485 (assoc-ref inputs "metis")
3486 (match (list (assoc-ref inputs "pt-scotch")
3487 (assoc-ref inputs "scotch"))
3491 `((,scotch "" "-Dscotch")))
3494 "-lptesmumps -lptscotch -lptscotcherr "
3495 "-Dptscotch")))))))))
3497 ;; By default only the d-precision library is built. Make with "all"
3498 ;; target so that all precision libraries and examples are built.
3500 (invoke "make" "all"
3501 (format #f "-j~a" (parallel-job-count)))))
3503 ;; Run the simple test drivers, which read test input from stdin:
3504 ;; from the "real" input for the single- and double-precision
3505 ;; testers, and from the "cmplx" input for complex-precision
3506 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3507 ;; package to prefix execution with "mpirun".
3508 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3509 (with-directory-excursion "examples"
3512 (let ((tester (apply open-pipe*
3515 ,(string-append "./" prec
3517 (input (open-input-file
3518 (string-append "input_simpletest_" type))))
3520 (dump-port input tester)
3522 (zero? (close-pipe tester)))))
3524 '("real" "real" "cmplx" "cmplx")))))
3526 (lambda* (#:key outputs #:allow-other-keys)
3527 (let* ((out (assoc-ref outputs "out"))
3528 (libdir (string-append out "/lib")))
3529 (copy-recursively "lib" libdir)
3530 (copy-recursively "include" (string-append out "/include"))
3531 (when (file-exists? "libseq/libmpiseq.a")
3532 (install-file "libseq/libmpiseq.a" libdir))
3533 (when (file-exists? "libseq/libmpiseq.so")
3534 (install-file "libseq/libmpiseq.so" libdir))
3536 (home-page "http://mumps.enseeiht.fr")
3537 (synopsis "Multifrontal sparse direct solver")
3539 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3540 sparse system of linear equations A x = b using Gaussian elimination.")
3541 (license license:cecill-c)))
3543 (define-public mumps-metis
3544 (package (inherit mumps)
3545 (name "mumps-metis")
3547 (alist-delete "scotch" (package-inputs mumps)))))
3549 (define-public mumps-openmpi
3550 (package (inherit mumps)
3551 (name "mumps-openmpi")
3554 ("scalapack" ,scalapack)
3555 ("pt-scotch" ,pt-scotch)
3556 ,@(alist-delete "scotch" (package-inputs mumps))))
3558 (substitute-keyword-arguments (package-arguments mumps)
3560 `(modify-phases ,phases
3561 (add-before 'check 'mpi-setup
3565 ((assoc-ref ,phases 'check)
3566 #:exec-prefix '("mpirun" "-n" "2"))))))))
3567 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3569 (define-public mumps-metis-openmpi
3570 (package (inherit mumps-openmpi)
3571 (name "mumps-metis-openmpi")
3573 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3575 (define-public ruby-asciimath
3577 (name "ruby-asciimath")
3582 (uri (rubygems-uri "asciimath" version))
3585 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3586 (build-system ruby-build-system)
3588 (list ruby-nokogiri ruby-rspec))
3589 (synopsis "AsciiMath parsing and conversion library")
3591 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3592 easy-to-write markup language for mathematics.")
3593 (home-page "https://github.com/asciidoctor/asciimath")
3594 (license license:expat)))
3596 (define-public superlu
3603 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3604 "superlu_" version ".tar.gz"))
3606 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3607 (modules '((guix build utils)))
3609 ;; Replace the non-free implementation of MC64 with a stub adapted
3612 (use-modules (ice-9 regex)
3614 (call-with-output-file "SRC/mc64ad.c"
3619 void mc64id_(int *a) {
3620 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3623 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3624 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3625 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3628 ;; Remove the corresponding license verbiage. MC64 license follows
3629 ;; a "------" line separator.
3630 (with-atomic-file-replacement "License.txt"
3631 (let ((rx (make-regexp "-{8}")))
3634 (let ((line (read-line in 'concat)))
3635 (unless (regexp-exec rx line)
3639 (build-system cmake-build-system)
3643 `(("blas" ,openblas)
3644 ("gfortran" ,gfortran)))
3646 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3647 "-DTPL_BLAS_LIBRARIES=openblas"
3648 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3649 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3650 (synopsis "Supernodal direct solver for sparse linear systems")
3652 "SuperLU is a general purpose library for the direct solution of large,
3653 sparse, nonsymmetric systems of linear equations on high performance machines.
3654 The library is written in C and is callable from either C or Fortran. The
3655 library routines perform an LU decomposition with partial pivoting and
3656 triangular system solves through forward and back substitution. The library
3657 also provides threshold-based ILU factorization preconditioners.")
3658 (license (list license:bsd-3
3659 license:gpl2+ ;EXAMPLE/*fgmr.c
3660 (license:fsf-free "file://SRC/colamd.h")))))
3662 (define-public superlu-dist
3664 (name "superlu-dist")
3670 (url "https://github.com/xiaoyeli/superlu_dist")
3671 (commit (string-append "v" version))))
3672 (file-name (git-file-name name version))
3674 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3675 (modules '((guix build utils)))
3677 ;; Replace the non-free implementation of MC64 with a stub
3679 (make-file-writable "SRC/mc64ad_dist.c")
3680 (call-with-output-file "SRC/mc64ad_dist.c"
3685 void mc64id_dist(int *a) {
3686 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3689 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3690 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3691 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3694 (substitute* "SRC/util.c" ;adjust default algorithm
3695 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3696 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3697 ;; general (i.e. non-square) processor-grid support.
3698 "RowPerm = NOROWPERM;"))
3700 (patches (search-patches "superlu-dist-scotchmetis.patch"
3701 "superlu-dist-awpm-grid.patch"))))
3702 (build-system cmake-build-system)
3706 `(("gfortran" ,gfortran)
3709 ("combblas" ,combinatorial-blas)))
3711 `(("mpi" ,openmpi) ;headers include MPI heades
3712 ("parmetis" ,pt-scotch32 "metis")
3713 ("pt-scotch" ,pt-scotch32)))
3715 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3716 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3717 "-DTPL_ENABLE_COMBBLASLIB=YES"
3718 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3719 "-DTPL_LAPACK_LIBRARIES=-llapack"
3720 (string-append "-DTPL_PARMETIS_LIBRARIES="
3722 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3723 "scotchmetis" "scotch" "scotcherr")
3725 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3726 (assoc-ref %build-inputs "parmetis")
3728 "-DTPL_ENABLE_COMBBLASLIB=ON"
3729 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3730 (assoc-ref %build-inputs "combblas")
3731 "/include/CombBLAS;"
3732 (assoc-ref %build-inputs "combblas")
3733 "/include/BipartiteMatchings")
3734 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3736 (modify-phases %standard-phases
3737 (add-before 'configure 'set-c++-standard
3739 (substitute* "CMakeLists.txt"
3740 ;; AWPM headers require C++14
3741 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3742 (add-before 'check 'mpi-setup
3744 (add-before 'check 'omp-setup
3745 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3746 (home-page (package-home-page superlu))
3747 (synopsis "Parallel supernodal direct solver")
3749 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3750 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3751 implemented in ANSI C, and MPI for communications.")
3752 (license license:bsd-3)))
3754 (define-public scotch
3761 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3762 "latestfile/298/scotch_" version ".tar.gz"))
3764 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3765 (patches (search-patches "scotch-build-parallelism.patch"
3766 "scotch-integer-declarations.patch"))))
3767 (build-system gnu-build-system)
3771 (list flex bison gfortran))
3772 (outputs '("out" "metis"))
3774 `(#:make-flags (list (string-append "prefix=" %output))
3776 (modify-phases %standard-phases
3778 'unpack 'chdir-to-src
3779 (lambda _ (chdir "src") #t))
3783 (call-with-output-file "Makefile.inc"
3798 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3799 LDFLAGS = -lz -lm -lrt -lpthread
3801 LEX = flex -Pscotchyy -olex.yy.c
3806 YACC = bison -pscotchyy -y -b y
3808 '("COMMON_FILE_COMPRESS_GZ"
3810 "COMMON_RANDOM_FIXED_SEED"
3811 "INTSIZE64" ;use 'int64_t'
3812 ;; Prevents symbol clashes with libesmumps
3814 ;; XXX: Causes invalid frees in superlu-dist tests
3816 ;; "SCOTCH_PTHREAD_NUMBER=2"
3817 "restrict=__restrict"))))
3819 (add-after 'build 'build-esmumps
3822 (format #f "-j~a" (parallel-job-count))
3824 (add-before 'install 'make-install-dirs
3825 (lambda* (#:key outputs #:allow-other-keys)
3826 (mkdir (assoc-ref outputs "out"))))
3827 (add-after 'install 'install-metis
3828 (lambda* (#:key outputs #:allow-other-keys)
3829 (let ((out (assoc-ref outputs "metis")))
3831 ;; metis files are not installed with 'make install'
3832 (for-each (lambda (f)
3833 (install-file f (string-append out "/include")))
3834 (find-files "../include/" ".*metis\\.h"))
3835 (for-each (lambda (f)
3836 (install-file f (string-append out "/lib")))
3837 (find-files "../lib/" ".*metis\\..*"))
3839 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3841 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3842 (synopsis "Programs and libraries for graph algorithms")
3843 (description "SCOTCH is a set of programs and libraries which implement
3844 the static mapping and sparse matrix reordering algorithms developed within
3845 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3846 conquer approach, to scientific computing problems such as graph and mesh
3847 partitioning, static mapping, and sparse matrix ordering, in application
3848 domains ranging from structural mechanics to operating systems or
3850 ;; See LICENSE_en.txt
3851 (license license:cecill-c)))
3853 (define-public scotch32
3854 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3855 ;; some applications.
3856 (package (inherit scotch)
3859 (substitute-keyword-arguments (package-arguments scotch)
3860 ((#:phases scotch-phases)
3861 `(modify-phases ,scotch-phases
3865 (call-with-output-file "Makefile.inc"
3880 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3881 LDFLAGS = -lz -lm -lrt -lpthread
3883 LEX = flex -Pscotchyy -olex.yy.c
3888 YACC = bison -pscotchyy -y -b y
3890 '("COMMON_FILE_COMPRESS_GZ"
3892 "COMMON_RANDOM_FIXED_SEED"
3893 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3894 ;; Prevents symbolc clashes with libesmumps
3896 ;; XXX: Causes invalid frees in superlu-dist tests
3898 ;; "SCOTCH_PTHREAD_NUMBER=2"
3899 "restrict=__restrict"))))))))))
3901 "Programs and libraries for graph algorithms (32-bit integers)")))
3903 (define-public scotch-shared
3904 (package (inherit scotch)
3905 (name "scotch-shared")
3907 (list gcc flex bison))
3909 (substitute-keyword-arguments (package-arguments scotch)
3910 ((#:phases scotch-shared-phases)
3911 `(modify-phases ,scotch-shared-phases
3915 ;; Otherwise, the RUNPATH will lack the final path component.
3916 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3917 (assoc-ref %outputs "out") "/lib"))
3918 (call-with-output-file "Makefile.inc"
3926 ARFLAGS = -shared -o
3933 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3934 CLIBFLAGS = -shared -fPIC
3935 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3937 LEX = flex -Pscotchyy -olex.yy.c
3942 YACC = bison -pscotchyy -y -b y
3944 '("COMMON_FILE_COMPRESS_GZ"
3946 "COMMON_RANDOM_FIXED_SEED"
3947 "INTSIZE64" ;use 'int64_t'
3948 ;; Prevents symbolc clashes with libesmumps
3950 ;; XXX: Causes invalid frees in superlu-dist tests
3952 ;; "SCOTCH_PTHREAD_NUMBER=2"
3953 "restrict=__restrict"
3957 "Programs and libraries for graph algorithms (shared libraries version)")))
3959 (define-public pt-scotch
3960 (package (inherit scotch)
3963 (list openmpi)) ;Headers include MPI headers
3965 (substitute-keyword-arguments (package-arguments scotch)
3966 ((#:phases scotch-phases)
3967 `(modify-phases ,scotch-phases
3971 (invoke "make" (format #f "-j~a" (parallel-job-count))
3972 "ptscotch" "ptesmumps")
3974 ;; Install the serial metis compatibility library
3975 (invoke "make" "-C" "libscotchmetis" "install")))
3976 (add-before 'check 'mpi-setup
3980 (invoke "make" "ptcheck")))))))
3981 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3983 (define-public pt-scotch32
3984 (package (inherit scotch32)
3985 (name "pt-scotch32")
3987 (list openmpi)) ;headers include MPI headers
3989 (substitute-keyword-arguments (package-arguments scotch32)
3990 ((#:phases scotch32-phases)
3991 `(modify-phases ,scotch32-phases
3994 (invoke "make" (format #f "-j~a" (parallel-job-count))
3995 "ptscotch" "ptesmumps")
3996 ;; Install the serial metis compatibility library
3997 (invoke "make" "-C" "libscotchmetis" "install")))
3998 (add-before 'check 'mpi-setup
4002 (invoke "make" "ptcheck")))))))
4004 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
4006 (define-public pt-scotch-shared
4007 (package (inherit scotch-shared)
4008 (name "pt-scotch-shared")
4010 (list openmpi)) ;Headers include MPI headers
4012 (substitute-keyword-arguments (package-arguments scotch-shared)
4013 ((#:phases scotch-shared-phases)
4014 `(modify-phases ,scotch-shared-phases
4018 (invoke "make" (format #f "-j~a" (parallel-job-count))
4019 "ptscotch" "ptesmumps")
4021 ;; Install the serial metis compatibility library
4022 (invoke "make" "-C" "libscotchmetis" "install")))
4023 (add-before 'check 'mpi-setup
4024 ,%openmpi-setup)))))
4025 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
4028 (define-public metis
4035 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
4036 "metis-" version ".tar.gz"))
4039 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
4041 `((release-monitoring-url
4042 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
4043 (build-system cmake-build-system)
4045 `(("blas" ,openblas)))
4047 `(#:tests? #f ;no tests
4048 #:configure-flags `("-DSHARED=ON"
4049 ,(string-append "-DGKLIB_PATH=" (getcwd)
4050 "/metis-" ,version "/GKlib"))))
4051 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
4052 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
4054 "METIS is a set of serial programs for partitioning graphs, partitioning
4055 finite element meshes, and producing fill-reducing orderings for sparse
4056 matrices. The algorithms implemented in METIS are based on the multilevel
4057 recursive-bisection, multilevel k-way, and multi-constraint partitioning
4059 (license license:asl2.0))) ;As of version 5.0.3
4061 (define-public p4est
4068 (uri (string-append "http://p4est.github.io/release/p4est-"
4072 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
4073 (build-system gnu-build-system)
4075 `(("fortran" ,gfortran)
4080 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
4081 (assoc-ref %build-inputs "blas")
4083 ,(string-append "LAPACK_LIBS=-L"
4084 (assoc-ref %build-inputs "lapack")
4086 #:phases (modify-phases %standard-phases
4087 (add-before 'check 'mpi-setup
4089 (home-page "http://www.p4est.org")
4090 (synopsis "Adaptive mesh refinement on forests of octrees")
4092 "The p4est software library enables the dynamic management of a
4093 collection of adaptive octrees, conveniently called a forest of octrees.
4094 p4est is designed to work in parallel and scales to hundreds of thousands of
4096 (license license:gpl2+)))
4098 (define-public p4est-openmpi
4099 (package (inherit p4est)
4100 (name "p4est-openmpi")
4103 ,@(package-inputs p4est)))
4105 (substitute-keyword-arguments (package-arguments p4est)
4106 ((#:configure-flags cf)
4107 ``("--enable-mpi" ,@,cf))))
4108 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
4110 (define-public gsegrafix
4111 ;; This is an old and equally dead "experimental fork" of the longer-dead
4112 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
4113 ;; libraries, instead rendering plots with Pango.
4120 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
4121 "gsegrafix-experimental-" version ".tar.gz"))
4123 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
4124 (build-system gnu-build-system)
4127 (list "--disable-static")))
4132 (home-page "https://www.gnu.org/software/gsegrafix/")
4133 (synopsis "GNOME application to create scientific and engineering plots")
4135 "GSEGrafix is an application which produces high-quality graphical
4136 plots for science and engineering. Plots are specified via simple ASCII
4137 parameter files and data files and are presented in an anti-aliased GNOME
4138 canvas. The program supports rectangular two-dimensional plots, histograms,
4139 polar-axis plots and three-dimensional plots. Plots can be printed or saved
4140 to BMP, JPEG or PNG image formats.")
4141 (license license:gpl3+)))
4143 (define-public maxima
4150 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
4151 version "-source/" name "-" version ".tar.gz"))
4154 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
4155 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
4156 (build-system gnu-build-system)
4158 `(("bash" ,bash-minimal)
4159 ("gnuplot" ,gnuplot) ;for plots
4162 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
4164 (list texinfo perl python))
4167 ,#~(list "--enable-sbcl"
4168 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
4169 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
4170 (string-append "--with-wish=" #$tk "/bin/wish"
4171 #$(version-major+minor (package-version tk))))
4172 ;; By default Maxima attempts to write temporary files to
4173 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
4174 ;; Work around that.
4175 #:make-flags (list "TMPDIR=/tmp")
4177 (modify-phases %standard-phases
4178 (add-after 'unpack 'patch-paths
4179 (lambda* (#:key inputs #:allow-other-keys)
4180 (let* ((sed (search-input-file inputs "/bin/sed"))
4181 (coreutils (assoc-ref inputs "coreutils"))
4182 (dirname (string-append coreutils "/bin/dirname"))
4183 (head (string-append coreutils "/bin/head"))
4184 (perl (search-input-file inputs "/bin/perl"))
4185 (python (search-input-file inputs "/bin/python3")))
4186 (substitute* "src/maxima.in"
4187 (("sed ") (string-append sed " "))
4188 (("dirname") dirname)
4190 (substitute* "doc/info/Makefile.in"
4191 (("/usr/bin/env perl") perl))
4192 (substitute* "doc/info/build_html.sh.in"
4193 (("python") python))
4195 (add-before 'check 'pre-check
4197 (chmod "src/maxima" #o555)
4201 ;; This is derived from the testing code in the "debian/rules" file
4202 ;; of Debian's Maxima package.
4203 ;; If Maxima can successfully run this, the binary to be installed
4209 "--batch-string=\"run_testsuite();\" "
4210 "| grep -q \"No unexpected errors found\""))))
4211 ;; Make sure the doc and emacs files are found in the
4212 ;; standard location. Also configure maxima to find gnuplot
4213 ;; without having it on the PATH.
4214 (add-after 'install 'post-install
4215 (lambda* (#:key outputs inputs #:allow-other-keys)
4216 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
4217 (out (assoc-ref outputs "out"))
4218 (datadir (string-append out "/share/maxima/" ,version))
4219 (binutils (dirname (search-input-file inputs "/bin/as"))))
4220 (with-directory-excursion out
4221 (mkdir-p "share/emacs")
4222 (mkdir-p "share/doc")
4224 (string-append datadir "/doc/")
4225 (string-append out "/share/doc/maxima"))
4226 (with-atomic-file-replacement
4227 (string-append datadir "/share/maxima-init.lisp")
4229 (format out "~a ~s~a~%"
4230 "(setf $gnuplot_command "
4231 (string-append gnuplot "/bin/gnuplot") ")")
4232 (dump-port in out))))
4233 ;; Ensure that Maxima will have access to the GNU binutils
4234 ;; components at runtime.
4235 (wrap-program (string-append out "/bin/maxima")
4236 `("PATH" prefix (,binutils))))
4238 (home-page "https://maxima.sourceforge.io")
4239 (synopsis "Numeric and symbolic expression manipulation")
4240 (description "Maxima is a system for the manipulation of symbolic and
4241 numerical expressions. It yields high precision numeric results by using
4242 exact fractions, arbitrary precision integers, and variable precision floating
4244 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
4245 ;; Others simply say "GNU General Public License" without stating a
4246 ;; version (which implicitly means gpl1+).
4247 ;; At least one file (src/maxima.asd) says "version 2."
4248 ;; GPLv2 only is therefore the smallest subset.
4249 (license license:gpl2)))
4251 (define-public wxmaxima
4259 (url "https://github.com/wxMaxima-developers/wxmaxima")
4260 (commit (string-append "Version-" version))))
4261 (file-name (git-file-name name version))
4263 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
4264 (build-system cmake-build-system)
4266 `(("gettext" ,gettext-minimal)))
4275 `(#:tests? #f ; tests fail non-deterministically
4277 (modify-phases %standard-phases
4278 (add-after 'unpack 'patch-doc-path
4280 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
4281 ;; documentation. Only licensing information is placed there by
4283 (substitute* "src/Dirstructure.cpp"
4284 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
4286 (add-after 'install 'wrap-program
4287 (lambda* (#:key inputs outputs #:allow-other-keys)
4288 (wrap-program (string-append (assoc-ref outputs "out")
4291 (,(string-append (assoc-ref inputs "maxima")
4293 ;; For GtkFileChooserDialog.
4294 `("GSETTINGS_SCHEMA_DIR" =
4295 (,(string-append (assoc-ref inputs "gtk+")
4296 "/share/glib-2.0/schemas")))
4297 `("XDG_DATA_DIRS" ":" prefix
4298 (;; Needed by gdk-pixbuf to know supported icon formats.
4300 (assoc-ref inputs "shared-mime-info") "/share")
4301 ;; The default icon theme of GTK+.
4303 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
4305 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
4306 (synopsis "Graphical user interface for the Maxima computer algebra system")
4308 "wxMaxima is a graphical user interface for the Maxima computer algebra
4309 system. It eases the use of Maxima by making most of its commands available
4310 through a menu system and by providing input dialogs for commands that require
4311 more than one argument. It also implements its own display engine that
4312 outputs mathematical symbols directly instead of depicting them with ASCII
4315 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
4316 text and mathematical calculations to create documents, exporting of input and
4317 output to TeX, and a browser for Maxima's manual including command index and
4318 full text searching.")
4319 (license license:gpl2+)))
4321 (define-public armadillo
4327 (uri (string-append "mirror://sourceforge/arma/armadillo-"
4331 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
4332 (build-system cmake-build-system)
4333 (arguments `(#:tests? #f)) ; no test target
4335 `(("openblas" ,openblas)
4337 ("arpack" ,arpack-ng)))
4338 (home-page "http://arma.sourceforge.net/")
4339 (synopsis "C++ linear algebra library")
4341 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4342 between speed and ease of use. It is useful for algorithm development
4343 directly in C++, or quick conversion of research code into production
4344 environments. It can be used for machine learning, pattern recognition,
4345 signal processing, bioinformatics, statistics, econometrics, etc. The library
4346 provides efficient classes for vectors, matrices and cubes, as well as 150+
4347 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4348 (license license:asl2.0)))
4350 (define-public muparser
4351 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4352 ;; different hash. In order to make `guix package --upgrade` work correctly,
4353 ;; we set a Guix packaging revision.
4354 ;; When the next version of muparser is released, we can remove
4355 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4356 (let ((upstream-version "2.2.5")
4360 (version (string-append upstream-version "-" revision))
4365 (url "https://github.com/beltoforion/muparser")
4366 (commit (string-append "v" upstream-version))))
4367 (file-name (git-file-name name version))
4369 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4370 (build-system gnu-build-system)
4372 `(#:configure-flags '("--enable-samples=no")
4373 #:tests? #f)) ;no "check" target
4374 (home-page "http://muparser.beltoforion.de/")
4375 (synopsis "Fast parser library for mathematical expressions")
4377 "muParser is an extensible high performance math parser library. It is
4378 based on transforming an expression into a bytecode and precalculating constant
4380 (license license:expat))))
4382 (define-public openblas
4390 (url "https://github.com/xianyi/OpenBLAS")
4391 (commit (string-append "v" version))))
4392 (file-name (git-file-name name version))
4395 "17zdd8asylz2w71hczrz5y344p6d5ds1jn4901maw7zcp3dbk63g"))))
4396 (build-system gnu-build-system)
4398 `(#:test-target "test"
4399 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4400 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4401 ;; we need to disable substitutions.
4403 ,(let ((system (or (%current-target-system) (%current-system))))
4404 (or (string-prefix? "x86_64" system)
4405 (string-prefix? "i686" system)
4406 (string-prefix? "mips" system)
4407 (string-prefix? "aarch64" system)))
4409 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4411 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4412 "NO_STATIC=1" ;avoid a 67 MiB static archive
4414 ;; This is the maximum number of threads OpenBLAS will ever use (that
4415 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4416 ;; is used.) If we don't set it, the makefile sets it to the number
4417 ;; of cores of the build machine, which is obviously wrong.
4420 ;; Build the library for all supported CPUs. This allows
4421 ;; switching CPU targets at runtime with the environment variable
4422 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4423 ;; Unfortunately, this is not supported on all architectures,
4424 ;; where it leads to failed builds.
4425 ,@(let ((system (or (%current-target-system) (%current-system))))
4427 ((or (string-prefix? "x86_64" system)
4428 (string-prefix? "i686" system)
4429 (string-prefix? "powerpc64le" system)
4430 (string-prefix? "aarch64" system))
4431 ;; Dynamic older enables a few extra CPU architectures that
4432 ;; were released before 2010.
4433 '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
4434 ;; On some of these architectures the CPU can't be detected.
4435 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4436 ;; two available MIPS targets special extended instructions
4437 ;; for Loongson cores are used.
4438 ((string-prefix? "mips" system)
4439 '("TARGET=SICORTEX"))
4440 ;; Failed to detect CPU.
4441 ((string-prefix? "armhf" system)
4444 ;; no configure script
4446 (modify-phases %standard-phases
4448 (add-before 'build 'set-extralib
4449 (lambda* (#:key inputs #:allow-other-keys)
4450 ;; Get libgfortran found when building in utest.
4452 (string-append "-L" (assoc-ref inputs "fortran-lib")
4455 `(("fortran-lib" ,gfortran "lib")))
4458 ("fortran" ,gfortran)
4460 (home-page "https://www.openblas.net/")
4461 (synopsis "Optimized BLAS library based on GotoBLAS")
4463 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4464 (license license:bsd-3)))
4466 (define-public openblas-ilp64
4467 (package/inherit openblas
4468 (name "openblas-ilp64")
4469 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4471 (substitute-keyword-arguments (package-arguments openblas)
4472 ((#:make-flags flags '())
4473 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4475 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4476 (license license:bsd-3)))
4482 (home-page "https://github.com/flame/blis")
4485 (uri (git-reference (url home-page) (commit version)))
4488 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4489 (file-name (git-file-name "blis" version))))
4492 (build-system gnu-build-system)
4495 ((guix build gnu-build-system)
4498 #:test-target "test"
4500 (modify-phases %standard-phases
4502 (lambda* (#:key outputs
4505 (configure-flags '())
4507 ;; This is a home-made 'configure' script.
4508 (let* ((out (assoc-ref outputs "out"))
4509 ;; Guix-specific support for choosing the configuration
4510 ;; via #:configure-flags: see below for details.
4511 (config-flag-prefix "--blis-config=")
4512 (maybe-config-flag (find
4514 (string-prefix? config-flag-prefix s))
4516 (configure-flags (if maybe-config-flag
4517 (delete maybe-config-flag
4520 ;; Select the "configuration" to build.
4521 ;; The "generic" configuration is non-optimized but
4522 ;; portable (no assembly).
4523 ;; The "x86_64" configuration family includes
4524 ;; sub-configurations for all supported
4525 ;; x86_64 microarchitectures.
4526 ;; BLIS currently lacks runtime hardware detection
4527 ;; for other architectures: see
4528 ;; <https://github.com/flame/blis/commit/c534da6>.
4529 ;; Conservatively, we stick to "generic" on armhf,
4530 ;; aarch64, and ppc64le for now. (But perhaps
4531 ;; "power9", "cortexa9", and "cortexa57" might be
4532 ;; general enough to use?)
4533 ;; Another approach would be to use the "auto"
4534 ;; configuration and make this package
4535 ;; non-substitutable.
4536 ;; The build is fairly intensive, though.
4540 (substring maybe-config-flag
4541 (string-length config-flag-prefix)))
4542 ((string-prefix? "x86_64" (or target system))
4551 "--enable-threading=openmp"
4552 "--enable-verbose-make"
4555 (format #t "configure args: ~s~%" configure-args)
4560 (add-before 'check 'show-test-output
4562 ;; By default "make check" is silent. Make it verbose.
4563 (system "tail -F output.testsuite &")
4565 (synopsis "High-performance basic linear algebra (BLAS) routines")
4567 "BLIS is a portable software framework for instantiating high-performance
4568 BLAS-like dense linear algebra libraries. The framework was designed to
4569 isolate essential kernels of computation that, when optimized, immediately
4570 enable optimized implementations of most of its commonly used and
4571 computationally intensive operations. While BLIS exports a new BLAS-like API,
4572 it also includes a BLAS compatibility layer which gives application developers
4573 access to BLIS implementations via traditional BLAS routine calls.")
4574 (license license:bsd-3)))
4576 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4577 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4578 (define-public blis-knl (deprecated-package "blis-knl" blis))
4580 (define ignorance blis)
4582 (define-public openlibm
4590 (url "https://github.com/JuliaLang/openlibm")
4591 (commit (string-append "v" version))))
4592 (file-name (git-file-name name version))
4594 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4595 (build-system gnu-build-system)
4598 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4599 ,(string-append "CC=" (cc-for-target)))
4601 ;; no configure script
4602 (modify-phases %standard-phases (delete 'configure))
4603 #:tests? #f)) ;the tests are part of the default target
4604 (home-page "https://openlibm.org/")
4605 (synopsis "Portable C mathematical library (libm)")
4607 "OpenLibm is an effort to have a high quality, portable, standalone C
4608 mathematical library (libm). It can be used standalone in applications and
4609 programming language implementations. The project was born out of a need to
4610 have a good libm for the Julia programming language that worked consistently
4611 across compilers and operating systems, and in 32-bit and 64-bit
4613 ;; Each architecture has its own make target, and there is none for mips.
4614 (supported-systems (delete "mips64el-linux" %supported-systems))
4615 ;; See LICENSE.md for details.
4616 (license (list license:expat
4619 license:public-domain
4620 license:lgpl2.1+))))
4622 (define-public openspecfun
4624 (name "openspecfun")
4630 (url "https://github.com/JuliaLang/openspecfun")
4631 (commit (string-append "v" version))))
4632 (file-name (git-file-name name version))
4634 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4635 (build-system gnu-build-system)
4637 '(#:tests? #f ; no "check" target
4639 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4641 (modify-phases %standard-phases
4642 (delete 'configure)))) ; no configure script
4644 `(("fortran" ,gfortran)))
4645 (home-page "https://github.com/JuliaLang/openspecfun")
4646 (synopsis "Collection of special mathematical functions")
4648 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4649 portable package for Bessel Functions of a Complex Argument and Nonnegative
4650 Order; it contains subroutines for computing Bessel functions and Airy
4651 functions. Faddeeva allows computing the various error functions of arbitrary
4652 complex arguments (Faddeeva function, error function, complementary error
4653 function, scaled complementary error function, imaginary error function, and
4654 Dawson function); given these, one can also easily compute Voigt functions,
4655 Fresnel integrals, and similar related functions as well.")
4656 ;; Faddeeva is released under the Expat license; AMOS is included as
4657 ;; public domain software.
4658 (license (list license:expat license:public-domain))))
4660 (define-public suitesparse
4662 (name "suitesparse")
4668 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4669 (commit (string-append "v" version))))
4670 (file-name (git-file-name name version))
4673 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4674 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4675 (modules '((guix build utils)))
4677 ;; Remove bundled metis source
4679 (delete-file-recursively "metis-5.1.0")
4681 (build-system gnu-build-system)
4683 `(#:tests? #f ;no "check" target
4685 (list (string-append "CC=" ,(cc-for-target))
4687 "MY_METIS_LIB=-lmetis"
4689 ;; The default is to link against netlib lapack. Use OpenBLAS
4691 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4693 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4694 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4695 (assoc-ref %outputs "out")
4696 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4697 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4698 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4699 " -DCMAKE_SKIP_RPATH=TRUE"
4700 " -DCMAKE_BUILD_TYPE=Release"
4701 " -DCMAKE_INSTALL_LIBDIR=lib")
4702 (string-append "INSTALL_LIB="
4703 (assoc-ref %outputs "out") "/lib")
4704 (string-append "INSTALL_INCLUDE="
4705 (assoc-ref %outputs "out") "/include")
4708 (modify-phases %standard-phases
4709 (delete 'configure)))) ;no configure script
4711 (list tbb openblas gmp mpfr metis))
4713 `(("cmake" ,cmake-minimal)
4715 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4716 (synopsis "Suite of sparse matrix software")
4718 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4719 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4720 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4721 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4722 CXSparse, a concise sparse Cholesky factorization package; and many other
4725 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4727 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4728 (license (list license:gpl2+ license:lgpl2.1+))))
4730 (define-public atlas
4736 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4737 version "/atlas" version ".tar.bz2"))
4738 (patches (search-patches "atlas-gfortran-compat.patch"))
4741 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4742 (build-system gnu-build-system)
4743 (home-page "http://math-atlas.sourceforge.net/")
4744 (inputs `(("gfortran" ,gfortran)
4745 ("lapack-tar" ,(package-source lapack))))
4746 (outputs '("out" "doc"))
4747 ;; For the moment we drop support for MIPS at it fails to compile. See
4748 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4749 (supported-systems (delete "mips64el-linux" %supported-systems))
4751 `(#:parallel-build? #f
4752 #:parallel-tests? #f
4754 ;; ATLAS tunes itself for the machine it is built on, as explained at
4755 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4756 ;; For this reason, we want users to build it locally instead of using
4760 #:modules ((srfi srfi-26)
4761 (guix build gnu-build-system)
4764 `(;; Generate position independent code suitable for dynamic libraries
4765 ;; and use WALL timer to get more accurate timing.
4766 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4769 ,,(if (string-match "64" (%current-system))
4772 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4773 ;; needed to compile C files before it is generated.
4774 "-Ss" "pmake" "make -j 1"
4775 ;; Probe is failing for MIPS. We therefore define the system
4776 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4777 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4778 ,,@(if (string-prefix? "mips" (%current-system))
4779 (list "-A" "49" "-V" "1")
4781 ;; Generate shared libraries.
4783 ;; Build a full LAPACK library.
4784 ,(string-append "--with-netlib-lapack-tarfile="
4785 (assoc-ref %build-inputs "lapack-tar")))
4787 (modify-phases %standard-phases
4788 (add-after 'install 'install-doc
4789 (lambda* (#:key outputs inputs #:allow-other-keys)
4790 (let ((doc (string-append (assoc-ref outputs "doc")
4791 "/share/doc/atlas")))
4793 (for-each (cut install-file <> doc)
4794 (find-files "../ATLAS/doc" ".*"))
4796 (add-after 'check 'check-pt
4797 (lambda _ (invoke "make" "ptcheck")))
4798 ;; Fix files required to run configure.
4799 (add-before 'configure 'fix-/bin/sh
4801 ;; Use `sh', not `/bin/sh'.
4802 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4806 ;; Fix /bin/sh in generated make files.
4807 (add-after 'configure 'fix-/bin/sh-in-generated-files
4809 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4813 ;; ATLAS configure program does not accepts the default flags
4814 ;; passed by the 'gnu-build-system'.
4816 (lambda* (#:key native-inputs inputs outputs
4817 (configure-flags '())
4818 #:allow-other-keys #:rest args)
4819 (let* ((prefix (assoc-ref outputs "out"))
4820 (bash (or (and=> (assoc-ref
4821 (or native-inputs inputs) "bash")
4822 (cut string-append <> "/bin/bash"))
4824 (flags `(,(string-append "--prefix=" prefix)
4826 (abs-srcdir (getcwd))
4827 (srcdir (string-append "../" (basename abs-srcdir))))
4828 (format #t "source directory: ~s (relative from build: ~s)~%"
4832 (format #t "build directory: ~s~%" (getcwd))
4833 (format #t "configure flags: ~s~%" flags)
4835 (string-append srcdir "/configure")
4837 (synopsis "Automatically Tuned Linear Algebra Software")
4839 "ATLAS is an automatically tuned linear algebra software library
4840 providing C and Fortran77 interfaces to a portably efficient BLAS
4841 implementation, as well as a few routines from LAPACK.
4843 Optimization occurs at build time. For this reason, the library is built on
4844 the machine where it is installed, without resorting to pre-built substitutes.
4846 Before building the library, CPU throttling should be disabled. This can be
4847 done in the BIOS, or, on GNU/Linux, with the following command:
4850 # cpupower --governor performance
4853 Failure to do so will result in a library with poor performance.")
4854 ;; The test suite is notoriously lengthy and routinely exceeds the default
4855 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4856 (properties '((timeout . 86400))) ; 1 day
4857 (license license:bsd-3)))
4867 (url "https://github.com/recp/cglm")
4868 (commit (string-append "v" version))))
4869 (file-name (git-file-name name version))
4871 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4872 (build-system cmake-build-system)
4875 (list "-DCGLM_USE_TEST=ON")))
4876 (home-page "https://github.com/recp/cglm")
4877 (synopsis "Mathematics C library for graphics programming")
4879 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4880 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4883 It's similar to the original C++ GLM library but written in C99 and compatible
4885 (license license:expat)))
4894 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4895 version "/glm-" version ".zip"))
4897 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4898 (build-system cmake-build-system)
4900 `(#:phases (modify-phases %standard-phases
4902 (lambda* (#:key outputs #:allow-other-keys)
4903 ;; Since version 0.9.9.6, 'make install' is not supported
4904 ;; and we have to do it "manually". Upstream discussion:
4905 ;; <https://github.com/g-truc/glm/pull/968>.
4906 (let* ((source (string-append "../glm"))
4907 (out (assoc-ref outputs "out"))
4908 (inc (string-append out "/include"))
4909 (lib (string-append out "/lib"))
4910 (pkgconfig (string-append lib "/pkgconfig")))
4911 (with-directory-excursion source
4914 (copy-recursively "glm" (string-append inc "/glm"))
4915 (copy-recursively "cmake" (string-append lib "/cmake"))
4916 (call-with-output-file (string-append pkgconfig "/glm.pc")
4920 includedir=${prefix}/include
4923 Description: OpenGL Mathematics
4925 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4929 (home-page "https://glm.g-truc.net/")
4930 (synopsis "OpenGL Mathematics library")
4931 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4932 library for graphics software based on the OpenGL Shading Language (GLSL)
4934 (license license:expat)))
4936 (define-public lpsolve
4943 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4944 "/lp_solve_" version "_source.tar.gz"))
4947 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4948 (modules '((guix build utils)))
4951 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4953 ;; Pretend to be on a 64 bit platform to obtain a common directory
4954 ;; name for the build results on all architectures; nothing else
4955 ;; seems to depend on it.
4956 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4958 ;; The check for 'isnan' as it is written fails with
4959 ;; "non-floating-point argument in call to function
4960 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4961 ;; definition, which in turn leads to bad things. Fix the feature
4963 (("isnan\\(0\\)") "isnan(0.)"))
4965 (build-system gnu-build-system)
4967 `(#:tests? #f ; no check target
4969 (modify-phases %standard-phases
4970 (delete 'configure) ; no configure script
4973 (with-directory-excursion "lpsolve55"
4974 (invoke "bash" "ccc"))
4975 (with-directory-excursion "lp_solve"
4976 (invoke "bash" "ccc"))
4979 (lambda* (#:key outputs #:allow-other-keys)
4980 (let* ((out (assoc-ref outputs "out"))
4981 (bin (string-append out "/bin"))
4982 (lib (string-append out "/lib"))
4983 ;; This is where LibreOffice expects to find the header
4984 ;; files, and where they are installed by Debian.
4985 (include (string-append out "/include/lpsolve")))
4986 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4987 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4988 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4990 ;; Install a subset of the header files as on Debian
4991 ;; (plus lp_bit.h, which matches the regular expression).
4992 (for-each (lambda (name)
4993 (install-file name include))
4994 (find-files "." "lp_[HMSa-z].*\\.h$"))
4995 (with-directory-excursion "shared"
4996 (for-each (lambda (name)
4997 (install-file name include))
4998 (find-files "." "\\.h$")))
5000 (home-page "http://lpsolve.sourceforge.net/")
5001 (synopsis "Mixed integer linear programming (MILP) solver")
5003 "lp_solve is a mixed integer linear programming solver based on the
5004 revised simplex and the branch-and-bound methods.")
5005 (license license:lgpl2.1+)))
5007 ;; Private Trilinos package for dealii-openmpi (similar to
5008 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
5009 ;; This version is the latest known to be compatible with deal.II [1].
5010 ;; Since the latest version of Trilinos is not necessarily supported by
5011 ;; deal.II, it may be worth keeping this package even if and when Trilinos
5012 ;; gets packaged separately for Guix (unless various versions of Trilinos are
5015 ;; An insightful source of information for building Trilinos for deal.II lies
5016 ;; in the Trilinos package for candi [2], which is a source-based installer
5017 ;; for deal.II and its dependencies.
5019 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
5020 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
5021 (define trilinos-for-dealii-openmpi
5023 (name "trilinos-for-dealii-openmpi")
5029 (url "https://github.com/trilinos/Trilinos/")
5031 (string-append "trilinos-release-"
5032 (string-replace-substring version "." "-")))))
5033 (file-name (git-file-name "trilinos" version))
5035 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
5036 (build-system cmake-build-system)
5038 `(("gfortran" ,gfortran)
5039 ;; Trilinos's repository contains several C-shell scripts, but adding
5040 ;; tcsh to the native inputs does not result in the check phase running
5041 ;; any more tests than without it (nor is tcsh required to build
5043 ;; It seems that Trilinos has replaced its use of C-shell test scripts
5044 ;; with CMake's testing facilities.
5046 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
5047 ;; states that Zoltan's C-shell test script
5048 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
5049 ;; performed through CMake.
5051 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
5053 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
5055 ("python" ,python-2)))
5057 `(("blas" ,openblas)
5059 ("mumps" ,mumps-openmpi)
5060 ("scalapack" ,scalapack)))
5062 `(("mpi" ,openmpi)))
5064 `(#:build-type "Release"
5066 `("-DBUILD_SHARED_LIBS=ON"
5067 ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release
5068 ;; default) rather than -O2 (the RelWithDebInfo default), to conform
5069 ;; to candi's trilinos.package's compilation flags, which are -g -O3.
5070 "-DCMAKE_C_FLAGS=-g"
5071 "-DCMAKE_CXX_FLAGS=-g"
5072 "-DCMAKE_Fortran_FLAGS=-g"
5074 ;; Trilinos libraries that deal.II can interface with.
5075 "-DTrilinos_ENABLE_Amesos=ON"
5076 "-DTrilinos_ENABLE_AztecOO=ON"
5077 "-DTrilinos_ENABLE_Epetra=ON"
5078 "-DTrilinos_ENABLE_EpetraExt=ON"
5079 "-DTrilinos_ENABLE_Ifpack=ON"
5080 "-DTrilinos_ENABLE_ML=ON"
5081 "-DTrilinos_ENABLE_MueLu=ON"
5082 "-DTrilinos_ENABLE_ROL=ON"
5083 ;; Optional; required for deal.II's GridIn::read_exodusii, but
5084 ;; depends on netcdf.
5085 ;; Enable if and when someone needs it.
5086 ;;"-DTrilinos_ENABLE_SEACAS=ON"
5087 "-DTrilinos_ENABLE_Sacado=ON"
5088 "-DTrilinos_ENABLE_Teuchos=ON"
5089 "-DTrilinos_ENABLE_Tpetra=ON"
5090 "-DTrilinos_ENABLE_Zoltan=ON"
5092 ;; Third-party libraries (TPLs) that Trilinos can interface with.
5093 "-DBLAS_LIBRARY_NAMES=openblas"
5094 "-DTPL_ENABLE_MPI=ON"
5095 "-DTPL_ENABLE_MUMPS=ON"
5096 "-DTPL_ENABLE_SCALAPACK=ON"
5098 ;; Enable the tests but not the examples (which are enabled by
5099 ;; default when enabling tests).
5100 ;; Although some examples are run as tests, they are otherwise
5101 ;; unnecessary since this is a private package meant for
5103 ;; Besides, some MueLu and ROL examples require a lot of memory to
5106 ;; (For future reference, note that some ROL and SEACAS examples
5107 ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the
5108 ;; dune-istl, dune-localfunctions and dune-alugrid packages.)
5109 "-DTrilinos_ENABLE_TESTS=ON"
5110 "-DTrilinos_ENABLE_EXAMPLES=OFF"
5111 ;; MueLu tests require considerably more time and memory to compile
5112 ;; than the rest of the tests.
5113 "-DMueLu_ENABLE_TESTS=OFF"
5115 ;; The following options were gleaned from candi's trilinos.package.
5116 ;; (We do not enable the complex instantiations, which are anyway
5117 ;; provided only as an option in trilinos.package, because they are
5118 ;; costly in compilation time and memory usage, and disk space [1].)
5120 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
5121 "-DTrilinos_ENABLE_Ifpack2=OFF"
5122 "-DTeuchos_ENABLE_FLOAT=ON"
5123 "-DTpetra_INST_INT_LONG=ON"
5124 "-DTPL_ENABLE_Boost=OFF")
5126 (modify-phases %standard-phases
5127 (add-after 'configure 'fix-kokkos-config
5129 ;; GNU Make 4.3 accidentally leaves the backslash preceding the
5130 ;; number sign in strings containing a literal backslash–number
5131 ;; sign (\#) [1, 2].
5132 ;; This is still an issue in Trilinos 13.0.1, but should be fixed
5133 ;; in the following version.
5134 ;; (The latest versions of Kokkos incorporate the fix [2].)
5136 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
5137 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
5138 (substitute* "KokkosCore_config.h"
5141 (add-before 'check 'mpi-setup
5143 (home-page "https://trilinos.github.io/")
5144 (synopsis "Algorithms for engineering and scientific problems")
5146 "The Trilinos Project is an effort to develop algorithms and enabling
5147 technologies within an object-oriented software framework for the solution of
5148 large-scale, complex multi-physics engineering and scientific problems.
5149 A unique design feature of Trilinos is its focus on packages.")
5150 ;; The packages are variously licensed under more than just BSD-3 and
5151 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
5152 ;; See https://trilinos.github.io/license.html.
5153 (license (list license:bsd-3 license:lgpl2.1+))))
5155 (define-public dealii
5162 (uri (string-append "https://github.com/dealii/dealii/releases/"
5163 "download/v" version "/dealii-" version ".tar.gz"))
5165 (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
5166 (modules '((guix build utils)))
5169 ;; Remove bundled boost, muparser, TBB and UMFPACK.
5170 (delete-file-recursively "bundled")
5172 (build-system cmake-build-system)
5173 (outputs '("out" "doc"))
5175 ;; Required to build the documentation.
5177 ("doxygen" ,doxygen)
5180 `(("arpack" ,arpack-ng)
5182 ("gfortran" ,gfortran)
5184 ("muparser" ,muparser)
5187 ;; Some scripts are installed into share/deal.II/scripts that require
5188 ;; perl and python, but they are not executable (and some are missing the
5189 ;; shebang line) and therefore must be explicitly passed to the
5191 ;; Anyway, they are meant to be used at build time, so rather than adding
5192 ;; the interpreters here, any package depending on them should just add
5193 ;; the requisite interpreter to its native inputs.
5194 (list boost hdf5 suitesparse ; For UMFPACK.
5197 `(#:build-type "DebugRelease" ; Supports only Debug, Release and DebugRelease.
5198 ;; The tests take too long and must be explicitly enabled with "make
5200 ;; See https://www.dealii.org/developer/developers/testsuite.html.
5201 ;; (They can also be run for an already installed deal.II.)
5204 (let ((doc (string-append (assoc-ref %outputs "doc")
5205 "/share/doc/" ,name "-" ,version)))
5206 `("-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
5207 ,(string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
5208 ,(string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
5209 ;; Don't compile the examples because the source and CMakeLists.txt
5210 ;; are installed anyway, allowing users to do so for themselves.
5211 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
5212 ,(string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc "/examples")))
5214 (modify-phases %standard-phases
5215 (add-after 'install 'remove-build-logs
5216 ;; These build logs leak the name of the build directory by storing
5217 ;; the values of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.
5218 (lambda* (#:key outputs #:allow-other-keys)
5219 (let ((doc (string-append (assoc-ref outputs "doc")
5220 "/share/doc/" ,name "-" ,version)))
5221 (for-each delete-file (map (lambda (f) (string-append doc "/" f))
5222 '("detailed.log" "summary.log"))))
5224 (home-page "https://www.dealii.org/")
5225 (synopsis "Finite element library")
5227 "Deal.II is a C++ program library targeted at the computational solution
5228 of partial differential equations using adaptive finite elements. The main
5229 aim of deal.II is to enable rapid development of modern finite element codes,
5230 using among other aspects adaptive meshes and a wide array of tools often used
5231 in finite element programs.")
5232 (license license:lgpl2.1+)))
5234 (define-public dealii-openmpi
5235 (package/inherit dealii
5236 (name "dealii-openmpi")
5238 `(("arpack" ,arpack-ng-openmpi)
5240 ("scalapack" ,scalapack)
5241 ,@(alist-delete "arpack" (package-inputs dealii))))
5243 `(("hdf5" ,hdf5-parallel-openmpi)
5245 ("p4est" ,p4est-openmpi)
5246 ("petsc" ,petsc-openmpi)
5247 ("slepc" ,slepc-openmpi)
5248 ("trilinos" ,trilinos-for-dealii-openmpi)
5249 ,@(alist-delete "hdf5" (package-propagated-inputs dealii))))
5251 (substitute-keyword-arguments (package-arguments dealii)
5252 ((#:configure-flags flags)
5253 `(cons "-DDEAL_II_WITH_MPI=ON" ,flags))))
5254 (synopsis "Finite element library (with MPI support)")))
5256 (define-public flann
5260 (home-page "https://github.com/mariusmuja/flann/")
5264 (uri (git-reference (url home-page) (commit version)))
5265 (file-name (git-file-name name version))
5268 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
5269 (patches (search-patches "flann-cmake-3.11.patch"))))
5270 (build-system cmake-build-system)
5276 ;; FIXME: 'mkoctfile' fails with a linker error:
5277 ;; ld: cannot find -loctinterp
5278 ;; ld: cannot find -loctave
5279 ;; Disable it for now.
5280 ;;("octave" ,octave-cli)
5281 ("python" ,python-2) ; print syntax
5282 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
5285 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
5286 ;; taken 46 MiB unstripped, and 6 MiB stripped.
5287 #:strip-directories '("lib" "lib64" "libexec"
5288 "bin" "sbin" "share/flann/octave")
5290 ;; Save 12 MiB by not installing .a files. Passing
5291 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
5292 #:phases (modify-phases %standard-phases
5293 (add-after 'install 'remove-static-libraries
5294 (lambda* (#:key outputs #:allow-other-keys)
5295 (let* ((out (assoc-ref outputs "out"))
5296 (lib (string-append out "/lib")))
5297 (for-each delete-file
5298 (find-files lib "\\.a$"))
5301 #:tests? #f)) ; The test data are downloaded from the Internet.
5302 (synopsis "Library for approximate nearest neighbors computation")
5303 (description "FLANN is a library for performing fast approximate
5304 nearest neighbor searches in high dimensional spaces. It implements a
5305 collection of algorithms and a system for automatically choosing the best
5306 algorithm and optimum parameters depending on the dataset.
5308 FLANN is written in C++ and contains bindings for C, Octave and Python.")
5309 (license (license:non-copyleft "file://COPYING"
5310 "See COPYING in the distribution."))))
5312 (define-public wcalc
5319 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
5320 "wcalc-" version ".tar.bz2"))
5323 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
5324 (build-system gnu-build-system)
5326 (list mpfr readline))
5327 (home-page "http://w-calc.sourceforge.net/index.php")
5328 (synopsis "Flexible command-line scientific calculator")
5329 (description "Wcalc is a very capable calculator. It has standard functions
5330 (sin, asin, and sinh for example, in either radians or degrees), many
5331 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
5332 variables, a command history, hex/octal/binary input and output, unit
5333 conversions, embedded comments, and an expandable expression entry field. It
5334 evaluates expressions using the standard order of operations.")
5335 (license license:gpl2+)))
5344 (url "https://github.com/xaos-project/XaoS")
5345 (commit (string-append "release-" version))))
5346 (file-name (git-file-name name version))
5349 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5350 (build-system gnu-build-system)
5351 (native-inputs `(("gettext" ,gettext-minimal)
5352 ("qtbase" ,qtbase-5)
5353 ("qttools" ,qttools)))
5354 (inputs (list libx11 zlib libpng gsl))
5355 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5356 ;; not enough for this package to install properly. These phases fix that.
5358 `(#:tests? #f ;no "check" target
5360 (modify-phases %standard-phases
5361 (add-before 'configure 'make-qt-deterministic
5363 ;; Make Qt deterministic.
5364 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5367 (lambda* (#:key outputs #:allow-other-keys)
5368 (let ((out (assoc-ref outputs "out")))
5369 (substitute* "XaoS.pro"
5370 ;; The DESTDIR is originally set to install the xaos binary to
5371 ;; the "bin" folder inside the build directory. Setting make
5372 ;; flags doesn't seem to change this.
5374 (string-append "DESTDIR=" out "/bin"))
5375 ;; Set the correct path to the lrelease binary.
5376 (("lrelease-qt5") "lrelease"))
5377 (substitute* "src/include/config.h"
5378 (("/usr/share/XaoS")
5379 (string-append out "/share/XaoS")))
5381 (add-after 'install 'install-data
5382 (lambda* (#:key outputs #:allow-other-keys)
5383 (let* ((out (assoc-ref outputs "out"))
5384 (share (string-append out "/share")))
5388 (copy-recursively folder
5389 (string-append share "/XaoS/" folder)))
5390 '("catalogs" "examples" "tutorial"))
5391 (install-file "xdg/xaos.png"
5392 (string-append share "/pixmaps"))
5393 (install-file "xdg/xaos.desktop"
5394 (string-append share "/applications")))
5396 (synopsis "Real-time fractal zoomer")
5397 (description "GNU XaoS is a graphical program that generates fractal
5398 patterns and allows you to zoom in and out of them infinitely in a fluid,
5399 continuous manner. It also includes tutorials that help to explain how fractals
5400 are built. It can generate many different fractal types such as the Mandelbrot
5402 (home-page "https://xaos-project.github.io/")
5403 (license license:gpl2+)))
5405 (define-public hypre
5413 (url "https://github.com/hypre-space/hypre")
5414 (commit (string-append "v" version))))
5415 (file-name (git-file-name name version))
5417 (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
5418 (build-system gnu-build-system)
5419 (outputs '("out" ;5.3 MiB of headers and libraries
5420 "doc")) ;12 MiB of documentation
5423 ("doxygen" ,doxygen)
5425 ("python-breathe" ,python-breathe)
5426 ("python-sphinx" ,python-sphinx)
5427 ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
5439 texlive-generic-listofitems
5440 texlive-generic-ulem
5441 texlive-latex-capt-of
5443 texlive-latex-colortbl
5445 texlive-latex-fancyhdr
5446 texlive-latex-fancyvrb
5448 texlive-latex-fncychap
5449 texlive-latex-framed
5450 texlive-latex-geometry
5451 texlive-latex-hanging
5453 texlive-latex-multirow
5454 texlive-latex-natbib
5455 texlive-latex-needspace
5456 texlive-latex-newunicodechar
5457 texlive-latex-parskip
5458 texlive-latex-stackengine
5459 texlive-latex-tabulary
5460 texlive-latex-titlesec
5461 texlive-latex-tocloft
5462 texlive-latex-upquote
5463 texlive-latex-varwidth
5465 texlive-latex-wrapfig)))))
5467 `(("blas" ,openblas)
5468 ("lapack" ,lapack)))
5470 `(#:modules ((srfi srfi-1)
5471 ,@%gnu-build-system-modules)
5472 #:configure-flags '("--enable-shared"
5480 (modify-phases %standard-phases
5481 (add-before 'configure 'chdir-src
5482 (lambda _ (chdir "src")))
5484 (lambda* (#:key build target configure-flags
5485 #:allow-other-keys #:rest args)
5486 (let* ((configure (assoc-ref %standard-phases 'configure)))
5489 (list #:configure-flags
5490 (cons (string-append
5491 "--host=" (or target build))
5492 configure-flags)))))))
5493 (add-after 'build 'build-docs
5495 (invoke "make" "-C" "docs")))
5498 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5499 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5500 (invoke "make" "check" "CHECKRUN=")
5501 (for-each (lambda (filename)
5502 (let ((size (stat:size (stat filename))))
5503 (when (positive? size)
5504 (error (format #f "~a size ~d; error indication~%"
5506 (find-files "test" ".*\\.err$"))))
5507 (add-after 'install 'install-docs
5508 (lambda* (#:key outputs #:allow-other-keys)
5509 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5510 (let* ((doc (assoc-ref outputs "doc"))
5511 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5512 (with-directory-excursion "docs"
5513 (for-each (lambda (base)
5514 (install-file (string-append base ".pdf") docdir)
5515 (copy-recursively (string-append base "-html")
5516 (string-append docdir "/" base)))
5517 '("usr-manual" "ref-manual")))))))))
5518 (home-page "https://computing.llnl.gov/projects\
5519 /hypre-scalable-linear-solvers-multigrid-methods")
5520 (synopsis "Library of solvers and preconditioners for linear equations")
5522 "HYPRE is a software library of high performance preconditioners and
5523 solvers for the solution of large, sparse linear systems of equations. It
5524 features multigrid solvers for both structured and unstructured grid
5526 (license license:lgpl2.1)))
5528 (define-public hypre-openmpi
5529 (package (inherit hypre)
5530 (name "hypre-openmpi")
5533 ,@(package-inputs hypre)))
5535 (substitute-keyword-arguments (package-arguments hypre)
5536 ((#:configure-flags flags)
5538 ,@(delete "--without-MPI" ,flags)))
5540 `(modify-phases ,phases
5541 (add-before 'check 'mpi-setup
5542 ,%openmpi-setup)))))
5543 (synopsis "Parallel solvers and preconditioners for linear equations")
5545 "HYPRE is a software library of high performance preconditioners and
5546 solvers for the solution of large, sparse linear systems of equations on
5547 parallel computers. It features parallel multigrid solvers for both
5548 structured and unstructured grid problems.")))
5550 (define-public matio
5557 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5558 "matio-" version ".tar.gz"))
5561 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5562 (build-system gnu-build-system)
5564 (list zlib hdf5-1.8))
5565 (home-page "http://matio.sourceforge.net/")
5566 (synopsis "Library for reading and writing MAT files")
5567 (description "Matio is a library for reading and writing MAT files. It
5568 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5569 (license license:bsd-2)))
5576 (origin (method url-fetch)
5577 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5578 "download/" version "/Vc-" version ".tar.gz"))
5581 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5582 (build-system cmake-build-system)
5585 '("-DBUILD_TESTING=ON"
5586 ;; By default, Vc will optimize for the CPU of the build machine.
5587 ;; Setting this to "none" makes it create portable binaries. See
5588 ;; "cmake/OptimizeForArchitecture.cmake".
5589 "-DTARGET_ARCHITECTURE=none")
5590 #:phases (modify-phases %standard-phases
5591 (add-after 'unpack 'copy-testdata
5592 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5593 (let ((testdata (assoc-ref (or native-inputs inputs)
5595 (copy-recursively testdata "tests/testdata")
5598 `(("virtest" ,virtest)
5600 ;; This is a submodule in the git project, but not part of the
5601 ;; released sources. See the git branch for the commit to take.
5602 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5606 (url "https://github.com/VcDevel/vc-testdata")
5607 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5608 (file-name (git-file-name "vc-testdata"
5609 (string-take commit 7)))
5612 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5613 (synopsis "SIMD vector classes for C++")
5614 (description "Vc provides portable, zero-overhead C++ types for explicitly
5615 data-parallel programming. It is a library designed to ease explicit
5616 vectorization of C++ code. Its types enable explicitly stating data-parallel
5617 operations on multiple values. The parallelism is therefore added via the type
5618 system. Vc has an intuitive API and provides portability between different
5619 compilers and compiler versions as well as portability between different vector
5620 instruction sets. Thus, an application written with Vc can be compiled for:
5623 @item SSE2 up to SSE4.2 or SSE4a
5626 @item NEON (in development)
5627 @item NVIDIA GPUs / CUDA (in development)
5629 (home-page "https://github.com/VcDevel/Vc")
5630 ;; "No support_???.cpp file exists for this architecture."
5631 (supported-systems '("x86_64-linux" "i686-linux"))
5632 (license license:bsd-3)))
5634 (define-public reducelcs
5635 ;; This is the last commit which is available upstream, no
5636 ;; release happened since 2010.
5637 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5641 (version (string-append "1.0-" revision "." (string-take commit 7)))
5646 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5648 (file-name (string-append name "-" version "-checkout"))
5651 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5652 (build-system gnu-build-system)
5656 `(#:tests? #f ; no tests
5658 (modify-phases %standard-phases
5659 (delete 'configure) ; No configure script exists.
5660 (replace 'install ; No install phase exists.
5661 (lambda* (#:key outputs #:allow-other-keys)
5662 (let* ((out (assoc-ref outputs "out"))
5663 (bin (string-append out "/bin")))
5664 (install-file "Approximation" bin)
5665 (install-file "CollectResults" bin)
5666 (install-file "GenerateInstances" bin)
5668 (synopsis "Approximate Longest Commons Subsequence computation tool")
5670 "@code{reduceLCS} is an implementation of the Reduce-Expand
5671 algorithm for LCS. It is a fast program to compute the approximate
5672 Longest Commons Subsequence of a set of strings.")
5673 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5674 (license license:gpl3+))))
5676 (define-public jacal
5683 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5686 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
5687 (patches (search-patches "jacal-fix-texinfo.patch"))))
5688 (build-system gnu-build-system)
5691 (modify-phases %standard-phases
5692 (add-before 'build 'pre-build
5693 ;; Don't use upstream's script - it really doesn't fit into
5694 ;; Guix's functional paradigm.
5695 (lambda* (#:key inputs outputs #:allow-other-keys)
5696 (substitute* "Makefile"
5697 (("^install: install-script") "install: "))))
5698 (add-after 'install 'post-install
5699 ;; Instead, we provide our own simplified script.
5700 (lambda* (#:key inputs outputs #:allow-other-keys)
5701 (let ((wrapper (string-append (assoc-ref outputs "out")
5703 (format (open wrapper (logior O_WRONLY O_CREAT))
5704 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5705 "-e '(slib:load \"~a/lib/jacal/math\") "
5708 (assoc-ref inputs "scm")
5709 (assoc-ref outputs "out"))
5710 (chmod wrapper #o555))))
5712 (lambda* (#:key outputs #:allow-other-keys)
5713 (invoke "./configure"
5714 (string-append "--prefix="
5715 (assoc-ref outputs "out"))))))))
5717 (native-inputs (list unzip texinfo))
5718 (synopsis "Symbolic mathematics system")
5719 (description "GNU JACAL is an interactive symbolic mathematics program based on
5720 Scheme. It manipulate and simplify a range of mathematical expressions such
5721 as equations, scalars, vectors, and matrices.")
5722 (home-page "https://www.gnu.org/software/jacal/")
5723 (license license:gpl3+)))
5729 (home-page "https://github.com/Z3Prover/z3")
5732 (uri (git-reference (url home-page)
5733 (commit (string-append "z3-" version))))
5734 (file-name (git-file-name name version))
5737 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5738 (build-system gnu-build-system)
5740 `(#:imported-modules ((guix build python-build-system)
5741 ,@%gnu-build-system-modules)
5742 #:modules (((guix build python-build-system) #:select (site-packages))
5743 (guix build gnu-build-system)
5746 (modify-phases %standard-phases
5747 (add-after 'unpack 'enable-bytecode-determinism
5749 (setenv "PYTHONHASHSEED" "0")
5751 (add-after 'unpack 'fix-compatability
5752 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5754 (substitute* "src/util/mpz.cpp"
5755 (("#include <immintrin.h>") ""))
5757 (add-before 'configure 'bootstrap
5759 (invoke "python" "scripts/mk_make.py")))
5760 ;; work around gnu-build-system's setting --enable-fast-install
5761 ;; (z3's `configure' is a wrapper around the above python file,
5762 ;; which fails when passed --enable-fast-install)
5764 (lambda* (#:key inputs outputs #:allow-other-keys)
5765 (invoke "./configure"
5767 (string-append "--prefix=" (assoc-ref outputs "out"))
5768 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5769 (add-after 'configure 'change-directory
5773 (add-before 'check 'make-test-z3
5775 ;; Build the test suite executable.
5776 (invoke "make" "test-z3" "-j"
5777 (number->string (parallel-job-count)))))
5780 ;; Run all the tests that don't require arguments.
5781 (invoke "./test-z3" "/a"))))))
5784 ("python" ,python-wrapper)))
5785 (synopsis "Theorem prover")
5786 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5787 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5788 (license license:expat)))
5790 (define-public ocaml-z3
5795 `(#:imported-modules ((guix build python-build-system)
5796 ,@%gnu-build-system-modules)
5797 #:modules (((guix build python-build-system) #:select (site-packages))
5798 (guix build gnu-build-system)
5800 #:tests? #f; no ml tests
5802 (modify-phases %standard-phases
5803 (add-before 'configure 'bootstrap
5804 (lambda* (#:key outputs #:allow-other-keys)
5805 (let ((out (assoc-ref outputs "out")))
5806 (setenv "OCAMLFIND_LDCONF" "ignore")
5807 (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
5808 (mkdir-p (string-append out "/lib/ocaml/site-lib"))
5809 (substitute* "scripts/mk_util.py"
5811 (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'"))
5812 ;; Do not build z3 again, use the library passed as input
5814 (("z3linkdep,") "\"\",")
5815 (("z3linkdep)") "\"\")"))
5816 (invoke "python" "scripts/mk_make.py"))))
5818 (lambda* (#:key inputs outputs #:allow-other-keys)
5819 (invoke "./configure"
5821 (string-append "--prefix=" (assoc-ref outputs "out")))))
5822 (add-after 'configure 'change-directory
5828 (invoke "make" "ml")))
5830 (lambda* (#:key outputs #:allow-other-keys)
5831 (invoke "ocamlfind" "install" "-destdir"
5832 (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")
5833 "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi"
5834 "api/ml/z3enums.cmx" "api/ml/z3native.mli"
5835 "api/ml/z3native.cmi" "api/ml/z3native.cmx"
5836 "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx"
5837 "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma"
5838 "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so"))))))
5841 ("python" ,python-wrapper)
5843 ("ocaml-findlib" ,ocaml-findlib)))
5845 (list ocaml-zarith))
5852 (version "2018.11.001")
5855 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5856 version "/elpa-" version ".tar.gz"))
5859 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5860 (build-system gnu-build-system)
5862 `(("fortran" ,gfortran)
5863 ("perl" ,perl))) ;for configure and deps
5865 `(("blas" ,openblas)))
5870 ;; ELPA unfortunately does not support runtime dispatch, so we can
5871 ;; only enable the "generic" kernels. See the "Cross compilation"
5872 ;; section of INSTALL.md.
5874 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5875 "--disable-avx" "--disable-avx2" "--disable-avx512"
5876 ,(string-append "CFLAGS=-O3 "
5877 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5878 "-ftree-vect-loop-version -ftree-vectorize "
5879 ,(let ((system (or (%current-target-system)
5880 (%current-system))))
5882 ((or (string-prefix? "x86_64" system)
5883 (string-prefix? "i686" system))
5886 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5888 (modify-phases %standard-phases
5889 (add-before 'configure 'patch-header-generation
5891 (substitute* "configure"
5892 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5893 (string-append & " CPP=\"$CPP\"")))
5895 (add-before 'check 'setup-tests
5897 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5898 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5899 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5900 ;; for Fortran. This also causes several tests to pass that
5901 ;; otherwise would otherwise fail with matrix size 5000; possibly
5902 ;; due to floating point tolerances that are too tight.
5903 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5904 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5905 (substitute* "Makefile"
5906 ;; Test scripts are generated, patch the shebang
5907 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5909 (home-page "https://elpa.mpcdf.mpg.de")
5910 (synopsis "Eigenvalue solvers for symmetric matrices")
5912 "The ELPA library provides efficient and scalable direct eigensolvers for
5913 symmetric matrices.")
5914 (license license:lgpl3)))
5916 (define-public elpa-openmpi
5917 (package (inherit elpa)
5918 (name "elpa-openmpi")
5921 ("scalapack" ,scalapack)
5922 ,@(package-inputs elpa)))
5924 (substitute-keyword-arguments (package-arguments elpa)
5925 ((#:configure-flags cf '())
5926 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5927 ((#:phases phases '%standard-phases)
5928 `(modify-phases ,phases
5929 (add-before 'check 'mpi-setup
5931 ;; Tests use 2 mpi tasks by default, use our remaining build
5932 ;; cores as OpenMP threads.
5933 (setenv "OMP_NUM_THREADS" (number->string
5934 (max (quotient (parallel-job-count) 2)
5936 (,%openmpi-setup)))))))
5937 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5939 (define-public elemental
5946 (url "https://github.com/elemental/Elemental")
5947 (commit (string-append "v" version))))
5948 (file-name (git-file-name name version))
5951 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5952 (build-system cmake-build-system)
5953 (home-page "https://github.com/elemental/Elemental")
5957 `(("blas" ,openblas)
5958 ("gfortran:lib" ,gfortran "lib")
5967 `(#:build-type "Release" ;default RelWithDebInfo not supported
5968 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5969 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5970 "-DEL_CACHE_WARNINGS:BOOL=YES"
5971 "-DEL_TESTS:BOOL=YES"
5972 "-DCMAKE_INSTALL_LIBDIR=lib"
5973 "-DGFORTRAN_LIB=gfortran")
5974 #:phases (modify-phases %standard-phases
5975 (add-before 'check 'mpi-setup
5977 (add-before 'check 'setup-tests
5979 ;; Parallelism is done at the MPI layer.
5980 (setenv "OMP_NUM_THREADS" "1")
5982 (add-after 'install 'remove-tests
5983 (lambda* (#:key outputs #:allow-other-keys)
5984 ;; Tests are installed, with no easy configuration
5985 ;; switch to prevent this, so delete them.
5986 (delete-file-recursively
5987 (string-append (assoc-ref outputs "out") "/bin"))
5989 (synopsis "Dense and sparse-direct linear algebra and optimization")
5990 (description "Elemental is a modern C++ library for distributed-memory
5991 dense and sparse-direct linear algebra, conic optimization, and lattice
5993 (license license:bsd-2)))
5995 (define-public mcrl2
5998 (version "202106.0")
6002 "https://www.mcrl2.org/download/release/mcrl2-"
6006 "1xgx3cd57vc7gbjic24j1q2za6j3ybz6nk4afvvpbwsf33xnlf4v"))))
6008 (list boost glu mesa qtbase-5))
6009 (build-system cmake-build-system)
6010 (synopsis "Toolset for the mCRL2 formal specification language")
6012 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
6013 specification language for describing concurrent discrete event systems. Its
6014 toolset supports analysis and automatic verification, linearisation, simulation,
6015 state-space exploration and generation, and tools to optimise and analyse
6016 specifications. Also, state spaces can be manipulated, visualised and
6018 (home-page "https://mcrl2.org")
6019 (license license:boost1.0)))
6021 (define-public mcrl2-minimal
6024 (name "mcrl2-minimal")
6028 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
6030 (define-public tcalc
6037 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
6041 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
6042 (build-system gnu-build-system)
6043 (synopsis "The terminal calculator")
6045 "The terminal calculator is a small program to help users of the GNU/Linux
6046 terminal do calculations simply and quickly. The formula to be calculated can
6047 be fed to @command{tcalc} through the command line.")
6048 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
6049 (license license:gpl3+)))
6051 (define-public tiny-bignum
6052 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
6054 (name "tiny-bignum")
6055 (version (git-version "0" "0" commit))
6060 (url "https://github.com/kokke/tiny-bignum-c")
6062 (file-name (git-file-name "tiny-bignum" commit))
6064 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
6065 (build-system gnu-build-system)
6068 (modify-phases %standard-phases
6070 (add-after 'unpack 'patch-tests
6072 (substitute* "scripts/test_rand.py"
6074 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
6077 (lambda* (#:key tests? #:allow-other-keys)
6079 (invoke "make" "test"))
6082 (lambda* (#:key outputs #:allow-other-keys)
6083 (let ((share (string-append (assoc-ref outputs "out") "/share"))
6084 (doc (string-append (assoc-ref outputs "out") "/doc")))
6086 (install-file "bn.c" share)
6087 (install-file "bn.h" share)
6089 (install-file "LICENSE" doc)
6090 (install-file "README.md" doc))
6093 `(("python" ,python-wrapper)))
6094 (home-page "https://github.com/kokke/tiny-bignum-c")
6095 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
6097 "This library provides portable Arbitrary-precision unsigned integer
6098 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
6099 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
6100 and comparisons are supported.")
6101 (license license:unlicense))))
6103 (define-public sundials
6110 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
6111 "sundials-" version ".tar.gz"))
6114 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
6115 (build-system cmake-build-system)
6117 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
6119 `(("fortran" ,gfortran) ;for fcmix
6121 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
6123 `(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
6124 "-DEXAMPLES_ENABLE_C:BOOL=ON"
6125 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
6126 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
6127 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
6128 "-DEXAMPLES_INSTALL:BOOL=OFF"
6130 "-DFCMIX_ENABLE:BOOL=ON"
6132 "-DKLU_ENABLE:BOOL=ON"
6133 ,(string-append "-DKLU_INCLUDE_DIR="
6134 (assoc-ref %build-inputs "suitesparse")
6136 ,(string-append "-DKLU_LIBRARY_DIR="
6137 (assoc-ref %build-inputs "suitesparse")
6139 (home-page "https://computation.llnl.gov/projects/sundials")
6140 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
6141 (description "SUNDIALS is a family of software packages implemented with
6142 the goal of providing robust time integrators and nonlinear solvers that can
6143 easily be incorporated into existing simulation codes.")
6145 '((release-monitoring-url
6146 . "https://computing.llnl.gov/projects/sundials/sundials-software")))
6147 (license license:bsd-3)))
6149 (define-public sundials-openmpi
6150 (package (inherit sundials)
6151 (name "sundials-openmpi")
6154 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
6155 ,@(package-inputs sundials)))
6157 (substitute-keyword-arguments (package-arguments sundials)
6158 ((#:configure-flags flags '())
6159 `(cons* "-DMPI_ENABLE:BOOL=ON"
6160 "-DPETSC_ENABLE:BOOL=ON"
6161 (string-append "-DPETSC_INCLUDE_DIR="
6162 (assoc-ref %build-inputs "petsc")
6164 (string-append "-DPETSC_LIBRARY_DIR="
6165 (assoc-ref %build-inputs "petsc")
6168 ((#:phases phases '%standard-phases)
6169 `(modify-phases ,phases
6170 (add-before 'check 'mpi-setup
6171 ,%openmpi-setup)))))
6172 (synopsis "SUNDIALS with OpenMPI support")))
6174 (define-public sundials-julia
6177 (name "sundials-julia")
6183 (url "https://github.com/LLNL/sundials")
6184 (commit (string-append "v" version))))
6185 (file-name (git-file-name name version))
6188 "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv"))))
6190 (modify-inputs (package-inputs sundials)
6193 (substitute-keyword-arguments (package-arguments sundials)
6194 ((#:configure-flags flags '())
6195 `(cons* "-DLAPACK_ENABLE:BOOL=ON"
6197 (synopsis "SUNDIALS with lapack support as required by julia-sundials-jll")))
6199 (define-public combinatorial-blas
6201 (name "combinatorial-blas")
6206 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
6208 (match (string-split version #\.)
6209 ((major minor patch)
6210 (string-append major minor "_" patch))) ;e.g. "16_2"
6214 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
6215 (patches (search-patches "combinatorial-blas-awpm.patch"
6216 "combinatorial-blas-io-fix.patch"))))
6217 (build-system cmake-build-system)
6220 ("test-data" ,(origin
6222 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
6223 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
6226 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
6228 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
6229 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
6230 #:parallel-tests? #f ;tests use 'mpiexec -n4'
6232 (modify-phases %standard-phases
6233 (add-before 'check 'mpi-setup
6235 (add-before 'check 'test-setup
6236 (lambda* (#:key inputs #:allow-other-keys)
6237 (setenv "OMP_NUM_THREADS" "2")
6238 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
6239 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
6240 (synopsis "Linear algebra primitives for graph analytics")
6241 (description "The Combinatorial BLAS (CombBLAS) is an extensible
6242 distributed-memory parallel graph library offering a small but powerful set of
6243 linear algebra primitives specifically targeting graph analytics.")
6245 license:gpl2+ ;include/psort/(funnel|sort)*.h
6246 license:x11 ;usort and psort
6247 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
6249 (define-public dune-common
6251 (name "dune-common")
6256 (uri (string-append "https://dune-project.org/download/"
6257 version "/dune-common-" version ".tar.gz"))
6260 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
6261 (build-system cmake-build-system)
6264 (modify-phases %standard-phases
6265 (add-after 'build 'build-tests
6266 (lambda* (#:key make-flags #:allow-other-keys)
6267 (apply invoke "make" "build_tests" make-flags))))))
6269 (list gmp metis openblas python superlu))
6271 (list gfortran pkg-config))
6272 (home-page "https://dune-project.org/")
6273 (synopsis "Distributed and Unified Numerics Environment")
6274 (description "DUNE, the Distributed and Unified Numerics Environment is a
6275 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6276 grid-based methods. It supports the easy implementation of methods like
6277 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6278 Differences} (FD).")
6279 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
6280 (license license:gpl2)))
6282 (define-public dune-geometry
6284 (name "dune-geometry")
6289 (uri (string-append "https://dune-project.org/download/"
6290 version "/dune-geometry-" version ".tar.gz"))
6293 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
6294 (build-system cmake-build-system)
6297 (modify-phases %standard-phases
6298 (add-after 'build 'build-tests
6299 (lambda* (#:key make-flags #:allow-other-keys)
6300 (apply invoke "make" "build_tests" make-flags))))))
6304 openblas gmp python))
6306 (list gfortran pkg-config))
6307 (home-page "https://dune-project.org/")
6308 (synopsis "Distributed and Unified Numerics Environment")
6309 (description "DUNE, the Distributed and Unified Numerics Environment is a
6310 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6311 grid-based methods. It supports the easy implementation of methods like
6312 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6315 This package contains the basic DUNE geometry classes.")
6316 ;; GPL version 2 with "runtime exception"
6317 (license license:gpl2)))
6319 (define-public dune-uggrid
6321 (name "dune-uggrid")
6327 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
6328 (commit (string-append "v" version))))
6329 (file-name (git-file-name name version))
6332 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
6333 (build-system cmake-build-system)
6336 (modify-phases %standard-phases
6337 (add-after 'build 'build-tests
6338 (lambda* (#:key make-flags #:allow-other-keys)
6339 (apply invoke "make" "build_tests" make-flags))))))
6343 (list gfortran pkg-config))
6344 (home-page "https://dune-project.org/")
6345 (synopsis "Distributed and Unified Numerics Environment")
6346 (description "DUNE, the Distributed and Unified Numerics Environment is a
6347 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6348 grid-based methods. It supports the easy implementation of methods like
6349 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6352 This package contains the DUNE UG grid classes.")
6353 (license license:lgpl2.1)))
6355 (define-public dune-grid
6362 (uri (string-append "https://dune-project.org/download/"
6363 version "/dune-grid-" version ".tar.gz"))
6366 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
6367 (build-system cmake-build-system)
6370 (modify-phases %standard-phases
6371 (add-after 'build 'build-tests
6372 (lambda* (#:key make-flags #:allow-other-keys)
6373 (apply invoke "make" "build_tests" make-flags))))))
6384 (list gfortran pkg-config))
6385 (home-page "https://dune-project.org/")
6386 (synopsis "Distributed and Unified Numerics Environment")
6387 (description "DUNE, the Distributed and Unified Numerics Environment is a
6388 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6389 grid-based methods. It supports the easy implementation of methods like
6390 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6393 This package contains the basic DUNE grid classes.")
6394 ;; GPL version 2 with "runtime exception"
6395 (license license:gpl2)))
6397 (define-public dune-istl
6404 (uri (string-append "https://dune-project.org/download/"
6405 version "/dune-istl-" version ".tar.gz"))
6408 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
6409 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
6410 (build-system cmake-build-system)
6413 (modify-phases %standard-phases
6414 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6415 ;; the stdlib types when the gfortran header is used. Remove gfortran
6416 ;; from CPLUS_INCLUDE_PATH as a workaround.
6417 (add-after 'set-paths 'hide-gfortran
6418 (lambda* (#:key inputs #:allow-other-keys)
6419 (let ((gfortran (assoc-ref inputs "gfortran")))
6420 (setenv "CPLUS_INCLUDE_PATH"
6422 (delete (string-append gfortran "/include/c++")
6423 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6426 (add-after 'build 'build-tests
6427 (lambda* (#:key make-flags #:allow-other-keys)
6428 (apply invoke "make" "build_tests" make-flags))))))
6439 (list gfortran pkg-config))
6440 (home-page "https://dune-project.org/")
6441 (synopsis "Distributed and Unified Numerics Environment")
6442 (description "DUNE, the Distributed and Unified Numerics Environment is a
6443 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6446 This is the iterative solver template library which provides generic sparse
6447 matrix/vector classes and a variety of solvers based on these classes. A
6448 special feature is the use of templates to exploit the recursive block
6449 structure of finite element matrices at compile time. Available solvers
6450 include Krylov methods, (block-) incomplete decompositions and
6451 aggregation-based algebraic multigrid.")
6452 ;; GPL version 2 with "runtime exception"
6453 (license license:gpl2)))
6455 (define-public dune-localfunctions
6457 (name "dune-localfunctions")
6462 (uri (string-append "https://dune-project.org/download/"
6463 version "/dune-localfunctions-" version ".tar.gz"))
6466 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
6467 (build-system cmake-build-system)
6470 (modify-phases %standard-phases
6471 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6472 ;; and fails to find the stdlib types when the gfortran header is used.
6473 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6474 (add-after 'set-paths 'hide-gfortran
6475 (lambda* (#:key inputs #:allow-other-keys)
6476 (let ((gfortran (assoc-ref inputs "gfortran")))
6477 (setenv "CPLUS_INCLUDE_PATH"
6479 (delete (string-append gfortran "/include/c++")
6480 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6483 (add-after 'build 'build-tests
6484 (lambda* (#:key make-flags #:allow-other-keys)
6485 (apply invoke "make" "build_tests" make-flags))))))
6494 (list gfortran pkg-config))
6495 (home-page "https://dune-project.org/")
6496 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6497 (description "This DUNE module provides interface and implementation for
6498 shape functions defined on the DUNE reference elements. In addition to the
6499 shape function, interpolation operators and special keys are provided which
6500 can be used to assemble global function spaces on finite-element grids.
6502 This package provides an interface and implementation for shape functions
6503 defined on the DUNE reference elements. In addition to the shape function,
6504 interpolation operators and special keys are provided which can be used to
6505 assemble global function spaces on finite-element grids.")
6506 ;; GPL version 2 with "runtime exception"
6507 (license license:gpl2)))
6509 (define-public dune-alugrid
6511 (name "dune-alugrid")
6512 (version "2.7.0-git-81d35682")
6517 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6518 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
6519 (file-name (git-file-name name version))
6522 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
6523 (build-system cmake-build-system)
6526 (modify-phases %standard-phases
6527 (add-after 'unpack 'patch-include
6529 (substitute* "dune/alugrid/test/test-alugrid.cc"
6530 (("doc/grids/gridfactory/testgrids")
6531 "doc/dune-grid/grids/gridfactory/testgrids"))
6533 (add-after 'build 'build-tests
6534 (lambda* (#:key inputs make-flags #:allow-other-keys)
6535 (setenv "CPLUS_INCLUDE_PATH"
6536 (string-append (assoc-ref inputs "dune-grid") "/share"))
6537 (apply invoke "make" "build_tests" make-flags))))))
6550 (list gfortran pkg-config))
6551 (home-page "https://dune-project.org/")
6552 (synopsis "Distributed and Unified Numerics Environment")
6553 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6554 implementation of the DUNE grid interface supporting either simplices or
6556 (license license:gpl2+)))
6558 (define-public dune-subgrid
6560 (name "dune-subgrid")
6561 (version "2.7.0-git-2103a363")
6566 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6567 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
6568 (file-name (git-file-name name version))
6571 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
6572 (build-system cmake-build-system)
6575 (modify-phases %standard-phases
6576 (add-after 'build 'build-tests
6577 (lambda* (#:key make-flags #:allow-other-keys)
6578 (apply invoke "make" "build_tests" make-flags))))))
6588 (list gfortran pkg-config))
6589 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6590 (synopsis "Distributed and Unified Numerics Environment")
6591 (description "The dune-subgrid module marks elements of
6592 another hierarchical dune grid. The set of marked elements can then be
6593 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6594 provides the full grid interface including adaptive mesh refinement.")
6595 (license license:gpl2+)))
6597 (define-public dune-typetree
6599 (name "dune-typetree")
6605 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6606 (commit (string-append "v" version))))
6607 (file-name (git-file-name name version))
6610 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
6611 (build-system cmake-build-system)
6614 (modify-phases %standard-phases
6615 (add-after 'build 'build-tests
6616 (lambda* (#:key make-flags #:allow-other-keys)
6617 (apply invoke "make" "build_tests" make-flags))))))
6627 (list gfortran pkg-config))
6628 (home-page "https://dune-project.org/")
6629 (synopsis "Distributed and Unified Numerics Environment")
6630 (description "TypeTree is a template library for constructing and
6631 operating on statically typed trees of objects.")
6632 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6633 (license (list license:lgpl3+ license:gpl2))))
6635 (define-public dune-functions
6637 (name "dune-functions")
6643 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6644 (commit (string-append "v" version))))
6645 (file-name (git-file-name name version))
6648 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
6649 (build-system cmake-build-system)
6652 (modify-phases %standard-phases
6653 (add-after 'unpack 'disable-failing-tests
6656 ;; unable to load GMSH file in this test
6657 "--exclude-regex gridviewfunctionspacebasistest")
6659 (add-after 'build 'build-tests
6660 (lambda* (#:key make-flags #:allow-other-keys)
6661 (apply invoke "make" "build_tests" make-flags))))))
6675 (list gfortran pkg-config))
6676 (home-page "https://dune-project.org/")
6677 (synopsis "Distributed and Unified Numerics Environment")
6678 (description "The dune-functions module provides an abstraction layer for
6679 global finite element functions. Its two main concepts are functions
6680 implemented as callable objects, and bases of finite element spaces.")
6681 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6682 (license (list license:lgpl3+ license:gpl2))))
6684 (define-public dune-pdelab
6686 (name "dune-pdelab")
6687 (version "2.7.0-git-476fe437")
6692 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6693 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
6694 (file-name (git-file-name name version))
6697 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
6698 (build-system cmake-build-system)
6699 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
6716 (list gfortran pkg-config))
6717 (home-page "https://dune-project.org/")
6718 (synopsis "Differential equations solver toolbox")
6719 (description "PDELab is a partial differential equations solver toolbox
6720 built on top of DUNE, the Distributed and Unified Numerics Environment.")
6721 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6722 (license (list license:lgpl3+ license:gpl2))))
6724 (define add-openmpi-to-dune-package
6725 (let ((dune-package?
6726 (lambda (p) (string-prefix? "dune-" (package-name p)))))
6729 (if (dune-package? p)
6730 (package (inherit p)
6731 (name (string-append (package-name p) "-openmpi"))
6732 (inputs `(,@(package-inputs p)
6733 ("openmpi" ,openmpi)))
6735 (substitute-keyword-arguments (package-arguments p)
6736 ((#:phases phases '%standard-phases)
6737 `(modify-phases ,phases
6738 (add-before 'check 'mpi-setup
6739 ,%openmpi-setup)))))
6740 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
6742 (negate dune-package?))))
6744 (define-public dune-common-openmpi
6745 (add-openmpi-to-dune-package dune-common))
6747 (define-public dune-geometry-openmpi
6748 (add-openmpi-to-dune-package dune-geometry))
6750 (define-public dune-istl-openmpi
6751 (add-openmpi-to-dune-package dune-istl))
6753 (define-public dune-typetree-openmpi
6754 (add-openmpi-to-dune-package dune-typetree))
6756 (define-public dune-uggrid-openmpi
6757 (add-openmpi-to-dune-package dune-uggrid))
6759 (define-public dune-grid-openmpi
6760 (add-openmpi-to-dune-package dune-grid))
6762 (define-public dune-alugrid-openmpi
6763 (add-openmpi-to-dune-package dune-alugrid))
6765 (define-public dune-subgrid-openmpi
6766 (add-openmpi-to-dune-package dune-subgrid))
6768 (define-public dune-localfunctions-openmpi
6769 (add-openmpi-to-dune-package dune-localfunctions))
6771 (define-public dune-functions-openmpi
6772 (add-openmpi-to-dune-package dune-functions))
6774 (define-public dune-pdelab-openmpi
6775 (add-openmpi-to-dune-package dune-pdelab))
6777 (define-public mlucas
6785 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
6787 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
6788 (build-system gnu-build-system)
6792 `(#:tests? #f ; no tests
6794 (modify-phases %standard-phases
6798 (call-with-output-file "Makefile"
6800 (format port "CC = gcc
6801 CFLAGS = -O3 ~a -DUSE_THREADS
6802 LDLIBS = -lm -lpthread -lrt
6803 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6805 ,(let ((system (or (%current-target-system)
6806 (%current-system))))
6808 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6812 (lambda* (#:key outputs #:allow-other-keys)
6813 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6814 (install-file "Mlucas" bin)
6815 (install-file "primenet.py" bin))
6817 (home-page "https://www.mersenne.org")
6818 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6819 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6820 numbers in search of a world-record prime. You may use it to test any
6821 suitable number as you wish, but it is preferable that you do so in a
6822 coordinated fashion, as part of the Great Internet Mersenne Prime
6823 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6824 management via the GIMPS project's Primenet server.")
6825 (license license:gpl2+)))
6827 (define-public nauty
6835 "https://pallini.di.uniroma1.it/"
6836 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6838 (base32 "1hl81gpf3xjf809w04jczvilq1ixy9ch1qrax8a7lgx52svna1jg"))))
6839 (build-system gnu-build-system)
6840 (outputs '("out" "lib"))
6842 `(#:test-target "checks"
6843 #:configure-flags '("--enable-generic") ;prevent -march-native
6845 (modify-phases %standard-phases
6846 ;; Default make target does not build all available
6847 ;; executables. Create them now.
6848 (add-after 'build 'build-extra-programs
6850 (for-each (lambda (target) (invoke "make" target))
6851 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6853 ;; Upstream does not provide any install target.
6855 (lambda* (#:key outputs #:allow-other-keys)
6856 (let* ((out (assoc-ref outputs "out"))
6857 (lib-output (assoc-ref outputs "lib"))
6858 (bin (string-append out "/bin"))
6859 (doc (string-append out "/share/doc/nauty/"))
6860 (include (string-append lib-output "/include/nauty"))
6861 (lib (string-append lib-output "/lib/nauty")))
6862 (for-each (lambda (f) (install-file f bin))
6863 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6864 "bliss2dre" "catg" "checks6" "complg" "converseg"
6865 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6866 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6867 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6868 "gentourng" "gentreeg" "hamheuristic" "labelg"
6869 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6870 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6871 "sumlines" "twohamg" "underlyingg" "vcolg"
6872 "watercluster2" "NRswitchg"))
6873 (for-each (lambda (f) (install-file f include))
6874 (find-files "." "\\.h$"))
6875 (for-each (lambda (f) (install-file f lib))
6876 (find-files "." "\\.a$"))
6877 (for-each (lambda (f) (install-file f doc))
6878 (append '("formats.txt" "README" "schreier.txt")
6879 (find-files "." "\\.pdf$")))))))))
6881 (list gmp)) ;for sumlines
6882 (home-page "https://pallini.di.uniroma1.it/")
6883 (synopsis "Library for graph automorphisms")
6884 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6885 procedures for computing automorphism groups of graphs and digraphs.
6887 @code{nauty} computes graph information in the form of a set of
6888 generators, the size of the group, and the orbits of the group; it can
6889 also produce a canonical label. The @code{nauty} suite is written in
6890 C and comes with a command-line interface, a collection of
6891 command-line tools, and an Application Programming Interface (API).
6893 This package provides the static libraries required to run programs
6894 compiled against the nauty library.")
6895 (license license:asl2.0)))
6904 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6905 "ftp/releases/" version
6906 "/ppl-" version ".tar.gz"))
6909 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6910 (build-system gnu-build-system)
6915 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6917 "Parma Polyhedra Library for computations with polyhedra")
6919 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6920 especially targeted at applications in the field of analysis and
6921 verification of complex systems. These abstractions include convex
6922 polyhedra, defined as the intersection of a finite number of (open or
6923 closed) halfspaces, each described by a linear inequality (strict or
6924 non-strict) with rational coefficients; some special classes of polyhedra
6925 shapes that offer interesting complexity/precision tradeoffs; and grids
6926 which represent regularly spaced points that satisfy a set of linear
6927 congruence relations. The library also supports finite powersets and
6928 products of (any kind of) polyhedra and grids, a mixed integer linear
6929 programming problem solver using an exact-arithmetic version of the simplex
6930 algorithm, a parametric integer programming solver, and primitives for
6931 termination analysis via the automatic synthesis of linear ranking
6933 (license license:gpl3+)))
6935 (define-public speedcrunch
6937 (name "speedcrunch")
6943 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6944 (commit (string-append "release-" version))))
6945 (file-name (git-file-name name version))
6948 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6949 (build-system cmake-build-system)
6950 (inputs (list qtbase-5))
6951 (native-inputs (list qttools))
6954 (modify-phases %standard-phases
6955 (add-after 'unpack 'chdir-to-src
6956 (lambda _ (chdir "src") #t)))))
6957 (synopsis "High-precision scientific calculator")
6959 "SpeedCrunch is a high-precision scientific calculator. It features a
6960 syntax-highlighted scrollable display and is designed to be fully used via
6961 keyboard. Some distinctive features are auto-completion of functions and
6962 variables, a formula book, and quick insertion of constants from various
6963 fields of knowledge.")
6964 (home-page "https://speedcrunch.org/")
6965 (license license:gpl2+)))
6967 (define-public minisat
6968 ;; This is the last commit which is available upstream, no
6969 ;; release happened since 2010.
6970 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6974 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6979 (url "https://github.com/niklasso/minisat")
6981 (file-name (string-append name "-" version "-checkout"))
6984 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6986 (search-patches "minisat-friend-declaration.patch"
6987 "minisat-install.patch"))))
6988 (build-system gnu-build-system)
6990 '(#:make-flags (list (string-append "prefix=" %output))
6991 #:tests? #f ;no check target
6993 (modify-phases %standard-phases
6994 (delete 'configure))))
6996 `(("zlib:static" ,zlib "static")
6999 "Small, yet efficient, SAT solver")
7001 "MiniSat is a minimalistic, open-source SAT solver, developed to help
7002 researchers and developers alike to get started on SAT.")
7004 "http://minisat.se/MiniSat.html")
7005 (license license:expat))))
7007 (define-public libqalculate
7009 (name "libqalculate")
7015 (url "https://github.com/Qalculate/libqalculate/")
7016 (commit (string-append "v" version))))
7017 (file-name (git-file-name name version))
7019 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
7021 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
7022 (build-system gnu-build-system)
7024 `(("pkg-config" ,pkg-config)
7025 ("gettext" ,gettext-minimal)
7026 ("intltool" ,intltool)
7027 ("automake" ,automake)
7028 ("autoconf" ,autoconf)
7029 ("libtool" ,libtool)
7030 ("doxygen" ,doxygen)
7043 (modify-phases %standard-phases
7044 (add-before 'bootstrap 'setenv
7045 ;; Prevent the autogen.sh script to carry out the configure
7046 ;; script, which has not yet been patched to replace /bin/sh.
7048 (setenv "NOCONFIGURE" "TRUE")
7050 (home-page "https://qalculate.github.io/")
7051 (synopsis "Multi-purpose cli desktop calculator and library")
7053 "Libqalculate is a multi-purpose cli desktop calculator and library.
7054 It provides basic and advanced functionality. Features include customizable
7055 functions, unit calculations, and conversions, physical constants, symbolic
7056 calculations (including integrals and equations), arbitrary precision,
7057 uncertainty propagation, interval arithmetic, plotting and a user-friendly
7059 (license license:gpl2+)))
7061 (define-public qalculate-gtk
7063 (name "qalculate-gtk")
7069 (url "https://github.com/Qalculate/qalculate-gtk/")
7070 (commit (string-append "v" version))))
7071 (file-name (git-file-name name version))
7073 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
7074 (build-system glib-or-gtk-build-system)
7091 (modify-phases %standard-phases
7092 (add-before 'bootstrap 'setenv
7093 ;; Prevent the autogen.sh script to carry out the configure
7094 ;; script, which has not yet been patched to replace /bin/sh.
7096 (setenv "NOCONFIGURE" "TRUE")
7098 (home-page "https://qalculate.github.io/")
7099 (synopsis "Multi-purpose graphical desktop calculator")
7101 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
7102 multi-purpose GUI desktop calculator. It provides basic and advanced
7103 functionality. Features include customizable functions, unit calculations,
7104 and conversions, physical constants, symbolic calculations (including
7105 integrals and equations), arbitrary precision, uncertainty propagation,
7106 interval arithmetic, plotting.")
7107 (license license:gpl2+)))
7109 (define-public numdiff
7116 (uri (string-append "mirror://savannah/numdiff/numdiff-"
7120 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
7121 (build-system gnu-build-system)
7123 '(#:tests? #f ; There are no tests.
7125 (modify-phases %standard-phases
7126 (add-before 'compress-documentation 'delete-precompressed-info-file
7128 (delete-file (string-append (assoc-ref %outputs "out")
7129 "/share/info/numdiff.info.gz"))
7131 (home-page "https://nongnu.org/numdiff/")
7132 (synopsis "Compare files with numeric fields")
7134 "Numdiff compares files line by line and field by field, ignoring small
7135 numeric differences and differences in numeric formats.")
7136 (license license:gpl3+)))
7145 (url "https://gitlab.inria.fr/why3/why3")
7147 (file-name (git-file-name name version))
7150 "0pfsiddnk26f384wbazfpgzh1n1ibf3xq101q74mxvczi7z0a791"))))
7151 (build-system ocaml-build-system)
7153 (list autoconf automake coq ocaml which))
7155 (list camlzip ocaml-graph ocaml-menhir ocaml-num ocaml-zarith))
7157 (list coq-flocq emacs-minimal zlib))
7160 (modify-phases %standard-phases
7161 (add-before 'configure 'bootstrap
7163 (invoke "./autogen.sh")
7164 (setenv "CONFIG_SHELL" (which "sh"))
7165 (substitute* "configure"
7166 (("#! /bin/sh") (string-append "#!" (which "sh")))
7167 ;; find ocaml-num in the correct directory
7168 (("\\$DIR/nums.cma") "$DIR/num.cma")
7169 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
7171 (add-after 'configure 'fix-makefile
7173 (substitute* "Makefile"
7174 ;; find ocaml-num in the correct directory
7175 (("site-lib/num") "site-lib"))
7177 (add-after 'install 'install-lib
7179 (invoke "make" "byte")
7180 (invoke "make" "install-lib")
7182 (home-page "http://why3.lri.fr")
7183 (synopsis "Deductive program verification")
7184 (description "Why3 provides a language for specification and programming,
7185 called WhyML, and relies on external theorem provers, both automated and
7186 interactive, to discharge verification conditions. Why3 comes with a standard
7187 library of logical theories (integer and real arithmetic, Boolean operations,
7188 sets and maps, etc.) and basic programming data structures (arrays, queues,
7189 hash tables, etc.). A user can write WhyML programs directly and get
7190 correct-by-construction OCaml programs through an automated extraction
7191 mechanism. WhyML is also used as an intermediate language for the verification
7192 of C, Java, or Ada programs.")
7193 (license license:lgpl2.1)))
7195 (define-public frama-c
7201 (uri (string-append "http://frama-c.com/download/frama-c-"
7202 version "-Vanadium.tar.gz"))
7205 "1rgkq9sg436smw005ag0j6y3xryhjn18a07m5wjfrfp0s1438nnj"))))
7206 (build-system ocaml-build-system)
7208 `(#:tests? #f; no test target in Makefile
7210 (modify-phases %standard-phases
7211 (add-before 'configure 'export-shell
7212 (lambda* (#:key inputs #:allow-other-keys)
7213 (setenv "CONFIG_SHELL"
7214 (search-input-file inputs "/bin/sh")))))))
7224 (native-search-paths
7225 (list (search-path-specification
7226 (variable "FRAMAC_SHARE")
7227 (files '("share/frama-c"))
7229 (search-path-specification
7230 (variable "FRAMAC_LIB")
7231 (files '("lib/frama-c"))
7233 (home-page "http://frama-c.com")
7234 (synopsis "C source code analysis platform")
7235 (description "Frama-C is an extensible and collaborative platform dedicated
7236 to source-code analysis of C software. The Frama-C analyzers assist you in
7237 various source-code-related activities, from the navigation through unfamiliar
7238 projects up to the certification of critical software.")
7239 (license license:lgpl2.1+)))
7241 (define-public blitz
7249 (url "https://github.com/blitzpp/blitz")
7251 (file-name (git-file-name name version))
7253 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
7254 (build-system cmake-build-system)
7256 `(#:configure-flags '("-DBUILD_DOC=ON"
7257 "-DBUILD_TESTING=ON")
7258 ;; The default "check" target also includes examples and benchmarks.
7259 #:test-target "check-testsuite"
7261 (modify-phases %standard-phases
7262 (add-after 'build 'build-doc
7264 (invoke "make" "-j" (number->string (parallel-job-count))
7267 (list python texinfo))
7268 (synopsis "C++ template class library for multidimensional arrays")
7269 (description "Blitz++ is a C++ template class library that provides
7270 high-performance multidimensional array containers for scientific computing.")
7271 (home-page "https://github.com/blitzpp/blitz")
7272 (license (list license:artistic2.0
7276 (define-public fxdiv
7277 ;; There is currently no tag in this repo.
7278 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
7283 (version (git-version version revision commit))
7284 (home-page "https://github.com/Maratyszcza/FXdiv")
7287 (uri (git-reference (url home-page) (commit commit)))
7288 (file-name (git-file-name name version))
7291 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
7292 (patches (search-patches "fxdiv-system-libraries.patch"))))
7293 (build-system cmake-build-system)
7295 (list googletest googlebenchmark))
7297 "C++ library for division via fixed-point multiplication by inverse")
7299 "On modern CPUs and GPUs, integer division is several times slower than
7300 multiplication. FXdiv implements an algorithm to replace an integer division
7301 with a multiplication and two shifts. This algorithm improves performance
7302 when an application performs repeated divisions by the same divisor.")
7303 (license license:expat))))
7306 ;; There is currently no tag in this repo.
7307 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
7312 (version (git-version version revision commit))
7313 (home-page "https://github.com/Maratyszcza/FP16")
7316 (uri (git-reference (url home-page) (commit commit)))
7317 (file-name (git-file-name name version))
7320 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
7321 (patches (search-patches "fp16-system-libraries.patch"))))
7322 (build-system cmake-build-system)
7324 `(#:imported-modules ((guix build python-build-system)
7325 ,@%cmake-build-system-modules)
7326 #:modules (((guix build python-build-system)
7327 #:select (site-packages))
7328 (guix build cmake-build-system)
7330 #:phases (modify-phases %standard-phases
7331 (add-after 'install 'move-python-files
7332 (lambda* (#:key inputs outputs #:allow-other-keys)
7333 ;; Python files get installed to $includedir (!).
7334 ;; Move them to the usual Python site directory.
7335 (let* ((out (assoc-ref outputs "out"))
7336 (include (string-append out "/include"))
7337 (site (site-packages inputs outputs))
7338 (target (string-append site "/fp16")))
7340 (for-each (lambda (file)
7342 (string-append target "/"
7345 (find-files include "\\.py$"))))))))
7347 (list python-wrapper))
7349 (list psimd googletest googlebenchmark))
7350 (synopsis "C++ library for half-precision floating point formats")
7352 "This header-only C++ library implements conversion to and from
7353 half-precision floating point formats.")
7354 (license license:expat))))
7356 (define-public optizelle
7357 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
7360 (version (git-version "1.3.0" "0" commit))
7365 (url "https://github.com/OptimoJoe/Optizelle")
7367 (file-name (git-file-name "optizelle" commit))
7370 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
7371 (modules '((guix build utils)))
7374 ;; Reduce the stopping tolerance in one test so that the
7375 ;; convergence check returns the correct stopping
7378 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
7379 (("1e-13") "5e-14"))
7380 ;; Skip one set of python tests. See
7381 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
7383 "src/examples/inequality_scaling/CMakeLists.txt"
7384 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
7385 (string-append "add_unit" middle "\"cpp\"" end)))
7386 ;; Install the licence for Optizelle, without also
7387 ;; including the licences for the dependencies.
7388 (substitute* "licenses/CMakeLists.txt"
7389 (("file.*package.*$" all)
7390 (string-append "# " all))
7391 ((".*[^l].[.]txt\\)\n") "")
7392 (("add_license.*\"\n") ""))
7394 (build-system cmake-build-system)
7396 `(#:imported-modules ((guix build python-build-system)
7397 ,@%cmake-build-system-modules)
7398 #:modules (((guix build python-build-system) #:select
7400 (guix build cmake-build-system)
7402 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
7403 "-DENABLE_CPP_UNIT:BOOL=ON"
7404 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
7405 "-DENABLE_PYTHON:BOOL=ON"
7406 "-DENABLE_PYTHON_UNIT:BOOL=ON"
7407 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
7408 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
7409 (assoc-ref %build-inputs
7411 "/lib/libopenblas.so")
7412 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7413 (assoc-ref %build-inputs
7415 "/lib/libgfortran.so;"
7416 (assoc-ref %build-inputs
7418 "/lib/libquadmath.so"))
7420 (modify-phases %standard-phases
7421 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7422 (lambda* (#:key inputs #:allow-other-keys)
7423 (let* ((pyver (python-version (assoc-ref inputs "python")))
7424 (npdir (string-append (assoc-ref inputs "numpy")
7427 (substitute* "src/cmake/Modules/Optizelle.cmake"
7429 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7430 "PYTHONPATH=" npdir ":"))))))
7431 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7433 `(("blas/lapack" ,openblas)
7434 ("fortran:lib" ,gfortran "lib")
7435 ("jsoncpp" ,jsoncpp)
7436 ("numpy" ,python-numpy)
7437 ("python" ,python)))
7439 `(("fortran" ,gfortran)
7440 ("pkg-config" ,pkg-config)))
7441 (home-page "https://www.optimojoe.com/products/optizelle/")
7442 (synopsis "Mathematical optimization library")
7443 (description "@code{optizelle} is a software library designed to
7444 solve nonlinear optimization problems. Four types of problem are
7445 considered: unconstrained, equality constrained, inequality
7446 constrained and constrained. Constraints may be applied as values of
7447 functions or sets of partial differential equations (PDEs).
7449 Solution algorithms such as the preconditioned nonlinear conjugate
7450 gradient method, sequential quadratic programming (SQP) and the
7451 primal-dual interior-point method are made available. Interfaces are
7452 provided for applications written in C++ and Python. Parallel
7453 computation is supported via MPI.")
7454 (license license:bsd-2))))