1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020, 2021 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nikita <nikita@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
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>
51 ;;; This file is part of GNU Guix.
53 ;;; GNU Guix is free software; you can redistribute it and/or modify it
54 ;;; under the terms of the GNU General Public License as published by
55 ;;; the Free Software Foundation; either version 3 of the License, or (at
56 ;;; your option) any later version.
58 ;;; GNU Guix is distributed in the hope that it will be useful, but
59 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
60 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 ;;; GNU General Public License for more details.
63 ;;; You should have received a copy of the GNU General Public License
64 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
66 (define-module (gnu packages maths)
67 #:use-module (ice-9 regex)
68 #:use-module (ice-9 match)
69 #:use-module (gnu packages)
70 #:use-module ((guix licenses) #:prefix license:)
71 #:use-module (guix packages)
72 #:use-module (guix download)
73 #:use-module (guix git-download)
74 #:use-module (guix utils)
75 #:use-module ((guix build utils) #:select (alist-replace))
76 #:use-module (guix build-system cmake)
77 #:use-module (guix build-system glib-or-gtk)
78 #:use-module (guix build-system gnu)
79 #:use-module (guix build-system ocaml)
80 #:use-module (guix build-system python)
81 #:use-module (guix build-system ruby)
82 #:use-module (gnu packages algebra)
83 #:use-module (gnu packages audio)
84 #:use-module (gnu packages autotools)
85 #:use-module (gnu packages base)
86 #:use-module (gnu packages bison)
87 #:use-module (gnu packages boost)
88 #:use-module (gnu packages check)
89 #:use-module (gnu packages cmake)
90 #:use-module (gnu packages compression)
91 #:use-module (gnu packages coq)
92 #:use-module (gnu packages curl)
93 #:use-module (gnu packages cyrus-sasl)
94 #:use-module (gnu packages dbm)
95 #:use-module (gnu packages documentation)
96 #:use-module (gnu packages elf)
97 #:use-module (gnu packages emacs)
98 #:use-module (gnu packages file)
99 #:use-module (gnu packages flex)
100 #:use-module (gnu packages fltk)
101 #:use-module (gnu packages fontutils)
102 #:use-module (gnu packages gettext)
103 #:use-module (gnu packages gcc)
104 #:use-module (gnu packages gd)
105 #:use-module (gnu packages ghostscript)
106 #:use-module (gnu packages glib)
107 #:use-module (gnu packages graphviz)
108 #:use-module (gnu packages gtk)
109 #:use-module (gnu packages icu4c)
110 #:use-module (gnu packages image)
111 #:use-module (gnu packages java)
112 #:use-module (gnu packages less)
113 #:use-module (gnu packages lisp)
114 #:use-module (gnu packages linux)
115 #:use-module (gnu packages llvm)
116 #:use-module (gnu packages logging)
117 #:use-module (gnu packages lua)
118 #:use-module (gnu packages gnome)
119 #:use-module (gnu packages guile)
120 #:use-module (gnu packages xorg)
121 #:use-module (gnu packages gl)
122 #:use-module (gnu packages imagemagick)
123 #:use-module (gnu packages m4)
124 #:use-module (gnu packages mpi)
125 #:use-module (gnu packages multiprecision)
126 #:use-module (gnu packages netpbm)
127 #:use-module (gnu packages ocaml)
128 #:use-module (gnu packages onc-rpc)
129 #:use-module (gnu packages pcre)
130 #:use-module (gnu packages popt)
131 #:use-module (gnu packages perl)
132 #:use-module (gnu packages pkg-config)
133 #:use-module (gnu packages pulseaudio)
134 #:use-module (gnu packages python)
135 #:use-module (gnu packages python-web)
136 #:use-module (gnu packages python-xyz)
137 #:use-module (gnu packages qt)
138 #:use-module (gnu packages readline)
139 #:use-module (gnu packages ruby)
140 #:use-module (gnu packages tbb)
141 #:use-module (gnu packages scheme)
142 #:use-module (gnu packages shells)
143 #:use-module (gnu packages tcl)
144 #:use-module (gnu packages texinfo)
145 #:use-module (gnu packages tex)
146 #:use-module (gnu packages tls)
147 #:use-module (gnu packages version-control)
148 #:use-module (gnu packages wxwidgets)
149 #:use-module (gnu packages xml)
150 #:use-module (srfi srfi-1)
151 #:use-module (srfi srfi-26))
159 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
161 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
162 (build-system gnu-build-system)
163 (inputs `(("gtk+" ,gtk+)
164 ("libxml2" ,libxml2)))
165 (native-inputs `(("pkg-config" ,pkg-config)))
166 (synopsis "Natural deduction first-order logic interface")
167 (description "Aris is a program for performing logical proofs. It supports
168 propositional and predicate logic, as well as Boolean algebra and
169 arithmetical logic. In addition to its predefined inference and equivalence
170 rules, Aris also supports references to older proofs. Its use of standard
171 logical symbols and its natural deduction interface make it easy to use for
173 (license license:gpl3+)
174 (home-page "https://www.gnu.org/software/aris/")))
176 (define-public c-graph
182 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
185 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
186 (build-system gnu-build-system)
188 `(("fortran" ,gfortran)))
189 (synopsis "Visualizing and demonstrating convolution")
191 "GNU C-Graph is a tool for demonstrating the theory of convolution.
192 Thus, it can serve as an excellent aid to students of signal and systems
193 theory in visualizing the convolution process. Rather than forcing the
194 student to write code, the program offers an intuitive interface with
195 interactive dialogs to guide them.")
196 (license license:gpl3+)
197 (home-page "https://www.gnu.org/software/c-graph/")))
206 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
207 version "/coda-" version ".tar.gz"))
209 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
210 (patches (search-patches "coda-use-system-libs.patch"))
211 (modules '((guix build utils)))
213 ;; Make sure we don't use the bundled software.
215 (for-each (lambda (d)
216 (delete-file-recursively (string-append "libcoda/" d)))
217 '("zlib" "pcre" "expat"))
220 `(("fortran" ,gfortran)
222 ("python-numpy" ,python-numpy)))
229 (build-system gnu-build-system)
231 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
232 "LIBS= -lz -lpcre -lexpat")))
233 (synopsis "A common interface to various earth observation data formats")
235 "The Common Data Access toolbox (CODA) provides a set of interfaces for
236 reading remote sensing data from earth observation data files. It consists of
237 command line applications and interfaces to the C, Fortran, Python, and Java
238 programming languages.")
239 (home-page "https://stcorp.nl/coda")
240 (license license:gpl2+)))
248 (uri (string-append "http://www.qhull.org/download/qhull-"
249 (car (string-split version #\.))
253 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
254 (build-system cmake-build-system)
256 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
257 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
258 (synopsis "Calculate convex hulls and related structures")
260 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
261 diagram, halfspace intersection about a point, furthest-site Delaunay
262 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
263 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
264 algorithm for computing the convex hull. It handles roundoff errors from
265 floating point arithmetic. It computes volumes, surface areas, and
266 approximations to the convex hull.
268 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
269 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
270 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
272 (home-page "http://qhull.org")
273 (license (license:non-copyleft "file://COPYING.txt"
274 "See COPYING in the distribution."))))
276 (define-public python-cvxopt
278 (name "python-cvxopt")
283 (url "https://github.com/cvxopt/cvxopt")
285 (file-name (git-file-name name version))
288 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
289 (build-system python-build-system)
292 (modify-phases %standard-phases
293 (add-after 'unpack 'find-libraries
294 (lambda* (#:key inputs #:allow-other-keys)
295 (setenv "CVXOPT_BLAS_LIB" "openblas")
296 (setenv "CVXOPT_BUILD_FFTW" "1")
297 (setenv "CVXOPT_BUILD_GLPK" "1")
298 (setenv "CVXOPT_BUILD_GSL" "1")
305 ("openblas" ,openblas)
306 ("suitesparse" ,suitesparse)))
307 (home-page "https://www.cvxopt.org")
308 (synopsis "Python library for convex optimization")
310 "CVXOPT is a package for convex optimization based on the Python
311 programming language. Its main purpose is to make the development of software
312 for convex optimization applications straightforward by building on Python’s
313 extensive standard library and on the strengths of Python as a high-level
314 programming language.")
315 (license license:gpl3+)))
317 (define-public python2-cvxopt
318 (package-with-python2 python-cvxopt))
326 (uri (string-append "mirror://gnu/units/units-" version
329 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
330 (build-system gnu-build-system)
332 `(("readline" ,readline)
333 ("python" ,python-wrapper) ;for 'units_cur' script
334 ("python-requests" ,python-requests)))
336 `(#:phases (modify-phases %standard-phases
337 (add-after 'install 'wrap-units_cur
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let* ((out (assoc-ref outputs "out"))
340 (bin (string-append out "/bin")))
341 (wrap-program (string-append bin "/units_cur")
342 `("PYTHONPATH" ":" prefix
343 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
345 (synopsis "Conversion between thousands of scales")
347 "GNU Units converts numeric quantities between units of measure. It
348 can handle scale changes through adaptive usage of standard scale
349 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
350 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
351 enough to be used effectively as a scientific calculator.")
352 (license license:gpl3+)
353 (home-page "https://www.gnu.org/software/units/")))
355 (define-public double-conversion
357 (name "double-conversion")
359 (home-page "https://github.com/google/double-conversion")
362 (uri (git-reference (url home-page)
363 (commit (string-append "v" version))))
364 (file-name (git-file-name name version))
367 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
368 (build-system cmake-build-system)
370 '(#:test-target "test"
371 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
372 "-DBUILD_TESTING=ON")))
373 (synopsis "Conversion routines for IEEE doubles")
375 "The double-conversion library provides binary-decimal and decimal-binary
376 routines for IEEE doubles. The library consists of efficient conversion
377 routines that have been extracted from the V8 JavaScript engine.")
378 (license license:bsd-3)))
380 (define-public dionysus
386 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
390 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
391 (build-system gnu-build-system)
392 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
393 (synopsis "Local search for universal constants and scientific values")
395 "GNU Dionysus is a convenient system for quickly retrieving the values of
396 mathematical constants used in science and engineering. Values can be
397 searched using a simple command-line tool, choosing from three databases:
398 universal constants, atomic numbers, and constants related to
400 (license license:gpl3+)
401 (home-page "https://www.gnu.org/software/dionysus/")))
412 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
413 "dSFMT-src-" version ".tar.gz"))
416 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
417 (modules '((guix build utils)))
418 ;; Don't distribute html documentation with bundled jquery.
421 (delete-file-recursively "html") #t))
422 ;; Add patches borrowed from Julia.
428 "https://raw.githubusercontent.com/JuliaLang/julia/"
429 "v1.3.0/deps/patches/dSFMT.c.patch"))
431 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
432 (file-name "dSFMT.c.patch"))
436 "https://raw.githubusercontent.com/JuliaLang/julia/"
437 "v1.3.0/deps/patches/dSFMT.h.patch"))
439 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
440 (file-name "dSFMT.h.patch"))))))
441 (build-system gnu-build-system)
444 (modify-phases %standard-phases
445 (delete 'configure) ; no configure script
447 ;; Upstream Makefile does not build a shared library. Borrow from Julia
448 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
451 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
452 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
453 "-O3" "-finline-functions" "-fomit-frame-pointer"
454 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
455 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
456 "-o" "libdSFMT.so")))
457 (replace 'install ; no "install" target
458 (lambda* (#:key outputs #:allow-other-keys)
459 (let* ((out (assoc-ref outputs "out"))
460 (lib (string-append out "/lib"))
461 (inc (string-append out "/include"))
462 (doc (string-append out "/share/doc/" ,name "-" ,version)))
463 (install-file "libdSFMT.so" lib)
464 (install-file "dSFMT.h" inc)
465 (install-file "LICENSE.txt" doc)
467 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
469 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
470 the expensive conversion of integer to double (floating point). dSFMT directly
471 generates double precision floating point pseudorandom numbers which have the
472 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
473 format. dSFMT is only available on the CPUs which use IEEE 754 format double
474 precision floating point numbers.")
475 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
476 (license license:bsd-3)))
484 (uri (string-append "mirror://gnu/gsl/gsl-"
488 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
489 (build-system gnu-build-system)
491 (let ((system (%current-system)))
493 ((or (string-prefix? "aarch64" system)
494 (string-prefix? "powerpc" system))
495 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
496 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
497 '(#:phases (modify-phases %standard-phases
498 (add-before 'check 'disable-failing-tests
500 (substitute* "spmatrix/test.c"
501 ((".*test_complex.*") "\n"))
503 ((string-prefix? "i686" system)
504 ;; There are rounding issues with these tests on i686:
505 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
506 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
507 '(#:phases (modify-phases %standard-phases
508 (add-before 'check 'disable-failing-tests
510 (substitute* "linalg/test.c"
511 ((".*gsl_test\\(test_LU_decomp.*") "\n")
512 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
513 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
514 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
515 (substitute* "spmatrix/test.c"
516 ((".*test_all.*") "\n")
517 ((".*test_float.*") "\n")
518 ((".*test_complex.*") "\n"))
521 (home-page "https://www.gnu.org/software/gsl/")
522 (synopsis "Numerical library for C and C++")
524 "The GNU Scientific Library is a library for numerical analysis in C
525 and C++. It includes a wide range of mathematical routines, with over 1000
526 functions in total. Subject areas covered by the library include:
527 differential equations, linear algebra, Fast Fourier Transforms and random
529 (license license:gpl3+)))
539 (url "https://github.com/shibatch/sleef")
541 (file-name (git-file-name name version))
543 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
544 (build-system cmake-build-system)
546 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
547 (string-append "-DCMAKE_INSTALL_LIBDIR="
548 (assoc-ref %outputs "out")
550 (string-append "-DCMAKE_INSTALL_PREFIX="
551 (assoc-ref %outputs "out")))
553 (modify-phases %standard-phases
554 ;; SLEEF generates a header library during the build process and writes
555 ;; to it via shell redirection. Make the checkout writable so the
556 ;; build can succeed.
557 (add-after 'unpack 'make-git-checkout-writable
559 (for-each make-file-writable (find-files "."))
565 ("openssl" ,openssl)))
566 (home-page "https://sleef.org/")
567 (synopsis "SIMD library for evaluating elementary functions and DFT")
569 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
570 implements vectorized versions of all C99 real floating point math functions.
571 It can utilize SIMD instructions that are available on modern processors.")
572 (license (list license:boost1.0 ;sleef
573 license:cc-by4.0)))) ;simplex algorithm
582 (uri (string-append "mirror://gnu/glpk/glpk-"
586 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
587 (build-system gnu-build-system)
591 `(#:configure-flags '("--with-gmp"
592 "--disable-static")))
593 (home-page "https://www.gnu.org/software/glpk/")
594 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
596 "GLPK is a C library for solving large-scale linear programming (LP),
597 mixed integer programming (MIP), and other related problems. It supports the
598 GNU MathProg modeling language, a subset of the AMPL language, and features a
599 translator for the language. In addition to the C library, a stand-alone
600 LP/MIP solver is included in the package.")
601 (license license:gpl3+)))
603 (define-public glpk-4
611 (uri (string-append "mirror://gnu/glpk/glpk-"
615 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
624 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
626 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
628 "/4ti2-" version ".tar.gz"))
630 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
631 (build-system gnu-build-system)
633 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
637 (home-page "http://www.4ti2.de/")
638 (synopsis "Mathematical tool suite for problems on linear spaces")
640 "4ti2 implements algorithms for solving algebraic, geometric and
641 combinatorial problems on linear spaces. Among others, it solves systems
642 of linear equations, computes extreme rays of polyhedral cones, solves
643 integer programming problems and computes Markov bases for statistics.")
644 (license license:gpl2+)))
646 (define-public cddlib
653 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
654 (string-delete #\. version) ".tar.gz"))
657 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
658 (build-system gnu-build-system)
661 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
662 (synopsis "Library for convex hulls and extreme rays of polyhedra")
664 "The C-library cddlib implements the Double Description Method of
665 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
666 rays of a general convex polyhedron given by a system of linear inequalities
667 in arbitrary dimension. It can also be used for the converse operation of
668 computing convex hulls.")
669 (license license:gpl2+)))
671 (define-public lrslib
678 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
680 (string-delete #\. version) ".tar.gz"))
683 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
684 (build-system gnu-build-system)
688 `(#:tests? #f ; no check phase
689 #:make-flags `("CC=gcc"
690 ,(string-append "prefix=" (assoc-ref %outputs "out"))
693 (modify-phases %standard-phases
696 (substitute* "makefile"
697 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
699 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
700 (synopsis "Convex hulls of polyhedra with exact arithmetic")
702 "The C code of lrslib implements the reverse search algorithm for
703 vertex enumeration and convex hull problems. Its input file format is
704 compatible with cddlib. All computations are done exactly in either
705 multiple precision or fixed integer arithmetic. Output is not stored
706 in memory, so even problems with very large output sizes can sometimes
708 (license license:gpl2+)))
710 (define-public libcerf
718 (url "https://jugit.fz-juelich.de/mlz/libcerf")
719 (commit (string-append "v" version))))
720 (file-name (git-file-name name version))
722 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
723 (build-system cmake-build-system)
726 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
727 (synopsis "Library for complex error functions")
729 "@code{libcerf} is a self-contained numeric library that provides an
730 efficient and accurate implementation of complex error functions, along with
731 Dawson, Faddeeva, and Voigt functions.")
732 (license license:expat)))
741 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
742 "vinci/vinci-" version ".tar.gz"))
745 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
746 (build-system gnu-build-system)
748 `(("lrslib" ,lrslib)))
750 `(#:tests? #f ; no check phase
752 (modify-phases %standard-phases
754 ;; register the lrs location in the config file
755 (lambda* (#:key inputs #:allow-other-keys)
756 (let* ((lrs (assoc-ref inputs "lrslib"))
757 (lrsexec (string-append lrs "/bin/lrs")))
758 (substitute* "vinci.h"
759 (("#define LRS_EXEC \"lrs\"")
760 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
763 (lambda* (#:key outputs #:allow-other-keys)
764 (let* ((out (assoc-ref outputs "out"))
765 (bin (string-append out "/bin")))
766 (install-file "vinci" bin))
769 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
770 (synopsis "Volume computation for polytopes")
772 "Vinci implements a number of volume computation algorithms for convex
773 polytopes in arbitrary dimension. The polytopes can be given by their
774 V-representation (as the convex hull of a finite number of vertices), by
775 their H-representation (as the bounded intersection of a finite number of
776 halfspaces) or by their double description with both representations.")
777 (license license:gpl2+)))
779 (define-public arpack-ng
783 (home-page "https://github.com/opencollab/arpack-ng")
786 (uri (git-reference (url home-page) (commit version)))
787 (file-name (git-file-name name version))
790 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
791 (build-system gnu-build-system)
793 `(("autoconf" ,autoconf)
794 ("automake" ,automake)
796 ("pkg-config" ,pkg-config)))
800 ("fortran" ,gfortran)))
801 (synopsis "Fortran subroutines for solving eigenvalue problems")
803 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
804 large scale eigenvalue problems.")
805 (license (license:non-copyleft "file://COPYING"
806 "See COPYING in the distribution."))))
808 (define-public arpack-ng-3.3.0
815 (uri (git-reference (url (package-home-page arpack-ng))
817 (file-name (git-file-name (package-name arpack-ng) version))
820 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
822 (define-public arpack-ng-openmpi
823 (package (inherit arpack-ng)
824 (name "arpack-ng-openmpi")
827 ,@(package-inputs arpack-ng)))
829 (substitute-keyword-arguments (package-arguments arpack-ng)
830 ((#:configure-flags _ '())
832 ((#:phases phases '%standard-phases)
833 `(modify-phases ,phases
834 (add-before 'check 'mpi-setup
836 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
838 (define-public lapack
845 (uri (string-append "http://www.netlib.org/lapack/lapack-"
849 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
850 (build-system cmake-build-system)
851 (home-page "http://www.netlib.org/lapack/")
852 (inputs `(("fortran" ,gfortran)
853 ("python" ,python-wrapper)))
855 `(#:configure-flags (list
856 "-DBUILD_SHARED_LIBS:BOOL=YES"
858 ;; Build the 'LAPACKE_clatms' functions.
859 "-DLAPACKE_WITH_TMG=ON"
860 "-DBUILD_TESTING=ON")))
861 (synopsis "Library for numerical linear algebra")
863 "LAPACK is a Fortran 90 library for solving the most commonly occurring
864 problems in numerical linear algebra.")
865 (license (license:non-copyleft "file://LICENSE"
866 "See LICENSE in the distribution."))))
868 (define-public clapack
875 (uri (string-append "http://www.netlib.org/clapack/clapack-"
876 version "-CMAKE.tgz"))
879 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
880 (build-system cmake-build-system)
883 (modify-phases %standard-phases
884 ;; These tests use a lot of stack variables and segfault without
885 ;; lifting resource limits.
886 (add-after 'unpack 'disable-broken-tests
888 (substitute* "TESTING/CMakeLists.txt"
889 (("add_lapack_test.* xeigtstz\\)") ""))
892 (lambda* (#:key outputs #:allow-other-keys)
893 (let* ((out (assoc-ref outputs "out"))
894 (libdir (string-append out "/lib"))
895 (f2cinc (string-append out "/include/libf2c")))
898 (for-each (lambda (file)
899 (install-file file libdir))
901 "F2CLIBS/libf2c/libf2c.a"
902 "TESTING/MATGEN/libtmglib.a"
903 "BLAS/SRC/libblas.a"))
904 (for-each (lambda (file)
905 (install-file file f2cinc))
906 (cons "F2CLIBS/libf2c/arith.h"
907 (find-files (string-append "../clapack-"
908 ,version "-CMAKE/F2CLIBS/libf2c")
910 (copy-recursively (string-append "../clapack-"
911 ,version "-CMAKE/INCLUDE")
912 (string-append out "/include"))
914 (home-page "https://www.netlib.org/clapack/")
915 (synopsis "Numerical linear algebra library for C")
917 "The CLAPACK library was built using a Fortran to C conversion utility
918 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
919 C code, and then modified to improve readability. CLAPACK's goal is to
920 provide LAPACK for someone who does not have access to a Fortran compiler.")
921 (license (license:non-copyleft "file://LICENSE"
922 "See LICENSE in the distribution."))))
924 (define-public scalapack
931 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
935 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
936 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
937 (build-system cmake-build-system)
940 ("fortran" ,gfortran)
941 ("lapack" ,lapack))) ;for testing only
943 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
944 #:phases (modify-phases %standard-phases
945 (add-before 'check 'mpi-setup
947 (home-page "http://www.netlib.org/scalapack/")
948 (synopsis "Library for scalable numerical linear algebra")
950 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
951 routines on parallel distributed memory machines. ScaLAPACK solves dense and
952 banded linear systems, least squares problems, eigenvalue problems, and
953 singular value problems.")
954 (license (license:non-copyleft "file://LICENSE"
955 "See LICENSE in the distribution."))))
957 (define-public gnuplot
963 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
967 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
968 (build-system gnu-build-system)
969 (inputs `(("readline" ,readline)
975 `(("pkg-config" ,pkg-config)
976 ("texlive" ,texlive-tiny)))
977 (arguments `(#:configure-flags (list (string-append
978 "--with-texdir=" %output
979 "/texmf-local/tex/latex/gnuplot"))
980 ;; Plot on a dumb terminal during tests.
981 #:make-flags '("GNUTERM=dumb")))
982 (home-page "http://www.gnuplot.info")
983 (synopsis "Command-line driven graphing utility")
984 (description "Gnuplot is a portable command-line driven graphing
985 utility. It was originally created to allow scientists and students to
986 visualize mathematical functions and data interactively, but has grown to
987 support many non-interactive uses such as web scripting. It is also used as a
988 plotting engine by third-party applications like Octave.")
989 ;; X11 Style with the additional restriction that derived works may only be
990 ;; distributed as patches to the original.
991 (license (license:fsf-free
992 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1002 (url "https://github.com/OkoSanto/GCTP")
1003 (commit (string-append "v" version))))
1004 (file-name (git-file-name name version))
1006 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1008 `(("fortran" ,gfortran)))
1009 (build-system gnu-build-system)
1010 (synopsis "General Cartographic Transformation Package (GCTP)")
1012 "The General Cartographic Transformation Package (GCTP) is a system of
1013 software routines designed to permit the transformation of coordinate pairs
1014 from one map projection to another. The GCTP is the standard computer
1015 software used by the National Mapping Division for map projection
1017 (home-page "https://github.com/OkoSanto/GCTP")
1018 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1027 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1028 version "/src/hdf-" version ".tar.bz2"))
1030 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1031 (patches (search-patches "hdf4-architectures.patch"
1032 "hdf4-reproducibility.patch"
1033 "hdf4-shared-fortran.patch"
1034 "hdf4-tirpc.patch"))))
1035 (build-system gnu-build-system)
1037 `(("gfortran" ,gfortran)
1042 ("libjpeg" ,libjpeg-turbo)
1043 ("libtirpc" ,libtirpc)))
1045 `(#:parallel-tests? #f
1046 #:configure-flags (list "--enable-shared"
1047 (string-append "CPPFLAGS=-I"
1048 (assoc-ref %build-inputs "libtirpc")
1051 (modify-phases %standard-phases
1052 ;; This is inspired by two of Debian's patches.
1053 (add-before 'configure 'add-more-aarch64-support
1055 (substitute* '("mfhdf/ncgen/ncgen.l"
1056 "mfhdf/ncgen/ncgenyy.c"
1057 "mfhdf/libsrc/netcdf.h.in")
1058 (("AIX5L64") "__aarch64__"))
1060 (add-before 'configure 'patchbuild
1063 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1065 (("/bin/mkdir") "mkdir"))
1066 (substitute* (find-files "." "^Makefile\\.in$")
1067 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1068 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1069 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1070 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1071 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1073 (add-after 'configure 'patch-settings
1075 ;; libhdf4.settings contains the full path of the
1076 ;; compilers used, and its contents are included in
1077 ;; .so-files. We truncate the hashes to avoid
1078 ;; unnecessary store references to those compilers:
1079 (substitute* "libhdf4.settings"
1080 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1081 (string-append prefix (string-take hash 10) "...")))
1083 (add-after 'install 'provide-absolute-libjpeg-reference
1084 (lambda* (#:key inputs outputs #:allow-other-keys)
1085 (let ((out (assoc-ref outputs "out"))
1086 (libjpeg (assoc-ref inputs "libjpeg")))
1087 ;; libjpeg-turbo does not provide a .la file, so libtool is
1088 ;; unable to add an absolute reference for -ljpeg in the .la
1089 ;; files. Fix it manually to avoid having to propagate it.
1090 (substitute* (find-files (string-append out "/lib") "\\.la$")
1092 (string-append "-L" libjpeg "/lib -ljpeg")))
1094 (home-page "https://www.hdfgroup.org/products/hdf4/")
1096 "Library and multi-object file format for storing and managing data")
1097 (description "HDF4 is a library and multi-object file format for storing
1098 and managing data between machines. HDF4 is an older hierarchical data format,
1099 incompatible with HDF5.")
1101 (license:non-copyleft
1102 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1104 (define-public hdf4-alt
1109 (substitute-keyword-arguments (package-arguments hdf4)
1110 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1112 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1114 (define-public hdf5-1.8
1121 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1122 "hdf5-" (version-major+minor version)
1123 "/hdf5-" version "/src/hdf5-"
1125 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1127 (match (string-split version #\.)
1128 ((major minor _ ...)
1129 (string-append major minor)))
1130 "/src/hdf5-" version ".tar.bz2")))
1132 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1133 (patches (search-patches "hdf5-config-date.patch"))))
1134 (build-system gnu-build-system)
1138 `(("gfortran" ,gfortran)
1139 ("perl" ,perl))) ;part of the test machinery needs Perl
1140 (outputs '("out" ; core library
1141 "fortran")) ; fortran interface
1143 `(;; Some of the users, notably Flann, need the C++ interface.
1144 #:configure-flags '("--enable-cxx"
1146 "--enable-fortran2003"
1148 ;; Build a thread-safe library. Unfortunately,
1149 ;; 'configure' invites you to either turn off C++,
1150 ;; Fortran, and the high-level interface (HL), or
1151 ;; to pass '--enable-unsupported'. Debian
1152 ;; packagers chose to pass '--enable-unsupported'
1153 ;; and we follow their lead here.
1154 "--enable-threadsafe"
1156 "--enable-unsupported")
1157 ;; Use -fPIC to allow the R bindings to link with the static libraries
1158 #:make-flags (list "CFLAGS=-fPIC"
1161 (modify-phases %standard-phases
1162 (add-before 'configure 'patch-configure
1163 (lambda* (#:key outputs #:allow-other-keys)
1164 (substitute* "configure"
1166 (substitute* "fortran/src/Makefile.in"
1167 (("libhdf5_fortran_la_LDFLAGS =")
1168 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1169 (assoc-ref outputs "fortran") "/lib")))
1170 (substitute* "hl/fortran/src/Makefile.in"
1171 (("libhdf5hl_fortran_la_LDFLAGS =")
1172 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1173 (assoc-ref outputs "fortran") "/lib")))
1175 (add-after 'configure 'patch-settings
1177 ;; libhdf5.settings contains the full path of the
1178 ;; compilers used, and its contents are included in
1179 ;; libhdf5.so. We truncate the hashes to avoid
1180 ;; unnecessary store references to those compilers:
1181 (substitute* "src/libhdf5.settings"
1182 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1183 (string-append prefix (string-take hash 10) "..."))
1184 ;; Don't record the build-time kernel version to make the
1185 ;; settings file reproducible.
1186 (("Uname information:.*")
1187 "Uname information: Linux\n"))
1189 (add-after 'install 'patch-references
1190 (lambda* (#:key inputs outputs #:allow-other-keys)
1191 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1192 (zlib (assoc-ref inputs "zlib")))
1193 (substitute* (find-files bin "h5p?cc")
1195 (string-append "-L" zlib "/lib " lib)))
1197 (add-after 'install 'split
1198 (lambda* (#:key inputs outputs #:allow-other-keys)
1199 ;; Move all fortran-related files
1200 (let* ((out (assoc-ref outputs "out"))
1201 (bin (string-append out "/bin"))
1202 (lib (string-append out "/lib"))
1203 (inc (string-append out "/include"))
1204 (ex (string-append out "/share/hdf5_examples/fortran"))
1205 (fort (assoc-ref outputs "fortran"))
1206 (fbin (string-append fort "/bin"))
1207 (flib (string-append fort "/lib"))
1208 (finc (string-append fort "/include"))
1209 (fex (string-append fort "/share/hdf5_examples/fortran")))
1214 ;; Note: When built with --enable-parallel, the 'h5fc' file
1215 ;; doesn't exist, hence this condition.
1216 (when (file-exists? (string-append bin "/h5fc"))
1217 (rename-file (string-append bin "/h5fc")
1218 (string-append fbin "/h5fc")))
1219 (for-each (lambda (file)
1221 (string-append flib "/" (basename file))))
1222 (find-files lib ".*fortran.*"))
1223 (for-each (lambda (file)
1225 (string-append finc "/" (basename file))))
1226 (find-files inc ".*mod"))
1227 (for-each (lambda (file)
1229 (string-append fex "/" (basename file))))
1230 (find-files ex ".*"))
1231 (delete-file-recursively ex))
1233 (home-page "https://www.hdfgroup.org")
1234 (synopsis "Management suite for extremely large and complex data")
1235 (description "HDF5 is a suite that makes possible the management of
1236 extremely large and complex data collections.")
1237 (license (license:x11-style
1238 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1240 (define-public hdf5-1.10
1247 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1248 "hdf5-" (version-major+minor version)
1249 "/hdf5-" version "/src/hdf5-"
1251 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1253 (apply string-append
1254 (take (string-split version #\.) 2))
1255 "/src/hdf5-" version ".tar.bz2")))
1257 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1258 (patches (search-patches "hdf5-config-date.patch"))))))
1260 (define-public hdf5-1.12
1267 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1268 "hdf5-" (version-major+minor version)
1269 "/hdf5-" version "/src/hdf5-"
1271 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1273 (apply string-append
1274 (take (string-split version #\.) 2))
1275 "/src/hdf5-" version ".tar.bz2")))
1277 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1278 (patches (search-patches "hdf5-config-date.patch"))))))
1281 ;; Default version of HDF5.
1284 (define-public hdf-java
1292 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1293 version "/src/CMake-hdfjava-" version ".tar.gz"))
1295 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1296 (modules '((guix build utils)))
1297 (snippet ; Make sure we don't use the bundled sources and binaries.
1299 (for-each delete-file
1300 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1301 "HDF4.tar.gz" "HDF5.tar.gz"))
1302 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1304 (build-system gnu-build-system)
1306 `(("jdk" ,icedtea "jdk")
1307 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1309 ("hamcrest-core" ,java-hamcrest-core)
1310 ("junit" ,java-junit)
1311 ("slf4j-simple" ,java-slf4j-simple)))
1316 ("libjpeg" ,libjpeg-turbo)
1317 ("slf4j-api" ,java-slf4j-api)))
1320 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1321 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1322 (assoc-ref %build-inputs "jdk") "/lib" )
1323 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1324 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1327 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1328 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1329 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1330 (string-append "JPEGLIB="
1331 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1335 (modify-phases %standard-phases
1336 (add-before 'configure 'chdir-to-source
1337 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1338 (add-before 'configure 'patch-build
1339 (lambda* (#:key inputs outputs #:allow-other-keys)
1340 (substitute* "configure"
1341 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1342 (("/bin/cat") (which "cat")))
1343 ;; Set classpath for compilation
1344 (substitute* '("hdf/hdf5lib/Makefile.in"
1345 "hdf/hdf5lib/exceptions/Makefile.in"
1346 "hdf/hdflib/Makefile.in")
1347 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1348 (string-append (assoc-ref inputs "slf4j-api")
1349 "/share/java/slf4j-api.jar")))
1350 ;; Replace outdated config.sub and config.guess:
1351 (with-directory-excursion "config"
1352 (for-each (lambda (file)
1354 (string-append (assoc-ref inputs "automake")
1356 ,(version-major+minor (package-version automake))
1358 '("config.sub" "config.guess")))
1360 ;; Fix embedded version number
1361 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1362 (substitute* "hdf/hdf5lib/H5.java"
1364 (string-join hdf5version ", "))))
1366 (mkdir-p (string-append (assoc-ref outputs "out")))
1367 ;; Set classpath for tests
1368 (let* ((build-dir (getcwd))
1369 (lib (string-append build-dir "/lib"))
1370 (jhdf (string-append lib "/jhdf.jar"))
1371 (jhdf5 (string-append lib "/jhdf5.jar"))
1375 (string-append (assoc-ref inputs i)
1376 "/share/java/" i ".jar"))
1377 '("slf4j-api" "slf4j-simple"))
1379 (car (find-files (assoc-ref inputs "junit") "jar$"))
1380 (car (find-files (assoc-ref inputs "hamcrest-core")
1383 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1385 (substitute* '("test/hdf5lib/Makefile.in"
1386 "test/hdf5lib/junit.sh.in"
1387 "examples/runExample.sh.in")
1389 (string-append (assoc-ref inputs "coreutils")
1392 (string-append (assoc-ref inputs "coreutils")
1394 (("CLASSPATH=[^\n]*")
1395 (string-append "CLASSPATH=" class-path)))
1396 (setenv "CLASSPATH" class-path))
1398 (add-before 'check 'build-examples
1400 (apply invoke `("javac"
1401 ,@(find-files "examples" ".*\\.java"))))))
1403 #:parallel-build? #f
1405 #:parallel-tests? #f ))
1406 (home-page "https://support.hdfgroup.org/products/java")
1407 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1408 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1409 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1412 ;; BSD-style license:
1413 (license (license:x11-style
1414 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1415 /current/src/unpacked/COPYING"))))
1417 (define-public hdf-eos2
1424 (uri "ftp://edhs1.gsfc.nasa.gov\
1425 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1427 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1428 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1429 "hdf-eos2-build-shared.patch"
1430 "hdf-eos2-fortrantests.patch"))))
1431 (build-system gnu-build-system)
1433 `(("gfortran" ,gfortran)))
1435 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1436 ;; XXX: These inputs are really dependencies of hdf4.
1438 ("libjpeg" ,libjpeg-turbo)
1439 ("libtirpc" ,libtirpc)
1443 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1444 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1445 #:parallel-tests? #f))
1446 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1447 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1448 (description "HDF-EOS2 is a software library built on HDF4 which supports
1449 the construction of data structures used in NASA's Earth Observing
1450 System (Grid, Point and Swath).")
1452 ;; Source files carry a permissive license header.
1453 (license (license:non-copyleft home-page))))
1455 (define-public hdf-eos5
1461 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1462 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1465 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1466 (patches (search-patches "hdf-eos5-build-shared.patch"
1467 "hdf-eos5-remove-gctp.patch"
1468 "hdf-eos5-fix-szip.patch"
1469 "hdf-eos5-fortrantests.patch"))))
1471 `(("gfortran" ,gfortran)))
1472 (build-system gnu-build-system)
1474 `(("hdf5" ,hdf5-1.8)
1478 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1479 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1480 #:parallel-tests? #f))
1481 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1483 "HDF-EOS5 is a software library built on HDF5 to support the construction
1484 of data structures used in NASA's Earth Observing System (Grid, Point and
1486 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1488 ;; Source files carry a permissive license header.
1489 (license (license:non-copyleft home-page))))
1491 (define-public hdf5-parallel-openmpi
1492 (package/inherit hdf5-1.10 ;use the latest
1493 (name "hdf5-parallel-openmpi")
1496 ,@(package-inputs hdf5)))
1498 (substitute-keyword-arguments (package-arguments hdf5)
1499 ((#:configure-flags flags)
1500 ``("--enable-parallel"
1501 ,@(delete "--enable-cxx"
1502 (delete "--enable-threadsafe" ,flags))))
1504 `(modify-phases ,phases
1505 (add-after 'build 'mpi-setup
1507 (add-before 'check 'patch-tests
1509 ;; OpenMPI's mpirun will exit with non-zero status if it
1510 ;; detects an "abnormal termination", i.e. any process not
1511 ;; calling MPI_Finalize(). Since the test is explicitly
1512 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1513 ;; H5C_flush_cache from being called, mpirun will always
1514 ;; complain, so turn this test off.
1515 (substitute* "testpar/Makefile"
1516 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1517 (string-append front back "\n")))
1518 (substitute* "tools/test/h5diff/testph5diff.sh"
1519 (("/bin/sh") (which "sh")))
1521 (synopsis "Management suite for data with parallel IO support")))
1523 (define-public hdf5-blosc
1531 (url "https://github.com/Blosc/hdf5-blosc")
1532 (commit (string-append "v" version))))
1533 (file-name (git-file-name name version))
1535 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1536 (build-system cmake-build-system)
1539 (list (string-append "-DBLOSC_INSTALL_DIR="
1540 (assoc-ref %build-inputs "c-blosc"))
1541 (string-append "-DPLUGIN_INSTALL_PATH="
1542 (assoc-ref %outputs "out")
1543 "/hdf5/lib/plugin"))
1545 (modify-phases %standard-phases
1546 (add-after 'unpack 'do-not-build-blosc
1548 (substitute* "CMakeLists.txt"
1549 (("set\\(BLOSC_INSTALL_DIR.*") "")
1550 (("ExternalProject_Add\\(project_blosc") "message("))
1553 `(("c-blosc" ,c-blosc)
1554 ("hdf5" ,hdf5-1.10)))
1555 (home-page "https://github.com/Blosc/hdf5-blosc")
1556 (synopsis "Filter for HDF5 using the Blosc compressor")
1557 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1558 installing this filter, you can read and write HDF5 files with
1559 Blosc-compressed datasets.")
1560 (license license:expat)))
1562 (define-public h5check
1569 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1570 "h5check/src/h5check-" version ".tar.gz"))
1573 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1574 (build-system gnu-build-system)
1575 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1576 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1577 (synopsis "HDF5 format checker")
1578 (description "@code{h5check} is a validation tool for verifying that an
1579 HDF5 file is encoded according to the HDF File Format Specification.")
1580 (license (license:x11-style "file://COPYING"))))
1588 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1593 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1594 (build-system cmake-build-system)
1595 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1596 (inputs `(("lapack" ,lapack)
1598 ;; FIXME: Even though the fonts are available dvips complains:
1599 ;; "Font cmmi10 not found; characters will be left blank."
1601 `(("texlive" ,texlive-tiny)
1602 ("ghostscript" ,ghostscript)
1603 ("doxygen" ,doxygen)))
1604 (home-page "http://itpp.sourceforge.net")
1605 (synopsis "C++ library of maths, signal processing and communication classes")
1606 (description "IT++ is a C++ library of mathematical, signal processing and
1607 communication classes and functions. Its main use is in simulation of
1608 communication systems and for performing research in the area of
1609 communications. The kernel of the library consists of generic vector and
1610 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1611 similar to MATLAB, GNU Octave or SciPy.")
1612 (license license:gpl3+)))
1614 (define-public netcdf
1622 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1623 "netcdf-c-" version ".tar.gz"))
1626 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1627 (patches (search-patches "netcdf-date-time.patch"))))
1628 (build-system gnu-build-system)
1631 ("doxygen" ,doxygen)
1632 ("graphviz" ,graphviz)))
1634 `(("hdf4" ,hdf4-alt)
1638 ("libjpeg" ,libjpeg-turbo)))
1640 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1642 #:phases (modify-phases %standard-phases
1643 (add-before 'configure 'fix-source-date
1645 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1646 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1647 ;; to '1st hour of the current day', and therefore makes the
1648 ;; package not reproducible.
1649 (substitute* "./configure"
1650 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1651 "date --date='@0'"))
1653 (add-after 'configure 'patch-settings
1655 ;; libnetcdf.settings contains the full filename of the compilers
1656 ;; used to build the library. We truncate the hashes of those
1657 ;; filenames to avoid unnecessary references to the corresponding
1659 (substitute* "libnetcdf.settings"
1660 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1661 (string-append prefix (string-take hash 10) "...")))
1664 #:parallel-tests? #f)) ;various race conditions
1665 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1666 (synopsis "Library for scientific data")
1667 (description "NetCDF is an interface for scientific data access and a
1668 software library that provides an implementation of the interface. The netCDF
1669 library defines a machine-independent format for representing scientific data.
1670 Together, the interface, library, and format support the creation, access, and
1671 sharing of scientific data.")
1672 (license (license:x11-style "file://COPYRIGHT"))))
1674 (define-public netcdf-parallel-openmpi
1675 (package (inherit netcdf)
1676 (name "netcdf-parallel-openmpi")
1679 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1680 (package-inputs netcdf))))
1681 ;; TODO: Replace pkg-config references in nc-config with absolute references
1683 (substitute-keyword-arguments (package-arguments netcdf)
1684 ((#:configure-flags flags)
1685 `(cons* "CC=mpicc" "CXX=mpicxx"
1686 "--enable-parallel-tests"
1687 ;; Shared libraries not supported with parallel IO.
1688 "--disable-shared" "--with-pic"
1690 ((#:phases phases '%standard-phases)
1691 `(modify-phases ,phases
1692 (add-after 'build 'mpi-setup
1693 ,%openmpi-setup)))))))
1695 (define-public netcdf-fortran
1697 (name "netcdf-fortran")
1702 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1706 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1707 (build-system gnu-build-system)
1709 `(#:parallel-tests? #f))
1711 `(("netcdf" ,netcdf)))
1713 `(("gfortran" ,gfortran)))
1714 (synopsis "Fortran interface for the netCDF library")
1715 (description (package-description netcdf))
1716 (home-page (package-home-page netcdf))
1717 (license (package-license netcdf))))
1719 (define-public nlopt
1725 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1728 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1729 (build-system gnu-build-system)
1731 `(;; Shared libraries are not built by default. They are required to
1732 ;; build the Guile, Octave, and Python bindings.
1733 #:configure-flags '("--enable-shared")
1736 (modify-phases %standard-phases
1737 (add-before 'configure 'set-libnlopt-file-name
1738 (lambda* (#:key outputs #:allow-other-keys)
1739 ;; Make sure the Scheme module refers to the library by its
1740 ;; absolute file name (we cannot do that from a snippet
1741 ;; because the expansion of @libdir@ contains
1743 (let ((out (assoc-ref outputs "out")))
1744 (substitute* "swig/nlopt.scm.in"
1746 (string-append out "/lib/libnlopt")))
1748 (inputs `(("guile" ,guile-2.0)))
1749 (native-inputs `(("pkg-config" ,pkg-config)))
1750 (home-page "http://ab-initio.mit.edu/wiki/")
1751 (synopsis "Library for nonlinear optimization")
1752 (description "NLopt is a library for nonlinear optimization, providing a
1753 common interface for a number of different free optimization routines available
1754 online as well as original implementations of various other algorithms.")
1755 (license license:lgpl2.1+)))
1757 (define-public ipopt
1764 (url "https://github.com/coin-or/Ipopt")
1765 (commit (string-append "releases/" version))))
1766 (file-name (git-file-name name version))
1769 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1770 (build-system gnu-build-system)
1772 '(#:phases (modify-phases %standard-phases
1773 (add-after 'install 'add--L-flags-in-ipopt.pc
1774 (lambda* (#:key inputs outputs #:allow-other-keys)
1775 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1776 ;; move it to "Libs.private" where it belongs, and add a
1777 ;; '-L' flag for LAPACK.
1778 (let ((out (assoc-ref outputs "out"))
1779 (lapack (assoc-ref inputs "lapack")))
1780 (substitute* (string-append out "/lib/pkgconfig/"
1782 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1783 (string-append "Libs: " before " " after "\n"
1784 "Libs.private: " before
1785 "-L" lapack "/lib -llapack -lblas "
1789 `(("gfortran" ,gfortran)
1790 ("pkg-config" ,pkg-config)))
1792 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1793 `(("lapack" ,lapack))) ;for both libblas and liblapack
1794 (home-page "https://www.coin-or.org")
1795 (synopsis "Large-scale nonlinear optimizer")
1797 "The Interior Point Optimizer (IPOPT) is a software package for
1798 large-scale nonlinear optimization. It provides C++, C, and Fortran
1800 (license license:epl2.0)))
1808 (uri (string-append "https://www.coin-or.org/download/source/"
1809 "Cbc/Cbc-" version ".tgz"))
1812 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
1813 (modules '((guix build utils)))
1815 ;; Make sure we don't use the bundled software.
1816 '(delete-file-recursively "ThirdParty"))))
1817 (build-system gnu-build-system)
1819 `(("gfortran" ,gfortran)
1820 ("pkg-config" ,pkg-config)))
1822 `(("openblas" ,openblas)))
1823 (home-page "https://www.coin-or.org")
1824 (synopsis "Branch-and-cut solver")
1826 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
1827 solver written in C++. It can be used as a library or as a standalone
1829 (license license:epl1.0)))
1837 (uri (string-append "https://www.coin-or.org/download/source/"
1838 "Clp/Clp-" version ".tgz"))
1841 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1842 (modules '((guix build utils)))
1844 ;; Make sure we don't use the bundled software.
1846 (delete-file-recursively "ThirdParty")
1848 (build-system gnu-build-system)
1850 `(("gfortran" ,gfortran)
1851 ("pkg-config" ,pkg-config)))
1853 `(("openblas" ,openblas)))
1854 (home-page "https://www.coin-or.org")
1855 (synopsis "Linear programming solver")
1857 "CLP is a high quality linear programming solver. Its main strengths are
1858 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1859 linear and quadratic objectives. There are limited facilities for nonlinear
1860 and quadratic objectives using the Simplex algorithm.")
1861 (license license:epl1.0)))
1863 (define-public libflame
1867 (outputs '("out" "static"))
1872 (url "https://github.com/flame/libflame")
1874 (file-name (git-file-name name version))
1877 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1878 (build-system gnu-build-system)
1881 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1882 (list "--enable-dynamic-build"
1883 "--enable-max-arg-list-hack"
1884 "--enable-lapack2flame"
1885 "--enable-verbose-make-output"
1886 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1887 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1890 '("--enable-vector-intrinsics=sse")
1892 "--enable-supermatrix"
1893 "--enable-memory-alignment=16"
1894 "--enable-ldim-alignment")
1896 (modify-phases %standard-phases
1897 (add-after 'unpack 'patch-/usr/bin/env-bash
1899 (substitute* "build/config.mk.in"
1900 (("/usr/bin/env bash") (which "bash")))
1903 (lambda* (#:key tests? #:allow-other-keys)
1904 (substitute* "test/Makefile"
1905 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1906 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1908 (with-directory-excursion "test"
1911 (invoke "./test_libflame.x"))
1913 (add-after 'install 'install-static
1914 (lambda* (#:key outputs #:allow-other-keys)
1915 (let ((out (assoc-ref outputs "out"))
1916 (static (assoc-ref outputs "static")))
1917 (mkdir-p (string-append static "/lib"))
1918 (rename-file (string-append out "/lib/libflame.a")
1919 (string-append static "/lib/libflame.a"))
1920 (install-file (string-append out "/include/FLAME.h")
1921 (string-append static "/include"))
1924 `(("gfortran" ,gfortran)))
1926 `(("lapack" ,lapack)
1927 ("openblas" ,openblas)
1929 ("python" ,python-wrapper)))
1930 (home-page "https://github.com/flame/libflame")
1931 (synopsis "High-performance object-based library for DLA computations")
1932 (description "@code{libflame} is a portable library for dense matrix
1933 computations, providing much of the functionality present in LAPACK, developed
1934 by current and former members of the @acronym{SHPC, Science of High-Performance
1935 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1936 Computational Engineering and Sciences} at The University of Texas at Austin.
1937 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1938 includes a complete LAPACK implementation.")
1939 (license license:bsd-3)))
1941 (define-public ceres
1943 (name "ceres-solver")
1945 (home-page "http://ceres-solver.org/")
1948 (uri (string-append home-page "ceres-solver-"
1952 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1953 (build-system cmake-build-system)
1955 ;; TODO: Build HTML user documentation and install separately.
1956 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1957 "-DBUILD_SHARED_LIBS=ON")
1959 #:phases (modify-phases %standard-phases
1960 (add-before 'configure 'set-library-directory
1962 ;; Install libraries to lib/, not lib64/.
1963 (substitute* "internal/ceres/CMakeLists.txt"
1964 (("set\\(LIB_SUFFIX \"64\"\\)")
1965 "set(LIB_SUFFIX \"\")"))
1968 `(("pkg-config" ,pkg-config)))
1970 `(("glog" ,glog))) ;for #include <glog/glog.h>
1975 ("suitesparse" ,suitesparse)
1976 ("gflags" ,gflags)))
1977 (synopsis "C++ library for solving large optimization problems")
1979 "Ceres Solver is a C++ library for modeling and solving large,
1980 complicated optimization problems. It is a feature rich, mature and
1981 performant library which has been used in production since 2010. Ceres Solver
1982 can solve two kinds of problems:
1984 @item non-linear least squares problems with bounds constraints;
1985 @item general unconstrained optimization problems.
1987 (license license:bsd-3)))
1989 ;; For a fully featured Octave, users are strongly recommended also to install
1990 ;; the following packages: less, ghostscript, gnuplot.
1991 (define-public octave-cli
1998 (uri (string-append "mirror://gnu/octave/octave-"
2002 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2003 (build-system gnu-build-system)
2005 `(("alsa-lib" ,alsa-lib)
2006 ("arpack" ,arpack-ng)
2012 ("fontconfig" ,fontconfig)
2013 ("freetype" ,freetype)
2017 ("graphicsmagick" ,graphicsmagick)
2019 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2020 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2021 ;; libtiff.la instead of having to provide it here.
2022 ("libjpeg" ,libjpeg-turbo)
2026 ("libsndfile" ,libsndfile)
2030 ("portaudio" ,portaudio)
2032 ("readline" ,readline)
2033 ("suitesparse" ,suitesparse)
2034 ("texinfo" ,texinfo)
2037 `(("gfortran" ,gfortran)
2038 ("pkg-config" ,pkg-config)
2040 ;; The following inputs are not actually used in the build process.
2041 ;; However, the ./configure gratuitously tests for their existence and
2042 ;; assumes that programs not present at build time are also not, and
2043 ;; can never be, available at run time! If these inputs are therefore
2044 ;; not present, support for them will be built out. However, Octave
2045 ;; will still run without them, albeit without the features they
2048 ("ghostscript" ,ghostscript)
2049 ("gnuplot" ,gnuplot)))
2050 ;; Octave code uses this variable to detect directories holding multiple CA
2051 ;; certificates to verify peers with. This is required for the networking
2052 ;; functions that require encryption to work properly.
2053 (native-search-paths
2054 (list (search-path-specification
2055 (variable "CURLOPT_CAPATH")
2056 (files '("etc/ssl/certs")))))
2059 (list (string-append "--with-shell="
2060 (assoc-ref %build-inputs "bash")
2063 ;; XXX: Without this flag, linking octave-cli fails with
2064 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2065 ;; not pulling in liboctinterp.la for -lstdc++.
2066 "--enable-link-all-dependencies")
2068 (modify-phases %standard-phases
2069 (add-after 'configure 'configure-makeinfo
2070 (lambda* (#:key inputs #:allow-other-keys)
2071 (substitute* "libinterp/corefcn/help.h"
2074 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2076 (home-page "https://www.gnu.org/software/octave/")
2077 (synopsis "High-level language for numerical computation (no GUI)")
2078 (description "GNU Octave is a high-level interpreted language that is
2079 specialized for numerical computations. It can be used for both linear and
2080 non-linear applications and it provides great support for visualizing results.
2081 Work may be performed both at the interactive command-line as well as via
2083 (license license:gpl3+)))
2085 (define-public octave
2086 (package (inherit octave-cli)
2089 `(("qscintilla" ,qscintilla)
2091 ,@(package-inputs octave-cli)))
2093 `(("qttools" , qttools) ;for lrelease
2094 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2095 ,@(package-native-inputs octave-cli)))
2097 (substitute-keyword-arguments (package-arguments octave-cli)
2099 `(modify-phases ,phases
2100 (add-before 'configure 'patch-qscintilla-library-name
2101 (lambda* (#:key inputs #:allow-other-keys)
2102 ;; The QScintilla library that the Octave configure script tries
2103 ;; to link with should be named libqscintilla-qt5.so, but the
2104 ;; QScintilla input provides the shared library as
2105 ;; libqscintilla2_qt5.so.
2106 (substitute* "configure"
2107 (("qscintilla2-qt5")
2110 (synopsis "High-level language for numerical computation (with GUI)")))
2112 (define-public opencascade-oce
2114 (name "opencascade-oce")
2120 (url "https://github.com/tpaviot/oce")
2121 (commit (string-append "OCE-" version))))
2122 (file-name (git-file-name name version))
2123 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2125 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2126 (build-system cmake-build-system)
2129 (list "-DOCE_TESTING:BOOL=ON"
2130 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2131 "-DOCE_DRAW:BOOL=ON"
2132 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2133 (assoc-ref %outputs "out"))
2134 "-UCMAKE_INSTALL_RPATH")))
2136 `(("freetype" ,freetype)
2143 `(("python" ,python-wrapper)))
2144 (home-page "https://github.com/tpaviot/oce")
2145 (synopsis "Libraries for 3D modeling and numerical simulation")
2147 "Open CASCADE is a set of libraries for the development of applications
2148 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2149 C++ class libraries providing services for 3D surface and solid modeling, CAD
2150 data exchange, and visualization. It is used for development of specialized
2151 software dealing with 3D models in design (CAD), manufacturing (CAM),
2152 numerical simulation (CAE), measurement equipment (CMM), and quality
2153 control (CAQ) domains.
2155 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2156 patches, improvements, and experiments contributed by users over the official
2157 Open CASCADE library.")
2158 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2159 ; use of header files; see
2160 ; OCCT_LGPL_EXCEPTION.txt
2161 license:public-domain; files
2162 ; src/Standard/Standard_StdAllocator.hxx and
2163 ; src/NCollection/NCollection_StdAllocator.hxx
2164 license:expat; file src/OpenGl/OpenGl_glext.h
2165 license:bsd-3)))); test framework gtest
2167 (define-public opencascade-occt
2169 (name "opencascade-occt")
2175 (url "https://git.dev.opencascade.org/repos/occt.git")
2178 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2180 (file-name (git-file-name name version))
2182 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2183 (modules '((guix build utils)))
2186 ;; Remove files specific to non-free operating systems.
2187 (delete-file-recursively "samples/ios")
2188 (delete-file-recursively "samples/mfc")
2189 (delete-file-recursively "samples/qt/FuncDemo")
2190 (delete-file "genconf.bat")
2191 (delete-file "gendoc.bat")
2192 (delete-file "genproj.bat")
2193 (delete-file "upgrade.bat")
2194 ;; Remove references to deleted files.
2195 (substitute* "dox/FILES_HTML.txt"
2196 ((".*standard.*") "" )
2197 ((".*UIKitSample.*") ""))
2199 (build-system cmake-build-system)
2201 '(;; There is no test target for make. OCCT provides an
2202 ;; 'Automated Testing System', which may be accessed after
2203 ;; installation via the draw.sh script. draw.sh is located in
2204 ;; the bin directory. For details see:
2205 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2206 ;; occt_dev_guides__tests.html
2208 ;; Configure without freeimage: attempting to link against the
2209 ;; freeimage version 3.17 library leads to 'undefined
2210 ;; reference' errors.
2212 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2214 "-DUSE_VTK:BOOL=OFF"
2215 "-DBUILD_DOC_Overview:BOOL=OFF"
2216 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2217 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2218 "-UCMAKE_INSTALL_LIBDIR")))
2220 `(("doxygen" ,doxygen)
2221 ;("freeimage" ,freeimage)
2222 ("freetype" ,freetype)
2224 ("libxext" ,libxext)
2231 ;; TODO: build Overview documentation and add 'doc' output.
2232 (home-page "https://www.opencascade.com")
2233 (synopsis "Libraries for 3D modeling and numerical simulation")
2235 "Open CASCADE is a set of libraries for the development of applications
2236 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2237 C++ class libraries providing services for 3D surface and solid modeling, CAD
2238 data exchange, and visualization. It is used for development of specialized
2239 software dealing with 3D models in design (CAD), manufacturing (CAM),
2240 numerical simulation (CAE), measurement equipment (CMM), and quality
2241 control (CAQ) domains.
2243 This is the certified version of the Open Cascade Technology (OCCT) library.")
2244 (license (list ;; OCCT library:
2245 license:lgpl2.1; with an exception for the use of header
2246 ; files, see OCCT_LGPL_EXCEPTION.txt.
2247 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2248 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2250 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2251 ;; src/StepFile/step.tab.*:
2252 license:gpl3+ ; with Bison 2.2 exception.
2253 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2254 (license:non-copyleft
2255 "https://www.unicode.org/license.html")
2256 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2257 license:public-domain))))
2267 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2269 (string-append "gmsh_"
2270 (string-replace-substring version "." "_")))))
2271 (file-name (git-file-name name version))
2273 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2274 (modules '((guix build utils)))
2277 (delete-file-recursively "contrib/metis")
2279 (build-system cmake-build-system)
2282 ("gfortran" ,gfortran)
2288 ("libxext" ,libxext)
2291 ("opencascade-occt" ,opencascade-occt)))
2293 `(("fontconfig" ,fontconfig)
2295 ("python" ,python)))
2297 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2298 "-DENABLE_BUILD_SHARED:BOOL=ON"
2299 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2300 #:imported-modules (,@%cmake-build-system-modules
2301 (guix build python-build-system))
2302 #:modules (((guix build python-build-system) #:select (site-packages))
2303 (guix build cmake-build-system)
2306 (modify-phases %standard-phases
2307 (add-after 'unpack 'patch-paths
2308 (lambda* (#:key inputs outputs #:allow-other-keys)
2309 ;; Use the standard Guix site-package path for
2310 ;; installation of the Python API.
2311 (substitute* "CMakeLists.txt"
2312 (("include\\(GNUInstallDirs\\)\n")
2313 (string-append "include(GNUInstallDirs)\n"
2315 (site-packages inputs outputs) ")\n"))
2316 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2317 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2318 ;; Find the shared library.
2319 (let ((libgmsh (string-append (assoc-ref outputs "out")
2320 "/lib/libgmsh.so")))
2321 (substitute* "api/gmsh.py"
2322 (("find_library\\(\"gmsh\"\\)")
2323 (simple-format #f "\"~a\"" libgmsh))))
2325 (home-page "http://gmsh.info/")
2326 (synopsis "3D finite element grid generator")
2327 (description "Gmsh is a 3D finite element grid generator with a built-in
2328 CAD engine and post-processor. Its design goal is to provide a fast, light
2329 and user-friendly meshing tool with parametric input and advanced
2330 visualization capabilities. Gmsh is built around four modules: geometry,
2331 mesh, solver and post-processing. The specification of any input to these
2332 modules is done either interactively using the graphical user interface or in
2333 ASCII text files using Gmsh's own scripting language.")
2334 (license license:gpl2+)))
2336 (define-public veusz
2343 (uri (pypi-uri "veusz" version))
2345 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2346 (build-system python-build-system)
2348 `(;; Tests will fail because they depend on optional packages like
2349 ;; python-astropy, which is not packaged.
2352 (modify-phases %standard-phases
2353 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2354 ;; the path is defined in Guix, therefore we have to change it.
2355 (add-after 'unpack 'fix-sip-dir
2357 (substitute* "pyqtdistutils.py"
2358 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2360 ;; Now we have to pass the correct sip_dir to setup.py.
2362 (lambda* (#:key inputs #:allow-other-keys)
2363 ;; We need to tell setup.py where to locate QtCoremod.sip
2364 ((@@ (guix build python-build-system) call-setuppy)
2366 (list (string-append "--sip-dir="
2367 (assoc-ref inputs "python-pyqt")
2370 ;; Ensure that icons are found at runtime.
2371 (add-after 'install 'wrap-executable
2372 (lambda* (#:key inputs outputs #:allow-other-keys)
2373 (let ((out (assoc-ref outputs "out")))
2374 (wrap-program (string-append out "/bin/veusz")
2375 `("QT_PLUGIN_PATH" prefix
2376 ,(list (string-append (assoc-ref inputs "qtsvg")
2377 "/lib/qt5/plugins/"))))))))))
2379 `(("pkg-config" ,pkg-config)
2380 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2381 ("qttools" ,qttools)
2382 ("python-sip" ,python-sip-4)))
2384 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2385 ("python-dbus" ,python-dbus)
2386 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2387 ("python-pyqt" ,python-pyqt)
2388 ("qtbase" ,qtbase-5)
2391 `(("python-numpy" ,python-numpy)))
2392 (home-page "https://veusz.github.io/")
2393 (synopsis "Scientific plotting package")
2395 "Veusz is a scientific plotting and graphing program with a graphical
2396 user interface, designed to produce publication-ready 2D and 3D plots. In
2397 addition it can be used as a module in Python for plotting. It supports
2398 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2399 (license license:gpl2+)))
2401 (define-public maxflow
2404 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2405 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2410 (url "https://github.com/gerddie/maxflow")
2412 (file-name (git-file-name name version))
2415 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2416 (build-system cmake-build-system)
2417 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2418 (synopsis "Library implementing Maxflow algorithm")
2419 (description "An implementation of the maxflow algorithm described in
2420 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2421 Energy Minimization in Computer Vision.\n
2422 Yuri Boykov and Vladimir Kolmogorov.\n
2423 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2425 (license license:gpl3+)))
2427 (define-public petsc
2434 ;; The *-lite-* tarball does not contain the *large* documentation
2435 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2436 "petsc-lite-" version ".tar.gz"))
2438 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2439 (outputs '("out" ; libraries and headers
2440 "examples")) ; ~30MiB of examples
2441 (build-system gnu-build-system)
2443 `(("python" ,python-2)))
2445 `(("gfortran" ,gfortran)
2446 ("openblas" ,openblas)
2447 ("superlu" ,superlu)
2448 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2449 ;; leaving out opengl, as configuration seems to only be for mac
2452 `(#:test-target "test"
2453 #:parallel-build? #f ; build is parallel by default
2460 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2461 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2462 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2464 (modify-phases %standard-phases
2466 ;; PETSc's configure script is actually a python script, so we can't
2467 ;; run it with bash.
2468 (lambda* (#:key outputs (configure-flags '())
2470 (let* ((prefix (assoc-ref outputs "out"))
2471 (flags `(,(string-append "--prefix=" prefix)
2472 ,@configure-flags)))
2473 (format #t "build directory: ~s~%" (getcwd))
2474 (format #t "configure flags: ~s~%" flags)
2475 (apply invoke "./configure" flags))))
2476 (add-after 'configure 'clean-local-references
2477 (lambda* (#:key outputs #:allow-other-keys)
2478 (let ((out (assoc-ref outputs "out")))
2479 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2480 ;; Prevent build directory from leaking into compiled code
2482 ;; Scrub timestamp for reproducibility
2483 ((".*Libraries compiled on.*") ""))
2484 (substitute* (find-files "." "petscvariables")
2485 ;; Do not expose build machine characteristics, set to defaults.
2486 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2487 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2489 (add-after 'install 'clean-install
2490 ;; Try to keep installed files from leaking build directory names.
2491 (lambda* (#:key inputs outputs #:allow-other-keys)
2492 (let ((out (assoc-ref outputs "out")))
2493 (substitute* (map (lambda (file)
2494 (string-append out "/lib/petsc/conf/" file))
2495 '("petscvariables"))
2497 ;; Make compiler references point to the store
2498 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2499 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2500 (string-append "= " (which compiler))))
2501 ;; PETSc installs some build logs, which aren't necessary.
2502 (for-each (lambda (file)
2503 (let ((f (string-append out "/lib/petsc/conf/" file)))
2504 (when (file-exists? f)
2506 '("configure.log" "make.log" "gmake.log"
2507 "test.log" "error.log" "RDict.db"
2508 "PETScBuildInternal.cmake"
2509 ;; Once installed, should uninstall with Guix
2512 (add-after 'install 'move-examples
2513 (lambda* (#:key outputs #:allow-other-keys)
2514 (let* ((out (assoc-ref outputs "out"))
2515 (examples (assoc-ref outputs "examples"))
2516 (exdir (string-append out "/share/petsc/examples"))
2517 (exdir' (string-append examples "/share/petsc/examples")))
2518 (copy-recursively exdir exdir')
2519 (delete-file-recursively exdir)
2521 (home-page "https://www.mcs.anl.gov/petsc")
2522 (synopsis "Library to solve PDEs")
2523 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2524 data structures and routines for the scalable (parallel) solution of
2525 scientific applications modeled by partial differential equations.")
2526 (license (license:non-copyleft
2527 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2529 (define-public petsc-complex
2530 (package (inherit petsc)
2531 (name "petsc-complex")
2533 (substitute-keyword-arguments (package-arguments petsc)
2534 ((#:configure-flags cf)
2535 `(cons "--with-scalar-type=complex" ,cf))))
2536 (synopsis "Library to solve PDEs (with complex scalars)")))
2538 (define-public petsc-openmpi
2539 (package (inherit petsc)
2540 (name "petsc-openmpi")
2542 `(("hdf5" ,hdf5-parallel-openmpi)
2543 ("hypre" ,hypre-openmpi)
2545 ("mumps" ,mumps-openmpi)
2546 ("openmpi" ,openmpi)
2547 ("scalapack" ,scalapack)
2548 ("scotch" ,pt-scotch32)
2549 ,@(package-inputs petsc)))
2551 (substitute-keyword-arguments (package-arguments petsc)
2552 ((#:configure-flags cf)
2554 "--with-mpiexec=mpirun"
2557 "--with-scalapack=1"
2559 ,(string-append "--with-mpi-dir="
2560 (assoc-ref %build-inputs "openmpi"))
2561 ,(string-append "--with-hdf5-include="
2562 (assoc-ref %build-inputs "hdf5") "/include")
2563 ,(string-append "--with-hdf5-lib="
2564 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2565 ,@(delete "--with-mpi=0" ,cf)))
2567 `(modify-phases ,phases
2568 (add-before 'configure 'mpi-setup
2569 ,%openmpi-setup)))))
2570 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2572 (define-public petsc-complex-openmpi
2573 (package (inherit petsc-complex)
2574 (name "petsc-complex-openmpi")
2576 `(("openmpi" ,openmpi)
2577 ,@(package-inputs petsc-complex)))
2579 (substitute-keyword-arguments (package-arguments petsc-complex)
2580 ((#:configure-flags cf)
2581 ``("--with-mpiexec=mpirun"
2582 ,(string-append "--with-mpi-dir="
2583 (assoc-ref %build-inputs "openmpi"))
2584 ,@(delete "--with-mpi=0" ,cf)))
2586 `(modify-phases ,phases
2587 (add-before 'configure 'mpi-setup
2588 ,%openmpi-setup)))))
2589 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2591 (define-public python-petsc4py
2593 (name "python-petsc4py")
2598 (uri (pypi-uri "petsc4py" version))
2601 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2602 (modules '((guix build utils)))
2605 ;; Ensure source file is regenerated in the build phase.
2606 (delete-file "src/petsc4py.PETSc.c")
2607 ;; Remove legacy GC code. See
2608 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2609 (substitute* "src/PETSc/cyclicgc.pxi"
2610 ((".*gc_refs.*") "" )
2611 ((".*PyGC_Head.*") ""))
2613 (build-system python-build-system)
2616 (modify-phases %standard-phases
2617 (add-before 'build 'pre-build
2619 ;; Define path to PETSc installation.
2620 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2622 (add-before 'check 'mpi-setup
2625 `(("python-cython" ,python-cython)))
2627 `(("petsc" ,petsc-openmpi)
2628 ("python-numpy" ,python-numpy)))
2629 (home-page "https://bitbucket.org/petsc/petsc4py/")
2630 (synopsis "Python bindings for PETSc")
2631 (description "PETSc, the Portable, Extensible Toolkit for
2632 Scientific Computation, is a suite of data structures and routines for
2633 the scalable (parallel) solution of scientific applications modeled by
2634 partial differential equations. It employs the MPI standard for all
2635 message-passing communication. @code{petsc4py} provides Python
2636 bindings to almost all functions of PETSc.")
2637 (license license:bsd-3)))
2639 (define-public python-kiwisolver
2641 (name "python-kiwisolver")
2645 (uri (pypi-uri "kiwisolver" version))
2648 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2649 (build-system python-build-system)
2650 (home-page "https://github.com/nucleic/kiwi")
2651 (synopsis "Fast implementation of the Cassowary constraint solver")
2653 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2654 solving algorithm. Kiwi has been designed from the ground up to be
2655 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2656 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2657 savings are consistently > 5x.")
2658 (license license:bsd-3)))
2660 (define-public python2-kiwisolver
2661 (package-with-python2 python-kiwisolver))
2663 (define-public slepc
2670 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2674 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2675 (build-system gnu-build-system)
2677 `(("python" ,python-2)
2678 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2680 `(("arpack" ,arpack-ng)
2681 ("gfortran" ,gfortran)))
2683 `(("petsc" ,petsc)))
2685 `(#:parallel-build? #f ;build is parallel by default
2687 `(,(string-append "--with-arpack-dir="
2688 (assoc-ref %build-inputs "arpack") "/lib"))
2689 #:make-flags ;honor (parallel-job-count)
2690 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2691 ,(string-append "PETSCCONFIGDIR="
2692 (assoc-ref %build-inputs "petsc:examples")
2693 "/share/petsc/examples/config"))
2695 (modify-phases %standard-phases
2697 ;; configure is a python script, so we can't run it with bash.
2698 (lambda* (#:key inputs outputs (configure-flags '())
2700 (let* ((prefix (assoc-ref outputs "out"))
2701 (flags `(,(string-append "--prefix=" prefix)
2702 ,@configure-flags)))
2703 (format #t "build directory: ~s~%" (getcwd))
2704 (format #t "configure flags: ~s~%" flags)
2705 (setenv "SLEPC_DIR" (getcwd))
2706 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2707 (apply invoke "./configure" flags))))
2708 (add-after 'install 'delete-doc
2709 ;; TODO: SLEPc installs HTML documentation alongside headers in
2710 ;; $out/include. We'd like to move them to share/doc, but delete
2711 ;; them for now, as they are incomplete and installing the complete
2712 ;; documentation is difficult.
2713 (lambda* (#:key outputs #:allow-other-keys)
2714 (let* ((out (assoc-ref outputs "out")))
2715 (for-each delete-file (find-files out "\\.html$"))
2717 (add-after 'install 'clean-install
2718 ;; Clean up unnecessary build logs from installation.
2719 (lambda* (#:key outputs #:allow-other-keys)
2720 (let ((out (assoc-ref outputs "out")))
2721 (for-each (lambda (file)
2722 (let ((f (string-append out "/lib/slepc/conf/" file)))
2723 (when (file-exists? f)
2725 '("configure.log" "make.log" "gmake.log"
2726 "test.log" "error.log" "RDict.db"
2729 (home-page "https://slepc.upv.es")
2730 (synopsis "Scalable library for eigenproblems")
2731 (description "SLEPc is a software library for the solution of large sparse
2732 eigenproblems on parallel computers. It can be used for the solution of
2733 linear eigenvalue problems formulated in either standard or generalized form,
2734 as well as other related problems such as the singular value decomposition.
2735 The emphasis of the software is on methods and techniques appropriate for
2736 problems in which the associated matrices are sparse, for example, those
2737 arising after the discretization of partial differential equations.")
2738 (license license:bsd-2)))
2740 (define-public slepc-complex
2741 (package (inherit slepc)
2742 (name "slepc-complex")
2744 `(("petsc" ,petsc-complex)
2745 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2746 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2748 (define-public slepc-openmpi
2749 (package (inherit slepc)
2750 (name "slepc-openmpi")
2752 (substitute-keyword-arguments (package-arguments slepc)
2753 ((#:phases phases '%standard-phases)
2754 `(modify-phases ,phases
2755 (add-before 'check 'mpi-setup
2756 ,%openmpi-setup)))))
2759 ("arpack" ,arpack-ng-openmpi)
2760 ,@(alist-delete "arpack" (package-inputs slepc))))
2762 `(("petsc" ,petsc-openmpi)
2763 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2764 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2766 (define-public slepc-complex-openmpi
2767 (package (inherit slepc-openmpi)
2768 (name "slepc-complex-openmpi")
2770 `(("petsc" ,petsc-complex-openmpi)
2771 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2772 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2774 (define-public python-slepc4py
2776 (name "python-slepc4py")
2781 (uri (pypi-uri "slepc4py" version))
2784 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2785 (build-system python-build-system)
2788 (modify-phases %standard-phases
2789 (add-before 'build 'pre-build
2791 ;; Define path to PETSc installation.
2792 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2793 ;; Define path to SLEPc installation.
2794 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2796 (add-before 'check 'mpi-setup
2799 `(("python-numpy" ,python-numpy)
2800 ("python-petsc4py" ,python-petsc4py)
2801 ("slepc" ,slepc-openmpi)))
2802 (home-page "https://bitbucket.org/slepc/slepc4py/")
2803 (synopsis "Python bindings for SLEPc")
2804 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2805 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2806 Scientific Computation. It employs the MPI standard for all
2807 message-passing communication. @code{slepc4py} provides Python
2808 bindings to almost all functions of SLEPc.")
2809 (license license:bsd-3)))
2811 (define-public metamath
2819 (url "https://github.com/metamath/metamath-exe")
2820 (commit (string-append "v" version))))
2821 (file-name (git-file-name name version))
2823 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2824 (build-system gnu-build-system)
2826 `(("autoconf" ,autoconf)
2827 ("automake" ,automake)))
2828 (home-page "http://us.metamath.org/")
2829 (synopsis "Proof verifier based on a minimalistic formalism")
2831 "Metamath is a tiny formal language and that can express theorems in
2832 abstract mathematics, with an accompyaning @command{metamath} executable that
2833 verifies databases of these proofs. There is a public database,
2834 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2835 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2836 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2837 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2839 (license license:gpl2+)))
2841 (define-public mumps
2848 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2852 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2853 (patches (search-patches "mumps-build-parallelism.patch"
2854 "mumps-shared-libseq.patch"
2855 "mumps-shared-mumps.patch"
2856 "mumps-shared-pord.patch"))))
2857 (build-system gnu-build-system)
2859 `(("fortran" ,gfortran)
2860 ;; These are required for linking against mumps, but we let the user
2861 ;; declare the dependency.
2864 ("scotch" ,scotch)))
2866 `(#:modules ((ice-9 match)
2869 ,@%gnu-build-system-modules)
2871 (modify-phases %standard-phases
2873 (lambda* (#:key inputs #:allow-other-keys)
2874 (call-with-output-file "Makefile.inc"
2885 INCSEQ = -I$(topdir)/libseq
2886 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2887 LIBSEQNEEDED = libseqneeded~;
2891 AR = ar vr # rules require trailing space, ugh...
2894 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2896 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2897 LIBOTHERS = -pthread
2900 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2904 LIBS = $(SCALAP) $(LIBSEQ)
2905 LPORDDIR = $(topdir)/PORD/lib
2906 IPORD = -I$(topdir)/PORD/include
2907 LPORD = $(LPORDDIR)/libpord.a
2908 ORDERINGSF = -Dpord~@[
2910 IMETIS = -I$(METISDIR)/include
2911 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2912 ORDERINGSF += -Dmetis~]~@[~:{
2914 ISCOTCH = -I$(SCOTCHDIR)/include
2915 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2916 ORDERINGSF += ~a~}~]
2917 ORDERINGSC = $(ORDERINGSF)
2918 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2919 IORDERINGSF = $(ISCOTCH)
2920 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2921 (assoc-ref inputs "mpi")
2922 (assoc-ref inputs "blas")
2923 (assoc-ref inputs "scalapack")
2924 (assoc-ref inputs "metis")
2925 (match (list (assoc-ref inputs "pt-scotch")
2926 (assoc-ref inputs "scotch"))
2930 `((,scotch "" "-Dscotch")))
2933 "-lptesmumps -lptscotch -lptscotcherr "
2934 "-Dptscotch")))))))))
2936 ;; By default only the d-precision library is built. Make with "all"
2937 ;; target so that all precision libraries and examples are built.
2939 (invoke "make" "all"
2940 (format #f "-j~a" (parallel-job-count)))))
2942 ;; Run the simple test drivers, which read test input from stdin:
2943 ;; from the "real" input for the single- and double-precision
2944 ;; testers, and from the "cmplx" input for complex-precision
2945 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2946 ;; package to prefix execution with "mpirun".
2947 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2948 (with-directory-excursion "examples"
2951 (let ((tester (apply open-pipe*
2954 ,(string-append "./" prec
2956 (input (open-input-file
2957 (string-append "input_simpletest_" type))))
2959 (dump-port input tester)
2961 (zero? (close-pipe tester)))))
2963 '("real" "real" "cmplx" "cmplx")))))
2965 (lambda* (#:key outputs #:allow-other-keys)
2966 (let* ((out (assoc-ref outputs "out"))
2967 (libdir (string-append out "/lib")))
2968 (copy-recursively "lib" libdir)
2969 (copy-recursively "include" (string-append out "/include"))
2970 (when (file-exists? "libseq/libmpiseq.a")
2971 (install-file "libseq/libmpiseq.a" libdir))
2972 (when (file-exists? "libseq/libmpiseq.so")
2973 (install-file "libseq/libmpiseq.so" libdir))
2975 (home-page "http://mumps.enseeiht.fr")
2976 (synopsis "Multifrontal sparse direct solver")
2978 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2979 sparse system of linear equations A x = b using Gaussian elimination.")
2980 (license license:cecill-c)))
2982 (define-public mumps-metis
2983 (package (inherit mumps)
2984 (name "mumps-metis")
2986 (alist-delete "scotch" (package-inputs mumps)))))
2988 (define-public mumps-openmpi
2989 (package (inherit mumps)
2990 (name "mumps-openmpi")
2993 ("scalapack" ,scalapack)
2994 ("pt-scotch" ,pt-scotch)
2995 ,@(alist-delete "scotch" (package-inputs mumps))))
2997 (substitute-keyword-arguments (package-arguments mumps)
2999 `(modify-phases ,phases
3000 (add-before 'check 'mpi-setup
3004 ((assoc-ref ,phases 'check)
3005 #:exec-prefix '("mpirun" "-n" "2"))))))))
3006 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3008 (define-public mumps-metis-openmpi
3009 (package (inherit mumps-openmpi)
3010 (name "mumps-metis-openmpi")
3012 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3014 (define-public ruby-asciimath
3016 (name "ruby-asciimath")
3021 (uri (rubygems-uri "asciimath" version))
3024 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3025 (build-system ruby-build-system)
3027 `(("ruby-nokogiri" ,ruby-nokogiri)
3028 ("ruby-rspec" ,ruby-rspec)))
3029 (synopsis "AsciiMath parsing and conversion library")
3031 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3032 easy-to-write markup language for mathematics.")
3033 (home-page "https://github.com/asciidoctor/asciimath")
3034 (license license:expat)))
3036 (define-public superlu
3043 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3044 "superlu_" version ".tar.gz"))
3046 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3047 (modules '((guix build utils)))
3049 ;; Replace the non-free implementation of MC64 with a stub adapted
3052 (use-modules (ice-9 regex)
3054 (call-with-output-file "SRC/mc64ad.c"
3059 void mc64id_(int *a) {
3060 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3063 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3064 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3065 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3068 ;; Remove the corresponding license verbiage. MC64 license follows
3069 ;; a "------" line separator.
3070 (with-atomic-file-replacement "License.txt"
3071 (let ((rx (make-regexp "-{8}")))
3074 (let ((line (read-line in 'concat)))
3075 (unless (regexp-exec rx line)
3079 (build-system cmake-build-system)
3083 `(("blas" ,openblas)
3084 ("gfortran" ,gfortran)))
3086 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3087 "-DTPL_BLAS_LIBRARIES=openblas"
3088 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3089 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3090 (synopsis "Supernodal direct solver for sparse linear systems")
3092 "SuperLU is a general purpose library for the direct solution of large,
3093 sparse, nonsymmetric systems of linear equations on high performance machines.
3094 The library is written in C and is callable from either C or Fortran. The
3095 library routines perform an LU decomposition with partial pivoting and
3096 triangular system solves through forward and back substitution. The library
3097 also provides threshold-based ILU factorization preconditioners.")
3098 (license (list license:bsd-3
3099 license:gpl2+ ;EXAMPLE/*fgmr.c
3100 (license:fsf-free "file://SRC/colamd.h")))))
3102 (define-public superlu-dist
3104 (name "superlu-dist")
3110 (url "https://github.com/xiaoyeli/superlu_dist")
3111 (commit (string-append "v" version))))
3112 (file-name (git-file-name name version))
3114 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3115 (modules '((guix build utils)))
3117 ;; Replace the non-free implementation of MC64 with a stub
3119 (make-file-writable "SRC/mc64ad_dist.c")
3120 (call-with-output-file "SRC/mc64ad_dist.c"
3125 void mc64id_dist(int *a) {
3126 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3129 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3130 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3131 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3134 (substitute* "SRC/util.c" ;adjust default algorithm
3135 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3136 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3137 ;; general (i.e. non-square) processor-grid support.
3138 "RowPerm = NOROWPERM;"))
3140 (patches (search-patches "superlu-dist-scotchmetis.patch"
3141 "superlu-dist-awpm-grid.patch"))))
3142 (build-system cmake-build-system)
3146 `(("gfortran" ,gfortran)
3149 ("combblas" ,combinatorial-blas)))
3151 `(("mpi" ,openmpi) ;headers include MPI heades
3152 ("parmetis" ,pt-scotch32 "metis")
3153 ("pt-scotch" ,pt-scotch32)))
3155 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3156 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3157 "-DTPL_ENABLE_COMBBLASLIB=YES"
3158 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3159 "-DTPL_LAPACK_LIBRARIES=-llapack"
3160 (string-append "-DTPL_PARMETIS_LIBRARIES="
3162 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3163 "scotchmetis" "scotch" "scotcherr")
3165 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3166 (assoc-ref %build-inputs "parmetis")
3168 "-DTPL_ENABLE_COMBBLASLIB=ON"
3169 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3170 (assoc-ref %build-inputs "combblas")
3171 "/include/CombBLAS;"
3172 (assoc-ref %build-inputs "combblas")
3173 "/include/BipartiteMatchings")
3174 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3176 (modify-phases %standard-phases
3177 (add-before 'configure 'set-c++-standard
3179 (substitute* "CMakeLists.txt"
3180 ;; AWPM headers require C++14
3181 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3182 (add-before 'check 'mpi-setup
3184 (add-before 'check 'omp-setup
3185 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3186 (home-page (package-home-page superlu))
3187 (synopsis "Parallel supernodal direct solver")
3189 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3190 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3191 implemented in ANSI C, and MPI for communications.")
3192 (license license:bsd-3)))
3194 (define-public scotch
3201 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3202 "latestfile/298/scotch_" version ".tar.gz"))
3204 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3205 (patches (search-patches "scotch-build-parallelism.patch"
3206 "scotch-integer-declarations.patch"))))
3207 (build-system gnu-build-system)
3213 ("gfortran" ,gfortran)))
3214 (outputs '("out" "metis"))
3216 `(#:make-flags (list (string-append "prefix=" %output))
3218 (modify-phases %standard-phases
3220 'unpack 'chdir-to-src
3221 (lambda _ (chdir "src") #t))
3225 (call-with-output-file "Makefile.inc"
3240 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3241 LDFLAGS = -lz -lm -lrt -lpthread
3243 LEX = flex -Pscotchyy -olex.yy.c
3248 YACC = bison -pscotchyy -y -b y
3250 '("COMMON_FILE_COMPRESS_GZ"
3252 "COMMON_RANDOM_FIXED_SEED"
3253 "INTSIZE64" ;use 'int64_t'
3254 ;; Prevents symbol clashes with libesmumps
3256 ;; XXX: Causes invalid frees in superlu-dist tests
3258 ;; "SCOTCH_PTHREAD_NUMBER=2"
3259 "restrict=__restrict"))))
3261 (add-after 'build 'build-esmumps
3264 (format #f "-j~a" (parallel-job-count))
3266 (add-before 'install 'make-install-dirs
3267 (lambda* (#:key outputs #:allow-other-keys)
3268 (mkdir (assoc-ref outputs "out"))))
3269 (add-after 'install 'install-metis
3270 (lambda* (#:key outputs #:allow-other-keys)
3271 (let ((out (assoc-ref outputs "metis")))
3273 ;; metis files are not installed with 'make install'
3274 (for-each (lambda (f)
3275 (install-file f (string-append out "/include")))
3276 (find-files "../include/" ".*metis\\.h"))
3277 (for-each (lambda (f)
3278 (install-file f (string-append out "/lib")))
3279 (find-files "../lib/" ".*metis\\..*"))
3281 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3283 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3284 (synopsis "Programs and libraries for graph algorithms")
3285 (description "SCOTCH is a set of programs and libraries which implement
3286 the static mapping and sparse matrix reordering algorithms developed within
3287 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3288 conquer approach, to scientific computing problems such as graph and mesh
3289 partitioning, static mapping, and sparse matrix ordering, in application
3290 domains ranging from structural mechanics to operating systems or
3292 ;; See LICENSE_en.txt
3293 (license license:cecill-c)))
3295 (define-public scotch32
3296 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3297 ;; some applications.
3298 (package (inherit scotch)
3301 (substitute-keyword-arguments (package-arguments scotch)
3302 ((#:phases scotch-phases)
3303 `(modify-phases ,scotch-phases
3307 (call-with-output-file "Makefile.inc"
3322 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3323 LDFLAGS = -lz -lm -lrt -lpthread
3325 LEX = flex -Pscotchyy -olex.yy.c
3330 YACC = bison -pscotchyy -y -b y
3332 '("COMMON_FILE_COMPRESS_GZ"
3334 "COMMON_RANDOM_FIXED_SEED"
3335 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3336 ;; Prevents symbolc clashes with libesmumps
3338 ;; XXX: Causes invalid frees in superlu-dist tests
3340 ;; "SCOTCH_PTHREAD_NUMBER=2"
3341 "restrict=__restrict"))))))))))
3343 "Programs and libraries for graph algorithms (32-bit integers)")))
3345 (define-public scotch-shared
3346 (package (inherit scotch)
3347 (name "scotch-shared")
3353 (substitute-keyword-arguments (package-arguments scotch)
3354 ((#:phases scotch-shared-phases)
3355 `(modify-phases ,scotch-shared-phases
3359 ;; Otherwise, the RUNPATH will lack the final path component.
3360 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3361 (assoc-ref %outputs "out") "/lib"))
3362 (call-with-output-file "Makefile.inc"
3370 ARFLAGS = -shared -o
3377 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3378 CLIBFLAGS = -shared -fPIC
3379 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3381 LEX = flex -Pscotchyy -olex.yy.c
3386 YACC = bison -pscotchyy -y -b y
3388 '("COMMON_FILE_COMPRESS_GZ"
3390 "COMMON_RANDOM_FIXED_SEED"
3391 "INTSIZE64" ;use 'int64_t'
3392 ;; Prevents symbolc clashes with libesmumps
3394 ;; XXX: Causes invalid frees in superlu-dist tests
3396 ;; "SCOTCH_PTHREAD_NUMBER=2"
3397 "restrict=__restrict"
3401 "Programs and libraries for graph algorithms (shared libraries version)")))
3403 (define-public pt-scotch
3404 (package (inherit scotch)
3407 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3409 (substitute-keyword-arguments (package-arguments scotch)
3410 ((#:phases scotch-phases)
3411 `(modify-phases ,scotch-phases
3415 (invoke "make" (format #f "-j~a" (parallel-job-count))
3416 "ptscotch" "ptesmumps")
3418 ;; Install the serial metis compatibility library
3419 (invoke "make" "-C" "libscotchmetis" "install")))
3420 (add-before 'check 'mpi-setup
3424 (invoke "make" "ptcheck")))))))
3425 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3427 (define-public pt-scotch32
3428 (package (inherit scotch32)
3429 (name "pt-scotch32")
3431 `(("openmpi" ,openmpi))) ;headers include MPI headers
3433 (substitute-keyword-arguments (package-arguments scotch32)
3434 ((#:phases scotch32-phases)
3435 `(modify-phases ,scotch32-phases
3438 (invoke "make" (format #f "-j~a" (parallel-job-count))
3439 "ptscotch" "ptesmumps")
3440 ;; Install the serial metis compatibility library
3441 (invoke "make" "-C" "libscotchmetis" "install")))
3442 (add-before 'check 'mpi-setup
3446 (invoke "make" "ptcheck")))))))
3448 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3450 (define-public pt-scotch-shared
3451 (package (inherit scotch-shared)
3452 (name "pt-scotch-shared")
3454 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3456 (substitute-keyword-arguments (package-arguments scotch-shared)
3457 ((#:phases scotch-shared-phases)
3458 `(modify-phases ,scotch-shared-phases
3462 (invoke "make" (format #f "-j~a" (parallel-job-count))
3463 "ptscotch" "ptesmumps")
3465 ;; Install the serial metis compatibility library
3466 (invoke "make" "-C" "libscotchmetis" "install")))
3467 (add-before 'check 'mpi-setup
3468 ,%openmpi-setup)))))
3469 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3472 (define-public metis
3479 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3480 "metis-" version ".tar.gz"))
3483 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3485 `((release-monitoring-url
3486 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3487 (build-system cmake-build-system)
3489 `(("blas" ,openblas)))
3491 `(#:tests? #f ;no tests
3492 #:configure-flags `("-DSHARED=ON"
3493 ,(string-append "-DGKLIB_PATH=" (getcwd)
3494 "/metis-" ,version "/GKlib"))))
3495 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3496 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3498 "METIS is a set of serial programs for partitioning graphs, partitioning
3499 finite element meshes, and producing fill-reducing orderings for sparse
3500 matrices. The algorithms implemented in METIS are based on the multilevel
3501 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3503 (license license:asl2.0))) ;As of version 5.0.3
3505 (define-public p4est
3512 (uri (string-append "http://p4est.github.io/release/p4est-"
3516 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3517 (build-system gnu-build-system)
3519 `(("fortran" ,gfortran)
3524 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3525 (assoc-ref %build-inputs "blas")
3527 ,(string-append "LAPACK_LIBS=-L"
3528 (assoc-ref %build-inputs "lapack")
3530 #:phases (modify-phases %standard-phases
3531 (add-before 'check 'mpi-setup
3533 (home-page "http://www.p4est.org")
3534 (synopsis "Adaptive mesh refinement on forests of octrees")
3536 "The p4est software library enables the dynamic management of a
3537 collection of adaptive octrees, conveniently called a forest of octrees.
3538 p4est is designed to work in parallel and scales to hundreds of thousands of
3540 (license license:gpl2+)))
3542 (define-public p4est-openmpi
3543 (package (inherit p4est)
3544 (name "p4est-openmpi")
3547 ,@(package-inputs p4est)))
3549 (substitute-keyword-arguments (package-arguments p4est)
3550 ((#:configure-flags cf)
3551 ``("--enable-mpi" ,@,cf))))
3552 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3554 (define-public gsegrafix
3561 (uri (string-append "mirror://gnu/" name "/" name "-"
3565 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3566 (build-system gnu-build-system)
3568 `(#:configure-flags '("LDFLAGS=-lm")))
3570 `(("libgnomecanvas" ,libgnomecanvas)
3571 ("libbonoboui" ,libbonoboui)
3572 ("libgnomeui" ,libgnomeui)
3573 ("libgnomeprintui" ,libgnomeprintui)
3576 `(("pkg-config" ,pkg-config)))
3577 (home-page "https://www.gnu.org/software/gsegrafix/")
3578 (synopsis "GNOME application to create scientific and engineering plots")
3579 (description "GSEGrafix is an application which produces high-quality graphical
3580 plots for science and engineering. Plots are specified via simple ASCII
3581 parameter files and data files and are presented in an anti-aliased GNOME
3582 canvas. The program supports rectangular two-dimensional plots, histograms,
3583 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3584 to BMP, JPEG or PNG image formats.")
3585 (license license:gpl3+)))
3587 (define-public maxima
3594 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3595 version "-source/" name "-" version ".tar.gz"))
3598 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
3599 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3600 (build-system gnu-build-system)
3603 ("gnuplot" ,gnuplot) ;for plots
3605 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3607 `(("texinfo" ,texinfo)
3609 ("python" ,python)))
3612 (list "--enable-gcl"
3613 (string-append "--with-posix-shell="
3614 (assoc-ref %build-inputs "bash")
3616 (string-append "--with-wish="
3617 (assoc-ref %build-inputs "tk")
3619 (let ((v ,(package-version tk)))
3620 (string-take v (string-index-right v #\.)))))
3621 ;; By default Maxima attempts to write temporary files to
3622 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3623 ;; Work around that.
3624 #:make-flags (list "TMPDIR=/tmp")
3626 (modify-phases %standard-phases
3627 (add-after 'unpack 'patch-paths
3628 (lambda* (#:key inputs #:allow-other-keys)
3629 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3630 (coreutils (assoc-ref inputs "coreutils"))
3631 (dirname (string-append coreutils "/bin/dirname"))
3632 (head (string-append coreutils "/bin/head"))
3633 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3634 (python (string-append (assoc-ref inputs "python")
3636 (substitute* "src/maxima.in"
3637 (("sed ") (string-append sed " "))
3638 (("dirname") dirname)
3640 (substitute* "doc/info/Makefile.in"
3641 (("/usr/bin/env perl") perl))
3642 (substitute* "doc/info/build_html.sh.in"
3643 (("python") python))
3645 (add-before 'check 'pre-check
3647 (chmod "src/maxima" #o555)
3651 ;; This is derived from the testing code in the "debian/rules" file
3652 ;; of Debian's Maxima package.
3653 ;; If Maxima can successfully run this, the binary to be installed
3659 "--batch-string=\"run_testsuite();\" "
3660 "| grep -q \"No unexpected errors found\""))))
3661 ;; Make sure the doc and emacs files are found in the
3662 ;; standard location. Also configure maxima to find gnuplot
3663 ;; without having it on the PATH.
3664 (add-after 'install 'post-install
3665 (lambda* (#:key outputs inputs #:allow-other-keys)
3666 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3667 (out (assoc-ref outputs "out"))
3668 (datadir (string-append out "/share/maxima/" ,version))
3669 (binutils (string-append (assoc-ref inputs "binutils")
3671 (with-directory-excursion out
3672 (mkdir-p "share/emacs")
3673 (mkdir-p "share/doc")
3675 (string-append datadir "/doc/")
3676 (string-append out "/share/doc/maxima"))
3677 (with-atomic-file-replacement
3678 (string-append datadir "/share/maxima-init.lisp")
3680 (format out "~a ~s~a~%"
3681 "(setf $gnuplot_command "
3682 (string-append gnuplot "/bin/gnuplot") ")")
3683 (dump-port in out))))
3684 ;; Ensure that Maxima will have access to the GNU binutils
3685 ;; components at runtime.
3686 (wrap-program (string-append out "/bin/maxima")
3687 `("PATH" prefix (,binutils))))
3689 (home-page "https://maxima.sourceforge.io")
3690 (synopsis "Numeric and symbolic expression manipulation")
3691 (description "Maxima is a system for the manipulation of symbolic and
3692 numerical expressions. It yields high precision numeric results by using
3693 exact fractions, arbitrary precision integers, and variable precision floating
3695 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3696 ;; Others simply say "GNU General Public License" without stating a
3697 ;; version (which implicitly means gpl1+).
3698 ;; At least one file (src/maxima.asd) says "version 2."
3699 ;; GPLv2 only is therefore the smallest subset.
3700 (license license:gpl2)))
3702 (define-public wxmaxima
3710 (url "https://github.com/wxMaxima-developers/wxmaxima")
3711 (commit (string-append "Version-" version))))
3712 (file-name (git-file-name name version))
3714 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
3715 (build-system cmake-build-system)
3717 `(("gettext" ,gettext-minimal)))
3719 `(("wxwidgets" ,wxwidgets)
3722 ("adwaita-icon-theme" ,adwaita-icon-theme)
3724 ("shared-mime-info" ,shared-mime-info)))
3726 `(#:tests? #f ; tests fail non-deterministically
3728 (modify-phases %standard-phases
3729 (add-after 'unpack 'patch-doc-path
3731 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3732 ;; documentation. Only licensing information is placed there by
3734 (substitute* "src/Dirstructure.cpp"
3735 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3737 (add-after 'install 'wrap-program
3738 (lambda* (#:key inputs outputs #:allow-other-keys)
3739 (wrap-program (string-append (assoc-ref outputs "out")
3742 (,(string-append (assoc-ref inputs "maxima")
3744 ;; For GtkFileChooserDialog.
3745 `("GSETTINGS_SCHEMA_DIR" =
3746 (,(string-append (assoc-ref inputs "gtk+")
3747 "/share/glib-2.0/schemas")))
3748 `("XDG_DATA_DIRS" ":" prefix
3749 (;; Needed by gdk-pixbuf to know supported icon formats.
3751 (assoc-ref inputs "shared-mime-info") "/share")
3752 ;; The default icon theme of GTK+.
3754 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3756 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3757 (synopsis "Graphical user interface for the Maxima computer algebra system")
3759 "wxMaxima is a graphical user interface for the Maxima computer algebra
3760 system. It eases the use of Maxima by making most of its commands available
3761 through a menu system and by providing input dialogs for commands that require
3762 more than one argument. It also implements its own display engine that
3763 outputs mathematical symbols directly instead of depicting them with ASCII
3766 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3767 text and mathematical calculations to create documents, exporting of input and
3768 output to TeX, and a browser for Maxima's manual including command index and
3769 full text searching.")
3770 (license license:gpl2+)))
3772 (define-public armadillo
3778 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3782 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3783 (build-system cmake-build-system)
3784 (arguments `(#:tests? #f)) ; no test target
3786 `(("openblas" ,openblas)
3788 ("arpack" ,arpack-ng)))
3789 (home-page "http://arma.sourceforge.net/")
3790 (synopsis "C++ linear algebra library")
3792 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3793 between speed and ease of use. It is useful for algorithm development
3794 directly in C++, or quick conversion of research code into production
3795 environments. It can be used for machine learning, pattern recognition,
3796 signal processing, bioinformatics, statistics, econometrics, etc. The library
3797 provides efficient classes for vectors, matrices and cubes, as well as 150+
3798 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3799 (license license:asl2.0)))
3801 (define-public muparser
3802 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3803 ;; different hash. In order to make `guix package --upgrade` work correctly,
3804 ;; we set a Guix packaging revision.
3805 ;; When the next version of muparser is released, we can remove
3806 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3807 (let ((upstream-version "2.2.5")
3811 (version (string-append upstream-version "-" revision))
3816 (url "https://github.com/beltoforion/muparser")
3817 (commit (string-append "v" upstream-version))))
3818 (file-name (git-file-name name version))
3820 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3821 (build-system gnu-build-system)
3823 `(#:configure-flags '("--enable-samples=no")
3824 #:tests? #f)) ;no "check" target
3825 (home-page "http://muparser.beltoforion.de/")
3826 (synopsis "Fast parser library for mathematical expressions")
3828 "muParser is an extensible high performance math parser library. It is
3829 based on transforming an expression into a bytecode and precalculating constant
3831 (license license:expat))))
3833 (define-public openblas
3840 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3841 version "%20version.tar.gz"))
3842 (file-name (string-append name "-" version ".tar.gz"))
3845 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3846 (build-system gnu-build-system)
3848 `(#:test-target "test"
3849 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3850 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3851 ;; we need to disable substitutions.
3853 ,(let ((system (or (%current-target-system) (%current-system))))
3854 (or (string-prefix? "x86_64" system)
3855 (string-prefix? "i686" system)
3856 (string-prefix? "mips" system)
3857 (string-prefix? "aarch64" system)))
3859 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3861 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3863 ;; This is the maximum number of threads OpenBLAS will ever use (that
3864 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3865 ;; is used.) If we don't set it, the makefile sets it to the number
3866 ;; of cores of the build machine, which is obviously wrong.
3869 ;; Build the library for all supported CPUs. This allows
3870 ;; switching CPU targets at runtime with the environment variable
3871 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3872 ;; Unfortunately, this is not supported on all architectures,
3873 ;; where it leads to failed builds.
3874 ,@(let ((system (or (%current-target-system) (%current-system))))
3876 ((or (string-prefix? "x86_64" system)
3877 (string-prefix? "i686" system))
3878 '("DYNAMIC_ARCH=1"))
3879 ;; On some of these architectures the CPU can't be detected.
3880 ((string-prefix? "powerpc64le" system)
3883 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3884 ;; two available MIPS targets special extended instructions
3885 ;; for Loongson cores are used.
3886 ((string-prefix? "mips" system)
3887 '("TARGET=SICORTEX"))
3888 ;; On aarch64 force the generic 'armv8-a' target
3889 ((string-prefix? "aarch64" system)
3891 ;; Failed to detect CPU.
3892 ((string-prefix? "armhf" system)
3895 ;; no configure script
3897 (modify-phases %standard-phases
3899 (add-before 'build 'set-extralib
3900 (lambda* (#:key inputs #:allow-other-keys)
3901 ;; Get libgfortran found when building in utest.
3903 (string-append "-L" (assoc-ref inputs "fortran-lib")
3907 `(("fortran-lib" ,gfortran "lib")))
3910 ("fortran" ,gfortran)
3912 (home-page "https://www.openblas.net/")
3913 (synopsis "Optimized BLAS library based on GotoBLAS")
3915 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3916 (license license:bsd-3)))
3918 (define-public openblas-ilp64
3919 (package/inherit openblas
3920 (name "openblas-ilp64")
3921 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3923 (substitute-keyword-arguments (package-arguments openblas)
3924 ((#:make-flags flags '())
3925 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3927 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3928 (license license:bsd-3)))
3934 (home-page "https://github.com/flame/blis")
3937 (uri (git-reference (url home-page) (commit version)))
3940 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
3941 (file-name (git-file-name "blis" version))))
3943 `(("python" ,python)
3945 (build-system gnu-build-system)
3948 ((guix build gnu-build-system)
3951 #:test-target "test"
3953 (modify-phases %standard-phases
3955 (lambda* (#:key outputs
3958 (configure-flags '())
3960 ;; This is a home-made 'configure' script.
3961 (let* ((out (assoc-ref outputs "out"))
3962 ;; Guix-specific support for choosing the configuration
3963 ;; via #:configure-flags: see below for details.
3964 (config-flag-prefix "--blis-config=")
3965 (maybe-config-flag (find
3967 (string-prefix? config-flag-prefix s))
3969 (configure-flags (if maybe-config-flag
3970 (delete maybe-config-flag
3973 ;; Select the "configuration" to build.
3974 ;; The "generic" configuration is non-optimized but
3975 ;; portable (no assembly).
3976 ;; The "x86_64" configuration family includes
3977 ;; sub-configurations for all supported
3978 ;; x86_64 microarchitectures.
3979 ;; BLIS currently lacks runtime hardware detection
3980 ;; for other architectures: see
3981 ;; <https://github.com/flame/blis/commit/c534da6>.
3982 ;; Conservatively, we stick to "generic" on armhf,
3983 ;; aarch64, and ppc64le for now. (But perhaps
3984 ;; "power9", "cortexa9", and "cortexa57" might be
3985 ;; general enough to use?)
3986 ;; Another approach would be to use the "auto"
3987 ;; configuration and make this package
3988 ;; non-substitutable.
3989 ;; The build is fairly intensive, though.
3993 (substring maybe-config-flag
3994 (string-length config-flag-prefix)))
3995 ((string-prefix? "x86_64" (or target system))
4004 "--enable-threading=openmp"
4005 "--enable-verbose-make"
4008 (format #t "configure args: ~s~%" configure-args)
4013 (add-before 'check 'show-test-output
4015 ;; By default "make check" is silent. Make it verbose.
4016 (system "tail -F output.testsuite &")
4018 (synopsis "High-performance basic linear algebra (BLAS) routines")
4020 "BLIS is a portable software framework for instantiating high-performance
4021 BLAS-like dense linear algebra libraries. The framework was designed to
4022 isolate essential kernels of computation that, when optimized, immediately
4023 enable optimized implementations of most of its commonly used and
4024 computationally intensive operations. While BLIS exports a new BLAS-like API,
4025 it also includes a BLAS compatibility layer which gives application developers
4026 access to BLIS implementations via traditional BLAS routine calls.")
4027 (license license:bsd-3)))
4029 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4030 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4031 (define-public blis-knl (deprecated-package "blis-knl" blis))
4033 (define ignorance blis)
4035 (define-public openlibm
4043 (url "https://github.com/JuliaLang/openlibm")
4044 (commit (string-append "v" version))))
4045 (file-name (git-file-name name version))
4047 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
4048 (build-system gnu-build-system)
4051 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4053 ;; no configure script
4054 (modify-phases %standard-phases (delete 'configure))
4055 #:tests? #f)) ;the tests are part of the default target
4056 (home-page "https://openlibm.org/")
4057 (synopsis "Portable C mathematical library (libm)")
4059 "OpenLibm is an effort to have a high quality, portable, standalone C
4060 mathematical library (libm). It can be used standalone in applications and
4061 programming language implementations. The project was born out of a need to
4062 have a good libm for the Julia programming language that worked consistently
4063 across compilers and operating systems, and in 32-bit and 64-bit
4065 ;; Each architecture has its own make target, and there is none for mips.
4066 (supported-systems (delete "mips64el-linux" %supported-systems))
4067 ;; See LICENSE.md for details.
4068 (license (list license:expat
4071 license:public-domain
4072 license:lgpl2.1+))))
4074 (define-public openspecfun
4076 (name "openspecfun")
4082 (url "https://github.com/JuliaLang/openspecfun")
4083 (commit (string-append "v" version))))
4084 (file-name (git-file-name name version))
4086 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4087 (build-system gnu-build-system)
4089 '(#:tests? #f ; no "check" target
4091 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4093 (modify-phases %standard-phases
4094 (delete 'configure)))) ; no configure script
4096 `(("fortran" ,gfortran)))
4097 (home-page "https://github.com/JuliaLang/openspecfun")
4098 (synopsis "Collection of special mathematical functions")
4100 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4101 portable package for Bessel Functions of a Complex Argument and Nonnegative
4102 Order; it contains subroutines for computing Bessel functions and Airy
4103 functions. Faddeeva allows computing the various error functions of arbitrary
4104 complex arguments (Faddeeva function, error function, complementary error
4105 function, scaled complementary error function, imaginary error function, and
4106 Dawson function); given these, one can also easily compute Voigt functions,
4107 Fresnel integrals, and similar related functions as well.")
4108 ;; Faddeeva is released under the Expat license; AMOS is included as
4109 ;; public domain software.
4110 (license (list license:expat license:public-domain))))
4112 (define-public suitesparse
4114 (name "suitesparse")
4120 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4121 (commit (string-append "v" version))))
4122 (file-name (git-file-name name version))
4125 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4126 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4127 (modules '((guix build utils)))
4129 ;; Remove bundled metis source
4131 (delete-file-recursively "metis-5.1.0")
4133 (build-system gnu-build-system)
4135 `(#:tests? #f ;no "check" target
4137 (list (string-append "CC=" ,(cc-for-target))
4139 "MY_METIS_LIB=-lmetis"
4141 ;; The default is to link against netlib lapack. Use OpenBLAS
4143 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4145 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4146 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4147 (assoc-ref %outputs "out")
4148 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4149 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4150 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4151 " -DCMAKE_SKIP_RPATH=TRUE"
4152 " -DCMAKE_BUILD_TYPE=Release"
4153 " -DCMAKE_INSTALL_LIBDIR=lib")
4154 (string-append "INSTALL_LIB="
4155 (assoc-ref %outputs "out") "/lib")
4156 (string-append "INSTALL_INCLUDE="
4157 (assoc-ref %outputs "out") "/include")
4160 (modify-phases %standard-phases
4161 (delete 'configure)))) ;no configure script
4164 ("openblas" ,openblas)
4169 `(("cmake" ,cmake-minimal)
4171 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4172 (synopsis "Suite of sparse matrix software")
4174 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4175 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4176 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4177 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4178 CXSparse, a concise sparse Cholesky factorization package; and many other
4181 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4183 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4184 (license (list license:gpl2+ license:lgpl2.1+))))
4186 (define-public atlas
4192 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4193 version "/atlas" version ".tar.bz2"))
4196 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4197 (build-system gnu-build-system)
4198 (home-page "http://math-atlas.sourceforge.net/")
4199 (inputs `(("gfortran" ,gfortran)
4200 ("lapack-tar" ,(package-source lapack))))
4201 (outputs '("out" "doc"))
4202 ;; For the moment we drop support for MIPS at it fails to compile. See
4203 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4204 (supported-systems (delete "mips64el-linux" %supported-systems))
4206 `(#:parallel-build? #f
4207 #:parallel-tests? #f
4209 ;; ATLAS tunes itself for the machine it is built on, as explained at
4210 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4211 ;; For this reason, we want users to build it locally instead of using
4215 #:modules ((srfi srfi-26)
4216 (guix build gnu-build-system)
4219 `(;; Generate position independent code suitable for dynamic libraries
4220 ;; and use WALL timer to get more accurate timing.
4221 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4224 ,,(if (string-match "64" (%current-system))
4227 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4228 ;; needed to compile C files before it is generated.
4229 "-Ss" "pmake" "make -j 1"
4230 ;; Probe is failing for MIPS. We therefore define the system
4231 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4232 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4233 ,,@(if (string-prefix? "mips" (%current-system))
4234 (list "-A" "49" "-V" "1")
4236 ;; Generate shared libraries.
4238 ;; Build a full LAPACK library.
4239 ,(string-append "--with-netlib-lapack-tarfile="
4240 (assoc-ref %build-inputs "lapack-tar")))
4242 (modify-phases %standard-phases
4243 (add-after 'install 'install-doc
4244 (lambda* (#:key outputs inputs #:allow-other-keys)
4245 (let ((doc (string-append (assoc-ref outputs "doc")
4246 "/share/doc/atlas")))
4248 (for-each (cut install-file <> doc)
4249 (find-files "../ATLAS/doc" ".*"))
4251 (add-after 'check 'check-pt
4252 (lambda _ (invoke "make" "ptcheck")))
4253 ;; Fix files required to run configure.
4254 (add-before 'configure 'fix-/bin/sh
4256 ;; Use `sh', not `/bin/sh'.
4257 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4261 ;; Fix /bin/sh in generated make files.
4262 (add-after 'configure 'fix-/bin/sh-in-generated-files
4264 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4268 ;; ATLAS configure program does not accepts the default flags
4269 ;; passed by the 'gnu-build-system'.
4271 (lambda* (#:key native-inputs inputs outputs
4272 (configure-flags '())
4273 #:allow-other-keys #:rest args)
4274 (let* ((prefix (assoc-ref outputs "out"))
4275 (bash (or (and=> (assoc-ref
4276 (or native-inputs inputs) "bash")
4277 (cut string-append <> "/bin/bash"))
4279 (flags `(,(string-append "--prefix=" prefix)
4281 (abs-srcdir (getcwd))
4282 (srcdir (string-append "../" (basename abs-srcdir))))
4283 (format #t "source directory: ~s (relative from build: ~s)~%"
4287 (format #t "build directory: ~s~%" (getcwd))
4288 (format #t "configure flags: ~s~%" flags)
4290 (string-append srcdir "/configure")
4292 (synopsis "Automatically Tuned Linear Algebra Software")
4294 "ATLAS is an automatically tuned linear algebra software library
4295 providing C and Fortran77 interfaces to a portably efficient BLAS
4296 implementation, as well as a few routines from LAPACK.
4298 Optimization occurs at build time. For this reason, the library is built on
4299 the machine where it is installed, without resorting to pre-built substitutes.
4301 Before building the library, CPU throttling should be disabled. This can be
4302 done in the BIOS, or, on GNU/Linux, with the following command:
4305 # cpupower --governor performance
4308 Failure to do so will result in a library with poor performance.")
4309 ;; The test suite is notoriously lengthy and routinely exceeds the default
4310 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4311 (properties '((timeout . 86400))) ; 1 day
4312 (license license:bsd-3)))
4322 (url "https://github.com/recp/cglm")
4323 (commit (string-append "v" version))))
4324 (file-name (git-file-name name version))
4326 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4327 (build-system cmake-build-system)
4330 (list "-DCGLM_USE_TEST=ON")))
4331 (home-page "https://github.com/recp/cglm")
4332 (synopsis "Mathematics C library for graphics programming")
4334 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4335 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4338 It's similar to the original C++ GLM library but written in C99 and compatible
4340 (license license:expat)))
4349 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4350 version "/glm-" version ".zip"))
4352 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4353 (build-system cmake-build-system)
4355 `(#:phases (modify-phases %standard-phases
4357 (lambda* (#:key outputs #:allow-other-keys)
4358 ;; Since version 0.9.9.6, 'make install' is not supported
4359 ;; and we have to do it "manually". Upstream discussion:
4360 ;; <https://github.com/g-truc/glm/pull/968>.
4361 (let* ((source (string-append "../glm"))
4362 (out (assoc-ref outputs "out"))
4363 (inc (string-append out "/include"))
4364 (lib (string-append out "/lib"))
4365 (pkgconfig (string-append lib "/pkgconfig")))
4366 (with-directory-excursion source
4369 (copy-recursively "glm" (string-append inc "/glm"))
4370 (copy-recursively "cmake" (string-append lib "/cmake"))
4371 (call-with-output-file (string-append pkgconfig "/glm.pc")
4375 includedir=${prefix}/include
4378 Description: OpenGL Mathematics
4380 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4383 `(("unzip" ,unzip)))
4384 (home-page "https://glm.g-truc.net/")
4385 (synopsis "OpenGL Mathematics library")
4386 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4387 library for graphics software based on the OpenGL Shading Language (GLSL)
4389 (license license:expat)))
4391 (define-public lpsolve
4398 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4399 "/lp_solve_" version "_source.tar.gz"))
4402 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4403 (modules '((guix build utils)))
4406 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4408 ;; Pretend to be on a 64 bit platform to obtain a common directory
4409 ;; name for the build results on all architectures; nothing else
4410 ;; seems to depend on it.
4411 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4413 ;; The check for 'isnan' as it is written fails with
4414 ;; "non-floating-point argument in call to function
4415 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4416 ;; definition, which in turn leads to bad things. Fix the feature
4418 (("isnan\\(0\\)") "isnan(0.)"))
4420 (build-system gnu-build-system)
4422 `(#:tests? #f ; no check target
4424 (modify-phases %standard-phases
4425 (delete 'configure) ; no configure script
4428 (with-directory-excursion "lpsolve55"
4429 (invoke "bash" "ccc"))
4430 (with-directory-excursion "lp_solve"
4431 (invoke "bash" "ccc"))
4434 (lambda* (#:key outputs #:allow-other-keys)
4435 (let* ((out (assoc-ref outputs "out"))
4436 (bin (string-append out "/bin"))
4437 (lib (string-append out "/lib"))
4438 ;; This is where LibreOffice expects to find the header
4439 ;; files, and where they are installed by Debian.
4440 (include (string-append out "/include/lpsolve")))
4441 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4442 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4443 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4445 ;; Install a subset of the header files as on Debian
4446 ;; (plus lp_bit.h, which matches the regular expression).
4447 (for-each (lambda (name)
4448 (install-file name include))
4449 (find-files "." "lp_[HMSa-z].*\\.h$"))
4450 (with-directory-excursion "shared"
4451 (for-each (lambda (name)
4452 (install-file name include))
4453 (find-files "." "\\.h$")))
4455 (home-page "http://lpsolve.sourceforge.net/")
4456 (synopsis "Mixed integer linear programming (MILP) solver")
4458 "lp_solve is a mixed integer linear programming solver based on the
4459 revised simplex and the branch-and-bound methods.")
4460 (license license:lgpl2.1+)))
4462 (define-public dealii
4469 (uri (string-append "https://github.com/dealii/dealii/releases/"
4470 "download/v" version "/dealii-" version ".tar.gz"))
4473 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4474 (modules '((guix build utils)))
4476 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4478 (delete-file-recursively "bundled")
4480 (build-system cmake-build-system)
4488 ("arpack" ,arpack-ng)
4489 ("muparser" ,muparser)
4490 ("gfortran" ,gfortran)
4491 ("suitesparse" ,suitesparse))) ;for UMFPACK
4493 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4495 ;; Work around a bug in libsuitesparseconfig linking
4496 ;; see https://github.com/dealii/dealii/issues/4745
4497 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4498 (home-page "https://www.dealii.org")
4499 (synopsis "Finite element library")
4501 "Deal.II is a C++ program library targeted at the computational solution
4502 of partial differential equations using adaptive finite elements. The main
4503 aim of deal.II is to enable rapid development of modern finite element codes,
4504 using among other aspects adaptive meshes and a wide array of tools often used
4505 in finite element programs.")
4506 (license license:lgpl2.1+)))
4508 (define-public dealii-openmpi
4509 (package (inherit dealii)
4510 (name "dealii-openmpi")
4513 ;;Supported only with MPI:
4514 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4515 ("p4est" ,p4est-openmpi)
4516 ("petsc" ,petsc-openmpi)
4517 ("slepc" ,slepc-openmpi)
4518 ("metis" ,metis) ;for MUMPS
4519 ("scalapack" ,scalapack) ;for MUMPS
4520 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4521 ("arpack" ,arpack-ng-openmpi)
4522 ,@(fold alist-delete (package-inputs dealii)
4523 '("p4est" "arpack"))))
4525 (substitute-keyword-arguments (package-arguments dealii)
4526 ((#:configure-flags cf)
4527 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4529 ((#:phases phases '%standard-phases)
4530 `(modify-phases ,phases
4531 (add-before 'check 'mpi-setup
4532 ,%openmpi-setup)))))
4533 (synopsis "Finite element library (with MPI support)")))
4535 (define-public flann
4539 (home-page "https://github.com/mariusmuja/flann/")
4543 (uri (git-reference (url home-page) (commit version)))
4544 (file-name (git-file-name name version))
4547 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4548 (patches (search-patches "flann-cmake-3.11.patch"))))
4549 (build-system cmake-build-system)
4552 `(("unzip" ,unzip)))
4555 ;; FIXME: 'mkoctfile' fails with a linker error:
4556 ;; ld: cannot find -loctinterp
4557 ;; ld: cannot find -loctave
4558 ;; Disable it for now.
4559 ;;("octave" ,octave-cli)
4560 ("python" ,python-2) ; print syntax
4561 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4564 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4565 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4566 #:strip-directories '("lib" "lib64" "libexec"
4567 "bin" "sbin" "share/flann/octave")
4569 ;; Save 12 MiB by not installing .a files. Passing
4570 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4571 #:phases (modify-phases %standard-phases
4572 (add-after 'install 'remove-static-libraries
4573 (lambda* (#:key outputs #:allow-other-keys)
4574 (let* ((out (assoc-ref outputs "out"))
4575 (lib (string-append out "/lib")))
4576 (for-each delete-file
4577 (find-files lib "\\.a$"))
4580 #:tests? #f)) ; The test data are downloaded from the Internet.
4581 (synopsis "Library for approximate nearest neighbors computation")
4582 (description "FLANN is a library for performing fast approximate
4583 nearest neighbor searches in high dimensional spaces. It implements a
4584 collection of algorithms and a system for automatically choosing the best
4585 algorithm and optimum parameters depending on the dataset.
4587 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4588 (license (license:non-copyleft "file://COPYING"
4589 "See COPYING in the distribution."))))
4591 (define-public wcalc
4598 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4599 "wcalc-" version ".tar.bz2"))
4602 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4603 (build-system gnu-build-system)
4606 ("readline" ,readline)))
4607 (home-page "http://w-calc.sourceforge.net/index.php")
4608 (synopsis "Flexible command-line scientific calculator")
4609 (description "Wcalc is a very capable calculator. It has standard functions
4610 (sin, asin, and sinh for example, in either radians or degrees), many
4611 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4612 variables, a command history, hex/octal/binary input and output, unit
4613 conversions, embedded comments, and an expandable expression entry field. It
4614 evaluates expressions using the standard order of operations.")
4615 (license license:gpl2+)))
4624 (url "https://github.com/xaos-project/XaoS")
4625 (commit (string-append "release-" version))))
4626 (file-name (git-file-name name version))
4629 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
4630 (build-system gnu-build-system)
4631 (native-inputs `(("gettext" ,gettext-minimal)
4632 ("qtbase" ,qtbase-5)
4633 ("qttools" ,qttools)))
4634 (inputs `(("libx11" ,libx11)
4638 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4639 ;; not enough for this package to install properly. These phases fix that.
4641 `(#:tests? #f ;no "check" target
4643 (modify-phases %standard-phases
4644 (add-before 'configure 'make-qt-deterministic
4646 ;; Make Qt deterministic.
4647 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4650 (lambda* (#:key outputs #:allow-other-keys)
4651 (let ((out (assoc-ref outputs "out")))
4652 (substitute* "XaoS.pro"
4653 ;; The DESTDIR is originally set to install the xaos binary to
4654 ;; the "bin" folder inside the build directory. Setting make
4655 ;; flags doesn't seem to change this.
4657 (string-append "DESTDIR=" out "/bin"))
4658 ;; Set the correct path to the lrelease binary.
4659 (("lrelease-qt5") "lrelease"))
4660 (substitute* "src/include/config.h"
4661 (("/usr/share/XaoS")
4662 (string-append out "/share/XaoS")))
4664 (add-after 'install 'install-data
4665 (lambda* (#:key outputs #:allow-other-keys)
4666 (let* ((out (assoc-ref outputs "out"))
4667 (share (string-append out "/share")))
4671 (copy-recursively folder
4672 (string-append share "/XaoS/" folder)))
4673 '("catalogs" "examples" "tutorial"))
4674 (install-file "xdg/xaos.png"
4675 (string-append share "/pixmaps"))
4676 (install-file "xdg/xaos.desktop"
4677 (string-append share "/applications")))
4679 (synopsis "Real-time fractal zoomer")
4680 (description "GNU XaoS is a graphical program that generates fractal
4681 patterns and allows you to zoom in and out of them infinitely in a fluid,
4682 continuous manner. It also includes tutorials that help to explain how fractals
4683 are built. It can generate many different fractal types such as the Mandelbrot
4685 (home-page "https://xaos-project.github.io/")
4686 (license license:gpl2+)))
4688 (define-public hypre
4696 (url "https://github.com/hypre-space/hypre")
4697 (commit (string-append "v" version))))
4698 (file-name (git-file-name name version))
4700 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4701 (modules '((guix build utils)))
4704 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4705 ;; substitute the release date.
4706 (substitute* "src/utilities/HYPRE_utilities.h"
4707 (("Date Compiled: .*$")
4708 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4710 (build-system gnu-build-system)
4711 (outputs '("out" ; 6.1 MiB of headers and libraries
4712 "doc")) ; 4.8 MiB of documentation
4716 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4717 ("texlive" ,(texlive-union (list texlive-xypic
4719 texlive-latex-hyperref
4721 ("ghostscript" ,ghostscript)))
4723 `(("blas" ,openblas)
4724 ("lapack" ,lapack)))
4726 `(#:modules ((srfi srfi-1)
4727 ,@%gnu-build-system-modules)
4728 #:configure-flags '("--enable-shared"
4736 (modify-phases %standard-phases
4737 (add-before 'build 'set-HOME
4739 ;; FIXME: texlive-union does not find the built
4740 ;; metafonts, so it tries to generate them in HOME.
4741 (setenv "HOME" "/tmp")
4743 (add-before 'configure 'chdir-src
4744 (lambda _ (chdir "src")))
4746 (lambda* (#:key build target configure-flags
4747 #:allow-other-keys #:rest args)
4748 (let* ((configure (assoc-ref %standard-phases 'configure)))
4751 (list #:configure-flags
4752 (cons (string-append
4753 "--host=" (or target build))
4754 configure-flags)))))))
4755 (add-after 'build 'build-docs
4757 (invoke "make" "-Cdocs" "pdf" "html")))
4760 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4761 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4762 (invoke "make" "check" "CHECKRUN=")
4763 (for-each (lambda (filename)
4764 (let ((size (stat:size (stat filename))))
4765 (when (positive? size)
4766 (error (format #f "~a size ~d; error indication~%"
4768 (find-files "test" ".*\\.err$"))
4770 (add-after 'install 'install-docs
4771 (lambda* (#:key outputs #:allow-other-keys)
4772 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4773 (let* ((doc (assoc-ref outputs "doc"))
4774 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4775 (with-directory-excursion "docs"
4776 (for-each (lambda (base)
4777 (install-file (string-append base ".pdf") docdir)
4778 (copy-recursively base docdir)) ; html docs
4779 '("HYPRE_usr_manual"
4780 "HYPRE_ref_manual")))
4782 (home-page "https://computing.llnl.gov/projects\
4783 /hypre-scalable-linear-solvers-multigrid-methods")
4784 (synopsis "Library of solvers and preconditioners for linear equations")
4786 "HYPRE is a software library of high performance preconditioners and
4787 solvers for the solution of large, sparse linear systems of equations. It
4788 features multigrid solvers for both structured and unstructured grid
4790 (license license:lgpl2.1)))
4792 (define-public hypre-openmpi
4793 (package (inherit hypre)
4794 (name "hypre-openmpi")
4797 ,@(package-inputs hypre)))
4799 (substitute-keyword-arguments (package-arguments hypre)
4800 ((#:configure-flags flags)
4802 ,@(delete "--without-MPI" ,flags)))
4804 `(modify-phases ,phases
4805 (add-before 'check 'mpi-setup
4806 ,%openmpi-setup)))))
4807 (synopsis "Parallel solvers and preconditioners for linear equations")
4809 "HYPRE is a software library of high performance preconditioners and
4810 solvers for the solution of large, sparse linear systems of equations on
4811 parallel computers. It features parallel multigrid solvers for both
4812 structured and unstructured grid problems.")))
4814 (define-public matio
4821 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4822 "matio-" version ".tar.gz"))
4825 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
4826 (build-system gnu-build-system)
4829 ("hdf5" ,hdf5-1.8)))
4830 (home-page "http://matio.sourceforge.net/")
4831 (synopsis "Library for reading and writing MAT files")
4832 (description "Matio is a library for reading and writing MAT files. It
4833 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4834 (license license:bsd-2)))
4841 (origin (method url-fetch)
4842 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4843 "download/" version "/Vc-" version ".tar.gz"))
4846 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4847 (build-system cmake-build-system)
4850 '("-DBUILD_TESTING=ON"
4851 ;; By default, Vc will optimize for the CPU of the build machine.
4852 ;; Setting this to "none" makes it create portable binaries. See
4853 ;; "cmake/OptimizeForArchitecture.cmake".
4854 "-DTARGET_ARCHITECTURE=none")
4855 #:phases (modify-phases %standard-phases
4856 (add-after 'unpack 'copy-testdata
4857 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4858 (let ((testdata (assoc-ref (or native-inputs inputs)
4860 (copy-recursively testdata "tests/testdata")
4863 `(("virtest" ,virtest)
4865 ;; This is a submodule in the git project, but not part of the
4866 ;; released sources. See the git branch for the commit to take.
4867 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4871 (url "https://github.com/VcDevel/vc-testdata")
4872 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4873 (file-name (git-file-name "vc-testdata"
4874 (string-take commit 7)))
4877 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4878 (synopsis "SIMD vector classes for C++")
4879 (description "Vc provides portable, zero-overhead C++ types for explicitly
4880 data-parallel programming. It is a library designed to ease explicit
4881 vectorization of C++ code. Its types enable explicitly stating data-parallel
4882 operations on multiple values. The parallelism is therefore added via the type
4883 system. Vc has an intuitive API and provides portability between different
4884 compilers and compiler versions as well as portability between different vector
4885 instruction sets. Thus, an application written with Vc can be compiled for:
4888 @item SSE2 up to SSE4.2 or SSE4a
4891 @item NEON (in development)
4892 @item NVIDIA GPUs / CUDA (in development)
4894 (home-page "https://github.com/VcDevel/Vc")
4895 ;; "No support_???.cpp file exists for this architecture."
4896 (supported-systems '("x86_64-linux" "i686-linux"))
4897 (license license:bsd-3)))
4899 (define-public reducelcs
4900 ;; This is the last commit which is available upstream, no
4901 ;; release happened since 2010.
4902 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4906 (version (string-append "1.0-" revision "." (string-take commit 7)))
4911 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4913 (file-name (string-append name "-" version "-checkout"))
4916 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4917 (build-system gnu-build-system)
4919 `(("openlibm" ,openlibm)))
4921 `(#:tests? #f ; no tests
4923 (modify-phases %standard-phases
4924 (delete 'configure) ; No configure script exists.
4925 (replace 'install ; No install phase exists.
4926 (lambda* (#:key outputs #:allow-other-keys)
4927 (let* ((out (assoc-ref outputs "out"))
4928 (bin (string-append out "/bin")))
4929 (install-file "Approximation" bin)
4930 (install-file "CollectResults" bin)
4931 (install-file "GenerateInstances" bin)
4933 (synopsis "Approximate Longest Commons Subsequence computation tool")
4935 "@code{reduceLCS} is an implementation of the Reduce-Expand
4936 algorithm for LCS. It is a fast program to compute the approximate
4937 Longest Commons Subsequence of a set of strings.")
4938 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4939 (license license:gpl3+))))
4941 (define-public jacal
4948 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4951 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4952 (patches (search-patches "jacal-fix-texinfo.patch"))))
4953 (build-system gnu-build-system)
4956 (modify-phases %standard-phases
4957 (add-before 'build 'pre-build
4958 ;; Don't use upstream's script - it really doesn't fit into
4959 ;; Guix's functional paradigm.
4960 (lambda* (#:key inputs outputs #:allow-other-keys)
4961 (substitute* "Makefile"
4962 (("^install: install-script") "install: "))))
4963 (add-after 'install 'post-install
4964 ;; Instead, we provide our own simplified script.
4965 (lambda* (#:key inputs outputs #:allow-other-keys)
4966 (let ((wrapper (string-append (assoc-ref outputs "out")
4968 (format (open wrapper (logior O_WRONLY O_CREAT))
4969 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4970 "-e '(slib:load \"~a/lib/jacal/math\") "
4973 (assoc-ref inputs "scm")
4974 (assoc-ref outputs "out"))
4975 (chmod wrapper #o555))))
4977 (lambda* (#:key outputs #:allow-other-keys)
4978 (invoke "./configure"
4979 (string-append "--prefix="
4980 (assoc-ref outputs "out"))))))))
4981 (inputs `(("scm" ,scm)))
4982 (native-inputs `(("unzip" ,unzip)
4983 ("texinfo" ,texinfo)))
4984 (synopsis "Symbolic mathematics system")
4985 (description "GNU JACAL is an interactive symbolic mathematics program based on
4986 Scheme. It manipulate and simplify a range of mathematical expressions such
4987 as equations, scalars, vectors, and matrices.")
4988 (home-page "https://www.gnu.org/software/jacal/")
4989 (license license:gpl3+)))
4995 (home-page "https://github.com/Z3Prover/z3")
4998 (uri (git-reference (url home-page)
4999 (commit (string-append "z3-" version))))
5000 (file-name (git-file-name name version))
5003 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5004 (build-system gnu-build-system)
5006 `(#:imported-modules ((guix build python-build-system)
5007 ,@%gnu-build-system-modules)
5008 #:modules (((guix build python-build-system) #:select (site-packages))
5009 (guix build gnu-build-system)
5012 (modify-phases %standard-phases
5013 (add-after 'unpack 'enable-bytecode-determinism
5015 (setenv "PYTHONHASHSEED" "0")
5017 (add-after 'unpack 'fix-compatability
5018 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5020 (substitute* "src/util/mpz.cpp"
5021 (("#include <immintrin.h>") ""))
5023 (add-before 'configure 'bootstrap
5025 (invoke "python" "scripts/mk_make.py")))
5026 ;; work around gnu-build-system's setting --enable-fast-install
5027 ;; (z3's `configure' is a wrapper around the above python file,
5028 ;; which fails when passed --enable-fast-install)
5030 (lambda* (#:key inputs outputs #:allow-other-keys)
5031 (invoke "./configure"
5033 (string-append "--prefix=" (assoc-ref outputs "out"))
5034 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5035 (add-after 'configure 'change-directory
5039 (add-before 'check 'make-test-z3
5041 ;; Build the test suite executable.
5042 (invoke "make" "test-z3" "-j"
5043 (number->string (parallel-job-count)))))
5046 ;; Run all the tests that don't require arguments.
5047 (invoke "./test-z3" "/a"))))))
5050 ("python" ,python-wrapper)))
5051 (synopsis "Theorem prover")
5052 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5053 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5054 (license license:expat)))
5059 (version "2018.11.001")
5062 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5063 version "/elpa-" version ".tar.gz"))
5066 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5067 (build-system gnu-build-system)
5069 `(("fortran" ,gfortran)
5070 ("perl" ,perl))) ;for configure and deps
5072 `(("blas" ,openblas)))
5077 ;; ELPA unfortunately does not support runtime dispatch, so we can
5078 ;; only enable the "generic" kernels. See the "Cross compilation"
5079 ;; section of INSTALL.md.
5081 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5082 "--disable-avx" "--disable-avx2" "--disable-avx512"
5083 ,(string-append "CFLAGS=-O3 "
5084 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5085 "-ftree-vect-loop-version -ftree-vectorize "
5086 ,(let ((system (or (%current-target-system)
5087 (%current-system))))
5089 ((or (string-prefix? "x86_64" system)
5090 (string-prefix? "i686" system))
5093 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5095 (modify-phases %standard-phases
5096 (add-before 'configure 'patch-header-generation
5098 (substitute* "configure"
5099 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5100 (string-append & " CPP=\"$CPP\"")))
5102 (add-before 'check 'setup-tests
5104 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5105 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5106 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5107 ;; for Fortran. This also causes several tests to pass that
5108 ;; otherwise would otherwise fail with matrix size 5000; possibly
5109 ;; due to floating point tolerances that are too tight.
5110 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5111 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5112 (substitute* "Makefile"
5113 ;; Test scripts are generated, patch the shebang
5114 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5116 (home-page "https://elpa.mpcdf.mpg.de")
5117 (synopsis "Eigenvalue solvers for symmetric matrices")
5119 "The ELPA library provides efficient and scalable direct eigensolvers for
5120 symmetric matrices.")
5121 (license license:lgpl3)))
5123 (define-public elpa-openmpi
5124 (package (inherit elpa)
5125 (name "elpa-openmpi")
5128 ("scalapack" ,scalapack)
5129 ,@(package-inputs elpa)))
5131 (substitute-keyword-arguments (package-arguments elpa)
5132 ((#:configure-flags cf '())
5133 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5134 ((#:phases phases '%standard-phases)
5135 `(modify-phases ,phases
5136 (add-before 'check 'mpi-setup
5138 ;; Tests use 2 mpi tasks by default, use our remaining build
5139 ;; cores as OpenMP threads.
5140 (setenv "OMP_NUM_THREADS" (number->string
5141 (max (quotient (parallel-job-count) 2)
5143 (,%openmpi-setup)))))))
5144 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5146 (define-public elemental
5153 (url "https://github.com/elemental/Elemental")
5154 (commit (string-append "v" version))))
5155 (file-name (git-file-name name version))
5158 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5159 (build-system cmake-build-system)
5160 (home-page "https://github.com/elemental/Elemental")
5162 `(("gfortran" ,gfortran)))
5164 `(("blas" ,openblas)
5165 ("gfortran:lib" ,gfortran "lib")
5174 `(#:build-type "Release" ;default RelWithDebInfo not supported
5175 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5176 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5177 "-DEL_CACHE_WARNINGS:BOOL=YES"
5178 "-DEL_TESTS:BOOL=YES"
5179 "-DCMAKE_INSTALL_LIBDIR=lib"
5180 "-DGFORTRAN_LIB=gfortran")
5181 #:phases (modify-phases %standard-phases
5182 (add-before 'check 'mpi-setup
5184 (add-before 'check 'setup-tests
5186 ;; Parallelism is done at the MPI layer.
5187 (setenv "OMP_NUM_THREADS" "1")
5189 (add-after 'install 'remove-tests
5190 (lambda* (#:key outputs #:allow-other-keys)
5191 ;; Tests are installed, with no easy configuration
5192 ;; switch to prevent this, so delete them.
5193 (delete-file-recursively
5194 (string-append (assoc-ref outputs "out") "/bin"))
5196 (synopsis "Dense and sparse-direct linear algebra and optimization")
5197 (description "Elemental is a modern C++ library for distributed-memory
5198 dense and sparse-direct linear algebra, conic optimization, and lattice
5200 (license license:bsd-2)))
5202 (define-public mcrl2
5205 (version "202106.0")
5209 "https://www.mcrl2.org/download/release/mcrl2-"
5213 "0db9wgy9spwm76mgfisnifrlg69y9cadjgxjr4gdwzfgg6wgqf6d"))))
5218 ("qtbase" ,qtbase-5)))
5219 (build-system cmake-build-system)
5220 (synopsis "Toolset for the mCRL2 formal specification language")
5222 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5223 specification language for describing concurrent discrete event systems. Its
5224 toolset supports analysis and automatic verification, linearisation, simulation,
5225 state-space exploration and generation, and tools to optimise and analyse
5226 specifications. Also, state spaces can be manipulated, visualised and
5228 (home-page "https://mcrl2.org")
5229 (license license:boost1.0)))
5231 (define-public mcrl2-minimal
5234 (name "mcrl2-minimal")
5236 `(("boost" ,boost)))
5238 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5240 (define-public tcalc
5247 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5251 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5252 (build-system gnu-build-system)
5253 (synopsis "The terminal calculator")
5255 "The terminal calculator is a small program to help users of the GNU/Linux
5256 terminal do calculations simply and quickly. The formula to be calculated can
5257 be fed to @command{tcalc} through the command line.")
5258 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5259 (license license:gpl3+)))
5261 (define-public tiny-bignum
5262 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5264 (name "tiny-bignum")
5265 (version (git-version "0" "0" commit))
5270 (url "https://github.com/kokke/tiny-bignum-c")
5272 (file-name (git-file-name "tiny-bignum" commit))
5274 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5275 (build-system gnu-build-system)
5278 (modify-phases %standard-phases
5280 (add-after 'unpack 'patch-tests
5282 (substitute* "scripts/test_rand.py"
5284 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5287 (lambda* (#:key tests? #:allow-other-keys)
5289 (invoke "make" "test"))
5292 (lambda* (#:key outputs #:allow-other-keys)
5293 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5294 (doc (string-append (assoc-ref outputs "out") "/doc")))
5296 (install-file "bn.c" share)
5297 (install-file "bn.h" share)
5299 (install-file "LICENSE" doc)
5300 (install-file "README.md" doc))
5303 `(("python" ,python-wrapper)))
5304 (home-page "https://github.com/kokke/tiny-bignum-c")
5305 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5307 "This library provides portable Arbitrary-precision unsigned integer
5308 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5309 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5310 and comparisons are supported.")
5311 (license license:unlicense))))
5313 (define-public sundials
5320 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5321 "sundials-" version ".tar.gz"))
5324 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5325 (build-system cmake-build-system)
5327 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5329 `(("fortran" ,gfortran) ;for fcmix
5331 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5333 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5334 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5335 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5336 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5337 "-DEXAMPLES_INSTALL:BOOL=OFF"
5339 "-DFCMIX_ENABLE:BOOL=ON"
5341 "-DKLU_ENABLE:BOOL=ON"
5342 ,(string-append "-DKLU_INCLUDE_DIR="
5343 (assoc-ref %build-inputs "suitesparse")
5345 ,(string-append "-DKLU_LIBRARY_DIR="
5346 (assoc-ref %build-inputs "suitesparse")
5348 (home-page "https://computation.llnl.gov/projects/sundials")
5349 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5350 (description "SUNDIALS is a family of software packages implemented with
5351 the goal of providing robust time integrators and nonlinear solvers that can
5352 easily be incorporated into existing simulation codes.")
5353 (license license:bsd-3)))
5355 (define-public sundials-openmpi
5356 (package (inherit sundials)
5357 (name "sundials-openmpi")
5360 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5361 ,@(package-inputs sundials)))
5363 (substitute-keyword-arguments (package-arguments sundials)
5364 ((#:configure-flags flags '())
5365 `(cons* "-DMPI_ENABLE:BOOL=ON"
5366 "-DPETSC_ENABLE:BOOL=ON"
5367 (string-append "-DPETSC_INCLUDE_DIR="
5368 (assoc-ref %build-inputs "petsc")
5370 (string-append "-DPETSC_LIBRARY_DIR="
5371 (assoc-ref %build-inputs "petsc")
5374 ((#:phases phases '%standard-phases)
5375 `(modify-phases ,phases
5376 (add-before 'check 'mpi-setup
5377 ,%openmpi-setup)))))
5378 (synopsis "SUNDIALS with OpenMPI support")))
5380 (define-public combinatorial-blas
5382 (name "combinatorial-blas")
5387 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5389 (match (string-split version #\.)
5390 ((major minor patch)
5391 (string-append major minor "_" patch))) ;e.g. "16_2"
5395 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5396 (patches (search-patches "combinatorial-blas-awpm.patch"
5397 "combinatorial-blas-io-fix.patch"))))
5398 (build-system cmake-build-system)
5401 ("test-data" ,(origin
5403 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5404 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5407 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5409 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5410 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5411 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5413 (modify-phases %standard-phases
5414 (add-before 'check 'mpi-setup
5416 (add-before 'check 'test-setup
5417 (lambda* (#:key inputs #:allow-other-keys)
5418 (setenv "OMP_NUM_THREADS" "2")
5419 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5420 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5421 (synopsis "Linear algebra primitives for graph analytics")
5422 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5423 distributed-memory parallel graph library offering a small but powerful set of
5424 linear algebra primitives specifically targeting graph analytics.")
5426 license:gpl2+ ;include/psort/(funnel|sort)*.h
5427 license:x11 ;usort and psort
5428 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5430 (define-public dune-common
5432 (name "dune-common")
5437 (uri (string-append "https://dune-project.org/download/"
5438 version "/dune-common-" version ".tar.gz"))
5441 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5442 (build-system cmake-build-system)
5445 (modify-phases %standard-phases
5446 (add-after 'build 'build-tests
5447 (lambda* (#:key make-flags #:allow-other-keys)
5448 (apply invoke "make" "build_tests" make-flags))))))
5452 ("openblas" ,openblas)
5454 ("superlu" ,superlu)))
5456 `(("gfortran" ,gfortran)
5457 ("pkg-config" ,pkg-config)))
5458 (home-page "https://dune-project.org/")
5459 (synopsis "Distributed and Unified Numerics Environment")
5460 (description "DUNE, the Distributed and Unified Numerics Environment is a
5461 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5462 grid-based methods. It supports the easy implementation of methods like
5463 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5464 Differences} (FD).")
5465 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5466 (license license:gpl2)))
5468 (define-public dune-geometry
5470 (name "dune-geometry")
5475 (uri (string-append "https://dune-project.org/download/"
5476 version "/dune-geometry-" version ".tar.gz"))
5479 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5480 (build-system cmake-build-system)
5483 (modify-phases %standard-phases
5484 (add-after 'build 'build-tests
5485 (lambda* (#:key make-flags #:allow-other-keys)
5486 (apply invoke "make" "build_tests" make-flags))))))
5488 `(("dune-common" ,dune-common)
5490 ("openblas" ,openblas)
5492 ("python" ,python)))
5494 `(("gfortran" ,gfortran)
5495 ("pkg-config" ,pkg-config)))
5496 (home-page "https://dune-project.org/")
5497 (synopsis "Distributed and Unified Numerics Environment")
5498 (description "DUNE, the Distributed and Unified Numerics Environment is a
5499 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5500 grid-based methods. It supports the easy implementation of methods like
5501 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5504 This package contains the basic DUNE geometry classes.")
5505 ;; GPL version 2 with "runtime exception"
5506 (license license:gpl2)))
5508 (define-public dune-uggrid
5510 (name "dune-uggrid")
5516 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5517 (commit (string-append "v" version))))
5518 (file-name (git-file-name name version))
5521 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5522 (build-system cmake-build-system)
5525 (modify-phases %standard-phases
5526 (add-after 'build 'build-tests
5527 (lambda* (#:key make-flags #:allow-other-keys)
5528 (apply invoke "make" "build_tests" make-flags))))))
5530 `(("dune-common" ,dune-common)))
5532 `(("gfortran" ,gfortran)
5533 ("pkg-config" ,pkg-config)))
5534 (home-page "https://dune-project.org/")
5535 (synopsis "Distributed and Unified Numerics Environment")
5536 (description "DUNE, the Distributed and Unified Numerics Environment is a
5537 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5538 grid-based methods. It supports the easy implementation of methods like
5539 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5542 This package contains the DUNE UG grid classes.")
5543 (license license:lgpl2.1)))
5545 (define-public dune-grid
5552 (uri (string-append "https://dune-project.org/download/"
5553 version "/dune-grid-" version ".tar.gz"))
5556 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5557 (build-system cmake-build-system)
5560 (modify-phases %standard-phases
5561 (add-after 'build 'build-tests
5562 (lambda* (#:key make-flags #:allow-other-keys)
5563 (apply invoke "make" "build_tests" make-flags))))))
5565 `(("dune-common" ,dune-common)
5566 ("dune-geometry" ,dune-geometry)
5569 ("openblas" ,openblas)
5570 ("python" ,python)))
5572 `(("dune-uggrid" ,dune-uggrid)))
5574 `(("gfortran" ,gfortran)
5575 ("pkg-config" ,pkg-config)))
5576 (home-page "https://dune-project.org/")
5577 (synopsis "Distributed and Unified Numerics Environment")
5578 (description "DUNE, the Distributed and Unified Numerics Environment is a
5579 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5580 grid-based methods. It supports the easy implementation of methods like
5581 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5584 This package contains the basic DUNE grid classes.")
5585 ;; GPL version 2 with "runtime exception"
5586 (license license:gpl2)))
5588 (define-public dune-istl
5595 (uri (string-append "https://dune-project.org/download/"
5596 version "/dune-istl-" version ".tar.gz"))
5599 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5600 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5601 (build-system cmake-build-system)
5604 (modify-phases %standard-phases
5605 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5606 ;; the stdlib types when the gfortran header is used. Remove gfortran
5607 ;; from CPLUS_INCLUDE_PATH as a workaround.
5608 (add-after 'set-paths 'hide-gfortran
5609 (lambda* (#:key inputs #:allow-other-keys)
5610 (let ((gfortran (assoc-ref inputs "gfortran")))
5611 (setenv "CPLUS_INCLUDE_PATH"
5613 (delete (string-append gfortran "/include/c++")
5614 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5617 (add-after 'build 'build-tests
5618 (lambda* (#:key make-flags #:allow-other-keys)
5619 (apply invoke "make" "build_tests" make-flags))))))
5621 `(("dune-common" ,dune-common)
5624 ("suitesparse" ,suitesparse)
5625 ("superlu" ,superlu)
5626 ("openblas" ,openblas)
5628 ("python" ,python)))
5630 `(("gfortran" ,gfortran)
5631 ("pkg-config" ,pkg-config)))
5632 (home-page "https://dune-project.org/")
5633 (synopsis "Distributed and Unified Numerics Environment")
5634 (description "DUNE, the Distributed and Unified Numerics Environment is a
5635 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5638 This is the iterative solver template library which provides generic sparse
5639 matrix/vector classes and a variety of solvers based on these classes. A
5640 special feature is the use of templates to exploit the recursive block
5641 structure of finite element matrices at compile time. Available solvers
5642 include Krylov methods, (block-) incomplete decompositions and
5643 aggregation-based algebraic multigrid.")
5644 ;; GPL version 2 with "runtime exception"
5645 (license license:gpl2)))
5647 (define-public dune-localfunctions
5649 (name "dune-localfunctions")
5654 (uri (string-append "https://dune-project.org/download/"
5655 version "/dune-localfunctions-" version ".tar.gz"))
5658 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5659 (build-system cmake-build-system)
5662 (modify-phases %standard-phases
5663 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5664 ;; and fails to find the stdlib types when the gfortran header is used.
5665 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5666 (add-after 'set-paths 'hide-gfortran
5667 (lambda* (#:key inputs #:allow-other-keys)
5668 (let ((gfortran (assoc-ref inputs "gfortran")))
5669 (setenv "CPLUS_INCLUDE_PATH"
5671 (delete (string-append gfortran "/include/c++")
5672 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5675 (add-after 'build 'build-tests
5676 (lambda* (#:key make-flags #:allow-other-keys)
5677 (apply invoke "make" "build_tests" make-flags))))))
5679 `(("dune-common" ,dune-common)
5680 ("dune-geometry" ,dune-geometry)
5683 ("superlu" ,superlu)
5686 `(("gfortran" ,gfortran)
5687 ("pkg-config" ,pkg-config)))
5688 (home-page "https://dune-project.org/")
5689 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5690 (description "This DUNE module provides interface and implementation for
5691 shape functions defined on the DUNE reference elements. In addition to the
5692 shape function, interpolation operators and special keys are provided which
5693 can be used to assemble global function spaces on finite-element grids.
5695 This package provides an interface and implementation for shape functions
5696 defined on the DUNE reference elements. In addition to the shape function,
5697 interpolation operators and special keys are provided which can be used to
5698 assemble global function spaces on finite-element grids.")
5699 ;; GPL version 2 with "runtime exception"
5700 (license license:gpl2)))
5702 (define-public dune-alugrid
5704 (name "dune-alugrid")
5705 (version "2.7.0-git-81d35682")
5710 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5711 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5712 (file-name (git-file-name name version))
5715 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5716 (build-system cmake-build-system)
5719 (modify-phases %standard-phases
5720 (add-after 'unpack 'patch-include
5722 (substitute* "dune/alugrid/test/test-alugrid.cc"
5723 (("doc/grids/gridfactory/testgrids")
5724 "doc/dune-grid/grids/gridfactory/testgrids"))
5726 (add-after 'build 'build-tests
5727 (lambda* (#:key inputs make-flags #:allow-other-keys)
5728 (setenv "CPLUS_INCLUDE_PATH"
5729 (string-append (assoc-ref inputs "dune-grid") "/share"))
5730 (apply invoke "make" "build_tests" make-flags))))))
5732 `(("dune-common" ,dune-common)
5733 ("dune-geometry" ,dune-geometry)
5734 ("dune-grid" ,dune-grid)
5737 ("openblas" ,openblas)
5739 ("superlu" ,superlu)
5743 `(("gfortran" ,gfortran)
5744 ("pkg-config" ,pkg-config)))
5745 (home-page "https://dune-project.org/")
5746 (synopsis "Distributed and Unified Numerics Environment")
5747 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5748 implementation of the DUNE grid interface supporting either simplices or
5750 (license license:gpl2+)))
5752 (define-public dune-subgrid
5754 (name "dune-subgrid")
5755 (version "2.7.0-git-2103a363")
5760 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5761 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5762 (file-name (git-file-name name version))
5765 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5766 (build-system cmake-build-system)
5769 (modify-phases %standard-phases
5770 (add-after 'build 'build-tests
5771 (lambda* (#:key make-flags #:allow-other-keys)
5772 (apply invoke "make" "build_tests" make-flags))))))
5774 `(("dune-common" ,dune-common)
5775 ("dune-geometry" ,dune-geometry)
5776 ("dune-grid" ,dune-grid)
5779 ("openblas" ,openblas)
5782 `(("gfortran" ,gfortran)
5783 ("pkg-config" ,pkg-config)))
5784 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5785 (synopsis "Distributed and Unified Numerics Environment")
5786 (description "The dune-subgrid module marks elements of
5787 another hierarchical dune grid. The set of marked elements can then be
5788 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5789 provides the full grid interface including adaptive mesh refinement.")
5790 (license license:gpl2+)))
5792 (define-public dune-typetree
5794 (name "dune-typetree")
5800 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5801 (commit (string-append "v" version))))
5802 (file-name (git-file-name name version))
5805 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5806 (build-system cmake-build-system)
5809 (modify-phases %standard-phases
5810 (add-after 'build 'build-tests
5811 (lambda* (#:key make-flags #:allow-other-keys)
5812 (apply invoke "make" "build_tests" make-flags))))))
5814 `(("dune-common" ,dune-common)
5816 ("openblas" ,openblas)
5819 ("superlu" ,superlu)
5822 `(("gfortran" ,gfortran)
5823 ("pkg-config" ,pkg-config)))
5824 (home-page "https://dune-project.org/")
5825 (synopsis "Distributed and Unified Numerics Environment")
5826 (description "TypeTree is a template library for constructing and
5827 operating on statically typed trees of objects.")
5828 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5829 (license (list license:lgpl3+ license:gpl2))))
5831 (define-public dune-functions
5833 (name "dune-functions")
5839 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5840 (commit (string-append "v" version))))
5841 (file-name (git-file-name name version))
5844 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5845 (build-system cmake-build-system)
5848 (modify-phases %standard-phases
5849 (add-after 'unpack 'disable-failing-tests
5852 ;; unable to load GMSH file in this test
5853 "--exclude-regex gridviewfunctionspacebasistest")
5855 (add-after 'build 'build-tests
5856 (lambda* (#:key make-flags #:allow-other-keys)
5857 (apply invoke "make" "build_tests" make-flags))))))
5859 `(("dune-common" ,dune-common)
5860 ("dune-istl" ,dune-istl)
5861 ("dune-localfunctions" ,dune-localfunctions)
5862 ("dune-grid" ,dune-grid)
5863 ("dune-geometry" ,dune-geometry)
5864 ("dune-typetree" ,dune-typetree)
5865 ("openblas" ,openblas)
5868 ("superlu" ,superlu)
5871 `(("gfortran" ,gfortran)
5872 ("pkg-config" ,pkg-config)))
5873 (home-page "https://dune-project.org/")
5874 (synopsis "Distributed and Unified Numerics Environment")
5875 (description "The dune-functions module provides an abstraction layer for
5876 global finite element functions. Its two main concepts are functions
5877 implemented as callable objects, and bases of finite element spaces.")
5878 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5879 (license (list license:lgpl3+ license:gpl2))))
5881 (define-public dune-pdelab
5883 (name "dune-pdelab")
5884 (version "2.7.0-git-476fe437")
5889 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5890 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5891 (file-name (git-file-name name version))
5894 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5895 (build-system cmake-build-system)
5896 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5898 `(("dune-common" ,dune-common)
5899 ("dune-istl" ,dune-istl)
5900 ("dune-localfunctions" ,dune-localfunctions)
5901 ("dune-geometry" ,dune-geometry)
5902 ("dune-grid" ,dune-grid)
5903 ("dune-typetree" ,dune-typetree)
5904 ("dune-functions" ,dune-functions)
5906 ("openblas" ,openblas)
5910 ("superlu" ,superlu)
5913 `(("gfortran" ,gfortran)
5914 ("pkg-config" ,pkg-config)))
5915 (home-page "https://dune-project.org/")
5916 (synopsis "Differential equations solver toolbox")
5917 (description "PDELab is a partial differential equations solver toolbox
5918 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5919 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5920 (license (list license:lgpl3+ license:gpl2))))
5922 (define add-openmpi-to-dune-package
5923 (let ((dune-package?
5924 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5927 (if (dune-package? p)
5928 (package (inherit p)
5929 (name (string-append (package-name p) "-openmpi"))
5930 (inputs `(,@(package-inputs p)
5931 ("openmpi" ,openmpi)))
5933 (substitute-keyword-arguments (package-arguments p)
5934 ((#:phases phases '%standard-phases)
5935 `(modify-phases ,phases
5936 (add-before 'check 'mpi-setup
5937 ,%openmpi-setup)))))
5938 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5940 (negate dune-package?))))
5942 (define-public dune-common-openmpi
5943 (add-openmpi-to-dune-package dune-common))
5945 (define-public dune-geometry-openmpi
5946 (add-openmpi-to-dune-package dune-geometry))
5948 (define-public dune-istl-openmpi
5949 (add-openmpi-to-dune-package dune-istl))
5951 (define-public dune-typetree-openmpi
5952 (add-openmpi-to-dune-package dune-typetree))
5954 (define-public dune-uggrid-openmpi
5955 (add-openmpi-to-dune-package dune-uggrid))
5957 (define-public dune-grid-openmpi
5958 (add-openmpi-to-dune-package dune-grid))
5960 (define-public dune-alugrid-openmpi
5961 (add-openmpi-to-dune-package dune-alugrid))
5963 (define-public dune-subgrid-openmpi
5964 (add-openmpi-to-dune-package dune-subgrid))
5966 (define-public dune-localfunctions-openmpi
5967 (add-openmpi-to-dune-package dune-localfunctions))
5969 (define-public dune-functions-openmpi
5970 (add-openmpi-to-dune-package dune-functions))
5972 (define-public dune-pdelab-openmpi
5973 (add-openmpi-to-dune-package dune-pdelab))
5975 (define-public mlucas
5983 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5985 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5986 (build-system gnu-build-system)
5988 `(("python2" ,python-2)))
5990 `(#:tests? #f ; no tests
5992 (modify-phases %standard-phases
5996 (call-with-output-file "Makefile"
5998 (format port "CC = gcc
5999 CFLAGS = -O3 ~a -DUSE_THREADS
6000 LDLIBS = -lm -lpthread -lrt
6001 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6003 ,(let ((system (or (%current-target-system)
6004 (%current-system))))
6006 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6010 (lambda* (#:key outputs #:allow-other-keys)
6011 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6012 (install-file "Mlucas" bin)
6013 (install-file "primenet.py" bin))
6015 (home-page "https://www.mersenne.org")
6016 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6017 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6018 numbers in search of a world-record prime. You may use it to test any
6019 suitable number as you wish, but it is preferable that you do so in a
6020 coordinated fashion, as part of the Great Internet Mersenne Prime
6021 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6022 management via the GIMPS project's Primenet server.")
6023 (license license:gpl2+)))
6025 (define-public nauty
6033 "https://pallini.di.uniroma1.it/"
6034 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6036 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
6037 (build-system gnu-build-system)
6038 (outputs '("out" "lib"))
6040 `(#:test-target "checks"
6041 #:configure-flags '("--enable-generic") ;prevent -march-native
6043 (modify-phases %standard-phases
6044 ;; Default make target does not build all available
6045 ;; executables. Create them now.
6046 (add-after 'build 'build-extra-programs
6048 (for-each (lambda (target) (invoke "make" target))
6049 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6051 ;; Upstream does not provide any install target.
6053 (lambda* (#:key outputs #:allow-other-keys)
6054 (let* ((out (assoc-ref outputs "out"))
6055 (lib-output (assoc-ref outputs "lib"))
6056 (bin (string-append out "/bin"))
6057 (doc (string-append out "/share/doc/nauty/"))
6058 (include (string-append lib-output "/include/nauty"))
6059 (lib (string-append lib-output "/lib/nauty")))
6060 (for-each (lambda (f) (install-file f bin))
6061 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6062 "bliss2dre" "catg" "checks6" "complg" "converseg"
6063 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6064 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6065 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6066 "gentourng" "gentreeg" "hamheuristic" "labelg"
6067 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6068 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6069 "sumlines" "twohamg" "underlyingg" "vcolg"
6070 "watercluster2" "NRswitchg"))
6071 (for-each (lambda (f) (install-file f include))
6072 (find-files "." "\\.h$"))
6073 (for-each (lambda (f) (install-file f lib))
6074 (find-files "." "\\.a$"))
6075 (for-each (lambda (f) (install-file f doc))
6076 (append '("formats.txt" "README" "schreier.txt")
6077 (find-files "." "\\.pdf$")))))))))
6079 `(("gmp" ,gmp))) ;for sumlines
6080 (home-page "https://pallini.di.uniroma1.it/")
6081 (synopsis "Library for graph automorphisms")
6082 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6083 procedures for computing automorphism groups of graphs and digraphs.
6085 @code{nauty} computes graph information in the form of a set of
6086 generators, the size of the group, and the orbits of the group; it can
6087 also produce a canonical label. The @code{nauty} suite is written in
6088 C and comes with a command-line interface, a collection of
6089 command-line tools, and an Application Programming Interface (API).
6091 This package provides the static libraries required to run programs
6092 compiled against the nauty library.")
6093 (license license:asl2.0)))
6102 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6103 "ftp/releases/" version
6104 "/ppl-" version ".tar.gz"))
6107 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6108 (build-system gnu-build-system)
6114 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6116 "Parma Polyhedra Library for computations with polyhedra")
6118 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6119 especially targeted at applications in the field of analysis and
6120 verification of complex systems. These abstractions include convex
6121 polyhedra, defined as the intersection of a finite number of (open or
6122 closed) halfspaces, each described by a linear inequality (strict or
6123 non-strict) with rational coefficients; some special classes of polyhedra
6124 shapes that offer interesting complexity/precision tradeoffs; and grids
6125 which represent regularly spaced points that satisfy a set of linear
6126 congruence relations. The library also supports finite powersets and
6127 products of (any kind of) polyhedra and grids, a mixed integer linear
6128 programming problem solver using an exact-arithmetic version of the simplex
6129 algorithm, a parametric integer programming solver, and primitives for
6130 termination analysis via the automatic synthesis of linear ranking
6132 (license license:gpl3+)))
6134 (define-public speedcrunch
6136 (name "speedcrunch")
6142 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6143 (commit (string-append "release-" version))))
6144 (file-name (git-file-name name version))
6147 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6148 (build-system cmake-build-system)
6149 (inputs `(("qtbase" ,qtbase-5)))
6150 (native-inputs `(("qttools" ,qttools)))
6153 (modify-phases %standard-phases
6154 (add-after 'unpack 'chdir-to-src
6155 (lambda _ (chdir "src") #t)))))
6156 (synopsis "High-precision scientific calculator")
6158 "SpeedCrunch is a high-precision scientific calculator. It features a
6159 syntax-highlighted scrollable display and is designed to be fully used via
6160 keyboard. Some distinctive features are auto-completion of functions and
6161 variables, a formula book, and quick insertion of constants from various
6162 fields of knowledge.")
6163 (home-page "https://speedcrunch.org/")
6164 (license license:gpl2+)))
6166 (define-public minisat
6167 ;; This is the last commit which is available upstream, no
6168 ;; release happened since 2010.
6169 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6173 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6178 (url "https://github.com/niklasso/minisat")
6180 (file-name (string-append name "-" version "-checkout"))
6183 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6185 (search-patches "minisat-friend-declaration.patch"
6186 "minisat-install.patch"))))
6187 (build-system gnu-build-system)
6189 '(#:make-flags (list (string-append "prefix=" %output))
6190 #:tests? #f ;no check target
6192 (modify-phases %standard-phases
6193 (delete 'configure))))
6195 `(("zlib:static" ,zlib "static")
6198 "Small, yet efficient, SAT solver")
6200 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6201 researchers and developers alike to get started on SAT.")
6203 "http://minisat.se/MiniSat.html")
6204 (license license:expat))))
6206 (define-public libqalculate
6208 (name "libqalculate")
6214 (url "https://github.com/Qalculate/libqalculate/")
6215 (commit (string-append "v" version))))
6216 (file-name (git-file-name name version))
6218 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
6220 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6221 (build-system gnu-build-system)
6223 `(("pkg-config" ,pkg-config)
6224 ("gettext" ,gettext-minimal)
6225 ("intltool" ,intltool)
6226 ("automake" ,automake)
6227 ("autoconf" ,autoconf)
6228 ("libtool" ,libtool)
6229 ("doxygen" ,doxygen)
6234 ("libxml2" ,libxml2)
6237 ("gnuplot" ,gnuplot)
6238 ("readline" ,readline)
6239 ("libiconv" ,libiconv)))
6242 (modify-phases %standard-phases
6243 (add-before 'bootstrap 'setenv
6244 ;; Prevent the autogen.sh script to carry out the configure
6245 ;; script, which has not yet been patched to replace /bin/sh.
6247 (setenv "NOCONFIGURE" "TRUE")
6249 (home-page "https://qalculate.github.io/")
6250 (synopsis "Multi-purpose cli desktop calculator and library")
6252 "Libqalculate is a multi-purpose cli desktop calculator and library.
6253 It provides basic and advanced functionality. Features include customizable
6254 functions, unit calculations, and conversions, physical constants, symbolic
6255 calculations (including integrals and equations), arbitrary precision,
6256 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6258 (license license:gpl2+)))
6260 (define-public qalculate-gtk
6262 (name "qalculate-gtk")
6268 (url "https://github.com/Qalculate/qalculate-gtk/")
6269 (commit (string-append "v" version))))
6270 (file-name (git-file-name name version))
6272 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
6273 (build-system glib-or-gtk-build-system)
6275 `(("pkg-config" ,pkg-config)
6276 ("intltool" ,intltool)
6277 ("automake" ,automake)
6278 ("autoconf" ,autoconf)
6279 ("libtool" ,libtool)
6284 ("libqalculate" ,libqalculate)
6285 ("libxml2" ,libxml2)
6290 (modify-phases %standard-phases
6291 (add-before 'bootstrap 'setenv
6292 ;; Prevent the autogen.sh script to carry out the configure
6293 ;; script, which has not yet been patched to replace /bin/sh.
6295 (setenv "NOCONFIGURE" "TRUE")
6297 (home-page "https://qalculate.github.io/")
6298 (synopsis "Multi-purpose graphical desktop calculator")
6300 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6301 multi-purpose GUI desktop calculator. It provides basic and advanced
6302 functionality. Features include customizable functions, unit calculations,
6303 and conversions, physical constants, symbolic calculations (including
6304 integrals and equations), arbitrary precision, uncertainty propagation,
6305 interval arithmetic, plotting.")
6306 (license license:gpl2+)))
6308 (define-public numdiff
6315 (uri (string-append "mirror://savannah/numdiff/numdiff-"
6319 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
6320 (build-system gnu-build-system)
6322 '(#:tests? #f ; There are no tests.
6324 (modify-phases %standard-phases
6325 (add-before 'compress-documentation 'delete-precompressed-info-file
6327 (delete-file (string-append (assoc-ref %outputs "out")
6328 "/share/info/numdiff.info.gz"))
6330 (home-page "https://nongnu.org/numdiff/")
6331 (synopsis "Compare files with numeric fields")
6333 "Numdiff compares files line by line and field by field, ignoring small
6334 numeric differences and differences in numeric formats.")
6335 (license license:gpl3+)))
6343 (uri (string-append "https://gforge.inria.fr/frs/download.php/file"
6344 "/38367/why3-" version ".tar.gz"))
6347 "1n0a2nn1gnk0zg339lh698g4wpk7m8m1vyi2yvifd5adqvk4milw"))))
6348 (build-system ocaml-build-system)
6354 `(("camlzip" ,camlzip)
6355 ("ocaml-graph" ,ocaml-graph)
6356 ("ocaml-menhir" ,ocaml-menhir)
6357 ("ocaml-num" ,ocaml-num)
6358 ("ocaml-zarith" ,ocaml-zarith)))
6360 `(("coq-flocq" ,coq-flocq)
6361 ("emacs-minimal" ,emacs-minimal)
6365 (modify-phases %standard-phases
6366 (add-before 'configure 'fix-configure
6368 (setenv "CONFIG_SHELL" (which "sh"))
6369 (substitute* "configure"
6370 ;; find ocaml-num in the correct directory
6371 (("\\$DIR/nums.cma") "$DIR/num.cma")
6372 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
6374 (add-after 'configure 'fix-makefile
6376 (substitute* "Makefile"
6377 ;; find ocaml-num in the correct directory
6378 (("site-lib/num") "site-lib"))
6380 (add-after 'install 'install-lib
6382 (invoke "make" "byte")
6383 (invoke "make" "install-lib")
6385 (home-page "http://why3.lri.fr")
6386 (synopsis "Deductive program verification")
6387 (description "Why3 provides a language for specification and programming,
6388 called WhyML, and relies on external theorem provers, both automated and
6389 interactive, to discharge verification conditions. Why3 comes with a standard
6390 library of logical theories (integer and real arithmetic, Boolean operations,
6391 sets and maps, etc.) and basic programming data structures (arrays, queues,
6392 hash tables, etc.). A user can write WhyML programs directly and get
6393 correct-by-construction OCaml programs through an automated extraction
6394 mechanism. WhyML is also used as an intermediate language for the verification
6395 of C, Java, or Ada programs.")
6396 (license license:lgpl2.1)))
6398 (define-public frama-c
6404 (uri (string-append "http://frama-c.com/download/frama-c-"
6405 version "-Titanium.tar.gz"))
6408 "1mq1fijka95ydrla486yr4w6wdl9l7vmp512s1q00b0p6lmfwmkh"))))
6409 (build-system ocaml-build-system)
6411 `(#:tests? #f; no test target in Makefile
6413 (modify-phases %standard-phases
6414 (add-before 'configure 'export-shell
6415 (lambda* (#:key inputs #:allow-other-keys)
6416 (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
6422 `(("ocaml-biniou" ,ocaml-biniou)
6423 ("ocaml-easy-format" ,ocaml-easy-format)
6424 ("ocaml-graph" ,ocaml-graph)
6425 ("ocaml-yojson" ,ocaml-yojson)
6426 ("ocaml-zarith" ,ocaml-zarith)
6428 (native-search-paths
6429 (list (search-path-specification
6430 (variable "FRAMAC_SHARE")
6431 (files '("share/frama-c"))
6433 (search-path-specification
6434 (variable "FRAMAC_LIB")
6435 (files '("lib/frama-c"))
6437 (home-page "http://frama-c.com")
6438 (synopsis "C source code analysis platform")
6439 (description "Frama-C is an extensible and collaborative platform dedicated
6440 to source-code analysis of C software. The Frama-C analyzers assist you in
6441 various source-code-related activities, from the navigation through unfamiliar
6442 projects up to the certification of critical software.")
6443 (license license:lgpl2.1+)))
6445 (define-public blitz
6453 (url "https://github.com/blitzpp/blitz")
6455 (file-name (git-file-name name version))
6457 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
6458 (build-system cmake-build-system)
6460 `(#:configure-flags '("-DBUILD_DOC=ON"
6461 "-DBUILD_TESTING=ON")
6462 ;; The default "check" target also includes examples and benchmarks.
6463 #:test-target "check-testsuite"
6465 (modify-phases %standard-phases
6466 (add-after 'build 'build-doc
6468 (invoke "make" "-j" (number->string (parallel-job-count))
6471 `(("python" ,python)
6472 ("texinfo" ,texinfo)))
6473 (synopsis "C++ template class library for multidimensional arrays")
6474 (description "Blitz++ is a C++ template class library that provides
6475 high-performance multidimensional array containers for scientific computing.")
6476 (home-page "https://github.com/blitzpp/blitz")
6477 (license (list license:artistic2.0