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, 2021 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 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 llvm)
108 #:use-module (gnu packages logging)
109 #:use-module (gnu packages lua)
110 #:use-module (gnu packages gnome)
111 #:use-module (gnu packages guile)
112 #:use-module (gnu packages xorg)
113 #:use-module (gnu packages gl)
114 #:use-module (gnu packages imagemagick)
115 #:use-module (gnu packages m4)
116 #:use-module (gnu packages mpi)
117 #:use-module (gnu packages multiprecision)
118 #:use-module (gnu packages netpbm)
119 #:use-module (gnu packages onc-rpc)
120 #:use-module (gnu packages pcre)
121 #:use-module (gnu packages popt)
122 #:use-module (gnu packages perl)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages pulseaudio)
125 #:use-module (gnu packages python)
126 #:use-module (gnu packages python-web)
127 #:use-module (gnu packages python-xyz)
128 #:use-module (gnu packages qt)
129 #:use-module (gnu packages readline)
130 #:use-module (gnu packages ruby)
131 #:use-module (gnu packages tbb)
132 #:use-module (gnu packages scheme)
133 #:use-module (gnu packages shells)
134 #:use-module (gnu packages tcl)
135 #:use-module (gnu packages texinfo)
136 #:use-module (gnu packages tex)
137 #:use-module (gnu packages tls)
138 #:use-module (gnu packages version-control)
139 #:use-module (gnu packages wxwidgets)
140 #:use-module (gnu packages xml)
141 #:use-module (srfi srfi-1)
142 #:use-module (srfi srfi-26))
150 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
152 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
153 (build-system gnu-build-system)
154 (inputs `(("gtk+" ,gtk+)
155 ("libxml2" ,libxml2)))
156 (native-inputs `(("pkg-config" ,pkg-config)))
157 (synopsis "Natural deduction first-order logic interface")
158 (description "Aris is a program for performing logical proofs. It supports
159 propositional and predicate logic, as well as Boolean algebra and
160 arithmetical logic. In addition to its predefined inference and equivalence
161 rules, Aris also supports references to older proofs. Its use of standard
162 logical symbols and its natural deduction interface make it easy to use for
164 (license license:gpl3+)
165 (home-page "https://www.gnu.org/software/aris/")))
167 (define-public c-graph
173 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
176 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
177 (build-system gnu-build-system)
179 `(("fortran" ,gfortran)))
180 (synopsis "Visualizing and demonstrating convolution")
182 "GNU C-Graph is a tool for demonstrating the theory of convolution.
183 Thus, it can serve as an excellent aid to students of signal and systems
184 theory in visualizing the convolution process. Rather than forcing the
185 student to write code, the program offers an intuitive interface with
186 interactive dialogs to guide them.")
187 (license license:gpl3+)
188 (home-page "https://www.gnu.org/software/c-graph/")))
197 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
198 version "/coda-" version ".tar.gz"))
200 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
201 (patches (search-patches "coda-use-system-libs.patch"))
202 (modules '((guix build utils)))
204 ;; Make sure we don't use the bundled software.
206 (for-each (lambda (d)
207 (delete-file-recursively (string-append "libcoda/" d)))
208 '("zlib" "pcre" "expat"))
211 `(("fortran" ,gfortran)
213 ("python-numpy" ,python-numpy)))
220 (build-system gnu-build-system)
222 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
223 "LIBS= -lz -lpcre -lexpat")))
224 (synopsis "A common interface to various earth observation data formats")
226 "The Common Data Access toolbox (CODA) provides a set of interfaces for
227 reading remote sensing data from earth observation data files. It consists of
228 command line applications and interfaces to the C, Fortran, Python, and Java
229 programming languages.")
230 (home-page "https://stcorp.nl/coda")
231 (license license:gpl2+)))
239 (uri (string-append "http://www.qhull.org/download/qhull-"
240 (car (string-split version #\.))
244 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
245 (build-system cmake-build-system)
246 (synopsis "Calculate convex hulls and related structures")
248 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
249 diagram, halfspace intersection about a point, furthest-site Delaunay
250 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
251 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
252 algorithm for computing the convex hull. It handles roundoff errors from
253 floating point arithmetic. It computes volumes, surface areas, and
254 approximations to the convex hull.
256 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
257 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
258 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
260 (home-page "http://qhull.org")
261 (license (license:non-copyleft "file://COPYING.txt"
262 "See COPYING in the distribution."))))
264 (define-public python-cvxopt
266 (name "python-cvxopt")
271 (url "https://github.com/cvxopt/cvxopt")
273 (file-name (git-file-name name version))
276 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
277 (build-system python-build-system)
280 (modify-phases %standard-phases
281 (add-after 'unpack 'find-libraries
282 (lambda* (#:key inputs #:allow-other-keys)
283 (setenv "CVXOPT_BLAS_LIB" "openblas")
284 (setenv "CVXOPT_BUILD_FFTW" "1")
285 (setenv "CVXOPT_BUILD_GLPK" "1")
286 (setenv "CVXOPT_BUILD_GSL" "1")
293 ("openblas" ,openblas)
294 ("suitesparse" ,suitesparse)))
295 (home-page "https://www.cvxopt.org")
296 (synopsis "Python library for convex optimization")
298 "CVXOPT is a package for convex optimization based on the Python
299 programming language. Its main purpose is to make the development of software
300 for convex optimization applications straightforward by building on Python’s
301 extensive standard library and on the strengths of Python as a high-level
302 programming language.")
303 (license license:gpl3+)))
305 (define-public python2-cvxopt
306 (package-with-python2 python-cvxopt))
314 (uri (string-append "mirror://gnu/units/units-" version
317 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
318 (build-system gnu-build-system)
320 `(("readline" ,readline)
321 ("python" ,python-wrapper) ;for 'units_cur' script
322 ("python-requests" ,python-requests)))
324 `(#:phases (modify-phases %standard-phases
325 (add-after 'install 'wrap-units_cur
326 (lambda* (#:key outputs #:allow-other-keys)
327 (let* ((out (assoc-ref outputs "out"))
328 (bin (string-append out "/bin")))
329 (wrap-program (string-append bin "/units_cur")
330 `("PYTHONPATH" ":" prefix
331 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
333 (synopsis "Conversion between thousands of scales")
335 "GNU Units converts numeric quantities between units of measure. It
336 can handle scale changes through adaptive usage of standard scale
337 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
338 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
339 enough to be used effectively as a scientific calculator.")
340 (license license:gpl3+)
341 (home-page "https://www.gnu.org/software/units/")))
343 (define-public double-conversion
345 (name "double-conversion")
347 (home-page "https://github.com/google/double-conversion")
350 (uri (git-reference (url home-page)
351 (commit (string-append "v" version))))
352 (file-name (git-file-name name version))
355 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
356 (build-system cmake-build-system)
358 '(#:test-target "test"
359 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
360 "-DBUILD_TESTING=ON")))
361 (synopsis "Conversion routines for IEEE doubles")
363 "The double-conversion library provides binary-decimal and decimal-binary
364 routines for IEEE doubles. The library consists of efficient conversion
365 routines that have been extracted from the V8 JavaScript engine.")
366 (license license:bsd-3)))
368 (define-public dionysus
374 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
378 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
379 (build-system gnu-build-system)
380 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
381 (synopsis "Local search for universal constants and scientific values")
383 "GNU Dionysus is a convenient system for quickly retrieving the values of
384 mathematical constants used in science and engineering. Values can be
385 searched using a simple command-line tool, choosing from three databases:
386 universal constants, atomic numbers, and constants related to
388 (license license:gpl3+)
389 (home-page "https://www.gnu.org/software/dionysus/")))
400 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
401 "dSFMT-src-" version ".tar.gz"))
404 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
405 (modules '((guix build utils)))
406 ;; Don't distribute html documentation with bundled jquery.
409 (delete-file-recursively "html") #t))
410 ;; Add patches borrowed from Julia.
416 "https://raw.githubusercontent.com/JuliaLang/julia/"
417 "v1.3.0/deps/patches/dSFMT.c.patch"))
419 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
420 (file-name "dSFMT.c.patch"))
424 "https://raw.githubusercontent.com/JuliaLang/julia/"
425 "v1.3.0/deps/patches/dSFMT.h.patch"))
427 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
428 (file-name "dSFMT.h.patch"))))))
429 (build-system gnu-build-system)
432 (modify-phases %standard-phases
433 (delete 'configure) ; no configure script
435 ;; Upstream Makefile does not build a shared library. Borrow from Julia
436 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
439 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
440 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
441 "-O3" "-finline-functions" "-fomit-frame-pointer"
442 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
443 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
444 "-o" "libdSFMT.so")))
445 (replace 'install ; no "install" target
446 (lambda* (#:key outputs #:allow-other-keys)
447 (let* ((out (assoc-ref outputs "out"))
448 (lib (string-append out "/lib"))
449 (inc (string-append out "/include"))
450 (doc (string-append out "/share/doc/" ,name "-" ,version)))
451 (install-file "libdSFMT.so" lib)
452 (install-file "dSFMT.h" inc)
453 (install-file "LICENSE.txt" doc)
455 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
457 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
458 the expensive conversion of integer to double (floating point). dSFMT directly
459 generates double precision floating point pseudorandom numbers which have the
460 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
461 format. dSFMT is only available on the CPUs which use IEEE 754 format double
462 precision floating point numbers.")
463 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
464 (license license:bsd-3)))
472 (uri (string-append "mirror://gnu/gsl/gsl-"
476 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
477 (build-system gnu-build-system)
479 (let ((system (%current-system)))
481 ((or (string-prefix? "aarch64" system)
482 (string-prefix? "powerpc" system))
483 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
484 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
485 '(#:phases (modify-phases %standard-phases
486 (add-before 'check 'disable-failing-tests
488 (substitute* "spmatrix/test.c"
489 ((".*test_complex.*") "\n"))
491 ((string-prefix? "i686" system)
492 ;; There are rounding issues with these tests on i686:
493 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
494 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
495 '(#:phases (modify-phases %standard-phases
496 (add-before 'check 'disable-failing-tests
498 (substitute* "linalg/test.c"
499 ((".*gsl_test\\(test_LU_decomp.*") "\n")
500 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
501 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
502 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
503 (substitute* "spmatrix/test.c"
504 ((".*test_all.*") "\n")
505 ((".*test_float.*") "\n")
506 ((".*test_complex.*") "\n"))
509 (home-page "https://www.gnu.org/software/gsl/")
510 (synopsis "Numerical library for C and C++")
512 "The GNU Scientific Library is a library for numerical analysis in C
513 and C++. It includes a wide range of mathematical routines, with over 1000
514 functions in total. Subject areas covered by the library include:
515 differential equations, linear algebra, Fast Fourier Transforms and random
517 (license license:gpl3+)))
527 (url "https://github.com/shibatch/sleef")
529 (file-name (git-file-name name version))
531 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
532 (build-system cmake-build-system)
534 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
535 (string-append "-DCMAKE_INSTALL_LIBDIR="
536 (assoc-ref %outputs "out")
538 (string-append "-DCMAKE_INSTALL_PREFIX="
539 (assoc-ref %outputs "out")))
541 (modify-phases %standard-phases
542 ;; SLEEF generates a header library during the build process and writes
543 ;; to it via shell redirection. Make the checkout writable so the
544 ;; build can succeed.
545 (add-after 'unpack 'make-git-checkout-writable
547 (for-each make-file-writable (find-files "."))
553 ("openssl" ,openssl)))
554 (home-page "https://sleef.org/")
555 (synopsis "SIMD library for evaluating elementary functions and DFT")
557 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
558 implements vectorized versions of all C99 real floating point math functions.
559 It can utilize SIMD instructions that are available on modern processors.")
560 (license (list license:boost1.0 ;sleef
561 license:cc-by4.0)))) ;simplex algorithm
570 (uri (string-append "mirror://gnu/glpk/glpk-"
574 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
575 (build-system gnu-build-system)
579 `(#:configure-flags '("--with-gmp"
580 "--disable-static")))
581 (home-page "https://www.gnu.org/software/glpk/")
582 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
584 "GLPK is a C library for solving large-scale linear programming (LP),
585 mixed integer programming (MIP), and other related problems. It supports the
586 GNU MathProg modeling language, a subset of the AMPL language, and features a
587 translator for the language. In addition to the C library, a stand-alone
588 LP/MIP solver is included in the package.")
589 (license license:gpl3+)))
591 (define-public glpk-4
599 (uri (string-append "mirror://gnu/glpk/glpk-"
603 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
612 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
614 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
616 "/4ti2-" version ".tar.gz"))
618 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
619 (build-system gnu-build-system)
621 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
625 (home-page "http://www.4ti2.de/")
626 (synopsis "Mathematical tool suite for problems on linear spaces")
628 "4ti2 implements algorithms for solving algebraic, geometric and
629 combinatorial problems on linear spaces. Among others, it solves systems
630 of linear equations, computes extreme rays of polyhedral cones, solves
631 integer programming problems and computes Markov bases for statistics.")
632 (license license:gpl2+)))
634 (define-public cddlib
641 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
642 (string-delete #\. version) ".tar.gz"))
645 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
646 (build-system gnu-build-system)
649 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
650 (synopsis "Library for convex hulls and extreme rays of polyhedra")
652 "The C-library cddlib implements the Double Description Method of
653 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
654 rays of a general convex polyhedron given by a system of linear inequalities
655 in arbitrary dimension. It can also be used for the converse operation of
656 computing convex hulls.")
657 (license license:gpl2+)))
659 (define-public lrslib
666 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
668 (string-delete #\. version) ".tar.gz"))
671 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
672 (build-system gnu-build-system)
676 `(#:tests? #f ; no check phase
677 #:make-flags `("CC=gcc"
678 ,(string-append "prefix=" (assoc-ref %outputs "out"))
681 (modify-phases %standard-phases
684 (substitute* "makefile"
685 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
687 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
688 (synopsis "Convex hulls of polyhedra with exact arithmetic")
690 "The C code of lrslib implements the reverse search algorithm for
691 vertex enumeration and convex hull problems. Its input file format is
692 compatible with cddlib. All computations are done exactly in either
693 multiple precision or fixed integer arithmetic. Output is not stored
694 in memory, so even problems with very large output sizes can sometimes
696 (license license:gpl2+)))
705 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
706 "vinci/vinci-" version ".tar.gz"))
709 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
710 (build-system gnu-build-system)
712 `(("lrslib" ,lrslib)))
714 `(#:tests? #f ; no check phase
716 (modify-phases %standard-phases
718 ;; register the lrs location in the config file
719 (lambda* (#:key inputs #:allow-other-keys)
720 (let* ((lrs (assoc-ref inputs "lrslib"))
721 (lrsexec (string-append lrs "/bin/lrs")))
722 (substitute* "vinci.h"
723 (("#define LRS_EXEC \"lrs\"")
724 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
727 (lambda* (#:key outputs #:allow-other-keys)
728 (let* ((out (assoc-ref outputs "out"))
729 (bin (string-append out "/bin")))
730 (install-file "vinci" bin))
733 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
734 (synopsis "Volume computation for polytopes")
736 "Vinci implements a number of volume computation algorithms for convex
737 polytopes in arbitrary dimension. The polytopes can be given by their
738 V-representation (as the convex hull of a finite number of vertices), by
739 their H-representation (as the bounded intersection of a finite number of
740 halfspaces) or by their double description with both representations.")
741 (license license:gpl2+)))
743 (define-public arpack-ng
747 (home-page "https://github.com/opencollab/arpack-ng")
750 (uri (git-reference (url home-page) (commit version)))
751 (file-name (git-file-name name version))
754 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
755 (build-system gnu-build-system)
757 `(("autoconf" ,autoconf)
758 ("automake" ,automake)
759 ("libtool" ,libtool)))
762 ("fortran" ,gfortran)))
763 (synopsis "Fortran subroutines for solving eigenvalue problems")
765 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
766 large scale eigenvalue problems.")
767 (license (license:non-copyleft "file://COPYING"
768 "See COPYING in the distribution."))))
770 (define-public arpack-ng-3.3.0
774 (name (package-name arpack-ng))
775 (home-page (package-home-page arpack-ng))
779 (uri (string-append home-page "/archive/" version ".tar.gz"))
780 (file-name (string-append name "-" version ".tar.gz"))
783 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
785 (define-public arpack-ng-openmpi
786 (package (inherit arpack-ng)
787 (name "arpack-ng-openmpi")
790 ,@(package-inputs arpack-ng)))
792 (substitute-keyword-arguments (package-arguments arpack-ng)
793 ((#:configure-flags _ '())
795 ((#:phases phases '%standard-phases)
796 `(modify-phases ,phases
797 (add-before 'check 'mpi-setup
799 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
801 (define-public lapack
808 (uri (string-append "http://www.netlib.org/lapack/lapack-"
812 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
813 (build-system cmake-build-system)
814 (home-page "http://www.netlib.org/lapack/")
815 (inputs `(("fortran" ,gfortran)
816 ("python" ,python-wrapper)))
818 `(#:configure-flags (list
819 "-DBUILD_SHARED_LIBS:BOOL=YES"
821 ;; Build the 'LAPACKE_clatms' functions.
822 "-DLAPACKE_WITH_TMG=ON"
823 "-DBUILD_TESTING=ON")))
824 (synopsis "Library for numerical linear algebra")
826 "LAPACK is a Fortran 90 library for solving the most commonly occurring
827 problems in numerical linear algebra.")
828 (license (license:non-copyleft "file://LICENSE"
829 "See LICENSE in the distribution."))))
831 (define-public clapack
838 (uri (string-append "http://www.netlib.org/clapack/clapack-"
839 version "-CMAKE.tgz"))
842 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
843 (build-system cmake-build-system)
846 (modify-phases %standard-phases
847 ;; These tests use a lot of stack variables and segfault without
848 ;; lifting resource limits.
849 (add-after 'unpack 'disable-broken-tests
851 (substitute* "TESTING/CMakeLists.txt"
852 (("add_lapack_test.* xeigtstz\\)") ""))
855 (lambda* (#:key outputs #:allow-other-keys)
856 (let* ((out (assoc-ref outputs "out"))
857 (libdir (string-append out "/lib"))
858 (f2cinc (string-append out "/include/libf2c")))
861 (for-each (lambda (file)
862 (install-file file libdir))
864 "F2CLIBS/libf2c/libf2c.a"
865 "TESTING/MATGEN/libtmglib.a"
866 "BLAS/SRC/libblas.a"))
867 (for-each (lambda (file)
868 (install-file file f2cinc))
869 (cons "F2CLIBS/libf2c/arith.h"
870 (find-files (string-append "../clapack-"
871 ,version "-CMAKE/F2CLIBS/libf2c")
873 (copy-recursively (string-append "../clapack-"
874 ,version "-CMAKE/INCLUDE")
875 (string-append out "/include"))
877 (home-page "https://www.netlib.org/clapack/")
878 (synopsis "Numerical linear algebra library for C")
880 "The CLAPACK library was built using a Fortran to C conversion utility
881 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
882 C code, and then modified to improve readability. CLAPACK's goal is to
883 provide LAPACK for someone who does not have access to a Fortran compiler.")
884 (license (license:non-copyleft "file://LICENSE"
885 "See LICENSE in the distribution."))))
887 (define-public scalapack
894 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
898 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
899 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
900 (build-system cmake-build-system)
903 ("fortran" ,gfortran)
904 ("lapack" ,lapack))) ;for testing only
906 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
907 #:phases (modify-phases %standard-phases
908 (add-before 'check 'mpi-setup
910 (home-page "http://www.netlib.org/scalapack/")
911 (synopsis "Library for scalable numerical linear algebra")
913 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
914 routines on parallel distributed memory machines. ScaLAPACK solves dense and
915 banded linear systems, least squares problems, eigenvalue problems, and
916 singular value problems.")
917 (license (license:non-copyleft "file://LICENSE"
918 "See LICENSE in the distribution."))))
920 (define-public gnuplot
926 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
930 (base32 "03jrqs5lvxmbbz2c4g17dn2hrxqwd3hfadk9q8wbkbkyas2h8sbb"))))
931 (build-system gnu-build-system)
932 (inputs `(("readline" ,readline)
938 `(("pkg-config" ,pkg-config)
939 ("texlive" ,texlive-tiny)))
940 (arguments `(#:configure-flags (list (string-append
941 "--with-texdir=" %output
942 "/texmf-local/tex/latex/gnuplot"))
943 ;; Plot on a dumb terminal during tests.
944 #:make-flags '("GNUTERM=dumb")))
945 (home-page "http://www.gnuplot.info")
946 (synopsis "Command-line driven graphing utility")
947 (description "Gnuplot is a portable command-line driven graphing
948 utility. It was originally created to allow scientists and students to
949 visualize mathematical functions and data interactively, but has grown to
950 support many non-interactive uses such as web scripting. It is also used as a
951 plotting engine by third-party applications like Octave.")
952 ;; X11 Style with the additional restriction that derived works may only be
953 ;; distributed as patches to the original.
954 (license (license:fsf-free
955 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
965 (url "https://github.com/OkoSanto/GCTP")
966 (commit (string-append "v" version))))
967 (file-name (git-file-name name version))
969 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
971 `(("fortran" ,gfortran)))
972 (build-system gnu-build-system)
973 (synopsis "General Cartographic Transformation Package (GCTP)")
975 "The General Cartographic Transformation Package (GCTP) is a system of
976 software routines designed to permit the transformation of coordinate pairs
977 from one map projection to another. The GCTP is the standard computer
978 software used by the National Mapping Division for map projection
980 (home-page "https://github.com/OkoSanto/GCTP")
981 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
990 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
991 version "/src/hdf-" version ".tar.bz2"))
993 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
994 (patches (search-patches "hdf4-architectures.patch"
995 "hdf4-reproducibility.patch"
996 "hdf4-shared-fortran.patch"
997 "hdf4-tirpc.patch"))))
998 (build-system gnu-build-system)
1000 `(("gfortran" ,gfortran)
1005 ("libjpeg" ,libjpeg-turbo)
1006 ("libtirpc" ,libtirpc)))
1008 `(#:parallel-tests? #f
1009 #:configure-flags (list "--enable-shared"
1010 (string-append "CPPFLAGS=-I"
1011 (assoc-ref %build-inputs "libtirpc")
1014 (modify-phases %standard-phases
1015 ;; This is inspired by two of Debian's patches.
1016 (add-before 'configure 'add-more-aarch64-support
1018 (substitute* '("mfhdf/ncgen/ncgen.l"
1019 "mfhdf/ncgen/ncgenyy.c"
1020 "mfhdf/libsrc/netcdf.h.in")
1021 (("AIX5L64") "__aarch64__"))
1023 (add-before 'configure 'patchbuild
1026 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1028 (("/bin/mkdir") "mkdir"))
1029 (substitute* (find-files "." "^Makefile\\.in$")
1030 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1031 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1032 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1033 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1034 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1036 (add-after 'configure 'patch-settings
1038 ;; libhdf4.settings contains the full path of the
1039 ;; compilers used, and its contents are included in
1040 ;; .so-files. We truncate the hashes to avoid
1041 ;; unnecessary store references to those compilers:
1042 (substitute* "libhdf4.settings"
1043 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1044 (string-append prefix (string-take hash 10) "...")))
1046 (add-after 'install 'provide-absolute-libjpeg-reference
1047 (lambda* (#:key inputs outputs #:allow-other-keys)
1048 (let ((out (assoc-ref outputs "out"))
1049 (libjpeg (assoc-ref inputs "libjpeg")))
1050 ;; libjpeg-turbo does not provide a .la file, so libtool is
1051 ;; unable to add an absolute reference for -ljpeg in the .la
1052 ;; files. Fix it manually to avoid having to propagate it.
1053 (substitute* (find-files (string-append out "/lib") "\\.la$")
1055 (string-append "-L" libjpeg "/lib -ljpeg")))
1057 (home-page "https://www.hdfgroup.org/products/hdf4/")
1059 "Library and multi-object file format for storing and managing data")
1060 (description "HDF4 is a library and multi-object file format for storing
1061 and managing data between machines. HDF4 is an older hierarchical data format,
1062 incompatible with HDF5.")
1064 (license:non-copyleft
1065 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1067 (define-public hdf4-alt
1072 (substitute-keyword-arguments (package-arguments hdf4)
1073 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1075 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1077 (define-public hdf5-1.8
1084 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1085 "hdf5-" (version-major+minor version)
1086 "/hdf5-" version "/src/hdf5-"
1088 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1090 (match (string-split version #\.)
1091 ((major minor _ ...)
1092 (string-append major minor)))
1093 "/src/hdf5-" version ".tar.bz2")))
1095 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1096 (patches (search-patches "hdf5-config-date.patch"
1097 "hdf5-1.8-mpi-deprecations.patch"))))
1098 (build-system gnu-build-system)
1102 `(("gfortran" ,gfortran)
1103 ("perl" ,perl))) ;part of the test machinery needs Perl
1104 (outputs '("out" ; core library
1105 "fortran")) ; fortran interface
1107 `(;; Some of the users, notably Flann, need the C++ interface.
1108 #:configure-flags '("--enable-cxx"
1110 "--enable-fortran2003"
1112 ;; Build a thread-safe library. Unfortunately,
1113 ;; 'configure' invites you to either turn off C++,
1114 ;; Fortran, and the high-level interface (HL), or
1115 ;; to pass '--enable-unsupported'. Debian
1116 ;; packagers chose to pass '--enable-unsupported'
1117 ;; and we follow their lead here.
1118 "--enable-threadsafe"
1120 "--enable-unsupported")
1121 ;; Use -fPIC to allow the R bindings to link with the static libraries
1122 #:make-flags (list "CFLAGS=-fPIC"
1125 (modify-phases %standard-phases
1126 (add-before 'configure 'patch-configure
1127 (lambda* (#:key outputs #:allow-other-keys)
1128 (substitute* "configure"
1130 (substitute* "fortran/src/Makefile.in"
1131 (("libhdf5_fortran_la_LDFLAGS =")
1132 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1133 (assoc-ref outputs "fortran") "/lib")))
1134 (substitute* "hl/fortran/src/Makefile.in"
1135 (("libhdf5hl_fortran_la_LDFLAGS =")
1136 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1137 (assoc-ref outputs "fortran") "/lib")))
1139 (add-after 'configure 'patch-settings
1141 ;; libhdf5.settings contains the full path of the
1142 ;; compilers used, and its contents are included in
1143 ;; libhdf5.so. We truncate the hashes to avoid
1144 ;; unnecessary store references to those compilers:
1145 (substitute* "src/libhdf5.settings"
1146 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1147 (string-append prefix (string-take hash 10) "..."))
1148 ;; Don't record the build-time kernel version to make the
1149 ;; settings file reproducible.
1150 (("Uname information:.*")
1151 "Uname information: Linux\n"))
1153 (add-after 'install 'patch-references
1154 (lambda* (#:key inputs outputs #:allow-other-keys)
1155 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1156 (zlib (assoc-ref inputs "zlib")))
1157 (substitute* (find-files bin "h5p?cc")
1159 (string-append "-L" zlib "/lib " lib)))
1161 (add-after 'install 'split
1162 (lambda* (#:key inputs outputs #:allow-other-keys)
1163 ;; Move all fortran-related files
1164 (let* ((out (assoc-ref outputs "out"))
1165 (bin (string-append out "/bin"))
1166 (lib (string-append out "/lib"))
1167 (inc (string-append out "/include"))
1168 (ex (string-append out "/share/hdf5_examples/fortran"))
1169 (fort (assoc-ref outputs "fortran"))
1170 (fbin (string-append fort "/bin"))
1171 (flib (string-append fort "/lib"))
1172 (finc (string-append fort "/include"))
1173 (fex (string-append fort "/share/hdf5_examples/fortran")))
1178 ;; Note: When built with --enable-parallel, the 'h5fc' file
1179 ;; doesn't exist, hence this condition.
1180 (when (file-exists? (string-append bin "/h5fc"))
1181 (rename-file (string-append bin "/h5fc")
1182 (string-append fbin "/h5fc")))
1183 (for-each (lambda (file)
1185 (string-append flib "/" (basename file))))
1186 (find-files lib ".*fortran.*"))
1187 (for-each (lambda (file)
1189 (string-append finc "/" (basename file))))
1190 (find-files inc ".*mod"))
1191 (for-each (lambda (file)
1193 (string-append fex "/" (basename file))))
1194 (find-files ex ".*"))
1195 (delete-file-recursively ex))
1197 (home-page "https://www.hdfgroup.org")
1198 (synopsis "Management suite for extremely large and complex data")
1199 (description "HDF5 is a suite that makes possible the management of
1200 extremely large and complex data collections.")
1201 (license (license:x11-style
1202 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1204 (define-public hdf5-1.10
1205 (package/inherit hdf5-1.8
1210 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1211 "hdf5-" (version-major+minor version)
1212 "/hdf5-" version "/src/hdf5-"
1214 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1216 (apply string-append
1217 (take (string-split version #\.) 2))
1218 "/src/hdf5-" version ".tar.bz2")))
1220 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1221 (patches (search-patches "hdf5-config-date.patch"))))))
1224 ;; Default version of HDF5.
1227 (define-public hdf-java
1235 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1236 version "/src/CMake-hdfjava-" version ".tar.gz"))
1238 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1239 (modules '((guix build utils)))
1240 (snippet ; Make sure we don't use the bundled sources and binaries.
1242 (for-each delete-file
1243 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1244 "HDF4.tar.gz" "HDF5.tar.gz"))
1245 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1247 (build-system gnu-build-system)
1249 `(("jdk" ,icedtea "jdk")
1250 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1252 ("hamcrest-core" ,java-hamcrest-core)
1253 ("junit" ,java-junit)
1254 ("slf4j-simple" ,java-slf4j-simple)))
1259 ("libjpeg" ,libjpeg-turbo)
1260 ("slf4j-api" ,java-slf4j-api)))
1263 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1264 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1265 (assoc-ref %build-inputs "jdk") "/lib" )
1266 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1267 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1270 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1271 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1272 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1273 (string-append "JPEGLIB="
1274 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1278 (modify-phases %standard-phases
1279 (add-before 'configure 'chdir-to-source
1280 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1281 (add-before 'configure 'patch-build
1282 (lambda* (#:key inputs outputs #:allow-other-keys)
1283 (substitute* "configure"
1284 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1285 (("/bin/cat") (which "cat")))
1286 ;; Set classpath for compilation
1287 (substitute* '("hdf/hdf5lib/Makefile.in"
1288 "hdf/hdf5lib/exceptions/Makefile.in"
1289 "hdf/hdflib/Makefile.in")
1290 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1291 (string-append (assoc-ref inputs "slf4j-api")
1292 "/share/java/slf4j-api.jar")))
1293 ;; Replace outdated config.sub and config.guess:
1294 (with-directory-excursion "config"
1295 (for-each (lambda (file)
1297 (string-append (assoc-ref inputs "automake")
1299 ,(version-major+minor (package-version automake))
1301 '("config.sub" "config.guess")))
1303 ;; Fix embedded version number
1304 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1305 (substitute* "hdf/hdf5lib/H5.java"
1307 (string-join hdf5version ", "))))
1309 (mkdir-p (string-append (assoc-ref outputs "out")))
1310 ;; Set classpath for tests
1311 (let* ((build-dir (getcwd))
1312 (lib (string-append build-dir "/lib"))
1313 (jhdf (string-append lib "/jhdf.jar"))
1314 (jhdf5 (string-append lib "/jhdf5.jar"))
1318 (string-append (assoc-ref inputs i)
1319 "/share/java/" i ".jar"))
1320 '("slf4j-api" "slf4j-simple"))
1322 (car (find-files (assoc-ref inputs "junit") "jar$"))
1323 (car (find-files (assoc-ref inputs "hamcrest-core")
1326 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1328 (substitute* '("test/hdf5lib/Makefile.in"
1329 "test/hdf5lib/junit.sh.in"
1330 "examples/runExample.sh.in")
1332 (string-append (assoc-ref inputs "coreutils")
1335 (string-append (assoc-ref inputs "coreutils")
1337 (("CLASSPATH=[^\n]*")
1338 (string-append "CLASSPATH=" class-path)))
1339 (setenv "CLASSPATH" class-path))
1341 (add-before 'check 'build-examples
1343 (apply invoke `("javac"
1344 ,@(find-files "examples" ".*\\.java"))))))
1346 #:parallel-build? #f
1348 #:parallel-tests? #f ))
1349 (home-page "https://support.hdfgroup.org/products/java")
1350 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1351 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1352 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1355 ;; BSD-style license:
1356 (license (license:x11-style
1357 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1358 /current/src/unpacked/COPYING"))))
1360 (define-public hdf-eos2
1367 (uri "ftp://edhs1.gsfc.nasa.gov\
1368 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1370 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1371 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1372 "hdf-eos2-build-shared.patch"
1373 "hdf-eos2-fortrantests.patch"))))
1374 (build-system gnu-build-system)
1376 `(("gfortran" ,gfortran)))
1378 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1379 ;; XXX: These inputs are really dependencies of hdf4.
1381 ("libjpeg" ,libjpeg-turbo)
1382 ("libtirpc" ,libtirpc)
1386 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1387 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1388 #:parallel-tests? #f))
1389 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1390 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1391 (description "HDF-EOS2 is a software library built on HDF4 which supports
1392 the construction of data structures used in NASA's Earth Observing
1393 System (Grid, Point and Swath).")
1395 ;; Source files carry a permissive license header.
1396 (license (license:non-copyleft home-page))))
1398 (define-public hdf-eos5
1404 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1405 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1408 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1409 (patches (search-patches "hdf-eos5-build-shared.patch"
1410 "hdf-eos5-remove-gctp.patch"
1411 "hdf-eos5-fix-szip.patch"
1412 "hdf-eos5-fortrantests.patch"))))
1414 `(("gfortran" ,gfortran)))
1415 (build-system gnu-build-system)
1417 `(("hdf5" ,hdf5-1.8)
1421 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1422 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1423 #:parallel-tests? #f))
1424 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1426 "HDF-EOS5 is a software library built on HDF5 to support the construction
1427 of data structures used in NASA's Earth Observing System (Grid, Point and
1429 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1431 ;; Source files carry a permissive license header.
1432 (license (license:non-copyleft home-page))))
1434 (define-public hdf5-parallel-openmpi
1435 (package/inherit hdf5-1.10 ;use the latest
1436 (name "hdf5-parallel-openmpi")
1439 ,@(package-inputs hdf5)))
1441 (substitute-keyword-arguments (package-arguments hdf5)
1442 ((#:configure-flags flags)
1443 ``("--enable-parallel"
1444 ,@(delete "--enable-cxx"
1445 (delete "--enable-threadsafe" ,flags))))
1447 `(modify-phases ,phases
1448 (add-after 'build 'mpi-setup
1450 (add-before 'check 'patch-tests
1452 ;; OpenMPI's mpirun will exit with non-zero status if it
1453 ;; detects an "abnormal termination", i.e. any process not
1454 ;; calling MPI_Finalize(). Since the test is explicitly
1455 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1456 ;; H5C_flush_cache from being called, mpirun will always
1457 ;; complain, so turn this test off.
1458 (substitute* "testpar/Makefile"
1459 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1460 (string-append front back "\n")))
1461 (substitute* "tools/test/h5diff/testph5diff.sh"
1462 (("/bin/sh") (which "sh")))
1464 (synopsis "Management suite for data with parallel IO support")))
1466 (define-public hdf5-blosc
1474 (url "https://github.com/Blosc/hdf5-blosc")
1475 (commit (string-append "v" version))))
1476 (file-name (git-file-name name version))
1478 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1479 (build-system cmake-build-system)
1482 (list (string-append "-DBLOSC_INSTALL_DIR="
1483 (assoc-ref %build-inputs "c-blosc"))
1484 (string-append "-DPLUGIN_INSTALL_PATH="
1485 (assoc-ref %outputs "out")
1486 "/hdf5/lib/plugin"))
1488 (modify-phases %standard-phases
1489 (add-after 'unpack 'do-not-build-blosc
1491 (substitute* "CMakeLists.txt"
1492 (("set\\(BLOSC_INSTALL_DIR.*") "")
1493 (("ExternalProject_Add\\(project_blosc") "message("))
1496 `(("c-blosc" ,c-blosc)
1497 ("hdf5" ,hdf5-1.10)))
1498 (home-page "https://github.com/Blosc/hdf5-blosc")
1499 (synopsis "Filter for HDF5 using the Blosc compressor")
1500 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1501 installing this filter, you can read and write HDF5 files with
1502 Blosc-compressed datasets.")
1503 (license license:expat)))
1505 (define-public h5check
1512 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1513 "h5check/src/h5check-" version ".tar.gz"))
1516 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1517 (build-system gnu-build-system)
1518 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1519 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1520 (synopsis "HDF5 format checker")
1521 (description "@code{h5check} is a validation tool for verifying that an
1522 HDF5 file is encoded according to the HDF File Format Specification.")
1523 (license (license:x11-style "file://COPYING"))))
1531 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1536 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1537 (build-system cmake-build-system)
1538 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1539 (inputs `(("lapack" ,lapack)
1541 ;; FIXME: Even though the fonts are available dvips complains:
1542 ;; "Font cmmi10 not found; characters will be left blank."
1544 `(("texlive" ,texlive-tiny)
1545 ("ghostscript" ,ghostscript)
1546 ("doxygen" ,doxygen)))
1547 (home-page "http://itpp.sourceforge.net")
1548 (synopsis "C++ library of maths, signal processing and communication classes")
1549 (description "IT++ is a C++ library of mathematical, signal processing and
1550 communication classes and functions. Its main use is in simulation of
1551 communication systems and for performing research in the area of
1552 communications. The kernel of the library consists of generic vector and
1553 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1554 similar to MATLAB, GNU Octave or SciPy.")
1555 (license license:gpl3+)))
1557 (define-public netcdf
1565 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1566 "netcdf-c-" version ".tar.gz"))
1569 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1570 (patches (search-patches "netcdf-date-time.patch"))))
1571 (build-system gnu-build-system)
1574 ("doxygen" ,doxygen)
1575 ("graphviz" ,graphviz)))
1577 `(("hdf4" ,hdf4-alt)
1581 ("libjpeg" ,libjpeg-turbo)))
1583 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1585 #:phases (modify-phases %standard-phases
1586 (add-before 'configure 'fix-source-date
1588 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1589 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1590 ;; to '1st hour of the current day', and therefore makes the
1591 ;; package not reproducible.
1592 (substitute* "./configure"
1593 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1594 "date --date='@0'"))
1596 (add-after 'configure 'patch-settings
1598 ;; libnetcdf.settings contains the full filename of the compilers
1599 ;; used to build the library. We truncate the hashes of those
1600 ;; filenames to avoid unnecessary references to the corresponding
1602 (substitute* "libnetcdf.settings"
1603 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1604 (string-append prefix (string-take hash 10) "...")))
1607 #:parallel-tests? #f)) ;various race conditions
1608 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1609 (synopsis "Library for scientific data")
1610 (description "NetCDF is an interface for scientific data access and a
1611 software library that provides an implementation of the interface. The netCDF
1612 library defines a machine-independent format for representing scientific data.
1613 Together, the interface, library, and format support the creation, access, and
1614 sharing of scientific data.")
1615 (license (license:x11-style "file://COPYRIGHT"))))
1617 (define-public netcdf-parallel-openmpi
1618 (package (inherit netcdf)
1619 (name "netcdf-parallel-openmpi")
1622 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1623 (package-inputs netcdf))))
1624 ;; TODO: Replace pkg-config references in nc-config with absolute references
1626 (substitute-keyword-arguments (package-arguments netcdf)
1627 ((#:configure-flags flags)
1628 `(cons* "CC=mpicc" "CXX=mpicxx"
1629 "--enable-parallel-tests"
1630 ;; Shared libraries not supported with parallel IO.
1631 "--disable-shared" "--with-pic"
1633 ((#:phases phases '%standard-phases)
1634 `(modify-phases ,phases
1635 (add-after 'build 'mpi-setup
1636 ,%openmpi-setup)))))))
1638 (define-public netcdf-fortran
1640 (name "netcdf-fortran")
1645 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1649 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1650 (build-system gnu-build-system)
1652 `(#:parallel-tests? #f))
1654 `(("netcdf" ,netcdf)))
1656 `(("gfortran" ,gfortran)))
1657 (synopsis "Fortran interface for the netCDF library")
1658 (description (package-description netcdf))
1659 (home-page (package-home-page netcdf))
1660 (license (package-license netcdf))))
1662 (define-public nlopt
1668 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1671 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1672 (build-system gnu-build-system)
1674 `(;; Shared libraries are not built by default. They are required to
1675 ;; build the Guile, Octave, and Python bindings.
1676 #:configure-flags '("--enable-shared")
1679 (modify-phases %standard-phases
1680 (add-before 'configure 'set-libnlopt-file-name
1681 (lambda* (#:key outputs #:allow-other-keys)
1682 ;; Make sure the Scheme module refers to the library by its
1683 ;; absolute file name (we cannot do that from a snippet
1684 ;; because the expansion of @libdir@ contains
1686 (let ((out (assoc-ref outputs "out")))
1687 (substitute* "swig/nlopt.scm.in"
1689 (string-append out "/lib/libnlopt")))
1691 (inputs `(("guile" ,guile-2.0)))
1692 (native-inputs `(("pkg-config" ,pkg-config)))
1693 (home-page "http://ab-initio.mit.edu/wiki/")
1694 (synopsis "Library for nonlinear optimization")
1695 (description "NLopt is a library for nonlinear optimization, providing a
1696 common interface for a number of different free optimization routines available
1697 online as well as original implementations of various other algorithms.")
1698 (license license:lgpl2.1+)))
1700 (define-public ipopt
1707 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1711 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1712 (modules '((guix build utils)))
1714 ;; Make sure we don't use the bundled software.
1716 (delete-file-recursively "ThirdParty")
1718 (build-system gnu-build-system)
1720 '(#:phases (modify-phases %standard-phases
1721 (add-after 'install 'add--L-flags-in-ipopt.pc
1722 (lambda* (#:key inputs outputs #:allow-other-keys)
1723 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1724 ;; move it to "Libs.private" where it belongs, and add a
1725 ;; '-L' flag for LAPACK.
1726 (let ((out (assoc-ref outputs "out"))
1727 (lapack (assoc-ref inputs "lapack")))
1728 (substitute* (string-append out "/lib/pkgconfig/"
1730 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1731 (string-append "Libs: " before " " after "\n"
1732 "Libs.private: " before
1733 "-L" lapack "/lib -llapack -lblas "
1737 `(("gfortran" ,gfortran)))
1739 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1740 `(("lapack" ,lapack))) ;for both libblas and liblapack
1741 (home-page "https://www.coin-or.org")
1742 (synopsis "Large-scale nonlinear optimizer")
1744 "The Interior Point Optimizer (IPOPT) is a software package for
1745 large-scale nonlinear optimization. It provides C++, C, and Fortran
1747 (license license:epl1.0)))
1755 (uri (string-append "https://www.coin-or.org/download/source/"
1756 "Clp/Clp-" version ".tgz"))
1759 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1760 (modules '((guix build utils)))
1762 ;; Make sure we don't use the bundled software.
1764 (delete-file-recursively "ThirdParty")
1766 (build-system gnu-build-system)
1768 `(("gfortran" ,gfortran)
1769 ("pkg-config" ,pkg-config)))
1771 `(("openblas" ,openblas)))
1772 (home-page "https://www.coin-or.org")
1773 (synopsis "Linear programming solver")
1775 "CLP is a high quality linear programming solver. Its main strengths are
1776 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1777 linear and quadratic objectives. There are limited facilities for nonlinear
1778 and quadratic objectives using the Simplex algorithm.")
1779 (license license:epl1.0)))
1781 (define-public libflame
1785 (outputs '("out" "static"))
1790 (url "https://github.com/flame/libflame")
1792 (file-name (git-file-name name version))
1795 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1796 (build-system gnu-build-system)
1799 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1800 (list "--enable-dynamic-build"
1801 "--enable-max-arg-list-hack"
1802 "--enable-lapack2flame"
1803 "--enable-verbose-make-output"
1804 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1805 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1808 '("--enable-vector-intrinsics=sse")
1810 "--enable-supermatrix"
1811 "--enable-memory-alignment=16"
1812 "--enable-ldim-alignment")
1814 (modify-phases %standard-phases
1815 (add-after 'unpack 'patch-/usr/bin/env-bash
1817 (substitute* "build/config.mk.in"
1818 (("/usr/bin/env bash") (which "bash")))
1821 (lambda* (#:key tests? #:allow-other-keys)
1822 (substitute* "test/Makefile"
1823 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1824 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1826 (with-directory-excursion "test"
1829 (invoke "./test_libflame.x"))
1831 (add-after 'install 'install-static
1832 (lambda* (#:key outputs #:allow-other-keys)
1833 (let ((out (assoc-ref outputs "out"))
1834 (static (assoc-ref outputs "static")))
1835 (mkdir-p (string-append static "/lib"))
1836 (rename-file (string-append out "/lib/libflame.a")
1837 (string-append static "/lib/libflame.a"))
1838 (install-file (string-append out "/include/FLAME.h")
1839 (string-append static "/include"))
1842 `(("gfortran" ,gfortran)))
1844 `(("lapack" ,lapack)
1845 ("openblas" ,openblas)
1847 ("python" ,python-wrapper)))
1848 (home-page "https://github.com/flame/libflame")
1849 (synopsis "High-performance object-based library for DLA computations")
1850 (description "@code{libflame} is a portable library for dense matrix
1851 computations, providing much of the functionality present in LAPACK, developed
1852 by current and former members of the @acronym{SHPC, Science of High-Performance
1853 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1854 Computational Engineering and Sciences} at The University of Texas at Austin.
1855 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1856 includes a complete LAPACK implementation.")
1857 (license license:bsd-3)))
1859 (define-public ceres
1861 (name "ceres-solver")
1863 (home-page "http://ceres-solver.org/")
1866 (uri (string-append home-page "ceres-solver-"
1870 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1871 (build-system cmake-build-system)
1873 ;; TODO: Build HTML user documentation and install separately.
1874 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1875 "-DBUILD_SHARED_LIBS=ON")
1877 #:phases (modify-phases %standard-phases
1878 (add-before 'configure 'set-library-directory
1880 ;; Install libraries to lib/, not lib64/.
1881 (substitute* "internal/ceres/CMakeLists.txt"
1882 (("set\\(LIB_SUFFIX \"64\"\\)")
1883 "set(LIB_SUFFIX \"\")"))
1886 `(("pkg-config" ,pkg-config)))
1888 `(("glog" ,glog))) ;for #include <glog/glog.h>
1893 ("suitesparse" ,suitesparse)
1894 ("gflags" ,gflags)))
1895 (synopsis "C++ library for solving large optimization problems")
1897 "Ceres Solver is a C++ library for modeling and solving large,
1898 complicated optimization problems. It is a feature rich, mature and
1899 performant library which has been used in production since 2010. Ceres Solver
1900 can solve two kinds of problems:
1902 @item non-linear least squares problems with bounds constraints;
1903 @item general unconstrained optimization problems.
1905 (license license:bsd-3)))
1907 ;; For a fully featured Octave, users are strongly recommended also to install
1908 ;; the following packages: less, ghostscript, gnuplot.
1909 (define-public octave-cli
1916 (uri (string-append "mirror://gnu/octave/octave-"
1920 "0355s0pi8603ccs2j08zym3nalgalslxn83s37zq8nkrrkwxrjfk"))))
1921 (build-system gnu-build-system)
1923 `(("alsa-lib" ,alsa-lib)
1924 ("arpack" ,arpack-ng)
1930 ("fontconfig" ,fontconfig)
1931 ("freetype" ,freetype)
1935 ("graphicsmagick" ,graphicsmagick)
1937 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1938 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1939 ;; libtiff.la instead of having to provide it here.
1940 ("libjpeg" ,libjpeg-turbo)
1944 ("libsndfile" ,libsndfile)
1948 ("portaudio" ,portaudio)
1950 ("readline" ,readline)
1951 ("suitesparse" ,suitesparse)
1952 ("texinfo" ,texinfo)
1956 ("gfortran" ,gfortran)
1957 ("pkg-config" ,pkg-config)
1959 ;; The following inputs are not actually used in the build process.
1960 ;; However, the ./configure gratuitously tests for their existence and
1961 ;; assumes that programs not present at build time are also not, and
1962 ;; can never be, available at run time! If these inputs are therefore
1963 ;; not present, support for them will be built out. However, Octave
1964 ;; will still run without them, albeit without the features they
1967 ("ghostscript" ,ghostscript)
1968 ("gnuplot" ,gnuplot)))
1969 ;; Octave code uses this variable to detect directories holding multiple CA
1970 ;; certificates to verify peers with. This is required for the networking
1971 ;; functions that require encryption to work properly.
1972 (native-search-paths
1973 (list (search-path-specification
1974 (variable "CURLOPT_CAPATH")
1975 (files '("etc/ssl/certs")))))
1978 (list (string-append "--with-shell="
1979 (assoc-ref %build-inputs "bash")
1982 ;; XXX: Without this flag, linking octave-cli fails with
1983 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1984 ;; not pulling in liboctinterp.la for -lstdc++.
1985 "--enable-link-all-dependencies")
1987 (modify-phases %standard-phases
1988 (add-after 'configure 'configure-makeinfo
1989 (lambda* (#:key inputs #:allow-other-keys)
1990 (substitute* "libinterp/corefcn/help.h"
1993 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1995 (home-page "https://www.gnu.org/software/octave/")
1996 (synopsis "High-level language for numerical computation")
1997 (description "GNU Octave is a high-level interpreted language that is
1998 specialized for numerical computations. It can be used for both linear and
1999 non-linear applications and it provides great support for visualizing results.
2000 Work may be performed both at the interactive command-line as well as via
2002 (license license:gpl3+)))
2004 (define-public octave
2005 (package (inherit octave-cli)
2008 `(("qscintilla" ,qscintilla)
2010 ,@(package-inputs octave-cli)))
2012 `(("qttools" , qttools) ;for lrelease
2013 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2014 ,@(package-native-inputs octave-cli)))
2016 (substitute-keyword-arguments (package-arguments octave-cli)
2018 `(modify-phases ,phases
2019 (add-before 'configure 'patch-qscintilla-library-name
2020 (lambda* (#:key inputs #:allow-other-keys)
2021 ;; The QScintilla library that the Octave configure script tries
2022 ;; to link with should be named libqscintilla-qt5.so, but the
2023 ;; QScintilla input provides the shared library as
2024 ;; libqscintilla2_qt5.so.
2025 (substitute* "configure"
2026 (("qscintilla2-qt5")
2030 (define-public opencascade-oce
2032 (name "opencascade-oce")
2038 (url "https://github.com/tpaviot/oce")
2039 (commit (string-append "OCE-" version))))
2040 (file-name (git-file-name name version))
2041 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2043 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2044 (build-system cmake-build-system)
2047 (list "-DOCE_TESTING:BOOL=ON"
2048 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2049 "-DOCE_DRAW:BOOL=ON"
2050 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2051 (assoc-ref %outputs "out"))
2052 "-UCMAKE_INSTALL_RPATH")))
2054 `(("freetype" ,freetype)
2061 `(("python" ,python-wrapper)))
2062 (home-page "https://github.com/tpaviot/oce")
2063 (synopsis "Libraries for 3D modeling and numerical simulation")
2065 "Open CASCADE is a set of libraries for the development of applications
2066 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2067 C++ class libraries providing services for 3D surface and solid modeling, CAD
2068 data exchange, and visualization. It is used for development of specialized
2069 software dealing with 3D models in design (CAD), manufacturing (CAM),
2070 numerical simulation (CAE), measurement equipment (CMM), and quality
2071 control (CAQ) domains.
2073 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2074 patches, improvements, and experiments contributed by users over the official
2075 Open CASCADE library.")
2076 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2077 ; use of header files; see
2078 ; OCCT_LGPL_EXCEPTION.txt
2079 license:public-domain; files
2080 ; src/Standard/Standard_StdAllocator.hxx and
2081 ; src/NCollection/NCollection_StdAllocator.hxx
2082 license:expat; file src/OpenGl/OpenGl_glext.h
2083 license:bsd-3)))); test framework gtest
2085 (define-public opencascade-occt
2087 (name "opencascade-occt")
2093 (url "https://git.dev.opencascade.org/repos/occt.git")
2096 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2098 (file-name (git-file-name name version))
2100 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2101 (modules '((guix build utils)))
2104 ;; Remove files specific to non-free operating systems.
2105 (delete-file-recursively "samples/ios")
2106 (delete-file-recursively "samples/mfc")
2107 (delete-file-recursively "samples/qt/FuncDemo")
2108 (delete-file "genconf.bat")
2109 (delete-file "gendoc.bat")
2110 (delete-file "genproj.bat")
2111 (delete-file "upgrade.bat")
2112 ;; Remove references to deleted files.
2113 (substitute* "dox/FILES_HTML.txt"
2114 ((".*standard.*") "" )
2115 ((".*UIKitSample.*") ""))
2117 (build-system cmake-build-system)
2119 '(;; There is no test target for make. OCCT provides an
2120 ;; 'Automated Testing System', which may be accessed after
2121 ;; installation via the draw.sh script. draw.sh is located in
2122 ;; the bin directory. For details see:
2123 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2124 ;; occt_dev_guides__tests.html
2126 ;; Configure without freeimage: attempting to link against the
2127 ;; freeimage version 3.17 library leads to 'undefined
2128 ;; reference' errors.
2130 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2132 "-DUSE_VTK:BOOL=OFF"
2133 "-DBUILD_DOC_Overview:BOOL=OFF"
2134 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2135 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2136 "-UCMAKE_INSTALL_LIBDIR")))
2138 `(("doxygen" ,doxygen)
2139 ;("freeimage" ,freeimage)
2140 ("freetype" ,freetype)
2142 ("libxext" ,libxext)
2149 ;; TODO: build Overview documentation and add 'doc' output.
2150 (home-page "https://www.opencascade.com")
2151 (synopsis "Libraries for 3D modeling and numerical simulation")
2153 "Open CASCADE is a set of libraries for the development of applications
2154 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2155 C++ class libraries providing services for 3D surface and solid modeling, CAD
2156 data exchange, and visualization. It is used for development of specialized
2157 software dealing with 3D models in design (CAD), manufacturing (CAM),
2158 numerical simulation (CAE), measurement equipment (CMM), and quality
2159 control (CAQ) domains.
2161 This is the certified version of the Open Cascade Technology (OCCT) library.")
2162 (license (list ;; OCCT library:
2163 license:lgpl2.1; with an exception for the use of header
2164 ; files, see OCCT_LGPL_EXCEPTION.txt.
2165 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2166 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2168 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2169 ;; src/StepFile/step.tab.*:
2170 license:gpl3+ ; with Bison 2.2 exception.
2171 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2172 (license:non-copyleft
2173 "https://www.unicode.org/license.html")
2174 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2175 license:public-domain))))
2185 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2187 (string-append "gmsh_"
2188 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2190 (file-name (git-file-name name version))
2192 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2193 (modules '((guix build utils)))
2196 (delete-file-recursively "contrib/metis")
2198 (build-system cmake-build-system)
2201 ("gfortran" ,gfortran)
2208 ("opencascade-occt" ,opencascade-occt)
2210 ("libxext" ,libxext)))
2212 `(("fontconfig" ,fontconfig)
2213 ("libxft" ,libxft)))
2215 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2216 "-DENABLE_BUILD_SHARED:BOOL=ON"
2217 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2218 (home-page "http://gmsh.info/")
2219 (synopsis "3D finite element grid generator")
2220 (description "Gmsh is a 3D finite element grid generator with a built-in
2221 CAD engine and post-processor. Its design goal is to provide a fast, light
2222 and user-friendly meshing tool with parametric input and advanced
2223 visualization capabilities. Gmsh is built around four modules: geometry,
2224 mesh, solver and post-processing. The specification of any input to these
2225 modules is done either interactively using the graphical user interface or in
2226 ASCII text files using Gmsh's own scripting language.")
2227 (license license:gpl2+)))
2229 (define-public veusz
2236 (uri (pypi-uri "veusz" version))
2238 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2239 (build-system python-build-system)
2241 `(;; Tests will fail because they depend on optional packages like
2242 ;; python-astropy, which is not packaged.
2245 (modify-phases %standard-phases
2246 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2247 ;; the path is defined in Guix, therefore we have to change it.
2248 (add-after 'unpack 'fix-sip-dir
2250 (substitute* "pyqtdistutils.py"
2251 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2253 ;; Now we have to pass the correct sip_dir to setup.py.
2255 (lambda* (#:key inputs #:allow-other-keys)
2256 ;; We need to tell setup.py where to locate QtCoremod.sip
2257 ((@@ (guix build python-build-system) call-setuppy)
2259 (list (string-append "--sip-dir="
2260 (assoc-ref inputs "python-pyqt")
2263 ;; Ensure that icons are found at runtime.
2264 (add-after 'install 'wrap-executable
2265 (lambda* (#:key inputs outputs #:allow-other-keys)
2266 (let ((out (assoc-ref outputs "out")))
2267 (wrap-program (string-append out "/bin/veusz")
2268 `("QT_PLUGIN_PATH" prefix
2269 ,(list (string-append (assoc-ref inputs "qtsvg")
2270 "/lib/qt5/plugins/"))))))))))
2272 `(("pkg-config" ,pkg-config)
2273 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2274 ("qttools" ,qttools)))
2276 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2277 ("python-dbus" ,python-dbus)
2278 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2279 ("python-pyqt" ,python-pyqt)
2283 `(("python-numpy" ,python-numpy)))
2284 (home-page "https://veusz.github.io/")
2285 (synopsis "Scientific plotting package")
2287 "Veusz is a scientific plotting and graphing program with a graphical
2288 user interface, designed to produce publication-ready 2D and 3D plots. In
2289 addition it can be used as a module in Python for plotting. It supports
2290 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2291 (license license:gpl2+)))
2293 (define-public maxflow
2296 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2297 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2302 (url "https://github.com/gerddie/maxflow")
2304 (file-name (git-file-name name version))
2307 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2308 (build-system cmake-build-system)
2309 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2310 (synopsis "Library implementing Maxflow algorithm")
2311 (description "An implementation of the maxflow algorithm described in
2312 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2313 Energy Minimization in Computer Vision.\n
2314 Yuri Boykov and Vladimir Kolmogorov.\n
2315 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2317 (license license:gpl3+)))
2319 (define-public petsc
2326 ;; The *-lite-* tarball does not contain the *large* documentation
2327 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2328 "petsc-lite-" version ".tar.gz"))
2330 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2331 (outputs '("out" ; libraries and headers
2332 "examples")) ; ~30MiB of examples
2333 (build-system gnu-build-system)
2335 `(("python" ,python-2)))
2337 `(("gfortran" ,gfortran)
2339 ("superlu" ,superlu)
2340 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2341 ;; leaving out opengl, as configuration seems to only be for mac
2344 `(#:test-target "test"
2345 #:parallel-build? #f ; build is parallel by default
2351 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2352 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2353 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2355 (modify-phases %standard-phases
2357 ;; PETSc's configure script is actually a python script, so we can't
2358 ;; run it with bash.
2359 (lambda* (#:key outputs (configure-flags '())
2361 (let* ((prefix (assoc-ref outputs "out"))
2362 (flags `(,(string-append "--prefix=" prefix)
2363 ,@configure-flags)))
2364 (format #t "build directory: ~s~%" (getcwd))
2365 (format #t "configure flags: ~s~%" flags)
2366 (apply invoke "./configure" flags))))
2367 (add-after 'configure 'clean-local-references
2368 (lambda* (#:key outputs #:allow-other-keys)
2369 (let ((out (assoc-ref outputs "out")))
2370 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2371 ;; Prevent build directory from leaking into compiled code
2373 ;; Scrub timestamp for reproducibility
2374 ((".*Libraries compiled on.*") ""))
2375 (substitute* (find-files "." "petscvariables")
2376 ;; Do not expose build machine characteristics, set to defaults.
2377 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2378 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2380 (add-after 'install 'clean-install
2381 ;; Try to keep installed files from leaking build directory names.
2382 (lambda* (#:key inputs outputs #:allow-other-keys)
2383 (let ((out (assoc-ref outputs "out")))
2384 (substitute* (map (lambda (file)
2385 (string-append out "/lib/petsc/conf/" file))
2386 '("petscvariables"))
2388 ;; Make compiler references point to the store
2389 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2390 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2391 (string-append "= " (which compiler))))
2392 ;; PETSc installs some build logs, which aren't necessary.
2393 (for-each (lambda (file)
2394 (let ((f (string-append out "/lib/petsc/conf/" file)))
2395 (when (file-exists? f)
2397 '("configure.log" "make.log" "gmake.log"
2398 "test.log" "error.log" "RDict.db"
2399 "PETScBuildInternal.cmake"
2400 ;; Once installed, should uninstall with Guix
2403 (add-after 'install 'move-examples
2404 (lambda* (#:key outputs #:allow-other-keys)
2405 (let* ((out (assoc-ref outputs "out"))
2406 (examples (assoc-ref outputs "examples"))
2407 (exdir (string-append out "/share/petsc/examples"))
2408 (exdir' (string-append examples "/share/petsc/examples")))
2409 (copy-recursively exdir exdir')
2410 (delete-file-recursively exdir)
2412 (home-page "https://www.mcs.anl.gov/petsc")
2413 (synopsis "Library to solve PDEs")
2414 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2415 data structures and routines for the scalable (parallel) solution of
2416 scientific applications modeled by partial differential equations.")
2417 (license (license:non-copyleft
2418 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2420 (define-public petsc-complex
2421 (package (inherit petsc)
2422 (name "petsc-complex")
2424 (substitute-keyword-arguments (package-arguments petsc)
2425 ((#:configure-flags cf)
2426 `(cons "--with-scalar-type=complex" ,cf))))
2427 (synopsis "Library to solve PDEs (with complex scalars)")))
2429 (define-public petsc-openmpi
2430 (package (inherit petsc)
2431 (name "petsc-openmpi")
2433 `(("hdf5" ,hdf5-parallel-openmpi)
2434 ("hypre" ,hypre-openmpi)
2436 ("mumps" ,mumps-openmpi)
2437 ("openmpi" ,openmpi)
2438 ("scalapack" ,scalapack)
2439 ("scotch" ,pt-scotch32)
2440 ,@(package-inputs petsc)))
2442 (substitute-keyword-arguments (package-arguments petsc)
2443 ((#:configure-flags cf)
2445 "--with-mpiexec=mpirun"
2448 "--with-scalapack=1"
2450 ,(string-append "--with-mpi-dir="
2451 (assoc-ref %build-inputs "openmpi"))
2452 ,(string-append "--with-hdf5-include="
2453 (assoc-ref %build-inputs "hdf5") "/include")
2454 ,(string-append "--with-hdf5-lib="
2455 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2456 ,@(delete "--with-mpi=0" ,cf)))
2458 `(modify-phases ,phases
2459 (add-before 'configure 'mpi-setup
2460 ,%openmpi-setup)))))
2461 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2463 (define-public petsc-complex-openmpi
2464 (package (inherit petsc-complex)
2465 (name "petsc-complex-openmpi")
2467 `(("openmpi" ,openmpi)
2468 ,@(package-inputs petsc-complex)))
2470 (substitute-keyword-arguments (package-arguments petsc-complex)
2471 ((#:configure-flags cf)
2472 ``("--with-mpiexec=mpirun"
2473 ,(string-append "--with-mpi-dir="
2474 (assoc-ref %build-inputs "openmpi"))
2475 ,@(delete "--with-mpi=0" ,cf)))
2477 `(modify-phases ,phases
2478 (add-before 'configure 'mpi-setup
2479 ,%openmpi-setup)))))
2480 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2482 (define-public python-petsc4py
2484 (name "python-petsc4py")
2489 (uri (pypi-uri "petsc4py" version))
2492 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2493 (modules '((guix build utils)))
2496 ;; Ensure source file is regenerated in the build phase.
2497 (delete-file "src/petsc4py.PETSc.c")
2498 ;; Remove legacy GC code. See
2499 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2500 (substitute* "src/PETSc/cyclicgc.pxi"
2501 ((".*gc_refs.*") "" )
2502 ((".*PyGC_Head.*") ""))
2504 (build-system python-build-system)
2507 (modify-phases %standard-phases
2508 (add-before 'build 'pre-build
2510 ;; Define path to PETSc installation.
2511 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2513 (add-before 'check 'mpi-setup
2516 `(("python-cython" ,python-cython)))
2518 `(("petsc" ,petsc-openmpi)
2519 ("python-numpy" ,python-numpy)))
2520 (home-page "https://bitbucket.org/petsc/petsc4py/")
2521 (synopsis "Python bindings for PETSc")
2522 (description "PETSc, the Portable, Extensible Toolkit for
2523 Scientific Computation, is a suite of data structures and routines for
2524 the scalable (parallel) solution of scientific applications modeled by
2525 partial differential equations. It employs the MPI standard for all
2526 message-passing communication. @code{petsc4py} provides Python
2527 bindings to almost all functions of PETSc.")
2528 (license license:bsd-3)))
2530 (define-public python-kiwisolver
2532 (name "python-kiwisolver")
2536 (uri (pypi-uri "kiwisolver" version))
2539 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2540 (build-system python-build-system)
2541 (home-page "https://github.com/nucleic/kiwi")
2542 (synopsis "Fast implementation of the Cassowary constraint solver")
2544 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2545 solving algorithm. Kiwi has been designed from the ground up to be
2546 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2547 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2548 savings are consistently > 5x.")
2549 (license license:bsd-3)))
2551 (define-public python2-kiwisolver
2552 (package-with-python2 python-kiwisolver))
2554 (define-public slepc
2561 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2565 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2566 (build-system gnu-build-system)
2568 `(("python" ,python-2)
2569 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2571 `(("arpack" ,arpack-ng)
2572 ("gfortran" ,gfortran)))
2574 `(("petsc" ,petsc)))
2576 `(#:parallel-build? #f ;build is parallel by default
2578 `(,(string-append "--with-arpack-dir="
2579 (assoc-ref %build-inputs "arpack") "/lib"))
2580 #:make-flags ;honor (parallel-job-count)
2581 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2582 ,(string-append "PETSCCONFIGDIR="
2583 (assoc-ref %build-inputs "petsc:examples")
2584 "/share/petsc/examples/config"))
2586 (modify-phases %standard-phases
2588 ;; configure is a python script, so we can't run it with bash.
2589 (lambda* (#:key inputs outputs (configure-flags '())
2591 (let* ((prefix (assoc-ref outputs "out"))
2592 (flags `(,(string-append "--prefix=" prefix)
2593 ,@configure-flags)))
2594 (format #t "build directory: ~s~%" (getcwd))
2595 (format #t "configure flags: ~s~%" flags)
2596 (setenv "SLEPC_DIR" (getcwd))
2597 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2598 (apply invoke "./configure" flags))))
2599 (add-after 'install 'delete-doc
2600 ;; TODO: SLEPc installs HTML documentation alongside headers in
2601 ;; $out/include. We'd like to move them to share/doc, but delete
2602 ;; them for now, as they are incomplete and installing the complete
2603 ;; documentation is difficult.
2604 (lambda* (#:key outputs #:allow-other-keys)
2605 (let* ((out (assoc-ref outputs "out")))
2606 (for-each delete-file (find-files out "\\.html$"))
2608 (add-after 'install 'clean-install
2609 ;; Clean up unnecessary build logs from installation.
2610 (lambda* (#:key outputs #:allow-other-keys)
2611 (let ((out (assoc-ref outputs "out")))
2612 (for-each (lambda (file)
2613 (let ((f (string-append out "/lib/slepc/conf/" file)))
2614 (when (file-exists? f)
2616 '("configure.log" "make.log" "gmake.log"
2617 "test.log" "error.log" "RDict.db"
2620 (home-page "http://slepc.upv.es")
2621 (synopsis "Scalable library for eigenproblems")
2622 (description "SLEPc is a software library for the solution of large sparse
2623 eigenproblems on parallel computers. It can be used for the solution of
2624 linear eigenvalue problems formulated in either standard or generalized form,
2625 as well as other related problems such as the singular value decomposition.
2626 The emphasis of the software is on methods and techniques appropriate for
2627 problems in which the associated matrices are sparse, for example, those
2628 arising after the discretization of partial differential equations.")
2629 (license license:bsd-2)))
2631 (define-public slepc-complex
2632 (package (inherit slepc)
2633 (name "slepc-complex")
2635 `(("petsc" ,petsc-complex)
2636 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2637 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2639 (define-public slepc-openmpi
2640 (package (inherit slepc)
2641 (name "slepc-openmpi")
2643 (substitute-keyword-arguments (package-arguments slepc)
2644 ((#:phases phases '%standard-phases)
2645 `(modify-phases ,phases
2646 (add-before 'check 'mpi-setup
2647 ,%openmpi-setup)))))
2650 ("arpack" ,arpack-ng-openmpi)
2651 ,@(alist-delete "arpack" (package-inputs slepc))))
2653 `(("petsc" ,petsc-openmpi)
2654 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2655 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2657 (define-public slepc-complex-openmpi
2658 (package (inherit slepc-openmpi)
2659 (name "slepc-complex-openmpi")
2661 `(("petsc" ,petsc-complex-openmpi)
2662 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2663 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2665 (define-public python-slepc4py
2667 (name "python-slepc4py")
2672 (uri (pypi-uri "slepc4py" version))
2675 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2676 (build-system python-build-system)
2679 (modify-phases %standard-phases
2680 (add-before 'build 'pre-build
2682 ;; Define path to PETSc installation.
2683 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2684 ;; Define path to SLEPc installation.
2685 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2687 (add-before 'check 'mpi-setup
2690 `(("python-numpy" ,python-numpy)
2691 ("python-petsc4py" ,python-petsc4py)
2692 ("slepc" ,slepc-openmpi)))
2693 (home-page "https://bitbucket.org/slepc/slepc4py/")
2694 (synopsis "Python bindings for SLEPc")
2695 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2696 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2697 Scientific Computation. It employs the MPI standard for all
2698 message-passing communication. @code{slepc4py} provides Python
2699 bindings to almost all functions of SLEPc.")
2700 (license license:bsd-3)))
2702 (define-public metamath
2710 (url "https://github.com/metamath/metamath-exe")
2711 (commit (string-append "v" version))))
2712 (file-name (git-file-name name version))
2714 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2715 (build-system gnu-build-system)
2717 `(("autoconf" ,autoconf)
2718 ("automake" ,automake)))
2719 (home-page "http://us.metamath.org/")
2720 (synopsis "Proof verifier based on a minimalistic formalism")
2722 "Metamath is a tiny formal language and that can express theorems in
2723 abstract mathematics, with an accompyaning @command{metamath} executable that
2724 verifies databases of these proofs. There is a public database,
2725 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2726 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2727 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2728 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2730 (license license:gpl2+)))
2732 (define-public mumps
2739 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2743 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2744 (patches (search-patches "mumps-build-parallelism.patch"
2745 "mumps-shared-libseq.patch"
2746 "mumps-shared-mumps.patch"
2747 "mumps-shared-pord.patch"))))
2748 (build-system gnu-build-system)
2750 `(("fortran" ,gfortran)
2751 ;; These are required for linking against mumps, but we let the user
2752 ;; declare the dependency.
2755 ("scotch" ,scotch)))
2757 `(#:modules ((ice-9 match)
2760 ,@%gnu-build-system-modules)
2762 (modify-phases %standard-phases
2764 (lambda* (#:key inputs #:allow-other-keys)
2765 (call-with-output-file "Makefile.inc"
2776 INCSEQ = -I$(topdir)/libseq
2777 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2778 LIBSEQNEEDED = libseqneeded~;
2782 AR = ar vr # rules require trailing space, ugh...
2785 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2787 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2788 LIBOTHERS = -pthread
2791 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2795 LIBS = $(SCALAP) $(LIBSEQ)
2796 LPORDDIR = $(topdir)/PORD/lib
2797 IPORD = -I$(topdir)/PORD/include
2798 LPORD = $(LPORDDIR)/libpord.a
2799 ORDERINGSF = -Dpord~@[
2801 IMETIS = -I$(METISDIR)/include
2802 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2803 ORDERINGSF += -Dmetis~]~@[~:{
2805 ISCOTCH = -I$(SCOTCHDIR)/include
2806 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2807 ORDERINGSF += ~a~}~]
2808 ORDERINGSC = $(ORDERINGSF)
2809 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2810 IORDERINGSF = $(ISCOTCH)
2811 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2812 (assoc-ref inputs "mpi")
2813 (assoc-ref inputs "blas")
2814 (assoc-ref inputs "scalapack")
2815 (assoc-ref inputs "metis")
2816 (match (list (assoc-ref inputs "pt-scotch")
2817 (assoc-ref inputs "scotch"))
2821 `((,scotch "" "-Dscotch")))
2824 "-lptesmumps -lptscotch -lptscotcherr "
2825 "-Dptscotch")))))))))
2827 ;; By default only the d-precision library is built. Make with "all"
2828 ;; target so that all precision libraries and examples are built.
2830 (invoke "make" "all"
2831 (format #f "-j~a" (parallel-job-count)))))
2833 ;; Run the simple test drivers, which read test input from stdin:
2834 ;; from the "real" input for the single- and double-precision
2835 ;; testers, and from the "cmplx" input for complex-precision
2836 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2837 ;; package to prefix execution with "mpirun".
2838 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2839 (with-directory-excursion "examples"
2842 (let ((tester (apply open-pipe*
2845 ,(string-append "./" prec
2847 (input (open-input-file
2848 (string-append "input_simpletest_" type))))
2850 (dump-port input tester)
2852 (zero? (close-pipe tester)))))
2854 '("real" "real" "cmplx" "cmplx")))))
2856 (lambda* (#:key outputs #:allow-other-keys)
2857 (let* ((out (assoc-ref outputs "out"))
2858 (libdir (string-append out "/lib")))
2859 (copy-recursively "lib" libdir)
2860 (copy-recursively "include" (string-append out "/include"))
2861 (when (file-exists? "libseq/libmpiseq.a")
2862 (install-file "libseq/libmpiseq.a" libdir))
2863 (when (file-exists? "libseq/libmpiseq.so")
2864 (install-file "libseq/libmpiseq.so" libdir))
2866 (home-page "http://mumps.enseeiht.fr")
2867 (synopsis "Multifrontal sparse direct solver")
2869 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2870 sparse system of linear equations A x = b using Gaussian elimination.")
2871 (license license:cecill-c)))
2873 (define-public mumps-metis
2874 (package (inherit mumps)
2875 (name "mumps-metis")
2877 (alist-delete "scotch" (package-inputs mumps)))))
2879 (define-public mumps-openmpi
2880 (package (inherit mumps)
2881 (name "mumps-openmpi")
2884 ("scalapack" ,scalapack)
2885 ("pt-scotch" ,pt-scotch)
2886 ,@(alist-delete "scotch" (package-inputs mumps))))
2888 (substitute-keyword-arguments (package-arguments mumps)
2890 `(modify-phases ,phases
2891 (add-before 'check 'mpi-setup
2895 ((assoc-ref ,phases 'check)
2896 #:exec-prefix '("mpirun" "-n" "2"))))))))
2897 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2899 (define-public mumps-metis-openmpi
2900 (package (inherit mumps-openmpi)
2901 (name "mumps-metis-openmpi")
2903 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2905 (define-public ruby-asciimath
2907 (name "ruby-asciimath")
2912 (uri (rubygems-uri "asciimath" version))
2915 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2916 (build-system ruby-build-system)
2918 `(("ruby-nokogiri" ,ruby-nokogiri)
2919 ("ruby-rspec" ,ruby-rspec)))
2920 (synopsis "AsciiMath parsing and conversion library")
2922 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2923 easy-to-write markup language for mathematics.")
2924 (home-page "https://github.com/asciidoctor/asciimath")
2925 (license license:expat)))
2927 (define-public superlu
2934 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2935 "superlu_" version ".tar.gz"))
2937 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
2938 (modules '((guix build utils)))
2940 ;; Replace the non-free implementation of MC64 with a stub adapted
2943 (use-modules (ice-9 regex)
2945 (call-with-output-file "SRC/mc64ad.c"
2950 void mc64id_(int *a) {
2951 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2954 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2955 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2956 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2959 ;; Remove the corresponding license verbiage. MC64 license follows
2960 ;; a "------" line separator.
2961 (with-atomic-file-replacement "License.txt"
2962 (let ((rx (make-regexp "-{8}")))
2965 (let ((line (read-line in 'concat)))
2966 (unless (regexp-exec rx line)
2970 (build-system cmake-build-system)
2974 `(("blas" ,openblas)
2975 ("gfortran" ,gfortran)))
2977 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2978 "-DTPL_BLAS_LIBRARIES=openblas"
2979 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2980 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2981 (synopsis "Supernodal direct solver for sparse linear systems")
2983 "SuperLU is a general purpose library for the direct solution of large,
2984 sparse, nonsymmetric systems of linear equations on high performance machines.
2985 The library is written in C and is callable from either C or Fortran. The
2986 library routines perform an LU decomposition with partial pivoting and
2987 triangular system solves through forward and back substitution. The library
2988 also provides threshold-based ILU factorization preconditioners.")
2989 (license (list license:bsd-3
2990 license:gpl2+ ;EXAMPLE/*fgmr.c
2991 (license:fsf-free "file://SRC/colamd.h")))))
2993 (define-public superlu-dist
2995 (name "superlu-dist")
3001 (url "https://github.com/xiaoyeli/superlu_dist")
3002 (commit (string-append "v" version))))
3003 (file-name (git-file-name name version))
3005 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3006 (modules '((guix build utils)))
3008 ;; Replace the non-free implementation of MC64 with a stub
3010 (make-file-writable "SRC/mc64ad_dist.c")
3011 (call-with-output-file "SRC/mc64ad_dist.c"
3016 void mc64id_dist(int *a) {
3017 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3020 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3021 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3022 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3025 (substitute* "SRC/util.c" ;adjust default algorithm
3026 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3027 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3028 ;; general (i.e. non-square) processor-grid support.
3029 "RowPerm = NOROWPERM;"))
3031 (patches (search-patches "superlu-dist-scotchmetis.patch"
3032 "superlu-dist-awpm-grid.patch"))))
3033 (build-system cmake-build-system)
3037 `(("gfortran" ,gfortran)
3040 ("combblas" ,combinatorial-blas)))
3042 `(("mpi" ,openmpi) ;headers include MPI heades
3043 ("parmetis" ,pt-scotch32 "metis")
3044 ("pt-scotch" ,pt-scotch32)))
3046 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3047 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3048 "-DTPL_ENABLE_COMBBLASLIB=YES"
3049 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3050 "-DTPL_LAPACK_LIBRARIES=-llapack"
3051 (string-append "-DTPL_PARMETIS_LIBRARIES="
3053 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3054 "scotchmetis" "scotch" "scotcherr")
3056 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3057 (assoc-ref %build-inputs "parmetis")
3059 "-DTPL_ENABLE_COMBBLASLIB=ON"
3060 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3061 (assoc-ref %build-inputs "combblas")
3062 "/include/CombBLAS;"
3063 (assoc-ref %build-inputs "combblas")
3064 "/include/BipartiteMatchings")
3065 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3067 (modify-phases %standard-phases
3068 (add-before 'configure 'set-c++-standard
3070 (substitute* "CMakeLists.txt"
3071 ;; AWPM headers require C++14
3072 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3073 (add-before 'check 'mpi-setup
3075 (add-before 'check 'omp-setup
3076 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3077 (home-page (package-home-page superlu))
3078 (synopsis "Parallel supernodal direct solver")
3080 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3081 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3082 implemented in ANSI C, and MPI for communications.")
3083 (license license:bsd-3)))
3085 (define-public scotch
3092 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3093 "latestfile/298/scotch_" version ".tar.gz"))
3095 (base32 "1184fcv4wa2df8szb5lan6pjh0raarr45pk8ilpvbz23naikzg53"))
3096 (patches (search-patches "scotch-build-parallelism.patch"
3097 "scotch-integer-declarations.patch"))))
3098 (build-system gnu-build-system)
3104 (outputs '("out" "metis"))
3106 `(#:make-flags (list (string-append "prefix=" %output))
3108 (modify-phases %standard-phases
3110 'unpack 'chdir-to-src
3111 (lambda _ (chdir "src") #t))
3115 (call-with-output-file "Makefile.inc"
3129 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3130 LDFLAGS = -lz -lm -lrt -lpthread
3132 LEX = flex -Pscotchyy -olex.yy.c
3137 YACC = bison -pscotchyy -y -b y
3139 '("COMMON_FILE_COMPRESS_GZ"
3141 "COMMON_RANDOM_FIXED_SEED"
3142 "INTSIZE64" ;use 'int64_t'
3143 ;; Prevents symbol clashes with libesmumps
3145 ;; XXX: Causes invalid frees in superlu-dist tests
3147 ;; "SCOTCH_PTHREAD_NUMBER=2"
3148 "restrict=__restrict"))))
3150 (add-after 'build 'build-esmumps
3153 (format #f "-j~a" (parallel-job-count))
3155 (add-before 'install 'make-install-dirs
3156 (lambda* (#:key outputs #:allow-other-keys)
3157 (mkdir (assoc-ref outputs "out"))))
3158 (add-after 'install 'install-metis
3159 (lambda* (#:key outputs #:allow-other-keys)
3160 (let ((out (assoc-ref outputs "metis")))
3162 ;; metis files are not installed with 'make install'
3163 (for-each (lambda (f)
3164 (install-file f (string-append out "/include")))
3165 (find-files "../include/" ".*metis\\.h"))
3166 (for-each (lambda (f)
3167 (install-file f (string-append out "/lib")))
3168 (find-files "../lib/" ".*metis\\..*"))
3170 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3171 (synopsis "Programs and libraries for graph algorithms")
3172 (description "SCOTCH is a set of programs and libraries which implement
3173 the static mapping and sparse matrix reordering algorithms developed within
3174 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3175 conquer approach, to scientific computing problems such as graph and mesh
3176 partitioning, static mapping, and sparse matrix ordering, in application
3177 domains ranging from structural mechanics to operating systems or
3179 ;; See LICENSE_en.txt
3180 (license license:cecill-c)))
3182 (define-public scotch32
3183 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3184 ;; some applications.
3185 (package (inherit scotch)
3188 (substitute-keyword-arguments (package-arguments scotch)
3189 ((#:phases scotch-phases)
3190 `(modify-phases ,scotch-phases
3194 (call-with-output-file "Makefile.inc"
3208 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3209 LDFLAGS = -lz -lm -lrt -lpthread
3211 LEX = flex -Pscotchyy -olex.yy.c
3216 YACC = bison -pscotchyy -y -b y
3218 '("COMMON_FILE_COMPRESS_GZ"
3220 "COMMON_RANDOM_FIXED_SEED"
3221 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3222 ;; Prevents symbolc clashes with libesmumps
3224 ;; XXX: Causes invalid frees in superlu-dist tests
3226 ;; "SCOTCH_PTHREAD_NUMBER=2"
3227 "restrict=__restrict"))))))))))
3229 "Programs and libraries for graph algorithms (32-bit integers)")))
3231 (define-public pt-scotch
3232 (package (inherit scotch)
3235 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3237 (substitute-keyword-arguments (package-arguments scotch)
3238 ((#:phases scotch-phases)
3239 `(modify-phases ,scotch-phases
3243 (invoke "make" (format #f "-j~a" (parallel-job-count))
3244 "ptscotch" "ptesmumps")
3246 ;; Install the serial metis compatibility library
3247 (invoke "make" "-C" "libscotchmetis" "install")))
3248 (add-before 'check 'mpi-setup
3252 (invoke "make" "ptcheck")))))))
3253 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3255 (define-public pt-scotch32
3256 (package (inherit scotch32)
3257 (name "pt-scotch32")
3259 `(("openmpi" ,openmpi))) ;headers include MPI headers
3261 (substitute-keyword-arguments (package-arguments scotch32)
3262 ((#:phases scotch32-phases)
3263 `(modify-phases ,scotch32-phases
3266 (invoke "make" (format #f "-j~a" (parallel-job-count))
3267 "ptscotch" "ptesmumps")
3268 ;; Install the serial metis compatibility library
3269 (invoke "make" "-C" "libscotchmetis" "install")))
3270 (add-before 'check 'mpi-setup
3274 (invoke "make" "ptcheck")))))))
3276 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3278 (define-public metis
3285 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3286 "metis-" version ".tar.gz"))
3289 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3290 (build-system cmake-build-system)
3292 `(("blas" ,openblas)))
3294 `(#:tests? #f ;no tests
3295 #:configure-flags `("-DSHARED=ON"
3296 ,(string-append "-DGKLIB_PATH=" (getcwd)
3297 "/metis-" ,version "/GKlib"))))
3298 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3299 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3301 "METIS is a set of serial programs for partitioning graphs, partitioning
3302 finite element meshes, and producing fill-reducing orderings for sparse
3303 matrices. The algorithms implemented in METIS are based on the multilevel
3304 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3306 (license license:asl2.0))) ;As of version 5.0.3
3308 (define-public p4est
3315 (uri (string-append "http://p4est.github.io/release/p4est-"
3319 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3320 (build-system gnu-build-system)
3322 `(("fortran" ,gfortran)
3327 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3328 (assoc-ref %build-inputs "blas")
3330 ,(string-append "LAPACK_LIBS=-L"
3331 (assoc-ref %build-inputs "lapack")
3333 #:phases (modify-phases %standard-phases
3334 (add-before 'check 'mpi-setup
3336 (home-page "http://www.p4est.org")
3337 (synopsis "Adaptive mesh refinement on forests of octrees")
3339 "The p4est software library enables the dynamic management of a
3340 collection of adaptive octrees, conveniently called a forest of octrees.
3341 p4est is designed to work in parallel and scales to hundreds of thousands of
3343 (license license:gpl2+)))
3345 (define-public p4est-openmpi
3346 (package (inherit p4est)
3347 (name "p4est-openmpi")
3350 ,@(package-inputs p4est)))
3352 (substitute-keyword-arguments (package-arguments p4est)
3353 ((#:configure-flags cf)
3354 ``("--enable-mpi" ,@,cf))))
3355 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3357 (define-public gsegrafix
3364 (uri (string-append "mirror://gnu/" name "/" name "-"
3368 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3369 (build-system gnu-build-system)
3371 `(#:configure-flags '("LDFLAGS=-lm")))
3373 `(("libgnomecanvas" ,libgnomecanvas)
3374 ("libbonoboui" ,libbonoboui)
3375 ("libgnomeui" ,libgnomeui)
3376 ("libgnomeprintui" ,libgnomeprintui)
3379 `(("pkg-config" ,pkg-config)))
3380 (home-page "https://www.gnu.org/software/gsegrafix/")
3381 (synopsis "GNOME application to create scientific and engineering plots")
3382 (description "GSEGrafix is an application which produces high-quality graphical
3383 plots for science and engineering. Plots are specified via simple ASCII
3384 parameter files and data files and are presented in an anti-aliased GNOME
3385 canvas. The program supports rectangular two-dimensional plots, histograms,
3386 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3387 to BMP, JPEG or PNG image formats.")
3388 (license license:gpl3+)))
3390 (define-public maxima
3397 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3398 version "-source/" name "-" version ".tar.gz"))
3401 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3402 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3403 (build-system gnu-build-system)
3406 ("gnuplot" ,gnuplot) ;for plots
3408 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3410 `(("texinfo" ,texinfo)
3412 ("python" ,python)))
3415 (list "--enable-gcl"
3416 (string-append "--with-posix-shell="
3417 (assoc-ref %build-inputs "bash")
3419 (string-append "--with-wish="
3420 (assoc-ref %build-inputs "tk")
3422 (let ((v ,(package-version tk)))
3423 (string-take v (string-index-right v #\.)))))
3424 ;; By default Maxima attempts to write temporary files to
3425 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3426 ;; Work around that.
3427 #:make-flags (list "TMPDIR=/tmp")
3429 (modify-phases %standard-phases
3430 (add-after 'unpack 'patch-paths
3431 (lambda* (#:key inputs #:allow-other-keys)
3432 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3433 (coreutils (assoc-ref inputs "coreutils"))
3434 (dirname (string-append coreutils "/bin/dirname"))
3435 (head (string-append coreutils "/bin/head"))
3436 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3437 (python (string-append (assoc-ref inputs "python")
3439 (substitute* "src/maxima.in"
3440 (("sed ") (string-append sed " "))
3441 (("dirname") dirname)
3443 (substitute* "doc/info/Makefile.in"
3444 (("/usr/bin/env perl") perl))
3445 (substitute* "doc/info/build_html.sh.in"
3446 (("python") python))
3448 (add-before 'check 'pre-check
3450 (chmod "src/maxima" #o555)
3454 ;; This is derived from the testing code in the "debian/rules" file
3455 ;; of Debian's Maxima package.
3456 ;; If Maxima can successfully run this, the binary to be installed
3462 "--batch-string=\"run_testsuite();\" "
3463 "| grep -q \"No unexpected errors found\""))))
3464 ;; Make sure the doc and emacs files are found in the
3465 ;; standard location. Also configure maxima to find gnuplot
3466 ;; without having it on the PATH.
3467 (add-after 'install 'post-install
3468 (lambda* (#:key outputs inputs #:allow-other-keys)
3469 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3470 (out (assoc-ref outputs "out"))
3471 (datadir (string-append out "/share/maxima/" ,version))
3472 (binutils (string-append (assoc-ref inputs "binutils")
3474 (with-directory-excursion out
3475 (mkdir-p "share/emacs")
3476 (mkdir-p "share/doc")
3478 (string-append datadir "/doc/")
3479 (string-append out "/share/doc/maxima"))
3480 (with-atomic-file-replacement
3481 (string-append datadir "/share/maxima-init.lisp")
3483 (format out "~a ~s~a~%"
3484 "(setf $gnuplot_command "
3485 (string-append gnuplot "/bin/gnuplot") ")")
3486 (dump-port in out))))
3487 ;; Ensure that Maxima will have access to the GNU binutils
3488 ;; components at runtime.
3489 (wrap-program (string-append out "/bin/maxima")
3490 `("PATH" prefix (,binutils))))
3492 (home-page "http://maxima.sourceforge.net")
3493 (synopsis "Numeric and symbolic expression manipulation")
3494 (description "Maxima is a system for the manipulation of symbolic and
3495 numerical expressions. It yields high precision numeric results by using
3496 exact fractions, arbitrary precision integers, and variable precision floating
3498 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3499 ;; Others simply say "GNU General Public License" without stating a
3500 ;; version (which implicitly means gpl1+).
3501 ;; At least one file (src/maxima.asd) says "version 2."
3502 ;; GPLv2 only is therefore the smallest subset.
3503 (license license:gpl2)))
3505 (define-public wxmaxima
3513 (url "https://github.com/wxMaxima-developers/wxmaxima")
3514 (commit (string-append "Version-" version))))
3515 (file-name (git-file-name name version))
3517 (base32 "1rxnxk7yanb9ac5pxbii6k7gg3b09pbp9rmwvsvgpbrk17mg79r9"))))
3518 (build-system cmake-build-system)
3520 `(("gettext" ,gettext-minimal)))
3522 `(("libomp" ,libomp)
3523 ("wxwidgets" ,wxwidgets)
3526 ("adwaita-icon-theme" ,adwaita-icon-theme)
3528 ("shared-mime-info" ,shared-mime-info)))
3530 `(#:tests? #f ; tests fail non-deterministically
3532 (modify-phases %standard-phases
3533 (add-after 'unpack 'patch-doc-path
3535 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3536 ;; documentation. Only licensing information is placed there by
3538 (substitute* "src/Dirstructure.cpp"
3539 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3541 (add-after 'install 'wrap-program
3542 (lambda* (#:key inputs outputs #:allow-other-keys)
3543 (wrap-program (string-append (assoc-ref outputs "out")
3546 (,(string-append (assoc-ref inputs "maxima")
3548 ;; For GtkFileChooserDialog.
3549 `("GSETTINGS_SCHEMA_DIR" =
3550 (,(string-append (assoc-ref inputs "gtk+")
3551 "/share/glib-2.0/schemas")))
3552 `("XDG_DATA_DIRS" ":" prefix
3553 (;; Needed by gdk-pixbuf to know supported icon formats.
3555 (assoc-ref inputs "shared-mime-info") "/share")
3556 ;; The default icon theme of GTK+.
3558 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3560 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3561 (synopsis "Graphical user interface for the Maxima computer algebra system")
3563 "wxMaxima is a graphical user interface for the Maxima computer algebra
3564 system. It eases the use of Maxima by making most of its commands available
3565 through a menu system and by providing input dialogs for commands that require
3566 more than one argument. It also implements its own display engine that
3567 outputs mathematical symbols directly instead of depicting them with ASCII
3570 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3571 text and mathematical calculations to create documents, exporting of input and
3572 output to TeX, and a browser for Maxima's manual including command index and
3573 full text searching.")
3574 (license license:gpl2+)))
3576 (define-public armadillo
3582 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3586 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3587 (build-system cmake-build-system)
3588 (arguments `(#:tests? #f)) ; no test target
3590 `(("openblas" ,openblas)
3592 ("arpack" ,arpack-ng)))
3593 (home-page "http://arma.sourceforge.net/")
3594 (synopsis "C++ linear algebra library")
3596 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3597 between speed and ease of use. It is useful for algorithm development
3598 directly in C++, or quick conversion of research code into production
3599 environments. It can be used for machine learning, pattern recognition,
3600 signal processing, bioinformatics, statistics, econometrics, etc. The library
3601 provides efficient classes for vectors, matrices and cubes, as well as 150+
3602 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3603 (license license:asl2.0)))
3605 (define-public muparser
3606 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3607 ;; different hash. In order to make `guix package --upgrade` work correctly,
3608 ;; we set a Guix packaging revision.
3609 ;; When the next version of muparser is released, we can remove
3610 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3611 (let ((upstream-version "2.2.5")
3615 (version (string-append upstream-version "-" revision))
3620 (url "https://github.com/beltoforion/muparser")
3621 (commit (string-append "v" upstream-version))))
3622 (file-name (git-file-name name version))
3624 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3625 (build-system gnu-build-system)
3627 `(#:configure-flags '("--enable-samples=no")
3628 #:tests? #f)) ;no "check" target
3629 (home-page "http://muparser.beltoforion.de/")
3630 (synopsis "Fast parser library for mathematical expressions")
3632 "muParser is an extensible high performance math parser library. It is
3633 based on transforming an expression into a bytecode and precalculating constant
3635 (license license:expat))))
3637 (define-public openblas
3644 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3645 version "%20version.tar.gz"))
3646 (file-name (string-append name "-" version ".tar.gz"))
3649 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3650 (build-system gnu-build-system)
3652 `(#:test-target "test"
3653 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3654 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3655 ;; we need to disable substitutions.
3657 ,(let ((system (or (%current-target-system) (%current-system))))
3658 (or (string-prefix? "x86_64" system)
3659 (string-prefix? "i686" system)
3660 (string-prefix? "mips" system)
3661 (string-prefix? "aarch64" system)))
3663 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3665 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3667 ;; This is the maximum number of threads OpenBLAS will ever use (that
3668 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3669 ;; is used.) If we don't set it, the makefile sets it to the number
3670 ;; of cores of the build machine, which is obviously wrong.
3673 ;; Build the library for all supported CPUs. This allows
3674 ;; switching CPU targets at runtime with the environment variable
3675 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3676 ;; Unfortunately, this is not supported on non-x86 architectures,
3677 ;; where it leads to failed builds.
3678 ,@(let ((system (or (%current-target-system) (%current-system))))
3680 ((or (string-prefix? "x86_64" system)
3681 (string-prefix? "i686" system))
3682 '("DYNAMIC_ARCH=1"))
3683 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3684 ;; two available MIPS targets special extended instructions
3685 ;; for Loongson cores are used.
3686 ((string-prefix? "mips" system)
3687 '("TARGET=SICORTEX"))
3688 ;; On aarch64 force the generic 'armv8-a' target
3689 ((string-prefix? "aarch64" system)
3692 ;; no configure script
3694 (modify-phases %standard-phases
3696 (add-before 'build 'set-extralib
3697 (lambda* (#:key inputs #:allow-other-keys)
3698 ;; Get libgfortran found when building in utest.
3700 (string-append "-L" (assoc-ref inputs "fortran-lib")
3704 `(("fortran-lib" ,gfortran "lib")))
3707 ("fortran" ,gfortran)
3709 (home-page "https://www.openblas.net/")
3710 (synopsis "Optimized BLAS library based on GotoBLAS")
3712 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3713 (license license:bsd-3)))
3715 (define-public openblas-ilp64
3716 (package/inherit openblas
3717 (name "openblas-ilp64")
3718 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3720 (substitute-keyword-arguments (package-arguments openblas)
3721 ((#:make-flags flags '())
3722 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3724 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3725 (license license:bsd-3)))
3727 (define* (make-blis implementation #:optional substitutable?)
3728 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3729 source tree for a list of implementations.)
3731 SUBSTITUTABLE? determines whether the package is made available as a
3734 Currently the specialization must be selected at configure-time, but work is
3735 underway to allow BLIS to select the right optimized kernels at run time:
3736 <https://github.com/flame/blis/issues/129>."
3738 (name (if (string=? implementation "reference")
3740 (string-append "blis-" implementation)))
3742 (home-page "https://github.com/flame/blis")
3745 (uri (git-reference (url home-page) (commit version)))
3748 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3749 (file-name (git-file-name "blis" version))))
3750 (build-system gnu-build-system)
3752 `(#:test-target "test"
3754 #:substitutable? ,substitutable?
3756 #:phases (modify-phases %standard-phases
3758 (lambda* (#:key outputs #:allow-other-keys)
3759 ;; This is a home-made 'configure' script.
3760 (let ((out (assoc-ref outputs "out")))
3761 (invoke "./configure" "-p" out
3765 "--enable-threading=openmp"
3768 (add-before 'check 'show-test-output
3770 ;; By default "make check" is silent. Make it verbose.
3771 (system "tail -F output.testsuite &")
3773 (synopsis "High-performance basic linear algebra (BLAS) routines")
3775 "BLIS is a portable software framework for instantiating high-performance
3776 BLAS-like dense linear algebra libraries. The framework was designed to
3777 isolate essential kernels of computation that, when optimized, immediately
3778 enable optimized implementations of most of its commonly used and
3779 computationally intensive operations. While BLIS exports a new BLAS-like API,
3780 it also includes a BLAS compatibility layer which gives application developers
3781 access to BLIS implementations via traditional BLAS routine calls.")
3782 (license license:bsd-3)))
3785 ;; This is the "reference" implementation, which is the non-optimized but
3786 ;; portable variant (no assembly).
3787 (make-blis "reference" #t))
3789 (define ignorance blis)
3791 (define-syntax-rule (blis/x86_64 processor)
3792 "Expand to a package specialized for PROCESSOR."
3794 (inherit (make-blis processor))
3795 (supported-systems '("x86_64-linux"))))
3797 (define-public blis-sandybridge
3798 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3799 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3800 (blis/x86_64 "sandybridge"))
3802 (define-public blis-haswell
3803 ;; BLIS specialized for Haswell processors (launched 2013):
3804 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3805 (blis/x86_64 "haswell"))
3807 (define-public blis-knl
3808 ;; BLIS specialized for Knights Landing processor (launched 2016):
3809 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3810 (blis/x86_64 "knl"))
3813 (define-public openlibm
3821 (url "https://github.com/JuliaLang/openlibm")
3822 (commit (string-append "v" version))))
3823 (file-name (git-file-name name version))
3825 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3826 (build-system gnu-build-system)
3829 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3831 ;; no configure script
3832 (modify-phases %standard-phases (delete 'configure))
3833 #:tests? #f)) ;the tests are part of the default target
3834 (home-page "https://openlibm.org/")
3835 (synopsis "Portable C mathematical library (libm)")
3837 "OpenLibm is an effort to have a high quality, portable, standalone C
3838 mathematical library (libm). It can be used standalone in applications and
3839 programming language implementations. The project was born out of a need to
3840 have a good libm for the Julia programming language that worked consistently
3841 across compilers and operating systems, and in 32-bit and 64-bit
3843 ;; Each architecture has its own make target, and there is none for mips.
3844 (supported-systems (delete "mips64el-linux" %supported-systems))
3845 ;; See LICENSE.md for details.
3846 (license (list license:expat
3849 license:public-domain
3850 license:lgpl2.1+))))
3852 (define-public openspecfun
3854 (name "openspecfun")
3860 (url "https://github.com/JuliaLang/openspecfun")
3861 (commit (string-append "v" version))))
3862 (file-name (git-file-name name version))
3864 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3865 (build-system gnu-build-system)
3867 '(#:tests? #f ; no "check" target
3869 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3871 (modify-phases %standard-phases
3872 (delete 'configure)))) ; no configure script
3874 `(("fortran" ,gfortran)))
3875 (home-page "https://github.com/JuliaLang/openspecfun")
3876 (synopsis "Collection of special mathematical functions")
3878 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3879 portable package for Bessel Functions of a Complex Argument and Nonnegative
3880 Order; it contains subroutines for computing Bessel functions and Airy
3881 functions. Faddeeva allows computing the various error functions of arbitrary
3882 complex arguments (Faddeeva function, error function, complementary error
3883 function, scaled complementary error function, imaginary error function, and
3884 Dawson function); given these, one can also easily compute Voigt functions,
3885 Fresnel integrals, and similar related functions as well.")
3886 ;; Faddeeva is released under the Expat license; AMOS is included as
3887 ;; public domain software.
3888 (license (list license:expat license:public-domain))))
3890 (define-public suitesparse
3892 (name "suitesparse")
3898 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3899 (commit (string-append "v" version))))
3900 (file-name (git-file-name name version))
3903 "0qjlyfxs8s48rs63c2fzspisgq1kk4bwkgnhmh125hgkdhrq2w1c"))
3904 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3905 (modules '((guix build utils)))
3907 ;; Remove bundled metis source
3909 (delete-file-recursively "metis-5.1.0")
3911 (build-system gnu-build-system)
3913 '(#:tests? #f ;no "check" target
3917 "MY_METIS_LIB=-lmetis"
3918 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3919 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3920 (assoc-ref %outputs "out")
3921 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3922 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3923 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3924 " -DCMAKE_SKIP_RPATH=TRUE"
3925 " -DCMAKE_BUILD_TYPE=Release"
3926 " -DCMAKE_INSTALL_LIBDIR=lib")
3927 (string-append "INSTALL_LIB="
3928 (assoc-ref %outputs "out") "/lib")
3929 (string-append "INSTALL_INCLUDE="
3930 (assoc-ref %outputs "out") "/include")
3933 (modify-phases %standard-phases
3934 (delete 'configure)))) ;no configure script
3942 `(("cmake" ,cmake-minimal)
3944 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3945 (synopsis "Suite of sparse matrix software")
3947 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3948 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3949 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3950 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3951 CXSparse, a concise sparse Cholesky factorization package; and many other
3954 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3956 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3957 (license (list license:gpl2+ license:lgpl2.1+))))
3959 (define-public atlas
3965 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3966 version "/atlas" version ".tar.bz2"))
3969 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3970 (build-system gnu-build-system)
3971 (home-page "http://math-atlas.sourceforge.net/")
3972 (inputs `(("gfortran" ,gfortran)
3973 ("lapack-tar" ,(package-source lapack))))
3974 (outputs '("out" "doc"))
3975 ;; For the moment we drop support for MIPS at it fails to compile. See
3976 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3977 (supported-systems (delete "mips64el-linux" %supported-systems))
3979 `(#:parallel-build? #f
3980 #:parallel-tests? #f
3982 ;; ATLAS tunes itself for the machine it is built on, as explained at
3983 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3984 ;; For this reason, we want users to build it locally instead of using
3988 #:modules ((srfi srfi-26)
3989 (guix build gnu-build-system)
3992 `(;; Generate position independent code suitable for dynamic libraries
3993 ;; and use WALL timer to get more accurate timing.
3994 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3997 ,,(if (string-match "64" (%current-system))
4000 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4001 ;; needed to compile C files before it is generated.
4002 "-Ss" "pmake" "make -j 1"
4003 ;; Probe is failing for MIPS. We therefore define the system
4004 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4005 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4006 ,,@(if (string-prefix? "mips" (%current-system))
4007 (list "-A" "49" "-V" "1")
4009 ;; Generate shared libraries.
4011 ;; Build a full LAPACK library.
4012 ,(string-append "--with-netlib-lapack-tarfile="
4013 (assoc-ref %build-inputs "lapack-tar")))
4015 (modify-phases %standard-phases
4016 (add-after 'install 'install-doc
4017 (lambda* (#:key outputs inputs #:allow-other-keys)
4018 (let ((doc (string-append (assoc-ref outputs "doc")
4019 "/share/doc/atlas")))
4021 (for-each (cut install-file <> doc)
4022 (find-files "../ATLAS/doc" ".*"))
4024 (add-after 'check 'check-pt
4025 (lambda _ (invoke "make" "ptcheck")))
4026 ;; Fix files required to run configure.
4027 (add-before 'configure 'fix-/bin/sh
4029 ;; Use `sh', not `/bin/sh'.
4030 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4034 ;; Fix /bin/sh in generated make files.
4035 (add-after 'configure 'fix-/bin/sh-in-generated-files
4037 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4041 ;; ATLAS configure program does not accepts the default flags
4042 ;; passed by the 'gnu-build-system'.
4044 (lambda* (#:key native-inputs inputs outputs
4045 (configure-flags '())
4046 #:allow-other-keys #:rest args)
4047 (let* ((prefix (assoc-ref outputs "out"))
4048 (bash (or (and=> (assoc-ref
4049 (or native-inputs inputs) "bash")
4050 (cut string-append <> "/bin/bash"))
4052 (flags `(,(string-append "--prefix=" prefix)
4054 (abs-srcdir (getcwd))
4055 (srcdir (string-append "../" (basename abs-srcdir))))
4056 (format #t "source directory: ~s (relative from build: ~s)~%"
4060 (format #t "build directory: ~s~%" (getcwd))
4061 (format #t "configure flags: ~s~%" flags)
4063 (string-append srcdir "/configure")
4065 (synopsis "Automatically Tuned Linear Algebra Software")
4067 "ATLAS is an automatically tuned linear algebra software library
4068 providing C and Fortran77 interfaces to a portably efficient BLAS
4069 implementation, as well as a few routines from LAPACK.
4071 Optimization occurs at build time. For this reason, the library is built on
4072 the machine where it is installed, without resorting to pre-built substitutes.
4074 Before building the library, CPU throttling should be disabled. This can be
4075 done in the BIOS, or, on GNU/Linux, with the following command:
4078 # cpupower --governor performance
4081 Failure to do so will result in a library with poor performance.")
4082 (license license:bsd-3)))
4091 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4092 version "/glm-" version ".zip"))
4094 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4095 (build-system cmake-build-system)
4097 `(#:phases (modify-phases %standard-phases
4099 (lambda* (#:key outputs #:allow-other-keys)
4100 ;; Since version 0.9.9.6, 'make install' is not supported
4101 ;; and we have to do it "manually". Upstream discussion:
4102 ;; <https://github.com/g-truc/glm/pull/968>.
4103 (let* ((source (string-append "../glm"))
4104 (out (assoc-ref outputs "out"))
4105 (inc (string-append out "/include"))
4106 (lib (string-append out "/lib"))
4107 (pkgconfig (string-append lib "/pkgconfig")))
4108 (with-directory-excursion source
4111 (copy-recursively "glm" (string-append inc "/glm"))
4112 (copy-recursively "cmake" (string-append lib "/cmake"))
4113 (call-with-output-file (string-append pkgconfig "/glm.pc")
4117 includedir=${prefix}/include
4120 Description: OpenGL Mathematics
4122 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4125 `(("unzip" ,unzip)))
4126 (home-page "https://glm.g-truc.net/")
4127 (synopsis "OpenGL Mathematics library")
4128 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4129 library for graphics software based on the OpenGL Shading Language (GLSL)
4131 (license license:expat)))
4133 (define-public lpsolve
4140 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4141 "/lp_solve_" version "_source.tar.gz"))
4144 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4145 (modules '((guix build utils)))
4148 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4150 ;; Pretend to be on a 64 bit platform to obtain a common directory
4151 ;; name for the build results on all architectures; nothing else
4152 ;; seems to depend on it.
4153 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4155 ;; The check for 'isnan' as it is written fails with
4156 ;; "non-floating-point argument in call to function
4157 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4158 ;; definition, which in turn leads to bad things. Fix the feature
4160 (("isnan\\(0\\)") "isnan(0.)"))
4162 (build-system gnu-build-system)
4164 `(#:tests? #f ; no check target
4166 (modify-phases %standard-phases
4167 (delete 'configure) ; no configure script
4170 (with-directory-excursion "lpsolve55"
4171 (invoke "bash" "ccc"))
4172 (with-directory-excursion "lp_solve"
4173 (invoke "bash" "ccc"))
4176 (lambda* (#:key outputs #:allow-other-keys)
4177 (let* ((out (assoc-ref outputs "out"))
4178 (bin (string-append out "/bin"))
4179 (lib (string-append out "/lib"))
4180 ;; This is where LibreOffice expects to find the header
4181 ;; files, and where they are installed by Debian.
4182 (include (string-append out "/include/lpsolve")))
4183 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4184 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4185 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4187 ;; Install a subset of the header files as on Debian
4188 ;; (plus lp_bit.h, which matches the regular expression).
4189 (for-each (lambda (name)
4190 (install-file name include))
4191 (find-files "." "lp_[HMSa-z].*\\.h$"))
4192 (with-directory-excursion "shared"
4193 (for-each (lambda (name)
4194 (install-file name include))
4195 (find-files "." "\\.h$")))
4197 (home-page "http://lpsolve.sourceforge.net/")
4198 (synopsis "Mixed integer linear programming (MILP) solver")
4200 "lp_solve is a mixed integer linear programming solver based on the
4201 revised simplex and the branch-and-bound methods.")
4202 (license license:lgpl2.1+)))
4204 (define-public dealii
4211 (uri (string-append "https://github.com/dealii/dealii/releases/"
4212 "download/v" version "/dealii-" version ".tar.gz"))
4215 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4216 (modules '((guix build utils)))
4218 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4220 (delete-file-recursively "bundled")
4222 (build-system cmake-build-system)
4230 ("arpack" ,arpack-ng)
4231 ("muparser" ,muparser)
4232 ("gfortran" ,gfortran)
4233 ("suitesparse" ,suitesparse))) ;for UMFPACK
4235 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4237 ;; Work around a bug in libsuitesparseconfig linking
4238 ;; see https://github.com/dealii/dealii/issues/4745
4239 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4240 (home-page "https://www.dealii.org")
4241 (synopsis "Finite element library")
4243 "Deal.II is a C++ program library targeted at the computational solution
4244 of partial differential equations using adaptive finite elements. The main
4245 aim of deal.II is to enable rapid development of modern finite element codes,
4246 using among other aspects adaptive meshes and a wide array of tools often used
4247 in finite element programs.")
4248 (license license:lgpl2.1+)))
4250 (define-public dealii-openmpi
4251 (package (inherit dealii)
4252 (name "dealii-openmpi")
4255 ;;Supported only with MPI:
4256 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4257 ("p4est" ,p4est-openmpi)
4258 ("petsc" ,petsc-openmpi)
4259 ("slepc" ,slepc-openmpi)
4260 ("metis" ,metis) ;for MUMPS
4261 ("scalapack" ,scalapack) ;for MUMPS
4262 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4263 ("arpack" ,arpack-ng-openmpi)
4264 ,@(fold alist-delete (package-inputs dealii)
4265 '("p4est" "arpack"))))
4267 (substitute-keyword-arguments (package-arguments dealii)
4268 ((#:configure-flags cf)
4269 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4271 ((#:phases phases '%standard-phases)
4272 `(modify-phases ,phases
4273 (add-before 'check 'mpi-setup
4274 ,%openmpi-setup)))))
4275 (synopsis "Finite element library (with MPI support)")))
4277 (define-public flann
4281 (home-page "https://github.com/mariusmuja/flann/")
4285 (uri (git-reference (url home-page) (commit version)))
4286 (file-name (git-file-name name version))
4289 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4290 (patches (search-patches "flann-cmake-3.11.patch"))))
4291 (build-system cmake-build-system)
4294 `(("unzip" ,unzip)))
4297 ;; FIXME: 'mkoctfile' fails with a linker error:
4298 ;; ld: cannot find -loctinterp
4299 ;; ld: cannot find -loctave
4300 ;; Disable it for now.
4301 ;;("octave" ,octave-cli)
4302 ("python" ,python-2) ; print syntax
4303 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4306 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4307 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4308 #:strip-directories '("lib" "lib64" "libexec"
4309 "bin" "sbin" "share/flann/octave")
4311 ;; Save 12 MiB by not installing .a files. Passing
4312 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4313 #:phases (modify-phases %standard-phases
4314 (add-after 'install 'remove-static-libraries
4315 (lambda* (#:key outputs #:allow-other-keys)
4316 (let* ((out (assoc-ref outputs "out"))
4317 (lib (string-append out "/lib")))
4318 (for-each delete-file
4319 (find-files lib "\\.a$"))
4322 #:tests? #f)) ; The test data are downloaded from the Internet.
4323 (synopsis "Library for approximate nearest neighbors computation")
4324 (description "FLANN is a library for performing fast approximate
4325 nearest neighbor searches in high dimensional spaces. It implements a
4326 collection of algorithms and a system for automatically choosing the best
4327 algorithm and optimum parameters depending on the dataset.
4329 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4330 (license (license:non-copyleft "file://COPYING"
4331 "See COPYING in the distribution."))))
4333 (define-public wcalc
4340 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4341 "wcalc-" version ".tar.bz2"))
4344 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4345 (build-system gnu-build-system)
4348 ("readline" ,readline)))
4349 (home-page "http://w-calc.sourceforge.net/index.php")
4350 (synopsis "Flexible command-line scientific calculator")
4351 (description "Wcalc is a very capable calculator. It has standard functions
4352 (sin, asin, and sinh for example, in either radians or degrees), many
4353 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4354 variables, a command history, hex/octal/binary input and output, unit
4355 conversions, embedded comments, and an expandable expression entry field. It
4356 evaluates expressions using the standard order of operations.")
4357 (license license:gpl2+)))
4366 (url "https://github.com/xaos-project/XaoS")
4367 (commit (string-append "release-" version))))
4368 (file-name (git-file-name name version))
4371 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4372 (build-system gnu-build-system)
4373 (native-inputs `(("gettext" ,gettext-minimal)
4375 ("qttools" ,qttools)))
4376 (inputs `(("libx11" ,libx11)
4380 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4381 ;; not enough for this package to install properly. These phases fix that.
4383 `(#:tests? #f ;no "check" target
4385 (modify-phases %standard-phases
4386 (add-before 'configure 'make-qt-deterministic
4388 ;; Make Qt deterministic.
4389 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4392 (lambda* (#:key outputs #:allow-other-keys)
4393 (let ((out (assoc-ref outputs "out")))
4394 ;; The DESTDIR is originally set to install the xaos binary to
4395 ;; the "bin" folder inside the build directory. Setting make
4396 ;; flags doesn't seem to change this.
4397 (substitute* "XaoS.pro"
4399 (string-append "DESTDIR=" out "/bin")))
4400 (substitute* "src/include/config.h"
4401 (("/usr/share/XaoS")
4402 (string-append out "/share/XaoS")))
4404 (add-after 'install 'install-data
4405 (lambda* (#:key outputs #:allow-other-keys)
4406 (let* ((out (assoc-ref outputs "out"))
4407 (share (string-append out "/share")))
4411 (copy-recursively folder
4412 (string-append share "/XaoS/" folder)))
4413 '("catalogs" "examples" "tutorial"))
4414 (install-file "xdg/xaos.png"
4415 (string-append share "/pixmaps"))
4416 (install-file "xdg/xaos.desktop"
4417 (string-append share "/applications")))
4419 (synopsis "Real-time fractal zoomer")
4420 (description "GNU XaoS is a graphical program that generates fractal
4421 patterns and allows you to zoom in and out of them infinitely in a fluid,
4422 continuous manner. It also includes tutorials that help to explain how fractals
4423 are built. It can generate many different fractal types such as the Mandelbrot
4425 (home-page "https://xaos-project.github.io/")
4426 (license license:gpl2+)))
4428 (define-public hypre
4436 (url "https://github.com/LLNL/hypre")
4437 (commit (string-append "v" version))))
4438 (file-name (git-file-name name version))
4440 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4441 (modules '((guix build utils)))
4444 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4445 ;; substitute the release date.
4446 (substitute* "src/utilities/HYPRE_utilities.h"
4447 (("Date Compiled: .*$")
4448 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4450 (build-system gnu-build-system)
4451 (outputs '("out" ; 6.1 MiB of headers and libraries
4452 "doc")) ; 4.8 MiB of documentation
4456 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4457 ("texlive" ,(texlive-union (list texlive-xypic
4459 texlive-latex-hyperref
4461 ("ghostscript" ,ghostscript)))
4463 `(("blas" ,openblas)
4464 ("lapack" ,lapack)))
4466 `(#:modules ((srfi srfi-1)
4467 ,@%gnu-build-system-modules)
4468 #:configure-flags '("--enable-shared"
4476 (modify-phases %standard-phases
4477 (add-before 'build 'set-HOME
4479 ;; FIXME: texlive-union does not find the built
4480 ;; metafonts, so it tries to generate them in HOME.
4481 (setenv "HOME" "/tmp")
4483 (add-before 'configure 'chdir-src
4484 (lambda _ (chdir "src")))
4486 (lambda* (#:key build target configure-flags
4487 #:allow-other-keys #:rest args)
4488 (let* ((configure (assoc-ref %standard-phases 'configure)))
4491 (list #:configure-flags
4492 (cons (string-append
4493 "--host=" (or target build))
4494 configure-flags)))))))
4495 (add-after 'build 'build-docs
4497 (invoke "make" "-Cdocs" "pdf" "html")))
4500 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4501 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4502 (invoke "make" "check" "CHECKRUN=")
4503 (for-each (lambda (filename)
4504 (let ((size (stat:size (stat filename))))
4505 (when (positive? size)
4506 (error (format #f "~a size ~d; error indication~%"
4508 (find-files "test" ".*\\.err$"))
4510 (add-after 'install 'install-docs
4511 (lambda* (#:key outputs #:allow-other-keys)
4512 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4513 (let* ((doc (assoc-ref outputs "doc"))
4514 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4515 (with-directory-excursion "docs"
4516 (for-each (lambda (base)
4517 (install-file (string-append base ".pdf") docdir)
4518 (copy-recursively base docdir)) ; html docs
4519 '("HYPRE_usr_manual"
4520 "HYPRE_ref_manual")))
4522 (home-page "http://www.llnl.gov/casc/hypre/")
4523 (synopsis "Library of solvers and preconditioners for linear equations")
4525 "HYPRE is a software library of high performance preconditioners and
4526 solvers for the solution of large, sparse linear systems of equations. It
4527 features multigrid solvers for both structured and unstructured grid
4529 (license license:lgpl2.1)))
4531 (define-public hypre-openmpi
4532 (package (inherit hypre)
4533 (name "hypre-openmpi")
4536 ,@(package-inputs hypre)))
4538 (substitute-keyword-arguments (package-arguments hypre)
4539 ((#:configure-flags flags)
4541 ,@(delete "--without-MPI" ,flags)))
4543 `(modify-phases ,phases
4544 (add-before 'check 'mpi-setup
4545 ,%openmpi-setup)))))
4546 (synopsis "Parallel solvers and preconditioners for linear equations")
4548 "HYPRE is a software library of high performance preconditioners and
4549 solvers for the solution of large, sparse linear systems of equations on
4550 parallel computers. It features parallel multigrid solvers for both
4551 structured and unstructured grid problems.")))
4553 (define-public matio
4560 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4561 "matio-" version ".tar.gz"))
4564 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
4565 (build-system gnu-build-system)
4568 ("hdf5" ,hdf5-1.8)))
4569 (home-page "http://matio.sourceforge.net/")
4570 (synopsis "Library for reading and writing MAT files")
4571 (description "Matio is a library for reading and writing MAT files. It
4572 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4573 (license license:bsd-2)))
4580 (origin (method url-fetch)
4581 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4582 "download/" version "/Vc-" version ".tar.gz"))
4585 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4586 (build-system cmake-build-system)
4589 '("-DBUILD_TESTING=ON"
4590 ;; By default, Vc will optimize for the CPU of the build machine.
4591 ;; Setting this to "none" makes it create portable binaries. See
4592 ;; "cmake/OptimizeForArchitecture.cmake".
4593 "-DTARGET_ARCHITECTURE=none")
4594 #:phases (modify-phases %standard-phases
4595 (add-after 'unpack 'copy-testdata
4596 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4597 (let ((testdata (assoc-ref (or native-inputs inputs)
4599 (copy-recursively testdata "tests/testdata")
4602 `(("virtest" ,virtest)
4604 ;; This is a submodule in the git project, but not part of the
4605 ;; released sources. See the git branch for the commit to take.
4606 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4610 (url "https://github.com/VcDevel/vc-testdata")
4611 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4612 (file-name (git-file-name "vc-testdata"
4613 (string-take commit 7)))
4616 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4617 (synopsis "SIMD vector classes for C++")
4618 (description "Vc provides portable, zero-overhead C++ types for explicitly
4619 data-parallel programming. It is a library designed to ease explicit
4620 vectorization of C++ code. Its types enable explicitly stating data-parallel
4621 operations on multiple values. The parallelism is therefore added via the type
4622 system. Vc has an intuitive API and provides portability between different
4623 compilers and compiler versions as well as portability between different vector
4624 instruction sets. Thus, an application written with Vc can be compiled for:
4627 @item SSE2 up to SSE4.2 or SSE4a
4630 @item NEON (in development)
4631 @item NVIDIA GPUs / CUDA (in development)
4633 (home-page "https://github.com/VcDevel/Vc")
4634 ;; "No support_???.cpp file exists for this architecture."
4635 (supported-systems '("x86_64-linux" "i686-linux"))
4636 (license license:bsd-3)))
4638 (define-public reducelcs
4639 ;; This is the last commit which is available upstream, no
4640 ;; release happened since 2010.
4641 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4645 (version (string-append "1.0-" revision "." (string-take commit 7)))
4650 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4652 (file-name (string-append name "-" version "-checkout"))
4655 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4656 (build-system gnu-build-system)
4658 `(("openlibm" ,openlibm)))
4660 `(#:tests? #f ; no tests
4662 (modify-phases %standard-phases
4663 (delete 'configure) ; No configure script exists.
4664 (replace 'install ; No install phase exists.
4665 (lambda* (#:key outputs #:allow-other-keys)
4666 (let* ((out (assoc-ref outputs "out"))
4667 (bin (string-append out "/bin")))
4668 (install-file "Approximation" bin)
4669 (install-file "CollectResults" bin)
4670 (install-file "GenerateInstances" bin)
4672 (synopsis "Approximate Longest Commons Subsequence computation tool")
4674 "@code{reduceLCS} is an implementation of the Reduce-Expand
4675 algorithm for LCS. It is a fast program to compute the approximate
4676 Longest Commons Subsequence of a set of strings.")
4677 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4678 (license license:gpl3+))))
4680 (define-public jacal
4687 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4690 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4691 (patches (search-patches "jacal-fix-texinfo.patch"))))
4692 (build-system gnu-build-system)
4695 (modify-phases %standard-phases
4696 (add-before 'build 'pre-build
4697 ;; Don't use upstream's script - it really doesn't fit into
4698 ;; Guix's functional paradigm.
4699 (lambda* (#:key inputs outputs #:allow-other-keys)
4700 (substitute* "Makefile"
4701 (("^install: install-script") "install: "))))
4702 (add-after 'install 'post-install
4703 ;; Instead, we provide our own simplified script.
4704 (lambda* (#:key inputs outputs #:allow-other-keys)
4705 (let ((wrapper (string-append (assoc-ref outputs "out")
4707 (format (open wrapper (logior O_WRONLY O_CREAT))
4708 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4709 "-e '(slib:load \"~a/lib/jacal/math\") "
4712 (assoc-ref inputs "scm")
4713 (assoc-ref outputs "out"))
4714 (chmod wrapper #o555))))
4716 (lambda* (#:key outputs #:allow-other-keys)
4717 (invoke "./configure"
4718 (string-append "--prefix="
4719 (assoc-ref outputs "out"))))))))
4720 (inputs `(("scm" ,scm)))
4721 (native-inputs `(("unzip" ,unzip)
4722 ("texinfo" ,texinfo)))
4723 (synopsis "Symbolic mathematics system")
4724 (description "GNU JACAL is an interactive symbolic mathematics program based on
4725 Scheme. It manipulate and simplify a range of mathematical expressions such
4726 as equations, scalars, vectors, and matrices.")
4727 (home-page "https://www.gnu.org/software/jacal/")
4728 (license license:gpl3+)))
4734 (home-page "https://github.com/Z3Prover/z3")
4737 (uri (git-reference (url home-page)
4738 (commit (string-append "z3-" version))))
4739 (file-name (git-file-name name version))
4742 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4743 (build-system gnu-build-system)
4745 `(#:imported-modules ((guix build python-build-system)
4746 ,@%gnu-build-system-modules)
4747 #:modules (((guix build python-build-system) #:select (site-packages))
4748 (guix build gnu-build-system)
4751 (modify-phases %standard-phases
4752 (add-after 'unpack 'enable-bytecode-determinism
4754 (setenv "PYTHONHASHSEED" "0")
4756 (add-after 'unpack 'fix-compatability
4757 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4759 (substitute* "src/util/mpz.cpp"
4760 (("#include <immintrin.h>") ""))
4762 (add-before 'configure 'bootstrap
4764 (invoke "python" "scripts/mk_make.py")))
4765 ;; work around gnu-build-system's setting --enable-fast-install
4766 ;; (z3's `configure' is a wrapper around the above python file,
4767 ;; which fails when passed --enable-fast-install)
4769 (lambda* (#:key inputs outputs #:allow-other-keys)
4770 (invoke "./configure"
4772 (string-append "--prefix=" (assoc-ref outputs "out"))
4773 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4774 (add-after 'configure 'change-directory
4778 (add-before 'check 'make-test-z3
4780 ;; Build the test suite executable.
4781 (invoke "make" "test-z3" "-j"
4782 (number->string (parallel-job-count)))))
4785 ;; Run all the tests that don't require arguments.
4786 (invoke "./test-z3" "/a"))))))
4789 ("python" ,python-wrapper)))
4790 (synopsis "Theorem prover")
4791 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4792 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4793 (license license:expat)))
4798 (version "2018.11.001")
4801 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4802 version "/elpa-" version ".tar.gz"))
4805 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4806 (build-system gnu-build-system)
4808 `(("fortran" ,gfortran)
4809 ("perl" ,perl))) ;for configure and deps
4811 `(("blas" ,openblas)))
4816 ;; ELPA unfortunately does not support runtime dispatch, so we can
4817 ;; only enable the "generic" kernels. See the "Cross compilation"
4818 ;; section of INSTALL.md.
4820 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4821 "--disable-avx" "--disable-avx2" "--disable-avx512"
4822 ,(string-append "CFLAGS=-O3 "
4823 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4824 "-ftree-vect-loop-version -ftree-vectorize "
4825 ,(let ((system (or (%current-target-system)
4826 (%current-system))))
4828 ((or (string-prefix? "x86_64" system)
4829 (string-prefix? "i686" system))
4832 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4834 (modify-phases %standard-phases
4835 (add-before 'configure 'patch-header-generation
4837 (substitute* "configure"
4838 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4839 (string-append & " CPP=\"$CPP\"")))
4841 (add-before 'check 'setup-tests
4843 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4844 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4845 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4846 ;; for Fortran. This also causes several tests to pass that
4847 ;; otherwise would otherwise fail with matrix size 5000; possibly
4848 ;; due to floating point tolerances that are too tight.
4849 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4850 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4851 (substitute* "Makefile"
4852 ;; Test scripts are generated, patch the shebang
4853 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4855 (home-page "http://elpa.mpcdf.mpg.de")
4856 (synopsis "Eigenvalue solvers for symmetric matrices")
4858 "The ELPA library provides efficient and scalable direct eigensolvers for
4859 symmetric matrices.")
4860 (license license:lgpl3)))
4862 (define-public elpa-openmpi
4863 (package (inherit elpa)
4864 (name "elpa-openmpi")
4867 ("scalapack" ,scalapack)
4868 ,@(package-inputs elpa)))
4870 (substitute-keyword-arguments (package-arguments elpa)
4871 ((#:configure-flags cf '())
4872 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4873 ((#:phases phases '%standard-phases)
4874 `(modify-phases ,phases
4875 (add-before 'check 'mpi-setup
4877 ;; Tests use 2 mpi tasks by default, use our remaining build
4878 ;; cores as OpenMP threads.
4879 (setenv "OMP_NUM_THREADS" (number->string
4880 (max (quotient (parallel-job-count) 2)
4882 (,%openmpi-setup)))))))
4883 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4885 (define-public elemental
4892 (url "https://github.com/elemental/Elemental")
4893 (commit (string-append "v" version))))
4894 (file-name (git-file-name name version))
4897 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4898 (build-system cmake-build-system)
4899 (home-page "https://github.com/elemental/Elemental")
4901 `(("gfortran" ,gfortran)))
4903 `(("blas" ,openblas)
4904 ("gfortran:lib" ,gfortran "lib")
4913 `(#:build-type "Release" ;default RelWithDebInfo not supported
4914 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4915 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4916 "-DEL_CACHE_WARNINGS:BOOL=YES"
4917 "-DEL_TESTS:BOOL=YES"
4918 "-DCMAKE_INSTALL_LIBDIR=lib"
4919 "-DGFORTRAN_LIB=gfortran")
4920 #:phases (modify-phases %standard-phases
4921 (add-before 'check 'mpi-setup
4923 (add-before 'check 'setup-tests
4925 ;; Parallelism is done at the MPI layer.
4926 (setenv "OMP_NUM_THREADS" "1")
4928 (add-after 'install 'remove-tests
4929 (lambda* (#:key outputs #:allow-other-keys)
4930 ;; Tests are installed, with no easy configuration
4931 ;; switch to prevent this, so delete them.
4932 (delete-file-recursively
4933 (string-append (assoc-ref outputs "out") "/bin"))
4935 (synopsis "Dense and sparse-direct linear algebra and optimization")
4936 (description "Elemental is a modern C++ library for distributed-memory
4937 dense and sparse-direct linear algebra, conic optimization, and lattice
4939 (license license:bsd-2)))
4941 (define-public mcrl2
4944 (version "202006.0")
4948 "https://www.mcrl2.org/download/release/mcrl2-"
4952 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4957 ("qtbase" ,qtbase)))
4958 (build-system cmake-build-system)
4959 (synopsis "Toolset for the mCRL2 formal specification language")
4961 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4962 specification language for describing concurrent discrete event systems. Its
4963 toolset supports analysis and automatic verification, linearisation, simulation,
4964 state-space exploration and generation, and tools to optimise and analyse
4965 specifications. Also, state spaces can be manipulated, visualised and
4967 (home-page "https://mcrl2.org")
4968 (license license:boost1.0)))
4970 (define-public mcrl2-minimal
4973 (name "mcrl2-minimal")
4975 `(("boost" ,boost)))
4977 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4979 (define-public tcalc
4986 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4990 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4991 (build-system gnu-build-system)
4992 (synopsis "The terminal calculator")
4994 "The terminal calculator is a small program to help users of the GNU/Linux
4995 terminal do calculations simply and quickly. The formula to be calculated can
4996 be fed to @command{tcalc} through the command line.")
4997 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4998 (license license:gpl3+)))
5000 (define-public tiny-bignum
5001 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5003 (name "tiny-bignum")
5004 (version (git-version "0" "0" commit))
5009 (url "https://github.com/kokke/tiny-bignum-c")
5011 (file-name (git-file-name "tiny-bignum" commit))
5013 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5014 (build-system gnu-build-system)
5017 (modify-phases %standard-phases
5019 (add-after 'unpack 'patch-tests
5021 (substitute* "scripts/test_rand.py"
5023 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5026 (lambda* (#:key tests? #:allow-other-keys)
5028 (invoke "make" "test"))
5031 (lambda* (#:key outputs #:allow-other-keys)
5032 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5033 (doc (string-append (assoc-ref outputs "out") "/doc")))
5035 (install-file "bn.c" share)
5036 (install-file "bn.h" share)
5038 (install-file "LICENSE" doc)
5039 (install-file "README.md" doc))
5042 `(("python" ,python-wrapper)))
5043 (home-page "https://github.com/kokke/tiny-bignum-c")
5044 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5046 "This library provides portable Arbitrary-precision unsigned integer
5047 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5048 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5049 and comparisons are supported.")
5050 (license license:unlicense))))
5052 (define-public sundials
5059 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5060 "sundials-" version ".tar.gz"))
5063 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5064 (build-system cmake-build-system)
5066 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5068 `(("fortran" ,gfortran) ;for fcmix
5070 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5072 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5073 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5074 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5075 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5076 "-DEXAMPLES_INSTALL:BOOL=OFF"
5078 "-DFCMIX_ENABLE:BOOL=ON"
5080 "-DKLU_ENABLE:BOOL=ON"
5081 ,(string-append "-DKLU_INCLUDE_DIR="
5082 (assoc-ref %build-inputs "suitesparse")
5084 ,(string-append "-DKLU_LIBRARY_DIR="
5085 (assoc-ref %build-inputs "suitesparse")
5087 (home-page "https://computation.llnl.gov/projects/sundials")
5088 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5089 (description "SUNDIALS is a family of software packages implemented with
5090 the goal of providing robust time integrators and nonlinear solvers that can
5091 easily be incorporated into existing simulation codes.")
5092 (license license:bsd-3)))
5094 (define-public sundials-openmpi
5095 (package (inherit sundials)
5096 (name "sundials-openmpi")
5099 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5100 ,@(package-inputs sundials)))
5102 (substitute-keyword-arguments (package-arguments sundials)
5103 ((#:configure-flags flags '())
5104 `(cons* "-DMPI_ENABLE:BOOL=ON"
5105 "-DPETSC_ENABLE:BOOL=ON"
5106 (string-append "-DPETSC_INCLUDE_DIR="
5107 (assoc-ref %build-inputs "petsc")
5109 (string-append "-DPETSC_LIBRARY_DIR="
5110 (assoc-ref %build-inputs "petsc")
5113 ((#:phases phases '%standard-phases)
5114 `(modify-phases ,phases
5115 (add-before 'check 'mpi-setup
5116 ,%openmpi-setup)))))
5117 (synopsis "SUNDIALS with OpenMPI support")))
5119 (define-public combinatorial-blas
5121 (name "combinatorial-blas")
5126 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5128 (match (string-split version #\.)
5129 ((major minor patch)
5130 (string-append major minor "_" patch))) ;e.g. "16_2"
5134 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5135 (patches (search-patches "combinatorial-blas-awpm.patch"
5136 "combinatorial-blas-io-fix.patch"))))
5137 (build-system cmake-build-system)
5140 ("test-data" ,(origin
5142 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5143 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5146 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5148 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5149 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5150 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5152 (modify-phases %standard-phases
5153 (add-before 'check 'mpi-setup
5155 (add-before 'check 'test-setup
5156 (lambda* (#:key inputs #:allow-other-keys)
5157 (setenv "OMP_NUM_THREADS" "2")
5158 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5159 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5160 (synopsis "Linear algebra primitives for graph analytics")
5161 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5162 distributed-memory parallel graph library offering a small but powerful set of
5163 linear algebra primitives specifically targeting graph analytics.")
5165 license:gpl2+ ;include/psort/(funnel|sort)*.h
5166 license:x11 ;usort and psort
5167 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5169 (define-public dune-common
5171 (name "dune-common")
5176 (uri (string-append "https://dune-project.org/download/"
5177 version "/dune-common-" version ".tar.gz"))
5180 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5181 (build-system cmake-build-system)
5184 (modify-phases %standard-phases
5185 (add-after 'build 'build-tests
5186 (lambda* (#:key make-flags #:allow-other-keys)
5187 (apply invoke "make" "build_tests" make-flags))))))
5191 ("openblas" ,openblas)
5193 ("superlu" ,superlu)))
5195 `(("gfortran" ,gfortran)
5196 ("pkg-config" ,pkg-config)))
5197 (home-page "https://dune-project.org/")
5198 (synopsis "Distributed and Unified Numerics Environment")
5199 (description "DUNE, the Distributed and Unified Numerics Environment is a
5200 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5201 grid-based methods. It supports the easy implementation of methods like
5202 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5203 Differences} (FD).")
5204 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5205 (license license:gpl2)))
5207 (define-public dune-geometry
5209 (name "dune-geometry")
5214 (uri (string-append "https://dune-project.org/download/"
5215 version "/dune-geometry-" version ".tar.gz"))
5218 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5219 (build-system cmake-build-system)
5222 (modify-phases %standard-phases
5223 (add-after 'build 'build-tests
5224 (lambda* (#:key make-flags #:allow-other-keys)
5225 (apply invoke "make" "build_tests" make-flags))))))
5227 `(("dune-common" ,dune-common)
5229 ("openblas" ,openblas)
5231 ("python" ,python)))
5233 `(("gfortran" ,gfortran)
5234 ("pkg-config" ,pkg-config)))
5235 (home-page "https://dune-project.org/")
5236 (synopsis "Distributed and Unified Numerics Environment")
5237 (description "DUNE, the Distributed and Unified Numerics Environment is a
5238 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5239 grid-based methods. It supports the easy implementation of methods like
5240 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5243 This package contains the basic DUNE geometry classes.")
5244 ;; GPL version 2 with "runtime exception"
5245 (license license:gpl2)))
5247 (define-public dune-uggrid
5249 (name "dune-uggrid")
5255 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5256 (commit (string-append "v" version))))
5257 (file-name (git-file-name name version))
5260 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5261 (build-system cmake-build-system)
5264 (modify-phases %standard-phases
5265 (add-after 'build 'build-tests
5266 (lambda* (#:key make-flags #:allow-other-keys)
5267 (apply invoke "make" "build_tests" make-flags))))))
5269 `(("dune-common" ,dune-common)))
5271 `(("gfortran" ,gfortran)
5272 ("pkg-config" ,pkg-config)))
5273 (home-page "https://dune-project.org/")
5274 (synopsis "Distributed and Unified Numerics Environment")
5275 (description "DUNE, the Distributed and Unified Numerics Environment is a
5276 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5277 grid-based methods. It supports the easy implementation of methods like
5278 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5281 This package contains the DUNE UG grid classes.")
5282 (license license:lgpl2.1)))
5284 (define-public dune-grid
5291 (uri (string-append "https://dune-project.org/download/"
5292 version "/dune-grid-" version ".tar.gz"))
5295 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5296 (build-system cmake-build-system)
5299 (modify-phases %standard-phases
5300 (add-after 'build 'build-tests
5301 (lambda* (#:key make-flags #:allow-other-keys)
5302 (apply invoke "make" "build_tests" make-flags))))))
5304 `(("dune-common" ,dune-common)
5305 ("dune-geometry" ,dune-geometry)
5308 ("openblas" ,openblas)
5309 ("python" ,python)))
5311 `(("dune-uggrid" ,dune-uggrid)))
5313 `(("gfortran" ,gfortran)
5314 ("pkg-config" ,pkg-config)))
5315 (home-page "https://dune-project.org/")
5316 (synopsis "Distributed and Unified Numerics Environment")
5317 (description "DUNE, the Distributed and Unified Numerics Environment is a
5318 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5319 grid-based methods. It supports the easy implementation of methods like
5320 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5323 This package contains the basic DUNE grid classes.")
5324 ;; GPL version 2 with "runtime exception"
5325 (license license:gpl2)))
5327 (define-public dune-istl
5334 (uri (string-append "https://dune-project.org/download/"
5335 version "/dune-istl-" version ".tar.gz"))
5338 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5339 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5340 (build-system cmake-build-system)
5343 (modify-phases %standard-phases
5344 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5345 ;; the stdlib types when the gfortran header is used. Remove gfortran
5346 ;; from CPLUS_INCLUDE_PATH as a workaround.
5347 (add-after 'set-paths 'hide-gfortran
5348 (lambda* (#:key inputs #:allow-other-keys)
5349 (let ((gfortran (assoc-ref inputs "gfortran")))
5350 (setenv "CPLUS_INCLUDE_PATH"
5352 (delete (string-append gfortran "/include/c++")
5353 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5356 (add-after 'build 'build-tests
5357 (lambda* (#:key make-flags #:allow-other-keys)
5358 (apply invoke "make" "build_tests" make-flags))))))
5360 `(("dune-common" ,dune-common)
5363 ("suitesparse" ,suitesparse)
5364 ("superlu" ,superlu)
5365 ("openblas" ,openblas)
5367 ("python" ,python)))
5369 `(("gfortran" ,gfortran)
5370 ("pkg-config" ,pkg-config)))
5371 (home-page "https://dune-project.org/")
5372 (synopsis "Distributed and Unified Numerics Environment")
5373 (description "DUNE, the Distributed and Unified Numerics Environment is a
5374 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5377 This is the iterative solver template library which provides generic sparse
5378 matrix/vector classes and a variety of solvers based on these classes. A
5379 special feature is the use of templates to exploit the recursive block
5380 structure of finite element matrices at compile time. Available solvers
5381 include Krylov methods, (block-) incomplete decompositions and
5382 aggregation-based algebraic multigrid.")
5383 ;; GPL version 2 with "runtime exception"
5384 (license license:gpl2)))
5386 (define-public dune-localfunctions
5388 (name "dune-localfunctions")
5393 (uri (string-append "https://dune-project.org/download/"
5394 version "/dune-localfunctions-" version ".tar.gz"))
5397 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5398 (build-system cmake-build-system)
5401 (modify-phases %standard-phases
5402 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5403 ;; and fails to find the stdlib types when the gfortran header is used.
5404 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5405 (add-after 'set-paths 'hide-gfortran
5406 (lambda* (#:key inputs #:allow-other-keys)
5407 (let ((gfortran (assoc-ref inputs "gfortran")))
5408 (setenv "CPLUS_INCLUDE_PATH"
5410 (delete (string-append gfortran "/include/c++")
5411 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5414 (add-after 'build 'build-tests
5415 (lambda* (#:key make-flags #:allow-other-keys)
5416 (apply invoke "make" "build_tests" make-flags))))))
5418 `(("dune-common" ,dune-common)
5419 ("dune-geometry" ,dune-geometry)
5422 ("superlu" ,superlu)
5425 `(("gfortran" ,gfortran)
5426 ("pkg-config" ,pkg-config)))
5427 (home-page "https://dune-project.org/")
5428 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5429 (description "This DUNE module provides interface and implementation for
5430 shape functions defined on the DUNE reference elements. In addition to the
5431 shape function, interpolation operators and special keys are provided which
5432 can be used to assemble global function spaces on finite-element grids.
5434 This package provides an interface and implementation for shape functions
5435 defined on the DUNE reference elements. In addition to the shape function,
5436 interpolation operators and special keys are provided which can be used to
5437 assemble global function spaces on finite-element grids.")
5438 ;; GPL version 2 with "runtime exception"
5439 (license license:gpl2)))
5441 (define-public dune-alugrid
5443 (name "dune-alugrid")
5444 (version "2.7.0-git-81d35682")
5449 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5450 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5451 (file-name (git-file-name name version))
5454 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5455 (build-system cmake-build-system)
5458 (modify-phases %standard-phases
5459 (add-after 'unpack 'patch-include
5461 (substitute* "dune/alugrid/test/test-alugrid.cc"
5462 (("doc/grids/gridfactory/testgrids")
5463 "doc/dune-grid/grids/gridfactory/testgrids"))
5465 (add-after 'build 'build-tests
5466 (lambda* (#:key inputs make-flags #:allow-other-keys)
5467 (setenv "CPLUS_INCLUDE_PATH"
5468 (string-append (assoc-ref inputs "dune-grid") "/share"))
5469 (apply invoke "make" "build_tests" make-flags))))))
5471 `(("dune-common" ,dune-common)
5472 ("dune-geometry" ,dune-geometry)
5473 ("dune-grid" ,dune-grid)
5476 ("openblas" ,openblas)
5478 ("superlu" ,superlu)
5482 `(("gfortran" ,gfortran)
5483 ("pkg-config" ,pkg-config)))
5484 (home-page "https://dune-project.org/")
5485 (synopsis "Distributed and Unified Numerics Environment")
5486 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5487 implementation of the DUNE grid interface supporting either simplices or
5489 (license license:gpl2+)))
5491 (define-public dune-subgrid
5493 (name "dune-subgrid")
5494 (version "2.7.0-git-2103a363")
5499 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5500 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5501 (file-name (git-file-name name version))
5504 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5505 (build-system cmake-build-system)
5508 (modify-phases %standard-phases
5509 (add-after 'build 'build-tests
5510 (lambda* (#:key make-flags #:allow-other-keys)
5511 (apply invoke "make" "build_tests" make-flags))))))
5513 `(("dune-common" ,dune-common)
5514 ("dune-geometry" ,dune-geometry)
5515 ("dune-grid" ,dune-grid)
5518 ("openblas" ,openblas)
5521 `(("gfortran" ,gfortran)
5522 ("pkg-config" ,pkg-config)))
5523 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5524 (synopsis "Distributed and Unified Numerics Environment")
5525 (description "The dune-subgrid module marks elements of
5526 another hierarchical dune grid. The set of marked elements can then be
5527 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5528 provides the full grid interface including adaptive mesh refinement.")
5529 (license license:gpl2+)))
5531 (define-public dune-typetree
5533 (name "dune-typetree")
5539 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5540 (commit (string-append "v" version))))
5541 (file-name (git-file-name name version))
5544 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5545 (build-system cmake-build-system)
5548 (modify-phases %standard-phases
5549 (add-after 'build 'build-tests
5550 (lambda* (#:key make-flags #:allow-other-keys)
5551 (apply invoke "make" "build_tests" make-flags))))))
5553 `(("dune-common" ,dune-common)
5555 ("openblas" ,openblas)
5558 ("superlu" ,superlu)
5561 `(("gfortran" ,gfortran)
5562 ("pkg-config" ,pkg-config)))
5563 (home-page "https://dune-project.org/")
5564 (synopsis "Distributed and Unified Numerics Environment")
5565 (description "TypeTree is a template library for constructing and
5566 operating on statically typed trees of objects.")
5567 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5568 (license (list license:lgpl3+ license:gpl2))))
5570 (define-public dune-functions
5572 (name "dune-functions")
5578 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5579 (commit (string-append "v" version))))
5580 (file-name (git-file-name name version))
5583 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5584 (build-system cmake-build-system)
5587 (modify-phases %standard-phases
5588 (add-after 'unpack 'disable-failing-tests
5591 ;; unable to load GMSH file in this test
5592 "--exclude-regex gridviewfunctionspacebasistest")
5594 (add-after 'build 'build-tests
5595 (lambda* (#:key make-flags #:allow-other-keys)
5596 (apply invoke "make" "build_tests" make-flags))))))
5598 `(("dune-common" ,dune-common)
5599 ("dune-istl" ,dune-istl)
5600 ("dune-localfunctions" ,dune-localfunctions)
5601 ("dune-grid" ,dune-grid)
5602 ("dune-geometry" ,dune-geometry)
5603 ("dune-typetree" ,dune-typetree)
5604 ("openblas" ,openblas)
5607 ("superlu" ,superlu)
5610 `(("gfortran" ,gfortran)
5611 ("pkg-config" ,pkg-config)))
5612 (home-page "https://dune-project.org/")
5613 (synopsis "Distributed and Unified Numerics Environment")
5614 (description "The dune-functions module provides an abstraction layer for
5615 global finite element functions. Its two main concepts are functions
5616 implemented as callable objects, and bases of finite element spaces.")
5617 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5618 (license (list license:lgpl3+ license:gpl2))))
5620 (define-public dune-pdelab
5622 (name "dune-pdelab")
5623 (version "2.7.0-git-476fe437")
5628 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5629 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5630 (file-name (git-file-name name version))
5633 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5634 (build-system cmake-build-system)
5635 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5637 `(("dune-common" ,dune-common)
5638 ("dune-istl" ,dune-istl)
5639 ("dune-localfunctions" ,dune-localfunctions)
5640 ("dune-geometry" ,dune-geometry)
5641 ("dune-grid" ,dune-grid)
5642 ("dune-typetree" ,dune-typetree)
5643 ("dune-functions" ,dune-functions)
5645 ("openblas" ,openblas)
5649 ("superlu" ,superlu)
5652 `(("gfortran" ,gfortran)
5653 ("pkg-config" ,pkg-config)))
5654 (home-page "https://dune-project.org/")
5655 (synopsis "Differential equations solver toolbox")
5656 (description "PDELab is a partial differential equations solver toolbox
5657 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5658 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5659 (license (list license:lgpl3+ license:gpl2))))
5661 (define add-openmpi-to-dune-package
5662 (let ((dune-package?
5663 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5666 (if (dune-package? p)
5667 (package (inherit p)
5668 (name (string-append (package-name p) "-openmpi"))
5669 (inputs `(,@(package-inputs p)
5670 ("openmpi" ,openmpi)))
5672 (substitute-keyword-arguments (package-arguments p)
5673 ((#:phases phases '%standard-phases)
5674 `(modify-phases ,phases
5675 (add-before 'check 'mpi-setup
5676 ,%openmpi-setup)))))
5677 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5679 (negate dune-package?))))
5681 (define-public dune-common-openmpi
5682 (add-openmpi-to-dune-package dune-common))
5684 (define-public dune-geometry-openmpi
5685 (add-openmpi-to-dune-package dune-geometry))
5687 (define-public dune-istl-openmpi
5688 (add-openmpi-to-dune-package dune-istl))
5690 (define-public dune-typetree-openmpi
5691 (add-openmpi-to-dune-package dune-typetree))
5693 (define-public dune-uggrid-openmpi
5694 (add-openmpi-to-dune-package dune-uggrid))
5696 (define-public dune-grid-openmpi
5697 (add-openmpi-to-dune-package dune-grid))
5699 (define-public dune-alugrid-openmpi
5700 (add-openmpi-to-dune-package dune-alugrid))
5702 (define-public dune-subgrid-openmpi
5703 (add-openmpi-to-dune-package dune-subgrid))
5705 (define-public dune-localfunctions-openmpi
5706 (add-openmpi-to-dune-package dune-localfunctions))
5708 (define-public dune-functions-openmpi
5709 (add-openmpi-to-dune-package dune-functions))
5711 (define-public dune-pdelab-openmpi
5712 (add-openmpi-to-dune-package dune-pdelab))
5714 (define-public mlucas
5722 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5724 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5725 (build-system gnu-build-system)
5727 `(("python2" ,python-2)))
5729 `(#:tests? #f ; no tests
5731 (modify-phases %standard-phases
5735 (call-with-output-file "Makefile"
5737 (format port "CC = gcc
5738 CFLAGS = -O3 ~a -DUSE_THREADS
5739 LDLIBS = -lm -lpthread -lrt
5740 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5742 ,(let ((system (or (%current-target-system)
5743 (%current-system))))
5745 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5749 (lambda* (#:key outputs #:allow-other-keys)
5750 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5751 (install-file "Mlucas" bin)
5752 (install-file "primenet.py" bin))
5754 (home-page "https://www.mersenne.org")
5755 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5756 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5757 numbers in search of a world-record prime. You may use it to test any
5758 suitable number as you wish, but it is preferable that you do so in a
5759 coordinated fashion, as part of the Great Internet Mersenne Prime
5760 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5761 management via the GIMPS project's Primenet server.")
5762 (license license:gpl2+)))
5764 (define-public nauty
5772 "https://pallini.di.uniroma1.it/"
5773 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5775 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5776 (build-system gnu-build-system)
5777 (outputs '("out" "lib"))
5779 `(#:test-target "checks"
5780 #:configure-flags '("--enable-generic") ;prevent -march-native
5782 (modify-phases %standard-phases
5783 ;; Default make target does not build all available
5784 ;; executables. Create them now.
5785 (add-after 'build 'build-extra-programs
5787 (for-each (lambda (target) (invoke "make" target))
5788 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5790 ;; Upstream does not provide any install target.
5792 (lambda* (#:key outputs #:allow-other-keys)
5793 (let* ((out (assoc-ref outputs "out"))
5794 (lib-output (assoc-ref outputs "lib"))
5795 (bin (string-append out "/bin"))
5796 (doc (string-append out "/share/doc/nauty/"))
5797 (include (string-append lib-output "/include/nauty"))
5798 (lib (string-append lib-output "/lib/nauty")))
5799 (for-each (lambda (f) (install-file f bin))
5800 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5801 "bliss2dre" "catg" "checks6" "complg" "converseg"
5802 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5803 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5804 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5805 "gentourng" "gentreeg" "hamheuristic" "labelg"
5806 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5807 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5808 "sumlines" "twohamg" "underlyingg" "vcolg"
5809 "watercluster2" "NRswitchg"))
5810 (for-each (lambda (f) (install-file f include))
5811 (find-files "." "\\.h$"))
5812 (for-each (lambda (f) (install-file f lib))
5813 (find-files "." "\\.a$"))
5814 (for-each (lambda (f) (install-file f doc))
5815 (append '("formats.txt" "README" "schreier.txt")
5816 (find-files "." "\\.pdf$")))))))))
5818 `(("gmp" ,gmp))) ;for sumlines
5819 (home-page "https://pallini.di.uniroma1.it/")
5820 (synopsis "Library for graph automorphisms")
5821 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5822 procedures for computing automorphism groups of graphs and digraphs.
5824 @code{nauty} computes graph information in the form of a set of
5825 generators, the size of the group, and the orbits of the group; it can
5826 also produce a canonical label. The @code{nauty} suite is written in
5827 C and comes with a command-line interface, a collection of
5828 command-line tools, and an Application Programming Interface (API).
5830 This package provides the static libraries required to run programs
5831 compiled against the nauty library.")
5832 (license license:asl2.0)))
5841 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5842 "ftp/releases/" version
5843 "/ppl-" version ".tar.gz"))
5846 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5847 (build-system gnu-build-system)
5853 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5855 "Parma Polyhedra Library for computations with polyhedra")
5857 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5858 especially targeted at applications in the field of analysis and
5859 verification of complex systems. These abstractions include convex
5860 polyhedra, defined as the intersection of a finite number of (open or
5861 closed) halfspaces, each described by a linear inequality (strict or
5862 non-strict) with rational coefficients; some special classes of polyhedra
5863 shapes that offer interesting complexity/precision tradeoffs; and grids
5864 which represent regularly spaced points that satisfy a set of linear
5865 congruence relations. The library also supports finite powersets and
5866 products of (any kind of) polyhedra and grids, a mixed integer linear
5867 programming problem solver using an exact-arithmetic version of the simplex
5868 algorithm, a parametric integer programming solver, and primitives for
5869 termination analysis via the automatic synthesis of linear ranking
5871 (license license:gpl3+)))
5873 (define-public speedcrunch
5875 (name "speedcrunch")
5881 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5882 (commit (string-append "release-" version))))
5883 (file-name (git-file-name name version))
5886 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5887 (build-system cmake-build-system)
5888 (inputs `(("qtbase" ,qtbase)))
5889 (native-inputs `(("qttools" ,qttools)))
5892 (modify-phases %standard-phases
5893 (add-after 'unpack 'chdir-to-src
5894 (lambda _ (chdir "src") #t)))))
5895 (synopsis "High-precision scientific calculator")
5897 "SpeedCrunch is a high-precision scientific calculator. It features a
5898 syntax-highlighted scrollable display and is designed to be fully used via
5899 keyboard. Some distinctive features are auto-completion of functions and
5900 variables, a formula book, and quick insertion of constants from various
5901 fields of knowledge.")
5902 (home-page "https://speedcrunch.org/")
5903 (license license:gpl2+)))
5905 (define-public minisat
5906 ;; This is the last commit which is available upstream, no
5907 ;; release happened since 2010.
5908 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5912 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5917 (url "https://github.com/niklasso/minisat")
5919 (file-name (string-append name "-" version "-checkout"))
5922 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5924 (search-patches "minisat-friend-declaration.patch"
5925 "minisat-install.patch"))))
5926 (build-system gnu-build-system)
5928 '(#:make-flags (list (string-append "prefix=" %output))
5929 #:tests? #f ;no check target
5931 (modify-phases %standard-phases
5932 (delete 'configure))))
5934 `(("zlib:static" ,zlib "static")
5937 "Small, yet efficient, SAT solver")
5939 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5940 researchers and developers alike to get started on SAT.")
5942 "http://minisat.se/MiniSat.html")
5943 (license license:expat))))
5945 (define-public libqalculate
5947 (name "libqalculate")
5953 (url "https://github.com/Qalculate/libqalculate/")
5954 (commit (string-append "v" version))))
5955 (file-name (git-file-name name version))
5957 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5959 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5960 (build-system gnu-build-system)
5962 `(("pkg-config" ,pkg-config)
5963 ("gettext" ,gettext-minimal)
5964 ("intltool" ,intltool)
5965 ("automake" ,automake)
5966 ("autoconf" ,autoconf)
5967 ("libtool" ,libtool)
5968 ("doxygen" ,doxygen)
5973 ("libxml2" ,libxml2)
5976 ("gnuplot" ,gnuplot)
5977 ("readline" ,readline)
5978 ("libiconv" ,libiconv)))
5981 (modify-phases %standard-phases
5982 (add-before 'bootstrap 'setenv
5983 ;; Prevent the autogen.sh script to carry out the configure
5984 ;; script, which has not yet been patched to replace /bin/sh.
5986 (setenv "NOCONFIGURE" "TRUE")
5988 (home-page "https://qalculate.github.io/")
5989 (synopsis "Multi-purpose cli desktop calculator and library")
5991 "Libqalculate is a multi-purpose cli desktop calculator and library.
5992 It provides basic and advanced functionality. Features include customizable
5993 functions, unit calculations, and conversions, physical constants, symbolic
5994 calculations (including integrals and equations), arbitrary precision,
5995 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5997 (license license:gpl2+)))
5999 (define-public qalculate-gtk
6001 (name "qalculate-gtk")
6007 (url "https://github.com/Qalculate/qalculate-gtk/")
6008 (commit (string-append "v" version))))
6009 (file-name (git-file-name name version))
6011 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
6012 (build-system glib-or-gtk-build-system)
6014 `(("pkg-config" ,pkg-config)
6015 ("intltool" ,intltool)
6016 ("automake" ,automake)
6017 ("autoconf" ,autoconf)
6018 ("libtool" ,libtool)
6023 ("libqalculate" ,libqalculate)
6024 ("libxml2" ,libxml2)
6029 (modify-phases %standard-phases
6030 (add-before 'bootstrap 'setenv
6031 ;; Prevent the autogen.sh script to carry out the configure
6032 ;; script, which has not yet been patched to replace /bin/sh.
6034 (setenv "NOCONFIGURE" "TRUE")
6036 (add-before 'check 'add-pot-file
6037 ;; the file contains translations and are currently not in use
6038 ;; left out on purpose so add it to POTFILES.skip
6040 (with-output-to-file "po/POTFILES.skip"
6042 (format #t "data/shortcuts.ui~%")
6045 (home-page "https://qalculate.github.io/")
6046 (synopsis "Multi-purpose graphical desktop calculator")
6048 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6049 multi-purpose GUI desktop calculator. It provides basic and advanced
6050 functionality. Features include customizable functions, unit calculations,
6051 and conversions, physical constants, symbolic calculations (including
6052 integrals and equations), arbitrary precision, uncertainty propagation,
6053 interval arithmetic, plotting.")
6054 (license license:gpl2+)))