1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nikita <nikita@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
35 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020, 2021 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
41 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
42 ;;; Copyright © 2020, 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>
49 ;;; This file is part of GNU Guix.
51 ;;; GNU Guix is free software; you can redistribute it and/or modify it
52 ;;; under the terms of the GNU General Public License as published by
53 ;;; the Free Software Foundation; either version 3 of the License, or (at
54 ;;; your option) any later version.
56 ;;; GNU Guix is distributed in the hope that it will be useful, but
57 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
58 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59 ;;; GNU General Public License for more details.
61 ;;; You should have received a copy of the GNU General Public License
62 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
64 (define-module (gnu packages maths)
65 #:use-module (ice-9 regex)
66 #:use-module (ice-9 match)
67 #:use-module (gnu packages)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix git-download)
72 #:use-module (guix utils)
73 #:use-module ((guix build utils) #:select (alist-replace))
74 #:use-module (guix build-system cmake)
75 #:use-module (guix build-system glib-or-gtk)
76 #:use-module (guix build-system gnu)
77 #:use-module (guix build-system python)
78 #:use-module (guix build-system ruby)
79 #:use-module (gnu packages algebra)
80 #:use-module (gnu packages audio)
81 #:use-module (gnu packages autotools)
82 #:use-module (gnu packages base)
83 #:use-module (gnu packages bison)
84 #:use-module (gnu packages boost)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages cmake)
87 #:use-module (gnu packages compression)
88 #:use-module (gnu packages curl)
89 #:use-module (gnu packages cyrus-sasl)
90 #:use-module (gnu packages dbm)
91 #:use-module (gnu packages documentation)
92 #:use-module (gnu packages elf)
93 #:use-module (gnu packages file)
94 #:use-module (gnu packages flex)
95 #:use-module (gnu packages fltk)
96 #:use-module (gnu packages fontutils)
97 #:use-module (gnu packages gettext)
98 #:use-module (gnu packages gcc)
99 #:use-module (gnu packages gd)
100 #:use-module (gnu packages ghostscript)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages graphviz)
103 #:use-module (gnu packages gtk)
104 #:use-module (gnu packages icu4c)
105 #:use-module (gnu packages image)
106 #:use-module (gnu packages java)
107 #:use-module (gnu packages less)
108 #:use-module (gnu packages lisp)
109 #:use-module (gnu packages linux)
110 #:use-module (gnu packages llvm)
111 #:use-module (gnu packages logging)
112 #:use-module (gnu packages lua)
113 #:use-module (gnu packages gnome)
114 #:use-module (gnu packages guile)
115 #:use-module (gnu packages xorg)
116 #:use-module (gnu packages gl)
117 #:use-module (gnu packages imagemagick)
118 #:use-module (gnu packages m4)
119 #:use-module (gnu packages mpi)
120 #:use-module (gnu packages multiprecision)
121 #:use-module (gnu packages netpbm)
122 #:use-module (gnu packages onc-rpc)
123 #:use-module (gnu packages pcre)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages perl)
126 #:use-module (gnu packages pkg-config)
127 #:use-module (gnu packages pulseaudio)
128 #:use-module (gnu packages python)
129 #:use-module (gnu packages python-web)
130 #:use-module (gnu packages python-xyz)
131 #:use-module (gnu packages qt)
132 #:use-module (gnu packages readline)
133 #:use-module (gnu packages ruby)
134 #:use-module (gnu packages tbb)
135 #:use-module (gnu packages scheme)
136 #:use-module (gnu packages shells)
137 #:use-module (gnu packages tcl)
138 #:use-module (gnu packages texinfo)
139 #:use-module (gnu packages tex)
140 #:use-module (gnu packages tls)
141 #:use-module (gnu packages version-control)
142 #:use-module (gnu packages wxwidgets)
143 #:use-module (gnu packages xml)
144 #:use-module (srfi srfi-1)
145 #:use-module (srfi srfi-26))
153 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
155 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
156 (build-system gnu-build-system)
157 (inputs `(("gtk+" ,gtk+)
158 ("libxml2" ,libxml2)))
159 (native-inputs `(("pkg-config" ,pkg-config)))
160 (synopsis "Natural deduction first-order logic interface")
161 (description "Aris is a program for performing logical proofs. It supports
162 propositional and predicate logic, as well as Boolean algebra and
163 arithmetical logic. In addition to its predefined inference and equivalence
164 rules, Aris also supports references to older proofs. Its use of standard
165 logical symbols and its natural deduction interface make it easy to use for
167 (license license:gpl3+)
168 (home-page "https://www.gnu.org/software/aris/")))
170 (define-public c-graph
176 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
179 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
180 (build-system gnu-build-system)
182 `(("fortran" ,gfortran)))
183 (synopsis "Visualizing and demonstrating convolution")
185 "GNU C-Graph is a tool for demonstrating the theory of convolution.
186 Thus, it can serve as an excellent aid to students of signal and systems
187 theory in visualizing the convolution process. Rather than forcing the
188 student to write code, the program offers an intuitive interface with
189 interactive dialogs to guide them.")
190 (license license:gpl3+)
191 (home-page "https://www.gnu.org/software/c-graph/")))
200 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
201 version "/coda-" version ".tar.gz"))
203 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
204 (patches (search-patches "coda-use-system-libs.patch"))
205 (modules '((guix build utils)))
207 ;; Make sure we don't use the bundled software.
209 (for-each (lambda (d)
210 (delete-file-recursively (string-append "libcoda/" d)))
211 '("zlib" "pcre" "expat"))
214 `(("fortran" ,gfortran)
216 ("python-numpy" ,python-numpy)))
223 (build-system gnu-build-system)
225 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
226 "LIBS= -lz -lpcre -lexpat")))
227 (synopsis "A common interface to various earth observation data formats")
229 "The Common Data Access toolbox (CODA) provides a set of interfaces for
230 reading remote sensing data from earth observation data files. It consists of
231 command line applications and interfaces to the C, Fortran, Python, and Java
232 programming languages.")
233 (home-page "https://stcorp.nl/coda")
234 (license license:gpl2+)))
242 (uri (string-append "http://www.qhull.org/download/qhull-"
243 (car (string-split version #\.))
247 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
248 (build-system cmake-build-system)
249 (synopsis "Calculate convex hulls and related structures")
251 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
252 diagram, halfspace intersection about a point, furthest-site Delaunay
253 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
254 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
255 algorithm for computing the convex hull. It handles roundoff errors from
256 floating point arithmetic. It computes volumes, surface areas, and
257 approximations to the convex hull.
259 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
260 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
261 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
263 (home-page "http://qhull.org")
264 (license (license:non-copyleft "file://COPYING.txt"
265 "See COPYING in the distribution."))))
267 (define-public python-cvxopt
269 (name "python-cvxopt")
274 (url "https://github.com/cvxopt/cvxopt")
276 (file-name (git-file-name name version))
279 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
280 (build-system python-build-system)
283 (modify-phases %standard-phases
284 (add-after 'unpack 'find-libraries
285 (lambda* (#:key inputs #:allow-other-keys)
286 (setenv "CVXOPT_BLAS_LIB" "openblas")
287 (setenv "CVXOPT_BUILD_FFTW" "1")
288 (setenv "CVXOPT_BUILD_GLPK" "1")
289 (setenv "CVXOPT_BUILD_GSL" "1")
296 ("openblas" ,openblas)
297 ("suitesparse" ,suitesparse)))
298 (home-page "https://www.cvxopt.org")
299 (synopsis "Python library for convex optimization")
301 "CVXOPT is a package for convex optimization based on the Python
302 programming language. Its main purpose is to make the development of software
303 for convex optimization applications straightforward by building on Python’s
304 extensive standard library and on the strengths of Python as a high-level
305 programming language.")
306 (license license:gpl3+)))
308 (define-public python2-cvxopt
309 (package-with-python2 python-cvxopt))
317 (uri (string-append "mirror://gnu/units/units-" version
320 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
321 (build-system gnu-build-system)
323 `(("readline" ,readline)
324 ("python" ,python-wrapper) ;for 'units_cur' script
325 ("python-requests" ,python-requests)))
327 `(#:phases (modify-phases %standard-phases
328 (add-after 'install 'wrap-units_cur
329 (lambda* (#:key outputs #:allow-other-keys)
330 (let* ((out (assoc-ref outputs "out"))
331 (bin (string-append out "/bin")))
332 (wrap-program (string-append bin "/units_cur")
333 `("PYTHONPATH" ":" prefix
334 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
336 (synopsis "Conversion between thousands of scales")
338 "GNU Units converts numeric quantities between units of measure. It
339 can handle scale changes through adaptive usage of standard scale
340 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
341 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
342 enough to be used effectively as a scientific calculator.")
343 (license license:gpl3+)
344 (home-page "https://www.gnu.org/software/units/")))
346 (define-public double-conversion
348 (name "double-conversion")
350 (home-page "https://github.com/google/double-conversion")
353 (uri (git-reference (url home-page)
354 (commit (string-append "v" version))))
355 (file-name (git-file-name name version))
358 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
359 (build-system cmake-build-system)
361 '(#:test-target "test"
362 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
363 "-DBUILD_TESTING=ON")))
364 (synopsis "Conversion routines for IEEE doubles")
366 "The double-conversion library provides binary-decimal and decimal-binary
367 routines for IEEE doubles. The library consists of efficient conversion
368 routines that have been extracted from the V8 JavaScript engine.")
369 (license license:bsd-3)))
371 (define-public dionysus
377 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
381 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
382 (build-system gnu-build-system)
383 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
384 (synopsis "Local search for universal constants and scientific values")
386 "GNU Dionysus is a convenient system for quickly retrieving the values of
387 mathematical constants used in science and engineering. Values can be
388 searched using a simple command-line tool, choosing from three databases:
389 universal constants, atomic numbers, and constants related to
391 (license license:gpl3+)
392 (home-page "https://www.gnu.org/software/dionysus/")))
403 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
404 "dSFMT-src-" version ".tar.gz"))
407 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
408 (modules '((guix build utils)))
409 ;; Don't distribute html documentation with bundled jquery.
412 (delete-file-recursively "html") #t))
413 ;; Add patches borrowed from Julia.
419 "https://raw.githubusercontent.com/JuliaLang/julia/"
420 "v1.3.0/deps/patches/dSFMT.c.patch"))
422 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
423 (file-name "dSFMT.c.patch"))
427 "https://raw.githubusercontent.com/JuliaLang/julia/"
428 "v1.3.0/deps/patches/dSFMT.h.patch"))
430 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
431 (file-name "dSFMT.h.patch"))))))
432 (build-system gnu-build-system)
435 (modify-phases %standard-phases
436 (delete 'configure) ; no configure script
438 ;; Upstream Makefile does not build a shared library. Borrow from Julia
439 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
442 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
443 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
444 "-O3" "-finline-functions" "-fomit-frame-pointer"
445 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
446 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
447 "-o" "libdSFMT.so")))
448 (replace 'install ; no "install" target
449 (lambda* (#:key outputs #:allow-other-keys)
450 (let* ((out (assoc-ref outputs "out"))
451 (lib (string-append out "/lib"))
452 (inc (string-append out "/include"))
453 (doc (string-append out "/share/doc/" ,name "-" ,version)))
454 (install-file "libdSFMT.so" lib)
455 (install-file "dSFMT.h" inc)
456 (install-file "LICENSE.txt" doc)
458 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
460 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
461 the expensive conversion of integer to double (floating point). dSFMT directly
462 generates double precision floating point pseudorandom numbers which have the
463 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
464 format. dSFMT is only available on the CPUs which use IEEE 754 format double
465 precision floating point numbers.")
466 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
467 (license license:bsd-3)))
475 (uri (string-append "mirror://gnu/gsl/gsl-"
479 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
480 (build-system gnu-build-system)
482 (let ((system (%current-system)))
484 ((or (string-prefix? "aarch64" system)
485 (string-prefix? "powerpc" system))
486 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
487 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
488 '(#:phases (modify-phases %standard-phases
489 (add-before 'check 'disable-failing-tests
491 (substitute* "spmatrix/test.c"
492 ((".*test_complex.*") "\n"))
494 ((string-prefix? "i686" system)
495 ;; There are rounding issues with these tests on i686:
496 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
497 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
498 '(#:phases (modify-phases %standard-phases
499 (add-before 'check 'disable-failing-tests
501 (substitute* "linalg/test.c"
502 ((".*gsl_test\\(test_LU_decomp.*") "\n")
503 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
504 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
505 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
506 (substitute* "spmatrix/test.c"
507 ((".*test_all.*") "\n")
508 ((".*test_float.*") "\n")
509 ((".*test_complex.*") "\n"))
512 (home-page "https://www.gnu.org/software/gsl/")
513 (synopsis "Numerical library for C and C++")
515 "The GNU Scientific Library is a library for numerical analysis in C
516 and C++. It includes a wide range of mathematical routines, with over 1000
517 functions in total. Subject areas covered by the library include:
518 differential equations, linear algebra, Fast Fourier Transforms and random
520 (license license:gpl3+)))
530 (url "https://github.com/shibatch/sleef")
532 (file-name (git-file-name name version))
534 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
535 (build-system cmake-build-system)
537 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
538 (string-append "-DCMAKE_INSTALL_LIBDIR="
539 (assoc-ref %outputs "out")
541 (string-append "-DCMAKE_INSTALL_PREFIX="
542 (assoc-ref %outputs "out")))
544 (modify-phases %standard-phases
545 ;; SLEEF generates a header library during the build process and writes
546 ;; to it via shell redirection. Make the checkout writable so the
547 ;; build can succeed.
548 (add-after 'unpack 'make-git-checkout-writable
550 (for-each make-file-writable (find-files "."))
556 ("openssl" ,openssl)))
557 (home-page "https://sleef.org/")
558 (synopsis "SIMD library for evaluating elementary functions and DFT")
560 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
561 implements vectorized versions of all C99 real floating point math functions.
562 It can utilize SIMD instructions that are available on modern processors.")
563 (license (list license:boost1.0 ;sleef
564 license:cc-by4.0)))) ;simplex algorithm
573 (uri (string-append "mirror://gnu/glpk/glpk-"
577 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
578 (build-system gnu-build-system)
582 `(#:configure-flags '("--with-gmp"
583 "--disable-static")))
584 (home-page "https://www.gnu.org/software/glpk/")
585 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
587 "GLPK is a C library for solving large-scale linear programming (LP),
588 mixed integer programming (MIP), and other related problems. It supports the
589 GNU MathProg modeling language, a subset of the AMPL language, and features a
590 translator for the language. In addition to the C library, a stand-alone
591 LP/MIP solver is included in the package.")
592 (license license:gpl3+)))
594 (define-public glpk-4
602 (uri (string-append "mirror://gnu/glpk/glpk-"
606 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
615 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
617 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
619 "/4ti2-" version ".tar.gz"))
621 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
622 (build-system gnu-build-system)
624 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
628 (home-page "http://www.4ti2.de/")
629 (synopsis "Mathematical tool suite for problems on linear spaces")
631 "4ti2 implements algorithms for solving algebraic, geometric and
632 combinatorial problems on linear spaces. Among others, it solves systems
633 of linear equations, computes extreme rays of polyhedral cones, solves
634 integer programming problems and computes Markov bases for statistics.")
635 (license license:gpl2+)))
637 (define-public cddlib
644 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
645 (string-delete #\. version) ".tar.gz"))
648 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
649 (build-system gnu-build-system)
652 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
653 (synopsis "Library for convex hulls and extreme rays of polyhedra")
655 "The C-library cddlib implements the Double Description Method of
656 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
657 rays of a general convex polyhedron given by a system of linear inequalities
658 in arbitrary dimension. It can also be used for the converse operation of
659 computing convex hulls.")
660 (license license:gpl2+)))
662 (define-public lrslib
669 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
671 (string-delete #\. version) ".tar.gz"))
674 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
675 (build-system gnu-build-system)
679 `(#:tests? #f ; no check phase
680 #:make-flags `("CC=gcc"
681 ,(string-append "prefix=" (assoc-ref %outputs "out"))
684 (modify-phases %standard-phases
687 (substitute* "makefile"
688 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
690 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
691 (synopsis "Convex hulls of polyhedra with exact arithmetic")
693 "The C code of lrslib implements the reverse search algorithm for
694 vertex enumeration and convex hull problems. Its input file format is
695 compatible with cddlib. All computations are done exactly in either
696 multiple precision or fixed integer arithmetic. Output is not stored
697 in memory, so even problems with very large output sizes can sometimes
699 (license license:gpl2+)))
701 (define-public libcerf
709 (url "https://jugit.fz-juelich.de/mlz/libcerf")
710 (commit (string-append "v" version))))
711 (file-name (git-file-name name version))
713 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
714 (build-system cmake-build-system)
717 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
718 (synopsis "Library for complex error functions")
720 "@code{libcerf} is a self-contained numeric library that provides an
721 efficient and accurate implementation of complex error functions, along with
722 Dawson, Faddeeva, and Voigt functions.")
723 (license license:expat)))
732 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
733 "vinci/vinci-" version ".tar.gz"))
736 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
737 (build-system gnu-build-system)
739 `(("lrslib" ,lrslib)))
741 `(#:tests? #f ; no check phase
743 (modify-phases %standard-phases
745 ;; register the lrs location in the config file
746 (lambda* (#:key inputs #:allow-other-keys)
747 (let* ((lrs (assoc-ref inputs "lrslib"))
748 (lrsexec (string-append lrs "/bin/lrs")))
749 (substitute* "vinci.h"
750 (("#define LRS_EXEC \"lrs\"")
751 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
754 (lambda* (#:key outputs #:allow-other-keys)
755 (let* ((out (assoc-ref outputs "out"))
756 (bin (string-append out "/bin")))
757 (install-file "vinci" bin))
760 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
761 (synopsis "Volume computation for polytopes")
763 "Vinci implements a number of volume computation algorithms for convex
764 polytopes in arbitrary dimension. The polytopes can be given by their
765 V-representation (as the convex hull of a finite number of vertices), by
766 their H-representation (as the bounded intersection of a finite number of
767 halfspaces) or by their double description with both representations.")
768 (license license:gpl2+)))
770 (define-public arpack-ng
774 (home-page "https://github.com/opencollab/arpack-ng")
777 (uri (git-reference (url home-page) (commit version)))
778 (file-name (git-file-name name version))
781 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
782 (build-system gnu-build-system)
784 `(("autoconf" ,autoconf)
785 ("automake" ,automake)
787 ("pkg-config" ,pkg-config)))
791 ("fortran" ,gfortran)))
792 (synopsis "Fortran subroutines for solving eigenvalue problems")
794 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
795 large scale eigenvalue problems.")
796 (license (license:non-copyleft "file://COPYING"
797 "See COPYING in the distribution."))))
799 (define-public arpack-ng-3.3.0
803 (name (package-name arpack-ng))
804 (home-page (package-home-page arpack-ng))
808 (uri (string-append home-page "/archive/" version ".tar.gz"))
809 (file-name (string-append name "-" version ".tar.gz"))
812 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
814 (define-public arpack-ng-openmpi
815 (package (inherit arpack-ng)
816 (name "arpack-ng-openmpi")
819 ,@(package-inputs arpack-ng)))
821 (substitute-keyword-arguments (package-arguments arpack-ng)
822 ((#:configure-flags _ '())
824 ((#:phases phases '%standard-phases)
825 `(modify-phases ,phases
826 (add-before 'check 'mpi-setup
828 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
830 (define-public lapack
837 (uri (string-append "http://www.netlib.org/lapack/lapack-"
841 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
842 (build-system cmake-build-system)
843 (home-page "http://www.netlib.org/lapack/")
844 (inputs `(("fortran" ,gfortran)
845 ("python" ,python-wrapper)))
847 `(#:configure-flags (list
848 "-DBUILD_SHARED_LIBS:BOOL=YES"
850 ;; Build the 'LAPACKE_clatms' functions.
851 "-DLAPACKE_WITH_TMG=ON"
852 "-DBUILD_TESTING=ON")))
853 (synopsis "Library for numerical linear algebra")
855 "LAPACK is a Fortran 90 library for solving the most commonly occurring
856 problems in numerical linear algebra.")
857 (license (license:non-copyleft "file://LICENSE"
858 "See LICENSE in the distribution."))))
860 (define-public clapack
867 (uri (string-append "http://www.netlib.org/clapack/clapack-"
868 version "-CMAKE.tgz"))
871 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
872 (build-system cmake-build-system)
875 (modify-phases %standard-phases
876 ;; These tests use a lot of stack variables and segfault without
877 ;; lifting resource limits.
878 (add-after 'unpack 'disable-broken-tests
880 (substitute* "TESTING/CMakeLists.txt"
881 (("add_lapack_test.* xeigtstz\\)") ""))
884 (lambda* (#:key outputs #:allow-other-keys)
885 (let* ((out (assoc-ref outputs "out"))
886 (libdir (string-append out "/lib"))
887 (f2cinc (string-append out "/include/libf2c")))
890 (for-each (lambda (file)
891 (install-file file libdir))
893 "F2CLIBS/libf2c/libf2c.a"
894 "TESTING/MATGEN/libtmglib.a"
895 "BLAS/SRC/libblas.a"))
896 (for-each (lambda (file)
897 (install-file file f2cinc))
898 (cons "F2CLIBS/libf2c/arith.h"
899 (find-files (string-append "../clapack-"
900 ,version "-CMAKE/F2CLIBS/libf2c")
902 (copy-recursively (string-append "../clapack-"
903 ,version "-CMAKE/INCLUDE")
904 (string-append out "/include"))
906 (home-page "https://www.netlib.org/clapack/")
907 (synopsis "Numerical linear algebra library for C")
909 "The CLAPACK library was built using a Fortran to C conversion utility
910 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
911 C code, and then modified to improve readability. CLAPACK's goal is to
912 provide LAPACK for someone who does not have access to a Fortran compiler.")
913 (license (license:non-copyleft "file://LICENSE"
914 "See LICENSE in the distribution."))))
916 (define-public scalapack
923 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
927 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
928 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
929 (build-system cmake-build-system)
932 ("fortran" ,gfortran)
933 ("lapack" ,lapack))) ;for testing only
935 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
936 #:phases (modify-phases %standard-phases
937 (add-before 'check 'mpi-setup
939 (home-page "http://www.netlib.org/scalapack/")
940 (synopsis "Library for scalable numerical linear algebra")
942 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
943 routines on parallel distributed memory machines. ScaLAPACK solves dense and
944 banded linear systems, least squares problems, eigenvalue problems, and
945 singular value problems.")
946 (license (license:non-copyleft "file://LICENSE"
947 "See LICENSE in the distribution."))))
949 (define-public gnuplot
955 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
959 (base32 "03jrqs5lvxmbbz2c4g17dn2hrxqwd3hfadk9q8wbkbkyas2h8sbb"))))
960 (build-system gnu-build-system)
961 (inputs `(("readline" ,readline)
967 `(("pkg-config" ,pkg-config)
968 ("texlive" ,texlive-tiny)))
969 (arguments `(#:configure-flags (list (string-append
970 "--with-texdir=" %output
971 "/texmf-local/tex/latex/gnuplot"))
972 ;; Plot on a dumb terminal during tests.
973 #:make-flags '("GNUTERM=dumb")))
974 (home-page "http://www.gnuplot.info")
975 (synopsis "Command-line driven graphing utility")
976 (description "Gnuplot is a portable command-line driven graphing
977 utility. It was originally created to allow scientists and students to
978 visualize mathematical functions and data interactively, but has grown to
979 support many non-interactive uses such as web scripting. It is also used as a
980 plotting engine by third-party applications like Octave.")
981 ;; X11 Style with the additional restriction that derived works may only be
982 ;; distributed as patches to the original.
983 (license (license:fsf-free
984 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
994 (url "https://github.com/OkoSanto/GCTP")
995 (commit (string-append "v" version))))
996 (file-name (git-file-name name version))
998 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1000 `(("fortran" ,gfortran)))
1001 (build-system gnu-build-system)
1002 (synopsis "General Cartographic Transformation Package (GCTP)")
1004 "The General Cartographic Transformation Package (GCTP) is a system of
1005 software routines designed to permit the transformation of coordinate pairs
1006 from one map projection to another. The GCTP is the standard computer
1007 software used by the National Mapping Division for map projection
1009 (home-page "https://github.com/OkoSanto/GCTP")
1010 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1019 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1020 version "/src/hdf-" version ".tar.bz2"))
1022 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1023 (patches (search-patches "hdf4-architectures.patch"
1024 "hdf4-reproducibility.patch"
1025 "hdf4-shared-fortran.patch"
1026 "hdf4-tirpc.patch"))))
1027 (build-system gnu-build-system)
1029 `(("gfortran" ,gfortran)
1034 ("libjpeg" ,libjpeg-turbo)
1035 ("libtirpc" ,libtirpc)))
1037 `(#:parallel-tests? #f
1038 #:configure-flags (list "--enable-shared"
1039 (string-append "CPPFLAGS=-I"
1040 (assoc-ref %build-inputs "libtirpc")
1043 (modify-phases %standard-phases
1044 ;; This is inspired by two of Debian's patches.
1045 (add-before 'configure 'add-more-aarch64-support
1047 (substitute* '("mfhdf/ncgen/ncgen.l"
1048 "mfhdf/ncgen/ncgenyy.c"
1049 "mfhdf/libsrc/netcdf.h.in")
1050 (("AIX5L64") "__aarch64__"))
1052 (add-before 'configure 'patchbuild
1055 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1057 (("/bin/mkdir") "mkdir"))
1058 (substitute* (find-files "." "^Makefile\\.in$")
1059 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1060 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1061 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1062 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1063 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1065 (add-after 'configure 'patch-settings
1067 ;; libhdf4.settings contains the full path of the
1068 ;; compilers used, and its contents are included in
1069 ;; .so-files. We truncate the hashes to avoid
1070 ;; unnecessary store references to those compilers:
1071 (substitute* "libhdf4.settings"
1072 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1073 (string-append prefix (string-take hash 10) "...")))
1075 (add-after 'install 'provide-absolute-libjpeg-reference
1076 (lambda* (#:key inputs outputs #:allow-other-keys)
1077 (let ((out (assoc-ref outputs "out"))
1078 (libjpeg (assoc-ref inputs "libjpeg")))
1079 ;; libjpeg-turbo does not provide a .la file, so libtool is
1080 ;; unable to add an absolute reference for -ljpeg in the .la
1081 ;; files. Fix it manually to avoid having to propagate it.
1082 (substitute* (find-files (string-append out "/lib") "\\.la$")
1084 (string-append "-L" libjpeg "/lib -ljpeg")))
1086 (home-page "https://www.hdfgroup.org/products/hdf4/")
1088 "Library and multi-object file format for storing and managing data")
1089 (description "HDF4 is a library and multi-object file format for storing
1090 and managing data between machines. HDF4 is an older hierarchical data format,
1091 incompatible with HDF5.")
1093 (license:non-copyleft
1094 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1096 (define-public hdf4-alt
1101 (substitute-keyword-arguments (package-arguments hdf4)
1102 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1104 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1106 (define-public hdf5-1.8
1113 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1114 "hdf5-" (version-major+minor version)
1115 "/hdf5-" version "/src/hdf5-"
1117 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1119 (match (string-split version #\.)
1120 ((major minor _ ...)
1121 (string-append major minor)))
1122 "/src/hdf5-" version ".tar.bz2")))
1124 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1125 (patches (search-patches "hdf5-config-date.patch"))))
1126 (build-system gnu-build-system)
1130 `(("gfortran" ,gfortran)
1131 ("perl" ,perl))) ;part of the test machinery needs Perl
1132 (outputs '("out" ; core library
1133 "fortran")) ; fortran interface
1135 `(;; Some of the users, notably Flann, need the C++ interface.
1136 #:configure-flags '("--enable-cxx"
1138 "--enable-fortran2003"
1140 ;; Build a thread-safe library. Unfortunately,
1141 ;; 'configure' invites you to either turn off C++,
1142 ;; Fortran, and the high-level interface (HL), or
1143 ;; to pass '--enable-unsupported'. Debian
1144 ;; packagers chose to pass '--enable-unsupported'
1145 ;; and we follow their lead here.
1146 "--enable-threadsafe"
1148 "--enable-unsupported")
1149 ;; Use -fPIC to allow the R bindings to link with the static libraries
1150 #:make-flags (list "CFLAGS=-fPIC"
1153 (modify-phases %standard-phases
1154 (add-before 'configure 'patch-configure
1155 (lambda* (#:key outputs #:allow-other-keys)
1156 (substitute* "configure"
1158 (substitute* "fortran/src/Makefile.in"
1159 (("libhdf5_fortran_la_LDFLAGS =")
1160 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1161 (assoc-ref outputs "fortran") "/lib")))
1162 (substitute* "hl/fortran/src/Makefile.in"
1163 (("libhdf5hl_fortran_la_LDFLAGS =")
1164 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1165 (assoc-ref outputs "fortran") "/lib")))
1167 (add-after 'configure 'patch-settings
1169 ;; libhdf5.settings contains the full path of the
1170 ;; compilers used, and its contents are included in
1171 ;; libhdf5.so. We truncate the hashes to avoid
1172 ;; unnecessary store references to those compilers:
1173 (substitute* "src/libhdf5.settings"
1174 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1175 (string-append prefix (string-take hash 10) "..."))
1176 ;; Don't record the build-time kernel version to make the
1177 ;; settings file reproducible.
1178 (("Uname information:.*")
1179 "Uname information: Linux\n"))
1181 (add-after 'install 'patch-references
1182 (lambda* (#:key inputs outputs #:allow-other-keys)
1183 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1184 (zlib (assoc-ref inputs "zlib")))
1185 (substitute* (find-files bin "h5p?cc")
1187 (string-append "-L" zlib "/lib " lib)))
1189 (add-after 'install 'split
1190 (lambda* (#:key inputs outputs #:allow-other-keys)
1191 ;; Move all fortran-related files
1192 (let* ((out (assoc-ref outputs "out"))
1193 (bin (string-append out "/bin"))
1194 (lib (string-append out "/lib"))
1195 (inc (string-append out "/include"))
1196 (ex (string-append out "/share/hdf5_examples/fortran"))
1197 (fort (assoc-ref outputs "fortran"))
1198 (fbin (string-append fort "/bin"))
1199 (flib (string-append fort "/lib"))
1200 (finc (string-append fort "/include"))
1201 (fex (string-append fort "/share/hdf5_examples/fortran")))
1206 ;; Note: When built with --enable-parallel, the 'h5fc' file
1207 ;; doesn't exist, hence this condition.
1208 (when (file-exists? (string-append bin "/h5fc"))
1209 (rename-file (string-append bin "/h5fc")
1210 (string-append fbin "/h5fc")))
1211 (for-each (lambda (file)
1213 (string-append flib "/" (basename file))))
1214 (find-files lib ".*fortran.*"))
1215 (for-each (lambda (file)
1217 (string-append finc "/" (basename file))))
1218 (find-files inc ".*mod"))
1219 (for-each (lambda (file)
1221 (string-append fex "/" (basename file))))
1222 (find-files ex ".*"))
1223 (delete-file-recursively ex))
1225 (home-page "https://www.hdfgroup.org")
1226 (synopsis "Management suite for extremely large and complex data")
1227 (description "HDF5 is a suite that makes possible the management of
1228 extremely large and complex data collections.")
1229 (license (license:x11-style
1230 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1232 (define-public hdf5-1.10
1233 (package/inherit hdf5-1.8
1238 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1239 "hdf5-" (version-major+minor version)
1240 "/hdf5-" version "/src/hdf5-"
1242 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1244 (apply string-append
1245 (take (string-split version #\.) 2))
1246 "/src/hdf5-" version ".tar.bz2")))
1248 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1249 (patches (search-patches "hdf5-config-date.patch"))))))
1251 (define-public hdf5-1.12
1252 (package/inherit hdf5-1.8
1257 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1258 "hdf5-" (version-major+minor version)
1259 "/hdf5-" version "/src/hdf5-"
1261 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1263 (apply string-append
1264 (take (string-split version #\.) 2))
1265 "/src/hdf5-" version ".tar.bz2")))
1267 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1268 (patches (search-patches "hdf5-config-date.patch"))))))
1271 ;; Default version of HDF5.
1274 (define-public hdf-java
1282 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1283 version "/src/CMake-hdfjava-" version ".tar.gz"))
1285 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1286 (modules '((guix build utils)))
1287 (snippet ; Make sure we don't use the bundled sources and binaries.
1289 (for-each delete-file
1290 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1291 "HDF4.tar.gz" "HDF5.tar.gz"))
1292 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1294 (build-system gnu-build-system)
1296 `(("jdk" ,icedtea "jdk")
1297 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1299 ("hamcrest-core" ,java-hamcrest-core)
1300 ("junit" ,java-junit)
1301 ("slf4j-simple" ,java-slf4j-simple)))
1306 ("libjpeg" ,libjpeg-turbo)
1307 ("slf4j-api" ,java-slf4j-api)))
1310 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1311 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1312 (assoc-ref %build-inputs "jdk") "/lib" )
1313 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1314 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1317 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1318 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1319 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1320 (string-append "JPEGLIB="
1321 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1325 (modify-phases %standard-phases
1326 (add-before 'configure 'chdir-to-source
1327 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1328 (add-before 'configure 'patch-build
1329 (lambda* (#:key inputs outputs #:allow-other-keys)
1330 (substitute* "configure"
1331 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1332 (("/bin/cat") (which "cat")))
1333 ;; Set classpath for compilation
1334 (substitute* '("hdf/hdf5lib/Makefile.in"
1335 "hdf/hdf5lib/exceptions/Makefile.in"
1336 "hdf/hdflib/Makefile.in")
1337 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1338 (string-append (assoc-ref inputs "slf4j-api")
1339 "/share/java/slf4j-api.jar")))
1340 ;; Replace outdated config.sub and config.guess:
1341 (with-directory-excursion "config"
1342 (for-each (lambda (file)
1344 (string-append (assoc-ref inputs "automake")
1346 ,(version-major+minor (package-version automake))
1348 '("config.sub" "config.guess")))
1350 ;; Fix embedded version number
1351 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1352 (substitute* "hdf/hdf5lib/H5.java"
1354 (string-join hdf5version ", "))))
1356 (mkdir-p (string-append (assoc-ref outputs "out")))
1357 ;; Set classpath for tests
1358 (let* ((build-dir (getcwd))
1359 (lib (string-append build-dir "/lib"))
1360 (jhdf (string-append lib "/jhdf.jar"))
1361 (jhdf5 (string-append lib "/jhdf5.jar"))
1365 (string-append (assoc-ref inputs i)
1366 "/share/java/" i ".jar"))
1367 '("slf4j-api" "slf4j-simple"))
1369 (car (find-files (assoc-ref inputs "junit") "jar$"))
1370 (car (find-files (assoc-ref inputs "hamcrest-core")
1373 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1375 (substitute* '("test/hdf5lib/Makefile.in"
1376 "test/hdf5lib/junit.sh.in"
1377 "examples/runExample.sh.in")
1379 (string-append (assoc-ref inputs "coreutils")
1382 (string-append (assoc-ref inputs "coreutils")
1384 (("CLASSPATH=[^\n]*")
1385 (string-append "CLASSPATH=" class-path)))
1386 (setenv "CLASSPATH" class-path))
1388 (add-before 'check 'build-examples
1390 (apply invoke `("javac"
1391 ,@(find-files "examples" ".*\\.java"))))))
1393 #:parallel-build? #f
1395 #:parallel-tests? #f ))
1396 (home-page "https://support.hdfgroup.org/products/java")
1397 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1398 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1399 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1402 ;; BSD-style license:
1403 (license (license:x11-style
1404 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1405 /current/src/unpacked/COPYING"))))
1407 (define-public hdf-eos2
1414 (uri "ftp://edhs1.gsfc.nasa.gov\
1415 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1417 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1418 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1419 "hdf-eos2-build-shared.patch"
1420 "hdf-eos2-fortrantests.patch"))))
1421 (build-system gnu-build-system)
1423 `(("gfortran" ,gfortran)))
1425 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1426 ;; XXX: These inputs are really dependencies of hdf4.
1428 ("libjpeg" ,libjpeg-turbo)
1429 ("libtirpc" ,libtirpc)
1433 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1434 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1435 #:parallel-tests? #f))
1436 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1437 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1438 (description "HDF-EOS2 is a software library built on HDF4 which supports
1439 the construction of data structures used in NASA's Earth Observing
1440 System (Grid, Point and Swath).")
1442 ;; Source files carry a permissive license header.
1443 (license (license:non-copyleft home-page))))
1445 (define-public hdf-eos5
1451 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1452 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1455 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1456 (patches (search-patches "hdf-eos5-build-shared.patch"
1457 "hdf-eos5-remove-gctp.patch"
1458 "hdf-eos5-fix-szip.patch"
1459 "hdf-eos5-fortrantests.patch"))))
1461 `(("gfortran" ,gfortran)))
1462 (build-system gnu-build-system)
1464 `(("hdf5" ,hdf5-1.8)
1468 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1469 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1470 #:parallel-tests? #f))
1471 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1473 "HDF-EOS5 is a software library built on HDF5 to support the construction
1474 of data structures used in NASA's Earth Observing System (Grid, Point and
1476 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1478 ;; Source files carry a permissive license header.
1479 (license (license:non-copyleft home-page))))
1481 (define-public hdf5-parallel-openmpi
1482 (package/inherit hdf5-1.10 ;use the latest
1483 (name "hdf5-parallel-openmpi")
1486 ,@(package-inputs hdf5)))
1488 (substitute-keyword-arguments (package-arguments hdf5)
1489 ((#:configure-flags flags)
1490 ``("--enable-parallel"
1491 ,@(delete "--enable-cxx"
1492 (delete "--enable-threadsafe" ,flags))))
1494 `(modify-phases ,phases
1495 (add-after 'build 'mpi-setup
1497 (add-before 'check 'patch-tests
1499 ;; OpenMPI's mpirun will exit with non-zero status if it
1500 ;; detects an "abnormal termination", i.e. any process not
1501 ;; calling MPI_Finalize(). Since the test is explicitly
1502 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1503 ;; H5C_flush_cache from being called, mpirun will always
1504 ;; complain, so turn this test off.
1505 (substitute* "testpar/Makefile"
1506 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1507 (string-append front back "\n")))
1508 (substitute* "tools/test/h5diff/testph5diff.sh"
1509 (("/bin/sh") (which "sh")))
1511 (synopsis "Management suite for data with parallel IO support")))
1513 (define-public hdf5-blosc
1521 (url "https://github.com/Blosc/hdf5-blosc")
1522 (commit (string-append "v" version))))
1523 (file-name (git-file-name name version))
1525 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1526 (build-system cmake-build-system)
1529 (list (string-append "-DBLOSC_INSTALL_DIR="
1530 (assoc-ref %build-inputs "c-blosc"))
1531 (string-append "-DPLUGIN_INSTALL_PATH="
1532 (assoc-ref %outputs "out")
1533 "/hdf5/lib/plugin"))
1535 (modify-phases %standard-phases
1536 (add-after 'unpack 'do-not-build-blosc
1538 (substitute* "CMakeLists.txt"
1539 (("set\\(BLOSC_INSTALL_DIR.*") "")
1540 (("ExternalProject_Add\\(project_blosc") "message("))
1543 `(("c-blosc" ,c-blosc)
1544 ("hdf5" ,hdf5-1.10)))
1545 (home-page "https://github.com/Blosc/hdf5-blosc")
1546 (synopsis "Filter for HDF5 using the Blosc compressor")
1547 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1548 installing this filter, you can read and write HDF5 files with
1549 Blosc-compressed datasets.")
1550 (license license:expat)))
1552 (define-public h5check
1559 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1560 "h5check/src/h5check-" version ".tar.gz"))
1563 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1564 (build-system gnu-build-system)
1565 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1566 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1567 (synopsis "HDF5 format checker")
1568 (description "@code{h5check} is a validation tool for verifying that an
1569 HDF5 file is encoded according to the HDF File Format Specification.")
1570 (license (license:x11-style "file://COPYING"))))
1578 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1583 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1584 (build-system cmake-build-system)
1585 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1586 (inputs `(("lapack" ,lapack)
1588 ;; FIXME: Even though the fonts are available dvips complains:
1589 ;; "Font cmmi10 not found; characters will be left blank."
1591 `(("texlive" ,texlive-tiny)
1592 ("ghostscript" ,ghostscript)
1593 ("doxygen" ,doxygen)))
1594 (home-page "http://itpp.sourceforge.net")
1595 (synopsis "C++ library of maths, signal processing and communication classes")
1596 (description "IT++ is a C++ library of mathematical, signal processing and
1597 communication classes and functions. Its main use is in simulation of
1598 communication systems and for performing research in the area of
1599 communications. The kernel of the library consists of generic vector and
1600 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1601 similar to MATLAB, GNU Octave or SciPy.")
1602 (license license:gpl3+)))
1604 (define-public netcdf
1612 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1613 "netcdf-c-" version ".tar.gz"))
1616 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1617 (patches (search-patches "netcdf-date-time.patch"))))
1618 (build-system gnu-build-system)
1621 ("doxygen" ,doxygen)
1622 ("graphviz" ,graphviz)))
1624 `(("hdf4" ,hdf4-alt)
1628 ("libjpeg" ,libjpeg-turbo)))
1630 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1632 #:phases (modify-phases %standard-phases
1633 (add-before 'configure 'fix-source-date
1635 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1636 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1637 ;; to '1st hour of the current day', and therefore makes the
1638 ;; package not reproducible.
1639 (substitute* "./configure"
1640 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1641 "date --date='@0'"))
1643 (add-after 'configure 'patch-settings
1645 ;; libnetcdf.settings contains the full filename of the compilers
1646 ;; used to build the library. We truncate the hashes of those
1647 ;; filenames to avoid unnecessary references to the corresponding
1649 (substitute* "libnetcdf.settings"
1650 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1651 (string-append prefix (string-take hash 10) "...")))
1654 #:parallel-tests? #f)) ;various race conditions
1655 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1656 (synopsis "Library for scientific data")
1657 (description "NetCDF is an interface for scientific data access and a
1658 software library that provides an implementation of the interface. The netCDF
1659 library defines a machine-independent format for representing scientific data.
1660 Together, the interface, library, and format support the creation, access, and
1661 sharing of scientific data.")
1662 (license (license:x11-style "file://COPYRIGHT"))))
1664 (define-public netcdf-parallel-openmpi
1665 (package (inherit netcdf)
1666 (name "netcdf-parallel-openmpi")
1669 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1670 (package-inputs netcdf))))
1671 ;; TODO: Replace pkg-config references in nc-config with absolute references
1673 (substitute-keyword-arguments (package-arguments netcdf)
1674 ((#:configure-flags flags)
1675 `(cons* "CC=mpicc" "CXX=mpicxx"
1676 "--enable-parallel-tests"
1677 ;; Shared libraries not supported with parallel IO.
1678 "--disable-shared" "--with-pic"
1680 ((#:phases phases '%standard-phases)
1681 `(modify-phases ,phases
1682 (add-after 'build 'mpi-setup
1683 ,%openmpi-setup)))))))
1685 (define-public netcdf-fortran
1687 (name "netcdf-fortran")
1692 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1696 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1697 (build-system gnu-build-system)
1699 `(#:parallel-tests? #f))
1701 `(("netcdf" ,netcdf)))
1703 `(("gfortran" ,gfortran)))
1704 (synopsis "Fortran interface for the netCDF library")
1705 (description (package-description netcdf))
1706 (home-page (package-home-page netcdf))
1707 (license (package-license netcdf))))
1709 (define-public nlopt
1715 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1718 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1719 (build-system gnu-build-system)
1721 `(;; Shared libraries are not built by default. They are required to
1722 ;; build the Guile, Octave, and Python bindings.
1723 #:configure-flags '("--enable-shared")
1726 (modify-phases %standard-phases
1727 (add-before 'configure 'set-libnlopt-file-name
1728 (lambda* (#:key outputs #:allow-other-keys)
1729 ;; Make sure the Scheme module refers to the library by its
1730 ;; absolute file name (we cannot do that from a snippet
1731 ;; because the expansion of @libdir@ contains
1733 (let ((out (assoc-ref outputs "out")))
1734 (substitute* "swig/nlopt.scm.in"
1736 (string-append out "/lib/libnlopt")))
1738 (inputs `(("guile" ,guile-2.0)))
1739 (native-inputs `(("pkg-config" ,pkg-config)))
1740 (home-page "http://ab-initio.mit.edu/wiki/")
1741 (synopsis "Library for nonlinear optimization")
1742 (description "NLopt is a library for nonlinear optimization, providing a
1743 common interface for a number of different free optimization routines available
1744 online as well as original implementations of various other algorithms.")
1745 (license license:lgpl2.1+)))
1747 (define-public ipopt
1754 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1758 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1759 (modules '((guix build utils)))
1761 ;; Make sure we don't use the bundled software.
1763 (delete-file-recursively "ThirdParty")
1765 (build-system gnu-build-system)
1767 '(#:phases (modify-phases %standard-phases
1768 (add-after 'install 'add--L-flags-in-ipopt.pc
1769 (lambda* (#:key inputs outputs #:allow-other-keys)
1770 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1771 ;; move it to "Libs.private" where it belongs, and add a
1772 ;; '-L' flag for LAPACK.
1773 (let ((out (assoc-ref outputs "out"))
1774 (lapack (assoc-ref inputs "lapack")))
1775 (substitute* (string-append out "/lib/pkgconfig/"
1777 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1778 (string-append "Libs: " before " " after "\n"
1779 "Libs.private: " before
1780 "-L" lapack "/lib -llapack -lblas "
1784 `(("gfortran" ,gfortran)))
1786 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1787 `(("lapack" ,lapack))) ;for both libblas and liblapack
1788 (home-page "https://www.coin-or.org")
1789 (synopsis "Large-scale nonlinear optimizer")
1791 "The Interior Point Optimizer (IPOPT) is a software package for
1792 large-scale nonlinear optimization. It provides C++, C, and Fortran
1794 (license license:epl1.0)))
1802 (uri (string-append "https://www.coin-or.org/download/source/"
1803 "Clp/Clp-" version ".tgz"))
1806 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1807 (modules '((guix build utils)))
1809 ;; Make sure we don't use the bundled software.
1811 (delete-file-recursively "ThirdParty")
1813 (build-system gnu-build-system)
1815 `(("gfortran" ,gfortran)
1816 ("pkg-config" ,pkg-config)))
1818 `(("openblas" ,openblas)))
1819 (home-page "https://www.coin-or.org")
1820 (synopsis "Linear programming solver")
1822 "CLP is a high quality linear programming solver. Its main strengths are
1823 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1824 linear and quadratic objectives. There are limited facilities for nonlinear
1825 and quadratic objectives using the Simplex algorithm.")
1826 (license license:epl1.0)))
1828 (define-public libflame
1832 (outputs '("out" "static"))
1837 (url "https://github.com/flame/libflame")
1839 (file-name (git-file-name name version))
1842 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1843 (build-system gnu-build-system)
1846 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1847 (list "--enable-dynamic-build"
1848 "--enable-max-arg-list-hack"
1849 "--enable-lapack2flame"
1850 "--enable-verbose-make-output"
1851 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1852 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1855 '("--enable-vector-intrinsics=sse")
1857 "--enable-supermatrix"
1858 "--enable-memory-alignment=16"
1859 "--enable-ldim-alignment")
1861 (modify-phases %standard-phases
1862 (add-after 'unpack 'patch-/usr/bin/env-bash
1864 (substitute* "build/config.mk.in"
1865 (("/usr/bin/env bash") (which "bash")))
1868 (lambda* (#:key tests? #:allow-other-keys)
1869 (substitute* "test/Makefile"
1870 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1871 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1873 (with-directory-excursion "test"
1876 (invoke "./test_libflame.x"))
1878 (add-after 'install 'install-static
1879 (lambda* (#:key outputs #:allow-other-keys)
1880 (let ((out (assoc-ref outputs "out"))
1881 (static (assoc-ref outputs "static")))
1882 (mkdir-p (string-append static "/lib"))
1883 (rename-file (string-append out "/lib/libflame.a")
1884 (string-append static "/lib/libflame.a"))
1885 (install-file (string-append out "/include/FLAME.h")
1886 (string-append static "/include"))
1889 `(("gfortran" ,gfortran)))
1891 `(("lapack" ,lapack)
1892 ("openblas" ,openblas)
1894 ("python" ,python-wrapper)))
1895 (home-page "https://github.com/flame/libflame")
1896 (synopsis "High-performance object-based library for DLA computations")
1897 (description "@code{libflame} is a portable library for dense matrix
1898 computations, providing much of the functionality present in LAPACK, developed
1899 by current and former members of the @acronym{SHPC, Science of High-Performance
1900 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1901 Computational Engineering and Sciences} at The University of Texas at Austin.
1902 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1903 includes a complete LAPACK implementation.")
1904 (license license:bsd-3)))
1906 (define-public ceres
1908 (name "ceres-solver")
1910 (home-page "http://ceres-solver.org/")
1913 (uri (string-append home-page "ceres-solver-"
1917 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1918 (build-system cmake-build-system)
1920 ;; TODO: Build HTML user documentation and install separately.
1921 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1922 "-DBUILD_SHARED_LIBS=ON")
1924 #:phases (modify-phases %standard-phases
1925 (add-before 'configure 'set-library-directory
1927 ;; Install libraries to lib/, not lib64/.
1928 (substitute* "internal/ceres/CMakeLists.txt"
1929 (("set\\(LIB_SUFFIX \"64\"\\)")
1930 "set(LIB_SUFFIX \"\")"))
1933 `(("pkg-config" ,pkg-config)))
1935 `(("glog" ,glog))) ;for #include <glog/glog.h>
1940 ("suitesparse" ,suitesparse)
1941 ("gflags" ,gflags)))
1942 (synopsis "C++ library for solving large optimization problems")
1944 "Ceres Solver is a C++ library for modeling and solving large,
1945 complicated optimization problems. It is a feature rich, mature and
1946 performant library which has been used in production since 2010. Ceres Solver
1947 can solve two kinds of problems:
1949 @item non-linear least squares problems with bounds constraints;
1950 @item general unconstrained optimization problems.
1952 (license license:bsd-3)))
1954 ;; For a fully featured Octave, users are strongly recommended also to install
1955 ;; the following packages: less, ghostscript, gnuplot.
1956 (define-public octave-cli
1963 (uri (string-append "mirror://gnu/octave/octave-"
1967 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
1968 (build-system gnu-build-system)
1970 `(("alsa-lib" ,alsa-lib)
1971 ("arpack" ,arpack-ng)
1977 ("fontconfig" ,fontconfig)
1978 ("freetype" ,freetype)
1982 ("graphicsmagick" ,graphicsmagick)
1984 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1985 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1986 ;; libtiff.la instead of having to provide it here.
1987 ("libjpeg" ,libjpeg-turbo)
1991 ("libsndfile" ,libsndfile)
1995 ("portaudio" ,portaudio)
1997 ("readline" ,readline)
1998 ("suitesparse" ,suitesparse)
1999 ("texinfo" ,texinfo)
2002 `(("gfortran" ,gfortran)
2003 ("pkg-config" ,pkg-config)
2005 ;; The following inputs are not actually used in the build process.
2006 ;; However, the ./configure gratuitously tests for their existence and
2007 ;; assumes that programs not present at build time are also not, and
2008 ;; can never be, available at run time! If these inputs are therefore
2009 ;; not present, support for them will be built out. However, Octave
2010 ;; will still run without them, albeit without the features they
2013 ("ghostscript" ,ghostscript)
2014 ("gnuplot" ,gnuplot)))
2015 ;; Octave code uses this variable to detect directories holding multiple CA
2016 ;; certificates to verify peers with. This is required for the networking
2017 ;; functions that require encryption to work properly.
2018 (native-search-paths
2019 (list (search-path-specification
2020 (variable "CURLOPT_CAPATH")
2021 (files '("etc/ssl/certs")))))
2024 (list (string-append "--with-shell="
2025 (assoc-ref %build-inputs "bash")
2028 ;; XXX: Without this flag, linking octave-cli fails with
2029 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2030 ;; not pulling in liboctinterp.la for -lstdc++.
2031 "--enable-link-all-dependencies")
2033 (modify-phases %standard-phases
2034 (add-after 'configure 'configure-makeinfo
2035 (lambda* (#:key inputs #:allow-other-keys)
2036 (substitute* "libinterp/corefcn/help.h"
2039 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2041 (home-page "https://www.gnu.org/software/octave/")
2042 (synopsis "High-level language for numerical computation (no GUI)")
2043 (description "GNU Octave is a high-level interpreted language that is
2044 specialized for numerical computations. It can be used for both linear and
2045 non-linear applications and it provides great support for visualizing results.
2046 Work may be performed both at the interactive command-line as well as via
2048 (license license:gpl3+)))
2050 (define-public octave
2051 (package (inherit octave-cli)
2054 `(("qscintilla" ,qscintilla)
2056 ,@(package-inputs octave-cli)))
2058 `(("qttools" , qttools) ;for lrelease
2059 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2060 ,@(package-native-inputs octave-cli)))
2062 (substitute-keyword-arguments (package-arguments octave-cli)
2064 `(modify-phases ,phases
2065 (add-before 'configure 'patch-qscintilla-library-name
2066 (lambda* (#:key inputs #:allow-other-keys)
2067 ;; The QScintilla library that the Octave configure script tries
2068 ;; to link with should be named libqscintilla-qt5.so, but the
2069 ;; QScintilla input provides the shared library as
2070 ;; libqscintilla2_qt5.so.
2071 (substitute* "configure"
2072 (("qscintilla2-qt5")
2075 (synopsis "High-level language for numerical computation (with GUI)")))
2077 (define-public opencascade-oce
2079 (name "opencascade-oce")
2085 (url "https://github.com/tpaviot/oce")
2086 (commit (string-append "OCE-" version))))
2087 (file-name (git-file-name name version))
2088 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2090 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2091 (build-system cmake-build-system)
2094 (list "-DOCE_TESTING:BOOL=ON"
2095 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2096 "-DOCE_DRAW:BOOL=ON"
2097 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2098 (assoc-ref %outputs "out"))
2099 "-UCMAKE_INSTALL_RPATH")))
2101 `(("freetype" ,freetype)
2108 `(("python" ,python-wrapper)))
2109 (home-page "https://github.com/tpaviot/oce")
2110 (synopsis "Libraries for 3D modeling and numerical simulation")
2112 "Open CASCADE is a set of libraries for the development of applications
2113 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2114 C++ class libraries providing services for 3D surface and solid modeling, CAD
2115 data exchange, and visualization. It is used for development of specialized
2116 software dealing with 3D models in design (CAD), manufacturing (CAM),
2117 numerical simulation (CAE), measurement equipment (CMM), and quality
2118 control (CAQ) domains.
2120 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2121 patches, improvements, and experiments contributed by users over the official
2122 Open CASCADE library.")
2123 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2124 ; use of header files; see
2125 ; OCCT_LGPL_EXCEPTION.txt
2126 license:public-domain; files
2127 ; src/Standard/Standard_StdAllocator.hxx and
2128 ; src/NCollection/NCollection_StdAllocator.hxx
2129 license:expat; file src/OpenGl/OpenGl_glext.h
2130 license:bsd-3)))); test framework gtest
2132 (define-public opencascade-occt
2134 (name "opencascade-occt")
2140 (url "https://git.dev.opencascade.org/repos/occt.git")
2143 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2145 (file-name (git-file-name name version))
2147 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2148 (modules '((guix build utils)))
2151 ;; Remove files specific to non-free operating systems.
2152 (delete-file-recursively "samples/ios")
2153 (delete-file-recursively "samples/mfc")
2154 (delete-file-recursively "samples/qt/FuncDemo")
2155 (delete-file "genconf.bat")
2156 (delete-file "gendoc.bat")
2157 (delete-file "genproj.bat")
2158 (delete-file "upgrade.bat")
2159 ;; Remove references to deleted files.
2160 (substitute* "dox/FILES_HTML.txt"
2161 ((".*standard.*") "" )
2162 ((".*UIKitSample.*") ""))
2164 (build-system cmake-build-system)
2166 '(;; There is no test target for make. OCCT provides an
2167 ;; 'Automated Testing System', which may be accessed after
2168 ;; installation via the draw.sh script. draw.sh is located in
2169 ;; the bin directory. For details see:
2170 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2171 ;; occt_dev_guides__tests.html
2173 ;; Configure without freeimage: attempting to link against the
2174 ;; freeimage version 3.17 library leads to 'undefined
2175 ;; reference' errors.
2177 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2179 "-DUSE_VTK:BOOL=OFF"
2180 "-DBUILD_DOC_Overview:BOOL=OFF"
2181 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2182 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2183 "-UCMAKE_INSTALL_LIBDIR")))
2185 `(("doxygen" ,doxygen)
2186 ;("freeimage" ,freeimage)
2187 ("freetype" ,freetype)
2189 ("libxext" ,libxext)
2196 ;; TODO: build Overview documentation and add 'doc' output.
2197 (home-page "https://www.opencascade.com")
2198 (synopsis "Libraries for 3D modeling and numerical simulation")
2200 "Open CASCADE is a set of libraries for the development of applications
2201 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2202 C++ class libraries providing services for 3D surface and solid modeling, CAD
2203 data exchange, and visualization. It is used for development of specialized
2204 software dealing with 3D models in design (CAD), manufacturing (CAM),
2205 numerical simulation (CAE), measurement equipment (CMM), and quality
2206 control (CAQ) domains.
2208 This is the certified version of the Open Cascade Technology (OCCT) library.")
2209 (license (list ;; OCCT library:
2210 license:lgpl2.1; with an exception for the use of header
2211 ; files, see OCCT_LGPL_EXCEPTION.txt.
2212 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2213 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2215 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2216 ;; src/StepFile/step.tab.*:
2217 license:gpl3+ ; with Bison 2.2 exception.
2218 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2219 (license:non-copyleft
2220 "https://www.unicode.org/license.html")
2221 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2222 license:public-domain))))
2232 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2234 (string-append "gmsh_"
2235 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2237 (file-name (git-file-name name version))
2239 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2240 (modules '((guix build utils)))
2243 (delete-file-recursively "contrib/metis")
2245 (build-system cmake-build-system)
2248 ("gfortran" ,gfortran)
2255 ("opencascade-occt" ,opencascade-occt)
2257 ("libxext" ,libxext)))
2259 `(("fontconfig" ,fontconfig)
2260 ("libxft" ,libxft)))
2262 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2263 "-DENABLE_BUILD_SHARED:BOOL=ON"
2264 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2265 (home-page "http://gmsh.info/")
2266 (synopsis "3D finite element grid generator")
2267 (description "Gmsh is a 3D finite element grid generator with a built-in
2268 CAD engine and post-processor. Its design goal is to provide a fast, light
2269 and user-friendly meshing tool with parametric input and advanced
2270 visualization capabilities. Gmsh is built around four modules: geometry,
2271 mesh, solver and post-processing. The specification of any input to these
2272 modules is done either interactively using the graphical user interface or in
2273 ASCII text files using Gmsh's own scripting language.")
2274 (license license:gpl2+)))
2276 (define-public veusz
2283 (uri (pypi-uri "veusz" version))
2285 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2286 (build-system python-build-system)
2288 `(;; Tests will fail because they depend on optional packages like
2289 ;; python-astropy, which is not packaged.
2292 (modify-phases %standard-phases
2293 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2294 ;; the path is defined in Guix, therefore we have to change it.
2295 (add-after 'unpack 'fix-sip-dir
2297 (substitute* "pyqtdistutils.py"
2298 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2300 ;; Now we have to pass the correct sip_dir to setup.py.
2302 (lambda* (#:key inputs #:allow-other-keys)
2303 ;; We need to tell setup.py where to locate QtCoremod.sip
2304 ((@@ (guix build python-build-system) call-setuppy)
2306 (list (string-append "--sip-dir="
2307 (assoc-ref inputs "python-pyqt")
2310 ;; Ensure that icons are found at runtime.
2311 (add-after 'install 'wrap-executable
2312 (lambda* (#:key inputs outputs #:allow-other-keys)
2313 (let ((out (assoc-ref outputs "out")))
2314 (wrap-program (string-append out "/bin/veusz")
2315 `("QT_PLUGIN_PATH" prefix
2316 ,(list (string-append (assoc-ref inputs "qtsvg")
2317 "/lib/qt5/plugins/"))))))))))
2319 `(("pkg-config" ,pkg-config)
2320 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2321 ("qttools" ,qttools)
2322 ("python-sip" ,python-sip-4)))
2324 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2325 ("python-dbus" ,python-dbus)
2326 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2327 ("python-pyqt" ,python-pyqt)
2331 `(("python-numpy" ,python-numpy)))
2332 (home-page "https://veusz.github.io/")
2333 (synopsis "Scientific plotting package")
2335 "Veusz is a scientific plotting and graphing program with a graphical
2336 user interface, designed to produce publication-ready 2D and 3D plots. In
2337 addition it can be used as a module in Python for plotting. It supports
2338 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2339 (license license:gpl2+)))
2341 (define-public maxflow
2344 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2345 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2350 (url "https://github.com/gerddie/maxflow")
2352 (file-name (git-file-name name version))
2355 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2356 (build-system cmake-build-system)
2357 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2358 (synopsis "Library implementing Maxflow algorithm")
2359 (description "An implementation of the maxflow algorithm described in
2360 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2361 Energy Minimization in Computer Vision.\n
2362 Yuri Boykov and Vladimir Kolmogorov.\n
2363 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2365 (license license:gpl3+)))
2367 (define-public petsc
2374 ;; The *-lite-* tarball does not contain the *large* documentation
2375 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2376 "petsc-lite-" version ".tar.gz"))
2378 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2379 (outputs '("out" ; libraries and headers
2380 "examples")) ; ~30MiB of examples
2381 (build-system gnu-build-system)
2383 `(("python" ,python-2)))
2385 `(("gfortran" ,gfortran)
2387 ("superlu" ,superlu)
2388 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2389 ;; leaving out opengl, as configuration seems to only be for mac
2392 `(#:test-target "test"
2393 #:parallel-build? #f ; build is parallel by default
2399 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2400 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2401 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2403 (modify-phases %standard-phases
2405 ;; PETSc's configure script is actually a python script, so we can't
2406 ;; run it with bash.
2407 (lambda* (#:key outputs (configure-flags '())
2409 (let* ((prefix (assoc-ref outputs "out"))
2410 (flags `(,(string-append "--prefix=" prefix)
2411 ,@configure-flags)))
2412 (format #t "build directory: ~s~%" (getcwd))
2413 (format #t "configure flags: ~s~%" flags)
2414 (apply invoke "./configure" flags))))
2415 (add-after 'configure 'clean-local-references
2416 (lambda* (#:key outputs #:allow-other-keys)
2417 (let ((out (assoc-ref outputs "out")))
2418 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2419 ;; Prevent build directory from leaking into compiled code
2421 ;; Scrub timestamp for reproducibility
2422 ((".*Libraries compiled on.*") ""))
2423 (substitute* (find-files "." "petscvariables")
2424 ;; Do not expose build machine characteristics, set to defaults.
2425 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2426 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2428 (add-after 'install 'clean-install
2429 ;; Try to keep installed files from leaking build directory names.
2430 (lambda* (#:key inputs outputs #:allow-other-keys)
2431 (let ((out (assoc-ref outputs "out")))
2432 (substitute* (map (lambda (file)
2433 (string-append out "/lib/petsc/conf/" file))
2434 '("petscvariables"))
2436 ;; Make compiler references point to the store
2437 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2438 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2439 (string-append "= " (which compiler))))
2440 ;; PETSc installs some build logs, which aren't necessary.
2441 (for-each (lambda (file)
2442 (let ((f (string-append out "/lib/petsc/conf/" file)))
2443 (when (file-exists? f)
2445 '("configure.log" "make.log" "gmake.log"
2446 "test.log" "error.log" "RDict.db"
2447 "PETScBuildInternal.cmake"
2448 ;; Once installed, should uninstall with Guix
2451 (add-after 'install 'move-examples
2452 (lambda* (#:key outputs #:allow-other-keys)
2453 (let* ((out (assoc-ref outputs "out"))
2454 (examples (assoc-ref outputs "examples"))
2455 (exdir (string-append out "/share/petsc/examples"))
2456 (exdir' (string-append examples "/share/petsc/examples")))
2457 (copy-recursively exdir exdir')
2458 (delete-file-recursively exdir)
2460 (home-page "https://www.mcs.anl.gov/petsc")
2461 (synopsis "Library to solve PDEs")
2462 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2463 data structures and routines for the scalable (parallel) solution of
2464 scientific applications modeled by partial differential equations.")
2465 (license (license:non-copyleft
2466 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2468 (define-public petsc-complex
2469 (package (inherit petsc)
2470 (name "petsc-complex")
2472 (substitute-keyword-arguments (package-arguments petsc)
2473 ((#:configure-flags cf)
2474 `(cons "--with-scalar-type=complex" ,cf))))
2475 (synopsis "Library to solve PDEs (with complex scalars)")))
2477 (define-public petsc-openmpi
2478 (package (inherit petsc)
2479 (name "petsc-openmpi")
2481 `(("hdf5" ,hdf5-parallel-openmpi)
2482 ("hypre" ,hypre-openmpi)
2484 ("mumps" ,mumps-openmpi)
2485 ("openmpi" ,openmpi)
2486 ("scalapack" ,scalapack)
2487 ("scotch" ,pt-scotch32)
2488 ,@(package-inputs petsc)))
2490 (substitute-keyword-arguments (package-arguments petsc)
2491 ((#:configure-flags cf)
2493 "--with-mpiexec=mpirun"
2496 "--with-scalapack=1"
2498 ,(string-append "--with-mpi-dir="
2499 (assoc-ref %build-inputs "openmpi"))
2500 ,(string-append "--with-hdf5-include="
2501 (assoc-ref %build-inputs "hdf5") "/include")
2502 ,(string-append "--with-hdf5-lib="
2503 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2504 ,@(delete "--with-mpi=0" ,cf)))
2506 `(modify-phases ,phases
2507 (add-before 'configure 'mpi-setup
2508 ,%openmpi-setup)))))
2509 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2511 (define-public petsc-complex-openmpi
2512 (package (inherit petsc-complex)
2513 (name "petsc-complex-openmpi")
2515 `(("openmpi" ,openmpi)
2516 ,@(package-inputs petsc-complex)))
2518 (substitute-keyword-arguments (package-arguments petsc-complex)
2519 ((#:configure-flags cf)
2520 ``("--with-mpiexec=mpirun"
2521 ,(string-append "--with-mpi-dir="
2522 (assoc-ref %build-inputs "openmpi"))
2523 ,@(delete "--with-mpi=0" ,cf)))
2525 `(modify-phases ,phases
2526 (add-before 'configure 'mpi-setup
2527 ,%openmpi-setup)))))
2528 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2530 (define-public python-petsc4py
2532 (name "python-petsc4py")
2537 (uri (pypi-uri "petsc4py" version))
2540 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2541 (modules '((guix build utils)))
2544 ;; Ensure source file is regenerated in the build phase.
2545 (delete-file "src/petsc4py.PETSc.c")
2546 ;; Remove legacy GC code. See
2547 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2548 (substitute* "src/PETSc/cyclicgc.pxi"
2549 ((".*gc_refs.*") "" )
2550 ((".*PyGC_Head.*") ""))
2552 (build-system python-build-system)
2555 (modify-phases %standard-phases
2556 (add-before 'build 'pre-build
2558 ;; Define path to PETSc installation.
2559 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2561 (add-before 'check 'mpi-setup
2564 `(("python-cython" ,python-cython)))
2566 `(("petsc" ,petsc-openmpi)
2567 ("python-numpy" ,python-numpy)))
2568 (home-page "https://bitbucket.org/petsc/petsc4py/")
2569 (synopsis "Python bindings for PETSc")
2570 (description "PETSc, the Portable, Extensible Toolkit for
2571 Scientific Computation, is a suite of data structures and routines for
2572 the scalable (parallel) solution of scientific applications modeled by
2573 partial differential equations. It employs the MPI standard for all
2574 message-passing communication. @code{petsc4py} provides Python
2575 bindings to almost all functions of PETSc.")
2576 (license license:bsd-3)))
2578 (define-public python-kiwisolver
2580 (name "python-kiwisolver")
2584 (uri (pypi-uri "kiwisolver" version))
2587 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2588 (build-system python-build-system)
2589 (home-page "https://github.com/nucleic/kiwi")
2590 (synopsis "Fast implementation of the Cassowary constraint solver")
2592 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2593 solving algorithm. Kiwi has been designed from the ground up to be
2594 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2595 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2596 savings are consistently > 5x.")
2597 (license license:bsd-3)))
2599 (define-public python2-kiwisolver
2600 (package-with-python2 python-kiwisolver))
2602 (define-public slepc
2609 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2613 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2614 (build-system gnu-build-system)
2616 `(("python" ,python-2)
2617 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2619 `(("arpack" ,arpack-ng)
2620 ("gfortran" ,gfortran)))
2622 `(("petsc" ,petsc)))
2624 `(#:parallel-build? #f ;build is parallel by default
2626 `(,(string-append "--with-arpack-dir="
2627 (assoc-ref %build-inputs "arpack") "/lib"))
2628 #:make-flags ;honor (parallel-job-count)
2629 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2630 ,(string-append "PETSCCONFIGDIR="
2631 (assoc-ref %build-inputs "petsc:examples")
2632 "/share/petsc/examples/config"))
2634 (modify-phases %standard-phases
2636 ;; configure is a python script, so we can't run it with bash.
2637 (lambda* (#:key inputs outputs (configure-flags '())
2639 (let* ((prefix (assoc-ref outputs "out"))
2640 (flags `(,(string-append "--prefix=" prefix)
2641 ,@configure-flags)))
2642 (format #t "build directory: ~s~%" (getcwd))
2643 (format #t "configure flags: ~s~%" flags)
2644 (setenv "SLEPC_DIR" (getcwd))
2645 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2646 (apply invoke "./configure" flags))))
2647 (add-after 'install 'delete-doc
2648 ;; TODO: SLEPc installs HTML documentation alongside headers in
2649 ;; $out/include. We'd like to move them to share/doc, but delete
2650 ;; them for now, as they are incomplete and installing the complete
2651 ;; documentation is difficult.
2652 (lambda* (#:key outputs #:allow-other-keys)
2653 (let* ((out (assoc-ref outputs "out")))
2654 (for-each delete-file (find-files out "\\.html$"))
2656 (add-after 'install 'clean-install
2657 ;; Clean up unnecessary build logs from installation.
2658 (lambda* (#:key outputs #:allow-other-keys)
2659 (let ((out (assoc-ref outputs "out")))
2660 (for-each (lambda (file)
2661 (let ((f (string-append out "/lib/slepc/conf/" file)))
2662 (when (file-exists? f)
2664 '("configure.log" "make.log" "gmake.log"
2665 "test.log" "error.log" "RDict.db"
2668 (home-page "https://slepc.upv.es")
2669 (synopsis "Scalable library for eigenproblems")
2670 (description "SLEPc is a software library for the solution of large sparse
2671 eigenproblems on parallel computers. It can be used for the solution of
2672 linear eigenvalue problems formulated in either standard or generalized form,
2673 as well as other related problems such as the singular value decomposition.
2674 The emphasis of the software is on methods and techniques appropriate for
2675 problems in which the associated matrices are sparse, for example, those
2676 arising after the discretization of partial differential equations.")
2677 (license license:bsd-2)))
2679 (define-public slepc-complex
2680 (package (inherit slepc)
2681 (name "slepc-complex")
2683 `(("petsc" ,petsc-complex)
2684 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2685 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2687 (define-public slepc-openmpi
2688 (package (inherit slepc)
2689 (name "slepc-openmpi")
2691 (substitute-keyword-arguments (package-arguments slepc)
2692 ((#:phases phases '%standard-phases)
2693 `(modify-phases ,phases
2694 (add-before 'check 'mpi-setup
2695 ,%openmpi-setup)))))
2698 ("arpack" ,arpack-ng-openmpi)
2699 ,@(alist-delete "arpack" (package-inputs slepc))))
2701 `(("petsc" ,petsc-openmpi)
2702 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2703 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2705 (define-public slepc-complex-openmpi
2706 (package (inherit slepc-openmpi)
2707 (name "slepc-complex-openmpi")
2709 `(("petsc" ,petsc-complex-openmpi)
2710 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2711 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2713 (define-public python-slepc4py
2715 (name "python-slepc4py")
2720 (uri (pypi-uri "slepc4py" version))
2723 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2724 (build-system python-build-system)
2727 (modify-phases %standard-phases
2728 (add-before 'build 'pre-build
2730 ;; Define path to PETSc installation.
2731 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2732 ;; Define path to SLEPc installation.
2733 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2735 (add-before 'check 'mpi-setup
2738 `(("python-numpy" ,python-numpy)
2739 ("python-petsc4py" ,python-petsc4py)
2740 ("slepc" ,slepc-openmpi)))
2741 (home-page "https://bitbucket.org/slepc/slepc4py/")
2742 (synopsis "Python bindings for SLEPc")
2743 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2744 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2745 Scientific Computation. It employs the MPI standard for all
2746 message-passing communication. @code{slepc4py} provides Python
2747 bindings to almost all functions of SLEPc.")
2748 (license license:bsd-3)))
2750 (define-public metamath
2758 (url "https://github.com/metamath/metamath-exe")
2759 (commit (string-append "v" version))))
2760 (file-name (git-file-name name version))
2762 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2763 (build-system gnu-build-system)
2765 `(("autoconf" ,autoconf)
2766 ("automake" ,automake)))
2767 (home-page "http://us.metamath.org/")
2768 (synopsis "Proof verifier based on a minimalistic formalism")
2770 "Metamath is a tiny formal language and that can express theorems in
2771 abstract mathematics, with an accompyaning @command{metamath} executable that
2772 verifies databases of these proofs. There is a public database,
2773 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2774 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2775 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2776 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2778 (license license:gpl2+)))
2780 (define-public mumps
2787 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2791 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2792 (patches (search-patches "mumps-build-parallelism.patch"
2793 "mumps-shared-libseq.patch"
2794 "mumps-shared-mumps.patch"
2795 "mumps-shared-pord.patch"))))
2796 (build-system gnu-build-system)
2798 `(("fortran" ,gfortran)
2799 ;; These are required for linking against mumps, but we let the user
2800 ;; declare the dependency.
2803 ("scotch" ,scotch)))
2805 `(#:modules ((ice-9 match)
2808 ,@%gnu-build-system-modules)
2810 (modify-phases %standard-phases
2812 (lambda* (#:key inputs #:allow-other-keys)
2813 (call-with-output-file "Makefile.inc"
2824 INCSEQ = -I$(topdir)/libseq
2825 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2826 LIBSEQNEEDED = libseqneeded~;
2830 AR = ar vr # rules require trailing space, ugh...
2833 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2835 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2836 LIBOTHERS = -pthread
2839 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2843 LIBS = $(SCALAP) $(LIBSEQ)
2844 LPORDDIR = $(topdir)/PORD/lib
2845 IPORD = -I$(topdir)/PORD/include
2846 LPORD = $(LPORDDIR)/libpord.a
2847 ORDERINGSF = -Dpord~@[
2849 IMETIS = -I$(METISDIR)/include
2850 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2851 ORDERINGSF += -Dmetis~]~@[~:{
2853 ISCOTCH = -I$(SCOTCHDIR)/include
2854 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2855 ORDERINGSF += ~a~}~]
2856 ORDERINGSC = $(ORDERINGSF)
2857 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2858 IORDERINGSF = $(ISCOTCH)
2859 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2860 (assoc-ref inputs "mpi")
2861 (assoc-ref inputs "blas")
2862 (assoc-ref inputs "scalapack")
2863 (assoc-ref inputs "metis")
2864 (match (list (assoc-ref inputs "pt-scotch")
2865 (assoc-ref inputs "scotch"))
2869 `((,scotch "" "-Dscotch")))
2872 "-lptesmumps -lptscotch -lptscotcherr "
2873 "-Dptscotch")))))))))
2875 ;; By default only the d-precision library is built. Make with "all"
2876 ;; target so that all precision libraries and examples are built.
2878 (invoke "make" "all"
2879 (format #f "-j~a" (parallel-job-count)))))
2881 ;; Run the simple test drivers, which read test input from stdin:
2882 ;; from the "real" input for the single- and double-precision
2883 ;; testers, and from the "cmplx" input for complex-precision
2884 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2885 ;; package to prefix execution with "mpirun".
2886 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2887 (with-directory-excursion "examples"
2890 (let ((tester (apply open-pipe*
2893 ,(string-append "./" prec
2895 (input (open-input-file
2896 (string-append "input_simpletest_" type))))
2898 (dump-port input tester)
2900 (zero? (close-pipe tester)))))
2902 '("real" "real" "cmplx" "cmplx")))))
2904 (lambda* (#:key outputs #:allow-other-keys)
2905 (let* ((out (assoc-ref outputs "out"))
2906 (libdir (string-append out "/lib")))
2907 (copy-recursively "lib" libdir)
2908 (copy-recursively "include" (string-append out "/include"))
2909 (when (file-exists? "libseq/libmpiseq.a")
2910 (install-file "libseq/libmpiseq.a" libdir))
2911 (when (file-exists? "libseq/libmpiseq.so")
2912 (install-file "libseq/libmpiseq.so" libdir))
2914 (home-page "http://mumps.enseeiht.fr")
2915 (synopsis "Multifrontal sparse direct solver")
2917 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2918 sparse system of linear equations A x = b using Gaussian elimination.")
2919 (license license:cecill-c)))
2921 (define-public mumps-metis
2922 (package (inherit mumps)
2923 (name "mumps-metis")
2925 (alist-delete "scotch" (package-inputs mumps)))))
2927 (define-public mumps-openmpi
2928 (package (inherit mumps)
2929 (name "mumps-openmpi")
2932 ("scalapack" ,scalapack)
2933 ("pt-scotch" ,pt-scotch)
2934 ,@(alist-delete "scotch" (package-inputs mumps))))
2936 (substitute-keyword-arguments (package-arguments mumps)
2938 `(modify-phases ,phases
2939 (add-before 'check 'mpi-setup
2943 ((assoc-ref ,phases 'check)
2944 #:exec-prefix '("mpirun" "-n" "2"))))))))
2945 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2947 (define-public mumps-metis-openmpi
2948 (package (inherit mumps-openmpi)
2949 (name "mumps-metis-openmpi")
2951 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2953 (define-public ruby-asciimath
2955 (name "ruby-asciimath")
2960 (uri (rubygems-uri "asciimath" version))
2963 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2964 (build-system ruby-build-system)
2966 `(("ruby-nokogiri" ,ruby-nokogiri)
2967 ("ruby-rspec" ,ruby-rspec)))
2968 (synopsis "AsciiMath parsing and conversion library")
2970 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2971 easy-to-write markup language for mathematics.")
2972 (home-page "https://github.com/asciidoctor/asciimath")
2973 (license license:expat)))
2975 (define-public superlu
2982 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2983 "superlu_" version ".tar.gz"))
2985 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
2986 (modules '((guix build utils)))
2988 ;; Replace the non-free implementation of MC64 with a stub adapted
2991 (use-modules (ice-9 regex)
2993 (call-with-output-file "SRC/mc64ad.c"
2998 void mc64id_(int *a) {
2999 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3002 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3003 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3004 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3007 ;; Remove the corresponding license verbiage. MC64 license follows
3008 ;; a "------" line separator.
3009 (with-atomic-file-replacement "License.txt"
3010 (let ((rx (make-regexp "-{8}")))
3013 (let ((line (read-line in 'concat)))
3014 (unless (regexp-exec rx line)
3018 (build-system cmake-build-system)
3022 `(("blas" ,openblas)
3023 ("gfortran" ,gfortran)))
3025 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3026 "-DTPL_BLAS_LIBRARIES=openblas"
3027 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3028 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3029 (synopsis "Supernodal direct solver for sparse linear systems")
3031 "SuperLU is a general purpose library for the direct solution of large,
3032 sparse, nonsymmetric systems of linear equations on high performance machines.
3033 The library is written in C and is callable from either C or Fortran. The
3034 library routines perform an LU decomposition with partial pivoting and
3035 triangular system solves through forward and back substitution. The library
3036 also provides threshold-based ILU factorization preconditioners.")
3037 (license (list license:bsd-3
3038 license:gpl2+ ;EXAMPLE/*fgmr.c
3039 (license:fsf-free "file://SRC/colamd.h")))))
3041 (define-public superlu-dist
3043 (name "superlu-dist")
3049 (url "https://github.com/xiaoyeli/superlu_dist")
3050 (commit (string-append "v" version))))
3051 (file-name (git-file-name name version))
3053 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3054 (modules '((guix build utils)))
3056 ;; Replace the non-free implementation of MC64 with a stub
3058 (make-file-writable "SRC/mc64ad_dist.c")
3059 (call-with-output-file "SRC/mc64ad_dist.c"
3064 void mc64id_dist(int *a) {
3065 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3068 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3069 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3070 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3073 (substitute* "SRC/util.c" ;adjust default algorithm
3074 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3075 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3076 ;; general (i.e. non-square) processor-grid support.
3077 "RowPerm = NOROWPERM;"))
3079 (patches (search-patches "superlu-dist-scotchmetis.patch"
3080 "superlu-dist-awpm-grid.patch"))))
3081 (build-system cmake-build-system)
3085 `(("gfortran" ,gfortran)
3088 ("combblas" ,combinatorial-blas)))
3090 `(("mpi" ,openmpi) ;headers include MPI heades
3091 ("parmetis" ,pt-scotch32 "metis")
3092 ("pt-scotch" ,pt-scotch32)))
3094 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3095 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3096 "-DTPL_ENABLE_COMBBLASLIB=YES"
3097 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3098 "-DTPL_LAPACK_LIBRARIES=-llapack"
3099 (string-append "-DTPL_PARMETIS_LIBRARIES="
3101 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3102 "scotchmetis" "scotch" "scotcherr")
3104 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3105 (assoc-ref %build-inputs "parmetis")
3107 "-DTPL_ENABLE_COMBBLASLIB=ON"
3108 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3109 (assoc-ref %build-inputs "combblas")
3110 "/include/CombBLAS;"
3111 (assoc-ref %build-inputs "combblas")
3112 "/include/BipartiteMatchings")
3113 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3115 (modify-phases %standard-phases
3116 (add-before 'configure 'set-c++-standard
3118 (substitute* "CMakeLists.txt"
3119 ;; AWPM headers require C++14
3120 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3121 (add-before 'check 'mpi-setup
3123 (add-before 'check 'omp-setup
3124 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3125 (home-page (package-home-page superlu))
3126 (synopsis "Parallel supernodal direct solver")
3128 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3129 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3130 implemented in ANSI C, and MPI for communications.")
3131 (license license:bsd-3)))
3133 (define-public scotch
3140 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3141 "latestfile/298/scotch_" version ".tar.gz"))
3143 (base32 "1184fcv4wa2df8szb5lan6pjh0raarr45pk8ilpvbz23naikzg53"))
3144 (patches (search-patches "scotch-build-parallelism.patch"
3145 "scotch-integer-declarations.patch"))))
3146 (build-system gnu-build-system)
3152 (outputs '("out" "metis"))
3154 `(#:make-flags (list (string-append "prefix=" %output))
3156 (modify-phases %standard-phases
3158 'unpack 'chdir-to-src
3159 (lambda _ (chdir "src") #t))
3163 (call-with-output-file "Makefile.inc"
3177 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3178 LDFLAGS = -lz -lm -lrt -lpthread
3180 LEX = flex -Pscotchyy -olex.yy.c
3185 YACC = bison -pscotchyy -y -b y
3187 '("COMMON_FILE_COMPRESS_GZ"
3189 "COMMON_RANDOM_FIXED_SEED"
3190 "INTSIZE64" ;use 'int64_t'
3191 ;; Prevents symbol clashes with libesmumps
3193 ;; XXX: Causes invalid frees in superlu-dist tests
3195 ;; "SCOTCH_PTHREAD_NUMBER=2"
3196 "restrict=__restrict"))))
3198 (add-after 'build 'build-esmumps
3201 (format #f "-j~a" (parallel-job-count))
3203 (add-before 'install 'make-install-dirs
3204 (lambda* (#:key outputs #:allow-other-keys)
3205 (mkdir (assoc-ref outputs "out"))))
3206 (add-after 'install 'install-metis
3207 (lambda* (#:key outputs #:allow-other-keys)
3208 (let ((out (assoc-ref outputs "metis")))
3210 ;; metis files are not installed with 'make install'
3211 (for-each (lambda (f)
3212 (install-file f (string-append out "/include")))
3213 (find-files "../include/" ".*metis\\.h"))
3214 (for-each (lambda (f)
3215 (install-file f (string-append out "/lib")))
3216 (find-files "../lib/" ".*metis\\..*"))
3218 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3219 (synopsis "Programs and libraries for graph algorithms")
3220 (description "SCOTCH is a set of programs and libraries which implement
3221 the static mapping and sparse matrix reordering algorithms developed within
3222 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3223 conquer approach, to scientific computing problems such as graph and mesh
3224 partitioning, static mapping, and sparse matrix ordering, in application
3225 domains ranging from structural mechanics to operating systems or
3227 ;; See LICENSE_en.txt
3228 (license license:cecill-c)))
3230 (define-public scotch32
3231 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3232 ;; some applications.
3233 (package (inherit scotch)
3236 (substitute-keyword-arguments (package-arguments scotch)
3237 ((#:phases scotch-phases)
3238 `(modify-phases ,scotch-phases
3242 (call-with-output-file "Makefile.inc"
3256 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3257 LDFLAGS = -lz -lm -lrt -lpthread
3259 LEX = flex -Pscotchyy -olex.yy.c
3264 YACC = bison -pscotchyy -y -b y
3266 '("COMMON_FILE_COMPRESS_GZ"
3268 "COMMON_RANDOM_FIXED_SEED"
3269 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3270 ;; Prevents symbolc clashes with libesmumps
3272 ;; XXX: Causes invalid frees in superlu-dist tests
3274 ;; "SCOTCH_PTHREAD_NUMBER=2"
3275 "restrict=__restrict"))))))))))
3277 "Programs and libraries for graph algorithms (32-bit integers)")))
3279 (define-public scotch-shared
3280 (package (inherit scotch)
3281 (name "scotch-shared")
3287 (substitute-keyword-arguments (package-arguments scotch)
3288 ((#:phases scotch-shared-phases)
3289 `(modify-phases ,scotch-shared-phases
3293 ;; Otherwise, the RUNPATH will lack the final path component.
3294 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3295 (assoc-ref %outputs "out") "/lib"))
3296 (call-with-output-file "Makefile.inc"
3304 ARFLAGS = -shared -o
3310 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3311 CLIBFLAGS = -shared -fPIC
3312 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3314 LEX = flex -Pscotchyy -olex.yy.c
3319 YACC = bison -pscotchyy -y -b y
3321 '("COMMON_FILE_COMPRESS_GZ"
3323 "COMMON_RANDOM_FIXED_SEED"
3324 "INTSIZE64" ;use 'int64_t'
3325 ;; Prevents symbolc clashes with libesmumps
3327 ;; XXX: Causes invalid frees in superlu-dist tests
3329 ;; "SCOTCH_PTHREAD_NUMBER=2"
3330 "restrict=__restrict"
3334 "Programs and libraries for graph algorithms (shared libraries version)")))
3336 (define-public pt-scotch
3337 (package (inherit scotch)
3340 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3342 (substitute-keyword-arguments (package-arguments scotch)
3343 ((#:phases scotch-phases)
3344 `(modify-phases ,scotch-phases
3348 (invoke "make" (format #f "-j~a" (parallel-job-count))
3349 "ptscotch" "ptesmumps")
3351 ;; Install the serial metis compatibility library
3352 (invoke "make" "-C" "libscotchmetis" "install")))
3353 (add-before 'check 'mpi-setup
3357 (invoke "make" "ptcheck")))))))
3358 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3360 (define-public pt-scotch32
3361 (package (inherit scotch32)
3362 (name "pt-scotch32")
3364 `(("openmpi" ,openmpi))) ;headers include MPI headers
3366 (substitute-keyword-arguments (package-arguments scotch32)
3367 ((#:phases scotch32-phases)
3368 `(modify-phases ,scotch32-phases
3371 (invoke "make" (format #f "-j~a" (parallel-job-count))
3372 "ptscotch" "ptesmumps")
3373 ;; Install the serial metis compatibility library
3374 (invoke "make" "-C" "libscotchmetis" "install")))
3375 (add-before 'check 'mpi-setup
3379 (invoke "make" "ptcheck")))))))
3381 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3383 (define-public pt-scotch-shared
3384 (package (inherit scotch-shared)
3385 (name "pt-scotch-shared")
3387 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3389 (substitute-keyword-arguments (package-arguments scotch-shared)
3390 ((#:phases scotch-shared-phases)
3391 `(modify-phases ,scotch-shared-phases
3395 (invoke "make" (format #f "-j~a" (parallel-job-count))
3396 "ptscotch" "ptesmumps")
3398 ;; Install the serial metis compatibility library
3399 (invoke "make" "-C" "libscotchmetis" "install")))
3400 (add-before 'check 'mpi-setup
3401 ,%openmpi-setup)))))
3402 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3405 (define-public metis
3412 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3413 "metis-" version ".tar.gz"))
3416 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3418 `((release-monitoring-url
3419 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3420 (build-system cmake-build-system)
3422 `(("blas" ,openblas)))
3424 `(#:tests? #f ;no tests
3425 #:configure-flags `("-DSHARED=ON"
3426 ,(string-append "-DGKLIB_PATH=" (getcwd)
3427 "/metis-" ,version "/GKlib"))))
3428 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3429 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3431 "METIS is a set of serial programs for partitioning graphs, partitioning
3432 finite element meshes, and producing fill-reducing orderings for sparse
3433 matrices. The algorithms implemented in METIS are based on the multilevel
3434 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3436 (license license:asl2.0))) ;As of version 5.0.3
3438 (define-public p4est
3445 (uri (string-append "http://p4est.github.io/release/p4est-"
3449 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3450 (build-system gnu-build-system)
3452 `(("fortran" ,gfortran)
3457 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3458 (assoc-ref %build-inputs "blas")
3460 ,(string-append "LAPACK_LIBS=-L"
3461 (assoc-ref %build-inputs "lapack")
3463 #:phases (modify-phases %standard-phases
3464 (add-before 'check 'mpi-setup
3466 (home-page "http://www.p4est.org")
3467 (synopsis "Adaptive mesh refinement on forests of octrees")
3469 "The p4est software library enables the dynamic management of a
3470 collection of adaptive octrees, conveniently called a forest of octrees.
3471 p4est is designed to work in parallel and scales to hundreds of thousands of
3473 (license license:gpl2+)))
3475 (define-public p4est-openmpi
3476 (package (inherit p4est)
3477 (name "p4est-openmpi")
3480 ,@(package-inputs p4est)))
3482 (substitute-keyword-arguments (package-arguments p4est)
3483 ((#:configure-flags cf)
3484 ``("--enable-mpi" ,@,cf))))
3485 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3487 (define-public gsegrafix
3494 (uri (string-append "mirror://gnu/" name "/" name "-"
3498 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3499 (build-system gnu-build-system)
3501 `(#:configure-flags '("LDFLAGS=-lm")))
3503 `(("libgnomecanvas" ,libgnomecanvas)
3504 ("libbonoboui" ,libbonoboui)
3505 ("libgnomeui" ,libgnomeui)
3506 ("libgnomeprintui" ,libgnomeprintui)
3509 `(("pkg-config" ,pkg-config)))
3510 (home-page "https://www.gnu.org/software/gsegrafix/")
3511 (synopsis "GNOME application to create scientific and engineering plots")
3512 (description "GSEGrafix is an application which produces high-quality graphical
3513 plots for science and engineering. Plots are specified via simple ASCII
3514 parameter files and data files and are presented in an anti-aliased GNOME
3515 canvas. The program supports rectangular two-dimensional plots, histograms,
3516 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3517 to BMP, JPEG or PNG image formats.")
3518 (license license:gpl3+)))
3520 (define-public maxima
3527 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3528 version "-source/" name "-" version ".tar.gz"))
3531 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3532 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3533 (build-system gnu-build-system)
3536 ("gnuplot" ,gnuplot) ;for plots
3538 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3540 `(("texinfo" ,texinfo)
3542 ("python" ,python)))
3545 (list "--enable-gcl"
3546 (string-append "--with-posix-shell="
3547 (assoc-ref %build-inputs "bash")
3549 (string-append "--with-wish="
3550 (assoc-ref %build-inputs "tk")
3552 (let ((v ,(package-version tk)))
3553 (string-take v (string-index-right v #\.)))))
3554 ;; By default Maxima attempts to write temporary files to
3555 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3556 ;; Work around that.
3557 #:make-flags (list "TMPDIR=/tmp")
3559 (modify-phases %standard-phases
3560 (add-after 'unpack 'patch-paths
3561 (lambda* (#:key inputs #:allow-other-keys)
3562 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3563 (coreutils (assoc-ref inputs "coreutils"))
3564 (dirname (string-append coreutils "/bin/dirname"))
3565 (head (string-append coreutils "/bin/head"))
3566 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3567 (python (string-append (assoc-ref inputs "python")
3569 (substitute* "src/maxima.in"
3570 (("sed ") (string-append sed " "))
3571 (("dirname") dirname)
3573 (substitute* "doc/info/Makefile.in"
3574 (("/usr/bin/env perl") perl))
3575 (substitute* "doc/info/build_html.sh.in"
3576 (("python") python))
3578 (add-before 'check 'pre-check
3580 (chmod "src/maxima" #o555)
3584 ;; This is derived from the testing code in the "debian/rules" file
3585 ;; of Debian's Maxima package.
3586 ;; If Maxima can successfully run this, the binary to be installed
3592 "--batch-string=\"run_testsuite();\" "
3593 "| grep -q \"No unexpected errors found\""))))
3594 ;; Make sure the doc and emacs files are found in the
3595 ;; standard location. Also configure maxima to find gnuplot
3596 ;; without having it on the PATH.
3597 (add-after 'install 'post-install
3598 (lambda* (#:key outputs inputs #:allow-other-keys)
3599 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3600 (out (assoc-ref outputs "out"))
3601 (datadir (string-append out "/share/maxima/" ,version))
3602 (binutils (string-append (assoc-ref inputs "binutils")
3604 (with-directory-excursion out
3605 (mkdir-p "share/emacs")
3606 (mkdir-p "share/doc")
3608 (string-append datadir "/doc/")
3609 (string-append out "/share/doc/maxima"))
3610 (with-atomic-file-replacement
3611 (string-append datadir "/share/maxima-init.lisp")
3613 (format out "~a ~s~a~%"
3614 "(setf $gnuplot_command "
3615 (string-append gnuplot "/bin/gnuplot") ")")
3616 (dump-port in out))))
3617 ;; Ensure that Maxima will have access to the GNU binutils
3618 ;; components at runtime.
3619 (wrap-program (string-append out "/bin/maxima")
3620 `("PATH" prefix (,binutils))))
3622 (home-page "http://maxima.sourceforge.net")
3623 (synopsis "Numeric and symbolic expression manipulation")
3624 (description "Maxima is a system for the manipulation of symbolic and
3625 numerical expressions. It yields high precision numeric results by using
3626 exact fractions, arbitrary precision integers, and variable precision floating
3628 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3629 ;; Others simply say "GNU General Public License" without stating a
3630 ;; version (which implicitly means gpl1+).
3631 ;; At least one file (src/maxima.asd) says "version 2."
3632 ;; GPLv2 only is therefore the smallest subset.
3633 (license license:gpl2)))
3635 (define-public wxmaxima
3643 (url "https://github.com/wxMaxima-developers/wxmaxima")
3644 (commit (string-append "Version-" version))))
3645 (file-name (git-file-name name version))
3647 (base32 "0xj95zk16x8kac8qhzd5kvf3b00x7hgdw85da9ww63xyndvhh2lw"))))
3648 (build-system cmake-build-system)
3650 `(("gettext" ,gettext-minimal)))
3652 `(("wxwidgets" ,wxwidgets)
3655 ("adwaita-icon-theme" ,adwaita-icon-theme)
3657 ("shared-mime-info" ,shared-mime-info)))
3659 `(#:tests? #f ; tests fail non-deterministically
3661 (modify-phases %standard-phases
3662 (add-after 'unpack 'patch-doc-path
3664 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3665 ;; documentation. Only licensing information is placed there by
3667 (substitute* "src/Dirstructure.cpp"
3668 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3670 (add-after 'install 'wrap-program
3671 (lambda* (#:key inputs outputs #:allow-other-keys)
3672 (wrap-program (string-append (assoc-ref outputs "out")
3675 (,(string-append (assoc-ref inputs "maxima")
3677 ;; For GtkFileChooserDialog.
3678 `("GSETTINGS_SCHEMA_DIR" =
3679 (,(string-append (assoc-ref inputs "gtk+")
3680 "/share/glib-2.0/schemas")))
3681 `("XDG_DATA_DIRS" ":" prefix
3682 (;; Needed by gdk-pixbuf to know supported icon formats.
3684 (assoc-ref inputs "shared-mime-info") "/share")
3685 ;; The default icon theme of GTK+.
3687 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3689 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3690 (synopsis "Graphical user interface for the Maxima computer algebra system")
3692 "wxMaxima is a graphical user interface for the Maxima computer algebra
3693 system. It eases the use of Maxima by making most of its commands available
3694 through a menu system and by providing input dialogs for commands that require
3695 more than one argument. It also implements its own display engine that
3696 outputs mathematical symbols directly instead of depicting them with ASCII
3699 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3700 text and mathematical calculations to create documents, exporting of input and
3701 output to TeX, and a browser for Maxima's manual including command index and
3702 full text searching.")
3703 (license license:gpl2+)))
3705 (define-public armadillo
3711 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3715 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3716 (build-system cmake-build-system)
3717 (arguments `(#:tests? #f)) ; no test target
3719 `(("openblas" ,openblas)
3721 ("arpack" ,arpack-ng)))
3722 (home-page "http://arma.sourceforge.net/")
3723 (synopsis "C++ linear algebra library")
3725 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3726 between speed and ease of use. It is useful for algorithm development
3727 directly in C++, or quick conversion of research code into production
3728 environments. It can be used for machine learning, pattern recognition,
3729 signal processing, bioinformatics, statistics, econometrics, etc. The library
3730 provides efficient classes for vectors, matrices and cubes, as well as 150+
3731 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3732 (license license:asl2.0)))
3734 (define-public muparser
3735 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3736 ;; different hash. In order to make `guix package --upgrade` work correctly,
3737 ;; we set a Guix packaging revision.
3738 ;; When the next version of muparser is released, we can remove
3739 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3740 (let ((upstream-version "2.2.5")
3744 (version (string-append upstream-version "-" revision))
3749 (url "https://github.com/beltoforion/muparser")
3750 (commit (string-append "v" upstream-version))))
3751 (file-name (git-file-name name version))
3753 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3754 (build-system gnu-build-system)
3756 `(#:configure-flags '("--enable-samples=no")
3757 #:tests? #f)) ;no "check" target
3758 (home-page "http://muparser.beltoforion.de/")
3759 (synopsis "Fast parser library for mathematical expressions")
3761 "muParser is an extensible high performance math parser library. It is
3762 based on transforming an expression into a bytecode and precalculating constant
3764 (license license:expat))))
3766 (define-public openblas
3773 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3774 version "%20version.tar.gz"))
3775 (file-name (string-append name "-" version ".tar.gz"))
3778 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3779 (build-system gnu-build-system)
3781 `(#:test-target "test"
3782 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3783 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3784 ;; we need to disable substitutions.
3786 ,(let ((system (or (%current-target-system) (%current-system))))
3787 (or (string-prefix? "x86_64" system)
3788 (string-prefix? "i686" system)
3789 (string-prefix? "mips" system)
3790 (string-prefix? "aarch64" system)))
3792 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3794 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3796 ;; This is the maximum number of threads OpenBLAS will ever use (that
3797 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3798 ;; is used.) If we don't set it, the makefile sets it to the number
3799 ;; of cores of the build machine, which is obviously wrong.
3802 ;; Build the library for all supported CPUs. This allows
3803 ;; switching CPU targets at runtime with the environment variable
3804 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3805 ;; Unfortunately, this is not supported on non-x86 architectures,
3806 ;; where it leads to failed builds.
3807 ,@(let ((system (or (%current-target-system) (%current-system))))
3809 ((or (string-prefix? "x86_64" system)
3810 (string-prefix? "i686" system))
3811 '("DYNAMIC_ARCH=1"))
3812 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3813 ;; two available MIPS targets special extended instructions
3814 ;; for Loongson cores are used.
3815 ((string-prefix? "mips" system)
3816 '("TARGET=SICORTEX"))
3817 ;; On aarch64 force the generic 'armv8-a' target
3818 ((string-prefix? "aarch64" system)
3821 ;; no configure script
3823 (modify-phases %standard-phases
3825 (add-before 'build 'set-extralib
3826 (lambda* (#:key inputs #:allow-other-keys)
3827 ;; Get libgfortran found when building in utest.
3829 (string-append "-L" (assoc-ref inputs "fortran-lib")
3833 `(("fortran-lib" ,gfortran "lib")))
3836 ("fortran" ,gfortran)
3838 (home-page "https://www.openblas.net/")
3839 (synopsis "Optimized BLAS library based on GotoBLAS")
3841 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3842 (license license:bsd-3)))
3844 (define-public openblas-ilp64
3845 (package/inherit openblas
3846 (name "openblas-ilp64")
3847 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3849 (substitute-keyword-arguments (package-arguments openblas)
3850 ((#:make-flags flags '())
3851 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3853 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3854 (license license:bsd-3)))
3860 (home-page "https://github.com/flame/blis")
3863 (uri (git-reference (url home-page) (commit version)))
3866 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
3867 (file-name (git-file-name "blis" version))))
3869 `(("python" ,python)
3871 (build-system gnu-build-system)
3874 ((guix build gnu-build-system)
3877 #:test-target "test"
3879 (modify-phases %standard-phases
3881 (lambda* (#:key outputs
3884 (configure-flags '())
3886 ;; This is a home-made 'configure' script.
3887 (let* ((out (assoc-ref outputs "out"))
3888 ;; Guix-specific support for choosing the configuration
3889 ;; via #:configure-flags: see below for details.
3890 (config-flag-prefix "--blis-config=")
3891 (maybe-config-flag (find
3893 (string-prefix? config-flag-prefix s))
3895 (configure-flags (if maybe-config-flag
3896 (delete maybe-config-flag
3899 ;; Select the "configuration" to build.
3900 ;; The "generic" configuration is non-optimized but
3901 ;; portable (no assembly).
3902 ;; The "x86_64" configuration family includes
3903 ;; sub-configurations for all supported
3904 ;; x86_64 microarchitectures.
3905 ;; BLIS currently lacks runtime hardware detection
3906 ;; for other architectures: see
3907 ;; <https://github.com/flame/blis/commit/c534da6>.
3908 ;; Conservatively, we stick to "generic" on armhf,
3909 ;; aarch64, and ppc64le for now. (But perhaps
3910 ;; "power9", "cortexa9", and "cortexa57" might be
3911 ;; general enough to use?)
3912 ;; Another approach would be to use the "auto"
3913 ;; configuration and make this package
3914 ;; non-substitutable.
3915 ;; The build is fairly intensive, though.
3919 (substring maybe-config-flag
3920 (string-length config-flag-prefix)))
3921 ((string-prefix? "x86_64" (or target system))
3930 "--enable-threading=openmp"
3931 "--enable-verbose-make"
3934 (format #t "configure args: ~s~%" configure-args)
3939 (add-before 'check 'show-test-output
3941 ;; By default "make check" is silent. Make it verbose.
3942 (system "tail -F output.testsuite &")
3944 (synopsis "High-performance basic linear algebra (BLAS) routines")
3946 "BLIS is a portable software framework for instantiating high-performance
3947 BLAS-like dense linear algebra libraries. The framework was designed to
3948 isolate essential kernels of computation that, when optimized, immediately
3949 enable optimized implementations of most of its commonly used and
3950 computationally intensive operations. While BLIS exports a new BLAS-like API,
3951 it also includes a BLAS compatibility layer which gives application developers
3952 access to BLIS implementations via traditional BLAS routine calls.")
3953 (license license:bsd-3)))
3955 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
3956 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
3957 (define-public blis-knl (deprecated-package "blis-knl" blis))
3959 (define ignorance blis)
3961 (define-public openlibm
3969 (url "https://github.com/JuliaLang/openlibm")
3970 (commit (string-append "v" version))))
3971 (file-name (git-file-name name version))
3973 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3974 (build-system gnu-build-system)
3977 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3979 ;; no configure script
3980 (modify-phases %standard-phases (delete 'configure))
3981 #:tests? #f)) ;the tests are part of the default target
3982 (home-page "https://openlibm.org/")
3983 (synopsis "Portable C mathematical library (libm)")
3985 "OpenLibm is an effort to have a high quality, portable, standalone C
3986 mathematical library (libm). It can be used standalone in applications and
3987 programming language implementations. The project was born out of a need to
3988 have a good libm for the Julia programming language that worked consistently
3989 across compilers and operating systems, and in 32-bit and 64-bit
3991 ;; Each architecture has its own make target, and there is none for mips.
3992 (supported-systems (delete "mips64el-linux" %supported-systems))
3993 ;; See LICENSE.md for details.
3994 (license (list license:expat
3997 license:public-domain
3998 license:lgpl2.1+))))
4000 (define-public openspecfun
4002 (name "openspecfun")
4008 (url "https://github.com/JuliaLang/openspecfun")
4009 (commit (string-append "v" version))))
4010 (file-name (git-file-name name version))
4012 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4013 (build-system gnu-build-system)
4015 '(#:tests? #f ; no "check" target
4017 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4019 (modify-phases %standard-phases
4020 (delete 'configure)))) ; no configure script
4022 `(("fortran" ,gfortran)))
4023 (home-page "https://github.com/JuliaLang/openspecfun")
4024 (synopsis "Collection of special mathematical functions")
4026 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4027 portable package for Bessel Functions of a Complex Argument and Nonnegative
4028 Order; it contains subroutines for computing Bessel functions and Airy
4029 functions. Faddeeva allows computing the various error functions of arbitrary
4030 complex arguments (Faddeeva function, error function, complementary error
4031 function, scaled complementary error function, imaginary error function, and
4032 Dawson function); given these, one can also easily compute Voigt functions,
4033 Fresnel integrals, and similar related functions as well.")
4034 ;; Faddeeva is released under the Expat license; AMOS is included as
4035 ;; public domain software.
4036 (license (list license:expat license:public-domain))))
4038 (define-public suitesparse
4040 (name "suitesparse")
4046 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4047 (commit (string-append "v" version))))
4048 (file-name (git-file-name name version))
4051 "1zhkix58afw92s7p291prljdm3yi0pjg1kbi3lczdb8rb14jkz5n"))
4052 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4053 (modules '((guix build utils)))
4055 ;; Remove bundled metis source
4057 (delete-file-recursively "metis-5.1.0")
4059 (build-system gnu-build-system)
4061 `(#:tests? #f ;no "check" target
4063 (list (string-append "CC=" ,(cc-for-target))
4065 "MY_METIS_LIB=-lmetis"
4066 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4067 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4068 (assoc-ref %outputs "out")
4069 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4070 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4071 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4072 " -DCMAKE_SKIP_RPATH=TRUE"
4073 " -DCMAKE_BUILD_TYPE=Release"
4074 " -DCMAKE_INSTALL_LIBDIR=lib")
4075 (string-append "INSTALL_LIB="
4076 (assoc-ref %outputs "out") "/lib")
4077 (string-append "INSTALL_INCLUDE="
4078 (assoc-ref %outputs "out") "/include")
4081 (modify-phases %standard-phases
4082 (delete 'configure)))) ;no configure script
4090 `(("cmake" ,cmake-minimal)
4092 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4093 (synopsis "Suite of sparse matrix software")
4095 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4096 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4097 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4098 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4099 CXSparse, a concise sparse Cholesky factorization package; and many other
4102 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4104 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4105 (license (list license:gpl2+ license:lgpl2.1+))))
4107 (define-public atlas
4113 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4114 version "/atlas" version ".tar.bz2"))
4117 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4118 (build-system gnu-build-system)
4119 (home-page "http://math-atlas.sourceforge.net/")
4120 (inputs `(("gfortran" ,gfortran)
4121 ("lapack-tar" ,(package-source lapack))))
4122 (outputs '("out" "doc"))
4123 ;; For the moment we drop support for MIPS at it fails to compile. See
4124 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4125 (supported-systems (delete "mips64el-linux" %supported-systems))
4127 `(#:parallel-build? #f
4128 #:parallel-tests? #f
4130 ;; ATLAS tunes itself for the machine it is built on, as explained at
4131 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4132 ;; For this reason, we want users to build it locally instead of using
4136 #:modules ((srfi srfi-26)
4137 (guix build gnu-build-system)
4140 `(;; Generate position independent code suitable for dynamic libraries
4141 ;; and use WALL timer to get more accurate timing.
4142 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4145 ,,(if (string-match "64" (%current-system))
4148 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4149 ;; needed to compile C files before it is generated.
4150 "-Ss" "pmake" "make -j 1"
4151 ;; Probe is failing for MIPS. We therefore define the system
4152 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4153 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4154 ,,@(if (string-prefix? "mips" (%current-system))
4155 (list "-A" "49" "-V" "1")
4157 ;; Generate shared libraries.
4159 ;; Build a full LAPACK library.
4160 ,(string-append "--with-netlib-lapack-tarfile="
4161 (assoc-ref %build-inputs "lapack-tar")))
4163 (modify-phases %standard-phases
4164 (add-after 'install 'install-doc
4165 (lambda* (#:key outputs inputs #:allow-other-keys)
4166 (let ((doc (string-append (assoc-ref outputs "doc")
4167 "/share/doc/atlas")))
4169 (for-each (cut install-file <> doc)
4170 (find-files "../ATLAS/doc" ".*"))
4172 (add-after 'check 'check-pt
4173 (lambda _ (invoke "make" "ptcheck")))
4174 ;; Fix files required to run configure.
4175 (add-before 'configure 'fix-/bin/sh
4177 ;; Use `sh', not `/bin/sh'.
4178 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4182 ;; Fix /bin/sh in generated make files.
4183 (add-after 'configure 'fix-/bin/sh-in-generated-files
4185 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4189 ;; ATLAS configure program does not accepts the default flags
4190 ;; passed by the 'gnu-build-system'.
4192 (lambda* (#:key native-inputs inputs outputs
4193 (configure-flags '())
4194 #:allow-other-keys #:rest args)
4195 (let* ((prefix (assoc-ref outputs "out"))
4196 (bash (or (and=> (assoc-ref
4197 (or native-inputs inputs) "bash")
4198 (cut string-append <> "/bin/bash"))
4200 (flags `(,(string-append "--prefix=" prefix)
4202 (abs-srcdir (getcwd))
4203 (srcdir (string-append "../" (basename abs-srcdir))))
4204 (format #t "source directory: ~s (relative from build: ~s)~%"
4208 (format #t "build directory: ~s~%" (getcwd))
4209 (format #t "configure flags: ~s~%" flags)
4211 (string-append srcdir "/configure")
4213 (synopsis "Automatically Tuned Linear Algebra Software")
4215 "ATLAS is an automatically tuned linear algebra software library
4216 providing C and Fortran77 interfaces to a portably efficient BLAS
4217 implementation, as well as a few routines from LAPACK.
4219 Optimization occurs at build time. For this reason, the library is built on
4220 the machine where it is installed, without resorting to pre-built substitutes.
4222 Before building the library, CPU throttling should be disabled. This can be
4223 done in the BIOS, or, on GNU/Linux, with the following command:
4226 # cpupower --governor performance
4229 Failure to do so will result in a library with poor performance.")
4230 (license license:bsd-3)))
4240 (url "https://github.com/recp/cglm")
4241 (commit (string-append "v" version))))
4242 (file-name (git-file-name name version))
4244 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4245 (build-system cmake-build-system)
4248 (list "-DCGLM_USE_TEST=ON")))
4249 (home-page "https://github.com/recp/cglm")
4250 (synopsis "Mathematics C library for graphics programming")
4252 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4253 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4256 It's similar to the original C++ GLM library but written in C99 and compatible
4258 (license license:expat)))
4267 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4268 version "/glm-" version ".zip"))
4270 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4271 (build-system cmake-build-system)
4273 `(#:phases (modify-phases %standard-phases
4275 (lambda* (#:key outputs #:allow-other-keys)
4276 ;; Since version 0.9.9.6, 'make install' is not supported
4277 ;; and we have to do it "manually". Upstream discussion:
4278 ;; <https://github.com/g-truc/glm/pull/968>.
4279 (let* ((source (string-append "../glm"))
4280 (out (assoc-ref outputs "out"))
4281 (inc (string-append out "/include"))
4282 (lib (string-append out "/lib"))
4283 (pkgconfig (string-append lib "/pkgconfig")))
4284 (with-directory-excursion source
4287 (copy-recursively "glm" (string-append inc "/glm"))
4288 (copy-recursively "cmake" (string-append lib "/cmake"))
4289 (call-with-output-file (string-append pkgconfig "/glm.pc")
4293 includedir=${prefix}/include
4296 Description: OpenGL Mathematics
4298 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4301 `(("unzip" ,unzip)))
4302 (home-page "https://glm.g-truc.net/")
4303 (synopsis "OpenGL Mathematics library")
4304 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4305 library for graphics software based on the OpenGL Shading Language (GLSL)
4307 (license license:expat)))
4309 (define-public lpsolve
4316 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4317 "/lp_solve_" version "_source.tar.gz"))
4320 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4321 (modules '((guix build utils)))
4324 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4326 ;; Pretend to be on a 64 bit platform to obtain a common directory
4327 ;; name for the build results on all architectures; nothing else
4328 ;; seems to depend on it.
4329 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4331 ;; The check for 'isnan' as it is written fails with
4332 ;; "non-floating-point argument in call to function
4333 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4334 ;; definition, which in turn leads to bad things. Fix the feature
4336 (("isnan\\(0\\)") "isnan(0.)"))
4338 (build-system gnu-build-system)
4340 `(#:tests? #f ; no check target
4342 (modify-phases %standard-phases
4343 (delete 'configure) ; no configure script
4346 (with-directory-excursion "lpsolve55"
4347 (invoke "bash" "ccc"))
4348 (with-directory-excursion "lp_solve"
4349 (invoke "bash" "ccc"))
4352 (lambda* (#:key outputs #:allow-other-keys)
4353 (let* ((out (assoc-ref outputs "out"))
4354 (bin (string-append out "/bin"))
4355 (lib (string-append out "/lib"))
4356 ;; This is where LibreOffice expects to find the header
4357 ;; files, and where they are installed by Debian.
4358 (include (string-append out "/include/lpsolve")))
4359 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4360 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4361 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4363 ;; Install a subset of the header files as on Debian
4364 ;; (plus lp_bit.h, which matches the regular expression).
4365 (for-each (lambda (name)
4366 (install-file name include))
4367 (find-files "." "lp_[HMSa-z].*\\.h$"))
4368 (with-directory-excursion "shared"
4369 (for-each (lambda (name)
4370 (install-file name include))
4371 (find-files "." "\\.h$")))
4373 (home-page "http://lpsolve.sourceforge.net/")
4374 (synopsis "Mixed integer linear programming (MILP) solver")
4376 "lp_solve is a mixed integer linear programming solver based on the
4377 revised simplex and the branch-and-bound methods.")
4378 (license license:lgpl2.1+)))
4380 (define-public dealii
4387 (uri (string-append "https://github.com/dealii/dealii/releases/"
4388 "download/v" version "/dealii-" version ".tar.gz"))
4391 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4392 (modules '((guix build utils)))
4394 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4396 (delete-file-recursively "bundled")
4398 (build-system cmake-build-system)
4406 ("arpack" ,arpack-ng)
4407 ("muparser" ,muparser)
4408 ("gfortran" ,gfortran)
4409 ("suitesparse" ,suitesparse))) ;for UMFPACK
4411 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4413 ;; Work around a bug in libsuitesparseconfig linking
4414 ;; see https://github.com/dealii/dealii/issues/4745
4415 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4416 (home-page "https://www.dealii.org")
4417 (synopsis "Finite element library")
4419 "Deal.II is a C++ program library targeted at the computational solution
4420 of partial differential equations using adaptive finite elements. The main
4421 aim of deal.II is to enable rapid development of modern finite element codes,
4422 using among other aspects adaptive meshes and a wide array of tools often used
4423 in finite element programs.")
4424 (license license:lgpl2.1+)))
4426 (define-public dealii-openmpi
4427 (package (inherit dealii)
4428 (name "dealii-openmpi")
4431 ;;Supported only with MPI:
4432 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4433 ("p4est" ,p4est-openmpi)
4434 ("petsc" ,petsc-openmpi)
4435 ("slepc" ,slepc-openmpi)
4436 ("metis" ,metis) ;for MUMPS
4437 ("scalapack" ,scalapack) ;for MUMPS
4438 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4439 ("arpack" ,arpack-ng-openmpi)
4440 ,@(fold alist-delete (package-inputs dealii)
4441 '("p4est" "arpack"))))
4443 (substitute-keyword-arguments (package-arguments dealii)
4444 ((#:configure-flags cf)
4445 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4447 ((#:phases phases '%standard-phases)
4448 `(modify-phases ,phases
4449 (add-before 'check 'mpi-setup
4450 ,%openmpi-setup)))))
4451 (synopsis "Finite element library (with MPI support)")))
4453 (define-public flann
4457 (home-page "https://github.com/mariusmuja/flann/")
4461 (uri (git-reference (url home-page) (commit version)))
4462 (file-name (git-file-name name version))
4465 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4466 (patches (search-patches "flann-cmake-3.11.patch"))))
4467 (build-system cmake-build-system)
4470 `(("unzip" ,unzip)))
4473 ;; FIXME: 'mkoctfile' fails with a linker error:
4474 ;; ld: cannot find -loctinterp
4475 ;; ld: cannot find -loctave
4476 ;; Disable it for now.
4477 ;;("octave" ,octave-cli)
4478 ("python" ,python-2) ; print syntax
4479 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4482 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4483 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4484 #:strip-directories '("lib" "lib64" "libexec"
4485 "bin" "sbin" "share/flann/octave")
4487 ;; Save 12 MiB by not installing .a files. Passing
4488 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4489 #:phases (modify-phases %standard-phases
4490 (add-after 'install 'remove-static-libraries
4491 (lambda* (#:key outputs #:allow-other-keys)
4492 (let* ((out (assoc-ref outputs "out"))
4493 (lib (string-append out "/lib")))
4494 (for-each delete-file
4495 (find-files lib "\\.a$"))
4498 #:tests? #f)) ; The test data are downloaded from the Internet.
4499 (synopsis "Library for approximate nearest neighbors computation")
4500 (description "FLANN is a library for performing fast approximate
4501 nearest neighbor searches in high dimensional spaces. It implements a
4502 collection of algorithms and a system for automatically choosing the best
4503 algorithm and optimum parameters depending on the dataset.
4505 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4506 (license (license:non-copyleft "file://COPYING"
4507 "See COPYING in the distribution."))))
4509 (define-public wcalc
4516 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4517 "wcalc-" version ".tar.bz2"))
4520 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4521 (build-system gnu-build-system)
4524 ("readline" ,readline)))
4525 (home-page "http://w-calc.sourceforge.net/index.php")
4526 (synopsis "Flexible command-line scientific calculator")
4527 (description "Wcalc is a very capable calculator. It has standard functions
4528 (sin, asin, and sinh for example, in either radians or degrees), many
4529 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4530 variables, a command history, hex/octal/binary input and output, unit
4531 conversions, embedded comments, and an expandable expression entry field. It
4532 evaluates expressions using the standard order of operations.")
4533 (license license:gpl2+)))
4542 (url "https://github.com/xaos-project/XaoS")
4543 (commit (string-append "release-" version))))
4544 (file-name (git-file-name name version))
4547 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
4548 (build-system gnu-build-system)
4549 (native-inputs `(("gettext" ,gettext-minimal)
4551 ("qttools" ,qttools)))
4552 (inputs `(("libx11" ,libx11)
4556 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4557 ;; not enough for this package to install properly. These phases fix that.
4559 `(#:tests? #f ;no "check" target
4561 (modify-phases %standard-phases
4562 (add-before 'configure 'make-qt-deterministic
4564 ;; Make Qt deterministic.
4565 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4568 (lambda* (#:key outputs #:allow-other-keys)
4569 (let ((out (assoc-ref outputs "out")))
4570 (substitute* "XaoS.pro"
4571 ;; The DESTDIR is originally set to install the xaos binary to
4572 ;; the "bin" folder inside the build directory. Setting make
4573 ;; flags doesn't seem to change this.
4575 (string-append "DESTDIR=" out "/bin"))
4576 ;; Set the correct path to the lrelease binary.
4577 (("lrelease-qt5") "lrelease"))
4578 (substitute* "src/include/config.h"
4579 (("/usr/share/XaoS")
4580 (string-append out "/share/XaoS")))
4582 (add-after 'install 'install-data
4583 (lambda* (#:key outputs #:allow-other-keys)
4584 (let* ((out (assoc-ref outputs "out"))
4585 (share (string-append out "/share")))
4589 (copy-recursively folder
4590 (string-append share "/XaoS/" folder)))
4591 '("catalogs" "examples" "tutorial"))
4592 (install-file "xdg/xaos.png"
4593 (string-append share "/pixmaps"))
4594 (install-file "xdg/xaos.desktop"
4595 (string-append share "/applications")))
4597 (synopsis "Real-time fractal zoomer")
4598 (description "GNU XaoS is a graphical program that generates fractal
4599 patterns and allows you to zoom in and out of them infinitely in a fluid,
4600 continuous manner. It also includes tutorials that help to explain how fractals
4601 are built. It can generate many different fractal types such as the Mandelbrot
4603 (home-page "https://xaos-project.github.io/")
4604 (license license:gpl2+)))
4606 (define-public hypre
4614 (url "https://github.com/LLNL/hypre")
4615 (commit (string-append "v" version))))
4616 (file-name (git-file-name name version))
4618 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4619 (modules '((guix build utils)))
4622 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4623 ;; substitute the release date.
4624 (substitute* "src/utilities/HYPRE_utilities.h"
4625 (("Date Compiled: .*$")
4626 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4628 (build-system gnu-build-system)
4629 (outputs '("out" ; 6.1 MiB of headers and libraries
4630 "doc")) ; 4.8 MiB of documentation
4634 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4635 ("texlive" ,(texlive-union (list texlive-xypic
4637 texlive-latex-hyperref
4639 ("ghostscript" ,ghostscript)))
4641 `(("blas" ,openblas)
4642 ("lapack" ,lapack)))
4644 `(#:modules ((srfi srfi-1)
4645 ,@%gnu-build-system-modules)
4646 #:configure-flags '("--enable-shared"
4654 (modify-phases %standard-phases
4655 (add-before 'build 'set-HOME
4657 ;; FIXME: texlive-union does not find the built
4658 ;; metafonts, so it tries to generate them in HOME.
4659 (setenv "HOME" "/tmp")
4661 (add-before 'configure 'chdir-src
4662 (lambda _ (chdir "src")))
4664 (lambda* (#:key build target configure-flags
4665 #:allow-other-keys #:rest args)
4666 (let* ((configure (assoc-ref %standard-phases 'configure)))
4669 (list #:configure-flags
4670 (cons (string-append
4671 "--host=" (or target build))
4672 configure-flags)))))))
4673 (add-after 'build 'build-docs
4675 (invoke "make" "-Cdocs" "pdf" "html")))
4678 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4679 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4680 (invoke "make" "check" "CHECKRUN=")
4681 (for-each (lambda (filename)
4682 (let ((size (stat:size (stat filename))))
4683 (when (positive? size)
4684 (error (format #f "~a size ~d; error indication~%"
4686 (find-files "test" ".*\\.err$"))
4688 (add-after 'install 'install-docs
4689 (lambda* (#:key outputs #:allow-other-keys)
4690 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4691 (let* ((doc (assoc-ref outputs "doc"))
4692 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4693 (with-directory-excursion "docs"
4694 (for-each (lambda (base)
4695 (install-file (string-append base ".pdf") docdir)
4696 (copy-recursively base docdir)) ; html docs
4697 '("HYPRE_usr_manual"
4698 "HYPRE_ref_manual")))
4700 (home-page "http://www.llnl.gov/casc/hypre/")
4701 (synopsis "Library of solvers and preconditioners for linear equations")
4703 "HYPRE is a software library of high performance preconditioners and
4704 solvers for the solution of large, sparse linear systems of equations. It
4705 features multigrid solvers for both structured and unstructured grid
4707 (license license:lgpl2.1)))
4709 (define-public hypre-openmpi
4710 (package (inherit hypre)
4711 (name "hypre-openmpi")
4714 ,@(package-inputs hypre)))
4716 (substitute-keyword-arguments (package-arguments hypre)
4717 ((#:configure-flags flags)
4719 ,@(delete "--without-MPI" ,flags)))
4721 `(modify-phases ,phases
4722 (add-before 'check 'mpi-setup
4723 ,%openmpi-setup)))))
4724 (synopsis "Parallel solvers and preconditioners for linear equations")
4726 "HYPRE is a software library of high performance preconditioners and
4727 solvers for the solution of large, sparse linear systems of equations on
4728 parallel computers. It features parallel multigrid solvers for both
4729 structured and unstructured grid problems.")))
4731 (define-public matio
4738 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4739 "matio-" version ".tar.gz"))
4742 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
4743 (build-system gnu-build-system)
4746 ("hdf5" ,hdf5-1.8)))
4747 (home-page "http://matio.sourceforge.net/")
4748 (synopsis "Library for reading and writing MAT files")
4749 (description "Matio is a library for reading and writing MAT files. It
4750 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4751 (license license:bsd-2)))
4758 (origin (method url-fetch)
4759 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4760 "download/" version "/Vc-" version ".tar.gz"))
4763 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4764 (build-system cmake-build-system)
4767 '("-DBUILD_TESTING=ON"
4768 ;; By default, Vc will optimize for the CPU of the build machine.
4769 ;; Setting this to "none" makes it create portable binaries. See
4770 ;; "cmake/OptimizeForArchitecture.cmake".
4771 "-DTARGET_ARCHITECTURE=none")
4772 #:phases (modify-phases %standard-phases
4773 (add-after 'unpack 'copy-testdata
4774 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4775 (let ((testdata (assoc-ref (or native-inputs inputs)
4777 (copy-recursively testdata "tests/testdata")
4780 `(("virtest" ,virtest)
4782 ;; This is a submodule in the git project, but not part of the
4783 ;; released sources. See the git branch for the commit to take.
4784 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4788 (url "https://github.com/VcDevel/vc-testdata")
4789 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4790 (file-name (git-file-name "vc-testdata"
4791 (string-take commit 7)))
4794 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4795 (synopsis "SIMD vector classes for C++")
4796 (description "Vc provides portable, zero-overhead C++ types for explicitly
4797 data-parallel programming. It is a library designed to ease explicit
4798 vectorization of C++ code. Its types enable explicitly stating data-parallel
4799 operations on multiple values. The parallelism is therefore added via the type
4800 system. Vc has an intuitive API and provides portability between different
4801 compilers and compiler versions as well as portability between different vector
4802 instruction sets. Thus, an application written with Vc can be compiled for:
4805 @item SSE2 up to SSE4.2 or SSE4a
4808 @item NEON (in development)
4809 @item NVIDIA GPUs / CUDA (in development)
4811 (home-page "https://github.com/VcDevel/Vc")
4812 ;; "No support_???.cpp file exists for this architecture."
4813 (supported-systems '("x86_64-linux" "i686-linux"))
4814 (license license:bsd-3)))
4816 (define-public reducelcs
4817 ;; This is the last commit which is available upstream, no
4818 ;; release happened since 2010.
4819 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4823 (version (string-append "1.0-" revision "." (string-take commit 7)))
4828 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4830 (file-name (string-append name "-" version "-checkout"))
4833 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4834 (build-system gnu-build-system)
4836 `(("openlibm" ,openlibm)))
4838 `(#:tests? #f ; no tests
4840 (modify-phases %standard-phases
4841 (delete 'configure) ; No configure script exists.
4842 (replace 'install ; No install phase exists.
4843 (lambda* (#:key outputs #:allow-other-keys)
4844 (let* ((out (assoc-ref outputs "out"))
4845 (bin (string-append out "/bin")))
4846 (install-file "Approximation" bin)
4847 (install-file "CollectResults" bin)
4848 (install-file "GenerateInstances" bin)
4850 (synopsis "Approximate Longest Commons Subsequence computation tool")
4852 "@code{reduceLCS} is an implementation of the Reduce-Expand
4853 algorithm for LCS. It is a fast program to compute the approximate
4854 Longest Commons Subsequence of a set of strings.")
4855 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4856 (license license:gpl3+))))
4858 (define-public jacal
4865 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4868 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4869 (patches (search-patches "jacal-fix-texinfo.patch"))))
4870 (build-system gnu-build-system)
4873 (modify-phases %standard-phases
4874 (add-before 'build 'pre-build
4875 ;; Don't use upstream's script - it really doesn't fit into
4876 ;; Guix's functional paradigm.
4877 (lambda* (#:key inputs outputs #:allow-other-keys)
4878 (substitute* "Makefile"
4879 (("^install: install-script") "install: "))))
4880 (add-after 'install 'post-install
4881 ;; Instead, we provide our own simplified script.
4882 (lambda* (#:key inputs outputs #:allow-other-keys)
4883 (let ((wrapper (string-append (assoc-ref outputs "out")
4885 (format (open wrapper (logior O_WRONLY O_CREAT))
4886 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4887 "-e '(slib:load \"~a/lib/jacal/math\") "
4890 (assoc-ref inputs "scm")
4891 (assoc-ref outputs "out"))
4892 (chmod wrapper #o555))))
4894 (lambda* (#:key outputs #:allow-other-keys)
4895 (invoke "./configure"
4896 (string-append "--prefix="
4897 (assoc-ref outputs "out"))))))))
4898 (inputs `(("scm" ,scm)))
4899 (native-inputs `(("unzip" ,unzip)
4900 ("texinfo" ,texinfo)))
4901 (synopsis "Symbolic mathematics system")
4902 (description "GNU JACAL is an interactive symbolic mathematics program based on
4903 Scheme. It manipulate and simplify a range of mathematical expressions such
4904 as equations, scalars, vectors, and matrices.")
4905 (home-page "https://www.gnu.org/software/jacal/")
4906 (license license:gpl3+)))
4912 (home-page "https://github.com/Z3Prover/z3")
4915 (uri (git-reference (url home-page)
4916 (commit (string-append "z3-" version))))
4917 (file-name (git-file-name name version))
4920 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4921 (build-system gnu-build-system)
4923 `(#:imported-modules ((guix build python-build-system)
4924 ,@%gnu-build-system-modules)
4925 #:modules (((guix build python-build-system) #:select (site-packages))
4926 (guix build gnu-build-system)
4929 (modify-phases %standard-phases
4930 (add-after 'unpack 'enable-bytecode-determinism
4932 (setenv "PYTHONHASHSEED" "0")
4934 (add-after 'unpack 'fix-compatability
4935 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4937 (substitute* "src/util/mpz.cpp"
4938 (("#include <immintrin.h>") ""))
4940 (add-before 'configure 'bootstrap
4942 (invoke "python" "scripts/mk_make.py")))
4943 ;; work around gnu-build-system's setting --enable-fast-install
4944 ;; (z3's `configure' is a wrapper around the above python file,
4945 ;; which fails when passed --enable-fast-install)
4947 (lambda* (#:key inputs outputs #:allow-other-keys)
4948 (invoke "./configure"
4950 (string-append "--prefix=" (assoc-ref outputs "out"))
4951 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4952 (add-after 'configure 'change-directory
4956 (add-before 'check 'make-test-z3
4958 ;; Build the test suite executable.
4959 (invoke "make" "test-z3" "-j"
4960 (number->string (parallel-job-count)))))
4963 ;; Run all the tests that don't require arguments.
4964 (invoke "./test-z3" "/a"))))))
4967 ("python" ,python-wrapper)))
4968 (synopsis "Theorem prover")
4969 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4970 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4971 (license license:expat)))
4976 (version "2018.11.001")
4979 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4980 version "/elpa-" version ".tar.gz"))
4983 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4984 (build-system gnu-build-system)
4986 `(("fortran" ,gfortran)
4987 ("perl" ,perl))) ;for configure and deps
4989 `(("blas" ,openblas)))
4994 ;; ELPA unfortunately does not support runtime dispatch, so we can
4995 ;; only enable the "generic" kernels. See the "Cross compilation"
4996 ;; section of INSTALL.md.
4998 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4999 "--disable-avx" "--disable-avx2" "--disable-avx512"
5000 ,(string-append "CFLAGS=-O3 "
5001 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5002 "-ftree-vect-loop-version -ftree-vectorize "
5003 ,(let ((system (or (%current-target-system)
5004 (%current-system))))
5006 ((or (string-prefix? "x86_64" system)
5007 (string-prefix? "i686" system))
5010 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5012 (modify-phases %standard-phases
5013 (add-before 'configure 'patch-header-generation
5015 (substitute* "configure"
5016 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5017 (string-append & " CPP=\"$CPP\"")))
5019 (add-before 'check 'setup-tests
5021 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5022 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5023 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5024 ;; for Fortran. This also causes several tests to pass that
5025 ;; otherwise would otherwise fail with matrix size 5000; possibly
5026 ;; due to floating point tolerances that are too tight.
5027 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5028 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5029 (substitute* "Makefile"
5030 ;; Test scripts are generated, patch the shebang
5031 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5033 (home-page "https://elpa.mpcdf.mpg.de")
5034 (synopsis "Eigenvalue solvers for symmetric matrices")
5036 "The ELPA library provides efficient and scalable direct eigensolvers for
5037 symmetric matrices.")
5038 (license license:lgpl3)))
5040 (define-public elpa-openmpi
5041 (package (inherit elpa)
5042 (name "elpa-openmpi")
5045 ("scalapack" ,scalapack)
5046 ,@(package-inputs elpa)))
5048 (substitute-keyword-arguments (package-arguments elpa)
5049 ((#:configure-flags cf '())
5050 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5051 ((#:phases phases '%standard-phases)
5052 `(modify-phases ,phases
5053 (add-before 'check 'mpi-setup
5055 ;; Tests use 2 mpi tasks by default, use our remaining build
5056 ;; cores as OpenMP threads.
5057 (setenv "OMP_NUM_THREADS" (number->string
5058 (max (quotient (parallel-job-count) 2)
5060 (,%openmpi-setup)))))))
5061 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5063 (define-public elemental
5070 (url "https://github.com/elemental/Elemental")
5071 (commit (string-append "v" version))))
5072 (file-name (git-file-name name version))
5075 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5076 (build-system cmake-build-system)
5077 (home-page "https://github.com/elemental/Elemental")
5079 `(("gfortran" ,gfortran)))
5081 `(("blas" ,openblas)
5082 ("gfortran:lib" ,gfortran "lib")
5091 `(#:build-type "Release" ;default RelWithDebInfo not supported
5092 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5093 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5094 "-DEL_CACHE_WARNINGS:BOOL=YES"
5095 "-DEL_TESTS:BOOL=YES"
5096 "-DCMAKE_INSTALL_LIBDIR=lib"
5097 "-DGFORTRAN_LIB=gfortran")
5098 #:phases (modify-phases %standard-phases
5099 (add-before 'check 'mpi-setup
5101 (add-before 'check 'setup-tests
5103 ;; Parallelism is done at the MPI layer.
5104 (setenv "OMP_NUM_THREADS" "1")
5106 (add-after 'install 'remove-tests
5107 (lambda* (#:key outputs #:allow-other-keys)
5108 ;; Tests are installed, with no easy configuration
5109 ;; switch to prevent this, so delete them.
5110 (delete-file-recursively
5111 (string-append (assoc-ref outputs "out") "/bin"))
5113 (synopsis "Dense and sparse-direct linear algebra and optimization")
5114 (description "Elemental is a modern C++ library for distributed-memory
5115 dense and sparse-direct linear algebra, conic optimization, and lattice
5117 (license license:bsd-2)))
5119 (define-public mcrl2
5122 (version "202006.0")
5126 "https://www.mcrl2.org/download/release/mcrl2-"
5130 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
5135 ("qtbase" ,qtbase)))
5136 (build-system cmake-build-system)
5137 (synopsis "Toolset for the mCRL2 formal specification language")
5139 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5140 specification language for describing concurrent discrete event systems. Its
5141 toolset supports analysis and automatic verification, linearisation, simulation,
5142 state-space exploration and generation, and tools to optimise and analyse
5143 specifications. Also, state spaces can be manipulated, visualised and
5145 (home-page "https://mcrl2.org")
5146 (license license:boost1.0)))
5148 (define-public mcrl2-minimal
5151 (name "mcrl2-minimal")
5153 `(("boost" ,boost)))
5155 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5157 (define-public tcalc
5164 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5168 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5169 (build-system gnu-build-system)
5170 (synopsis "The terminal calculator")
5172 "The terminal calculator is a small program to help users of the GNU/Linux
5173 terminal do calculations simply and quickly. The formula to be calculated can
5174 be fed to @command{tcalc} through the command line.")
5175 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5176 (license license:gpl3+)))
5178 (define-public tiny-bignum
5179 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5181 (name "tiny-bignum")
5182 (version (git-version "0" "0" commit))
5187 (url "https://github.com/kokke/tiny-bignum-c")
5189 (file-name (git-file-name "tiny-bignum" commit))
5191 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5192 (build-system gnu-build-system)
5195 (modify-phases %standard-phases
5197 (add-after 'unpack 'patch-tests
5199 (substitute* "scripts/test_rand.py"
5201 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5204 (lambda* (#:key tests? #:allow-other-keys)
5206 (invoke "make" "test"))
5209 (lambda* (#:key outputs #:allow-other-keys)
5210 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5211 (doc (string-append (assoc-ref outputs "out") "/doc")))
5213 (install-file "bn.c" share)
5214 (install-file "bn.h" share)
5216 (install-file "LICENSE" doc)
5217 (install-file "README.md" doc))
5220 `(("python" ,python-wrapper)))
5221 (home-page "https://github.com/kokke/tiny-bignum-c")
5222 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5224 "This library provides portable Arbitrary-precision unsigned integer
5225 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5226 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5227 and comparisons are supported.")
5228 (license license:unlicense))))
5230 (define-public sundials
5237 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5238 "sundials-" version ".tar.gz"))
5241 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5242 (build-system cmake-build-system)
5244 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5246 `(("fortran" ,gfortran) ;for fcmix
5248 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5250 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5251 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5252 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5253 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5254 "-DEXAMPLES_INSTALL:BOOL=OFF"
5256 "-DFCMIX_ENABLE:BOOL=ON"
5258 "-DKLU_ENABLE:BOOL=ON"
5259 ,(string-append "-DKLU_INCLUDE_DIR="
5260 (assoc-ref %build-inputs "suitesparse")
5262 ,(string-append "-DKLU_LIBRARY_DIR="
5263 (assoc-ref %build-inputs "suitesparse")
5265 (home-page "https://computation.llnl.gov/projects/sundials")
5266 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5267 (description "SUNDIALS is a family of software packages implemented with
5268 the goal of providing robust time integrators and nonlinear solvers that can
5269 easily be incorporated into existing simulation codes.")
5270 (license license:bsd-3)))
5272 (define-public sundials-openmpi
5273 (package (inherit sundials)
5274 (name "sundials-openmpi")
5277 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5278 ,@(package-inputs sundials)))
5280 (substitute-keyword-arguments (package-arguments sundials)
5281 ((#:configure-flags flags '())
5282 `(cons* "-DMPI_ENABLE:BOOL=ON"
5283 "-DPETSC_ENABLE:BOOL=ON"
5284 (string-append "-DPETSC_INCLUDE_DIR="
5285 (assoc-ref %build-inputs "petsc")
5287 (string-append "-DPETSC_LIBRARY_DIR="
5288 (assoc-ref %build-inputs "petsc")
5291 ((#:phases phases '%standard-phases)
5292 `(modify-phases ,phases
5293 (add-before 'check 'mpi-setup
5294 ,%openmpi-setup)))))
5295 (synopsis "SUNDIALS with OpenMPI support")))
5297 (define-public combinatorial-blas
5299 (name "combinatorial-blas")
5304 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5306 (match (string-split version #\.)
5307 ((major minor patch)
5308 (string-append major minor "_" patch))) ;e.g. "16_2"
5312 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5313 (patches (search-patches "combinatorial-blas-awpm.patch"
5314 "combinatorial-blas-io-fix.patch"))))
5315 (build-system cmake-build-system)
5318 ("test-data" ,(origin
5320 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5321 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5324 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5326 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5327 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5328 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5330 (modify-phases %standard-phases
5331 (add-before 'check 'mpi-setup
5333 (add-before 'check 'test-setup
5334 (lambda* (#:key inputs #:allow-other-keys)
5335 (setenv "OMP_NUM_THREADS" "2")
5336 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5337 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5338 (synopsis "Linear algebra primitives for graph analytics")
5339 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5340 distributed-memory parallel graph library offering a small but powerful set of
5341 linear algebra primitives specifically targeting graph analytics.")
5343 license:gpl2+ ;include/psort/(funnel|sort)*.h
5344 license:x11 ;usort and psort
5345 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5347 (define-public dune-common
5349 (name "dune-common")
5354 (uri (string-append "https://dune-project.org/download/"
5355 version "/dune-common-" version ".tar.gz"))
5358 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5359 (build-system cmake-build-system)
5362 (modify-phases %standard-phases
5363 (add-after 'build 'build-tests
5364 (lambda* (#:key make-flags #:allow-other-keys)
5365 (apply invoke "make" "build_tests" make-flags))))))
5369 ("openblas" ,openblas)
5371 ("superlu" ,superlu)))
5373 `(("gfortran" ,gfortran)
5374 ("pkg-config" ,pkg-config)))
5375 (home-page "https://dune-project.org/")
5376 (synopsis "Distributed and Unified Numerics Environment")
5377 (description "DUNE, the Distributed and Unified Numerics Environment is a
5378 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5379 grid-based methods. It supports the easy implementation of methods like
5380 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5381 Differences} (FD).")
5382 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5383 (license license:gpl2)))
5385 (define-public dune-geometry
5387 (name "dune-geometry")
5392 (uri (string-append "https://dune-project.org/download/"
5393 version "/dune-geometry-" version ".tar.gz"))
5396 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5397 (build-system cmake-build-system)
5400 (modify-phases %standard-phases
5401 (add-after 'build 'build-tests
5402 (lambda* (#:key make-flags #:allow-other-keys)
5403 (apply invoke "make" "build_tests" make-flags))))))
5405 `(("dune-common" ,dune-common)
5407 ("openblas" ,openblas)
5409 ("python" ,python)))
5411 `(("gfortran" ,gfortran)
5412 ("pkg-config" ,pkg-config)))
5413 (home-page "https://dune-project.org/")
5414 (synopsis "Distributed and Unified Numerics Environment")
5415 (description "DUNE, the Distributed and Unified Numerics Environment is a
5416 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5417 grid-based methods. It supports the easy implementation of methods like
5418 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5421 This package contains the basic DUNE geometry classes.")
5422 ;; GPL version 2 with "runtime exception"
5423 (license license:gpl2)))
5425 (define-public dune-uggrid
5427 (name "dune-uggrid")
5433 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5434 (commit (string-append "v" version))))
5435 (file-name (git-file-name name version))
5438 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5439 (build-system cmake-build-system)
5442 (modify-phases %standard-phases
5443 (add-after 'build 'build-tests
5444 (lambda* (#:key make-flags #:allow-other-keys)
5445 (apply invoke "make" "build_tests" make-flags))))))
5447 `(("dune-common" ,dune-common)))
5449 `(("gfortran" ,gfortran)
5450 ("pkg-config" ,pkg-config)))
5451 (home-page "https://dune-project.org/")
5452 (synopsis "Distributed and Unified Numerics Environment")
5453 (description "DUNE, the Distributed and Unified Numerics Environment is a
5454 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5455 grid-based methods. It supports the easy implementation of methods like
5456 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5459 This package contains the DUNE UG grid classes.")
5460 (license license:lgpl2.1)))
5462 (define-public dune-grid
5469 (uri (string-append "https://dune-project.org/download/"
5470 version "/dune-grid-" version ".tar.gz"))
5473 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5474 (build-system cmake-build-system)
5477 (modify-phases %standard-phases
5478 (add-after 'build 'build-tests
5479 (lambda* (#:key make-flags #:allow-other-keys)
5480 (apply invoke "make" "build_tests" make-flags))))))
5482 `(("dune-common" ,dune-common)
5483 ("dune-geometry" ,dune-geometry)
5486 ("openblas" ,openblas)
5487 ("python" ,python)))
5489 `(("dune-uggrid" ,dune-uggrid)))
5491 `(("gfortran" ,gfortran)
5492 ("pkg-config" ,pkg-config)))
5493 (home-page "https://dune-project.org/")
5494 (synopsis "Distributed and Unified Numerics Environment")
5495 (description "DUNE, the Distributed and Unified Numerics Environment is a
5496 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5497 grid-based methods. It supports the easy implementation of methods like
5498 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5501 This package contains the basic DUNE grid classes.")
5502 ;; GPL version 2 with "runtime exception"
5503 (license license:gpl2)))
5505 (define-public dune-istl
5512 (uri (string-append "https://dune-project.org/download/"
5513 version "/dune-istl-" version ".tar.gz"))
5516 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5517 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5518 (build-system cmake-build-system)
5521 (modify-phases %standard-phases
5522 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5523 ;; the stdlib types when the gfortran header is used. Remove gfortran
5524 ;; from CPLUS_INCLUDE_PATH as a workaround.
5525 (add-after 'set-paths 'hide-gfortran
5526 (lambda* (#:key inputs #:allow-other-keys)
5527 (let ((gfortran (assoc-ref inputs "gfortran")))
5528 (setenv "CPLUS_INCLUDE_PATH"
5530 (delete (string-append gfortran "/include/c++")
5531 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5534 (add-after 'build 'build-tests
5535 (lambda* (#:key make-flags #:allow-other-keys)
5536 (apply invoke "make" "build_tests" make-flags))))))
5538 `(("dune-common" ,dune-common)
5541 ("suitesparse" ,suitesparse)
5542 ("superlu" ,superlu)
5543 ("openblas" ,openblas)
5545 ("python" ,python)))
5547 `(("gfortran" ,gfortran)
5548 ("pkg-config" ,pkg-config)))
5549 (home-page "https://dune-project.org/")
5550 (synopsis "Distributed and Unified Numerics Environment")
5551 (description "DUNE, the Distributed and Unified Numerics Environment is a
5552 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5555 This is the iterative solver template library which provides generic sparse
5556 matrix/vector classes and a variety of solvers based on these classes. A
5557 special feature is the use of templates to exploit the recursive block
5558 structure of finite element matrices at compile time. Available solvers
5559 include Krylov methods, (block-) incomplete decompositions and
5560 aggregation-based algebraic multigrid.")
5561 ;; GPL version 2 with "runtime exception"
5562 (license license:gpl2)))
5564 (define-public dune-localfunctions
5566 (name "dune-localfunctions")
5571 (uri (string-append "https://dune-project.org/download/"
5572 version "/dune-localfunctions-" version ".tar.gz"))
5575 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5576 (build-system cmake-build-system)
5579 (modify-phases %standard-phases
5580 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5581 ;; and fails to find the stdlib types when the gfortran header is used.
5582 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5583 (add-after 'set-paths 'hide-gfortran
5584 (lambda* (#:key inputs #:allow-other-keys)
5585 (let ((gfortran (assoc-ref inputs "gfortran")))
5586 (setenv "CPLUS_INCLUDE_PATH"
5588 (delete (string-append gfortran "/include/c++")
5589 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5592 (add-after 'build 'build-tests
5593 (lambda* (#:key make-flags #:allow-other-keys)
5594 (apply invoke "make" "build_tests" make-flags))))))
5596 `(("dune-common" ,dune-common)
5597 ("dune-geometry" ,dune-geometry)
5600 ("superlu" ,superlu)
5603 `(("gfortran" ,gfortran)
5604 ("pkg-config" ,pkg-config)))
5605 (home-page "https://dune-project.org/")
5606 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5607 (description "This DUNE module provides interface and implementation for
5608 shape functions defined on the DUNE reference elements. In addition to the
5609 shape function, interpolation operators and special keys are provided which
5610 can be used to assemble global function spaces on finite-element grids.
5612 This package provides an interface and implementation for shape functions
5613 defined on the DUNE reference elements. In addition to the shape function,
5614 interpolation operators and special keys are provided which can be used to
5615 assemble global function spaces on finite-element grids.")
5616 ;; GPL version 2 with "runtime exception"
5617 (license license:gpl2)))
5619 (define-public dune-alugrid
5621 (name "dune-alugrid")
5622 (version "2.7.0-git-81d35682")
5627 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5628 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5629 (file-name (git-file-name name version))
5632 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5633 (build-system cmake-build-system)
5636 (modify-phases %standard-phases
5637 (add-after 'unpack 'patch-include
5639 (substitute* "dune/alugrid/test/test-alugrid.cc"
5640 (("doc/grids/gridfactory/testgrids")
5641 "doc/dune-grid/grids/gridfactory/testgrids"))
5643 (add-after 'build 'build-tests
5644 (lambda* (#:key inputs make-flags #:allow-other-keys)
5645 (setenv "CPLUS_INCLUDE_PATH"
5646 (string-append (assoc-ref inputs "dune-grid") "/share"))
5647 (apply invoke "make" "build_tests" make-flags))))))
5649 `(("dune-common" ,dune-common)
5650 ("dune-geometry" ,dune-geometry)
5651 ("dune-grid" ,dune-grid)
5654 ("openblas" ,openblas)
5656 ("superlu" ,superlu)
5660 `(("gfortran" ,gfortran)
5661 ("pkg-config" ,pkg-config)))
5662 (home-page "https://dune-project.org/")
5663 (synopsis "Distributed and Unified Numerics Environment")
5664 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5665 implementation of the DUNE grid interface supporting either simplices or
5667 (license license:gpl2+)))
5669 (define-public dune-subgrid
5671 (name "dune-subgrid")
5672 (version "2.7.0-git-2103a363")
5677 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5678 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5679 (file-name (git-file-name name version))
5682 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5683 (build-system cmake-build-system)
5686 (modify-phases %standard-phases
5687 (add-after 'build 'build-tests
5688 (lambda* (#:key make-flags #:allow-other-keys)
5689 (apply invoke "make" "build_tests" make-flags))))))
5691 `(("dune-common" ,dune-common)
5692 ("dune-geometry" ,dune-geometry)
5693 ("dune-grid" ,dune-grid)
5696 ("openblas" ,openblas)
5699 `(("gfortran" ,gfortran)
5700 ("pkg-config" ,pkg-config)))
5701 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5702 (synopsis "Distributed and Unified Numerics Environment")
5703 (description "The dune-subgrid module marks elements of
5704 another hierarchical dune grid. The set of marked elements can then be
5705 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5706 provides the full grid interface including adaptive mesh refinement.")
5707 (license license:gpl2+)))
5709 (define-public dune-typetree
5711 (name "dune-typetree")
5717 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5718 (commit (string-append "v" version))))
5719 (file-name (git-file-name name version))
5722 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5723 (build-system cmake-build-system)
5726 (modify-phases %standard-phases
5727 (add-after 'build 'build-tests
5728 (lambda* (#:key make-flags #:allow-other-keys)
5729 (apply invoke "make" "build_tests" make-flags))))))
5731 `(("dune-common" ,dune-common)
5733 ("openblas" ,openblas)
5736 ("superlu" ,superlu)
5739 `(("gfortran" ,gfortran)
5740 ("pkg-config" ,pkg-config)))
5741 (home-page "https://dune-project.org/")
5742 (synopsis "Distributed and Unified Numerics Environment")
5743 (description "TypeTree is a template library for constructing and
5744 operating on statically typed trees of objects.")
5745 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5746 (license (list license:lgpl3+ license:gpl2))))
5748 (define-public dune-functions
5750 (name "dune-functions")
5756 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5757 (commit (string-append "v" version))))
5758 (file-name (git-file-name name version))
5761 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5762 (build-system cmake-build-system)
5765 (modify-phases %standard-phases
5766 (add-after 'unpack 'disable-failing-tests
5769 ;; unable to load GMSH file in this test
5770 "--exclude-regex gridviewfunctionspacebasistest")
5772 (add-after 'build 'build-tests
5773 (lambda* (#:key make-flags #:allow-other-keys)
5774 (apply invoke "make" "build_tests" make-flags))))))
5776 `(("dune-common" ,dune-common)
5777 ("dune-istl" ,dune-istl)
5778 ("dune-localfunctions" ,dune-localfunctions)
5779 ("dune-grid" ,dune-grid)
5780 ("dune-geometry" ,dune-geometry)
5781 ("dune-typetree" ,dune-typetree)
5782 ("openblas" ,openblas)
5785 ("superlu" ,superlu)
5788 `(("gfortran" ,gfortran)
5789 ("pkg-config" ,pkg-config)))
5790 (home-page "https://dune-project.org/")
5791 (synopsis "Distributed and Unified Numerics Environment")
5792 (description "The dune-functions module provides an abstraction layer for
5793 global finite element functions. Its two main concepts are functions
5794 implemented as callable objects, and bases of finite element spaces.")
5795 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5796 (license (list license:lgpl3+ license:gpl2))))
5798 (define-public dune-pdelab
5800 (name "dune-pdelab")
5801 (version "2.7.0-git-476fe437")
5806 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5807 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5808 (file-name (git-file-name name version))
5811 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5812 (build-system cmake-build-system)
5813 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5815 `(("dune-common" ,dune-common)
5816 ("dune-istl" ,dune-istl)
5817 ("dune-localfunctions" ,dune-localfunctions)
5818 ("dune-geometry" ,dune-geometry)
5819 ("dune-grid" ,dune-grid)
5820 ("dune-typetree" ,dune-typetree)
5821 ("dune-functions" ,dune-functions)
5823 ("openblas" ,openblas)
5827 ("superlu" ,superlu)
5830 `(("gfortran" ,gfortran)
5831 ("pkg-config" ,pkg-config)))
5832 (home-page "https://dune-project.org/")
5833 (synopsis "Differential equations solver toolbox")
5834 (description "PDELab is a partial differential equations solver toolbox
5835 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5836 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5837 (license (list license:lgpl3+ license:gpl2))))
5839 (define add-openmpi-to-dune-package
5840 (let ((dune-package?
5841 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5844 (if (dune-package? p)
5845 (package (inherit p)
5846 (name (string-append (package-name p) "-openmpi"))
5847 (inputs `(,@(package-inputs p)
5848 ("openmpi" ,openmpi)))
5850 (substitute-keyword-arguments (package-arguments p)
5851 ((#:phases phases '%standard-phases)
5852 `(modify-phases ,phases
5853 (add-before 'check 'mpi-setup
5854 ,%openmpi-setup)))))
5855 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5857 (negate dune-package?))))
5859 (define-public dune-common-openmpi
5860 (add-openmpi-to-dune-package dune-common))
5862 (define-public dune-geometry-openmpi
5863 (add-openmpi-to-dune-package dune-geometry))
5865 (define-public dune-istl-openmpi
5866 (add-openmpi-to-dune-package dune-istl))
5868 (define-public dune-typetree-openmpi
5869 (add-openmpi-to-dune-package dune-typetree))
5871 (define-public dune-uggrid-openmpi
5872 (add-openmpi-to-dune-package dune-uggrid))
5874 (define-public dune-grid-openmpi
5875 (add-openmpi-to-dune-package dune-grid))
5877 (define-public dune-alugrid-openmpi
5878 (add-openmpi-to-dune-package dune-alugrid))
5880 (define-public dune-subgrid-openmpi
5881 (add-openmpi-to-dune-package dune-subgrid))
5883 (define-public dune-localfunctions-openmpi
5884 (add-openmpi-to-dune-package dune-localfunctions))
5886 (define-public dune-functions-openmpi
5887 (add-openmpi-to-dune-package dune-functions))
5889 (define-public dune-pdelab-openmpi
5890 (add-openmpi-to-dune-package dune-pdelab))
5892 (define-public mlucas
5900 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5902 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5903 (build-system gnu-build-system)
5905 `(("python2" ,python-2)))
5907 `(#:tests? #f ; no tests
5909 (modify-phases %standard-phases
5913 (call-with-output-file "Makefile"
5915 (format port "CC = gcc
5916 CFLAGS = -O3 ~a -DUSE_THREADS
5917 LDLIBS = -lm -lpthread -lrt
5918 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5920 ,(let ((system (or (%current-target-system)
5921 (%current-system))))
5923 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5927 (lambda* (#:key outputs #:allow-other-keys)
5928 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5929 (install-file "Mlucas" bin)
5930 (install-file "primenet.py" bin))
5932 (home-page "https://www.mersenne.org")
5933 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5934 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5935 numbers in search of a world-record prime. You may use it to test any
5936 suitable number as you wish, but it is preferable that you do so in a
5937 coordinated fashion, as part of the Great Internet Mersenne Prime
5938 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5939 management via the GIMPS project's Primenet server.")
5940 (license license:gpl2+)))
5942 (define-public nauty
5950 "https://pallini.di.uniroma1.it/"
5951 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5953 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5954 (build-system gnu-build-system)
5955 (outputs '("out" "lib"))
5957 `(#:test-target "checks"
5958 #:configure-flags '("--enable-generic") ;prevent -march-native
5960 (modify-phases %standard-phases
5961 ;; Default make target does not build all available
5962 ;; executables. Create them now.
5963 (add-after 'build 'build-extra-programs
5965 (for-each (lambda (target) (invoke "make" target))
5966 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5968 ;; Upstream does not provide any install target.
5970 (lambda* (#:key outputs #:allow-other-keys)
5971 (let* ((out (assoc-ref outputs "out"))
5972 (lib-output (assoc-ref outputs "lib"))
5973 (bin (string-append out "/bin"))
5974 (doc (string-append out "/share/doc/nauty/"))
5975 (include (string-append lib-output "/include/nauty"))
5976 (lib (string-append lib-output "/lib/nauty")))
5977 (for-each (lambda (f) (install-file f bin))
5978 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5979 "bliss2dre" "catg" "checks6" "complg" "converseg"
5980 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5981 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5982 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5983 "gentourng" "gentreeg" "hamheuristic" "labelg"
5984 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5985 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5986 "sumlines" "twohamg" "underlyingg" "vcolg"
5987 "watercluster2" "NRswitchg"))
5988 (for-each (lambda (f) (install-file f include))
5989 (find-files "." "\\.h$"))
5990 (for-each (lambda (f) (install-file f lib))
5991 (find-files "." "\\.a$"))
5992 (for-each (lambda (f) (install-file f doc))
5993 (append '("formats.txt" "README" "schreier.txt")
5994 (find-files "." "\\.pdf$")))))))))
5996 `(("gmp" ,gmp))) ;for sumlines
5997 (home-page "https://pallini.di.uniroma1.it/")
5998 (synopsis "Library for graph automorphisms")
5999 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6000 procedures for computing automorphism groups of graphs and digraphs.
6002 @code{nauty} computes graph information in the form of a set of
6003 generators, the size of the group, and the orbits of the group; it can
6004 also produce a canonical label. The @code{nauty} suite is written in
6005 C and comes with a command-line interface, a collection of
6006 command-line tools, and an Application Programming Interface (API).
6008 This package provides the static libraries required to run programs
6009 compiled against the nauty library.")
6010 (license license:asl2.0)))
6019 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6020 "ftp/releases/" version
6021 "/ppl-" version ".tar.gz"))
6024 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6025 (build-system gnu-build-system)
6031 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6033 "Parma Polyhedra Library for computations with polyhedra")
6035 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6036 especially targeted at applications in the field of analysis and
6037 verification of complex systems. These abstractions include convex
6038 polyhedra, defined as the intersection of a finite number of (open or
6039 closed) halfspaces, each described by a linear inequality (strict or
6040 non-strict) with rational coefficients; some special classes of polyhedra
6041 shapes that offer interesting complexity/precision tradeoffs; and grids
6042 which represent regularly spaced points that satisfy a set of linear
6043 congruence relations. The library also supports finite powersets and
6044 products of (any kind of) polyhedra and grids, a mixed integer linear
6045 programming problem solver using an exact-arithmetic version of the simplex
6046 algorithm, a parametric integer programming solver, and primitives for
6047 termination analysis via the automatic synthesis of linear ranking
6049 (license license:gpl3+)))
6051 (define-public speedcrunch
6053 (name "speedcrunch")
6059 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6060 (commit (string-append "release-" version))))
6061 (file-name (git-file-name name version))
6064 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6065 (build-system cmake-build-system)
6066 (inputs `(("qtbase" ,qtbase)))
6067 (native-inputs `(("qttools" ,qttools)))
6070 (modify-phases %standard-phases
6071 (add-after 'unpack 'chdir-to-src
6072 (lambda _ (chdir "src") #t)))))
6073 (synopsis "High-precision scientific calculator")
6075 "SpeedCrunch is a high-precision scientific calculator. It features a
6076 syntax-highlighted scrollable display and is designed to be fully used via
6077 keyboard. Some distinctive features are auto-completion of functions and
6078 variables, a formula book, and quick insertion of constants from various
6079 fields of knowledge.")
6080 (home-page "https://speedcrunch.org/")
6081 (license license:gpl2+)))
6083 (define-public minisat
6084 ;; This is the last commit which is available upstream, no
6085 ;; release happened since 2010.
6086 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6090 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6095 (url "https://github.com/niklasso/minisat")
6097 (file-name (string-append name "-" version "-checkout"))
6100 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6102 (search-patches "minisat-friend-declaration.patch"
6103 "minisat-install.patch"))))
6104 (build-system gnu-build-system)
6106 '(#:make-flags (list (string-append "prefix=" %output))
6107 #:tests? #f ;no check target
6109 (modify-phases %standard-phases
6110 (delete 'configure))))
6112 `(("zlib:static" ,zlib "static")
6115 "Small, yet efficient, SAT solver")
6117 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6118 researchers and developers alike to get started on SAT.")
6120 "http://minisat.se/MiniSat.html")
6121 (license license:expat))))
6123 (define-public libqalculate
6125 (name "libqalculate")
6131 (url "https://github.com/Qalculate/libqalculate/")
6132 (commit (string-append "v" version))))
6133 (file-name (git-file-name name version))
6135 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
6137 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6138 (build-system gnu-build-system)
6140 `(("pkg-config" ,pkg-config)
6141 ("gettext" ,gettext-minimal)
6142 ("intltool" ,intltool)
6143 ("automake" ,automake)
6144 ("autoconf" ,autoconf)
6145 ("libtool" ,libtool)
6146 ("doxygen" ,doxygen)
6151 ("libxml2" ,libxml2)
6154 ("gnuplot" ,gnuplot)
6155 ("readline" ,readline)
6156 ("libiconv" ,libiconv)))
6159 (modify-phases %standard-phases
6160 (add-before 'bootstrap 'setenv
6161 ;; Prevent the autogen.sh script to carry out the configure
6162 ;; script, which has not yet been patched to replace /bin/sh.
6164 (setenv "NOCONFIGURE" "TRUE")
6166 (home-page "https://qalculate.github.io/")
6167 (synopsis "Multi-purpose cli desktop calculator and library")
6169 "Libqalculate is a multi-purpose cli desktop calculator and library.
6170 It provides basic and advanced functionality. Features include customizable
6171 functions, unit calculations, and conversions, physical constants, symbolic
6172 calculations (including integrals and equations), arbitrary precision,
6173 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6175 (license license:gpl2+)))
6177 (define-public qalculate-gtk
6179 (name "qalculate-gtk")
6185 (url "https://github.com/Qalculate/qalculate-gtk/")
6186 (commit (string-append "v" version))))
6187 (file-name (git-file-name name version))
6189 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
6190 (build-system glib-or-gtk-build-system)
6192 `(("pkg-config" ,pkg-config)
6193 ("intltool" ,intltool)
6194 ("automake" ,automake)
6195 ("autoconf" ,autoconf)
6196 ("libtool" ,libtool)
6201 ("libqalculate" ,libqalculate)
6202 ("libxml2" ,libxml2)
6207 (modify-phases %standard-phases
6208 (add-before 'bootstrap 'setenv
6209 ;; Prevent the autogen.sh script to carry out the configure
6210 ;; script, which has not yet been patched to replace /bin/sh.
6212 (setenv "NOCONFIGURE" "TRUE")
6214 (add-before 'check 'add-pot-file
6215 ;; the file contains translations and are currently not in use
6216 ;; left out on purpose so add it to POTFILES.skip
6218 (with-output-to-file "po/POTFILES.skip"
6220 (format #t "data/shortcuts.ui~%")
6223 (home-page "https://qalculate.github.io/")
6224 (synopsis "Multi-purpose graphical desktop calculator")
6226 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6227 multi-purpose GUI desktop calculator. It provides basic and advanced
6228 functionality. Features include customizable functions, unit calculations,
6229 and conversions, physical constants, symbolic calculations (including
6230 integrals and equations), arbitrary precision, uncertainty propagation,
6231 interval arithmetic, plotting.")
6232 (license license:gpl2+)))