1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nikita <nikita@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
35 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
41 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
42 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
43 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
44 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
46 ;;; This file is part of GNU Guix.
48 ;;; GNU Guix is free software; you can redistribute it and/or modify it
49 ;;; under the terms of the GNU General Public License as published by
50 ;;; the Free Software Foundation; either version 3 of the License, or (at
51 ;;; your option) any later version.
53 ;;; GNU Guix is distributed in the hope that it will be useful, but
54 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 ;;; GNU General Public License for more details.
58 ;;; You should have received a copy of the GNU General Public License
59 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
61 (define-module (gnu packages maths)
62 #:use-module (ice-9 regex)
63 #:use-module (ice-9 match)
64 #:use-module (gnu packages)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix utils)
70 #:use-module ((guix build utils) #:select (alist-replace))
71 #:use-module (guix build-system cmake)
72 #:use-module (guix build-system glib-or-gtk)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system ruby)
76 #:use-module (gnu packages algebra)
77 #:use-module (gnu packages audio)
78 #:use-module (gnu packages autotools)
79 #:use-module (gnu packages base)
80 #:use-module (gnu packages bison)
81 #:use-module (gnu packages boost)
82 #:use-module (gnu packages check)
83 #:use-module (gnu packages cmake)
84 #:use-module (gnu packages compression)
85 #:use-module (gnu packages curl)
86 #:use-module (gnu packages cyrus-sasl)
87 #:use-module (gnu packages dbm)
88 #:use-module (gnu packages documentation)
89 #:use-module (gnu packages elf)
90 #:use-module (gnu packages file)
91 #:use-module (gnu packages flex)
92 #:use-module (gnu packages fltk)
93 #:use-module (gnu packages fontutils)
94 #:use-module (gnu packages gettext)
95 #:use-module (gnu packages gcc)
96 #:use-module (gnu packages gd)
97 #:use-module (gnu packages ghostscript)
98 #:use-module (gnu packages glib)
99 #:use-module (gnu packages graphviz)
100 #:use-module (gnu packages gtk)
101 #:use-module (gnu packages icu4c)
102 #:use-module (gnu packages image)
103 #:use-module (gnu packages java)
104 #:use-module (gnu packages less)
105 #:use-module (gnu packages lisp)
106 #:use-module (gnu packages linux)
107 #:use-module (gnu packages logging)
108 #:use-module (gnu packages lua)
109 #:use-module (gnu packages gnome)
110 #:use-module (gnu packages guile)
111 #:use-module (gnu packages xorg)
112 #:use-module (gnu packages gl)
113 #:use-module (gnu packages imagemagick)
114 #:use-module (gnu packages m4)
115 #:use-module (gnu packages mpi)
116 #:use-module (gnu packages multiprecision)
117 #:use-module (gnu packages netpbm)
118 #:use-module (gnu packages onc-rpc)
119 #:use-module (gnu packages pcre)
120 #:use-module (gnu packages popt)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages pkg-config)
123 #:use-module (gnu packages pulseaudio)
124 #:use-module (gnu packages python)
125 #:use-module (gnu packages python-web)
126 #:use-module (gnu packages python-xyz)
127 #:use-module (gnu packages qt)
128 #:use-module (gnu packages readline)
129 #:use-module (gnu packages ruby)
130 #:use-module (gnu packages tbb)
131 #:use-module (gnu packages scheme)
132 #:use-module (gnu packages shells)
133 #:use-module (gnu packages tcl)
134 #:use-module (gnu packages texinfo)
135 #:use-module (gnu packages tex)
136 #:use-module (gnu packages tls)
137 #:use-module (gnu packages version-control)
138 #:use-module (gnu packages wxwidgets)
139 #:use-module (gnu packages xml)
140 #:use-module (srfi srfi-1)
141 #:use-module (srfi srfi-26))
149 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
151 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
152 (build-system gnu-build-system)
153 (inputs `(("gtk+" ,gtk+)
154 ("libxml2" ,libxml2)))
155 (native-inputs `(("pkg-config" ,pkg-config)))
156 (synopsis "Natural deduction first-order logic interface")
157 (description "Aris is a program for performing logical proofs. It supports
158 propositional and predicate logic, as well as Boolean algebra and
159 arithmetical logic. In addition to its predefined inference and equivalence
160 rules, Aris also supports references to older proofs. Its use of standard
161 logical symbols and its natural deduction interface make it easy to use for
163 (license license:gpl3+)
164 (home-page "https://www.gnu.org/software/aris/")))
166 (define-public c-graph
172 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
175 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
176 (build-system gnu-build-system)
178 `(("fortran" ,gfortran)))
179 (synopsis "Visualizing and demonstrating convolution")
181 "GNU C-Graph is a tool for demonstrating the theory of convolution.
182 Thus, it can serve as an excellent aid to students of signal and systems
183 theory in visualizing the convolution process. Rather than forcing the
184 student to write code, the program offers an intuitive interface with
185 interactive dialogs to guide them.")
186 (license license:gpl3+)
187 (home-page "https://www.gnu.org/software/c-graph/")))
196 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
197 version "/coda-" version ".tar.gz"))
199 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
200 (patches (search-patches "coda-use-system-libs.patch"))
201 (modules '((guix build utils)))
203 ;; Make sure we don't use the bundled software.
205 (for-each (lambda (d)
206 (delete-file-recursively (string-append "libcoda/" d)))
207 '("zlib" "pcre" "expat"))
210 `(("fortran" ,gfortran)
212 ("python-numpy" ,python-numpy)))
219 (build-system gnu-build-system)
221 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
222 "LIBS= -lz -lpcre -lexpat")))
223 (synopsis "A common interface to various earth observation data formats")
225 "The Common Data Access toolbox (CODA) provides a set of interfaces for
226 reading remote sensing data from earth observation data files. It consists of
227 command line applications and interfaces to the C, Fortran, Python, and Java
228 programming languages.")
229 (home-page "https://stcorp.nl/coda")
230 (license license:gpl2+)))
238 (uri (string-append "http://www.qhull.org/download/qhull-"
239 (car (string-split version #\.))
243 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
244 (build-system cmake-build-system)
245 (synopsis "Calculate convex hulls and related structures")
247 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
248 diagram, halfspace intersection about a point, furthest-site Delaunay
249 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
250 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
251 algorithm for computing the convex hull. It handles roundoff errors from
252 floating point arithmetic. It computes volumes, surface areas, and
253 approximations to the convex hull.
255 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
256 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
257 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
259 (home-page "http://qhull.org")
260 (license (license:non-copyleft "file://COPYING.txt"
261 "See COPYING in the distribution."))))
263 (define-public python-cvxopt
265 (name "python-cvxopt")
270 (url "https://github.com/cvxopt/cvxopt")
272 (file-name (git-file-name name version))
275 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
276 (build-system python-build-system)
279 (modify-phases %standard-phases
280 (add-after 'unpack 'find-libraries
281 (lambda* (#:key inputs #:allow-other-keys)
282 (setenv "CVXOPT_BLAS_LIB" "openblas")
283 (setenv "CVXOPT_BUILD_FFTW" "1")
284 (setenv "CVXOPT_BUILD_GLPK" "1")
285 (setenv "CVXOPT_BUILD_GSL" "1")
292 ("openblas" ,openblas)
293 ("suitesparse" ,suitesparse)))
294 (home-page "https://www.cvxopt.org")
295 (synopsis "Python library for convex optimization")
297 "CVXOPT is a package for convex optimization based on the Python
298 programming language. Its main purpose is to make the development of software
299 for convex optimization applications straightforward by building on Python’s
300 extensive standard library and on the strengths of Python as a high-level
301 programming language.")
302 (license license:gpl3+)))
304 (define-public python2-cvxopt
305 (package-with-python2 python-cvxopt))
313 (uri (string-append "mirror://gnu/units/units-" version
316 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
317 (build-system gnu-build-system)
319 `(("readline" ,readline)
320 ("python" ,python-wrapper) ;for 'units_cur' script
321 ("python-requests" ,python-requests)))
323 `(#:phases (modify-phases %standard-phases
324 (add-after 'install 'wrap-units_cur
325 (lambda* (#:key outputs #:allow-other-keys)
326 (let* ((out (assoc-ref outputs "out"))
327 (bin (string-append out "/bin")))
328 (wrap-program (string-append bin "/units_cur")
329 `("PYTHONPATH" ":" prefix
330 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
332 (synopsis "Conversion between thousands of scales")
334 "GNU Units converts numeric quantities between units of measure. It
335 can handle scale changes through adaptive usage of standard scale
336 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
337 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
338 enough to be used effectively as a scientific calculator.")
339 (license license:gpl3+)
340 (home-page "https://www.gnu.org/software/units/")))
342 (define-public double-conversion
344 (name "double-conversion")
346 (home-page "https://github.com/google/double-conversion")
349 (uri (git-reference (url home-page)
350 (commit (string-append "v" version))))
351 (file-name (git-file-name name version))
354 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
355 (build-system cmake-build-system)
357 '(#:test-target "test"
358 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
359 "-DBUILD_TESTING=ON")))
360 (synopsis "Conversion routines for IEEE doubles")
362 "The double-conversion library provides binary-decimal and decimal-binary
363 routines for IEEE doubles. The library consists of efficient conversion
364 routines that have been extracted from the V8 JavaScript engine.")
365 (license license:bsd-3)))
367 (define-public dionysus
373 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
377 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
378 (build-system gnu-build-system)
379 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
380 (synopsis "Local search for universal constants and scientific values")
382 "GNU Dionysus is a convenient system for quickly retrieving the values of
383 mathematical constants used in science and engineering. Values can be
384 searched using a simple command-line tool, choosing from three databases:
385 universal constants, atomic numbers, and constants related to
387 (license license:gpl3+)
388 (home-page "https://www.gnu.org/software/dionysus/")))
399 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
400 "dSFMT-src-" version ".tar.gz"))
403 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
404 (modules '((guix build utils)))
405 ;; Don't distribute html documentation with bundled jquery.
408 (delete-file-recursively "html") #t))
409 ;; Add patches borrowed from Julia.
415 "https://raw.githubusercontent.com/JuliaLang/julia/"
416 "v1.3.0/deps/patches/dSFMT.c.patch"))
418 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
419 (file-name "dSFMT.c.patch"))
423 "https://raw.githubusercontent.com/JuliaLang/julia/"
424 "v1.3.0/deps/patches/dSFMT.h.patch"))
426 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
427 (file-name "dSFMT.h.patch"))))))
428 (build-system gnu-build-system)
431 (modify-phases %standard-phases
432 (delete 'configure) ; no configure script
434 ;; Upstream Makefile does not build a shared library. Borrow from Julia
435 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
438 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
439 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
440 "-O3" "-finline-functions" "-fomit-frame-pointer"
441 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
442 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
443 "-o" "libdSFMT.so")))
444 (replace 'install ; no "install" target
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let* ((out (assoc-ref outputs "out"))
447 (lib (string-append out "/lib"))
448 (inc (string-append out "/include"))
449 (doc (string-append out "/share/doc/" ,name "-" ,version)))
450 (install-file "libdSFMT.so" lib)
451 (install-file "dSFMT.h" inc)
452 (install-file "LICENSE.txt" doc)
454 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
456 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
457 the expensive conversion of integer to double (floating point). dSFMT directly
458 generates double precision floating point pseudorandom numbers which have the
459 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
460 format. dSFMT is only available on the CPUs which use IEEE 754 format double
461 precision floating point numbers.")
462 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
463 (license license:bsd-3)))
471 (uri (string-append "mirror://gnu/gsl/gsl-"
475 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
476 (build-system gnu-build-system)
478 (let ((system (%current-system)))
480 ((or (string-prefix? "aarch64" system)
481 (string-prefix? "powerpc" system))
482 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
483 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
484 '(#:phases (modify-phases %standard-phases
485 (add-before 'check 'disable-failing-tests
487 (substitute* "spmatrix/test.c"
488 ((".*test_complex.*") "\n"))
490 ((string-prefix? "i686" system)
491 ;; There are rounding issues with these tests on i686:
492 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
493 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
494 '(#:phases (modify-phases %standard-phases
495 (add-before 'check 'disable-failing-tests
497 (substitute* "linalg/test.c"
498 ((".*gsl_test\\(test_LU_decomp.*") "\n")
499 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
500 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
501 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
502 (substitute* "spmatrix/test.c"
503 ((".*test_all.*") "\n")
504 ((".*test_float.*") "\n")
505 ((".*test_complex.*") "\n"))
508 (home-page "https://www.gnu.org/software/gsl/")
509 (synopsis "Numerical library for C and C++")
511 "The GNU Scientific Library is a library for numerical analysis in C
512 and C++. It includes a wide range of mathematical routines, with over 1000
513 functions in total. Subject areas covered by the library include:
514 differential equations, linear algebra, Fast Fourier Transforms and random
516 (license license:gpl3+)))
526 (url "https://github.com/shibatch/sleef")
528 (file-name (git-file-name name version))
530 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
531 (build-system cmake-build-system)
533 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
534 (string-append "-DCMAKE_INSTALL_LIBDIR="
535 (assoc-ref %outputs "out")
537 (string-append "-DCMAKE_INSTALL_PREFIX="
538 (assoc-ref %outputs "out")))
540 (modify-phases %standard-phases
541 ;; SLEEF generates a header library during the build process and writes
542 ;; to it via shell redirection. Make the checkout writable so the
543 ;; build can succeed.
544 (add-after 'unpack 'make-git-checkout-writable
546 (for-each make-file-writable (find-files "."))
552 ("openssl" ,openssl)))
553 (home-page "https://sleef.org/")
554 (synopsis "SIMD library for evaluating elementary functions and DFT")
556 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
557 implements vectorized versions of all C99 real floating point math functions.
558 It can utilize SIMD instructions that are available on modern processors.")
559 (license (list license:boost1.0 ;sleef
560 license:cc-by4.0)))) ;simplex algorithm
569 (uri (string-append "mirror://gnu/glpk/glpk-"
573 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
574 (build-system gnu-build-system)
578 `(#:configure-flags '("--with-gmp"
579 "--disable-static")))
580 (home-page "https://www.gnu.org/software/glpk/")
581 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
583 "GLPK is a C library for solving large-scale linear programming (LP),
584 mixed integer programming (MIP), and other related problems. It supports the
585 GNU MathProg modeling language, a subset of the AMPL language, and features a
586 translator for the language. In addition to the C library, a stand-alone
587 LP/MIP solver is included in the package.")
588 (license license:gpl3+)))
590 (define-public glpk-4
598 (uri (string-append "mirror://gnu/glpk/glpk-"
602 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
611 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
613 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
615 "/4ti2-" version ".tar.gz"))
617 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
618 (build-system gnu-build-system)
620 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
624 (home-page "http://www.4ti2.de/")
625 (synopsis "Mathematical tool suite for problems on linear spaces")
627 "4ti2 implements algorithms for solving algebraic, geometric and
628 combinatorial problems on linear spaces. Among others, it solves systems
629 of linear equations, computes extreme rays of polyhedral cones, solves
630 integer programming problems and computes Markov bases for statistics.")
631 (license license:gpl2+)))
633 (define-public cddlib
640 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
641 (string-delete #\. version) ".tar.gz"))
644 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
645 (build-system gnu-build-system)
648 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
649 (synopsis "Library for convex hulls and extreme rays of polyhedra")
651 "The C-library cddlib implements the Double Description Method of
652 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
653 rays of a general convex polyhedron given by a system of linear inequalities
654 in arbitrary dimension. It can also be used for the converse operation of
655 computing convex hulls.")
656 (license license:gpl2+)))
658 (define-public lrslib
665 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
667 (string-delete #\. version) ".tar.gz"))
670 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
671 (build-system gnu-build-system)
675 `(#:tests? #f ; no check phase
676 #:make-flags `("CC=gcc"
677 ,(string-append "prefix=" (assoc-ref %outputs "out"))
680 (modify-phases %standard-phases
683 (substitute* "makefile"
684 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
686 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
687 (synopsis "Convex hulls of polyhedra with exact arithmetic")
689 "The C code of lrslib implements the reverse search algorithm for
690 vertex enumeration and convex hull problems. Its input file format is
691 compatible with cddlib. All computations are done exactly in either
692 multiple precision or fixed integer arithmetic. Output is not stored
693 in memory, so even problems with very large output sizes can sometimes
695 (license license:gpl2+)))
704 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
705 "vinci/vinci-" version ".tar.gz"))
708 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
709 (build-system gnu-build-system)
711 `(("lrslib" ,lrslib)))
713 `(#:tests? #f ; no check phase
715 (modify-phases %standard-phases
717 ;; register the lrs location in the config file
718 (lambda* (#:key inputs #:allow-other-keys)
719 (let* ((lrs (assoc-ref inputs "lrslib"))
720 (lrsexec (string-append lrs "/bin/lrs")))
721 (substitute* "vinci.h"
722 (("#define LRS_EXEC \"lrs\"")
723 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
726 (lambda* (#:key outputs #:allow-other-keys)
727 (let* ((out (assoc-ref outputs "out"))
728 (bin (string-append out "/bin")))
729 (install-file "vinci" bin))
732 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
733 (synopsis "Volume computation for polytopes")
735 "Vinci implements a number of volume computation algorithms for convex
736 polytopes in arbitrary dimension. The polytopes can be given by their
737 V-representation (as the convex hull of a finite number of vertices), by
738 their H-representation (as the bounded intersection of a finite number of
739 halfspaces) or by their double description with both representations.")
740 (license license:gpl2+)))
742 (define-public arpack-ng
746 (home-page "https://github.com/opencollab/arpack-ng")
749 (uri (git-reference (url home-page) (commit version)))
750 (file-name (git-file-name name version))
753 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
754 (build-system gnu-build-system)
756 `(("autoconf" ,autoconf)
757 ("automake" ,automake)
758 ("libtool" ,libtool)))
761 ("fortran" ,gfortran)))
762 (synopsis "Fortran subroutines for solving eigenvalue problems")
764 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
765 large scale eigenvalue problems.")
766 (license (license:non-copyleft "file://COPYING"
767 "See COPYING in the distribution."))))
769 (define-public arpack-ng-3.3.0
773 (name (package-name arpack-ng))
774 (home-page (package-home-page arpack-ng))
778 (uri (string-append home-page "/archive/" version ".tar.gz"))
779 (file-name (string-append name "-" version ".tar.gz"))
782 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
784 (define-public arpack-ng-openmpi
785 (package (inherit arpack-ng)
786 (name "arpack-ng-openmpi")
789 ,@(package-inputs arpack-ng)))
791 (substitute-keyword-arguments (package-arguments arpack-ng)
792 ((#:configure-flags _ '())
794 ((#:phases phases '%standard-phases)
795 `(modify-phases ,phases
796 (add-before 'check 'mpi-setup
798 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
800 (define-public lapack
807 (uri (string-append "http://www.netlib.org/lapack/lapack-"
811 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
812 (build-system cmake-build-system)
813 (home-page "http://www.netlib.org/lapack/")
814 (inputs `(("fortran" ,gfortran)
815 ("python" ,python-wrapper)))
817 `(#:configure-flags (list
818 "-DBUILD_SHARED_LIBS:BOOL=YES"
820 ;; Build the 'LAPACKE_clatms' functions.
821 "-DLAPACKE_WITH_TMG=ON"
822 "-DBUILD_TESTING=ON")))
823 (synopsis "Library for numerical linear algebra")
825 "LAPACK is a Fortran 90 library for solving the most commonly occurring
826 problems in numerical linear algebra.")
827 (license (license:non-copyleft "file://LICENSE"
828 "See LICENSE in the distribution."))))
830 (define-public clapack
837 (uri (string-append "http://www.netlib.org/clapack/clapack-"
838 version "-CMAKE.tgz"))
841 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
842 (build-system cmake-build-system)
845 (modify-phases %standard-phases
846 ;; These tests use a lot of stack variables and segfault without
847 ;; lifting resource limits.
848 (add-after 'unpack 'disable-broken-tests
850 (substitute* "TESTING/CMakeLists.txt"
851 (("add_lapack_test.* xeigtstz\\)") ""))
854 (lambda* (#:key outputs #:allow-other-keys)
855 (let* ((out (assoc-ref outputs "out"))
856 (libdir (string-append out "/lib"))
857 (f2cinc (string-append out "/include/libf2c")))
860 (for-each (lambda (file)
861 (install-file file libdir))
863 "F2CLIBS/libf2c/libf2c.a"
864 "TESTING/MATGEN/libtmglib.a"
865 "BLAS/SRC/libblas.a"))
866 (for-each (lambda (file)
867 (install-file file f2cinc))
868 (cons "F2CLIBS/libf2c/arith.h"
869 (find-files (string-append "../clapack-"
870 ,version "-CMAKE/F2CLIBS/libf2c")
872 (copy-recursively (string-append "../clapack-"
873 ,version "-CMAKE/INCLUDE")
874 (string-append out "/include"))
876 (home-page "https://www.netlib.org/clapack/")
877 (synopsis "Numerical linear algebra library for C")
879 "The CLAPACK library was built using a Fortran to C conversion utility
880 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
881 C code, and then modified to improve readability. CLAPACK's goal is to
882 provide LAPACK for someone who does not have access to a Fortran compiler.")
883 (license (license:non-copyleft "file://LICENSE"
884 "See LICENSE in the distribution."))))
886 (define-public scalapack
893 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
897 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
898 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
899 (build-system cmake-build-system)
902 ("fortran" ,gfortran)
903 ("lapack" ,lapack))) ;for testing only
905 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
906 #:phases (modify-phases %standard-phases
907 (add-before 'check 'mpi-setup
909 (home-page "http://www.netlib.org/scalapack/")
910 (synopsis "Library for scalable numerical linear algebra")
912 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
913 routines on parallel distributed memory machines. ScaLAPACK solves dense and
914 banded linear systems, least squares problems, eigenvalue problems, and
915 singular value problems.")
916 (license (license:non-copyleft "file://LICENSE"
917 "See LICENSE in the distribution."))))
919 (define-public gnuplot
925 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
929 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
930 (build-system gnu-build-system)
931 (inputs `(("readline" ,readline)
937 `(("pkg-config" ,pkg-config)
938 ("texlive" ,texlive-tiny)))
939 (arguments `(#:configure-flags (list (string-append
940 "--with-texdir=" %output
941 "/texmf-local/tex/latex/gnuplot"))))
942 (home-page "http://www.gnuplot.info")
943 (synopsis "Command-line driven graphing utility")
944 (description "Gnuplot is a portable command-line driven graphing
945 utility. It was originally created to allow scientists and students to
946 visualize mathematical functions and data interactively, but has grown to
947 support many non-interactive uses such as web scripting. It is also used as a
948 plotting engine by third-party applications like Octave.")
949 ;; X11 Style with the additional restriction that derived works may only be
950 ;; distributed as patches to the original.
951 (license (license:fsf-free
952 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
962 (url "https://github.com/OkoSanto/GCTP")
963 (commit (string-append "v" version))))
964 (file-name (git-file-name name version))
966 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
968 `(("fortran" ,gfortran)))
969 (build-system gnu-build-system)
970 (synopsis "General Cartographic Transformation Package (GCTP)")
972 "The General Cartographic Transformation Package (GCTP) is a system of
973 software routines designed to permit the transformation of coordinate pairs
974 from one map projection to another. The GCTP is the standard computer
975 software used by the National Mapping Division for map projection
977 (home-page "https://github.com/OkoSanto/GCTP")
978 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
987 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
988 version "/src/hdf-" version ".tar.bz2"))
990 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
991 (patches (search-patches "hdf4-architectures.patch"
992 "hdf4-reproducibility.patch"
993 "hdf4-shared-fortran.patch"
994 "hdf4-tirpc.patch"))))
995 (build-system gnu-build-system)
997 `(("gfortran" ,gfortran)
1002 ("libjpeg" ,libjpeg-turbo)
1003 ("libtirpc" ,libtirpc)))
1005 `(#:parallel-tests? #f
1006 #:configure-flags (list "--enable-shared"
1007 (string-append "CPPFLAGS=-I"
1008 (assoc-ref %build-inputs "libtirpc")
1011 (modify-phases %standard-phases
1012 ;; This is inspired by two of Debian's patches.
1013 (add-before 'configure 'add-more-aarch64-support
1015 (substitute* '("mfhdf/ncgen/ncgen.l"
1016 "mfhdf/ncgen/ncgenyy.c"
1017 "mfhdf/libsrc/netcdf.h.in")
1018 (("AIX5L64") "__aarch64__"))
1020 (add-before 'configure 'patchbuild
1023 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1025 (("/bin/mkdir") "mkdir"))
1026 (substitute* (find-files "." "^Makefile\\.in$")
1027 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1028 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1029 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1030 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1031 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1033 (add-after 'configure 'patch-settings
1035 ;; libhdf4.settings contains the full path of the
1036 ;; compilers used, and its contents are included in
1037 ;; .so-files. We truncate the hashes to avoid
1038 ;; unnecessary store references to those compilers:
1039 (substitute* "libhdf4.settings"
1040 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1041 (string-append prefix (string-take hash 10) "...")))
1043 (add-after 'install 'provide-absolute-libjpeg-reference
1044 (lambda* (#:key inputs outputs #:allow-other-keys)
1045 (let ((out (assoc-ref outputs "out"))
1046 (libjpeg (assoc-ref inputs "libjpeg")))
1047 ;; libjpeg-turbo does not provide a .la file, so libtool is
1048 ;; unable to add an absolute reference for -ljpeg in the .la
1049 ;; files. Fix it manually to avoid having to propagate it.
1050 (substitute* (find-files (string-append out "/lib") "\\.la$")
1052 (string-append "-L" libjpeg "/lib -ljpeg")))
1054 (home-page "https://www.hdfgroup.org/products/hdf4/")
1056 "Library and multi-object file format for storing and managing data")
1057 (description "HDF4 is a library and multi-object file format for storing
1058 and managing data between machines. HDF4 is an older hierarchical data format,
1059 incompatible with HDF5.")
1061 (license:non-copyleft
1062 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1064 (define-public hdf4-alt
1069 (substitute-keyword-arguments (package-arguments hdf4)
1070 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1072 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1074 (define-public hdf5-1.8
1081 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1082 "hdf5-" (version-major+minor version)
1083 "/hdf5-" version "/src/hdf5-"
1085 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1087 (match (string-split version #\.)
1088 ((major minor _ ...)
1089 (string-append major minor)))
1090 "/src/hdf5-" version ".tar.bz2")))
1092 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1093 (patches (search-patches "hdf5-config-date.patch"
1094 "hdf5-1.8-mpi-deprecations.patch"))))
1095 (build-system gnu-build-system)
1099 `(("gfortran" ,gfortran)
1100 ("perl" ,perl))) ;part of the test machinery needs Perl
1101 (outputs '("out" ; core library
1102 "fortran")) ; fortran interface
1104 `(;; Some of the users, notably Flann, need the C++ interface.
1105 #:configure-flags '("--enable-cxx"
1107 "--enable-fortran2003"
1109 ;; Build a thread-safe library. Unfortunately,
1110 ;; 'configure' invites you to either turn off C++,
1111 ;; Fortran, and the high-level interface (HL), or
1112 ;; to pass '--enable-unsupported'. Debian
1113 ;; packagers chose to pass '--enable-unsupported'
1114 ;; and we follow their lead here.
1115 "--enable-threadsafe"
1117 "--enable-unsupported")
1118 ;; Use -fPIC to allow the R bindings to link with the static libraries
1119 #:make-flags (list "CFLAGS=-fPIC"
1122 (modify-phases %standard-phases
1123 (add-before 'configure 'patch-configure
1124 (lambda* (#:key outputs #:allow-other-keys)
1125 (substitute* "configure"
1127 (substitute* "fortran/src/Makefile.in"
1128 (("libhdf5_fortran_la_LDFLAGS =")
1129 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1130 (assoc-ref outputs "fortran") "/lib")))
1131 (substitute* "hl/fortran/src/Makefile.in"
1132 (("libhdf5hl_fortran_la_LDFLAGS =")
1133 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1134 (assoc-ref outputs "fortran") "/lib")))
1136 (add-after 'configure 'patch-settings
1138 ;; libhdf5.settings contains the full path of the
1139 ;; compilers used, and its contents are included in
1140 ;; libhdf5.so. We truncate the hashes to avoid
1141 ;; unnecessary store references to those compilers:
1142 (substitute* "src/libhdf5.settings"
1143 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1144 (string-append prefix (string-take hash 10) "..."))
1145 ;; Don't record the build-time kernel version to make the
1146 ;; settings file reproducible.
1147 (("Uname information:.*")
1148 "Uname information: Linux\n"))
1150 (add-after 'install 'patch-references
1151 (lambda* (#:key inputs outputs #:allow-other-keys)
1152 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1153 (zlib (assoc-ref inputs "zlib")))
1154 (substitute* (find-files bin "h5p?cc")
1156 (string-append "-L" zlib "/lib " lib)))
1158 (add-after 'install 'split
1159 (lambda* (#:key inputs outputs #:allow-other-keys)
1160 ;; Move all fortran-related files
1161 (let* ((out (assoc-ref outputs "out"))
1162 (bin (string-append out "/bin"))
1163 (lib (string-append out "/lib"))
1164 (inc (string-append out "/include"))
1165 (ex (string-append out "/share/hdf5_examples/fortran"))
1166 (fort (assoc-ref outputs "fortran"))
1167 (fbin (string-append fort "/bin"))
1168 (flib (string-append fort "/lib"))
1169 (finc (string-append fort "/include"))
1170 (fex (string-append fort "/share/hdf5_examples/fortran")))
1175 ;; Note: When built with --enable-parallel, the 'h5fc' file
1176 ;; doesn't exist, hence this condition.
1177 (when (file-exists? (string-append bin "/h5fc"))
1178 (rename-file (string-append bin "/h5fc")
1179 (string-append fbin "/h5fc")))
1180 (for-each (lambda (file)
1182 (string-append flib "/" (basename file))))
1183 (find-files lib ".*fortran.*"))
1184 (for-each (lambda (file)
1186 (string-append finc "/" (basename file))))
1187 (find-files inc ".*mod"))
1188 (for-each (lambda (file)
1190 (string-append fex "/" (basename file))))
1191 (find-files ex ".*"))
1192 (delete-file-recursively ex))
1194 (home-page "https://www.hdfgroup.org")
1195 (synopsis "Management suite for extremely large and complex data")
1196 (description "HDF5 is a suite that makes possible the management of
1197 extremely large and complex data collections.")
1198 (license (license:x11-style
1199 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1201 (define-public hdf5-1.10
1202 (package/inherit hdf5-1.8
1207 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1208 "hdf5-" (version-major+minor version)
1209 "/hdf5-" version "/src/hdf5-"
1211 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1213 (apply string-append
1214 (take (string-split version #\.) 2))
1215 "/src/hdf5-" version ".tar.bz2")))
1217 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1218 (patches (search-patches "hdf5-config-date.patch"))))))
1221 ;; Default version of HDF5.
1224 (define-public hdf-java
1232 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1233 version "/src/CMake-hdfjava-" version ".tar.gz"))
1235 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1236 (modules '((guix build utils)))
1237 (snippet ; Make sure we don't use the bundled sources and binaries.
1239 (for-each delete-file
1240 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1241 "HDF4.tar.gz" "HDF5.tar.gz"))
1242 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1244 (build-system gnu-build-system)
1246 `(("jdk" ,icedtea "jdk")
1247 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1249 ("hamcrest-core" ,java-hamcrest-core)
1250 ("junit" ,java-junit)
1251 ("slf4j-simple" ,java-slf4j-simple)))
1256 ("libjpeg" ,libjpeg-turbo)
1257 ("slf4j-api" ,java-slf4j-api)))
1260 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1261 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1262 (assoc-ref %build-inputs "jdk") "/lib" )
1263 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1264 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1267 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1268 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1269 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1270 (string-append "JPEGLIB="
1271 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1275 (modify-phases %standard-phases
1276 (add-before 'configure 'chdir-to-source
1277 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1278 (add-before 'configure 'patch-build
1279 (lambda* (#:key inputs outputs #:allow-other-keys)
1280 (substitute* "configure"
1281 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1282 (("/bin/cat") (which "cat")))
1283 ;; Set classpath for compilation
1284 (substitute* '("hdf/hdf5lib/Makefile.in"
1285 "hdf/hdf5lib/exceptions/Makefile.in"
1286 "hdf/hdflib/Makefile.in")
1287 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1288 (string-append (assoc-ref inputs "slf4j-api")
1289 "/share/java/slf4j-api.jar")))
1290 ;; Replace outdated config.sub and config.guess:
1291 (with-directory-excursion "config"
1292 (for-each (lambda (file)
1294 (string-append (assoc-ref inputs "automake")
1296 ,(version-major+minor (package-version automake))
1298 '("config.sub" "config.guess")))
1300 ;; Fix embedded version number
1301 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1302 (substitute* "hdf/hdf5lib/H5.java"
1304 (string-join hdf5version ", "))))
1306 (mkdir-p (string-append (assoc-ref outputs "out")))
1307 ;; Set classpath for tests
1308 (let* ((build-dir (getcwd))
1309 (lib (string-append build-dir "/lib"))
1310 (jhdf (string-append lib "/jhdf.jar"))
1311 (jhdf5 (string-append lib "/jhdf5.jar"))
1315 (string-append (assoc-ref inputs i)
1316 "/share/java/" i ".jar"))
1317 '("slf4j-api" "slf4j-simple"))
1319 (car (find-files (assoc-ref inputs "junit") "jar$"))
1320 (car (find-files (assoc-ref inputs "hamcrest-core")
1323 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1325 (substitute* '("test/hdf5lib/Makefile.in"
1326 "test/hdf5lib/junit.sh.in"
1327 "examples/runExample.sh.in")
1329 (string-append (assoc-ref inputs "coreutils")
1332 (string-append (assoc-ref inputs "coreutils")
1334 (("CLASSPATH=[^\n]*")
1335 (string-append "CLASSPATH=" class-path)))
1336 (setenv "CLASSPATH" class-path))
1338 (add-before 'check 'build-examples
1340 (apply invoke `("javac"
1341 ,@(find-files "examples" ".*\\.java"))))))
1343 #:parallel-build? #f
1345 #:parallel-tests? #f ))
1346 (home-page "https://support.hdfgroup.org/products/java")
1347 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1348 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1349 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1352 ;; BSD-style license:
1353 (license (license:x11-style
1354 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1355 /current/src/unpacked/COPYING"))))
1357 (define-public hdf-eos2
1364 (uri "ftp://edhs1.gsfc.nasa.gov\
1365 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1367 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1368 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1369 "hdf-eos2-build-shared.patch"
1370 "hdf-eos2-fortrantests.patch"))))
1371 (build-system gnu-build-system)
1373 `(("gfortran" ,gfortran)))
1375 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1376 ;; XXX: These inputs are really dependencies of hdf4.
1378 ("libjpeg" ,libjpeg-turbo)
1379 ("libtirpc" ,libtirpc)
1383 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1384 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1385 #:parallel-tests? #f))
1386 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1387 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1388 (description "HDF-EOS2 is a software library built on HDF4 which supports
1389 the construction of data structures used in NASA's Earth Observing
1390 System (Grid, Point and Swath).")
1392 ;; Source files carry a permissive license header.
1393 (license (license:non-copyleft home-page))))
1395 (define-public hdf-eos5
1401 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1402 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1405 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1406 (patches (search-patches "hdf-eos5-build-shared.patch"
1407 "hdf-eos5-remove-gctp.patch"
1408 "hdf-eos5-fix-szip.patch"
1409 "hdf-eos5-fortrantests.patch"))))
1411 `(("gfortran" ,gfortran)))
1412 (build-system gnu-build-system)
1414 `(("hdf5" ,hdf5-1.8)
1418 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1419 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1420 #:parallel-tests? #f))
1421 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1423 "HDF-EOS5 is a software library built on HDF5 to support the construction
1424 of data structures used in NASA's Earth Observing System (Grid, Point and
1426 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1428 ;; Source files carry a permissive license header.
1429 (license (license:non-copyleft home-page))))
1431 (define-public hdf5-parallel-openmpi
1432 (package/inherit hdf5-1.10 ;use the latest
1433 (name "hdf5-parallel-openmpi")
1436 ,@(package-inputs hdf5)))
1438 (substitute-keyword-arguments (package-arguments hdf5)
1439 ((#:configure-flags flags)
1440 ``("--enable-parallel"
1441 ,@(delete "--enable-cxx"
1442 (delete "--enable-threadsafe" ,flags))))
1444 `(modify-phases ,phases
1445 (add-after 'build 'mpi-setup
1447 (add-before 'check 'patch-tests
1449 ;; OpenMPI's mpirun will exit with non-zero status if it
1450 ;; detects an "abnormal termination", i.e. any process not
1451 ;; calling MPI_Finalize(). Since the test is explicitly
1452 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1453 ;; H5C_flush_cache from being called, mpirun will always
1454 ;; complain, so turn this test off.
1455 (substitute* "testpar/Makefile"
1456 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1457 (string-append front back "\n")))
1458 (substitute* "tools/test/h5diff/testph5diff.sh"
1459 (("/bin/sh") (which "sh")))
1461 (synopsis "Management suite for data with parallel IO support")))
1463 (define-public hdf5-blosc
1471 (url "https://github.com/Blosc/hdf5-blosc")
1472 (commit (string-append "v" version))))
1473 (file-name (git-file-name name version))
1475 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1476 (build-system cmake-build-system)
1479 (list (string-append "-DBLOSC_INSTALL_DIR="
1480 (assoc-ref %build-inputs "c-blosc"))
1481 (string-append "-DPLUGIN_INSTALL_PATH="
1482 (assoc-ref %outputs "out")
1483 "/hdf5/lib/plugin"))
1485 (modify-phases %standard-phases
1486 (add-after 'unpack 'do-not-build-blosc
1488 (substitute* "CMakeLists.txt"
1489 (("set\\(BLOSC_INSTALL_DIR.*") "")
1490 (("ExternalProject_Add\\(project_blosc") "message("))
1493 `(("c-blosc" ,c-blosc)
1494 ("hdf5" ,hdf5-1.10)))
1495 (home-page "https://github.com/Blosc/hdf5-blosc")
1496 (synopsis "Filter for HDF5 using the Blosc compressor")
1497 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1498 installing this filter, you can read and write HDF5 files with
1499 Blosc-compressed datasets.")
1500 (license license:expat)))
1502 (define-public h5check
1509 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1510 "h5check/src/h5check-" version ".tar.gz"))
1513 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1514 (build-system gnu-build-system)
1515 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1516 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1517 (synopsis "HDF5 format checker")
1518 (description "@code{h5check} is a validation tool for verifying that an
1519 HDF5 file is encoded according to the HDF File Format Specification.")
1520 (license (license:x11-style "file://COPYING"))))
1528 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1533 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1534 (build-system cmake-build-system)
1535 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1536 (inputs `(("lapack" ,lapack)
1538 ;; FIXME: Even though the fonts are available dvips complains:
1539 ;; "Font cmmi10 not found; characters will be left blank."
1541 `(("texlive" ,texlive-tiny)
1542 ("ghostscript" ,ghostscript)
1543 ("doxygen" ,doxygen)))
1544 (home-page "http://itpp.sourceforge.net")
1545 (synopsis "C++ library of maths, signal processing and communication classes")
1546 (description "IT++ is a C++ library of mathematical, signal processing and
1547 communication classes and functions. Its main use is in simulation of
1548 communication systems and for performing research in the area of
1549 communications. The kernel of the library consists of generic vector and
1550 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1551 similar to MATLAB, GNU Octave or SciPy.")
1552 (license license:gpl3+)))
1554 (define-public netcdf
1562 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1563 "netcdf-c-" version ".tar.gz"))
1566 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1567 (patches (search-patches "netcdf-date-time.patch"))))
1568 (build-system gnu-build-system)
1571 ("doxygen" ,doxygen)
1572 ("graphviz" ,graphviz)))
1574 `(("hdf4" ,hdf4-alt)
1578 ("libjpeg" ,libjpeg-turbo)))
1580 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1582 #:phases (modify-phases %standard-phases
1583 (add-before 'configure 'fix-source-date
1585 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1586 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1587 ;; to '1st hour of the current day', and therefore makes the
1588 ;; package not reproducible.
1589 (substitute* "./configure"
1590 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1591 "date --date='@0'"))
1593 (add-after 'configure 'patch-settings
1595 ;; libnetcdf.settings contains the full filename of the compilers
1596 ;; used to build the library. We truncate the hashes of those
1597 ;; filenames to avoid unnecessary references to the corresponding
1599 (substitute* "libnetcdf.settings"
1600 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1601 (string-append prefix (string-take hash 10) "...")))
1604 #:parallel-tests? #f)) ;various race conditions
1605 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1606 (synopsis "Library for scientific data")
1607 (description "NetCDF is an interface for scientific data access and a
1608 software library that provides an implementation of the interface. The netCDF
1609 library defines a machine-independent format for representing scientific data.
1610 Together, the interface, library, and format support the creation, access, and
1611 sharing of scientific data.")
1612 (license (license:x11-style "file://COPYRIGHT"))))
1614 (define-public netcdf-parallel-openmpi
1615 (package (inherit netcdf)
1616 (name "netcdf-parallel-openmpi")
1619 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1620 (package-inputs netcdf))))
1621 ;; TODO: Replace pkg-config references in nc-config with absolute references
1623 (substitute-keyword-arguments (package-arguments netcdf)
1624 ((#:configure-flags flags)
1625 `(cons* "CC=mpicc" "CXX=mpicxx"
1626 "--enable-parallel-tests"
1627 ;; Shared libraries not supported with parallel IO.
1628 "--disable-shared" "--with-pic"
1630 ((#:phases phases '%standard-phases)
1631 `(modify-phases ,phases
1632 (add-after 'build 'mpi-setup
1633 ,%openmpi-setup)))))))
1635 (define-public netcdf-fortran
1637 (name "netcdf-fortran")
1642 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1646 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1647 (build-system gnu-build-system)
1649 `(#:parallel-tests? #f))
1651 `(("netcdf" ,netcdf)))
1653 `(("gfortran" ,gfortran)))
1654 (synopsis "Fortran interface for the netCDF library")
1655 (description (package-description netcdf))
1656 (home-page (package-home-page netcdf))
1657 (license (package-license netcdf))))
1659 (define-public nlopt
1665 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1668 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1669 (build-system gnu-build-system)
1671 `(;; Shared libraries are not built by default. They are required to
1672 ;; build the Guile, Octave, and Python bindings.
1673 #:configure-flags '("--enable-shared")
1676 (modify-phases %standard-phases
1677 (add-before 'configure 'set-libnlopt-file-name
1678 (lambda* (#:key outputs #:allow-other-keys)
1679 ;; Make sure the Scheme module refers to the library by its
1680 ;; absolute file name (we cannot do that from a snippet
1681 ;; because the expansion of @libdir@ contains
1683 (let ((out (assoc-ref outputs "out")))
1684 (substitute* "swig/nlopt.scm.in"
1686 (string-append out "/lib/libnlopt")))
1688 (inputs `(("guile" ,guile-2.0)))
1689 (native-inputs `(("pkg-config" ,pkg-config)))
1690 (home-page "http://ab-initio.mit.edu/wiki/")
1691 (synopsis "Library for nonlinear optimization")
1692 (description "NLopt is a library for nonlinear optimization, providing a
1693 common interface for a number of different free optimization routines available
1694 online as well as original implementations of various other algorithms.")
1695 (license license:lgpl2.1+)))
1697 (define-public ipopt
1704 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1708 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1709 (modules '((guix build utils)))
1711 ;; Make sure we don't use the bundled software.
1713 (delete-file-recursively "ThirdParty")
1715 (build-system gnu-build-system)
1717 '(#:phases (modify-phases %standard-phases
1718 (add-after 'install 'add--L-flags-in-ipopt.pc
1719 (lambda* (#:key inputs outputs #:allow-other-keys)
1720 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1721 ;; move it to "Libs.private" where it belongs, and add a
1722 ;; '-L' flag for LAPACK.
1723 (let ((out (assoc-ref outputs "out"))
1724 (lapack (assoc-ref inputs "lapack")))
1725 (substitute* (string-append out "/lib/pkgconfig/"
1727 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1728 (string-append "Libs: " before " " after "\n"
1729 "Libs.private: " before
1730 "-L" lapack "/lib -llapack -lblas "
1734 `(("gfortran" ,gfortran)))
1736 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1737 `(("lapack" ,lapack))) ;for both libblas and liblapack
1738 (home-page "https://www.coin-or.org")
1739 (synopsis "Large-scale nonlinear optimizer")
1741 "The Interior Point Optimizer (IPOPT) is a software package for
1742 large-scale nonlinear optimization. It provides C++, C, and Fortran
1744 (license license:epl1.0)))
1752 (uri (string-append "https://www.coin-or.org/download/source/"
1753 "Clp/Clp-" version ".tgz"))
1756 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1757 (modules '((guix build utils)))
1759 ;; Make sure we don't use the bundled software.
1761 (delete-file-recursively "ThirdParty")
1763 (build-system gnu-build-system)
1765 `(("gfortran" ,gfortran)
1766 ("pkg-config" ,pkg-config)))
1768 `(("openblas" ,openblas)))
1769 (home-page "https://www.coin-or.org")
1770 (synopsis "Linear programming solver")
1772 "CLP is a high quality linear programming solver. Its main strengths are
1773 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1774 linear and quadratic objectives. There are limited facilities for nonlinear
1775 and quadratic objectives using the Simplex algorithm.")
1776 (license license:epl1.0)))
1778 (define-public libflame
1782 (outputs '("out" "static"))
1787 (url "https://github.com/flame/libflame")
1789 (file-name (git-file-name name version))
1792 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1793 (build-system gnu-build-system)
1796 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1797 (list "--enable-dynamic-build"
1798 "--enable-max-arg-list-hack"
1799 "--enable-lapack2flame"
1800 "--enable-verbose-make-output"
1801 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1802 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1805 '("--enable-vector-intrinsics=sse")
1807 "--enable-supermatrix"
1808 "--enable-memory-alignment=16"
1809 "--enable-ldim-alignment")
1811 (modify-phases %standard-phases
1812 (add-after 'unpack 'patch-/usr/bin/env-bash
1814 (substitute* "build/config.mk.in"
1815 (("/usr/bin/env bash") (which "bash")))
1818 (lambda* (#:key tests? #:allow-other-keys)
1819 (substitute* "test/Makefile"
1820 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1821 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1823 (with-directory-excursion "test"
1826 (invoke "./test_libflame.x"))
1828 (add-after 'install 'install-static
1829 (lambda* (#:key outputs #:allow-other-keys)
1830 (let ((out (assoc-ref outputs "out"))
1831 (static (assoc-ref outputs "static")))
1832 (mkdir-p (string-append static "/lib"))
1833 (rename-file (string-append out "/lib/libflame.a")
1834 (string-append static "/lib/libflame.a"))
1835 (install-file (string-append out "/include/FLAME.h")
1836 (string-append static "/include"))
1839 `(("gfortran" ,gfortran)))
1841 `(("lapack" ,lapack)
1842 ("openblas" ,openblas)
1844 ("python" ,python-wrapper)))
1845 (home-page "https://github.com/flame/libflame")
1846 (synopsis "High-performance object-based library for DLA computations")
1847 (description "@code{libflame} is a portable library for dense matrix
1848 computations, providing much of the functionality present in LAPACK, developed
1849 by current and former members of the @acronym{SHPC, Science of High-Performance
1850 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1851 Computational Engineering and Sciences} at The University of Texas at Austin.
1852 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1853 includes a complete LAPACK implementation.")
1854 (license license:bsd-3)))
1856 (define-public ceres
1858 (name "ceres-solver")
1860 (home-page "http://ceres-solver.org/")
1863 (uri (string-append home-page "ceres-solver-"
1867 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1868 (build-system cmake-build-system)
1870 ;; TODO: Build HTML user documentation and install separately.
1871 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1872 "-DBUILD_SHARED_LIBS=ON")
1874 #:phases (modify-phases %standard-phases
1875 (add-before 'configure 'set-library-directory
1877 ;; Install libraries to lib/, not lib64/.
1878 (substitute* "internal/ceres/CMakeLists.txt"
1879 (("set\\(LIB_SUFFIX \"64\"\\)")
1880 "set(LIB_SUFFIX \"\")"))
1883 `(("pkg-config" ,pkg-config)))
1885 `(("glog" ,glog))) ;for #include <glog/glog.h>
1890 ("suitesparse" ,suitesparse)
1891 ("gflags" ,gflags)))
1892 (synopsis "C++ library for solving large optimization problems")
1894 "Ceres Solver is a C++ library for modeling and solving large,
1895 complicated optimization problems. It is a feature rich, mature and
1896 performant library which has been used in production since 2010. Ceres Solver
1897 can solve two kinds of problems:
1899 @item non-linear least squares problems with bounds constraints;
1900 @item general unconstrained optimization problems.
1902 (license license:bsd-3)))
1904 ;; For a fully featured Octave, users are strongly recommended also to install
1905 ;; the following packages: less, ghostscript, gnuplot.
1906 (define-public octave-cli
1913 (uri (string-append "mirror://gnu/octave/octave-"
1917 "0355s0pi8603ccs2j08zym3nalgalslxn83s37zq8nkrrkwxrjfk"))))
1918 (build-system gnu-build-system)
1920 `(("alsa-lib" ,alsa-lib)
1921 ("arpack" ,arpack-ng)
1927 ("fontconfig" ,fontconfig)
1928 ("freetype" ,freetype)
1932 ("graphicsmagick" ,graphicsmagick)
1934 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1935 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1936 ;; libtiff.la instead of having to provide it here.
1937 ("libjpeg" ,libjpeg-turbo)
1941 ("libsndfile" ,libsndfile)
1945 ("portaudio" ,portaudio)
1947 ("readline" ,readline)
1948 ("suitesparse" ,suitesparse)
1949 ("texinfo" ,texinfo)
1953 ("gfortran" ,gfortran)
1954 ("pkg-config" ,pkg-config)
1956 ;; The following inputs are not actually used in the build process.
1957 ;; However, the ./configure gratuitously tests for their existence and
1958 ;; assumes that programs not present at build time are also not, and
1959 ;; can never be, available at run time! If these inputs are therefore
1960 ;; not present, support for them will be built out. However, Octave
1961 ;; will still run without them, albeit without the features they
1964 ("ghostscript" ,ghostscript)
1965 ("gnuplot" ,gnuplot)))
1966 ;; Octave code uses this variable to detect directories holding multiple CA
1967 ;; certificates to verify peers with. This is required for the networking
1968 ;; functions that require encryption to work properly.
1969 (native-search-paths
1970 (list (search-path-specification
1971 (variable "CURLOPT_CAPATH")
1972 (files '("etc/ssl/certs")))))
1975 (list (string-append "--with-shell="
1976 (assoc-ref %build-inputs "bash")
1979 ;; XXX: Without this flag, linking octave-cli fails with
1980 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1981 ;; not pulling in liboctinterp.la for -lstdc++.
1982 "--enable-link-all-dependencies")
1984 (modify-phases %standard-phases
1985 (add-after 'configure 'configure-makeinfo
1986 (lambda* (#:key inputs #:allow-other-keys)
1987 (substitute* "libinterp/corefcn/help.h"
1990 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1992 (home-page "https://www.gnu.org/software/octave/")
1993 (synopsis "High-level language for numerical computation")
1994 (description "GNU Octave is a high-level interpreted language that is
1995 specialized for numerical computations. It can be used for both linear and
1996 non-linear applications and it provides great support for visualizing results.
1997 Work may be performed both at the interactive command-line as well as via
1999 (license license:gpl3+)))
2001 (define-public octave
2002 (package (inherit octave-cli)
2005 `(("qscintilla" ,qscintilla)
2007 ,@(package-inputs octave-cli)))
2009 `(("qttools" , qttools) ;for lrelease
2010 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2011 ,@(package-native-inputs octave-cli)))
2013 (substitute-keyword-arguments (package-arguments octave-cli)
2015 `(modify-phases ,phases
2016 (add-before 'configure 'patch-qscintilla-library-name
2017 (lambda* (#:key inputs #:allow-other-keys)
2018 ;; The QScintilla library that the Octave configure script tries
2019 ;; to link with should be named libqscintilla-qt5.so, but the
2020 ;; QScintilla input provides the shared library as
2021 ;; libqscintilla2_qt5.so.
2022 (substitute* "configure"
2023 (("qscintilla2-qt5")
2027 (define-public opencascade-oce
2029 (name "opencascade-oce")
2035 (url "https://github.com/tpaviot/oce")
2036 (commit (string-append "OCE-" version))))
2037 (file-name (git-file-name name version))
2038 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2040 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2041 (build-system cmake-build-system)
2044 (list "-DOCE_TESTING:BOOL=ON"
2045 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2046 "-DOCE_DRAW:BOOL=ON"
2047 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2048 (assoc-ref %outputs "out"))
2049 "-UCMAKE_INSTALL_RPATH")))
2051 `(("freetype" ,freetype)
2058 `(("python" ,python-wrapper)))
2059 (home-page "https://github.com/tpaviot/oce")
2060 (synopsis "Libraries for 3D modeling and numerical simulation")
2062 "Open CASCADE is a set of libraries for the development of applications
2063 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2064 C++ class libraries providing services for 3D surface and solid modeling, CAD
2065 data exchange, and visualization. It is used for development of specialized
2066 software dealing with 3D models in design (CAD), manufacturing (CAM),
2067 numerical simulation (CAE), measurement equipment (CMM), and quality
2068 control (CAQ) domains.
2070 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2071 patches, improvements, and experiments contributed by users over the official
2072 Open CASCADE library.")
2073 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2074 ; use of header files; see
2075 ; OCCT_LGPL_EXCEPTION.txt
2076 license:public-domain; files
2077 ; src/Standard/Standard_StdAllocator.hxx and
2078 ; src/NCollection/NCollection_StdAllocator.hxx
2079 license:expat; file src/OpenGl/OpenGl_glext.h
2080 license:bsd-3)))); test framework gtest
2082 (define-public opencascade-occt
2084 (name "opencascade-occt")
2090 (url "https://git.dev.opencascade.org/repos/occt.git")
2093 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2095 (file-name (git-file-name name version))
2097 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2098 (modules '((guix build utils)))
2101 ;; Remove files specific to non-free operating systems.
2102 (delete-file-recursively "samples/ios")
2103 (delete-file-recursively "samples/mfc")
2104 (delete-file-recursively "samples/qt/FuncDemo")
2105 (delete-file "genconf.bat")
2106 (delete-file "gendoc.bat")
2107 (delete-file "genproj.bat")
2108 (delete-file "upgrade.bat")
2109 ;; Remove references to deleted files.
2110 (substitute* "dox/FILES_HTML.txt"
2111 ((".*standard.*") "" )
2112 ((".*UIKitSample.*") ""))
2114 (build-system cmake-build-system)
2116 '(;; There is no test target for make. OCCT provides an
2117 ;; 'Automated Testing System', which may be accessed after
2118 ;; installation via the draw.sh script. draw.sh is located in
2119 ;; the bin directory. For details see:
2120 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2121 ;; occt_dev_guides__tests.html
2123 ;; Configure without freeimage: attempting to link against the
2124 ;; freeimage version 3.17 library leads to 'undefined
2125 ;; reference' errors.
2127 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2129 "-DUSE_VTK:BOOL=OFF"
2130 "-DBUILD_DOC_Overview:BOOL=OFF"
2131 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2132 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2133 "-UCMAKE_INSTALL_LIBDIR")))
2135 `(("doxygen" ,doxygen)
2136 ;("freeimage" ,freeimage)
2137 ("freetype" ,freetype)
2139 ("libxext" ,libxext)
2146 ;; TODO: build Overview documentation and add 'doc' output.
2147 (home-page "https://www.opencascade.com")
2148 (synopsis "Libraries for 3D modeling and numerical simulation")
2150 "Open CASCADE is a set of libraries for the development of applications
2151 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2152 C++ class libraries providing services for 3D surface and solid modeling, CAD
2153 data exchange, and visualization. It is used for development of specialized
2154 software dealing with 3D models in design (CAD), manufacturing (CAM),
2155 numerical simulation (CAE), measurement equipment (CMM), and quality
2156 control (CAQ) domains.
2158 This is the certified version of the Open Cascade Technology (OCCT) library.")
2159 (license (list ;; OCCT library:
2160 license:lgpl2.1; with an exception for the use of header
2161 ; files, see OCCT_LGPL_EXCEPTION.txt.
2162 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2163 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2165 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2166 ;; src/StepFile/step.tab.*:
2167 license:gpl3+ ; with Bison 2.2 exception.
2168 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2169 (license:non-copyleft
2170 "https://www.unicode.org/license.html")
2171 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2172 license:public-domain))))
2182 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2184 (string-append "gmsh_"
2185 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2187 (file-name (git-file-name name version))
2189 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2190 (modules '((guix build utils)))
2193 (delete-file-recursively "contrib/metis")
2195 (build-system cmake-build-system)
2198 ("gfortran" ,gfortran)
2205 ("opencascade-occt" ,opencascade-occt)
2207 ("libxext" ,libxext)))
2209 `(("fontconfig" ,fontconfig)
2210 ("libxft" ,libxft)))
2212 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2213 "-DENABLE_BUILD_SHARED:BOOL=ON"
2214 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2215 (home-page "http://gmsh.info/")
2216 (synopsis "3D finite element grid generator")
2217 (description "Gmsh is a 3D finite element grid generator with a built-in
2218 CAD engine and post-processor. Its design goal is to provide a fast, light
2219 and user-friendly meshing tool with parametric input and advanced
2220 visualization capabilities. Gmsh is built around four modules: geometry,
2221 mesh, solver and post-processing. The specification of any input to these
2222 modules is done either interactively using the graphical user interface or in
2223 ASCII text files using Gmsh's own scripting language.")
2224 (license license:gpl2+)))
2226 (define-public veusz
2233 (uri (pypi-uri "veusz" version))
2235 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2236 (build-system python-build-system)
2238 `(;; Tests will fail because they depend on optional packages like
2239 ;; python-astropy, which is not packaged.
2242 (modify-phases %standard-phases
2243 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2244 ;; the path is defined in Guix, therefore we have to change it.
2245 (add-after 'unpack 'fix-sip-dir
2247 (substitute* "pyqtdistutils.py"
2248 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2250 ;; Now we have to pass the correct sip_dir to setup.py.
2252 (lambda* (#:key inputs #:allow-other-keys)
2253 ;; We need to tell setup.py where to locate QtCoremod.sip
2254 ((@@ (guix build python-build-system) call-setuppy)
2256 (list (string-append "--sip-dir="
2257 (assoc-ref inputs "python-pyqt")
2260 ;; Ensure that icons are found at runtime.
2261 (add-after 'install 'wrap-executable
2262 (lambda* (#:key inputs outputs #:allow-other-keys)
2263 (let ((out (assoc-ref outputs "out")))
2264 (wrap-program (string-append out "/bin/veusz")
2265 `("QT_PLUGIN_PATH" prefix
2266 ,(list (string-append (assoc-ref inputs "qtsvg")
2267 "/lib/qt5/plugins/"))))))))))
2269 `(("pkg-config" ,pkg-config)
2270 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2271 ("qttools" ,qttools)))
2273 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2274 ("python-dbus" ,python-dbus)
2275 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2276 ("python-pyqt" ,python-pyqt)
2280 `(("python-numpy" ,python-numpy)))
2281 (home-page "https://veusz.github.io/")
2282 (synopsis "Scientific plotting package")
2284 "Veusz is a scientific plotting and graphing program with a graphical
2285 user interface, designed to produce publication-ready 2D and 3D plots. In
2286 addition it can be used as a module in Python for plotting. It supports
2287 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2288 (license license:gpl2+)))
2290 (define-public maxflow
2293 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2294 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2299 (url "https://github.com/gerddie/maxflow")
2301 (file-name (git-file-name name version))
2304 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2305 (build-system cmake-build-system)
2306 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2307 (synopsis "Library implementing Maxflow algorithm")
2308 (description "An implementation of the maxflow algorithm described in
2309 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2310 Energy Minimization in Computer Vision.\n
2311 Yuri Boykov and Vladimir Kolmogorov.\n
2312 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2314 (license license:gpl3+)))
2316 (define-public petsc
2323 ;; The *-lite-* tarball does not contain the *large* documentation
2324 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2325 "petsc-lite-" version ".tar.gz"))
2327 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2328 (outputs '("out" ; libraries and headers
2329 "examples")) ; ~30MiB of examples
2330 (build-system gnu-build-system)
2332 `(("python" ,python-2)))
2334 `(("gfortran" ,gfortran)
2336 ("superlu" ,superlu)
2337 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2338 ;; leaving out opengl, as configuration seems to only be for mac
2341 `(#:test-target "test"
2342 #:parallel-build? #f ; build is parallel by default
2348 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2349 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2350 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2352 (modify-phases %standard-phases
2354 ;; PETSc's configure script is actually a python script, so we can't
2355 ;; run it with bash.
2356 (lambda* (#:key outputs (configure-flags '())
2358 (let* ((prefix (assoc-ref outputs "out"))
2359 (flags `(,(string-append "--prefix=" prefix)
2360 ,@configure-flags)))
2361 (format #t "build directory: ~s~%" (getcwd))
2362 (format #t "configure flags: ~s~%" flags)
2363 (apply invoke "./configure" flags))))
2364 (add-after 'configure 'clean-local-references
2365 (lambda* (#:key outputs #:allow-other-keys)
2366 (let ((out (assoc-ref outputs "out")))
2367 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2368 ;; Prevent build directory from leaking into compiled code
2370 ;; Scrub timestamp for reproducibility
2371 ((".*Libraries compiled on.*") ""))
2372 (substitute* (find-files "." "petscvariables")
2373 ;; Do not expose build machine characteristics, set to defaults.
2374 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2375 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2377 (add-after 'install 'clean-install
2378 ;; Try to keep installed files from leaking build directory names.
2379 (lambda* (#:key inputs outputs #:allow-other-keys)
2380 (let ((out (assoc-ref outputs "out")))
2381 (substitute* (map (lambda (file)
2382 (string-append out "/lib/petsc/conf/" file))
2383 '("petscvariables"))
2385 ;; Make compiler references point to the store
2386 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2387 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2388 (string-append "= " (which compiler))))
2389 ;; PETSc installs some build logs, which aren't necessary.
2390 (for-each (lambda (file)
2391 (let ((f (string-append out "/lib/petsc/conf/" file)))
2392 (when (file-exists? f)
2394 '("configure.log" "make.log" "gmake.log"
2395 "test.log" "error.log" "RDict.db"
2396 "PETScBuildInternal.cmake"
2397 ;; Once installed, should uninstall with Guix
2400 (add-after 'install 'move-examples
2401 (lambda* (#:key outputs #:allow-other-keys)
2402 (let* ((out (assoc-ref outputs "out"))
2403 (examples (assoc-ref outputs "examples"))
2404 (exdir (string-append out "/share/petsc/examples"))
2405 (exdir' (string-append examples "/share/petsc/examples")))
2406 (copy-recursively exdir exdir')
2407 (delete-file-recursively exdir)
2409 (home-page "https://www.mcs.anl.gov/petsc")
2410 (synopsis "Library to solve PDEs")
2411 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2412 data structures and routines for the scalable (parallel) solution of
2413 scientific applications modeled by partial differential equations.")
2414 (license (license:non-copyleft
2415 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2417 (define-public petsc-complex
2418 (package (inherit petsc)
2419 (name "petsc-complex")
2421 (substitute-keyword-arguments (package-arguments petsc)
2422 ((#:configure-flags cf)
2423 `(cons "--with-scalar-type=complex" ,cf))))
2424 (synopsis "Library to solve PDEs (with complex scalars)")))
2426 (define-public petsc-openmpi
2427 (package (inherit petsc)
2428 (name "petsc-openmpi")
2430 `(("hdf5" ,hdf5-parallel-openmpi)
2431 ("hypre" ,hypre-openmpi)
2433 ("mumps" ,mumps-openmpi)
2434 ("openmpi" ,openmpi)
2435 ("scalapack" ,scalapack)
2436 ("scotch" ,pt-scotch32)
2437 ,@(package-inputs petsc)))
2439 (substitute-keyword-arguments (package-arguments petsc)
2440 ((#:configure-flags cf)
2442 "--with-mpiexec=mpirun"
2445 "--with-scalapack=1"
2447 ,(string-append "--with-mpi-dir="
2448 (assoc-ref %build-inputs "openmpi"))
2449 ,(string-append "--with-hdf5-include="
2450 (assoc-ref %build-inputs "hdf5") "/include")
2451 ,(string-append "--with-hdf5-lib="
2452 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2453 ,@(delete "--with-mpi=0" ,cf)))
2455 `(modify-phases ,phases
2456 (add-before 'configure 'mpi-setup
2457 ,%openmpi-setup)))))
2458 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2460 (define-public petsc-complex-openmpi
2461 (package (inherit petsc-complex)
2462 (name "petsc-complex-openmpi")
2464 `(("openmpi" ,openmpi)
2465 ,@(package-inputs petsc-complex)))
2467 (substitute-keyword-arguments (package-arguments petsc-complex)
2468 ((#:configure-flags cf)
2469 ``("--with-mpiexec=mpirun"
2470 ,(string-append "--with-mpi-dir="
2471 (assoc-ref %build-inputs "openmpi"))
2472 ,@(delete "--with-mpi=0" ,cf)))
2474 `(modify-phases ,phases
2475 (add-before 'configure 'mpi-setup
2476 ,%openmpi-setup)))))
2477 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2479 (define-public python-petsc4py
2481 (name "python-petsc4py")
2486 (uri (pypi-uri "petsc4py" version))
2489 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2490 (modules '((guix build utils)))
2493 ;; Ensure source file is regenerated in the build phase.
2494 (delete-file "src/petsc4py.PETSc.c")
2495 ;; Remove legacy GC code. See
2496 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2497 (substitute* "src/PETSc/cyclicgc.pxi"
2498 ((".*gc_refs.*") "" )
2499 ((".*PyGC_Head.*") ""))
2501 (build-system python-build-system)
2504 (modify-phases %standard-phases
2505 (add-before 'build 'pre-build
2507 ;; Define path to PETSc installation.
2508 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2510 (add-before 'check 'mpi-setup
2513 `(("python-cython" ,python-cython)))
2515 `(("petsc" ,petsc-openmpi)
2516 ("python-numpy" ,python-numpy)))
2517 (home-page "https://bitbucket.org/petsc/petsc4py/")
2518 (synopsis "Python bindings for PETSc")
2519 (description "PETSc, the Portable, Extensible Toolkit for
2520 Scientific Computation, is a suite of data structures and routines for
2521 the scalable (parallel) solution of scientific applications modeled by
2522 partial differential equations. It employs the MPI standard for all
2523 message-passing communication. @code{petsc4py} provides Python
2524 bindings to almost all functions of PETSc.")
2525 (license license:bsd-3)))
2527 (define-public python-kiwisolver
2529 (name "python-kiwisolver")
2533 (uri (pypi-uri "kiwisolver" version))
2536 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2537 (build-system python-build-system)
2538 (home-page "https://github.com/nucleic/kiwi")
2539 (synopsis "Fast implementation of the Cassowary constraint solver")
2541 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2542 solving algorithm. Kiwi has been designed from the ground up to be
2543 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2544 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2545 savings are consistently > 5x.")
2546 (license license:bsd-3)))
2548 (define-public python2-kiwisolver
2549 (package-with-python2 python-kiwisolver))
2551 (define-public slepc
2558 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2562 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2563 (build-system gnu-build-system)
2565 `(("python" ,python-2)
2566 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2568 `(("arpack" ,arpack-ng)
2569 ("gfortran" ,gfortran)))
2571 `(("petsc" ,petsc)))
2573 `(#:parallel-build? #f ;build is parallel by default
2575 `(,(string-append "--with-arpack-dir="
2576 (assoc-ref %build-inputs "arpack") "/lib"))
2577 #:make-flags ;honor (parallel-job-count)
2578 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2579 ,(string-append "PETSCCONFIGDIR="
2580 (assoc-ref %build-inputs "petsc:examples")
2581 "/share/petsc/examples/config"))
2583 (modify-phases %standard-phases
2585 ;; configure is a python script, so we can't run it with bash.
2586 (lambda* (#:key inputs outputs (configure-flags '())
2588 (let* ((prefix (assoc-ref outputs "out"))
2589 (flags `(,(string-append "--prefix=" prefix)
2590 ,@configure-flags)))
2591 (format #t "build directory: ~s~%" (getcwd))
2592 (format #t "configure flags: ~s~%" flags)
2593 (setenv "SLEPC_DIR" (getcwd))
2594 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2595 (apply invoke "./configure" flags))))
2596 (add-after 'install 'delete-doc
2597 ;; TODO: SLEPc installs HTML documentation alongside headers in
2598 ;; $out/include. We'd like to move them to share/doc, but delete
2599 ;; them for now, as they are incomplete and installing the complete
2600 ;; documentation is difficult.
2601 (lambda* (#:key outputs #:allow-other-keys)
2602 (let* ((out (assoc-ref outputs "out")))
2603 (for-each delete-file (find-files out "\\.html$"))
2605 (add-after 'install 'clean-install
2606 ;; Clean up unnecessary build logs from installation.
2607 (lambda* (#:key outputs #:allow-other-keys)
2608 (let ((out (assoc-ref outputs "out")))
2609 (for-each (lambda (file)
2610 (let ((f (string-append out "/lib/slepc/conf/" file)))
2611 (when (file-exists? f)
2613 '("configure.log" "make.log" "gmake.log"
2614 "test.log" "error.log" "RDict.db"
2617 (home-page "http://slepc.upv.es")
2618 (synopsis "Scalable library for eigenproblems")
2619 (description "SLEPc is a software library for the solution of large sparse
2620 eigenproblems on parallel computers. It can be used for the solution of
2621 linear eigenvalue problems formulated in either standard or generalized form,
2622 as well as other related problems such as the singular value decomposition.
2623 The emphasis of the software is on methods and techniques appropriate for
2624 problems in which the associated matrices are sparse, for example, those
2625 arising after the discretization of partial differential equations.")
2626 (license license:bsd-2)))
2628 (define-public slepc-complex
2629 (package (inherit slepc)
2630 (name "slepc-complex")
2632 `(("petsc" ,petsc-complex)
2633 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2634 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2636 (define-public slepc-openmpi
2637 (package (inherit slepc)
2638 (name "slepc-openmpi")
2640 (substitute-keyword-arguments (package-arguments slepc)
2641 ((#:phases phases '%standard-phases)
2642 `(modify-phases ,phases
2643 (add-before 'check 'mpi-setup
2644 ,%openmpi-setup)))))
2647 ("arpack" ,arpack-ng-openmpi)
2648 ,@(alist-delete "arpack" (package-inputs slepc))))
2650 `(("petsc" ,petsc-openmpi)
2651 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2652 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2654 (define-public slepc-complex-openmpi
2655 (package (inherit slepc-openmpi)
2656 (name "slepc-complex-openmpi")
2658 `(("petsc" ,petsc-complex-openmpi)
2659 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2660 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2662 (define-public python-slepc4py
2664 (name "python-slepc4py")
2669 (uri (pypi-uri "slepc4py" version))
2672 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2673 (build-system python-build-system)
2676 (modify-phases %standard-phases
2677 (add-before 'build 'pre-build
2679 ;; Define path to PETSc installation.
2680 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2681 ;; Define path to SLEPc installation.
2682 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2684 (add-before 'check 'mpi-setup
2687 `(("python-numpy" ,python-numpy)
2688 ("python-petsc4py" ,python-petsc4py)
2689 ("slepc" ,slepc-openmpi)))
2690 (home-page "https://bitbucket.org/slepc/slepc4py/")
2691 (synopsis "Python bindings for SLEPc")
2692 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2693 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2694 Scientific Computation. It employs the MPI standard for all
2695 message-passing communication. @code{slepc4py} provides Python
2696 bindings to almost all functions of SLEPc.")
2697 (license license:bsd-3)))
2699 (define-public metamath
2707 (url "https://github.com/metamath/metamath-exe")
2708 (commit (string-append "v" version))))
2709 (file-name (git-file-name name version))
2711 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
2712 (build-system gnu-build-system)
2714 `(("autoconf" ,autoconf)
2715 ("automake" ,automake)))
2716 (home-page "http://us.metamath.org/")
2717 (synopsis "Proof verifier based on a minimalistic formalism")
2719 "Metamath is a tiny formal language and that can express theorems in
2720 abstract mathematics, with an accompyaning @command{metamath} executable that
2721 verifies databases of these proofs. There is a public database,
2722 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2723 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2724 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2725 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2727 (license license:gpl2+)))
2729 (define-public mumps
2736 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2740 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2741 (patches (search-patches "mumps-build-parallelism.patch"
2742 "mumps-shared-libseq.patch"
2743 "mumps-shared-mumps.patch"
2744 "mumps-shared-pord.patch"))))
2745 (build-system gnu-build-system)
2747 `(("fortran" ,gfortran)
2748 ;; These are required for linking against mumps, but we let the user
2749 ;; declare the dependency.
2752 ("scotch" ,scotch)))
2754 `(#:modules ((ice-9 match)
2757 ,@%gnu-build-system-modules)
2759 (modify-phases %standard-phases
2761 (lambda* (#:key inputs #:allow-other-keys)
2762 (call-with-output-file "Makefile.inc"
2773 INCSEQ = -I$(topdir)/libseq
2774 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2775 LIBSEQNEEDED = libseqneeded~;
2779 AR = ar vr # rules require trailing space, ugh...
2782 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2784 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2785 LIBOTHERS = -pthread
2788 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2792 LIBS = $(SCALAP) $(LIBSEQ)
2793 LPORDDIR = $(topdir)/PORD/lib
2794 IPORD = -I$(topdir)/PORD/include
2795 LPORD = $(LPORDDIR)/libpord.a
2796 ORDERINGSF = -Dpord~@[
2798 IMETIS = -I$(METISDIR)/include
2799 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2800 ORDERINGSF += -Dmetis~]~@[~:{
2802 ISCOTCH = -I$(SCOTCHDIR)/include
2803 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2804 ORDERINGSF += ~a~}~]
2805 ORDERINGSC = $(ORDERINGSF)
2806 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2807 IORDERINGSF = $(ISCOTCH)
2808 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2809 (assoc-ref inputs "mpi")
2810 (assoc-ref inputs "blas")
2811 (assoc-ref inputs "scalapack")
2812 (assoc-ref inputs "metis")
2813 (match (list (assoc-ref inputs "pt-scotch")
2814 (assoc-ref inputs "scotch"))
2818 `((,scotch "" "-Dscotch")))
2821 "-lptesmumps -lptscotch -lptscotcherr "
2822 "-Dptscotch")))))))))
2824 ;; By default only the d-precision library is built. Make with "all"
2825 ;; target so that all precision libraries and examples are built.
2827 (invoke "make" "all"
2828 (format #f "-j~a" (parallel-job-count)))))
2830 ;; Run the simple test drivers, which read test input from stdin:
2831 ;; from the "real" input for the single- and double-precision
2832 ;; testers, and from the "cmplx" input for complex-precision
2833 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2834 ;; package to prefix execution with "mpirun".
2835 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2836 (with-directory-excursion "examples"
2839 (let ((tester (apply open-pipe*
2842 ,(string-append "./" prec
2844 (input (open-input-file
2845 (string-append "input_simpletest_" type))))
2847 (dump-port input tester)
2849 (zero? (close-pipe tester)))))
2851 '("real" "real" "cmplx" "cmplx")))))
2853 (lambda* (#:key outputs #:allow-other-keys)
2854 (let* ((out (assoc-ref outputs "out"))
2855 (libdir (string-append out "/lib")))
2856 (copy-recursively "lib" libdir)
2857 (copy-recursively "include" (string-append out "/include"))
2858 (when (file-exists? "libseq/libmpiseq.a")
2859 (install-file "libseq/libmpiseq.a" libdir))
2860 (when (file-exists? "libseq/libmpiseq.so")
2861 (install-file "libseq/libmpiseq.so" libdir))
2863 (home-page "http://mumps.enseeiht.fr")
2864 (synopsis "Multifrontal sparse direct solver")
2866 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2867 sparse system of linear equations A x = b using Gaussian elimination.")
2868 (license license:cecill-c)))
2870 (define-public mumps-metis
2871 (package (inherit mumps)
2872 (name "mumps-metis")
2874 (alist-delete "scotch" (package-inputs mumps)))))
2876 (define-public mumps-openmpi
2877 (package (inherit mumps)
2878 (name "mumps-openmpi")
2881 ("scalapack" ,scalapack)
2882 ("pt-scotch" ,pt-scotch)
2883 ,@(alist-delete "scotch" (package-inputs mumps))))
2885 (substitute-keyword-arguments (package-arguments mumps)
2887 `(modify-phases ,phases
2888 (add-before 'check 'mpi-setup
2892 ((assoc-ref ,phases 'check)
2893 #:exec-prefix '("mpirun" "-n" "2"))))))))
2894 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2896 (define-public mumps-metis-openmpi
2897 (package (inherit mumps-openmpi)
2898 (name "mumps-metis-openmpi")
2900 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2902 (define-public ruby-asciimath
2904 (name "ruby-asciimath")
2909 (uri (rubygems-uri "asciimath" version))
2912 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2913 (build-system ruby-build-system)
2915 `(("ruby-nokogiri" ,ruby-nokogiri)
2916 ("ruby-rspec" ,ruby-rspec)))
2917 (synopsis "AsciiMath parsing and conversion library")
2919 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2920 easy-to-write markup language for mathematics.")
2921 (home-page "https://github.com/asciidoctor/asciimath")
2922 (license license:expat)))
2924 (define-public superlu
2931 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2932 "superlu_" version ".tar.gz"))
2934 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
2935 (modules '((guix build utils)))
2937 ;; Replace the non-free implementation of MC64 with a stub adapted
2940 (use-modules (ice-9 regex)
2942 (call-with-output-file "SRC/mc64ad.c"
2947 void mc64id_(int *a) {
2948 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2951 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2952 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2953 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2956 ;; Remove the corresponding license verbiage. MC64 license follows
2957 ;; a "------" line separator.
2958 (with-atomic-file-replacement "License.txt"
2959 (let ((rx (make-regexp "-{8}")))
2962 (let ((line (read-line in 'concat)))
2963 (unless (regexp-exec rx line)
2967 (build-system cmake-build-system)
2971 `(("blas" ,openblas)
2972 ("gfortran" ,gfortran)))
2974 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2975 "-DTPL_BLAS_LIBRARIES=openblas"
2976 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2977 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2978 (synopsis "Supernodal direct solver for sparse linear systems")
2980 "SuperLU is a general purpose library for the direct solution of large,
2981 sparse, nonsymmetric systems of linear equations on high performance machines.
2982 The library is written in C and is callable from either C or Fortran. The
2983 library routines perform an LU decomposition with partial pivoting and
2984 triangular system solves through forward and back substitution. The library
2985 also provides threshold-based ILU factorization preconditioners.")
2986 (license (list license:bsd-3
2987 license:gpl2+ ;EXAMPLE/*fgmr.c
2988 (license:fsf-free "file://SRC/colamd.h")))))
2990 (define-public superlu-dist
2992 (name "superlu-dist")
2998 (url "https://github.com/xiaoyeli/superlu_dist")
2999 (commit (string-append "v" version))))
3000 (file-name (git-file-name name version))
3002 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3003 (modules '((guix build utils)))
3005 ;; Replace the non-free implementation of MC64 with a stub
3007 (make-file-writable "SRC/mc64ad_dist.c")
3008 (call-with-output-file "SRC/mc64ad_dist.c"
3013 void mc64id_dist(int *a) {
3014 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3017 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3018 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3019 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3022 (substitute* "SRC/util.c" ;adjust default algorithm
3023 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3024 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3025 ;; general (i.e. non-square) processor-grid support.
3026 "RowPerm = NOROWPERM;"))
3028 (patches (search-patches "superlu-dist-scotchmetis.patch"
3029 "superlu-dist-awpm-grid.patch"))))
3030 (build-system cmake-build-system)
3034 `(("gfortran" ,gfortran)
3037 ("combblas" ,combinatorial-blas)))
3039 `(("mpi" ,openmpi) ;headers include MPI heades
3040 ("parmetis" ,pt-scotch32 "metis")
3041 ("pt-scotch" ,pt-scotch32)))
3043 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3044 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3045 "-DTPL_ENABLE_COMBBLASLIB=YES"
3046 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3047 "-DTPL_LAPACK_LIBRARIES=-llapack"
3048 (string-append "-DTPL_PARMETIS_LIBRARIES="
3050 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3051 "scotchmetis" "scotch" "scotcherr")
3053 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3054 (assoc-ref %build-inputs "parmetis")
3056 "-DTPL_ENABLE_COMBBLASLIB=ON"
3057 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3058 (assoc-ref %build-inputs "combblas")
3059 "/include/CombBLAS;"
3060 (assoc-ref %build-inputs "combblas")
3061 "/include/BipartiteMatchings")
3062 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3064 (modify-phases %standard-phases
3065 (add-before 'configure 'set-c++-standard
3067 (substitute* "CMakeLists.txt"
3068 ;; AWPM headers require C++14
3069 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3070 (add-before 'check 'mpi-setup
3072 (add-before 'check 'omp-setup
3073 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3074 (home-page (package-home-page superlu))
3075 (synopsis "Parallel supernodal direct solver")
3077 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3078 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3079 implemented in ANSI C, and MPI for communications.")
3080 (license license:bsd-3)))
3082 (define-public scotch
3089 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3090 "latestfile/298/scotch_" version ".tar.gz"))
3092 (base32 "1184fcv4wa2df8szb5lan6pjh0raarr45pk8ilpvbz23naikzg53"))
3093 (patches (search-patches "scotch-build-parallelism.patch"
3094 "scotch-integer-declarations.patch"))))
3095 (build-system gnu-build-system)
3101 (outputs '("out" "metis"))
3103 `(#:make-flags (list (string-append "prefix=" %output))
3105 (modify-phases %standard-phases
3107 'unpack 'chdir-to-src
3108 (lambda _ (chdir "src") #t))
3112 (call-with-output-file "Makefile.inc"
3126 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3127 LDFLAGS = -lz -lm -lrt -lpthread
3129 LEX = flex -Pscotchyy -olex.yy.c
3134 YACC = bison -pscotchyy -y -b y
3136 '("COMMON_FILE_COMPRESS_GZ"
3138 "COMMON_RANDOM_FIXED_SEED"
3139 "INTSIZE64" ;use 'int64_t'
3140 ;; Prevents symbol clashes with libesmumps
3142 ;; XXX: Causes invalid frees in superlu-dist tests
3144 ;; "SCOTCH_PTHREAD_NUMBER=2"
3145 "restrict=__restrict"))))
3147 (add-after 'build 'build-esmumps
3150 (format #f "-j~a" (parallel-job-count))
3152 (add-before 'install 'make-install-dirs
3153 (lambda* (#:key outputs #:allow-other-keys)
3154 (mkdir (assoc-ref outputs "out"))))
3155 (add-after 'install 'install-metis
3156 (lambda* (#:key outputs #:allow-other-keys)
3157 (let ((out (assoc-ref outputs "metis")))
3159 ;; metis files are not installed with 'make install'
3160 (for-each (lambda (f)
3161 (install-file f (string-append out "/include")))
3162 (find-files "../include/" ".*metis\\.h"))
3163 (for-each (lambda (f)
3164 (install-file f (string-append out "/lib")))
3165 (find-files "../lib/" ".*metis\\..*"))
3167 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3168 (synopsis "Programs and libraries for graph algorithms")
3169 (description "SCOTCH is a set of programs and libraries which implement
3170 the static mapping and sparse matrix reordering algorithms developed within
3171 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3172 conquer approach, to scientific computing problems such as graph and mesh
3173 partitioning, static mapping, and sparse matrix ordering, in application
3174 domains ranging from structural mechanics to operating systems or
3176 ;; See LICENSE_en.txt
3177 (license license:cecill-c)))
3179 (define-public scotch32
3180 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3181 ;; some applications.
3182 (package (inherit scotch)
3185 (substitute-keyword-arguments (package-arguments scotch)
3186 ((#:phases scotch-phases)
3187 `(modify-phases ,scotch-phases
3191 (call-with-output-file "Makefile.inc"
3205 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3206 LDFLAGS = -lz -lm -lrt -lpthread
3208 LEX = flex -Pscotchyy -olex.yy.c
3213 YACC = bison -pscotchyy -y -b y
3215 '("COMMON_FILE_COMPRESS_GZ"
3217 "COMMON_RANDOM_FIXED_SEED"
3218 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3219 ;; Prevents symbolc clashes with libesmumps
3221 ;; XXX: Causes invalid frees in superlu-dist tests
3223 ;; "SCOTCH_PTHREAD_NUMBER=2"
3224 "restrict=__restrict"))))))))))
3226 "Programs and libraries for graph algorithms (32-bit integers)")))
3228 (define-public pt-scotch
3229 (package (inherit scotch)
3232 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3234 (substitute-keyword-arguments (package-arguments scotch)
3235 ((#:phases scotch-phases)
3236 `(modify-phases ,scotch-phases
3240 (invoke "make" (format #f "-j~a" (parallel-job-count))
3241 "ptscotch" "ptesmumps")
3243 ;; Install the serial metis compatibility library
3244 (invoke "make" "-C" "libscotchmetis" "install")))
3245 (add-before 'check 'mpi-setup
3249 (invoke "make" "ptcheck")))))))
3250 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3252 (define-public pt-scotch32
3253 (package (inherit scotch32)
3254 (name "pt-scotch32")
3256 `(("openmpi" ,openmpi))) ;headers include MPI headers
3258 (substitute-keyword-arguments (package-arguments scotch32)
3259 ((#:phases scotch32-phases)
3260 `(modify-phases ,scotch32-phases
3263 (invoke "make" (format #f "-j~a" (parallel-job-count))
3264 "ptscotch" "ptesmumps")
3265 ;; Install the serial metis compatibility library
3266 (invoke "make" "-C" "libscotchmetis" "install")))
3267 (add-before 'check 'mpi-setup
3271 (invoke "make" "ptcheck")))))))
3273 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3275 (define-public metis
3282 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3283 "metis-" version ".tar.gz"))
3286 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3287 (build-system cmake-build-system)
3289 `(("blas" ,openblas)))
3291 `(#:tests? #f ;no tests
3292 #:configure-flags `("-DSHARED=ON"
3293 ,(string-append "-DGKLIB_PATH=" (getcwd)
3294 "/metis-" ,version "/GKlib"))))
3295 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3296 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3298 "METIS is a set of serial programs for partitioning graphs, partitioning
3299 finite element meshes, and producing fill-reducing orderings for sparse
3300 matrices. The algorithms implemented in METIS are based on the multilevel
3301 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3303 (license license:asl2.0))) ;As of version 5.0.3
3305 (define-public p4est
3312 (uri (string-append "http://p4est.github.io/release/p4est-"
3316 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3317 (build-system gnu-build-system)
3319 `(("fortran" ,gfortran)
3324 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3325 (assoc-ref %build-inputs "blas")
3327 ,(string-append "LAPACK_LIBS=-L"
3328 (assoc-ref %build-inputs "lapack")
3330 #:phases (modify-phases %standard-phases
3331 (add-before 'check 'mpi-setup
3333 (home-page "http://www.p4est.org")
3334 (synopsis "Adaptive mesh refinement on forests of octrees")
3336 "The p4est software library enables the dynamic management of a
3337 collection of adaptive octrees, conveniently called a forest of octrees.
3338 p4est is designed to work in parallel and scales to hundreds of thousands of
3340 (license license:gpl2+)))
3342 (define-public p4est-openmpi
3343 (package (inherit p4est)
3344 (name "p4est-openmpi")
3347 ,@(package-inputs p4est)))
3349 (substitute-keyword-arguments (package-arguments p4est)
3350 ((#:configure-flags cf)
3351 ``("--enable-mpi" ,@,cf))))
3352 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3354 (define-public gsegrafix
3361 (uri (string-append "mirror://gnu/" name "/" name "-"
3365 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3366 (build-system gnu-build-system)
3368 `(#:configure-flags '("LDFLAGS=-lm")))
3370 `(("libgnomecanvas" ,libgnomecanvas)
3371 ("libbonoboui" ,libbonoboui)
3372 ("libgnomeui" ,libgnomeui)
3373 ("libgnomeprintui" ,libgnomeprintui)
3376 `(("pkg-config" ,pkg-config)))
3377 (home-page "https://www.gnu.org/software/gsegrafix/")
3378 (synopsis "GNOME application to create scientific and engineering plots")
3379 (description "GSEGrafix is an application which produces high-quality graphical
3380 plots for science and engineering. Plots are specified via simple ASCII
3381 parameter files and data files and are presented in an anti-aliased GNOME
3382 canvas. The program supports rectangular two-dimensional plots, histograms,
3383 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3384 to BMP, JPEG or PNG image formats.")
3385 (license license:gpl3+)))
3387 (define-public maxima
3394 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3395 version "-source/" name "-" version ".tar.gz"))
3398 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3399 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3400 (build-system gnu-build-system)
3403 ("gnuplot" ,gnuplot) ;for plots
3405 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3407 `(("texinfo" ,texinfo)
3409 ("python" ,python)))
3412 (list "--enable-gcl"
3413 (string-append "--with-posix-shell="
3414 (assoc-ref %build-inputs "bash")
3416 (string-append "--with-wish="
3417 (assoc-ref %build-inputs "tk")
3419 (let ((v ,(package-version tk)))
3420 (string-take v (string-index-right v #\.)))))
3421 ;; By default Maxima attempts to write temporary files to
3422 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3423 ;; Work around that.
3424 #:make-flags (list "TMPDIR=/tmp")
3426 (modify-phases %standard-phases
3427 (add-after 'unpack 'patch-paths
3428 (lambda* (#:key inputs #:allow-other-keys)
3429 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3430 (coreutils (assoc-ref inputs "coreutils"))
3431 (dirname (string-append coreutils "/bin/dirname"))
3432 (head (string-append coreutils "/bin/head"))
3433 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3434 (python (string-append (assoc-ref inputs "python")
3436 (substitute* "src/maxima.in"
3437 (("sed ") (string-append sed " "))
3438 (("dirname") dirname)
3440 (substitute* "doc/info/Makefile.in"
3441 (("/usr/bin/env perl") perl))
3442 (substitute* "doc/info/build_html.sh.in"
3443 (("python") python))
3445 (add-before 'check 'pre-check
3447 (chmod "src/maxima" #o555)
3451 ;; This is derived from the testing code in the "debian/rules" file
3452 ;; of Debian's Maxima package.
3453 ;; If Maxima can successfully run this, the binary to be installed
3459 "--batch-string=\"run_testsuite();\" "
3460 "| grep -q \"No unexpected errors found\""))))
3461 ;; Make sure the doc and emacs files are found in the
3462 ;; standard location. Also configure maxima to find gnuplot
3463 ;; without having it on the PATH.
3464 (add-after 'install 'post-install
3465 (lambda* (#:key outputs inputs #:allow-other-keys)
3466 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3467 (out (assoc-ref outputs "out"))
3468 (datadir (string-append out "/share/maxima/" ,version))
3469 (binutils (string-append (assoc-ref inputs "binutils")
3471 (with-directory-excursion out
3472 (mkdir-p "share/emacs")
3473 (mkdir-p "share/doc")
3475 (string-append datadir "/doc/")
3476 (string-append out "/share/doc/maxima"))
3477 (with-atomic-file-replacement
3478 (string-append datadir "/share/maxima-init.lisp")
3480 (format out "~a ~s~a~%"
3481 "(setf $gnuplot_command "
3482 (string-append gnuplot "/bin/gnuplot") ")")
3483 (dump-port in out))))
3484 ;; Ensure that Maxima will have access to the GNU binutils
3485 ;; components at runtime.
3486 (wrap-program (string-append out "/bin/maxima")
3487 `("PATH" prefix (,binutils))))
3489 (home-page "http://maxima.sourceforge.net")
3490 (synopsis "Numeric and symbolic expression manipulation")
3491 (description "Maxima is a system for the manipulation of symbolic and
3492 numerical expressions. It yields high precision numeric results by using
3493 exact fractions, arbitrary precision integers, and variable precision floating
3495 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3496 ;; Others simply say "GNU General Public License" without stating a
3497 ;; version (which implicitly means gpl1+).
3498 ;; At least one file (src/maxima.asd) says "version 2."
3499 ;; GPLv2 only is therefore the smallest subset.
3500 (license license:gpl2)))
3502 (define-public wxmaxima
3510 (url "https://github.com/wxMaxima-developers/wxmaxima")
3511 (commit (string-append "Version-" version))))
3512 (file-name (git-file-name name version))
3514 (base32 "054f7n5kx75ng5j20rd5q27n9xxk03mrd7sbxyym1lsswzimqh4w"))))
3515 (build-system cmake-build-system)
3517 `(("gettext" ,gettext-minimal)
3518 ("xorg-server" ,xorg-server-for-tests)))
3519 ;; TODO: Add libomp for multithreading support.
3520 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3522 `(("wxwidgets" ,wxwidgets)
3525 ("adwaita-icon-theme" ,adwaita-icon-theme)
3527 ("shared-mime-info" ,shared-mime-info)))
3529 `(#:test-target "test"
3531 (modify-phases %standard-phases
3532 (add-after 'unpack 'patch-doc-path
3534 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3535 ;; documentation. Only licensing information is placed there by
3537 (substitute* "src/Dirstructure.cpp"
3538 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3540 (add-before 'check 'pre-check
3542 ;; Tests require a running X server.
3543 (system "Xvfb :1 &")
3544 (setenv "DISPLAY" ":1")
3545 (setenv "HOME" (getcwd))
3547 (add-after 'install 'wrap-program
3548 (lambda* (#:key inputs outputs #:allow-other-keys)
3549 (wrap-program (string-append (assoc-ref outputs "out")
3552 (,(string-append (assoc-ref inputs "maxima")
3554 ;; For GtkFileChooserDialog.
3555 `("GSETTINGS_SCHEMA_DIR" =
3556 (,(string-append (assoc-ref inputs "gtk+")
3557 "/share/glib-2.0/schemas")))
3558 `("XDG_DATA_DIRS" ":" prefix
3559 (;; Needed by gdk-pixbuf to know supported icon formats.
3561 (assoc-ref inputs "shared-mime-info") "/share")
3562 ;; The default icon theme of GTK+.
3564 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3566 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3567 (synopsis "Graphical user interface for the Maxima computer algebra system")
3569 "wxMaxima is a graphical user interface for the Maxima computer algebra
3570 system. It eases the use of Maxima by making most of its commands available
3571 through a menu system and by providing input dialogs for commands that require
3572 more than one argument. It also implements its own display engine that
3573 outputs mathematical symbols directly instead of depicting them with ASCII
3576 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3577 text and mathematical calculations to create documents, exporting of input and
3578 output to TeX, and a browser for Maxima's manual including command index and
3579 full text searching.")
3580 (license license:gpl2+)))
3582 (define-public armadillo
3588 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3592 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3593 (build-system cmake-build-system)
3594 (arguments `(#:tests? #f)) ; no test target
3596 `(("openblas" ,openblas)
3598 ("arpack" ,arpack-ng)))
3599 (home-page "http://arma.sourceforge.net/")
3600 (synopsis "C++ linear algebra library")
3602 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3603 between speed and ease of use. It is useful for algorithm development
3604 directly in C++, or quick conversion of research code into production
3605 environments. It can be used for machine learning, pattern recognition,
3606 signal processing, bioinformatics, statistics, econometrics, etc. The library
3607 provides efficient classes for vectors, matrices and cubes, as well as 150+
3608 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3609 (license license:asl2.0)))
3611 (define-public muparser
3612 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3613 ;; different hash. In order to make `guix package --upgrade` work correctly,
3614 ;; we set a Guix packaging revision.
3615 ;; When the next version of muparser is released, we can remove
3616 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3617 (let ((upstream-version "2.2.5")
3621 (version (string-append upstream-version "-" revision))
3626 (url "https://github.com/beltoforion/muparser")
3627 (commit (string-append "v" upstream-version))))
3628 (file-name (git-file-name name version))
3630 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3631 (build-system gnu-build-system)
3633 `(#:configure-flags '("--enable-samples=no")
3634 #:tests? #f)) ;no "check" target
3635 (home-page "http://muparser.beltoforion.de/")
3636 (synopsis "Fast parser library for mathematical expressions")
3638 "muParser is an extensible high performance math parser library. It is
3639 based on transforming an expression into a bytecode and precalculating constant
3641 (license license:expat))))
3643 (define-public openblas
3650 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3651 version "%20version.tar.gz"))
3652 (file-name (string-append name "-" version ".tar.gz"))
3655 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3656 (build-system gnu-build-system)
3658 `(#:test-target "test"
3659 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3660 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3661 ;; we need to disable substitutions.
3663 ,(let ((system (or (%current-target-system) (%current-system))))
3664 (or (string-prefix? "x86_64" system)
3665 (string-prefix? "i686" system)
3666 (string-prefix? "mips" system)
3667 (string-prefix? "aarch64" system)))
3669 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3671 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3673 ;; This is the maximum number of threads OpenBLAS will ever use (that
3674 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3675 ;; is used.) If we don't set it, the makefile sets it to the number
3676 ;; of cores of the build machine, which is obviously wrong.
3679 ;; Build the library for all supported CPUs. This allows
3680 ;; switching CPU targets at runtime with the environment variable
3681 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3682 ;; Unfortunately, this is not supported on non-x86 architectures,
3683 ;; where it leads to failed builds.
3684 ,@(let ((system (or (%current-target-system) (%current-system))))
3686 ((or (string-prefix? "x86_64" system)
3687 (string-prefix? "i686" system))
3688 '("DYNAMIC_ARCH=1"))
3689 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3690 ;; two available MIPS targets special extended instructions
3691 ;; for Loongson cores are used.
3692 ((string-prefix? "mips" system)
3693 '("TARGET=SICORTEX"))
3694 ;; On aarch64 force the generic 'armv8-a' target
3695 ((string-prefix? "aarch64" system)
3698 ;; no configure script
3700 (modify-phases %standard-phases
3702 (add-before 'build 'set-extralib
3703 (lambda* (#:key inputs #:allow-other-keys)
3704 ;; Get libgfortran found when building in utest.
3706 (string-append "-L" (assoc-ref inputs "fortran-lib")
3710 `(("fortran-lib" ,gfortran "lib")))
3713 ("fortran" ,gfortran)
3715 (home-page "https://www.openblas.net/")
3716 (synopsis "Optimized BLAS library based on GotoBLAS")
3718 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3719 (license license:bsd-3)))
3721 (define-public openblas-ilp64
3722 (package/inherit openblas
3723 (name "openblas-ilp64")
3724 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3726 (substitute-keyword-arguments (package-arguments openblas)
3727 ((#:make-flags flags '())
3728 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3730 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3731 (license license:bsd-3)))
3733 (define* (make-blis implementation #:optional substitutable?)
3734 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3735 source tree for a list of implementations.)
3737 SUBSTITUTABLE? determines whether the package is made available as a
3740 Currently the specialization must be selected at configure-time, but work is
3741 underway to allow BLIS to select the right optimized kernels at run time:
3742 <https://github.com/flame/blis/issues/129>."
3744 (name (if (string=? implementation "reference")
3746 (string-append "blis-" implementation)))
3748 (home-page "https://github.com/flame/blis")
3751 (uri (git-reference (url home-page) (commit version)))
3754 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3755 (file-name (git-file-name "blis" version))))
3756 (build-system gnu-build-system)
3758 `(#:test-target "test"
3760 #:substitutable? ,substitutable?
3762 #:phases (modify-phases %standard-phases
3764 (lambda* (#:key outputs #:allow-other-keys)
3765 ;; This is a home-made 'configure' script.
3766 (let ((out (assoc-ref outputs "out")))
3767 (invoke "./configure" "-p" out
3771 "--enable-threading=openmp"
3774 (add-before 'check 'show-test-output
3776 ;; By default "make check" is silent. Make it verbose.
3777 (system "tail -F output.testsuite &")
3779 (synopsis "High-performance basic linear algebra (BLAS) routines")
3781 "BLIS is a portable software framework for instantiating high-performance
3782 BLAS-like dense linear algebra libraries. The framework was designed to
3783 isolate essential kernels of computation that, when optimized, immediately
3784 enable optimized implementations of most of its commonly used and
3785 computationally intensive operations. While BLIS exports a new BLAS-like API,
3786 it also includes a BLAS compatibility layer which gives application developers
3787 access to BLIS implementations via traditional BLAS routine calls.")
3788 (license license:bsd-3)))
3791 ;; This is the "reference" implementation, which is the non-optimized but
3792 ;; portable variant (no assembly).
3793 (make-blis "reference" #t))
3795 (define ignorance blis)
3797 (define-syntax-rule (blis/x86_64 processor)
3798 "Expand to a package specialized for PROCESSOR."
3800 (inherit (make-blis processor))
3801 (supported-systems '("x86_64-linux"))))
3803 (define-public blis-sandybridge
3804 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3805 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3806 (blis/x86_64 "sandybridge"))
3808 (define-public blis-haswell
3809 ;; BLIS specialized for Haswell processors (launched 2013):
3810 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3811 (blis/x86_64 "haswell"))
3813 (define-public blis-knl
3814 ;; BLIS specialized for Knights Landing processor (launched 2016):
3815 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3816 (blis/x86_64 "knl"))
3819 (define-public openlibm
3827 (url "https://github.com/JuliaLang/openlibm")
3828 (commit (string-append "v" version))))
3829 (file-name (git-file-name name version))
3831 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3832 (build-system gnu-build-system)
3835 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3837 ;; no configure script
3838 (modify-phases %standard-phases (delete 'configure))
3839 #:tests? #f)) ;the tests are part of the default target
3840 (home-page "https://openlibm.org/")
3841 (synopsis "Portable C mathematical library (libm)")
3843 "OpenLibm is an effort to have a high quality, portable, standalone C
3844 mathematical library (libm). It can be used standalone in applications and
3845 programming language implementations. The project was born out of a need to
3846 have a good libm for the Julia programming language that worked consistently
3847 across compilers and operating systems, and in 32-bit and 64-bit
3849 ;; Each architecture has its own make target, and there is none for mips.
3850 (supported-systems (delete "mips64el-linux" %supported-systems))
3851 ;; See LICENSE.md for details.
3852 (license (list license:expat
3855 license:public-domain
3856 license:lgpl2.1+))))
3858 (define-public openspecfun
3860 (name "openspecfun")
3866 (url "https://github.com/JuliaLang/openspecfun")
3867 (commit (string-append "v" version))))
3868 (file-name (git-file-name name version))
3870 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3871 (build-system gnu-build-system)
3873 '(#:tests? #f ; no "check" target
3875 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3877 (modify-phases %standard-phases
3878 (delete 'configure)))) ; no configure script
3880 `(("fortran" ,gfortran)))
3881 (home-page "https://github.com/JuliaLang/openspecfun")
3882 (synopsis "Collection of special mathematical functions")
3884 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3885 portable package for Bessel Functions of a Complex Argument and Nonnegative
3886 Order; it contains subroutines for computing Bessel functions and Airy
3887 functions. Faddeeva allows computing the various error functions of arbitrary
3888 complex arguments (Faddeeva function, error function, complementary error
3889 function, scaled complementary error function, imaginary error function, and
3890 Dawson function); given these, one can also easily compute Voigt functions,
3891 Fresnel integrals, and similar related functions as well.")
3892 ;; Faddeeva is released under the Expat license; AMOS is included as
3893 ;; public domain software.
3894 (license (list license:expat license:public-domain))))
3896 (define-public suitesparse
3898 (name "suitesparse")
3904 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3905 (commit (string-append "v" version))))
3906 (file-name (git-file-name name version))
3909 "0qjlyfxs8s48rs63c2fzspisgq1kk4bwkgnhmh125hgkdhrq2w1c"))
3910 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3911 (modules '((guix build utils)))
3913 ;; Remove bundled metis source
3915 (delete-file-recursively "metis-5.1.0")
3917 (build-system gnu-build-system)
3919 '(#:tests? #f ;no "check" target
3923 "MY_METIS_LIB=-lmetis"
3924 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3925 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3926 (assoc-ref %outputs "out")
3927 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3928 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3929 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3930 " -DCMAKE_SKIP_RPATH=TRUE"
3931 " -DCMAKE_BUILD_TYPE=Release")
3932 (string-append "INSTALL_LIB="
3933 (assoc-ref %outputs "out") "/lib")
3934 (string-append "INSTALL_INCLUDE="
3935 (assoc-ref %outputs "out") "/include")
3938 (modify-phases %standard-phases
3939 (delete 'configure)))) ;no configure script
3947 `(("cmake" ,cmake-minimal)
3949 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3950 (synopsis "Suite of sparse matrix software")
3952 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3953 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3954 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3955 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3956 CXSparse, a concise sparse Cholesky factorization package; and many other
3959 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3961 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3962 (license (list license:gpl2+ license:lgpl2.1+))))
3964 (define-public atlas
3970 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3971 version "/atlas" version ".tar.bz2"))
3974 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3975 (build-system gnu-build-system)
3976 (home-page "http://math-atlas.sourceforge.net/")
3977 (inputs `(("gfortran" ,gfortran)
3978 ("lapack-tar" ,(package-source lapack))))
3979 (outputs '("out" "doc"))
3980 ;; For the moment we drop support for MIPS at it fails to compile. See
3981 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3982 (supported-systems (delete "mips64el-linux" %supported-systems))
3984 `(#:parallel-build? #f
3985 #:parallel-tests? #f
3987 ;; ATLAS tunes itself for the machine it is built on, as explained at
3988 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3989 ;; For this reason, we want users to build it locally instead of using
3993 #:modules ((srfi srfi-26)
3994 (guix build gnu-build-system)
3997 `(;; Generate position independent code suitable for dynamic libraries
3998 ;; and use WALL timer to get more accurate timing.
3999 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4002 ,,(if (string-match "64" (%current-system))
4005 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4006 ;; needed to compile C files before it is generated.
4007 "-Ss" "pmake" "make -j 1"
4008 ;; Probe is failing for MIPS. We therefore define the system
4009 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4010 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4011 ,,@(if (string-prefix? "mips" (%current-system))
4012 (list "-A" "49" "-V" "1")
4014 ;; Generate shared libraries.
4016 ;; Build a full LAPACK library.
4017 ,(string-append "--with-netlib-lapack-tarfile="
4018 (assoc-ref %build-inputs "lapack-tar")))
4020 (modify-phases %standard-phases
4021 (add-after 'install 'install-doc
4022 (lambda* (#:key outputs inputs #:allow-other-keys)
4023 (let ((doc (string-append (assoc-ref outputs "doc")
4024 "/share/doc/atlas")))
4026 (for-each (cut install-file <> doc)
4027 (find-files "../ATLAS/doc" ".*"))
4029 (add-after 'check 'check-pt
4030 (lambda _ (invoke "make" "ptcheck")))
4031 ;; Fix files required to run configure.
4032 (add-before 'configure 'fix-/bin/sh
4034 ;; Use `sh', not `/bin/sh'.
4035 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4039 ;; Fix /bin/sh in generated make files.
4040 (add-after 'configure 'fix-/bin/sh-in-generated-files
4042 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4046 ;; ATLAS configure program does not accepts the default flags
4047 ;; passed by the 'gnu-build-system'.
4049 (lambda* (#:key native-inputs inputs outputs
4050 (configure-flags '())
4051 #:allow-other-keys #:rest args)
4052 (let* ((prefix (assoc-ref outputs "out"))
4053 (bash (or (and=> (assoc-ref
4054 (or native-inputs inputs) "bash")
4055 (cut string-append <> "/bin/bash"))
4057 (flags `(,(string-append "--prefix=" prefix)
4059 (abs-srcdir (getcwd))
4060 (srcdir (string-append "../" (basename abs-srcdir))))
4061 (format #t "source directory: ~s (relative from build: ~s)~%"
4065 (format #t "build directory: ~s~%" (getcwd))
4066 (format #t "configure flags: ~s~%" flags)
4068 (string-append srcdir "/configure")
4070 (synopsis "Automatically Tuned Linear Algebra Software")
4072 "ATLAS is an automatically tuned linear algebra software library
4073 providing C and Fortran77 interfaces to a portably efficient BLAS
4074 implementation, as well as a few routines from LAPACK.
4076 Optimization occurs at build time. For this reason, the library is built on
4077 the machine where it is installed, without resorting to pre-built substitutes.
4079 Before building the library, CPU throttling should be disabled. This can be
4080 done in the BIOS, or, on GNU/Linux, with the following command:
4083 # cpupower --governor performance
4086 Failure to do so will result in a library with poor performance.")
4087 (license license:bsd-3)))
4096 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4097 version "/glm-" version ".zip"))
4099 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4100 (build-system cmake-build-system)
4102 `(#:phases (modify-phases %standard-phases
4104 (lambda* (#:key outputs #:allow-other-keys)
4105 ;; Since version 0.9.9.6, 'make install' is not supported
4106 ;; and we have to do it "manually". Upstream discussion:
4107 ;; <https://github.com/g-truc/glm/pull/968>.
4108 (let* ((source (string-append "../glm"))
4109 (out (assoc-ref outputs "out"))
4110 (inc (string-append out "/include"))
4111 (lib (string-append out "/lib"))
4112 (pkgconfig (string-append lib "/pkgconfig")))
4113 (with-directory-excursion source
4116 (copy-recursively "glm" (string-append inc "/glm"))
4117 (copy-recursively "cmake" (string-append lib "/cmake"))
4118 (call-with-output-file (string-append pkgconfig "/glm.pc")
4122 includedir=${prefix}/include
4125 Description: OpenGL Mathematics
4127 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4130 `(("unzip" ,unzip)))
4131 (home-page "https://glm.g-truc.net/")
4132 (synopsis "OpenGL Mathematics library")
4133 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4134 library for graphics software based on the OpenGL Shading Language (GLSL)
4136 (license license:expat)))
4138 (define-public lpsolve
4145 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4146 "/lp_solve_" version "_source.tar.gz"))
4149 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4150 (modules '((guix build utils)))
4153 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4155 ;; Pretend to be on a 64 bit platform to obtain a common directory
4156 ;; name for the build results on all architectures; nothing else
4157 ;; seems to depend on it.
4158 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4160 ;; The check for 'isnan' as it is written fails with
4161 ;; "non-floating-point argument in call to function
4162 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4163 ;; definition, which in turn leads to bad things. Fix the feature
4165 (("isnan\\(0\\)") "isnan(0.)"))
4167 (build-system gnu-build-system)
4169 `(#:tests? #f ; no check target
4171 (modify-phases %standard-phases
4172 (delete 'configure) ; no configure script
4175 (with-directory-excursion "lpsolve55"
4176 (invoke "bash" "ccc"))
4177 (with-directory-excursion "lp_solve"
4178 (invoke "bash" "ccc"))
4181 (lambda* (#:key outputs #:allow-other-keys)
4182 (let* ((out (assoc-ref outputs "out"))
4183 (bin (string-append out "/bin"))
4184 (lib (string-append out "/lib"))
4185 ;; This is where LibreOffice expects to find the header
4186 ;; files, and where they are installed by Debian.
4187 (include (string-append out "/include/lpsolve")))
4188 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4189 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4190 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4192 ;; Install a subset of the header files as on Debian
4193 ;; (plus lp_bit.h, which matches the regular expression).
4194 (for-each (lambda (name)
4195 (install-file name include))
4196 (find-files "." "lp_[HMSa-z].*\\.h$"))
4197 (with-directory-excursion "shared"
4198 (for-each (lambda (name)
4199 (install-file name include))
4200 (find-files "." "\\.h$")))
4202 (home-page "http://lpsolve.sourceforge.net/")
4203 (synopsis "Mixed integer linear programming (MILP) solver")
4205 "lp_solve is a mixed integer linear programming solver based on the
4206 revised simplex and the branch-and-bound methods.")
4207 (license license:lgpl2.1+)))
4209 (define-public dealii
4216 (uri (string-append "https://github.com/dealii/dealii/releases/"
4217 "download/v" version "/dealii-" version ".tar.gz"))
4220 "0fm4xzrnb7dfn4415j24d8v3jkh0lssi86250x2f5wgi83xq4nnh"))
4221 (modules '((guix build utils)))
4223 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4225 (delete-file-recursively "bundled")
4227 (build-system cmake-build-system)
4235 ("arpack" ,arpack-ng)
4236 ("muparser" ,muparser)
4237 ("gfortran" ,gfortran)
4238 ("suitesparse" ,suitesparse))) ;for UMFPACK
4240 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4242 ;; Work around a bug in libsuitesparseconfig linking
4243 ;; see https://github.com/dealii/dealii/issues/4745
4244 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4245 (home-page "https://www.dealii.org")
4246 (synopsis "Finite element library")
4248 "Deal.II is a C++ program library targeted at the computational solution
4249 of partial differential equations using adaptive finite elements. The main
4250 aim of deal.II is to enable rapid development of modern finite element codes,
4251 using among other aspects adaptive meshes and a wide array of tools often used
4252 in finite element programs.")
4253 (license license:lgpl2.1+)))
4255 (define-public dealii-openmpi
4256 (package (inherit dealii)
4257 (name "dealii-openmpi")
4260 ;;Supported only with MPI:
4261 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4262 ("p4est" ,p4est-openmpi)
4263 ("petsc" ,petsc-openmpi)
4264 ("slepc" ,slepc-openmpi)
4265 ("metis" ,metis) ;for MUMPS
4266 ("scalapack" ,scalapack) ;for MUMPS
4267 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4268 ("arpack" ,arpack-ng-openmpi)
4269 ,@(fold alist-delete (package-inputs dealii)
4270 '("p4est" "arpack"))))
4272 (substitute-keyword-arguments (package-arguments dealii)
4273 ((#:configure-flags cf)
4274 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4276 ((#:phases phases '%standard-phases)
4277 `(modify-phases ,phases
4278 (add-before 'check 'mpi-setup
4279 ,%openmpi-setup)))))
4280 (synopsis "Finite element library (with MPI support)")))
4282 (define-public flann
4286 (home-page "https://github.com/mariusmuja/flann/")
4290 (uri (git-reference (url home-page) (commit version)))
4291 (file-name (git-file-name name version))
4294 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4295 (patches (search-patches "flann-cmake-3.11.patch"))))
4296 (build-system cmake-build-system)
4299 `(("unzip" ,unzip)))
4302 ;; FIXME: 'mkoctfile' fails with a linker error:
4303 ;; ld: cannot find -loctinterp
4304 ;; ld: cannot find -loctave
4305 ;; Disable it for now.
4306 ;;("octave" ,octave-cli)
4307 ("python" ,python-2) ; print syntax
4308 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4311 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4312 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4313 #:strip-directories '("lib" "lib64" "libexec"
4314 "bin" "sbin" "share/flann/octave")
4316 ;; Save 12 MiB by not installing .a files. Passing
4317 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4318 #:phases (modify-phases %standard-phases
4319 (add-after 'install 'remove-static-libraries
4320 (lambda* (#:key outputs #:allow-other-keys)
4321 (let* ((out (assoc-ref outputs "out"))
4322 (lib (string-append out "/lib")))
4323 (for-each delete-file
4324 (find-files lib "\\.a$"))
4327 #:tests? #f)) ; The test data are downloaded from the Internet.
4328 (synopsis "Library for approximate nearest neighbors computation")
4329 (description "FLANN is a library for performing fast approximate
4330 nearest neighbor searches in high dimensional spaces. It implements a
4331 collection of algorithms and a system for automatically choosing the best
4332 algorithm and optimum parameters depending on the dataset.
4334 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4335 (license (license:non-copyleft "file://COPYING"
4336 "See COPYING in the distribution."))))
4338 (define-public wcalc
4345 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4346 "wcalc-" version ".tar.bz2"))
4349 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4350 (build-system gnu-build-system)
4353 ("readline" ,readline)))
4354 (home-page "http://w-calc.sourceforge.net/index.php")
4355 (synopsis "Flexible command-line scientific calculator")
4356 (description "Wcalc is a very capable calculator. It has standard functions
4357 (sin, asin, and sinh for example, in either radians or degrees), many
4358 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4359 variables, a command history, hex/octal/binary input and output, unit
4360 conversions, embedded comments, and an expandable expression entry field. It
4361 evaluates expressions using the standard order of operations.")
4362 (license license:gpl2+)))
4371 (url "https://github.com/xaos-project/XaoS")
4372 (commit (string-append "release-" version))))
4373 (file-name (git-file-name name version))
4376 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4377 (build-system gnu-build-system)
4378 (native-inputs `(("gettext" ,gettext-minimal)
4380 ("qttools" ,qttools)))
4381 (inputs `(("libx11" ,libx11)
4385 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4386 ;; not enough for this package to install properly. These phases fix that.
4388 `(#:tests? #f ;no "check" target
4390 (modify-phases %standard-phases
4391 (add-before 'configure 'make-qt-deterministic
4393 ;; Make Qt deterministic.
4394 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4397 (lambda* (#:key outputs #:allow-other-keys)
4398 (let ((out (assoc-ref outputs "out")))
4399 ;; The DESTDIR is originally set to install the xaos binary to
4400 ;; the "bin" folder inside the build directory. Setting make
4401 ;; flags doesn't seem to change this.
4402 (substitute* "XaoS.pro"
4404 (string-append "DESTDIR=" out "/bin")))
4405 (substitute* "src/include/config.h"
4406 (("/usr/share/XaoS")
4407 (string-append out "/share/XaoS")))
4409 (add-after 'install 'install-data
4410 (lambda* (#:key outputs #:allow-other-keys)
4411 (let* ((out (assoc-ref outputs "out"))
4412 (share (string-append out "/share")))
4416 (copy-recursively folder
4417 (string-append share "/XaoS/" folder)))
4418 '("catalogs" "examples" "tutorial"))
4419 (install-file "xdg/xaos.png"
4420 (string-append share "/pixmaps"))
4421 (install-file "xdg/xaos.desktop"
4422 (string-append share "/applications")))
4424 (synopsis "Real-time fractal zoomer")
4425 (description "GNU XaoS is a graphical program that generates fractal
4426 patterns and allows you to zoom in and out of them infinitely in a fluid,
4427 continuous manner. It also includes tutorials that help to explain how fractals
4428 are built. It can generate many different fractal types such as the Mandelbrot
4430 (home-page "https://xaos-project.github.io/")
4431 (license license:gpl2+)))
4433 (define-public hypre
4441 (url "https://github.com/LLNL/hypre")
4442 (commit (string-append "v" version))))
4443 (file-name (git-file-name name version))
4445 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4446 (modules '((guix build utils)))
4449 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4450 ;; substitute the release date.
4451 (substitute* "src/utilities/HYPRE_utilities.h"
4452 (("Date Compiled: .*$")
4453 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4455 (build-system gnu-build-system)
4456 (outputs '("out" ; 6.1 MiB of headers and libraries
4457 "doc")) ; 4.8 MiB of documentation
4461 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4462 ("texlive" ,(texlive-union (list texlive-xypic
4464 texlive-latex-hyperref
4466 ("ghostscript" ,ghostscript)))
4468 `(("blas" ,openblas)
4469 ("lapack" ,lapack)))
4471 `(#:modules ((srfi srfi-1)
4472 ,@%gnu-build-system-modules)
4473 #:configure-flags '("--enable-shared"
4481 (modify-phases %standard-phases
4482 (add-before 'build 'set-HOME
4484 ;; FIXME: texlive-union does not find the built
4485 ;; metafonts, so it tries to generate them in HOME.
4486 (setenv "HOME" "/tmp")
4488 (add-before 'configure 'chdir-src
4489 (lambda _ (chdir "src")))
4491 (lambda* (#:key build target configure-flags
4492 #:allow-other-keys #:rest args)
4493 (let* ((configure (assoc-ref %standard-phases 'configure)))
4496 (list #:configure-flags
4497 (cons (string-append
4498 "--host=" (or target build))
4499 configure-flags)))))))
4500 (add-after 'build 'build-docs
4502 (invoke "make" "-Cdocs" "pdf" "html")))
4505 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4506 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4507 (invoke "make" "check" "CHECKRUN=")
4508 (for-each (lambda (filename)
4509 (let ((size (stat:size (stat filename))))
4510 (when (positive? size)
4511 (error (format #f "~a size ~d; error indication~%"
4513 (find-files "test" ".*\\.err$"))
4515 (add-after 'install 'install-docs
4516 (lambda* (#:key outputs #:allow-other-keys)
4517 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4518 (let* ((doc (assoc-ref outputs "doc"))
4519 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4520 (with-directory-excursion "docs"
4521 (for-each (lambda (base)
4522 (install-file (string-append base ".pdf") docdir)
4523 (copy-recursively base docdir)) ; html docs
4524 '("HYPRE_usr_manual"
4525 "HYPRE_ref_manual")))
4527 (home-page "http://www.llnl.gov/casc/hypre/")
4528 (synopsis "Library of solvers and preconditioners for linear equations")
4530 "HYPRE is a software library of high performance preconditioners and
4531 solvers for the solution of large, sparse linear systems of equations. It
4532 features multigrid solvers for both structured and unstructured grid
4534 (license license:lgpl2.1)))
4536 (define-public hypre-openmpi
4537 (package (inherit hypre)
4538 (name "hypre-openmpi")
4541 ,@(package-inputs hypre)))
4543 (substitute-keyword-arguments (package-arguments hypre)
4544 ((#:configure-flags flags)
4546 ,@(delete "--without-MPI" ,flags)))
4548 `(modify-phases ,phases
4549 (add-before 'check 'mpi-setup
4550 ,%openmpi-setup)))))
4551 (synopsis "Parallel solvers and preconditioners for linear equations")
4553 "HYPRE is a software library of high performance preconditioners and
4554 solvers for the solution of large, sparse linear systems of equations on
4555 parallel computers. It features parallel multigrid solvers for both
4556 structured and unstructured grid problems.")))
4558 (define-public matio
4565 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4566 "matio-" version ".tar.gz"))
4569 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4570 (build-system gnu-build-system)
4573 ("hdf5" ,hdf5-1.8)))
4574 (home-page "http://matio.sourceforge.net/")
4575 (synopsis "Library for reading and writing MAT files")
4576 (description "Matio is a library for reading and writing MAT files. It
4577 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4578 (license license:bsd-2)))
4585 (origin (method url-fetch)
4586 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4587 "download/" version "/Vc-" version ".tar.gz"))
4590 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4591 (build-system cmake-build-system)
4594 '("-DBUILD_TESTING=ON"
4595 ;; By default, Vc will optimize for the CPU of the build machine.
4596 ;; Setting this to "none" makes it create portable binaries. See
4597 ;; "cmake/OptimizeForArchitecture.cmake".
4598 "-DTARGET_ARCHITECTURE=none")
4599 #:phases (modify-phases %standard-phases
4600 (add-after 'unpack 'copy-testdata
4601 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4602 (let ((testdata (assoc-ref (or native-inputs inputs)
4604 (copy-recursively testdata "tests/testdata")
4607 `(("virtest" ,virtest)
4609 ;; This is a submodule in the git project, but not part of the
4610 ;; released sources. See the git branch for the commit to take.
4611 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4615 (url "https://github.com/VcDevel/vc-testdata")
4616 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4617 (file-name (git-file-name "vc-testdata"
4618 (string-take commit 7)))
4621 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4622 (synopsis "SIMD vector classes for C++")
4623 (description "Vc provides portable, zero-overhead C++ types for explicitly
4624 data-parallel programming. It is a library designed to ease explicit
4625 vectorization of C++ code. Its types enable explicitly stating data-parallel
4626 operations on multiple values. The parallelism is therefore added via the type
4627 system. Vc has an intuitive API and provides portability between different
4628 compilers and compiler versions as well as portability between different vector
4629 instruction sets. Thus, an application written with Vc can be compiled for:
4632 @item SSE2 up to SSE4.2 or SSE4a
4635 @item NEON (in development)
4636 @item NVIDIA GPUs / CUDA (in development)
4638 (home-page "https://github.com/VcDevel/Vc")
4639 ;; "No support_???.cpp file exists for this architecture."
4640 (supported-systems '("x86_64-linux" "i686-linux"))
4641 (license license:bsd-3)))
4643 (define-public reducelcs
4644 ;; This is the last commit which is available upstream, no
4645 ;; release happened since 2010.
4646 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4650 (version (string-append "1.0-" revision "." (string-take commit 7)))
4655 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4657 (file-name (string-append name "-" version "-checkout"))
4660 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4661 (build-system gnu-build-system)
4663 `(("openlibm" ,openlibm)))
4665 `(#:tests? #f ; no tests
4667 (modify-phases %standard-phases
4668 (delete 'configure) ; No configure script exists.
4669 (replace 'install ; No install phase exists.
4670 (lambda* (#:key outputs #:allow-other-keys)
4671 (let* ((out (assoc-ref outputs "out"))
4672 (bin (string-append out "/bin")))
4673 (install-file "Approximation" bin)
4674 (install-file "CollectResults" bin)
4675 (install-file "GenerateInstances" bin)
4677 (synopsis "Approximate Longest Commons Subsequence computation tool")
4679 "@code{reduceLCS} is an implementation of the Reduce-Expand
4680 algorithm for LCS. It is a fast program to compute the approximate
4681 Longest Commons Subsequence of a set of strings.")
4682 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4683 (license license:gpl3+))))
4685 (define-public jacal
4692 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4695 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4696 (patches (search-patches "jacal-fix-texinfo.patch"))))
4697 (build-system gnu-build-system)
4700 (modify-phases %standard-phases
4701 (add-before 'build 'pre-build
4702 ;; Don't use upstream's script - it really doesn't fit into
4703 ;; Guix's functional paradigm.
4704 (lambda* (#:key inputs outputs #:allow-other-keys)
4705 (substitute* "Makefile"
4706 (("^install: install-script") "install: "))))
4707 (add-after 'install 'post-install
4708 ;; Instead, we provide our own simplified script.
4709 (lambda* (#:key inputs outputs #:allow-other-keys)
4710 (let ((wrapper (string-append (assoc-ref outputs "out")
4712 (format (open wrapper (logior O_WRONLY O_CREAT))
4713 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4714 "-e '(slib:load \"~a/lib/jacal/math\") "
4717 (assoc-ref inputs "scm")
4718 (assoc-ref outputs "out"))
4719 (chmod wrapper #o555))))
4721 (lambda* (#:key outputs #:allow-other-keys)
4722 (invoke "./configure"
4723 (string-append "--prefix="
4724 (assoc-ref outputs "out"))))))))
4725 (inputs `(("scm" ,scm)))
4726 (native-inputs `(("unzip" ,unzip)
4727 ("texinfo" ,texinfo)))
4728 (synopsis "Symbolic mathematics system")
4729 (description "GNU JACAL is an interactive symbolic mathematics program based on
4730 Scheme. It manipulate and simplify a range of mathematical expressions such
4731 as equations, scalars, vectors, and matrices.")
4732 (home-page "https://www.gnu.org/software/jacal/")
4733 (license license:gpl3+)))
4739 (home-page "https://github.com/Z3Prover/z3")
4742 (uri (git-reference (url home-page)
4743 (commit (string-append "z3-" version))))
4744 (file-name (git-file-name name version))
4747 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
4748 (build-system gnu-build-system)
4750 `(#:imported-modules ((guix build python-build-system)
4751 ,@%gnu-build-system-modules)
4752 #:modules (((guix build python-build-system) #:select (site-packages))
4753 (guix build gnu-build-system)
4756 (modify-phases %standard-phases
4757 (add-after 'unpack 'enable-bytecode-determinism
4759 (setenv "PYTHONHASHSEED" "0")
4761 (add-after 'unpack 'fix-compatability
4762 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4764 (substitute* "src/util/mpz.cpp"
4765 (("#include <immintrin.h>") ""))
4767 (add-before 'configure 'bootstrap
4769 (invoke "python" "scripts/mk_make.py")))
4770 ;; work around gnu-build-system's setting --enable-fast-install
4771 ;; (z3's `configure' is a wrapper around the above python file,
4772 ;; which fails when passed --enable-fast-install)
4774 (lambda* (#:key inputs outputs #:allow-other-keys)
4775 (invoke "./configure"
4777 (string-append "--prefix=" (assoc-ref outputs "out"))
4778 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4779 (add-after 'configure 'change-directory
4783 (add-before 'check 'make-test-z3
4785 ;; Build the test suite executable.
4786 (invoke "make" "test-z3" "-j"
4787 (number->string (parallel-job-count)))))
4790 ;; Run all the tests that don't require arguments.
4791 (invoke "./test-z3" "/a"))))))
4794 ("python" ,python-wrapper)))
4795 (synopsis "Theorem prover")
4796 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4797 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4798 (license license:expat)))
4803 (version "2018.11.001")
4806 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4807 version "/elpa-" version ".tar.gz"))
4810 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4811 (build-system gnu-build-system)
4813 `(("fortran" ,gfortran)
4814 ("perl" ,perl))) ;for configure and deps
4816 `(("blas" ,openblas)))
4821 ;; ELPA unfortunately does not support runtime dispatch, so we can
4822 ;; only enable the "generic" kernels. See the "Cross compilation"
4823 ;; section of INSTALL.md.
4825 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4826 "--disable-avx" "--disable-avx2" "--disable-avx512"
4827 ,(string-append "CFLAGS=-O3 "
4828 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4829 "-ftree-vect-loop-version -ftree-vectorize "
4830 ,(let ((system (or (%current-target-system)
4831 (%current-system))))
4833 ((or (string-prefix? "x86_64" system)
4834 (string-prefix? "i686" system))
4837 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4839 (modify-phases %standard-phases
4840 (add-before 'configure 'patch-header-generation
4842 (substitute* "configure"
4843 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4844 (string-append & " CPP=\"$CPP\"")))
4846 (add-before 'check 'setup-tests
4848 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4849 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4850 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4851 ;; for Fortran. This also causes several tests to pass that
4852 ;; otherwise would otherwise fail with matrix size 5000; possibly
4853 ;; due to floating point tolerances that are too tight.
4854 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4855 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4856 (substitute* "Makefile"
4857 ;; Test scripts are generated, patch the shebang
4858 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4860 (home-page "http://elpa.mpcdf.mpg.de")
4861 (synopsis "Eigenvalue solvers for symmetric matrices")
4863 "The ELPA library provides efficient and scalable direct eigensolvers for
4864 symmetric matrices.")
4865 (license license:lgpl3)))
4867 (define-public elpa-openmpi
4868 (package (inherit elpa)
4869 (name "elpa-openmpi")
4872 ("scalapack" ,scalapack)
4873 ,@(package-inputs elpa)))
4875 (substitute-keyword-arguments (package-arguments elpa)
4876 ((#:configure-flags cf '())
4877 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4878 ((#:phases phases '%standard-phases)
4879 `(modify-phases ,phases
4880 (add-before 'check 'mpi-setup
4882 ;; Tests use 2 mpi tasks by default, use our remaining build
4883 ;; cores as OpenMP threads.
4884 (setenv "OMP_NUM_THREADS" (number->string
4885 (max (quotient (parallel-job-count) 2)
4887 (,%openmpi-setup)))))))
4888 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4890 (define-public elemental
4897 (url "https://github.com/elemental/Elemental")
4898 (commit (string-append "v" version))))
4899 (file-name (git-file-name name version))
4902 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4903 (build-system cmake-build-system)
4904 (home-page "https://github.com/elemental/Elemental")
4906 `(("gfortran" ,gfortran)))
4908 `(("blas" ,openblas)
4909 ("gfortran:lib" ,gfortran "lib")
4918 `(#:build-type "Release" ;default RelWithDebInfo not supported
4919 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4920 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4921 "-DEL_CACHE_WARNINGS:BOOL=YES"
4922 "-DEL_TESTS:BOOL=YES"
4923 "-DCMAKE_INSTALL_LIBDIR=lib"
4924 "-DGFORTRAN_LIB=gfortran")
4925 #:phases (modify-phases %standard-phases
4926 (add-before 'check 'mpi-setup
4928 (add-before 'check 'setup-tests
4930 ;; Parallelism is done at the MPI layer.
4931 (setenv "OMP_NUM_THREADS" "1")
4933 (add-after 'install 'remove-tests
4934 (lambda* (#:key outputs #:allow-other-keys)
4935 ;; Tests are installed, with no easy configuration
4936 ;; switch to prevent this, so delete them.
4937 (delete-file-recursively
4938 (string-append (assoc-ref outputs "out") "/bin"))
4940 (synopsis "Dense and sparse-direct linear algebra and optimization")
4941 (description "Elemental is a modern C++ library for distributed-memory
4942 dense and sparse-direct linear algebra, conic optimization, and lattice
4944 (license license:bsd-2)))
4946 (define-public mcrl2
4949 (version "202006.0")
4953 "https://www.mcrl2.org/download/release/mcrl2-"
4957 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4962 ("qtbase" ,qtbase)))
4963 (build-system cmake-build-system)
4964 (synopsis "Toolset for the mCRL2 formal specification language")
4966 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4967 specification language for describing concurrent discrete event systems. Its
4968 toolset supports analysis and automatic verification, linearisation, simulation,
4969 state-space exploration and generation, and tools to optimise and analyse
4970 specifications. Also, state spaces can be manipulated, visualised and
4972 (home-page "https://mcrl2.org")
4973 (license license:boost1.0)))
4975 (define-public mcrl2-minimal
4978 (name "mcrl2-minimal")
4980 `(("boost" ,boost)))
4982 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4984 (define-public tcalc
4991 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4995 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4996 (build-system gnu-build-system)
4997 (synopsis "The terminal calculator")
4999 "The terminal calculator is a small program to help users of the GNU/Linux
5000 terminal do calculations simply and quickly. The formula to be calculated can
5001 be fed to @command{tcalc} through the command line.")
5002 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5003 (license license:gpl3+)))
5005 (define-public tiny-bignum
5006 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5008 (name "tiny-bignum")
5009 (version (git-version "0" "0" commit))
5014 (url "https://github.com/kokke/tiny-bignum-c")
5016 (file-name (git-file-name "tiny-bignum" commit))
5018 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5019 (build-system gnu-build-system)
5022 (modify-phases %standard-phases
5024 (add-after 'unpack 'patch-tests
5026 (substitute* "scripts/test_rand.py"
5028 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5031 (lambda* (#:key tests? #:allow-other-keys)
5033 (invoke "make" "test"))
5036 (lambda* (#:key outputs #:allow-other-keys)
5037 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5038 (doc (string-append (assoc-ref outputs "out") "/doc")))
5040 (install-file "bn.c" share)
5041 (install-file "bn.h" share)
5043 (install-file "LICENSE" doc)
5044 (install-file "README.md" doc))
5047 `(("python" ,python-wrapper)))
5048 (home-page "https://github.com/kokke/tiny-bignum-c")
5049 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5051 "This library provides portable Arbitrary-precision unsigned integer
5052 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5053 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5054 and comparisons are supported.")
5055 (license license:unlicense))))
5057 (define-public sundials
5064 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5065 "sundials-" version ".tar.gz"))
5068 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5069 (build-system cmake-build-system)
5071 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5073 `(("fortran" ,gfortran) ;for fcmix
5075 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5077 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5078 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5079 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5080 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5081 "-DEXAMPLES_INSTALL:BOOL=OFF"
5083 "-DFCMIX_ENABLE:BOOL=ON"
5085 "-DKLU_ENABLE:BOOL=ON"
5086 ,(string-append "-DKLU_INCLUDE_DIR="
5087 (assoc-ref %build-inputs "suitesparse")
5089 ,(string-append "-DKLU_LIBRARY_DIR="
5090 (assoc-ref %build-inputs "suitesparse")
5092 (home-page "https://computation.llnl.gov/projects/sundials")
5093 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5094 (description "SUNDIALS is a family of software packages implemented with
5095 the goal of providing robust time integrators and nonlinear solvers that can
5096 easily be incorporated into existing simulation codes.")
5097 (license license:bsd-3)))
5099 (define-public sundials-openmpi
5100 (package (inherit sundials)
5101 (name "sundials-openmpi")
5104 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5105 ,@(package-inputs sundials)))
5107 (substitute-keyword-arguments (package-arguments sundials)
5108 ((#:configure-flags flags '())
5109 `(cons* "-DMPI_ENABLE:BOOL=ON"
5110 "-DPETSC_ENABLE:BOOL=ON"
5111 (string-append "-DPETSC_INCLUDE_DIR="
5112 (assoc-ref %build-inputs "petsc")
5114 (string-append "-DPETSC_LIBRARY_DIR="
5115 (assoc-ref %build-inputs "petsc")
5118 ((#:phases phases '%standard-phases)
5119 `(modify-phases ,phases
5120 (add-before 'check 'mpi-setup
5121 ,%openmpi-setup)))))
5122 (synopsis "SUNDIALS with OpenMPI support")))
5124 (define-public combinatorial-blas
5126 (name "combinatorial-blas")
5131 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5133 (match (string-split version #\.)
5134 ((major minor patch)
5135 (string-append major minor "_" patch))) ;e.g. "16_2"
5139 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5140 (patches (search-patches "combinatorial-blas-awpm.patch"
5141 "combinatorial-blas-io-fix.patch"))))
5142 (build-system cmake-build-system)
5145 ("test-data" ,(origin
5147 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5148 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5151 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5153 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5154 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5155 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5157 (modify-phases %standard-phases
5158 (add-before 'check 'mpi-setup
5160 (add-before 'check 'test-setup
5161 (lambda* (#:key inputs #:allow-other-keys)
5162 (setenv "OMP_NUM_THREADS" "2")
5163 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5164 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5165 (synopsis "Linear algebra primitives for graph analytics")
5166 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5167 distributed-memory parallel graph library offering a small but powerful set of
5168 linear algebra primitives specifically targeting graph analytics.")
5170 license:gpl2+ ;include/psort/(funnel|sort)*.h
5171 license:x11 ;usort and psort
5172 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5174 (define-public dune-common
5176 (name "dune-common")
5181 (uri (string-append "https://dune-project.org/download/"
5182 version "/dune-common-" version ".tar.gz"))
5185 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5186 (build-system cmake-build-system)
5189 (modify-phases %standard-phases
5190 (add-after 'build 'build-tests
5191 (lambda* (#:key make-flags #:allow-other-keys)
5192 (apply invoke "make" "build_tests" make-flags))))))
5196 ("openblas" ,openblas)
5198 ("superlu" ,superlu)))
5200 `(("gfortran" ,gfortran)
5201 ("pkg-config" ,pkg-config)))
5202 (home-page "https://dune-project.org/")
5203 (synopsis "Distributed and Unified Numerics Environment")
5204 (description "DUNE, the Distributed and Unified Numerics Environment is a
5205 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5206 grid-based methods. It supports the easy implementation of methods like
5207 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5208 Differences} (FD).")
5209 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5210 (license license:gpl2)))
5212 (define-public dune-geometry
5214 (name "dune-geometry")
5219 (uri (string-append "https://dune-project.org/download/"
5220 version "/dune-geometry-" version ".tar.gz"))
5223 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5224 (build-system cmake-build-system)
5227 (modify-phases %standard-phases
5228 (add-after 'build 'build-tests
5229 (lambda* (#:key make-flags #:allow-other-keys)
5230 (apply invoke "make" "build_tests" make-flags))))))
5232 `(("dune-common" ,dune-common)
5234 ("openblas" ,openblas)
5236 ("python" ,python)))
5238 `(("gfortran" ,gfortran)
5239 ("pkg-config" ,pkg-config)))
5240 (home-page "https://dune-project.org/")
5241 (synopsis "Distributed and Unified Numerics Environment")
5242 (description "DUNE, the Distributed and Unified Numerics Environment is a
5243 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5244 grid-based methods. It supports the easy implementation of methods like
5245 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5248 This package contains the basic DUNE geometry classes.")
5249 ;; GPL version 2 with "runtime exception"
5250 (license license:gpl2)))
5252 (define-public dune-uggrid
5254 (name "dune-uggrid")
5260 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5261 (commit (string-append "v" version))))
5262 (file-name (git-file-name name version))
5265 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5266 (build-system cmake-build-system)
5269 (modify-phases %standard-phases
5270 (add-after 'build 'build-tests
5271 (lambda* (#:key make-flags #:allow-other-keys)
5272 (apply invoke "make" "build_tests" make-flags))))))
5274 `(("dune-common" ,dune-common)))
5276 `(("gfortran" ,gfortran)
5277 ("pkg-config" ,pkg-config)))
5278 (home-page "https://dune-project.org/")
5279 (synopsis "Distributed and Unified Numerics Environment")
5280 (description "DUNE, the Distributed and Unified Numerics Environment is a
5281 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5282 grid-based methods. It supports the easy implementation of methods like
5283 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5286 This package contains the DUNE UG grid classes.")
5287 (license license:lgpl2.1)))
5289 (define-public dune-grid
5296 (uri (string-append "https://dune-project.org/download/"
5297 version "/dune-grid-" version ".tar.gz"))
5300 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5301 (build-system cmake-build-system)
5304 (modify-phases %standard-phases
5305 (add-after 'build 'build-tests
5306 (lambda* (#:key make-flags #:allow-other-keys)
5307 (apply invoke "make" "build_tests" make-flags))))))
5309 `(("dune-common" ,dune-common)
5310 ("dune-geometry" ,dune-geometry)
5313 ("openblas" ,openblas)
5314 ("python" ,python)))
5316 `(("dune-uggrid" ,dune-uggrid)))
5318 `(("gfortran" ,gfortran)
5319 ("pkg-config" ,pkg-config)))
5320 (home-page "https://dune-project.org/")
5321 (synopsis "Distributed and Unified Numerics Environment")
5322 (description "DUNE, the Distributed and Unified Numerics Environment is a
5323 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5324 grid-based methods. It supports the easy implementation of methods like
5325 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5328 This package contains the basic DUNE grid classes.")
5329 ;; GPL version 2 with "runtime exception"
5330 (license license:gpl2)))
5332 (define-public dune-istl
5339 (uri (string-append "https://dune-project.org/download/"
5340 version "/dune-istl-" version ".tar.gz"))
5343 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5344 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5345 (build-system cmake-build-system)
5348 (modify-phases %standard-phases
5349 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5350 ;; the stdlib types when the gfortran header is used. Remove gfortran
5351 ;; from CPLUS_INCLUDE_PATH as a workaround.
5352 (add-after 'set-paths 'hide-gfortran
5353 (lambda* (#:key inputs #:allow-other-keys)
5354 (let ((gfortran (assoc-ref inputs "gfortran")))
5355 (setenv "CPLUS_INCLUDE_PATH"
5357 (delete (string-append gfortran "/include/c++")
5358 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5361 (add-after 'build 'build-tests
5362 (lambda* (#:key make-flags #:allow-other-keys)
5363 (apply invoke "make" "build_tests" make-flags))))))
5365 `(("dune-common" ,dune-common)
5368 ("suitesparse" ,suitesparse)
5369 ("superlu" ,superlu)
5370 ("openblas" ,openblas)
5372 ("python" ,python)))
5374 `(("gfortran" ,gfortran)
5375 ("pkg-config" ,pkg-config)))
5376 (home-page "https://dune-project.org/")
5377 (synopsis "Distributed and Unified Numerics Environment")
5378 (description "DUNE, the Distributed and Unified Numerics Environment is a
5379 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5382 This is the iterative solver template library which provides generic sparse
5383 matrix/vector classes and a variety of solvers based on these classes. A
5384 special feature is the use of templates to exploit the recursive block
5385 structure of finite element matrices at compile time. Available solvers
5386 include Krylov methods, (block-) incomplete decompositions and
5387 aggregation-based algebraic multigrid.")
5388 ;; GPL version 2 with "runtime exception"
5389 (license license:gpl2)))
5391 (define-public dune-localfunctions
5393 (name "dune-localfunctions")
5398 (uri (string-append "https://dune-project.org/download/"
5399 version "/dune-localfunctions-" version ".tar.gz"))
5402 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5403 (build-system cmake-build-system)
5406 (modify-phases %standard-phases
5407 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5408 ;; and fails to find the stdlib types when the gfortran header is used.
5409 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5410 (add-after 'set-paths 'hide-gfortran
5411 (lambda* (#:key inputs #:allow-other-keys)
5412 (let ((gfortran (assoc-ref inputs "gfortran")))
5413 (setenv "CPLUS_INCLUDE_PATH"
5415 (delete (string-append gfortran "/include/c++")
5416 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5419 (add-after 'build 'build-tests
5420 (lambda* (#:key make-flags #:allow-other-keys)
5421 (apply invoke "make" "build_tests" make-flags))))))
5423 `(("dune-common" ,dune-common)
5424 ("dune-geometry" ,dune-geometry)
5427 ("superlu" ,superlu)
5430 `(("gfortran" ,gfortran)
5431 ("pkg-config" ,pkg-config)))
5432 (home-page "https://dune-project.org/")
5433 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5434 (description "This DUNE module provides interface and implementation for
5435 shape functions defined on the DUNE reference elements. In addition to the
5436 shape function, interpolation operators and special keys are provided which
5437 can be used to assemble global function spaces on finite-element grids.
5439 This package provides an interface and implementation for shape functions
5440 defined on the DUNE reference elements. In addition to the shape function,
5441 interpolation operators and special keys are provided which can be used to
5442 assemble global function spaces on finite-element grids.")
5443 ;; GPL version 2 with "runtime exception"
5444 (license license:gpl2)))
5446 (define-public dune-alugrid
5448 (name "dune-alugrid")
5449 (version "2.7.0-git-81d35682")
5454 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5455 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5456 (file-name (git-file-name name version))
5459 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5460 (build-system cmake-build-system)
5463 (modify-phases %standard-phases
5464 (add-after 'unpack 'patch-include
5466 (substitute* "dune/alugrid/test/test-alugrid.cc"
5467 (("doc/grids/gridfactory/testgrids")
5468 "doc/dune-grid/grids/gridfactory/testgrids"))
5470 (add-after 'build 'build-tests
5471 (lambda* (#:key inputs make-flags #:allow-other-keys)
5472 (setenv "CPLUS_INCLUDE_PATH"
5473 (string-append (assoc-ref inputs "dune-grid") "/share"))
5474 (apply invoke "make" "build_tests" make-flags))))))
5476 `(("dune-common" ,dune-common)
5477 ("dune-geometry" ,dune-geometry)
5478 ("dune-grid" ,dune-grid)
5481 ("openblas" ,openblas)
5483 ("superlu" ,superlu)
5487 `(("gfortran" ,gfortran)
5488 ("pkg-config" ,pkg-config)))
5489 (home-page "https://dune-project.org/")
5490 (synopsis "Distributed and Unified Numerics Environment")
5491 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5492 implementation of the DUNE grid interface supporting either simplices or
5494 (license license:gpl2+)))
5496 (define-public dune-subgrid
5498 (name "dune-subgrid")
5499 (version "2.7.0-git-2103a363")
5504 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5505 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5506 (file-name (git-file-name name version))
5509 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5510 (build-system cmake-build-system)
5513 (modify-phases %standard-phases
5514 (add-after 'build 'build-tests
5515 (lambda* (#:key make-flags #:allow-other-keys)
5516 (apply invoke "make" "build_tests" make-flags))))))
5518 `(("dune-common" ,dune-common)
5519 ("dune-geometry" ,dune-geometry)
5520 ("dune-grid" ,dune-grid)
5523 ("openblas" ,openblas)
5526 `(("gfortran" ,gfortran)
5527 ("pkg-config" ,pkg-config)))
5528 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5529 (synopsis "Distributed and Unified Numerics Environment")
5530 (description "The dune-subgrid module marks elements of
5531 another hierarchical dune grid. The set of marked elements can then be
5532 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5533 provides the full grid interface including adaptive mesh refinement.")
5534 (license license:gpl2+)))
5536 (define-public dune-typetree
5538 (name "dune-typetree")
5544 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5545 (commit (string-append "v" version))))
5546 (file-name (git-file-name name version))
5549 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5550 (build-system cmake-build-system)
5553 (modify-phases %standard-phases
5554 (add-after 'build 'build-tests
5555 (lambda* (#:key make-flags #:allow-other-keys)
5556 (apply invoke "make" "build_tests" make-flags))))))
5558 `(("dune-common" ,dune-common)
5560 ("openblas" ,openblas)
5563 ("superlu" ,superlu)
5566 `(("gfortran" ,gfortran)
5567 ("pkg-config" ,pkg-config)))
5568 (home-page "https://dune-project.org/")
5569 (synopsis "Distributed and Unified Numerics Environment")
5570 (description "TypeTree is a template library for constructing and
5571 operating on statically typed trees of objects.")
5572 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5573 (license (list license:lgpl3+ license:gpl2))))
5575 (define-public dune-functions
5577 (name "dune-functions")
5583 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5584 (commit (string-append "v" version))))
5585 (file-name (git-file-name name version))
5588 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5589 (build-system cmake-build-system)
5592 (modify-phases %standard-phases
5593 (add-after 'unpack 'disable-failing-tests
5596 ;; unable to load GMSH file in this test
5597 "--exclude-regex gridviewfunctionspacebasistest")
5599 (add-after 'build 'build-tests
5600 (lambda* (#:key make-flags #:allow-other-keys)
5601 (apply invoke "make" "build_tests" make-flags))))))
5603 `(("dune-common" ,dune-common)
5604 ("dune-istl" ,dune-istl)
5605 ("dune-localfunctions" ,dune-localfunctions)
5606 ("dune-grid" ,dune-grid)
5607 ("dune-geometry" ,dune-geometry)
5608 ("dune-typetree" ,dune-typetree)
5609 ("openblas" ,openblas)
5612 ("superlu" ,superlu)
5615 `(("gfortran" ,gfortran)
5616 ("pkg-config" ,pkg-config)))
5617 (home-page "https://dune-project.org/")
5618 (synopsis "Distributed and Unified Numerics Environment")
5619 (description "The dune-functions module provides an abstraction layer for
5620 global finite element functions. Its two main concepts are functions
5621 implemented as callable objects, and bases of finite element spaces.")
5622 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5623 (license (list license:lgpl3+ license:gpl2))))
5625 (define-public dune-pdelab
5627 (name "dune-pdelab")
5628 (version "2.7.0-git-476fe437")
5633 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5634 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5635 (file-name (git-file-name name version))
5638 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5639 (build-system cmake-build-system)
5640 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5642 `(("dune-common" ,dune-common)
5643 ("dune-istl" ,dune-istl)
5644 ("dune-localfunctions" ,dune-localfunctions)
5645 ("dune-geometry" ,dune-geometry)
5646 ("dune-grid" ,dune-grid)
5647 ("dune-typetree" ,dune-typetree)
5648 ("dune-functions" ,dune-functions)
5650 ("openblas" ,openblas)
5654 ("superlu" ,superlu)
5657 `(("gfortran" ,gfortran)
5658 ("pkg-config" ,pkg-config)))
5659 (home-page "https://dune-project.org/")
5660 (synopsis "Differential equations solver toolbox")
5661 (description "PDELab is a partial differential equations solver toolbox
5662 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5663 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5664 (license (list license:lgpl3+ license:gpl2))))
5666 (define add-openmpi-to-dune-package
5667 (let ((dune-package?
5668 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5671 (if (dune-package? p)
5672 (package (inherit p)
5673 (name (string-append (package-name p) "-openmpi"))
5674 (inputs `(,@(package-inputs p)
5675 ("openmpi" ,openmpi)))
5677 (substitute-keyword-arguments (package-arguments p)
5678 ((#:phases phases '%standard-phases)
5679 `(modify-phases ,phases
5680 (add-before 'check 'mpi-setup
5681 ,%openmpi-setup)))))
5682 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5684 (negate dune-package?))))
5686 (define-public dune-common-openmpi
5687 (add-openmpi-to-dune-package dune-common))
5689 (define-public dune-geometry-openmpi
5690 (add-openmpi-to-dune-package dune-geometry))
5692 (define-public dune-istl-openmpi
5693 (add-openmpi-to-dune-package dune-istl))
5695 (define-public dune-typetree-openmpi
5696 (add-openmpi-to-dune-package dune-typetree))
5698 (define-public dune-uggrid-openmpi
5699 (add-openmpi-to-dune-package dune-uggrid))
5701 (define-public dune-grid-openmpi
5702 (add-openmpi-to-dune-package dune-grid))
5704 (define-public dune-alugrid-openmpi
5705 (add-openmpi-to-dune-package dune-alugrid))
5707 (define-public dune-subgrid-openmpi
5708 (add-openmpi-to-dune-package dune-subgrid))
5710 (define-public dune-localfunctions-openmpi
5711 (add-openmpi-to-dune-package dune-localfunctions))
5713 (define-public dune-functions-openmpi
5714 (add-openmpi-to-dune-package dune-functions))
5716 (define-public dune-pdelab-openmpi
5717 (add-openmpi-to-dune-package dune-pdelab))
5719 (define-public mlucas
5727 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5729 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5730 (build-system gnu-build-system)
5732 `(("python2" ,python-2)))
5734 `(#:tests? #f ; no tests
5736 (modify-phases %standard-phases
5740 (call-with-output-file "Makefile"
5742 (format port "CC = gcc
5743 CFLAGS = -O3 ~a -DUSE_THREADS
5744 LDLIBS = -lm -lpthread -lrt
5745 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5747 ,(let ((system (or (%current-target-system)
5748 (%current-system))))
5750 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5754 (lambda* (#:key outputs #:allow-other-keys)
5755 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5756 (install-file "Mlucas" bin)
5757 (install-file "primenet.py" bin))
5759 (home-page "https://www.mersenne.org")
5760 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5761 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5762 numbers in search of a world-record prime. You may use it to test any
5763 suitable number as you wish, but it is preferable that you do so in a
5764 coordinated fashion, as part of the Great Internet Mersenne Prime
5765 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5766 management via the GIMPS project's Primenet server.")
5767 (license license:gpl2+)))
5769 (define-public nauty
5777 "https://pallini.di.uniroma1.it/"
5778 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5780 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5781 (build-system gnu-build-system)
5782 (outputs '("out" "lib"))
5784 `(#:test-target "checks"
5785 #:configure-flags '("--enable-generic") ;prevent -march-native
5787 (modify-phases %standard-phases
5788 ;; Default make target does not build all available
5789 ;; executables. Create them now.
5790 (add-after 'build 'build-extra-programs
5792 (for-each (lambda (target) (invoke "make" target))
5793 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5795 ;; Upstream does not provide any install target.
5797 (lambda* (#:key outputs #:allow-other-keys)
5798 (let* ((out (assoc-ref outputs "out"))
5799 (lib-output (assoc-ref outputs "lib"))
5800 (bin (string-append out "/bin"))
5801 (doc (string-append out "/share/doc/nauty/"))
5802 (include (string-append lib-output "/include/nauty"))
5803 (lib (string-append lib-output "/lib/nauty")))
5804 (for-each (lambda (f) (install-file f bin))
5805 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5806 "bliss2dre" "catg" "checks6" "complg" "converseg"
5807 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5808 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5809 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5810 "gentourng" "gentreeg" "hamheuristic" "labelg"
5811 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5812 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5813 "sumlines" "twohamg" "underlyingg" "vcolg"
5814 "watercluster2" "NRswitchg"))
5815 (for-each (lambda (f) (install-file f include))
5816 (find-files "." "\\.h$"))
5817 (for-each (lambda (f) (install-file f lib))
5818 (find-files "." "\\.a$"))
5819 (for-each (lambda (f) (install-file f doc))
5820 (append '("formats.txt" "README" "schreier.txt")
5821 (find-files "." "\\.pdf$")))))))))
5823 `(("gmp" ,gmp))) ;for sumlines
5824 (home-page "https://pallini.di.uniroma1.it/")
5825 (synopsis "Library for graph automorphisms")
5826 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5827 procedures for computing automorphism groups of graphs and digraphs.
5829 @code{nauty} computes graph information in the form of a set of
5830 generators, the size of the group, and the orbits of the group; it can
5831 also produce a canonical label. The @code{nauty} suite is written in
5832 C and comes with a command-line interface, a collection of
5833 command-line tools, and an Application Programming Interface (API).
5835 This package provides the static libraries required to run programs
5836 compiled against the nauty library.")
5837 (license license:asl2.0)))
5846 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5847 "ftp/releases/" version
5848 "/ppl-" version ".tar.gz"))
5851 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5852 (build-system gnu-build-system)
5858 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5860 "Parma Polyhedra Library for computations with polyhedra")
5862 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5863 especially targeted at applications in the field of analysis and
5864 verification of complex systems. These abstractions include convex
5865 polyhedra, defined as the intersection of a finite number of (open or
5866 closed) halfspaces, each described by a linear inequality (strict or
5867 non-strict) with rational coefficients; some special classes of polyhedra
5868 shapes that offer interesting complexity/precision tradeoffs; and grids
5869 which represent regularly spaced points that satisfy a set of linear
5870 congruence relations. The library also supports finite powersets and
5871 products of (any kind of) polyhedra and grids, a mixed integer linear
5872 programming problem solver using an exact-arithmetic version of the simplex
5873 algorithm, a parametric integer programming solver, and primitives for
5874 termination analysis via the automatic synthesis of linear ranking
5876 (license license:gpl3+)))
5878 (define-public speedcrunch
5880 (name "speedcrunch")
5886 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5887 (commit (string-append "release-" version))))
5888 (file-name (git-file-name name version))
5891 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5892 (build-system cmake-build-system)
5893 (inputs `(("qtbase" ,qtbase)))
5894 (native-inputs `(("qttools" ,qttools)))
5897 (modify-phases %standard-phases
5898 (add-after 'unpack 'chdir-to-src
5899 (lambda _ (chdir "src") #t)))))
5900 (synopsis "High-precision scientific calculator")
5902 "SpeedCrunch is a high-precision scientific calculator. It features a
5903 syntax-highlighted scrollable display and is designed to be fully used via
5904 keyboard. Some distinctive features are auto-completion of functions and
5905 variables, a formula book, and quick insertion of constants from various
5906 fields of knowledge.")
5907 (home-page "https://speedcrunch.org/")
5908 (license license:gpl2+)))
5910 (define-public minisat
5911 ;; This is the last commit which is available upstream, no
5912 ;; release happened since 2010.
5913 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5917 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5922 (url "https://github.com/niklasso/minisat")
5924 (file-name (string-append name "-" version "-checkout"))
5927 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5929 (search-patches "minisat-friend-declaration.patch"
5930 "minisat-install.patch"))))
5931 (build-system gnu-build-system)
5933 '(#:make-flags (list (string-append "prefix=" %output))
5934 #:tests? #f ;no check target
5936 (modify-phases %standard-phases
5937 (delete 'configure))))
5939 `(("zlib:static" ,zlib "static")
5942 "Small, yet efficient, SAT solver")
5944 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5945 researchers and developers alike to get started on SAT.")
5947 "http://minisat.se/MiniSat.html")
5948 (license license:expat))))
5950 (define-public libqalculate
5952 (name "libqalculate")
5958 (url "https://github.com/Qalculate/libqalculate/")
5959 (commit (string-append "v" version))))
5960 (file-name (git-file-name name version))
5962 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5964 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5965 (build-system gnu-build-system)
5967 `(("pkg-config" ,pkg-config)
5968 ("gettext" ,gettext-minimal)
5969 ("intltool" ,intltool)
5970 ("automake" ,automake)
5971 ("autoconf" ,autoconf)
5972 ("libtool" ,libtool)
5973 ("doxygen" ,doxygen)
5978 ("libxml2" ,libxml2)
5981 ("gnuplot" ,gnuplot)
5982 ("readline" ,readline)
5983 ("libiconv" ,libiconv)))
5986 (modify-phases %standard-phases
5987 (add-before 'bootstrap 'setenv
5988 ;; Prevent the autogen.sh script to carry out the configure
5989 ;; script, which has not yet been patched to replace /bin/sh.
5991 (setenv "NOCONFIGURE" "TRUE")
5993 (home-page "https://qalculate.github.io/")
5994 (synopsis "Multi-purpose cli desktop calculator and library")
5996 "Libqalculate is a multi-purpose cli desktop calculator and library.
5997 It provides basic and advanced functionality. Features include customizable
5998 functions, unit calculations, and conversions, physical constants, symbolic
5999 calculations (including integrals and equations), arbitrary precision,
6000 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6002 (license license:gpl2+)))
6004 (define-public qalculate-gtk
6006 (name "qalculate-gtk")
6012 (url "https://github.com/Qalculate/qalculate-gtk/")
6013 (commit (string-append "v" version))))
6014 (file-name (git-file-name name version))
6016 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
6017 (build-system glib-or-gtk-build-system)
6019 `(("pkg-config" ,pkg-config)
6020 ("intltool" ,intltool)
6021 ("automake" ,automake)
6022 ("autoconf" ,autoconf)
6023 ("libtool" ,libtool)
6028 ("libqalculate" ,libqalculate)
6029 ("libxml2" ,libxml2)
6034 (modify-phases %standard-phases
6035 (add-before 'bootstrap 'setenv
6036 ;; Prevent the autogen.sh script to carry out the configure
6037 ;; script, which has not yet been patched to replace /bin/sh.
6039 (setenv "NOCONFIGURE" "TRUE")
6041 (add-before 'check 'add-pot-file
6042 ;; the file contains translations and are currently not in use
6043 ;; left out on purpose so add it to POTFILES.skip
6045 (with-output-to-file "po/POTFILES.skip"
6047 (format #t "data/shortcuts.ui~%")
6050 (home-page "https://qalculate.github.io/")
6051 (synopsis "Multi-purpose graphical desktop calculator")
6053 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6054 multi-purpose GUI desktop calculator. It provides basic and advanced
6055 functionality. Features include customizable functions, unit calculations,
6056 and conversions, physical constants, symbolic calculations (including
6057 integrals and equations), arbitrary precision, uncertainty propagation,
6058 interval arithmetic, plotting.")
6059 (license license:gpl2+)))