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>
44 ;;; This file is part of GNU Guix.
46 ;;; GNU Guix is free software; you can redistribute it and/or modify it
47 ;;; under the terms of the GNU General Public License as published by
48 ;;; the Free Software Foundation; either version 3 of the License, or (at
49 ;;; your option) any later version.
51 ;;; GNU Guix is distributed in the hope that it will be useful, but
52 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
53 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 ;;; GNU General Public License for more details.
56 ;;; You should have received a copy of the GNU General Public License
57 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
59 (define-module (gnu packages maths)
60 #:use-module (ice-9 regex)
61 #:use-module (ice-9 match)
62 #:use-module (gnu packages)
63 #:use-module ((guix licenses) #:prefix license:)
64 #:use-module (guix packages)
65 #:use-module (guix download)
66 #:use-module (guix git-download)
67 #:use-module (guix utils)
68 #:use-module ((guix build utils) #:select (alist-replace))
69 #:use-module (guix build-system cmake)
70 #:use-module (guix build-system glib-or-gtk)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system python)
73 #:use-module (guix build-system ruby)
74 #:use-module (gnu packages algebra)
75 #:use-module (gnu packages audio)
76 #:use-module (gnu packages autotools)
77 #:use-module (gnu packages base)
78 #:use-module (gnu packages bison)
79 #:use-module (gnu packages boost)
80 #:use-module (gnu packages check)
81 #:use-module (gnu packages cmake)
82 #:use-module (gnu packages compression)
83 #:use-module (gnu packages curl)
84 #:use-module (gnu packages cyrus-sasl)
85 #:use-module (gnu packages dbm)
86 #:use-module (gnu packages documentation)
87 #:use-module (gnu packages elf)
88 #:use-module (gnu packages file)
89 #:use-module (gnu packages flex)
90 #:use-module (gnu packages fltk)
91 #:use-module (gnu packages fontutils)
92 #:use-module (gnu packages gettext)
93 #:use-module (gnu packages gcc)
94 #:use-module (gnu packages gd)
95 #:use-module (gnu packages ghostscript)
96 #:use-module (gnu packages glib)
97 #:use-module (gnu packages graphviz)
98 #:use-module (gnu packages gtk)
99 #:use-module (gnu packages icu4c)
100 #:use-module (gnu packages image)
101 #:use-module (gnu packages java)
102 #:use-module (gnu packages less)
103 #:use-module (gnu packages lisp)
104 #:use-module (gnu packages linux)
105 #:use-module (gnu packages logging)
106 #:use-module (gnu packages lua)
107 #:use-module (gnu packages gnome)
108 #:use-module (gnu packages guile)
109 #:use-module (gnu packages xorg)
110 #:use-module (gnu packages gl)
111 #:use-module (gnu packages imagemagick)
112 #:use-module (gnu packages m4)
113 #:use-module (gnu packages mpi)
114 #:use-module (gnu packages multiprecision)
115 #:use-module (gnu packages netpbm)
116 #:use-module (gnu packages onc-rpc)
117 #:use-module (gnu packages pcre)
118 #:use-module (gnu packages popt)
119 #:use-module (gnu packages perl)
120 #:use-module (gnu packages pkg-config)
121 #:use-module (gnu packages pulseaudio)
122 #:use-module (gnu packages python)
123 #:use-module (gnu packages python-web)
124 #:use-module (gnu packages python-xyz)
125 #:use-module (gnu packages qt)
126 #:use-module (gnu packages readline)
127 #:use-module (gnu packages ruby)
128 #:use-module (gnu packages tbb)
129 #:use-module (gnu packages scheme)
130 #:use-module (gnu packages shells)
131 #:use-module (gnu packages tcl)
132 #:use-module (gnu packages texinfo)
133 #:use-module (gnu packages tex)
134 #:use-module (gnu packages tls)
135 #:use-module (gnu packages version-control)
136 #:use-module (gnu packages wxwidgets)
137 #:use-module (gnu packages xml)
138 #:use-module (srfi srfi-1))
146 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
148 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
149 (build-system gnu-build-system)
150 (inputs `(("gtk+" ,gtk+)
151 ("libxml2" ,libxml2)))
152 (native-inputs `(("pkg-config" ,pkg-config)))
153 (synopsis "Natural deduction first-order logic interface")
154 (description "Aris is a program for performing logical proofs. It supports
155 propositional and predicate logic, as well as Boolean algebra and
156 arithmetical logic. In addition to its predefined inference and equivalence
157 rules, Aris also supports references to older proofs. Its use of standard
158 logical symbols and its natural deduction interface make it easy to use for
160 (license license:gpl3+)
161 (home-page "https://www.gnu.org/software/aris/")))
163 (define-public c-graph
169 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
172 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
173 (build-system gnu-build-system)
175 `(("fortran" ,gfortran)))
176 (synopsis "Visualizing and demonstrating convolution")
178 "GNU C-Graph is a tool for demonstrating the theory of convolution.
179 Thus, it can serve as an excellent aid to students of signal and systems
180 theory in visualizing the convolution process. Rather than forcing the
181 student to write code, the program offers an intuitive interface with
182 interactive dialogs to guide them.")
183 (license license:gpl3+)
184 (home-page "https://www.gnu.org/software/c-graph/")))
193 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
194 version "/coda-" version ".tar.gz"))
196 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
197 (patches (search-patches "coda-use-system-libs.patch"))
198 (modules '((guix build utils)))
200 ;; Make sure we don't use the bundled software.
202 (for-each (lambda (d)
203 (delete-file-recursively (string-append "libcoda/" d)))
204 '("zlib" "pcre" "expat"))
207 `(("fortran" ,gfortran)
209 ("python-numpy" ,python-numpy)))
216 (build-system gnu-build-system)
218 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
219 "LIBS= -lz -lpcre -lexpat")))
220 (synopsis "A common interface to various earth observation data formats")
222 "The Common Data Access toolbox (CODA) provides a set of interfaces for
223 reading remote sensing data from earth observation data files. It consists of
224 command line applications and interfaces to the C, Fortran, Python, and Java
225 programming languages.")
226 (home-page "https://stcorp.nl/coda")
227 (license license:gpl2+)))
235 (uri (string-append "http://www.qhull.org/download/qhull-"
236 (car (string-split version #\.))
240 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
241 (build-system cmake-build-system)
242 (synopsis "Calculate convex hulls and related structures")
244 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
245 diagram, halfspace intersection about a point, furthest-site Delaunay
246 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
247 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
248 algorithm for computing the convex hull. It handles roundoff errors from
249 floating point arithmetic. It computes volumes, surface areas, and
250 approximations to the convex hull.
252 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
253 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
254 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
256 (home-page "http://qhull.org")
257 (license (license:non-copyleft "file://COPYING.txt"
258 "See COPYING in the distribution."))))
260 (define-public python-cvxopt
262 (name "python-cvxopt")
267 (url "https://github.com/cvxopt/cvxopt")
269 (file-name (git-file-name name version))
272 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
273 (build-system python-build-system)
276 (modify-phases %standard-phases
277 (add-after 'unpack 'find-libraries
278 (lambda* (#:key inputs #:allow-other-keys)
279 (setenv "CVXOPT_BLAS_LIB" "openblas")
280 (setenv "CVXOPT_BUILD_FFTW" "1")
281 (setenv "CVXOPT_BUILD_GLPK" "1")
282 (setenv "CVXOPT_BUILD_GSL" "1")
289 ("openblas" ,openblas)
290 ("suitesparse" ,suitesparse)))
291 (home-page "https://www.cvxopt.org")
292 (synopsis "Python library for convex optimization")
294 "CVXOPT is a package for convex optimization based on the Python
295 programming language. Its main purpose is to make the development of software
296 for convex optimization applications straightforward by building on Python’s
297 extensive standard library and on the strengths of Python as a high-level
298 programming language.")
299 (license license:gpl3+)))
301 (define-public python2-cvxopt
302 (package-with-python2 python-cvxopt))
310 (uri (string-append "mirror://gnu/units/units-" version
313 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
314 (build-system gnu-build-system)
316 `(("readline" ,readline)
317 ("python" ,python-wrapper) ;for 'units_cur' script
318 ("python-requests" ,python-requests)))
320 `(#:phases (modify-phases %standard-phases
321 (add-after 'install 'wrap-units_cur
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let* ((out (assoc-ref outputs "out"))
324 (bin (string-append out "/bin")))
325 (wrap-program (string-append bin "/units_cur")
326 `("PYTHONPATH" ":" prefix
327 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
329 (synopsis "Conversion between thousands of scales")
331 "GNU Units converts numeric quantities between units of measure. It
332 can handle scale changes through adaptive usage of standard scale
333 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
334 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
335 enough to be used effectively as a scientific calculator.")
336 (license license:gpl3+)
337 (home-page "https://www.gnu.org/software/units/")))
339 (define-public double-conversion
341 (name "double-conversion")
343 (home-page "https://github.com/google/double-conversion")
346 (uri (git-reference (url home-page)
347 (commit (string-append "v" version))))
348 (file-name (git-file-name name version))
351 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
352 (build-system cmake-build-system)
354 '(#:test-target "test"
355 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
356 "-DBUILD_TESTING=ON")))
357 (synopsis "Conversion routines for IEEE doubles")
359 "The double-conversion library provides binary-decimal and decimal-binary
360 routines for IEEE doubles. The library consists of efficient conversion
361 routines that have been extracted from the V8 JavaScript engine.")
362 (license license:bsd-3)))
364 (define-public dionysus
370 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
374 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
375 (build-system gnu-build-system)
376 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
377 (synopsis "Local search for universal constants and scientific values")
379 "GNU Dionysus is a convenient system for quickly retrieving the values of
380 mathematical constants used in science and engineering. Values can be
381 searched using a simple command-line tool, choosing from three databases:
382 universal constants, atomic numbers, and constants related to
384 (license license:gpl3+)
385 (home-page "https://www.gnu.org/software/dionysus/")))
396 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
397 "dSFMT-src-" version ".tar.gz"))
400 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
401 (modules '((guix build utils)))
402 ;; Don't distribute html documentation with bundled jquery.
405 (delete-file-recursively "html") #t))
406 ;; Add patches borrowed from Julia.
412 "https://raw.githubusercontent.com/JuliaLang/julia/"
413 "v1.3.0/deps/patches/dSFMT.c.patch"))
415 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
416 (file-name "dSFMT.c.patch"))
420 "https://raw.githubusercontent.com/JuliaLang/julia/"
421 "v1.3.0/deps/patches/dSFMT.h.patch"))
423 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
424 (file-name "dSFMT.h.patch"))))))
425 (build-system gnu-build-system)
428 (modify-phases %standard-phases
429 (delete 'configure) ; no configure script
431 ;; Upstream Makefile does not build a shared library. Borrow from Julia
432 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
435 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
436 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
437 "-O3" "-finline-functions" "-fomit-frame-pointer"
438 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
439 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
440 "-o" "libdSFMT.so")))
441 (replace 'install ; no "install" target
442 (lambda* (#:key outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (lib (string-append out "/lib"))
445 (inc (string-append out "/include"))
446 (doc (string-append out "/share/doc/" ,name "-" ,version)))
447 (install-file "libdSFMT.so" lib)
448 (install-file "dSFMT.h" inc)
449 (install-file "LICENSE.txt" doc)
451 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
453 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
454 the expensive conversion of integer to double (floating point). dSFMT directly
455 generates double precision floating point pseudorandom numbers which have the
456 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
457 format. dSFMT is only available on the CPUs which use IEEE 754 format double
458 precision floating point numbers.")
459 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
460 (license license:bsd-3)))
468 (uri (string-append "mirror://gnu/gsl/gsl-"
472 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
473 (build-system gnu-build-system)
475 (let ((system (%current-system)))
477 ((or (string-prefix? "aarch64" system)
478 (string-prefix? "powerpc" system))
479 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
480 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
481 '(#:phases (modify-phases %standard-phases
482 (add-before 'check 'disable-failing-tests
484 (substitute* "spmatrix/test.c"
485 ((".*test_complex.*") "\n"))
487 ((string-prefix? "i686" system)
488 ;; There are rounding issues with these tests on i686:
489 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
490 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
491 '(#:phases (modify-phases %standard-phases
492 (add-before 'check 'disable-failing-tests
494 (substitute* "linalg/test.c"
495 ((".*gsl_test\\(test_LU_decomp.*") "\n")
496 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
497 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
498 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
499 (substitute* "spmatrix/test.c"
500 ((".*test_all.*") "\n")
501 ((".*test_float.*") "\n")
502 ((".*test_complex.*") "\n"))
505 (home-page "https://www.gnu.org/software/gsl/")
506 (synopsis "Numerical library for C and C++")
508 "The GNU Scientific Library is a library for numerical analysis in C
509 and C++. It includes a wide range of mathematical routines, with over 1000
510 functions in total. Subject areas covered by the library include:
511 differential equations, linear algebra, Fast Fourier Transforms and random
513 (license license:gpl3+)))
523 (url "https://github.com/shibatch/sleef")
525 (file-name (git-file-name name version))
527 (base32 "1gvf7cfvszmgjrsqivwmyy1jnp3hy80dmszxx827lhjz8yqq5019"))))
528 (build-system cmake-build-system)
530 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
531 (string-append "-DCMAKE_INSTALL_LIBDIR="
532 (assoc-ref %outputs "out")
534 (string-append "-DCMAKE_INSTALL_PREFIX="
535 (assoc-ref %outputs "out")))
537 (modify-phases %standard-phases
538 ;; SLEEF generates a header library during the build process and writes
539 ;; to it via shell redirection. Make the checkout writable so the
540 ;; build can succeed.
541 (add-after 'unpack 'make-git-checkout-writable
543 (for-each make-file-writable (find-files "."))
549 ("openssl" ,openssl)))
550 (home-page "https://sleef.org/")
551 (synopsis "SIMD library for evaluating elementary functions and DFT")
553 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
554 implements vectorized versions of all C99 real floating point math functions.
555 It can utilize SIMD instructions that are available on modern processors.")
556 (license (list license:boost1.0 ;sleef
557 license:cc-by4.0)))) ;simplex algorithm
566 (uri (string-append "mirror://gnu/glpk/glpk-"
570 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
571 (build-system gnu-build-system)
575 `(#:configure-flags '("--with-gmp")))
576 (home-page "https://www.gnu.org/software/glpk/")
577 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
579 "GLPK is a C library for solving large-scale linear programming (LP),
580 mixed integer programming (MIP), and other related problems. It supports the
581 GNU MathProg modeling language, a subset of the AMPL language, and features a
582 translator for the language. In addition to the C library, a stand-alone
583 LP/MIP solver is included in the package.")
584 (license license:gpl3+)))
593 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
595 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
597 "/4ti2-" version ".tar.gz"))
599 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
600 (build-system gnu-build-system)
602 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
606 (home-page "http://www.4ti2.de/")
607 (synopsis "Mathematical tool suite for problems on linear spaces")
609 "4ti2 implements algorithms for solving algebraic, geometric and
610 combinatorial problems on linear spaces. Among others, it solves systems
611 of linear equations, computes extreme rays of polyhedral cones, solves
612 integer programming problems and computes Markov bases for statistics.")
613 (license license:gpl2+)))
615 (define-public cddlib
622 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
623 (string-delete #\. version) ".tar.gz"))
626 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
627 (build-system gnu-build-system)
630 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
631 (synopsis "Library for convex hulls and extreme rays of polyhedra")
633 "The C-library cddlib implements the Double Description Method of
634 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
635 rays of a general convex polyhedron given by a system of linear inequalities
636 in arbitrary dimension. It can also be used for the converse operation of
637 computing convex hulls.")
638 (license license:gpl2+)))
640 (define-public lrslib
647 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
649 (string-delete #\. version) ".tar.gz"))
652 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
653 (build-system gnu-build-system)
657 `(#:tests? #f ; no check phase
658 #:make-flags `("CC=gcc"
659 ,(string-append "prefix=" (assoc-ref %outputs "out"))
662 (modify-phases %standard-phases
665 (substitute* "makefile"
666 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
668 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
669 (synopsis "Convex hulls of polyhedra with exact arithmetic")
671 "The C code of lrslib implements the reverse search algorithm for
672 vertex enumeration and convex hull problems. Its input file format is
673 compatible with cddlib. All computations are done exactly in either
674 multiple precision or fixed integer arithmetic. Output is not stored
675 in memory, so even problems with very large output sizes can sometimes
677 (license license:gpl2+)))
686 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
687 "vinci/vinci-" version ".tar.gz"))
690 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
691 (build-system gnu-build-system)
693 `(("lrslib" ,lrslib)))
695 `(#:tests? #f ; no check phase
697 (modify-phases %standard-phases
699 ;; register the lrs location in the config file
700 (lambda* (#:key inputs #:allow-other-keys)
701 (let* ((lrs (assoc-ref inputs "lrslib"))
702 (lrsexec (string-append lrs "/bin/lrs")))
703 (substitute* "vinci.h"
704 (("#define LRS_EXEC \"lrs\"")
705 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
708 (lambda* (#:key outputs #:allow-other-keys)
709 (let* ((out (assoc-ref outputs "out"))
710 (bin (string-append out "/bin")))
711 (install-file "vinci" bin))
714 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
715 (synopsis "Volume computation for polytopes")
717 "Vinci implements a number of volume computation algorithms for convex
718 polytopes in arbitrary dimension. The polytopes can be given by their
719 V-representation (as the convex hull of a finite number of vertices), by
720 their H-representation (as the bounded intersection of a finite number of
721 halfspaces) or by their double description with both representations.")
722 (license license:gpl2+)))
724 (define-public arpack-ng
728 (home-page "https://github.com/opencollab/arpack-ng")
731 (uri (git-reference (url home-page) (commit version)))
732 (file-name (git-file-name name version))
735 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
736 (build-system gnu-build-system)
738 `(("autoconf" ,autoconf)
739 ("automake" ,automake)
740 ("libtool" ,libtool)))
743 ("fortran" ,gfortran)))
744 (synopsis "Fortran subroutines for solving eigenvalue problems")
746 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
747 large scale eigenvalue problems.")
748 (license (license:non-copyleft "file://COPYING"
749 "See COPYING in the distribution."))))
751 (define-public arpack-ng-3.3.0
755 (name (package-name arpack-ng))
756 (home-page (package-home-page arpack-ng))
760 (uri (string-append home-page "/archive/" version ".tar.gz"))
761 (file-name (string-append name "-" version ".tar.gz"))
764 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
766 (define-public arpack-ng-openmpi
767 (package (inherit arpack-ng)
768 (name "arpack-ng-openmpi")
771 ,@(package-inputs arpack-ng)))
773 (substitute-keyword-arguments (package-arguments arpack-ng)
774 ((#:configure-flags _ '())
776 ((#:phases phases '%standard-phases)
777 `(modify-phases ,phases
778 (add-before 'check 'mpi-setup
780 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
782 (define-public lapack
789 (uri (string-append "http://www.netlib.org/lapack/lapack-"
793 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
794 (build-system cmake-build-system)
795 (home-page "http://www.netlib.org/lapack/")
796 (inputs `(("fortran" ,gfortran)
797 ("python" ,python-wrapper)))
799 `(#:configure-flags (list
800 "-DBUILD_SHARED_LIBS:BOOL=YES"
802 ;; Build the 'LAPACKE_clatms' functions.
803 "-DLAPACKE_WITH_TMG=ON"
804 "-DBUILD_TESTING=ON")))
805 (synopsis "Library for numerical linear algebra")
807 "LAPACK is a Fortran 90 library for solving the most commonly occurring
808 problems in numerical linear algebra.")
809 (license (license:non-copyleft "file://LICENSE"
810 "See LICENSE in the distribution."))))
812 (define-public clapack
819 (uri (string-append "http://www.netlib.org/clapack/clapack-"
820 version "-CMAKE.tgz"))
823 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
824 (build-system cmake-build-system)
827 (modify-phases %standard-phases
828 ;; These tests use a lot of stack variables and segfault without
829 ;; lifting resource limits.
830 (add-after 'unpack 'disable-broken-tests
832 (substitute* "TESTING/CMakeLists.txt"
833 (("add_lapack_test.* xeigtstz\\)") ""))
836 (lambda* (#:key outputs #:allow-other-keys)
837 (let* ((out (assoc-ref outputs "out"))
838 (libdir (string-append out "/lib"))
839 (f2cinc (string-append out "/include/libf2c")))
842 (for-each (lambda (file)
843 (install-file file libdir))
845 "F2CLIBS/libf2c/libf2c.a"
846 "TESTING/MATGEN/libtmglib.a"
847 "BLAS/SRC/libblas.a"))
848 (for-each (lambda (file)
849 (install-file file f2cinc))
850 (cons "F2CLIBS/libf2c/arith.h"
851 (find-files (string-append "../clapack-"
852 ,version "-CMAKE/F2CLIBS/libf2c")
854 (copy-recursively (string-append "../clapack-"
855 ,version "-CMAKE/INCLUDE")
856 (string-append out "/include"))
858 (home-page "https://www.netlib.org/clapack/")
859 (synopsis "Numerical linear algebra library for C")
861 "The CLAPACK library was built using a Fortran to C conversion utility
862 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
863 C code, and then modified to improve readability. CLAPACK's goal is to
864 provide LAPACK for someone who does not have access to a Fortran compiler.")
865 (license (license:non-copyleft "file://LICENSE"
866 "See LICENSE in the distribution."))))
868 (define-public scalapack
875 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
879 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
880 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
881 (build-system cmake-build-system)
884 ("fortran" ,gfortran)
885 ("lapack" ,lapack))) ;for testing only
887 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
888 #:phases (modify-phases %standard-phases
889 (add-before 'check 'mpi-setup
891 (home-page "http://www.netlib.org/scalapack/")
892 (synopsis "Library for scalable numerical linear algebra")
894 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
895 routines on parallel distributed memory machines. ScaLAPACK solves dense and
896 banded linear systems, least squares problems, eigenvalue problems, and
897 singular value problems.")
898 (license (license:non-copyleft "file://LICENSE"
899 "See LICENSE in the distribution."))))
901 (define-public gnuplot
907 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
911 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
912 (build-system gnu-build-system)
913 (inputs `(("readline" ,readline)
919 `(("pkg-config" ,pkg-config)
920 ("texlive" ,texlive-tiny)))
921 (arguments `(#:configure-flags (list (string-append
922 "--with-texdir=" %output
923 "/texmf-local/tex/latex/gnuplot"))))
924 (home-page "http://www.gnuplot.info")
925 (synopsis "Command-line driven graphing utility")
926 (description "Gnuplot is a portable command-line driven graphing
927 utility. It was originally created to allow scientists and students to
928 visualize mathematical functions and data interactively, but has grown to
929 support many non-interactive uses such as web scripting. It is also used as a
930 plotting engine by third-party applications like Octave.")
931 ;; X11 Style with the additional restriction that derived works may only be
932 ;; distributed as patches to the original.
933 (license (license:fsf-free
934 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
944 (url "https://github.com/OkoSanto/GCTP")
945 (commit (string-append "v" version))))
946 (file-name (git-file-name name version))
948 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
950 `(("fortran" ,gfortran)))
951 (build-system gnu-build-system)
952 (synopsis "General Cartographic Transformation Package (GCTP)")
954 "The General Cartographic Transformation Package (GCTP) is a system of
955 software routines designed to permit the transformation of coordinate pairs
956 from one map projection to another. The GCTP is the standard computer
957 software used by the National Mapping Division for map projection
959 (home-page "https://github.com/OkoSanto/GCTP")
960 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
969 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
970 version "/src/hdf-" version ".tar.bz2"))
972 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
973 (patches (search-patches "hdf4-architectures.patch"
974 "hdf4-reproducibility.patch"
975 "hdf4-shared-fortran.patch"
976 "hdf4-tirpc.patch"))))
977 (build-system gnu-build-system)
979 `(("gfortran" ,gfortran)
984 ("libjpeg" ,libjpeg-turbo)
985 ("libtirpc" ,libtirpc)))
987 `(#:parallel-tests? #f
988 #:configure-flags (list "--enable-shared"
989 (string-append "CPPFLAGS=-I"
990 (assoc-ref %build-inputs "libtirpc")
993 (modify-phases %standard-phases
994 ;; This is inspired by two of Debian's patches.
995 (add-before 'configure 'add-more-aarch64-support
997 (substitute* '("mfhdf/ncgen/ncgen.l"
998 "mfhdf/ncgen/ncgenyy.c"
999 "mfhdf/libsrc/netcdf.h.in")
1000 (("AIX5L64") "__aarch64__"))
1002 (add-before 'configure 'patchbuild
1005 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1007 (("/bin/mkdir") "mkdir"))
1008 (substitute* (find-files "." "^Makefile\\.in$")
1009 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1010 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1011 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1012 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1013 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1015 (add-after 'configure 'patch-settings
1017 ;; libhdf4.settings contains the full path of the
1018 ;; compilers used, and its contents are included in
1019 ;; .so-files. We truncate the hashes to avoid
1020 ;; unnecessary store references to those compilers:
1021 (substitute* "libhdf4.settings"
1022 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1023 (string-append prefix (string-take hash 10) "...")))
1025 (add-after 'install 'provide-absolute-libjpeg-reference
1026 (lambda* (#:key inputs outputs #:allow-other-keys)
1027 (let ((out (assoc-ref outputs "out"))
1028 (libjpeg (assoc-ref inputs "libjpeg")))
1029 ;; libjpeg-turbo does not provide a .la file, so libtool is
1030 ;; unable to add an absolute reference for -ljpeg in the .la
1031 ;; files. Fix it manually to avoid having to propagate it.
1032 (substitute* (find-files (string-append out "/lib") "\\.la$")
1034 (string-append "-L" libjpeg "/lib -ljpeg")))
1036 (home-page "https://www.hdfgroup.org/products/hdf4/")
1038 "Library and multi-object file format for storing and managing data")
1039 (description "HDF4 is a library and multi-object file format for storing
1040 and managing data between machines. HDF4 is an older hierarchical data format,
1041 incompatible with HDF5.")
1043 (license:non-copyleft
1044 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1046 (define-public hdf4-alt
1051 (substitute-keyword-arguments (package-arguments hdf4)
1052 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1054 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1063 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1064 "hdf5-" (version-major+minor version)
1065 "/hdf5-" version "/src/hdf5-"
1067 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1069 (match (string-split version #\.)
1070 ((major minor _ ...)
1071 (string-append major minor)))
1072 "/src/hdf5-" version ".tar.bz2")))
1074 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1075 (patches (search-patches "hdf5-config-date.patch"
1076 "hdf5-1.8-mpi-deprecations.patch"))))
1077 (build-system gnu-build-system)
1081 `(("gfortran" ,gfortran)
1082 ("perl" ,perl))) ;part of the test machinery needs Perl
1083 (outputs '("out" ; core library
1084 "fortran")) ; fortran interface
1086 `(;; Some of the users, notably Flann, need the C++ interface.
1087 #:configure-flags '("--enable-cxx"
1089 "--enable-fortran2003"
1091 ;; Build a thread-safe library. Unfortunately,
1092 ;; 'configure' invites you to either turn off C++,
1093 ;; Fortran, and the high-level interface (HL), or
1094 ;; to pass '--enable-unsupported'. Debian
1095 ;; packagers chose to pass '--enable-unsupported'
1096 ;; and we follow their lead here.
1097 "--enable-threadsafe"
1099 "--enable-unsupported")
1100 ;; Use -fPIC to allow the R bindings to link with the static libraries
1101 #:make-flags (list "CFLAGS=-fPIC"
1104 (modify-phases %standard-phases
1105 (add-before 'configure 'patch-configure
1106 (lambda* (#:key outputs #:allow-other-keys)
1107 (substitute* "configure"
1109 (substitute* "fortran/src/Makefile.in"
1110 (("libhdf5_fortran_la_LDFLAGS =")
1111 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1112 (assoc-ref outputs "fortran") "/lib")))
1113 (substitute* "hl/fortran/src/Makefile.in"
1114 (("libhdf5hl_fortran_la_LDFLAGS =")
1115 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1116 (assoc-ref outputs "fortran") "/lib")))
1118 (add-after 'configure 'patch-settings
1120 ;; libhdf5.settings contains the full path of the
1121 ;; compilers used, and its contents are included in
1122 ;; libhdf5.so. We truncate the hashes to avoid
1123 ;; unnecessary store references to those compilers:
1124 (substitute* "src/libhdf5.settings"
1125 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1126 (string-append prefix (string-take hash 10) "..."))
1127 ;; Don't record the build-time kernel version to make the
1128 ;; settings file reproducible.
1129 (("Uname information:.*")
1130 "Uname information: Linux\n"))
1132 (add-after 'install 'patch-references
1133 (lambda* (#:key inputs outputs #:allow-other-keys)
1134 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1135 (zlib (assoc-ref inputs "zlib")))
1136 (substitute* (find-files bin "h5p?cc")
1138 (string-append "-L" zlib "/lib " lib)))
1140 (add-after 'install 'split
1141 (lambda* (#:key inputs outputs #:allow-other-keys)
1142 ;; Move all fortran-related files
1143 (let* ((out (assoc-ref outputs "out"))
1144 (bin (string-append out "/bin"))
1145 (lib (string-append out "/lib"))
1146 (inc (string-append out "/include"))
1147 (ex (string-append out "/share/hdf5_examples/fortran"))
1148 (fort (assoc-ref outputs "fortran"))
1149 (fbin (string-append fort "/bin"))
1150 (flib (string-append fort "/lib"))
1151 (finc (string-append fort "/include"))
1152 (fex (string-append fort "/share/hdf5_examples/fortran")))
1157 ;; Note: When built with --enable-parallel, the 'h5fc' file
1158 ;; doesn't exist, hence this condition.
1159 (when (file-exists? (string-append bin "/h5fc"))
1160 (rename-file (string-append bin "/h5fc")
1161 (string-append fbin "/h5fc")))
1162 (for-each (lambda (file)
1164 (string-append flib "/" (basename file))))
1165 (find-files lib ".*fortran.*"))
1166 (for-each (lambda (file)
1168 (string-append finc "/" (basename file))))
1169 (find-files inc ".*mod"))
1170 (for-each (lambda (file)
1172 (string-append fex "/" (basename file))))
1173 (find-files ex ".*"))
1174 (delete-file-recursively ex))
1176 (home-page "https://www.hdfgroup.org")
1177 (synopsis "Management suite for extremely large and complex data")
1178 (description "HDF5 is a suite that makes possible the management of
1179 extremely large and complex data collections.")
1180 (license (license:x11-style
1181 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1183 (define-public hdf5-1.10
1184 (package (inherit hdf5)
1189 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1190 "hdf5-" (version-major+minor version)
1191 "/hdf5-" version "/src/hdf5-"
1193 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1195 (apply string-append
1196 (take (string-split version #\.) 2))
1197 "/src/hdf5-" version ".tar.bz2")))
1199 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
1200 (patches (search-patches "hdf5-config-date.patch"))))))
1202 (define-public hdf-java
1210 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1211 version "/src/CMake-hdfjava-" version ".tar.gz"))
1213 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1214 (modules '((guix build utils)))
1215 (snippet ; Make sure we don't use the bundled sources and binaries.
1217 (for-each delete-file
1218 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1219 "HDF4.tar.gz" "HDF5.tar.gz"))
1220 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1222 (build-system gnu-build-system)
1224 `(("jdk" ,icedtea "jdk")
1225 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1227 ("hamcrest-core" ,java-hamcrest-core)
1228 ("junit" ,java-junit)
1229 ("slf4j-simple" ,java-slf4j-simple)))
1234 ("libjpeg" ,libjpeg-turbo)
1235 ("slf4j-api" ,java-slf4j-api)))
1238 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1239 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1240 (assoc-ref %build-inputs "jdk") "/lib" )
1241 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1242 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1245 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1246 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1247 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1248 (string-append "JPEGLIB="
1249 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1253 (modify-phases %standard-phases
1254 (add-before 'configure 'chdir-to-source
1255 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1256 (add-before 'configure 'patch-build
1257 (lambda* (#:key inputs outputs #:allow-other-keys)
1258 (substitute* "configure"
1259 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1260 (("/bin/cat") (which "cat")))
1261 ;; Set classpath for compilation
1262 (substitute* '("hdf/hdf5lib/Makefile.in"
1263 "hdf/hdf5lib/exceptions/Makefile.in"
1264 "hdf/hdflib/Makefile.in")
1265 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1266 (string-append (assoc-ref inputs "slf4j-api")
1267 "/share/java/slf4j-api.jar")))
1268 ;; Replace outdated config.sub and config.guess:
1269 (with-directory-excursion "config"
1270 (for-each (lambda (file)
1272 (string-append (assoc-ref inputs "automake")
1274 ,(version-major+minor (package-version automake))
1276 '("config.sub" "config.guess")))
1278 ;; Fix embedded version number
1279 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1280 (substitute* "hdf/hdf5lib/H5.java"
1282 (string-join hdf5version ", "))))
1284 (mkdir-p (string-append (assoc-ref outputs "out")))
1285 ;; Set classpath for tests
1286 (let* ((build-dir (getcwd))
1287 (lib (string-append build-dir "/lib"))
1288 (jhdf (string-append lib "/jhdf.jar"))
1289 (jhdf5 (string-append lib "/jhdf5.jar"))
1293 (string-append (assoc-ref inputs i)
1294 "/share/java/" i ".jar"))
1295 '("slf4j-api" "slf4j-simple"))
1297 (car (find-files (assoc-ref inputs "junit") "jar$"))
1298 (car (find-files (assoc-ref inputs "hamcrest-core")
1301 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1303 (substitute* '("test/hdf5lib/Makefile.in"
1304 "test/hdf5lib/junit.sh.in"
1305 "examples/runExample.sh.in")
1307 (string-append (assoc-ref inputs "coreutils")
1310 (string-append (assoc-ref inputs "coreutils")
1312 (("CLASSPATH=[^\n]*")
1313 (string-append "CLASSPATH=" class-path)))
1314 (setenv "CLASSPATH" class-path))
1316 (add-before 'check 'build-examples
1318 (apply invoke `("javac"
1319 ,@(find-files "examples" ".*\\.java"))))))
1321 #:parallel-build? #f
1323 #:parallel-tests? #f ))
1324 (home-page "https://support.hdfgroup.org/products/java")
1325 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1326 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1327 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1330 ;; BSD-style license:
1331 (license (license:x11-style
1332 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1333 /current/src/unpacked/COPYING"))))
1335 (define-public hdf-eos2
1342 (uri "ftp://edhs1.gsfc.nasa.gov\
1343 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1345 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1346 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1347 "hdf-eos2-build-shared.patch"
1348 "hdf-eos2-fortrantests.patch"))))
1349 (build-system gnu-build-system)
1351 `(("gfortran" ,gfortran)))
1353 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1354 ;; XXX: These inputs are really dependencies of hdf4.
1356 ("libjpeg" ,libjpeg-turbo)
1357 ("libtirpc" ,libtirpc)
1361 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1362 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1363 #:parallel-tests? #f))
1364 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1365 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1366 (description "HDF-EOS2 is a software library built on HDF4 which supports
1367 the construction of data structures used in NASA's Earth Observing
1368 System (Grid, Point and Swath).")
1370 ;; Source files carry a permissive license header.
1371 (license (license:non-copyleft home-page))))
1373 (define-public hdf-eos5
1379 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1380 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1383 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1384 (patches (search-patches "hdf-eos5-build-shared.patch"
1385 "hdf-eos5-remove-gctp.patch"
1386 "hdf-eos5-fix-szip.patch"
1387 "hdf-eos5-fortrantests.patch"))))
1389 `(("gfortran" ,gfortran)))
1390 (build-system gnu-build-system)
1396 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1397 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1398 #:parallel-tests? #f))
1399 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1401 "HDF-EOS5 is a software library built on HDF5 to support the construction
1402 of data structures used in NASA's Earth Observing System (Grid, Point and
1404 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1406 ;; Source files carry a permissive license header.
1407 (license (license:non-copyleft home-page))))
1409 (define-public hdf5-parallel-openmpi
1410 (package (inherit hdf5)
1411 (name "hdf5-parallel-openmpi")
1414 ,@(package-inputs hdf5)))
1416 (substitute-keyword-arguments (package-arguments hdf5)
1417 ((#:configure-flags flags)
1418 ``("--enable-parallel"
1419 ,@(delete "--enable-cxx"
1420 (delete "--enable-threadsafe" ,flags))))
1422 `(modify-phases ,phases
1423 (add-after 'build 'mpi-setup
1425 (add-before 'check 'patch-tests
1427 ;; OpenMPI's mpirun will exit with non-zero status if it
1428 ;; detects an "abnormal termination", i.e. any process not
1429 ;; calling MPI_Finalize(). Since the test is explicitly
1430 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1431 ;; H5C_flush_cache from being called, mpirun will always
1432 ;; complain, so turn this test off.
1433 (substitute* "testpar/Makefile"
1434 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1435 (string-append front back "\n")))
1436 (substitute* "tools/h5diff/testph5diff.sh"
1437 (("/bin/sh") (which "sh")))
1439 (synopsis "Management suite for data with parallel IO support")))
1441 (define-public hdf5-blosc
1449 (url "https://github.com/Blosc/hdf5-blosc")
1450 (commit (string-append "v" version))))
1451 (file-name (git-file-name name version))
1453 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1454 (build-system cmake-build-system)
1457 (list (string-append "-DBLOSC_INSTALL_DIR="
1458 (assoc-ref %build-inputs "c-blosc"))
1459 (string-append "-DPLUGIN_INSTALL_PATH="
1460 (assoc-ref %outputs "out")
1461 "/hdf5/lib/plugin"))
1463 (modify-phases %standard-phases
1464 (add-after 'unpack 'do-not-build-blosc
1466 (substitute* "CMakeLists.txt"
1467 (("set\\(BLOSC_INSTALL_DIR.*") "")
1468 (("ExternalProject_Add\\(project_blosc") "message("))
1471 `(("c-blosc" ,c-blosc)
1472 ("hdf5" ,hdf5-1.10)))
1473 (home-page "https://github.com/Blosc/hdf5-blosc")
1474 (synopsis "Filter for HDF5 using the Blosc compressor")
1475 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1476 installing this filter, you can read and write HDF5 files with
1477 Blosc-compressed datasets.")
1478 (license license:expat)))
1480 (define-public h5check
1487 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1488 "h5check/src/h5check-" version ".tar.gz"))
1491 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1492 (build-system gnu-build-system)
1493 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1494 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1495 (synopsis "HDF5 format checker")
1496 (description "@code{h5check} is a validation tool for verifying that an
1497 HDF5 file is encoded according to the HDF File Format Specification.")
1498 (license (license:x11-style "file://COPYING"))))
1506 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1511 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1512 (build-system cmake-build-system)
1513 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1514 (inputs `(("lapack" ,lapack)
1516 ;; FIXME: Even though the fonts are available dvips complains:
1517 ;; "Font cmmi10 not found; characters will be left blank."
1519 `(("texlive" ,texlive-tiny)
1520 ("ghostscript" ,ghostscript)
1521 ("doxygen" ,doxygen)))
1522 (home-page "http://itpp.sourceforge.net")
1523 (synopsis "C++ library of maths, signal processing and communication classes")
1524 (description "IT++ is a C++ library of mathematical, signal processing and
1525 communication classes and functions. Its main use is in simulation of
1526 communication systems and for performing research in the area of
1527 communications. The kernel of the library consists of generic vector and
1528 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1529 similar to MATLAB, GNU Octave or SciPy.")
1530 (license license:gpl3+)))
1532 (define-public netcdf
1539 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1540 "netcdf-" version ".tar.gz"))
1543 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1544 (patches (search-patches "netcdf-date-time.patch"
1545 "netcdf-tst_h_par.patch"))))
1546 (build-system gnu-build-system)
1549 ("doxygen" ,doxygen)
1550 ("graphviz" ,graphviz)))
1552 `(("hdf4" ,hdf4-alt)
1555 ("libjpeg" ,libjpeg-turbo)))
1557 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1559 #:phases (modify-phases %standard-phases
1560 (add-before 'configure 'fix-source-date
1562 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1563 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1564 ;; to '1st hour of the current day', and therefore makes the
1565 ;; package not reproducible.
1566 (substitute* "./configure"
1567 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1568 "date --date='@0'"))
1570 (add-after 'configure 'patch-settings
1572 ;; libnetcdf.settings contains the full filename of the compilers
1573 ;; used to build the library. We truncate the hashes of those
1574 ;; filenames to avoid unnecessary references to the corresponding
1576 (substitute* "libnetcdf.settings"
1577 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1578 (string-append prefix (string-take hash 10) "...")))
1581 #:parallel-tests? #f)) ;various race conditions
1582 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1583 (synopsis "Library for scientific data")
1584 (description "NetCDF is an interface for scientific data access and a
1585 software library that provides an implementation of the interface. The netCDF
1586 library defines a machine-independent format for representing scientific data.
1587 Together, the interface, library, and format support the creation, access, and
1588 sharing of scientific data.")
1589 (license (license:x11-style "file://COPYRIGHT"))))
1591 (define-public netcdf-parallel-openmpi
1592 (package (inherit netcdf)
1593 (name "netcdf-parallel-openmpi")
1596 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1597 (package-inputs netcdf))))
1598 ;; TODO: Replace pkg-config references in nc-config with absolute references
1600 (substitute-keyword-arguments (package-arguments netcdf)
1601 ((#:configure-flags flags)
1602 `(cons* "CC=mpicc" "CXX=mpicxx"
1603 "--enable-parallel-tests"
1604 ;; Shared libraries not supported with parallel IO.
1605 "--disable-shared" "--with-pic"
1608 (define-public netcdf-fortran
1610 (name "netcdf-fortran")
1615 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1619 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1620 (build-system gnu-build-system)
1622 `(#:parallel-tests? #f))
1624 `(("netcdf" ,netcdf)))
1626 `(("gfortran" ,gfortran)))
1627 (synopsis "Fortran interface for the netCDF library")
1628 (description (package-description netcdf))
1629 (home-page (package-home-page netcdf))
1630 (license (package-license netcdf))))
1632 (define-public nlopt
1638 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1641 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1642 (build-system gnu-build-system)
1644 `(;; Shared libraries are not built by default. They are required to
1645 ;; build the Guile, Octave, and Python bindings.
1646 #:configure-flags '("--enable-shared")
1649 (modify-phases %standard-phases
1650 (add-before 'configure 'set-libnlopt-file-name
1651 (lambda* (#:key outputs #:allow-other-keys)
1652 ;; Make sure the Scheme module refers to the library by its
1653 ;; absolute file name (we cannot do that from a snippet
1654 ;; because the expansion of @libdir@ contains
1656 (let ((out (assoc-ref outputs "out")))
1657 (substitute* "swig/nlopt.scm.in"
1659 (string-append out "/lib/libnlopt")))
1661 (inputs `(("guile" ,guile-2.0)))
1662 (native-inputs `(("pkg-config" ,pkg-config)))
1663 (home-page "http://ab-initio.mit.edu/wiki/")
1664 (synopsis "Library for nonlinear optimization")
1665 (description "NLopt is a library for nonlinear optimization, providing a
1666 common interface for a number of different free optimization routines available
1667 online as well as original implementations of various other algorithms.")
1668 (license license:lgpl2.1+)))
1670 (define-public ipopt
1677 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1681 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1682 (modules '((guix build utils)))
1684 ;; Make sure we don't use the bundled software.
1686 (delete-file-recursively "ThirdParty")
1688 (build-system gnu-build-system)
1690 '(#:phases (modify-phases %standard-phases
1691 (add-after 'install 'add--L-flags-in-ipopt.pc
1692 (lambda* (#:key inputs outputs #:allow-other-keys)
1693 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1694 ;; move it to "Libs.private" where it belongs, and add a
1695 ;; '-L' flag for LAPACK.
1696 (let ((out (assoc-ref outputs "out"))
1697 (lapack (assoc-ref inputs "lapack")))
1698 (substitute* (string-append out "/lib/pkgconfig/"
1700 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1701 (string-append "Libs: " before " " after "\n"
1702 "Libs.private: " before
1703 "-L" lapack "/lib -llapack -lblas "
1707 `(("gfortran" ,gfortran)))
1709 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1710 `(("lapack" ,lapack))) ;for both libblas and liblapack
1711 (home-page "https://www.coin-or.org")
1712 (synopsis "Large-scale nonlinear optimizer")
1714 "The Interior Point Optimizer (IPOPT) is a software package for
1715 large-scale nonlinear optimization. It provides C++, C, and Fortran
1717 (license license:epl1.0)))
1725 (uri (string-append "https://www.coin-or.org/download/source/"
1726 "Clp/Clp-" version ".tgz"))
1729 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1730 (modules '((guix build utils)))
1732 ;; Make sure we don't use the bundled software.
1734 (delete-file-recursively "ThirdParty")
1736 (build-system gnu-build-system)
1738 `(("gfortran" ,gfortran)
1739 ("pkg-config" ,pkg-config)))
1741 `(("openblas" ,openblas)))
1742 (home-page "https://www.coin-or.org")
1743 (synopsis "Linear programming solver")
1745 "CLP is a high quality linear programming solver. Its main strengths are
1746 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1747 linear and quadratic objectives. There are limited facilities for nonlinear
1748 and quadratic objectives using the Simplex algorithm.")
1749 (license license:epl1.0)))
1751 (define-public ceres
1753 (name "ceres-solver")
1755 (home-page "http://ceres-solver.org/")
1758 (uri (string-append home-page "ceres-solver-"
1762 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1763 (build-system cmake-build-system)
1765 ;; TODO: Build HTML user documentation and install separately.
1766 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1767 "-DBUILD_SHARED_LIBS=ON")
1769 #:phases (modify-phases %standard-phases
1770 (add-before 'configure 'set-library-directory
1772 ;; Install libraries to lib/, not lib64/.
1773 (substitute* "internal/ceres/CMakeLists.txt"
1774 (("set\\(LIB_SUFFIX \"64\"\\)")
1775 "set(LIB_SUFFIX \"\")"))
1778 `(("pkg-config" ,pkg-config)))
1780 `(("glog" ,glog))) ;for #include <glog/glog.h>
1785 ("suitesparse" ,suitesparse)
1786 ("gflags" ,gflags)))
1787 (synopsis "C++ library for solving large optimization problems")
1789 "Ceres Solver is a C++ library for modeling and solving large,
1790 complicated optimization problems. It is a feature rich, mature and
1791 performant library which has been used in production since 2010. Ceres Solver
1792 can solve two kinds of problems:
1794 @item non-linear least squares problems with bounds constraints;
1795 @item general unconstrained optimization problems.
1797 (license license:bsd-3)))
1799 ;; For a fully featured Octave, users are strongly recommended also to install
1800 ;; the following packages: less, ghostscript, gnuplot.
1801 (define-public octave-cli
1808 (uri (string-append "mirror://gnu/octave/octave-"
1812 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1813 (build-system gnu-build-system)
1815 `(("alsa-lib" ,alsa-lib)
1816 ("arpack" ,arpack-ng)
1822 ("fontconfig" ,fontconfig)
1823 ("freetype" ,freetype)
1827 ("graphicsmagick" ,graphicsmagick)
1829 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1830 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1831 ;; libtiff.la instead of having to provide it here.
1832 ("libjpeg" ,libjpeg-turbo)
1836 ("libsndfile" ,libsndfile)
1840 ("portaudio" ,portaudio)
1842 ("readline" ,readline)
1843 ("suitesparse" ,suitesparse)
1844 ("texinfo" ,texinfo)
1848 ("gfortran" ,gfortran)
1849 ("pkg-config" ,pkg-config)
1851 ;; The following inputs are not actually used in the build process.
1852 ;; However, the ./configure gratuitously tests for their existence and
1853 ;; assumes that programs not present at build time are also not, and
1854 ;; can never be, available at run time! If these inputs are therefore
1855 ;; not present, support for them will be built out. However, Octave
1856 ;; will still run without them, albeit without the features they
1859 ("ghostscript" ,ghostscript)
1860 ("gnuplot" ,gnuplot)))
1861 ;; Octave code uses this variable to detect directories holding multiple CA
1862 ;; certificates to verify peers with. This is required for the networking
1863 ;; functions that require encryption to work properly.
1864 (native-search-paths
1865 (list (search-path-specification
1866 (variable "CURLOPT_CAPATH")
1867 (files '("etc/ssl/certs")))))
1870 (list (string-append "--with-shell="
1871 (assoc-ref %build-inputs "bash")
1874 ;; XXX: Without this flag, linking octave-cli fails with
1875 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1876 ;; not pulling in liboctinterp.la for -lstdc++.
1877 "--enable-link-all-dependencies")
1879 (modify-phases %standard-phases
1880 (add-after 'configure 'configure-makeinfo
1881 (lambda* (#:key inputs #:allow-other-keys)
1882 (substitute* "libinterp/corefcn/help.h"
1885 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1887 (home-page "https://www.gnu.org/software/octave/")
1888 (synopsis "High-level language for numerical computation")
1889 (description "GNU Octave is a high-level interpreted language that is
1890 specialized for numerical computations. It can be used for both linear and
1891 non-linear applications and it provides great support for visualizing results.
1892 Work may be performed both at the interactive command-line as well as via
1894 (license license:gpl3+)))
1896 (define-public octave
1897 (package (inherit octave-cli)
1900 (inherit (package-source octave-cli))))
1902 `(("qscintilla" ,qscintilla)
1904 ,@(package-inputs octave-cli)))
1906 `(("qttools" , qttools) ;for lrelease
1907 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1908 ,@(package-native-inputs octave-cli)))
1910 (substitute-keyword-arguments (package-arguments octave-cli)
1912 `(modify-phases ,phases
1913 (add-before 'configure 'patch-qscintilla-library-name
1914 (lambda* (#:key inputs #:allow-other-keys)
1915 ;; The QScintilla library that the Octave configure script tries
1916 ;; to link with should be named libqscintilla-qt5.so, but the
1917 ;; QScintilla input provides the shared library as
1918 ;; libqscintilla2_qt5.so.
1919 (substitute* "configure"
1920 (("qscintilla2-qt5")
1924 (define-public opencascade-oce
1926 (name "opencascade-oce")
1932 (url "https://github.com/tpaviot/oce")
1933 (commit (string-append "OCE-" version))))
1934 (file-name (git-file-name name version))
1935 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1937 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1938 (build-system cmake-build-system)
1941 (list "-DOCE_TESTING:BOOL=ON"
1942 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1943 "-DOCE_DRAW:BOOL=ON"
1944 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1945 (assoc-ref %outputs "out"))
1946 "-UCMAKE_INSTALL_RPATH")))
1948 `(("freetype" ,freetype)
1955 `(("python" ,python-wrapper)))
1956 (home-page "https://github.com/tpaviot/oce")
1957 (synopsis "Libraries for 3D modeling and numerical simulation")
1959 "Open CASCADE is a set of libraries for the development of applications
1960 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1961 C++ class libraries providing services for 3D surface and solid modeling, CAD
1962 data exchange, and visualization. It is used for development of specialized
1963 software dealing with 3D models in design (CAD), manufacturing (CAM),
1964 numerical simulation (CAE), measurement equipment (CMM), and quality
1965 control (CAQ) domains.
1967 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1968 patches, improvements, and experiments contributed by users over the official
1969 Open CASCADE library.")
1970 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1971 ; use of header files; see
1972 ; OCCT_LGPL_EXCEPTION.txt
1973 license:public-domain; files
1974 ; src/Standard/Standard_StdAllocator.hxx and
1975 ; src/NCollection/NCollection_StdAllocator.hxx
1976 license:expat; file src/OpenGl/OpenGl_glext.h
1977 license:bsd-3)))); test framework gtest
1979 (define-public opencascade-occt
1981 (name "opencascade-occt")
1987 (url "https://git.dev.opencascade.org/repos/occt.git")
1990 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1992 (file-name (git-file-name name version))
1994 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1995 (modules '((guix build utils)))
1998 ;; Remove files specific to non-free operating systems.
1999 (delete-file-recursively "samples/ios")
2000 (delete-file-recursively "samples/mfc")
2001 (delete-file-recursively "samples/qt/FuncDemo")
2002 (delete-file "genconf.bat")
2003 (delete-file "gendoc.bat")
2004 (delete-file "genproj.bat")
2005 (delete-file "upgrade.bat")
2006 ;; Remove references to deleted files.
2007 (substitute* "dox/FILES_HTML.txt"
2008 ((".*standard.*") "" )
2009 ((".*UIKitSample.*") ""))
2011 (build-system cmake-build-system)
2013 '(;; There is no test target for make. OCCT provides an
2014 ;; 'Automated Testing System', which may be accessed after
2015 ;; installation via the draw.sh script. draw.sh is located in
2016 ;; the bin directory. For details see:
2017 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2018 ;; occt_dev_guides__tests.html
2020 ;; Configure without freeimage: attempting to link against the
2021 ;; freeimage version 3.17 library leads to 'undefined
2022 ;; reference' errors.
2024 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2026 "-DUSE_VTK:BOOL=OFF"
2027 "-DBUILD_DOC_Overview:BOOL=OFF"
2028 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2029 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2030 "-UCMAKE_INSTALL_LIBDIR")))
2032 `(("doxygen" ,doxygen)
2033 ;("freeimage" ,freeimage)
2034 ("freetype" ,freetype)
2036 ("libxext" ,libxext)
2043 ;; TODO: build Overview documentation and add 'doc' output.
2044 (home-page "https://www.opencascade.com")
2045 (synopsis "Libraries for 3D modeling and numerical simulation")
2047 "Open CASCADE is a set of libraries for the development of applications
2048 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2049 C++ class libraries providing services for 3D surface and solid modeling, CAD
2050 data exchange, and visualization. It is used for development of specialized
2051 software dealing with 3D models in design (CAD), manufacturing (CAM),
2052 numerical simulation (CAE), measurement equipment (CMM), and quality
2053 control (CAQ) domains.
2055 This is the certified version of the Open Cascade Technology (OCCT) library.")
2056 (license (list ;; OCCT library:
2057 license:lgpl2.1; with an exception for the use of header
2058 ; files, see OCCT_LGPL_EXCEPTION.txt.
2059 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2060 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2062 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2063 ;; src/StepFile/step.tab.*:
2064 license:gpl3+ ; with Bison 2.2 exception.
2065 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2066 (license:non-copyleft
2067 "https://www.unicode.org/license.html")
2068 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2069 license:public-domain))))
2079 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2081 (string-append "gmsh_"
2082 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2084 (file-name (git-file-name name version))
2086 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
2087 (modules '((guix build utils)))
2089 ;; Remove non-free METIS code
2091 (delete-file-recursively "contrib/Metis")
2093 (build-system cmake-build-system)
2096 ("gfortran" ,gfortran)
2102 ("opencascade-oce" ,opencascade-oce)
2104 ("libxext" ,libxext)))
2106 `(("fontconfig" ,fontconfig)
2107 ("libxft" ,libxft)))
2109 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
2110 "-DENABLE_BUILD_SHARED:BOOL=ON"
2111 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2112 (home-page "http://gmsh.info/")
2113 (synopsis "3D finite element grid generator")
2114 (description "Gmsh is a 3D finite element grid generator with a built-in
2115 CAD engine and post-processor. Its design goal is to provide a fast, light
2116 and user-friendly meshing tool with parametric input and advanced
2117 visualization capabilities. Gmsh is built around four modules: geometry,
2118 mesh, solver and post-processing. The specification of any input to these
2119 modules is done either interactively using the graphical user interface or in
2120 ASCII text files using Gmsh's own scripting language.")
2121 (license license:gpl2+)))
2123 (define-public maxflow
2126 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2127 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2132 (url "https://github.com/gerddie/maxflow")
2134 (file-name (git-file-name name version))
2137 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2138 (build-system cmake-build-system)
2139 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2140 (synopsis "Library implementing Maxflow algorithm")
2141 (description "An implementation of the maxflow algorithm described in
2142 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2143 Energy Minimization in Computer Vision.\n
2144 Yuri Boykov and Vladimir Kolmogorov.\n
2145 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2147 (license license:gpl3+)))
2149 (define-public petsc
2156 ;; The *-lite-* tarball does not contain the *large* documentation
2157 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2158 "petsc-lite-" version ".tar.gz"))
2160 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2161 (outputs '("out" ; libraries and headers
2162 "examples")) ; ~30MiB of examples
2163 (build-system gnu-build-system)
2165 `(("python" ,python-2)))
2167 `(("gfortran" ,gfortran)
2169 ("superlu" ,superlu)
2170 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2171 ;; leaving out opengl, as configuration seems to only be for mac
2174 `(#:test-target "test"
2175 #:parallel-build? #f ; build is parallel by default
2181 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2182 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2183 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2185 (modify-phases %standard-phases
2187 ;; PETSc's configure script is actually a python script, so we can't
2188 ;; run it with bash.
2189 (lambda* (#:key outputs (configure-flags '())
2191 (let* ((prefix (assoc-ref outputs "out"))
2192 (flags `(,(string-append "--prefix=" prefix)
2193 ,@configure-flags)))
2194 (format #t "build directory: ~s~%" (getcwd))
2195 (format #t "configure flags: ~s~%" flags)
2196 (apply invoke "./configure" flags))))
2197 (add-after 'configure 'clean-local-references
2198 (lambda* (#:key outputs #:allow-other-keys)
2199 (let ((out (assoc-ref outputs "out")))
2200 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2201 ;; Prevent build directory from leaking into compiled code
2203 ;; Scrub timestamp for reproducibility
2204 ((".*Libraries compiled on.*") ""))
2205 (substitute* (find-files "." "petscvariables")
2206 ;; Do not expose build machine characteristics, set to defaults.
2207 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2208 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2210 (add-after 'install 'clean-install
2211 ;; Try to keep installed files from leaking build directory names.
2212 (lambda* (#:key inputs outputs #:allow-other-keys)
2213 (let ((out (assoc-ref outputs "out")))
2214 (substitute* (map (lambda (file)
2215 (string-append out "/lib/petsc/conf/" file))
2216 '("petscvariables"))
2218 ;; Make compiler references point to the store
2219 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2220 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2221 (string-append "= " (which compiler))))
2222 ;; PETSc installs some build logs, which aren't necessary.
2223 (for-each (lambda (file)
2224 (let ((f (string-append out "/lib/petsc/conf/" file)))
2225 (when (file-exists? f)
2227 '("configure.log" "make.log" "gmake.log"
2228 "test.log" "error.log" "RDict.db"
2229 "PETScBuildInternal.cmake"
2230 ;; Once installed, should uninstall with Guix
2233 (add-after 'install 'move-examples
2234 (lambda* (#:key outputs #:allow-other-keys)
2235 (let* ((out (assoc-ref outputs "out"))
2236 (examples (assoc-ref outputs "examples"))
2237 (exdir (string-append out "/share/petsc/examples"))
2238 (exdir' (string-append examples "/share/petsc/examples")))
2239 (copy-recursively exdir exdir')
2240 (delete-file-recursively exdir)
2242 (home-page "https://www.mcs.anl.gov/petsc")
2243 (synopsis "Library to solve PDEs")
2244 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2245 data structures and routines for the scalable (parallel) solution of
2246 scientific applications modeled by partial differential equations.")
2247 (license (license:non-copyleft
2248 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2250 (define-public petsc-complex
2251 (package (inherit petsc)
2252 (name "petsc-complex")
2254 (substitute-keyword-arguments (package-arguments petsc)
2255 ((#:configure-flags cf)
2256 `(cons "--with-scalar-type=complex" ,cf))))
2257 (synopsis "Library to solve PDEs (with complex scalars)")))
2259 (define-public petsc-openmpi
2260 (package (inherit petsc)
2261 (name "petsc-openmpi")
2263 `(("hdf5" ,hdf5-parallel-openmpi)
2264 ("hypre" ,hypre-openmpi)
2266 ("mumps" ,mumps-openmpi)
2267 ("openmpi" ,openmpi)
2268 ("scalapack" ,scalapack)
2269 ("scotch" ,pt-scotch32)
2270 ,@(package-inputs petsc)))
2272 (substitute-keyword-arguments (package-arguments petsc)
2273 ((#:configure-flags cf)
2275 "--with-mpiexec=mpirun"
2278 "--with-scalapack=1"
2280 ,(string-append "--with-mpi-dir="
2281 (assoc-ref %build-inputs "openmpi"))
2282 ,(string-append "--with-hdf5-include="
2283 (assoc-ref %build-inputs "hdf5") "/include")
2284 ,(string-append "--with-hdf5-lib="
2285 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2286 ,@(delete "--with-mpi=0" ,cf)))
2288 `(modify-phases ,phases
2289 (add-before 'configure 'mpi-setup
2290 ,%openmpi-setup)))))
2291 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2293 (define-public petsc-complex-openmpi
2294 (package (inherit petsc-complex)
2295 (name "petsc-complex-openmpi")
2297 `(("openmpi" ,openmpi)
2298 ,@(package-inputs petsc-complex)))
2300 (substitute-keyword-arguments (package-arguments petsc-complex)
2301 ((#:configure-flags cf)
2302 ``("--with-mpiexec=mpirun"
2303 ,(string-append "--with-mpi-dir="
2304 (assoc-ref %build-inputs "openmpi"))
2305 ,@(delete "--with-mpi=0" ,cf)))
2307 `(modify-phases ,phases
2308 (add-before 'configure 'mpi-setup
2309 ,%openmpi-setup)))))
2310 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2312 (define-public python-petsc4py
2314 (name "python-petsc4py")
2319 (uri (pypi-uri "petsc4py" version))
2322 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2323 (build-system python-build-system)
2326 (modify-phases %standard-phases
2327 (add-before 'build 'pre-build
2329 ;; Define path to PETSc installation.
2330 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2332 (add-before 'check 'mpi-setup
2335 `(("petsc" ,petsc-openmpi)
2336 ("python-numpy" ,python-numpy)))
2337 (home-page "https://bitbucket.org/petsc/petsc4py/")
2338 (synopsis "Python bindings for PETSc")
2339 (description "PETSc, the Portable, Extensible Toolkit for
2340 Scientific Computation, is a suite of data structures and routines for
2341 the scalable (parallel) solution of scientific applications modeled by
2342 partial differential equations. It employs the MPI standard for all
2343 message-passing communication. @code{petsc4py} provides Python
2344 bindings to almost all functions of PETSc.")
2345 (license license:bsd-3)))
2347 (define-public python-kiwisolver
2349 (name "python-kiwisolver")
2353 (uri (pypi-uri "kiwisolver" version))
2356 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2357 (build-system python-build-system)
2358 (home-page "https://github.com/nucleic/kiwi")
2359 (synopsis "Fast implementation of the Cassowary constraint solver")
2361 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2362 solving algorithm. Kiwi has been designed from the ground up to be
2363 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2364 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2365 savings are consistently > 5x.")
2366 (license license:bsd-3)))
2368 (define-public python2-kiwisolver
2369 (package-with-python2 python-kiwisolver))
2371 (define-public slepc
2378 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2382 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2383 (build-system gnu-build-system)
2385 `(("python" ,python-2)
2386 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2388 `(("arpack" ,arpack-ng)
2389 ("gfortran" ,gfortran)))
2391 `(("petsc" ,petsc)))
2393 `(#:parallel-build? #f ;build is parallel by default
2395 `(,(string-append "--with-arpack-dir="
2396 (assoc-ref %build-inputs "arpack") "/lib"))
2397 #:make-flags ;honor (parallel-job-count)
2398 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2399 ,(string-append "PETSCCONFIGDIR="
2400 (assoc-ref %build-inputs "petsc:examples")
2401 "/share/petsc/examples/config"))
2403 (modify-phases %standard-phases
2405 ;; configure is a python script, so we can't run it with bash.
2406 (lambda* (#:key inputs outputs (configure-flags '())
2408 (let* ((prefix (assoc-ref outputs "out"))
2409 (flags `(,(string-append "--prefix=" prefix)
2410 ,@configure-flags)))
2411 (format #t "build directory: ~s~%" (getcwd))
2412 (format #t "configure flags: ~s~%" flags)
2413 (setenv "SLEPC_DIR" (getcwd))
2414 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2415 (apply invoke "./configure" flags))))
2416 (add-after 'install 'delete-doc
2417 ;; TODO: SLEPc installs HTML documentation alongside headers in
2418 ;; $out/include. We'd like to move them to share/doc, but delete
2419 ;; them for now, as they are incomplete and installing the complete
2420 ;; documentation is difficult.
2421 (lambda* (#:key outputs #:allow-other-keys)
2422 (let* ((out (assoc-ref outputs "out")))
2423 (for-each delete-file (find-files out "\\.html$"))
2425 (add-after 'install 'clean-install
2426 ;; Clean up unnecessary build logs from installation.
2427 (lambda* (#:key outputs #:allow-other-keys)
2428 (let ((out (assoc-ref outputs "out")))
2429 (for-each (lambda (file)
2430 (let ((f (string-append out "/lib/slepc/conf/" file)))
2431 (when (file-exists? f)
2433 '("configure.log" "make.log" "gmake.log"
2434 "test.log" "error.log" "RDict.db"
2437 (home-page "http://slepc.upv.es")
2438 (synopsis "Scalable library for eigenproblems")
2439 (description "SLEPc is a software library for the solution of large sparse
2440 eigenproblems on parallel computers. It can be used for the solution of
2441 linear eigenvalue problems formulated in either standard or generalized form,
2442 as well as other related problems such as the singular value decomposition.
2443 The emphasis of the software is on methods and techniques appropriate for
2444 problems in which the associated matrices are sparse, for example, those
2445 arising after the discretization of partial differential equations.")
2446 (license license:bsd-2)))
2448 (define-public slepc-complex
2449 (package (inherit slepc)
2450 (name "slepc-complex")
2452 `(("petsc" ,petsc-complex)
2453 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2454 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2456 (define-public slepc-openmpi
2457 (package (inherit slepc)
2458 (name "slepc-openmpi")
2460 (substitute-keyword-arguments (package-arguments slepc)
2461 ((#:phases phases '%standard-phases)
2462 `(modify-phases ,phases
2463 (add-before 'check 'mpi-setup
2464 ,%openmpi-setup)))))
2467 ("arpack" ,arpack-ng-openmpi)
2468 ,@(alist-delete "arpack" (package-inputs slepc))))
2470 `(("petsc" ,petsc-openmpi)
2471 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2472 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2474 (define-public slepc-complex-openmpi
2475 (package (inherit slepc-openmpi)
2476 (name "slepc-complex-openmpi")
2478 `(("petsc" ,petsc-complex-openmpi)
2479 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2480 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2482 (define-public python-slepc4py
2484 (name "python-slepc4py")
2489 (uri (pypi-uri "slepc4py" version))
2492 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2493 (build-system python-build-system)
2496 (modify-phases %standard-phases
2497 (add-before 'build 'pre-build
2499 ;; Define path to PETSc installation.
2500 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2501 ;; Define path to SLEPc installation.
2502 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2504 (add-before 'check 'mpi-setup
2507 `(("python-numpy" ,python-numpy)
2508 ("python-petsc4py" ,python-petsc4py)
2509 ("slepc" ,slepc-openmpi)))
2510 (home-page "https://bitbucket.org/slepc/slepc4py/")
2511 (synopsis "Python bindings for SLEPc")
2512 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2513 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2514 Scientific Computation. It employs the MPI standard for all
2515 message-passing communication. @code{slepc4py} provides Python
2516 bindings to almost all functions of SLEPc.")
2517 (license license:bsd-3)))
2519 (define-public metamath
2527 (url "https://github.com/metamath/metamath-exe")
2528 (commit (string-append "v" version))))
2529 (file-name (git-file-name name version))
2531 (base32 "1jjf4fy6j53i40dh0yv0f9sngnw4gs24cig99vsg3q0303pwrhg7"))))
2532 (build-system gnu-build-system)
2534 `(("autoconf" ,autoconf)
2535 ("automake" ,automake)))
2536 (home-page "http://us.metamath.org/")
2537 (synopsis "Proof verifier based on a minimalistic formalism")
2539 "Metamath is a tiny formal language and that can express theorems in
2540 abstract mathematics, with an accompyaning @command{metamath} executable that
2541 verifies databases of these proofs. There is a public database,
2542 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2543 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2544 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2545 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2547 (license license:gpl2+)))
2549 (define-public mumps
2556 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2560 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2561 (patches (search-patches "mumps-build-parallelism.patch"
2562 "mumps-shared-libseq.patch"
2563 "mumps-shared-mumps.patch"
2564 "mumps-shared-pord.patch"))))
2565 (build-system gnu-build-system)
2567 `(("fortran" ,gfortran)
2568 ;; These are required for linking against mumps, but we let the user
2569 ;; declare the dependency.
2572 ("scotch" ,scotch)))
2574 `(#:modules ((ice-9 match)
2577 ,@%gnu-build-system-modules)
2579 (modify-phases %standard-phases
2581 (lambda* (#:key inputs #:allow-other-keys)
2582 (call-with-output-file "Makefile.inc"
2593 INCSEQ = -I$(topdir)/libseq
2594 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2595 LIBSEQNEEDED = libseqneeded~;
2599 AR = ar vr # rules require trailing space, ugh...
2602 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2604 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2605 LIBOTHERS = -pthread
2608 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2612 LIBS = $(SCALAP) $(LIBSEQ)
2613 LPORDDIR = $(topdir)/PORD/lib
2614 IPORD = -I$(topdir)/PORD/include
2615 LPORD = $(LPORDDIR)/libpord.a
2616 ORDERINGSF = -Dpord~@[
2618 IMETIS = -I$(METISDIR)/include
2619 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2620 ORDERINGSF += -Dmetis~]~@[~:{
2622 ISCOTCH = -I$(SCOTCHDIR)/include
2623 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2624 ORDERINGSF += ~a~}~]
2625 ORDERINGSC = $(ORDERINGSF)
2626 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2627 IORDERINGSF = $(ISCOTCH)
2628 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2629 (assoc-ref inputs "mpi")
2630 (assoc-ref inputs "blas")
2631 (assoc-ref inputs "scalapack")
2632 (assoc-ref inputs "metis")
2633 (match (list (assoc-ref inputs "pt-scotch")
2634 (assoc-ref inputs "scotch"))
2638 `((,scotch "" "-Dscotch")))
2641 "-lptesmumps -lptscotch -lptscotcherr "
2642 "-Dptscotch")))))))))
2644 ;; By default only the d-precision library is built. Make with "all"
2645 ;; target so that all precision libraries and examples are built.
2647 (invoke "make" "all"
2648 (format #f "-j~a" (parallel-job-count)))))
2650 ;; Run the simple test drivers, which read test input from stdin:
2651 ;; from the "real" input for the single- and double-precision
2652 ;; testers, and from the "cmplx" input for complex-precision
2653 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2654 ;; package to prefix execution with "mpirun".
2655 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2656 (with-directory-excursion "examples"
2659 (let ((tester (apply open-pipe*
2662 ,(string-append "./" prec
2664 (input (open-input-file
2665 (string-append "input_simpletest_" type))))
2667 (dump-port input tester)
2669 (zero? (close-pipe tester)))))
2671 '("real" "real" "cmplx" "cmplx")))))
2673 (lambda* (#:key outputs #:allow-other-keys)
2674 (let* ((out (assoc-ref outputs "out"))
2675 (libdir (string-append out "/lib")))
2676 (copy-recursively "lib" libdir)
2677 (copy-recursively "include" (string-append out "/include"))
2678 (when (file-exists? "libseq/libmpiseq.a")
2679 (install-file "libseq/libmpiseq.a" libdir))
2680 (when (file-exists? "libseq/libmpiseq.so")
2681 (install-file "libseq/libmpiseq.so" libdir))
2683 (home-page "http://mumps.enseeiht.fr")
2684 (synopsis "Multifrontal sparse direct solver")
2686 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2687 sparse system of linear equations A x = b using Gaussian elimination.")
2688 (license license:cecill-c)))
2690 (define-public mumps-metis
2691 (package (inherit mumps)
2692 (name "mumps-metis")
2694 (alist-delete "scotch" (package-inputs mumps)))))
2696 (define-public mumps-openmpi
2697 (package (inherit mumps)
2698 (name "mumps-openmpi")
2701 ("scalapack" ,scalapack)
2702 ("pt-scotch" ,pt-scotch)
2703 ,@(alist-delete "scotch" (package-inputs mumps))))
2705 (substitute-keyword-arguments (package-arguments mumps)
2707 `(modify-phases ,phases
2708 (add-before 'check 'mpi-setup
2712 ((assoc-ref ,phases 'check)
2713 #:exec-prefix '("mpirun" "-n" "2"))))))))
2714 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2716 (define-public mumps-metis-openmpi
2717 (package (inherit mumps-openmpi)
2718 (name "mumps-metis-openmpi")
2720 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2722 (define-public ruby-asciimath
2724 (name "ruby-asciimath")
2729 (uri (rubygems-uri "asciimath" version))
2732 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2733 (build-system ruby-build-system)
2735 `(("ruby-nokogiri" ,ruby-nokogiri)
2736 ("ruby-rspec" ,ruby-rspec)))
2737 (synopsis "AsciiMath parsing and conversion library")
2739 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2740 easy-to-write markup language for mathematics.")
2741 (home-page "https://github.com/asciidoctor/asciimath")
2742 (license license:expat)))
2744 (define-public superlu
2751 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2752 "superlu_" version ".tar.gz"))
2754 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2755 (modules '((guix build utils)))
2757 ;; Replace the non-free implementation of MC64 with a stub adapted
2760 (use-modules (ice-9 regex)
2762 (call-with-output-file "SRC/mc64ad.c"
2767 void mc64id_(int *a) {
2768 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2771 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2772 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2773 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2776 ;; Remove the corresponding license verbiage. MC64 license follows
2777 ;; a "------" line separator.
2778 (with-atomic-file-replacement "License.txt"
2779 (let ((rx (make-regexp "-{8}")))
2782 (let ((line (read-line in 'concat)))
2783 (unless (regexp-exec rx line)
2787 (build-system cmake-build-system)
2791 `(("blas" ,openblas)
2792 ("gfortran" ,gfortran)))
2794 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2795 "-DTPL_BLAS_LIBRARIES=openblas"
2796 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2797 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2798 (synopsis "Supernodal direct solver for sparse linear systems")
2800 "SuperLU is a general purpose library for the direct solution of large,
2801 sparse, nonsymmetric systems of linear equations on high performance machines.
2802 The library is written in C and is callable from either C or Fortran. The
2803 library routines perform an LU decomposition with partial pivoting and
2804 triangular system solves through forward and back substitution. The library
2805 also provides threshold-based ILU factorization preconditioners.")
2806 (license (list license:bsd-3
2807 license:gpl2+ ;EXAMPLE/*fgmr.c
2808 (license:fsf-free "file://SRC/colamd.h")))))
2810 (define-public superlu-dist
2812 (name "superlu-dist")
2817 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2818 "superlu_dist_" version ".tar.gz"))
2820 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2821 (modules '((guix build utils)))
2823 ;; Replace the non-free implementation of MC64 with a stub
2825 (call-with-output-file "SRC/mc64ad_dist.c"
2830 void mc64id_dist(int *a) {
2831 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2834 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2835 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2836 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2839 (substitute* "SRC/util.c" ;adjust default algorithm
2840 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2841 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2842 ;; general (i.e. non-square) processor-grid support.
2843 "RowPerm = NOROWPERM;"))
2845 (patches (search-patches "superlu-dist-scotchmetis.patch"
2846 "superlu-dist-awpm-grid.patch"))))
2847 (build-system cmake-build-system)
2851 `(("gfortran" ,gfortran)
2854 ("combblas" ,combinatorial-blas)))
2856 `(("mpi" ,openmpi) ;headers include MPI heades
2857 ("parmetis" ,pt-scotch32 "metis")
2858 ("pt-scotch" ,pt-scotch32)))
2860 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2861 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2862 "-DTPL_ENABLE_COMBBLASLIB=YES"
2863 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2864 "-DTPL_LAPACK_LIBRARIES=-llapack"
2865 (string-append "-DTPL_PARMETIS_LIBRARIES="
2867 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2868 "scotchmetis" "scotch" "scotcherr")
2870 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2871 (assoc-ref %build-inputs "parmetis")
2873 "-DTPL_ENABLE_COMBBLASLIB=ON"
2874 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2875 (assoc-ref %build-inputs "combblas")
2876 "/include/CombBLAS;"
2877 (assoc-ref %build-inputs "combblas")
2878 "/include/BipartiteMatchings")
2879 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2881 (modify-phases %standard-phases
2882 (add-before 'configure 'set-c++-standard
2884 (substitute* "CMakeLists.txt"
2885 ;; AWPM headers require C++14
2886 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2887 (add-before 'check 'mpi-setup
2889 (add-before 'check 'omp-setup
2890 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2891 (home-page (package-home-page superlu))
2892 (synopsis "Parallel supernodal direct solver")
2894 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2895 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2896 implemented in ANSI C, and MPI for communications.")
2897 (license license:bsd-3)))
2899 (define-public scotch
2906 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2907 "latestfile/298/scotch_" version ".tar.gz"))
2909 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2910 (patches (search-patches "scotch-build-parallelism.patch"
2911 "scotch-integer-declarations.patch"))))
2912 (build-system gnu-build-system)
2918 (outputs '("out" "metis"))
2920 `(#:make-flags (list (string-append "prefix=" %output))
2922 (modify-phases %standard-phases
2924 'unpack 'chdir-to-src
2925 (lambda _ (chdir "src") #t))
2929 (call-with-output-file "Makefile.inc"
2943 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2944 LDFLAGS = -lz -lm -lrt -lpthread
2946 LEX = flex -Pscotchyy -olex.yy.c
2951 YACC = bison -pscotchyy -y -b y
2953 '("COMMON_FILE_COMPRESS_GZ"
2955 "COMMON_RANDOM_FIXED_SEED"
2956 "INTSIZE64" ;use 'int64_t'
2957 ;; Prevents symbolc clashes with libesmumps
2959 ;; XXX: Causes invalid frees in superlu-dist tests
2961 ;; "SCOTCH_PTHREAD_NUMBER=2"
2962 "restrict=__restrict"))))
2964 (add-after 'build 'build-esmumps
2967 (format #f "-j~a" (parallel-job-count))
2969 (add-before 'install 'make-install-dirs
2970 (lambda* (#:key outputs #:allow-other-keys)
2971 (mkdir (assoc-ref outputs "out"))))
2972 (add-after 'install 'install-metis
2973 (lambda* (#:key outputs #:allow-other-keys)
2974 (let ((out (assoc-ref outputs "metis")))
2976 ;; metis files are not installed with 'make install'
2977 (for-each (lambda (f)
2978 (install-file f (string-append out "/include")))
2979 (find-files "../include/" ".*metis\\.h"))
2980 (for-each (lambda (f)
2981 (install-file f (string-append out "/lib")))
2982 (find-files "../lib/" ".*metis\\..*"))
2984 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2985 (synopsis "Programs and libraries for graph algorithms")
2986 (description "SCOTCH is a set of programs and libraries which implement
2987 the static mapping and sparse matrix reordering algorithms developed within
2988 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2989 conquer approach, to scientific computing problems such as graph and mesh
2990 partitioning, static mapping, and sparse matrix ordering, in application
2991 domains ranging from structural mechanics to operating systems or
2993 ;; See LICENSE_en.txt
2994 (license license:cecill-c)))
2996 (define-public scotch32
2997 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2998 ;; some applications.
2999 (package (inherit scotch)
3002 (substitute-keyword-arguments (package-arguments scotch)
3003 ((#:phases scotch-phases)
3004 `(modify-phases ,scotch-phases
3008 (call-with-output-file "Makefile.inc"
3022 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3023 LDFLAGS = -lz -lm -lrt -lpthread
3025 LEX = flex -Pscotchyy -olex.yy.c
3030 YACC = bison -pscotchyy -y -b y
3032 '("COMMON_FILE_COMPRESS_GZ"
3034 "COMMON_RANDOM_FIXED_SEED"
3035 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3036 ;; Prevents symbolc clashes with libesmumps
3038 ;; XXX: Causes invalid frees in superlu-dist tests
3040 ;; "SCOTCH_PTHREAD_NUMBER=2"
3041 "restrict=__restrict"))))))))))
3043 "Programs and libraries for graph algorithms (32-bit integers)")))
3045 (define-public pt-scotch
3046 (package (inherit scotch)
3049 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3051 (substitute-keyword-arguments (package-arguments scotch)
3052 ((#:phases scotch-phases)
3053 `(modify-phases ,scotch-phases
3057 (invoke "make" (format #f "-j~a" (parallel-job-count))
3058 "ptscotch" "ptesmumps")
3060 ;; Install the serial metis compatibility library
3061 (invoke "make" "-C" "libscotchmetis" "install")))
3062 (add-before 'check 'mpi-setup
3066 (invoke "make" "ptcheck")))))))
3067 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3069 (define-public pt-scotch32
3070 (package (inherit scotch32)
3071 (name "pt-scotch32")
3073 `(("openmpi" ,openmpi))) ;headers include MPI headers
3075 (substitute-keyword-arguments (package-arguments scotch32)
3076 ((#:phases scotch32-phases)
3077 `(modify-phases ,scotch32-phases
3080 (invoke "make" (format #f "-j~a" (parallel-job-count))
3081 "ptscotch" "ptesmumps")
3082 ;; Install the serial metis compatibility library
3083 (invoke "make" "-C" "libscotchmetis" "install")))
3084 (add-before 'check 'mpi-setup
3088 (invoke "make" "ptcheck")))))))
3090 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3092 (define-public metis
3099 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3100 "metis-" version ".tar.gz"))
3103 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3104 (build-system cmake-build-system)
3106 `(("blas" ,openblas)))
3108 `(#:tests? #f ;no tests
3109 #:configure-flags `("-DSHARED=ON"
3110 ,(string-append "-DGKLIB_PATH=" (getcwd)
3111 "/metis-" ,version "/GKlib"))))
3112 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3113 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3115 "METIS is a set of serial programs for partitioning graphs, partitioning
3116 finite element meshes, and producing fill-reducing orderings for sparse
3117 matrices. The algorithms implemented in METIS are based on the multilevel
3118 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3120 (license license:asl2.0))) ;As of version 5.0.3
3122 (define-public p4est
3129 (uri (string-append "http://p4est.github.io/release/p4est-"
3133 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3134 (build-system gnu-build-system)
3136 `(("fortran" ,gfortran)
3141 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3142 (assoc-ref %build-inputs "blas")
3144 ,(string-append "LAPACK_LIBS=-L"
3145 (assoc-ref %build-inputs "lapack")
3147 #:phases (modify-phases %standard-phases
3148 (add-before 'check 'mpi-setup
3150 (home-page "http://www.p4est.org")
3151 (synopsis "Adaptive mesh refinement on forests of octrees")
3153 "The p4est software library enables the dynamic management of a
3154 collection of adaptive octrees, conveniently called a forest of octrees.
3155 p4est is designed to work in parallel and scales to hundreds of thousands of
3157 (license license:gpl2+)))
3159 (define-public p4est-openmpi
3160 (package (inherit p4est)
3161 (name "p4est-openmpi")
3164 ,@(package-inputs p4est)))
3166 (substitute-keyword-arguments (package-arguments p4est)
3167 ((#:configure-flags cf)
3168 ``("--enable-mpi" ,@,cf))))
3169 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3171 (define-public gsegrafix
3178 (uri (string-append "mirror://gnu/" name "/" name "-"
3182 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3183 (build-system gnu-build-system)
3185 `(#:configure-flags '("LDFLAGS=-lm")))
3187 `(("libgnomecanvas" ,libgnomecanvas)
3188 ("libbonoboui" ,libbonoboui)
3189 ("libgnomeui" ,libgnomeui)
3190 ("libgnomeprintui" ,libgnomeprintui)
3193 `(("pkg-config" ,pkg-config)))
3194 (home-page "https://www.gnu.org/software/gsegrafix/")
3195 (synopsis "GNOME application to create scientific and engineering plots")
3196 (description "GSEGrafix is an application which produces high-quality graphical
3197 plots for science and engineering. Plots are specified via simple ASCII
3198 parameter files and data files and are presented in an anti-aliased GNOME
3199 canvas. The program supports rectangular two-dimensional plots, histograms,
3200 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3201 to BMP, JPEG or PNG image formats.")
3202 (license license:gpl3+)))
3204 (define-public maxima
3211 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3212 version "-source/" name "-" version ".tar.gz"))
3215 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3216 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3217 (build-system gnu-build-system)
3220 ("gnuplot" ,gnuplot) ;for plots
3222 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3224 `(("texinfo" ,texinfo)
3226 ("python" ,python)))
3229 (list "--enable-gcl"
3230 (string-append "--with-posix-shell="
3231 (assoc-ref %build-inputs "bash")
3233 (string-append "--with-wish="
3234 (assoc-ref %build-inputs "tk")
3236 (let ((v ,(package-version tk)))
3237 (string-take v (string-index-right v #\.)))))
3238 ;; By default Maxima attempts to write temporary files to
3239 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3240 ;; Work around that.
3241 #:make-flags (list "TMPDIR=/tmp")
3243 (modify-phases %standard-phases
3244 (add-after 'unpack 'patch-paths
3245 (lambda* (#:key inputs #:allow-other-keys)
3246 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3247 (coreutils (assoc-ref inputs "coreutils"))
3248 (dirname (string-append coreutils "/bin/dirname"))
3249 (head (string-append coreutils "/bin/head"))
3250 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3251 (python (string-append (assoc-ref inputs "python")
3253 (substitute* "src/maxima.in"
3254 (("sed ") (string-append sed " "))
3255 (("dirname") dirname)
3257 (substitute* "doc/info/Makefile.in"
3258 (("/usr/bin/env perl") perl))
3259 (substitute* "doc/info/build_html.sh.in"
3260 (("python") python))
3262 (add-before 'check 'pre-check
3264 (chmod "src/maxima" #o555)
3268 ;; This is derived from the testing code in the "debian/rules" file
3269 ;; of Debian's Maxima package.
3270 ;; If Maxima can successfully run this, the binary to be installed
3276 "--batch-string=\"run_testsuite();\" "
3277 "| grep -q \"No unexpected errors found\""))))
3278 ;; Make sure the doc and emacs files are found in the
3279 ;; standard location. Also configure maxima to find gnuplot
3280 ;; without having it on the PATH.
3281 (add-after 'install 'post-install
3282 (lambda* (#:key outputs inputs #:allow-other-keys)
3283 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3284 (out (assoc-ref outputs "out"))
3285 (datadir (string-append out "/share/maxima/" ,version))
3286 (binutils (string-append (assoc-ref inputs "binutils")
3288 (with-directory-excursion out
3289 (mkdir-p "share/emacs")
3290 (mkdir-p "share/doc")
3292 (string-append datadir "/doc/")
3293 (string-append out "/share/doc/maxima"))
3294 (with-atomic-file-replacement
3295 (string-append datadir "/share/maxima-init.lisp")
3297 (format out "~a ~s~a~%"
3298 "(setf $gnuplot_command "
3299 (string-append gnuplot "/bin/gnuplot") ")")
3300 (dump-port in out))))
3301 ;; Ensure that Maxima will have access to the GNU binutils
3302 ;; components at runtime.
3303 (wrap-program (string-append out "/bin/maxima")
3304 `("PATH" prefix (,binutils))))
3306 (home-page "http://maxima.sourceforge.net")
3307 (synopsis "Numeric and symbolic expression manipulation")
3308 (description "Maxima is a system for the manipulation of symbolic and
3309 numerical expressions. It yields high precision numeric results by using
3310 exact fractions, arbitrary precision integers, and variable precision floating
3312 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3313 ;; Others simply say "GNU General Public License" without stating a
3314 ;; version (which implicitly means gpl1+).
3315 ;; At least one file (src/maxima.asd) says "version 2."
3316 ;; GPLv2 only is therefore the smallest subset.
3317 (license license:gpl2)))
3319 (define-public wxmaxima
3327 (url "https://github.com/wxMaxima-developers/wxmaxima")
3328 (commit (string-append "Version-" version))))
3329 (file-name (git-file-name name version))
3331 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
3332 (build-system cmake-build-system)
3334 `(("gettext" ,gettext-minimal)
3335 ("xorg-server" ,xorg-server-for-tests)))
3336 ;; TODO: Add libomp for multithreading support.
3337 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3339 `(("wxwidgets" ,wxwidgets)
3342 ("adwaita-icon-theme" ,adwaita-icon-theme)
3344 ("shared-mime-info" ,shared-mime-info)))
3346 `(#:test-target "test"
3348 (modify-phases %standard-phases
3349 (add-before 'check 'pre-check
3351 ;; Tests require a running X server.
3352 (system "Xvfb :1 &")
3353 (setenv "DISPLAY" ":1")
3354 (setenv "HOME" (getcwd))
3356 (add-after 'install 'wrap-program
3357 (lambda* (#:key inputs outputs #:allow-other-keys)
3358 (wrap-program (string-append (assoc-ref outputs "out")
3361 (,(string-append (assoc-ref inputs "maxima")
3363 ;; For GtkFileChooserDialog.
3364 `("GSETTINGS_SCHEMA_DIR" =
3365 (,(string-append (assoc-ref inputs "gtk+")
3366 "/share/glib-2.0/schemas")))
3367 `("XDG_DATA_DIRS" ":" prefix
3368 (;; Needed by gdk-pixbuf to know supported icon formats.
3370 (assoc-ref inputs "shared-mime-info") "/share")
3371 ;; The default icon theme of GTK+.
3373 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3375 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3376 (synopsis "Graphical user interface for the Maxima computer algebra system")
3378 "wxMaxima is a graphical user interface for the Maxima computer algebra
3379 system. It eases the use of Maxima by making most of its commands available
3380 through a menu system and by providing input dialogs for commands that require
3381 more than one argument. It also implements its own display engine that
3382 outputs mathematical symbols directly instead of depicting them with ASCII
3385 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3386 text and mathematical calculations to create documents, exporting of input and
3387 output to TeX, and a browser for Maxima's manual including command index and
3388 full text searching.")
3389 (license license:gpl2+)))
3391 (define-public armadillo
3397 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3401 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3402 (build-system cmake-build-system)
3403 (arguments `(#:tests? #f)) ; no test target
3405 `(("openblas" ,openblas)
3407 ("arpack" ,arpack-ng)))
3408 (home-page "http://arma.sourceforge.net/")
3409 (synopsis "C++ linear algebra library")
3411 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3412 between speed and ease of use. It is useful for algorithm development
3413 directly in C++, or quick conversion of research code into production
3414 environments. It can be used for machine learning, pattern recognition,
3415 signal processing, bioinformatics, statistics, econometrics, etc. The library
3416 provides efficient classes for vectors, matrices and cubes, as well as 150+
3417 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3418 (license license:asl2.0)))
3420 (define-public muparser
3421 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3422 ;; different hash. In order to make `guix package --upgrade` work correctly,
3423 ;; we set a Guix packaging revision.
3424 ;; When the next version of muparser is released, we can remove
3425 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3426 (let ((upstream-version "2.2.5")
3430 (version (string-append upstream-version "-" revision))
3435 (url "https://github.com/beltoforion/muparser")
3436 (commit (string-append "v" upstream-version))))
3437 (file-name (git-file-name name version))
3439 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3440 (build-system gnu-build-system)
3442 `(#:configure-flags '("--enable-samples=no")
3443 #:tests? #f)) ;no "check" target
3444 (home-page "http://muparser.beltoforion.de/")
3445 (synopsis "Fast parser library for mathematical expressions")
3447 "muParser is an extensible high performance math parser library. It is
3448 based on transforming an expression into a bytecode and precalculating constant
3450 (license license:expat))))
3452 (define-public openblas
3459 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3460 version "%20version.tar.gz"))
3461 (file-name (string-append name "-" version ".tar.gz"))
3464 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3465 (build-system gnu-build-system)
3467 `(#:test-target "test"
3468 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3469 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3470 ;; we need to disable substitutions.
3472 ,(let ((system (or (%current-target-system) (%current-system))))
3473 (or (string-prefix? "x86_64" system)
3474 (string-prefix? "i686" system)
3475 (string-prefix? "mips" system)
3476 (string-prefix? "aarch64" system)))
3478 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3480 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3482 ;; This is the maximum number of threads OpenBLAS will ever use (that
3483 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3484 ;; is used.) If we don't set it, the makefile sets it to the number
3485 ;; of cores of the build machine, which is obviously wrong.
3488 ;; Build the library for all supported CPUs. This allows
3489 ;; switching CPU targets at runtime with the environment variable
3490 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3491 ;; Unfortunately, this is not supported on non-x86 architectures,
3492 ;; where it leads to failed builds.
3493 ,@(let ((system (or (%current-target-system) (%current-system))))
3495 ((or (string-prefix? "x86_64" system)
3496 (string-prefix? "i686" system))
3497 '("DYNAMIC_ARCH=1"))
3498 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3499 ;; two available MIPS targets special extended instructions
3500 ;; for Loongson cores are used.
3501 ((string-prefix? "mips" system)
3502 '("TARGET=SICORTEX"))
3503 ;; On aarch64 force the generic 'armv8-a' target
3504 ((string-prefix? "aarch64" system)
3507 ;; no configure script
3509 (modify-phases %standard-phases
3511 (add-before 'build 'set-extralib
3512 (lambda* (#:key inputs #:allow-other-keys)
3513 ;; Get libgfortran found when building in utest.
3515 (string-append "-L" (assoc-ref inputs "fortran-lib")
3519 `(("fortran-lib" ,gfortran "lib")))
3522 ("fortran" ,gfortran)
3524 (home-page "https://www.openblas.net/")
3525 (synopsis "Optimized BLAS library based on GotoBLAS")
3527 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3528 (license license:bsd-3)))
3530 (define-public openblas-ilp64
3531 (package/inherit openblas
3532 (name "openblas-ilp64")
3533 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3535 (substitute-keyword-arguments (package-arguments openblas)
3536 ((#:make-flags flags '())
3537 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3539 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3540 (license license:bsd-3)))
3542 (define* (make-blis implementation #:optional substitutable?)
3543 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3544 source tree for a list of implementations.)
3546 SUBSTITUTABLE? determines whether the package is made available as a
3549 Currently the specialization must be selected at configure-time, but work is
3550 underway to allow BLIS to select the right optimized kernels at run time:
3551 <https://github.com/flame/blis/issues/129>."
3553 (name (if (string=? implementation "reference")
3555 (string-append "blis-" implementation)))
3557 (home-page "https://github.com/flame/blis")
3560 (uri (git-reference (url home-page) (commit version)))
3563 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3564 (file-name (git-file-name "blis" version))))
3565 (build-system gnu-build-system)
3567 `(#:test-target "test"
3569 #:substitutable? ,substitutable?
3571 #:phases (modify-phases %standard-phases
3573 (lambda* (#:key outputs #:allow-other-keys)
3574 ;; This is a home-made 'configure' script.
3575 (let ((out (assoc-ref outputs "out")))
3576 (invoke "./configure" "-p" out
3580 "--enable-threading=openmp"
3583 (add-before 'check 'show-test-output
3585 ;; By default "make check" is silent. Make it verbose.
3586 (system "tail -F output.testsuite &")
3588 (synopsis "High-performance basic linear algebra (BLAS) routines")
3590 "BLIS is a portable software framework for instantiating high-performance
3591 BLAS-like dense linear algebra libraries. The framework was designed to
3592 isolate essential kernels of computation that, when optimized, immediately
3593 enable optimized implementations of most of its commonly used and
3594 computationally intensive operations. While BLIS exports a new BLAS-like API,
3595 it also includes a BLAS compatibility layer which gives application developers
3596 access to BLIS implementations via traditional BLAS routine calls.")
3597 (license license:bsd-3)))
3600 ;; This is the "reference" implementation, which is the non-optimized but
3601 ;; portable variant (no assembly).
3602 (make-blis "reference" #t))
3604 (define ignorance blis)
3606 (define-syntax-rule (blis/x86_64 processor)
3607 "Expand to a package specialized for PROCESSOR."
3609 (inherit (make-blis processor))
3610 (supported-systems '("x86_64-linux"))))
3612 (define-public blis-sandybridge
3613 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3614 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3615 (blis/x86_64 "sandybridge"))
3617 (define-public blis-haswell
3618 ;; BLIS specialized for Haswell processors (launched 2013):
3619 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3620 (blis/x86_64 "haswell"))
3622 (define-public blis-knl
3623 ;; BLIS specialized for Knights Landing processor (launched 2016):
3624 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3625 (blis/x86_64 "knl"))
3628 (define-public openlibm
3636 (url "https://github.com/JuliaLang/openlibm")
3637 (commit (string-append "v" version))))
3638 (file-name (git-file-name name version))
3640 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3641 (build-system gnu-build-system)
3644 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3646 ;; no configure script
3647 (modify-phases %standard-phases (delete 'configure))
3648 #:tests? #f)) ;the tests are part of the default target
3649 (home-page "https://openlibm.org/")
3650 (synopsis "Portable C mathematical library (libm)")
3652 "OpenLibm is an effort to have a high quality, portable, standalone C
3653 mathematical library (libm). It can be used standalone in applications and
3654 programming language implementations. The project was born out of a need to
3655 have a good libm for the Julia programming language that worked consistently
3656 across compilers and operating systems, and in 32-bit and 64-bit
3658 ;; Each architecture has its own make target, and there is none for mips.
3659 (supported-systems (delete "mips64el-linux" %supported-systems))
3660 ;; See LICENSE.md for details.
3661 (license (list license:expat
3664 license:public-domain
3665 license:lgpl2.1+))))
3667 (define-public openspecfun
3669 (name "openspecfun")
3675 (url "https://github.com/JuliaLang/openspecfun")
3676 (commit (string-append "v" version))))
3677 (file-name (git-file-name name version))
3679 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3680 (build-system gnu-build-system)
3682 '(#:tests? #f ; no "check" target
3684 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3686 (modify-phases %standard-phases
3687 (delete 'configure)))) ; no configure script
3689 `(("fortran" ,gfortran)))
3690 (home-page "https://github.com/JuliaLang/openspecfun")
3691 (synopsis "Collection of special mathematical functions")
3693 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3694 portable package for Bessel Functions of a Complex Argument and Nonnegative
3695 Order; it contains subroutines for computing Bessel functions and Airy
3696 functions. Faddeeva allows computing the various error functions of arbitrary
3697 complex arguments (Faddeeva function, error function, complementary error
3698 function, scaled complementary error function, imaginary error function, and
3699 Dawson function); given these, one can also easily compute Voigt functions,
3700 Fresnel integrals, and similar related functions as well.")
3701 ;; Faddeeva is released under the Expat license; AMOS is included as
3702 ;; public domain software.
3703 (license (list license:expat license:public-domain))))
3705 (define-public suitesparse
3707 (name "suitesparse")
3713 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3714 (commit (string-append "v" version))))
3715 (file-name (git-file-name name version))
3718 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3719 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3720 (modules '((guix build utils)))
3722 ;; Remove bundled metis source
3724 (delete-file-recursively "metis-5.1.0")
3726 (build-system gnu-build-system)
3728 '(#:tests? #f ;no "check" target
3733 "MY_METIS_LIB=-lmetis"
3734 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3735 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3736 (assoc-ref %outputs "out")
3737 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3738 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3739 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3740 " -DCMAKE_SKIP_RPATH=TRUE"
3741 " -DCMAKE_BUILD_TYPE=Release")
3742 (string-append "INSTALL_LIB="
3743 (assoc-ref %outputs "out") "/lib")
3744 (string-append "INSTALL_INCLUDE="
3745 (assoc-ref %outputs "out") "/include")
3748 (modify-phases %standard-phases
3749 (delete 'configure)))) ;no configure script
3755 `(("cmake" ,cmake-minimal)
3757 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3758 (synopsis "Suite of sparse matrix software")
3760 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3761 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3762 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3763 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3764 CXSparse, a concise sparse Cholesky factorization package; and many other
3767 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3769 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3770 (license (list license:gpl2+ license:lgpl2.1+))))
3772 (define-public atlas
3778 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3779 version "/atlas" version ".tar.bz2"))
3782 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3783 (build-system gnu-build-system)
3784 (home-page "http://math-atlas.sourceforge.net/")
3785 (inputs `(("gfortran" ,gfortran)
3786 ("lapack-tar" ,(package-source lapack))))
3787 (outputs '("out" "doc"))
3788 ;; For the moment we drop support for MIPS at it fails to compile. See
3789 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3790 (supported-systems (delete "mips64el-linux" %supported-systems))
3792 `(#:parallel-build? #f
3793 #:parallel-tests? #f
3795 ;; ATLAS tunes itself for the machine it is built on, as explained at
3796 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3797 ;; For this reason, we want users to build it locally instead of using
3801 #:modules ((srfi srfi-26)
3802 (guix build gnu-build-system)
3805 `(;; Generate position independent code suitable for dynamic libraries
3806 ;; and use WALL timer to get more accurate timing.
3807 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3810 ,,(if (string-match "64" (%current-system))
3813 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3814 ;; needed to compile C files before it is generated.
3815 "-Ss" "pmake" "make -j 1"
3816 ;; Probe is failing for MIPS. We therefore define the system
3817 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3818 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3819 ,,@(if (string-prefix? "mips" (%current-system))
3820 (list "-A" "49" "-V" "1")
3822 ;; Generate shared libraries.
3824 ;; Build a full LAPACK library.
3825 ,(string-append "--with-netlib-lapack-tarfile="
3826 (assoc-ref %build-inputs "lapack-tar")))
3828 (modify-phases %standard-phases
3829 (add-after 'install 'install-doc
3830 (lambda* (#:key outputs inputs #:allow-other-keys)
3831 (let ((doc (string-append (assoc-ref outputs "doc")
3832 "/share/doc/atlas")))
3834 (for-each (cut install-file <> doc)
3835 (find-files "../ATLAS/doc" ".*"))
3837 (add-after 'check 'check-pt
3838 (lambda _ (invoke "make" "ptcheck")))
3839 ;; Fix files required to run configure.
3840 (add-before 'configure 'fix-/bin/sh
3842 ;; Use `sh', not `/bin/sh'.
3843 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3847 ;; Fix /bin/sh in generated make files.
3848 (add-after 'configure 'fix-/bin/sh-in-generated-files
3850 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3854 ;; ATLAS configure program does not accepts the default flags
3855 ;; passed by the 'gnu-build-system'.
3857 (lambda* (#:key native-inputs inputs outputs
3858 (configure-flags '())
3859 #:allow-other-keys #:rest args)
3860 (let* ((prefix (assoc-ref outputs "out"))
3861 (bash (or (and=> (assoc-ref
3862 (or native-inputs inputs) "bash")
3863 (cut string-append <> "/bin/bash"))
3865 (flags `(,(string-append "--prefix=" prefix)
3867 (abs-srcdir (getcwd))
3868 (srcdir (string-append "../" (basename abs-srcdir))))
3869 (format #t "source directory: ~s (relative from build: ~s)~%"
3873 (format #t "build directory: ~s~%" (getcwd))
3874 (format #t "configure flags: ~s~%" flags)
3876 (string-append srcdir "/configure")
3878 (synopsis "Automatically Tuned Linear Algebra Software")
3880 "ATLAS is an automatically tuned linear algebra software library
3881 providing C and Fortran77 interfaces to a portably efficient BLAS
3882 implementation, as well as a few routines from LAPACK.
3884 Optimization occurs at build time. For this reason, the library is built on
3885 the machine where it is installed, without resorting to pre-built substitutes.
3887 Before building the library, CPU throttling should be disabled. This can be
3888 done in the BIOS, or, on GNU/Linux, with the following command:
3891 # cpupower --governor performance
3894 Failure to do so will result in a library with poor performance.")
3895 (license license:bsd-3)))
3904 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3905 version "/glm-" version ".zip"))
3907 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
3908 (build-system cmake-build-system)
3910 `(#:phases (modify-phases %standard-phases
3912 (lambda* (#:key outputs #:allow-other-keys)
3913 ;; Since version 0.9.9.6, 'make install' is not supported
3914 ;; and we have to do it "manually". Upstream discussion:
3915 ;; <https://github.com/g-truc/glm/pull/968>.
3916 (let* ((source (string-append "../glm"))
3917 (out (assoc-ref outputs "out"))
3918 (inc (string-append out "/include"))
3919 (lib (string-append out "/lib"))
3920 (pkgconfig (string-append lib "/pkgconfig")))
3921 (with-directory-excursion source
3924 (copy-recursively "glm" (string-append inc "/glm"))
3925 (copy-recursively "cmake" (string-append lib "/cmake"))
3926 (call-with-output-file (string-append pkgconfig "/glm.pc")
3930 includedir=${prefix}/include
3933 Description: OpenGL Mathematics
3935 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3938 `(("unzip" ,unzip)))
3939 (home-page "https://glm.g-truc.net/")
3940 (synopsis "OpenGL Mathematics library")
3941 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3942 library for graphics software based on the OpenGL Shading Language (GLSL)
3944 (license license:expat)))
3946 (define-public lpsolve
3953 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3954 "/lp_solve_" version "_source.tar.gz"))
3957 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3958 (modules '((guix build utils)))
3961 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3963 ;; Pretend to be on a 64 bit platform to obtain a common directory
3964 ;; name for the build results on all architectures; nothing else
3965 ;; seems to depend on it.
3966 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3968 ;; The check for 'isnan' as it is written fails with
3969 ;; "non-floating-point argument in call to function
3970 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3971 ;; definition, which in turn leads to bad things. Fix the feature
3973 (("isnan\\(0\\)") "isnan(0.)"))
3975 (build-system gnu-build-system)
3977 `(#:tests? #f ; no check target
3979 (modify-phases %standard-phases
3980 (delete 'configure) ; no configure script
3983 (with-directory-excursion "lpsolve55"
3984 (invoke "bash" "ccc"))
3985 (with-directory-excursion "lp_solve"
3986 (invoke "bash" "ccc"))
3989 (lambda* (#:key outputs #:allow-other-keys)
3990 (let* ((out (assoc-ref outputs "out"))
3991 (bin (string-append out "/bin"))
3992 (lib (string-append out "/lib"))
3993 ;; This is where LibreOffice expects to find the header
3994 ;; files, and where they are installed by Debian.
3995 (include (string-append out "/include/lpsolve")))
3996 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3997 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3998 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4000 ;; Install a subset of the header files as on Debian
4001 ;; (plus lp_bit.h, which matches the regular expression).
4002 (for-each (lambda (name)
4003 (install-file name include))
4004 (find-files "." "lp_[HMSa-z].*\\.h$"))
4005 (with-directory-excursion "shared"
4006 (for-each (lambda (name)
4007 (install-file name include))
4008 (find-files "." "\\.h$")))
4010 (home-page "http://lpsolve.sourceforge.net/")
4011 (synopsis "Mixed integer linear programming (MILP) solver")
4013 "lp_solve is a mixed integer linear programming solver based on the
4014 revised simplex and the branch-and-bound methods.")
4015 (license license:lgpl2.1+)))
4017 (define-public dealii
4024 (uri (string-append "https://github.com/dealii/dealii/releases/"
4025 "download/v" version "/dealii-" version ".tar.gz"))
4028 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
4029 (modules '((guix build utils)))
4031 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
4033 (delete-file-recursively "bundled")
4035 (build-system cmake-build-system)
4043 ("arpack" ,arpack-ng)
4044 ("muparser" ,muparser)
4045 ("gfortran" ,gfortran)
4046 ("suitesparse" ,suitesparse))) ;for UMFPACK
4048 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
4050 ;; Work around a bug in libsuitesparseconfig linking
4051 ;; see https://github.com/dealii/dealii/issues/4745
4052 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
4053 (home-page "https://www.dealii.org")
4054 (synopsis "Finite element library")
4056 "Deal.II is a C++ program library targeted at the computational solution
4057 of partial differential equations using adaptive finite elements. The main
4058 aim of deal.II is to enable rapid development of modern finite element codes,
4059 using among other aspects adaptive meshes and a wide array of tools often used
4060 in finite element programs.")
4061 (license license:lgpl2.1+)))
4063 (define-public dealii-openmpi
4064 (package (inherit dealii)
4065 (name "dealii-openmpi")
4068 ;;Supported only with MPI:
4069 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4070 ("p4est" ,p4est-openmpi)
4071 ("petsc" ,petsc-openmpi)
4072 ("slepc" ,slepc-openmpi)
4073 ("metis" ,metis) ;for MUMPS
4074 ("scalapack" ,scalapack) ;for MUMPS
4075 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4076 ("arpack" ,arpack-ng-openmpi)
4077 ,@(fold alist-delete (package-inputs dealii)
4078 '("p4est" "arpack"))))
4080 (substitute-keyword-arguments (package-arguments dealii)
4081 ((#:configure-flags cf)
4082 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4084 ((#:phases phases '%standard-phases)
4085 `(modify-phases ,phases
4086 (add-before 'check 'mpi-setup
4087 ,%openmpi-setup)))))
4088 (synopsis "Finite element library (with MPI support)")))
4090 (define-public flann
4094 (home-page "https://github.com/mariusmuja/flann/")
4098 (uri (git-reference (url home-page) (commit version)))
4099 (file-name (git-file-name name version))
4102 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4103 (patches (search-patches "flann-cmake-3.11.patch"))))
4104 (build-system cmake-build-system)
4107 `(("unzip" ,unzip)))
4110 ;; FIXME: 'mkoctfile' fails with a linker error:
4111 ;; ld: cannot find -loctinterp
4112 ;; ld: cannot find -loctave
4113 ;; Disable it for now.
4114 ;;("octave" ,octave-cli)
4115 ("python" ,python-2) ; print syntax
4116 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4119 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4120 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4121 #:strip-directories '("lib" "lib64" "libexec"
4122 "bin" "sbin" "share/flann/octave")
4124 ;; Save 12 MiB by not installing .a files. Passing
4125 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4126 #:phases (modify-phases %standard-phases
4127 (add-after 'install 'remove-static-libraries
4128 (lambda* (#:key outputs #:allow-other-keys)
4129 (let* ((out (assoc-ref outputs "out"))
4130 (lib (string-append out "/lib")))
4131 (for-each delete-file
4132 (find-files lib "\\.a$"))
4135 #:tests? #f)) ; The test data are downloaded from the Internet.
4136 (synopsis "Library for approximate nearest neighbors computation")
4137 (description "FLANN is a library for performing fast approximate
4138 nearest neighbor searches in high dimensional spaces. It implements a
4139 collection of algorithms and a system for automatically choosing the best
4140 algorithm and optimum parameters depending on the dataset.
4142 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4143 (license (license:non-copyleft "file://COPYING"
4144 "See COPYING in the distribution."))))
4146 (define-public wcalc
4153 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4154 "wcalc-" version ".tar.bz2"))
4157 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4158 (build-system gnu-build-system)
4161 ("readline" ,readline)))
4162 (home-page "http://w-calc.sourceforge.net/index.php")
4163 (synopsis "Flexible command-line scientific calculator")
4164 (description "Wcalc is a very capable calculator. It has standard functions
4165 (sin, asin, and sinh for example, in either radians or degrees), many
4166 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4167 variables, a command history, hex/octal/binary input and output, unit
4168 conversions, embedded comments, and an expandable expression entry field. It
4169 evaluates expressions using the standard order of operations.")
4170 (license license:gpl2+)))
4179 (url "https://github.com/xaos-project/XaoS")
4180 (commit (string-append "release-" version))))
4181 (file-name (git-file-name name version))
4184 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4185 (build-system gnu-build-system)
4186 (native-inputs `(("gettext" ,gettext-minimal)
4188 ("qttools" ,qttools)))
4189 (inputs `(("libx11" ,libx11)
4193 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4194 ;; not enough for this package to install properly. These phases fix that.
4196 `(#:tests? #f ;no "check" target
4198 (modify-phases %standard-phases
4199 (add-before 'configure 'make-qt-deterministic
4201 ;; Make Qt deterministic.
4202 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4205 (lambda* (#:key outputs #:allow-other-keys)
4206 (let ((out (assoc-ref outputs "out")))
4207 ;; The DESTDIR is originally set to install the xaos binary to
4208 ;; the "bin" folder inside the build directory. Setting make
4209 ;; flags doesn't seem to change this.
4210 (substitute* "XaoS.pro"
4212 (string-append "DESTDIR=" out "/bin")))
4213 (substitute* "src/include/config.h"
4214 (("/usr/share/XaoS")
4215 (string-append out "/share/XaoS")))
4217 (add-after 'install 'install-data
4218 (lambda* (#:key outputs #:allow-other-keys)
4219 (let* ((out (assoc-ref outputs "out"))
4220 (share (string-append out "/share")))
4224 (copy-recursively folder
4225 (string-append share "/XaoS/" folder)))
4226 '("catalogs" "examples" "tutorial"))
4227 (install-file "xdg/xaos.png"
4228 (string-append share "/pixmaps"))
4229 (install-file "xdg/xaos.desktop"
4230 (string-append share "/applications")))
4232 (synopsis "Real-time fractal zoomer")
4233 (description "GNU XaoS is a graphical program that generates fractal
4234 patterns and allows you to zoom in and out of them infinitely in a fluid,
4235 continuous manner. It also includes tutorials that help to explain how fractals
4236 are built. It can generate many different fractal types such as the Mandelbrot
4238 (home-page "https://xaos-project.github.io/")
4239 (license license:gpl2+)))
4241 (define-public hypre
4249 (url "https://github.com/LLNL/hypre")
4250 (commit (string-append "v" version))))
4251 (file-name (git-file-name name version))
4253 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4254 (modules '((guix build utils)))
4257 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4258 ;; substitute the release date.
4259 (substitute* "src/utilities/HYPRE_utilities.h"
4260 (("Date Compiled: .*$")
4261 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4263 (build-system gnu-build-system)
4264 (outputs '("out" ; 6.1 MiB of headers and libraries
4265 "doc")) ; 4.8 MiB of documentation
4269 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4270 ("texlive" ,(texlive-union (list texlive-xypic
4272 texlive-latex-hyperref
4274 ("ghostscript" ,ghostscript)))
4276 `(("blas" ,openblas)
4277 ("lapack" ,lapack)))
4279 `(#:modules ((srfi srfi-1)
4280 ,@%gnu-build-system-modules)
4281 #:configure-flags '("--enable-shared"
4289 (modify-phases %standard-phases
4290 (add-before 'build 'set-HOME
4292 ;; FIXME: texlive-union does not find the built
4293 ;; metafonts, so it tries to generate them in HOME.
4294 (setenv "HOME" "/tmp")
4296 (add-before 'configure 'chdir-src
4297 (lambda _ (chdir "src")))
4299 (lambda* (#:key build target configure-flags
4300 #:allow-other-keys #:rest args)
4301 (let* ((configure (assoc-ref %standard-phases 'configure)))
4304 (list #:configure-flags
4305 (cons (string-append
4306 "--host=" (or target build))
4307 configure-flags)))))))
4308 (add-after 'build 'build-docs
4310 (invoke "make" "-Cdocs" "pdf" "html")))
4313 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4314 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4315 (invoke "make" "check" "CHECKRUN=")
4316 (for-each (lambda (filename)
4317 (let ((size (stat:size (stat filename))))
4318 (when (positive? size)
4319 (error (format #f "~a size ~d; error indication~%"
4321 (find-files "test" ".*\\.err$"))
4323 (add-after 'install 'install-docs
4324 (lambda* (#:key outputs #:allow-other-keys)
4325 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4326 (let* ((doc (assoc-ref outputs "doc"))
4327 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4328 (with-directory-excursion "docs"
4329 (for-each (lambda (base)
4330 (install-file (string-append base ".pdf") docdir)
4331 (copy-recursively base docdir)) ; html docs
4332 '("HYPRE_usr_manual"
4333 "HYPRE_ref_manual")))
4335 (home-page "http://www.llnl.gov/casc/hypre/")
4336 (synopsis "Library of solvers and preconditioners for linear equations")
4338 "HYPRE is a software library of high performance preconditioners and
4339 solvers for the solution of large, sparse linear systems of equations. It
4340 features multigrid solvers for both structured and unstructured grid
4342 (license license:lgpl2.1)))
4344 (define-public hypre-openmpi
4345 (package (inherit hypre)
4346 (name "hypre-openmpi")
4349 ,@(package-inputs hypre)))
4351 (substitute-keyword-arguments (package-arguments hypre)
4352 ((#:configure-flags flags)
4354 ,@(delete "--without-MPI" ,flags)))
4356 `(modify-phases ,phases
4357 (add-before 'check 'mpi-setup
4358 ,%openmpi-setup)))))
4359 (synopsis "Parallel solvers and preconditioners for linear equations")
4361 "HYPRE is a software library of high performance preconditioners and
4362 solvers for the solution of large, sparse linear systems of equations on
4363 parallel computers. It features parallel multigrid solvers for both
4364 structured and unstructured grid problems.")))
4366 (define-public matio
4373 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4374 "matio-" version ".tar.gz"))
4377 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4378 (build-system gnu-build-system)
4382 (home-page "http://matio.sourceforge.net/")
4383 (synopsis "Library for reading and writing MAT files")
4384 (description "Matio is a library for reading and writing MAT files. It
4385 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4386 (license license:bsd-2)))
4393 (origin (method url-fetch)
4394 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4395 "download/" version "/Vc-" version ".tar.gz"))
4398 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4399 (build-system cmake-build-system)
4402 '("-DBUILD_TESTING=ON"
4403 ;; By default, Vc will optimize for the CPU of the build machine.
4404 ;; Setting this to "none" makes it create portable binaries. See
4405 ;; "cmake/OptimizeForArchitecture.cmake".
4406 "-DTARGET_ARCHITECTURE=none")
4407 #:phases (modify-phases %standard-phases
4408 (add-after 'unpack 'copy-testdata
4409 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4410 (let ((testdata (assoc-ref (or native-inputs inputs)
4412 (copy-recursively testdata "tests/testdata")
4415 `(("virtest" ,virtest)
4417 ;; This is a submodule in the git project, but not part of the
4418 ;; released sources. See the git branch for the commit to take.
4419 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4423 (url "https://github.com/VcDevel/vc-testdata")
4424 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4425 (file-name (git-file-name "vc-testdata"
4426 (string-take commit 7)))
4429 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4430 (synopsis "SIMD vector classes for C++")
4431 (description "Vc provides portable, zero-overhead C++ types for explicitly
4432 data-parallel programming. It is a library designed to ease explicit
4433 vectorization of C++ code. Its types enable explicitly stating data-parallel
4434 operations on multiple values. The parallelism is therefore added via the type
4435 system. Vc has an intuitive API and provides portability between different
4436 compilers and compiler versions as well as portability between different vector
4437 instruction sets. Thus, an application written with Vc can be compiled for:
4440 @item SSE2 up to SSE4.2 or SSE4a
4443 @item NEON (in development)
4444 @item NVIDIA GPUs / CUDA (in development)
4446 (home-page "https://github.com/VcDevel/Vc")
4447 ;; "No support_???.cpp file exists for this architecture."
4448 (supported-systems '("x86_64-linux" "i686-linux"))
4449 (license license:bsd-3)))
4451 (define-public reducelcs
4452 ;; This is the last commit which is available upstream, no
4453 ;; release happened since 2010.
4454 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4458 (version (string-append "1.0-" revision "." (string-take commit 7)))
4463 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4465 (file-name (string-append name "-" version "-checkout"))
4468 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4469 (build-system gnu-build-system)
4471 `(("openlibm" ,openlibm)))
4473 `(#:tests? #f ; no tests
4475 (modify-phases %standard-phases
4476 (delete 'configure) ; No configure script exists.
4477 (replace 'install ; No install phase exists.
4478 (lambda* (#:key outputs #:allow-other-keys)
4479 (let* ((out (assoc-ref outputs "out"))
4480 (bin (string-append out "/bin")))
4481 (install-file "Approximation" bin)
4482 (install-file "CollectResults" bin)
4483 (install-file "GenerateInstances" bin)
4485 (synopsis "Approximate Longest Commons Subsequence computation tool")
4487 "@code{reduceLCS} is an implementation of the Reduce-Expand
4488 algorithm for LCS. It is a fast program to compute the approximate
4489 Longest Commons Subsequence of a set of strings.")
4490 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4491 (license license:gpl3+))))
4493 (define-public jacal
4500 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4503 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4504 (patches (search-patches "jacal-fix-texinfo.patch"))))
4505 (build-system gnu-build-system)
4508 (modify-phases %standard-phases
4509 (add-before 'build 'pre-build
4510 ;; Don't use upstream's script - it really doesn't fit into
4511 ;; Guix's functional paradigm.
4512 (lambda* (#:key inputs outputs #:allow-other-keys)
4513 (substitute* "Makefile"
4514 (("^install: install-script") "install: "))))
4515 (add-after 'install 'post-install
4516 ;; Instead, we provide our own simplified script.
4517 (lambda* (#:key inputs outputs #:allow-other-keys)
4518 (let ((wrapper (string-append (assoc-ref outputs "out")
4520 (format (open wrapper (logior O_WRONLY O_CREAT))
4521 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4522 "-e '(slib:load \"~a/lib/jacal/math\") "
4525 (assoc-ref inputs "scm")
4526 (assoc-ref outputs "out"))
4527 (chmod wrapper #o555))))
4529 (lambda* (#:key outputs #:allow-other-keys)
4530 (invoke "./configure"
4531 (string-append "--prefix="
4532 (assoc-ref outputs "out"))))))))
4533 (inputs `(("scm" ,scm)))
4534 (native-inputs `(("unzip" ,unzip)
4535 ("texinfo" ,texinfo)))
4536 (synopsis "Symbolic mathematics system")
4537 (description "GNU JACAL is an interactive symbolic mathematics program based on
4538 Scheme. It manipulate and simplify a range of mathematical expressions such
4539 as equations, scalars, vectors, and matrices.")
4540 (home-page "https://www.gnu.org/software/jacal/")
4541 (license license:gpl3+)))
4547 (home-page "https://github.com/Z3Prover/z3")
4550 (uri (git-reference (url home-page)
4551 (commit (string-append "z3-" version))))
4552 (file-name (git-file-name name version))
4555 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
4556 (build-system gnu-build-system)
4558 `(#:imported-modules ((guix build python-build-system)
4559 ,@%gnu-build-system-modules)
4560 #:modules (((guix build python-build-system) #:select (site-packages))
4561 (guix build gnu-build-system)
4564 (modify-phases %standard-phases
4565 (add-after 'unpack 'enable-bytecode-determinism
4567 (setenv "PYTHONHASHSEED" "0")
4569 (add-after 'unpack 'fix-compatability
4570 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4572 (substitute* "src/util/mpz.cpp"
4573 (("#include <immintrin.h>") ""))
4575 (add-before 'configure 'bootstrap
4577 (invoke "python" "scripts/mk_make.py")))
4578 ;; work around gnu-build-system's setting --enable-fast-install
4579 ;; (z3's `configure' is a wrapper around the above python file,
4580 ;; which fails when passed --enable-fast-install)
4582 (lambda* (#:key inputs outputs #:allow-other-keys)
4583 (invoke "./configure"
4585 (string-append "--prefix=" (assoc-ref outputs "out"))
4586 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4587 (add-after 'configure 'change-directory
4591 (add-before 'check 'make-test-z3
4593 ;; Build the test suite executable.
4594 (invoke "make" "test-z3" "-j"
4595 (number->string (parallel-job-count)))))
4598 ;; Run all the tests that don't require arguments.
4599 (invoke "./test-z3" "/a"))))))
4602 ("python" ,python-wrapper)))
4603 (synopsis "Theorem prover")
4604 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4605 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4606 (license license:expat)))
4611 (version "2018.11.001")
4614 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4615 version "/elpa-" version ".tar.gz"))
4618 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4619 (build-system gnu-build-system)
4621 `(("fortran" ,gfortran)
4622 ("perl" ,perl))) ;for configure and deps
4624 `(("blas" ,openblas)))
4629 ;; ELPA unfortunately does not support runtime dispatch, so we can
4630 ;; only enable the "generic" kernels. See the "Cross compilation"
4631 ;; section of INSTALL.md.
4633 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4634 "--disable-avx" "--disable-avx2" "--disable-avx512"
4635 ,(string-append "CFLAGS=-O3 "
4636 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4637 "-ftree-vect-loop-version -ftree-vectorize "
4638 ,(let ((system (or (%current-target-system)
4639 (%current-system))))
4641 ((or (string-prefix? "x86_64" system)
4642 (string-prefix? "i686" system))
4645 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4647 (modify-phases %standard-phases
4648 (add-before 'configure 'patch-header-generation
4650 (substitute* "configure"
4651 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4652 (string-append & " CPP=\"$CPP\"")))
4654 (add-before 'check 'setup-tests
4656 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4657 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4658 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4659 ;; for Fortran. This also causes several tests to pass that
4660 ;; otherwise would otherwise fail with matrix size 5000; possibly
4661 ;; due to floating point tolerances that are too tight.
4662 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4663 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4664 (substitute* "Makefile"
4665 ;; Test scripts are generated, patch the shebang
4666 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4668 (home-page "http://elpa.mpcdf.mpg.de")
4669 (synopsis "Eigenvalue solvers for symmetric matrices")
4671 "The ELPA library provides efficient and scalable direct eigensolvers for
4672 symmetric matrices.")
4673 (license license:lgpl3)))
4675 (define-public elpa-openmpi
4676 (package (inherit elpa)
4677 (name "elpa-openmpi")
4680 ("scalapack" ,scalapack)
4681 ,@(package-inputs elpa)))
4683 (substitute-keyword-arguments (package-arguments elpa)
4684 ((#:configure-flags cf '())
4685 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4686 ((#:phases phases '%standard-phases)
4687 `(modify-phases ,phases
4688 (add-before 'check 'mpi-setup
4690 ;; Tests use 2 mpi tasks by default, use our remaining build
4691 ;; cores as OpenMP threads.
4692 (setenv "OMP_NUM_THREADS" (number->string
4693 (max (quotient (parallel-job-count) 2)
4695 (,%openmpi-setup)))))))
4696 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4698 (define-public elemental
4705 (url "https://github.com/elemental/Elemental")
4706 (commit (string-append "v" version))))
4707 (file-name (git-file-name name version))
4710 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4711 (build-system cmake-build-system)
4712 (home-page "https://github.com/elemental/Elemental")
4714 `(("gfortran" ,gfortran)))
4716 `(("blas" ,openblas)
4717 ("gfortran:lib" ,gfortran "lib")
4726 `(#:build-type "Release" ;default RelWithDebInfo not supported
4727 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4728 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4729 "-DEL_CACHE_WARNINGS:BOOL=YES"
4730 "-DEL_TESTS:BOOL=YES"
4731 "-DCMAKE_INSTALL_LIBDIR=lib"
4732 "-DGFORTRAN_LIB=gfortran")
4733 #:phases (modify-phases %standard-phases
4734 (add-before 'check 'mpi-setup
4736 (add-before 'check 'setup-tests
4738 ;; Parallelism is done at the MPI layer.
4739 (setenv "OMP_NUM_THREADS" "1")
4741 (add-after 'install 'remove-tests
4742 (lambda* (#:key outputs #:allow-other-keys)
4743 ;; Tests are installed, with no easy configuration
4744 ;; switch to prevent this, so delete them.
4745 (delete-file-recursively
4746 (string-append (assoc-ref outputs "out") "/bin"))
4748 (synopsis "Dense and sparse-direct linear algebra and optimization")
4749 (description "Elemental is a modern C++ library for distributed-memory
4750 dense and sparse-direct linear algebra, conic optimization, and lattice
4752 (license license:bsd-2)))
4754 (define-public mcrl2
4757 (version "202006.0")
4761 "https://www.mcrl2.org/download/release/mcrl2-"
4765 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4770 ("qtbase" ,qtbase)))
4771 (build-system cmake-build-system)
4772 (synopsis "Toolset for the mCRL2 formal specification language")
4774 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4775 specification language for describing concurrent discrete event systems. Its
4776 toolset supports analysis and automatic verification, linearisation, simulation,
4777 state-space exploration and generation, and tools to optimise and analyse
4778 specifications. Also, state spaces can be manipulated, visualised and
4780 (home-page "https://mcrl2.org")
4781 (license license:boost1.0)))
4783 (define-public mcrl2-minimal
4786 (name "mcrl2-minimal")
4788 `(("boost" ,boost)))
4790 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4792 (define-public tcalc
4799 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4803 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4804 (build-system gnu-build-system)
4805 (synopsis "The terminal calculator")
4807 "The terminal calculator is a small program to help users of the GNU/Linux
4808 terminal do calculations simply and quickly. The formula to be calculated can
4809 be fed to @command{tcalc} through the command line.")
4810 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4811 (license license:gpl3+)))
4813 (define-public sundials
4820 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4821 "sundials-" version ".tar.gz"))
4824 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4825 (build-system cmake-build-system)
4827 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4829 `(("fortran" ,gfortran) ;for fcmix
4831 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4833 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4834 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4835 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4836 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4837 "-DEXAMPLES_INSTALL:BOOL=OFF"
4839 "-DFCMIX_ENABLE:BOOL=ON"
4841 "-DKLU_ENABLE:BOOL=ON"
4842 ,(string-append "-DKLU_INCLUDE_DIR="
4843 (assoc-ref %build-inputs "suitesparse")
4845 ,(string-append "-DKLU_LIBRARY_DIR="
4846 (assoc-ref %build-inputs "suitesparse")
4848 (home-page "https://computation.llnl.gov/projects/sundials")
4849 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4850 (description "SUNDIALS is a family of software packages implemented with
4851 the goal of providing robust time integrators and nonlinear solvers that can
4852 easily be incorporated into existing simulation codes.")
4853 (license license:bsd-3)))
4855 (define-public sundials-openmpi
4856 (package (inherit sundials)
4857 (name "sundials-openmpi")
4860 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4861 ,@(package-inputs sundials)))
4863 (substitute-keyword-arguments (package-arguments sundials)
4864 ((#:configure-flags flags '())
4865 `(cons* "-DMPI_ENABLE:BOOL=ON"
4866 "-DPETSC_ENABLE:BOOL=ON"
4867 (string-append "-DPETSC_INCLUDE_DIR="
4868 (assoc-ref %build-inputs "petsc")
4870 (string-append "-DPETSC_LIBRARY_DIR="
4871 (assoc-ref %build-inputs "petsc")
4874 ((#:phases phases '%standard-phases)
4875 `(modify-phases ,phases
4876 (add-before 'check 'mpi-setup
4877 ,%openmpi-setup)))))
4878 (synopsis "SUNDIALS with OpenMPI support")))
4880 (define-public combinatorial-blas
4882 (name "combinatorial-blas")
4887 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4889 (match (string-split version #\.)
4890 ((major minor patch)
4891 (string-append major minor "_" patch))) ;e.g. "16_2"
4895 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4896 (patches (search-patches "combinatorial-blas-awpm.patch"
4897 "combinatorial-blas-io-fix.patch"))))
4898 (build-system cmake-build-system)
4901 ("test-data" ,(origin
4903 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4904 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4907 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4909 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4910 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4911 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4913 (modify-phases %standard-phases
4914 (add-before 'check 'mpi-setup
4916 (add-before 'check 'test-setup
4917 (lambda* (#:key inputs #:allow-other-keys)
4918 (setenv "OMP_NUM_THREADS" "2")
4919 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4920 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4921 (synopsis "Linear algebra primitives for graph analytics")
4922 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4923 distributed-memory parallel graph library offering a small but powerful set of
4924 linear algebra primitives specifically targeting graph analytics.")
4926 license:gpl2+ ;include/psort/(funnel|sort)*.h
4927 license:x11 ;usort and psort
4928 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4930 (define-public dune-common
4932 (name "dune-common")
4937 (uri (string-append "https://dune-project.org/download/"
4938 version "/dune-common-" version ".tar.gz"))
4941 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
4942 (build-system cmake-build-system)
4945 (modify-phases %standard-phases
4946 (add-after 'build 'build-tests
4947 (lambda* (#:key make-flags #:allow-other-keys)
4948 (apply invoke "make" "build_tests" make-flags))))))
4952 ("openblas" ,openblas)
4954 ("superlu" ,superlu)))
4956 `(("gfortran" ,gfortran)
4957 ("pkg-config" ,pkg-config)))
4958 (home-page "https://dune-project.org/")
4959 (synopsis "Distributed and Unified Numerics Environment")
4960 (description "DUNE, the Distributed and Unified Numerics Environment is a
4961 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4962 grid-based methods. It supports the easy implementation of methods like
4963 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4964 Differences} (FD).")
4965 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4966 (license license:gpl2)))
4968 (define-public dune-geometry
4970 (name "dune-geometry")
4975 (uri (string-append "https://dune-project.org/download/"
4976 version "/dune-geometry-" version ".tar.gz"))
4979 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
4980 (build-system cmake-build-system)
4983 (modify-phases %standard-phases
4984 (add-after 'build 'build-tests
4985 (lambda* (#:key make-flags #:allow-other-keys)
4986 (apply invoke "make" "build_tests" make-flags))))))
4988 `(("dune-common" ,dune-common)
4990 ("openblas" ,openblas)
4992 ("python" ,python)))
4994 `(("gfortran" ,gfortran)
4995 ("pkg-config" ,pkg-config)))
4996 (home-page "https://dune-project.org/")
4997 (synopsis "Distributed and Unified Numerics Environment")
4998 (description "DUNE, the Distributed and Unified Numerics Environment is a
4999 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5000 grid-based methods. It supports the easy implementation of methods like
5001 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5004 This package contains the basic DUNE geometry classes.")
5005 ;; GPL version 2 with "runtime exception"
5006 (license license:gpl2)))
5008 (define-public dune-uggrid
5010 (name "dune-uggrid")
5016 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
5017 (commit (string-append "v" version))))
5018 (file-name (git-file-name name version))
5021 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
5022 (build-system cmake-build-system)
5025 (modify-phases %standard-phases
5026 (add-after 'build 'build-tests
5027 (lambda* (#:key make-flags #:allow-other-keys)
5028 (apply invoke "make" "build_tests" make-flags))))))
5030 `(("dune-common" ,dune-common)))
5032 `(("gfortran" ,gfortran)
5033 ("pkg-config" ,pkg-config)))
5034 (home-page "https://dune-project.org/")
5035 (synopsis "Distributed and Unified Numerics Environment")
5036 (description "DUNE, the Distributed and Unified Numerics Environment is a
5037 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5038 grid-based methods. It supports the easy implementation of methods like
5039 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5042 This package contains the DUNE UG grid classes.")
5043 (license license:lgpl2.1)))
5045 (define-public dune-grid
5052 (uri (string-append "https://dune-project.org/download/"
5053 version "/dune-grid-" version ".tar.gz"))
5056 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5057 (build-system cmake-build-system)
5060 (modify-phases %standard-phases
5061 (add-after 'build 'build-tests
5062 (lambda* (#:key make-flags #:allow-other-keys)
5063 (apply invoke "make" "build_tests" make-flags))))))
5065 `(("dune-common" ,dune-common)
5066 ("dune-geometry" ,dune-geometry)
5069 ("openblas" ,openblas)
5070 ("python" ,python)))
5072 `(("dune-uggrid" ,dune-uggrid)))
5074 `(("gfortran" ,gfortran)
5075 ("pkg-config" ,pkg-config)))
5076 (home-page "https://dune-project.org/")
5077 (synopsis "Distributed and Unified Numerics Environment")
5078 (description "DUNE, the Distributed and Unified Numerics Environment is a
5079 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5080 grid-based methods. It supports the easy implementation of methods like
5081 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5084 This package contains the basic DUNE grid classes.")
5085 ;; GPL version 2 with "runtime exception"
5086 (license license:gpl2)))
5088 (define-public dune-istl
5095 (uri (string-append "https://dune-project.org/download/"
5096 version "/dune-istl-" version ".tar.gz"))
5099 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5100 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5101 (build-system cmake-build-system)
5104 (modify-phases %standard-phases
5105 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5106 ;; the stdlib types when the gfortran header is used. Remove gfortran
5107 ;; from CPLUS_INCLUDE_PATH as a workaround.
5108 (add-after 'set-paths 'hide-gfortran
5109 (lambda* (#:key inputs #:allow-other-keys)
5110 (let ((gfortran (assoc-ref inputs "gfortran")))
5111 (setenv "CPLUS_INCLUDE_PATH"
5113 (delete (string-append gfortran "/include/c++")
5114 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5117 (add-after 'build 'build-tests
5118 (lambda* (#:key make-flags #:allow-other-keys)
5119 (apply invoke "make" "build_tests" make-flags))))))
5121 `(("dune-common" ,dune-common)
5124 ("suitesparse" ,suitesparse)
5125 ("superlu" ,superlu)
5126 ("openblas" ,openblas)
5128 ("python" ,python)))
5130 `(("gfortran" ,gfortran)
5131 ("pkg-config" ,pkg-config)))
5132 (home-page "https://dune-project.org/")
5133 (synopsis "Distributed and Unified Numerics Environment")
5134 (description "DUNE, the Distributed and Unified Numerics Environment is a
5135 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5138 This is the iterative solver template library which provides generic sparse
5139 matrix/vector classes and a variety of solvers based on these classes. A
5140 special feature is the use of templates to exploit the recursive block
5141 structure of finite element matrices at compile time. Available solvers
5142 include Krylov methods, (block-) incomplete decompositions and
5143 aggregation-based algebraic multigrid.")
5144 ;; GPL version 2 with "runtime exception"
5145 (license license:gpl2)))
5147 (define-public dune-localfunctions
5149 (name "dune-localfunctions")
5154 (uri (string-append "https://dune-project.org/download/"
5155 version "/dune-localfunctions-" version ".tar.gz"))
5158 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5159 (build-system cmake-build-system)
5162 (modify-phases %standard-phases
5163 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5164 ;; and fails to find the stdlib types when the gfortran header is used.
5165 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5166 (add-after 'set-paths 'hide-gfortran
5167 (lambda* (#:key inputs #:allow-other-keys)
5168 (let ((gfortran (assoc-ref inputs "gfortran")))
5169 (setenv "CPLUS_INCLUDE_PATH"
5171 (delete (string-append gfortran "/include/c++")
5172 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5175 (add-after 'build 'build-tests
5176 (lambda* (#:key make-flags #:allow-other-keys)
5177 (apply invoke "make" "build_tests" make-flags))))))
5179 `(("dune-common" ,dune-common)
5180 ("dune-geometry" ,dune-geometry)
5183 ("superlu" ,superlu)
5186 `(("gfortran" ,gfortran)
5187 ("pkg-config" ,pkg-config)))
5188 (home-page "https://dune-project.org/")
5189 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5190 (description "This DUNE module provides interface and implementation for
5191 shape functions defined on the DUNE reference elements. In addition to the
5192 shape function, interpolation operators and special keys are provided which
5193 can be used to assemble global function spaces on finite-element grids.
5195 This package provides an interface and implementation for shape functions
5196 defined on the DUNE reference elements. In addition to the shape function,
5197 interpolation operators and special keys are provided which can be used to
5198 assemble global function spaces on finite-element grids.")
5199 ;; GPL version 2 with "runtime exception"
5200 (license license:gpl2)))
5202 (define-public dune-alugrid
5204 (name "dune-alugrid")
5205 (version "2.7.0-git-81d35682")
5210 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5211 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5212 (file-name (git-file-name name version))
5215 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5216 (build-system cmake-build-system)
5219 (modify-phases %standard-phases
5220 (add-after 'unpack 'patch-include
5222 (substitute* "dune/alugrid/test/test-alugrid.cc"
5223 (("doc/grids/gridfactory/testgrids")
5224 "doc/dune-grid/grids/gridfactory/testgrids"))
5226 (add-after 'build 'build-tests
5227 (lambda* (#:key inputs make-flags #:allow-other-keys)
5228 (setenv "CPLUS_INCLUDE_PATH"
5229 (string-append (assoc-ref inputs "dune-grid") "/share"))
5230 (apply invoke "make" "build_tests" make-flags))))))
5232 `(("dune-common" ,dune-common)
5233 ("dune-geometry" ,dune-geometry)
5234 ("dune-grid" ,dune-grid)
5237 ("openblas" ,openblas)
5239 ("superlu" ,superlu)
5243 `(("gfortran" ,gfortran)
5244 ("pkg-config" ,pkg-config)))
5245 (home-page "https://dune-project.org/")
5246 (synopsis "Distributed and Unified Numerics Environment")
5247 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5248 implementation of the DUNE grid interface supporting either simplices or
5250 (license license:gpl2+)))
5252 (define-public dune-subgrid
5254 (name "dune-subgrid")
5255 (version "2.7.0-git-2103a363")
5260 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5261 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5262 (file-name (git-file-name name version))
5265 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5266 (build-system cmake-build-system)
5269 (modify-phases %standard-phases
5270 (add-after 'build 'build-tests
5271 (lambda* (#:key make-flags #:allow-other-keys)
5272 (apply invoke "make" "build_tests" make-flags))))))
5274 `(("dune-common" ,dune-common)
5275 ("dune-geometry" ,dune-geometry)
5276 ("dune-grid" ,dune-grid)
5279 ("openblas" ,openblas)
5282 `(("gfortran" ,gfortran)
5283 ("pkg-config" ,pkg-config)))
5284 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5285 (synopsis "Distributed and Unified Numerics Environment")
5286 (description "The dune-subgrid module marks elements of
5287 another hierarchical dune grid. The set of marked elements can then be
5288 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5289 provides the full grid interface including adaptive mesh refinement.")
5290 (license license:gpl2+)))
5292 (define-public dune-typetree
5294 (name "dune-typetree")
5300 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5301 (commit (string-append "v" version))))
5302 (file-name (git-file-name name version))
5305 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5306 (build-system cmake-build-system)
5309 (modify-phases %standard-phases
5310 (add-after 'build 'build-tests
5311 (lambda* (#:key make-flags #:allow-other-keys)
5312 (apply invoke "make" "build_tests" make-flags))))))
5314 `(("dune-common" ,dune-common)
5316 ("openblas" ,openblas)
5319 ("superlu" ,superlu)
5322 `(("gfortran" ,gfortran)
5323 ("pkg-config" ,pkg-config)))
5324 (home-page "https://dune-project.org/")
5325 (synopsis "Distributed and Unified Numerics Environment")
5326 (description "TypeTree is a template library for constructing and
5327 operating on statically typed trees of objects.")
5328 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5329 (license (list license:lgpl3+ license:gpl2))))
5331 (define-public dune-functions
5333 (name "dune-functions")
5339 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5340 (commit (string-append "v" version))))
5341 (file-name (git-file-name name version))
5344 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5345 (build-system cmake-build-system)
5348 (modify-phases %standard-phases
5349 (add-after 'unpack 'disable-failing-tests
5352 ;; unable to load GMSH file in this test
5353 "--exclude-regex gridviewfunctionspacebasistest")
5355 (add-after 'build 'build-tests
5356 (lambda* (#:key make-flags #:allow-other-keys)
5357 (apply invoke "make" "build_tests" make-flags))))))
5359 `(("dune-common" ,dune-common)
5360 ("dune-istl" ,dune-istl)
5361 ("dune-localfunctions" ,dune-localfunctions)
5362 ("dune-grid" ,dune-grid)
5363 ("dune-geometry" ,dune-geometry)
5364 ("dune-typetree" ,dune-typetree)
5365 ("openblas" ,openblas)
5368 ("superlu" ,superlu)
5371 `(("gfortran" ,gfortran)
5372 ("pkg-config" ,pkg-config)))
5373 (home-page "https://dune-project.org/")
5374 (synopsis "Distributed and Unified Numerics Environment")
5375 (description "The dune-functions module provides an abstraction layer for
5376 global finite element functions. Its two main concepts are functions
5377 implemented as callable objects, and bases of finite element spaces.")
5378 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5379 (license (list license:lgpl3+ license:gpl2))))
5381 (define-public dune-pdelab
5383 (name "dune-pdelab")
5384 (version "2.7.0-git-476fe437")
5389 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5390 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5391 (file-name (git-file-name name version))
5394 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5395 (build-system cmake-build-system)
5396 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5398 `(("dune-common" ,dune-common)
5399 ("dune-istl" ,dune-istl)
5400 ("dune-localfunctions" ,dune-localfunctions)
5401 ("dune-geometry" ,dune-geometry)
5402 ("dune-grid" ,dune-grid)
5403 ("dune-typetree" ,dune-typetree)
5404 ("dune-functions" ,dune-functions)
5406 ("openblas" ,openblas)
5410 ("superlu" ,superlu)
5413 `(("gfortran" ,gfortran)
5414 ("pkg-config" ,pkg-config)))
5415 (home-page "https://dune-project.org/")
5416 (synopsis "Differential equations solver toolbox")
5417 (description "PDELab is a partial differential equations solver toolbox
5418 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5419 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5420 (license (list license:lgpl3+ license:gpl2))))
5422 (define add-openmpi-to-dune-package
5423 (let ((dune-package?
5424 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5427 (if (dune-package? p)
5428 (package (inherit p)
5429 (name (string-append (package-name p) "-openmpi"))
5430 (inputs `(,@(package-inputs p)
5431 ("openmpi" ,openmpi)))
5433 (substitute-keyword-arguments (package-arguments p)
5434 ((#:phases phases '%standard-phases)
5435 `(modify-phases ,phases
5436 (add-before 'check 'mpi-setup
5437 ,%openmpi-setup)))))
5438 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5440 (negate dune-package?))))
5442 (define-public dune-common-openmpi
5443 (add-openmpi-to-dune-package dune-common))
5445 (define-public dune-geometry-openmpi
5446 (add-openmpi-to-dune-package dune-geometry))
5448 (define-public dune-istl-openmpi
5449 (add-openmpi-to-dune-package dune-istl))
5451 (define-public dune-typetree-openmpi
5452 (add-openmpi-to-dune-package dune-typetree))
5454 (define-public dune-uggrid-openmpi
5455 (add-openmpi-to-dune-package dune-uggrid))
5457 (define-public dune-grid-openmpi
5458 (add-openmpi-to-dune-package dune-grid))
5460 (define-public dune-alugrid-openmpi
5461 (add-openmpi-to-dune-package dune-alugrid))
5463 (define-public dune-subgrid-openmpi
5464 (add-openmpi-to-dune-package dune-subgrid))
5466 (define-public dune-localfunctions-openmpi
5467 (add-openmpi-to-dune-package dune-localfunctions))
5469 (define-public dune-functions-openmpi
5470 (add-openmpi-to-dune-package dune-functions))
5472 (define-public dune-pdelab-openmpi
5473 (add-openmpi-to-dune-package dune-pdelab))
5475 (define-public mlucas
5483 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5485 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5486 (build-system gnu-build-system)
5488 `(("python2" ,python-2)))
5490 `(#:tests? #f ; no tests
5492 (modify-phases %standard-phases
5496 (call-with-output-file "Makefile"
5498 (format port "CC = gcc
5499 CFLAGS = -O3 ~a -DUSE_THREADS
5500 LDLIBS = -lm -lpthread -lrt
5501 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5503 ,(let ((system (or (%current-target-system)
5504 (%current-system))))
5506 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5510 (lambda* (#:key outputs #:allow-other-keys)
5511 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5512 (install-file "Mlucas" bin)
5513 (install-file "primenet.py" bin))
5515 (home-page "https://www.mersenne.org")
5516 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5517 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5518 numbers in search of a world-record prime. You may use it to test any
5519 suitable number as you wish, but it is preferable that you do so in a
5520 coordinated fashion, as part of the Great Internet Mersenne Prime
5521 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5522 management via the GIMPS project's Primenet server.")
5523 (license license:gpl2+)))
5525 (define-public nauty
5533 "https://pallini.di.uniroma1.it/"
5534 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5536 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5537 (build-system gnu-build-system)
5538 (outputs '("out" "lib"))
5540 `(#:test-target "checks"
5541 #:configure-flags '("--enable-generic") ;prevent -march-native
5543 (modify-phases %standard-phases
5544 ;; Default make target does not build all available
5545 ;; executables. Create them now.
5546 (add-after 'build 'build-extra-programs
5548 (for-each (lambda (target) (invoke "make" target))
5549 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5551 ;; Upstream does not provide any install target.
5553 (lambda* (#:key outputs #:allow-other-keys)
5554 (let* ((out (assoc-ref outputs "out"))
5555 (lib-output (assoc-ref outputs "lib"))
5556 (bin (string-append out "/bin"))
5557 (doc (string-append out "/share/doc/nauty/"))
5558 (include (string-append lib-output "/include/nauty"))
5559 (lib (string-append lib-output "/lib/nauty")))
5560 (for-each (lambda (f) (install-file f bin))
5561 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5562 "bliss2dre" "catg" "checks6" "complg" "converseg"
5563 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5564 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5565 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5566 "gentourng" "gentreeg" "hamheuristic" "labelg"
5567 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5568 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5569 "sumlines" "twohamg" "underlyingg" "vcolg"
5570 "watercluster2" "NRswitchg"))
5571 (for-each (lambda (f) (install-file f include))
5572 (find-files "." "\\.h$"))
5573 (for-each (lambda (f) (install-file f lib))
5574 (find-files "." "\\.a$"))
5575 (for-each (lambda (f) (install-file f doc))
5576 (append '("formats.txt" "README" "schreier.txt")
5577 (find-files "." "\\.pdf$")))))))))
5579 `(("gmp" ,gmp))) ;for sumlines
5580 (home-page "https://pallini.di.uniroma1.it/")
5581 (synopsis "Library for graph automorphisms")
5582 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5583 procedures for computing automorphism groups of graphs and digraphs.
5585 @code{nauty} computes graph information in the form of a set of
5586 generators, the size of the group, and the orbits of the group; it can
5587 also produce a canonical label. The @code{nauty} suite is written in
5588 C and comes with a command-line interface, a collection of
5589 command-line tools, and an Application Programming Interface (API).
5591 This package provides the static libraries required to run programs
5592 compiled against the nauty library.")
5593 (license license:asl2.0)))
5602 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5603 "ftp/releases/" version
5604 "/ppl-" version ".tar.gz"))
5607 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5608 (build-system gnu-build-system)
5614 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5616 "Parma Polyhedra Library for computations with polyhedra")
5618 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5619 especially targeted at applications in the field of analysis and
5620 verification of complex systems. These abstractions include convex
5621 polyhedra, defined as the intersection of a finite number of (open or
5622 closed) halfspaces, each described by a linear inequality (strict or
5623 non-strict) with rational coefficients; some special classes of polyhedra
5624 shapes that offer interesting complexity/precision tradeoffs; and grids
5625 which represent regularly spaced points that satisfy a set of linear
5626 congruence relations. The library also supports finite powersets and
5627 products of (any kind of) polyhedra and grids, a mixed integer linear
5628 programming problem solver using an exact-arithmetic version of the simplex
5629 algorithm, a parametric integer programming solver, and primitives for
5630 termination analysis via the automatic synthesis of linear ranking
5632 (license license:gpl3+)))
5634 (define-public speedcrunch
5636 (name "speedcrunch")
5642 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5643 (commit (string-append "release-" version))))
5644 (file-name (git-file-name name version))
5647 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5648 (build-system cmake-build-system)
5649 (inputs `(("qtbase" ,qtbase)))
5650 (native-inputs `(("qttools" ,qttools)))
5653 (modify-phases %standard-phases
5654 (add-after 'unpack 'chdir-to-src
5655 (lambda _ (chdir "src") #t)))))
5656 (synopsis "High-precision scientific calculator")
5658 "SpeedCrunch is a high-precision scientific calculator. It features a
5659 syntax-highlighted scrollable display and is designed to be fully used via
5660 keyboard. Some distinctive features are auto-completion of functions and
5661 variables, a formula book, and quick insertion of constants from various
5662 fields of knowledge.")
5663 (home-page "https://speedcrunch.org/")
5664 (license license:gpl2+)))
5666 (define-public minisat
5667 ;; This is the last commit which is available upstream, no
5668 ;; release happened since 2010.
5669 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5673 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5678 (url "https://github.com/niklasso/minisat")
5680 (file-name (string-append name "-" version "-checkout"))
5683 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5685 (search-patches "minisat-friend-declaration.patch"
5686 "minisat-install.patch"))))
5687 (build-system gnu-build-system)
5689 '(#:make-flags (list (string-append "prefix=" %output))
5690 #:tests? #f ;no check target
5692 (modify-phases %standard-phases
5693 (delete 'configure))))
5695 `(("zlib:static" ,zlib "static")
5698 "Small, yet efficient, SAT solver")
5700 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5701 researchers and developers alike to get started on SAT.")
5703 "http://minisat.se/MiniSat.html")
5704 (license license:expat))))
5706 (define-public libqalculate
5708 (name "libqalculate")
5714 (url "https://github.com/Qalculate/libqalculate/")
5715 (commit (string-append "v" version))))
5716 (file-name (git-file-name name version))
5718 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5720 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5721 (build-system gnu-build-system)
5723 `(("pkg-config" ,pkg-config)
5724 ("gettext" ,gettext-minimal)
5725 ("intltool" ,intltool)
5726 ("automake" ,automake)
5727 ("autoconf" ,autoconf)
5728 ("libtool" ,libtool)
5729 ("doxygen" ,doxygen)
5734 ("libxml2" ,libxml2)
5737 ("gnuplot" ,gnuplot)
5738 ("readline" ,readline)
5739 ("libiconv" ,libiconv)))
5742 (modify-phases %standard-phases
5743 (add-before 'bootstrap 'setenv
5744 ;; Prevent the autogen.sh script to carry out the configure
5745 ;; script, which has not yet been patched to replace /bin/sh.
5747 (setenv "NOCONFIGURE" "TRUE")
5749 (home-page "https://qalculate.github.io/")
5750 (synopsis "Multi-purpose cli desktop calculator and library")
5752 "Libqalculate is a multi-purpose cli desktop calculator and library.
5753 It provides basic and advanced functionality. Features include customizable
5754 functions, unit calculations, and conversions, physical constants, symbolic
5755 calculations (including integrals and equations), arbitrary precision,
5756 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5758 (license license:gpl2+)))
5760 (define-public qalculate-gtk
5762 (name "qalculate-gtk")
5768 (url "https://github.com/Qalculate/qalculate-gtk/")
5769 (commit (string-append "v" version))))
5770 (file-name (git-file-name name version))
5772 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5773 (build-system glib-or-gtk-build-system)
5775 `(("pkg-config" ,pkg-config)
5776 ("intltool" ,intltool)
5777 ("automake" ,automake)
5778 ("autoconf" ,autoconf)
5779 ("libtool" ,libtool)
5784 ("libqalculate" ,libqalculate)
5785 ("libxml2" ,libxml2)
5790 (modify-phases %standard-phases
5791 (add-before 'bootstrap 'setenv
5792 ;; Prevent the autogen.sh script to carry out the configure
5793 ;; script, which has not yet been patched to replace /bin/sh.
5795 (setenv "NOCONFIGURE" "TRUE")
5797 (add-before 'check 'add-pot-file
5798 ;; the file contains translations and are currently not in use
5799 ;; left out on purpose so add it to POTFILES.skip
5801 (with-output-to-file "po/POTFILES.skip"
5803 (format #t "data/shortcuts.ui~%")
5806 (home-page "https://qalculate.github.io/")
5807 (synopsis "Multi-purpose graphical desktop calculator")
5809 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5810 multi-purpose GUI desktop calculator. It provides basic and advanced
5811 functionality. Features include customizable functions, unit calculations,
5812 and conversions, physical constants, symbolic calculations (including
5813 integrals and equations), arbitrary precision, uncertainty propagation,
5814 interval arithmetic, plotting.")
5815 (license license:gpl2+)))