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 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 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 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 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 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 Vinicius Monego <monego@posteo.net>
43 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
44 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
46 ;;; This file is part of GNU Guix.
48 ;;; GNU Guix is free software; you can redistribute it and/or modify it
49 ;;; under the terms of the GNU General Public License as published by
50 ;;; the Free Software Foundation; either version 3 of the License, or (at
51 ;;; your option) any later version.
53 ;;; GNU Guix is distributed in the hope that it will be useful, but
54 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 ;;; GNU General Public License for more details.
58 ;;; You should have received a copy of the GNU General Public License
59 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
61 (define-module (gnu packages maths)
62 #:use-module (ice-9 regex)
63 #:use-module (ice-9 match)
64 #:use-module (gnu packages)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix utils)
70 #:use-module ((guix build utils) #:select (alist-replace))
71 #:use-module (guix build-system cmake)
72 #:use-module (guix build-system glib-or-gtk)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system ruby)
76 #:use-module (gnu packages algebra)
77 #:use-module (gnu packages audio)
78 #:use-module (gnu packages autotools)
79 #:use-module (gnu packages base)
80 #:use-module (gnu packages bison)
81 #:use-module (gnu packages boost)
82 #:use-module (gnu packages check)
83 #:use-module (gnu packages cmake)
84 #:use-module (gnu packages compression)
85 #:use-module (gnu packages curl)
86 #:use-module (gnu packages cyrus-sasl)
87 #:use-module (gnu packages dbm)
88 #:use-module (gnu packages documentation)
89 #:use-module (gnu packages elf)
90 #:use-module (gnu packages file)
91 #:use-module (gnu packages flex)
92 #:use-module (gnu packages fltk)
93 #:use-module (gnu packages fontutils)
94 #:use-module (gnu packages gettext)
95 #:use-module (gnu packages gcc)
96 #:use-module (gnu packages gd)
97 #:use-module (gnu packages ghostscript)
98 #:use-module (gnu packages glib)
99 #:use-module (gnu packages graphviz)
100 #:use-module (gnu packages gtk)
101 #:use-module (gnu packages icu4c)
102 #:use-module (gnu packages image)
103 #:use-module (gnu packages java)
104 #:use-module (gnu packages less)
105 #:use-module (gnu packages lisp)
106 #:use-module (gnu packages linux)
107 #:use-module (gnu packages logging)
108 #:use-module (gnu packages lua)
109 #:use-module (gnu packages gnome)
110 #:use-module (gnu packages guile)
111 #:use-module (gnu packages xorg)
112 #:use-module (gnu packages gl)
113 #:use-module (gnu packages imagemagick)
114 #:use-module (gnu packages m4)
115 #:use-module (gnu packages mpi)
116 #:use-module (gnu packages multiprecision)
117 #:use-module (gnu packages netpbm)
118 #:use-module (gnu packages onc-rpc)
119 #:use-module (gnu packages pcre)
120 #:use-module (gnu packages popt)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages pkg-config)
123 #:use-module (gnu packages pulseaudio)
124 #:use-module (gnu packages python)
125 #:use-module (gnu packages python-web)
126 #:use-module (gnu packages python-xyz)
127 #:use-module (gnu packages qt)
128 #:use-module (gnu packages readline)
129 #:use-module (gnu packages ruby)
130 #:use-module (gnu packages tbb)
131 #:use-module (gnu packages scheme)
132 #:use-module (gnu packages shells)
133 #:use-module (gnu packages tcl)
134 #:use-module (gnu packages texinfo)
135 #:use-module (gnu packages tex)
136 #:use-module (gnu packages tls)
137 #:use-module (gnu packages version-control)
138 #:use-module (gnu packages wxwidgets)
139 #:use-module (gnu packages xml)
140 #:use-module (srfi srfi-1)
141 #:use-module (srfi srfi-26))
149 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
151 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
152 (build-system gnu-build-system)
153 (inputs `(("gtk+" ,gtk+)
154 ("libxml2" ,libxml2)))
155 (native-inputs `(("pkg-config" ,pkg-config)))
156 (synopsis "Natural deduction first-order logic interface")
157 (description "Aris is a program for performing logical proofs. It supports
158 propositional and predicate logic, as well as Boolean algebra and
159 arithmetical logic. In addition to its predefined inference and equivalence
160 rules, Aris also supports references to older proofs. Its use of standard
161 logical symbols and its natural deduction interface make it easy to use for
163 (license license:gpl3+)
164 (home-page "https://www.gnu.org/software/aris/")))
166 (define-public c-graph
172 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
175 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
176 (build-system gnu-build-system)
178 `(("fortran" ,gfortran)))
179 (synopsis "Visualizing and demonstrating convolution")
181 "GNU C-Graph is a tool for demonstrating the theory of convolution.
182 Thus, it can serve as an excellent aid to students of signal and systems
183 theory in visualizing the convolution process. Rather than forcing the
184 student to write code, the program offers an intuitive interface with
185 interactive dialogs to guide them.")
186 (license license:gpl3+)
187 (home-page "https://www.gnu.org/software/c-graph/")))
196 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
197 version "/coda-" version ".tar.gz"))
199 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
200 (patches (search-patches "coda-use-system-libs.patch"))
201 (modules '((guix build utils)))
203 ;; Make sure we don't use the bundled software.
205 (for-each (lambda (d)
206 (delete-file-recursively (string-append "libcoda/" d)))
207 '("zlib" "pcre" "expat"))
210 `(("fortran" ,gfortran)
212 ("python-numpy" ,python-numpy)))
219 (build-system gnu-build-system)
221 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
222 "LIBS= -lz -lpcre -lexpat")))
223 (synopsis "A common interface to various earth observation data formats")
225 "The Common Data Access toolbox (CODA) provides a set of interfaces for
226 reading remote sensing data from earth observation data files. It consists of
227 command line applications and interfaces to the C, Fortran, Python, and Java
228 programming languages.")
229 (home-page "https://stcorp.nl/coda")
230 (license license:gpl2+)))
238 (uri (string-append "http://www.qhull.org/download/qhull-"
239 (car (string-split version #\.))
243 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
244 (build-system cmake-build-system)
245 (synopsis "Calculate convex hulls and related structures")
247 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
248 diagram, halfspace intersection about a point, furthest-site Delaunay
249 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
250 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
251 algorithm for computing the convex hull. It handles roundoff errors from
252 floating point arithmetic. It computes volumes, surface areas, and
253 approximations to the convex hull.
255 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
256 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
257 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
259 (home-page "http://qhull.org")
260 (license (license:non-copyleft "file://COPYING.txt"
261 "See COPYING in the distribution."))))
263 (define-public python-cvxopt
265 (name "python-cvxopt")
270 (url "https://github.com/cvxopt/cvxopt")
272 (file-name (git-file-name name version))
275 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
276 (build-system python-build-system)
279 (modify-phases %standard-phases
280 (add-after 'unpack 'find-libraries
281 (lambda* (#:key inputs #:allow-other-keys)
282 (setenv "CVXOPT_BLAS_LIB" "openblas")
283 (setenv "CVXOPT_BUILD_FFTW" "1")
284 (setenv "CVXOPT_BUILD_GLPK" "1")
285 (setenv "CVXOPT_BUILD_GSL" "1")
292 ("openblas" ,openblas)
293 ("suitesparse" ,suitesparse)))
294 (home-page "https://www.cvxopt.org")
295 (synopsis "Python library for convex optimization")
297 "CVXOPT is a package for convex optimization based on the Python
298 programming language. Its main purpose is to make the development of software
299 for convex optimization applications straightforward by building on Python’s
300 extensive standard library and on the strengths of Python as a high-level
301 programming language.")
302 (license license:gpl3+)))
304 (define-public python2-cvxopt
305 (package-with-python2 python-cvxopt))
313 (uri (string-append "mirror://gnu/units/units-" version
316 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
317 (build-system gnu-build-system)
319 `(("readline" ,readline)
320 ("python" ,python-wrapper) ;for 'units_cur' script
321 ("python-requests" ,python-requests)))
323 `(#:phases (modify-phases %standard-phases
324 (add-after 'install 'wrap-units_cur
325 (lambda* (#:key outputs #:allow-other-keys)
326 (let* ((out (assoc-ref outputs "out"))
327 (bin (string-append out "/bin")))
328 (wrap-program (string-append bin "/units_cur")
329 `("PYTHONPATH" ":" prefix
330 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
332 (synopsis "Conversion between thousands of scales")
334 "GNU Units converts numeric quantities between units of measure. It
335 can handle scale changes through adaptive usage of standard scale
336 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
337 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
338 enough to be used effectively as a scientific calculator.")
339 (license license:gpl3+)
340 (home-page "https://www.gnu.org/software/units/")))
342 (define-public double-conversion
344 (name "double-conversion")
346 (home-page "https://github.com/google/double-conversion")
349 (uri (git-reference (url home-page)
350 (commit (string-append "v" version))))
351 (file-name (git-file-name name version))
354 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
355 (build-system cmake-build-system)
357 '(#:test-target "test"
358 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
359 "-DBUILD_TESTING=ON")))
360 (synopsis "Conversion routines for IEEE doubles")
362 "The double-conversion library provides binary-decimal and decimal-binary
363 routines for IEEE doubles. The library consists of efficient conversion
364 routines that have been extracted from the V8 JavaScript engine.")
365 (license license:bsd-3)))
367 (define-public dionysus
373 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
377 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
378 (build-system gnu-build-system)
379 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
380 (synopsis "Local search for universal constants and scientific values")
382 "GNU Dionysus is a convenient system for quickly retrieving the values of
383 mathematical constants used in science and engineering. Values can be
384 searched using a simple command-line tool, choosing from three databases:
385 universal constants, atomic numbers, and constants related to
387 (license license:gpl3+)
388 (home-page "https://www.gnu.org/software/dionysus/")))
399 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
400 "dSFMT-src-" version ".tar.gz"))
403 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
404 (modules '((guix build utils)))
405 ;; Don't distribute html documentation with bundled jquery.
408 (delete-file-recursively "html") #t))
409 ;; Add patches borrowed from Julia.
415 "https://raw.githubusercontent.com/JuliaLang/julia/"
416 "v1.3.0/deps/patches/dSFMT.c.patch"))
418 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
419 (file-name "dSFMT.c.patch"))
423 "https://raw.githubusercontent.com/JuliaLang/julia/"
424 "v1.3.0/deps/patches/dSFMT.h.patch"))
426 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
427 (file-name "dSFMT.h.patch"))))))
428 (build-system gnu-build-system)
431 (modify-phases %standard-phases
432 (delete 'configure) ; no configure script
434 ;; Upstream Makefile does not build a shared library. Borrow from Julia
435 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
438 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
439 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
440 "-O3" "-finline-functions" "-fomit-frame-pointer"
441 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
442 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
443 "-o" "libdSFMT.so")))
444 (replace 'install ; no "install" target
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let* ((out (assoc-ref outputs "out"))
447 (lib (string-append out "/lib"))
448 (inc (string-append out "/include"))
449 (doc (string-append out "/share/doc/" ,name "-" ,version)))
450 (install-file "libdSFMT.so" lib)
451 (install-file "dSFMT.h" inc)
452 (install-file "LICENSE.txt" doc)
454 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
456 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
457 the expensive conversion of integer to double (floating point). dSFMT directly
458 generates double precision floating point pseudorandom numbers which have the
459 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
460 format. dSFMT is only available on the CPUs which use IEEE 754 format double
461 precision floating point numbers.")
462 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
463 (license license:bsd-3)))
471 (uri (string-append "mirror://gnu/gsl/gsl-"
475 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
476 (build-system gnu-build-system)
478 (let ((system (%current-system)))
480 ((or (string-prefix? "aarch64" system)
481 (string-prefix? "powerpc" system))
482 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
483 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
484 '(#:phases (modify-phases %standard-phases
485 (add-before 'check 'disable-failing-tests
487 (substitute* "spmatrix/test.c"
488 ((".*test_complex.*") "\n"))
490 ((string-prefix? "i686" system)
491 ;; There are rounding issues with these tests on i686:
492 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
493 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
494 '(#:phases (modify-phases %standard-phases
495 (add-before 'check 'disable-failing-tests
497 (substitute* "linalg/test.c"
498 ((".*gsl_test\\(test_LU_decomp.*") "\n")
499 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
500 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
501 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
502 (substitute* "spmatrix/test.c"
503 ((".*test_all.*") "\n")
504 ((".*test_float.*") "\n")
505 ((".*test_complex.*") "\n"))
508 (home-page "https://www.gnu.org/software/gsl/")
509 (synopsis "Numerical library for C and C++")
511 "The GNU Scientific Library is a library for numerical analysis in C
512 and C++. It includes a wide range of mathematical routines, with over 1000
513 functions in total. Subject areas covered by the library include:
514 differential equations, linear algebra, Fast Fourier Transforms and random
516 (license license:gpl3+)))
526 (url "https://github.com/shibatch/sleef")
528 (file-name (git-file-name name version))
530 (base32 "1gvf7cfvszmgjrsqivwmyy1jnp3hy80dmszxx827lhjz8yqq5019"))))
531 (build-system cmake-build-system)
533 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
534 (string-append "-DCMAKE_INSTALL_LIBDIR="
535 (assoc-ref %outputs "out")
537 (string-append "-DCMAKE_INSTALL_PREFIX="
538 (assoc-ref %outputs "out")))
540 (modify-phases %standard-phases
541 ;; SLEEF generates a header library during the build process and writes
542 ;; to it via shell redirection. Make the checkout writable so the
543 ;; build can succeed.
544 (add-after 'unpack 'make-git-checkout-writable
546 (for-each make-file-writable (find-files "."))
552 ("openssl" ,openssl)))
553 (home-page "https://sleef.org/")
554 (synopsis "SIMD library for evaluating elementary functions and DFT")
556 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
557 implements vectorized versions of all C99 real floating point math functions.
558 It can utilize SIMD instructions that are available on modern processors.")
559 (license (list license:boost1.0 ;sleef
560 license:cc-by4.0)))) ;simplex algorithm
569 (uri (string-append "mirror://gnu/glpk/glpk-"
573 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
574 (build-system gnu-build-system)
578 `(#:configure-flags '("--with-gmp")))
579 (home-page "https://www.gnu.org/software/glpk/")
580 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
582 "GLPK is a C library for solving large-scale linear programming (LP),
583 mixed integer programming (MIP), and other related problems. It supports the
584 GNU MathProg modeling language, a subset of the AMPL language, and features a
585 translator for the language. In addition to the C library, a stand-alone
586 LP/MIP solver is included in the package.")
587 (license license:gpl3+)))
596 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
598 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
600 "/4ti2-" version ".tar.gz"))
602 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
603 (build-system gnu-build-system)
605 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
609 (home-page "http://www.4ti2.de/")
610 (synopsis "Mathematical tool suite for problems on linear spaces")
612 "4ti2 implements algorithms for solving algebraic, geometric and
613 combinatorial problems on linear spaces. Among others, it solves systems
614 of linear equations, computes extreme rays of polyhedral cones, solves
615 integer programming problems and computes Markov bases for statistics.")
616 (license license:gpl2+)))
618 (define-public cddlib
625 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
626 (string-delete #\. version) ".tar.gz"))
629 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
630 (build-system gnu-build-system)
633 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
634 (synopsis "Library for convex hulls and extreme rays of polyhedra")
636 "The C-library cddlib implements the Double Description Method of
637 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
638 rays of a general convex polyhedron given by a system of linear inequalities
639 in arbitrary dimension. It can also be used for the converse operation of
640 computing convex hulls.")
641 (license license:gpl2+)))
643 (define-public lrslib
650 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
652 (string-delete #\. version) ".tar.gz"))
655 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
656 (build-system gnu-build-system)
660 `(#:tests? #f ; no check phase
661 #:make-flags `("CC=gcc"
662 ,(string-append "prefix=" (assoc-ref %outputs "out"))
665 (modify-phases %standard-phases
668 (substitute* "makefile"
669 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
671 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
672 (synopsis "Convex hulls of polyhedra with exact arithmetic")
674 "The C code of lrslib implements the reverse search algorithm for
675 vertex enumeration and convex hull problems. Its input file format is
676 compatible with cddlib. All computations are done exactly in either
677 multiple precision or fixed integer arithmetic. Output is not stored
678 in memory, so even problems with very large output sizes can sometimes
680 (license license:gpl2+)))
689 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
690 "vinci/vinci-" version ".tar.gz"))
693 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
694 (build-system gnu-build-system)
696 `(("lrslib" ,lrslib)))
698 `(#:tests? #f ; no check phase
700 (modify-phases %standard-phases
702 ;; register the lrs location in the config file
703 (lambda* (#:key inputs #:allow-other-keys)
704 (let* ((lrs (assoc-ref inputs "lrslib"))
705 (lrsexec (string-append lrs "/bin/lrs")))
706 (substitute* "vinci.h"
707 (("#define LRS_EXEC \"lrs\"")
708 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
711 (lambda* (#:key outputs #:allow-other-keys)
712 (let* ((out (assoc-ref outputs "out"))
713 (bin (string-append out "/bin")))
714 (install-file "vinci" bin))
717 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
718 (synopsis "Volume computation for polytopes")
720 "Vinci implements a number of volume computation algorithms for convex
721 polytopes in arbitrary dimension. The polytopes can be given by their
722 V-representation (as the convex hull of a finite number of vertices), by
723 their H-representation (as the bounded intersection of a finite number of
724 halfspaces) or by their double description with both representations.")
725 (license license:gpl2+)))
727 (define-public arpack-ng
731 (home-page "https://github.com/opencollab/arpack-ng")
734 (uri (git-reference (url home-page) (commit version)))
735 (file-name (git-file-name name version))
738 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
739 (build-system gnu-build-system)
741 `(("autoconf" ,autoconf)
742 ("automake" ,automake)
743 ("libtool" ,libtool)))
746 ("fortran" ,gfortran)))
747 (synopsis "Fortran subroutines for solving eigenvalue problems")
749 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
750 large scale eigenvalue problems.")
751 (license (license:non-copyleft "file://COPYING"
752 "See COPYING in the distribution."))))
754 (define-public arpack-ng-3.3.0
758 (name (package-name arpack-ng))
759 (home-page (package-home-page arpack-ng))
763 (uri (string-append home-page "/archive/" version ".tar.gz"))
764 (file-name (string-append name "-" version ".tar.gz"))
767 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
769 (define-public arpack-ng-openmpi
770 (package (inherit arpack-ng)
771 (name "arpack-ng-openmpi")
774 ,@(package-inputs arpack-ng)))
776 (substitute-keyword-arguments (package-arguments arpack-ng)
777 ((#:configure-flags _ '())
779 ((#:phases phases '%standard-phases)
780 `(modify-phases ,phases
781 (add-before 'check 'mpi-setup
783 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
785 (define-public lapack
792 (uri (string-append "http://www.netlib.org/lapack/lapack-"
796 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
797 (build-system cmake-build-system)
798 (home-page "http://www.netlib.org/lapack/")
799 (inputs `(("fortran" ,gfortran)
800 ("python" ,python-wrapper)))
802 `(#:configure-flags (list
803 "-DBUILD_SHARED_LIBS:BOOL=YES"
805 ;; Build the 'LAPACKE_clatms' functions.
806 "-DLAPACKE_WITH_TMG=ON"
807 "-DBUILD_TESTING=ON")))
808 (synopsis "Library for numerical linear algebra")
810 "LAPACK is a Fortran 90 library for solving the most commonly occurring
811 problems in numerical linear algebra.")
812 (license (license:non-copyleft "file://LICENSE"
813 "See LICENSE in the distribution."))))
815 (define-public clapack
822 (uri (string-append "http://www.netlib.org/clapack/clapack-"
823 version "-CMAKE.tgz"))
826 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
827 (build-system cmake-build-system)
830 (modify-phases %standard-phases
831 ;; These tests use a lot of stack variables and segfault without
832 ;; lifting resource limits.
833 (add-after 'unpack 'disable-broken-tests
835 (substitute* "TESTING/CMakeLists.txt"
836 (("add_lapack_test.* xeigtstz\\)") ""))
839 (lambda* (#:key outputs #:allow-other-keys)
840 (let* ((out (assoc-ref outputs "out"))
841 (libdir (string-append out "/lib"))
842 (f2cinc (string-append out "/include/libf2c")))
845 (for-each (lambda (file)
846 (install-file file libdir))
848 "F2CLIBS/libf2c/libf2c.a"
849 "TESTING/MATGEN/libtmglib.a"
850 "BLAS/SRC/libblas.a"))
851 (for-each (lambda (file)
852 (install-file file f2cinc))
853 (cons "F2CLIBS/libf2c/arith.h"
854 (find-files (string-append "../clapack-"
855 ,version "-CMAKE/F2CLIBS/libf2c")
857 (copy-recursively (string-append "../clapack-"
858 ,version "-CMAKE/INCLUDE")
859 (string-append out "/include"))
861 (home-page "https://www.netlib.org/clapack/")
862 (synopsis "Numerical linear algebra library for C")
864 "The CLAPACK library was built using a Fortran to C conversion utility
865 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
866 C code, and then modified to improve readability. CLAPACK's goal is to
867 provide LAPACK for someone who does not have access to a Fortran compiler.")
868 (license (license:non-copyleft "file://LICENSE"
869 "See LICENSE in the distribution."))))
871 (define-public scalapack
878 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
882 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
883 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
884 (build-system cmake-build-system)
887 ("fortran" ,gfortran)
888 ("lapack" ,lapack))) ;for testing only
890 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
891 #:phases (modify-phases %standard-phases
892 (add-before 'check 'mpi-setup
894 (home-page "http://www.netlib.org/scalapack/")
895 (synopsis "Library for scalable numerical linear algebra")
897 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
898 routines on parallel distributed memory machines. ScaLAPACK solves dense and
899 banded linear systems, least squares problems, eigenvalue problems, and
900 singular value problems.")
901 (license (license:non-copyleft "file://LICENSE"
902 "See LICENSE in the distribution."))))
904 (define-public gnuplot
910 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
914 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
915 (build-system gnu-build-system)
916 (inputs `(("readline" ,readline)
922 `(("pkg-config" ,pkg-config)
923 ("texlive" ,texlive-tiny)))
924 (arguments `(#:configure-flags (list (string-append
925 "--with-texdir=" %output
926 "/texmf-local/tex/latex/gnuplot"))))
927 (home-page "http://www.gnuplot.info")
928 (synopsis "Command-line driven graphing utility")
929 (description "Gnuplot is a portable command-line driven graphing
930 utility. It was originally created to allow scientists and students to
931 visualize mathematical functions and data interactively, but has grown to
932 support many non-interactive uses such as web scripting. It is also used as a
933 plotting engine by third-party applications like Octave.")
934 ;; X11 Style with the additional restriction that derived works may only be
935 ;; distributed as patches to the original.
936 (license (license:fsf-free
937 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
947 (url "https://github.com/OkoSanto/GCTP")
948 (commit (string-append "v" version))))
949 (file-name (git-file-name name version))
951 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
953 `(("fortran" ,gfortran)))
954 (build-system gnu-build-system)
955 (synopsis "General Cartographic Transformation Package (GCTP)")
957 "The General Cartographic Transformation Package (GCTP) is a system of
958 software routines designed to permit the transformation of coordinate pairs
959 from one map projection to another. The GCTP is the standard computer
960 software used by the National Mapping Division for map projection
962 (home-page "https://github.com/OkoSanto/GCTP")
963 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
972 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
973 version "/src/hdf-" version ".tar.bz2"))
975 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
976 (patches (search-patches "hdf4-architectures.patch"
977 "hdf4-reproducibility.patch"
978 "hdf4-shared-fortran.patch"
979 "hdf4-tirpc.patch"))))
980 (build-system gnu-build-system)
982 `(("gfortran" ,gfortran)
987 ("libjpeg" ,libjpeg-turbo)
988 ("libtirpc" ,libtirpc)))
990 `(#:parallel-tests? #f
991 #:configure-flags (list "--enable-shared"
992 (string-append "CPPFLAGS=-I"
993 (assoc-ref %build-inputs "libtirpc")
996 (modify-phases %standard-phases
997 ;; This is inspired by two of Debian's patches.
998 (add-before 'configure 'add-more-aarch64-support
1000 (substitute* '("mfhdf/ncgen/ncgen.l"
1001 "mfhdf/ncgen/ncgenyy.c"
1002 "mfhdf/libsrc/netcdf.h.in")
1003 (("AIX5L64") "__aarch64__"))
1005 (add-before 'configure 'patchbuild
1008 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1010 (("/bin/mkdir") "mkdir"))
1011 (substitute* (find-files "." "^Makefile\\.in$")
1012 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1013 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1014 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1015 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1016 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1018 (add-after 'configure 'patch-settings
1020 ;; libhdf4.settings contains the full path of the
1021 ;; compilers used, and its contents are included in
1022 ;; .so-files. We truncate the hashes to avoid
1023 ;; unnecessary store references to those compilers:
1024 (substitute* "libhdf4.settings"
1025 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1026 (string-append prefix (string-take hash 10) "...")))
1028 (add-after 'install 'provide-absolute-libjpeg-reference
1029 (lambda* (#:key inputs outputs #:allow-other-keys)
1030 (let ((out (assoc-ref outputs "out"))
1031 (libjpeg (assoc-ref inputs "libjpeg")))
1032 ;; libjpeg-turbo does not provide a .la file, so libtool is
1033 ;; unable to add an absolute reference for -ljpeg in the .la
1034 ;; files. Fix it manually to avoid having to propagate it.
1035 (substitute* (find-files (string-append out "/lib") "\\.la$")
1037 (string-append "-L" libjpeg "/lib -ljpeg")))
1039 (home-page "https://www.hdfgroup.org/products/hdf4/")
1041 "Library and multi-object file format for storing and managing data")
1042 (description "HDF4 is a library and multi-object file format for storing
1043 and managing data between machines. HDF4 is an older hierarchical data format,
1044 incompatible with HDF5.")
1046 (license:non-copyleft
1047 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1049 (define-public hdf4-alt
1054 (substitute-keyword-arguments (package-arguments hdf4)
1055 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1057 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1059 (define-public hdf5-1.8
1066 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1067 "hdf5-" (version-major+minor version)
1068 "/hdf5-" version "/src/hdf5-"
1070 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1072 (match (string-split version #\.)
1073 ((major minor _ ...)
1074 (string-append major minor)))
1075 "/src/hdf5-" version ".tar.bz2")))
1077 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1078 (patches (search-patches "hdf5-config-date.patch"
1079 "hdf5-1.8-mpi-deprecations.patch"))))
1080 (build-system gnu-build-system)
1084 `(("gfortran" ,gfortran)
1085 ("perl" ,perl))) ;part of the test machinery needs Perl
1086 (outputs '("out" ; core library
1087 "fortran")) ; fortran interface
1089 `(;; Some of the users, notably Flann, need the C++ interface.
1090 #:configure-flags '("--enable-cxx"
1092 "--enable-fortran2003"
1094 ;; Build a thread-safe library. Unfortunately,
1095 ;; 'configure' invites you to either turn off C++,
1096 ;; Fortran, and the high-level interface (HL), or
1097 ;; to pass '--enable-unsupported'. Debian
1098 ;; packagers chose to pass '--enable-unsupported'
1099 ;; and we follow their lead here.
1100 "--enable-threadsafe"
1102 "--enable-unsupported")
1103 ;; Use -fPIC to allow the R bindings to link with the static libraries
1104 #:make-flags (list "CFLAGS=-fPIC"
1107 (modify-phases %standard-phases
1108 (add-before 'configure 'patch-configure
1109 (lambda* (#:key outputs #:allow-other-keys)
1110 (substitute* "configure"
1112 (substitute* "fortran/src/Makefile.in"
1113 (("libhdf5_fortran_la_LDFLAGS =")
1114 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1115 (assoc-ref outputs "fortran") "/lib")))
1116 (substitute* "hl/fortran/src/Makefile.in"
1117 (("libhdf5hl_fortran_la_LDFLAGS =")
1118 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1119 (assoc-ref outputs "fortran") "/lib")))
1121 (add-after 'configure 'patch-settings
1123 ;; libhdf5.settings contains the full path of the
1124 ;; compilers used, and its contents are included in
1125 ;; libhdf5.so. We truncate the hashes to avoid
1126 ;; unnecessary store references to those compilers:
1127 (substitute* "src/libhdf5.settings"
1128 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1129 (string-append prefix (string-take hash 10) "..."))
1130 ;; Don't record the build-time kernel version to make the
1131 ;; settings file reproducible.
1132 (("Uname information:.*")
1133 "Uname information: Linux\n"))
1135 (add-after 'install 'patch-references
1136 (lambda* (#:key inputs outputs #:allow-other-keys)
1137 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1138 (zlib (assoc-ref inputs "zlib")))
1139 (substitute* (find-files bin "h5p?cc")
1141 (string-append "-L" zlib "/lib " lib)))
1143 (add-after 'install 'split
1144 (lambda* (#:key inputs outputs #:allow-other-keys)
1145 ;; Move all fortran-related files
1146 (let* ((out (assoc-ref outputs "out"))
1147 (bin (string-append out "/bin"))
1148 (lib (string-append out "/lib"))
1149 (inc (string-append out "/include"))
1150 (ex (string-append out "/share/hdf5_examples/fortran"))
1151 (fort (assoc-ref outputs "fortran"))
1152 (fbin (string-append fort "/bin"))
1153 (flib (string-append fort "/lib"))
1154 (finc (string-append fort "/include"))
1155 (fex (string-append fort "/share/hdf5_examples/fortran")))
1160 ;; Note: When built with --enable-parallel, the 'h5fc' file
1161 ;; doesn't exist, hence this condition.
1162 (when (file-exists? (string-append bin "/h5fc"))
1163 (rename-file (string-append bin "/h5fc")
1164 (string-append fbin "/h5fc")))
1165 (for-each (lambda (file)
1167 (string-append flib "/" (basename file))))
1168 (find-files lib ".*fortran.*"))
1169 (for-each (lambda (file)
1171 (string-append finc "/" (basename file))))
1172 (find-files inc ".*mod"))
1173 (for-each (lambda (file)
1175 (string-append fex "/" (basename file))))
1176 (find-files ex ".*"))
1177 (delete-file-recursively ex))
1179 (home-page "https://www.hdfgroup.org")
1180 (synopsis "Management suite for extremely large and complex data")
1181 (description "HDF5 is a suite that makes possible the management of
1182 extremely large and complex data collections.")
1183 (license (license:x11-style
1184 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1186 (define-public hdf5-1.10
1187 (package/inherit hdf5-1.8
1192 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1193 "hdf5-" (version-major+minor version)
1194 "/hdf5-" version "/src/hdf5-"
1196 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1198 (apply string-append
1199 (take (string-split version #\.) 2))
1200 "/src/hdf5-" version ".tar.bz2")))
1202 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1203 (patches (search-patches "hdf5-config-date.patch"))))))
1206 ;; Default version of HDF5.
1209 (define-public hdf-java
1217 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1218 version "/src/CMake-hdfjava-" version ".tar.gz"))
1220 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1221 (modules '((guix build utils)))
1222 (snippet ; Make sure we don't use the bundled sources and binaries.
1224 (for-each delete-file
1225 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1226 "HDF4.tar.gz" "HDF5.tar.gz"))
1227 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1229 (build-system gnu-build-system)
1231 `(("jdk" ,icedtea "jdk")
1232 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1234 ("hamcrest-core" ,java-hamcrest-core)
1235 ("junit" ,java-junit)
1236 ("slf4j-simple" ,java-slf4j-simple)))
1241 ("libjpeg" ,libjpeg-turbo)
1242 ("slf4j-api" ,java-slf4j-api)))
1245 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1246 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1247 (assoc-ref %build-inputs "jdk") "/lib" )
1248 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1249 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1252 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1253 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1254 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1255 (string-append "JPEGLIB="
1256 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1260 (modify-phases %standard-phases
1261 (add-before 'configure 'chdir-to-source
1262 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1263 (add-before 'configure 'patch-build
1264 (lambda* (#:key inputs outputs #:allow-other-keys)
1265 (substitute* "configure"
1266 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1267 (("/bin/cat") (which "cat")))
1268 ;; Set classpath for compilation
1269 (substitute* '("hdf/hdf5lib/Makefile.in"
1270 "hdf/hdf5lib/exceptions/Makefile.in"
1271 "hdf/hdflib/Makefile.in")
1272 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1273 (string-append (assoc-ref inputs "slf4j-api")
1274 "/share/java/slf4j-api.jar")))
1275 ;; Replace outdated config.sub and config.guess:
1276 (with-directory-excursion "config"
1277 (for-each (lambda (file)
1279 (string-append (assoc-ref inputs "automake")
1281 ,(version-major+minor (package-version automake))
1283 '("config.sub" "config.guess")))
1285 ;; Fix embedded version number
1286 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1287 (substitute* "hdf/hdf5lib/H5.java"
1289 (string-join hdf5version ", "))))
1291 (mkdir-p (string-append (assoc-ref outputs "out")))
1292 ;; Set classpath for tests
1293 (let* ((build-dir (getcwd))
1294 (lib (string-append build-dir "/lib"))
1295 (jhdf (string-append lib "/jhdf.jar"))
1296 (jhdf5 (string-append lib "/jhdf5.jar"))
1300 (string-append (assoc-ref inputs i)
1301 "/share/java/" i ".jar"))
1302 '("slf4j-api" "slf4j-simple"))
1304 (car (find-files (assoc-ref inputs "junit") "jar$"))
1305 (car (find-files (assoc-ref inputs "hamcrest-core")
1308 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1310 (substitute* '("test/hdf5lib/Makefile.in"
1311 "test/hdf5lib/junit.sh.in"
1312 "examples/runExample.sh.in")
1314 (string-append (assoc-ref inputs "coreutils")
1317 (string-append (assoc-ref inputs "coreutils")
1319 (("CLASSPATH=[^\n]*")
1320 (string-append "CLASSPATH=" class-path)))
1321 (setenv "CLASSPATH" class-path))
1323 (add-before 'check 'build-examples
1325 (apply invoke `("javac"
1326 ,@(find-files "examples" ".*\\.java"))))))
1328 #:parallel-build? #f
1330 #:parallel-tests? #f ))
1331 (home-page "https://support.hdfgroup.org/products/java")
1332 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1333 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1334 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1337 ;; BSD-style license:
1338 (license (license:x11-style
1339 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1340 /current/src/unpacked/COPYING"))))
1342 (define-public hdf-eos2
1349 (uri "ftp://edhs1.gsfc.nasa.gov\
1350 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1352 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1353 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1354 "hdf-eos2-build-shared.patch"
1355 "hdf-eos2-fortrantests.patch"))))
1356 (build-system gnu-build-system)
1358 `(("gfortran" ,gfortran)))
1360 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1361 ;; XXX: These inputs are really dependencies of hdf4.
1363 ("libjpeg" ,libjpeg-turbo)
1364 ("libtirpc" ,libtirpc)
1368 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1369 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1370 #:parallel-tests? #f))
1371 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1372 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1373 (description "HDF-EOS2 is a software library built on HDF4 which supports
1374 the construction of data structures used in NASA's Earth Observing
1375 System (Grid, Point and Swath).")
1377 ;; Source files carry a permissive license header.
1378 (license (license:non-copyleft home-page))))
1380 (define-public hdf-eos5
1386 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1387 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1390 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1391 (patches (search-patches "hdf-eos5-build-shared.patch"
1392 "hdf-eos5-remove-gctp.patch"
1393 "hdf-eos5-fix-szip.patch"
1394 "hdf-eos5-fortrantests.patch"))))
1396 `(("gfortran" ,gfortran)))
1397 (build-system gnu-build-system)
1399 `(("hdf5" ,hdf5-1.8)
1403 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1404 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1405 #:parallel-tests? #f))
1406 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1408 "HDF-EOS5 is a software library built on HDF5 to support the construction
1409 of data structures used in NASA's Earth Observing System (Grid, Point and
1411 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1413 ;; Source files carry a permissive license header.
1414 (license (license:non-copyleft home-page))))
1416 (define-public hdf5-parallel-openmpi
1417 (package/inherit hdf5-1.10 ;use the latest
1418 (name "hdf5-parallel-openmpi")
1421 ,@(package-inputs hdf5)))
1423 (substitute-keyword-arguments (package-arguments hdf5)
1424 ((#:configure-flags flags)
1425 ``("--enable-parallel"
1426 ,@(delete "--enable-cxx"
1427 (delete "--enable-threadsafe" ,flags))))
1429 `(modify-phases ,phases
1430 (add-after 'build 'mpi-setup
1432 (add-before 'check 'patch-tests
1434 ;; OpenMPI's mpirun will exit with non-zero status if it
1435 ;; detects an "abnormal termination", i.e. any process not
1436 ;; calling MPI_Finalize(). Since the test is explicitly
1437 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1438 ;; H5C_flush_cache from being called, mpirun will always
1439 ;; complain, so turn this test off.
1440 (substitute* "testpar/Makefile"
1441 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1442 (string-append front back "\n")))
1443 (substitute* "tools/test/h5diff/testph5diff.sh"
1444 (("/bin/sh") (which "sh")))
1446 (synopsis "Management suite for data with parallel IO support")))
1448 (define-public hdf5-blosc
1456 (url "https://github.com/Blosc/hdf5-blosc")
1457 (commit (string-append "v" version))))
1458 (file-name (git-file-name name version))
1460 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1461 (build-system cmake-build-system)
1464 (list (string-append "-DBLOSC_INSTALL_DIR="
1465 (assoc-ref %build-inputs "c-blosc"))
1466 (string-append "-DPLUGIN_INSTALL_PATH="
1467 (assoc-ref %outputs "out")
1468 "/hdf5/lib/plugin"))
1470 (modify-phases %standard-phases
1471 (add-after 'unpack 'do-not-build-blosc
1473 (substitute* "CMakeLists.txt"
1474 (("set\\(BLOSC_INSTALL_DIR.*") "")
1475 (("ExternalProject_Add\\(project_blosc") "message("))
1478 `(("c-blosc" ,c-blosc)
1479 ("hdf5" ,hdf5-1.10)))
1480 (home-page "https://github.com/Blosc/hdf5-blosc")
1481 (synopsis "Filter for HDF5 using the Blosc compressor")
1482 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1483 installing this filter, you can read and write HDF5 files with
1484 Blosc-compressed datasets.")
1485 (license license:expat)))
1487 (define-public h5check
1494 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1495 "h5check/src/h5check-" version ".tar.gz"))
1498 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1499 (build-system gnu-build-system)
1500 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1501 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1502 (synopsis "HDF5 format checker")
1503 (description "@code{h5check} is a validation tool for verifying that an
1504 HDF5 file is encoded according to the HDF File Format Specification.")
1505 (license (license:x11-style "file://COPYING"))))
1513 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1518 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1519 (build-system cmake-build-system)
1520 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1521 (inputs `(("lapack" ,lapack)
1523 ;; FIXME: Even though the fonts are available dvips complains:
1524 ;; "Font cmmi10 not found; characters will be left blank."
1526 `(("texlive" ,texlive-tiny)
1527 ("ghostscript" ,ghostscript)
1528 ("doxygen" ,doxygen)))
1529 (home-page "http://itpp.sourceforge.net")
1530 (synopsis "C++ library of maths, signal processing and communication classes")
1531 (description "IT++ is a C++ library of mathematical, signal processing and
1532 communication classes and functions. Its main use is in simulation of
1533 communication systems and for performing research in the area of
1534 communications. The kernel of the library consists of generic vector and
1535 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1536 similar to MATLAB, GNU Octave or SciPy.")
1537 (license license:gpl3+)))
1539 (define-public netcdf
1547 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1548 "netcdf-c-" version ".tar.gz"))
1551 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1552 (patches (search-patches "netcdf-date-time.patch"))))
1553 (build-system gnu-build-system)
1556 ("doxygen" ,doxygen)
1557 ("graphviz" ,graphviz)))
1559 `(("hdf4" ,hdf4-alt)
1563 ("libjpeg" ,libjpeg-turbo)))
1565 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1567 #:phases (modify-phases %standard-phases
1568 (add-before 'configure 'fix-source-date
1570 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1571 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1572 ;; to '1st hour of the current day', and therefore makes the
1573 ;; package not reproducible.
1574 (substitute* "./configure"
1575 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1576 "date --date='@0'"))
1578 (add-after 'configure 'patch-settings
1580 ;; libnetcdf.settings contains the full filename of the compilers
1581 ;; used to build the library. We truncate the hashes of those
1582 ;; filenames to avoid unnecessary references to the corresponding
1584 (substitute* "libnetcdf.settings"
1585 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1586 (string-append prefix (string-take hash 10) "...")))
1589 #:parallel-tests? #f)) ;various race conditions
1590 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1591 (synopsis "Library for scientific data")
1592 (description "NetCDF is an interface for scientific data access and a
1593 software library that provides an implementation of the interface. The netCDF
1594 library defines a machine-independent format for representing scientific data.
1595 Together, the interface, library, and format support the creation, access, and
1596 sharing of scientific data.")
1597 (license (license:x11-style "file://COPYRIGHT"))))
1599 (define-public netcdf-parallel-openmpi
1600 (package (inherit netcdf)
1601 (name "netcdf-parallel-openmpi")
1604 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1605 (package-inputs netcdf))))
1606 ;; TODO: Replace pkg-config references in nc-config with absolute references
1608 (substitute-keyword-arguments (package-arguments netcdf)
1609 ((#:configure-flags flags)
1610 `(cons* "CC=mpicc" "CXX=mpicxx"
1611 "--enable-parallel-tests"
1612 ;; Shared libraries not supported with parallel IO.
1613 "--disable-shared" "--with-pic"
1615 ((#:phases phases '%standard-phases)
1616 `(modify-phases ,phases
1617 (add-after 'build 'mpi-setup
1618 ,%openmpi-setup)))))))
1620 (define-public netcdf-fortran
1622 (name "netcdf-fortran")
1627 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1631 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1632 (build-system gnu-build-system)
1634 `(#:parallel-tests? #f))
1636 `(("netcdf" ,netcdf)))
1638 `(("gfortran" ,gfortran)))
1639 (synopsis "Fortran interface for the netCDF library")
1640 (description (package-description netcdf))
1641 (home-page (package-home-page netcdf))
1642 (license (package-license netcdf))))
1644 (define-public nlopt
1650 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1653 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1654 (build-system gnu-build-system)
1656 `(;; Shared libraries are not built by default. They are required to
1657 ;; build the Guile, Octave, and Python bindings.
1658 #:configure-flags '("--enable-shared")
1661 (modify-phases %standard-phases
1662 (add-before 'configure 'set-libnlopt-file-name
1663 (lambda* (#:key outputs #:allow-other-keys)
1664 ;; Make sure the Scheme module refers to the library by its
1665 ;; absolute file name (we cannot do that from a snippet
1666 ;; because the expansion of @libdir@ contains
1668 (let ((out (assoc-ref outputs "out")))
1669 (substitute* "swig/nlopt.scm.in"
1671 (string-append out "/lib/libnlopt")))
1673 (inputs `(("guile" ,guile-2.0)))
1674 (native-inputs `(("pkg-config" ,pkg-config)))
1675 (home-page "http://ab-initio.mit.edu/wiki/")
1676 (synopsis "Library for nonlinear optimization")
1677 (description "NLopt is a library for nonlinear optimization, providing a
1678 common interface for a number of different free optimization routines available
1679 online as well as original implementations of various other algorithms.")
1680 (license license:lgpl2.1+)))
1682 (define-public ipopt
1689 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1693 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1694 (modules '((guix build utils)))
1696 ;; Make sure we don't use the bundled software.
1698 (delete-file-recursively "ThirdParty")
1700 (build-system gnu-build-system)
1702 '(#:phases (modify-phases %standard-phases
1703 (add-after 'install 'add--L-flags-in-ipopt.pc
1704 (lambda* (#:key inputs outputs #:allow-other-keys)
1705 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1706 ;; move it to "Libs.private" where it belongs, and add a
1707 ;; '-L' flag for LAPACK.
1708 (let ((out (assoc-ref outputs "out"))
1709 (lapack (assoc-ref inputs "lapack")))
1710 (substitute* (string-append out "/lib/pkgconfig/"
1712 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1713 (string-append "Libs: " before " " after "\n"
1714 "Libs.private: " before
1715 "-L" lapack "/lib -llapack -lblas "
1719 `(("gfortran" ,gfortran)))
1721 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1722 `(("lapack" ,lapack))) ;for both libblas and liblapack
1723 (home-page "https://www.coin-or.org")
1724 (synopsis "Large-scale nonlinear optimizer")
1726 "The Interior Point Optimizer (IPOPT) is a software package for
1727 large-scale nonlinear optimization. It provides C++, C, and Fortran
1729 (license license:epl1.0)))
1737 (uri (string-append "https://www.coin-or.org/download/source/"
1738 "Clp/Clp-" version ".tgz"))
1741 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1742 (modules '((guix build utils)))
1744 ;; Make sure we don't use the bundled software.
1746 (delete-file-recursively "ThirdParty")
1748 (build-system gnu-build-system)
1750 `(("gfortran" ,gfortran)
1751 ("pkg-config" ,pkg-config)))
1753 `(("openblas" ,openblas)))
1754 (home-page "https://www.coin-or.org")
1755 (synopsis "Linear programming solver")
1757 "CLP is a high quality linear programming solver. Its main strengths are
1758 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1759 linear and quadratic objectives. There are limited facilities for nonlinear
1760 and quadratic objectives using the Simplex algorithm.")
1761 (license license:epl1.0)))
1763 (define-public libflame
1767 (outputs '("out" "static"))
1772 (url "https://github.com/flame/libflame")
1774 (file-name (git-file-name name version))
1777 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1778 (build-system gnu-build-system)
1781 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1782 (list "--enable-dynamic-build"
1783 "--enable-max-arg-list-hack"
1784 "--enable-lapack2flame"
1785 "--enable-verbose-make-output"
1786 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1787 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1790 '("--enable-vector-intrinsics=sse")
1792 "--enable-supermatrix"
1793 "--enable-memory-alignment=16"
1794 "--enable-ldim-alignment")
1796 (modify-phases %standard-phases
1797 (add-after 'unpack 'patch-/usr/bin/env-bash
1799 (substitute* "build/config.mk.in"
1800 (("/usr/bin/env bash") (which "bash")))
1803 (lambda* (#:key tests? #:allow-other-keys)
1804 (substitute* "test/Makefile"
1805 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1806 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1808 (with-directory-excursion "test"
1811 (invoke "./test_libflame.x"))
1813 (add-after 'install 'install-static
1814 (lambda* (#:key outputs #:allow-other-keys)
1815 (let ((out (assoc-ref outputs "out"))
1816 (static (assoc-ref outputs "static")))
1817 (mkdir-p (string-append static "/lib"))
1818 (rename-file (string-append out "/lib/libflame.a")
1819 (string-append static "/lib/libflame.a"))
1820 (install-file (string-append out "/include/FLAME.h")
1821 (string-append static "/include"))
1824 `(("gfortran" ,gfortran)))
1826 `(("lapack" ,lapack)
1827 ("openblas" ,openblas)
1829 ("python" ,python-wrapper)))
1830 (home-page "https://github.com/flame/libflame")
1831 (synopsis "High-performance object-based library for DLA computations")
1832 (description "@code{libflame} is a portable library for dense matrix
1833 computations, providing much of the functionality present in LAPACK, developed
1834 by current and former members of the @acronym{SHPC, Science of High-Performance
1835 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1836 Computational Engineering and Sciences} at The University of Texas at Austin.
1837 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1838 includes a complete LAPACK implementation.")
1839 (license license:bsd-3)))
1841 (define-public ceres
1843 (name "ceres-solver")
1845 (home-page "http://ceres-solver.org/")
1848 (uri (string-append home-page "ceres-solver-"
1852 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1853 (build-system cmake-build-system)
1855 ;; TODO: Build HTML user documentation and install separately.
1856 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1857 "-DBUILD_SHARED_LIBS=ON")
1859 #:phases (modify-phases %standard-phases
1860 (add-before 'configure 'set-library-directory
1862 ;; Install libraries to lib/, not lib64/.
1863 (substitute* "internal/ceres/CMakeLists.txt"
1864 (("set\\(LIB_SUFFIX \"64\"\\)")
1865 "set(LIB_SUFFIX \"\")"))
1868 `(("pkg-config" ,pkg-config)))
1870 `(("glog" ,glog))) ;for #include <glog/glog.h>
1875 ("suitesparse" ,suitesparse)
1876 ("gflags" ,gflags)))
1877 (synopsis "C++ library for solving large optimization problems")
1879 "Ceres Solver is a C++ library for modeling and solving large,
1880 complicated optimization problems. It is a feature rich, mature and
1881 performant library which has been used in production since 2010. Ceres Solver
1882 can solve two kinds of problems:
1884 @item non-linear least squares problems with bounds constraints;
1885 @item general unconstrained optimization problems.
1887 (license license:bsd-3)))
1889 ;; For a fully featured Octave, users are strongly recommended also to install
1890 ;; the following packages: less, ghostscript, gnuplot.
1891 (define-public octave-cli
1898 (uri (string-append "mirror://gnu/octave/octave-"
1902 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1903 (build-system gnu-build-system)
1905 `(("alsa-lib" ,alsa-lib)
1906 ("arpack" ,arpack-ng)
1912 ("fontconfig" ,fontconfig)
1913 ("freetype" ,freetype)
1917 ("graphicsmagick" ,graphicsmagick)
1919 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1920 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1921 ;; libtiff.la instead of having to provide it here.
1922 ("libjpeg" ,libjpeg-turbo)
1926 ("libsndfile" ,libsndfile)
1930 ("portaudio" ,portaudio)
1932 ("readline" ,readline)
1933 ("suitesparse" ,suitesparse)
1934 ("texinfo" ,texinfo)
1938 ("gfortran" ,gfortran)
1939 ("pkg-config" ,pkg-config)
1941 ;; The following inputs are not actually used in the build process.
1942 ;; However, the ./configure gratuitously tests for their existence and
1943 ;; assumes that programs not present at build time are also not, and
1944 ;; can never be, available at run time! If these inputs are therefore
1945 ;; not present, support for them will be built out. However, Octave
1946 ;; will still run without them, albeit without the features they
1949 ("ghostscript" ,ghostscript)
1950 ("gnuplot" ,gnuplot)))
1951 ;; Octave code uses this variable to detect directories holding multiple CA
1952 ;; certificates to verify peers with. This is required for the networking
1953 ;; functions that require encryption to work properly.
1954 (native-search-paths
1955 (list (search-path-specification
1956 (variable "CURLOPT_CAPATH")
1957 (files '("etc/ssl/certs")))))
1960 (list (string-append "--with-shell="
1961 (assoc-ref %build-inputs "bash")
1964 ;; XXX: Without this flag, linking octave-cli fails with
1965 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1966 ;; not pulling in liboctinterp.la for -lstdc++.
1967 "--enable-link-all-dependencies")
1969 (modify-phases %standard-phases
1970 (add-after 'configure 'configure-makeinfo
1971 (lambda* (#:key inputs #:allow-other-keys)
1972 (substitute* "libinterp/corefcn/help.h"
1975 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1977 (home-page "https://www.gnu.org/software/octave/")
1978 (synopsis "High-level language for numerical computation")
1979 (description "GNU Octave is a high-level interpreted language that is
1980 specialized for numerical computations. It can be used for both linear and
1981 non-linear applications and it provides great support for visualizing results.
1982 Work may be performed both at the interactive command-line as well as via
1984 (license license:gpl3+)))
1986 (define-public octave
1987 (package (inherit octave-cli)
1990 `(("qscintilla" ,qscintilla)
1992 ,@(package-inputs octave-cli)))
1994 `(("qttools" , qttools) ;for lrelease
1995 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1996 ,@(package-native-inputs octave-cli)))
1998 (substitute-keyword-arguments (package-arguments octave-cli)
2000 `(modify-phases ,phases
2001 (add-before 'configure 'patch-qscintilla-library-name
2002 (lambda* (#:key inputs #:allow-other-keys)
2003 ;; The QScintilla library that the Octave configure script tries
2004 ;; to link with should be named libqscintilla-qt5.so, but the
2005 ;; QScintilla input provides the shared library as
2006 ;; libqscintilla2_qt5.so.
2007 (substitute* "configure"
2008 (("qscintilla2-qt5")
2012 (define-public opencascade-oce
2014 (name "opencascade-oce")
2020 (url "https://github.com/tpaviot/oce")
2021 (commit (string-append "OCE-" version))))
2022 (file-name (git-file-name name version))
2023 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2025 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2026 (build-system cmake-build-system)
2029 (list "-DOCE_TESTING:BOOL=ON"
2030 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2031 "-DOCE_DRAW:BOOL=ON"
2032 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2033 (assoc-ref %outputs "out"))
2034 "-UCMAKE_INSTALL_RPATH")))
2036 `(("freetype" ,freetype)
2043 `(("python" ,python-wrapper)))
2044 (home-page "https://github.com/tpaviot/oce")
2045 (synopsis "Libraries for 3D modeling and numerical simulation")
2047 "Open CASCADE is a set of libraries for the development of applications
2048 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2049 C++ class libraries providing services for 3D surface and solid modeling, CAD
2050 data exchange, and visualization. It is used for development of specialized
2051 software dealing with 3D models in design (CAD), manufacturing (CAM),
2052 numerical simulation (CAE), measurement equipment (CMM), and quality
2053 control (CAQ) domains.
2055 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2056 patches, improvements, and experiments contributed by users over the official
2057 Open CASCADE library.")
2058 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2059 ; use of header files; see
2060 ; OCCT_LGPL_EXCEPTION.txt
2061 license:public-domain; files
2062 ; src/Standard/Standard_StdAllocator.hxx and
2063 ; src/NCollection/NCollection_StdAllocator.hxx
2064 license:expat; file src/OpenGl/OpenGl_glext.h
2065 license:bsd-3)))); test framework gtest
2067 (define-public opencascade-occt
2069 (name "opencascade-occt")
2075 (url "https://git.dev.opencascade.org/repos/occt.git")
2078 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2080 (file-name (git-file-name name version))
2082 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2083 (modules '((guix build utils)))
2086 ;; Remove files specific to non-free operating systems.
2087 (delete-file-recursively "samples/ios")
2088 (delete-file-recursively "samples/mfc")
2089 (delete-file-recursively "samples/qt/FuncDemo")
2090 (delete-file "genconf.bat")
2091 (delete-file "gendoc.bat")
2092 (delete-file "genproj.bat")
2093 (delete-file "upgrade.bat")
2094 ;; Remove references to deleted files.
2095 (substitute* "dox/FILES_HTML.txt"
2096 ((".*standard.*") "" )
2097 ((".*UIKitSample.*") ""))
2099 (build-system cmake-build-system)
2101 '(;; There is no test target for make. OCCT provides an
2102 ;; 'Automated Testing System', which may be accessed after
2103 ;; installation via the draw.sh script. draw.sh is located in
2104 ;; the bin directory. For details see:
2105 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2106 ;; occt_dev_guides__tests.html
2108 ;; Configure without freeimage: attempting to link against the
2109 ;; freeimage version 3.17 library leads to 'undefined
2110 ;; reference' errors.
2112 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2114 "-DUSE_VTK:BOOL=OFF"
2115 "-DBUILD_DOC_Overview:BOOL=OFF"
2116 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2117 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2118 "-UCMAKE_INSTALL_LIBDIR")))
2120 `(("doxygen" ,doxygen)
2121 ;("freeimage" ,freeimage)
2122 ("freetype" ,freetype)
2124 ("libxext" ,libxext)
2131 ;; TODO: build Overview documentation and add 'doc' output.
2132 (home-page "https://www.opencascade.com")
2133 (synopsis "Libraries for 3D modeling and numerical simulation")
2135 "Open CASCADE is a set of libraries for the development of applications
2136 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2137 C++ class libraries providing services for 3D surface and solid modeling, CAD
2138 data exchange, and visualization. It is used for development of specialized
2139 software dealing with 3D models in design (CAD), manufacturing (CAM),
2140 numerical simulation (CAE), measurement equipment (CMM), and quality
2141 control (CAQ) domains.
2143 This is the certified version of the Open Cascade Technology (OCCT) library.")
2144 (license (list ;; OCCT library:
2145 license:lgpl2.1; with an exception for the use of header
2146 ; files, see OCCT_LGPL_EXCEPTION.txt.
2147 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2148 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2150 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2151 ;; src/StepFile/step.tab.*:
2152 license:gpl3+ ; with Bison 2.2 exception.
2153 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2154 (license:non-copyleft
2155 "https://www.unicode.org/license.html")
2156 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2157 license:public-domain))))
2167 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2169 (string-append "gmsh_"
2170 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2172 (file-name (git-file-name name version))
2174 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2175 (modules '((guix build utils)))
2178 (delete-file-recursively "contrib/metis")
2180 (build-system cmake-build-system)
2183 ("gfortran" ,gfortran)
2190 ("opencascade-occt" ,opencascade-occt)
2192 ("libxext" ,libxext)))
2194 `(("fontconfig" ,fontconfig)
2195 ("libxft" ,libxft)))
2197 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2198 "-DENABLE_BUILD_SHARED:BOOL=ON"
2199 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2200 (home-page "http://gmsh.info/")
2201 (synopsis "3D finite element grid generator")
2202 (description "Gmsh is a 3D finite element grid generator with a built-in
2203 CAD engine and post-processor. Its design goal is to provide a fast, light
2204 and user-friendly meshing tool with parametric input and advanced
2205 visualization capabilities. Gmsh is built around four modules: geometry,
2206 mesh, solver and post-processing. The specification of any input to these
2207 modules is done either interactively using the graphical user interface or in
2208 ASCII text files using Gmsh's own scripting language.")
2209 (license license:gpl2+)))
2211 (define-public veusz
2218 (uri (pypi-uri "veusz" version))
2220 (base32 "00vmfpvyd6f33l5awlf02qdik3gmbhzyfizfwwbx7qnam2i9bbwy"))))
2221 (build-system python-build-system)
2223 `(;; Tests will fail because they depend on optional packages like
2224 ;; python-astropy, which is not packaged.
2227 (modify-phases %standard-phases
2228 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2229 ;; the path is defined in Guix, therefore we have to change it.
2230 (add-after 'unpack 'fix-sip-dir
2232 (substitute* "pyqtdistutils.py"
2233 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2235 ;; Now we have to pass the correct sip_dir to setup.py.
2237 (lambda* (#:key inputs #:allow-other-keys)
2238 ;; We need to tell setup.py where to locate QtCoremod.sip
2239 ((@@ (guix build python-build-system) call-setuppy)
2241 (list (string-append "--sip-dir="
2242 (assoc-ref inputs "python-pyqt")
2245 ;; Ensure that icons are found at runtime.
2246 (add-after 'install 'wrap-executable
2247 (lambda* (#:key inputs outputs #:allow-other-keys)
2248 (let ((out (assoc-ref outputs "out")))
2249 (wrap-program (string-append out "/bin/veusz")
2250 `("QT_PLUGIN_PATH" prefix
2251 ,(list (string-append (assoc-ref inputs "qtsvg")
2252 "/lib/qt5/plugins/"))))))))))
2254 `(("pkg-config" ,pkg-config)
2255 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2256 ("qttools" ,qttools)))
2258 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2259 ("python-dbus" ,python-dbus)
2260 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2261 ("python-pyqt" ,python-pyqt)
2265 `(("python-numpy" ,python-numpy)))
2266 (home-page "https://veusz.github.io/")
2267 (synopsis "Scientific plotting package")
2269 "Veusz is a scientific plotting and graphing program with a graphical
2270 user interface, designed to produce publication-ready 2D and 3D plots. In
2271 addition it can be used as a module in Python for plotting. It supports
2272 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2273 (license license:gpl2+)))
2275 (define-public maxflow
2278 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2279 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2284 (url "https://github.com/gerddie/maxflow")
2286 (file-name (git-file-name name version))
2289 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2290 (build-system cmake-build-system)
2291 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2292 (synopsis "Library implementing Maxflow algorithm")
2293 (description "An implementation of the maxflow algorithm described in
2294 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2295 Energy Minimization in Computer Vision.\n
2296 Yuri Boykov and Vladimir Kolmogorov.\n
2297 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2299 (license license:gpl3+)))
2301 (define-public petsc
2308 ;; The *-lite-* tarball does not contain the *large* documentation
2309 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2310 "petsc-lite-" version ".tar.gz"))
2312 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2313 (outputs '("out" ; libraries and headers
2314 "examples")) ; ~30MiB of examples
2315 (build-system gnu-build-system)
2317 `(("python" ,python-2)))
2319 `(("gfortran" ,gfortran)
2321 ("superlu" ,superlu)
2322 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2323 ;; leaving out opengl, as configuration seems to only be for mac
2326 `(#:test-target "test"
2327 #:parallel-build? #f ; build is parallel by default
2333 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2334 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2335 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2337 (modify-phases %standard-phases
2339 ;; PETSc's configure script is actually a python script, so we can't
2340 ;; run it with bash.
2341 (lambda* (#:key outputs (configure-flags '())
2343 (let* ((prefix (assoc-ref outputs "out"))
2344 (flags `(,(string-append "--prefix=" prefix)
2345 ,@configure-flags)))
2346 (format #t "build directory: ~s~%" (getcwd))
2347 (format #t "configure flags: ~s~%" flags)
2348 (apply invoke "./configure" flags))))
2349 (add-after 'configure 'clean-local-references
2350 (lambda* (#:key outputs #:allow-other-keys)
2351 (let ((out (assoc-ref outputs "out")))
2352 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2353 ;; Prevent build directory from leaking into compiled code
2355 ;; Scrub timestamp for reproducibility
2356 ((".*Libraries compiled on.*") ""))
2357 (substitute* (find-files "." "petscvariables")
2358 ;; Do not expose build machine characteristics, set to defaults.
2359 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2360 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2362 (add-after 'install 'clean-install
2363 ;; Try to keep installed files from leaking build directory names.
2364 (lambda* (#:key inputs outputs #:allow-other-keys)
2365 (let ((out (assoc-ref outputs "out")))
2366 (substitute* (map (lambda (file)
2367 (string-append out "/lib/petsc/conf/" file))
2368 '("petscvariables"))
2370 ;; Make compiler references point to the store
2371 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2372 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2373 (string-append "= " (which compiler))))
2374 ;; PETSc installs some build logs, which aren't necessary.
2375 (for-each (lambda (file)
2376 (let ((f (string-append out "/lib/petsc/conf/" file)))
2377 (when (file-exists? f)
2379 '("configure.log" "make.log" "gmake.log"
2380 "test.log" "error.log" "RDict.db"
2381 "PETScBuildInternal.cmake"
2382 ;; Once installed, should uninstall with Guix
2385 (add-after 'install 'move-examples
2386 (lambda* (#:key outputs #:allow-other-keys)
2387 (let* ((out (assoc-ref outputs "out"))
2388 (examples (assoc-ref outputs "examples"))
2389 (exdir (string-append out "/share/petsc/examples"))
2390 (exdir' (string-append examples "/share/petsc/examples")))
2391 (copy-recursively exdir exdir')
2392 (delete-file-recursively exdir)
2394 (home-page "https://www.mcs.anl.gov/petsc")
2395 (synopsis "Library to solve PDEs")
2396 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2397 data structures and routines for the scalable (parallel) solution of
2398 scientific applications modeled by partial differential equations.")
2399 (license (license:non-copyleft
2400 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2402 (define-public petsc-complex
2403 (package (inherit petsc)
2404 (name "petsc-complex")
2406 (substitute-keyword-arguments (package-arguments petsc)
2407 ((#:configure-flags cf)
2408 `(cons "--with-scalar-type=complex" ,cf))))
2409 (synopsis "Library to solve PDEs (with complex scalars)")))
2411 (define-public petsc-openmpi
2412 (package (inherit petsc)
2413 (name "petsc-openmpi")
2415 `(("hdf5" ,hdf5-parallel-openmpi)
2416 ("hypre" ,hypre-openmpi)
2418 ("mumps" ,mumps-openmpi)
2419 ("openmpi" ,openmpi)
2420 ("scalapack" ,scalapack)
2421 ("scotch" ,pt-scotch32)
2422 ,@(package-inputs petsc)))
2424 (substitute-keyword-arguments (package-arguments petsc)
2425 ((#:configure-flags cf)
2427 "--with-mpiexec=mpirun"
2430 "--with-scalapack=1"
2432 ,(string-append "--with-mpi-dir="
2433 (assoc-ref %build-inputs "openmpi"))
2434 ,(string-append "--with-hdf5-include="
2435 (assoc-ref %build-inputs "hdf5") "/include")
2436 ,(string-append "--with-hdf5-lib="
2437 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2438 ,@(delete "--with-mpi=0" ,cf)))
2440 `(modify-phases ,phases
2441 (add-before 'configure 'mpi-setup
2442 ,%openmpi-setup)))))
2443 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2445 (define-public petsc-complex-openmpi
2446 (package (inherit petsc-complex)
2447 (name "petsc-complex-openmpi")
2449 `(("openmpi" ,openmpi)
2450 ,@(package-inputs petsc-complex)))
2452 (substitute-keyword-arguments (package-arguments petsc-complex)
2453 ((#:configure-flags cf)
2454 ``("--with-mpiexec=mpirun"
2455 ,(string-append "--with-mpi-dir="
2456 (assoc-ref %build-inputs "openmpi"))
2457 ,@(delete "--with-mpi=0" ,cf)))
2459 `(modify-phases ,phases
2460 (add-before 'configure 'mpi-setup
2461 ,%openmpi-setup)))))
2462 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2464 (define-public python-petsc4py
2466 (name "python-petsc4py")
2471 (uri (pypi-uri "petsc4py" version))
2474 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2475 (modules '((guix build utils)))
2478 ;; Ensure source file is regenerated in the build phase.
2479 (delete-file "src/petsc4py.PETSc.c")
2480 ;; Remove legacy GC code. See
2481 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2482 (substitute* "src/PETSc/cyclicgc.pxi"
2483 ((".*gc_refs.*") "" )
2484 ((".*PyGC_Head.*") ""))
2486 (build-system python-build-system)
2489 (modify-phases %standard-phases
2490 (add-before 'build 'pre-build
2492 ;; Define path to PETSc installation.
2493 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2495 (add-before 'check 'mpi-setup
2498 `(("python-cython" ,python-cython)))
2500 `(("petsc" ,petsc-openmpi)
2501 ("python-numpy" ,python-numpy)))
2502 (home-page "https://bitbucket.org/petsc/petsc4py/")
2503 (synopsis "Python bindings for PETSc")
2504 (description "PETSc, the Portable, Extensible Toolkit for
2505 Scientific Computation, is a suite of data structures and routines for
2506 the scalable (parallel) solution of scientific applications modeled by
2507 partial differential equations. It employs the MPI standard for all
2508 message-passing communication. @code{petsc4py} provides Python
2509 bindings to almost all functions of PETSc.")
2510 (license license:bsd-3)))
2512 (define-public python-kiwisolver
2514 (name "python-kiwisolver")
2518 (uri (pypi-uri "kiwisolver" version))
2521 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2522 (build-system python-build-system)
2523 (home-page "https://github.com/nucleic/kiwi")
2524 (synopsis "Fast implementation of the Cassowary constraint solver")
2526 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2527 solving algorithm. Kiwi has been designed from the ground up to be
2528 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2529 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2530 savings are consistently > 5x.")
2531 (license license:bsd-3)))
2533 (define-public python2-kiwisolver
2534 (package-with-python2 python-kiwisolver))
2536 (define-public slepc
2543 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2547 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2548 (build-system gnu-build-system)
2550 `(("python" ,python-2)
2551 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2553 `(("arpack" ,arpack-ng)
2554 ("gfortran" ,gfortran)))
2556 `(("petsc" ,petsc)))
2558 `(#:parallel-build? #f ;build is parallel by default
2560 `(,(string-append "--with-arpack-dir="
2561 (assoc-ref %build-inputs "arpack") "/lib"))
2562 #:make-flags ;honor (parallel-job-count)
2563 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2564 ,(string-append "PETSCCONFIGDIR="
2565 (assoc-ref %build-inputs "petsc:examples")
2566 "/share/petsc/examples/config"))
2568 (modify-phases %standard-phases
2570 ;; configure is a python script, so we can't run it with bash.
2571 (lambda* (#:key inputs outputs (configure-flags '())
2573 (let* ((prefix (assoc-ref outputs "out"))
2574 (flags `(,(string-append "--prefix=" prefix)
2575 ,@configure-flags)))
2576 (format #t "build directory: ~s~%" (getcwd))
2577 (format #t "configure flags: ~s~%" flags)
2578 (setenv "SLEPC_DIR" (getcwd))
2579 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2580 (apply invoke "./configure" flags))))
2581 (add-after 'install 'delete-doc
2582 ;; TODO: SLEPc installs HTML documentation alongside headers in
2583 ;; $out/include. We'd like to move them to share/doc, but delete
2584 ;; them for now, as they are incomplete and installing the complete
2585 ;; documentation is difficult.
2586 (lambda* (#:key outputs #:allow-other-keys)
2587 (let* ((out (assoc-ref outputs "out")))
2588 (for-each delete-file (find-files out "\\.html$"))
2590 (add-after 'install 'clean-install
2591 ;; Clean up unnecessary build logs from installation.
2592 (lambda* (#:key outputs #:allow-other-keys)
2593 (let ((out (assoc-ref outputs "out")))
2594 (for-each (lambda (file)
2595 (let ((f (string-append out "/lib/slepc/conf/" file)))
2596 (when (file-exists? f)
2598 '("configure.log" "make.log" "gmake.log"
2599 "test.log" "error.log" "RDict.db"
2602 (home-page "http://slepc.upv.es")
2603 (synopsis "Scalable library for eigenproblems")
2604 (description "SLEPc is a software library for the solution of large sparse
2605 eigenproblems on parallel computers. It can be used for the solution of
2606 linear eigenvalue problems formulated in either standard or generalized form,
2607 as well as other related problems such as the singular value decomposition.
2608 The emphasis of the software is on methods and techniques appropriate for
2609 problems in which the associated matrices are sparse, for example, those
2610 arising after the discretization of partial differential equations.")
2611 (license license:bsd-2)))
2613 (define-public slepc-complex
2614 (package (inherit slepc)
2615 (name "slepc-complex")
2617 `(("petsc" ,petsc-complex)
2618 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2619 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2621 (define-public slepc-openmpi
2622 (package (inherit slepc)
2623 (name "slepc-openmpi")
2625 (substitute-keyword-arguments (package-arguments slepc)
2626 ((#:phases phases '%standard-phases)
2627 `(modify-phases ,phases
2628 (add-before 'check 'mpi-setup
2629 ,%openmpi-setup)))))
2632 ("arpack" ,arpack-ng-openmpi)
2633 ,@(alist-delete "arpack" (package-inputs slepc))))
2635 `(("petsc" ,petsc-openmpi)
2636 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2637 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2639 (define-public slepc-complex-openmpi
2640 (package (inherit slepc-openmpi)
2641 (name "slepc-complex-openmpi")
2643 `(("petsc" ,petsc-complex-openmpi)
2644 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2645 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2647 (define-public python-slepc4py
2649 (name "python-slepc4py")
2654 (uri (pypi-uri "slepc4py" version))
2657 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2658 (build-system python-build-system)
2661 (modify-phases %standard-phases
2662 (add-before 'build 'pre-build
2664 ;; Define path to PETSc installation.
2665 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2666 ;; Define path to SLEPc installation.
2667 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2669 (add-before 'check 'mpi-setup
2672 `(("python-numpy" ,python-numpy)
2673 ("python-petsc4py" ,python-petsc4py)
2674 ("slepc" ,slepc-openmpi)))
2675 (home-page "https://bitbucket.org/slepc/slepc4py/")
2676 (synopsis "Python bindings for SLEPc")
2677 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2678 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2679 Scientific Computation. It employs the MPI standard for all
2680 message-passing communication. @code{slepc4py} provides Python
2681 bindings to almost all functions of SLEPc.")
2682 (license license:bsd-3)))
2684 (define-public metamath
2692 (url "https://github.com/metamath/metamath-exe")
2693 (commit (string-append "v" version))))
2694 (file-name (git-file-name name version))
2696 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2697 (build-system gnu-build-system)
2699 `(("autoconf" ,autoconf)
2700 ("automake" ,automake)))
2701 (home-page "http://us.metamath.org/")
2702 (synopsis "Proof verifier based on a minimalistic formalism")
2704 "Metamath is a tiny formal language and that can express theorems in
2705 abstract mathematics, with an accompyaning @command{metamath} executable that
2706 verifies databases of these proofs. There is a public database,
2707 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2708 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2709 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2710 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2712 (license license:gpl2+)))
2714 (define-public mumps
2721 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2725 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2726 (patches (search-patches "mumps-build-parallelism.patch"
2727 "mumps-shared-libseq.patch"
2728 "mumps-shared-mumps.patch"
2729 "mumps-shared-pord.patch"))))
2730 (build-system gnu-build-system)
2732 `(("fortran" ,gfortran)
2733 ;; These are required for linking against mumps, but we let the user
2734 ;; declare the dependency.
2737 ("scotch" ,scotch)))
2739 `(#:modules ((ice-9 match)
2742 ,@%gnu-build-system-modules)
2744 (modify-phases %standard-phases
2746 (lambda* (#:key inputs #:allow-other-keys)
2747 (call-with-output-file "Makefile.inc"
2758 INCSEQ = -I$(topdir)/libseq
2759 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2760 LIBSEQNEEDED = libseqneeded~;
2764 AR = ar vr # rules require trailing space, ugh...
2767 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2769 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2770 LIBOTHERS = -pthread
2773 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2777 LIBS = $(SCALAP) $(LIBSEQ)
2778 LPORDDIR = $(topdir)/PORD/lib
2779 IPORD = -I$(topdir)/PORD/include
2780 LPORD = $(LPORDDIR)/libpord.a
2781 ORDERINGSF = -Dpord~@[
2783 IMETIS = -I$(METISDIR)/include
2784 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2785 ORDERINGSF += -Dmetis~]~@[~:{
2787 ISCOTCH = -I$(SCOTCHDIR)/include
2788 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2789 ORDERINGSF += ~a~}~]
2790 ORDERINGSC = $(ORDERINGSF)
2791 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2792 IORDERINGSF = $(ISCOTCH)
2793 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2794 (assoc-ref inputs "mpi")
2795 (assoc-ref inputs "blas")
2796 (assoc-ref inputs "scalapack")
2797 (assoc-ref inputs "metis")
2798 (match (list (assoc-ref inputs "pt-scotch")
2799 (assoc-ref inputs "scotch"))
2803 `((,scotch "" "-Dscotch")))
2806 "-lptesmumps -lptscotch -lptscotcherr "
2807 "-Dptscotch")))))))))
2809 ;; By default only the d-precision library is built. Make with "all"
2810 ;; target so that all precision libraries and examples are built.
2812 (invoke "make" "all"
2813 (format #f "-j~a" (parallel-job-count)))))
2815 ;; Run the simple test drivers, which read test input from stdin:
2816 ;; from the "real" input for the single- and double-precision
2817 ;; testers, and from the "cmplx" input for complex-precision
2818 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2819 ;; package to prefix execution with "mpirun".
2820 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2821 (with-directory-excursion "examples"
2824 (let ((tester (apply open-pipe*
2827 ,(string-append "./" prec
2829 (input (open-input-file
2830 (string-append "input_simpletest_" type))))
2832 (dump-port input tester)
2834 (zero? (close-pipe tester)))))
2836 '("real" "real" "cmplx" "cmplx")))))
2838 (lambda* (#:key outputs #:allow-other-keys)
2839 (let* ((out (assoc-ref outputs "out"))
2840 (libdir (string-append out "/lib")))
2841 (copy-recursively "lib" libdir)
2842 (copy-recursively "include" (string-append out "/include"))
2843 (when (file-exists? "libseq/libmpiseq.a")
2844 (install-file "libseq/libmpiseq.a" libdir))
2845 (when (file-exists? "libseq/libmpiseq.so")
2846 (install-file "libseq/libmpiseq.so" libdir))
2848 (home-page "http://mumps.enseeiht.fr")
2849 (synopsis "Multifrontal sparse direct solver")
2851 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2852 sparse system of linear equations A x = b using Gaussian elimination.")
2853 (license license:cecill-c)))
2855 (define-public mumps-metis
2856 (package (inherit mumps)
2857 (name "mumps-metis")
2859 (alist-delete "scotch" (package-inputs mumps)))))
2861 (define-public mumps-openmpi
2862 (package (inherit mumps)
2863 (name "mumps-openmpi")
2866 ("scalapack" ,scalapack)
2867 ("pt-scotch" ,pt-scotch)
2868 ,@(alist-delete "scotch" (package-inputs mumps))))
2870 (substitute-keyword-arguments (package-arguments mumps)
2872 `(modify-phases ,phases
2873 (add-before 'check 'mpi-setup
2877 ((assoc-ref ,phases 'check)
2878 #:exec-prefix '("mpirun" "-n" "2"))))))))
2879 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2881 (define-public mumps-metis-openmpi
2882 (package (inherit mumps-openmpi)
2883 (name "mumps-metis-openmpi")
2885 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2887 (define-public ruby-asciimath
2889 (name "ruby-asciimath")
2894 (uri (rubygems-uri "asciimath" version))
2897 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2898 (build-system ruby-build-system)
2900 `(("ruby-nokogiri" ,ruby-nokogiri)
2901 ("ruby-rspec" ,ruby-rspec)))
2902 (synopsis "AsciiMath parsing and conversion library")
2904 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2905 easy-to-write markup language for mathematics.")
2906 (home-page "https://github.com/asciidoctor/asciimath")
2907 (license license:expat)))
2909 (define-public superlu
2916 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2917 "superlu_" version ".tar.gz"))
2919 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
2920 (modules '((guix build utils)))
2922 ;; Replace the non-free implementation of MC64 with a stub adapted
2925 (use-modules (ice-9 regex)
2927 (call-with-output-file "SRC/mc64ad.c"
2932 void mc64id_(int *a) {
2933 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2936 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2937 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2938 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2941 ;; Remove the corresponding license verbiage. MC64 license follows
2942 ;; a "------" line separator.
2943 (with-atomic-file-replacement "License.txt"
2944 (let ((rx (make-regexp "-{8}")))
2947 (let ((line (read-line in 'concat)))
2948 (unless (regexp-exec rx line)
2952 (build-system cmake-build-system)
2956 `(("blas" ,openblas)
2957 ("gfortran" ,gfortran)))
2959 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2960 "-DTPL_BLAS_LIBRARIES=openblas"
2961 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2962 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2963 (synopsis "Supernodal direct solver for sparse linear systems")
2965 "SuperLU is a general purpose library for the direct solution of large,
2966 sparse, nonsymmetric systems of linear equations on high performance machines.
2967 The library is written in C and is callable from either C or Fortran. The
2968 library routines perform an LU decomposition with partial pivoting and
2969 triangular system solves through forward and back substitution. The library
2970 also provides threshold-based ILU factorization preconditioners.")
2971 (license (list license:bsd-3
2972 license:gpl2+ ;EXAMPLE/*fgmr.c
2973 (license:fsf-free "file://SRC/colamd.h")))))
2975 (define-public superlu-dist
2977 (name "superlu-dist")
2982 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2983 "superlu_dist_" version ".tar.gz"))
2985 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2986 (modules '((guix build utils)))
2988 ;; Replace the non-free implementation of MC64 with a stub
2990 (call-with-output-file "SRC/mc64ad_dist.c"
2995 void mc64id_dist(int *a) {
2996 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2999 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3000 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3001 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3004 (substitute* "SRC/util.c" ;adjust default algorithm
3005 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3006 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3007 ;; general (i.e. non-square) processor-grid support.
3008 "RowPerm = NOROWPERM;"))
3010 (patches (search-patches "superlu-dist-scotchmetis.patch"
3011 "superlu-dist-awpm-grid.patch"))))
3012 (build-system cmake-build-system)
3016 `(("gfortran" ,gfortran)
3019 ("combblas" ,combinatorial-blas)))
3021 `(("mpi" ,openmpi) ;headers include MPI heades
3022 ("parmetis" ,pt-scotch32 "metis")
3023 ("pt-scotch" ,pt-scotch32)))
3025 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3026 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3027 "-DTPL_ENABLE_COMBBLASLIB=YES"
3028 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3029 "-DTPL_LAPACK_LIBRARIES=-llapack"
3030 (string-append "-DTPL_PARMETIS_LIBRARIES="
3032 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3033 "scotchmetis" "scotch" "scotcherr")
3035 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3036 (assoc-ref %build-inputs "parmetis")
3038 "-DTPL_ENABLE_COMBBLASLIB=ON"
3039 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3040 (assoc-ref %build-inputs "combblas")
3041 "/include/CombBLAS;"
3042 (assoc-ref %build-inputs "combblas")
3043 "/include/BipartiteMatchings")
3044 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3046 (modify-phases %standard-phases
3047 (add-before 'configure 'set-c++-standard
3049 (substitute* "CMakeLists.txt"
3050 ;; AWPM headers require C++14
3051 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3052 (add-before 'check 'mpi-setup
3054 (add-before 'check 'omp-setup
3055 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3056 (home-page (package-home-page superlu))
3057 (synopsis "Parallel supernodal direct solver")
3059 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3060 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3061 implemented in ANSI C, and MPI for communications.")
3062 (license license:bsd-3)))
3064 (define-public scotch
3071 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3072 "latestfile/298/scotch_" version ".tar.gz"))
3074 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
3075 (patches (search-patches "scotch-build-parallelism.patch"
3076 "scotch-integer-declarations.patch"))))
3077 (build-system gnu-build-system)
3083 (outputs '("out" "metis"))
3085 `(#:make-flags (list (string-append "prefix=" %output))
3087 (modify-phases %standard-phases
3089 'unpack 'chdir-to-src
3090 (lambda _ (chdir "src") #t))
3094 (call-with-output-file "Makefile.inc"
3108 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3109 LDFLAGS = -lz -lm -lrt -lpthread
3111 LEX = flex -Pscotchyy -olex.yy.c
3116 YACC = bison -pscotchyy -y -b y
3118 '("COMMON_FILE_COMPRESS_GZ"
3120 "COMMON_RANDOM_FIXED_SEED"
3121 "INTSIZE64" ;use 'int64_t'
3122 ;; Prevents symbolc clashes with libesmumps
3124 ;; XXX: Causes invalid frees in superlu-dist tests
3126 ;; "SCOTCH_PTHREAD_NUMBER=2"
3127 "restrict=__restrict"))))
3129 (add-after 'build 'build-esmumps
3132 (format #f "-j~a" (parallel-job-count))
3134 (add-before 'install 'make-install-dirs
3135 (lambda* (#:key outputs #:allow-other-keys)
3136 (mkdir (assoc-ref outputs "out"))))
3137 (add-after 'install 'install-metis
3138 (lambda* (#:key outputs #:allow-other-keys)
3139 (let ((out (assoc-ref outputs "metis")))
3141 ;; metis files are not installed with 'make install'
3142 (for-each (lambda (f)
3143 (install-file f (string-append out "/include")))
3144 (find-files "../include/" ".*metis\\.h"))
3145 (for-each (lambda (f)
3146 (install-file f (string-append out "/lib")))
3147 (find-files "../lib/" ".*metis\\..*"))
3149 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3150 (synopsis "Programs and libraries for graph algorithms")
3151 (description "SCOTCH is a set of programs and libraries which implement
3152 the static mapping and sparse matrix reordering algorithms developed within
3153 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3154 conquer approach, to scientific computing problems such as graph and mesh
3155 partitioning, static mapping, and sparse matrix ordering, in application
3156 domains ranging from structural mechanics to operating systems or
3158 ;; See LICENSE_en.txt
3159 (license license:cecill-c)))
3161 (define-public scotch32
3162 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3163 ;; some applications.
3164 (package (inherit scotch)
3167 (substitute-keyword-arguments (package-arguments scotch)
3168 ((#:phases scotch-phases)
3169 `(modify-phases ,scotch-phases
3173 (call-with-output-file "Makefile.inc"
3187 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3188 LDFLAGS = -lz -lm -lrt -lpthread
3190 LEX = flex -Pscotchyy -olex.yy.c
3195 YACC = bison -pscotchyy -y -b y
3197 '("COMMON_FILE_COMPRESS_GZ"
3199 "COMMON_RANDOM_FIXED_SEED"
3200 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3201 ;; Prevents symbolc clashes with libesmumps
3203 ;; XXX: Causes invalid frees in superlu-dist tests
3205 ;; "SCOTCH_PTHREAD_NUMBER=2"
3206 "restrict=__restrict"))))))))))
3208 "Programs and libraries for graph algorithms (32-bit integers)")))
3210 (define-public pt-scotch
3211 (package (inherit scotch)
3214 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3216 (substitute-keyword-arguments (package-arguments scotch)
3217 ((#:phases scotch-phases)
3218 `(modify-phases ,scotch-phases
3222 (invoke "make" (format #f "-j~a" (parallel-job-count))
3223 "ptscotch" "ptesmumps")
3225 ;; Install the serial metis compatibility library
3226 (invoke "make" "-C" "libscotchmetis" "install")))
3227 (add-before 'check 'mpi-setup
3231 (invoke "make" "ptcheck")))))))
3232 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3234 (define-public pt-scotch32
3235 (package (inherit scotch32)
3236 (name "pt-scotch32")
3238 `(("openmpi" ,openmpi))) ;headers include MPI headers
3240 (substitute-keyword-arguments (package-arguments scotch32)
3241 ((#:phases scotch32-phases)
3242 `(modify-phases ,scotch32-phases
3245 (invoke "make" (format #f "-j~a" (parallel-job-count))
3246 "ptscotch" "ptesmumps")
3247 ;; Install the serial metis compatibility library
3248 (invoke "make" "-C" "libscotchmetis" "install")))
3249 (add-before 'check 'mpi-setup
3253 (invoke "make" "ptcheck")))))))
3255 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3257 (define-public metis
3264 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3265 "metis-" version ".tar.gz"))
3268 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3269 (build-system cmake-build-system)
3271 `(("blas" ,openblas)))
3273 `(#:tests? #f ;no tests
3274 #:configure-flags `("-DSHARED=ON"
3275 ,(string-append "-DGKLIB_PATH=" (getcwd)
3276 "/metis-" ,version "/GKlib"))))
3277 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3278 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3280 "METIS is a set of serial programs for partitioning graphs, partitioning
3281 finite element meshes, and producing fill-reducing orderings for sparse
3282 matrices. The algorithms implemented in METIS are based on the multilevel
3283 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3285 (license license:asl2.0))) ;As of version 5.0.3
3287 (define-public p4est
3294 (uri (string-append "http://p4est.github.io/release/p4est-"
3298 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3299 (build-system gnu-build-system)
3301 `(("fortran" ,gfortran)
3306 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3307 (assoc-ref %build-inputs "blas")
3309 ,(string-append "LAPACK_LIBS=-L"
3310 (assoc-ref %build-inputs "lapack")
3312 #:phases (modify-phases %standard-phases
3313 (add-before 'check 'mpi-setup
3315 (home-page "http://www.p4est.org")
3316 (synopsis "Adaptive mesh refinement on forests of octrees")
3318 "The p4est software library enables the dynamic management of a
3319 collection of adaptive octrees, conveniently called a forest of octrees.
3320 p4est is designed to work in parallel and scales to hundreds of thousands of
3322 (license license:gpl2+)))
3324 (define-public p4est-openmpi
3325 (package (inherit p4est)
3326 (name "p4est-openmpi")
3329 ,@(package-inputs p4est)))
3331 (substitute-keyword-arguments (package-arguments p4est)
3332 ((#:configure-flags cf)
3333 ``("--enable-mpi" ,@,cf))))
3334 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3336 (define-public gsegrafix
3343 (uri (string-append "mirror://gnu/" name "/" name "-"
3347 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3348 (build-system gnu-build-system)
3350 `(#:configure-flags '("LDFLAGS=-lm")))
3352 `(("libgnomecanvas" ,libgnomecanvas)
3353 ("libbonoboui" ,libbonoboui)
3354 ("libgnomeui" ,libgnomeui)
3355 ("libgnomeprintui" ,libgnomeprintui)
3358 `(("pkg-config" ,pkg-config)))
3359 (home-page "https://www.gnu.org/software/gsegrafix/")
3360 (synopsis "GNOME application to create scientific and engineering plots")
3361 (description "GSEGrafix is an application which produces high-quality graphical
3362 plots for science and engineering. Plots are specified via simple ASCII
3363 parameter files and data files and are presented in an anti-aliased GNOME
3364 canvas. The program supports rectangular two-dimensional plots, histograms,
3365 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3366 to BMP, JPEG or PNG image formats.")
3367 (license license:gpl3+)))
3369 (define-public maxima
3376 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3377 version "-source/" name "-" version ".tar.gz"))
3380 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3381 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3382 (build-system gnu-build-system)
3385 ("gnuplot" ,gnuplot) ;for plots
3387 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3389 `(("texinfo" ,texinfo)
3391 ("python" ,python)))
3394 (list "--enable-gcl"
3395 (string-append "--with-posix-shell="
3396 (assoc-ref %build-inputs "bash")
3398 (string-append "--with-wish="
3399 (assoc-ref %build-inputs "tk")
3401 (let ((v ,(package-version tk)))
3402 (string-take v (string-index-right v #\.)))))
3403 ;; By default Maxima attempts to write temporary files to
3404 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3405 ;; Work around that.
3406 #:make-flags (list "TMPDIR=/tmp")
3408 (modify-phases %standard-phases
3409 (add-after 'unpack 'patch-paths
3410 (lambda* (#:key inputs #:allow-other-keys)
3411 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3412 (coreutils (assoc-ref inputs "coreutils"))
3413 (dirname (string-append coreutils "/bin/dirname"))
3414 (head (string-append coreutils "/bin/head"))
3415 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3416 (python (string-append (assoc-ref inputs "python")
3418 (substitute* "src/maxima.in"
3419 (("sed ") (string-append sed " "))
3420 (("dirname") dirname)
3422 (substitute* "doc/info/Makefile.in"
3423 (("/usr/bin/env perl") perl))
3424 (substitute* "doc/info/build_html.sh.in"
3425 (("python") python))
3427 (add-before 'check 'pre-check
3429 (chmod "src/maxima" #o555)
3433 ;; This is derived from the testing code in the "debian/rules" file
3434 ;; of Debian's Maxima package.
3435 ;; If Maxima can successfully run this, the binary to be installed
3441 "--batch-string=\"run_testsuite();\" "
3442 "| grep -q \"No unexpected errors found\""))))
3443 ;; Make sure the doc and emacs files are found in the
3444 ;; standard location. Also configure maxima to find gnuplot
3445 ;; without having it on the PATH.
3446 (add-after 'install 'post-install
3447 (lambda* (#:key outputs inputs #:allow-other-keys)
3448 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3449 (out (assoc-ref outputs "out"))
3450 (datadir (string-append out "/share/maxima/" ,version))
3451 (binutils (string-append (assoc-ref inputs "binutils")
3453 (with-directory-excursion out
3454 (mkdir-p "share/emacs")
3455 (mkdir-p "share/doc")
3457 (string-append datadir "/doc/")
3458 (string-append out "/share/doc/maxima"))
3459 (with-atomic-file-replacement
3460 (string-append datadir "/share/maxima-init.lisp")
3462 (format out "~a ~s~a~%"
3463 "(setf $gnuplot_command "
3464 (string-append gnuplot "/bin/gnuplot") ")")
3465 (dump-port in out))))
3466 ;; Ensure that Maxima will have access to the GNU binutils
3467 ;; components at runtime.
3468 (wrap-program (string-append out "/bin/maxima")
3469 `("PATH" prefix (,binutils))))
3471 (home-page "http://maxima.sourceforge.net")
3472 (synopsis "Numeric and symbolic expression manipulation")
3473 (description "Maxima is a system for the manipulation of symbolic and
3474 numerical expressions. It yields high precision numeric results by using
3475 exact fractions, arbitrary precision integers, and variable precision floating
3477 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3478 ;; Others simply say "GNU General Public License" without stating a
3479 ;; version (which implicitly means gpl1+).
3480 ;; At least one file (src/maxima.asd) says "version 2."
3481 ;; GPLv2 only is therefore the smallest subset.
3482 (license license:gpl2)))
3484 (define-public wxmaxima
3492 (url "https://github.com/wxMaxima-developers/wxmaxima")
3493 (commit (string-append "Version-" version))))
3494 (file-name (git-file-name name version))
3496 (base32 "054f7n5kx75ng5j20rd5q27n9xxk03mrd7sbxyym1lsswzimqh4w"))))
3497 (build-system cmake-build-system)
3499 `(("gettext" ,gettext-minimal)
3500 ("xorg-server" ,xorg-server-for-tests)))
3501 ;; TODO: Add libomp for multithreading support.
3502 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3504 `(("wxwidgets" ,wxwidgets)
3507 ("adwaita-icon-theme" ,adwaita-icon-theme)
3509 ("shared-mime-info" ,shared-mime-info)))
3511 `(#:test-target "test"
3513 (modify-phases %standard-phases
3514 (add-after 'unpack 'patch-doc-path
3516 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3517 ;; documentation. Only licensing information is placed there by
3519 (substitute* "src/Dirstructure.cpp"
3520 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3522 (add-before 'check 'pre-check
3524 ;; Tests require a running X server.
3525 (system "Xvfb :1 &")
3526 (setenv "DISPLAY" ":1")
3527 (setenv "HOME" (getcwd))
3529 (add-after 'install 'wrap-program
3530 (lambda* (#:key inputs outputs #:allow-other-keys)
3531 (wrap-program (string-append (assoc-ref outputs "out")
3534 (,(string-append (assoc-ref inputs "maxima")
3536 ;; For GtkFileChooserDialog.
3537 `("GSETTINGS_SCHEMA_DIR" =
3538 (,(string-append (assoc-ref inputs "gtk+")
3539 "/share/glib-2.0/schemas")))
3540 `("XDG_DATA_DIRS" ":" prefix
3541 (;; Needed by gdk-pixbuf to know supported icon formats.
3543 (assoc-ref inputs "shared-mime-info") "/share")
3544 ;; The default icon theme of GTK+.
3546 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3548 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3549 (synopsis "Graphical user interface for the Maxima computer algebra system")
3551 "wxMaxima is a graphical user interface for the Maxima computer algebra
3552 system. It eases the use of Maxima by making most of its commands available
3553 through a menu system and by providing input dialogs for commands that require
3554 more than one argument. It also implements its own display engine that
3555 outputs mathematical symbols directly instead of depicting them with ASCII
3558 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3559 text and mathematical calculations to create documents, exporting of input and
3560 output to TeX, and a browser for Maxima's manual including command index and
3561 full text searching.")
3562 (license license:gpl2+)))
3564 (define-public armadillo
3570 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3574 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3575 (build-system cmake-build-system)
3576 (arguments `(#:tests? #f)) ; no test target
3578 `(("openblas" ,openblas)
3580 ("arpack" ,arpack-ng)))
3581 (home-page "http://arma.sourceforge.net/")
3582 (synopsis "C++ linear algebra library")
3584 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3585 between speed and ease of use. It is useful for algorithm development
3586 directly in C++, or quick conversion of research code into production
3587 environments. It can be used for machine learning, pattern recognition,
3588 signal processing, bioinformatics, statistics, econometrics, etc. The library
3589 provides efficient classes for vectors, matrices and cubes, as well as 150+
3590 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3591 (license license:asl2.0)))
3593 (define-public muparser
3594 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3595 ;; different hash. In order to make `guix package --upgrade` work correctly,
3596 ;; we set a Guix packaging revision.
3597 ;; When the next version of muparser is released, we can remove
3598 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3599 (let ((upstream-version "2.2.5")
3603 (version (string-append upstream-version "-" revision))
3608 (url "https://github.com/beltoforion/muparser")
3609 (commit (string-append "v" upstream-version))))
3610 (file-name (git-file-name name version))
3612 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3613 (build-system gnu-build-system)
3615 `(#:configure-flags '("--enable-samples=no")
3616 #:tests? #f)) ;no "check" target
3617 (home-page "http://muparser.beltoforion.de/")
3618 (synopsis "Fast parser library for mathematical expressions")
3620 "muParser is an extensible high performance math parser library. It is
3621 based on transforming an expression into a bytecode and precalculating constant
3623 (license license:expat))))
3625 (define-public openblas
3632 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3633 version "%20version.tar.gz"))
3634 (file-name (string-append name "-" version ".tar.gz"))
3637 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3638 (build-system gnu-build-system)
3640 `(#:test-target "test"
3641 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3642 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3643 ;; we need to disable substitutions.
3645 ,(let ((system (or (%current-target-system) (%current-system))))
3646 (or (string-prefix? "x86_64" system)
3647 (string-prefix? "i686" system)
3648 (string-prefix? "mips" system)
3649 (string-prefix? "aarch64" system)))
3651 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3653 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3655 ;; This is the maximum number of threads OpenBLAS will ever use (that
3656 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3657 ;; is used.) If we don't set it, the makefile sets it to the number
3658 ;; of cores of the build machine, which is obviously wrong.
3661 ;; Build the library for all supported CPUs. This allows
3662 ;; switching CPU targets at runtime with the environment variable
3663 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3664 ;; Unfortunately, this is not supported on non-x86 architectures,
3665 ;; where it leads to failed builds.
3666 ,@(let ((system (or (%current-target-system) (%current-system))))
3668 ((or (string-prefix? "x86_64" system)
3669 (string-prefix? "i686" system))
3670 '("DYNAMIC_ARCH=1"))
3671 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3672 ;; two available MIPS targets special extended instructions
3673 ;; for Loongson cores are used.
3674 ((string-prefix? "mips" system)
3675 '("TARGET=SICORTEX"))
3676 ;; On aarch64 force the generic 'armv8-a' target
3677 ((string-prefix? "aarch64" system)
3680 ;; no configure script
3682 (modify-phases %standard-phases
3684 (add-before 'build 'set-extralib
3685 (lambda* (#:key inputs #:allow-other-keys)
3686 ;; Get libgfortran found when building in utest.
3688 (string-append "-L" (assoc-ref inputs "fortran-lib")
3692 `(("fortran-lib" ,gfortran "lib")))
3695 ("fortran" ,gfortran)
3697 (home-page "https://www.openblas.net/")
3698 (synopsis "Optimized BLAS library based on GotoBLAS")
3700 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3701 (license license:bsd-3)))
3703 (define-public openblas-ilp64
3704 (package/inherit openblas
3705 (name "openblas-ilp64")
3706 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3708 (substitute-keyword-arguments (package-arguments openblas)
3709 ((#:make-flags flags '())
3710 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3712 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3713 (license license:bsd-3)))
3715 (define* (make-blis implementation #:optional substitutable?)
3716 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3717 source tree for a list of implementations.)
3719 SUBSTITUTABLE? determines whether the package is made available as a
3722 Currently the specialization must be selected at configure-time, but work is
3723 underway to allow BLIS to select the right optimized kernels at run time:
3724 <https://github.com/flame/blis/issues/129>."
3726 (name (if (string=? implementation "reference")
3728 (string-append "blis-" implementation)))
3730 (home-page "https://github.com/flame/blis")
3733 (uri (git-reference (url home-page) (commit version)))
3736 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3737 (file-name (git-file-name "blis" version))))
3738 (build-system gnu-build-system)
3740 `(#:test-target "test"
3742 #:substitutable? ,substitutable?
3744 #:phases (modify-phases %standard-phases
3746 (lambda* (#:key outputs #:allow-other-keys)
3747 ;; This is a home-made 'configure' script.
3748 (let ((out (assoc-ref outputs "out")))
3749 (invoke "./configure" "-p" out
3753 "--enable-threading=openmp"
3756 (add-before 'check 'show-test-output
3758 ;; By default "make check" is silent. Make it verbose.
3759 (system "tail -F output.testsuite &")
3761 (synopsis "High-performance basic linear algebra (BLAS) routines")
3763 "BLIS is a portable software framework for instantiating high-performance
3764 BLAS-like dense linear algebra libraries. The framework was designed to
3765 isolate essential kernels of computation that, when optimized, immediately
3766 enable optimized implementations of most of its commonly used and
3767 computationally intensive operations. While BLIS exports a new BLAS-like API,
3768 it also includes a BLAS compatibility layer which gives application developers
3769 access to BLIS implementations via traditional BLAS routine calls.")
3770 (license license:bsd-3)))
3773 ;; This is the "reference" implementation, which is the non-optimized but
3774 ;; portable variant (no assembly).
3775 (make-blis "reference" #t))
3777 (define ignorance blis)
3779 (define-syntax-rule (blis/x86_64 processor)
3780 "Expand to a package specialized for PROCESSOR."
3782 (inherit (make-blis processor))
3783 (supported-systems '("x86_64-linux"))))
3785 (define-public blis-sandybridge
3786 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3787 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3788 (blis/x86_64 "sandybridge"))
3790 (define-public blis-haswell
3791 ;; BLIS specialized for Haswell processors (launched 2013):
3792 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3793 (blis/x86_64 "haswell"))
3795 (define-public blis-knl
3796 ;; BLIS specialized for Knights Landing processor (launched 2016):
3797 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3798 (blis/x86_64 "knl"))
3801 (define-public openlibm
3809 (url "https://github.com/JuliaLang/openlibm")
3810 (commit (string-append "v" version))))
3811 (file-name (git-file-name name version))
3813 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3814 (build-system gnu-build-system)
3817 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3819 ;; no configure script
3820 (modify-phases %standard-phases (delete 'configure))
3821 #:tests? #f)) ;the tests are part of the default target
3822 (home-page "https://openlibm.org/")
3823 (synopsis "Portable C mathematical library (libm)")
3825 "OpenLibm is an effort to have a high quality, portable, standalone C
3826 mathematical library (libm). It can be used standalone in applications and
3827 programming language implementations. The project was born out of a need to
3828 have a good libm for the Julia programming language that worked consistently
3829 across compilers and operating systems, and in 32-bit and 64-bit
3831 ;; Each architecture has its own make target, and there is none for mips.
3832 (supported-systems (delete "mips64el-linux" %supported-systems))
3833 ;; See LICENSE.md for details.
3834 (license (list license:expat
3837 license:public-domain
3838 license:lgpl2.1+))))
3840 (define-public openspecfun
3842 (name "openspecfun")
3848 (url "https://github.com/JuliaLang/openspecfun")
3849 (commit (string-append "v" version))))
3850 (file-name (git-file-name name version))
3852 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3853 (build-system gnu-build-system)
3855 '(#:tests? #f ; no "check" target
3857 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3859 (modify-phases %standard-phases
3860 (delete 'configure)))) ; no configure script
3862 `(("fortran" ,gfortran)))
3863 (home-page "https://github.com/JuliaLang/openspecfun")
3864 (synopsis "Collection of special mathematical functions")
3866 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3867 portable package for Bessel Functions of a Complex Argument and Nonnegative
3868 Order; it contains subroutines for computing Bessel functions and Airy
3869 functions. Faddeeva allows computing the various error functions of arbitrary
3870 complex arguments (Faddeeva function, error function, complementary error
3871 function, scaled complementary error function, imaginary error function, and
3872 Dawson function); given these, one can also easily compute Voigt functions,
3873 Fresnel integrals, and similar related functions as well.")
3874 ;; Faddeeva is released under the Expat license; AMOS is included as
3875 ;; public domain software.
3876 (license (list license:expat license:public-domain))))
3878 (define-public suitesparse
3880 (name "suitesparse")
3886 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3887 (commit (string-append "v" version))))
3888 (file-name (git-file-name name version))
3891 "0qjlyfxs8s48rs63c2fzspisgq1kk4bwkgnhmh125hgkdhrq2w1c"))
3892 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3893 (modules '((guix build utils)))
3895 ;; Remove bundled metis source
3897 (delete-file-recursively "metis-5.1.0")
3899 (build-system gnu-build-system)
3901 '(#:tests? #f ;no "check" target
3905 "MY_METIS_LIB=-lmetis"
3906 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3907 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3908 (assoc-ref %outputs "out")
3909 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3910 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3911 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3912 " -DCMAKE_SKIP_RPATH=TRUE"
3913 " -DCMAKE_BUILD_TYPE=Release")
3914 (string-append "INSTALL_LIB="
3915 (assoc-ref %outputs "out") "/lib")
3916 (string-append "INSTALL_INCLUDE="
3917 (assoc-ref %outputs "out") "/include")
3920 (modify-phases %standard-phases
3921 (delete 'configure)))) ;no configure script
3929 `(("cmake" ,cmake-minimal)
3931 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3932 (synopsis "Suite of sparse matrix software")
3934 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3935 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3936 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3937 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3938 CXSparse, a concise sparse Cholesky factorization package; and many other
3941 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3943 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3944 (license (list license:gpl2+ license:lgpl2.1+))))
3946 (define-public atlas
3952 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3953 version "/atlas" version ".tar.bz2"))
3956 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3957 (build-system gnu-build-system)
3958 (home-page "http://math-atlas.sourceforge.net/")
3959 (inputs `(("gfortran" ,gfortran)
3960 ("lapack-tar" ,(package-source lapack))))
3961 (outputs '("out" "doc"))
3962 ;; For the moment we drop support for MIPS at it fails to compile. See
3963 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3964 (supported-systems (delete "mips64el-linux" %supported-systems))
3966 `(#:parallel-build? #f
3967 #:parallel-tests? #f
3969 ;; ATLAS tunes itself for the machine it is built on, as explained at
3970 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3971 ;; For this reason, we want users to build it locally instead of using
3975 #:modules ((srfi srfi-26)
3976 (guix build gnu-build-system)
3979 `(;; Generate position independent code suitable for dynamic libraries
3980 ;; and use WALL timer to get more accurate timing.
3981 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3984 ,,(if (string-match "64" (%current-system))
3987 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3988 ;; needed to compile C files before it is generated.
3989 "-Ss" "pmake" "make -j 1"
3990 ;; Probe is failing for MIPS. We therefore define the system
3991 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3992 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3993 ,,@(if (string-prefix? "mips" (%current-system))
3994 (list "-A" "49" "-V" "1")
3996 ;; Generate shared libraries.
3998 ;; Build a full LAPACK library.
3999 ,(string-append "--with-netlib-lapack-tarfile="
4000 (assoc-ref %build-inputs "lapack-tar")))
4002 (modify-phases %standard-phases
4003 (add-after 'install 'install-doc
4004 (lambda* (#:key outputs inputs #:allow-other-keys)
4005 (let ((doc (string-append (assoc-ref outputs "doc")
4006 "/share/doc/atlas")))
4008 (for-each (cut install-file <> doc)
4009 (find-files "../ATLAS/doc" ".*"))
4011 (add-after 'check 'check-pt
4012 (lambda _ (invoke "make" "ptcheck")))
4013 ;; Fix files required to run configure.
4014 (add-before 'configure 'fix-/bin/sh
4016 ;; Use `sh', not `/bin/sh'.
4017 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4021 ;; Fix /bin/sh in generated make files.
4022 (add-after 'configure 'fix-/bin/sh-in-generated-files
4024 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4028 ;; ATLAS configure program does not accepts the default flags
4029 ;; passed by the 'gnu-build-system'.
4031 (lambda* (#:key native-inputs inputs outputs
4032 (configure-flags '())
4033 #:allow-other-keys #:rest args)
4034 (let* ((prefix (assoc-ref outputs "out"))
4035 (bash (or (and=> (assoc-ref
4036 (or native-inputs inputs) "bash")
4037 (cut string-append <> "/bin/bash"))
4039 (flags `(,(string-append "--prefix=" prefix)
4041 (abs-srcdir (getcwd))
4042 (srcdir (string-append "../" (basename abs-srcdir))))
4043 (format #t "source directory: ~s (relative from build: ~s)~%"
4047 (format #t "build directory: ~s~%" (getcwd))
4048 (format #t "configure flags: ~s~%" flags)
4050 (string-append srcdir "/configure")
4052 (synopsis "Automatically Tuned Linear Algebra Software")
4054 "ATLAS is an automatically tuned linear algebra software library
4055 providing C and Fortran77 interfaces to a portably efficient BLAS
4056 implementation, as well as a few routines from LAPACK.
4058 Optimization occurs at build time. For this reason, the library is built on
4059 the machine where it is installed, without resorting to pre-built substitutes.
4061 Before building the library, CPU throttling should be disabled. This can be
4062 done in the BIOS, or, on GNU/Linux, with the following command:
4065 # cpupower --governor performance
4068 Failure to do so will result in a library with poor performance.")
4069 (license license:bsd-3)))
4078 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4079 version "/glm-" version ".zip"))
4081 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4082 (build-system cmake-build-system)
4084 `(#:phases (modify-phases %standard-phases
4086 (lambda* (#:key outputs #:allow-other-keys)
4087 ;; Since version 0.9.9.6, 'make install' is not supported
4088 ;; and we have to do it "manually". Upstream discussion:
4089 ;; <https://github.com/g-truc/glm/pull/968>.
4090 (let* ((source (string-append "../glm"))
4091 (out (assoc-ref outputs "out"))
4092 (inc (string-append out "/include"))
4093 (lib (string-append out "/lib"))
4094 (pkgconfig (string-append lib "/pkgconfig")))
4095 (with-directory-excursion source
4098 (copy-recursively "glm" (string-append inc "/glm"))
4099 (copy-recursively "cmake" (string-append lib "/cmake"))
4100 (call-with-output-file (string-append pkgconfig "/glm.pc")
4104 includedir=${prefix}/include
4107 Description: OpenGL Mathematics
4109 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4112 `(("unzip" ,unzip)))
4113 (home-page "https://glm.g-truc.net/")
4114 (synopsis "OpenGL Mathematics library")
4115 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4116 library for graphics software based on the OpenGL Shading Language (GLSL)
4118 (license license:expat)))
4120 (define-public lpsolve
4127 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4128 "/lp_solve_" version "_source.tar.gz"))
4131 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4132 (modules '((guix build utils)))
4135 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4137 ;; Pretend to be on a 64 bit platform to obtain a common directory
4138 ;; name for the build results on all architectures; nothing else
4139 ;; seems to depend on it.
4140 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4142 ;; The check for 'isnan' as it is written fails with
4143 ;; "non-floating-point argument in call to function
4144 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4145 ;; definition, which in turn leads to bad things. Fix the feature
4147 (("isnan\\(0\\)") "isnan(0.)"))
4149 (build-system gnu-build-system)
4151 `(#:tests? #f ; no check target
4153 (modify-phases %standard-phases
4154 (delete 'configure) ; no configure script
4157 (with-directory-excursion "lpsolve55"
4158 (invoke "bash" "ccc"))
4159 (with-directory-excursion "lp_solve"
4160 (invoke "bash" "ccc"))
4163 (lambda* (#:key outputs #:allow-other-keys)
4164 (let* ((out (assoc-ref outputs "out"))
4165 (bin (string-append out "/bin"))
4166 (lib (string-append out "/lib"))
4167 ;; This is where LibreOffice expects to find the header
4168 ;; files, and where they are installed by Debian.
4169 (include (string-append out "/include/lpsolve")))
4170 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4171 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4172 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4174 ;; Install a subset of the header files as on Debian
4175 ;; (plus lp_bit.h, which matches the regular expression).
4176 (for-each (lambda (name)
4177 (install-file name include))
4178 (find-files "." "lp_[HMSa-z].*\\.h$"))
4179 (with-directory-excursion "shared"
4180 (for-each (lambda (name)
4181 (install-file name include))
4182 (find-files "." "\\.h$")))
4184 (home-page "http://lpsolve.sourceforge.net/")
4185 (synopsis "Mixed integer linear programming (MILP) solver")
4187 "lp_solve is a mixed integer linear programming solver based on the
4188 revised simplex and the branch-and-bound methods.")
4189 (license license:lgpl2.1+)))
4191 (define-public dealii
4198 (uri (string-append "https://github.com/dealii/dealii/releases/"
4199 "download/v" version "/dealii-" version ".tar.gz"))
4202 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
4203 (modules '((guix build utils)))
4205 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4207 (delete-file-recursively "bundled")
4209 (build-system cmake-build-system)
4217 ("arpack" ,arpack-ng)
4218 ("muparser" ,muparser)
4219 ("gfortran" ,gfortran)
4220 ("suitesparse" ,suitesparse))) ;for UMFPACK
4222 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4224 ;; Work around a bug in libsuitesparseconfig linking
4225 ;; see https://github.com/dealii/dealii/issues/4745
4226 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4227 (home-page "https://www.dealii.org")
4228 (synopsis "Finite element library")
4230 "Deal.II is a C++ program library targeted at the computational solution
4231 of partial differential equations using adaptive finite elements. The main
4232 aim of deal.II is to enable rapid development of modern finite element codes,
4233 using among other aspects adaptive meshes and a wide array of tools often used
4234 in finite element programs.")
4235 (license license:lgpl2.1+)))
4237 (define-public dealii-openmpi
4238 (package (inherit dealii)
4239 (name "dealii-openmpi")
4242 ;;Supported only with MPI:
4243 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4244 ("p4est" ,p4est-openmpi)
4245 ("petsc" ,petsc-openmpi)
4246 ("slepc" ,slepc-openmpi)
4247 ("metis" ,metis) ;for MUMPS
4248 ("scalapack" ,scalapack) ;for MUMPS
4249 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4250 ("arpack" ,arpack-ng-openmpi)
4251 ,@(fold alist-delete (package-inputs dealii)
4252 '("p4est" "arpack"))))
4254 (substitute-keyword-arguments (package-arguments dealii)
4255 ((#:configure-flags cf)
4256 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4258 ((#:phases phases '%standard-phases)
4259 `(modify-phases ,phases
4260 (add-before 'check 'mpi-setup
4261 ,%openmpi-setup)))))
4262 (synopsis "Finite element library (with MPI support)")))
4264 (define-public flann
4268 (home-page "https://github.com/mariusmuja/flann/")
4272 (uri (git-reference (url home-page) (commit version)))
4273 (file-name (git-file-name name version))
4276 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4277 (patches (search-patches "flann-cmake-3.11.patch"))))
4278 (build-system cmake-build-system)
4281 `(("unzip" ,unzip)))
4284 ;; FIXME: 'mkoctfile' fails with a linker error:
4285 ;; ld: cannot find -loctinterp
4286 ;; ld: cannot find -loctave
4287 ;; Disable it for now.
4288 ;;("octave" ,octave-cli)
4289 ("python" ,python-2) ; print syntax
4290 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4293 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4294 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4295 #:strip-directories '("lib" "lib64" "libexec"
4296 "bin" "sbin" "share/flann/octave")
4298 ;; Save 12 MiB by not installing .a files. Passing
4299 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4300 #:phases (modify-phases %standard-phases
4301 (add-after 'install 'remove-static-libraries
4302 (lambda* (#:key outputs #:allow-other-keys)
4303 (let* ((out (assoc-ref outputs "out"))
4304 (lib (string-append out "/lib")))
4305 (for-each delete-file
4306 (find-files lib "\\.a$"))
4309 #:tests? #f)) ; The test data are downloaded from the Internet.
4310 (synopsis "Library for approximate nearest neighbors computation")
4311 (description "FLANN is a library for performing fast approximate
4312 nearest neighbor searches in high dimensional spaces. It implements a
4313 collection of algorithms and a system for automatically choosing the best
4314 algorithm and optimum parameters depending on the dataset.
4316 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4317 (license (license:non-copyleft "file://COPYING"
4318 "See COPYING in the distribution."))))
4320 (define-public wcalc
4327 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4328 "wcalc-" version ".tar.bz2"))
4331 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4332 (build-system gnu-build-system)
4335 ("readline" ,readline)))
4336 (home-page "http://w-calc.sourceforge.net/index.php")
4337 (synopsis "Flexible command-line scientific calculator")
4338 (description "Wcalc is a very capable calculator. It has standard functions
4339 (sin, asin, and sinh for example, in either radians or degrees), many
4340 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4341 variables, a command history, hex/octal/binary input and output, unit
4342 conversions, embedded comments, and an expandable expression entry field. It
4343 evaluates expressions using the standard order of operations.")
4344 (license license:gpl2+)))
4353 (url "https://github.com/xaos-project/XaoS")
4354 (commit (string-append "release-" version))))
4355 (file-name (git-file-name name version))
4358 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4359 (build-system gnu-build-system)
4360 (native-inputs `(("gettext" ,gettext-minimal)
4362 ("qttools" ,qttools)))
4363 (inputs `(("libx11" ,libx11)
4367 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4368 ;; not enough for this package to install properly. These phases fix that.
4370 `(#:tests? #f ;no "check" target
4372 (modify-phases %standard-phases
4373 (add-before 'configure 'make-qt-deterministic
4375 ;; Make Qt deterministic.
4376 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4379 (lambda* (#:key outputs #:allow-other-keys)
4380 (let ((out (assoc-ref outputs "out")))
4381 ;; The DESTDIR is originally set to install the xaos binary to
4382 ;; the "bin" folder inside the build directory. Setting make
4383 ;; flags doesn't seem to change this.
4384 (substitute* "XaoS.pro"
4386 (string-append "DESTDIR=" out "/bin")))
4387 (substitute* "src/include/config.h"
4388 (("/usr/share/XaoS")
4389 (string-append out "/share/XaoS")))
4391 (add-after 'install 'install-data
4392 (lambda* (#:key outputs #:allow-other-keys)
4393 (let* ((out (assoc-ref outputs "out"))
4394 (share (string-append out "/share")))
4398 (copy-recursively folder
4399 (string-append share "/XaoS/" folder)))
4400 '("catalogs" "examples" "tutorial"))
4401 (install-file "xdg/xaos.png"
4402 (string-append share "/pixmaps"))
4403 (install-file "xdg/xaos.desktop"
4404 (string-append share "/applications")))
4406 (synopsis "Real-time fractal zoomer")
4407 (description "GNU XaoS is a graphical program that generates fractal
4408 patterns and allows you to zoom in and out of them infinitely in a fluid,
4409 continuous manner. It also includes tutorials that help to explain how fractals
4410 are built. It can generate many different fractal types such as the Mandelbrot
4412 (home-page "https://xaos-project.github.io/")
4413 (license license:gpl2+)))
4415 (define-public hypre
4423 (url "https://github.com/LLNL/hypre")
4424 (commit (string-append "v" version))))
4425 (file-name (git-file-name name version))
4427 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4428 (modules '((guix build utils)))
4431 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4432 ;; substitute the release date.
4433 (substitute* "src/utilities/HYPRE_utilities.h"
4434 (("Date Compiled: .*$")
4435 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4437 (build-system gnu-build-system)
4438 (outputs '("out" ; 6.1 MiB of headers and libraries
4439 "doc")) ; 4.8 MiB of documentation
4443 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4444 ("texlive" ,(texlive-union (list texlive-xypic
4446 texlive-latex-hyperref
4448 ("ghostscript" ,ghostscript)))
4450 `(("blas" ,openblas)
4451 ("lapack" ,lapack)))
4453 `(#:modules ((srfi srfi-1)
4454 ,@%gnu-build-system-modules)
4455 #:configure-flags '("--enable-shared"
4463 (modify-phases %standard-phases
4464 (add-before 'build 'set-HOME
4466 ;; FIXME: texlive-union does not find the built
4467 ;; metafonts, so it tries to generate them in HOME.
4468 (setenv "HOME" "/tmp")
4470 (add-before 'configure 'chdir-src
4471 (lambda _ (chdir "src")))
4473 (lambda* (#:key build target configure-flags
4474 #:allow-other-keys #:rest args)
4475 (let* ((configure (assoc-ref %standard-phases 'configure)))
4478 (list #:configure-flags
4479 (cons (string-append
4480 "--host=" (or target build))
4481 configure-flags)))))))
4482 (add-after 'build 'build-docs
4484 (invoke "make" "-Cdocs" "pdf" "html")))
4487 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4488 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4489 (invoke "make" "check" "CHECKRUN=")
4490 (for-each (lambda (filename)
4491 (let ((size (stat:size (stat filename))))
4492 (when (positive? size)
4493 (error (format #f "~a size ~d; error indication~%"
4495 (find-files "test" ".*\\.err$"))
4497 (add-after 'install 'install-docs
4498 (lambda* (#:key outputs #:allow-other-keys)
4499 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4500 (let* ((doc (assoc-ref outputs "doc"))
4501 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4502 (with-directory-excursion "docs"
4503 (for-each (lambda (base)
4504 (install-file (string-append base ".pdf") docdir)
4505 (copy-recursively base docdir)) ; html docs
4506 '("HYPRE_usr_manual"
4507 "HYPRE_ref_manual")))
4509 (home-page "http://www.llnl.gov/casc/hypre/")
4510 (synopsis "Library of solvers and preconditioners for linear equations")
4512 "HYPRE is a software library of high performance preconditioners and
4513 solvers for the solution of large, sparse linear systems of equations. It
4514 features multigrid solvers for both structured and unstructured grid
4516 (license license:lgpl2.1)))
4518 (define-public hypre-openmpi
4519 (package (inherit hypre)
4520 (name "hypre-openmpi")
4523 ,@(package-inputs hypre)))
4525 (substitute-keyword-arguments (package-arguments hypre)
4526 ((#:configure-flags flags)
4528 ,@(delete "--without-MPI" ,flags)))
4530 `(modify-phases ,phases
4531 (add-before 'check 'mpi-setup
4532 ,%openmpi-setup)))))
4533 (synopsis "Parallel solvers and preconditioners for linear equations")
4535 "HYPRE is a software library of high performance preconditioners and
4536 solvers for the solution of large, sparse linear systems of equations on
4537 parallel computers. It features parallel multigrid solvers for both
4538 structured and unstructured grid problems.")))
4540 (define-public matio
4547 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4548 "matio-" version ".tar.gz"))
4551 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4552 (build-system gnu-build-system)
4555 ("hdf5" ,hdf5-1.8)))
4556 (home-page "http://matio.sourceforge.net/")
4557 (synopsis "Library for reading and writing MAT files")
4558 (description "Matio is a library for reading and writing MAT files. It
4559 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4560 (license license:bsd-2)))
4567 (origin (method url-fetch)
4568 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4569 "download/" version "/Vc-" version ".tar.gz"))
4572 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4573 (build-system cmake-build-system)
4576 '("-DBUILD_TESTING=ON"
4577 ;; By default, Vc will optimize for the CPU of the build machine.
4578 ;; Setting this to "none" makes it create portable binaries. See
4579 ;; "cmake/OptimizeForArchitecture.cmake".
4580 "-DTARGET_ARCHITECTURE=none")
4581 #:phases (modify-phases %standard-phases
4582 (add-after 'unpack 'copy-testdata
4583 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4584 (let ((testdata (assoc-ref (or native-inputs inputs)
4586 (copy-recursively testdata "tests/testdata")
4589 `(("virtest" ,virtest)
4591 ;; This is a submodule in the git project, but not part of the
4592 ;; released sources. See the git branch for the commit to take.
4593 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4597 (url "https://github.com/VcDevel/vc-testdata")
4598 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4599 (file-name (git-file-name "vc-testdata"
4600 (string-take commit 7)))
4603 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4604 (synopsis "SIMD vector classes for C++")
4605 (description "Vc provides portable, zero-overhead C++ types for explicitly
4606 data-parallel programming. It is a library designed to ease explicit
4607 vectorization of C++ code. Its types enable explicitly stating data-parallel
4608 operations on multiple values. The parallelism is therefore added via the type
4609 system. Vc has an intuitive API and provides portability between different
4610 compilers and compiler versions as well as portability between different vector
4611 instruction sets. Thus, an application written with Vc can be compiled for:
4614 @item SSE2 up to SSE4.2 or SSE4a
4617 @item NEON (in development)
4618 @item NVIDIA GPUs / CUDA (in development)
4620 (home-page "https://github.com/VcDevel/Vc")
4621 ;; "No support_???.cpp file exists for this architecture."
4622 (supported-systems '("x86_64-linux" "i686-linux"))
4623 (license license:bsd-3)))
4625 (define-public reducelcs
4626 ;; This is the last commit which is available upstream, no
4627 ;; release happened since 2010.
4628 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4632 (version (string-append "1.0-" revision "." (string-take commit 7)))
4637 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4639 (file-name (string-append name "-" version "-checkout"))
4642 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4643 (build-system gnu-build-system)
4645 `(("openlibm" ,openlibm)))
4647 `(#:tests? #f ; no tests
4649 (modify-phases %standard-phases
4650 (delete 'configure) ; No configure script exists.
4651 (replace 'install ; No install phase exists.
4652 (lambda* (#:key outputs #:allow-other-keys)
4653 (let* ((out (assoc-ref outputs "out"))
4654 (bin (string-append out "/bin")))
4655 (install-file "Approximation" bin)
4656 (install-file "CollectResults" bin)
4657 (install-file "GenerateInstances" bin)
4659 (synopsis "Approximate Longest Commons Subsequence computation tool")
4661 "@code{reduceLCS} is an implementation of the Reduce-Expand
4662 algorithm for LCS. It is a fast program to compute the approximate
4663 Longest Commons Subsequence of a set of strings.")
4664 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4665 (license license:gpl3+))))
4667 (define-public jacal
4674 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4677 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4678 (patches (search-patches "jacal-fix-texinfo.patch"))))
4679 (build-system gnu-build-system)
4682 (modify-phases %standard-phases
4683 (add-before 'build 'pre-build
4684 ;; Don't use upstream's script - it really doesn't fit into
4685 ;; Guix's functional paradigm.
4686 (lambda* (#:key inputs outputs #:allow-other-keys)
4687 (substitute* "Makefile"
4688 (("^install: install-script") "install: "))))
4689 (add-after 'install 'post-install
4690 ;; Instead, we provide our own simplified script.
4691 (lambda* (#:key inputs outputs #:allow-other-keys)
4692 (let ((wrapper (string-append (assoc-ref outputs "out")
4694 (format (open wrapper (logior O_WRONLY O_CREAT))
4695 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4696 "-e '(slib:load \"~a/lib/jacal/math\") "
4699 (assoc-ref inputs "scm")
4700 (assoc-ref outputs "out"))
4701 (chmod wrapper #o555))))
4703 (lambda* (#:key outputs #:allow-other-keys)
4704 (invoke "./configure"
4705 (string-append "--prefix="
4706 (assoc-ref outputs "out"))))))))
4707 (inputs `(("scm" ,scm)))
4708 (native-inputs `(("unzip" ,unzip)
4709 ("texinfo" ,texinfo)))
4710 (synopsis "Symbolic mathematics system")
4711 (description "GNU JACAL is an interactive symbolic mathematics program based on
4712 Scheme. It manipulate and simplify a range of mathematical expressions such
4713 as equations, scalars, vectors, and matrices.")
4714 (home-page "https://www.gnu.org/software/jacal/")
4715 (license license:gpl3+)))
4721 (home-page "https://github.com/Z3Prover/z3")
4724 (uri (git-reference (url home-page)
4725 (commit (string-append "z3-" version))))
4726 (file-name (git-file-name name version))
4729 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4730 (build-system gnu-build-system)
4732 `(#:imported-modules ((guix build python-build-system)
4733 ,@%gnu-build-system-modules)
4734 #:modules (((guix build python-build-system) #:select (site-packages))
4735 (guix build gnu-build-system)
4738 (modify-phases %standard-phases
4739 (add-after 'unpack 'enable-bytecode-determinism
4741 (setenv "PYTHONHASHSEED" "0")
4743 (add-after 'unpack 'fix-compatability
4744 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4746 (substitute* "src/util/mpz.cpp"
4747 (("#include <immintrin.h>") ""))
4749 (add-before 'configure 'bootstrap
4751 (invoke "python" "scripts/mk_make.py")))
4752 ;; work around gnu-build-system's setting --enable-fast-install
4753 ;; (z3's `configure' is a wrapper around the above python file,
4754 ;; which fails when passed --enable-fast-install)
4756 (lambda* (#:key inputs outputs #:allow-other-keys)
4757 (invoke "./configure"
4759 (string-append "--prefix=" (assoc-ref outputs "out"))
4760 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4761 (add-after 'configure 'change-directory
4765 (add-before 'check 'make-test-z3
4767 ;; Build the test suite executable.
4768 (invoke "make" "test-z3" "-j"
4769 (number->string (parallel-job-count)))))
4772 ;; Run all the tests that don't require arguments.
4773 (invoke "./test-z3" "/a"))))))
4776 ("python" ,python-wrapper)))
4777 (synopsis "Theorem prover")
4778 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4779 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4780 (license license:expat)))
4785 (version "2018.11.001")
4788 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4789 version "/elpa-" version ".tar.gz"))
4792 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4793 (build-system gnu-build-system)
4795 `(("fortran" ,gfortran)
4796 ("perl" ,perl))) ;for configure and deps
4798 `(("blas" ,openblas)))
4803 ;; ELPA unfortunately does not support runtime dispatch, so we can
4804 ;; only enable the "generic" kernels. See the "Cross compilation"
4805 ;; section of INSTALL.md.
4807 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4808 "--disable-avx" "--disable-avx2" "--disable-avx512"
4809 ,(string-append "CFLAGS=-O3 "
4810 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4811 "-ftree-vect-loop-version -ftree-vectorize "
4812 ,(let ((system (or (%current-target-system)
4813 (%current-system))))
4815 ((or (string-prefix? "x86_64" system)
4816 (string-prefix? "i686" system))
4819 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4821 (modify-phases %standard-phases
4822 (add-before 'configure 'patch-header-generation
4824 (substitute* "configure"
4825 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4826 (string-append & " CPP=\"$CPP\"")))
4828 (add-before 'check 'setup-tests
4830 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4831 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4832 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4833 ;; for Fortran. This also causes several tests to pass that
4834 ;; otherwise would otherwise fail with matrix size 5000; possibly
4835 ;; due to floating point tolerances that are too tight.
4836 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4837 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4838 (substitute* "Makefile"
4839 ;; Test scripts are generated, patch the shebang
4840 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4842 (home-page "http://elpa.mpcdf.mpg.de")
4843 (synopsis "Eigenvalue solvers for symmetric matrices")
4845 "The ELPA library provides efficient and scalable direct eigensolvers for
4846 symmetric matrices.")
4847 (license license:lgpl3)))
4849 (define-public elpa-openmpi
4850 (package (inherit elpa)
4851 (name "elpa-openmpi")
4854 ("scalapack" ,scalapack)
4855 ,@(package-inputs elpa)))
4857 (substitute-keyword-arguments (package-arguments elpa)
4858 ((#:configure-flags cf '())
4859 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4860 ((#:phases phases '%standard-phases)
4861 `(modify-phases ,phases
4862 (add-before 'check 'mpi-setup
4864 ;; Tests use 2 mpi tasks by default, use our remaining build
4865 ;; cores as OpenMP threads.
4866 (setenv "OMP_NUM_THREADS" (number->string
4867 (max (quotient (parallel-job-count) 2)
4869 (,%openmpi-setup)))))))
4870 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4872 (define-public elemental
4879 (url "https://github.com/elemental/Elemental")
4880 (commit (string-append "v" version))))
4881 (file-name (git-file-name name version))
4884 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4885 (build-system cmake-build-system)
4886 (home-page "https://github.com/elemental/Elemental")
4888 `(("gfortran" ,gfortran)))
4890 `(("blas" ,openblas)
4891 ("gfortran:lib" ,gfortran "lib")
4900 `(#:build-type "Release" ;default RelWithDebInfo not supported
4901 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4902 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4903 "-DEL_CACHE_WARNINGS:BOOL=YES"
4904 "-DEL_TESTS:BOOL=YES"
4905 "-DCMAKE_INSTALL_LIBDIR=lib"
4906 "-DGFORTRAN_LIB=gfortran")
4907 #:phases (modify-phases %standard-phases
4908 (add-before 'check 'mpi-setup
4910 (add-before 'check 'setup-tests
4912 ;; Parallelism is done at the MPI layer.
4913 (setenv "OMP_NUM_THREADS" "1")
4915 (add-after 'install 'remove-tests
4916 (lambda* (#:key outputs #:allow-other-keys)
4917 ;; Tests are installed, with no easy configuration
4918 ;; switch to prevent this, so delete them.
4919 (delete-file-recursively
4920 (string-append (assoc-ref outputs "out") "/bin"))
4922 (synopsis "Dense and sparse-direct linear algebra and optimization")
4923 (description "Elemental is a modern C++ library for distributed-memory
4924 dense and sparse-direct linear algebra, conic optimization, and lattice
4926 (license license:bsd-2)))
4928 (define-public mcrl2
4931 (version "202006.0")
4935 "https://www.mcrl2.org/download/release/mcrl2-"
4939 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4944 ("qtbase" ,qtbase)))
4945 (build-system cmake-build-system)
4946 (synopsis "Toolset for the mCRL2 formal specification language")
4948 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4949 specification language for describing concurrent discrete event systems. Its
4950 toolset supports analysis and automatic verification, linearisation, simulation,
4951 state-space exploration and generation, and tools to optimise and analyse
4952 specifications. Also, state spaces can be manipulated, visualised and
4954 (home-page "https://mcrl2.org")
4955 (license license:boost1.0)))
4957 (define-public mcrl2-minimal
4960 (name "mcrl2-minimal")
4962 `(("boost" ,boost)))
4964 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4966 (define-public tcalc
4973 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4977 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4978 (build-system gnu-build-system)
4979 (synopsis "The terminal calculator")
4981 "The terminal calculator is a small program to help users of the GNU/Linux
4982 terminal do calculations simply and quickly. The formula to be calculated can
4983 be fed to @command{tcalc} through the command line.")
4984 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4985 (license license:gpl3+)))
4987 (define-public sundials
4994 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4995 "sundials-" version ".tar.gz"))
4998 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4999 (build-system cmake-build-system)
5001 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5003 `(("fortran" ,gfortran) ;for fcmix
5005 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5007 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5008 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5009 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5010 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5011 "-DEXAMPLES_INSTALL:BOOL=OFF"
5013 "-DFCMIX_ENABLE:BOOL=ON"
5015 "-DKLU_ENABLE:BOOL=ON"
5016 ,(string-append "-DKLU_INCLUDE_DIR="
5017 (assoc-ref %build-inputs "suitesparse")
5019 ,(string-append "-DKLU_LIBRARY_DIR="
5020 (assoc-ref %build-inputs "suitesparse")
5022 (home-page "https://computation.llnl.gov/projects/sundials")
5023 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5024 (description "SUNDIALS is a family of software packages implemented with
5025 the goal of providing robust time integrators and nonlinear solvers that can
5026 easily be incorporated into existing simulation codes.")
5027 (license license:bsd-3)))
5029 (define-public sundials-openmpi
5030 (package (inherit sundials)
5031 (name "sundials-openmpi")
5034 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5035 ,@(package-inputs sundials)))
5037 (substitute-keyword-arguments (package-arguments sundials)
5038 ((#:configure-flags flags '())
5039 `(cons* "-DMPI_ENABLE:BOOL=ON"
5040 "-DPETSC_ENABLE:BOOL=ON"
5041 (string-append "-DPETSC_INCLUDE_DIR="
5042 (assoc-ref %build-inputs "petsc")
5044 (string-append "-DPETSC_LIBRARY_DIR="
5045 (assoc-ref %build-inputs "petsc")
5048 ((#:phases phases '%standard-phases)
5049 `(modify-phases ,phases
5050 (add-before 'check 'mpi-setup
5051 ,%openmpi-setup)))))
5052 (synopsis "SUNDIALS with OpenMPI support")))
5054 (define-public combinatorial-blas
5056 (name "combinatorial-blas")
5061 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5063 (match (string-split version #\.)
5064 ((major minor patch)
5065 (string-append major minor "_" patch))) ;e.g. "16_2"
5069 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5070 (patches (search-patches "combinatorial-blas-awpm.patch"
5071 "combinatorial-blas-io-fix.patch"))))
5072 (build-system cmake-build-system)
5075 ("test-data" ,(origin
5077 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5078 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5081 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5083 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5084 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5085 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5087 (modify-phases %standard-phases
5088 (add-before 'check 'mpi-setup
5090 (add-before 'check 'test-setup
5091 (lambda* (#:key inputs #:allow-other-keys)
5092 (setenv "OMP_NUM_THREADS" "2")
5093 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5094 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5095 (synopsis "Linear algebra primitives for graph analytics")
5096 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5097 distributed-memory parallel graph library offering a small but powerful set of
5098 linear algebra primitives specifically targeting graph analytics.")
5100 license:gpl2+ ;include/psort/(funnel|sort)*.h
5101 license:x11 ;usort and psort
5102 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5104 (define-public dune-common
5106 (name "dune-common")
5111 (uri (string-append "https://dune-project.org/download/"
5112 version "/dune-common-" version ".tar.gz"))
5115 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5116 (build-system cmake-build-system)
5119 (modify-phases %standard-phases
5120 (add-after 'build 'build-tests
5121 (lambda* (#:key make-flags #:allow-other-keys)
5122 (apply invoke "make" "build_tests" make-flags))))))
5126 ("openblas" ,openblas)
5128 ("superlu" ,superlu)))
5130 `(("gfortran" ,gfortran)
5131 ("pkg-config" ,pkg-config)))
5132 (home-page "https://dune-project.org/")
5133 (synopsis "Distributed and Unified Numerics Environment")
5134 (description "DUNE, the Distributed and Unified Numerics Environment is a
5135 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5136 grid-based methods. It supports the easy implementation of methods like
5137 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5138 Differences} (FD).")
5139 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5140 (license license:gpl2)))
5142 (define-public dune-geometry
5144 (name "dune-geometry")
5149 (uri (string-append "https://dune-project.org/download/"
5150 version "/dune-geometry-" version ".tar.gz"))
5153 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5154 (build-system cmake-build-system)
5157 (modify-phases %standard-phases
5158 (add-after 'build 'build-tests
5159 (lambda* (#:key make-flags #:allow-other-keys)
5160 (apply invoke "make" "build_tests" make-flags))))))
5162 `(("dune-common" ,dune-common)
5164 ("openblas" ,openblas)
5166 ("python" ,python)))
5168 `(("gfortran" ,gfortran)
5169 ("pkg-config" ,pkg-config)))
5170 (home-page "https://dune-project.org/")
5171 (synopsis "Distributed and Unified Numerics Environment")
5172 (description "DUNE, the Distributed and Unified Numerics Environment is a
5173 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5174 grid-based methods. It supports the easy implementation of methods like
5175 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5178 This package contains the basic DUNE geometry classes.")
5179 ;; GPL version 2 with "runtime exception"
5180 (license license:gpl2)))
5182 (define-public dune-uggrid
5184 (name "dune-uggrid")
5190 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5191 (commit (string-append "v" version))))
5192 (file-name (git-file-name name version))
5195 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5196 (build-system cmake-build-system)
5199 (modify-phases %standard-phases
5200 (add-after 'build 'build-tests
5201 (lambda* (#:key make-flags #:allow-other-keys)
5202 (apply invoke "make" "build_tests" make-flags))))))
5204 `(("dune-common" ,dune-common)))
5206 `(("gfortran" ,gfortran)
5207 ("pkg-config" ,pkg-config)))
5208 (home-page "https://dune-project.org/")
5209 (synopsis "Distributed and Unified Numerics Environment")
5210 (description "DUNE, the Distributed and Unified Numerics Environment is a
5211 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5212 grid-based methods. It supports the easy implementation of methods like
5213 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5216 This package contains the DUNE UG grid classes.")
5217 (license license:lgpl2.1)))
5219 (define-public dune-grid
5226 (uri (string-append "https://dune-project.org/download/"
5227 version "/dune-grid-" version ".tar.gz"))
5230 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5231 (build-system cmake-build-system)
5234 (modify-phases %standard-phases
5235 (add-after 'build 'build-tests
5236 (lambda* (#:key make-flags #:allow-other-keys)
5237 (apply invoke "make" "build_tests" make-flags))))))
5239 `(("dune-common" ,dune-common)
5240 ("dune-geometry" ,dune-geometry)
5243 ("openblas" ,openblas)
5244 ("python" ,python)))
5246 `(("dune-uggrid" ,dune-uggrid)))
5248 `(("gfortran" ,gfortran)
5249 ("pkg-config" ,pkg-config)))
5250 (home-page "https://dune-project.org/")
5251 (synopsis "Distributed and Unified Numerics Environment")
5252 (description "DUNE, the Distributed and Unified Numerics Environment is a
5253 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5254 grid-based methods. It supports the easy implementation of methods like
5255 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5258 This package contains the basic DUNE grid classes.")
5259 ;; GPL version 2 with "runtime exception"
5260 (license license:gpl2)))
5262 (define-public dune-istl
5269 (uri (string-append "https://dune-project.org/download/"
5270 version "/dune-istl-" version ".tar.gz"))
5273 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5274 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5275 (build-system cmake-build-system)
5278 (modify-phases %standard-phases
5279 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5280 ;; the stdlib types when the gfortran header is used. Remove gfortran
5281 ;; from CPLUS_INCLUDE_PATH as a workaround.
5282 (add-after 'set-paths 'hide-gfortran
5283 (lambda* (#:key inputs #:allow-other-keys)
5284 (let ((gfortran (assoc-ref inputs "gfortran")))
5285 (setenv "CPLUS_INCLUDE_PATH"
5287 (delete (string-append gfortran "/include/c++")
5288 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5291 (add-after 'build 'build-tests
5292 (lambda* (#:key make-flags #:allow-other-keys)
5293 (apply invoke "make" "build_tests" make-flags))))))
5295 `(("dune-common" ,dune-common)
5298 ("suitesparse" ,suitesparse)
5299 ("superlu" ,superlu)
5300 ("openblas" ,openblas)
5302 ("python" ,python)))
5304 `(("gfortran" ,gfortran)
5305 ("pkg-config" ,pkg-config)))
5306 (home-page "https://dune-project.org/")
5307 (synopsis "Distributed and Unified Numerics Environment")
5308 (description "DUNE, the Distributed and Unified Numerics Environment is a
5309 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5312 This is the iterative solver template library which provides generic sparse
5313 matrix/vector classes and a variety of solvers based on these classes. A
5314 special feature is the use of templates to exploit the recursive block
5315 structure of finite element matrices at compile time. Available solvers
5316 include Krylov methods, (block-) incomplete decompositions and
5317 aggregation-based algebraic multigrid.")
5318 ;; GPL version 2 with "runtime exception"
5319 (license license:gpl2)))
5321 (define-public dune-localfunctions
5323 (name "dune-localfunctions")
5328 (uri (string-append "https://dune-project.org/download/"
5329 version "/dune-localfunctions-" version ".tar.gz"))
5332 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5333 (build-system cmake-build-system)
5336 (modify-phases %standard-phases
5337 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5338 ;; and fails to find the stdlib types when the gfortran header is used.
5339 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5340 (add-after 'set-paths 'hide-gfortran
5341 (lambda* (#:key inputs #:allow-other-keys)
5342 (let ((gfortran (assoc-ref inputs "gfortran")))
5343 (setenv "CPLUS_INCLUDE_PATH"
5345 (delete (string-append gfortran "/include/c++")
5346 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5349 (add-after 'build 'build-tests
5350 (lambda* (#:key make-flags #:allow-other-keys)
5351 (apply invoke "make" "build_tests" make-flags))))))
5353 `(("dune-common" ,dune-common)
5354 ("dune-geometry" ,dune-geometry)
5357 ("superlu" ,superlu)
5360 `(("gfortran" ,gfortran)
5361 ("pkg-config" ,pkg-config)))
5362 (home-page "https://dune-project.org/")
5363 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5364 (description "This DUNE module provides interface and implementation for
5365 shape functions defined on the DUNE reference elements. In addition to the
5366 shape function, interpolation operators and special keys are provided which
5367 can be used to assemble global function spaces on finite-element grids.
5369 This package provides an interface and implementation for shape functions
5370 defined on the DUNE reference elements. In addition to the shape function,
5371 interpolation operators and special keys are provided which can be used to
5372 assemble global function spaces on finite-element grids.")
5373 ;; GPL version 2 with "runtime exception"
5374 (license license:gpl2)))
5376 (define-public dune-alugrid
5378 (name "dune-alugrid")
5379 (version "2.7.0-git-81d35682")
5384 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5385 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5386 (file-name (git-file-name name version))
5389 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5390 (build-system cmake-build-system)
5393 (modify-phases %standard-phases
5394 (add-after 'unpack 'patch-include
5396 (substitute* "dune/alugrid/test/test-alugrid.cc"
5397 (("doc/grids/gridfactory/testgrids")
5398 "doc/dune-grid/grids/gridfactory/testgrids"))
5400 (add-after 'build 'build-tests
5401 (lambda* (#:key inputs make-flags #:allow-other-keys)
5402 (setenv "CPLUS_INCLUDE_PATH"
5403 (string-append (assoc-ref inputs "dune-grid") "/share"))
5404 (apply invoke "make" "build_tests" make-flags))))))
5406 `(("dune-common" ,dune-common)
5407 ("dune-geometry" ,dune-geometry)
5408 ("dune-grid" ,dune-grid)
5411 ("openblas" ,openblas)
5413 ("superlu" ,superlu)
5417 `(("gfortran" ,gfortran)
5418 ("pkg-config" ,pkg-config)))
5419 (home-page "https://dune-project.org/")
5420 (synopsis "Distributed and Unified Numerics Environment")
5421 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5422 implementation of the DUNE grid interface supporting either simplices or
5424 (license license:gpl2+)))
5426 (define-public dune-subgrid
5428 (name "dune-subgrid")
5429 (version "2.7.0-git-2103a363")
5434 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5435 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5436 (file-name (git-file-name name version))
5439 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5440 (build-system cmake-build-system)
5443 (modify-phases %standard-phases
5444 (add-after 'build 'build-tests
5445 (lambda* (#:key make-flags #:allow-other-keys)
5446 (apply invoke "make" "build_tests" make-flags))))))
5448 `(("dune-common" ,dune-common)
5449 ("dune-geometry" ,dune-geometry)
5450 ("dune-grid" ,dune-grid)
5453 ("openblas" ,openblas)
5456 `(("gfortran" ,gfortran)
5457 ("pkg-config" ,pkg-config)))
5458 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5459 (synopsis "Distributed and Unified Numerics Environment")
5460 (description "The dune-subgrid module marks elements of
5461 another hierarchical dune grid. The set of marked elements can then be
5462 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5463 provides the full grid interface including adaptive mesh refinement.")
5464 (license license:gpl2+)))
5466 (define-public dune-typetree
5468 (name "dune-typetree")
5474 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5475 (commit (string-append "v" version))))
5476 (file-name (git-file-name name version))
5479 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5480 (build-system cmake-build-system)
5483 (modify-phases %standard-phases
5484 (add-after 'build 'build-tests
5485 (lambda* (#:key make-flags #:allow-other-keys)
5486 (apply invoke "make" "build_tests" make-flags))))))
5488 `(("dune-common" ,dune-common)
5490 ("openblas" ,openblas)
5493 ("superlu" ,superlu)
5496 `(("gfortran" ,gfortran)
5497 ("pkg-config" ,pkg-config)))
5498 (home-page "https://dune-project.org/")
5499 (synopsis "Distributed and Unified Numerics Environment")
5500 (description "TypeTree is a template library for constructing and
5501 operating on statically typed trees of objects.")
5502 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5503 (license (list license:lgpl3+ license:gpl2))))
5505 (define-public dune-functions
5507 (name "dune-functions")
5513 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5514 (commit (string-append "v" version))))
5515 (file-name (git-file-name name version))
5518 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5519 (build-system cmake-build-system)
5522 (modify-phases %standard-phases
5523 (add-after 'unpack 'disable-failing-tests
5526 ;; unable to load GMSH file in this test
5527 "--exclude-regex gridviewfunctionspacebasistest")
5529 (add-after 'build 'build-tests
5530 (lambda* (#:key make-flags #:allow-other-keys)
5531 (apply invoke "make" "build_tests" make-flags))))))
5533 `(("dune-common" ,dune-common)
5534 ("dune-istl" ,dune-istl)
5535 ("dune-localfunctions" ,dune-localfunctions)
5536 ("dune-grid" ,dune-grid)
5537 ("dune-geometry" ,dune-geometry)
5538 ("dune-typetree" ,dune-typetree)
5539 ("openblas" ,openblas)
5542 ("superlu" ,superlu)
5545 `(("gfortran" ,gfortran)
5546 ("pkg-config" ,pkg-config)))
5547 (home-page "https://dune-project.org/")
5548 (synopsis "Distributed and Unified Numerics Environment")
5549 (description "The dune-functions module provides an abstraction layer for
5550 global finite element functions. Its two main concepts are functions
5551 implemented as callable objects, and bases of finite element spaces.")
5552 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5553 (license (list license:lgpl3+ license:gpl2))))
5555 (define-public dune-pdelab
5557 (name "dune-pdelab")
5558 (version "2.7.0-git-476fe437")
5563 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5564 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5565 (file-name (git-file-name name version))
5568 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5569 (build-system cmake-build-system)
5570 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5572 `(("dune-common" ,dune-common)
5573 ("dune-istl" ,dune-istl)
5574 ("dune-localfunctions" ,dune-localfunctions)
5575 ("dune-geometry" ,dune-geometry)
5576 ("dune-grid" ,dune-grid)
5577 ("dune-typetree" ,dune-typetree)
5578 ("dune-functions" ,dune-functions)
5580 ("openblas" ,openblas)
5584 ("superlu" ,superlu)
5587 `(("gfortran" ,gfortran)
5588 ("pkg-config" ,pkg-config)))
5589 (home-page "https://dune-project.org/")
5590 (synopsis "Differential equations solver toolbox")
5591 (description "PDELab is a partial differential equations solver toolbox
5592 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5593 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5594 (license (list license:lgpl3+ license:gpl2))))
5596 (define add-openmpi-to-dune-package
5597 (let ((dune-package?
5598 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5601 (if (dune-package? p)
5602 (package (inherit p)
5603 (name (string-append (package-name p) "-openmpi"))
5604 (inputs `(,@(package-inputs p)
5605 ("openmpi" ,openmpi)))
5607 (substitute-keyword-arguments (package-arguments p)
5608 ((#:phases phases '%standard-phases)
5609 `(modify-phases ,phases
5610 (add-before 'check 'mpi-setup
5611 ,%openmpi-setup)))))
5612 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5614 (negate dune-package?))))
5616 (define-public dune-common-openmpi
5617 (add-openmpi-to-dune-package dune-common))
5619 (define-public dune-geometry-openmpi
5620 (add-openmpi-to-dune-package dune-geometry))
5622 (define-public dune-istl-openmpi
5623 (add-openmpi-to-dune-package dune-istl))
5625 (define-public dune-typetree-openmpi
5626 (add-openmpi-to-dune-package dune-typetree))
5628 (define-public dune-uggrid-openmpi
5629 (add-openmpi-to-dune-package dune-uggrid))
5631 (define-public dune-grid-openmpi
5632 (add-openmpi-to-dune-package dune-grid))
5634 (define-public dune-alugrid-openmpi
5635 (add-openmpi-to-dune-package dune-alugrid))
5637 (define-public dune-subgrid-openmpi
5638 (add-openmpi-to-dune-package dune-subgrid))
5640 (define-public dune-localfunctions-openmpi
5641 (add-openmpi-to-dune-package dune-localfunctions))
5643 (define-public dune-functions-openmpi
5644 (add-openmpi-to-dune-package dune-functions))
5646 (define-public dune-pdelab-openmpi
5647 (add-openmpi-to-dune-package dune-pdelab))
5649 (define-public mlucas
5657 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5659 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5660 (build-system gnu-build-system)
5662 `(("python2" ,python-2)))
5664 `(#:tests? #f ; no tests
5666 (modify-phases %standard-phases
5670 (call-with-output-file "Makefile"
5672 (format port "CC = gcc
5673 CFLAGS = -O3 ~a -DUSE_THREADS
5674 LDLIBS = -lm -lpthread -lrt
5675 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5677 ,(let ((system (or (%current-target-system)
5678 (%current-system))))
5680 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5684 (lambda* (#:key outputs #:allow-other-keys)
5685 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5686 (install-file "Mlucas" bin)
5687 (install-file "primenet.py" bin))
5689 (home-page "https://www.mersenne.org")
5690 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5691 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5692 numbers in search of a world-record prime. You may use it to test any
5693 suitable number as you wish, but it is preferable that you do so in a
5694 coordinated fashion, as part of the Great Internet Mersenne Prime
5695 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5696 management via the GIMPS project's Primenet server.")
5697 (license license:gpl2+)))
5699 (define-public nauty
5707 "https://pallini.di.uniroma1.it/"
5708 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5710 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5711 (build-system gnu-build-system)
5712 (outputs '("out" "lib"))
5714 `(#:test-target "checks"
5715 #:configure-flags '("--enable-generic") ;prevent -march-native
5717 (modify-phases %standard-phases
5718 ;; Default make target does not build all available
5719 ;; executables. Create them now.
5720 (add-after 'build 'build-extra-programs
5722 (for-each (lambda (target) (invoke "make" target))
5723 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5725 ;; Upstream does not provide any install target.
5727 (lambda* (#:key outputs #:allow-other-keys)
5728 (let* ((out (assoc-ref outputs "out"))
5729 (lib-output (assoc-ref outputs "lib"))
5730 (bin (string-append out "/bin"))
5731 (doc (string-append out "/share/doc/nauty/"))
5732 (include (string-append lib-output "/include/nauty"))
5733 (lib (string-append lib-output "/lib/nauty")))
5734 (for-each (lambda (f) (install-file f bin))
5735 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5736 "bliss2dre" "catg" "checks6" "complg" "converseg"
5737 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5738 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5739 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5740 "gentourng" "gentreeg" "hamheuristic" "labelg"
5741 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5742 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5743 "sumlines" "twohamg" "underlyingg" "vcolg"
5744 "watercluster2" "NRswitchg"))
5745 (for-each (lambda (f) (install-file f include))
5746 (find-files "." "\\.h$"))
5747 (for-each (lambda (f) (install-file f lib))
5748 (find-files "." "\\.a$"))
5749 (for-each (lambda (f) (install-file f doc))
5750 (append '("formats.txt" "README" "schreier.txt")
5751 (find-files "." "\\.pdf$")))))))))
5753 `(("gmp" ,gmp))) ;for sumlines
5754 (home-page "https://pallini.di.uniroma1.it/")
5755 (synopsis "Library for graph automorphisms")
5756 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5757 procedures for computing automorphism groups of graphs and digraphs.
5759 @code{nauty} computes graph information in the form of a set of
5760 generators, the size of the group, and the orbits of the group; it can
5761 also produce a canonical label. The @code{nauty} suite is written in
5762 C and comes with a command-line interface, a collection of
5763 command-line tools, and an Application Programming Interface (API).
5765 This package provides the static libraries required to run programs
5766 compiled against the nauty library.")
5767 (license license:asl2.0)))
5776 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5777 "ftp/releases/" version
5778 "/ppl-" version ".tar.gz"))
5781 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5782 (build-system gnu-build-system)
5788 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5790 "Parma Polyhedra Library for computations with polyhedra")
5792 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5793 especially targeted at applications in the field of analysis and
5794 verification of complex systems. These abstractions include convex
5795 polyhedra, defined as the intersection of a finite number of (open or
5796 closed) halfspaces, each described by a linear inequality (strict or
5797 non-strict) with rational coefficients; some special classes of polyhedra
5798 shapes that offer interesting complexity/precision tradeoffs; and grids
5799 which represent regularly spaced points that satisfy a set of linear
5800 congruence relations. The library also supports finite powersets and
5801 products of (any kind of) polyhedra and grids, a mixed integer linear
5802 programming problem solver using an exact-arithmetic version of the simplex
5803 algorithm, a parametric integer programming solver, and primitives for
5804 termination analysis via the automatic synthesis of linear ranking
5806 (license license:gpl3+)))
5808 (define-public speedcrunch
5810 (name "speedcrunch")
5816 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5817 (commit (string-append "release-" version))))
5818 (file-name (git-file-name name version))
5821 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5822 (build-system cmake-build-system)
5823 (inputs `(("qtbase" ,qtbase)))
5824 (native-inputs `(("qttools" ,qttools)))
5827 (modify-phases %standard-phases
5828 (add-after 'unpack 'chdir-to-src
5829 (lambda _ (chdir "src") #t)))))
5830 (synopsis "High-precision scientific calculator")
5832 "SpeedCrunch is a high-precision scientific calculator. It features a
5833 syntax-highlighted scrollable display and is designed to be fully used via
5834 keyboard. Some distinctive features are auto-completion of functions and
5835 variables, a formula book, and quick insertion of constants from various
5836 fields of knowledge.")
5837 (home-page "https://speedcrunch.org/")
5838 (license license:gpl2+)))
5840 (define-public minisat
5841 ;; This is the last commit which is available upstream, no
5842 ;; release happened since 2010.
5843 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5847 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5852 (url "https://github.com/niklasso/minisat")
5854 (file-name (string-append name "-" version "-checkout"))
5857 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5859 (search-patches "minisat-friend-declaration.patch"
5860 "minisat-install.patch"))))
5861 (build-system gnu-build-system)
5863 '(#:make-flags (list (string-append "prefix=" %output))
5864 #:tests? #f ;no check target
5866 (modify-phases %standard-phases
5867 (delete 'configure))))
5869 `(("zlib:static" ,zlib "static")
5872 "Small, yet efficient, SAT solver")
5874 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5875 researchers and developers alike to get started on SAT.")
5877 "http://minisat.se/MiniSat.html")
5878 (license license:expat))))
5880 (define-public libqalculate
5882 (name "libqalculate")
5888 (url "https://github.com/Qalculate/libqalculate/")
5889 (commit (string-append "v" version))))
5890 (file-name (git-file-name name version))
5892 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5894 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5895 (build-system gnu-build-system)
5897 `(("pkg-config" ,pkg-config)
5898 ("gettext" ,gettext-minimal)
5899 ("intltool" ,intltool)
5900 ("automake" ,automake)
5901 ("autoconf" ,autoconf)
5902 ("libtool" ,libtool)
5903 ("doxygen" ,doxygen)
5908 ("libxml2" ,libxml2)
5911 ("gnuplot" ,gnuplot)
5912 ("readline" ,readline)
5913 ("libiconv" ,libiconv)))
5916 (modify-phases %standard-phases
5917 (add-before 'bootstrap 'setenv
5918 ;; Prevent the autogen.sh script to carry out the configure
5919 ;; script, which has not yet been patched to replace /bin/sh.
5921 (setenv "NOCONFIGURE" "TRUE")
5923 (home-page "https://qalculate.github.io/")
5924 (synopsis "Multi-purpose cli desktop calculator and library")
5926 "Libqalculate is a multi-purpose cli desktop calculator and library.
5927 It provides basic and advanced functionality. Features include customizable
5928 functions, unit calculations, and conversions, physical constants, symbolic
5929 calculations (including integrals and equations), arbitrary precision,
5930 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5932 (license license:gpl2+)))
5934 (define-public qalculate-gtk
5936 (name "qalculate-gtk")
5942 (url "https://github.com/Qalculate/qalculate-gtk/")
5943 (commit (string-append "v" version))))
5944 (file-name (git-file-name name version))
5946 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5947 (build-system glib-or-gtk-build-system)
5949 `(("pkg-config" ,pkg-config)
5950 ("intltool" ,intltool)
5951 ("automake" ,automake)
5952 ("autoconf" ,autoconf)
5953 ("libtool" ,libtool)
5958 ("libqalculate" ,libqalculate)
5959 ("libxml2" ,libxml2)
5964 (modify-phases %standard-phases
5965 (add-before 'bootstrap 'setenv
5966 ;; Prevent the autogen.sh script to carry out the configure
5967 ;; script, which has not yet been patched to replace /bin/sh.
5969 (setenv "NOCONFIGURE" "TRUE")
5971 (add-before 'check 'add-pot-file
5972 ;; the file contains translations and are currently not in use
5973 ;; left out on purpose so add it to POTFILES.skip
5975 (with-output-to-file "po/POTFILES.skip"
5977 (format #t "data/shortcuts.ui~%")
5980 (home-page "https://qalculate.github.io/")
5981 (synopsis "Multi-purpose graphical desktop calculator")
5983 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5984 multi-purpose GUI desktop calculator. It provides basic and advanced
5985 functionality. Features include customizable functions, unit calculations,
5986 and conversions, physical constants, symbolic calculations (including
5987 integrals and equations), arbitrary precision, uncertainty propagation,
5988 interval arithmetic, plotting.")
5989 (license license:gpl2+)))