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>
45 ;;; This file is part of GNU Guix.
47 ;;; GNU Guix is free software; you can redistribute it and/or modify it
48 ;;; under the terms of the GNU General Public License as published by
49 ;;; the Free Software Foundation; either version 3 of the License, or (at
50 ;;; your option) any later version.
52 ;;; GNU Guix is distributed in the hope that it will be useful, but
53 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
54 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55 ;;; GNU General Public License for more details.
57 ;;; You should have received a copy of the GNU General Public License
58 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
60 (define-module (gnu packages maths)
61 #:use-module (ice-9 regex)
62 #:use-module (ice-9 match)
63 #:use-module (gnu packages)
64 #:use-module ((guix licenses) #:prefix license:)
65 #:use-module (guix packages)
66 #:use-module (guix download)
67 #:use-module (guix git-download)
68 #:use-module (guix utils)
69 #:use-module ((guix build utils) #:select (alist-replace))
70 #:use-module (guix build-system cmake)
71 #:use-module (guix build-system glib-or-gtk)
72 #:use-module (guix build-system gnu)
73 #:use-module (guix build-system python)
74 #:use-module (guix build-system ruby)
75 #:use-module (gnu packages algebra)
76 #:use-module (gnu packages audio)
77 #:use-module (gnu packages autotools)
78 #:use-module (gnu packages base)
79 #:use-module (gnu packages bison)
80 #:use-module (gnu packages boost)
81 #:use-module (gnu packages check)
82 #:use-module (gnu packages cmake)
83 #:use-module (gnu packages compression)
84 #:use-module (gnu packages curl)
85 #:use-module (gnu packages cyrus-sasl)
86 #:use-module (gnu packages dbm)
87 #:use-module (gnu packages documentation)
88 #:use-module (gnu packages elf)
89 #:use-module (gnu packages file)
90 #:use-module (gnu packages flex)
91 #:use-module (gnu packages fltk)
92 #:use-module (gnu packages fontutils)
93 #:use-module (gnu packages gettext)
94 #:use-module (gnu packages gcc)
95 #:use-module (gnu packages gd)
96 #:use-module (gnu packages ghostscript)
97 #:use-module (gnu packages glib)
98 #:use-module (gnu packages graphviz)
99 #:use-module (gnu packages gtk)
100 #:use-module (gnu packages icu4c)
101 #:use-module (gnu packages image)
102 #:use-module (gnu packages java)
103 #:use-module (gnu packages less)
104 #:use-module (gnu packages lisp)
105 #:use-module (gnu packages linux)
106 #:use-module (gnu packages logging)
107 #:use-module (gnu packages lua)
108 #:use-module (gnu packages gnome)
109 #:use-module (gnu packages guile)
110 #:use-module (gnu packages xorg)
111 #:use-module (gnu packages gl)
112 #:use-module (gnu packages imagemagick)
113 #:use-module (gnu packages m4)
114 #:use-module (gnu packages mpi)
115 #:use-module (gnu packages multiprecision)
116 #:use-module (gnu packages netpbm)
117 #:use-module (gnu packages onc-rpc)
118 #:use-module (gnu packages pcre)
119 #:use-module (gnu packages popt)
120 #:use-module (gnu packages perl)
121 #:use-module (gnu packages pkg-config)
122 #:use-module (gnu packages pulseaudio)
123 #:use-module (gnu packages python)
124 #:use-module (gnu packages python-web)
125 #:use-module (gnu packages python-xyz)
126 #:use-module (gnu packages qt)
127 #:use-module (gnu packages readline)
128 #:use-module (gnu packages ruby)
129 #:use-module (gnu packages tbb)
130 #:use-module (gnu packages scheme)
131 #:use-module (gnu packages shells)
132 #:use-module (gnu packages tcl)
133 #:use-module (gnu packages texinfo)
134 #:use-module (gnu packages tex)
135 #:use-module (gnu packages tls)
136 #:use-module (gnu packages version-control)
137 #:use-module (gnu packages wxwidgets)
138 #:use-module (gnu packages xml)
139 #:use-module (srfi srfi-1)
140 #:use-module (srfi srfi-26))
148 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
150 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
151 (build-system gnu-build-system)
152 (inputs `(("gtk+" ,gtk+)
153 ("libxml2" ,libxml2)))
154 (native-inputs `(("pkg-config" ,pkg-config)))
155 (synopsis "Natural deduction first-order logic interface")
156 (description "Aris is a program for performing logical proofs. It supports
157 propositional and predicate logic, as well as Boolean algebra and
158 arithmetical logic. In addition to its predefined inference and equivalence
159 rules, Aris also supports references to older proofs. Its use of standard
160 logical symbols and its natural deduction interface make it easy to use for
162 (license license:gpl3+)
163 (home-page "https://www.gnu.org/software/aris/")))
165 (define-public c-graph
171 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
174 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
175 (build-system gnu-build-system)
177 `(("fortran" ,gfortran)))
178 (synopsis "Visualizing and demonstrating convolution")
180 "GNU C-Graph is a tool for demonstrating the theory of convolution.
181 Thus, it can serve as an excellent aid to students of signal and systems
182 theory in visualizing the convolution process. Rather than forcing the
183 student to write code, the program offers an intuitive interface with
184 interactive dialogs to guide them.")
185 (license license:gpl3+)
186 (home-page "https://www.gnu.org/software/c-graph/")))
195 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
196 version "/coda-" version ".tar.gz"))
198 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
199 (patches (search-patches "coda-use-system-libs.patch"))
200 (modules '((guix build utils)))
202 ;; Make sure we don't use the bundled software.
204 (for-each (lambda (d)
205 (delete-file-recursively (string-append "libcoda/" d)))
206 '("zlib" "pcre" "expat"))
209 `(("fortran" ,gfortran)
211 ("python-numpy" ,python-numpy)))
218 (build-system gnu-build-system)
220 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
221 "LIBS= -lz -lpcre -lexpat")))
222 (synopsis "A common interface to various earth observation data formats")
224 "The Common Data Access toolbox (CODA) provides a set of interfaces for
225 reading remote sensing data from earth observation data files. It consists of
226 command line applications and interfaces to the C, Fortran, Python, and Java
227 programming languages.")
228 (home-page "https://stcorp.nl/coda")
229 (license license:gpl2+)))
237 (uri (string-append "http://www.qhull.org/download/qhull-"
238 (car (string-split version #\.))
242 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
243 (build-system cmake-build-system)
244 (synopsis "Calculate convex hulls and related structures")
246 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
247 diagram, halfspace intersection about a point, furthest-site Delaunay
248 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
249 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
250 algorithm for computing the convex hull. It handles roundoff errors from
251 floating point arithmetic. It computes volumes, surface areas, and
252 approximations to the convex hull.
254 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
255 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
256 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
258 (home-page "http://qhull.org")
259 (license (license:non-copyleft "file://COPYING.txt"
260 "See COPYING in the distribution."))))
262 (define-public python-cvxopt
264 (name "python-cvxopt")
269 (url "https://github.com/cvxopt/cvxopt")
271 (file-name (git-file-name name version))
274 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
275 (build-system python-build-system)
278 (modify-phases %standard-phases
279 (add-after 'unpack 'find-libraries
280 (lambda* (#:key inputs #:allow-other-keys)
281 (setenv "CVXOPT_BLAS_LIB" "openblas")
282 (setenv "CVXOPT_BUILD_FFTW" "1")
283 (setenv "CVXOPT_BUILD_GLPK" "1")
284 (setenv "CVXOPT_BUILD_GSL" "1")
291 ("openblas" ,openblas)
292 ("suitesparse" ,suitesparse)))
293 (home-page "https://www.cvxopt.org")
294 (synopsis "Python library for convex optimization")
296 "CVXOPT is a package for convex optimization based on the Python
297 programming language. Its main purpose is to make the development of software
298 for convex optimization applications straightforward by building on Python’s
299 extensive standard library and on the strengths of Python as a high-level
300 programming language.")
301 (license license:gpl3+)))
303 (define-public python2-cvxopt
304 (package-with-python2 python-cvxopt))
312 (uri (string-append "mirror://gnu/units/units-" version
315 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
316 (build-system gnu-build-system)
318 `(("readline" ,readline)
319 ("python" ,python-wrapper) ;for 'units_cur' script
320 ("python-requests" ,python-requests)))
322 `(#:phases (modify-phases %standard-phases
323 (add-after 'install 'wrap-units_cur
324 (lambda* (#:key outputs #:allow-other-keys)
325 (let* ((out (assoc-ref outputs "out"))
326 (bin (string-append out "/bin")))
327 (wrap-program (string-append bin "/units_cur")
328 `("PYTHONPATH" ":" prefix
329 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
331 (synopsis "Conversion between thousands of scales")
333 "GNU Units converts numeric quantities between units of measure. It
334 can handle scale changes through adaptive usage of standard scale
335 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
336 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
337 enough to be used effectively as a scientific calculator.")
338 (license license:gpl3+)
339 (home-page "https://www.gnu.org/software/units/")))
341 (define-public double-conversion
343 (name "double-conversion")
345 (home-page "https://github.com/google/double-conversion")
348 (uri (git-reference (url home-page)
349 (commit (string-append "v" version))))
350 (file-name (git-file-name name version))
353 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
354 (build-system cmake-build-system)
356 '(#:test-target "test"
357 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
358 "-DBUILD_TESTING=ON")))
359 (synopsis "Conversion routines for IEEE doubles")
361 "The double-conversion library provides binary-decimal and decimal-binary
362 routines for IEEE doubles. The library consists of efficient conversion
363 routines that have been extracted from the V8 JavaScript engine.")
364 (license license:bsd-3)))
366 (define-public dionysus
372 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
376 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
377 (build-system gnu-build-system)
378 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
379 (synopsis "Local search for universal constants and scientific values")
381 "GNU Dionysus is a convenient system for quickly retrieving the values of
382 mathematical constants used in science and engineering. Values can be
383 searched using a simple command-line tool, choosing from three databases:
384 universal constants, atomic numbers, and constants related to
386 (license license:gpl3+)
387 (home-page "https://www.gnu.org/software/dionysus/")))
398 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
399 "dSFMT-src-" version ".tar.gz"))
402 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
403 (modules '((guix build utils)))
404 ;; Don't distribute html documentation with bundled jquery.
407 (delete-file-recursively "html") #t))
408 ;; Add patches borrowed from Julia.
414 "https://raw.githubusercontent.com/JuliaLang/julia/"
415 "v1.3.0/deps/patches/dSFMT.c.patch"))
417 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
418 (file-name "dSFMT.c.patch"))
422 "https://raw.githubusercontent.com/JuliaLang/julia/"
423 "v1.3.0/deps/patches/dSFMT.h.patch"))
425 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
426 (file-name "dSFMT.h.patch"))))))
427 (build-system gnu-build-system)
430 (modify-phases %standard-phases
431 (delete 'configure) ; no configure script
433 ;; Upstream Makefile does not build a shared library. Borrow from Julia
434 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
437 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
438 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
439 "-O3" "-finline-functions" "-fomit-frame-pointer"
440 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
441 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
442 "-o" "libdSFMT.so")))
443 (replace 'install ; no "install" target
444 (lambda* (#:key outputs #:allow-other-keys)
445 (let* ((out (assoc-ref outputs "out"))
446 (lib (string-append out "/lib"))
447 (inc (string-append out "/include"))
448 (doc (string-append out "/share/doc/" ,name "-" ,version)))
449 (install-file "libdSFMT.so" lib)
450 (install-file "dSFMT.h" inc)
451 (install-file "LICENSE.txt" doc)
453 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
455 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
456 the expensive conversion of integer to double (floating point). dSFMT directly
457 generates double precision floating point pseudorandom numbers which have the
458 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
459 format. dSFMT is only available on the CPUs which use IEEE 754 format double
460 precision floating point numbers.")
461 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
462 (license license:bsd-3)))
470 (uri (string-append "mirror://gnu/gsl/gsl-"
474 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
475 (build-system gnu-build-system)
477 (let ((system (%current-system)))
479 ((or (string-prefix? "aarch64" system)
480 (string-prefix? "powerpc" system))
481 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
482 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
483 '(#:phases (modify-phases %standard-phases
484 (add-before 'check 'disable-failing-tests
486 (substitute* "spmatrix/test.c"
487 ((".*test_complex.*") "\n"))
489 ((string-prefix? "i686" system)
490 ;; There are rounding issues with these tests on i686:
491 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
492 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
493 '(#:phases (modify-phases %standard-phases
494 (add-before 'check 'disable-failing-tests
496 (substitute* "linalg/test.c"
497 ((".*gsl_test\\(test_LU_decomp.*") "\n")
498 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
499 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
500 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
501 (substitute* "spmatrix/test.c"
502 ((".*test_all.*") "\n")
503 ((".*test_float.*") "\n")
504 ((".*test_complex.*") "\n"))
507 (home-page "https://www.gnu.org/software/gsl/")
508 (synopsis "Numerical library for C and C++")
510 "The GNU Scientific Library is a library for numerical analysis in C
511 and C++. It includes a wide range of mathematical routines, with over 1000
512 functions in total. Subject areas covered by the library include:
513 differential equations, linear algebra, Fast Fourier Transforms and random
515 (license license:gpl3+)))
525 (url "https://github.com/shibatch/sleef")
527 (file-name (git-file-name name version))
529 (base32 "1gvf7cfvszmgjrsqivwmyy1jnp3hy80dmszxx827lhjz8yqq5019"))))
530 (build-system cmake-build-system)
532 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
533 (string-append "-DCMAKE_INSTALL_LIBDIR="
534 (assoc-ref %outputs "out")
536 (string-append "-DCMAKE_INSTALL_PREFIX="
537 (assoc-ref %outputs "out")))
539 (modify-phases %standard-phases
540 ;; SLEEF generates a header library during the build process and writes
541 ;; to it via shell redirection. Make the checkout writable so the
542 ;; build can succeed.
543 (add-after 'unpack 'make-git-checkout-writable
545 (for-each make-file-writable (find-files "."))
551 ("openssl" ,openssl)))
552 (home-page "https://sleef.org/")
553 (synopsis "SIMD library for evaluating elementary functions and DFT")
555 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
556 implements vectorized versions of all C99 real floating point math functions.
557 It can utilize SIMD instructions that are available on modern processors.")
558 (license (list license:boost1.0 ;sleef
559 license:cc-by4.0)))) ;simplex algorithm
568 (uri (string-append "mirror://gnu/glpk/glpk-"
572 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
573 (build-system gnu-build-system)
577 `(#:configure-flags '("--with-gmp")))
578 (home-page "https://www.gnu.org/software/glpk/")
579 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
581 "GLPK is a C library for solving large-scale linear programming (LP),
582 mixed integer programming (MIP), and other related problems. It supports the
583 GNU MathProg modeling language, a subset of the AMPL language, and features a
584 translator for the language. In addition to the C library, a stand-alone
585 LP/MIP solver is included in the package.")
586 (license license:gpl3+)))
595 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
597 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
599 "/4ti2-" version ".tar.gz"))
601 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
602 (build-system gnu-build-system)
604 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
608 (home-page "http://www.4ti2.de/")
609 (synopsis "Mathematical tool suite for problems on linear spaces")
611 "4ti2 implements algorithms for solving algebraic, geometric and
612 combinatorial problems on linear spaces. Among others, it solves systems
613 of linear equations, computes extreme rays of polyhedral cones, solves
614 integer programming problems and computes Markov bases for statistics.")
615 (license license:gpl2+)))
617 (define-public cddlib
624 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
625 (string-delete #\. version) ".tar.gz"))
628 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
629 (build-system gnu-build-system)
632 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
633 (synopsis "Library for convex hulls and extreme rays of polyhedra")
635 "The C-library cddlib implements the Double Description Method of
636 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
637 rays of a general convex polyhedron given by a system of linear inequalities
638 in arbitrary dimension. It can also be used for the converse operation of
639 computing convex hulls.")
640 (license license:gpl2+)))
642 (define-public lrslib
649 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
651 (string-delete #\. version) ".tar.gz"))
654 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
655 (build-system gnu-build-system)
659 `(#:tests? #f ; no check phase
660 #:make-flags `("CC=gcc"
661 ,(string-append "prefix=" (assoc-ref %outputs "out"))
664 (modify-phases %standard-phases
667 (substitute* "makefile"
668 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
670 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
671 (synopsis "Convex hulls of polyhedra with exact arithmetic")
673 "The C code of lrslib implements the reverse search algorithm for
674 vertex enumeration and convex hull problems. Its input file format is
675 compatible with cddlib. All computations are done exactly in either
676 multiple precision or fixed integer arithmetic. Output is not stored
677 in memory, so even problems with very large output sizes can sometimes
679 (license license:gpl2+)))
688 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
689 "vinci/vinci-" version ".tar.gz"))
692 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
693 (build-system gnu-build-system)
695 `(("lrslib" ,lrslib)))
697 `(#:tests? #f ; no check phase
699 (modify-phases %standard-phases
701 ;; register the lrs location in the config file
702 (lambda* (#:key inputs #:allow-other-keys)
703 (let* ((lrs (assoc-ref inputs "lrslib"))
704 (lrsexec (string-append lrs "/bin/lrs")))
705 (substitute* "vinci.h"
706 (("#define LRS_EXEC \"lrs\"")
707 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
710 (lambda* (#:key outputs #:allow-other-keys)
711 (let* ((out (assoc-ref outputs "out"))
712 (bin (string-append out "/bin")))
713 (install-file "vinci" bin))
716 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
717 (synopsis "Volume computation for polytopes")
719 "Vinci implements a number of volume computation algorithms for convex
720 polytopes in arbitrary dimension. The polytopes can be given by their
721 V-representation (as the convex hull of a finite number of vertices), by
722 their H-representation (as the bounded intersection of a finite number of
723 halfspaces) or by their double description with both representations.")
724 (license license:gpl2+)))
726 (define-public arpack-ng
730 (home-page "https://github.com/opencollab/arpack-ng")
733 (uri (git-reference (url home-page) (commit version)))
734 (file-name (git-file-name name version))
737 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
738 (build-system gnu-build-system)
740 `(("autoconf" ,autoconf)
741 ("automake" ,automake)
742 ("libtool" ,libtool)))
745 ("fortran" ,gfortran)))
746 (synopsis "Fortran subroutines for solving eigenvalue problems")
748 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
749 large scale eigenvalue problems.")
750 (license (license:non-copyleft "file://COPYING"
751 "See COPYING in the distribution."))))
753 (define-public arpack-ng-3.3.0
757 (name (package-name arpack-ng))
758 (home-page (package-home-page arpack-ng))
762 (uri (string-append home-page "/archive/" version ".tar.gz"))
763 (file-name (string-append name "-" version ".tar.gz"))
766 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
768 (define-public arpack-ng-openmpi
769 (package (inherit arpack-ng)
770 (name "arpack-ng-openmpi")
773 ,@(package-inputs arpack-ng)))
775 (substitute-keyword-arguments (package-arguments arpack-ng)
776 ((#:configure-flags _ '())
778 ((#:phases phases '%standard-phases)
779 `(modify-phases ,phases
780 (add-before 'check 'mpi-setup
782 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
784 (define-public lapack
791 (uri (string-append "http://www.netlib.org/lapack/lapack-"
795 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
796 (build-system cmake-build-system)
797 (home-page "http://www.netlib.org/lapack/")
798 (inputs `(("fortran" ,gfortran)
799 ("python" ,python-wrapper)))
801 `(#:configure-flags (list
802 "-DBUILD_SHARED_LIBS:BOOL=YES"
804 ;; Build the 'LAPACKE_clatms' functions.
805 "-DLAPACKE_WITH_TMG=ON"
806 "-DBUILD_TESTING=ON")))
807 (synopsis "Library for numerical linear algebra")
809 "LAPACK is a Fortran 90 library for solving the most commonly occurring
810 problems in numerical linear algebra.")
811 (license (license:non-copyleft "file://LICENSE"
812 "See LICENSE in the distribution."))))
814 (define-public clapack
821 (uri (string-append "http://www.netlib.org/clapack/clapack-"
822 version "-CMAKE.tgz"))
825 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
826 (build-system cmake-build-system)
829 (modify-phases %standard-phases
830 ;; These tests use a lot of stack variables and segfault without
831 ;; lifting resource limits.
832 (add-after 'unpack 'disable-broken-tests
834 (substitute* "TESTING/CMakeLists.txt"
835 (("add_lapack_test.* xeigtstz\\)") ""))
838 (lambda* (#:key outputs #:allow-other-keys)
839 (let* ((out (assoc-ref outputs "out"))
840 (libdir (string-append out "/lib"))
841 (f2cinc (string-append out "/include/libf2c")))
844 (for-each (lambda (file)
845 (install-file file libdir))
847 "F2CLIBS/libf2c/libf2c.a"
848 "TESTING/MATGEN/libtmglib.a"
849 "BLAS/SRC/libblas.a"))
850 (for-each (lambda (file)
851 (install-file file f2cinc))
852 (cons "F2CLIBS/libf2c/arith.h"
853 (find-files (string-append "../clapack-"
854 ,version "-CMAKE/F2CLIBS/libf2c")
856 (copy-recursively (string-append "../clapack-"
857 ,version "-CMAKE/INCLUDE")
858 (string-append out "/include"))
860 (home-page "https://www.netlib.org/clapack/")
861 (synopsis "Numerical linear algebra library for C")
863 "The CLAPACK library was built using a Fortran to C conversion utility
864 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
865 C code, and then modified to improve readability. CLAPACK's goal is to
866 provide LAPACK for someone who does not have access to a Fortran compiler.")
867 (license (license:non-copyleft "file://LICENSE"
868 "See LICENSE in the distribution."))))
870 (define-public scalapack
877 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
881 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
882 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
883 (build-system cmake-build-system)
886 ("fortran" ,gfortran)
887 ("lapack" ,lapack))) ;for testing only
889 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
890 #:phases (modify-phases %standard-phases
891 (add-before 'check 'mpi-setup
893 (home-page "http://www.netlib.org/scalapack/")
894 (synopsis "Library for scalable numerical linear algebra")
896 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
897 routines on parallel distributed memory machines. ScaLAPACK solves dense and
898 banded linear systems, least squares problems, eigenvalue problems, and
899 singular value problems.")
900 (license (license:non-copyleft "file://LICENSE"
901 "See LICENSE in the distribution."))))
903 (define-public gnuplot
909 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
913 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
914 (build-system gnu-build-system)
915 (inputs `(("readline" ,readline)
921 `(("pkg-config" ,pkg-config)
922 ("texlive" ,texlive-tiny)))
923 (arguments `(#:configure-flags (list (string-append
924 "--with-texdir=" %output
925 "/texmf-local/tex/latex/gnuplot"))))
926 (home-page "http://www.gnuplot.info")
927 (synopsis "Command-line driven graphing utility")
928 (description "Gnuplot is a portable command-line driven graphing
929 utility. It was originally created to allow scientists and students to
930 visualize mathematical functions and data interactively, but has grown to
931 support many non-interactive uses such as web scripting. It is also used as a
932 plotting engine by third-party applications like Octave.")
933 ;; X11 Style with the additional restriction that derived works may only be
934 ;; distributed as patches to the original.
935 (license (license:fsf-free
936 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
946 (url "https://github.com/OkoSanto/GCTP")
947 (commit (string-append "v" version))))
948 (file-name (git-file-name name version))
950 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
952 `(("fortran" ,gfortran)))
953 (build-system gnu-build-system)
954 (synopsis "General Cartographic Transformation Package (GCTP)")
956 "The General Cartographic Transformation Package (GCTP) is a system of
957 software routines designed to permit the transformation of coordinate pairs
958 from one map projection to another. The GCTP is the standard computer
959 software used by the National Mapping Division for map projection
961 (home-page "https://github.com/OkoSanto/GCTP")
962 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
971 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
972 version "/src/hdf-" version ".tar.bz2"))
974 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
975 (patches (search-patches "hdf4-architectures.patch"
976 "hdf4-reproducibility.patch"
977 "hdf4-shared-fortran.patch"
978 "hdf4-tirpc.patch"))))
979 (build-system gnu-build-system)
981 `(("gfortran" ,gfortran)
986 ("libjpeg" ,libjpeg-turbo)
987 ("libtirpc" ,libtirpc)))
989 `(#:parallel-tests? #f
990 #:configure-flags (list "--enable-shared"
991 (string-append "CPPFLAGS=-I"
992 (assoc-ref %build-inputs "libtirpc")
995 (modify-phases %standard-phases
996 ;; This is inspired by two of Debian's patches.
997 (add-before 'configure 'add-more-aarch64-support
999 (substitute* '("mfhdf/ncgen/ncgen.l"
1000 "mfhdf/ncgen/ncgenyy.c"
1001 "mfhdf/libsrc/netcdf.h.in")
1002 (("AIX5L64") "__aarch64__"))
1004 (add-before 'configure 'patchbuild
1007 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1009 (("/bin/mkdir") "mkdir"))
1010 (substitute* (find-files "." "^Makefile\\.in$")
1011 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1012 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1013 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1014 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1015 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1017 (add-after 'configure 'patch-settings
1019 ;; libhdf4.settings contains the full path of the
1020 ;; compilers used, and its contents are included in
1021 ;; .so-files. We truncate the hashes to avoid
1022 ;; unnecessary store references to those compilers:
1023 (substitute* "libhdf4.settings"
1024 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1025 (string-append prefix (string-take hash 10) "...")))
1027 (add-after 'install 'provide-absolute-libjpeg-reference
1028 (lambda* (#:key inputs outputs #:allow-other-keys)
1029 (let ((out (assoc-ref outputs "out"))
1030 (libjpeg (assoc-ref inputs "libjpeg")))
1031 ;; libjpeg-turbo does not provide a .la file, so libtool is
1032 ;; unable to add an absolute reference for -ljpeg in the .la
1033 ;; files. Fix it manually to avoid having to propagate it.
1034 (substitute* (find-files (string-append out "/lib") "\\.la$")
1036 (string-append "-L" libjpeg "/lib -ljpeg")))
1038 (home-page "https://www.hdfgroup.org/products/hdf4/")
1040 "Library and multi-object file format for storing and managing data")
1041 (description "HDF4 is a library and multi-object file format for storing
1042 and managing data between machines. HDF4 is an older hierarchical data format,
1043 incompatible with HDF5.")
1045 (license:non-copyleft
1046 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1048 (define-public hdf4-alt
1053 (substitute-keyword-arguments (package-arguments hdf4)
1054 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1056 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1058 (define-public hdf5-1.8
1065 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1066 "hdf5-" (version-major+minor version)
1067 "/hdf5-" version "/src/hdf5-"
1069 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1071 (match (string-split version #\.)
1072 ((major minor _ ...)
1073 (string-append major minor)))
1074 "/src/hdf5-" version ".tar.bz2")))
1076 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1077 (patches (search-patches "hdf5-config-date.patch"
1078 "hdf5-1.8-mpi-deprecations.patch"))))
1079 (build-system gnu-build-system)
1083 `(("gfortran" ,gfortran)
1084 ("perl" ,perl))) ;part of the test machinery needs Perl
1085 (outputs '("out" ; core library
1086 "fortran")) ; fortran interface
1088 `(;; Some of the users, notably Flann, need the C++ interface.
1089 #:configure-flags '("--enable-cxx"
1091 "--enable-fortran2003"
1093 ;; Build a thread-safe library. Unfortunately,
1094 ;; 'configure' invites you to either turn off C++,
1095 ;; Fortran, and the high-level interface (HL), or
1096 ;; to pass '--enable-unsupported'. Debian
1097 ;; packagers chose to pass '--enable-unsupported'
1098 ;; and we follow their lead here.
1099 "--enable-threadsafe"
1101 "--enable-unsupported")
1102 ;; Use -fPIC to allow the R bindings to link with the static libraries
1103 #:make-flags (list "CFLAGS=-fPIC"
1106 (modify-phases %standard-phases
1107 (add-before 'configure 'patch-configure
1108 (lambda* (#:key outputs #:allow-other-keys)
1109 (substitute* "configure"
1111 (substitute* "fortran/src/Makefile.in"
1112 (("libhdf5_fortran_la_LDFLAGS =")
1113 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1114 (assoc-ref outputs "fortran") "/lib")))
1115 (substitute* "hl/fortran/src/Makefile.in"
1116 (("libhdf5hl_fortran_la_LDFLAGS =")
1117 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1118 (assoc-ref outputs "fortran") "/lib")))
1120 (add-after 'configure 'patch-settings
1122 ;; libhdf5.settings contains the full path of the
1123 ;; compilers used, and its contents are included in
1124 ;; libhdf5.so. We truncate the hashes to avoid
1125 ;; unnecessary store references to those compilers:
1126 (substitute* "src/libhdf5.settings"
1127 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1128 (string-append prefix (string-take hash 10) "..."))
1129 ;; Don't record the build-time kernel version to make the
1130 ;; settings file reproducible.
1131 (("Uname information:.*")
1132 "Uname information: Linux\n"))
1134 (add-after 'install 'patch-references
1135 (lambda* (#:key inputs outputs #:allow-other-keys)
1136 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1137 (zlib (assoc-ref inputs "zlib")))
1138 (substitute* (find-files bin "h5p?cc")
1140 (string-append "-L" zlib "/lib " lib)))
1142 (add-after 'install 'split
1143 (lambda* (#:key inputs outputs #:allow-other-keys)
1144 ;; Move all fortran-related files
1145 (let* ((out (assoc-ref outputs "out"))
1146 (bin (string-append out "/bin"))
1147 (lib (string-append out "/lib"))
1148 (inc (string-append out "/include"))
1149 (ex (string-append out "/share/hdf5_examples/fortran"))
1150 (fort (assoc-ref outputs "fortran"))
1151 (fbin (string-append fort "/bin"))
1152 (flib (string-append fort "/lib"))
1153 (finc (string-append fort "/include"))
1154 (fex (string-append fort "/share/hdf5_examples/fortran")))
1159 ;; Note: When built with --enable-parallel, the 'h5fc' file
1160 ;; doesn't exist, hence this condition.
1161 (when (file-exists? (string-append bin "/h5fc"))
1162 (rename-file (string-append bin "/h5fc")
1163 (string-append fbin "/h5fc")))
1164 (for-each (lambda (file)
1166 (string-append flib "/" (basename file))))
1167 (find-files lib ".*fortran.*"))
1168 (for-each (lambda (file)
1170 (string-append finc "/" (basename file))))
1171 (find-files inc ".*mod"))
1172 (for-each (lambda (file)
1174 (string-append fex "/" (basename file))))
1175 (find-files ex ".*"))
1176 (delete-file-recursively ex))
1178 (home-page "https://www.hdfgroup.org")
1179 (synopsis "Management suite for extremely large and complex data")
1180 (description "HDF5 is a suite that makes possible the management of
1181 extremely large and complex data collections.")
1182 (license (license:x11-style
1183 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1185 (define-public hdf5-1.10
1186 (package/inherit hdf5-1.8
1191 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1192 "hdf5-" (version-major+minor version)
1193 "/hdf5-" version "/src/hdf5-"
1195 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1197 (apply string-append
1198 (take (string-split version #\.) 2))
1199 "/src/hdf5-" version ".tar.bz2")))
1201 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1202 (patches (search-patches "hdf5-config-date.patch"))))))
1205 ;; Default version of HDF5.
1208 (define-public hdf-java
1216 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1217 version "/src/CMake-hdfjava-" version ".tar.gz"))
1219 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1220 (modules '((guix build utils)))
1221 (snippet ; Make sure we don't use the bundled sources and binaries.
1223 (for-each delete-file
1224 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1225 "HDF4.tar.gz" "HDF5.tar.gz"))
1226 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1228 (build-system gnu-build-system)
1230 `(("jdk" ,icedtea "jdk")
1231 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1233 ("hamcrest-core" ,java-hamcrest-core)
1234 ("junit" ,java-junit)
1235 ("slf4j-simple" ,java-slf4j-simple)))
1240 ("libjpeg" ,libjpeg-turbo)
1241 ("slf4j-api" ,java-slf4j-api)))
1244 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1245 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1246 (assoc-ref %build-inputs "jdk") "/lib" )
1247 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1248 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1251 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1252 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1253 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1254 (string-append "JPEGLIB="
1255 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1259 (modify-phases %standard-phases
1260 (add-before 'configure 'chdir-to-source
1261 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1262 (add-before 'configure 'patch-build
1263 (lambda* (#:key inputs outputs #:allow-other-keys)
1264 (substitute* "configure"
1265 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1266 (("/bin/cat") (which "cat")))
1267 ;; Set classpath for compilation
1268 (substitute* '("hdf/hdf5lib/Makefile.in"
1269 "hdf/hdf5lib/exceptions/Makefile.in"
1270 "hdf/hdflib/Makefile.in")
1271 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1272 (string-append (assoc-ref inputs "slf4j-api")
1273 "/share/java/slf4j-api.jar")))
1274 ;; Replace outdated config.sub and config.guess:
1275 (with-directory-excursion "config"
1276 (for-each (lambda (file)
1278 (string-append (assoc-ref inputs "automake")
1280 ,(version-major+minor (package-version automake))
1282 '("config.sub" "config.guess")))
1284 ;; Fix embedded version number
1285 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1286 (substitute* "hdf/hdf5lib/H5.java"
1288 (string-join hdf5version ", "))))
1290 (mkdir-p (string-append (assoc-ref outputs "out")))
1291 ;; Set classpath for tests
1292 (let* ((build-dir (getcwd))
1293 (lib (string-append build-dir "/lib"))
1294 (jhdf (string-append lib "/jhdf.jar"))
1295 (jhdf5 (string-append lib "/jhdf5.jar"))
1299 (string-append (assoc-ref inputs i)
1300 "/share/java/" i ".jar"))
1301 '("slf4j-api" "slf4j-simple"))
1303 (car (find-files (assoc-ref inputs "junit") "jar$"))
1304 (car (find-files (assoc-ref inputs "hamcrest-core")
1307 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1309 (substitute* '("test/hdf5lib/Makefile.in"
1310 "test/hdf5lib/junit.sh.in"
1311 "examples/runExample.sh.in")
1313 (string-append (assoc-ref inputs "coreutils")
1316 (string-append (assoc-ref inputs "coreutils")
1318 (("CLASSPATH=[^\n]*")
1319 (string-append "CLASSPATH=" class-path)))
1320 (setenv "CLASSPATH" class-path))
1322 (add-before 'check 'build-examples
1324 (apply invoke `("javac"
1325 ,@(find-files "examples" ".*\\.java"))))))
1327 #:parallel-build? #f
1329 #:parallel-tests? #f ))
1330 (home-page "https://support.hdfgroup.org/products/java")
1331 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1332 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1333 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1336 ;; BSD-style license:
1337 (license (license:x11-style
1338 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1339 /current/src/unpacked/COPYING"))))
1341 (define-public hdf-eos2
1348 (uri "ftp://edhs1.gsfc.nasa.gov\
1349 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1351 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1352 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1353 "hdf-eos2-build-shared.patch"
1354 "hdf-eos2-fortrantests.patch"))))
1355 (build-system gnu-build-system)
1357 `(("gfortran" ,gfortran)))
1359 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1360 ;; XXX: These inputs are really dependencies of hdf4.
1362 ("libjpeg" ,libjpeg-turbo)
1363 ("libtirpc" ,libtirpc)
1367 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1368 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1369 #:parallel-tests? #f))
1370 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1371 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1372 (description "HDF-EOS2 is a software library built on HDF4 which supports
1373 the construction of data structures used in NASA's Earth Observing
1374 System (Grid, Point and Swath).")
1376 ;; Source files carry a permissive license header.
1377 (license (license:non-copyleft home-page))))
1379 (define-public hdf-eos5
1385 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1386 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1389 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1390 (patches (search-patches "hdf-eos5-build-shared.patch"
1391 "hdf-eos5-remove-gctp.patch"
1392 "hdf-eos5-fix-szip.patch"
1393 "hdf-eos5-fortrantests.patch"))))
1395 `(("gfortran" ,gfortran)))
1396 (build-system gnu-build-system)
1398 `(("hdf5" ,hdf5-1.8)
1402 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1403 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1404 #:parallel-tests? #f))
1405 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1407 "HDF-EOS5 is a software library built on HDF5 to support the construction
1408 of data structures used in NASA's Earth Observing System (Grid, Point and
1410 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1412 ;; Source files carry a permissive license header.
1413 (license (license:non-copyleft home-page))))
1415 (define-public hdf5-parallel-openmpi
1416 (package/inherit hdf5-1.10 ;use the latest
1417 (name "hdf5-parallel-openmpi")
1420 ,@(package-inputs hdf5)))
1422 (substitute-keyword-arguments (package-arguments hdf5)
1423 ((#:configure-flags flags)
1424 ``("--enable-parallel"
1425 ,@(delete "--enable-cxx"
1426 (delete "--enable-threadsafe" ,flags))))
1428 `(modify-phases ,phases
1429 (add-after 'build 'mpi-setup
1431 (add-before 'check 'patch-tests
1433 ;; OpenMPI's mpirun will exit with non-zero status if it
1434 ;; detects an "abnormal termination", i.e. any process not
1435 ;; calling MPI_Finalize(). Since the test is explicitly
1436 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1437 ;; H5C_flush_cache from being called, mpirun will always
1438 ;; complain, so turn this test off.
1439 (substitute* "testpar/Makefile"
1440 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1441 (string-append front back "\n")))
1442 (substitute* "tools/test/h5diff/testph5diff.sh"
1443 (("/bin/sh") (which "sh")))
1445 (synopsis "Management suite for data with parallel IO support")))
1447 (define-public hdf5-blosc
1455 (url "https://github.com/Blosc/hdf5-blosc")
1456 (commit (string-append "v" version))))
1457 (file-name (git-file-name name version))
1459 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1460 (build-system cmake-build-system)
1463 (list (string-append "-DBLOSC_INSTALL_DIR="
1464 (assoc-ref %build-inputs "c-blosc"))
1465 (string-append "-DPLUGIN_INSTALL_PATH="
1466 (assoc-ref %outputs "out")
1467 "/hdf5/lib/plugin"))
1469 (modify-phases %standard-phases
1470 (add-after 'unpack 'do-not-build-blosc
1472 (substitute* "CMakeLists.txt"
1473 (("set\\(BLOSC_INSTALL_DIR.*") "")
1474 (("ExternalProject_Add\\(project_blosc") "message("))
1477 `(("c-blosc" ,c-blosc)
1478 ("hdf5" ,hdf5-1.10)))
1479 (home-page "https://github.com/Blosc/hdf5-blosc")
1480 (synopsis "Filter for HDF5 using the Blosc compressor")
1481 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1482 installing this filter, you can read and write HDF5 files with
1483 Blosc-compressed datasets.")
1484 (license license:expat)))
1486 (define-public h5check
1493 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1494 "h5check/src/h5check-" version ".tar.gz"))
1497 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1498 (build-system gnu-build-system)
1499 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1500 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1501 (synopsis "HDF5 format checker")
1502 (description "@code{h5check} is a validation tool for verifying that an
1503 HDF5 file is encoded according to the HDF File Format Specification.")
1504 (license (license:x11-style "file://COPYING"))))
1512 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1517 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1518 (build-system cmake-build-system)
1519 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1520 (inputs `(("lapack" ,lapack)
1522 ;; FIXME: Even though the fonts are available dvips complains:
1523 ;; "Font cmmi10 not found; characters will be left blank."
1525 `(("texlive" ,texlive-tiny)
1526 ("ghostscript" ,ghostscript)
1527 ("doxygen" ,doxygen)))
1528 (home-page "http://itpp.sourceforge.net")
1529 (synopsis "C++ library of maths, signal processing and communication classes")
1530 (description "IT++ is a C++ library of mathematical, signal processing and
1531 communication classes and functions. Its main use is in simulation of
1532 communication systems and for performing research in the area of
1533 communications. The kernel of the library consists of generic vector and
1534 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1535 similar to MATLAB, GNU Octave or SciPy.")
1536 (license license:gpl3+)))
1538 (define-public netcdf
1546 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1547 "netcdf-c-" version ".tar.gz"))
1550 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1551 (patches (search-patches "netcdf-date-time.patch"))))
1552 (build-system gnu-build-system)
1555 ("doxygen" ,doxygen)
1556 ("graphviz" ,graphviz)))
1558 `(("hdf4" ,hdf4-alt)
1562 ("libjpeg" ,libjpeg-turbo)))
1564 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1566 #:phases (modify-phases %standard-phases
1567 (add-before 'configure 'fix-source-date
1569 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1570 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1571 ;; to '1st hour of the current day', and therefore makes the
1572 ;; package not reproducible.
1573 (substitute* "./configure"
1574 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1575 "date --date='@0'"))
1577 (add-after 'configure 'patch-settings
1579 ;; libnetcdf.settings contains the full filename of the compilers
1580 ;; used to build the library. We truncate the hashes of those
1581 ;; filenames to avoid unnecessary references to the corresponding
1583 (substitute* "libnetcdf.settings"
1584 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1585 (string-append prefix (string-take hash 10) "...")))
1588 #:parallel-tests? #f)) ;various race conditions
1589 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1590 (synopsis "Library for scientific data")
1591 (description "NetCDF is an interface for scientific data access and a
1592 software library that provides an implementation of the interface. The netCDF
1593 library defines a machine-independent format for representing scientific data.
1594 Together, the interface, library, and format support the creation, access, and
1595 sharing of scientific data.")
1596 (license (license:x11-style "file://COPYRIGHT"))))
1598 (define-public netcdf-parallel-openmpi
1599 (package (inherit netcdf)
1600 (name "netcdf-parallel-openmpi")
1603 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1604 (package-inputs netcdf))))
1605 ;; TODO: Replace pkg-config references in nc-config with absolute references
1607 (substitute-keyword-arguments (package-arguments netcdf)
1608 ((#:configure-flags flags)
1609 `(cons* "CC=mpicc" "CXX=mpicxx"
1610 "--enable-parallel-tests"
1611 ;; Shared libraries not supported with parallel IO.
1612 "--disable-shared" "--with-pic"
1614 ((#:phases phases '%standard-phases)
1615 `(modify-phases ,phases
1616 (add-after 'build 'mpi-setup
1617 ,%openmpi-setup)))))))
1619 (define-public netcdf-fortran
1621 (name "netcdf-fortran")
1626 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1630 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1631 (build-system gnu-build-system)
1633 `(#:parallel-tests? #f))
1635 `(("netcdf" ,netcdf)))
1637 `(("gfortran" ,gfortran)))
1638 (synopsis "Fortran interface for the netCDF library")
1639 (description (package-description netcdf))
1640 (home-page (package-home-page netcdf))
1641 (license (package-license netcdf))))
1643 (define-public nlopt
1649 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1652 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1653 (build-system gnu-build-system)
1655 `(;; Shared libraries are not built by default. They are required to
1656 ;; build the Guile, Octave, and Python bindings.
1657 #:configure-flags '("--enable-shared")
1660 (modify-phases %standard-phases
1661 (add-before 'configure 'set-libnlopt-file-name
1662 (lambda* (#:key outputs #:allow-other-keys)
1663 ;; Make sure the Scheme module refers to the library by its
1664 ;; absolute file name (we cannot do that from a snippet
1665 ;; because the expansion of @libdir@ contains
1667 (let ((out (assoc-ref outputs "out")))
1668 (substitute* "swig/nlopt.scm.in"
1670 (string-append out "/lib/libnlopt")))
1672 (inputs `(("guile" ,guile-2.0)))
1673 (native-inputs `(("pkg-config" ,pkg-config)))
1674 (home-page "http://ab-initio.mit.edu/wiki/")
1675 (synopsis "Library for nonlinear optimization")
1676 (description "NLopt is a library for nonlinear optimization, providing a
1677 common interface for a number of different free optimization routines available
1678 online as well as original implementations of various other algorithms.")
1679 (license license:lgpl2.1+)))
1681 (define-public ipopt
1688 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1692 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1693 (modules '((guix build utils)))
1695 ;; Make sure we don't use the bundled software.
1697 (delete-file-recursively "ThirdParty")
1699 (build-system gnu-build-system)
1701 '(#:phases (modify-phases %standard-phases
1702 (add-after 'install 'add--L-flags-in-ipopt.pc
1703 (lambda* (#:key inputs outputs #:allow-other-keys)
1704 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1705 ;; move it to "Libs.private" where it belongs, and add a
1706 ;; '-L' flag for LAPACK.
1707 (let ((out (assoc-ref outputs "out"))
1708 (lapack (assoc-ref inputs "lapack")))
1709 (substitute* (string-append out "/lib/pkgconfig/"
1711 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1712 (string-append "Libs: " before " " after "\n"
1713 "Libs.private: " before
1714 "-L" lapack "/lib -llapack -lblas "
1718 `(("gfortran" ,gfortran)))
1720 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1721 `(("lapack" ,lapack))) ;for both libblas and liblapack
1722 (home-page "https://www.coin-or.org")
1723 (synopsis "Large-scale nonlinear optimizer")
1725 "The Interior Point Optimizer (IPOPT) is a software package for
1726 large-scale nonlinear optimization. It provides C++, C, and Fortran
1728 (license license:epl1.0)))
1736 (uri (string-append "https://www.coin-or.org/download/source/"
1737 "Clp/Clp-" version ".tgz"))
1740 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1741 (modules '((guix build utils)))
1743 ;; Make sure we don't use the bundled software.
1745 (delete-file-recursively "ThirdParty")
1747 (build-system gnu-build-system)
1749 `(("gfortran" ,gfortran)
1750 ("pkg-config" ,pkg-config)))
1752 `(("openblas" ,openblas)))
1753 (home-page "https://www.coin-or.org")
1754 (synopsis "Linear programming solver")
1756 "CLP is a high quality linear programming solver. Its main strengths are
1757 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1758 linear and quadratic objectives. There are limited facilities for nonlinear
1759 and quadratic objectives using the Simplex algorithm.")
1760 (license license:epl1.0)))
1762 (define-public libflame
1766 (outputs '("out" "static"))
1771 (url "https://github.com/flame/libflame")
1773 (file-name (git-file-name name version))
1776 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
1777 (build-system gnu-build-system)
1780 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
1781 (list "--enable-dynamic-build"
1782 "--enable-max-arg-list-hack"
1783 "--enable-lapack2flame"
1784 "--enable-verbose-make-output"
1785 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
1786 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
1789 '("--enable-vector-intrinsics=sse")
1791 "--enable-supermatrix"
1792 "--enable-memory-alignment=16"
1793 "--enable-ldim-alignment")
1795 (modify-phases %standard-phases
1796 (add-after 'unpack 'patch-/usr/bin/env-bash
1798 (substitute* "build/config.mk.in"
1799 (("/usr/bin/env bash") (which "bash")))
1802 (lambda* (#:key tests? #:allow-other-keys)
1803 (substitute* "test/Makefile"
1804 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
1805 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
1807 (with-directory-excursion "test"
1810 (invoke "./test_libflame.x"))
1812 (add-after 'install 'install-static
1813 (lambda* (#:key outputs #:allow-other-keys)
1814 (let ((out (assoc-ref outputs "out"))
1815 (static (assoc-ref outputs "static")))
1816 (mkdir-p (string-append static "/lib"))
1817 (rename-file (string-append out "/lib/libflame.a")
1818 (string-append static "/lib/libflame.a"))
1819 (install-file (string-append out "/include/FLAME.h")
1820 (string-append static "/include"))
1823 `(("gfortran" ,gfortran)))
1825 `(("lapack" ,lapack)
1826 ("openblas" ,openblas)
1828 ("python" ,python-wrapper)))
1829 (home-page "https://github.com/flame/libflame")
1830 (synopsis "High-performance object-based library for DLA computations")
1831 (description "@code{libflame} is a portable library for dense matrix
1832 computations, providing much of the functionality present in LAPACK, developed
1833 by current and former members of the @acronym{SHPC, Science of High-Performance
1834 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
1835 Computational Engineering and Sciences} at The University of Texas at Austin.
1836 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
1837 includes a complete LAPACK implementation.")
1838 (license license:bsd-3)))
1840 (define-public ceres
1842 (name "ceres-solver")
1844 (home-page "http://ceres-solver.org/")
1847 (uri (string-append home-page "ceres-solver-"
1851 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1852 (build-system cmake-build-system)
1854 ;; TODO: Build HTML user documentation and install separately.
1855 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1856 "-DBUILD_SHARED_LIBS=ON")
1858 #:phases (modify-phases %standard-phases
1859 (add-before 'configure 'set-library-directory
1861 ;; Install libraries to lib/, not lib64/.
1862 (substitute* "internal/ceres/CMakeLists.txt"
1863 (("set\\(LIB_SUFFIX \"64\"\\)")
1864 "set(LIB_SUFFIX \"\")"))
1867 `(("pkg-config" ,pkg-config)))
1869 `(("glog" ,glog))) ;for #include <glog/glog.h>
1874 ("suitesparse" ,suitesparse)
1875 ("gflags" ,gflags)))
1876 (synopsis "C++ library for solving large optimization problems")
1878 "Ceres Solver is a C++ library for modeling and solving large,
1879 complicated optimization problems. It is a feature rich, mature and
1880 performant library which has been used in production since 2010. Ceres Solver
1881 can solve two kinds of problems:
1883 @item non-linear least squares problems with bounds constraints;
1884 @item general unconstrained optimization problems.
1886 (license license:bsd-3)))
1888 ;; For a fully featured Octave, users are strongly recommended also to install
1889 ;; the following packages: less, ghostscript, gnuplot.
1890 (define-public octave-cli
1897 (uri (string-append "mirror://gnu/octave/octave-"
1901 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1902 (build-system gnu-build-system)
1904 `(("alsa-lib" ,alsa-lib)
1905 ("arpack" ,arpack-ng)
1911 ("fontconfig" ,fontconfig)
1912 ("freetype" ,freetype)
1916 ("graphicsmagick" ,graphicsmagick)
1918 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1919 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1920 ;; libtiff.la instead of having to provide it here.
1921 ("libjpeg" ,libjpeg-turbo)
1925 ("libsndfile" ,libsndfile)
1929 ("portaudio" ,portaudio)
1931 ("readline" ,readline)
1932 ("suitesparse" ,suitesparse)
1933 ("texinfo" ,texinfo)
1937 ("gfortran" ,gfortran)
1938 ("pkg-config" ,pkg-config)
1940 ;; The following inputs are not actually used in the build process.
1941 ;; However, the ./configure gratuitously tests for their existence and
1942 ;; assumes that programs not present at build time are also not, and
1943 ;; can never be, available at run time! If these inputs are therefore
1944 ;; not present, support for them will be built out. However, Octave
1945 ;; will still run without them, albeit without the features they
1948 ("ghostscript" ,ghostscript)
1949 ("gnuplot" ,gnuplot)))
1950 ;; Octave code uses this variable to detect directories holding multiple CA
1951 ;; certificates to verify peers with. This is required for the networking
1952 ;; functions that require encryption to work properly.
1953 (native-search-paths
1954 (list (search-path-specification
1955 (variable "CURLOPT_CAPATH")
1956 (files '("etc/ssl/certs")))))
1959 (list (string-append "--with-shell="
1960 (assoc-ref %build-inputs "bash")
1963 ;; XXX: Without this flag, linking octave-cli fails with
1964 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1965 ;; not pulling in liboctinterp.la for -lstdc++.
1966 "--enable-link-all-dependencies")
1968 (modify-phases %standard-phases
1969 (add-after 'configure 'configure-makeinfo
1970 (lambda* (#:key inputs #:allow-other-keys)
1971 (substitute* "libinterp/corefcn/help.h"
1974 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1976 (home-page "https://www.gnu.org/software/octave/")
1977 (synopsis "High-level language for numerical computation")
1978 (description "GNU Octave is a high-level interpreted language that is
1979 specialized for numerical computations. It can be used for both linear and
1980 non-linear applications and it provides great support for visualizing results.
1981 Work may be performed both at the interactive command-line as well as via
1983 (license license:gpl3+)))
1985 (define-public octave
1986 (package (inherit octave-cli)
1989 `(("qscintilla" ,qscintilla)
1991 ,@(package-inputs octave-cli)))
1993 `(("qttools" , qttools) ;for lrelease
1994 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1995 ,@(package-native-inputs octave-cli)))
1997 (substitute-keyword-arguments (package-arguments octave-cli)
1999 `(modify-phases ,phases
2000 (add-before 'configure 'patch-qscintilla-library-name
2001 (lambda* (#:key inputs #:allow-other-keys)
2002 ;; The QScintilla library that the Octave configure script tries
2003 ;; to link with should be named libqscintilla-qt5.so, but the
2004 ;; QScintilla input provides the shared library as
2005 ;; libqscintilla2_qt5.so.
2006 (substitute* "configure"
2007 (("qscintilla2-qt5")
2011 (define-public opencascade-oce
2013 (name "opencascade-oce")
2019 (url "https://github.com/tpaviot/oce")
2020 (commit (string-append "OCE-" version))))
2021 (file-name (git-file-name name version))
2022 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2024 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2025 (build-system cmake-build-system)
2028 (list "-DOCE_TESTING:BOOL=ON"
2029 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2030 "-DOCE_DRAW:BOOL=ON"
2031 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2032 (assoc-ref %outputs "out"))
2033 "-UCMAKE_INSTALL_RPATH")))
2035 `(("freetype" ,freetype)
2042 `(("python" ,python-wrapper)))
2043 (home-page "https://github.com/tpaviot/oce")
2044 (synopsis "Libraries for 3D modeling and numerical simulation")
2046 "Open CASCADE is a set of libraries for the development of applications
2047 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2048 C++ class libraries providing services for 3D surface and solid modeling, CAD
2049 data exchange, and visualization. It is used for development of specialized
2050 software dealing with 3D models in design (CAD), manufacturing (CAM),
2051 numerical simulation (CAE), measurement equipment (CMM), and quality
2052 control (CAQ) domains.
2054 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2055 patches, improvements, and experiments contributed by users over the official
2056 Open CASCADE library.")
2057 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2058 ; use of header files; see
2059 ; OCCT_LGPL_EXCEPTION.txt
2060 license:public-domain; files
2061 ; src/Standard/Standard_StdAllocator.hxx and
2062 ; src/NCollection/NCollection_StdAllocator.hxx
2063 license:expat; file src/OpenGl/OpenGl_glext.h
2064 license:bsd-3)))); test framework gtest
2066 (define-public opencascade-occt
2068 (name "opencascade-occt")
2074 (url "https://git.dev.opencascade.org/repos/occt.git")
2077 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2079 (file-name (git-file-name name version))
2081 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2082 (modules '((guix build utils)))
2085 ;; Remove files specific to non-free operating systems.
2086 (delete-file-recursively "samples/ios")
2087 (delete-file-recursively "samples/mfc")
2088 (delete-file-recursively "samples/qt/FuncDemo")
2089 (delete-file "genconf.bat")
2090 (delete-file "gendoc.bat")
2091 (delete-file "genproj.bat")
2092 (delete-file "upgrade.bat")
2093 ;; Remove references to deleted files.
2094 (substitute* "dox/FILES_HTML.txt"
2095 ((".*standard.*") "" )
2096 ((".*UIKitSample.*") ""))
2098 (build-system cmake-build-system)
2100 '(;; There is no test target for make. OCCT provides an
2101 ;; 'Automated Testing System', which may be accessed after
2102 ;; installation via the draw.sh script. draw.sh is located in
2103 ;; the bin directory. For details see:
2104 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2105 ;; occt_dev_guides__tests.html
2107 ;; Configure without freeimage: attempting to link against the
2108 ;; freeimage version 3.17 library leads to 'undefined
2109 ;; reference' errors.
2111 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2113 "-DUSE_VTK:BOOL=OFF"
2114 "-DBUILD_DOC_Overview:BOOL=OFF"
2115 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2116 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2117 "-UCMAKE_INSTALL_LIBDIR")))
2119 `(("doxygen" ,doxygen)
2120 ;("freeimage" ,freeimage)
2121 ("freetype" ,freetype)
2123 ("libxext" ,libxext)
2130 ;; TODO: build Overview documentation and add 'doc' output.
2131 (home-page "https://www.opencascade.com")
2132 (synopsis "Libraries for 3D modeling and numerical simulation")
2134 "Open CASCADE is a set of libraries for the development of applications
2135 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2136 C++ class libraries providing services for 3D surface and solid modeling, CAD
2137 data exchange, and visualization. It is used for development of specialized
2138 software dealing with 3D models in design (CAD), manufacturing (CAM),
2139 numerical simulation (CAE), measurement equipment (CMM), and quality
2140 control (CAQ) domains.
2142 This is the certified version of the Open Cascade Technology (OCCT) library.")
2143 (license (list ;; OCCT library:
2144 license:lgpl2.1; with an exception for the use of header
2145 ; files, see OCCT_LGPL_EXCEPTION.txt.
2146 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2147 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2149 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2150 ;; src/StepFile/step.tab.*:
2151 license:gpl3+ ; with Bison 2.2 exception.
2152 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2153 (license:non-copyleft
2154 "https://www.unicode.org/license.html")
2155 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2156 license:public-domain))))
2166 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2168 (string-append "gmsh_"
2169 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2171 (file-name (git-file-name name version))
2173 (base32 "0m0pjxcy1bnr7a20i11lh0ih159pphq9wsvfjr3sfx4y3lginz5y"))
2174 (modules '((guix build utils)))
2177 (delete-file-recursively "contrib/metis")
2179 (build-system cmake-build-system)
2182 ("gfortran" ,gfortran)
2189 ("opencascade-occt" ,opencascade-occt)
2191 ("libxext" ,libxext)))
2193 `(("fontconfig" ,fontconfig)
2194 ("libxft" ,libxft)))
2196 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2197 "-DENABLE_BUILD_SHARED:BOOL=ON"
2198 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2199 (home-page "http://gmsh.info/")
2200 (synopsis "3D finite element grid generator")
2201 (description "Gmsh is a 3D finite element grid generator with a built-in
2202 CAD engine and post-processor. Its design goal is to provide a fast, light
2203 and user-friendly meshing tool with parametric input and advanced
2204 visualization capabilities. Gmsh is built around four modules: geometry,
2205 mesh, solver and post-processing. The specification of any input to these
2206 modules is done either interactively using the graphical user interface or in
2207 ASCII text files using Gmsh's own scripting language.")
2208 (license license:gpl2+)))
2210 (define-public veusz
2217 (uri (pypi-uri "veusz" version))
2219 (base32 "00vmfpvyd6f33l5awlf02qdik3gmbhzyfizfwwbx7qnam2i9bbwy"))))
2220 (build-system python-build-system)
2222 `(;; Tests will fail because they depend on optional packages like
2223 ;; python-astropy, which is not packaged.
2226 (modify-phases %standard-phases
2227 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2228 ;; the path is defined in Guix, therefore we have to change it.
2229 (add-after 'unpack 'fix-sip-dir
2231 (substitute* "pyqtdistutils.py"
2232 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2234 ;; Now we have to pass the correct sip_dir to setup.py.
2236 (lambda* (#:key inputs #:allow-other-keys)
2237 ;; We need to tell setup.py where to locate QtCoremod.sip
2238 ((@@ (guix build python-build-system) call-setuppy)
2240 (list (string-append "--sip-dir="
2241 (assoc-ref inputs "python-pyqt")
2244 ;; Ensure that icons are found at runtime.
2245 (add-after 'install 'wrap-executable
2246 (lambda* (#:key inputs outputs #:allow-other-keys)
2247 (let ((out (assoc-ref outputs "out")))
2248 (wrap-program (string-append out "/bin/veusz")
2249 `("QT_PLUGIN_PATH" prefix
2250 ,(list (string-append (assoc-ref inputs "qtsvg")
2251 "/lib/qt5/plugins/"))))))))))
2253 `(("pkg-config" ,pkg-config)
2254 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2255 ("qttools" ,qttools)))
2257 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2258 ("python-dbus" ,python-dbus)
2259 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2260 ("python-pyqt" ,python-pyqt)
2264 `(("python-numpy" ,python-numpy)))
2265 (home-page "https://veusz.github.io/")
2266 (synopsis "Scientific plotting package")
2268 "Veusz is a scientific plotting and graphing program with a graphical
2269 user interface, designed to produce publication-ready 2D and 3D plots. In
2270 addition it can be used as a module in Python for plotting. It supports
2271 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2272 (license license:gpl2+)))
2274 (define-public maxflow
2277 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2278 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2283 (url "https://github.com/gerddie/maxflow")
2285 (file-name (git-file-name name version))
2288 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2289 (build-system cmake-build-system)
2290 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2291 (synopsis "Library implementing Maxflow algorithm")
2292 (description "An implementation of the maxflow algorithm described in
2293 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2294 Energy Minimization in Computer Vision.\n
2295 Yuri Boykov and Vladimir Kolmogorov.\n
2296 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2298 (license license:gpl3+)))
2300 (define-public petsc
2307 ;; The *-lite-* tarball does not contain the *large* documentation
2308 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2309 "petsc-lite-" version ".tar.gz"))
2311 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2312 (outputs '("out" ; libraries and headers
2313 "examples")) ; ~30MiB of examples
2314 (build-system gnu-build-system)
2316 `(("python" ,python-2)))
2318 `(("gfortran" ,gfortran)
2320 ("superlu" ,superlu)
2321 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2322 ;; leaving out opengl, as configuration seems to only be for mac
2325 `(#:test-target "test"
2326 #:parallel-build? #f ; build is parallel by default
2332 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2333 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2334 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2336 (modify-phases %standard-phases
2338 ;; PETSc's configure script is actually a python script, so we can't
2339 ;; run it with bash.
2340 (lambda* (#:key outputs (configure-flags '())
2342 (let* ((prefix (assoc-ref outputs "out"))
2343 (flags `(,(string-append "--prefix=" prefix)
2344 ,@configure-flags)))
2345 (format #t "build directory: ~s~%" (getcwd))
2346 (format #t "configure flags: ~s~%" flags)
2347 (apply invoke "./configure" flags))))
2348 (add-after 'configure 'clean-local-references
2349 (lambda* (#:key outputs #:allow-other-keys)
2350 (let ((out (assoc-ref outputs "out")))
2351 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2352 ;; Prevent build directory from leaking into compiled code
2354 ;; Scrub timestamp for reproducibility
2355 ((".*Libraries compiled on.*") ""))
2356 (substitute* (find-files "." "petscvariables")
2357 ;; Do not expose build machine characteristics, set to defaults.
2358 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2359 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2361 (add-after 'install 'clean-install
2362 ;; Try to keep installed files from leaking build directory names.
2363 (lambda* (#:key inputs outputs #:allow-other-keys)
2364 (let ((out (assoc-ref outputs "out")))
2365 (substitute* (map (lambda (file)
2366 (string-append out "/lib/petsc/conf/" file))
2367 '("petscvariables"))
2369 ;; Make compiler references point to the store
2370 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2371 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2372 (string-append "= " (which compiler))))
2373 ;; PETSc installs some build logs, which aren't necessary.
2374 (for-each (lambda (file)
2375 (let ((f (string-append out "/lib/petsc/conf/" file)))
2376 (when (file-exists? f)
2378 '("configure.log" "make.log" "gmake.log"
2379 "test.log" "error.log" "RDict.db"
2380 "PETScBuildInternal.cmake"
2381 ;; Once installed, should uninstall with Guix
2384 (add-after 'install 'move-examples
2385 (lambda* (#:key outputs #:allow-other-keys)
2386 (let* ((out (assoc-ref outputs "out"))
2387 (examples (assoc-ref outputs "examples"))
2388 (exdir (string-append out "/share/petsc/examples"))
2389 (exdir' (string-append examples "/share/petsc/examples")))
2390 (copy-recursively exdir exdir')
2391 (delete-file-recursively exdir)
2393 (home-page "https://www.mcs.anl.gov/petsc")
2394 (synopsis "Library to solve PDEs")
2395 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2396 data structures and routines for the scalable (parallel) solution of
2397 scientific applications modeled by partial differential equations.")
2398 (license (license:non-copyleft
2399 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2401 (define-public petsc-complex
2402 (package (inherit petsc)
2403 (name "petsc-complex")
2405 (substitute-keyword-arguments (package-arguments petsc)
2406 ((#:configure-flags cf)
2407 `(cons "--with-scalar-type=complex" ,cf))))
2408 (synopsis "Library to solve PDEs (with complex scalars)")))
2410 (define-public petsc-openmpi
2411 (package (inherit petsc)
2412 (name "petsc-openmpi")
2414 `(("hdf5" ,hdf5-parallel-openmpi)
2415 ("hypre" ,hypre-openmpi)
2417 ("mumps" ,mumps-openmpi)
2418 ("openmpi" ,openmpi)
2419 ("scalapack" ,scalapack)
2420 ("scotch" ,pt-scotch32)
2421 ,@(package-inputs petsc)))
2423 (substitute-keyword-arguments (package-arguments petsc)
2424 ((#:configure-flags cf)
2426 "--with-mpiexec=mpirun"
2429 "--with-scalapack=1"
2431 ,(string-append "--with-mpi-dir="
2432 (assoc-ref %build-inputs "openmpi"))
2433 ,(string-append "--with-hdf5-include="
2434 (assoc-ref %build-inputs "hdf5") "/include")
2435 ,(string-append "--with-hdf5-lib="
2436 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2437 ,@(delete "--with-mpi=0" ,cf)))
2439 `(modify-phases ,phases
2440 (add-before 'configure 'mpi-setup
2441 ,%openmpi-setup)))))
2442 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2444 (define-public petsc-complex-openmpi
2445 (package (inherit petsc-complex)
2446 (name "petsc-complex-openmpi")
2448 `(("openmpi" ,openmpi)
2449 ,@(package-inputs petsc-complex)))
2451 (substitute-keyword-arguments (package-arguments petsc-complex)
2452 ((#:configure-flags cf)
2453 ``("--with-mpiexec=mpirun"
2454 ,(string-append "--with-mpi-dir="
2455 (assoc-ref %build-inputs "openmpi"))
2456 ,@(delete "--with-mpi=0" ,cf)))
2458 `(modify-phases ,phases
2459 (add-before 'configure 'mpi-setup
2460 ,%openmpi-setup)))))
2461 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2463 (define-public python-petsc4py
2465 (name "python-petsc4py")
2470 (uri (pypi-uri "petsc4py" version))
2473 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2474 (modules '((guix build utils)))
2477 ;; Ensure source file is regenerated in the build phase.
2478 (delete-file "src/petsc4py.PETSc.c")
2479 ;; Remove legacy GC code. See
2480 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2481 (substitute* "src/PETSc/cyclicgc.pxi"
2482 ((".*gc_refs.*") "" )
2483 ((".*PyGC_Head.*") ""))
2485 (build-system python-build-system)
2488 (modify-phases %standard-phases
2489 (add-before 'build 'pre-build
2491 ;; Define path to PETSc installation.
2492 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2494 (add-before 'check 'mpi-setup
2497 `(("python-cython" ,python-cython)))
2499 `(("petsc" ,petsc-openmpi)
2500 ("python-numpy" ,python-numpy)))
2501 (home-page "https://bitbucket.org/petsc/petsc4py/")
2502 (synopsis "Python bindings for PETSc")
2503 (description "PETSc, the Portable, Extensible Toolkit for
2504 Scientific Computation, is a suite of data structures and routines for
2505 the scalable (parallel) solution of scientific applications modeled by
2506 partial differential equations. It employs the MPI standard for all
2507 message-passing communication. @code{petsc4py} provides Python
2508 bindings to almost all functions of PETSc.")
2509 (license license:bsd-3)))
2511 (define-public python-kiwisolver
2513 (name "python-kiwisolver")
2517 (uri (pypi-uri "kiwisolver" version))
2520 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2521 (build-system python-build-system)
2522 (home-page "https://github.com/nucleic/kiwi")
2523 (synopsis "Fast implementation of the Cassowary constraint solver")
2525 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2526 solving algorithm. Kiwi has been designed from the ground up to be
2527 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2528 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2529 savings are consistently > 5x.")
2530 (license license:bsd-3)))
2532 (define-public python2-kiwisolver
2533 (package-with-python2 python-kiwisolver))
2535 (define-public slepc
2542 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2546 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2547 (build-system gnu-build-system)
2549 `(("python" ,python-2)
2550 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2552 `(("arpack" ,arpack-ng)
2553 ("gfortran" ,gfortran)))
2555 `(("petsc" ,petsc)))
2557 `(#:parallel-build? #f ;build is parallel by default
2559 `(,(string-append "--with-arpack-dir="
2560 (assoc-ref %build-inputs "arpack") "/lib"))
2561 #:make-flags ;honor (parallel-job-count)
2562 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2563 ,(string-append "PETSCCONFIGDIR="
2564 (assoc-ref %build-inputs "petsc:examples")
2565 "/share/petsc/examples/config"))
2567 (modify-phases %standard-phases
2569 ;; configure is a python script, so we can't run it with bash.
2570 (lambda* (#:key inputs outputs (configure-flags '())
2572 (let* ((prefix (assoc-ref outputs "out"))
2573 (flags `(,(string-append "--prefix=" prefix)
2574 ,@configure-flags)))
2575 (format #t "build directory: ~s~%" (getcwd))
2576 (format #t "configure flags: ~s~%" flags)
2577 (setenv "SLEPC_DIR" (getcwd))
2578 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2579 (apply invoke "./configure" flags))))
2580 (add-after 'install 'delete-doc
2581 ;; TODO: SLEPc installs HTML documentation alongside headers in
2582 ;; $out/include. We'd like to move them to share/doc, but delete
2583 ;; them for now, as they are incomplete and installing the complete
2584 ;; documentation is difficult.
2585 (lambda* (#:key outputs #:allow-other-keys)
2586 (let* ((out (assoc-ref outputs "out")))
2587 (for-each delete-file (find-files out "\\.html$"))
2589 (add-after 'install 'clean-install
2590 ;; Clean up unnecessary build logs from installation.
2591 (lambda* (#:key outputs #:allow-other-keys)
2592 (let ((out (assoc-ref outputs "out")))
2593 (for-each (lambda (file)
2594 (let ((f (string-append out "/lib/slepc/conf/" file)))
2595 (when (file-exists? f)
2597 '("configure.log" "make.log" "gmake.log"
2598 "test.log" "error.log" "RDict.db"
2601 (home-page "http://slepc.upv.es")
2602 (synopsis "Scalable library for eigenproblems")
2603 (description "SLEPc is a software library for the solution of large sparse
2604 eigenproblems on parallel computers. It can be used for the solution of
2605 linear eigenvalue problems formulated in either standard or generalized form,
2606 as well as other related problems such as the singular value decomposition.
2607 The emphasis of the software is on methods and techniques appropriate for
2608 problems in which the associated matrices are sparse, for example, those
2609 arising after the discretization of partial differential equations.")
2610 (license license:bsd-2)))
2612 (define-public slepc-complex
2613 (package (inherit slepc)
2614 (name "slepc-complex")
2616 `(("petsc" ,petsc-complex)
2617 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2618 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2620 (define-public slepc-openmpi
2621 (package (inherit slepc)
2622 (name "slepc-openmpi")
2624 (substitute-keyword-arguments (package-arguments slepc)
2625 ((#:phases phases '%standard-phases)
2626 `(modify-phases ,phases
2627 (add-before 'check 'mpi-setup
2628 ,%openmpi-setup)))))
2631 ("arpack" ,arpack-ng-openmpi)
2632 ,@(alist-delete "arpack" (package-inputs slepc))))
2634 `(("petsc" ,petsc-openmpi)
2635 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2636 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2638 (define-public slepc-complex-openmpi
2639 (package (inherit slepc-openmpi)
2640 (name "slepc-complex-openmpi")
2642 `(("petsc" ,petsc-complex-openmpi)
2643 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2644 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2646 (define-public python-slepc4py
2648 (name "python-slepc4py")
2653 (uri (pypi-uri "slepc4py" version))
2656 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2657 (build-system python-build-system)
2660 (modify-phases %standard-phases
2661 (add-before 'build 'pre-build
2663 ;; Define path to PETSc installation.
2664 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2665 ;; Define path to SLEPc installation.
2666 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2668 (add-before 'check 'mpi-setup
2671 `(("python-numpy" ,python-numpy)
2672 ("python-petsc4py" ,python-petsc4py)
2673 ("slepc" ,slepc-openmpi)))
2674 (home-page "https://bitbucket.org/slepc/slepc4py/")
2675 (synopsis "Python bindings for SLEPc")
2676 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2677 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2678 Scientific Computation. It employs the MPI standard for all
2679 message-passing communication. @code{slepc4py} provides Python
2680 bindings to almost all functions of SLEPc.")
2681 (license license:bsd-3)))
2683 (define-public metamath
2691 (url "https://github.com/metamath/metamath-exe")
2692 (commit (string-append "v" version))))
2693 (file-name (git-file-name name version))
2695 (base32 "1k31zw36h2b0w5r6sbn9qc0v4hj42vw53qlhf5l7q2h3p5qlzvic"))))
2696 (build-system gnu-build-system)
2698 `(("autoconf" ,autoconf)
2699 ("automake" ,automake)))
2700 (home-page "http://us.metamath.org/")
2701 (synopsis "Proof verifier based on a minimalistic formalism")
2703 "Metamath is a tiny formal language and that can express theorems in
2704 abstract mathematics, with an accompyaning @command{metamath} executable that
2705 verifies databases of these proofs. There is a public database,
2706 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2707 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2708 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2709 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2711 (license license:gpl2+)))
2713 (define-public mumps
2720 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2724 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2725 (patches (search-patches "mumps-build-parallelism.patch"
2726 "mumps-shared-libseq.patch"
2727 "mumps-shared-mumps.patch"
2728 "mumps-shared-pord.patch"))))
2729 (build-system gnu-build-system)
2731 `(("fortran" ,gfortran)
2732 ;; These are required for linking against mumps, but we let the user
2733 ;; declare the dependency.
2736 ("scotch" ,scotch)))
2738 `(#:modules ((ice-9 match)
2741 ,@%gnu-build-system-modules)
2743 (modify-phases %standard-phases
2745 (lambda* (#:key inputs #:allow-other-keys)
2746 (call-with-output-file "Makefile.inc"
2757 INCSEQ = -I$(topdir)/libseq
2758 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2759 LIBSEQNEEDED = libseqneeded~;
2763 AR = ar vr # rules require trailing space, ugh...
2766 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2768 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2769 LIBOTHERS = -pthread
2772 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2776 LIBS = $(SCALAP) $(LIBSEQ)
2777 LPORDDIR = $(topdir)/PORD/lib
2778 IPORD = -I$(topdir)/PORD/include
2779 LPORD = $(LPORDDIR)/libpord.a
2780 ORDERINGSF = -Dpord~@[
2782 IMETIS = -I$(METISDIR)/include
2783 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2784 ORDERINGSF += -Dmetis~]~@[~:{
2786 ISCOTCH = -I$(SCOTCHDIR)/include
2787 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2788 ORDERINGSF += ~a~}~]
2789 ORDERINGSC = $(ORDERINGSF)
2790 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2791 IORDERINGSF = $(ISCOTCH)
2792 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2793 (assoc-ref inputs "mpi")
2794 (assoc-ref inputs "blas")
2795 (assoc-ref inputs "scalapack")
2796 (assoc-ref inputs "metis")
2797 (match (list (assoc-ref inputs "pt-scotch")
2798 (assoc-ref inputs "scotch"))
2802 `((,scotch "" "-Dscotch")))
2805 "-lptesmumps -lptscotch -lptscotcherr "
2806 "-Dptscotch")))))))))
2808 ;; By default only the d-precision library is built. Make with "all"
2809 ;; target so that all precision libraries and examples are built.
2811 (invoke "make" "all"
2812 (format #f "-j~a" (parallel-job-count)))))
2814 ;; Run the simple test drivers, which read test input from stdin:
2815 ;; from the "real" input for the single- and double-precision
2816 ;; testers, and from the "cmplx" input for complex-precision
2817 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2818 ;; package to prefix execution with "mpirun".
2819 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2820 (with-directory-excursion "examples"
2823 (let ((tester (apply open-pipe*
2826 ,(string-append "./" prec
2828 (input (open-input-file
2829 (string-append "input_simpletest_" type))))
2831 (dump-port input tester)
2833 (zero? (close-pipe tester)))))
2835 '("real" "real" "cmplx" "cmplx")))))
2837 (lambda* (#:key outputs #:allow-other-keys)
2838 (let* ((out (assoc-ref outputs "out"))
2839 (libdir (string-append out "/lib")))
2840 (copy-recursively "lib" libdir)
2841 (copy-recursively "include" (string-append out "/include"))
2842 (when (file-exists? "libseq/libmpiseq.a")
2843 (install-file "libseq/libmpiseq.a" libdir))
2844 (when (file-exists? "libseq/libmpiseq.so")
2845 (install-file "libseq/libmpiseq.so" libdir))
2847 (home-page "http://mumps.enseeiht.fr")
2848 (synopsis "Multifrontal sparse direct solver")
2850 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2851 sparse system of linear equations A x = b using Gaussian elimination.")
2852 (license license:cecill-c)))
2854 (define-public mumps-metis
2855 (package (inherit mumps)
2856 (name "mumps-metis")
2858 (alist-delete "scotch" (package-inputs mumps)))))
2860 (define-public mumps-openmpi
2861 (package (inherit mumps)
2862 (name "mumps-openmpi")
2865 ("scalapack" ,scalapack)
2866 ("pt-scotch" ,pt-scotch)
2867 ,@(alist-delete "scotch" (package-inputs mumps))))
2869 (substitute-keyword-arguments (package-arguments mumps)
2871 `(modify-phases ,phases
2872 (add-before 'check 'mpi-setup
2876 ((assoc-ref ,phases 'check)
2877 #:exec-prefix '("mpirun" "-n" "2"))))))))
2878 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2880 (define-public mumps-metis-openmpi
2881 (package (inherit mumps-openmpi)
2882 (name "mumps-metis-openmpi")
2884 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2886 (define-public ruby-asciimath
2888 (name "ruby-asciimath")
2893 (uri (rubygems-uri "asciimath" version))
2896 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2897 (build-system ruby-build-system)
2899 `(("ruby-nokogiri" ,ruby-nokogiri)
2900 ("ruby-rspec" ,ruby-rspec)))
2901 (synopsis "AsciiMath parsing and conversion library")
2903 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2904 easy-to-write markup language for mathematics.")
2905 (home-page "https://github.com/asciidoctor/asciimath")
2906 (license license:expat)))
2908 (define-public superlu
2915 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2916 "superlu_" version ".tar.gz"))
2918 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2919 (modules '((guix build utils)))
2921 ;; Replace the non-free implementation of MC64 with a stub adapted
2924 (use-modules (ice-9 regex)
2926 (call-with-output-file "SRC/mc64ad.c"
2931 void mc64id_(int *a) {
2932 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2935 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2936 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2937 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2940 ;; Remove the corresponding license verbiage. MC64 license follows
2941 ;; a "------" line separator.
2942 (with-atomic-file-replacement "License.txt"
2943 (let ((rx (make-regexp "-{8}")))
2946 (let ((line (read-line in 'concat)))
2947 (unless (regexp-exec rx line)
2951 (build-system cmake-build-system)
2955 `(("blas" ,openblas)
2956 ("gfortran" ,gfortran)))
2958 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2959 "-DTPL_BLAS_LIBRARIES=openblas"
2960 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2961 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2962 (synopsis "Supernodal direct solver for sparse linear systems")
2964 "SuperLU is a general purpose library for the direct solution of large,
2965 sparse, nonsymmetric systems of linear equations on high performance machines.
2966 The library is written in C and is callable from either C or Fortran. The
2967 library routines perform an LU decomposition with partial pivoting and
2968 triangular system solves through forward and back substitution. The library
2969 also provides threshold-based ILU factorization preconditioners.")
2970 (license (list license:bsd-3
2971 license:gpl2+ ;EXAMPLE/*fgmr.c
2972 (license:fsf-free "file://SRC/colamd.h")))))
2974 (define-public superlu-dist
2976 (name "superlu-dist")
2981 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2982 "superlu_dist_" version ".tar.gz"))
2984 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2985 (modules '((guix build utils)))
2987 ;; Replace the non-free implementation of MC64 with a stub
2989 (call-with-output-file "SRC/mc64ad_dist.c"
2994 void mc64id_dist(int *a) {
2995 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2998 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2999 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3000 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3003 (substitute* "SRC/util.c" ;adjust default algorithm
3004 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3005 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3006 ;; general (i.e. non-square) processor-grid support.
3007 "RowPerm = NOROWPERM;"))
3009 (patches (search-patches "superlu-dist-scotchmetis.patch"
3010 "superlu-dist-awpm-grid.patch"))))
3011 (build-system cmake-build-system)
3015 `(("gfortran" ,gfortran)
3018 ("combblas" ,combinatorial-blas)))
3020 `(("mpi" ,openmpi) ;headers include MPI heades
3021 ("parmetis" ,pt-scotch32 "metis")
3022 ("pt-scotch" ,pt-scotch32)))
3024 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3025 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3026 "-DTPL_ENABLE_COMBBLASLIB=YES"
3027 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3028 "-DTPL_LAPACK_LIBRARIES=-llapack"
3029 (string-append "-DTPL_PARMETIS_LIBRARIES="
3031 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3032 "scotchmetis" "scotch" "scotcherr")
3034 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3035 (assoc-ref %build-inputs "parmetis")
3037 "-DTPL_ENABLE_COMBBLASLIB=ON"
3038 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3039 (assoc-ref %build-inputs "combblas")
3040 "/include/CombBLAS;"
3041 (assoc-ref %build-inputs "combblas")
3042 "/include/BipartiteMatchings")
3043 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3045 (modify-phases %standard-phases
3046 (add-before 'configure 'set-c++-standard
3048 (substitute* "CMakeLists.txt"
3049 ;; AWPM headers require C++14
3050 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3051 (add-before 'check 'mpi-setup
3053 (add-before 'check 'omp-setup
3054 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3055 (home-page (package-home-page superlu))
3056 (synopsis "Parallel supernodal direct solver")
3058 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3059 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3060 implemented in ANSI C, and MPI for communications.")
3061 (license license:bsd-3)))
3063 (define-public scotch
3070 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3071 "latestfile/298/scotch_" version ".tar.gz"))
3073 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
3074 (patches (search-patches "scotch-build-parallelism.patch"
3075 "scotch-integer-declarations.patch"))))
3076 (build-system gnu-build-system)
3082 (outputs '("out" "metis"))
3084 `(#:make-flags (list (string-append "prefix=" %output))
3086 (modify-phases %standard-phases
3088 'unpack 'chdir-to-src
3089 (lambda _ (chdir "src") #t))
3093 (call-with-output-file "Makefile.inc"
3107 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3108 LDFLAGS = -lz -lm -lrt -lpthread
3110 LEX = flex -Pscotchyy -olex.yy.c
3115 YACC = bison -pscotchyy -y -b y
3117 '("COMMON_FILE_COMPRESS_GZ"
3119 "COMMON_RANDOM_FIXED_SEED"
3120 "INTSIZE64" ;use 'int64_t'
3121 ;; Prevents symbolc clashes with libesmumps
3123 ;; XXX: Causes invalid frees in superlu-dist tests
3125 ;; "SCOTCH_PTHREAD_NUMBER=2"
3126 "restrict=__restrict"))))
3128 (add-after 'build 'build-esmumps
3131 (format #f "-j~a" (parallel-job-count))
3133 (add-before 'install 'make-install-dirs
3134 (lambda* (#:key outputs #:allow-other-keys)
3135 (mkdir (assoc-ref outputs "out"))))
3136 (add-after 'install 'install-metis
3137 (lambda* (#:key outputs #:allow-other-keys)
3138 (let ((out (assoc-ref outputs "metis")))
3140 ;; metis files are not installed with 'make install'
3141 (for-each (lambda (f)
3142 (install-file f (string-append out "/include")))
3143 (find-files "../include/" ".*metis\\.h"))
3144 (for-each (lambda (f)
3145 (install-file f (string-append out "/lib")))
3146 (find-files "../lib/" ".*metis\\..*"))
3148 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3149 (synopsis "Programs and libraries for graph algorithms")
3150 (description "SCOTCH is a set of programs and libraries which implement
3151 the static mapping and sparse matrix reordering algorithms developed within
3152 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3153 conquer approach, to scientific computing problems such as graph and mesh
3154 partitioning, static mapping, and sparse matrix ordering, in application
3155 domains ranging from structural mechanics to operating systems or
3157 ;; See LICENSE_en.txt
3158 (license license:cecill-c)))
3160 (define-public scotch32
3161 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3162 ;; some applications.
3163 (package (inherit scotch)
3166 (substitute-keyword-arguments (package-arguments scotch)
3167 ((#:phases scotch-phases)
3168 `(modify-phases ,scotch-phases
3172 (call-with-output-file "Makefile.inc"
3186 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3187 LDFLAGS = -lz -lm -lrt -lpthread
3189 LEX = flex -Pscotchyy -olex.yy.c
3194 YACC = bison -pscotchyy -y -b y
3196 '("COMMON_FILE_COMPRESS_GZ"
3198 "COMMON_RANDOM_FIXED_SEED"
3199 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3200 ;; Prevents symbolc clashes with libesmumps
3202 ;; XXX: Causes invalid frees in superlu-dist tests
3204 ;; "SCOTCH_PTHREAD_NUMBER=2"
3205 "restrict=__restrict"))))))))))
3207 "Programs and libraries for graph algorithms (32-bit integers)")))
3209 (define-public pt-scotch
3210 (package (inherit scotch)
3213 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3215 (substitute-keyword-arguments (package-arguments scotch)
3216 ((#:phases scotch-phases)
3217 `(modify-phases ,scotch-phases
3221 (invoke "make" (format #f "-j~a" (parallel-job-count))
3222 "ptscotch" "ptesmumps")
3224 ;; Install the serial metis compatibility library
3225 (invoke "make" "-C" "libscotchmetis" "install")))
3226 (add-before 'check 'mpi-setup
3230 (invoke "make" "ptcheck")))))))
3231 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3233 (define-public pt-scotch32
3234 (package (inherit scotch32)
3235 (name "pt-scotch32")
3237 `(("openmpi" ,openmpi))) ;headers include MPI headers
3239 (substitute-keyword-arguments (package-arguments scotch32)
3240 ((#:phases scotch32-phases)
3241 `(modify-phases ,scotch32-phases
3244 (invoke "make" (format #f "-j~a" (parallel-job-count))
3245 "ptscotch" "ptesmumps")
3246 ;; Install the serial metis compatibility library
3247 (invoke "make" "-C" "libscotchmetis" "install")))
3248 (add-before 'check 'mpi-setup
3252 (invoke "make" "ptcheck")))))))
3254 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3256 (define-public metis
3263 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3264 "metis-" version ".tar.gz"))
3267 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3268 (build-system cmake-build-system)
3270 `(("blas" ,openblas)))
3272 `(#:tests? #f ;no tests
3273 #:configure-flags `("-DSHARED=ON"
3274 ,(string-append "-DGKLIB_PATH=" (getcwd)
3275 "/metis-" ,version "/GKlib"))))
3276 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3277 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3279 "METIS is a set of serial programs for partitioning graphs, partitioning
3280 finite element meshes, and producing fill-reducing orderings for sparse
3281 matrices. The algorithms implemented in METIS are based on the multilevel
3282 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3284 (license license:asl2.0))) ;As of version 5.0.3
3286 (define-public p4est
3293 (uri (string-append "http://p4est.github.io/release/p4est-"
3297 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3298 (build-system gnu-build-system)
3300 `(("fortran" ,gfortran)
3305 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3306 (assoc-ref %build-inputs "blas")
3308 ,(string-append "LAPACK_LIBS=-L"
3309 (assoc-ref %build-inputs "lapack")
3311 #:phases (modify-phases %standard-phases
3312 (add-before 'check 'mpi-setup
3314 (home-page "http://www.p4est.org")
3315 (synopsis "Adaptive mesh refinement on forests of octrees")
3317 "The p4est software library enables the dynamic management of a
3318 collection of adaptive octrees, conveniently called a forest of octrees.
3319 p4est is designed to work in parallel and scales to hundreds of thousands of
3321 (license license:gpl2+)))
3323 (define-public p4est-openmpi
3324 (package (inherit p4est)
3325 (name "p4est-openmpi")
3328 ,@(package-inputs p4est)))
3330 (substitute-keyword-arguments (package-arguments p4est)
3331 ((#:configure-flags cf)
3332 ``("--enable-mpi" ,@,cf))))
3333 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3335 (define-public gsegrafix
3342 (uri (string-append "mirror://gnu/" name "/" name "-"
3346 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3347 (build-system gnu-build-system)
3349 `(#:configure-flags '("LDFLAGS=-lm")))
3351 `(("libgnomecanvas" ,libgnomecanvas)
3352 ("libbonoboui" ,libbonoboui)
3353 ("libgnomeui" ,libgnomeui)
3354 ("libgnomeprintui" ,libgnomeprintui)
3357 `(("pkg-config" ,pkg-config)))
3358 (home-page "https://www.gnu.org/software/gsegrafix/")
3359 (synopsis "GNOME application to create scientific and engineering plots")
3360 (description "GSEGrafix is an application which produces high-quality graphical
3361 plots for science and engineering. Plots are specified via simple ASCII
3362 parameter files and data files and are presented in an anti-aliased GNOME
3363 canvas. The program supports rectangular two-dimensional plots, histograms,
3364 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3365 to BMP, JPEG or PNG image formats.")
3366 (license license:gpl3+)))
3368 (define-public maxima
3375 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3376 version "-source/" name "-" version ".tar.gz"))
3379 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3380 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3381 (build-system gnu-build-system)
3384 ("gnuplot" ,gnuplot) ;for plots
3386 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3388 `(("texinfo" ,texinfo)
3390 ("python" ,python)))
3393 (list "--enable-gcl"
3394 (string-append "--with-posix-shell="
3395 (assoc-ref %build-inputs "bash")
3397 (string-append "--with-wish="
3398 (assoc-ref %build-inputs "tk")
3400 (let ((v ,(package-version tk)))
3401 (string-take v (string-index-right v #\.)))))
3402 ;; By default Maxima attempts to write temporary files to
3403 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3404 ;; Work around that.
3405 #:make-flags (list "TMPDIR=/tmp")
3407 (modify-phases %standard-phases
3408 (add-after 'unpack 'patch-paths
3409 (lambda* (#:key inputs #:allow-other-keys)
3410 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3411 (coreutils (assoc-ref inputs "coreutils"))
3412 (dirname (string-append coreutils "/bin/dirname"))
3413 (head (string-append coreutils "/bin/head"))
3414 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3415 (python (string-append (assoc-ref inputs "python")
3417 (substitute* "src/maxima.in"
3418 (("sed ") (string-append sed " "))
3419 (("dirname") dirname)
3421 (substitute* "doc/info/Makefile.in"
3422 (("/usr/bin/env perl") perl))
3423 (substitute* "doc/info/build_html.sh.in"
3424 (("python") python))
3426 (add-before 'check 'pre-check
3428 (chmod "src/maxima" #o555)
3432 ;; This is derived from the testing code in the "debian/rules" file
3433 ;; of Debian's Maxima package.
3434 ;; If Maxima can successfully run this, the binary to be installed
3440 "--batch-string=\"run_testsuite();\" "
3441 "| grep -q \"No unexpected errors found\""))))
3442 ;; Make sure the doc and emacs files are found in the
3443 ;; standard location. Also configure maxima to find gnuplot
3444 ;; without having it on the PATH.
3445 (add-after 'install 'post-install
3446 (lambda* (#:key outputs inputs #:allow-other-keys)
3447 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3448 (out (assoc-ref outputs "out"))
3449 (datadir (string-append out "/share/maxima/" ,version))
3450 (binutils (string-append (assoc-ref inputs "binutils")
3452 (with-directory-excursion out
3453 (mkdir-p "share/emacs")
3454 (mkdir-p "share/doc")
3456 (string-append datadir "/doc/")
3457 (string-append out "/share/doc/maxima"))
3458 (with-atomic-file-replacement
3459 (string-append datadir "/share/maxima-init.lisp")
3461 (format out "~a ~s~a~%"
3462 "(setf $gnuplot_command "
3463 (string-append gnuplot "/bin/gnuplot") ")")
3464 (dump-port in out))))
3465 ;; Ensure that Maxima will have access to the GNU binutils
3466 ;; components at runtime.
3467 (wrap-program (string-append out "/bin/maxima")
3468 `("PATH" prefix (,binutils))))
3470 (home-page "http://maxima.sourceforge.net")
3471 (synopsis "Numeric and symbolic expression manipulation")
3472 (description "Maxima is a system for the manipulation of symbolic and
3473 numerical expressions. It yields high precision numeric results by using
3474 exact fractions, arbitrary precision integers, and variable precision floating
3476 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3477 ;; Others simply say "GNU General Public License" without stating a
3478 ;; version (which implicitly means gpl1+).
3479 ;; At least one file (src/maxima.asd) says "version 2."
3480 ;; GPLv2 only is therefore the smallest subset.
3481 (license license:gpl2)))
3483 (define-public wxmaxima
3491 (url "https://github.com/wxMaxima-developers/wxmaxima")
3492 (commit (string-append "Version-" version))))
3493 (file-name (git-file-name name version))
3495 (base32 "054f7n5kx75ng5j20rd5q27n9xxk03mrd7sbxyym1lsswzimqh4w"))))
3496 (build-system cmake-build-system)
3498 `(("gettext" ,gettext-minimal)
3499 ("xorg-server" ,xorg-server-for-tests)))
3500 ;; TODO: Add libomp for multithreading support.
3501 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3503 `(("wxwidgets" ,wxwidgets)
3506 ("adwaita-icon-theme" ,adwaita-icon-theme)
3508 ("shared-mime-info" ,shared-mime-info)))
3510 `(#:test-target "test"
3512 (modify-phases %standard-phases
3513 (add-after 'unpack 'patch-doc-path
3515 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
3516 ;; documentation. Only licensing information is placed there by
3518 (substitute* "src/Dirstructure.cpp"
3519 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
3521 (add-before 'check 'pre-check
3523 ;; Tests require a running X server.
3524 (system "Xvfb :1 &")
3525 (setenv "DISPLAY" ":1")
3526 (setenv "HOME" (getcwd))
3528 (add-after 'install 'wrap-program
3529 (lambda* (#:key inputs outputs #:allow-other-keys)
3530 (wrap-program (string-append (assoc-ref outputs "out")
3533 (,(string-append (assoc-ref inputs "maxima")
3535 ;; For GtkFileChooserDialog.
3536 `("GSETTINGS_SCHEMA_DIR" =
3537 (,(string-append (assoc-ref inputs "gtk+")
3538 "/share/glib-2.0/schemas")))
3539 `("XDG_DATA_DIRS" ":" prefix
3540 (;; Needed by gdk-pixbuf to know supported icon formats.
3542 (assoc-ref inputs "shared-mime-info") "/share")
3543 ;; The default icon theme of GTK+.
3545 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3547 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3548 (synopsis "Graphical user interface for the Maxima computer algebra system")
3550 "wxMaxima is a graphical user interface for the Maxima computer algebra
3551 system. It eases the use of Maxima by making most of its commands available
3552 through a menu system and by providing input dialogs for commands that require
3553 more than one argument. It also implements its own display engine that
3554 outputs mathematical symbols directly instead of depicting them with ASCII
3557 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3558 text and mathematical calculations to create documents, exporting of input and
3559 output to TeX, and a browser for Maxima's manual including command index and
3560 full text searching.")
3561 (license license:gpl2+)))
3563 (define-public armadillo
3569 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3573 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3574 (build-system cmake-build-system)
3575 (arguments `(#:tests? #f)) ; no test target
3577 `(("openblas" ,openblas)
3579 ("arpack" ,arpack-ng)))
3580 (home-page "http://arma.sourceforge.net/")
3581 (synopsis "C++ linear algebra library")
3583 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3584 between speed and ease of use. It is useful for algorithm development
3585 directly in C++, or quick conversion of research code into production
3586 environments. It can be used for machine learning, pattern recognition,
3587 signal processing, bioinformatics, statistics, econometrics, etc. The library
3588 provides efficient classes for vectors, matrices and cubes, as well as 150+
3589 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3590 (license license:asl2.0)))
3592 (define-public muparser
3593 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3594 ;; different hash. In order to make `guix package --upgrade` work correctly,
3595 ;; we set a Guix packaging revision.
3596 ;; When the next version of muparser is released, we can remove
3597 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3598 (let ((upstream-version "2.2.5")
3602 (version (string-append upstream-version "-" revision))
3607 (url "https://github.com/beltoforion/muparser")
3608 (commit (string-append "v" upstream-version))))
3609 (file-name (git-file-name name version))
3611 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3612 (build-system gnu-build-system)
3614 `(#:configure-flags '("--enable-samples=no")
3615 #:tests? #f)) ;no "check" target
3616 (home-page "http://muparser.beltoforion.de/")
3617 (synopsis "Fast parser library for mathematical expressions")
3619 "muParser is an extensible high performance math parser library. It is
3620 based on transforming an expression into a bytecode and precalculating constant
3622 (license license:expat))))
3624 (define-public openblas
3631 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3632 version "%20version.tar.gz"))
3633 (file-name (string-append name "-" version ".tar.gz"))
3636 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3637 (build-system gnu-build-system)
3639 `(#:test-target "test"
3640 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3641 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3642 ;; we need to disable substitutions.
3644 ,(let ((system (or (%current-target-system) (%current-system))))
3645 (or (string-prefix? "x86_64" system)
3646 (string-prefix? "i686" system)
3647 (string-prefix? "mips" system)
3648 (string-prefix? "aarch64" system)))
3650 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3652 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3654 ;; This is the maximum number of threads OpenBLAS will ever use (that
3655 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3656 ;; is used.) If we don't set it, the makefile sets it to the number
3657 ;; of cores of the build machine, which is obviously wrong.
3660 ;; Build the library for all supported CPUs. This allows
3661 ;; switching CPU targets at runtime with the environment variable
3662 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3663 ;; Unfortunately, this is not supported on non-x86 architectures,
3664 ;; where it leads to failed builds.
3665 ,@(let ((system (or (%current-target-system) (%current-system))))
3667 ((or (string-prefix? "x86_64" system)
3668 (string-prefix? "i686" system))
3669 '("DYNAMIC_ARCH=1"))
3670 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3671 ;; two available MIPS targets special extended instructions
3672 ;; for Loongson cores are used.
3673 ((string-prefix? "mips" system)
3674 '("TARGET=SICORTEX"))
3675 ;; On aarch64 force the generic 'armv8-a' target
3676 ((string-prefix? "aarch64" system)
3679 ;; no configure script
3681 (modify-phases %standard-phases
3683 (add-before 'build 'set-extralib
3684 (lambda* (#:key inputs #:allow-other-keys)
3685 ;; Get libgfortran found when building in utest.
3687 (string-append "-L" (assoc-ref inputs "fortran-lib")
3691 `(("fortran-lib" ,gfortran "lib")))
3694 ("fortran" ,gfortran)
3696 (home-page "https://www.openblas.net/")
3697 (synopsis "Optimized BLAS library based on GotoBLAS")
3699 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3700 (license license:bsd-3)))
3702 (define-public openblas-ilp64
3703 (package/inherit openblas
3704 (name "openblas-ilp64")
3705 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3707 (substitute-keyword-arguments (package-arguments openblas)
3708 ((#:make-flags flags '())
3709 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3711 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3712 (license license:bsd-3)))
3714 (define* (make-blis implementation #:optional substitutable?)
3715 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3716 source tree for a list of implementations.)
3718 SUBSTITUTABLE? determines whether the package is made available as a
3721 Currently the specialization must be selected at configure-time, but work is
3722 underway to allow BLIS to select the right optimized kernels at run time:
3723 <https://github.com/flame/blis/issues/129>."
3725 (name (if (string=? implementation "reference")
3727 (string-append "blis-" implementation)))
3729 (home-page "https://github.com/flame/blis")
3732 (uri (git-reference (url home-page) (commit version)))
3735 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3736 (file-name (git-file-name "blis" version))))
3737 (build-system gnu-build-system)
3739 `(#:test-target "test"
3741 #:substitutable? ,substitutable?
3743 #:phases (modify-phases %standard-phases
3745 (lambda* (#:key outputs #:allow-other-keys)
3746 ;; This is a home-made 'configure' script.
3747 (let ((out (assoc-ref outputs "out")))
3748 (invoke "./configure" "-p" out
3752 "--enable-threading=openmp"
3755 (add-before 'check 'show-test-output
3757 ;; By default "make check" is silent. Make it verbose.
3758 (system "tail -F output.testsuite &")
3760 (synopsis "High-performance basic linear algebra (BLAS) routines")
3762 "BLIS is a portable software framework for instantiating high-performance
3763 BLAS-like dense linear algebra libraries. The framework was designed to
3764 isolate essential kernels of computation that, when optimized, immediately
3765 enable optimized implementations of most of its commonly used and
3766 computationally intensive operations. While BLIS exports a new BLAS-like API,
3767 it also includes a BLAS compatibility layer which gives application developers
3768 access to BLIS implementations via traditional BLAS routine calls.")
3769 (license license:bsd-3)))
3772 ;; This is the "reference" implementation, which is the non-optimized but
3773 ;; portable variant (no assembly).
3774 (make-blis "reference" #t))
3776 (define ignorance blis)
3778 (define-syntax-rule (blis/x86_64 processor)
3779 "Expand to a package specialized for PROCESSOR."
3781 (inherit (make-blis processor))
3782 (supported-systems '("x86_64-linux"))))
3784 (define-public blis-sandybridge
3785 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3786 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3787 (blis/x86_64 "sandybridge"))
3789 (define-public blis-haswell
3790 ;; BLIS specialized for Haswell processors (launched 2013):
3791 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3792 (blis/x86_64 "haswell"))
3794 (define-public blis-knl
3795 ;; BLIS specialized for Knights Landing processor (launched 2016):
3796 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3797 (blis/x86_64 "knl"))
3800 (define-public openlibm
3808 (url "https://github.com/JuliaLang/openlibm")
3809 (commit (string-append "v" version))))
3810 (file-name (git-file-name name version))
3812 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3813 (build-system gnu-build-system)
3816 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3818 ;; no configure script
3819 (modify-phases %standard-phases (delete 'configure))
3820 #:tests? #f)) ;the tests are part of the default target
3821 (home-page "https://openlibm.org/")
3822 (synopsis "Portable C mathematical library (libm)")
3824 "OpenLibm is an effort to have a high quality, portable, standalone C
3825 mathematical library (libm). It can be used standalone in applications and
3826 programming language implementations. The project was born out of a need to
3827 have a good libm for the Julia programming language that worked consistently
3828 across compilers and operating systems, and in 32-bit and 64-bit
3830 ;; Each architecture has its own make target, and there is none for mips.
3831 (supported-systems (delete "mips64el-linux" %supported-systems))
3832 ;; See LICENSE.md for details.
3833 (license (list license:expat
3836 license:public-domain
3837 license:lgpl2.1+))))
3839 (define-public openspecfun
3841 (name "openspecfun")
3847 (url "https://github.com/JuliaLang/openspecfun")
3848 (commit (string-append "v" version))))
3849 (file-name (git-file-name name version))
3851 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3852 (build-system gnu-build-system)
3854 '(#:tests? #f ; no "check" target
3856 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3858 (modify-phases %standard-phases
3859 (delete 'configure)))) ; no configure script
3861 `(("fortran" ,gfortran)))
3862 (home-page "https://github.com/JuliaLang/openspecfun")
3863 (synopsis "Collection of special mathematical functions")
3865 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3866 portable package for Bessel Functions of a Complex Argument and Nonnegative
3867 Order; it contains subroutines for computing Bessel functions and Airy
3868 functions. Faddeeva allows computing the various error functions of arbitrary
3869 complex arguments (Faddeeva function, error function, complementary error
3870 function, scaled complementary error function, imaginary error function, and
3871 Dawson function); given these, one can also easily compute Voigt functions,
3872 Fresnel integrals, and similar related functions as well.")
3873 ;; Faddeeva is released under the Expat license; AMOS is included as
3874 ;; public domain software.
3875 (license (list license:expat license:public-domain))))
3877 (define-public suitesparse
3879 (name "suitesparse")
3885 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3886 (commit (string-append "v" version))))
3887 (file-name (git-file-name name version))
3890 "0qjlyfxs8s48rs63c2fzspisgq1kk4bwkgnhmh125hgkdhrq2w1c"))
3891 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3892 (modules '((guix build utils)))
3894 ;; Remove bundled metis source
3896 (delete-file-recursively "metis-5.1.0")
3898 (build-system gnu-build-system)
3900 '(#:tests? #f ;no "check" target
3904 "MY_METIS_LIB=-lmetis"
3905 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3906 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3907 (assoc-ref %outputs "out")
3908 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3909 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3910 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3911 " -DCMAKE_SKIP_RPATH=TRUE"
3912 " -DCMAKE_BUILD_TYPE=Release")
3913 (string-append "INSTALL_LIB="
3914 (assoc-ref %outputs "out") "/lib")
3915 (string-append "INSTALL_INCLUDE="
3916 (assoc-ref %outputs "out") "/include")
3919 (modify-phases %standard-phases
3920 (delete 'configure)))) ;no configure script
3928 `(("cmake" ,cmake-minimal)
3930 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3931 (synopsis "Suite of sparse matrix software")
3933 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3934 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3935 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3936 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3937 CXSparse, a concise sparse Cholesky factorization package; and many other
3940 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3942 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3943 (license (list license:gpl2+ license:lgpl2.1+))))
3945 (define-public atlas
3951 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3952 version "/atlas" version ".tar.bz2"))
3955 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3956 (build-system gnu-build-system)
3957 (home-page "http://math-atlas.sourceforge.net/")
3958 (inputs `(("gfortran" ,gfortran)
3959 ("lapack-tar" ,(package-source lapack))))
3960 (outputs '("out" "doc"))
3961 ;; For the moment we drop support for MIPS at it fails to compile. See
3962 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3963 (supported-systems (delete "mips64el-linux" %supported-systems))
3965 `(#:parallel-build? #f
3966 #:parallel-tests? #f
3968 ;; ATLAS tunes itself for the machine it is built on, as explained at
3969 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3970 ;; For this reason, we want users to build it locally instead of using
3974 #:modules ((srfi srfi-26)
3975 (guix build gnu-build-system)
3978 `(;; Generate position independent code suitable for dynamic libraries
3979 ;; and use WALL timer to get more accurate timing.
3980 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3983 ,,(if (string-match "64" (%current-system))
3986 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3987 ;; needed to compile C files before it is generated.
3988 "-Ss" "pmake" "make -j 1"
3989 ;; Probe is failing for MIPS. We therefore define the system
3990 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3991 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3992 ,,@(if (string-prefix? "mips" (%current-system))
3993 (list "-A" "49" "-V" "1")
3995 ;; Generate shared libraries.
3997 ;; Build a full LAPACK library.
3998 ,(string-append "--with-netlib-lapack-tarfile="
3999 (assoc-ref %build-inputs "lapack-tar")))
4001 (modify-phases %standard-phases
4002 (add-after 'install 'install-doc
4003 (lambda* (#:key outputs inputs #:allow-other-keys)
4004 (let ((doc (string-append (assoc-ref outputs "doc")
4005 "/share/doc/atlas")))
4007 (for-each (cut install-file <> doc)
4008 (find-files "../ATLAS/doc" ".*"))
4010 (add-after 'check 'check-pt
4011 (lambda _ (invoke "make" "ptcheck")))
4012 ;; Fix files required to run configure.
4013 (add-before 'configure 'fix-/bin/sh
4015 ;; Use `sh', not `/bin/sh'.
4016 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4020 ;; Fix /bin/sh in generated make files.
4021 (add-after 'configure 'fix-/bin/sh-in-generated-files
4023 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4027 ;; ATLAS configure program does not accepts the default flags
4028 ;; passed by the 'gnu-build-system'.
4030 (lambda* (#:key native-inputs inputs outputs
4031 (configure-flags '())
4032 #:allow-other-keys #:rest args)
4033 (let* ((prefix (assoc-ref outputs "out"))
4034 (bash (or (and=> (assoc-ref
4035 (or native-inputs inputs) "bash")
4036 (cut string-append <> "/bin/bash"))
4038 (flags `(,(string-append "--prefix=" prefix)
4040 (abs-srcdir (getcwd))
4041 (srcdir (string-append "../" (basename abs-srcdir))))
4042 (format #t "source directory: ~s (relative from build: ~s)~%"
4046 (format #t "build directory: ~s~%" (getcwd))
4047 (format #t "configure flags: ~s~%" flags)
4049 (string-append srcdir "/configure")
4051 (synopsis "Automatically Tuned Linear Algebra Software")
4053 "ATLAS is an automatically tuned linear algebra software library
4054 providing C and Fortran77 interfaces to a portably efficient BLAS
4055 implementation, as well as a few routines from LAPACK.
4057 Optimization occurs at build time. For this reason, the library is built on
4058 the machine where it is installed, without resorting to pre-built substitutes.
4060 Before building the library, CPU throttling should be disabled. This can be
4061 done in the BIOS, or, on GNU/Linux, with the following command:
4064 # cpupower --governor performance
4067 Failure to do so will result in a library with poor performance.")
4068 (license license:bsd-3)))
4077 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4078 version "/glm-" version ".zip"))
4080 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4081 (build-system cmake-build-system)
4083 `(#:phases (modify-phases %standard-phases
4085 (lambda* (#:key outputs #:allow-other-keys)
4086 ;; Since version 0.9.9.6, 'make install' is not supported
4087 ;; and we have to do it "manually". Upstream discussion:
4088 ;; <https://github.com/g-truc/glm/pull/968>.
4089 (let* ((source (string-append "../glm"))
4090 (out (assoc-ref outputs "out"))
4091 (inc (string-append out "/include"))
4092 (lib (string-append out "/lib"))
4093 (pkgconfig (string-append lib "/pkgconfig")))
4094 (with-directory-excursion source
4097 (copy-recursively "glm" (string-append inc "/glm"))
4098 (copy-recursively "cmake" (string-append lib "/cmake"))
4099 (call-with-output-file (string-append pkgconfig "/glm.pc")
4103 includedir=${prefix}/include
4106 Description: OpenGL Mathematics
4108 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4111 `(("unzip" ,unzip)))
4112 (home-page "https://glm.g-truc.net/")
4113 (synopsis "OpenGL Mathematics library")
4114 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4115 library for graphics software based on the OpenGL Shading Language (GLSL)
4117 (license license:expat)))
4119 (define-public lpsolve
4126 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4127 "/lp_solve_" version "_source.tar.gz"))
4130 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4131 (modules '((guix build utils)))
4134 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4136 ;; Pretend to be on a 64 bit platform to obtain a common directory
4137 ;; name for the build results on all architectures; nothing else
4138 ;; seems to depend on it.
4139 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4141 ;; The check for 'isnan' as it is written fails with
4142 ;; "non-floating-point argument in call to function
4143 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4144 ;; definition, which in turn leads to bad things. Fix the feature
4146 (("isnan\\(0\\)") "isnan(0.)"))
4148 (build-system gnu-build-system)
4150 `(#:tests? #f ; no check target
4152 (modify-phases %standard-phases
4153 (delete 'configure) ; no configure script
4156 (with-directory-excursion "lpsolve55"
4157 (invoke "bash" "ccc"))
4158 (with-directory-excursion "lp_solve"
4159 (invoke "bash" "ccc"))
4162 (lambda* (#:key outputs #:allow-other-keys)
4163 (let* ((out (assoc-ref outputs "out"))
4164 (bin (string-append out "/bin"))
4165 (lib (string-append out "/lib"))
4166 ;; This is where LibreOffice expects to find the header
4167 ;; files, and where they are installed by Debian.
4168 (include (string-append out "/include/lpsolve")))
4169 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4170 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4171 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4173 ;; Install a subset of the header files as on Debian
4174 ;; (plus lp_bit.h, which matches the regular expression).
4175 (for-each (lambda (name)
4176 (install-file name include))
4177 (find-files "." "lp_[HMSa-z].*\\.h$"))
4178 (with-directory-excursion "shared"
4179 (for-each (lambda (name)
4180 (install-file name include))
4181 (find-files "." "\\.h$")))
4183 (home-page "http://lpsolve.sourceforge.net/")
4184 (synopsis "Mixed integer linear programming (MILP) solver")
4186 "lp_solve is a mixed integer linear programming solver based on the
4187 revised simplex and the branch-and-bound methods.")
4188 (license license:lgpl2.1+)))
4190 (define-public dealii
4197 (uri (string-append "https://github.com/dealii/dealii/releases/"
4198 "download/v" version "/dealii-" version ".tar.gz"))
4201 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
4202 (modules '((guix build utils)))
4204 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4206 (delete-file-recursively "bundled")
4208 (build-system cmake-build-system)
4216 ("arpack" ,arpack-ng)
4217 ("muparser" ,muparser)
4218 ("gfortran" ,gfortran)
4219 ("suitesparse" ,suitesparse))) ;for UMFPACK
4221 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4223 ;; Work around a bug in libsuitesparseconfig linking
4224 ;; see https://github.com/dealii/dealii/issues/4745
4225 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4226 (home-page "https://www.dealii.org")
4227 (synopsis "Finite element library")
4229 "Deal.II is a C++ program library targeted at the computational solution
4230 of partial differential equations using adaptive finite elements. The main
4231 aim of deal.II is to enable rapid development of modern finite element codes,
4232 using among other aspects adaptive meshes and a wide array of tools often used
4233 in finite element programs.")
4234 (license license:lgpl2.1+)))
4236 (define-public dealii-openmpi
4237 (package (inherit dealii)
4238 (name "dealii-openmpi")
4241 ;;Supported only with MPI:
4242 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4243 ("p4est" ,p4est-openmpi)
4244 ("petsc" ,petsc-openmpi)
4245 ("slepc" ,slepc-openmpi)
4246 ("metis" ,metis) ;for MUMPS
4247 ("scalapack" ,scalapack) ;for MUMPS
4248 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4249 ("arpack" ,arpack-ng-openmpi)
4250 ,@(fold alist-delete (package-inputs dealii)
4251 '("p4est" "arpack"))))
4253 (substitute-keyword-arguments (package-arguments dealii)
4254 ((#:configure-flags cf)
4255 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4257 ((#:phases phases '%standard-phases)
4258 `(modify-phases ,phases
4259 (add-before 'check 'mpi-setup
4260 ,%openmpi-setup)))))
4261 (synopsis "Finite element library (with MPI support)")))
4263 (define-public flann
4267 (home-page "https://github.com/mariusmuja/flann/")
4271 (uri (git-reference (url home-page) (commit version)))
4272 (file-name (git-file-name name version))
4275 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4276 (patches (search-patches "flann-cmake-3.11.patch"))))
4277 (build-system cmake-build-system)
4280 `(("unzip" ,unzip)))
4283 ;; FIXME: 'mkoctfile' fails with a linker error:
4284 ;; ld: cannot find -loctinterp
4285 ;; ld: cannot find -loctave
4286 ;; Disable it for now.
4287 ;;("octave" ,octave-cli)
4288 ("python" ,python-2) ; print syntax
4289 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4292 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4293 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4294 #:strip-directories '("lib" "lib64" "libexec"
4295 "bin" "sbin" "share/flann/octave")
4297 ;; Save 12 MiB by not installing .a files. Passing
4298 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4299 #:phases (modify-phases %standard-phases
4300 (add-after 'install 'remove-static-libraries
4301 (lambda* (#:key outputs #:allow-other-keys)
4302 (let* ((out (assoc-ref outputs "out"))
4303 (lib (string-append out "/lib")))
4304 (for-each delete-file
4305 (find-files lib "\\.a$"))
4308 #:tests? #f)) ; The test data are downloaded from the Internet.
4309 (synopsis "Library for approximate nearest neighbors computation")
4310 (description "FLANN is a library for performing fast approximate
4311 nearest neighbor searches in high dimensional spaces. It implements a
4312 collection of algorithms and a system for automatically choosing the best
4313 algorithm and optimum parameters depending on the dataset.
4315 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4316 (license (license:non-copyleft "file://COPYING"
4317 "See COPYING in the distribution."))))
4319 (define-public wcalc
4326 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4327 "wcalc-" version ".tar.bz2"))
4330 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4331 (build-system gnu-build-system)
4334 ("readline" ,readline)))
4335 (home-page "http://w-calc.sourceforge.net/index.php")
4336 (synopsis "Flexible command-line scientific calculator")
4337 (description "Wcalc is a very capable calculator. It has standard functions
4338 (sin, asin, and sinh for example, in either radians or degrees), many
4339 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4340 variables, a command history, hex/octal/binary input and output, unit
4341 conversions, embedded comments, and an expandable expression entry field. It
4342 evaluates expressions using the standard order of operations.")
4343 (license license:gpl2+)))
4352 (url "https://github.com/xaos-project/XaoS")
4353 (commit (string-append "release-" version))))
4354 (file-name (git-file-name name version))
4357 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4358 (build-system gnu-build-system)
4359 (native-inputs `(("gettext" ,gettext-minimal)
4361 ("qttools" ,qttools)))
4362 (inputs `(("libx11" ,libx11)
4366 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4367 ;; not enough for this package to install properly. These phases fix that.
4369 `(#:tests? #f ;no "check" target
4371 (modify-phases %standard-phases
4372 (add-before 'configure 'make-qt-deterministic
4374 ;; Make Qt deterministic.
4375 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4378 (lambda* (#:key outputs #:allow-other-keys)
4379 (let ((out (assoc-ref outputs "out")))
4380 ;; The DESTDIR is originally set to install the xaos binary to
4381 ;; the "bin" folder inside the build directory. Setting make
4382 ;; flags doesn't seem to change this.
4383 (substitute* "XaoS.pro"
4385 (string-append "DESTDIR=" out "/bin")))
4386 (substitute* "src/include/config.h"
4387 (("/usr/share/XaoS")
4388 (string-append out "/share/XaoS")))
4390 (add-after 'install 'install-data
4391 (lambda* (#:key outputs #:allow-other-keys)
4392 (let* ((out (assoc-ref outputs "out"))
4393 (share (string-append out "/share")))
4397 (copy-recursively folder
4398 (string-append share "/XaoS/" folder)))
4399 '("catalogs" "examples" "tutorial"))
4400 (install-file "xdg/xaos.png"
4401 (string-append share "/pixmaps"))
4402 (install-file "xdg/xaos.desktop"
4403 (string-append share "/applications")))
4405 (synopsis "Real-time fractal zoomer")
4406 (description "GNU XaoS is a graphical program that generates fractal
4407 patterns and allows you to zoom in and out of them infinitely in a fluid,
4408 continuous manner. It also includes tutorials that help to explain how fractals
4409 are built. It can generate many different fractal types such as the Mandelbrot
4411 (home-page "https://xaos-project.github.io/")
4412 (license license:gpl2+)))
4414 (define-public hypre
4422 (url "https://github.com/LLNL/hypre")
4423 (commit (string-append "v" version))))
4424 (file-name (git-file-name name version))
4426 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4427 (modules '((guix build utils)))
4430 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4431 ;; substitute the release date.
4432 (substitute* "src/utilities/HYPRE_utilities.h"
4433 (("Date Compiled: .*$")
4434 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4436 (build-system gnu-build-system)
4437 (outputs '("out" ; 6.1 MiB of headers and libraries
4438 "doc")) ; 4.8 MiB of documentation
4442 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4443 ("texlive" ,(texlive-union (list texlive-xypic
4445 texlive-latex-hyperref
4447 ("ghostscript" ,ghostscript)))
4449 `(("blas" ,openblas)
4450 ("lapack" ,lapack)))
4452 `(#:modules ((srfi srfi-1)
4453 ,@%gnu-build-system-modules)
4454 #:configure-flags '("--enable-shared"
4462 (modify-phases %standard-phases
4463 (add-before 'build 'set-HOME
4465 ;; FIXME: texlive-union does not find the built
4466 ;; metafonts, so it tries to generate them in HOME.
4467 (setenv "HOME" "/tmp")
4469 (add-before 'configure 'chdir-src
4470 (lambda _ (chdir "src")))
4472 (lambda* (#:key build target configure-flags
4473 #:allow-other-keys #:rest args)
4474 (let* ((configure (assoc-ref %standard-phases 'configure)))
4477 (list #:configure-flags
4478 (cons (string-append
4479 "--host=" (or target build))
4480 configure-flags)))))))
4481 (add-after 'build 'build-docs
4483 (invoke "make" "-Cdocs" "pdf" "html")))
4486 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4487 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4488 (invoke "make" "check" "CHECKRUN=")
4489 (for-each (lambda (filename)
4490 (let ((size (stat:size (stat filename))))
4491 (when (positive? size)
4492 (error (format #f "~a size ~d; error indication~%"
4494 (find-files "test" ".*\\.err$"))
4496 (add-after 'install 'install-docs
4497 (lambda* (#:key outputs #:allow-other-keys)
4498 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4499 (let* ((doc (assoc-ref outputs "doc"))
4500 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4501 (with-directory-excursion "docs"
4502 (for-each (lambda (base)
4503 (install-file (string-append base ".pdf") docdir)
4504 (copy-recursively base docdir)) ; html docs
4505 '("HYPRE_usr_manual"
4506 "HYPRE_ref_manual")))
4508 (home-page "http://www.llnl.gov/casc/hypre/")
4509 (synopsis "Library of solvers and preconditioners for linear equations")
4511 "HYPRE is a software library of high performance preconditioners and
4512 solvers for the solution of large, sparse linear systems of equations. It
4513 features multigrid solvers for both structured and unstructured grid
4515 (license license:lgpl2.1)))
4517 (define-public hypre-openmpi
4518 (package (inherit hypre)
4519 (name "hypre-openmpi")
4522 ,@(package-inputs hypre)))
4524 (substitute-keyword-arguments (package-arguments hypre)
4525 ((#:configure-flags flags)
4527 ,@(delete "--without-MPI" ,flags)))
4529 `(modify-phases ,phases
4530 (add-before 'check 'mpi-setup
4531 ,%openmpi-setup)))))
4532 (synopsis "Parallel solvers and preconditioners for linear equations")
4534 "HYPRE is a software library of high performance preconditioners and
4535 solvers for the solution of large, sparse linear systems of equations on
4536 parallel computers. It features parallel multigrid solvers for both
4537 structured and unstructured grid problems.")))
4539 (define-public matio
4546 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4547 "matio-" version ".tar.gz"))
4550 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4551 (build-system gnu-build-system)
4554 ("hdf5" ,hdf5-1.8)))
4555 (home-page "http://matio.sourceforge.net/")
4556 (synopsis "Library for reading and writing MAT files")
4557 (description "Matio is a library for reading and writing MAT files. It
4558 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4559 (license license:bsd-2)))
4566 (origin (method url-fetch)
4567 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4568 "download/" version "/Vc-" version ".tar.gz"))
4571 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4572 (build-system cmake-build-system)
4575 '("-DBUILD_TESTING=ON"
4576 ;; By default, Vc will optimize for the CPU of the build machine.
4577 ;; Setting this to "none" makes it create portable binaries. See
4578 ;; "cmake/OptimizeForArchitecture.cmake".
4579 "-DTARGET_ARCHITECTURE=none")
4580 #:phases (modify-phases %standard-phases
4581 (add-after 'unpack 'copy-testdata
4582 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4583 (let ((testdata (assoc-ref (or native-inputs inputs)
4585 (copy-recursively testdata "tests/testdata")
4588 `(("virtest" ,virtest)
4590 ;; This is a submodule in the git project, but not part of the
4591 ;; released sources. See the git branch for the commit to take.
4592 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4596 (url "https://github.com/VcDevel/vc-testdata")
4597 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4598 (file-name (git-file-name "vc-testdata"
4599 (string-take commit 7)))
4602 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4603 (synopsis "SIMD vector classes for C++")
4604 (description "Vc provides portable, zero-overhead C++ types for explicitly
4605 data-parallel programming. It is a library designed to ease explicit
4606 vectorization of C++ code. Its types enable explicitly stating data-parallel
4607 operations on multiple values. The parallelism is therefore added via the type
4608 system. Vc has an intuitive API and provides portability between different
4609 compilers and compiler versions as well as portability between different vector
4610 instruction sets. Thus, an application written with Vc can be compiled for:
4613 @item SSE2 up to SSE4.2 or SSE4a
4616 @item NEON (in development)
4617 @item NVIDIA GPUs / CUDA (in development)
4619 (home-page "https://github.com/VcDevel/Vc")
4620 ;; "No support_???.cpp file exists for this architecture."
4621 (supported-systems '("x86_64-linux" "i686-linux"))
4622 (license license:bsd-3)))
4624 (define-public reducelcs
4625 ;; This is the last commit which is available upstream, no
4626 ;; release happened since 2010.
4627 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4631 (version (string-append "1.0-" revision "." (string-take commit 7)))
4636 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4638 (file-name (string-append name "-" version "-checkout"))
4641 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4642 (build-system gnu-build-system)
4644 `(("openlibm" ,openlibm)))
4646 `(#:tests? #f ; no tests
4648 (modify-phases %standard-phases
4649 (delete 'configure) ; No configure script exists.
4650 (replace 'install ; No install phase exists.
4651 (lambda* (#:key outputs #:allow-other-keys)
4652 (let* ((out (assoc-ref outputs "out"))
4653 (bin (string-append out "/bin")))
4654 (install-file "Approximation" bin)
4655 (install-file "CollectResults" bin)
4656 (install-file "GenerateInstances" bin)
4658 (synopsis "Approximate Longest Commons Subsequence computation tool")
4660 "@code{reduceLCS} is an implementation of the Reduce-Expand
4661 algorithm for LCS. It is a fast program to compute the approximate
4662 Longest Commons Subsequence of a set of strings.")
4663 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4664 (license license:gpl3+))))
4666 (define-public jacal
4673 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4676 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4677 (patches (search-patches "jacal-fix-texinfo.patch"))))
4678 (build-system gnu-build-system)
4681 (modify-phases %standard-phases
4682 (add-before 'build 'pre-build
4683 ;; Don't use upstream's script - it really doesn't fit into
4684 ;; Guix's functional paradigm.
4685 (lambda* (#:key inputs outputs #:allow-other-keys)
4686 (substitute* "Makefile"
4687 (("^install: install-script") "install: "))))
4688 (add-after 'install 'post-install
4689 ;; Instead, we provide our own simplified script.
4690 (lambda* (#:key inputs outputs #:allow-other-keys)
4691 (let ((wrapper (string-append (assoc-ref outputs "out")
4693 (format (open wrapper (logior O_WRONLY O_CREAT))
4694 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4695 "-e '(slib:load \"~a/lib/jacal/math\") "
4698 (assoc-ref inputs "scm")
4699 (assoc-ref outputs "out"))
4700 (chmod wrapper #o555))))
4702 (lambda* (#:key outputs #:allow-other-keys)
4703 (invoke "./configure"
4704 (string-append "--prefix="
4705 (assoc-ref outputs "out"))))))))
4706 (inputs `(("scm" ,scm)))
4707 (native-inputs `(("unzip" ,unzip)
4708 ("texinfo" ,texinfo)))
4709 (synopsis "Symbolic mathematics system")
4710 (description "GNU JACAL is an interactive symbolic mathematics program based on
4711 Scheme. It manipulate and simplify a range of mathematical expressions such
4712 as equations, scalars, vectors, and matrices.")
4713 (home-page "https://www.gnu.org/software/jacal/")
4714 (license license:gpl3+)))
4720 (home-page "https://github.com/Z3Prover/z3")
4723 (uri (git-reference (url home-page)
4724 (commit (string-append "z3-" version))))
4725 (file-name (git-file-name name version))
4728 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
4729 (build-system gnu-build-system)
4731 `(#:imported-modules ((guix build python-build-system)
4732 ,@%gnu-build-system-modules)
4733 #:modules (((guix build python-build-system) #:select (site-packages))
4734 (guix build gnu-build-system)
4737 (modify-phases %standard-phases
4738 (add-after 'unpack 'enable-bytecode-determinism
4740 (setenv "PYTHONHASHSEED" "0")
4742 (add-after 'unpack 'fix-compatability
4743 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4745 (substitute* "src/util/mpz.cpp"
4746 (("#include <immintrin.h>") ""))
4748 (add-before 'configure 'bootstrap
4750 (invoke "python" "scripts/mk_make.py")))
4751 ;; work around gnu-build-system's setting --enable-fast-install
4752 ;; (z3's `configure' is a wrapper around the above python file,
4753 ;; which fails when passed --enable-fast-install)
4755 (lambda* (#:key inputs outputs #:allow-other-keys)
4756 (invoke "./configure"
4758 (string-append "--prefix=" (assoc-ref outputs "out"))
4759 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4760 (add-after 'configure 'change-directory
4764 (add-before 'check 'make-test-z3
4766 ;; Build the test suite executable.
4767 (invoke "make" "test-z3" "-j"
4768 (number->string (parallel-job-count)))))
4771 ;; Run all the tests that don't require arguments.
4772 (invoke "./test-z3" "/a"))))))
4775 ("python" ,python-wrapper)))
4776 (synopsis "Theorem prover")
4777 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4778 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4779 (license license:expat)))
4784 (version "2018.11.001")
4787 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4788 version "/elpa-" version ".tar.gz"))
4791 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4792 (build-system gnu-build-system)
4794 `(("fortran" ,gfortran)
4795 ("perl" ,perl))) ;for configure and deps
4797 `(("blas" ,openblas)))
4802 ;; ELPA unfortunately does not support runtime dispatch, so we can
4803 ;; only enable the "generic" kernels. See the "Cross compilation"
4804 ;; section of INSTALL.md.
4806 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4807 "--disable-avx" "--disable-avx2" "--disable-avx512"
4808 ,(string-append "CFLAGS=-O3 "
4809 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4810 "-ftree-vect-loop-version -ftree-vectorize "
4811 ,(let ((system (or (%current-target-system)
4812 (%current-system))))
4814 ((or (string-prefix? "x86_64" system)
4815 (string-prefix? "i686" system))
4818 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4820 (modify-phases %standard-phases
4821 (add-before 'configure 'patch-header-generation
4823 (substitute* "configure"
4824 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4825 (string-append & " CPP=\"$CPP\"")))
4827 (add-before 'check 'setup-tests
4829 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4830 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4831 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4832 ;; for Fortran. This also causes several tests to pass that
4833 ;; otherwise would otherwise fail with matrix size 5000; possibly
4834 ;; due to floating point tolerances that are too tight.
4835 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4836 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4837 (substitute* "Makefile"
4838 ;; Test scripts are generated, patch the shebang
4839 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4841 (home-page "http://elpa.mpcdf.mpg.de")
4842 (synopsis "Eigenvalue solvers for symmetric matrices")
4844 "The ELPA library provides efficient and scalable direct eigensolvers for
4845 symmetric matrices.")
4846 (license license:lgpl3)))
4848 (define-public elpa-openmpi
4849 (package (inherit elpa)
4850 (name "elpa-openmpi")
4853 ("scalapack" ,scalapack)
4854 ,@(package-inputs elpa)))
4856 (substitute-keyword-arguments (package-arguments elpa)
4857 ((#:configure-flags cf '())
4858 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4859 ((#:phases phases '%standard-phases)
4860 `(modify-phases ,phases
4861 (add-before 'check 'mpi-setup
4863 ;; Tests use 2 mpi tasks by default, use our remaining build
4864 ;; cores as OpenMP threads.
4865 (setenv "OMP_NUM_THREADS" (number->string
4866 (max (quotient (parallel-job-count) 2)
4868 (,%openmpi-setup)))))))
4869 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4871 (define-public elemental
4878 (url "https://github.com/elemental/Elemental")
4879 (commit (string-append "v" version))))
4880 (file-name (git-file-name name version))
4883 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4884 (build-system cmake-build-system)
4885 (home-page "https://github.com/elemental/Elemental")
4887 `(("gfortran" ,gfortran)))
4889 `(("blas" ,openblas)
4890 ("gfortran:lib" ,gfortran "lib")
4899 `(#:build-type "Release" ;default RelWithDebInfo not supported
4900 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4901 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4902 "-DEL_CACHE_WARNINGS:BOOL=YES"
4903 "-DEL_TESTS:BOOL=YES"
4904 "-DCMAKE_INSTALL_LIBDIR=lib"
4905 "-DGFORTRAN_LIB=gfortran")
4906 #:phases (modify-phases %standard-phases
4907 (add-before 'check 'mpi-setup
4909 (add-before 'check 'setup-tests
4911 ;; Parallelism is done at the MPI layer.
4912 (setenv "OMP_NUM_THREADS" "1")
4914 (add-after 'install 'remove-tests
4915 (lambda* (#:key outputs #:allow-other-keys)
4916 ;; Tests are installed, with no easy configuration
4917 ;; switch to prevent this, so delete them.
4918 (delete-file-recursively
4919 (string-append (assoc-ref outputs "out") "/bin"))
4921 (synopsis "Dense and sparse-direct linear algebra and optimization")
4922 (description "Elemental is a modern C++ library for distributed-memory
4923 dense and sparse-direct linear algebra, conic optimization, and lattice
4925 (license license:bsd-2)))
4927 (define-public mcrl2
4930 (version "202006.0")
4934 "https://www.mcrl2.org/download/release/mcrl2-"
4938 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4943 ("qtbase" ,qtbase)))
4944 (build-system cmake-build-system)
4945 (synopsis "Toolset for the mCRL2 formal specification language")
4947 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4948 specification language for describing concurrent discrete event systems. Its
4949 toolset supports analysis and automatic verification, linearisation, simulation,
4950 state-space exploration and generation, and tools to optimise and analyse
4951 specifications. Also, state spaces can be manipulated, visualised and
4953 (home-page "https://mcrl2.org")
4954 (license license:boost1.0)))
4956 (define-public mcrl2-minimal
4959 (name "mcrl2-minimal")
4961 `(("boost" ,boost)))
4963 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4965 (define-public tcalc
4972 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4976 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4977 (build-system gnu-build-system)
4978 (synopsis "The terminal calculator")
4980 "The terminal calculator is a small program to help users of the GNU/Linux
4981 terminal do calculations simply and quickly. The formula to be calculated can
4982 be fed to @command{tcalc} through the command line.")
4983 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4984 (license license:gpl3+)))
4986 (define-public sundials
4993 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4994 "sundials-" version ".tar.gz"))
4997 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4998 (build-system cmake-build-system)
5000 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5002 `(("fortran" ,gfortran) ;for fcmix
5004 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5006 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5007 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5008 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5009 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5010 "-DEXAMPLES_INSTALL:BOOL=OFF"
5012 "-DFCMIX_ENABLE:BOOL=ON"
5014 "-DKLU_ENABLE:BOOL=ON"
5015 ,(string-append "-DKLU_INCLUDE_DIR="
5016 (assoc-ref %build-inputs "suitesparse")
5018 ,(string-append "-DKLU_LIBRARY_DIR="
5019 (assoc-ref %build-inputs "suitesparse")
5021 (home-page "https://computation.llnl.gov/projects/sundials")
5022 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5023 (description "SUNDIALS is a family of software packages implemented with
5024 the goal of providing robust time integrators and nonlinear solvers that can
5025 easily be incorporated into existing simulation codes.")
5026 (license license:bsd-3)))
5028 (define-public sundials-openmpi
5029 (package (inherit sundials)
5030 (name "sundials-openmpi")
5033 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5034 ,@(package-inputs sundials)))
5036 (substitute-keyword-arguments (package-arguments sundials)
5037 ((#:configure-flags flags '())
5038 `(cons* "-DMPI_ENABLE:BOOL=ON"
5039 "-DPETSC_ENABLE:BOOL=ON"
5040 (string-append "-DPETSC_INCLUDE_DIR="
5041 (assoc-ref %build-inputs "petsc")
5043 (string-append "-DPETSC_LIBRARY_DIR="
5044 (assoc-ref %build-inputs "petsc")
5047 ((#:phases phases '%standard-phases)
5048 `(modify-phases ,phases
5049 (add-before 'check 'mpi-setup
5050 ,%openmpi-setup)))))
5051 (synopsis "SUNDIALS with OpenMPI support")))
5053 (define-public combinatorial-blas
5055 (name "combinatorial-blas")
5060 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5062 (match (string-split version #\.)
5063 ((major minor patch)
5064 (string-append major minor "_" patch))) ;e.g. "16_2"
5068 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5069 (patches (search-patches "combinatorial-blas-awpm.patch"
5070 "combinatorial-blas-io-fix.patch"))))
5071 (build-system cmake-build-system)
5074 ("test-data" ,(origin
5076 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5077 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5080 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5082 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5083 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5084 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5086 (modify-phases %standard-phases
5087 (add-before 'check 'mpi-setup
5089 (add-before 'check 'test-setup
5090 (lambda* (#:key inputs #:allow-other-keys)
5091 (setenv "OMP_NUM_THREADS" "2")
5092 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5093 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5094 (synopsis "Linear algebra primitives for graph analytics")
5095 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5096 distributed-memory parallel graph library offering a small but powerful set of
5097 linear algebra primitives specifically targeting graph analytics.")
5099 license:gpl2+ ;include/psort/(funnel|sort)*.h
5100 license:x11 ;usort and psort
5101 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5103 (define-public dune-common
5105 (name "dune-common")
5110 (uri (string-append "https://dune-project.org/download/"
5111 version "/dune-common-" version ".tar.gz"))
5114 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
5115 (build-system cmake-build-system)
5118 (modify-phases %standard-phases
5119 (add-after 'build 'build-tests
5120 (lambda* (#:key make-flags #:allow-other-keys)
5121 (apply invoke "make" "build_tests" make-flags))))))
5125 ("openblas" ,openblas)
5127 ("superlu" ,superlu)))
5129 `(("gfortran" ,gfortran)
5130 ("pkg-config" ,pkg-config)))
5131 (home-page "https://dune-project.org/")
5132 (synopsis "Distributed and Unified Numerics Environment")
5133 (description "DUNE, the Distributed and Unified Numerics Environment is a
5134 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5135 grid-based methods. It supports the easy implementation of methods like
5136 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5137 Differences} (FD).")
5138 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
5139 (license license:gpl2)))
5141 (define-public dune-geometry
5143 (name "dune-geometry")
5148 (uri (string-append "https://dune-project.org/download/"
5149 version "/dune-geometry-" version ".tar.gz"))
5152 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
5153 (build-system cmake-build-system)
5156 (modify-phases %standard-phases
5157 (add-after 'build 'build-tests
5158 (lambda* (#:key make-flags #:allow-other-keys)
5159 (apply invoke "make" "build_tests" make-flags))))))
5161 `(("dune-common" ,dune-common)
5163 ("openblas" ,openblas)
5165 ("python" ,python)))
5167 `(("gfortran" ,gfortran)
5168 ("pkg-config" ,pkg-config)))
5169 (home-page "https://dune-project.org/")
5170 (synopsis "Distributed and Unified Numerics Environment")
5171 (description "DUNE, the Distributed and Unified Numerics Environment is a
5172 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5173 grid-based methods. It supports the easy implementation of methods like
5174 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5177 This package contains the basic DUNE geometry classes.")
5178 ;; GPL version 2 with "runtime exception"
5179 (license license:gpl2)))
5181 (define-public dune-uggrid
5183 (name "dune-uggrid")
5189 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5190 (commit (string-append "v" version))))
5191 (file-name (git-file-name name version))
5194 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5195 (build-system cmake-build-system)
5198 (modify-phases %standard-phases
5199 (add-after 'build 'build-tests
5200 (lambda* (#:key make-flags #:allow-other-keys)
5201 (apply invoke "make" "build_tests" make-flags))))))
5203 `(("dune-common" ,dune-common)))
5205 `(("gfortran" ,gfortran)
5206 ("pkg-config" ,pkg-config)))
5207 (home-page "https://dune-project.org/")
5208 (synopsis "Distributed and Unified Numerics Environment")
5209 (description "DUNE, the Distributed and Unified Numerics Environment is a
5210 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5211 grid-based methods. It supports the easy implementation of methods like
5212 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5215 This package contains the DUNE UG grid classes.")
5216 (license license:lgpl2.1)))
5218 (define-public dune-grid
5225 (uri (string-append "https://dune-project.org/download/"
5226 version "/dune-grid-" version ".tar.gz"))
5229 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5230 (build-system cmake-build-system)
5233 (modify-phases %standard-phases
5234 (add-after 'build 'build-tests
5235 (lambda* (#:key make-flags #:allow-other-keys)
5236 (apply invoke "make" "build_tests" make-flags))))))
5238 `(("dune-common" ,dune-common)
5239 ("dune-geometry" ,dune-geometry)
5242 ("openblas" ,openblas)
5243 ("python" ,python)))
5245 `(("dune-uggrid" ,dune-uggrid)))
5247 `(("gfortran" ,gfortran)
5248 ("pkg-config" ,pkg-config)))
5249 (home-page "https://dune-project.org/")
5250 (synopsis "Distributed and Unified Numerics Environment")
5251 (description "DUNE, the Distributed and Unified Numerics Environment is a
5252 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5253 grid-based methods. It supports the easy implementation of methods like
5254 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5257 This package contains the basic DUNE grid classes.")
5258 ;; GPL version 2 with "runtime exception"
5259 (license license:gpl2)))
5261 (define-public dune-istl
5268 (uri (string-append "https://dune-project.org/download/"
5269 version "/dune-istl-" version ".tar.gz"))
5272 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5273 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5274 (build-system cmake-build-system)
5277 (modify-phases %standard-phases
5278 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5279 ;; the stdlib types when the gfortran header is used. Remove gfortran
5280 ;; from CPLUS_INCLUDE_PATH as a workaround.
5281 (add-after 'set-paths 'hide-gfortran
5282 (lambda* (#:key inputs #:allow-other-keys)
5283 (let ((gfortran (assoc-ref inputs "gfortran")))
5284 (setenv "CPLUS_INCLUDE_PATH"
5286 (delete (string-append gfortran "/include/c++")
5287 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5290 (add-after 'build 'build-tests
5291 (lambda* (#:key make-flags #:allow-other-keys)
5292 (apply invoke "make" "build_tests" make-flags))))))
5294 `(("dune-common" ,dune-common)
5297 ("suitesparse" ,suitesparse)
5298 ("superlu" ,superlu)
5299 ("openblas" ,openblas)
5301 ("python" ,python)))
5303 `(("gfortran" ,gfortran)
5304 ("pkg-config" ,pkg-config)))
5305 (home-page "https://dune-project.org/")
5306 (synopsis "Distributed and Unified Numerics Environment")
5307 (description "DUNE, the Distributed and Unified Numerics Environment is a
5308 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5311 This is the iterative solver template library which provides generic sparse
5312 matrix/vector classes and a variety of solvers based on these classes. A
5313 special feature is the use of templates to exploit the recursive block
5314 structure of finite element matrices at compile time. Available solvers
5315 include Krylov methods, (block-) incomplete decompositions and
5316 aggregation-based algebraic multigrid.")
5317 ;; GPL version 2 with "runtime exception"
5318 (license license:gpl2)))
5320 (define-public dune-localfunctions
5322 (name "dune-localfunctions")
5327 (uri (string-append "https://dune-project.org/download/"
5328 version "/dune-localfunctions-" version ".tar.gz"))
5331 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5332 (build-system cmake-build-system)
5335 (modify-phases %standard-phases
5336 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5337 ;; and fails to find the stdlib types when the gfortran header is used.
5338 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5339 (add-after 'set-paths 'hide-gfortran
5340 (lambda* (#:key inputs #:allow-other-keys)
5341 (let ((gfortran (assoc-ref inputs "gfortran")))
5342 (setenv "CPLUS_INCLUDE_PATH"
5344 (delete (string-append gfortran "/include/c++")
5345 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5348 (add-after 'build 'build-tests
5349 (lambda* (#:key make-flags #:allow-other-keys)
5350 (apply invoke "make" "build_tests" make-flags))))))
5352 `(("dune-common" ,dune-common)
5353 ("dune-geometry" ,dune-geometry)
5356 ("superlu" ,superlu)
5359 `(("gfortran" ,gfortran)
5360 ("pkg-config" ,pkg-config)))
5361 (home-page "https://dune-project.org/")
5362 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5363 (description "This DUNE module provides interface and implementation for
5364 shape functions defined on the DUNE reference elements. In addition to the
5365 shape function, interpolation operators and special keys are provided which
5366 can be used to assemble global function spaces on finite-element grids.
5368 This package provides an interface and implementation for shape functions
5369 defined on the DUNE reference elements. In addition to the shape function,
5370 interpolation operators and special keys are provided which can be used to
5371 assemble global function spaces on finite-element grids.")
5372 ;; GPL version 2 with "runtime exception"
5373 (license license:gpl2)))
5375 (define-public dune-alugrid
5377 (name "dune-alugrid")
5378 (version "2.7.0-git-81d35682")
5383 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5384 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5385 (file-name (git-file-name name version))
5388 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5389 (build-system cmake-build-system)
5392 (modify-phases %standard-phases
5393 (add-after 'unpack 'patch-include
5395 (substitute* "dune/alugrid/test/test-alugrid.cc"
5396 (("doc/grids/gridfactory/testgrids")
5397 "doc/dune-grid/grids/gridfactory/testgrids"))
5399 (add-after 'build 'build-tests
5400 (lambda* (#:key inputs make-flags #:allow-other-keys)
5401 (setenv "CPLUS_INCLUDE_PATH"
5402 (string-append (assoc-ref inputs "dune-grid") "/share"))
5403 (apply invoke "make" "build_tests" make-flags))))))
5405 `(("dune-common" ,dune-common)
5406 ("dune-geometry" ,dune-geometry)
5407 ("dune-grid" ,dune-grid)
5410 ("openblas" ,openblas)
5412 ("superlu" ,superlu)
5416 `(("gfortran" ,gfortran)
5417 ("pkg-config" ,pkg-config)))
5418 (home-page "https://dune-project.org/")
5419 (synopsis "Distributed and Unified Numerics Environment")
5420 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5421 implementation of the DUNE grid interface supporting either simplices or
5423 (license license:gpl2+)))
5425 (define-public dune-subgrid
5427 (name "dune-subgrid")
5428 (version "2.7.0-git-2103a363")
5433 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5434 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5435 (file-name (git-file-name name version))
5438 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5439 (build-system cmake-build-system)
5442 (modify-phases %standard-phases
5443 (add-after 'build 'build-tests
5444 (lambda* (#:key make-flags #:allow-other-keys)
5445 (apply invoke "make" "build_tests" make-flags))))))
5447 `(("dune-common" ,dune-common)
5448 ("dune-geometry" ,dune-geometry)
5449 ("dune-grid" ,dune-grid)
5452 ("openblas" ,openblas)
5455 `(("gfortran" ,gfortran)
5456 ("pkg-config" ,pkg-config)))
5457 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5458 (synopsis "Distributed and Unified Numerics Environment")
5459 (description "The dune-subgrid module marks elements of
5460 another hierarchical dune grid. The set of marked elements can then be
5461 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5462 provides the full grid interface including adaptive mesh refinement.")
5463 (license license:gpl2+)))
5465 (define-public dune-typetree
5467 (name "dune-typetree")
5473 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5474 (commit (string-append "v" version))))
5475 (file-name (git-file-name name version))
5478 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5479 (build-system cmake-build-system)
5482 (modify-phases %standard-phases
5483 (add-after 'build 'build-tests
5484 (lambda* (#:key make-flags #:allow-other-keys)
5485 (apply invoke "make" "build_tests" make-flags))))))
5487 `(("dune-common" ,dune-common)
5489 ("openblas" ,openblas)
5492 ("superlu" ,superlu)
5495 `(("gfortran" ,gfortran)
5496 ("pkg-config" ,pkg-config)))
5497 (home-page "https://dune-project.org/")
5498 (synopsis "Distributed and Unified Numerics Environment")
5499 (description "TypeTree is a template library for constructing and
5500 operating on statically typed trees of objects.")
5501 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5502 (license (list license:lgpl3+ license:gpl2))))
5504 (define-public dune-functions
5506 (name "dune-functions")
5512 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5513 (commit (string-append "v" version))))
5514 (file-name (git-file-name name version))
5517 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5518 (build-system cmake-build-system)
5521 (modify-phases %standard-phases
5522 (add-after 'unpack 'disable-failing-tests
5525 ;; unable to load GMSH file in this test
5526 "--exclude-regex gridviewfunctionspacebasistest")
5528 (add-after 'build 'build-tests
5529 (lambda* (#:key make-flags #:allow-other-keys)
5530 (apply invoke "make" "build_tests" make-flags))))))
5532 `(("dune-common" ,dune-common)
5533 ("dune-istl" ,dune-istl)
5534 ("dune-localfunctions" ,dune-localfunctions)
5535 ("dune-grid" ,dune-grid)
5536 ("dune-geometry" ,dune-geometry)
5537 ("dune-typetree" ,dune-typetree)
5538 ("openblas" ,openblas)
5541 ("superlu" ,superlu)
5544 `(("gfortran" ,gfortran)
5545 ("pkg-config" ,pkg-config)))
5546 (home-page "https://dune-project.org/")
5547 (synopsis "Distributed and Unified Numerics Environment")
5548 (description "The dune-functions module provides an abstraction layer for
5549 global finite element functions. Its two main concepts are functions
5550 implemented as callable objects, and bases of finite element spaces.")
5551 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5552 (license (list license:lgpl3+ license:gpl2))))
5554 (define-public dune-pdelab
5556 (name "dune-pdelab")
5557 (version "2.7.0-git-476fe437")
5562 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5563 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5564 (file-name (git-file-name name version))
5567 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5568 (build-system cmake-build-system)
5569 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5571 `(("dune-common" ,dune-common)
5572 ("dune-istl" ,dune-istl)
5573 ("dune-localfunctions" ,dune-localfunctions)
5574 ("dune-geometry" ,dune-geometry)
5575 ("dune-grid" ,dune-grid)
5576 ("dune-typetree" ,dune-typetree)
5577 ("dune-functions" ,dune-functions)
5579 ("openblas" ,openblas)
5583 ("superlu" ,superlu)
5586 `(("gfortran" ,gfortran)
5587 ("pkg-config" ,pkg-config)))
5588 (home-page "https://dune-project.org/")
5589 (synopsis "Differential equations solver toolbox")
5590 (description "PDELab is a partial differential equations solver toolbox
5591 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5592 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5593 (license (list license:lgpl3+ license:gpl2))))
5595 (define add-openmpi-to-dune-package
5596 (let ((dune-package?
5597 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5600 (if (dune-package? p)
5601 (package (inherit p)
5602 (name (string-append (package-name p) "-openmpi"))
5603 (inputs `(,@(package-inputs p)
5604 ("openmpi" ,openmpi)))
5606 (substitute-keyword-arguments (package-arguments p)
5607 ((#:phases phases '%standard-phases)
5608 `(modify-phases ,phases
5609 (add-before 'check 'mpi-setup
5610 ,%openmpi-setup)))))
5611 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5613 (negate dune-package?))))
5615 (define-public dune-common-openmpi
5616 (add-openmpi-to-dune-package dune-common))
5618 (define-public dune-geometry-openmpi
5619 (add-openmpi-to-dune-package dune-geometry))
5621 (define-public dune-istl-openmpi
5622 (add-openmpi-to-dune-package dune-istl))
5624 (define-public dune-typetree-openmpi
5625 (add-openmpi-to-dune-package dune-typetree))
5627 (define-public dune-uggrid-openmpi
5628 (add-openmpi-to-dune-package dune-uggrid))
5630 (define-public dune-grid-openmpi
5631 (add-openmpi-to-dune-package dune-grid))
5633 (define-public dune-alugrid-openmpi
5634 (add-openmpi-to-dune-package dune-alugrid))
5636 (define-public dune-subgrid-openmpi
5637 (add-openmpi-to-dune-package dune-subgrid))
5639 (define-public dune-localfunctions-openmpi
5640 (add-openmpi-to-dune-package dune-localfunctions))
5642 (define-public dune-functions-openmpi
5643 (add-openmpi-to-dune-package dune-functions))
5645 (define-public dune-pdelab-openmpi
5646 (add-openmpi-to-dune-package dune-pdelab))
5648 (define-public mlucas
5656 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5658 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5659 (build-system gnu-build-system)
5661 `(("python2" ,python-2)))
5663 `(#:tests? #f ; no tests
5665 (modify-phases %standard-phases
5669 (call-with-output-file "Makefile"
5671 (format port "CC = gcc
5672 CFLAGS = -O3 ~a -DUSE_THREADS
5673 LDLIBS = -lm -lpthread -lrt
5674 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5676 ,(let ((system (or (%current-target-system)
5677 (%current-system))))
5679 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5683 (lambda* (#:key outputs #:allow-other-keys)
5684 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5685 (install-file "Mlucas" bin)
5686 (install-file "primenet.py" bin))
5688 (home-page "https://www.mersenne.org")
5689 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5690 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5691 numbers in search of a world-record prime. You may use it to test any
5692 suitable number as you wish, but it is preferable that you do so in a
5693 coordinated fashion, as part of the Great Internet Mersenne Prime
5694 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5695 management via the GIMPS project's Primenet server.")
5696 (license license:gpl2+)))
5698 (define-public nauty
5706 "https://pallini.di.uniroma1.it/"
5707 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5709 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5710 (build-system gnu-build-system)
5711 (outputs '("out" "lib"))
5713 `(#:test-target "checks"
5714 #:configure-flags '("--enable-generic") ;prevent -march-native
5716 (modify-phases %standard-phases
5717 ;; Default make target does not build all available
5718 ;; executables. Create them now.
5719 (add-after 'build 'build-extra-programs
5721 (for-each (lambda (target) (invoke "make" target))
5722 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5724 ;; Upstream does not provide any install target.
5726 (lambda* (#:key outputs #:allow-other-keys)
5727 (let* ((out (assoc-ref outputs "out"))
5728 (lib-output (assoc-ref outputs "lib"))
5729 (bin (string-append out "/bin"))
5730 (doc (string-append out "/share/doc/nauty/"))
5731 (include (string-append lib-output "/include/nauty"))
5732 (lib (string-append lib-output "/lib/nauty")))
5733 (for-each (lambda (f) (install-file f bin))
5734 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5735 "bliss2dre" "catg" "checks6" "complg" "converseg"
5736 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5737 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5738 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5739 "gentourng" "gentreeg" "hamheuristic" "labelg"
5740 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5741 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5742 "sumlines" "twohamg" "underlyingg" "vcolg"
5743 "watercluster2" "NRswitchg"))
5744 (for-each (lambda (f) (install-file f include))
5745 (find-files "." "\\.h$"))
5746 (for-each (lambda (f) (install-file f lib))
5747 (find-files "." "\\.a$"))
5748 (for-each (lambda (f) (install-file f doc))
5749 (append '("formats.txt" "README" "schreier.txt")
5750 (find-files "." "\\.pdf$")))))))))
5752 `(("gmp" ,gmp))) ;for sumlines
5753 (home-page "https://pallini.di.uniroma1.it/")
5754 (synopsis "Library for graph automorphisms")
5755 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5756 procedures for computing automorphism groups of graphs and digraphs.
5758 @code{nauty} computes graph information in the form of a set of
5759 generators, the size of the group, and the orbits of the group; it can
5760 also produce a canonical label. The @code{nauty} suite is written in
5761 C and comes with a command-line interface, a collection of
5762 command-line tools, and an Application Programming Interface (API).
5764 This package provides the static libraries required to run programs
5765 compiled against the nauty library.")
5766 (license license:asl2.0)))
5775 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5776 "ftp/releases/" version
5777 "/ppl-" version ".tar.gz"))
5780 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5781 (build-system gnu-build-system)
5787 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5789 "Parma Polyhedra Library for computations with polyhedra")
5791 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5792 especially targeted at applications in the field of analysis and
5793 verification of complex systems. These abstractions include convex
5794 polyhedra, defined as the intersection of a finite number of (open or
5795 closed) halfspaces, each described by a linear inequality (strict or
5796 non-strict) with rational coefficients; some special classes of polyhedra
5797 shapes that offer interesting complexity/precision tradeoffs; and grids
5798 which represent regularly spaced points that satisfy a set of linear
5799 congruence relations. The library also supports finite powersets and
5800 products of (any kind of) polyhedra and grids, a mixed integer linear
5801 programming problem solver using an exact-arithmetic version of the simplex
5802 algorithm, a parametric integer programming solver, and primitives for
5803 termination analysis via the automatic synthesis of linear ranking
5805 (license license:gpl3+)))
5807 (define-public speedcrunch
5809 (name "speedcrunch")
5815 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5816 (commit (string-append "release-" version))))
5817 (file-name (git-file-name name version))
5820 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5821 (build-system cmake-build-system)
5822 (inputs `(("qtbase" ,qtbase)))
5823 (native-inputs `(("qttools" ,qttools)))
5826 (modify-phases %standard-phases
5827 (add-after 'unpack 'chdir-to-src
5828 (lambda _ (chdir "src") #t)))))
5829 (synopsis "High-precision scientific calculator")
5831 "SpeedCrunch is a high-precision scientific calculator. It features a
5832 syntax-highlighted scrollable display and is designed to be fully used via
5833 keyboard. Some distinctive features are auto-completion of functions and
5834 variables, a formula book, and quick insertion of constants from various
5835 fields of knowledge.")
5836 (home-page "https://speedcrunch.org/")
5837 (license license:gpl2+)))
5839 (define-public minisat
5840 ;; This is the last commit which is available upstream, no
5841 ;; release happened since 2010.
5842 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5846 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5851 (url "https://github.com/niklasso/minisat")
5853 (file-name (string-append name "-" version "-checkout"))
5856 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5858 (search-patches "minisat-friend-declaration.patch"
5859 "minisat-install.patch"))))
5860 (build-system gnu-build-system)
5862 '(#:make-flags (list (string-append "prefix=" %output))
5863 #:tests? #f ;no check target
5865 (modify-phases %standard-phases
5866 (delete 'configure))))
5868 `(("zlib:static" ,zlib "static")
5871 "Small, yet efficient, SAT solver")
5873 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5874 researchers and developers alike to get started on SAT.")
5876 "http://minisat.se/MiniSat.html")
5877 (license license:expat))))
5879 (define-public libqalculate
5881 (name "libqalculate")
5887 (url "https://github.com/Qalculate/libqalculate/")
5888 (commit (string-append "v" version))))
5889 (file-name (git-file-name name version))
5891 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5893 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5894 (build-system gnu-build-system)
5896 `(("pkg-config" ,pkg-config)
5897 ("gettext" ,gettext-minimal)
5898 ("intltool" ,intltool)
5899 ("automake" ,automake)
5900 ("autoconf" ,autoconf)
5901 ("libtool" ,libtool)
5902 ("doxygen" ,doxygen)
5907 ("libxml2" ,libxml2)
5910 ("gnuplot" ,gnuplot)
5911 ("readline" ,readline)
5912 ("libiconv" ,libiconv)))
5915 (modify-phases %standard-phases
5916 (add-before 'bootstrap 'setenv
5917 ;; Prevent the autogen.sh script to carry out the configure
5918 ;; script, which has not yet been patched to replace /bin/sh.
5920 (setenv "NOCONFIGURE" "TRUE")
5922 (home-page "https://qalculate.github.io/")
5923 (synopsis "Multi-purpose cli desktop calculator and library")
5925 "Libqalculate is a multi-purpose cli desktop calculator and library.
5926 It provides basic and advanced functionality. Features include customizable
5927 functions, unit calculations, and conversions, physical constants, symbolic
5928 calculations (including integrals and equations), arbitrary precision,
5929 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5931 (license license:gpl2+)))
5933 (define-public qalculate-gtk
5935 (name "qalculate-gtk")
5941 (url "https://github.com/Qalculate/qalculate-gtk/")
5942 (commit (string-append "v" version))))
5943 (file-name (git-file-name name version))
5945 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5946 (build-system glib-or-gtk-build-system)
5948 `(("pkg-config" ,pkg-config)
5949 ("intltool" ,intltool)
5950 ("automake" ,automake)
5951 ("autoconf" ,autoconf)
5952 ("libtool" ,libtool)
5957 ("libqalculate" ,libqalculate)
5958 ("libxml2" ,libxml2)
5963 (modify-phases %standard-phases
5964 (add-before 'bootstrap 'setenv
5965 ;; Prevent the autogen.sh script to carry out the configure
5966 ;; script, which has not yet been patched to replace /bin/sh.
5968 (setenv "NOCONFIGURE" "TRUE")
5970 (add-before 'check 'add-pot-file
5971 ;; the file contains translations and are currently not in use
5972 ;; left out on purpose so add it to POTFILES.skip
5974 (with-output-to-file "po/POTFILES.skip"
5976 (format #t "data/shortcuts.ui~%")
5979 (home-page "https://qalculate.github.io/")
5980 (synopsis "Multi-purpose graphical desktop calculator")
5982 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5983 multi-purpose GUI desktop calculator. It provides basic and advanced
5984 functionality. Features include customizable functions, unit calculations,
5985 and conversions, physical constants, symbolic calculations (including
5986 integrals and equations), arbitrary precision, uncertainty propagation,
5987 interval arithmetic, plotting.")
5988 (license license:gpl2+)))