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 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 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018, 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>
50 ;;; This file is part of GNU Guix.
52 ;;; GNU Guix is free software; you can redistribute it and/or modify it
53 ;;; under the terms of the GNU General Public License as published by
54 ;;; the Free Software Foundation; either version 3 of the License, or (at
55 ;;; your option) any later version.
57 ;;; GNU Guix is distributed in the hope that it will be useful, but
58 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
59 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60 ;;; GNU General Public License for more details.
62 ;;; You should have received a copy of the GNU General Public License
63 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65 (define-module (gnu packages maths)
66 #:use-module (ice-9 regex)
67 #:use-module (ice-9 match)
68 #:use-module (gnu packages)
69 #:use-module ((guix licenses) #:prefix license:)
70 #:use-module (guix packages)
71 #:use-module (guix download)
72 #:use-module (guix git-download)
73 #:use-module (guix utils)
74 #:use-module ((guix build utils) #:select (alist-replace))
75 #:use-module (guix build-system cmake)
76 #:use-module (guix build-system glib-or-gtk)
77 #:use-module (guix build-system gnu)
78 #:use-module (guix build-system ocaml)
79 #:use-module (guix build-system python)
80 #:use-module (guix build-system ruby)
81 #:use-module (gnu packages algebra)
82 #:use-module (gnu packages audio)
83 #:use-module (gnu packages autotools)
84 #:use-module (gnu packages base)
85 #:use-module (gnu packages bison)
86 #:use-module (gnu packages boost)
87 #:use-module (gnu packages check)
88 #:use-module (gnu packages cmake)
89 #:use-module (gnu packages compression)
90 #:use-module (gnu packages coq)
91 #:use-module (gnu packages curl)
92 #:use-module (gnu packages cyrus-sasl)
93 #:use-module (gnu packages dbm)
94 #:use-module (gnu packages documentation)
95 #:use-module (gnu packages elf)
96 #:use-module (gnu packages emacs)
97 #:use-module (gnu packages file)
98 #:use-module (gnu packages flex)
99 #:use-module (gnu packages fltk)
100 #:use-module (gnu packages fontutils)
101 #:use-module (gnu packages gettext)
102 #:use-module (gnu packages gcc)
103 #:use-module (gnu packages gd)
104 #:use-module (gnu packages ghostscript)
105 #:use-module (gnu packages glib)
106 #:use-module (gnu packages graphviz)
107 #:use-module (gnu packages gtk)
108 #:use-module (gnu packages icu4c)
109 #:use-module (gnu packages image)
110 #:use-module (gnu packages java)
111 #:use-module (gnu packages less)
112 #:use-module (gnu packages lisp)
113 #:use-module (gnu packages linux)
114 #:use-module (gnu packages llvm)
115 #:use-module (gnu packages logging)
116 #:use-module (gnu packages lua)
117 #:use-module (gnu packages gnome)
118 #:use-module (gnu packages guile)
119 #:use-module (gnu packages xorg)
120 #:use-module (gnu packages gl)
121 #:use-module (gnu packages imagemagick)
122 #:use-module (gnu packages m4)
123 #:use-module (gnu packages mpi)
124 #:use-module (gnu packages multiprecision)
125 #:use-module (gnu packages netpbm)
126 #:use-module (gnu packages ocaml)
127 #:use-module (gnu packages onc-rpc)
128 #:use-module (gnu packages pcre)
129 #:use-module (gnu packages popt)
130 #:use-module (gnu packages perl)
131 #:use-module (gnu packages pkg-config)
132 #:use-module (gnu packages pulseaudio)
133 #:use-module (gnu packages python)
134 #:use-module (gnu packages python-web)
135 #:use-module (gnu packages python-xyz)
136 #:use-module (gnu packages qt)
137 #:use-module (gnu packages readline)
138 #:use-module (gnu packages ruby)
139 #:use-module (gnu packages tbb)
140 #:use-module (gnu packages scheme)
141 #:use-module (gnu packages shells)
142 #:use-module (gnu packages tcl)
143 #:use-module (gnu packages texinfo)
144 #:use-module (gnu packages tex)
145 #:use-module (gnu packages tls)
146 #:use-module (gnu packages version-control)
147 #:use-module (gnu packages wxwidgets)
148 #:use-module (gnu packages xml)
149 #:use-module (srfi srfi-1)
150 #:use-module (srfi srfi-26))
158 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
160 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
161 (build-system gnu-build-system)
162 (inputs `(("gtk+" ,gtk+)
163 ("libxml2" ,libxml2)))
164 (native-inputs `(("pkg-config" ,pkg-config)))
165 (synopsis "Natural deduction first-order logic interface")
166 (description "Aris is a program for performing logical proofs. It supports
167 propositional and predicate logic, as well as Boolean algebra and
168 arithmetical logic. In addition to its predefined inference and equivalence
169 rules, Aris also supports references to older proofs. Its use of standard
170 logical symbols and its natural deduction interface make it easy to use for
172 (license license:gpl3+)
173 (home-page "https://www.gnu.org/software/aris/")))
175 (define-public c-graph
181 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
184 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
185 (build-system gnu-build-system)
187 `(("fortran" ,gfortran)))
188 (synopsis "Visualizing and demonstrating convolution")
190 "GNU C-Graph is a tool for demonstrating the theory of convolution.
191 Thus, it can serve as an excellent aid to students of signal and systems
192 theory in visualizing the convolution process. Rather than forcing the
193 student to write code, the program offers an intuitive interface with
194 interactive dialogs to guide them.")
195 (license license:gpl3+)
196 (home-page "https://www.gnu.org/software/c-graph/")))
205 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
206 version "/coda-" version ".tar.gz"))
208 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
209 (patches (search-patches "coda-use-system-libs.patch"))
210 (modules '((guix build utils)))
212 ;; Make sure we don't use the bundled software.
214 (for-each (lambda (d)
215 (delete-file-recursively (string-append "libcoda/" d)))
216 '("zlib" "pcre" "expat"))
219 `(("fortran" ,gfortran)
221 ("python-numpy" ,python-numpy)))
228 (build-system gnu-build-system)
230 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
231 "LIBS= -lz -lpcre -lexpat")))
232 (synopsis "A common interface to various earth observation data formats")
234 "The Common Data Access toolbox (CODA) provides a set of interfaces for
235 reading remote sensing data from earth observation data files. It consists of
236 command line applications and interfaces to the C, Fortran, Python, and Java
237 programming languages.")
238 (home-page "https://stcorp.nl/coda")
239 (license license:gpl2+)))
247 (uri (string-append "http://www.qhull.org/download/qhull-"
248 (car (string-split version #\.))
252 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
253 (build-system cmake-build-system)
255 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
256 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
257 (synopsis "Calculate convex hulls and related structures")
259 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
260 diagram, halfspace intersection about a point, furthest-site Delaunay
261 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
262 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
263 algorithm for computing the convex hull. It handles roundoff errors from
264 floating point arithmetic. It computes volumes, surface areas, and
265 approximations to the convex hull.
267 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
268 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
269 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
271 (home-page "http://qhull.org")
272 (license (license:non-copyleft "file://COPYING.txt"
273 "See COPYING in the distribution."))))
275 (define-public python-cvxopt
277 (name "python-cvxopt")
282 (url "https://github.com/cvxopt/cvxopt")
284 (file-name (git-file-name name version))
287 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
288 (build-system python-build-system)
291 (modify-phases %standard-phases
292 (add-after 'unpack 'find-libraries
293 (lambda* (#:key inputs #:allow-other-keys)
294 (setenv "CVXOPT_BLAS_LIB" "openblas")
295 (setenv "CVXOPT_BUILD_FFTW" "1")
296 (setenv "CVXOPT_BUILD_GLPK" "1")
297 (setenv "CVXOPT_BUILD_GSL" "1")
304 ("openblas" ,openblas)
305 ("suitesparse" ,suitesparse)))
306 (home-page "https://www.cvxopt.org")
307 (synopsis "Python library for convex optimization")
309 "CVXOPT is a package for convex optimization based on the Python
310 programming language. Its main purpose is to make the development of software
311 for convex optimization applications straightforward by building on Python’s
312 extensive standard library and on the strengths of Python as a high-level
313 programming language.")
314 (license license:gpl3+)))
316 (define-public python2-cvxopt
317 (package-with-python2 python-cvxopt))
325 (uri (string-append "mirror://gnu/units/units-" version
328 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
329 (build-system gnu-build-system)
331 `(("readline" ,readline)
332 ("python" ,python-wrapper) ;for 'units_cur' script
333 ("python-requests" ,python-requests)))
335 `(#:phases (modify-phases %standard-phases
336 (add-after 'install 'wrap-units_cur
337 (lambda* (#:key outputs #:allow-other-keys)
338 (let* ((out (assoc-ref outputs "out"))
339 (bin (string-append out "/bin")))
340 (wrap-program (string-append bin "/units_cur")
341 `("PYTHONPATH" ":" prefix
342 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
344 (synopsis "Conversion between thousands of scales")
346 "GNU Units converts numeric quantities between units of measure. It
347 can handle scale changes through adaptive usage of standard scale
348 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
349 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
350 enough to be used effectively as a scientific calculator.")
351 (license license:gpl3+)
352 (home-page "https://www.gnu.org/software/units/")))
354 (define-public double-conversion
356 (name "double-conversion")
358 (home-page "https://github.com/google/double-conversion")
361 (uri (git-reference (url home-page)
362 (commit (string-append "v" version))))
363 (file-name (git-file-name name version))
366 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
367 (build-system cmake-build-system)
369 '(#:test-target "test"
370 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
371 "-DBUILD_TESTING=ON")))
372 (synopsis "Conversion routines for IEEE doubles")
374 "The double-conversion library provides binary-decimal and decimal-binary
375 routines for IEEE doubles. The library consists of efficient conversion
376 routines that have been extracted from the V8 JavaScript engine.")
377 (license license:bsd-3)))
379 (define-public dionysus
385 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
389 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
390 (build-system gnu-build-system)
391 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
392 (synopsis "Local search for universal constants and scientific values")
394 "GNU Dionysus is a convenient system for quickly retrieving the values of
395 mathematical constants used in science and engineering. Values can be
396 searched using a simple command-line tool, choosing from three databases:
397 universal constants, atomic numbers, and constants related to
399 (license license:gpl3+)
400 (home-page "https://www.gnu.org/software/dionysus/")))
411 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
412 "dSFMT-src-" version ".tar.gz"))
415 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
416 (modules '((guix build utils)))
417 ;; Don't distribute html documentation with bundled jquery.
420 (delete-file-recursively "html") #t))
421 ;; Add patches borrowed from Julia.
427 "https://raw.githubusercontent.com/JuliaLang/julia/"
428 "v1.3.0/deps/patches/dSFMT.c.patch"))
430 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
431 (file-name "dSFMT.c.patch"))
435 "https://raw.githubusercontent.com/JuliaLang/julia/"
436 "v1.3.0/deps/patches/dSFMT.h.patch"))
438 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
439 (file-name "dSFMT.h.patch"))))))
440 (build-system gnu-build-system)
443 (modify-phases %standard-phases
444 (delete 'configure) ; no configure script
446 ;; Upstream Makefile does not build a shared library. Borrow from Julia
447 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
450 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
451 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
452 "-O3" "-finline-functions" "-fomit-frame-pointer"
453 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
454 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
455 "-o" "libdSFMT.so")))
456 (replace 'install ; no "install" target
457 (lambda* (#:key outputs #:allow-other-keys)
458 (let* ((out (assoc-ref outputs "out"))
459 (lib (string-append out "/lib"))
460 (inc (string-append out "/include"))
461 (doc (string-append out "/share/doc/" ,name "-" ,version)))
462 (install-file "libdSFMT.so" lib)
463 (install-file "dSFMT.h" inc)
464 (install-file "LICENSE.txt" doc)
466 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
468 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
469 the expensive conversion of integer to double (floating point). dSFMT directly
470 generates double precision floating point pseudorandom numbers which have the
471 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
472 format. dSFMT is only available on the CPUs which use IEEE 754 format double
473 precision floating point numbers.")
474 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
475 (license license:bsd-3)))
483 (uri (string-append "mirror://gnu/gsl/gsl-"
487 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
488 (build-system gnu-build-system)
490 (let ((system (%current-system)))
492 ((or (string-prefix? "aarch64" system)
493 (string-prefix? "powerpc" system))
494 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
495 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
496 '(#:phases (modify-phases %standard-phases
497 (add-before 'check 'disable-failing-tests
499 (substitute* "spmatrix/test.c"
500 ((".*test_complex.*") "\n"))
502 ((string-prefix? "i686" system)
503 ;; There are rounding issues with these tests on i686:
504 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
505 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
506 '(#:phases (modify-phases %standard-phases
507 (add-before 'check 'disable-failing-tests
509 (substitute* "linalg/test.c"
510 ((".*gsl_test\\(test_LU_decomp.*") "\n")
511 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
512 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
513 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
514 (substitute* "spmatrix/test.c"
515 ((".*test_all.*") "\n")
516 ((".*test_float.*") "\n")
517 ((".*test_complex.*") "\n"))
520 (home-page "https://www.gnu.org/software/gsl/")
521 (synopsis "Numerical library for C and C++")
523 "The GNU Scientific Library is a library for numerical analysis in C
524 and C++. It includes a wide range of mathematical routines, with over 1000
525 functions in total. Subject areas covered by the library include:
526 differential equations, linear algebra, Fast Fourier Transforms and random
528 (license license:gpl3+)))
538 (url "https://github.com/shibatch/sleef")
540 (file-name (git-file-name name version))
542 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
543 (build-system cmake-build-system)
545 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
546 (string-append "-DCMAKE_INSTALL_LIBDIR="
547 (assoc-ref %outputs "out")
549 (string-append "-DCMAKE_INSTALL_PREFIX="
550 (assoc-ref %outputs "out")))
552 (modify-phases %standard-phases
553 ;; SLEEF generates a header library during the build process and writes
554 ;; to it via shell redirection. Make the checkout writable so the
555 ;; build can succeed.
556 (add-after 'unpack 'make-git-checkout-writable
558 (for-each make-file-writable (find-files "."))
564 ("openssl" ,openssl)))
565 (home-page "https://sleef.org/")
566 (synopsis "SIMD library for evaluating elementary functions and DFT")
568 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
569 implements vectorized versions of all C99 real floating point math functions.
570 It can utilize SIMD instructions that are available on modern processors.")
571 (license (list license:boost1.0 ;sleef
572 license:cc-by4.0)))) ;simplex algorithm
581 (uri (string-append "mirror://gnu/glpk/glpk-"
585 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
586 (build-system gnu-build-system)
590 `(#:configure-flags '("--with-gmp"
591 "--disable-static")))
592 (home-page "https://www.gnu.org/software/glpk/")
593 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
595 "GLPK is a C library for solving large-scale linear programming (LP),
596 mixed integer programming (MIP), and other related problems. It supports the
597 GNU MathProg modeling language, a subset of the AMPL language, and features a
598 translator for the language. In addition to the C library, a stand-alone
599 LP/MIP solver is included in the package.")
600 (license license:gpl3+)))
602 (define-public glpk-4
610 (uri (string-append "mirror://gnu/glpk/glpk-"
614 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
623 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
625 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
627 "/4ti2-" version ".tar.gz"))
629 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
630 (build-system gnu-build-system)
632 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
636 (home-page "http://www.4ti2.de/")
637 (synopsis "Mathematical tool suite for problems on linear spaces")
639 "4ti2 implements algorithms for solving algebraic, geometric and
640 combinatorial problems on linear spaces. Among others, it solves systems
641 of linear equations, computes extreme rays of polyhedral cones, solves
642 integer programming problems and computes Markov bases for statistics.")
643 (license license:gpl2+)))
645 (define-public cddlib
652 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
653 (string-delete #\. version) ".tar.gz"))
656 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
657 (build-system gnu-build-system)
660 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
661 (synopsis "Library for convex hulls and extreme rays of polyhedra")
663 "The C-library cddlib implements the Double Description Method of
664 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
665 rays of a general convex polyhedron given by a system of linear inequalities
666 in arbitrary dimension. It can also be used for the converse operation of
667 computing convex hulls.")
668 (license license:gpl2+)))
670 (define-public lrslib
677 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
679 (string-delete #\. version) ".tar.gz"))
682 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
683 (build-system gnu-build-system)
687 `(#:tests? #f ; no check phase
688 #:make-flags `("CC=gcc"
689 ,(string-append "prefix=" (assoc-ref %outputs "out"))
692 (modify-phases %standard-phases
695 (substitute* "makefile"
696 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
698 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
699 (synopsis "Convex hulls of polyhedra with exact arithmetic")
701 "The C code of lrslib implements the reverse search algorithm for
702 vertex enumeration and convex hull problems. Its input file format is
703 compatible with cddlib. All computations are done exactly in either
704 multiple precision or fixed integer arithmetic. Output is not stored
705 in memory, so even problems with very large output sizes can sometimes
707 (license license:gpl2+)))
709 (define-public libcerf
717 (url "https://jugit.fz-juelich.de/mlz/libcerf")
718 (commit (string-append "v" version))))
719 (file-name (git-file-name name version))
721 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
722 (build-system cmake-build-system)
725 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
726 (synopsis "Library for complex error functions")
728 "@code{libcerf} is a self-contained numeric library that provides an
729 efficient and accurate implementation of complex error functions, along with
730 Dawson, Faddeeva, and Voigt functions.")
731 (license license:expat)))
740 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
741 "vinci/vinci-" version ".tar.gz"))
744 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
745 (build-system gnu-build-system)
747 `(("lrslib" ,lrslib)))
749 `(#:tests? #f ; no check phase
751 (modify-phases %standard-phases
753 ;; register the lrs location in the config file
754 (lambda* (#:key inputs #:allow-other-keys)
755 (let* ((lrs (assoc-ref inputs "lrslib"))
756 (lrsexec (string-append lrs "/bin/lrs")))
757 (substitute* "vinci.h"
758 (("#define LRS_EXEC \"lrs\"")
759 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
762 (lambda* (#:key outputs #:allow-other-keys)
763 (let* ((out (assoc-ref outputs "out"))
764 (bin (string-append out "/bin")))
765 (install-file "vinci" bin))
768 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
769 (synopsis "Volume computation for polytopes")
771 "Vinci implements a number of volume computation algorithms for convex
772 polytopes in arbitrary dimension. The polytopes can be given by their
773 V-representation (as the convex hull of a finite number of vertices), by
774 their H-representation (as the bounded intersection of a finite number of
775 halfspaces) or by their double description with both representations.")
776 (license license:gpl2+)))
778 (define-public arpack-ng
782 (home-page "https://github.com/opencollab/arpack-ng")
785 (uri (git-reference (url home-page) (commit version)))
786 (file-name (git-file-name name version))
789 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
790 (build-system gnu-build-system)
792 `(("autoconf" ,autoconf)
793 ("automake" ,automake)
795 ("pkg-config" ,pkg-config)))
799 ("fortran" ,gfortran)))
800 (synopsis "Fortran subroutines for solving eigenvalue problems")
802 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
803 large scale eigenvalue problems.")
804 (license (license:non-copyleft "file://COPYING"
805 "See COPYING in the distribution."))))
807 (define-public arpack-ng-3.3.0
814 (uri (git-reference (url (package-home-page arpack-ng))
816 (file-name (git-file-name (package-name arpack-ng) version))
819 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
821 (define-public arpack-ng-openmpi
822 (package (inherit arpack-ng)
823 (name "arpack-ng-openmpi")
826 ,@(package-inputs arpack-ng)))
828 (substitute-keyword-arguments (package-arguments arpack-ng)
829 ((#:configure-flags _ '())
831 ((#:phases phases '%standard-phases)
832 `(modify-phases ,phases
833 (add-before 'check 'mpi-setup
835 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
837 (define-public lapack
844 (uri (string-append "http://www.netlib.org/lapack/lapack-"
848 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
849 (build-system cmake-build-system)
850 (home-page "http://www.netlib.org/lapack/")
851 (inputs `(("fortran" ,gfortran)
852 ("python" ,python-wrapper)))
854 `(#:configure-flags (list
855 "-DBUILD_SHARED_LIBS:BOOL=YES"
857 ;; Build the 'LAPACKE_clatms' functions.
858 "-DLAPACKE_WITH_TMG=ON"
859 "-DBUILD_TESTING=ON")))
860 (synopsis "Library for numerical linear algebra")
862 "LAPACK is a Fortran 90 library for solving the most commonly occurring
863 problems in numerical linear algebra.")
864 (license (license:non-copyleft "file://LICENSE"
865 "See LICENSE in the distribution."))))
867 (define-public clapack
874 (uri (string-append "http://www.netlib.org/clapack/clapack-"
875 version "-CMAKE.tgz"))
878 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
879 (build-system cmake-build-system)
882 (modify-phases %standard-phases
883 ;; These tests use a lot of stack variables and segfault without
884 ;; lifting resource limits.
885 (add-after 'unpack 'disable-broken-tests
887 (substitute* "TESTING/CMakeLists.txt"
888 (("add_lapack_test.* xeigtstz\\)") ""))
891 (lambda* (#:key outputs #:allow-other-keys)
892 (let* ((out (assoc-ref outputs "out"))
893 (libdir (string-append out "/lib"))
894 (f2cinc (string-append out "/include/libf2c")))
897 (for-each (lambda (file)
898 (install-file file libdir))
900 "F2CLIBS/libf2c/libf2c.a"
901 "TESTING/MATGEN/libtmglib.a"
902 "BLAS/SRC/libblas.a"))
903 (for-each (lambda (file)
904 (install-file file f2cinc))
905 (cons "F2CLIBS/libf2c/arith.h"
906 (find-files (string-append "../clapack-"
907 ,version "-CMAKE/F2CLIBS/libf2c")
909 (copy-recursively (string-append "../clapack-"
910 ,version "-CMAKE/INCLUDE")
911 (string-append out "/include"))
913 (home-page "https://www.netlib.org/clapack/")
914 (synopsis "Numerical linear algebra library for C")
916 "The CLAPACK library was built using a Fortran to C conversion utility
917 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
918 C code, and then modified to improve readability. CLAPACK's goal is to
919 provide LAPACK for someone who does not have access to a Fortran compiler.")
920 (license (license:non-copyleft "file://LICENSE"
921 "See LICENSE in the distribution."))))
923 (define-public scalapack
930 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
934 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
935 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
936 (build-system cmake-build-system)
939 ("fortran" ,gfortran)
940 ("lapack" ,lapack))) ;for testing only
942 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
943 #:phases (modify-phases %standard-phases
944 (add-before 'check 'mpi-setup
946 (home-page "http://www.netlib.org/scalapack/")
947 (synopsis "Library for scalable numerical linear algebra")
949 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
950 routines on parallel distributed memory machines. ScaLAPACK solves dense and
951 banded linear systems, least squares problems, eigenvalue problems, and
952 singular value problems.")
953 (license (license:non-copyleft "file://LICENSE"
954 "See LICENSE in the distribution."))))
956 (define-public gnuplot
962 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
966 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
967 (build-system gnu-build-system)
968 (inputs `(("readline" ,readline)
974 `(("pkg-config" ,pkg-config)
975 ("texlive" ,texlive-tiny)))
976 (arguments `(#:configure-flags (list (string-append
977 "--with-texdir=" %output
978 "/texmf-local/tex/latex/gnuplot"))
979 ;; Plot on a dumb terminal during tests.
980 #:make-flags '("GNUTERM=dumb")))
981 (home-page "http://www.gnuplot.info")
982 (synopsis "Command-line driven graphing utility")
983 (description "Gnuplot is a portable command-line driven graphing
984 utility. It was originally created to allow scientists and students to
985 visualize mathematical functions and data interactively, but has grown to
986 support many non-interactive uses such as web scripting. It is also used as a
987 plotting engine by third-party applications like Octave.")
988 ;; X11 Style with the additional restriction that derived works may only be
989 ;; distributed as patches to the original.
990 (license (license:fsf-free
991 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1001 (url "https://github.com/OkoSanto/GCTP")
1002 (commit (string-append "v" version))))
1003 (file-name (git-file-name name version))
1005 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1007 `(("fortran" ,gfortran)))
1008 (build-system gnu-build-system)
1009 (synopsis "General Cartographic Transformation Package (GCTP)")
1011 "The General Cartographic Transformation Package (GCTP) is a system of
1012 software routines designed to permit the transformation of coordinate pairs
1013 from one map projection to another. The GCTP is the standard computer
1014 software used by the National Mapping Division for map projection
1016 (home-page "https://github.com/OkoSanto/GCTP")
1017 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1026 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1027 version "/src/hdf-" version ".tar.bz2"))
1029 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1030 (patches (search-patches "hdf4-architectures.patch"
1031 "hdf4-reproducibility.patch"
1032 "hdf4-shared-fortran.patch"
1033 "hdf4-tirpc.patch"))))
1034 (build-system gnu-build-system)
1036 `(("gfortran" ,gfortran)
1041 ("libjpeg" ,libjpeg-turbo)
1042 ("libtirpc" ,libtirpc)))
1044 `(#:parallel-tests? #f
1045 #:configure-flags (list "--enable-shared"
1046 (string-append "CPPFLAGS=-I"
1047 (assoc-ref %build-inputs "libtirpc")
1050 (modify-phases %standard-phases
1051 ;; This is inspired by two of Debian's patches.
1052 (add-before 'configure 'add-more-aarch64-support
1054 (substitute* '("mfhdf/ncgen/ncgen.l"
1055 "mfhdf/ncgen/ncgenyy.c"
1056 "mfhdf/libsrc/netcdf.h.in")
1057 (("AIX5L64") "__aarch64__"))
1059 (add-before 'configure 'patchbuild
1062 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1064 (("/bin/mkdir") "mkdir"))
1065 (substitute* (find-files "." "^Makefile\\.in$")
1066 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1067 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1068 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1069 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1070 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1072 (add-after 'configure 'patch-settings
1074 ;; libhdf4.settings contains the full path of the
1075 ;; compilers used, and its contents are included in
1076 ;; .so-files. We truncate the hashes to avoid
1077 ;; unnecessary store references to those compilers:
1078 (substitute* "libhdf4.settings"
1079 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1080 (string-append prefix (string-take hash 10) "...")))
1082 (add-after 'install 'provide-absolute-libjpeg-reference
1083 (lambda* (#:key inputs outputs #:allow-other-keys)
1084 (let ((out (assoc-ref outputs "out"))
1085 (libjpeg (assoc-ref inputs "libjpeg")))
1086 ;; libjpeg-turbo does not provide a .la file, so libtool is
1087 ;; unable to add an absolute reference for -ljpeg in the .la
1088 ;; files. Fix it manually to avoid having to propagate it.
1089 (substitute* (find-files (string-append out "/lib") "\\.la$")
1091 (string-append "-L" libjpeg "/lib -ljpeg")))
1093 (home-page "https://www.hdfgroup.org/products/hdf4/")
1095 "Library and multi-object file format for storing and managing data")
1096 (description "HDF4 is a library and multi-object file format for storing
1097 and managing data between machines. HDF4 is an older hierarchical data format,
1098 incompatible with HDF5.")
1100 (license:non-copyleft
1101 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1103 (define-public hdf4-alt
1108 (substitute-keyword-arguments (package-arguments hdf4)
1109 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1111 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1113 (define-public hdf5-1.8
1120 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1121 "hdf5-" (version-major+minor version)
1122 "/hdf5-" version "/src/hdf5-"
1124 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1126 (match (string-split version #\.)
1127 ((major minor _ ...)
1128 (string-append major minor)))
1129 "/src/hdf5-" version ".tar.bz2")))
1131 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1132 (patches (search-patches "hdf5-config-date.patch"))))
1133 (build-system gnu-build-system)
1137 `(("gfortran" ,gfortran)
1138 ("perl" ,perl))) ;part of the test machinery needs Perl
1139 (outputs '("out" ; core library
1140 "fortran")) ; fortran interface
1142 `(;; Some of the users, notably Flann, need the C++ interface.
1143 #:configure-flags '("--enable-cxx"
1145 "--enable-fortran2003"
1147 ;; Build a thread-safe library. Unfortunately,
1148 ;; 'configure' invites you to either turn off C++,
1149 ;; Fortran, and the high-level interface (HL), or
1150 ;; to pass '--enable-unsupported'. Debian
1151 ;; packagers chose to pass '--enable-unsupported'
1152 ;; and we follow their lead here.
1153 "--enable-threadsafe"
1155 "--enable-unsupported")
1156 ;; Use -fPIC to allow the R bindings to link with the static libraries
1157 #:make-flags (list "CFLAGS=-fPIC"
1160 (modify-phases %standard-phases
1161 (add-before 'configure 'patch-configure
1162 (lambda* (#:key outputs #:allow-other-keys)
1163 (substitute* "configure"
1165 (substitute* "fortran/src/Makefile.in"
1166 (("libhdf5_fortran_la_LDFLAGS =")
1167 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1168 (assoc-ref outputs "fortran") "/lib")))
1169 (substitute* "hl/fortran/src/Makefile.in"
1170 (("libhdf5hl_fortran_la_LDFLAGS =")
1171 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1172 (assoc-ref outputs "fortran") "/lib")))
1174 (add-after 'configure 'patch-settings
1176 ;; libhdf5.settings contains the full path of the
1177 ;; compilers used, and its contents are included in
1178 ;; libhdf5.so. We truncate the hashes to avoid
1179 ;; unnecessary store references to those compilers:
1180 (substitute* "src/libhdf5.settings"
1181 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1182 (string-append prefix (string-take hash 10) "..."))
1183 ;; Don't record the build-time kernel version to make the
1184 ;; settings file reproducible.
1185 (("Uname information:.*")
1186 "Uname information: Linux\n"))
1188 (add-after 'install 'patch-references
1189 (lambda* (#:key inputs outputs #:allow-other-keys)
1190 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1191 (zlib (assoc-ref inputs "zlib")))
1192 (substitute* (find-files bin "h5p?cc")
1194 (string-append "-L" zlib "/lib " lib)))
1196 (add-after 'install 'split
1197 (lambda* (#:key inputs outputs #:allow-other-keys)
1198 ;; Move all fortran-related files
1199 (let* ((out (assoc-ref outputs "out"))
1200 (bin (string-append out "/bin"))
1201 (lib (string-append out "/lib"))
1202 (inc (string-append out "/include"))
1203 (ex (string-append out "/share/hdf5_examples/fortran"))
1204 (fort (assoc-ref outputs "fortran"))
1205 (fbin (string-append fort "/bin"))
1206 (flib (string-append fort "/lib"))
1207 (finc (string-append fort "/include"))
1208 (fex (string-append fort "/share/hdf5_examples/fortran")))
1213 ;; Note: When built with --enable-parallel, the 'h5fc' file
1214 ;; doesn't exist, hence this condition.
1215 (when (file-exists? (string-append bin "/h5fc"))
1216 (rename-file (string-append bin "/h5fc")
1217 (string-append fbin "/h5fc")))
1218 (for-each (lambda (file)
1220 (string-append flib "/" (basename file))))
1221 (find-files lib ".*fortran.*"))
1222 (for-each (lambda (file)
1224 (string-append finc "/" (basename file))))
1225 (find-files inc ".*mod"))
1226 (for-each (lambda (file)
1228 (string-append fex "/" (basename file))))
1229 (find-files ex ".*"))
1230 (delete-file-recursively ex))
1232 (home-page "https://www.hdfgroup.org")
1233 (synopsis "Management suite for extremely large and complex data")
1234 (description "HDF5 is a suite that makes possible the management of
1235 extremely large and complex data collections.")
1236 (license (license:x11-style
1237 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1239 (define-public hdf5-1.10
1246 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1247 "hdf5-" (version-major+minor version)
1248 "/hdf5-" version "/src/hdf5-"
1250 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1252 (apply string-append
1253 (take (string-split version #\.) 2))
1254 "/src/hdf5-" version ".tar.bz2")))
1256 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1257 (patches (search-patches "hdf5-config-date.patch"))))))
1259 (define-public hdf5-1.12
1266 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1267 "hdf5-" (version-major+minor version)
1268 "/hdf5-" version "/src/hdf5-"
1270 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1272 (apply string-append
1273 (take (string-split version #\.) 2))
1274 "/src/hdf5-" version ".tar.bz2")))
1276 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1277 (patches (search-patches "hdf5-config-date.patch"))))))
1280 ;; Default version of HDF5.
1283 (define-public hdf-java
1291 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1292 version "/src/CMake-hdfjava-" version ".tar.gz"))
1294 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1295 (modules '((guix build utils)))
1296 (snippet ; Make sure we don't use the bundled sources and binaries.
1298 (for-each delete-file
1299 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1300 "HDF4.tar.gz" "HDF5.tar.gz"))
1301 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1303 (build-system gnu-build-system)
1305 `(("jdk" ,icedtea "jdk")
1306 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1308 ("hamcrest-core" ,java-hamcrest-core)
1309 ("junit" ,java-junit)
1310 ("slf4j-simple" ,java-slf4j-simple)))
1315 ("libjpeg" ,libjpeg-turbo)
1316 ("slf4j-api" ,java-slf4j-api)))
1319 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1320 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1321 (assoc-ref %build-inputs "jdk") "/lib" )
1322 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1323 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1326 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1327 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1328 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1329 (string-append "JPEGLIB="
1330 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1334 (modify-phases %standard-phases
1335 (add-before 'configure 'chdir-to-source
1336 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1337 (add-before 'configure 'patch-build
1338 (lambda* (#:key inputs outputs #:allow-other-keys)
1339 (substitute* "configure"
1340 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1341 (("/bin/cat") (which "cat")))
1342 ;; Set classpath for compilation
1343 (substitute* '("hdf/hdf5lib/Makefile.in"
1344 "hdf/hdf5lib/exceptions/Makefile.in"
1345 "hdf/hdflib/Makefile.in")
1346 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1347 (string-append (assoc-ref inputs "slf4j-api")
1348 "/share/java/slf4j-api.jar")))
1349 ;; Replace outdated config.sub and config.guess:
1350 (with-directory-excursion "config"
1351 (for-each (lambda (file)
1353 (string-append (assoc-ref inputs "automake")
1355 ,(version-major+minor (package-version automake))
1357 '("config.sub" "config.guess")))
1359 ;; Fix embedded version number
1360 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1361 (substitute* "hdf/hdf5lib/H5.java"
1363 (string-join hdf5version ", "))))
1365 (mkdir-p (string-append (assoc-ref outputs "out")))
1366 ;; Set classpath for tests
1367 (let* ((build-dir (getcwd))
1368 (lib (string-append build-dir "/lib"))
1369 (jhdf (string-append lib "/jhdf.jar"))
1370 (jhdf5 (string-append lib "/jhdf5.jar"))
1374 (string-append (assoc-ref inputs i)
1375 "/share/java/" i ".jar"))
1376 '("slf4j-api" "slf4j-simple"))
1378 (car (find-files (assoc-ref inputs "junit") "jar$"))
1379 (car (find-files (assoc-ref inputs "hamcrest-core")
1382 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1384 (substitute* '("test/hdf5lib/Makefile.in"
1385 "test/hdf5lib/junit.sh.in"
1386 "examples/runExample.sh.in")
1388 (string-append (assoc-ref inputs "coreutils")
1391 (string-append (assoc-ref inputs "coreutils")
1393 (("CLASSPATH=[^\n]*")
1394 (string-append "CLASSPATH=" class-path)))
1395 (setenv "CLASSPATH" class-path))
1397 (add-before 'check 'build-examples
1399 (apply invoke `("javac"
1400 ,@(find-files "examples" ".*\\.java"))))))
1402 #:parallel-build? #f
1404 #:parallel-tests? #f ))
1405 (home-page "https://support.hdfgroup.org/products/java")
1406 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1407 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1408 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1411 ;; BSD-style license:
1412 (license (license:x11-style
1413 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1414 /current/src/unpacked/COPYING"))))
1416 (define-public hdf-eos2
1423 (uri "ftp://edhs1.gsfc.nasa.gov\
1424 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1426 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1427 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1428 "hdf-eos2-build-shared.patch"
1429 "hdf-eos2-fortrantests.patch"))))
1430 (build-system gnu-build-system)
1432 `(("gfortran" ,gfortran)))
1434 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1435 ;; XXX: These inputs are really dependencies of hdf4.
1437 ("libjpeg" ,libjpeg-turbo)
1438 ("libtirpc" ,libtirpc)
1442 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1443 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1444 #:parallel-tests? #f))
1445 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1446 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1447 (description "HDF-EOS2 is a software library built on HDF4 which supports
1448 the construction of data structures used in NASA's Earth Observing
1449 System (Grid, Point and Swath).")
1451 ;; Source files carry a permissive license header.
1452 (license (license:non-copyleft home-page))))
1454 (define-public hdf-eos5
1460 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1461 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1464 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1465 (patches (search-patches "hdf-eos5-build-shared.patch"
1466 "hdf-eos5-remove-gctp.patch"
1467 "hdf-eos5-fix-szip.patch"
1468 "hdf-eos5-fortrantests.patch"))))
1470 `(("gfortran" ,gfortran)))
1471 (build-system gnu-build-system)
1473 `(("hdf5" ,hdf5-1.8)
1477 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1478 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1479 #:parallel-tests? #f))
1480 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1482 "HDF-EOS5 is a software library built on HDF5 to support the construction
1483 of data structures used in NASA's Earth Observing System (Grid, Point and
1485 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1487 ;; Source files carry a permissive license header.
1488 (license (license:non-copyleft home-page))))
1490 (define-public hdf5-parallel-openmpi
1491 (package/inherit hdf5-1.10 ;use the latest
1492 (name "hdf5-parallel-openmpi")
1495 ,@(package-inputs hdf5)))
1497 (substitute-keyword-arguments (package-arguments hdf5)
1498 ((#:configure-flags flags)
1499 ``("--enable-parallel"
1500 ,@(delete "--enable-cxx"
1501 (delete "--enable-threadsafe" ,flags))))
1503 `(modify-phases ,phases
1504 (add-after 'build 'mpi-setup
1506 (add-before 'check 'patch-tests
1508 ;; OpenMPI's mpirun will exit with non-zero status if it
1509 ;; detects an "abnormal termination", i.e. any process not
1510 ;; calling MPI_Finalize(). Since the test is explicitly
1511 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1512 ;; H5C_flush_cache from being called, mpirun will always
1513 ;; complain, so turn this test off.
1514 (substitute* "testpar/Makefile"
1515 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1516 (string-append front back "\n")))
1517 (substitute* "tools/test/h5diff/testph5diff.sh"
1518 (("/bin/sh") (which "sh")))
1520 (synopsis "Management suite for data with parallel IO support")))
1522 (define-public hdf5-blosc
1530 (url "https://github.com/Blosc/hdf5-blosc")
1531 (commit (string-append "v" version))))
1532 (file-name (git-file-name name version))
1534 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1535 (build-system cmake-build-system)
1538 (list (string-append "-DBLOSC_INSTALL_DIR="
1539 (assoc-ref %build-inputs "c-blosc"))
1540 (string-append "-DPLUGIN_INSTALL_PATH="
1541 (assoc-ref %outputs "out")
1542 "/hdf5/lib/plugin"))
1544 (modify-phases %standard-phases
1545 (add-after 'unpack 'do-not-build-blosc
1547 (substitute* "CMakeLists.txt"
1548 (("set\\(BLOSC_INSTALL_DIR.*") "")
1549 (("ExternalProject_Add\\(project_blosc") "message("))
1552 `(("c-blosc" ,c-blosc)
1553 ("hdf5" ,hdf5-1.10)))
1554 (home-page "https://github.com/Blosc/hdf5-blosc")
1555 (synopsis "Filter for HDF5 using the Blosc compressor")
1556 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1557 installing this filter, you can read and write HDF5 files with
1558 Blosc-compressed datasets.")
1559 (license license:expat)))
1561 (define-public h5check
1568 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1569 "h5check/src/h5check-" version ".tar.gz"))
1572 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1573 (build-system gnu-build-system)
1574 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1575 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1576 (synopsis "HDF5 format checker")
1577 (description "@code{h5check} is a validation tool for verifying that an
1578 HDF5 file is encoded according to the HDF File Format Specification.")
1579 (license (license:x11-style "file://COPYING"))))
1587 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1592 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1593 (build-system cmake-build-system)
1594 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1595 (inputs `(("lapack" ,lapack)
1597 ;; FIXME: Even though the fonts are available dvips complains:
1598 ;; "Font cmmi10 not found; characters will be left blank."
1600 `(("texlive" ,texlive-tiny)
1601 ("ghostscript" ,ghostscript)
1602 ("doxygen" ,doxygen)))
1603 (home-page "http://itpp.sourceforge.net")
1604 (synopsis "C++ library of maths, signal processing and communication classes")
1605 (description "IT++ is a C++ library of mathematical, signal processing and
1606 communication classes and functions. Its main use is in simulation of
1607 communication systems and for performing research in the area of
1608 communications. The kernel of the library consists of generic vector and
1609 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1610 similar to MATLAB, GNU Octave or SciPy.")
1611 (license license:gpl3+)))
1613 (define-public netcdf
1621 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1622 "netcdf-c-" version ".tar.gz"))
1625 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1626 (patches (search-patches "netcdf-date-time.patch"))))
1627 (build-system gnu-build-system)
1630 ("doxygen" ,doxygen)
1631 ("graphviz" ,graphviz)))
1633 `(("hdf4" ,hdf4-alt)
1637 ("libjpeg" ,libjpeg-turbo)))
1639 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1641 #:phases (modify-phases %standard-phases
1642 (add-before 'configure 'fix-source-date
1644 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1645 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1646 ;; to '1st hour of the current day', and therefore makes the
1647 ;; package not reproducible.
1648 (substitute* "./configure"
1649 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1650 "date --date='@0'"))
1652 (add-after 'configure 'patch-settings
1654 ;; libnetcdf.settings contains the full filename of the compilers
1655 ;; used to build the library. We truncate the hashes of those
1656 ;; filenames to avoid unnecessary references to the corresponding
1658 (substitute* "libnetcdf.settings"
1659 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1660 (string-append prefix (string-take hash 10) "...")))
1663 #:parallel-tests? #f)) ;various race conditions
1664 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1665 (synopsis "Library for scientific data")
1666 (description "NetCDF is an interface for scientific data access and a
1667 software library that provides an implementation of the interface. The netCDF
1668 library defines a machine-independent format for representing scientific data.
1669 Together, the interface, library, and format support the creation, access, and
1670 sharing of scientific data.")
1671 (license (license:x11-style "file://COPYRIGHT"))))
1673 (define-public netcdf-parallel-openmpi
1674 (package (inherit netcdf)
1675 (name "netcdf-parallel-openmpi")
1678 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1679 (package-inputs netcdf))))
1680 ;; TODO: Replace pkg-config references in nc-config with absolute references
1682 (substitute-keyword-arguments (package-arguments netcdf)
1683 ((#:configure-flags flags)
1684 `(cons* "CC=mpicc" "CXX=mpicxx"
1685 "--enable-parallel-tests"
1686 ;; Shared libraries not supported with parallel IO.
1687 "--disable-shared" "--with-pic"
1689 ((#:phases phases '%standard-phases)
1690 `(modify-phases ,phases
1691 (add-after 'build 'mpi-setup
1692 ,%openmpi-setup)))))))
1694 (define-public netcdf-fortran
1696 (name "netcdf-fortran")
1701 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1705 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1706 (build-system gnu-build-system)
1708 `(#:parallel-tests? #f))
1710 `(("netcdf" ,netcdf)))
1712 `(("gfortran" ,gfortran)))
1713 (synopsis "Fortran interface for the netCDF library")
1714 (description (package-description netcdf))
1715 (home-page (package-home-page netcdf))
1716 (license (package-license netcdf))))
1718 (define-public nlopt
1724 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1727 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1728 (build-system gnu-build-system)
1730 `(;; Shared libraries are not built by default. They are required to
1731 ;; build the Guile, Octave, and Python bindings.
1732 #:configure-flags '("--enable-shared")
1735 (modify-phases %standard-phases
1736 (add-before 'configure 'set-libnlopt-file-name
1737 (lambda* (#:key outputs #:allow-other-keys)
1738 ;; Make sure the Scheme module refers to the library by its
1739 ;; absolute file name (we cannot do that from a snippet
1740 ;; because the expansion of @libdir@ contains
1742 (let ((out (assoc-ref outputs "out")))
1743 (substitute* "swig/nlopt.scm.in"
1745 (string-append out "/lib/libnlopt")))
1747 (inputs `(("guile" ,guile-2.0)))
1748 (native-inputs `(("pkg-config" ,pkg-config)))
1749 (home-page "http://ab-initio.mit.edu/wiki/")
1750 (synopsis "Library for nonlinear optimization")
1751 (description "NLopt is a library for nonlinear optimization, providing a
1752 common interface for a number of different free optimization routines available
1753 online as well as original implementations of various other algorithms.")
1754 (license license:lgpl2.1+)))
1756 (define-public ipopt
1763 (url "https://github.com/coin-or/Ipopt")
1764 (commit (string-append "releases/" version))))
1765 (file-name (git-file-name name version))
1768 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1769 (build-system gnu-build-system)
1771 '(#:phases (modify-phases %standard-phases
1772 (add-after 'install 'add--L-flags-in-ipopt.pc
1773 (lambda* (#:key inputs outputs #:allow-other-keys)
1774 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1775 ;; move it to "Libs.private" where it belongs, and add a
1776 ;; '-L' flag for LAPACK.
1777 (let ((out (assoc-ref outputs "out"))
1778 (lapack (assoc-ref inputs "lapack")))
1779 (substitute* (string-append out "/lib/pkgconfig/"
1781 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1782 (string-append "Libs: " before " " after "\n"
1783 "Libs.private: " before
1784 "-L" lapack "/lib -llapack -lblas "
1788 `(("gfortran" ,gfortran)
1789 ("pkg-config" ,pkg-config)))
1791 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1792 `(("lapack" ,lapack))) ;for both libblas and liblapack
1793 (home-page "https://www.coin-or.org")
1794 (synopsis "Large-scale nonlinear optimizer")
1796 "The Interior Point Optimizer (IPOPT) is a software package for
1797 large-scale nonlinear optimization. It provides C++, C, and Fortran
1799 (license license:epl2.0)))
1807 (uri (string-append "https://www.coin-or.org/download/source/"
1808 "Cbc/Cbc-" version ".tgz"))
1811 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
1812 (modules '((guix build utils)))
1814 ;; Make sure we don't use the bundled software.
1815 '(delete-file-recursively "ThirdParty"))))
1816 (build-system gnu-build-system)
1818 `(("gfortran" ,gfortran)
1819 ("pkg-config" ,pkg-config)))
1821 `(("openblas" ,openblas)))
1822 (home-page "https://www.coin-or.org")
1823 (synopsis "Branch-and-cut solver")
1825 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
1826 solver written in C++. It can be used as a library or as a standalone
1828 (license license:epl1.0)))
1836 (uri (string-append "https://www.coin-or.org/download/source/"
1837 "Clp/Clp-" version ".tgz"))
1840 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1841 (modules '((guix build utils)))
1843 ;; Make sure we don't use the bundled software.
1845 (delete-file-recursively "ThirdParty")
1847 (build-system gnu-build-system)
1849 `(("gfortran" ,gfortran)
1850 ("pkg-config" ,pkg-config)))
1852 `(("openblas" ,openblas)))
1853 (home-page "https://www.coin-or.org")
1854 (synopsis "Linear programming solver")
1856 "CLP is a high quality linear programming solver. Its main strengths are
1857 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1858 linear and quadratic objectives. There are limited facilities for nonlinear
1859 and quadratic objectives using the Simplex algorithm.")
1860 (license license:epl1.0)))
1862 (define-public libflame
1866 (outputs '("out" "static"))
1871 (url "https://github.com/flame/libflame")
1873 (file-name (git-file-name name version))
1876 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1877 (build-system gnu-build-system)
1880 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1881 (list "--enable-dynamic-build"
1882 "--enable-max-arg-list-hack"
1883 "--enable-lapack2flame"
1884 "--enable-verbose-make-output"
1885 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1886 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1889 '("--enable-vector-intrinsics=sse")
1891 "--enable-supermatrix"
1892 "--enable-memory-alignment=16"
1893 "--enable-ldim-alignment")
1895 (modify-phases %standard-phases
1896 (add-after 'unpack 'patch-/usr/bin/env-bash
1898 (substitute* "build/config.mk.in"
1899 (("/usr/bin/env bash") (which "bash")))
1902 (lambda* (#:key tests? #:allow-other-keys)
1903 (substitute* "test/Makefile"
1904 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1905 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1907 (with-directory-excursion "test"
1910 (invoke "./test_libflame.x"))
1912 (add-after 'install 'install-static
1913 (lambda* (#:key outputs #:allow-other-keys)
1914 (let ((out (assoc-ref outputs "out"))
1915 (static (assoc-ref outputs "static")))
1916 (mkdir-p (string-append static "/lib"))
1917 (rename-file (string-append out "/lib/libflame.a")
1918 (string-append static "/lib/libflame.a"))
1919 (install-file (string-append out "/include/FLAME.h")
1920 (string-append static "/include"))
1923 `(("gfortran" ,gfortran)))
1925 `(("lapack" ,lapack)
1926 ("openblas" ,openblas)
1928 ("python" ,python-wrapper)))
1929 (home-page "https://github.com/flame/libflame")
1930 (synopsis "High-performance object-based library for DLA computations")
1931 (description "@code{libflame} is a portable library for dense matrix
1932 computations, providing much of the functionality present in LAPACK, developed
1933 by current and former members of the @acronym{SHPC, Science of High-Performance
1934 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1935 Computational Engineering and Sciences} at The University of Texas at Austin.
1936 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1937 includes a complete LAPACK implementation.")
1938 (license license:bsd-3)))
1940 (define-public ceres
1942 (name "ceres-solver")
1944 (home-page "http://ceres-solver.org/")
1947 (uri (string-append home-page "ceres-solver-"
1951 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1952 (build-system cmake-build-system)
1954 ;; TODO: Build HTML user documentation and install separately.
1955 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1956 "-DBUILD_SHARED_LIBS=ON")
1958 #:phases (modify-phases %standard-phases
1959 (add-before 'configure 'set-library-directory
1961 ;; Install libraries to lib/, not lib64/.
1962 (substitute* "internal/ceres/CMakeLists.txt"
1963 (("set\\(LIB_SUFFIX \"64\"\\)")
1964 "set(LIB_SUFFIX \"\")"))
1967 `(("pkg-config" ,pkg-config)))
1969 `(("glog" ,glog))) ;for #include <glog/glog.h>
1974 ("suitesparse" ,suitesparse)
1975 ("gflags" ,gflags)))
1976 (synopsis "C++ library for solving large optimization problems")
1978 "Ceres Solver is a C++ library for modeling and solving large,
1979 complicated optimization problems. It is a feature rich, mature and
1980 performant library which has been used in production since 2010. Ceres Solver
1981 can solve two kinds of problems:
1983 @item non-linear least squares problems with bounds constraints;
1984 @item general unconstrained optimization problems.
1986 (license license:bsd-3)))
1988 ;; For a fully featured Octave, users are strongly recommended also to install
1989 ;; the following packages: less, ghostscript, gnuplot.
1990 (define-public octave-cli
1997 (uri (string-append "mirror://gnu/octave/octave-"
2001 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2002 (build-system gnu-build-system)
2004 `(("alsa-lib" ,alsa-lib)
2005 ("arpack" ,arpack-ng)
2011 ("fontconfig" ,fontconfig)
2012 ("freetype" ,freetype)
2016 ("graphicsmagick" ,graphicsmagick)
2018 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2019 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2020 ;; libtiff.la instead of having to provide it here.
2021 ("libjpeg" ,libjpeg-turbo)
2025 ("libsndfile" ,libsndfile)
2029 ("portaudio" ,portaudio)
2031 ("readline" ,readline)
2032 ("suitesparse" ,suitesparse)
2033 ("texinfo" ,texinfo)
2036 `(("gfortran" ,gfortran)
2037 ("pkg-config" ,pkg-config)
2039 ;; The following inputs are not actually used in the build process.
2040 ;; However, the ./configure gratuitously tests for their existence and
2041 ;; assumes that programs not present at build time are also not, and
2042 ;; can never be, available at run time! If these inputs are therefore
2043 ;; not present, support for them will be built out. However, Octave
2044 ;; will still run without them, albeit without the features they
2047 ("ghostscript" ,ghostscript)
2048 ("gnuplot" ,gnuplot)))
2049 ;; Octave code uses this variable to detect directories holding multiple CA
2050 ;; certificates to verify peers with. This is required for the networking
2051 ;; functions that require encryption to work properly.
2052 (native-search-paths
2053 (list (search-path-specification
2054 (variable "CURLOPT_CAPATH")
2055 (files '("etc/ssl/certs")))))
2058 (list (string-append "--with-shell="
2059 (assoc-ref %build-inputs "bash")
2062 ;; XXX: Without this flag, linking octave-cli fails with
2063 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2064 ;; not pulling in liboctinterp.la for -lstdc++.
2065 "--enable-link-all-dependencies")
2067 (modify-phases %standard-phases
2068 (add-after 'configure 'configure-makeinfo
2069 (lambda* (#:key inputs #:allow-other-keys)
2070 (substitute* "libinterp/corefcn/help.h"
2073 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2075 (home-page "https://www.gnu.org/software/octave/")
2076 (synopsis "High-level language for numerical computation (no GUI)")
2077 (description "GNU Octave is a high-level interpreted language that is
2078 specialized for numerical computations. It can be used for both linear and
2079 non-linear applications and it provides great support for visualizing results.
2080 Work may be performed both at the interactive command-line as well as via
2082 (license license:gpl3+)))
2084 (define-public octave
2085 (package (inherit octave-cli)
2088 `(("qscintilla" ,qscintilla)
2090 ,@(package-inputs octave-cli)))
2092 `(("qttools" , qttools) ;for lrelease
2093 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2094 ,@(package-native-inputs octave-cli)))
2096 (substitute-keyword-arguments (package-arguments octave-cli)
2098 `(modify-phases ,phases
2099 (add-before 'configure 'patch-qscintilla-library-name
2100 (lambda* (#:key inputs #:allow-other-keys)
2101 ;; The QScintilla library that the Octave configure script tries
2102 ;; to link with should be named libqscintilla-qt5.so, but the
2103 ;; QScintilla input provides the shared library as
2104 ;; libqscintilla2_qt5.so.
2105 (substitute* "configure"
2106 (("qscintilla2-qt5")
2109 (synopsis "High-level language for numerical computation (with GUI)")))
2111 (define-public opencascade-oce
2113 (name "opencascade-oce")
2119 (url "https://github.com/tpaviot/oce")
2120 (commit (string-append "OCE-" version))))
2121 (file-name (git-file-name name version))
2122 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2124 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2125 (build-system cmake-build-system)
2128 (list "-DOCE_TESTING:BOOL=ON"
2129 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2130 "-DOCE_DRAW:BOOL=ON"
2131 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2132 (assoc-ref %outputs "out"))
2133 "-UCMAKE_INSTALL_RPATH")))
2135 `(("freetype" ,freetype)
2142 `(("python" ,python-wrapper)))
2143 (home-page "https://github.com/tpaviot/oce")
2144 (synopsis "Libraries for 3D modeling and numerical simulation")
2146 "Open CASCADE is a set of libraries for the development of applications
2147 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2148 C++ class libraries providing services for 3D surface and solid modeling, CAD
2149 data exchange, and visualization. It is used for development of specialized
2150 software dealing with 3D models in design (CAD), manufacturing (CAM),
2151 numerical simulation (CAE), measurement equipment (CMM), and quality
2152 control (CAQ) domains.
2154 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2155 patches, improvements, and experiments contributed by users over the official
2156 Open CASCADE library.")
2157 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2158 ; use of header files; see
2159 ; OCCT_LGPL_EXCEPTION.txt
2160 license:public-domain; files
2161 ; src/Standard/Standard_StdAllocator.hxx and
2162 ; src/NCollection/NCollection_StdAllocator.hxx
2163 license:expat; file src/OpenGl/OpenGl_glext.h
2164 license:bsd-3)))); test framework gtest
2166 (define-public opencascade-occt
2168 (name "opencascade-occt")
2174 (url "https://git.dev.opencascade.org/repos/occt.git")
2177 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2179 (file-name (git-file-name name version))
2181 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2182 (modules '((guix build utils)))
2185 ;; Remove files specific to non-free operating systems.
2186 (delete-file-recursively "samples/ios")
2187 (delete-file-recursively "samples/mfc")
2188 (delete-file-recursively "samples/qt/FuncDemo")
2189 (delete-file "genconf.bat")
2190 (delete-file "gendoc.bat")
2191 (delete-file "genproj.bat")
2192 (delete-file "upgrade.bat")
2193 ;; Remove references to deleted files.
2194 (substitute* "dox/FILES_HTML.txt"
2195 ((".*standard.*") "" )
2196 ((".*UIKitSample.*") ""))
2198 (build-system cmake-build-system)
2200 '(;; There is no test target for make. OCCT provides an
2201 ;; 'Automated Testing System', which may be accessed after
2202 ;; installation via the draw.sh script. draw.sh is located in
2203 ;; the bin directory. For details see:
2204 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2205 ;; occt_dev_guides__tests.html
2207 ;; Configure without freeimage: attempting to link against the
2208 ;; freeimage version 3.17 library leads to 'undefined
2209 ;; reference' errors.
2211 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2213 "-DUSE_VTK:BOOL=OFF"
2214 "-DBUILD_DOC_Overview:BOOL=OFF"
2215 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2216 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2217 "-UCMAKE_INSTALL_LIBDIR")))
2219 `(("doxygen" ,doxygen)
2220 ;("freeimage" ,freeimage)
2221 ("freetype" ,freetype)
2223 ("libxext" ,libxext)
2230 ;; TODO: build Overview documentation and add 'doc' output.
2231 (home-page "https://www.opencascade.com")
2232 (synopsis "Libraries for 3D modeling and numerical simulation")
2234 "Open CASCADE is a set of libraries for the development of applications
2235 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2236 C++ class libraries providing services for 3D surface and solid modeling, CAD
2237 data exchange, and visualization. It is used for development of specialized
2238 software dealing with 3D models in design (CAD), manufacturing (CAM),
2239 numerical simulation (CAE), measurement equipment (CMM), and quality
2240 control (CAQ) domains.
2242 This is the certified version of the Open Cascade Technology (OCCT) library.")
2243 (license (list ;; OCCT library:
2244 license:lgpl2.1; with an exception for the use of header
2245 ; files, see OCCT_LGPL_EXCEPTION.txt.
2246 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2247 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2249 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2250 ;; src/StepFile/step.tab.*:
2251 license:gpl3+ ; with Bison 2.2 exception.
2252 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2253 (license:non-copyleft
2254 "https://www.unicode.org/license.html")
2255 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2256 license:public-domain))))
2266 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2268 (string-append "gmsh_"
2269 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2271 (file-name (git-file-name name version))
2273 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2274 (modules '((guix build utils)))
2277 (delete-file-recursively "contrib/metis")
2279 (build-system cmake-build-system)
2282 ("gfortran" ,gfortran)
2289 ("opencascade-occt" ,opencascade-occt)
2291 ("libxext" ,libxext)))
2293 `(("fontconfig" ,fontconfig)
2294 ("libxft" ,libxft)))
2296 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2297 "-DENABLE_BUILD_SHARED:BOOL=ON"
2298 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2299 (home-page "http://gmsh.info/")
2300 (synopsis "3D finite element grid generator")
2301 (description "Gmsh is a 3D finite element grid generator with a built-in
2302 CAD engine and post-processor. Its design goal is to provide a fast, light
2303 and user-friendly meshing tool with parametric input and advanced
2304 visualization capabilities. Gmsh is built around four modules: geometry,
2305 mesh, solver and post-processing. The specification of any input to these
2306 modules is done either interactively using the graphical user interface or in
2307 ASCII text files using Gmsh's own scripting language.")
2308 (license license:gpl2+)))
2310 (define-public veusz
2317 (uri (pypi-uri "veusz" version))
2319 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2320 (build-system python-build-system)
2322 `(;; Tests will fail because they depend on optional packages like
2323 ;; python-astropy, which is not packaged.
2326 (modify-phases %standard-phases
2327 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2328 ;; the path is defined in Guix, therefore we have to change it.
2329 (add-after 'unpack 'fix-sip-dir
2331 (substitute* "pyqtdistutils.py"
2332 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2334 ;; Now we have to pass the correct sip_dir to setup.py.
2336 (lambda* (#:key inputs #:allow-other-keys)
2337 ;; We need to tell setup.py where to locate QtCoremod.sip
2338 ((@@ (guix build python-build-system) call-setuppy)
2340 (list (string-append "--sip-dir="
2341 (assoc-ref inputs "python-pyqt")
2344 ;; Ensure that icons are found at runtime.
2345 (add-after 'install 'wrap-executable
2346 (lambda* (#:key inputs outputs #:allow-other-keys)
2347 (let ((out (assoc-ref outputs "out")))
2348 (wrap-program (string-append out "/bin/veusz")
2349 `("QT_PLUGIN_PATH" prefix
2350 ,(list (string-append (assoc-ref inputs "qtsvg")
2351 "/lib/qt5/plugins/"))))))))))
2353 `(("pkg-config" ,pkg-config)
2354 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2355 ("qttools" ,qttools)
2356 ("python-sip" ,python-sip-4)))
2358 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2359 ("python-dbus" ,python-dbus)
2360 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2361 ("python-pyqt" ,python-pyqt)
2362 ("qtbase" ,qtbase-5)
2365 `(("python-numpy" ,python-numpy)))
2366 (home-page "https://veusz.github.io/")
2367 (synopsis "Scientific plotting package")
2369 "Veusz is a scientific plotting and graphing program with a graphical
2370 user interface, designed to produce publication-ready 2D and 3D plots. In
2371 addition it can be used as a module in Python for plotting. It supports
2372 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2373 (license license:gpl2+)))
2375 (define-public maxflow
2378 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2379 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2384 (url "https://github.com/gerddie/maxflow")
2386 (file-name (git-file-name name version))
2389 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2390 (build-system cmake-build-system)
2391 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2392 (synopsis "Library implementing Maxflow algorithm")
2393 (description "An implementation of the maxflow algorithm described in
2394 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2395 Energy Minimization in Computer Vision.\n
2396 Yuri Boykov and Vladimir Kolmogorov.\n
2397 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2399 (license license:gpl3+)))
2401 (define-public petsc
2408 ;; The *-lite-* tarball does not contain the *large* documentation
2409 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2410 "petsc-lite-" version ".tar.gz"))
2412 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2413 (outputs '("out" ; libraries and headers
2414 "examples")) ; ~30MiB of examples
2415 (build-system gnu-build-system)
2417 `(("python" ,python-2)))
2419 `(("gfortran" ,gfortran)
2420 ("openblas" ,openblas)
2421 ("superlu" ,superlu)
2422 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2423 ;; leaving out opengl, as configuration seems to only be for mac
2426 `(#:test-target "test"
2427 #:parallel-build? #f ; build is parallel by default
2434 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2435 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2436 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2438 (modify-phases %standard-phases
2440 ;; PETSc's configure script is actually a python script, so we can't
2441 ;; run it with bash.
2442 (lambda* (#:key outputs (configure-flags '())
2444 (let* ((prefix (assoc-ref outputs "out"))
2445 (flags `(,(string-append "--prefix=" prefix)
2446 ,@configure-flags)))
2447 (format #t "build directory: ~s~%" (getcwd))
2448 (format #t "configure flags: ~s~%" flags)
2449 (apply invoke "./configure" flags))))
2450 (add-after 'configure 'clean-local-references
2451 (lambda* (#:key outputs #:allow-other-keys)
2452 (let ((out (assoc-ref outputs "out")))
2453 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2454 ;; Prevent build directory from leaking into compiled code
2456 ;; Scrub timestamp for reproducibility
2457 ((".*Libraries compiled on.*") ""))
2458 (substitute* (find-files "." "petscvariables")
2459 ;; Do not expose build machine characteristics, set to defaults.
2460 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2461 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2463 (add-after 'install 'clean-install
2464 ;; Try to keep installed files from leaking build directory names.
2465 (lambda* (#:key inputs outputs #:allow-other-keys)
2466 (let ((out (assoc-ref outputs "out")))
2467 (substitute* (map (lambda (file)
2468 (string-append out "/lib/petsc/conf/" file))
2469 '("petscvariables"))
2471 ;; Make compiler references point to the store
2472 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2473 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2474 (string-append "= " (which compiler))))
2475 ;; PETSc installs some build logs, which aren't necessary.
2476 (for-each (lambda (file)
2477 (let ((f (string-append out "/lib/petsc/conf/" file)))
2478 (when (file-exists? f)
2480 '("configure.log" "make.log" "gmake.log"
2481 "test.log" "error.log" "RDict.db"
2482 "PETScBuildInternal.cmake"
2483 ;; Once installed, should uninstall with Guix
2486 (add-after 'install 'move-examples
2487 (lambda* (#:key outputs #:allow-other-keys)
2488 (let* ((out (assoc-ref outputs "out"))
2489 (examples (assoc-ref outputs "examples"))
2490 (exdir (string-append out "/share/petsc/examples"))
2491 (exdir' (string-append examples "/share/petsc/examples")))
2492 (copy-recursively exdir exdir')
2493 (delete-file-recursively exdir)
2495 (home-page "https://www.mcs.anl.gov/petsc")
2496 (synopsis "Library to solve PDEs")
2497 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2498 data structures and routines for the scalable (parallel) solution of
2499 scientific applications modeled by partial differential equations.")
2500 (license (license:non-copyleft
2501 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2503 (define-public petsc-complex
2504 (package (inherit petsc)
2505 (name "petsc-complex")
2507 (substitute-keyword-arguments (package-arguments petsc)
2508 ((#:configure-flags cf)
2509 `(cons "--with-scalar-type=complex" ,cf))))
2510 (synopsis "Library to solve PDEs (with complex scalars)")))
2512 (define-public petsc-openmpi
2513 (package (inherit petsc)
2514 (name "petsc-openmpi")
2516 `(("hdf5" ,hdf5-parallel-openmpi)
2517 ("hypre" ,hypre-openmpi)
2519 ("mumps" ,mumps-openmpi)
2520 ("openmpi" ,openmpi)
2521 ("scalapack" ,scalapack)
2522 ("scotch" ,pt-scotch32)
2523 ,@(package-inputs petsc)))
2525 (substitute-keyword-arguments (package-arguments petsc)
2526 ((#:configure-flags cf)
2528 "--with-mpiexec=mpirun"
2531 "--with-scalapack=1"
2533 ,(string-append "--with-mpi-dir="
2534 (assoc-ref %build-inputs "openmpi"))
2535 ,(string-append "--with-hdf5-include="
2536 (assoc-ref %build-inputs "hdf5") "/include")
2537 ,(string-append "--with-hdf5-lib="
2538 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2539 ,@(delete "--with-mpi=0" ,cf)))
2541 `(modify-phases ,phases
2542 (add-before 'configure 'mpi-setup
2543 ,%openmpi-setup)))))
2544 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2546 (define-public petsc-complex-openmpi
2547 (package (inherit petsc-complex)
2548 (name "petsc-complex-openmpi")
2550 `(("openmpi" ,openmpi)
2551 ,@(package-inputs petsc-complex)))
2553 (substitute-keyword-arguments (package-arguments petsc-complex)
2554 ((#:configure-flags cf)
2555 ``("--with-mpiexec=mpirun"
2556 ,(string-append "--with-mpi-dir="
2557 (assoc-ref %build-inputs "openmpi"))
2558 ,@(delete "--with-mpi=0" ,cf)))
2560 `(modify-phases ,phases
2561 (add-before 'configure 'mpi-setup
2562 ,%openmpi-setup)))))
2563 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2565 (define-public python-petsc4py
2567 (name "python-petsc4py")
2572 (uri (pypi-uri "petsc4py" version))
2575 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2576 (modules '((guix build utils)))
2579 ;; Ensure source file is regenerated in the build phase.
2580 (delete-file "src/petsc4py.PETSc.c")
2581 ;; Remove legacy GC code. See
2582 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2583 (substitute* "src/PETSc/cyclicgc.pxi"
2584 ((".*gc_refs.*") "" )
2585 ((".*PyGC_Head.*") ""))
2587 (build-system python-build-system)
2590 (modify-phases %standard-phases
2591 (add-before 'build 'pre-build
2593 ;; Define path to PETSc installation.
2594 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2596 (add-before 'check 'mpi-setup
2599 `(("python-cython" ,python-cython)))
2601 `(("petsc" ,petsc-openmpi)
2602 ("python-numpy" ,python-numpy)))
2603 (home-page "https://bitbucket.org/petsc/petsc4py/")
2604 (synopsis "Python bindings for PETSc")
2605 (description "PETSc, the Portable, Extensible Toolkit for
2606 Scientific Computation, is a suite of data structures and routines for
2607 the scalable (parallel) solution of scientific applications modeled by
2608 partial differential equations. It employs the MPI standard for all
2609 message-passing communication. @code{petsc4py} provides Python
2610 bindings to almost all functions of PETSc.")
2611 (license license:bsd-3)))
2613 (define-public python-kiwisolver
2615 (name "python-kiwisolver")
2619 (uri (pypi-uri "kiwisolver" version))
2622 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2623 (build-system python-build-system)
2624 (home-page "https://github.com/nucleic/kiwi")
2625 (synopsis "Fast implementation of the Cassowary constraint solver")
2627 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2628 solving algorithm. Kiwi has been designed from the ground up to be
2629 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2630 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2631 savings are consistently > 5x.")
2632 (license license:bsd-3)))
2634 (define-public python2-kiwisolver
2635 (package-with-python2 python-kiwisolver))
2637 (define-public slepc
2644 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2648 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2649 (build-system gnu-build-system)
2651 `(("python" ,python-2)
2652 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2654 `(("arpack" ,arpack-ng)
2655 ("gfortran" ,gfortran)))
2657 `(("petsc" ,petsc)))
2659 `(#:parallel-build? #f ;build is parallel by default
2661 `(,(string-append "--with-arpack-dir="
2662 (assoc-ref %build-inputs "arpack") "/lib"))
2663 #:make-flags ;honor (parallel-job-count)
2664 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2665 ,(string-append "PETSCCONFIGDIR="
2666 (assoc-ref %build-inputs "petsc:examples")
2667 "/share/petsc/examples/config"))
2669 (modify-phases %standard-phases
2671 ;; configure is a python script, so we can't run it with bash.
2672 (lambda* (#:key inputs outputs (configure-flags '())
2674 (let* ((prefix (assoc-ref outputs "out"))
2675 (flags `(,(string-append "--prefix=" prefix)
2676 ,@configure-flags)))
2677 (format #t "build directory: ~s~%" (getcwd))
2678 (format #t "configure flags: ~s~%" flags)
2679 (setenv "SLEPC_DIR" (getcwd))
2680 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2681 (apply invoke "./configure" flags))))
2682 (add-after 'install 'delete-doc
2683 ;; TODO: SLEPc installs HTML documentation alongside headers in
2684 ;; $out/include. We'd like to move them to share/doc, but delete
2685 ;; them for now, as they are incomplete and installing the complete
2686 ;; documentation is difficult.
2687 (lambda* (#:key outputs #:allow-other-keys)
2688 (let* ((out (assoc-ref outputs "out")))
2689 (for-each delete-file (find-files out "\\.html$"))
2691 (add-after 'install 'clean-install
2692 ;; Clean up unnecessary build logs from installation.
2693 (lambda* (#:key outputs #:allow-other-keys)
2694 (let ((out (assoc-ref outputs "out")))
2695 (for-each (lambda (file)
2696 (let ((f (string-append out "/lib/slepc/conf/" file)))
2697 (when (file-exists? f)
2699 '("configure.log" "make.log" "gmake.log"
2700 "test.log" "error.log" "RDict.db"
2703 (home-page "https://slepc.upv.es")
2704 (synopsis "Scalable library for eigenproblems")
2705 (description "SLEPc is a software library for the solution of large sparse
2706 eigenproblems on parallel computers. It can be used for the solution of
2707 linear eigenvalue problems formulated in either standard or generalized form,
2708 as well as other related problems such as the singular value decomposition.
2709 The emphasis of the software is on methods and techniques appropriate for
2710 problems in which the associated matrices are sparse, for example, those
2711 arising after the discretization of partial differential equations.")
2712 (license license:bsd-2)))
2714 (define-public slepc-complex
2715 (package (inherit slepc)
2716 (name "slepc-complex")
2718 `(("petsc" ,petsc-complex)
2719 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2720 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2722 (define-public slepc-openmpi
2723 (package (inherit slepc)
2724 (name "slepc-openmpi")
2726 (substitute-keyword-arguments (package-arguments slepc)
2727 ((#:phases phases '%standard-phases)
2728 `(modify-phases ,phases
2729 (add-before 'check 'mpi-setup
2730 ,%openmpi-setup)))))
2733 ("arpack" ,arpack-ng-openmpi)
2734 ,@(alist-delete "arpack" (package-inputs slepc))))
2736 `(("petsc" ,petsc-openmpi)
2737 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2738 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2740 (define-public slepc-complex-openmpi
2741 (package (inherit slepc-openmpi)
2742 (name "slepc-complex-openmpi")
2744 `(("petsc" ,petsc-complex-openmpi)
2745 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2746 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2748 (define-public python-slepc4py
2750 (name "python-slepc4py")
2755 (uri (pypi-uri "slepc4py" version))
2758 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2759 (build-system python-build-system)
2762 (modify-phases %standard-phases
2763 (add-before 'build 'pre-build
2765 ;; Define path to PETSc installation.
2766 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2767 ;; Define path to SLEPc installation.
2768 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2770 (add-before 'check 'mpi-setup
2773 `(("python-numpy" ,python-numpy)
2774 ("python-petsc4py" ,python-petsc4py)
2775 ("slepc" ,slepc-openmpi)))
2776 (home-page "https://bitbucket.org/slepc/slepc4py/")
2777 (synopsis "Python bindings for SLEPc")
2778 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2779 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2780 Scientific Computation. It employs the MPI standard for all
2781 message-passing communication. @code{slepc4py} provides Python
2782 bindings to almost all functions of SLEPc.")
2783 (license license:bsd-3)))
2785 (define-public metamath
2793 (url "https://github.com/metamath/metamath-exe")
2794 (commit (string-append "v" version))))
2795 (file-name (git-file-name name version))
2797 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2798 (build-system gnu-build-system)
2800 `(("autoconf" ,autoconf)
2801 ("automake" ,automake)))
2802 (home-page "http://us.metamath.org/")
2803 (synopsis "Proof verifier based on a minimalistic formalism")
2805 "Metamath is a tiny formal language and that can express theorems in
2806 abstract mathematics, with an accompyaning @command{metamath} executable that
2807 verifies databases of these proofs. There is a public database,
2808 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2809 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2810 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2811 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2813 (license license:gpl2+)))
2815 (define-public mumps
2822 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2826 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2827 (patches (search-patches "mumps-build-parallelism.patch"
2828 "mumps-shared-libseq.patch"
2829 "mumps-shared-mumps.patch"
2830 "mumps-shared-pord.patch"))))
2831 (build-system gnu-build-system)
2833 `(("fortran" ,gfortran)
2834 ;; These are required for linking against mumps, but we let the user
2835 ;; declare the dependency.
2838 ("scotch" ,scotch)))
2840 `(#:modules ((ice-9 match)
2843 ,@%gnu-build-system-modules)
2845 (modify-phases %standard-phases
2847 (lambda* (#:key inputs #:allow-other-keys)
2848 (call-with-output-file "Makefile.inc"
2859 INCSEQ = -I$(topdir)/libseq
2860 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2861 LIBSEQNEEDED = libseqneeded~;
2865 AR = ar vr # rules require trailing space, ugh...
2868 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2870 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2871 LIBOTHERS = -pthread
2874 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2878 LIBS = $(SCALAP) $(LIBSEQ)
2879 LPORDDIR = $(topdir)/PORD/lib
2880 IPORD = -I$(topdir)/PORD/include
2881 LPORD = $(LPORDDIR)/libpord.a
2882 ORDERINGSF = -Dpord~@[
2884 IMETIS = -I$(METISDIR)/include
2885 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2886 ORDERINGSF += -Dmetis~]~@[~:{
2888 ISCOTCH = -I$(SCOTCHDIR)/include
2889 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2890 ORDERINGSF += ~a~}~]
2891 ORDERINGSC = $(ORDERINGSF)
2892 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2893 IORDERINGSF = $(ISCOTCH)
2894 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2895 (assoc-ref inputs "mpi")
2896 (assoc-ref inputs "blas")
2897 (assoc-ref inputs "scalapack")
2898 (assoc-ref inputs "metis")
2899 (match (list (assoc-ref inputs "pt-scotch")
2900 (assoc-ref inputs "scotch"))
2904 `((,scotch "" "-Dscotch")))
2907 "-lptesmumps -lptscotch -lptscotcherr "
2908 "-Dptscotch")))))))))
2910 ;; By default only the d-precision library is built. Make with "all"
2911 ;; target so that all precision libraries and examples are built.
2913 (invoke "make" "all"
2914 (format #f "-j~a" (parallel-job-count)))))
2916 ;; Run the simple test drivers, which read test input from stdin:
2917 ;; from the "real" input for the single- and double-precision
2918 ;; testers, and from the "cmplx" input for complex-precision
2919 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2920 ;; package to prefix execution with "mpirun".
2921 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2922 (with-directory-excursion "examples"
2925 (let ((tester (apply open-pipe*
2928 ,(string-append "./" prec
2930 (input (open-input-file
2931 (string-append "input_simpletest_" type))))
2933 (dump-port input tester)
2935 (zero? (close-pipe tester)))))
2937 '("real" "real" "cmplx" "cmplx")))))
2939 (lambda* (#:key outputs #:allow-other-keys)
2940 (let* ((out (assoc-ref outputs "out"))
2941 (libdir (string-append out "/lib")))
2942 (copy-recursively "lib" libdir)
2943 (copy-recursively "include" (string-append out "/include"))
2944 (when (file-exists? "libseq/libmpiseq.a")
2945 (install-file "libseq/libmpiseq.a" libdir))
2946 (when (file-exists? "libseq/libmpiseq.so")
2947 (install-file "libseq/libmpiseq.so" libdir))
2949 (home-page "http://mumps.enseeiht.fr")
2950 (synopsis "Multifrontal sparse direct solver")
2952 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2953 sparse system of linear equations A x = b using Gaussian elimination.")
2954 (license license:cecill-c)))
2956 (define-public mumps-metis
2957 (package (inherit mumps)
2958 (name "mumps-metis")
2960 (alist-delete "scotch" (package-inputs mumps)))))
2962 (define-public mumps-openmpi
2963 (package (inherit mumps)
2964 (name "mumps-openmpi")
2967 ("scalapack" ,scalapack)
2968 ("pt-scotch" ,pt-scotch)
2969 ,@(alist-delete "scotch" (package-inputs mumps))))
2971 (substitute-keyword-arguments (package-arguments mumps)
2973 `(modify-phases ,phases
2974 (add-before 'check 'mpi-setup
2978 ((assoc-ref ,phases 'check)
2979 #:exec-prefix '("mpirun" "-n" "2"))))))))
2980 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2982 (define-public mumps-metis-openmpi
2983 (package (inherit mumps-openmpi)
2984 (name "mumps-metis-openmpi")
2986 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2988 (define-public ruby-asciimath
2990 (name "ruby-asciimath")
2995 (uri (rubygems-uri "asciimath" version))
2998 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2999 (build-system ruby-build-system)
3001 `(("ruby-nokogiri" ,ruby-nokogiri)
3002 ("ruby-rspec" ,ruby-rspec)))
3003 (synopsis "AsciiMath parsing and conversion library")
3005 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3006 easy-to-write markup language for mathematics.")
3007 (home-page "https://github.com/asciidoctor/asciimath")
3008 (license license:expat)))
3010 (define-public superlu
3017 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3018 "superlu_" version ".tar.gz"))
3020 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3021 (modules '((guix build utils)))
3023 ;; Replace the non-free implementation of MC64 with a stub adapted
3026 (use-modules (ice-9 regex)
3028 (call-with-output-file "SRC/mc64ad.c"
3033 void mc64id_(int *a) {
3034 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3037 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3038 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3039 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3042 ;; Remove the corresponding license verbiage. MC64 license follows
3043 ;; a "------" line separator.
3044 (with-atomic-file-replacement "License.txt"
3045 (let ((rx (make-regexp "-{8}")))
3048 (let ((line (read-line in 'concat)))
3049 (unless (regexp-exec rx line)
3053 (build-system cmake-build-system)
3057 `(("blas" ,openblas)
3058 ("gfortran" ,gfortran)))
3060 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3061 "-DTPL_BLAS_LIBRARIES=openblas"
3062 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3063 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3064 (synopsis "Supernodal direct solver for sparse linear systems")
3066 "SuperLU is a general purpose library for the direct solution of large,
3067 sparse, nonsymmetric systems of linear equations on high performance machines.
3068 The library is written in C and is callable from either C or Fortran. The
3069 library routines perform an LU decomposition with partial pivoting and
3070 triangular system solves through forward and back substitution. The library
3071 also provides threshold-based ILU factorization preconditioners.")
3072 (license (list license:bsd-3
3073 license:gpl2+ ;EXAMPLE/*fgmr.c
3074 (license:fsf-free "file://SRC/colamd.h")))))
3076 (define-public superlu-dist
3078 (name "superlu-dist")
3084 (url "https://github.com/xiaoyeli/superlu_dist")
3085 (commit (string-append "v" version))))
3086 (file-name (git-file-name name version))
3088 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3089 (modules '((guix build utils)))
3091 ;; Replace the non-free implementation of MC64 with a stub
3093 (make-file-writable "SRC/mc64ad_dist.c")
3094 (call-with-output-file "SRC/mc64ad_dist.c"
3099 void mc64id_dist(int *a) {
3100 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3103 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3104 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3105 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3108 (substitute* "SRC/util.c" ;adjust default algorithm
3109 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3110 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3111 ;; general (i.e. non-square) processor-grid support.
3112 "RowPerm = NOROWPERM;"))
3114 (patches (search-patches "superlu-dist-scotchmetis.patch"
3115 "superlu-dist-awpm-grid.patch"))))
3116 (build-system cmake-build-system)
3120 `(("gfortran" ,gfortran)
3123 ("combblas" ,combinatorial-blas)))
3125 `(("mpi" ,openmpi) ;headers include MPI heades
3126 ("parmetis" ,pt-scotch32 "metis")
3127 ("pt-scotch" ,pt-scotch32)))
3129 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3130 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3131 "-DTPL_ENABLE_COMBBLASLIB=YES"
3132 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3133 "-DTPL_LAPACK_LIBRARIES=-llapack"
3134 (string-append "-DTPL_PARMETIS_LIBRARIES="
3136 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3137 "scotchmetis" "scotch" "scotcherr")
3139 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3140 (assoc-ref %build-inputs "parmetis")
3142 "-DTPL_ENABLE_COMBBLASLIB=ON"
3143 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3144 (assoc-ref %build-inputs "combblas")
3145 "/include/CombBLAS;"
3146 (assoc-ref %build-inputs "combblas")
3147 "/include/BipartiteMatchings")
3148 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3150 (modify-phases %standard-phases
3151 (add-before 'configure 'set-c++-standard
3153 (substitute* "CMakeLists.txt"
3154 ;; AWPM headers require C++14
3155 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3156 (add-before 'check 'mpi-setup
3158 (add-before 'check 'omp-setup
3159 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3160 (home-page (package-home-page superlu))
3161 (synopsis "Parallel supernodal direct solver")
3163 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3164 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3165 implemented in ANSI C, and MPI for communications.")
3166 (license license:bsd-3)))
3168 (define-public scotch
3175 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3176 "latestfile/298/scotch_" version ".tar.gz"))
3178 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3179 (patches (search-patches "scotch-build-parallelism.patch"
3180 "scotch-integer-declarations.patch"))))
3181 (build-system gnu-build-system)
3187 ("gfortran" ,gfortran)))
3188 (outputs '("out" "metis"))
3190 `(#:make-flags (list (string-append "prefix=" %output))
3192 (modify-phases %standard-phases
3194 'unpack 'chdir-to-src
3195 (lambda _ (chdir "src") #t))
3199 (call-with-output-file "Makefile.inc"
3214 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3215 LDFLAGS = -lz -lm -lrt -lpthread
3217 LEX = flex -Pscotchyy -olex.yy.c
3222 YACC = bison -pscotchyy -y -b y
3224 '("COMMON_FILE_COMPRESS_GZ"
3226 "COMMON_RANDOM_FIXED_SEED"
3227 "INTSIZE64" ;use 'int64_t'
3228 ;; Prevents symbol clashes with libesmumps
3230 ;; XXX: Causes invalid frees in superlu-dist tests
3232 ;; "SCOTCH_PTHREAD_NUMBER=2"
3233 "restrict=__restrict"))))
3235 (add-after 'build 'build-esmumps
3238 (format #f "-j~a" (parallel-job-count))
3240 (add-before 'install 'make-install-dirs
3241 (lambda* (#:key outputs #:allow-other-keys)
3242 (mkdir (assoc-ref outputs "out"))))
3243 (add-after 'install 'install-metis
3244 (lambda* (#:key outputs #:allow-other-keys)
3245 (let ((out (assoc-ref outputs "metis")))
3247 ;; metis files are not installed with 'make install'
3248 (for-each (lambda (f)
3249 (install-file f (string-append out "/include")))
3250 (find-files "../include/" ".*metis\\.h"))
3251 (for-each (lambda (f)
3252 (install-file f (string-append out "/lib")))
3253 (find-files "../lib/" ".*metis\\..*"))
3255 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3257 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3258 (synopsis "Programs and libraries for graph algorithms")
3259 (description "SCOTCH is a set of programs and libraries which implement
3260 the static mapping and sparse matrix reordering algorithms developed within
3261 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3262 conquer approach, to scientific computing problems such as graph and mesh
3263 partitioning, static mapping, and sparse matrix ordering, in application
3264 domains ranging from structural mechanics to operating systems or
3266 ;; See LICENSE_en.txt
3267 (license license:cecill-c)))
3269 (define-public scotch32
3270 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3271 ;; some applications.
3272 (package (inherit scotch)
3275 (substitute-keyword-arguments (package-arguments scotch)
3276 ((#:phases scotch-phases)
3277 `(modify-phases ,scotch-phases
3281 (call-with-output-file "Makefile.inc"
3296 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3297 LDFLAGS = -lz -lm -lrt -lpthread
3299 LEX = flex -Pscotchyy -olex.yy.c
3304 YACC = bison -pscotchyy -y -b y
3306 '("COMMON_FILE_COMPRESS_GZ"
3308 "COMMON_RANDOM_FIXED_SEED"
3309 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3310 ;; Prevents symbolc clashes with libesmumps
3312 ;; XXX: Causes invalid frees in superlu-dist tests
3314 ;; "SCOTCH_PTHREAD_NUMBER=2"
3315 "restrict=__restrict"))))))))))
3317 "Programs and libraries for graph algorithms (32-bit integers)")))
3319 (define-public scotch-shared
3320 (package (inherit scotch)
3321 (name "scotch-shared")
3327 (substitute-keyword-arguments (package-arguments scotch)
3328 ((#:phases scotch-shared-phases)
3329 `(modify-phases ,scotch-shared-phases
3333 ;; Otherwise, the RUNPATH will lack the final path component.
3334 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3335 (assoc-ref %outputs "out") "/lib"))
3336 (call-with-output-file "Makefile.inc"
3344 ARFLAGS = -shared -o
3351 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3352 CLIBFLAGS = -shared -fPIC
3353 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3355 LEX = flex -Pscotchyy -olex.yy.c
3360 YACC = bison -pscotchyy -y -b y
3362 '("COMMON_FILE_COMPRESS_GZ"
3364 "COMMON_RANDOM_FIXED_SEED"
3365 "INTSIZE64" ;use 'int64_t'
3366 ;; Prevents symbolc clashes with libesmumps
3368 ;; XXX: Causes invalid frees in superlu-dist tests
3370 ;; "SCOTCH_PTHREAD_NUMBER=2"
3371 "restrict=__restrict"
3375 "Programs and libraries for graph algorithms (shared libraries version)")))
3377 (define-public pt-scotch
3378 (package (inherit scotch)
3381 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3383 (substitute-keyword-arguments (package-arguments scotch)
3384 ((#:phases scotch-phases)
3385 `(modify-phases ,scotch-phases
3389 (invoke "make" (format #f "-j~a" (parallel-job-count))
3390 "ptscotch" "ptesmumps")
3392 ;; Install the serial metis compatibility library
3393 (invoke "make" "-C" "libscotchmetis" "install")))
3394 (add-before 'check 'mpi-setup
3398 (invoke "make" "ptcheck")))))))
3399 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3401 (define-public pt-scotch32
3402 (package (inherit scotch32)
3403 (name "pt-scotch32")
3405 `(("openmpi" ,openmpi))) ;headers include MPI headers
3407 (substitute-keyword-arguments (package-arguments scotch32)
3408 ((#:phases scotch32-phases)
3409 `(modify-phases ,scotch32-phases
3412 (invoke "make" (format #f "-j~a" (parallel-job-count))
3413 "ptscotch" "ptesmumps")
3414 ;; Install the serial metis compatibility library
3415 (invoke "make" "-C" "libscotchmetis" "install")))
3416 (add-before 'check 'mpi-setup
3420 (invoke "make" "ptcheck")))))))
3422 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3424 (define-public pt-scotch-shared
3425 (package (inherit scotch-shared)
3426 (name "pt-scotch-shared")
3428 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3430 (substitute-keyword-arguments (package-arguments scotch-shared)
3431 ((#:phases scotch-shared-phases)
3432 `(modify-phases ,scotch-shared-phases
3436 (invoke "make" (format #f "-j~a" (parallel-job-count))
3437 "ptscotch" "ptesmumps")
3439 ;; Install the serial metis compatibility library
3440 (invoke "make" "-C" "libscotchmetis" "install")))
3441 (add-before 'check 'mpi-setup
3442 ,%openmpi-setup)))))
3443 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3446 (define-public metis
3453 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3454 "metis-" version ".tar.gz"))
3457 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3459 `((release-monitoring-url
3460 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3461 (build-system cmake-build-system)
3463 `(("blas" ,openblas)))
3465 `(#:tests? #f ;no tests
3466 #:configure-flags `("-DSHARED=ON"
3467 ,(string-append "-DGKLIB_PATH=" (getcwd)
3468 "/metis-" ,version "/GKlib"))))
3469 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3470 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3472 "METIS is a set of serial programs for partitioning graphs, partitioning
3473 finite element meshes, and producing fill-reducing orderings for sparse
3474 matrices. The algorithms implemented in METIS are based on the multilevel
3475 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3477 (license license:asl2.0))) ;As of version 5.0.3
3479 (define-public p4est
3486 (uri (string-append "http://p4est.github.io/release/p4est-"
3490 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3491 (build-system gnu-build-system)
3493 `(("fortran" ,gfortran)
3498 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3499 (assoc-ref %build-inputs "blas")
3501 ,(string-append "LAPACK_LIBS=-L"
3502 (assoc-ref %build-inputs "lapack")
3504 #:phases (modify-phases %standard-phases
3505 (add-before 'check 'mpi-setup
3507 (home-page "http://www.p4est.org")
3508 (synopsis "Adaptive mesh refinement on forests of octrees")
3510 "The p4est software library enables the dynamic management of a
3511 collection of adaptive octrees, conveniently called a forest of octrees.
3512 p4est is designed to work in parallel and scales to hundreds of thousands of
3514 (license license:gpl2+)))
3516 (define-public p4est-openmpi
3517 (package (inherit p4est)
3518 (name "p4est-openmpi")
3521 ,@(package-inputs p4est)))
3523 (substitute-keyword-arguments (package-arguments p4est)
3524 ((#:configure-flags cf)
3525 ``("--enable-mpi" ,@,cf))))
3526 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3528 (define-public gsegrafix
3535 (uri (string-append "mirror://gnu/" name "/" name "-"
3539 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3540 (build-system gnu-build-system)
3542 `(#:configure-flags '("LDFLAGS=-lm")))
3544 `(("libgnomecanvas" ,libgnomecanvas)
3545 ("libbonoboui" ,libbonoboui)
3546 ("libgnomeui" ,libgnomeui)
3547 ("libgnomeprintui" ,libgnomeprintui)
3550 `(("pkg-config" ,pkg-config)))
3551 (home-page "https://www.gnu.org/software/gsegrafix/")
3552 (synopsis "GNOME application to create scientific and engineering plots")
3553 (description "GSEGrafix is an application which produces high-quality graphical
3554 plots for science and engineering. Plots are specified via simple ASCII
3555 parameter files and data files and are presented in an anti-aliased GNOME
3556 canvas. The program supports rectangular two-dimensional plots, histograms,
3557 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3558 to BMP, JPEG or PNG image formats.")
3559 (license license:gpl3+)))
3561 (define-public maxima
3568 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3569 version "-source/" name "-" version ".tar.gz"))
3572 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
3573 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3574 (build-system gnu-build-system)
3577 ("gnuplot" ,gnuplot) ;for plots
3579 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3581 `(("texinfo" ,texinfo)
3583 ("python" ,python)))
3586 (list "--enable-gcl"
3587 (string-append "--with-posix-shell="
3588 (assoc-ref %build-inputs "bash")
3590 (string-append "--with-wish="
3591 (assoc-ref %build-inputs "tk")
3593 (let ((v ,(package-version tk)))
3594 (string-take v (string-index-right v #\.)))))
3595 ;; By default Maxima attempts to write temporary files to
3596 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3597 ;; Work around that.
3598 #:make-flags (list "TMPDIR=/tmp")
3600 (modify-phases %standard-phases
3601 (add-after 'unpack 'patch-paths
3602 (lambda* (#:key inputs #:allow-other-keys)
3603 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3604 (coreutils (assoc-ref inputs "coreutils"))
3605 (dirname (string-append coreutils "/bin/dirname"))
3606 (head (string-append coreutils "/bin/head"))
3607 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3608 (python (string-append (assoc-ref inputs "python")
3610 (substitute* "src/maxima.in"
3611 (("sed ") (string-append sed " "))
3612 (("dirname") dirname)
3614 (substitute* "doc/info/Makefile.in"
3615 (("/usr/bin/env perl") perl))
3616 (substitute* "doc/info/build_html.sh.in"
3617 (("python") python))
3619 (add-before 'check 'pre-check
3621 (chmod "src/maxima" #o555)
3625 ;; This is derived from the testing code in the "debian/rules" file
3626 ;; of Debian's Maxima package.
3627 ;; If Maxima can successfully run this, the binary to be installed
3633 "--batch-string=\"run_testsuite();\" "
3634 "| grep -q \"No unexpected errors found\""))))
3635 ;; Make sure the doc and emacs files are found in the
3636 ;; standard location. Also configure maxima to find gnuplot
3637 ;; without having it on the PATH.
3638 (add-after 'install 'post-install
3639 (lambda* (#:key outputs inputs #:allow-other-keys)
3640 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3641 (out (assoc-ref outputs "out"))
3642 (datadir (string-append out "/share/maxima/" ,version))
3643 (binutils (string-append (assoc-ref inputs "binutils")
3645 (with-directory-excursion out
3646 (mkdir-p "share/emacs")
3647 (mkdir-p "share/doc")
3649 (string-append datadir "/doc/")
3650 (string-append out "/share/doc/maxima"))
3651 (with-atomic-file-replacement
3652 (string-append datadir "/share/maxima-init.lisp")
3654 (format out "~a ~s~a~%"
3655 "(setf $gnuplot_command "
3656 (string-append gnuplot "/bin/gnuplot") ")")
3657 (dump-port in out))))
3658 ;; Ensure that Maxima will have access to the GNU binutils
3659 ;; components at runtime.
3660 (wrap-program (string-append out "/bin/maxima")
3661 `("PATH" prefix (,binutils))))
3663 (home-page "https://maxima.sourceforge.io")
3664 (synopsis "Numeric and symbolic expression manipulation")
3665 (description "Maxima is a system for the manipulation of symbolic and
3666 numerical expressions. It yields high precision numeric results by using
3667 exact fractions, arbitrary precision integers, and variable precision floating
3669 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3670 ;; Others simply say "GNU General Public License" without stating a
3671 ;; version (which implicitly means gpl1+).
3672 ;; At least one file (src/maxima.asd) says "version 2."
3673 ;; GPLv2 only is therefore the smallest subset.
3674 (license license:gpl2)))
3676 (define-public wxmaxima
3684 (url "https://github.com/wxMaxima-developers/wxmaxima")
3685 (commit (string-append "Version-" version))))
3686 (file-name (git-file-name name version))
3688 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
3689 (build-system cmake-build-system)
3691 `(("gettext" ,gettext-minimal)))
3693 `(("wxwidgets" ,wxwidgets)
3696 ("adwaita-icon-theme" ,adwaita-icon-theme)
3698 ("shared-mime-info" ,shared-mime-info)))
3700 `(#:tests? #f ; tests fail non-deterministically
3702 (modify-phases %standard-phases
3703 (add-after 'unpack 'patch-doc-path
3705 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3706 ;; documentation. Only licensing information is placed there by
3708 (substitute* "src/Dirstructure.cpp"
3709 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3711 (add-after 'install 'wrap-program
3712 (lambda* (#:key inputs outputs #:allow-other-keys)
3713 (wrap-program (string-append (assoc-ref outputs "out")
3716 (,(string-append (assoc-ref inputs "maxima")
3718 ;; For GtkFileChooserDialog.
3719 `("GSETTINGS_SCHEMA_DIR" =
3720 (,(string-append (assoc-ref inputs "gtk+")
3721 "/share/glib-2.0/schemas")))
3722 `("XDG_DATA_DIRS" ":" prefix
3723 (;; Needed by gdk-pixbuf to know supported icon formats.
3725 (assoc-ref inputs "shared-mime-info") "/share")
3726 ;; The default icon theme of GTK+.
3728 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3730 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3731 (synopsis "Graphical user interface for the Maxima computer algebra system")
3733 "wxMaxima is a graphical user interface for the Maxima computer algebra
3734 system. It eases the use of Maxima by making most of its commands available
3735 through a menu system and by providing input dialogs for commands that require
3736 more than one argument. It also implements its own display engine that
3737 outputs mathematical symbols directly instead of depicting them with ASCII
3740 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3741 text and mathematical calculations to create documents, exporting of input and
3742 output to TeX, and a browser for Maxima's manual including command index and
3743 full text searching.")
3744 (license license:gpl2+)))
3746 (define-public armadillo
3752 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3756 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3757 (build-system cmake-build-system)
3758 (arguments `(#:tests? #f)) ; no test target
3760 `(("openblas" ,openblas)
3762 ("arpack" ,arpack-ng)))
3763 (home-page "http://arma.sourceforge.net/")
3764 (synopsis "C++ linear algebra library")
3766 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3767 between speed and ease of use. It is useful for algorithm development
3768 directly in C++, or quick conversion of research code into production
3769 environments. It can be used for machine learning, pattern recognition,
3770 signal processing, bioinformatics, statistics, econometrics, etc. The library
3771 provides efficient classes for vectors, matrices and cubes, as well as 150+
3772 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3773 (license license:asl2.0)))
3775 (define-public muparser
3776 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3777 ;; different hash. In order to make `guix package --upgrade` work correctly,
3778 ;; we set a Guix packaging revision.
3779 ;; When the next version of muparser is released, we can remove
3780 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3781 (let ((upstream-version "2.2.5")
3785 (version (string-append upstream-version "-" revision))
3790 (url "https://github.com/beltoforion/muparser")
3791 (commit (string-append "v" upstream-version))))
3792 (file-name (git-file-name name version))
3794 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3795 (build-system gnu-build-system)
3797 `(#:configure-flags '("--enable-samples=no")
3798 #:tests? #f)) ;no "check" target
3799 (home-page "http://muparser.beltoforion.de/")
3800 (synopsis "Fast parser library for mathematical expressions")
3802 "muParser is an extensible high performance math parser library. It is
3803 based on transforming an expression into a bytecode and precalculating constant
3805 (license license:expat))))
3807 (define-public openblas
3814 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3815 version "%20version.tar.gz"))
3816 (file-name (string-append name "-" version ".tar.gz"))
3819 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3820 (build-system gnu-build-system)
3822 `(#:test-target "test"
3823 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3824 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3825 ;; we need to disable substitutions.
3827 ,(let ((system (or (%current-target-system) (%current-system))))
3828 (or (string-prefix? "x86_64" system)
3829 (string-prefix? "i686" system)
3830 (string-prefix? "mips" system)
3831 (string-prefix? "aarch64" system)))
3833 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3835 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3837 ;; This is the maximum number of threads OpenBLAS will ever use (that
3838 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3839 ;; is used.) If we don't set it, the makefile sets it to the number
3840 ;; of cores of the build machine, which is obviously wrong.
3843 ;; Build the library for all supported CPUs. This allows
3844 ;; switching CPU targets at runtime with the environment variable
3845 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3846 ;; Unfortunately, this is not supported on all architectures,
3847 ;; where it leads to failed builds.
3848 ,@(let ((system (or (%current-target-system) (%current-system))))
3850 ((or (string-prefix? "x86_64" system)
3851 (string-prefix? "i686" system))
3852 '("DYNAMIC_ARCH=1"))
3853 ;; On some of these architectures the CPU can't be detected.
3854 ((string-prefix? "powerpc64le" system)
3857 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3858 ;; two available MIPS targets special extended instructions
3859 ;; for Loongson cores are used.
3860 ((string-prefix? "mips" system)
3861 '("TARGET=SICORTEX"))
3862 ;; On aarch64 force the generic 'armv8-a' target
3863 ((string-prefix? "aarch64" system)
3865 ;; Failed to detect CPU.
3866 ((string-prefix? "armhf" system)
3869 ;; no configure script
3871 (modify-phases %standard-phases
3873 (add-before 'build 'set-extralib
3874 (lambda* (#:key inputs #:allow-other-keys)
3875 ;; Get libgfortran found when building in utest.
3877 (string-append "-L" (assoc-ref inputs "fortran-lib")
3881 `(("fortran-lib" ,gfortran "lib")))
3884 ("fortran" ,gfortran)
3886 (home-page "https://www.openblas.net/")
3887 (synopsis "Optimized BLAS library based on GotoBLAS")
3889 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3890 (license license:bsd-3)))
3892 (define-public openblas-ilp64
3893 (package/inherit openblas
3894 (name "openblas-ilp64")
3895 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3897 (substitute-keyword-arguments (package-arguments openblas)
3898 ((#:make-flags flags '())
3899 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3901 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3902 (license license:bsd-3)))
3908 (home-page "https://github.com/flame/blis")
3911 (uri (git-reference (url home-page) (commit version)))
3914 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
3915 (file-name (git-file-name "blis" version))))
3917 `(("python" ,python)
3919 (build-system gnu-build-system)
3922 ((guix build gnu-build-system)
3925 #:test-target "test"
3927 (modify-phases %standard-phases
3929 (lambda* (#:key outputs
3932 (configure-flags '())
3934 ;; This is a home-made 'configure' script.
3935 (let* ((out (assoc-ref outputs "out"))
3936 ;; Guix-specific support for choosing the configuration
3937 ;; via #:configure-flags: see below for details.
3938 (config-flag-prefix "--blis-config=")
3939 (maybe-config-flag (find
3941 (string-prefix? config-flag-prefix s))
3943 (configure-flags (if maybe-config-flag
3944 (delete maybe-config-flag
3947 ;; Select the "configuration" to build.
3948 ;; The "generic" configuration is non-optimized but
3949 ;; portable (no assembly).
3950 ;; The "x86_64" configuration family includes
3951 ;; sub-configurations for all supported
3952 ;; x86_64 microarchitectures.
3953 ;; BLIS currently lacks runtime hardware detection
3954 ;; for other architectures: see
3955 ;; <https://github.com/flame/blis/commit/c534da6>.
3956 ;; Conservatively, we stick to "generic" on armhf,
3957 ;; aarch64, and ppc64le for now. (But perhaps
3958 ;; "power9", "cortexa9", and "cortexa57" might be
3959 ;; general enough to use?)
3960 ;; Another approach would be to use the "auto"
3961 ;; configuration and make this package
3962 ;; non-substitutable.
3963 ;; The build is fairly intensive, though.
3967 (substring maybe-config-flag
3968 (string-length config-flag-prefix)))
3969 ((string-prefix? "x86_64" (or target system))
3978 "--enable-threading=openmp"
3979 "--enable-verbose-make"
3982 (format #t "configure args: ~s~%" configure-args)
3987 (add-before 'check 'show-test-output
3989 ;; By default "make check" is silent. Make it verbose.
3990 (system "tail -F output.testsuite &")
3992 (synopsis "High-performance basic linear algebra (BLAS) routines")
3994 "BLIS is a portable software framework for instantiating high-performance
3995 BLAS-like dense linear algebra libraries. The framework was designed to
3996 isolate essential kernels of computation that, when optimized, immediately
3997 enable optimized implementations of most of its commonly used and
3998 computationally intensive operations. While BLIS exports a new BLAS-like API,
3999 it also includes a BLAS compatibility layer which gives application developers
4000 access to BLIS implementations via traditional BLAS routine calls.")
4001 (license license:bsd-3)))
4003 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4004 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4005 (define-public blis-knl (deprecated-package "blis-knl" blis))
4007 (define ignorance blis)
4009 (define-public openlibm
4017 (url "https://github.com/JuliaLang/openlibm")
4018 (commit (string-append "v" version))))
4019 (file-name (git-file-name name version))
4021 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
4022 (build-system gnu-build-system)
4025 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4027 ;; no configure script
4028 (modify-phases %standard-phases (delete 'configure))
4029 #:tests? #f)) ;the tests are part of the default target
4030 (home-page "https://openlibm.org/")
4031 (synopsis "Portable C mathematical library (libm)")
4033 "OpenLibm is an effort to have a high quality, portable, standalone C
4034 mathematical library (libm). It can be used standalone in applications and
4035 programming language implementations. The project was born out of a need to
4036 have a good libm for the Julia programming language that worked consistently
4037 across compilers and operating systems, and in 32-bit and 64-bit
4039 ;; Each architecture has its own make target, and there is none for mips.
4040 (supported-systems (delete "mips64el-linux" %supported-systems))
4041 ;; See LICENSE.md for details.
4042 (license (list license:expat
4045 license:public-domain
4046 license:lgpl2.1+))))
4048 (define-public openspecfun
4050 (name "openspecfun")
4056 (url "https://github.com/JuliaLang/openspecfun")
4057 (commit (string-append "v" version))))
4058 (file-name (git-file-name name version))
4060 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4061 (build-system gnu-build-system)
4063 '(#:tests? #f ; no "check" target
4065 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4067 (modify-phases %standard-phases
4068 (delete 'configure)))) ; no configure script
4070 `(("fortran" ,gfortran)))
4071 (home-page "https://github.com/JuliaLang/openspecfun")
4072 (synopsis "Collection of special mathematical functions")
4074 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4075 portable package for Bessel Functions of a Complex Argument and Nonnegative
4076 Order; it contains subroutines for computing Bessel functions and Airy
4077 functions. Faddeeva allows computing the various error functions of arbitrary
4078 complex arguments (Faddeeva function, error function, complementary error
4079 function, scaled complementary error function, imaginary error function, and
4080 Dawson function); given these, one can also easily compute Voigt functions,
4081 Fresnel integrals, and similar related functions as well.")
4082 ;; Faddeeva is released under the Expat license; AMOS is included as
4083 ;; public domain software.
4084 (license (list license:expat license:public-domain))))
4086 (define-public suitesparse
4088 (name "suitesparse")
4094 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4095 (commit (string-append "v" version))))
4096 (file-name (git-file-name name version))
4099 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4100 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4101 (modules '((guix build utils)))
4103 ;; Remove bundled metis source
4105 (delete-file-recursively "metis-5.1.0")
4107 (build-system gnu-build-system)
4109 `(#:tests? #f ;no "check" target
4111 (list (string-append "CC=" ,(cc-for-target))
4113 "MY_METIS_LIB=-lmetis"
4115 ;; The default is to link against netlib lapack. Use OpenBLAS
4117 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4119 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4120 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4121 (assoc-ref %outputs "out")
4122 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4123 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4124 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4125 " -DCMAKE_SKIP_RPATH=TRUE"
4126 " -DCMAKE_BUILD_TYPE=Release"
4127 " -DCMAKE_INSTALL_LIBDIR=lib")
4128 (string-append "INSTALL_LIB="
4129 (assoc-ref %outputs "out") "/lib")
4130 (string-append "INSTALL_INCLUDE="
4131 (assoc-ref %outputs "out") "/include")
4134 (modify-phases %standard-phases
4135 (delete 'configure)))) ;no configure script
4138 ("openblas" ,openblas)
4143 `(("cmake" ,cmake-minimal)
4145 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4146 (synopsis "Suite of sparse matrix software")
4148 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4149 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4150 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4151 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4152 CXSparse, a concise sparse Cholesky factorization package; and many other
4155 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4157 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4158 (license (list license:gpl2+ license:lgpl2.1+))))
4160 (define-public atlas
4166 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4167 version "/atlas" version ".tar.bz2"))
4170 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4171 (build-system gnu-build-system)
4172 (home-page "http://math-atlas.sourceforge.net/")
4173 (inputs `(("gfortran" ,gfortran)
4174 ("lapack-tar" ,(package-source lapack))))
4175 (outputs '("out" "doc"))
4176 ;; For the moment we drop support for MIPS at it fails to compile. See
4177 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4178 (supported-systems (delete "mips64el-linux" %supported-systems))
4180 `(#:parallel-build? #f
4181 #:parallel-tests? #f
4183 ;; ATLAS tunes itself for the machine it is built on, as explained at
4184 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4185 ;; For this reason, we want users to build it locally instead of using
4189 #:modules ((srfi srfi-26)
4190 (guix build gnu-build-system)
4193 `(;; Generate position independent code suitable for dynamic libraries
4194 ;; and use WALL timer to get more accurate timing.
4195 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4198 ,,(if (string-match "64" (%current-system))
4201 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4202 ;; needed to compile C files before it is generated.
4203 "-Ss" "pmake" "make -j 1"
4204 ;; Probe is failing for MIPS. We therefore define the system
4205 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4206 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4207 ,,@(if (string-prefix? "mips" (%current-system))
4208 (list "-A" "49" "-V" "1")
4210 ;; Generate shared libraries.
4212 ;; Build a full LAPACK library.
4213 ,(string-append "--with-netlib-lapack-tarfile="
4214 (assoc-ref %build-inputs "lapack-tar")))
4216 (modify-phases %standard-phases
4217 (add-after 'install 'install-doc
4218 (lambda* (#:key outputs inputs #:allow-other-keys)
4219 (let ((doc (string-append (assoc-ref outputs "doc")
4220 "/share/doc/atlas")))
4222 (for-each (cut install-file <> doc)
4223 (find-files "../ATLAS/doc" ".*"))
4225 (add-after 'check 'check-pt
4226 (lambda _ (invoke "make" "ptcheck")))
4227 ;; Fix files required to run configure.
4228 (add-before 'configure 'fix-/bin/sh
4230 ;; Use `sh', not `/bin/sh'.
4231 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4235 ;; Fix /bin/sh in generated make files.
4236 (add-after 'configure 'fix-/bin/sh-in-generated-files
4238 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4242 ;; ATLAS configure program does not accepts the default flags
4243 ;; passed by the 'gnu-build-system'.
4245 (lambda* (#:key native-inputs inputs outputs
4246 (configure-flags '())
4247 #:allow-other-keys #:rest args)
4248 (let* ((prefix (assoc-ref outputs "out"))
4249 (bash (or (and=> (assoc-ref
4250 (or native-inputs inputs) "bash")
4251 (cut string-append <> "/bin/bash"))
4253 (flags `(,(string-append "--prefix=" prefix)
4255 (abs-srcdir (getcwd))
4256 (srcdir (string-append "../" (basename abs-srcdir))))
4257 (format #t "source directory: ~s (relative from build: ~s)~%"
4261 (format #t "build directory: ~s~%" (getcwd))
4262 (format #t "configure flags: ~s~%" flags)
4264 (string-append srcdir "/configure")
4266 (synopsis "Automatically Tuned Linear Algebra Software")
4268 "ATLAS is an automatically tuned linear algebra software library
4269 providing C and Fortran77 interfaces to a portably efficient BLAS
4270 implementation, as well as a few routines from LAPACK.
4272 Optimization occurs at build time. For this reason, the library is built on
4273 the machine where it is installed, without resorting to pre-built substitutes.
4275 Before building the library, CPU throttling should be disabled. This can be
4276 done in the BIOS, or, on GNU/Linux, with the following command:
4279 # cpupower --governor performance
4282 Failure to do so will result in a library with poor performance.")
4283 ;; The test suite is notoriously lengthy and routinely exceeds the default
4284 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4285 (properties '((timeout . 86400))) ; 1 day
4286 (license license:bsd-3)))
4296 (url "https://github.com/recp/cglm")
4297 (commit (string-append "v" version))))
4298 (file-name (git-file-name name version))
4300 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4301 (build-system cmake-build-system)
4304 (list "-DCGLM_USE_TEST=ON")))
4305 (home-page "https://github.com/recp/cglm")
4306 (synopsis "Mathematics C library for graphics programming")
4308 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4309 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4312 It's similar to the original C++ GLM library but written in C99 and compatible
4314 (license license:expat)))
4323 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4324 version "/glm-" version ".zip"))
4326 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4327 (build-system cmake-build-system)
4329 `(#:phases (modify-phases %standard-phases
4331 (lambda* (#:key outputs #:allow-other-keys)
4332 ;; Since version 0.9.9.6, 'make install' is not supported
4333 ;; and we have to do it "manually". Upstream discussion:
4334 ;; <https://github.com/g-truc/glm/pull/968>.
4335 (let* ((source (string-append "../glm"))
4336 (out (assoc-ref outputs "out"))
4337 (inc (string-append out "/include"))
4338 (lib (string-append out "/lib"))
4339 (pkgconfig (string-append lib "/pkgconfig")))
4340 (with-directory-excursion source
4343 (copy-recursively "glm" (string-append inc "/glm"))
4344 (copy-recursively "cmake" (string-append lib "/cmake"))
4345 (call-with-output-file (string-append pkgconfig "/glm.pc")
4349 includedir=${prefix}/include
4352 Description: OpenGL Mathematics
4354 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4357 `(("unzip" ,unzip)))
4358 (home-page "https://glm.g-truc.net/")
4359 (synopsis "OpenGL Mathematics library")
4360 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4361 library for graphics software based on the OpenGL Shading Language (GLSL)
4363 (license license:expat)))
4365 (define-public lpsolve
4372 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4373 "/lp_solve_" version "_source.tar.gz"))
4376 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4377 (modules '((guix build utils)))
4380 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4382 ;; Pretend to be on a 64 bit platform to obtain a common directory
4383 ;; name for the build results on all architectures; nothing else
4384 ;; seems to depend on it.
4385 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4387 ;; The check for 'isnan' as it is written fails with
4388 ;; "non-floating-point argument in call to function
4389 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4390 ;; definition, which in turn leads to bad things. Fix the feature
4392 (("isnan\\(0\\)") "isnan(0.)"))
4394 (build-system gnu-build-system)
4396 `(#:tests? #f ; no check target
4398 (modify-phases %standard-phases
4399 (delete 'configure) ; no configure script
4402 (with-directory-excursion "lpsolve55"
4403 (invoke "bash" "ccc"))
4404 (with-directory-excursion "lp_solve"
4405 (invoke "bash" "ccc"))
4408 (lambda* (#:key outputs #:allow-other-keys)
4409 (let* ((out (assoc-ref outputs "out"))
4410 (bin (string-append out "/bin"))
4411 (lib (string-append out "/lib"))
4412 ;; This is where LibreOffice expects to find the header
4413 ;; files, and where they are installed by Debian.
4414 (include (string-append out "/include/lpsolve")))
4415 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4416 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4417 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4419 ;; Install a subset of the header files as on Debian
4420 ;; (plus lp_bit.h, which matches the regular expression).
4421 (for-each (lambda (name)
4422 (install-file name include))
4423 (find-files "." "lp_[HMSa-z].*\\.h$"))
4424 (with-directory-excursion "shared"
4425 (for-each (lambda (name)
4426 (install-file name include))
4427 (find-files "." "\\.h$")))
4429 (home-page "http://lpsolve.sourceforge.net/")
4430 (synopsis "Mixed integer linear programming (MILP) solver")
4432 "lp_solve is a mixed integer linear programming solver based on the
4433 revised simplex and the branch-and-bound methods.")
4434 (license license:lgpl2.1+)))
4436 (define-public dealii
4443 (uri (string-append "https://github.com/dealii/dealii/releases/"
4444 "download/v" version "/dealii-" version ".tar.gz"))
4447 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4448 (modules '((guix build utils)))
4450 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4452 (delete-file-recursively "bundled")
4454 (build-system cmake-build-system)
4462 ("arpack" ,arpack-ng)
4463 ("muparser" ,muparser)
4464 ("gfortran" ,gfortran)
4465 ("suitesparse" ,suitesparse))) ;for UMFPACK
4467 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4469 ;; Work around a bug in libsuitesparseconfig linking
4470 ;; see https://github.com/dealii/dealii/issues/4745
4471 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4472 (home-page "https://www.dealii.org")
4473 (synopsis "Finite element library")
4475 "Deal.II is a C++ program library targeted at the computational solution
4476 of partial differential equations using adaptive finite elements. The main
4477 aim of deal.II is to enable rapid development of modern finite element codes,
4478 using among other aspects adaptive meshes and a wide array of tools often used
4479 in finite element programs.")
4480 (license license:lgpl2.1+)))
4482 (define-public dealii-openmpi
4483 (package (inherit dealii)
4484 (name "dealii-openmpi")
4487 ;;Supported only with MPI:
4488 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4489 ("p4est" ,p4est-openmpi)
4490 ("petsc" ,petsc-openmpi)
4491 ("slepc" ,slepc-openmpi)
4492 ("metis" ,metis) ;for MUMPS
4493 ("scalapack" ,scalapack) ;for MUMPS
4494 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4495 ("arpack" ,arpack-ng-openmpi)
4496 ,@(fold alist-delete (package-inputs dealii)
4497 '("p4est" "arpack"))))
4499 (substitute-keyword-arguments (package-arguments dealii)
4500 ((#:configure-flags cf)
4501 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4503 ((#:phases phases '%standard-phases)
4504 `(modify-phases ,phases
4505 (add-before 'check 'mpi-setup
4506 ,%openmpi-setup)))))
4507 (synopsis "Finite element library (with MPI support)")))
4509 (define-public flann
4513 (home-page "https://github.com/mariusmuja/flann/")
4517 (uri (git-reference (url home-page) (commit version)))
4518 (file-name (git-file-name name version))
4521 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4522 (patches (search-patches "flann-cmake-3.11.patch"))))
4523 (build-system cmake-build-system)
4526 `(("unzip" ,unzip)))
4529 ;; FIXME: 'mkoctfile' fails with a linker error:
4530 ;; ld: cannot find -loctinterp
4531 ;; ld: cannot find -loctave
4532 ;; Disable it for now.
4533 ;;("octave" ,octave-cli)
4534 ("python" ,python-2) ; print syntax
4535 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4538 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4539 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4540 #:strip-directories '("lib" "lib64" "libexec"
4541 "bin" "sbin" "share/flann/octave")
4543 ;; Save 12 MiB by not installing .a files. Passing
4544 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4545 #:phases (modify-phases %standard-phases
4546 (add-after 'install 'remove-static-libraries
4547 (lambda* (#:key outputs #:allow-other-keys)
4548 (let* ((out (assoc-ref outputs "out"))
4549 (lib (string-append out "/lib")))
4550 (for-each delete-file
4551 (find-files lib "\\.a$"))
4554 #:tests? #f)) ; The test data are downloaded from the Internet.
4555 (synopsis "Library for approximate nearest neighbors computation")
4556 (description "FLANN is a library for performing fast approximate
4557 nearest neighbor searches in high dimensional spaces. It implements a
4558 collection of algorithms and a system for automatically choosing the best
4559 algorithm and optimum parameters depending on the dataset.
4561 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4562 (license (license:non-copyleft "file://COPYING"
4563 "See COPYING in the distribution."))))
4565 (define-public wcalc
4572 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4573 "wcalc-" version ".tar.bz2"))
4576 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4577 (build-system gnu-build-system)
4580 ("readline" ,readline)))
4581 (home-page "http://w-calc.sourceforge.net/index.php")
4582 (synopsis "Flexible command-line scientific calculator")
4583 (description "Wcalc is a very capable calculator. It has standard functions
4584 (sin, asin, and sinh for example, in either radians or degrees), many
4585 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4586 variables, a command history, hex/octal/binary input and output, unit
4587 conversions, embedded comments, and an expandable expression entry field. It
4588 evaluates expressions using the standard order of operations.")
4589 (license license:gpl2+)))
4598 (url "https://github.com/xaos-project/XaoS")
4599 (commit (string-append "release-" version))))
4600 (file-name (git-file-name name version))
4603 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
4604 (build-system gnu-build-system)
4605 (native-inputs `(("gettext" ,gettext-minimal)
4606 ("qtbase" ,qtbase-5)
4607 ("qttools" ,qttools)))
4608 (inputs `(("libx11" ,libx11)
4612 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4613 ;; not enough for this package to install properly. These phases fix that.
4615 `(#:tests? #f ;no "check" target
4617 (modify-phases %standard-phases
4618 (add-before 'configure 'make-qt-deterministic
4620 ;; Make Qt deterministic.
4621 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4624 (lambda* (#:key outputs #:allow-other-keys)
4625 (let ((out (assoc-ref outputs "out")))
4626 (substitute* "XaoS.pro"
4627 ;; The DESTDIR is originally set to install the xaos binary to
4628 ;; the "bin" folder inside the build directory. Setting make
4629 ;; flags doesn't seem to change this.
4631 (string-append "DESTDIR=" out "/bin"))
4632 ;; Set the correct path to the lrelease binary.
4633 (("lrelease-qt5") "lrelease"))
4634 (substitute* "src/include/config.h"
4635 (("/usr/share/XaoS")
4636 (string-append out "/share/XaoS")))
4638 (add-after 'install 'install-data
4639 (lambda* (#:key outputs #:allow-other-keys)
4640 (let* ((out (assoc-ref outputs "out"))
4641 (share (string-append out "/share")))
4645 (copy-recursively folder
4646 (string-append share "/XaoS/" folder)))
4647 '("catalogs" "examples" "tutorial"))
4648 (install-file "xdg/xaos.png"
4649 (string-append share "/pixmaps"))
4650 (install-file "xdg/xaos.desktop"
4651 (string-append share "/applications")))
4653 (synopsis "Real-time fractal zoomer")
4654 (description "GNU XaoS is a graphical program that generates fractal
4655 patterns and allows you to zoom in and out of them infinitely in a fluid,
4656 continuous manner. It also includes tutorials that help to explain how fractals
4657 are built. It can generate many different fractal types such as the Mandelbrot
4659 (home-page "https://xaos-project.github.io/")
4660 (license license:gpl2+)))
4662 (define-public hypre
4670 (url "https://github.com/hypre-space/hypre")
4671 (commit (string-append "v" version))))
4672 (file-name (git-file-name name version))
4674 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4675 (modules '((guix build utils)))
4678 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4679 ;; substitute the release date.
4680 (substitute* "src/utilities/HYPRE_utilities.h"
4681 (("Date Compiled: .*$")
4682 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4684 (build-system gnu-build-system)
4685 (outputs '("out" ; 6.1 MiB of headers and libraries
4686 "doc")) ; 4.8 MiB of documentation
4690 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4691 ("texlive" ,(texlive-union (list texlive-xypic
4693 texlive-latex-hyperref
4695 ("ghostscript" ,ghostscript)))
4697 `(("blas" ,openblas)
4698 ("lapack" ,lapack)))
4700 `(#:modules ((srfi srfi-1)
4701 ,@%gnu-build-system-modules)
4702 #:configure-flags '("--enable-shared"
4710 (modify-phases %standard-phases
4711 (add-before 'build 'set-HOME
4713 ;; FIXME: texlive-union does not find the built
4714 ;; metafonts, so it tries to generate them in HOME.
4715 (setenv "HOME" "/tmp")
4717 (add-before 'configure 'chdir-src
4718 (lambda _ (chdir "src")))
4720 (lambda* (#:key build target configure-flags
4721 #:allow-other-keys #:rest args)
4722 (let* ((configure (assoc-ref %standard-phases 'configure)))
4725 (list #:configure-flags
4726 (cons (string-append
4727 "--host=" (or target build))
4728 configure-flags)))))))
4729 (add-after 'build 'build-docs
4731 (invoke "make" "-Cdocs" "pdf" "html")))
4734 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4735 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4736 (invoke "make" "check" "CHECKRUN=")
4737 (for-each (lambda (filename)
4738 (let ((size (stat:size (stat filename))))
4739 (when (positive? size)
4740 (error (format #f "~a size ~d; error indication~%"
4742 (find-files "test" ".*\\.err$"))
4744 (add-after 'install 'install-docs
4745 (lambda* (#:key outputs #:allow-other-keys)
4746 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4747 (let* ((doc (assoc-ref outputs "doc"))
4748 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4749 (with-directory-excursion "docs"
4750 (for-each (lambda (base)
4751 (install-file (string-append base ".pdf") docdir)
4752 (copy-recursively base docdir)) ; html docs
4753 '("HYPRE_usr_manual"
4754 "HYPRE_ref_manual")))
4756 (home-page "https://computing.llnl.gov/projects\
4757 /hypre-scalable-linear-solvers-multigrid-methods")
4758 (synopsis "Library of solvers and preconditioners for linear equations")
4760 "HYPRE is a software library of high performance preconditioners and
4761 solvers for the solution of large, sparse linear systems of equations. It
4762 features multigrid solvers for both structured and unstructured grid
4764 (license license:lgpl2.1)))
4766 (define-public hypre-openmpi
4767 (package (inherit hypre)
4768 (name "hypre-openmpi")
4771 ,@(package-inputs hypre)))
4773 (substitute-keyword-arguments (package-arguments hypre)
4774 ((#:configure-flags flags)
4776 ,@(delete "--without-MPI" ,flags)))
4778 `(modify-phases ,phases
4779 (add-before 'check 'mpi-setup
4780 ,%openmpi-setup)))))
4781 (synopsis "Parallel solvers and preconditioners for linear equations")
4783 "HYPRE is a software library of high performance preconditioners and
4784 solvers for the solution of large, sparse linear systems of equations on
4785 parallel computers. It features parallel multigrid solvers for both
4786 structured and unstructured grid problems.")))
4788 (define-public matio
4795 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4796 "matio-" version ".tar.gz"))
4799 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
4800 (build-system gnu-build-system)
4803 ("hdf5" ,hdf5-1.8)))
4804 (home-page "http://matio.sourceforge.net/")
4805 (synopsis "Library for reading and writing MAT files")
4806 (description "Matio is a library for reading and writing MAT files. It
4807 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4808 (license license:bsd-2)))
4815 (origin (method url-fetch)
4816 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4817 "download/" version "/Vc-" version ".tar.gz"))
4820 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4821 (build-system cmake-build-system)
4824 '("-DBUILD_TESTING=ON"
4825 ;; By default, Vc will optimize for the CPU of the build machine.
4826 ;; Setting this to "none" makes it create portable binaries. See
4827 ;; "cmake/OptimizeForArchitecture.cmake".
4828 "-DTARGET_ARCHITECTURE=none")
4829 #:phases (modify-phases %standard-phases
4830 (add-after 'unpack 'copy-testdata
4831 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4832 (let ((testdata (assoc-ref (or native-inputs inputs)
4834 (copy-recursively testdata "tests/testdata")
4837 `(("virtest" ,virtest)
4839 ;; This is a submodule in the git project, but not part of the
4840 ;; released sources. See the git branch for the commit to take.
4841 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4845 (url "https://github.com/VcDevel/vc-testdata")
4846 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4847 (file-name (git-file-name "vc-testdata"
4848 (string-take commit 7)))
4851 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4852 (synopsis "SIMD vector classes for C++")
4853 (description "Vc provides portable, zero-overhead C++ types for explicitly
4854 data-parallel programming. It is a library designed to ease explicit
4855 vectorization of C++ code. Its types enable explicitly stating data-parallel
4856 operations on multiple values. The parallelism is therefore added via the type
4857 system. Vc has an intuitive API and provides portability between different
4858 compilers and compiler versions as well as portability between different vector
4859 instruction sets. Thus, an application written with Vc can be compiled for:
4862 @item SSE2 up to SSE4.2 or SSE4a
4865 @item NEON (in development)
4866 @item NVIDIA GPUs / CUDA (in development)
4868 (home-page "https://github.com/VcDevel/Vc")
4869 ;; "No support_???.cpp file exists for this architecture."
4870 (supported-systems '("x86_64-linux" "i686-linux"))
4871 (license license:bsd-3)))
4873 (define-public reducelcs
4874 ;; This is the last commit which is available upstream, no
4875 ;; release happened since 2010.
4876 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4880 (version (string-append "1.0-" revision "." (string-take commit 7)))
4885 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4887 (file-name (string-append name "-" version "-checkout"))
4890 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4891 (build-system gnu-build-system)
4893 `(("openlibm" ,openlibm)))
4895 `(#:tests? #f ; no tests
4897 (modify-phases %standard-phases
4898 (delete 'configure) ; No configure script exists.
4899 (replace 'install ; No install phase exists.
4900 (lambda* (#:key outputs #:allow-other-keys)
4901 (let* ((out (assoc-ref outputs "out"))
4902 (bin (string-append out "/bin")))
4903 (install-file "Approximation" bin)
4904 (install-file "CollectResults" bin)
4905 (install-file "GenerateInstances" bin)
4907 (synopsis "Approximate Longest Commons Subsequence computation tool")
4909 "@code{reduceLCS} is an implementation of the Reduce-Expand
4910 algorithm for LCS. It is a fast program to compute the approximate
4911 Longest Commons Subsequence of a set of strings.")
4912 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4913 (license license:gpl3+))))
4915 (define-public jacal
4922 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4925 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4926 (patches (search-patches "jacal-fix-texinfo.patch"))))
4927 (build-system gnu-build-system)
4930 (modify-phases %standard-phases
4931 (add-before 'build 'pre-build
4932 ;; Don't use upstream's script - it really doesn't fit into
4933 ;; Guix's functional paradigm.
4934 (lambda* (#:key inputs outputs #:allow-other-keys)
4935 (substitute* "Makefile"
4936 (("^install: install-script") "install: "))))
4937 (add-after 'install 'post-install
4938 ;; Instead, we provide our own simplified script.
4939 (lambda* (#:key inputs outputs #:allow-other-keys)
4940 (let ((wrapper (string-append (assoc-ref outputs "out")
4942 (format (open wrapper (logior O_WRONLY O_CREAT))
4943 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4944 "-e '(slib:load \"~a/lib/jacal/math\") "
4947 (assoc-ref inputs "scm")
4948 (assoc-ref outputs "out"))
4949 (chmod wrapper #o555))))
4951 (lambda* (#:key outputs #:allow-other-keys)
4952 (invoke "./configure"
4953 (string-append "--prefix="
4954 (assoc-ref outputs "out"))))))))
4955 (inputs `(("scm" ,scm)))
4956 (native-inputs `(("unzip" ,unzip)
4957 ("texinfo" ,texinfo)))
4958 (synopsis "Symbolic mathematics system")
4959 (description "GNU JACAL is an interactive symbolic mathematics program based on
4960 Scheme. It manipulate and simplify a range of mathematical expressions such
4961 as equations, scalars, vectors, and matrices.")
4962 (home-page "https://www.gnu.org/software/jacal/")
4963 (license license:gpl3+)))
4969 (home-page "https://github.com/Z3Prover/z3")
4972 (uri (git-reference (url home-page)
4973 (commit (string-append "z3-" version))))
4974 (file-name (git-file-name name version))
4977 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4978 (build-system gnu-build-system)
4980 `(#:imported-modules ((guix build python-build-system)
4981 ,@%gnu-build-system-modules)
4982 #:modules (((guix build python-build-system) #:select (site-packages))
4983 (guix build gnu-build-system)
4986 (modify-phases %standard-phases
4987 (add-after 'unpack 'enable-bytecode-determinism
4989 (setenv "PYTHONHASHSEED" "0")
4991 (add-after 'unpack 'fix-compatability
4992 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4994 (substitute* "src/util/mpz.cpp"
4995 (("#include <immintrin.h>") ""))
4997 (add-before 'configure 'bootstrap
4999 (invoke "python" "scripts/mk_make.py")))
5000 ;; work around gnu-build-system's setting --enable-fast-install
5001 ;; (z3's `configure' is a wrapper around the above python file,
5002 ;; which fails when passed --enable-fast-install)
5004 (lambda* (#:key inputs outputs #:allow-other-keys)
5005 (invoke "./configure"
5007 (string-append "--prefix=" (assoc-ref outputs "out"))
5008 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5009 (add-after 'configure 'change-directory
5013 (add-before 'check 'make-test-z3
5015 ;; Build the test suite executable.
5016 (invoke "make" "test-z3" "-j"
5017 (number->string (parallel-job-count)))))
5020 ;; Run all the tests that don't require arguments.
5021 (invoke "./test-z3" "/a"))))))
5024 ("python" ,python-wrapper)))
5025 (synopsis "Theorem prover")
5026 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5027 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5028 (license license:expat)))
5033 (version "2018.11.001")
5036 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5037 version "/elpa-" version ".tar.gz"))
5040 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5041 (build-system gnu-build-system)
5043 `(("fortran" ,gfortran)
5044 ("perl" ,perl))) ;for configure and deps
5046 `(("blas" ,openblas)))
5051 ;; ELPA unfortunately does not support runtime dispatch, so we can
5052 ;; only enable the "generic" kernels. See the "Cross compilation"
5053 ;; section of INSTALL.md.
5055 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5056 "--disable-avx" "--disable-avx2" "--disable-avx512"
5057 ,(string-append "CFLAGS=-O3 "
5058 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5059 "-ftree-vect-loop-version -ftree-vectorize "
5060 ,(let ((system (or (%current-target-system)
5061 (%current-system))))
5063 ((or (string-prefix? "x86_64" system)
5064 (string-prefix? "i686" system))
5067 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5069 (modify-phases %standard-phases
5070 (add-before 'configure 'patch-header-generation
5072 (substitute* "configure"
5073 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5074 (string-append & " CPP=\"$CPP\"")))
5076 (add-before 'check 'setup-tests
5078 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5079 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5080 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5081 ;; for Fortran. This also causes several tests to pass that
5082 ;; otherwise would otherwise fail with matrix size 5000; possibly
5083 ;; due to floating point tolerances that are too tight.
5084 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5085 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5086 (substitute* "Makefile"
5087 ;; Test scripts are generated, patch the shebang
5088 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5090 (home-page "https://elpa.mpcdf.mpg.de")
5091 (synopsis "Eigenvalue solvers for symmetric matrices")
5093 "The ELPA library provides efficient and scalable direct eigensolvers for
5094 symmetric matrices.")
5095 (license license:lgpl3)))
5097 (define-public elpa-openmpi
5098 (package (inherit elpa)
5099 (name "elpa-openmpi")
5102 ("scalapack" ,scalapack)
5103 ,@(package-inputs elpa)))
5105 (substitute-keyword-arguments (package-arguments elpa)
5106 ((#:configure-flags cf '())
5107 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5108 ((#:phases phases '%standard-phases)
5109 `(modify-phases ,phases
5110 (add-before 'check 'mpi-setup
5112 ;; Tests use 2 mpi tasks by default, use our remaining build
5113 ;; cores as OpenMP threads.
5114 (setenv "OMP_NUM_THREADS" (number->string
5115 (max (quotient (parallel-job-count) 2)
5117 (,%openmpi-setup)))))))
5118 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5120 (define-public elemental
5127 (url "https://github.com/elemental/Elemental")
5128 (commit (string-append "v" version))))
5129 (file-name (git-file-name name version))
5132 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5133 (build-system cmake-build-system)
5134 (home-page "https://github.com/elemental/Elemental")
5136 `(("gfortran" ,gfortran)))
5138 `(("blas" ,openblas)
5139 ("gfortran:lib" ,gfortran "lib")
5148 `(#:build-type "Release" ;default RelWithDebInfo not supported
5149 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5150 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5151 "-DEL_CACHE_WARNINGS:BOOL=YES"
5152 "-DEL_TESTS:BOOL=YES"
5153 "-DCMAKE_INSTALL_LIBDIR=lib"
5154 "-DGFORTRAN_LIB=gfortran")
5155 #:phases (modify-phases %standard-phases
5156 (add-before 'check 'mpi-setup
5158 (add-before 'check 'setup-tests
5160 ;; Parallelism is done at the MPI layer.
5161 (setenv "OMP_NUM_THREADS" "1")
5163 (add-after 'install 'remove-tests
5164 (lambda* (#:key outputs #:allow-other-keys)
5165 ;; Tests are installed, with no easy configuration
5166 ;; switch to prevent this, so delete them.
5167 (delete-file-recursively
5168 (string-append (assoc-ref outputs "out") "/bin"))
5170 (synopsis "Dense and sparse-direct linear algebra and optimization")
5171 (description "Elemental is a modern C++ library for distributed-memory
5172 dense and sparse-direct linear algebra, conic optimization, and lattice
5174 (license license:bsd-2)))
5176 (define-public mcrl2
5179 (version "202006.0")
5183 "https://www.mcrl2.org/download/release/mcrl2-"
5187 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
5192 ("qtbase" ,qtbase-5)))
5193 (build-system cmake-build-system)
5194 (synopsis "Toolset for the mCRL2 formal specification language")
5196 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5197 specification language for describing concurrent discrete event systems. Its
5198 toolset supports analysis and automatic verification, linearisation, simulation,
5199 state-space exploration and generation, and tools to optimise and analyse
5200 specifications. Also, state spaces can be manipulated, visualised and
5202 (home-page "https://mcrl2.org")
5203 (license license:boost1.0)))
5205 (define-public mcrl2-minimal
5208 (name "mcrl2-minimal")
5210 `(("boost" ,boost)))
5212 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5214 (define-public tcalc
5221 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5225 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5226 (build-system gnu-build-system)
5227 (synopsis "The terminal calculator")
5229 "The terminal calculator is a small program to help users of the GNU/Linux
5230 terminal do calculations simply and quickly. The formula to be calculated can
5231 be fed to @command{tcalc} through the command line.")
5232 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5233 (license license:gpl3+)))
5235 (define-public tiny-bignum
5236 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5238 (name "tiny-bignum")
5239 (version (git-version "0" "0" commit))
5244 (url "https://github.com/kokke/tiny-bignum-c")
5246 (file-name (git-file-name "tiny-bignum" commit))
5248 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5249 (build-system gnu-build-system)
5252 (modify-phases %standard-phases
5254 (add-after 'unpack 'patch-tests
5256 (substitute* "scripts/test_rand.py"
5258 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5261 (lambda* (#:key tests? #:allow-other-keys)
5263 (invoke "make" "test"))
5266 (lambda* (#:key outputs #:allow-other-keys)
5267 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5268 (doc (string-append (assoc-ref outputs "out") "/doc")))
5270 (install-file "bn.c" share)
5271 (install-file "bn.h" share)
5273 (install-file "LICENSE" doc)
5274 (install-file "README.md" doc))
5277 `(("python" ,python-wrapper)))
5278 (home-page "https://github.com/kokke/tiny-bignum-c")
5279 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5281 "This library provides portable Arbitrary-precision unsigned integer
5282 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5283 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5284 and comparisons are supported.")
5285 (license license:unlicense))))
5287 (define-public sundials
5294 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5295 "sundials-" version ".tar.gz"))
5298 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5299 (build-system cmake-build-system)
5301 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5303 `(("fortran" ,gfortran) ;for fcmix
5305 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5307 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5308 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5309 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5310 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5311 "-DEXAMPLES_INSTALL:BOOL=OFF"
5313 "-DFCMIX_ENABLE:BOOL=ON"
5315 "-DKLU_ENABLE:BOOL=ON"
5316 ,(string-append "-DKLU_INCLUDE_DIR="
5317 (assoc-ref %build-inputs "suitesparse")
5319 ,(string-append "-DKLU_LIBRARY_DIR="
5320 (assoc-ref %build-inputs "suitesparse")
5322 (home-page "https://computation.llnl.gov/projects/sundials")
5323 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5324 (description "SUNDIALS is a family of software packages implemented with
5325 the goal of providing robust time integrators and nonlinear solvers that can
5326 easily be incorporated into existing simulation codes.")
5327 (license license:bsd-3)))
5329 (define-public sundials-openmpi
5330 (package (inherit sundials)
5331 (name "sundials-openmpi")
5334 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5335 ,@(package-inputs sundials)))
5337 (substitute-keyword-arguments (package-arguments sundials)
5338 ((#:configure-flags flags '())
5339 `(cons* "-DMPI_ENABLE:BOOL=ON"
5340 "-DPETSC_ENABLE:BOOL=ON"
5341 (string-append "-DPETSC_INCLUDE_DIR="
5342 (assoc-ref %build-inputs "petsc")
5344 (string-append "-DPETSC_LIBRARY_DIR="
5345 (assoc-ref %build-inputs "petsc")
5348 ((#:phases phases '%standard-phases)
5349 `(modify-phases ,phases
5350 (add-before 'check 'mpi-setup
5351 ,%openmpi-setup)))))
5352 (synopsis "SUNDIALS with OpenMPI support")))
5354 (define-public combinatorial-blas
5356 (name "combinatorial-blas")
5361 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5363 (match (string-split version #\.)
5364 ((major minor patch)
5365 (string-append major minor "_" patch))) ;e.g. "16_2"
5369 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5370 (patches (search-patches "combinatorial-blas-awpm.patch"
5371 "combinatorial-blas-io-fix.patch"))))
5372 (build-system cmake-build-system)
5375 ("test-data" ,(origin
5377 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5378 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5381 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5383 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5384 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5385 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5387 (modify-phases %standard-phases
5388 (add-before 'check 'mpi-setup
5390 (add-before 'check 'test-setup
5391 (lambda* (#:key inputs #:allow-other-keys)
5392 (setenv "OMP_NUM_THREADS" "2")
5393 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5394 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5395 (synopsis "Linear algebra primitives for graph analytics")
5396 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5397 distributed-memory parallel graph library offering a small but powerful set of
5398 linear algebra primitives specifically targeting graph analytics.")
5400 license:gpl2+ ;include/psort/(funnel|sort)*.h
5401 license:x11 ;usort and psort
5402 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5404 (define-public dune-common
5406 (name "dune-common")
5411 (uri (string-append "https://dune-project.org/download/"
5412 version "/dune-common-" version ".tar.gz"))
5415 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5416 (build-system cmake-build-system)
5419 (modify-phases %standard-phases
5420 (add-after 'build 'build-tests
5421 (lambda* (#:key make-flags #:allow-other-keys)
5422 (apply invoke "make" "build_tests" make-flags))))))
5426 ("openblas" ,openblas)
5428 ("superlu" ,superlu)))
5430 `(("gfortran" ,gfortran)
5431 ("pkg-config" ,pkg-config)))
5432 (home-page "https://dune-project.org/")
5433 (synopsis "Distributed and Unified Numerics Environment")
5434 (description "DUNE, the Distributed and Unified Numerics Environment is a
5435 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5436 grid-based methods. It supports the easy implementation of methods like
5437 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5438 Differences} (FD).")
5439 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5440 (license license:gpl2)))
5442 (define-public dune-geometry
5444 (name "dune-geometry")
5449 (uri (string-append "https://dune-project.org/download/"
5450 version "/dune-geometry-" version ".tar.gz"))
5453 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5454 (build-system cmake-build-system)
5457 (modify-phases %standard-phases
5458 (add-after 'build 'build-tests
5459 (lambda* (#:key make-flags #:allow-other-keys)
5460 (apply invoke "make" "build_tests" make-flags))))))
5462 `(("dune-common" ,dune-common)
5464 ("openblas" ,openblas)
5466 ("python" ,python)))
5468 `(("gfortran" ,gfortran)
5469 ("pkg-config" ,pkg-config)))
5470 (home-page "https://dune-project.org/")
5471 (synopsis "Distributed and Unified Numerics Environment")
5472 (description "DUNE, the Distributed and Unified Numerics Environment is a
5473 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5474 grid-based methods. It supports the easy implementation of methods like
5475 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5478 This package contains the basic DUNE geometry classes.")
5479 ;; GPL version 2 with "runtime exception"
5480 (license license:gpl2)))
5482 (define-public dune-uggrid
5484 (name "dune-uggrid")
5490 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5491 (commit (string-append "v" version))))
5492 (file-name (git-file-name name version))
5495 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5496 (build-system cmake-build-system)
5499 (modify-phases %standard-phases
5500 (add-after 'build 'build-tests
5501 (lambda* (#:key make-flags #:allow-other-keys)
5502 (apply invoke "make" "build_tests" make-flags))))))
5504 `(("dune-common" ,dune-common)))
5506 `(("gfortran" ,gfortran)
5507 ("pkg-config" ,pkg-config)))
5508 (home-page "https://dune-project.org/")
5509 (synopsis "Distributed and Unified Numerics Environment")
5510 (description "DUNE, the Distributed and Unified Numerics Environment is a
5511 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5512 grid-based methods. It supports the easy implementation of methods like
5513 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5516 This package contains the DUNE UG grid classes.")
5517 (license license:lgpl2.1)))
5519 (define-public dune-grid
5526 (uri (string-append "https://dune-project.org/download/"
5527 version "/dune-grid-" version ".tar.gz"))
5530 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5531 (build-system cmake-build-system)
5534 (modify-phases %standard-phases
5535 (add-after 'build 'build-tests
5536 (lambda* (#:key make-flags #:allow-other-keys)
5537 (apply invoke "make" "build_tests" make-flags))))))
5539 `(("dune-common" ,dune-common)
5540 ("dune-geometry" ,dune-geometry)
5543 ("openblas" ,openblas)
5544 ("python" ,python)))
5546 `(("dune-uggrid" ,dune-uggrid)))
5548 `(("gfortran" ,gfortran)
5549 ("pkg-config" ,pkg-config)))
5550 (home-page "https://dune-project.org/")
5551 (synopsis "Distributed and Unified Numerics Environment")
5552 (description "DUNE, the Distributed and Unified Numerics Environment is a
5553 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5554 grid-based methods. It supports the easy implementation of methods like
5555 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5558 This package contains the basic DUNE grid classes.")
5559 ;; GPL version 2 with "runtime exception"
5560 (license license:gpl2)))
5562 (define-public dune-istl
5569 (uri (string-append "https://dune-project.org/download/"
5570 version "/dune-istl-" version ".tar.gz"))
5573 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5574 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5575 (build-system cmake-build-system)
5578 (modify-phases %standard-phases
5579 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5580 ;; the stdlib types when the gfortran header is used. Remove gfortran
5581 ;; from CPLUS_INCLUDE_PATH as a workaround.
5582 (add-after 'set-paths 'hide-gfortran
5583 (lambda* (#:key inputs #:allow-other-keys)
5584 (let ((gfortran (assoc-ref inputs "gfortran")))
5585 (setenv "CPLUS_INCLUDE_PATH"
5587 (delete (string-append gfortran "/include/c++")
5588 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5591 (add-after 'build 'build-tests
5592 (lambda* (#:key make-flags #:allow-other-keys)
5593 (apply invoke "make" "build_tests" make-flags))))))
5595 `(("dune-common" ,dune-common)
5598 ("suitesparse" ,suitesparse)
5599 ("superlu" ,superlu)
5600 ("openblas" ,openblas)
5602 ("python" ,python)))
5604 `(("gfortran" ,gfortran)
5605 ("pkg-config" ,pkg-config)))
5606 (home-page "https://dune-project.org/")
5607 (synopsis "Distributed and Unified Numerics Environment")
5608 (description "DUNE, the Distributed and Unified Numerics Environment is a
5609 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5612 This is the iterative solver template library which provides generic sparse
5613 matrix/vector classes and a variety of solvers based on these classes. A
5614 special feature is the use of templates to exploit the recursive block
5615 structure of finite element matrices at compile time. Available solvers
5616 include Krylov methods, (block-) incomplete decompositions and
5617 aggregation-based algebraic multigrid.")
5618 ;; GPL version 2 with "runtime exception"
5619 (license license:gpl2)))
5621 (define-public dune-localfunctions
5623 (name "dune-localfunctions")
5628 (uri (string-append "https://dune-project.org/download/"
5629 version "/dune-localfunctions-" version ".tar.gz"))
5632 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5633 (build-system cmake-build-system)
5636 (modify-phases %standard-phases
5637 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5638 ;; and fails to find the stdlib types when the gfortran header is used.
5639 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5640 (add-after 'set-paths 'hide-gfortran
5641 (lambda* (#:key inputs #:allow-other-keys)
5642 (let ((gfortran (assoc-ref inputs "gfortran")))
5643 (setenv "CPLUS_INCLUDE_PATH"
5645 (delete (string-append gfortran "/include/c++")
5646 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5649 (add-after 'build 'build-tests
5650 (lambda* (#:key make-flags #:allow-other-keys)
5651 (apply invoke "make" "build_tests" make-flags))))))
5653 `(("dune-common" ,dune-common)
5654 ("dune-geometry" ,dune-geometry)
5657 ("superlu" ,superlu)
5660 `(("gfortran" ,gfortran)
5661 ("pkg-config" ,pkg-config)))
5662 (home-page "https://dune-project.org/")
5663 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5664 (description "This DUNE module provides interface and implementation for
5665 shape functions defined on the DUNE reference elements. In addition to the
5666 shape function, interpolation operators and special keys are provided which
5667 can be used to assemble global function spaces on finite-element grids.
5669 This package provides an interface and implementation for shape functions
5670 defined on the DUNE reference elements. In addition to the shape function,
5671 interpolation operators and special keys are provided which can be used to
5672 assemble global function spaces on finite-element grids.")
5673 ;; GPL version 2 with "runtime exception"
5674 (license license:gpl2)))
5676 (define-public dune-alugrid
5678 (name "dune-alugrid")
5679 (version "2.7.0-git-81d35682")
5684 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5685 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5686 (file-name (git-file-name name version))
5689 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5690 (build-system cmake-build-system)
5693 (modify-phases %standard-phases
5694 (add-after 'unpack 'patch-include
5696 (substitute* "dune/alugrid/test/test-alugrid.cc"
5697 (("doc/grids/gridfactory/testgrids")
5698 "doc/dune-grid/grids/gridfactory/testgrids"))
5700 (add-after 'build 'build-tests
5701 (lambda* (#:key inputs make-flags #:allow-other-keys)
5702 (setenv "CPLUS_INCLUDE_PATH"
5703 (string-append (assoc-ref inputs "dune-grid") "/share"))
5704 (apply invoke "make" "build_tests" make-flags))))))
5706 `(("dune-common" ,dune-common)
5707 ("dune-geometry" ,dune-geometry)
5708 ("dune-grid" ,dune-grid)
5711 ("openblas" ,openblas)
5713 ("superlu" ,superlu)
5717 `(("gfortran" ,gfortran)
5718 ("pkg-config" ,pkg-config)))
5719 (home-page "https://dune-project.org/")
5720 (synopsis "Distributed and Unified Numerics Environment")
5721 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5722 implementation of the DUNE grid interface supporting either simplices or
5724 (license license:gpl2+)))
5726 (define-public dune-subgrid
5728 (name "dune-subgrid")
5729 (version "2.7.0-git-2103a363")
5734 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5735 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5736 (file-name (git-file-name name version))
5739 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5740 (build-system cmake-build-system)
5743 (modify-phases %standard-phases
5744 (add-after 'build 'build-tests
5745 (lambda* (#:key make-flags #:allow-other-keys)
5746 (apply invoke "make" "build_tests" make-flags))))))
5748 `(("dune-common" ,dune-common)
5749 ("dune-geometry" ,dune-geometry)
5750 ("dune-grid" ,dune-grid)
5753 ("openblas" ,openblas)
5756 `(("gfortran" ,gfortran)
5757 ("pkg-config" ,pkg-config)))
5758 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5759 (synopsis "Distributed and Unified Numerics Environment")
5760 (description "The dune-subgrid module marks elements of
5761 another hierarchical dune grid. The set of marked elements can then be
5762 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5763 provides the full grid interface including adaptive mesh refinement.")
5764 (license license:gpl2+)))
5766 (define-public dune-typetree
5768 (name "dune-typetree")
5774 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5775 (commit (string-append "v" version))))
5776 (file-name (git-file-name name version))
5779 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5780 (build-system cmake-build-system)
5783 (modify-phases %standard-phases
5784 (add-after 'build 'build-tests
5785 (lambda* (#:key make-flags #:allow-other-keys)
5786 (apply invoke "make" "build_tests" make-flags))))))
5788 `(("dune-common" ,dune-common)
5790 ("openblas" ,openblas)
5793 ("superlu" ,superlu)
5796 `(("gfortran" ,gfortran)
5797 ("pkg-config" ,pkg-config)))
5798 (home-page "https://dune-project.org/")
5799 (synopsis "Distributed and Unified Numerics Environment")
5800 (description "TypeTree is a template library for constructing and
5801 operating on statically typed trees of objects.")
5802 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5803 (license (list license:lgpl3+ license:gpl2))))
5805 (define-public dune-functions
5807 (name "dune-functions")
5813 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5814 (commit (string-append "v" version))))
5815 (file-name (git-file-name name version))
5818 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5819 (build-system cmake-build-system)
5822 (modify-phases %standard-phases
5823 (add-after 'unpack 'disable-failing-tests
5826 ;; unable to load GMSH file in this test
5827 "--exclude-regex gridviewfunctionspacebasistest")
5829 (add-after 'build 'build-tests
5830 (lambda* (#:key make-flags #:allow-other-keys)
5831 (apply invoke "make" "build_tests" make-flags))))))
5833 `(("dune-common" ,dune-common)
5834 ("dune-istl" ,dune-istl)
5835 ("dune-localfunctions" ,dune-localfunctions)
5836 ("dune-grid" ,dune-grid)
5837 ("dune-geometry" ,dune-geometry)
5838 ("dune-typetree" ,dune-typetree)
5839 ("openblas" ,openblas)
5842 ("superlu" ,superlu)
5845 `(("gfortran" ,gfortran)
5846 ("pkg-config" ,pkg-config)))
5847 (home-page "https://dune-project.org/")
5848 (synopsis "Distributed and Unified Numerics Environment")
5849 (description "The dune-functions module provides an abstraction layer for
5850 global finite element functions. Its two main concepts are functions
5851 implemented as callable objects, and bases of finite element spaces.")
5852 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5853 (license (list license:lgpl3+ license:gpl2))))
5855 (define-public dune-pdelab
5857 (name "dune-pdelab")
5858 (version "2.7.0-git-476fe437")
5863 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5864 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5865 (file-name (git-file-name name version))
5868 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5869 (build-system cmake-build-system)
5870 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5872 `(("dune-common" ,dune-common)
5873 ("dune-istl" ,dune-istl)
5874 ("dune-localfunctions" ,dune-localfunctions)
5875 ("dune-geometry" ,dune-geometry)
5876 ("dune-grid" ,dune-grid)
5877 ("dune-typetree" ,dune-typetree)
5878 ("dune-functions" ,dune-functions)
5880 ("openblas" ,openblas)
5884 ("superlu" ,superlu)
5887 `(("gfortran" ,gfortran)
5888 ("pkg-config" ,pkg-config)))
5889 (home-page "https://dune-project.org/")
5890 (synopsis "Differential equations solver toolbox")
5891 (description "PDELab is a partial differential equations solver toolbox
5892 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5893 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5894 (license (list license:lgpl3+ license:gpl2))))
5896 (define add-openmpi-to-dune-package
5897 (let ((dune-package?
5898 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5901 (if (dune-package? p)
5902 (package (inherit p)
5903 (name (string-append (package-name p) "-openmpi"))
5904 (inputs `(,@(package-inputs p)
5905 ("openmpi" ,openmpi)))
5907 (substitute-keyword-arguments (package-arguments p)
5908 ((#:phases phases '%standard-phases)
5909 `(modify-phases ,phases
5910 (add-before 'check 'mpi-setup
5911 ,%openmpi-setup)))))
5912 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5914 (negate dune-package?))))
5916 (define-public dune-common-openmpi
5917 (add-openmpi-to-dune-package dune-common))
5919 (define-public dune-geometry-openmpi
5920 (add-openmpi-to-dune-package dune-geometry))
5922 (define-public dune-istl-openmpi
5923 (add-openmpi-to-dune-package dune-istl))
5925 (define-public dune-typetree-openmpi
5926 (add-openmpi-to-dune-package dune-typetree))
5928 (define-public dune-uggrid-openmpi
5929 (add-openmpi-to-dune-package dune-uggrid))
5931 (define-public dune-grid-openmpi
5932 (add-openmpi-to-dune-package dune-grid))
5934 (define-public dune-alugrid-openmpi
5935 (add-openmpi-to-dune-package dune-alugrid))
5937 (define-public dune-subgrid-openmpi
5938 (add-openmpi-to-dune-package dune-subgrid))
5940 (define-public dune-localfunctions-openmpi
5941 (add-openmpi-to-dune-package dune-localfunctions))
5943 (define-public dune-functions-openmpi
5944 (add-openmpi-to-dune-package dune-functions))
5946 (define-public dune-pdelab-openmpi
5947 (add-openmpi-to-dune-package dune-pdelab))
5949 (define-public mlucas
5957 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5959 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5960 (build-system gnu-build-system)
5962 `(("python2" ,python-2)))
5964 `(#:tests? #f ; no tests
5966 (modify-phases %standard-phases
5970 (call-with-output-file "Makefile"
5972 (format port "CC = gcc
5973 CFLAGS = -O3 ~a -DUSE_THREADS
5974 LDLIBS = -lm -lpthread -lrt
5975 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5977 ,(let ((system (or (%current-target-system)
5978 (%current-system))))
5980 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5984 (lambda* (#:key outputs #:allow-other-keys)
5985 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5986 (install-file "Mlucas" bin)
5987 (install-file "primenet.py" bin))
5989 (home-page "https://www.mersenne.org")
5990 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5991 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5992 numbers in search of a world-record prime. You may use it to test any
5993 suitable number as you wish, but it is preferable that you do so in a
5994 coordinated fashion, as part of the Great Internet Mersenne Prime
5995 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5996 management via the GIMPS project's Primenet server.")
5997 (license license:gpl2+)))
5999 (define-public nauty
6007 "https://pallini.di.uniroma1.it/"
6008 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6010 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
6011 (build-system gnu-build-system)
6012 (outputs '("out" "lib"))
6014 `(#:test-target "checks"
6015 #:configure-flags '("--enable-generic") ;prevent -march-native
6017 (modify-phases %standard-phases
6018 ;; Default make target does not build all available
6019 ;; executables. Create them now.
6020 (add-after 'build 'build-extra-programs
6022 (for-each (lambda (target) (invoke "make" target))
6023 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6025 ;; Upstream does not provide any install target.
6027 (lambda* (#:key outputs #:allow-other-keys)
6028 (let* ((out (assoc-ref outputs "out"))
6029 (lib-output (assoc-ref outputs "lib"))
6030 (bin (string-append out "/bin"))
6031 (doc (string-append out "/share/doc/nauty/"))
6032 (include (string-append lib-output "/include/nauty"))
6033 (lib (string-append lib-output "/lib/nauty")))
6034 (for-each (lambda (f) (install-file f bin))
6035 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6036 "bliss2dre" "catg" "checks6" "complg" "converseg"
6037 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6038 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6039 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6040 "gentourng" "gentreeg" "hamheuristic" "labelg"
6041 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6042 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6043 "sumlines" "twohamg" "underlyingg" "vcolg"
6044 "watercluster2" "NRswitchg"))
6045 (for-each (lambda (f) (install-file f include))
6046 (find-files "." "\\.h$"))
6047 (for-each (lambda (f) (install-file f lib))
6048 (find-files "." "\\.a$"))
6049 (for-each (lambda (f) (install-file f doc))
6050 (append '("formats.txt" "README" "schreier.txt")
6051 (find-files "." "\\.pdf$")))))))))
6053 `(("gmp" ,gmp))) ;for sumlines
6054 (home-page "https://pallini.di.uniroma1.it/")
6055 (synopsis "Library for graph automorphisms")
6056 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6057 procedures for computing automorphism groups of graphs and digraphs.
6059 @code{nauty} computes graph information in the form of a set of
6060 generators, the size of the group, and the orbits of the group; it can
6061 also produce a canonical label. The @code{nauty} suite is written in
6062 C and comes with a command-line interface, a collection of
6063 command-line tools, and an Application Programming Interface (API).
6065 This package provides the static libraries required to run programs
6066 compiled against the nauty library.")
6067 (license license:asl2.0)))
6076 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6077 "ftp/releases/" version
6078 "/ppl-" version ".tar.gz"))
6081 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6082 (build-system gnu-build-system)
6088 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6090 "Parma Polyhedra Library for computations with polyhedra")
6092 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6093 especially targeted at applications in the field of analysis and
6094 verification of complex systems. These abstractions include convex
6095 polyhedra, defined as the intersection of a finite number of (open or
6096 closed) halfspaces, each described by a linear inequality (strict or
6097 non-strict) with rational coefficients; some special classes of polyhedra
6098 shapes that offer interesting complexity/precision tradeoffs; and grids
6099 which represent regularly spaced points that satisfy a set of linear
6100 congruence relations. The library also supports finite powersets and
6101 products of (any kind of) polyhedra and grids, a mixed integer linear
6102 programming problem solver using an exact-arithmetic version of the simplex
6103 algorithm, a parametric integer programming solver, and primitives for
6104 termination analysis via the automatic synthesis of linear ranking
6106 (license license:gpl3+)))
6108 (define-public speedcrunch
6110 (name "speedcrunch")
6116 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6117 (commit (string-append "release-" version))))
6118 (file-name (git-file-name name version))
6121 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6122 (build-system cmake-build-system)
6123 (inputs `(("qtbase" ,qtbase-5)))
6124 (native-inputs `(("qttools" ,qttools)))
6127 (modify-phases %standard-phases
6128 (add-after 'unpack 'chdir-to-src
6129 (lambda _ (chdir "src") #t)))))
6130 (synopsis "High-precision scientific calculator")
6132 "SpeedCrunch is a high-precision scientific calculator. It features a
6133 syntax-highlighted scrollable display and is designed to be fully used via
6134 keyboard. Some distinctive features are auto-completion of functions and
6135 variables, a formula book, and quick insertion of constants from various
6136 fields of knowledge.")
6137 (home-page "https://speedcrunch.org/")
6138 (license license:gpl2+)))
6140 (define-public minisat
6141 ;; This is the last commit which is available upstream, no
6142 ;; release happened since 2010.
6143 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6147 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6152 (url "https://github.com/niklasso/minisat")
6154 (file-name (string-append name "-" version "-checkout"))
6157 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6159 (search-patches "minisat-friend-declaration.patch"
6160 "minisat-install.patch"))))
6161 (build-system gnu-build-system)
6163 '(#:make-flags (list (string-append "prefix=" %output))
6164 #:tests? #f ;no check target
6166 (modify-phases %standard-phases
6167 (delete 'configure))))
6169 `(("zlib:static" ,zlib "static")
6172 "Small, yet efficient, SAT solver")
6174 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6175 researchers and developers alike to get started on SAT.")
6177 "http://minisat.se/MiniSat.html")
6178 (license license:expat))))
6180 (define-public libqalculate
6182 (name "libqalculate")
6188 (url "https://github.com/Qalculate/libqalculate/")
6189 (commit (string-append "v" version))))
6190 (file-name (git-file-name name version))
6192 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
6194 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6195 (build-system gnu-build-system)
6197 `(("pkg-config" ,pkg-config)
6198 ("gettext" ,gettext-minimal)
6199 ("intltool" ,intltool)
6200 ("automake" ,automake)
6201 ("autoconf" ,autoconf)
6202 ("libtool" ,libtool)
6203 ("doxygen" ,doxygen)
6208 ("libxml2" ,libxml2)
6211 ("gnuplot" ,gnuplot)
6212 ("readline" ,readline)
6213 ("libiconv" ,libiconv)))
6216 (modify-phases %standard-phases
6217 (add-before 'bootstrap 'setenv
6218 ;; Prevent the autogen.sh script to carry out the configure
6219 ;; script, which has not yet been patched to replace /bin/sh.
6221 (setenv "NOCONFIGURE" "TRUE")
6223 (home-page "https://qalculate.github.io/")
6224 (synopsis "Multi-purpose cli desktop calculator and library")
6226 "Libqalculate is a multi-purpose cli desktop calculator and library.
6227 It provides basic and advanced functionality. Features include customizable
6228 functions, unit calculations, and conversions, physical constants, symbolic
6229 calculations (including integrals and equations), arbitrary precision,
6230 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6232 (license license:gpl2+)))
6234 (define-public qalculate-gtk
6236 (name "qalculate-gtk")
6242 (url "https://github.com/Qalculate/qalculate-gtk/")
6243 (commit (string-append "v" version))))
6244 (file-name (git-file-name name version))
6246 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
6247 (build-system glib-or-gtk-build-system)
6249 `(("pkg-config" ,pkg-config)
6250 ("intltool" ,intltool)
6251 ("automake" ,automake)
6252 ("autoconf" ,autoconf)
6253 ("libtool" ,libtool)
6258 ("libqalculate" ,libqalculate)
6259 ("libxml2" ,libxml2)
6264 (modify-phases %standard-phases
6265 (add-before 'bootstrap 'setenv
6266 ;; Prevent the autogen.sh script to carry out the configure
6267 ;; script, which has not yet been patched to replace /bin/sh.
6269 (setenv "NOCONFIGURE" "TRUE")
6271 (home-page "https://qalculate.github.io/")
6272 (synopsis "Multi-purpose graphical desktop calculator")
6274 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6275 multi-purpose GUI desktop calculator. It provides basic and advanced
6276 functionality. Features include customizable functions, unit calculations,
6277 and conversions, physical constants, symbolic calculations (including
6278 integrals and equations), arbitrary precision, uncertainty propagation,
6279 interval arithmetic, plotting.")
6280 (license license:gpl2+)))
6282 (define-public numdiff
6289 (uri (string-append "mirror://savannah/numdiff/numdiff-"
6293 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
6294 (build-system gnu-build-system)
6296 '(#:tests? #f ; There are no tests.
6298 (modify-phases %standard-phases
6299 (add-before 'compress-documentation 'delete-precompressed-info-file
6301 (delete-file (string-append (assoc-ref %outputs "out")
6302 "/share/info/numdiff.info.gz"))
6304 (home-page "https://nongnu.org/numdiff/")
6305 (synopsis "Compare files with numeric fields")
6307 "Numdiff compares files line by line and field by field, ignoring small
6308 numeric differences and differences in numeric formats.")
6309 (license license:gpl3+)))
6317 (uri (string-append "https://gforge.inria.fr/frs/download.php/file"
6318 "/38367/why3-" version ".tar.gz"))
6321 "1n0a2nn1gnk0zg339lh698g4wpk7m8m1vyi2yvifd5adqvk4milw"))))
6322 (build-system ocaml-build-system)
6328 `(("camlzip" ,camlzip)
6329 ("ocaml-graph" ,ocaml-graph)
6330 ("ocaml-menhir" ,ocaml-menhir)
6331 ("ocaml-num" ,ocaml-num)
6332 ("ocaml-zarith" ,ocaml-zarith)))
6334 `(("coq-flocq" ,coq-flocq)
6335 ("emacs-minimal" ,emacs-minimal)
6339 (modify-phases %standard-phases
6340 (add-before 'configure 'fix-configure
6342 (setenv "CONFIG_SHELL" (which "sh"))
6343 (substitute* "configure"
6344 ;; find ocaml-num in the correct directory
6345 (("\\$DIR/nums.cma") "$DIR/num.cma")
6346 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
6348 (add-after 'configure 'fix-makefile
6350 (substitute* "Makefile"
6351 ;; find ocaml-num in the correct directory
6352 (("site-lib/num") "site-lib"))
6354 (add-after 'install 'install-lib
6356 (invoke "make" "byte")
6357 (invoke "make" "install-lib")
6359 (home-page "http://why3.lri.fr")
6360 (synopsis "Deductive program verification")
6361 (description "Why3 provides a language for specification and programming,
6362 called WhyML, and relies on external theorem provers, both automated and
6363 interactive, to discharge verification conditions. Why3 comes with a standard
6364 library of logical theories (integer and real arithmetic, Boolean operations,
6365 sets and maps, etc.) and basic programming data structures (arrays, queues,
6366 hash tables, etc.). A user can write WhyML programs directly and get
6367 correct-by-construction OCaml programs through an automated extraction
6368 mechanism. WhyML is also used as an intermediate language for the verification
6369 of C, Java, or Ada programs.")
6370 (license license:lgpl2.1)))
6372 (define-public frama-c
6378 (uri (string-append "http://frama-c.com/download/frama-c-"
6379 version "-Titanium.tar.gz"))
6382 "1mq1fijka95ydrla486yr4w6wdl9l7vmp512s1q00b0p6lmfwmkh"))))
6383 (build-system ocaml-build-system)
6385 `(#:tests? #f; no test target in Makefile
6387 (modify-phases %standard-phases
6388 (add-before 'configure 'export-shell
6389 (lambda* (#:key inputs #:allow-other-keys)
6390 (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
6396 `(("ocaml-biniou" ,ocaml-biniou)
6397 ("ocaml-easy-format" ,ocaml-easy-format)
6398 ("ocaml-graph" ,ocaml-graph)
6399 ("ocaml-yojson" ,ocaml-yojson)
6400 ("ocaml-zarith" ,ocaml-zarith)
6402 (native-search-paths
6403 (list (search-path-specification
6404 (variable "FRAMAC_SHARE")
6405 (files '("share/frama-c"))
6407 (search-path-specification
6408 (variable "FRAMAC_LIB")
6409 (files '("lib/frama-c"))
6411 (home-page "http://frama-c.com")
6412 (synopsis "C source code analysis platform")
6413 (description "Frama-C is an extensible and collaborative platform dedicated
6414 to source-code analysis of C software. The Frama-C analyzers assist you in
6415 various source-code-related activities, from the navigation through unfamiliar
6416 projects up to the certification of critical software.")
6417 (license license:lgpl2.1+)))