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 scalapack
819 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
823 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
824 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
825 (build-system cmake-build-system)
828 ("fortran" ,gfortran)
829 ("lapack" ,lapack))) ;for testing only
831 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
832 #:phases (modify-phases %standard-phases
833 (add-before 'check 'mpi-setup
835 (home-page "http://www.netlib.org/scalapack/")
836 (synopsis "Library for scalable numerical linear algebra")
838 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
839 routines on parallel distributed memory machines. ScaLAPACK solves dense and
840 banded linear systems, least squares problems, eigenvalue problems, and
841 singular value problems.")
842 (license (license:non-copyleft "file://LICENSE"
843 "See LICENSE in the distribution."))))
845 (define-public gnuplot
851 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
855 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
856 (build-system gnu-build-system)
857 (inputs `(("readline" ,readline)
863 `(("pkg-config" ,pkg-config)
864 ("texlive" ,texlive-tiny)))
865 (arguments `(#:configure-flags (list (string-append
866 "--with-texdir=" %output
867 "/texmf-local/tex/latex/gnuplot"))))
868 (home-page "http://www.gnuplot.info")
869 (synopsis "Command-line driven graphing utility")
870 (description "Gnuplot is a portable command-line driven graphing
871 utility. It was originally created to allow scientists and students to
872 visualize mathematical functions and data interactively, but has grown to
873 support many non-interactive uses such as web scripting. It is also used as a
874 plotting engine by third-party applications like Octave.")
875 ;; X11 Style with the additional restriction that derived works may only be
876 ;; distributed as patches to the original.
877 (license (license:fsf-free
878 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
888 (url "https://github.com/OkoSanto/GCTP")
889 (commit (string-append "v" version))))
890 (file-name (git-file-name name version))
892 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
894 `(("fortran" ,gfortran)))
895 (build-system gnu-build-system)
896 (synopsis "General Cartographic Transformation Package (GCTP)")
898 "The General Cartographic Transformation Package (GCTP) is a system of
899 software routines designed to permit the transformation of coordinate pairs
900 from one map projection to another. The GCTP is the standard computer
901 software used by the National Mapping Division for map projection
903 (home-page "https://github.com/OkoSanto/GCTP")
904 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
913 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
914 version "/src/hdf-" version ".tar.bz2"))
916 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
917 (patches (search-patches "hdf4-architectures.patch"
918 "hdf4-reproducibility.patch"
919 "hdf4-shared-fortran.patch"
920 "hdf4-tirpc.patch"))))
921 (build-system gnu-build-system)
923 `(("gfortran" ,gfortran)
928 ("libjpeg" ,libjpeg-turbo)
929 ("libtirpc" ,libtirpc)))
931 `(#:parallel-tests? #f
932 #:configure-flags (list "--enable-shared"
933 (string-append "CPPFLAGS=-I"
934 (assoc-ref %build-inputs "libtirpc")
937 (modify-phases %standard-phases
938 ;; This is inspired by two of Debian's patches.
939 (add-before 'configure 'add-more-aarch64-support
941 (substitute* '("mfhdf/ncgen/ncgen.l"
942 "mfhdf/ncgen/ncgenyy.c"
943 "mfhdf/libsrc/netcdf.h.in")
944 (("AIX5L64") "__aarch64__"))
946 (add-before 'configure 'patchbuild
949 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
951 (("/bin/mkdir") "mkdir"))
952 (substitute* (find-files "." "^Makefile\\.in$")
953 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
954 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
955 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
956 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
957 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
959 (add-after 'configure 'patch-settings
961 ;; libhdf4.settings contains the full path of the
962 ;; compilers used, and its contents are included in
963 ;; .so-files. We truncate the hashes to avoid
964 ;; unnecessary store references to those compilers:
965 (substitute* "libhdf4.settings"
966 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
967 (string-append prefix (string-take hash 10) "...")))
969 (add-after 'install 'provide-absolute-libjpeg-reference
970 (lambda* (#:key inputs outputs #:allow-other-keys)
971 (let ((out (assoc-ref outputs "out"))
972 (libjpeg (assoc-ref inputs "libjpeg")))
973 ;; libjpeg-turbo does not provide a .la file, so libtool is
974 ;; unable to add an absolute reference for -ljpeg in the .la
975 ;; files. Fix it manually to avoid having to propagate it.
976 (substitute* (find-files (string-append out "/lib") "\\.la$")
978 (string-append "-L" libjpeg "/lib -ljpeg")))
980 (home-page "https://www.hdfgroup.org/products/hdf4/")
982 "Library and multi-object file format for storing and managing data")
983 (description "HDF4 is a library and multi-object file format for storing
984 and managing data between machines. HDF4 is an older hierarchical data format,
985 incompatible with HDF5.")
987 (license:non-copyleft
988 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
990 (define-public hdf4-alt
995 (substitute-keyword-arguments (package-arguments hdf4)
996 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
998 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1007 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1008 "hdf5-" (version-major+minor version)
1009 "/hdf5-" version "/src/hdf5-"
1011 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1013 (match (string-split version #\.)
1014 ((major minor _ ...)
1015 (string-append major minor)))
1016 "/src/hdf5-" version ".tar.bz2")))
1018 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
1019 (patches (search-patches "hdf5-config-date.patch"
1020 "hdf5-1.8-mpi-deprecations.patch"))))
1021 (build-system gnu-build-system)
1025 `(("gfortran" ,gfortran)
1026 ("perl" ,perl))) ;part of the test machinery needs Perl
1027 (outputs '("out" ; core library
1028 "fortran")) ; fortran interface
1030 `(;; Some of the users, notably Flann, need the C++ interface.
1031 #:configure-flags '("--enable-cxx"
1033 "--enable-fortran2003"
1035 ;; Build a thread-safe library. Unfortunately,
1036 ;; 'configure' invites you to either turn off C++,
1037 ;; Fortran, and the high-level interface (HL), or
1038 ;; to pass '--enable-unsupported'. Debian
1039 ;; packagers chose to pass '--enable-unsupported'
1040 ;; and we follow their lead here.
1041 "--enable-threadsafe"
1043 "--enable-unsupported")
1044 ;; Use -fPIC to allow the R bindings to link with the static libraries
1045 #:make-flags (list "CFLAGS=-fPIC"
1048 (modify-phases %standard-phases
1049 (add-before 'configure 'patch-configure
1050 (lambda* (#:key outputs #:allow-other-keys)
1051 (substitute* "configure"
1053 (substitute* "fortran/src/Makefile.in"
1054 (("libhdf5_fortran_la_LDFLAGS =")
1055 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1056 (assoc-ref outputs "fortran") "/lib")))
1057 (substitute* "hl/fortran/src/Makefile.in"
1058 (("libhdf5hl_fortran_la_LDFLAGS =")
1059 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1060 (assoc-ref outputs "fortran") "/lib")))
1062 (add-after 'configure 'patch-settings
1064 ;; libhdf5.settings contains the full path of the
1065 ;; compilers used, and its contents are included in
1066 ;; libhdf5.so. We truncate the hashes to avoid
1067 ;; unnecessary store references to those compilers:
1068 (substitute* "src/libhdf5.settings"
1069 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1070 (string-append prefix (string-take hash 10) "..."))
1071 ;; Don't record the build-time kernel version to make the
1072 ;; settings file reproducible.
1073 (("Uname information:.*")
1074 "Uname information: Linux\n"))
1076 (add-after 'install 'patch-references
1077 (lambda* (#:key inputs outputs #:allow-other-keys)
1078 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1079 (zlib (assoc-ref inputs "zlib")))
1080 (substitute* (find-files bin "h5p?cc")
1082 (string-append "-L" zlib "/lib " lib)))
1084 (add-after 'install 'split
1085 (lambda* (#:key inputs outputs #:allow-other-keys)
1086 ;; Move all fortran-related files
1087 (let* ((out (assoc-ref outputs "out"))
1088 (bin (string-append out "/bin"))
1089 (lib (string-append out "/lib"))
1090 (inc (string-append out "/include"))
1091 (ex (string-append out "/share/hdf5_examples/fortran"))
1092 (fort (assoc-ref outputs "fortran"))
1093 (fbin (string-append fort "/bin"))
1094 (flib (string-append fort "/lib"))
1095 (finc (string-append fort "/include"))
1096 (fex (string-append fort "/share/hdf5_examples/fortran")))
1101 ;; Note: When built with --enable-parallel, the 'h5fc' file
1102 ;; doesn't exist, hence this condition.
1103 (when (file-exists? (string-append bin "/h5fc"))
1104 (rename-file (string-append bin "/h5fc")
1105 (string-append fbin "/h5fc")))
1106 (for-each (lambda (file)
1108 (string-append flib "/" (basename file))))
1109 (find-files lib ".*fortran.*"))
1110 (for-each (lambda (file)
1112 (string-append finc "/" (basename file))))
1113 (find-files inc ".*mod"))
1114 (for-each (lambda (file)
1116 (string-append fex "/" (basename file))))
1117 (find-files ex ".*"))
1118 (delete-file-recursively ex))
1120 (home-page "https://www.hdfgroup.org")
1121 (synopsis "Management suite for extremely large and complex data")
1122 (description "HDF5 is a suite that makes possible the management of
1123 extremely large and complex data collections.")
1124 (license (license:x11-style
1125 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1127 (define-public hdf5-1.10
1128 (package (inherit hdf5)
1133 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1134 "hdf5-" (version-major+minor version)
1135 "/hdf5-" version "/src/hdf5-"
1137 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1139 (apply string-append
1140 (take (string-split version #\.) 2))
1141 "/src/hdf5-" version ".tar.bz2")))
1143 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
1144 (patches (search-patches "hdf5-config-date.patch"))))))
1146 (define-public hdf-java
1154 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1155 version "/src/CMake-hdfjava-" version ".tar.gz"))
1157 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1158 (modules '((guix build utils)))
1159 (snippet ; Make sure we don't use the bundled sources and binaries.
1161 (for-each delete-file
1162 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1163 "HDF4.tar.gz" "HDF5.tar.gz"))
1164 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1166 (build-system gnu-build-system)
1168 `(("jdk" ,icedtea "jdk")
1169 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1171 ("hamcrest-core" ,java-hamcrest-core)
1172 ("junit" ,java-junit)
1173 ("slf4j-simple" ,java-slf4j-simple)))
1178 ("libjpeg" ,libjpeg-turbo)
1179 ("slf4j-api" ,java-slf4j-api)))
1182 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1183 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1184 (assoc-ref %build-inputs "jdk") "/lib" )
1185 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1186 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1189 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1190 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1191 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1192 (string-append "JPEGLIB="
1193 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1197 (modify-phases %standard-phases
1198 (add-before 'configure 'chdir-to-source
1199 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1200 (add-before 'configure 'patch-build
1201 (lambda* (#:key inputs outputs #:allow-other-keys)
1202 (substitute* "configure"
1203 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1204 (("/bin/cat") (which "cat")))
1205 ;; Set classpath for compilation
1206 (substitute* '("hdf/hdf5lib/Makefile.in"
1207 "hdf/hdf5lib/exceptions/Makefile.in"
1208 "hdf/hdflib/Makefile.in")
1209 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1210 (string-append (assoc-ref inputs "slf4j-api")
1211 "/share/java/slf4j-api.jar")))
1212 ;; Replace outdated config.sub and config.guess:
1213 (with-directory-excursion "config"
1214 (for-each (lambda (file)
1216 (string-append (assoc-ref inputs "automake")
1218 ,(version-major+minor (package-version automake))
1220 '("config.sub" "config.guess")))
1222 ;; Fix embedded version number
1223 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1224 (substitute* "hdf/hdf5lib/H5.java"
1226 (string-join hdf5version ", "))))
1228 (mkdir-p (string-append (assoc-ref outputs "out")))
1229 ;; Set classpath for tests
1230 (let* ((build-dir (getcwd))
1231 (lib (string-append build-dir "/lib"))
1232 (jhdf (string-append lib "/jhdf.jar"))
1233 (jhdf5 (string-append lib "/jhdf5.jar"))
1237 (string-append (assoc-ref inputs i)
1238 "/share/java/" i ".jar"))
1239 '("slf4j-api" "slf4j-simple"))
1241 (car (find-files (assoc-ref inputs "junit") "jar$"))
1242 (car (find-files (assoc-ref inputs "hamcrest-core")
1245 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1247 (substitute* '("test/hdf5lib/Makefile.in"
1248 "test/hdf5lib/junit.sh.in"
1249 "examples/runExample.sh.in")
1251 (string-append (assoc-ref inputs "coreutils")
1254 (string-append (assoc-ref inputs "coreutils")
1256 (("CLASSPATH=[^\n]*")
1257 (string-append "CLASSPATH=" class-path)))
1258 (setenv "CLASSPATH" class-path))
1260 (add-before 'check 'build-examples
1262 (apply invoke `("javac"
1263 ,@(find-files "examples" ".*\\.java"))))))
1265 #:parallel-build? #f
1267 #:parallel-tests? #f ))
1268 (home-page "https://support.hdfgroup.org/products/java")
1269 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1270 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1271 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1274 ;; BSD-style license:
1275 (license (license:x11-style
1276 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1277 /current/src/unpacked/COPYING"))))
1279 (define-public hdf-eos2
1286 (uri "ftp://edhs1.gsfc.nasa.gov\
1287 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1289 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1290 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1291 "hdf-eos2-build-shared.patch"
1292 "hdf-eos2-fortrantests.patch"))))
1293 (build-system gnu-build-system)
1295 `(("gfortran" ,gfortran)))
1297 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1298 ;; XXX: These inputs are really dependencies of hdf4.
1300 ("libjpeg" ,libjpeg-turbo)
1301 ("libtirpc" ,libtirpc)
1305 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1306 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1307 #:parallel-tests? #f))
1308 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1309 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1310 (description "HDF-EOS2 is a software library built on HDF4 which supports
1311 the construction of data structures used in NASA's Earth Observing
1312 System (Grid, Point and Swath).")
1314 ;; Source files carry a permissive license header.
1315 (license (license:non-copyleft home-page))))
1317 (define-public hdf-eos5
1323 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1324 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1327 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1328 (patches (search-patches "hdf-eos5-build-shared.patch"
1329 "hdf-eos5-remove-gctp.patch"
1330 "hdf-eos5-fix-szip.patch"
1331 "hdf-eos5-fortrantests.patch"))))
1333 `(("gfortran" ,gfortran)))
1334 (build-system gnu-build-system)
1340 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1341 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1342 #:parallel-tests? #f))
1343 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1345 "HDF-EOS5 is a software library built on HDF5 to support the construction
1346 of data structures used in NASA's Earth Observing System (Grid, Point and
1348 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1350 ;; Source files carry a permissive license header.
1351 (license (license:non-copyleft home-page))))
1353 (define-public hdf5-parallel-openmpi
1354 (package (inherit hdf5)
1355 (name "hdf5-parallel-openmpi")
1358 ,@(package-inputs hdf5)))
1360 (substitute-keyword-arguments (package-arguments hdf5)
1361 ((#:configure-flags flags)
1362 ``("--enable-parallel"
1363 ,@(delete "--enable-cxx"
1364 (delete "--enable-threadsafe" ,flags))))
1366 `(modify-phases ,phases
1367 (add-after 'build 'mpi-setup
1369 (add-before 'check 'patch-tests
1371 ;; OpenMPI's mpirun will exit with non-zero status if it
1372 ;; detects an "abnormal termination", i.e. any process not
1373 ;; calling MPI_Finalize(). Since the test is explicitly
1374 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1375 ;; H5C_flush_cache from being called, mpirun will always
1376 ;; complain, so turn this test off.
1377 (substitute* "testpar/Makefile"
1378 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1379 (string-append front back "\n")))
1380 (substitute* "tools/h5diff/testph5diff.sh"
1381 (("/bin/sh") (which "sh")))
1383 (synopsis "Management suite for data with parallel IO support")))
1385 (define-public hdf5-blosc
1393 (url "https://github.com/Blosc/hdf5-blosc")
1394 (commit (string-append "v" version))))
1395 (file-name (git-file-name name version))
1397 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1398 (build-system cmake-build-system)
1401 (list (string-append "-DBLOSC_INSTALL_DIR="
1402 (assoc-ref %build-inputs "c-blosc"))
1403 (string-append "-DPLUGIN_INSTALL_PATH="
1404 (assoc-ref %outputs "out")
1405 "/hdf5/lib/plugin"))
1407 (modify-phases %standard-phases
1408 (add-after 'unpack 'do-not-build-blosc
1410 (substitute* "CMakeLists.txt"
1411 (("set\\(BLOSC_INSTALL_DIR.*") "")
1412 (("ExternalProject_Add\\(project_blosc") "message("))
1415 `(("c-blosc" ,c-blosc)
1416 ("hdf5" ,hdf5-1.10)))
1417 (home-page "https://github.com/Blosc/hdf5-blosc")
1418 (synopsis "Filter for HDF5 using the Blosc compressor")
1419 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1420 installing this filter, you can read and write HDF5 files with
1421 Blosc-compressed datasets.")
1422 (license license:expat)))
1424 (define-public h5check
1431 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1432 "h5check/src/h5check-" version ".tar.gz"))
1435 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1436 (build-system gnu-build-system)
1437 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1438 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1439 (synopsis "HDF5 format checker")
1440 (description "@code{h5check} is a validation tool for verifying that an
1441 HDF5 file is encoded according to the HDF File Format Specification.")
1442 (license (license:x11-style "file://COPYING"))))
1450 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1455 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1456 (build-system cmake-build-system)
1457 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1458 (inputs `(("lapack" ,lapack)
1460 ;; FIXME: Even though the fonts are available dvips complains:
1461 ;; "Font cmmi10 not found; characters will be left blank."
1463 `(("texlive" ,texlive-tiny)
1464 ("ghostscript" ,ghostscript)
1465 ("doxygen" ,doxygen)))
1466 (home-page "http://itpp.sourceforge.net")
1467 (synopsis "C++ library of maths, signal processing and communication classes")
1468 (description "IT++ is a C++ library of mathematical, signal processing and
1469 communication classes and functions. Its main use is in simulation of
1470 communication systems and for performing research in the area of
1471 communications. The kernel of the library consists of generic vector and
1472 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1473 similar to MATLAB, GNU Octave or SciPy.")
1474 (license license:gpl3+)))
1476 (define-public netcdf
1483 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1484 "netcdf-" version ".tar.gz"))
1487 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1488 (patches (search-patches "netcdf-date-time.patch"
1489 "netcdf-tst_h_par.patch"))))
1490 (build-system gnu-build-system)
1493 ("doxygen" ,doxygen)
1494 ("graphviz" ,graphviz)))
1496 `(("hdf4" ,hdf4-alt)
1499 ("libjpeg" ,libjpeg-turbo)))
1501 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1503 #:phases (modify-phases %standard-phases
1504 (add-before 'configure 'fix-source-date
1506 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1507 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1508 ;; to '1st hour of the current day', and therefore makes the
1509 ;; package not reproducible.
1510 (substitute* "./configure"
1511 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1512 "date --date='@0'"))
1514 (add-after 'configure 'patch-settings
1516 ;; libnetcdf.settings contains the full filename of the compilers
1517 ;; used to build the library. We truncate the hashes of those
1518 ;; filenames to avoid unnecessary references to the corresponding
1520 (substitute* "libnetcdf.settings"
1521 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1522 (string-append prefix (string-take hash 10) "...")))
1525 #:parallel-tests? #f)) ;various race conditions
1526 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1527 (synopsis "Library for scientific data")
1528 (description "NetCDF is an interface for scientific data access and a
1529 software library that provides an implementation of the interface. The netCDF
1530 library defines a machine-independent format for representing scientific data.
1531 Together, the interface, library, and format support the creation, access, and
1532 sharing of scientific data.")
1533 (license (license:x11-style "file://COPYRIGHT"))))
1535 (define-public netcdf-parallel-openmpi
1536 (package (inherit netcdf)
1537 (name "netcdf-parallel-openmpi")
1540 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1541 (package-inputs netcdf))))
1542 ;; TODO: Replace pkg-config references in nc-config with absolute references
1544 (substitute-keyword-arguments (package-arguments netcdf)
1545 ((#:configure-flags flags)
1546 `(cons* "CC=mpicc" "CXX=mpicxx"
1547 "--enable-parallel-tests"
1548 ;; Shared libraries not supported with parallel IO.
1549 "--disable-shared" "--with-pic"
1552 (define-public netcdf-fortran
1554 (name "netcdf-fortran")
1559 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1563 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1564 (build-system gnu-build-system)
1566 `(#:parallel-tests? #f))
1568 `(("netcdf" ,netcdf)))
1570 `(("gfortran" ,gfortran)))
1571 (synopsis "Fortran interface for the netCDF library")
1572 (description (package-description netcdf))
1573 (home-page (package-home-page netcdf))
1574 (license (package-license netcdf))))
1576 (define-public nlopt
1582 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1585 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1586 (build-system gnu-build-system)
1588 `(;; Shared libraries are not built by default. They are required to
1589 ;; build the Guile, Octave, and Python bindings.
1590 #:configure-flags '("--enable-shared")
1593 (modify-phases %standard-phases
1594 (add-before 'configure 'set-libnlopt-file-name
1595 (lambda* (#:key outputs #:allow-other-keys)
1596 ;; Make sure the Scheme module refers to the library by its
1597 ;; absolute file name (we cannot do that from a snippet
1598 ;; because the expansion of @libdir@ contains
1600 (let ((out (assoc-ref outputs "out")))
1601 (substitute* "swig/nlopt.scm.in"
1603 (string-append out "/lib/libnlopt")))
1605 (inputs `(("guile" ,guile-2.0)))
1606 (native-inputs `(("pkg-config" ,pkg-config)))
1607 (home-page "http://ab-initio.mit.edu/wiki/")
1608 (synopsis "Library for nonlinear optimization")
1609 (description "NLopt is a library for nonlinear optimization, providing a
1610 common interface for a number of different free optimization routines available
1611 online as well as original implementations of various other algorithms.")
1612 (license license:lgpl2.1+)))
1614 (define-public ipopt
1621 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1625 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1626 (modules '((guix build utils)))
1628 ;; Make sure we don't use the bundled software.
1630 (delete-file-recursively "ThirdParty")
1632 (build-system gnu-build-system)
1634 '(#:phases (modify-phases %standard-phases
1635 (add-after 'install 'add--L-flags-in-ipopt.pc
1636 (lambda* (#:key inputs outputs #:allow-other-keys)
1637 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1638 ;; move it to "Libs.private" where it belongs, and add a
1639 ;; '-L' flag for LAPACK.
1640 (let ((out (assoc-ref outputs "out"))
1641 (lapack (assoc-ref inputs "lapack")))
1642 (substitute* (string-append out "/lib/pkgconfig/"
1644 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1645 (string-append "Libs: " before " " after "\n"
1646 "Libs.private: " before
1647 "-L" lapack "/lib -llapack -lblas "
1651 `(("gfortran" ,gfortran)))
1653 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1654 `(("lapack" ,lapack))) ;for both libblas and liblapack
1655 (home-page "https://www.coin-or.org")
1656 (synopsis "Large-scale nonlinear optimizer")
1658 "The Interior Point Optimizer (IPOPT) is a software package for
1659 large-scale nonlinear optimization. It provides C++, C, and Fortran
1661 (license license:epl1.0)))
1669 (uri (string-append "https://www.coin-or.org/download/source/"
1670 "Clp/Clp-" version ".tgz"))
1673 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1674 (modules '((guix build utils)))
1676 ;; Make sure we don't use the bundled software.
1678 (delete-file-recursively "ThirdParty")
1680 (build-system gnu-build-system)
1682 `(("gfortran" ,gfortran)
1683 ("pkg-config" ,pkg-config)))
1685 `(("openblas" ,openblas)))
1686 (home-page "https://www.coin-or.org")
1687 (synopsis "Linear programming solver")
1689 "CLP is a high quality linear programming solver. Its main strengths are
1690 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1691 linear and quadratic objectives. There are limited facilities for nonlinear
1692 and quadratic objectives using the Simplex algorithm.")
1693 (license license:epl1.0)))
1695 (define-public ceres
1697 (name "ceres-solver")
1699 (home-page "http://ceres-solver.org/")
1702 (uri (string-append home-page "ceres-solver-"
1706 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1707 (build-system cmake-build-system)
1709 ;; TODO: Build HTML user documentation and install separately.
1710 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1711 "-DBUILD_SHARED_LIBS=ON")
1713 #:phases (modify-phases %standard-phases
1714 (add-before 'configure 'set-library-directory
1716 ;; Install libraries to lib/, not lib64/.
1717 (substitute* "internal/ceres/CMakeLists.txt"
1718 (("set\\(LIB_SUFFIX \"64\"\\)")
1719 "set(LIB_SUFFIX \"\")"))
1722 `(("pkg-config" ,pkg-config)))
1724 `(("glog" ,glog))) ;for #include <glog/glog.h>
1729 ("suitesparse" ,suitesparse)
1730 ("gflags" ,gflags)))
1731 (synopsis "C++ library for solving large optimization problems")
1733 "Ceres Solver is a C++ library for modeling and solving large,
1734 complicated optimization problems. It is a feature rich, mature and
1735 performant library which has been used in production since 2010. Ceres Solver
1736 can solve two kinds of problems:
1738 @item non-linear least squares problems with bounds constraints;
1739 @item general unconstrained optimization problems.
1741 (license license:bsd-3)))
1743 ;; For a fully featured Octave, users are strongly recommended also to install
1744 ;; the following packages: less, ghostscript, gnuplot.
1745 (define-public octave-cli
1752 (uri (string-append "mirror://gnu/octave/octave-"
1756 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1757 (build-system gnu-build-system)
1759 `(("alsa-lib" ,alsa-lib)
1760 ("arpack" ,arpack-ng)
1766 ("fontconfig" ,fontconfig)
1767 ("freetype" ,freetype)
1771 ("graphicsmagick" ,graphicsmagick)
1773 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1774 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1775 ;; libtiff.la instead of having to provide it here.
1776 ("libjpeg" ,libjpeg-turbo)
1780 ("libsndfile" ,libsndfile)
1784 ("portaudio" ,portaudio)
1786 ("readline" ,readline)
1787 ("suitesparse" ,suitesparse)
1788 ("texinfo" ,texinfo)
1792 ("gfortran" ,gfortran)
1793 ("pkg-config" ,pkg-config)
1795 ;; The following inputs are not actually used in the build process.
1796 ;; However, the ./configure gratuitously tests for their existence and
1797 ;; assumes that programs not present at build time are also not, and
1798 ;; can never be, available at run time! If these inputs are therefore
1799 ;; not present, support for them will be built out. However, Octave
1800 ;; will still run without them, albeit without the features they
1803 ("ghostscript" ,ghostscript)
1804 ("gnuplot" ,gnuplot)))
1805 ;; Octave code uses this variable to detect directories holding multiple CA
1806 ;; certificates to verify peers with. This is required for the networking
1807 ;; functions that require encryption to work properly.
1808 (native-search-paths
1809 (list (search-path-specification
1810 (variable "CURLOPT_CAPATH")
1811 (files '("etc/ssl/certs")))))
1814 (list (string-append "--with-shell="
1815 (assoc-ref %build-inputs "bash")
1818 ;; XXX: Without this flag, linking octave-cli fails with
1819 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1820 ;; not pulling in liboctinterp.la for -lstdc++.
1821 "--enable-link-all-dependencies")
1823 (modify-phases %standard-phases
1824 (add-after 'configure 'configure-makeinfo
1825 (lambda* (#:key inputs #:allow-other-keys)
1826 (substitute* "libinterp/corefcn/help.h"
1829 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1831 (home-page "https://www.gnu.org/software/octave/")
1832 (synopsis "High-level language for numerical computation")
1833 (description "GNU Octave is a high-level interpreted language that is
1834 specialized for numerical computations. It can be used for both linear and
1835 non-linear applications and it provides great support for visualizing results.
1836 Work may be performed both at the interactive command-line as well as via
1838 (license license:gpl3+)))
1840 (define-public octave
1841 (package (inherit octave-cli)
1844 (inherit (package-source octave-cli))))
1846 `(("qscintilla" ,qscintilla)
1848 ,@(package-inputs octave-cli)))
1850 `(("qttools" , qttools) ;for lrelease
1851 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1852 ,@(package-native-inputs octave-cli)))
1854 (substitute-keyword-arguments (package-arguments octave-cli)
1856 `(modify-phases ,phases
1857 (add-before 'configure 'patch-qscintilla-library-name
1858 (lambda* (#:key inputs #:allow-other-keys)
1859 ;; The QScintilla library that the Octave configure script tries
1860 ;; to link with should be named libqscintilla-qt5.so, but the
1861 ;; QScintilla input provides the shared library as
1862 ;; libqscintilla2_qt5.so.
1863 (substitute* "configure"
1864 (("qscintilla2-qt5")
1868 (define-public opencascade-oce
1870 (name "opencascade-oce")
1876 (url "https://github.com/tpaviot/oce")
1877 (commit (string-append "OCE-" version))))
1878 (file-name (git-file-name name version))
1879 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1881 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1882 (build-system cmake-build-system)
1885 (list "-DOCE_TESTING:BOOL=ON"
1886 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1887 "-DOCE_DRAW:BOOL=ON"
1888 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1889 (assoc-ref %outputs "out"))
1890 "-UCMAKE_INSTALL_RPATH")))
1892 `(("freetype" ,freetype)
1899 `(("python" ,python-wrapper)))
1900 (home-page "https://github.com/tpaviot/oce")
1901 (synopsis "Libraries for 3D modeling and numerical simulation")
1903 "Open CASCADE is a set of libraries for the development of applications
1904 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1905 C++ class libraries providing services for 3D surface and solid modeling, CAD
1906 data exchange, and visualization. It is used for development of specialized
1907 software dealing with 3D models in design (CAD), manufacturing (CAM),
1908 numerical simulation (CAE), measurement equipment (CMM), and quality
1909 control (CAQ) domains.
1911 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1912 patches, improvements, and experiments contributed by users over the official
1913 Open CASCADE library.")
1914 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1915 ; use of header files; see
1916 ; OCCT_LGPL_EXCEPTION.txt
1917 license:public-domain; files
1918 ; src/Standard/Standard_StdAllocator.hxx and
1919 ; src/NCollection/NCollection_StdAllocator.hxx
1920 license:expat; file src/OpenGl/OpenGl_glext.h
1921 license:bsd-3)))); test framework gtest
1923 (define-public opencascade-occt
1925 (name "opencascade-occt")
1931 (url "https://git.dev.opencascade.org/repos/occt.git")
1934 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1936 (file-name (git-file-name name version))
1938 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1939 (modules '((guix build utils)))
1942 ;; Remove files specific to non-free operating systems.
1943 (delete-file-recursively "samples/ios")
1944 (delete-file-recursively "samples/mfc")
1945 (delete-file-recursively "samples/qt/FuncDemo")
1946 (delete-file "genconf.bat")
1947 (delete-file "gendoc.bat")
1948 (delete-file "genproj.bat")
1949 (delete-file "upgrade.bat")
1950 ;; Remove references to deleted files.
1951 (substitute* "dox/FILES_HTML.txt"
1952 ((".*standard.*") "" )
1953 ((".*UIKitSample.*") ""))
1955 (build-system cmake-build-system)
1957 '(;; There is no test target for make. OCCT provides an
1958 ;; 'Automated Testing System', which may be accessed after
1959 ;; installation via the draw.sh script. draw.sh is located in
1960 ;; the bin directory. For details see:
1961 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1962 ;; occt_dev_guides__tests.html
1964 ;; Configure without freeimage: attempting to link against the
1965 ;; freeimage version 3.17 library leads to 'undefined
1966 ;; reference' errors.
1968 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1970 "-DUSE_VTK:BOOL=OFF"
1971 "-DBUILD_DOC_Overview:BOOL=OFF"
1972 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1973 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1974 "-UCMAKE_INSTALL_LIBDIR")))
1976 `(("doxygen" ,doxygen)
1977 ;("freeimage" ,freeimage)
1978 ("freetype" ,freetype)
1980 ("libxext" ,libxext)
1987 ;; TODO: build Overview documentation and add 'doc' output.
1988 (home-page "https://www.opencascade.com")
1989 (synopsis "Libraries for 3D modeling and numerical simulation")
1991 "Open CASCADE is a set of libraries for the development of applications
1992 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1993 C++ class libraries providing services for 3D surface and solid modeling, CAD
1994 data exchange, and visualization. It is used for development of specialized
1995 software dealing with 3D models in design (CAD), manufacturing (CAM),
1996 numerical simulation (CAE), measurement equipment (CMM), and quality
1997 control (CAQ) domains.
1999 This is the certified version of the Open Cascade Technology (OCCT) library.")
2000 (license (list ;; OCCT library:
2001 license:lgpl2.1; with an exception for the use of header
2002 ; files, see OCCT_LGPL_EXCEPTION.txt.
2003 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2004 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2006 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2007 ;; src/StepFile/step.tab.*:
2008 license:gpl3+ ; with Bison 2.2 exception.
2009 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2010 (license:non-copyleft
2011 "https://www.unicode.org/license.html")
2012 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2013 license:public-domain))))
2023 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2025 (string-append "gmsh_"
2026 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2028 (file-name (git-file-name name version))
2030 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
2031 (modules '((guix build utils)))
2033 ;; Remove non-free METIS code
2035 (delete-file-recursively "contrib/Metis")
2037 (build-system cmake-build-system)
2040 ("gfortran" ,gfortran)
2046 ("opencascade-oce" ,opencascade-oce)
2048 ("libxext" ,libxext)))
2050 `(("fontconfig" ,fontconfig)
2051 ("libxft" ,libxft)))
2053 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
2054 "-DENABLE_BUILD_SHARED:BOOL=ON"
2055 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2056 (home-page "http://gmsh.info/")
2057 (synopsis "3D finite element grid generator")
2058 (description "Gmsh is a 3D finite element grid generator with a built-in
2059 CAD engine and post-processor. Its design goal is to provide a fast, light
2060 and user-friendly meshing tool with parametric input and advanced
2061 visualization capabilities. Gmsh is built around four modules: geometry,
2062 mesh, solver and post-processing. The specification of any input to these
2063 modules is done either interactively using the graphical user interface or in
2064 ASCII text files using Gmsh's own scripting language.")
2065 (license license:gpl2+)))
2067 (define-public maxflow
2070 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2071 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2076 (url "https://github.com/gerddie/maxflow")
2078 (file-name (git-file-name name version))
2081 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2082 (build-system cmake-build-system)
2083 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2084 (synopsis "Library implementing Maxflow algorithm")
2085 (description "An implementation of the maxflow algorithm described in
2086 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2087 Energy Minimization in Computer Vision.\n
2088 Yuri Boykov and Vladimir Kolmogorov.\n
2089 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2091 (license license:gpl3+)))
2093 (define-public petsc
2100 ;; The *-lite-* tarball does not contain the *large* documentation
2101 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2102 "petsc-lite-" version ".tar.gz"))
2104 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2105 (outputs '("out" ; libraries and headers
2106 "examples")) ; ~30MiB of examples
2107 (build-system gnu-build-system)
2109 `(("python" ,python-2)))
2111 `(("gfortran" ,gfortran)
2113 ("superlu" ,superlu)
2114 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2115 ;; leaving out opengl, as configuration seems to only be for mac
2118 `(#:test-target "test"
2119 #:parallel-build? #f ; build is parallel by default
2125 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2126 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2127 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2129 (modify-phases %standard-phases
2131 ;; PETSc's configure script is actually a python script, so we can't
2132 ;; run it with bash.
2133 (lambda* (#:key outputs (configure-flags '())
2135 (let* ((prefix (assoc-ref outputs "out"))
2136 (flags `(,(string-append "--prefix=" prefix)
2137 ,@configure-flags)))
2138 (format #t "build directory: ~s~%" (getcwd))
2139 (format #t "configure flags: ~s~%" flags)
2140 (apply invoke "./configure" flags))))
2141 (add-after 'configure 'clean-local-references
2142 (lambda* (#:key outputs #:allow-other-keys)
2143 (let ((out (assoc-ref outputs "out")))
2144 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2145 ;; Prevent build directory from leaking into compiled code
2147 ;; Scrub timestamp for reproducibility
2148 ((".*Libraries compiled on.*") ""))
2149 (substitute* (find-files "." "petscvariables")
2150 ;; Do not expose build machine characteristics, set to defaults.
2151 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2152 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2154 (add-after 'install 'clean-install
2155 ;; Try to keep installed files from leaking build directory names.
2156 (lambda* (#:key inputs outputs #:allow-other-keys)
2157 (let ((out (assoc-ref outputs "out")))
2158 (substitute* (map (lambda (file)
2159 (string-append out "/lib/petsc/conf/" file))
2160 '("petscvariables"))
2162 ;; Make compiler references point to the store
2163 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2164 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2165 (string-append "= " (which compiler))))
2166 ;; PETSc installs some build logs, which aren't necessary.
2167 (for-each (lambda (file)
2168 (let ((f (string-append out "/lib/petsc/conf/" file)))
2169 (when (file-exists? f)
2171 '("configure.log" "make.log" "gmake.log"
2172 "test.log" "error.log" "RDict.db"
2173 "PETScBuildInternal.cmake"
2174 ;; Once installed, should uninstall with Guix
2177 (add-after 'install 'move-examples
2178 (lambda* (#:key outputs #:allow-other-keys)
2179 (let* ((out (assoc-ref outputs "out"))
2180 (examples (assoc-ref outputs "examples"))
2181 (exdir (string-append out "/share/petsc/examples"))
2182 (exdir' (string-append examples "/share/petsc/examples")))
2183 (copy-recursively exdir exdir')
2184 (delete-file-recursively exdir)
2186 (home-page "https://www.mcs.anl.gov/petsc")
2187 (synopsis "Library to solve PDEs")
2188 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2189 data structures and routines for the scalable (parallel) solution of
2190 scientific applications modeled by partial differential equations.")
2191 (license (license:non-copyleft
2192 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2194 (define-public petsc-complex
2195 (package (inherit petsc)
2196 (name "petsc-complex")
2198 (substitute-keyword-arguments (package-arguments petsc)
2199 ((#:configure-flags cf)
2200 `(cons "--with-scalar-type=complex" ,cf))))
2201 (synopsis "Library to solve PDEs (with complex scalars)")))
2203 (define-public petsc-openmpi
2204 (package (inherit petsc)
2205 (name "petsc-openmpi")
2207 `(("hdf5" ,hdf5-parallel-openmpi)
2208 ("hypre" ,hypre-openmpi)
2210 ("mumps" ,mumps-openmpi)
2211 ("openmpi" ,openmpi)
2212 ("scalapack" ,scalapack)
2213 ("scotch" ,pt-scotch32)
2214 ,@(package-inputs petsc)))
2216 (substitute-keyword-arguments (package-arguments petsc)
2217 ((#:configure-flags cf)
2219 "--with-mpiexec=mpirun"
2222 "--with-scalapack=1"
2224 ,(string-append "--with-mpi-dir="
2225 (assoc-ref %build-inputs "openmpi"))
2226 ,(string-append "--with-hdf5-include="
2227 (assoc-ref %build-inputs "hdf5") "/include")
2228 ,(string-append "--with-hdf5-lib="
2229 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2230 ,@(delete "--with-mpi=0" ,cf)))
2232 `(modify-phases ,phases
2233 (add-before 'configure 'mpi-setup
2234 ,%openmpi-setup)))))
2235 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2237 (define-public petsc-complex-openmpi
2238 (package (inherit petsc-complex)
2239 (name "petsc-complex-openmpi")
2241 `(("openmpi" ,openmpi)
2242 ,@(package-inputs petsc-complex)))
2244 (substitute-keyword-arguments (package-arguments petsc-complex)
2245 ((#:configure-flags cf)
2246 ``("--with-mpiexec=mpirun"
2247 ,(string-append "--with-mpi-dir="
2248 (assoc-ref %build-inputs "openmpi"))
2249 ,@(delete "--with-mpi=0" ,cf)))
2251 `(modify-phases ,phases
2252 (add-before 'configure 'mpi-setup
2253 ,%openmpi-setup)))))
2254 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2256 (define-public python-petsc4py
2258 (name "python-petsc4py")
2263 (uri (pypi-uri "petsc4py" version))
2266 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2267 (build-system python-build-system)
2270 (modify-phases %standard-phases
2271 (add-before 'build 'pre-build
2273 ;; Define path to PETSc installation.
2274 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2276 (add-before 'check 'mpi-setup
2279 `(("petsc" ,petsc-openmpi)
2280 ("python-numpy" ,python-numpy)))
2281 (home-page "https://bitbucket.org/petsc/petsc4py/")
2282 (synopsis "Python bindings for PETSc")
2283 (description "PETSc, the Portable, Extensible Toolkit for
2284 Scientific Computation, is a suite of data structures and routines for
2285 the scalable (parallel) solution of scientific applications modeled by
2286 partial differential equations. It employs the MPI standard for all
2287 message-passing communication. @code{petsc4py} provides Python
2288 bindings to almost all functions of PETSc.")
2289 (license license:bsd-3)))
2291 (define-public python-kiwisolver
2293 (name "python-kiwisolver")
2297 (uri (pypi-uri "kiwisolver" version))
2300 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2301 (build-system python-build-system)
2302 (home-page "https://github.com/nucleic/kiwi")
2303 (synopsis "Fast implementation of the Cassowary constraint solver")
2305 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2306 solving algorithm. Kiwi has been designed from the ground up to be
2307 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2308 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2309 savings are consistently > 5x.")
2310 (license license:bsd-3)))
2312 (define-public python2-kiwisolver
2313 (package-with-python2 python-kiwisolver))
2315 (define-public slepc
2322 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2326 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2327 (build-system gnu-build-system)
2329 `(("python" ,python-2)
2330 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2332 `(("arpack" ,arpack-ng)
2333 ("gfortran" ,gfortran)))
2335 `(("petsc" ,petsc)))
2337 `(#:parallel-build? #f ;build is parallel by default
2339 `(,(string-append "--with-arpack-dir="
2340 (assoc-ref %build-inputs "arpack") "/lib"))
2341 #:make-flags ;honor (parallel-job-count)
2342 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2343 ,(string-append "PETSCCONFIGDIR="
2344 (assoc-ref %build-inputs "petsc:examples")
2345 "/share/petsc/examples/config"))
2347 (modify-phases %standard-phases
2349 ;; configure is a python script, so we can't run it with bash.
2350 (lambda* (#:key inputs outputs (configure-flags '())
2352 (let* ((prefix (assoc-ref outputs "out"))
2353 (flags `(,(string-append "--prefix=" prefix)
2354 ,@configure-flags)))
2355 (format #t "build directory: ~s~%" (getcwd))
2356 (format #t "configure flags: ~s~%" flags)
2357 (setenv "SLEPC_DIR" (getcwd))
2358 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2359 (apply invoke "./configure" flags))))
2360 (add-after 'install 'delete-doc
2361 ;; TODO: SLEPc installs HTML documentation alongside headers in
2362 ;; $out/include. We'd like to move them to share/doc, but delete
2363 ;; them for now, as they are incomplete and installing the complete
2364 ;; documentation is difficult.
2365 (lambda* (#:key outputs #:allow-other-keys)
2366 (let* ((out (assoc-ref outputs "out")))
2367 (for-each delete-file (find-files out "\\.html$"))
2369 (add-after 'install 'clean-install
2370 ;; Clean up unnecessary build logs from installation.
2371 (lambda* (#:key outputs #:allow-other-keys)
2372 (let ((out (assoc-ref outputs "out")))
2373 (for-each (lambda (file)
2374 (let ((f (string-append out "/lib/slepc/conf/" file)))
2375 (when (file-exists? f)
2377 '("configure.log" "make.log" "gmake.log"
2378 "test.log" "error.log" "RDict.db"
2381 (home-page "http://slepc.upv.es")
2382 (synopsis "Scalable library for eigenproblems")
2383 (description "SLEPc is a software library for the solution of large sparse
2384 eigenproblems on parallel computers. It can be used for the solution of
2385 linear eigenvalue problems formulated in either standard or generalized form,
2386 as well as other related problems such as the singular value decomposition.
2387 The emphasis of the software is on methods and techniques appropriate for
2388 problems in which the associated matrices are sparse, for example, those
2389 arising after the discretization of partial differential equations.")
2390 (license license:bsd-2)))
2392 (define-public slepc-complex
2393 (package (inherit slepc)
2394 (name "slepc-complex")
2396 `(("petsc" ,petsc-complex)
2397 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2398 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2400 (define-public slepc-openmpi
2401 (package (inherit slepc)
2402 (name "slepc-openmpi")
2404 (substitute-keyword-arguments (package-arguments slepc)
2405 ((#:phases phases '%standard-phases)
2406 `(modify-phases ,phases
2407 (add-before 'check 'mpi-setup
2408 ,%openmpi-setup)))))
2411 ("arpack" ,arpack-ng-openmpi)
2412 ,@(alist-delete "arpack" (package-inputs slepc))))
2414 `(("petsc" ,petsc-openmpi)
2415 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2416 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2418 (define-public slepc-complex-openmpi
2419 (package (inherit slepc-openmpi)
2420 (name "slepc-complex-openmpi")
2422 `(("petsc" ,petsc-complex-openmpi)
2423 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2424 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2426 (define-public python-slepc4py
2428 (name "python-slepc4py")
2433 (uri (pypi-uri "slepc4py" version))
2436 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2437 (build-system python-build-system)
2440 (modify-phases %standard-phases
2441 (add-before 'build 'pre-build
2443 ;; Define path to PETSc installation.
2444 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2445 ;; Define path to SLEPc installation.
2446 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2448 (add-before 'check 'mpi-setup
2451 `(("python-numpy" ,python-numpy)
2452 ("python-petsc4py" ,python-petsc4py)
2453 ("slepc" ,slepc-openmpi)))
2454 (home-page "https://bitbucket.org/slepc/slepc4py/")
2455 (synopsis "Python bindings for SLEPc")
2456 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2457 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2458 Scientific Computation. It employs the MPI standard for all
2459 message-passing communication. @code{slepc4py} provides Python
2460 bindings to almost all functions of SLEPc.")
2461 (license license:bsd-3)))
2463 (define-public metamath
2471 (url "https://github.com/metamath/metamath-exe")
2472 (commit (string-append "v" version))))
2473 (file-name (git-file-name name version))
2475 (base32 "1jjf4fy6j53i40dh0yv0f9sngnw4gs24cig99vsg3q0303pwrhg7"))))
2476 (build-system gnu-build-system)
2478 `(("autoconf" ,autoconf)
2479 ("automake" ,automake)))
2480 (home-page "http://us.metamath.org/")
2481 (synopsis "Proof verifier based on a minimalistic formalism")
2483 "Metamath is a tiny formal language and that can express theorems in
2484 abstract mathematics, with an accompyaning @command{metamath} executable that
2485 verifies databases of these proofs. There is a public database,
2486 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2487 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2488 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2489 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2491 (license license:gpl2+)))
2493 (define-public mumps
2500 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2504 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2505 (patches (search-patches "mumps-build-parallelism.patch"
2506 "mumps-shared-libseq.patch"
2507 "mumps-shared-mumps.patch"
2508 "mumps-shared-pord.patch"))))
2509 (build-system gnu-build-system)
2511 `(("fortran" ,gfortran)
2512 ;; These are required for linking against mumps, but we let the user
2513 ;; declare the dependency.
2516 ("scotch" ,scotch)))
2518 `(#:modules ((ice-9 match)
2521 ,@%gnu-build-system-modules)
2523 (modify-phases %standard-phases
2525 (lambda* (#:key inputs #:allow-other-keys)
2526 (call-with-output-file "Makefile.inc"
2537 INCSEQ = -I$(topdir)/libseq
2538 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2539 LIBSEQNEEDED = libseqneeded~;
2543 AR = ar vr # rules require trailing space, ugh...
2546 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2548 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2549 LIBOTHERS = -pthread
2552 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2556 LIBS = $(SCALAP) $(LIBSEQ)
2557 LPORDDIR = $(topdir)/PORD/lib
2558 IPORD = -I$(topdir)/PORD/include
2559 LPORD = $(LPORDDIR)/libpord.a
2560 ORDERINGSF = -Dpord~@[
2562 IMETIS = -I$(METISDIR)/include
2563 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2564 ORDERINGSF += -Dmetis~]~@[~:{
2566 ISCOTCH = -I$(SCOTCHDIR)/include
2567 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2568 ORDERINGSF += ~a~}~]
2569 ORDERINGSC = $(ORDERINGSF)
2570 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2571 IORDERINGSF = $(ISCOTCH)
2572 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2573 (assoc-ref inputs "mpi")
2574 (assoc-ref inputs "blas")
2575 (assoc-ref inputs "scalapack")
2576 (assoc-ref inputs "metis")
2577 (match (list (assoc-ref inputs "pt-scotch")
2578 (assoc-ref inputs "scotch"))
2582 `((,scotch "" "-Dscotch")))
2585 "-lptesmumps -lptscotch -lptscotcherr "
2586 "-Dptscotch")))))))))
2588 ;; By default only the d-precision library is built. Make with "all"
2589 ;; target so that all precision libraries and examples are built.
2591 (invoke "make" "all"
2592 (format #f "-j~a" (parallel-job-count)))))
2594 ;; Run the simple test drivers, which read test input from stdin:
2595 ;; from the "real" input for the single- and double-precision
2596 ;; testers, and from the "cmplx" input for complex-precision
2597 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2598 ;; package to prefix execution with "mpirun".
2599 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2600 (with-directory-excursion "examples"
2603 (let ((tester (apply open-pipe*
2606 ,(string-append "./" prec
2608 (input (open-input-file
2609 (string-append "input_simpletest_" type))))
2611 (dump-port input tester)
2613 (zero? (close-pipe tester)))))
2615 '("real" "real" "cmplx" "cmplx")))))
2617 (lambda* (#:key outputs #:allow-other-keys)
2618 (let* ((out (assoc-ref outputs "out"))
2619 (libdir (string-append out "/lib")))
2620 (copy-recursively "lib" libdir)
2621 (copy-recursively "include" (string-append out "/include"))
2622 (when (file-exists? "libseq/libmpiseq.a")
2623 (install-file "libseq/libmpiseq.a" libdir))
2624 (when (file-exists? "libseq/libmpiseq.so")
2625 (install-file "libseq/libmpiseq.so" libdir))
2627 (home-page "http://mumps.enseeiht.fr")
2628 (synopsis "Multifrontal sparse direct solver")
2630 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2631 sparse system of linear equations A x = b using Gaussian elimination.")
2632 (license license:cecill-c)))
2634 (define-public mumps-metis
2635 (package (inherit mumps)
2636 (name "mumps-metis")
2638 (alist-delete "scotch" (package-inputs mumps)))))
2640 (define-public mumps-openmpi
2641 (package (inherit mumps)
2642 (name "mumps-openmpi")
2645 ("scalapack" ,scalapack)
2646 ("pt-scotch" ,pt-scotch)
2647 ,@(alist-delete "scotch" (package-inputs mumps))))
2649 (substitute-keyword-arguments (package-arguments mumps)
2651 `(modify-phases ,phases
2652 (add-before 'check 'mpi-setup
2656 ((assoc-ref ,phases 'check)
2657 #:exec-prefix '("mpirun" "-n" "2"))))))))
2658 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2660 (define-public mumps-metis-openmpi
2661 (package (inherit mumps-openmpi)
2662 (name "mumps-metis-openmpi")
2664 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2666 (define-public ruby-asciimath
2668 (name "ruby-asciimath")
2673 (uri (rubygems-uri "asciimath" version))
2676 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
2677 (build-system ruby-build-system)
2679 `(("ruby-nokogiri" ,ruby-nokogiri)
2680 ("ruby-rspec" ,ruby-rspec)))
2681 (synopsis "AsciiMath parsing and conversion library")
2683 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2684 easy-to-write markup language for mathematics.")
2685 (home-page "https://github.com/asciidoctor/asciimath")
2686 (license license:expat)))
2688 (define-public superlu
2695 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2696 "superlu_" version ".tar.gz"))
2698 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2699 (modules '((guix build utils)))
2701 ;; Replace the non-free implementation of MC64 with a stub adapted
2704 (use-modules (ice-9 regex)
2706 (call-with-output-file "SRC/mc64ad.c"
2711 void mc64id_(int *a) {
2712 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2715 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2716 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2717 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2720 ;; Remove the corresponding license verbiage. MC64 license follows
2721 ;; a "------" line separator.
2722 (with-atomic-file-replacement "License.txt"
2723 (let ((rx (make-regexp "-{8}")))
2726 (let ((line (read-line in 'concat)))
2727 (unless (regexp-exec rx line)
2731 (build-system cmake-build-system)
2735 `(("blas" ,openblas)
2736 ("gfortran" ,gfortran)))
2738 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2739 "-DTPL_BLAS_LIBRARIES=openblas"
2740 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2741 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2742 (synopsis "Supernodal direct solver for sparse linear systems")
2744 "SuperLU is a general purpose library for the direct solution of large,
2745 sparse, nonsymmetric systems of linear equations on high performance machines.
2746 The library is written in C and is callable from either C or Fortran. The
2747 library routines perform an LU decomposition with partial pivoting and
2748 triangular system solves through forward and back substitution. The library
2749 also provides threshold-based ILU factorization preconditioners.")
2750 (license (list license:bsd-3
2751 license:gpl2+ ;EXAMPLE/*fgmr.c
2752 (license:fsf-free "file://SRC/colamd.h")))))
2754 (define-public superlu-dist
2756 (name "superlu-dist")
2761 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2762 "superlu_dist_" version ".tar.gz"))
2764 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2765 (modules '((guix build utils)))
2767 ;; Replace the non-free implementation of MC64 with a stub
2769 (call-with-output-file "SRC/mc64ad_dist.c"
2774 void mc64id_dist(int *a) {
2775 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2778 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2779 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2780 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2783 (substitute* "SRC/util.c" ;adjust default algorithm
2784 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2785 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2786 ;; general (i.e. non-square) processor-grid support.
2787 "RowPerm = NOROWPERM;"))
2789 (patches (search-patches "superlu-dist-scotchmetis.patch"
2790 "superlu-dist-awpm-grid.patch"))))
2791 (build-system cmake-build-system)
2795 `(("gfortran" ,gfortran)
2798 ("combblas" ,combinatorial-blas)))
2800 `(("mpi" ,openmpi) ;headers include MPI heades
2801 ("parmetis" ,pt-scotch32 "metis")
2802 ("pt-scotch" ,pt-scotch32)))
2804 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2805 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2806 "-DTPL_ENABLE_COMBBLASLIB=YES"
2807 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2808 "-DTPL_LAPACK_LIBRARIES=-llapack"
2809 (string-append "-DTPL_PARMETIS_LIBRARIES="
2811 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2812 "scotchmetis" "scotch" "scotcherr")
2814 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2815 (assoc-ref %build-inputs "parmetis")
2817 "-DTPL_ENABLE_COMBBLASLIB=ON"
2818 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2819 (assoc-ref %build-inputs "combblas")
2820 "/include/CombBLAS;"
2821 (assoc-ref %build-inputs "combblas")
2822 "/include/BipartiteMatchings")
2823 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2825 (modify-phases %standard-phases
2826 (add-before 'configure 'set-c++-standard
2828 (substitute* "CMakeLists.txt"
2829 ;; AWPM headers require C++14
2830 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2831 (add-before 'check 'mpi-setup
2833 (add-before 'check 'omp-setup
2834 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2835 (home-page (package-home-page superlu))
2836 (synopsis "Parallel supernodal direct solver")
2838 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2839 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2840 implemented in ANSI C, and MPI for communications.")
2841 (license license:bsd-3)))
2843 (define-public scotch
2850 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2851 "latestfile/298/scotch_" version ".tar.gz"))
2853 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2854 (patches (search-patches "scotch-build-parallelism.patch"
2855 "scotch-integer-declarations.patch"))))
2856 (build-system gnu-build-system)
2862 (outputs '("out" "metis"))
2864 `(#:make-flags (list (string-append "prefix=" %output))
2866 (modify-phases %standard-phases
2868 'unpack 'chdir-to-src
2869 (lambda _ (chdir "src") #t))
2873 (call-with-output-file "Makefile.inc"
2887 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2888 LDFLAGS = -lz -lm -lrt -lpthread
2890 LEX = flex -Pscotchyy -olex.yy.c
2895 YACC = bison -pscotchyy -y -b y
2897 '("COMMON_FILE_COMPRESS_GZ"
2899 "COMMON_RANDOM_FIXED_SEED"
2900 "INTSIZE64" ;use 'int64_t'
2901 ;; Prevents symbolc clashes with libesmumps
2903 ;; XXX: Causes invalid frees in superlu-dist tests
2905 ;; "SCOTCH_PTHREAD_NUMBER=2"
2906 "restrict=__restrict"))))
2908 (add-after 'build 'build-esmumps
2911 (format #f "-j~a" (parallel-job-count))
2913 (add-before 'install 'make-install-dirs
2914 (lambda* (#:key outputs #:allow-other-keys)
2915 (mkdir (assoc-ref outputs "out"))))
2916 (add-after 'install 'install-metis
2917 (lambda* (#:key outputs #:allow-other-keys)
2918 (let ((out (assoc-ref outputs "metis")))
2920 ;; metis files are not installed with 'make install'
2921 (for-each (lambda (f)
2922 (install-file f (string-append out "/include")))
2923 (find-files "../include/" ".*metis\\.h"))
2924 (for-each (lambda (f)
2925 (install-file f (string-append out "/lib")))
2926 (find-files "../lib/" ".*metis\\..*"))
2928 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2929 (synopsis "Programs and libraries for graph algorithms")
2930 (description "SCOTCH is a set of programs and libraries which implement
2931 the static mapping and sparse matrix reordering algorithms developed within
2932 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2933 conquer approach, to scientific computing problems such as graph and mesh
2934 partitioning, static mapping, and sparse matrix ordering, in application
2935 domains ranging from structural mechanics to operating systems or
2937 ;; See LICENSE_en.txt
2938 (license license:cecill-c)))
2940 (define-public scotch32
2941 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2942 ;; some applications.
2943 (package (inherit scotch)
2946 (substitute-keyword-arguments (package-arguments scotch)
2947 ((#:phases scotch-phases)
2948 `(modify-phases ,scotch-phases
2952 (call-with-output-file "Makefile.inc"
2966 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2967 LDFLAGS = -lz -lm -lrt -lpthread
2969 LEX = flex -Pscotchyy -olex.yy.c
2974 YACC = bison -pscotchyy -y -b y
2976 '("COMMON_FILE_COMPRESS_GZ"
2978 "COMMON_RANDOM_FIXED_SEED"
2979 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2980 ;; Prevents symbolc clashes with libesmumps
2982 ;; XXX: Causes invalid frees in superlu-dist tests
2984 ;; "SCOTCH_PTHREAD_NUMBER=2"
2985 "restrict=__restrict"))))))))))
2987 "Programs and libraries for graph algorithms (32-bit integers)")))
2989 (define-public pt-scotch
2990 (package (inherit scotch)
2993 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2995 (substitute-keyword-arguments (package-arguments scotch)
2996 ((#:phases scotch-phases)
2997 `(modify-phases ,scotch-phases
3001 (invoke "make" (format #f "-j~a" (parallel-job-count))
3002 "ptscotch" "ptesmumps")
3004 ;; Install the serial metis compatibility library
3005 (invoke "make" "-C" "libscotchmetis" "install")))
3006 (add-before 'check 'mpi-setup
3010 (invoke "make" "ptcheck")))))))
3011 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3013 (define-public pt-scotch32
3014 (package (inherit scotch32)
3015 (name "pt-scotch32")
3017 `(("openmpi" ,openmpi))) ;headers include MPI headers
3019 (substitute-keyword-arguments (package-arguments scotch32)
3020 ((#:phases scotch32-phases)
3021 `(modify-phases ,scotch32-phases
3024 (invoke "make" (format #f "-j~a" (parallel-job-count))
3025 "ptscotch" "ptesmumps")
3026 ;; Install the serial metis compatibility library
3027 (invoke "make" "-C" "libscotchmetis" "install")))
3028 (add-before 'check 'mpi-setup
3032 (invoke "make" "ptcheck")))))))
3034 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3036 (define-public metis
3043 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3044 "metis-" version ".tar.gz"))
3047 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3048 (build-system cmake-build-system)
3050 `(("blas" ,openblas)))
3052 `(#:tests? #f ;no tests
3053 #:configure-flags `("-DSHARED=ON"
3054 ,(string-append "-DGKLIB_PATH=" (getcwd)
3055 "/metis-" ,version "/GKlib"))))
3056 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3057 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3059 "METIS is a set of serial programs for partitioning graphs, partitioning
3060 finite element meshes, and producing fill-reducing orderings for sparse
3061 matrices. The algorithms implemented in METIS are based on the multilevel
3062 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3064 (license license:asl2.0))) ;As of version 5.0.3
3066 (define-public p4est
3073 (uri (string-append "http://p4est.github.io/release/p4est-"
3077 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3078 (build-system gnu-build-system)
3080 `(("fortran" ,gfortran)
3085 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3086 (assoc-ref %build-inputs "blas")
3088 ,(string-append "LAPACK_LIBS=-L"
3089 (assoc-ref %build-inputs "lapack")
3091 #:phases (modify-phases %standard-phases
3092 (add-before 'check 'mpi-setup
3094 (home-page "http://www.p4est.org")
3095 (synopsis "Adaptive mesh refinement on forests of octrees")
3097 "The p4est software library enables the dynamic management of a
3098 collection of adaptive octrees, conveniently called a forest of octrees.
3099 p4est is designed to work in parallel and scales to hundreds of thousands of
3101 (license license:gpl2+)))
3103 (define-public p4est-openmpi
3104 (package (inherit p4est)
3105 (name "p4est-openmpi")
3108 ,@(package-inputs p4est)))
3110 (substitute-keyword-arguments (package-arguments p4est)
3111 ((#:configure-flags cf)
3112 ``("--enable-mpi" ,@,cf))))
3113 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3115 (define-public gsegrafix
3122 (uri (string-append "mirror://gnu/" name "/" name "-"
3126 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3127 (build-system gnu-build-system)
3129 `(#:configure-flags '("LDFLAGS=-lm")))
3131 `(("libgnomecanvas" ,libgnomecanvas)
3132 ("libbonoboui" ,libbonoboui)
3133 ("libgnomeui" ,libgnomeui)
3134 ("libgnomeprintui" ,libgnomeprintui)
3137 `(("pkg-config" ,pkg-config)))
3138 (home-page "https://www.gnu.org/software/gsegrafix/")
3139 (synopsis "GNOME application to create scientific and engineering plots")
3140 (description "GSEGrafix is an application which produces high-quality graphical
3141 plots for science and engineering. Plots are specified via simple ASCII
3142 parameter files and data files and are presented in an anti-aliased GNOME
3143 canvas. The program supports rectangular two-dimensional plots, histograms,
3144 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3145 to BMP, JPEG or PNG image formats.")
3146 (license license:gpl3+)))
3148 (define-public maxima
3155 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3156 version "-source/" name "-" version ".tar.gz"))
3159 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
3160 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3161 (build-system gnu-build-system)
3164 ("gnuplot" ,gnuplot) ;for plots
3166 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3168 `(("texinfo" ,texinfo)
3170 ("python" ,python)))
3173 (list "--enable-gcl"
3174 (string-append "--with-posix-shell="
3175 (assoc-ref %build-inputs "bash")
3177 (string-append "--with-wish="
3178 (assoc-ref %build-inputs "tk")
3180 (let ((v ,(package-version tk)))
3181 (string-take v (string-index-right v #\.)))))
3182 ;; By default Maxima attempts to write temporary files to
3183 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3184 ;; Work around that.
3185 #:make-flags (list "TMPDIR=/tmp")
3187 (modify-phases %standard-phases
3188 (add-after 'unpack 'patch-paths
3189 (lambda* (#:key inputs #:allow-other-keys)
3190 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3191 (coreutils (assoc-ref inputs "coreutils"))
3192 (dirname (string-append coreutils "/bin/dirname"))
3193 (head (string-append coreutils "/bin/head"))
3194 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3195 (python (string-append (assoc-ref inputs "python")
3197 (substitute* "src/maxima.in"
3198 (("sed ") (string-append sed " "))
3199 (("dirname") dirname)
3201 (substitute* "doc/info/Makefile.in"
3202 (("/usr/bin/env perl") perl))
3203 (substitute* "doc/info/build_html.sh.in"
3204 (("python") python))
3206 (add-before 'check 'pre-check
3208 (chmod "src/maxima" #o555)
3212 ;; This is derived from the testing code in the "debian/rules" file
3213 ;; of Debian's Maxima package.
3214 ;; If Maxima can successfully run this, the binary to be installed
3220 "--batch-string=\"run_testsuite();\" "
3221 "| grep -q \"No unexpected errors found\""))))
3222 ;; Make sure the doc and emacs files are found in the
3223 ;; standard location. Also configure maxima to find gnuplot
3224 ;; without having it on the PATH.
3225 (add-after 'install 'post-install
3226 (lambda* (#:key outputs inputs #:allow-other-keys)
3227 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3228 (out (assoc-ref outputs "out"))
3229 (datadir (string-append out "/share/maxima/" ,version))
3230 (binutils (string-append (assoc-ref inputs "binutils")
3232 (with-directory-excursion out
3233 (mkdir-p "share/emacs")
3234 (mkdir-p "share/doc")
3236 (string-append datadir "/doc/")
3237 (string-append out "/share/doc/maxima"))
3238 (with-atomic-file-replacement
3239 (string-append datadir "/share/maxima-init.lisp")
3241 (format out "~a ~s~a~%"
3242 "(setf $gnuplot_command "
3243 (string-append gnuplot "/bin/gnuplot") ")")
3244 (dump-port in out))))
3245 ;; Ensure that Maxima will have access to the GNU binutils
3246 ;; components at runtime.
3247 (wrap-program (string-append out "/bin/maxima")
3248 `("PATH" prefix (,binutils))))
3250 (home-page "http://maxima.sourceforge.net")
3251 (synopsis "Numeric and symbolic expression manipulation")
3252 (description "Maxima is a system for the manipulation of symbolic and
3253 numerical expressions. It yields high precision numeric results by using
3254 exact fractions, arbitrary precision integers, and variable precision floating
3256 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3257 ;; Others simply say "GNU General Public License" without stating a
3258 ;; version (which implicitly means gpl1+).
3259 ;; At least one file (src/maxima.asd) says "version 2."
3260 ;; GPLv2 only is therefore the smallest subset.
3261 (license license:gpl2)))
3263 (define-public wxmaxima
3271 (url "https://github.com/wxMaxima-developers/wxmaxima")
3272 (commit (string-append "Version-" version))))
3273 (file-name (git-file-name name version))
3275 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
3276 (build-system cmake-build-system)
3278 `(("gettext" ,gettext-minimal)
3279 ("xorg-server" ,xorg-server-for-tests)))
3280 ;; TODO: Add libomp for multithreading support.
3281 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3283 `(("wxwidgets" ,wxwidgets)
3286 ("adwaita-icon-theme" ,adwaita-icon-theme)
3288 ("shared-mime-info" ,shared-mime-info)))
3290 `(#:test-target "test"
3292 (modify-phases %standard-phases
3293 (add-before 'check 'pre-check
3295 ;; Tests require a running X server.
3296 (system "Xvfb :1 &")
3297 (setenv "DISPLAY" ":1")
3298 (setenv "HOME" (getcwd))
3300 (add-after 'install 'wrap-program
3301 (lambda* (#:key inputs outputs #:allow-other-keys)
3302 (wrap-program (string-append (assoc-ref outputs "out")
3305 (,(string-append (assoc-ref inputs "maxima")
3307 ;; For GtkFileChooserDialog.
3308 `("GSETTINGS_SCHEMA_DIR" =
3309 (,(string-append (assoc-ref inputs "gtk+")
3310 "/share/glib-2.0/schemas")))
3311 `("XDG_DATA_DIRS" ":" prefix
3312 (;; Needed by gdk-pixbuf to know supported icon formats.
3314 (assoc-ref inputs "shared-mime-info") "/share")
3315 ;; The default icon theme of GTK+.
3317 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3319 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3320 (synopsis "Graphical user interface for the Maxima computer algebra system")
3322 "wxMaxima is a graphical user interface for the Maxima computer algebra
3323 system. It eases the use of Maxima by making most of its commands available
3324 through a menu system and by providing input dialogs for commands that require
3325 more than one argument. It also implements its own display engine that
3326 outputs mathematical symbols directly instead of depicting them with ASCII
3329 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3330 text and mathematical calculations to create documents, exporting of input and
3331 output to TeX, and a browser for Maxima's manual including command index and
3332 full text searching.")
3333 (license license:gpl2+)))
3335 (define-public armadillo
3341 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3345 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3346 (build-system cmake-build-system)
3347 (arguments `(#:tests? #f)) ; no test target
3349 `(("openblas" ,openblas)
3351 ("arpack" ,arpack-ng)))
3352 (home-page "http://arma.sourceforge.net/")
3353 (synopsis "C++ linear algebra library")
3355 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3356 between speed and ease of use. It is useful for algorithm development
3357 directly in C++, or quick conversion of research code into production
3358 environments. It can be used for machine learning, pattern recognition,
3359 signal processing, bioinformatics, statistics, econometrics, etc. The library
3360 provides efficient classes for vectors, matrices and cubes, as well as 150+
3361 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3362 (license license:asl2.0)))
3364 (define-public muparser
3365 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3366 ;; different hash. In order to make `guix package --upgrade` work correctly,
3367 ;; we set a Guix packaging revision.
3368 ;; When the next version of muparser is released, we can remove
3369 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3370 (let ((upstream-version "2.2.5")
3374 (version (string-append upstream-version "-" revision))
3379 (url "https://github.com/beltoforion/muparser")
3380 (commit (string-append "v" upstream-version))))
3381 (file-name (git-file-name name version))
3383 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3384 (build-system gnu-build-system)
3386 `(#:configure-flags '("--enable-samples=no")
3387 #:tests? #f)) ;no "check" target
3388 (home-page "http://muparser.beltoforion.de/")
3389 (synopsis "Fast parser library for mathematical expressions")
3391 "muParser is an extensible high performance math parser library. It is
3392 based on transforming an expression into a bytecode and precalculating constant
3394 (license license:expat))))
3396 (define-public openblas
3403 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3404 version "%20version.tar.gz"))
3405 (file-name (string-append name "-" version ".tar.gz"))
3408 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3409 (build-system gnu-build-system)
3411 `(#:test-target "test"
3412 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3413 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3414 ;; we need to disable substitutions.
3416 ,(let ((system (or (%current-target-system) (%current-system))))
3417 (or (string-prefix? "x86_64" system)
3418 (string-prefix? "i686" system)
3419 (string-prefix? "mips" system)
3420 (string-prefix? "aarch64" system)))
3422 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3424 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3426 ;; This is the maximum number of threads OpenBLAS will ever use (that
3427 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3428 ;; is used.) If we don't set it, the makefile sets it to the number
3429 ;; of cores of the build machine, which is obviously wrong.
3432 ;; Build the library for all supported CPUs. This allows
3433 ;; switching CPU targets at runtime with the environment variable
3434 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3435 ;; Unfortunately, this is not supported on non-x86 architectures,
3436 ;; where it leads to failed builds.
3437 ,@(let ((system (or (%current-target-system) (%current-system))))
3439 ((or (string-prefix? "x86_64" system)
3440 (string-prefix? "i686" system))
3441 '("DYNAMIC_ARCH=1"))
3442 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3443 ;; two available MIPS targets special extended instructions
3444 ;; for Loongson cores are used.
3445 ((string-prefix? "mips" system)
3446 '("TARGET=SICORTEX"))
3447 ;; On aarch64 force the generic 'armv8-a' target
3448 ((string-prefix? "aarch64" system)
3451 ;; no configure script
3453 (modify-phases %standard-phases
3455 (add-before 'build 'set-extralib
3456 (lambda* (#:key inputs #:allow-other-keys)
3457 ;; Get libgfortran found when building in utest.
3459 (string-append "-L" (assoc-ref inputs "fortran-lib")
3463 `(("fortran-lib" ,gfortran "lib")))
3466 ("fortran" ,gfortran)
3468 (home-page "https://www.openblas.net/")
3469 (synopsis "Optimized BLAS library based on GotoBLAS")
3471 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3472 (license license:bsd-3)))
3474 (define-public openblas-ilp64
3475 (package/inherit openblas
3476 (name "openblas-ilp64")
3477 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3479 (substitute-keyword-arguments (package-arguments openblas)
3480 ((#:make-flags flags '())
3481 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3483 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3484 (license license:bsd-3)))
3486 (define* (make-blis implementation #:optional substitutable?)
3487 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3488 source tree for a list of implementations.)
3490 SUBSTITUTABLE? determines whether the package is made available as a
3493 Currently the specialization must be selected at configure-time, but work is
3494 underway to allow BLIS to select the right optimized kernels at run time:
3495 <https://github.com/flame/blis/issues/129>."
3497 (name (if (string=? implementation "reference")
3499 (string-append "blis-" implementation)))
3501 (home-page "https://github.com/flame/blis")
3504 (uri (git-reference (url home-page) (commit version)))
3507 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3508 (file-name (git-file-name "blis" version))))
3509 (build-system gnu-build-system)
3511 `(#:test-target "test"
3513 #:substitutable? ,substitutable?
3515 #:phases (modify-phases %standard-phases
3517 (lambda* (#:key outputs #:allow-other-keys)
3518 ;; This is a home-made 'configure' script.
3519 (let ((out (assoc-ref outputs "out")))
3520 (invoke "./configure" "-p" out
3524 "--enable-threading=openmp"
3527 (add-before 'check 'show-test-output
3529 ;; By default "make check" is silent. Make it verbose.
3530 (system "tail -F output.testsuite &")
3532 (synopsis "High-performance basic linear algebra (BLAS) routines")
3534 "BLIS is a portable software framework for instantiating high-performance
3535 BLAS-like dense linear algebra libraries. The framework was designed to
3536 isolate essential kernels of computation that, when optimized, immediately
3537 enable optimized implementations of most of its commonly used and
3538 computationally intensive operations. While BLIS exports a new BLAS-like API,
3539 it also includes a BLAS compatibility layer which gives application developers
3540 access to BLIS implementations via traditional BLAS routine calls.")
3541 (license license:bsd-3)))
3544 ;; This is the "reference" implementation, which is the non-optimized but
3545 ;; portable variant (no assembly).
3546 (make-blis "reference" #t))
3548 (define ignorance blis)
3550 (define-syntax-rule (blis/x86_64 processor)
3551 "Expand to a package specialized for PROCESSOR."
3553 (inherit (make-blis processor))
3554 (supported-systems '("x86_64-linux"))))
3556 (define-public blis-sandybridge
3557 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3558 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3559 (blis/x86_64 "sandybridge"))
3561 (define-public blis-haswell
3562 ;; BLIS specialized for Haswell processors (launched 2013):
3563 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3564 (blis/x86_64 "haswell"))
3566 (define-public blis-knl
3567 ;; BLIS specialized for Knights Landing processor (launched 2016):
3568 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3569 (blis/x86_64 "knl"))
3572 (define-public openlibm
3580 (url "https://github.com/JuliaLang/openlibm")
3581 (commit (string-append "v" version))))
3582 (file-name (git-file-name name version))
3584 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3585 (build-system gnu-build-system)
3588 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3590 ;; no configure script
3591 (modify-phases %standard-phases (delete 'configure))
3592 #:tests? #f)) ;the tests are part of the default target
3593 (home-page "https://openlibm.org/")
3594 (synopsis "Portable C mathematical library (libm)")
3596 "OpenLibm is an effort to have a high quality, portable, standalone C
3597 mathematical library (libm). It can be used standalone in applications and
3598 programming language implementations. The project was born out of a need to
3599 have a good libm for the Julia programming language that worked consistently
3600 across compilers and operating systems, and in 32-bit and 64-bit
3602 ;; Each architecture has its own make target, and there is none for mips.
3603 (supported-systems (delete "mips64el-linux" %supported-systems))
3604 ;; See LICENSE.md for details.
3605 (license (list license:expat
3608 license:public-domain
3609 license:lgpl2.1+))))
3611 (define-public openspecfun
3613 (name "openspecfun")
3619 (url "https://github.com/JuliaLang/openspecfun")
3620 (commit (string-append "v" version))))
3621 (file-name (git-file-name name version))
3623 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3624 (build-system gnu-build-system)
3626 '(#:tests? #f ; no "check" target
3628 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3630 (modify-phases %standard-phases
3631 (delete 'configure)))) ; no configure script
3633 `(("fortran" ,gfortran)))
3634 (home-page "https://github.com/JuliaLang/openspecfun")
3635 (synopsis "Collection of special mathematical functions")
3637 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3638 portable package for Bessel Functions of a Complex Argument and Nonnegative
3639 Order; it contains subroutines for computing Bessel functions and Airy
3640 functions. Faddeeva allows computing the various error functions of arbitrary
3641 complex arguments (Faddeeva function, error function, complementary error
3642 function, scaled complementary error function, imaginary error function, and
3643 Dawson function); given these, one can also easily compute Voigt functions,
3644 Fresnel integrals, and similar related functions as well.")
3645 ;; Faddeeva is released under the Expat license; AMOS is included as
3646 ;; public domain software.
3647 (license (list license:expat license:public-domain))))
3649 (define-public suitesparse
3651 (name "suitesparse")
3657 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
3658 (commit (string-append "v" version))))
3659 (file-name (git-file-name name version))
3662 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3663 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3664 (modules '((guix build utils)))
3666 ;; Remove bundled metis source
3668 (delete-file-recursively "metis-5.1.0")
3670 (build-system gnu-build-system)
3672 '(#:tests? #f ;no "check" target
3677 "MY_METIS_LIB=-lmetis"
3678 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3679 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3680 (assoc-ref %outputs "out")
3681 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3682 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3683 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3684 " -DCMAKE_SKIP_RPATH=TRUE"
3685 " -DCMAKE_BUILD_TYPE=Release")
3686 (string-append "INSTALL_LIB="
3687 (assoc-ref %outputs "out") "/lib")
3688 (string-append "INSTALL_INCLUDE="
3689 (assoc-ref %outputs "out") "/include")
3692 (modify-phases %standard-phases
3693 (delete 'configure)))) ;no configure script
3699 `(("cmake" ,cmake-minimal)
3701 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3702 (synopsis "Suite of sparse matrix software")
3704 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3705 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3706 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3707 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3708 CXSparse, a concise sparse Cholesky factorization package; and many other
3711 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3713 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3714 (license (list license:gpl2+ license:lgpl2.1+))))
3716 (define-public atlas
3722 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3723 version "/atlas" version ".tar.bz2"))
3726 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3727 (build-system gnu-build-system)
3728 (home-page "http://math-atlas.sourceforge.net/")
3729 (inputs `(("gfortran" ,gfortran)
3730 ("lapack-tar" ,(package-source lapack))))
3731 (outputs '("out" "doc"))
3732 ;; For the moment we drop support for MIPS at it fails to compile. See
3733 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3734 (supported-systems (delete "mips64el-linux" %supported-systems))
3736 `(#:parallel-build? #f
3737 #:parallel-tests? #f
3739 ;; ATLAS tunes itself for the machine it is built on, as explained at
3740 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3741 ;; For this reason, we want users to build it locally instead of using
3745 #:modules ((srfi srfi-26)
3746 (guix build gnu-build-system)
3749 `(;; Generate position independent code suitable for dynamic libraries
3750 ;; and use WALL timer to get more accurate timing.
3751 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3754 ,,(if (string-match "64" (%current-system))
3757 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3758 ;; needed to compile C files before it is generated.
3759 "-Ss" "pmake" "make -j 1"
3760 ;; Probe is failing for MIPS. We therefore define the system
3761 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3762 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3763 ,,@(if (string-prefix? "mips" (%current-system))
3764 (list "-A" "49" "-V" "1")
3766 ;; Generate shared libraries.
3768 ;; Build a full LAPACK library.
3769 ,(string-append "--with-netlib-lapack-tarfile="
3770 (assoc-ref %build-inputs "lapack-tar")))
3772 (modify-phases %standard-phases
3773 (add-after 'install 'install-doc
3774 (lambda* (#:key outputs inputs #:allow-other-keys)
3775 (let ((doc (string-append (assoc-ref outputs "doc")
3776 "/share/doc/atlas")))
3778 (for-each (cut install-file <> doc)
3779 (find-files "../ATLAS/doc" ".*"))
3781 (add-after 'check 'check-pt
3782 (lambda _ (invoke "make" "ptcheck")))
3783 ;; Fix files required to run configure.
3784 (add-before 'configure 'fix-/bin/sh
3786 ;; Use `sh', not `/bin/sh'.
3787 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3791 ;; Fix /bin/sh in generated make files.
3792 (add-after 'configure 'fix-/bin/sh-in-generated-files
3794 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3798 ;; ATLAS configure program does not accepts the default flags
3799 ;; passed by the 'gnu-build-system'.
3801 (lambda* (#:key native-inputs inputs outputs
3802 (configure-flags '())
3803 #:allow-other-keys #:rest args)
3804 (let* ((prefix (assoc-ref outputs "out"))
3805 (bash (or (and=> (assoc-ref
3806 (or native-inputs inputs) "bash")
3807 (cut string-append <> "/bin/bash"))
3809 (flags `(,(string-append "--prefix=" prefix)
3811 (abs-srcdir (getcwd))
3812 (srcdir (string-append "../" (basename abs-srcdir))))
3813 (format #t "source directory: ~s (relative from build: ~s)~%"
3817 (format #t "build directory: ~s~%" (getcwd))
3818 (format #t "configure flags: ~s~%" flags)
3820 (string-append srcdir "/configure")
3822 (synopsis "Automatically Tuned Linear Algebra Software")
3824 "ATLAS is an automatically tuned linear algebra software library
3825 providing C and Fortran77 interfaces to a portably efficient BLAS
3826 implementation, as well as a few routines from LAPACK.
3828 Optimization occurs at build time. For this reason, the library is built on
3829 the machine where it is installed, without resorting to pre-built substitutes.
3831 Before building the library, CPU throttling should be disabled. This can be
3832 done in the BIOS, or, on GNU/Linux, with the following command:
3835 # cpupower --governor performance
3838 Failure to do so will result in a library with poor performance.")
3839 (license license:bsd-3)))
3848 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3849 version "/glm-" version ".zip"))
3851 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
3852 (build-system cmake-build-system)
3854 `(#:phases (modify-phases %standard-phases
3856 (lambda* (#:key outputs #:allow-other-keys)
3857 ;; Since version 0.9.9.6, 'make install' is not supported
3858 ;; and we have to do it "manually". Upstream discussion:
3859 ;; <https://github.com/g-truc/glm/pull/968>.
3860 (let* ((source (string-append "../glm"))
3861 (out (assoc-ref outputs "out"))
3862 (inc (string-append out "/include"))
3863 (lib (string-append out "/lib"))
3864 (pkgconfig (string-append lib "/pkgconfig")))
3865 (with-directory-excursion source
3868 (copy-recursively "glm" (string-append inc "/glm"))
3869 (copy-recursively "cmake" (string-append lib "/cmake"))
3870 (call-with-output-file (string-append pkgconfig "/glm.pc")
3874 includedir=${prefix}/include
3877 Description: OpenGL Mathematics
3879 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3882 `(("unzip" ,unzip)))
3883 (home-page "https://glm.g-truc.net/")
3884 (synopsis "OpenGL Mathematics library")
3885 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3886 library for graphics software based on the OpenGL Shading Language (GLSL)
3888 (license license:expat)))
3890 (define-public lpsolve
3897 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3898 "/lp_solve_" version "_source.tar.gz"))
3901 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3902 (modules '((guix build utils)))
3905 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3907 ;; Pretend to be on a 64 bit platform to obtain a common directory
3908 ;; name for the build results on all architectures; nothing else
3909 ;; seems to depend on it.
3910 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3912 ;; The check for 'isnan' as it is written fails with
3913 ;; "non-floating-point argument in call to function
3914 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3915 ;; definition, which in turn leads to bad things. Fix the feature
3917 (("isnan\\(0\\)") "isnan(0.)"))
3919 (build-system gnu-build-system)
3921 `(#:tests? #f ; no check target
3923 (modify-phases %standard-phases
3924 (delete 'configure) ; no configure script
3927 (with-directory-excursion "lpsolve55"
3928 (invoke "bash" "ccc"))
3929 (with-directory-excursion "lp_solve"
3930 (invoke "bash" "ccc"))
3933 (lambda* (#:key outputs #:allow-other-keys)
3934 (let* ((out (assoc-ref outputs "out"))
3935 (bin (string-append out "/bin"))
3936 (lib (string-append out "/lib"))
3937 ;; This is where LibreOffice expects to find the header
3938 ;; files, and where they are installed by Debian.
3939 (include (string-append out "/include/lpsolve")))
3940 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3941 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3942 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3944 ;; Install a subset of the header files as on Debian
3945 ;; (plus lp_bit.h, which matches the regular expression).
3946 (for-each (lambda (name)
3947 (install-file name include))
3948 (find-files "." "lp_[HMSa-z].*\\.h$"))
3949 (with-directory-excursion "shared"
3950 (for-each (lambda (name)
3951 (install-file name include))
3952 (find-files "." "\\.h$")))
3954 (home-page "http://lpsolve.sourceforge.net/")
3955 (synopsis "Mixed integer linear programming (MILP) solver")
3957 "lp_solve is a mixed integer linear programming solver based on the
3958 revised simplex and the branch-and-bound methods.")
3959 (license license:lgpl2.1+)))
3961 (define-public dealii
3968 (uri (string-append "https://github.com/dealii/dealii/releases/"
3969 "download/v" version "/dealii-" version ".tar.gz"))
3972 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3973 (modules '((guix build utils)))
3975 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3977 (delete-file-recursively "bundled")
3979 (build-system cmake-build-system)
3987 ("arpack" ,arpack-ng)
3988 ("muparser" ,muparser)
3989 ("gfortran" ,gfortran)
3990 ("suitesparse" ,suitesparse))) ;for UMFPACK
3992 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3994 ;; Work around a bug in libsuitesparseconfig linking
3995 ;; see https://github.com/dealii/dealii/issues/4745
3996 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3997 (home-page "https://www.dealii.org")
3998 (synopsis "Finite element library")
4000 "Deal.II is a C++ program library targeted at the computational solution
4001 of partial differential equations using adaptive finite elements. The main
4002 aim of deal.II is to enable rapid development of modern finite element codes,
4003 using among other aspects adaptive meshes and a wide array of tools often used
4004 in finite element programs.")
4005 (license license:lgpl2.1+)))
4007 (define-public dealii-openmpi
4008 (package (inherit dealii)
4009 (name "dealii-openmpi")
4012 ;;Supported only with MPI:
4013 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
4014 ("p4est" ,p4est-openmpi)
4015 ("petsc" ,petsc-openmpi)
4016 ("slepc" ,slepc-openmpi)
4017 ("metis" ,metis) ;for MUMPS
4018 ("scalapack" ,scalapack) ;for MUMPS
4019 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4020 ("arpack" ,arpack-ng-openmpi)
4021 ,@(fold alist-delete (package-inputs dealii)
4022 '("p4est" "arpack"))))
4024 (substitute-keyword-arguments (package-arguments dealii)
4025 ((#:configure-flags cf)
4026 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4028 ((#:phases phases '%standard-phases)
4029 `(modify-phases ,phases
4030 (add-before 'check 'mpi-setup
4031 ,%openmpi-setup)))))
4032 (synopsis "Finite element library (with MPI support)")))
4034 (define-public flann
4038 (home-page "https://github.com/mariusmuja/flann/")
4042 (uri (git-reference (url home-page) (commit version)))
4043 (file-name (git-file-name name version))
4046 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
4047 (patches (search-patches "flann-cmake-3.11.patch"))))
4048 (build-system cmake-build-system)
4051 `(("unzip" ,unzip)))
4054 ;; FIXME: 'mkoctfile' fails with a linker error:
4055 ;; ld: cannot find -loctinterp
4056 ;; ld: cannot find -loctave
4057 ;; Disable it for now.
4058 ;;("octave" ,octave-cli)
4059 ("python" ,python-2) ; print syntax
4060 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4063 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4064 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4065 #:strip-directories '("lib" "lib64" "libexec"
4066 "bin" "sbin" "share/flann/octave")
4068 ;; Save 12 MiB by not installing .a files. Passing
4069 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4070 #:phases (modify-phases %standard-phases
4071 (add-after 'install 'remove-static-libraries
4072 (lambda* (#:key outputs #:allow-other-keys)
4073 (let* ((out (assoc-ref outputs "out"))
4074 (lib (string-append out "/lib")))
4075 (for-each delete-file
4076 (find-files lib "\\.a$"))
4079 #:tests? #f)) ; The test data are downloaded from the Internet.
4080 (synopsis "Library for approximate nearest neighbors computation")
4081 (description "FLANN is a library for performing fast approximate
4082 nearest neighbor searches in high dimensional spaces. It implements a
4083 collection of algorithms and a system for automatically choosing the best
4084 algorithm and optimum parameters depending on the dataset.
4086 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4087 (license (license:non-copyleft "file://COPYING"
4088 "See COPYING in the distribution."))))
4090 (define-public wcalc
4097 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4098 "wcalc-" version ".tar.bz2"))
4101 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4102 (build-system gnu-build-system)
4105 ("readline" ,readline)))
4106 (home-page "http://w-calc.sourceforge.net/index.php")
4107 (synopsis "Flexible command-line scientific calculator")
4108 (description "Wcalc is a very capable calculator. It has standard functions
4109 (sin, asin, and sinh for example, in either radians or degrees), many
4110 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4111 variables, a command history, hex/octal/binary input and output, unit
4112 conversions, embedded comments, and an expandable expression entry field. It
4113 evaluates expressions using the standard order of operations.")
4114 (license license:gpl2+)))
4123 (url "https://github.com/xaos-project/XaoS")
4124 (commit (string-append "release-" version))))
4125 (file-name (git-file-name name version))
4128 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4129 (build-system gnu-build-system)
4130 (native-inputs `(("gettext" ,gettext-minimal)
4132 ("qttools" ,qttools)))
4133 (inputs `(("libx11" ,libx11)
4137 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4138 ;; not enough for this package to install properly. These phases fix that.
4140 `(#:tests? #f ;no "check" target
4142 (modify-phases %standard-phases
4143 (add-before 'configure 'make-qt-deterministic
4145 ;; Make Qt deterministic.
4146 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4149 (lambda* (#:key outputs #:allow-other-keys)
4150 (let ((out (assoc-ref outputs "out")))
4151 ;; The DESTDIR is originally set to install the xaos binary to
4152 ;; the "bin" folder inside the build directory. Setting make
4153 ;; flags doesn't seem to change this.
4154 (substitute* "XaoS.pro"
4156 (string-append "DESTDIR=" out "/bin")))
4157 (substitute* "src/include/config.h"
4158 (("/usr/share/XaoS")
4159 (string-append out "/share/XaoS")))
4161 (add-after 'install 'install-data
4162 (lambda* (#:key outputs #:allow-other-keys)
4163 (let* ((out (assoc-ref outputs "out"))
4164 (share (string-append out "/share")))
4168 (copy-recursively folder
4169 (string-append share "/XaoS/" folder)))
4170 '("catalogs" "examples" "tutorial"))
4171 (install-file "xdg/xaos.png"
4172 (string-append share "/pixmaps"))
4173 (install-file "xdg/xaos.desktop"
4174 (string-append share "/applications")))
4176 (synopsis "Real-time fractal zoomer")
4177 (description "GNU XaoS is a graphical program that generates fractal
4178 patterns and allows you to zoom in and out of them infinitely in a fluid,
4179 continuous manner. It also includes tutorials that help to explain how fractals
4180 are built. It can generate many different fractal types such as the Mandelbrot
4182 (home-page "https://xaos-project.github.io/")
4183 (license license:gpl2+)))
4185 (define-public hypre
4193 (url "https://github.com/LLNL/hypre")
4194 (commit (string-append "v" version))))
4195 (file-name (git-file-name name version))
4197 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4198 (modules '((guix build utils)))
4201 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4202 ;; substitute the release date.
4203 (substitute* "src/utilities/HYPRE_utilities.h"
4204 (("Date Compiled: .*$")
4205 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4207 (build-system gnu-build-system)
4208 (outputs '("out" ; 6.1 MiB of headers and libraries
4209 "doc")) ; 4.8 MiB of documentation
4213 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4214 ("texlive" ,(texlive-union (list texlive-xypic
4216 texlive-latex-hyperref
4218 ("ghostscript" ,ghostscript)))
4220 `(("blas" ,openblas)
4221 ("lapack" ,lapack)))
4223 `(#:modules ((srfi srfi-1)
4224 ,@%gnu-build-system-modules)
4225 #:configure-flags '("--enable-shared"
4233 (modify-phases %standard-phases
4234 (add-before 'build 'set-HOME
4236 ;; FIXME: texlive-union does not find the built
4237 ;; metafonts, so it tries to generate them in HOME.
4238 (setenv "HOME" "/tmp")
4240 (add-before 'configure 'chdir-src
4241 (lambda _ (chdir "src")))
4243 (lambda* (#:key build target configure-flags
4244 #:allow-other-keys #:rest args)
4245 (let* ((configure (assoc-ref %standard-phases 'configure)))
4248 (list #:configure-flags
4249 (cons (string-append
4250 "--host=" (or target build))
4251 configure-flags)))))))
4252 (add-after 'build 'build-docs
4254 (invoke "make" "-Cdocs" "pdf" "html")))
4257 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4258 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4259 (invoke "make" "check" "CHECKRUN=")
4260 (for-each (lambda (filename)
4261 (let ((size (stat:size (stat filename))))
4262 (when (positive? size)
4263 (error (format #f "~a size ~d; error indication~%"
4265 (find-files "test" ".*\\.err$"))
4267 (add-after 'install 'install-docs
4268 (lambda* (#:key outputs #:allow-other-keys)
4269 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4270 (let* ((doc (assoc-ref outputs "doc"))
4271 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4272 (with-directory-excursion "docs"
4273 (for-each (lambda (base)
4274 (install-file (string-append base ".pdf") docdir)
4275 (copy-recursively base docdir)) ; html docs
4276 '("HYPRE_usr_manual"
4277 "HYPRE_ref_manual")))
4279 (home-page "http://www.llnl.gov/casc/hypre/")
4280 (synopsis "Library of solvers and preconditioners for linear equations")
4282 "HYPRE is a software library of high performance preconditioners and
4283 solvers for the solution of large, sparse linear systems of equations. It
4284 features multigrid solvers for both structured and unstructured grid
4286 (license license:lgpl2.1)))
4288 (define-public hypre-openmpi
4289 (package (inherit hypre)
4290 (name "hypre-openmpi")
4293 ,@(package-inputs hypre)))
4295 (substitute-keyword-arguments (package-arguments hypre)
4296 ((#:configure-flags flags)
4298 ,@(delete "--without-MPI" ,flags)))
4300 `(modify-phases ,phases
4301 (add-before 'check 'mpi-setup
4302 ,%openmpi-setup)))))
4303 (synopsis "Parallel solvers and preconditioners for linear equations")
4305 "HYPRE is a software library of high performance preconditioners and
4306 solvers for the solution of large, sparse linear systems of equations on
4307 parallel computers. It features parallel multigrid solvers for both
4308 structured and unstructured grid problems.")))
4310 (define-public matio
4317 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4318 "matio-" version ".tar.gz"))
4321 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4322 (build-system gnu-build-system)
4326 (home-page "http://matio.sourceforge.net/")
4327 (synopsis "Library for reading and writing MAT files")
4328 (description "Matio is a library for reading and writing MAT files. It
4329 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4330 (license license:bsd-2)))
4337 (origin (method url-fetch)
4338 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4339 "download/" version "/Vc-" version ".tar.gz"))
4342 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4343 (build-system cmake-build-system)
4346 '("-DBUILD_TESTING=ON"
4347 ;; By default, Vc will optimize for the CPU of the build machine.
4348 ;; Setting this to "none" makes it create portable binaries. See
4349 ;; "cmake/OptimizeForArchitecture.cmake".
4350 "-DTARGET_ARCHITECTURE=none")
4351 #:phases (modify-phases %standard-phases
4352 (add-after 'unpack 'copy-testdata
4353 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4354 (let ((testdata (assoc-ref (or native-inputs inputs)
4356 (copy-recursively testdata "tests/testdata")
4359 `(("virtest" ,virtest)
4361 ;; This is a submodule in the git project, but not part of the
4362 ;; released sources. See the git branch for the commit to take.
4363 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4367 (url "https://github.com/VcDevel/vc-testdata")
4368 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4369 (file-name (git-file-name "vc-testdata"
4370 (string-take commit 7)))
4373 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4374 (synopsis "SIMD vector classes for C++")
4375 (description "Vc provides portable, zero-overhead C++ types for explicitly
4376 data-parallel programming. It is a library designed to ease explicit
4377 vectorization of C++ code. Its types enable explicitly stating data-parallel
4378 operations on multiple values. The parallelism is therefore added via the type
4379 system. Vc has an intuitive API and provides portability between different
4380 compilers and compiler versions as well as portability between different vector
4381 instruction sets. Thus, an application written with Vc can be compiled for:
4384 @item SSE2 up to SSE4.2 or SSE4a
4387 @item NEON (in development)
4388 @item NVIDIA GPUs / CUDA (in development)
4390 (home-page "https://github.com/VcDevel/Vc")
4391 ;; "No support_???.cpp file exists for this architecture."
4392 (supported-systems '("x86_64-linux" "i686-linux"))
4393 (license license:bsd-3)))
4395 (define-public reducelcs
4396 ;; This is the last commit which is available upstream, no
4397 ;; release happened since 2010.
4398 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4402 (version (string-append "1.0-" revision "." (string-take commit 7)))
4407 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4409 (file-name (string-append name "-" version "-checkout"))
4412 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4413 (build-system gnu-build-system)
4415 `(("openlibm" ,openlibm)))
4417 `(#:tests? #f ; no tests
4419 (modify-phases %standard-phases
4420 (delete 'configure) ; No configure script exists.
4421 (replace 'install ; No install phase exists.
4422 (lambda* (#:key outputs #:allow-other-keys)
4423 (let* ((out (assoc-ref outputs "out"))
4424 (bin (string-append out "/bin")))
4425 (install-file "Approximation" bin)
4426 (install-file "CollectResults" bin)
4427 (install-file "GenerateInstances" bin)
4429 (synopsis "Approximate Longest Commons Subsequence computation tool")
4431 "@code{reduceLCS} is an implementation of the Reduce-Expand
4432 algorithm for LCS. It is a fast program to compute the approximate
4433 Longest Commons Subsequence of a set of strings.")
4434 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4435 (license license:gpl3+))))
4437 (define-public jacal
4444 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4447 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4448 (patches (search-patches "jacal-fix-texinfo.patch"))))
4449 (build-system gnu-build-system)
4452 (modify-phases %standard-phases
4453 (add-before 'build 'pre-build
4454 ;; Don't use upstream's script - it really doesn't fit into
4455 ;; Guix's functional paradigm.
4456 (lambda* (#:key inputs outputs #:allow-other-keys)
4457 (substitute* "Makefile"
4458 (("^install: install-script") "install: "))))
4459 (add-after 'install 'post-install
4460 ;; Instead, we provide our own simplified script.
4461 (lambda* (#:key inputs outputs #:allow-other-keys)
4462 (let ((wrapper (string-append (assoc-ref outputs "out")
4464 (format (open wrapper (logior O_WRONLY O_CREAT))
4465 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4466 "-e '(slib:load \"~a/lib/jacal/math\") "
4469 (assoc-ref inputs "scm")
4470 (assoc-ref outputs "out"))
4471 (chmod wrapper #o555))))
4473 (lambda* (#:key outputs #:allow-other-keys)
4474 (invoke "./configure"
4475 (string-append "--prefix="
4476 (assoc-ref outputs "out"))))))))
4477 (inputs `(("scm" ,scm)))
4478 (native-inputs `(("unzip" ,unzip)
4479 ("texinfo" ,texinfo)))
4480 (synopsis "Symbolic mathematics system")
4481 (description "GNU JACAL is an interactive symbolic mathematics program based on
4482 Scheme. It manipulate and simplify a range of mathematical expressions such
4483 as equations, scalars, vectors, and matrices.")
4484 (home-page "https://www.gnu.org/software/jacal/")
4485 (license license:gpl3+)))
4491 (home-page "https://github.com/Z3Prover/z3")
4494 (uri (git-reference (url home-page)
4495 (commit (string-append "z3-" version))))
4496 (file-name (git-file-name name version))
4499 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
4500 (build-system gnu-build-system)
4502 `(#:imported-modules ((guix build python-build-system)
4503 ,@%gnu-build-system-modules)
4504 #:modules (((guix build python-build-system) #:select (site-packages))
4505 (guix build gnu-build-system)
4508 (modify-phases %standard-phases
4509 (add-after 'unpack 'enable-bytecode-determinism
4511 (setenv "PYTHONHASHSEED" "0")
4513 (add-after 'unpack 'fix-compatability
4514 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4516 (substitute* "src/util/mpz.cpp"
4517 (("#include <immintrin.h>") ""))
4519 (add-before 'configure 'bootstrap
4521 (invoke "python" "scripts/mk_make.py")))
4522 ;; work around gnu-build-system's setting --enable-fast-install
4523 ;; (z3's `configure' is a wrapper around the above python file,
4524 ;; which fails when passed --enable-fast-install)
4526 (lambda* (#:key inputs outputs #:allow-other-keys)
4527 (invoke "./configure"
4529 (string-append "--prefix=" (assoc-ref outputs "out"))
4530 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4531 (add-after 'configure 'change-directory
4535 (add-before 'check 'make-test-z3
4537 ;; Build the test suite executable.
4538 (invoke "make" "test-z3" "-j"
4539 (number->string (parallel-job-count)))))
4542 ;; Run all the tests that don't require arguments.
4543 (invoke "./test-z3" "/a"))))))
4546 ("python" ,python-wrapper)))
4547 (synopsis "Theorem prover")
4548 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4549 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4550 (license license:expat)))
4555 (version "2018.11.001")
4558 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4559 version "/elpa-" version ".tar.gz"))
4562 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4563 (build-system gnu-build-system)
4565 `(("fortran" ,gfortran)
4566 ("perl" ,perl))) ;for configure and deps
4568 `(("blas" ,openblas)))
4573 ;; ELPA unfortunately does not support runtime dispatch, so we can
4574 ;; only enable the "generic" kernels. See the "Cross compilation"
4575 ;; section of INSTALL.md.
4577 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4578 "--disable-avx" "--disable-avx2" "--disable-avx512"
4579 ,(string-append "CFLAGS=-O3 "
4580 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4581 "-ftree-vect-loop-version -ftree-vectorize "
4582 ,(let ((system (or (%current-target-system)
4583 (%current-system))))
4585 ((or (string-prefix? "x86_64" system)
4586 (string-prefix? "i686" system))
4589 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4591 (modify-phases %standard-phases
4592 (add-before 'configure 'patch-header-generation
4594 (substitute* "configure"
4595 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4596 (string-append & " CPP=\"$CPP\"")))
4598 (add-before 'check 'setup-tests
4600 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4601 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4602 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4603 ;; for Fortran. This also causes several tests to pass that
4604 ;; otherwise would otherwise fail with matrix size 5000; possibly
4605 ;; due to floating point tolerances that are too tight.
4606 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4607 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4608 (substitute* "Makefile"
4609 ;; Test scripts are generated, patch the shebang
4610 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4612 (home-page "http://elpa.mpcdf.mpg.de")
4613 (synopsis "Eigenvalue solvers for symmetric matrices")
4615 "The ELPA library provides efficient and scalable direct eigensolvers for
4616 symmetric matrices.")
4617 (license license:lgpl3)))
4619 (define-public elpa-openmpi
4620 (package (inherit elpa)
4621 (name "elpa-openmpi")
4624 ("scalapack" ,scalapack)
4625 ,@(package-inputs elpa)))
4627 (substitute-keyword-arguments (package-arguments elpa)
4628 ((#:configure-flags cf '())
4629 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4630 ((#:phases phases '%standard-phases)
4631 `(modify-phases ,phases
4632 (add-before 'check 'mpi-setup
4634 ;; Tests use 2 mpi tasks by default, use our remaining build
4635 ;; cores as OpenMP threads.
4636 (setenv "OMP_NUM_THREADS" (number->string
4637 (max (quotient (parallel-job-count) 2)
4639 (,%openmpi-setup)))))))
4640 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4642 (define-public elemental
4649 (url "https://github.com/elemental/Elemental")
4650 (commit (string-append "v" version))))
4651 (file-name (git-file-name name version))
4654 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4655 (build-system cmake-build-system)
4656 (home-page "https://github.com/elemental/Elemental")
4658 `(("gfortran" ,gfortran)))
4660 `(("blas" ,openblas)
4661 ("gfortran:lib" ,gfortran "lib")
4670 `(#:build-type "Release" ;default RelWithDebInfo not supported
4671 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4672 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4673 "-DEL_CACHE_WARNINGS:BOOL=YES"
4674 "-DEL_TESTS:BOOL=YES"
4675 "-DCMAKE_INSTALL_LIBDIR=lib"
4676 "-DGFORTRAN_LIB=gfortran")
4677 #:phases (modify-phases %standard-phases
4678 (add-before 'check 'mpi-setup
4680 (add-before 'check 'setup-tests
4682 ;; Parallelism is done at the MPI layer.
4683 (setenv "OMP_NUM_THREADS" "1")
4685 (add-after 'install 'remove-tests
4686 (lambda* (#:key outputs #:allow-other-keys)
4687 ;; Tests are installed, with no easy configuration
4688 ;; switch to prevent this, so delete them.
4689 (delete-file-recursively
4690 (string-append (assoc-ref outputs "out") "/bin"))
4692 (synopsis "Dense and sparse-direct linear algebra and optimization")
4693 (description "Elemental is a modern C++ library for distributed-memory
4694 dense and sparse-direct linear algebra, conic optimization, and lattice
4696 (license license:bsd-2)))
4698 (define-public mcrl2
4701 (version "202006.0")
4705 "https://www.mcrl2.org/download/release/mcrl2-"
4709 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
4714 ("qtbase" ,qtbase)))
4715 (build-system cmake-build-system)
4716 (synopsis "Toolset for the mCRL2 formal specification language")
4718 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4719 specification language for describing concurrent discrete event systems. Its
4720 toolset supports analysis and automatic verification, linearisation, simulation,
4721 state-space exploration and generation, and tools to optimise and analyse
4722 specifications. Also, state spaces can be manipulated, visualised and
4724 (home-page "https://mcrl2.org")
4725 (license license:boost1.0)))
4727 (define-public mcrl2-minimal
4730 (name "mcrl2-minimal")
4732 `(("boost" ,boost)))
4734 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4736 (define-public tcalc
4743 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4747 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4748 (build-system gnu-build-system)
4749 (synopsis "The terminal calculator")
4751 "The terminal calculator is a small program to help users of the GNU/Linux
4752 terminal do calculations simply and quickly. The formula to be calculated can
4753 be fed to @command{tcalc} through the command line.")
4754 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4755 (license license:gpl3+)))
4757 (define-public sundials
4764 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4765 "sundials-" version ".tar.gz"))
4768 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4769 (build-system cmake-build-system)
4771 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4773 `(("fortran" ,gfortran) ;for fcmix
4775 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4777 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4778 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4779 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4780 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4781 "-DEXAMPLES_INSTALL:BOOL=OFF"
4783 "-DFCMIX_ENABLE:BOOL=ON"
4785 "-DKLU_ENABLE:BOOL=ON"
4786 ,(string-append "-DKLU_INCLUDE_DIR="
4787 (assoc-ref %build-inputs "suitesparse")
4789 ,(string-append "-DKLU_LIBRARY_DIR="
4790 (assoc-ref %build-inputs "suitesparse")
4792 (home-page "https://computation.llnl.gov/projects/sundials")
4793 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4794 (description "SUNDIALS is a family of software packages implemented with
4795 the goal of providing robust time integrators and nonlinear solvers that can
4796 easily be incorporated into existing simulation codes.")
4797 (license license:bsd-3)))
4799 (define-public sundials-openmpi
4800 (package (inherit sundials)
4801 (name "sundials-openmpi")
4804 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4805 ,@(package-inputs sundials)))
4807 (substitute-keyword-arguments (package-arguments sundials)
4808 ((#:configure-flags flags '())
4809 `(cons* "-DMPI_ENABLE:BOOL=ON"
4810 "-DPETSC_ENABLE:BOOL=ON"
4811 (string-append "-DPETSC_INCLUDE_DIR="
4812 (assoc-ref %build-inputs "petsc")
4814 (string-append "-DPETSC_LIBRARY_DIR="
4815 (assoc-ref %build-inputs "petsc")
4818 ((#:phases phases '%standard-phases)
4819 `(modify-phases ,phases
4820 (add-before 'check 'mpi-setup
4821 ,%openmpi-setup)))))
4822 (synopsis "SUNDIALS with OpenMPI support")))
4824 (define-public combinatorial-blas
4826 (name "combinatorial-blas")
4831 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4833 (match (string-split version #\.)
4834 ((major minor patch)
4835 (string-append major minor "_" patch))) ;e.g. "16_2"
4839 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4840 (patches (search-patches "combinatorial-blas-awpm.patch"
4841 "combinatorial-blas-io-fix.patch"))))
4842 (build-system cmake-build-system)
4845 ("test-data" ,(origin
4847 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4848 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4851 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4853 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4854 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4855 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4857 (modify-phases %standard-phases
4858 (add-before 'check 'mpi-setup
4860 (add-before 'check 'test-setup
4861 (lambda* (#:key inputs #:allow-other-keys)
4862 (setenv "OMP_NUM_THREADS" "2")
4863 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4864 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4865 (synopsis "Linear algebra primitives for graph analytics")
4866 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4867 distributed-memory parallel graph library offering a small but powerful set of
4868 linear algebra primitives specifically targeting graph analytics.")
4870 license:gpl2+ ;include/psort/(funnel|sort)*.h
4871 license:x11 ;usort and psort
4872 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4874 (define-public dune-common
4876 (name "dune-common")
4881 (uri (string-append "https://dune-project.org/download/"
4882 version "/dune-common-" version ".tar.gz"))
4885 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
4886 (build-system cmake-build-system)
4889 (modify-phases %standard-phases
4890 (add-after 'build 'build-tests
4891 (lambda* (#:key make-flags #:allow-other-keys)
4892 (apply invoke "make" "build_tests" make-flags))))))
4896 ("openblas" ,openblas)
4898 ("superlu" ,superlu)))
4900 `(("gfortran" ,gfortran)
4901 ("pkg-config" ,pkg-config)))
4902 (home-page "https://dune-project.org/")
4903 (synopsis "Distributed and Unified Numerics Environment")
4904 (description "DUNE, the Distributed and Unified Numerics Environment is a
4905 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4906 grid-based methods. It supports the easy implementation of methods like
4907 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4908 Differences} (FD).")
4909 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4910 (license license:gpl2)))
4912 (define-public dune-geometry
4914 (name "dune-geometry")
4919 (uri (string-append "https://dune-project.org/download/"
4920 version "/dune-geometry-" version ".tar.gz"))
4923 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
4924 (build-system cmake-build-system)
4927 (modify-phases %standard-phases
4928 (add-after 'build 'build-tests
4929 (lambda* (#:key make-flags #:allow-other-keys)
4930 (apply invoke "make" "build_tests" make-flags))))))
4932 `(("dune-common" ,dune-common)
4934 ("openblas" ,openblas)
4936 ("python" ,python)))
4938 `(("gfortran" ,gfortran)
4939 ("pkg-config" ,pkg-config)))
4940 (home-page "https://dune-project.org/")
4941 (synopsis "Distributed and Unified Numerics Environment")
4942 (description "DUNE, the Distributed and Unified Numerics Environment is a
4943 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4944 grid-based methods. It supports the easy implementation of methods like
4945 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4948 This package contains the basic DUNE geometry classes.")
4949 ;; GPL version 2 with "runtime exception"
4950 (license license:gpl2)))
4952 (define-public dune-uggrid
4954 (name "dune-uggrid")
4960 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
4961 (commit (string-append "v" version))))
4962 (file-name (git-file-name name version))
4965 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
4966 (build-system cmake-build-system)
4969 (modify-phases %standard-phases
4970 (add-after 'build 'build-tests
4971 (lambda* (#:key make-flags #:allow-other-keys)
4972 (apply invoke "make" "build_tests" make-flags))))))
4974 `(("dune-common" ,dune-common)))
4976 `(("gfortran" ,gfortran)
4977 ("pkg-config" ,pkg-config)))
4978 (home-page "https://dune-project.org/")
4979 (synopsis "Distributed and Unified Numerics Environment")
4980 (description "DUNE, the Distributed and Unified Numerics Environment is a
4981 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4982 grid-based methods. It supports the easy implementation of methods like
4983 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4986 This package contains the DUNE UG grid classes.")
4987 (license license:lgpl2.1)))
4989 (define-public dune-grid
4996 (uri (string-append "https://dune-project.org/download/"
4997 version "/dune-grid-" version ".tar.gz"))
5000 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
5001 (build-system cmake-build-system)
5004 (modify-phases %standard-phases
5005 (add-after 'build 'build-tests
5006 (lambda* (#:key make-flags #:allow-other-keys)
5007 (apply invoke "make" "build_tests" make-flags))))))
5009 `(("dune-common" ,dune-common)
5010 ("dune-geometry" ,dune-geometry)
5013 ("openblas" ,openblas)
5014 ("python" ,python)))
5016 `(("dune-uggrid" ,dune-uggrid)))
5018 `(("gfortran" ,gfortran)
5019 ("pkg-config" ,pkg-config)))
5020 (home-page "https://dune-project.org/")
5021 (synopsis "Distributed and Unified Numerics Environment")
5022 (description "DUNE, the Distributed and Unified Numerics Environment is a
5023 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5024 grid-based methods. It supports the easy implementation of methods like
5025 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5028 This package contains the basic DUNE grid classes.")
5029 ;; GPL version 2 with "runtime exception"
5030 (license license:gpl2)))
5032 (define-public dune-istl
5039 (uri (string-append "https://dune-project.org/download/"
5040 version "/dune-istl-" version ".tar.gz"))
5043 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5044 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
5045 (build-system cmake-build-system)
5048 (modify-phases %standard-phases
5049 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5050 ;; the stdlib types when the gfortran header is used. Remove gfortran
5051 ;; from CPLUS_INCLUDE_PATH as a workaround.
5052 (add-after 'set-paths 'hide-gfortran
5053 (lambda* (#:key inputs #:allow-other-keys)
5054 (let ((gfortran (assoc-ref inputs "gfortran")))
5055 (setenv "CPLUS_INCLUDE_PATH"
5057 (delete (string-append gfortran "/include/c++")
5058 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
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)
5068 ("suitesparse" ,suitesparse)
5069 ("superlu" ,superlu)
5070 ("openblas" ,openblas)
5072 ("python" ,python)))
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
5082 This is the iterative solver template library which provides generic sparse
5083 matrix/vector classes and a variety of solvers based on these classes. A
5084 special feature is the use of templates to exploit the recursive block
5085 structure of finite element matrices at compile time. Available solvers
5086 include Krylov methods, (block-) incomplete decompositions and
5087 aggregation-based algebraic multigrid.")
5088 ;; GPL version 2 with "runtime exception"
5089 (license license:gpl2)))
5091 (define-public dune-localfunctions
5093 (name "dune-localfunctions")
5098 (uri (string-append "https://dune-project.org/download/"
5099 version "/dune-localfunctions-" version ".tar.gz"))
5102 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5103 (build-system cmake-build-system)
5106 (modify-phases %standard-phases
5107 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5108 ;; and fails to find the stdlib types when the gfortran header is used.
5109 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5110 (add-after 'set-paths 'hide-gfortran
5111 (lambda* (#:key inputs #:allow-other-keys)
5112 (let ((gfortran (assoc-ref inputs "gfortran")))
5113 (setenv "CPLUS_INCLUDE_PATH"
5115 (delete (string-append gfortran "/include/c++")
5116 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5119 (add-after 'build 'build-tests
5120 (lambda* (#:key make-flags #:allow-other-keys)
5121 (apply invoke "make" "build_tests" make-flags))))))
5123 `(("dune-common" ,dune-common)
5124 ("dune-geometry" ,dune-geometry)
5127 ("superlu" ,superlu)
5130 `(("gfortran" ,gfortran)
5131 ("pkg-config" ,pkg-config)))
5132 (home-page "https://dune-project.org/")
5133 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5134 (description "This DUNE module provides interface and implementation for
5135 shape functions defined on the DUNE reference elements. In addition to the
5136 shape function, interpolation operators and special keys are provided which
5137 can be used to assemble global function spaces on finite-element grids.
5139 This package provides an interface and implementation for shape functions
5140 defined on the DUNE reference elements. In addition to the shape function,
5141 interpolation operators and special keys are provided which can be used to
5142 assemble global function spaces on finite-element grids.")
5143 ;; GPL version 2 with "runtime exception"
5144 (license license:gpl2)))
5146 (define-public dune-alugrid
5148 (name "dune-alugrid")
5149 (version "2.7.0-git-81d35682")
5154 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5155 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5156 (file-name (git-file-name name version))
5159 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5160 (build-system cmake-build-system)
5163 (modify-phases %standard-phases
5164 (add-after 'unpack 'patch-include
5166 (substitute* "dune/alugrid/test/test-alugrid.cc"
5167 (("doc/grids/gridfactory/testgrids")
5168 "doc/dune-grid/grids/gridfactory/testgrids"))
5170 (add-after 'build 'build-tests
5171 (lambda* (#:key inputs make-flags #:allow-other-keys)
5172 (setenv "CPLUS_INCLUDE_PATH"
5173 (string-append (assoc-ref inputs "dune-grid") "/share"))
5174 (apply invoke "make" "build_tests" make-flags))))))
5176 `(("dune-common" ,dune-common)
5177 ("dune-geometry" ,dune-geometry)
5178 ("dune-grid" ,dune-grid)
5181 ("openblas" ,openblas)
5183 ("superlu" ,superlu)
5187 `(("gfortran" ,gfortran)
5188 ("pkg-config" ,pkg-config)))
5189 (home-page "https://dune-project.org/")
5190 (synopsis "Distributed and Unified Numerics Environment")
5191 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5192 implementation of the DUNE grid interface supporting either simplices or
5194 (license license:gpl2+)))
5196 (define-public dune-subgrid
5198 (name "dune-subgrid")
5199 (version "2.7.0-git-2103a363")
5204 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5205 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5206 (file-name (git-file-name name version))
5209 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5210 (build-system cmake-build-system)
5213 (modify-phases %standard-phases
5214 (add-after 'build 'build-tests
5215 (lambda* (#:key make-flags #:allow-other-keys)
5216 (apply invoke "make" "build_tests" make-flags))))))
5218 `(("dune-common" ,dune-common)
5219 ("dune-geometry" ,dune-geometry)
5220 ("dune-grid" ,dune-grid)
5223 ("openblas" ,openblas)
5226 `(("gfortran" ,gfortran)
5227 ("pkg-config" ,pkg-config)))
5228 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5229 (synopsis "Distributed and Unified Numerics Environment")
5230 (description "The dune-subgrid module marks elements of
5231 another hierarchical dune grid. The set of marked elements can then be
5232 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5233 provides the full grid interface including adaptive mesh refinement.")
5234 (license license:gpl2+)))
5236 (define-public dune-typetree
5238 (name "dune-typetree")
5244 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5245 (commit (string-append "v" version))))
5246 (file-name (git-file-name name version))
5249 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5250 (build-system cmake-build-system)
5253 (modify-phases %standard-phases
5254 (add-after 'build 'build-tests
5255 (lambda* (#:key make-flags #:allow-other-keys)
5256 (apply invoke "make" "build_tests" make-flags))))))
5258 `(("dune-common" ,dune-common)
5260 ("openblas" ,openblas)
5263 ("superlu" ,superlu)
5266 `(("gfortran" ,gfortran)
5267 ("pkg-config" ,pkg-config)))
5268 (home-page "https://dune-project.org/")
5269 (synopsis "Distributed and Unified Numerics Environment")
5270 (description "TypeTree is a template library for constructing and
5271 operating on statically typed trees of objects.")
5272 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5273 (license (list license:lgpl3+ license:gpl2))))
5275 (define-public dune-functions
5277 (name "dune-functions")
5283 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5284 (commit (string-append "v" version))))
5285 (file-name (git-file-name name version))
5288 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5289 (build-system cmake-build-system)
5292 (modify-phases %standard-phases
5293 (add-after 'unpack 'disable-failing-tests
5296 ;; unable to load GMSH file in this test
5297 "--exclude-regex gridviewfunctionspacebasistest")
5299 (add-after 'build 'build-tests
5300 (lambda* (#:key make-flags #:allow-other-keys)
5301 (apply invoke "make" "build_tests" make-flags))))))
5303 `(("dune-common" ,dune-common)
5304 ("dune-istl" ,dune-istl)
5305 ("dune-localfunctions" ,dune-localfunctions)
5306 ("dune-grid" ,dune-grid)
5307 ("dune-geometry" ,dune-geometry)
5308 ("dune-typetree" ,dune-typetree)
5309 ("openblas" ,openblas)
5312 ("superlu" ,superlu)
5315 `(("gfortran" ,gfortran)
5316 ("pkg-config" ,pkg-config)))
5317 (home-page "https://dune-project.org/")
5318 (synopsis "Distributed and Unified Numerics Environment")
5319 (description "The dune-functions module provides an abstraction layer for
5320 global finite element functions. Its two main concepts are functions
5321 implemented as callable objects, and bases of finite element spaces.")
5322 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5323 (license (list license:lgpl3+ license:gpl2))))
5325 (define-public dune-pdelab
5327 (name "dune-pdelab")
5328 (version "2.7.0-git-476fe437")
5333 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5334 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5335 (file-name (git-file-name name version))
5338 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5339 (build-system cmake-build-system)
5340 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5342 `(("dune-common" ,dune-common)
5343 ("dune-istl" ,dune-istl)
5344 ("dune-localfunctions" ,dune-localfunctions)
5345 ("dune-geometry" ,dune-geometry)
5346 ("dune-grid" ,dune-grid)
5347 ("dune-typetree" ,dune-typetree)
5348 ("dune-functions" ,dune-functions)
5350 ("openblas" ,openblas)
5354 ("superlu" ,superlu)
5357 `(("gfortran" ,gfortran)
5358 ("pkg-config" ,pkg-config)))
5359 (home-page "https://dune-project.org/")
5360 (synopsis "Differential equations solver toolbox")
5361 (description "PDELab is a partial differential equations solver toolbox
5362 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5363 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5364 (license (list license:lgpl3+ license:gpl2))))
5366 (define add-openmpi-to-dune-package
5367 (let ((dune-package?
5368 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5371 (if (dune-package? p)
5372 (package (inherit p)
5373 (name (string-append (package-name p) "-openmpi"))
5374 (inputs `(,@(package-inputs p)
5375 ("openmpi" ,openmpi)))
5377 (substitute-keyword-arguments (package-arguments p)
5378 ((#:phases phases '%standard-phases)
5379 `(modify-phases ,phases
5380 (add-before 'check 'mpi-setup
5381 ,%openmpi-setup)))))
5382 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5384 (negate dune-package?))))
5386 (define-public dune-common-openmpi
5387 (add-openmpi-to-dune-package dune-common))
5389 (define-public dune-geometry-openmpi
5390 (add-openmpi-to-dune-package dune-geometry))
5392 (define-public dune-istl-openmpi
5393 (add-openmpi-to-dune-package dune-istl))
5395 (define-public dune-typetree-openmpi
5396 (add-openmpi-to-dune-package dune-typetree))
5398 (define-public dune-uggrid-openmpi
5399 (add-openmpi-to-dune-package dune-uggrid))
5401 (define-public dune-grid-openmpi
5402 (add-openmpi-to-dune-package dune-grid))
5404 (define-public dune-alugrid-openmpi
5405 (add-openmpi-to-dune-package dune-alugrid))
5407 (define-public dune-subgrid-openmpi
5408 (add-openmpi-to-dune-package dune-subgrid))
5410 (define-public dune-localfunctions-openmpi
5411 (add-openmpi-to-dune-package dune-localfunctions))
5413 (define-public dune-functions-openmpi
5414 (add-openmpi-to-dune-package dune-functions))
5416 (define-public dune-pdelab-openmpi
5417 (add-openmpi-to-dune-package dune-pdelab))
5419 (define-public mlucas
5427 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5429 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5430 (build-system gnu-build-system)
5432 `(("python2" ,python-2)))
5434 `(#:tests? #f ; no tests
5436 (modify-phases %standard-phases
5440 (call-with-output-file "Makefile"
5442 (format port "CC = gcc
5443 CFLAGS = -O3 ~a -DUSE_THREADS
5444 LDLIBS = -lm -lpthread -lrt
5445 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5447 ,(let ((system (or (%current-target-system)
5448 (%current-system))))
5450 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5454 (lambda* (#:key outputs #:allow-other-keys)
5455 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5456 (install-file "Mlucas" bin)
5457 (install-file "primenet.py" bin))
5459 (home-page "https://www.mersenne.org")
5460 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5461 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5462 numbers in search of a world-record prime. You may use it to test any
5463 suitable number as you wish, but it is preferable that you do so in a
5464 coordinated fashion, as part of the Great Internet Mersenne Prime
5465 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5466 management via the GIMPS project's Primenet server.")
5467 (license license:gpl2+)))
5469 (define-public nauty
5477 "https://pallini.di.uniroma1.it/"
5478 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5480 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5481 (build-system gnu-build-system)
5482 (outputs '("out" "lib"))
5484 `(#:test-target "checks"
5485 #:configure-flags '("--enable-generic") ;prevent -march-native
5487 (modify-phases %standard-phases
5488 ;; Default make target does not build all available
5489 ;; executables. Create them now.
5490 (add-after 'build 'build-extra-programs
5492 (for-each (lambda (target) (invoke "make" target))
5493 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5495 ;; Upstream does not provide any install target.
5497 (lambda* (#:key outputs #:allow-other-keys)
5498 (let* ((out (assoc-ref outputs "out"))
5499 (lib-output (assoc-ref outputs "lib"))
5500 (bin (string-append out "/bin"))
5501 (doc (string-append out "/share/doc/nauty/"))
5502 (include (string-append lib-output "/include/nauty"))
5503 (lib (string-append lib-output "/lib/nauty")))
5504 (for-each (lambda (f) (install-file f bin))
5505 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5506 "bliss2dre" "catg" "checks6" "complg" "converseg"
5507 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5508 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5509 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5510 "gentourng" "gentreeg" "hamheuristic" "labelg"
5511 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5512 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5513 "sumlines" "twohamg" "underlyingg" "vcolg"
5514 "watercluster2" "NRswitchg"))
5515 (for-each (lambda (f) (install-file f include))
5516 (find-files "." "\\.h$"))
5517 (for-each (lambda (f) (install-file f lib))
5518 (find-files "." "\\.a$"))
5519 (for-each (lambda (f) (install-file f doc))
5520 (append '("formats.txt" "README" "schreier.txt")
5521 (find-files "." "\\.pdf$")))))))))
5523 `(("gmp" ,gmp))) ;for sumlines
5524 (home-page "https://pallini.di.uniroma1.it/")
5525 (synopsis "Library for graph automorphisms")
5526 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5527 procedures for computing automorphism groups of graphs and digraphs.
5529 @code{nauty} computes graph information in the form of a set of
5530 generators, the size of the group, and the orbits of the group; it can
5531 also produce a canonical label. The @code{nauty} suite is written in
5532 C and comes with a command-line interface, a collection of
5533 command-line tools, and an Application Programming Interface (API).
5535 This package provides the static libraries required to run programs
5536 compiled against the nauty library.")
5537 (license license:asl2.0)))
5546 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5547 "ftp/releases/" version
5548 "/ppl-" version ".tar.gz"))
5551 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5552 (build-system gnu-build-system)
5558 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5560 "Parma Polyhedra Library for computations with polyhedra")
5562 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5563 especially targeted at applications in the field of analysis and
5564 verification of complex systems. These abstractions include convex
5565 polyhedra, defined as the intersection of a finite number of (open or
5566 closed) halfspaces, each described by a linear inequality (strict or
5567 non-strict) with rational coefficients; some special classes of polyhedra
5568 shapes that offer interesting complexity/precision tradeoffs; and grids
5569 which represent regularly spaced points that satisfy a set of linear
5570 congruence relations. The library also supports finite powersets and
5571 products of (any kind of) polyhedra and grids, a mixed integer linear
5572 programming problem solver using an exact-arithmetic version of the simplex
5573 algorithm, a parametric integer programming solver, and primitives for
5574 termination analysis via the automatic synthesis of linear ranking
5576 (license license:gpl3+)))
5578 (define-public speedcrunch
5580 (name "speedcrunch")
5586 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5587 (commit (string-append "release-" version))))
5588 (file-name (git-file-name name version))
5591 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5592 (build-system cmake-build-system)
5593 (inputs `(("qtbase" ,qtbase)))
5594 (native-inputs `(("qttools" ,qttools)))
5597 (modify-phases %standard-phases
5598 (add-after 'unpack 'chdir-to-src
5599 (lambda _ (chdir "src") #t)))))
5600 (synopsis "High-precision scientific calculator")
5602 "SpeedCrunch is a high-precision scientific calculator. It features a
5603 syntax-highlighted scrollable display and is designed to be fully used via
5604 keyboard. Some distinctive features are auto-completion of functions and
5605 variables, a formula book, and quick insertion of constants from various
5606 fields of knowledge.")
5607 (home-page "https://speedcrunch.org/")
5608 (license license:gpl2+)))
5610 (define-public minisat
5611 ;; This is the last commit which is available upstream, no
5612 ;; release happened since 2010.
5613 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5617 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5622 (url "https://github.com/niklasso/minisat")
5624 (file-name (string-append name "-" version "-checkout"))
5627 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5629 (search-patches "minisat-friend-declaration.patch"
5630 "minisat-install.patch"))))
5631 (build-system gnu-build-system)
5633 '(#:make-flags (list (string-append "prefix=" %output))
5634 #:tests? #f ;no check target
5636 (modify-phases %standard-phases
5637 (delete 'configure))))
5639 `(("zlib:static" ,zlib "static")
5642 "Small, yet efficient, SAT solver")
5644 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5645 researchers and developers alike to get started on SAT.")
5647 "http://minisat.se/MiniSat.html")
5648 (license license:expat))))
5650 (define-public libqalculate
5652 (name "libqalculate")
5658 (url "https://github.com/Qalculate/libqalculate/")
5659 (commit (string-append "v" version))))
5660 (file-name (git-file-name name version))
5662 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5664 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5665 (build-system gnu-build-system)
5667 `(("pkg-config" ,pkg-config)
5668 ("gettext" ,gettext-minimal)
5669 ("intltool" ,intltool)
5670 ("automake" ,automake)
5671 ("autoconf" ,autoconf)
5672 ("libtool" ,libtool)
5673 ("doxygen" ,doxygen)
5678 ("libxml2" ,libxml2)
5681 ("gnuplot" ,gnuplot)
5682 ("readline" ,readline)
5683 ("libiconv" ,libiconv)))
5686 (modify-phases %standard-phases
5687 (add-before 'bootstrap 'setenv
5688 ;; Prevent the autogen.sh script to carry out the configure
5689 ;; script, which has not yet been patched to replace /bin/sh.
5691 (setenv "NOCONFIGURE" "TRUE")
5693 (home-page "https://qalculate.github.io/")
5694 (synopsis "Multi-purpose cli desktop calculator and library")
5696 "Libqalculate is a multi-purpose cli desktop calculator and library.
5697 It provides basic and advanced functionality. Features include customizable
5698 functions, unit calculations, and conversions, physical constants, symbolic
5699 calculations (including integrals and equations), arbitrary precision,
5700 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5702 (license license:gpl2+)))
5704 (define-public qalculate-gtk
5706 (name "qalculate-gtk")
5712 (url "https://github.com/Qalculate/qalculate-gtk/")
5713 (commit (string-append "v" version))))
5714 (file-name (git-file-name name version))
5716 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5717 (build-system glib-or-gtk-build-system)
5719 `(("pkg-config" ,pkg-config)
5720 ("intltool" ,intltool)
5721 ("automake" ,automake)
5722 ("autoconf" ,autoconf)
5723 ("libtool" ,libtool)
5728 ("libqalculate" ,libqalculate)
5729 ("libxml2" ,libxml2)
5734 (modify-phases %standard-phases
5735 (add-before 'bootstrap 'setenv
5736 ;; Prevent the autogen.sh script to carry out the configure
5737 ;; script, which has not yet been patched to replace /bin/sh.
5739 (setenv "NOCONFIGURE" "TRUE")
5741 (add-before 'check 'add-pot-file
5742 ;; the file contains translations and are currently not in use
5743 ;; left out on purpose so add it to POTFILES.skip
5745 (with-output-to-file "po/POTFILES.skip"
5747 (format #t "data/shortcuts.ui~%")
5750 (home-page "https://qalculate.github.io/")
5751 (synopsis "Multi-purpose graphical desktop calculator")
5753 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5754 multi-purpose GUI desktop calculator. It provides basic and advanced
5755 functionality. Features include customizable functions, unit calculations,
5756 and conversions, physical constants, symbolic calculations (including
5757 integrals and equations), arbitrary precision, uncertainty propagation,
5758 interval arithmetic, plotting.")
5759 (license license:gpl2+)))