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 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>
42 ;;; This file is part of GNU Guix.
44 ;;; GNU Guix is free software; you can redistribute it and/or modify it
45 ;;; under the terms of the GNU General Public License as published by
46 ;;; the Free Software Foundation; either version 3 of the License, or (at
47 ;;; your option) any later version.
49 ;;; GNU Guix is distributed in the hope that it will be useful, but
50 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
51 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ;;; GNU General Public License for more details.
54 ;;; You should have received a copy of the GNU General Public License
55 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
57 (define-module (gnu packages maths)
58 #:use-module (ice-9 regex)
59 #:use-module (ice-9 match)
60 #:use-module (gnu packages)
61 #:use-module ((guix licenses) #:prefix license:)
62 #:use-module (guix packages)
63 #:use-module (guix download)
64 #:use-module (guix git-download)
65 #:use-module (guix utils)
66 #:use-module ((guix build utils) #:select (alist-replace))
67 #:use-module (guix build-system cmake)
68 #:use-module (guix build-system glib-or-gtk)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system python)
71 #:use-module (guix build-system ruby)
72 #:use-module (gnu packages algebra)
73 #:use-module (gnu packages audio)
74 #:use-module (gnu packages autotools)
75 #:use-module (gnu packages base)
76 #:use-module (gnu packages bison)
77 #:use-module (gnu packages boost)
78 #:use-module (gnu packages check)
79 #:use-module (gnu packages cmake)
80 #:use-module (gnu packages compression)
81 #:use-module (gnu packages curl)
82 #:use-module (gnu packages cyrus-sasl)
83 #:use-module (gnu packages dbm)
84 #:use-module (gnu packages documentation)
85 #:use-module (gnu packages elf)
86 #:use-module (gnu packages file)
87 #:use-module (gnu packages flex)
88 #:use-module (gnu packages fltk)
89 #:use-module (gnu packages fontutils)
90 #:use-module (gnu packages gettext)
91 #:use-module (gnu packages gcc)
92 #:use-module (gnu packages gd)
93 #:use-module (gnu packages ghostscript)
94 #:use-module (gnu packages glib)
95 #:use-module (gnu packages graphviz)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages icu4c)
98 #:use-module (gnu packages image)
99 #:use-module (gnu packages java)
100 #:use-module (gnu packages less)
101 #:use-module (gnu packages lisp)
102 #:use-module (gnu packages linux)
103 #:use-module (gnu packages logging)
104 #:use-module (gnu packages lua)
105 #:use-module (gnu packages gnome)
106 #:use-module (gnu packages guile)
107 #:use-module (gnu packages xorg)
108 #:use-module (gnu packages gl)
109 #:use-module (gnu packages imagemagick)
110 #:use-module (gnu packages m4)
111 #:use-module (gnu packages mpi)
112 #:use-module (gnu packages multiprecision)
113 #:use-module (gnu packages netpbm)
114 #:use-module (gnu packages onc-rpc)
115 #:use-module (gnu packages pcre)
116 #:use-module (gnu packages popt)
117 #:use-module (gnu packages perl)
118 #:use-module (gnu packages pkg-config)
119 #:use-module (gnu packages pulseaudio)
120 #:use-module (gnu packages python)
121 #:use-module (gnu packages python-web)
122 #:use-module (gnu packages python-xyz)
123 #:use-module (gnu packages qt)
124 #:use-module (gnu packages readline)
125 #:use-module (gnu packages ruby)
126 #:use-module (gnu packages tbb)
127 #:use-module (gnu packages scheme)
128 #:use-module (gnu packages shells)
129 #:use-module (gnu packages tcl)
130 #:use-module (gnu packages texinfo)
131 #:use-module (gnu packages tex)
132 #:use-module (gnu packages tls)
133 #:use-module (gnu packages version-control)
134 #:use-module (gnu packages wxwidgets)
135 #:use-module (gnu packages xml)
136 #:use-module (srfi srfi-1))
144 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
146 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
147 (build-system gnu-build-system)
148 (inputs `(("gtk+" ,gtk+)
149 ("libxml2" ,libxml2)))
150 (native-inputs `(("pkg-config" ,pkg-config)))
151 (synopsis "Natural deduction first-order logic interface")
152 (description "Aris is a program for performing logical proofs. It supports
153 propositional and predicate logic, as well as Boolean algebra and
154 arithmetical logic. In addition to its predefined inference and equivalence
155 rules, Aris also supports references to older proofs. Its use of standard
156 logical symbols and its natural deduction interface make it easy to use for
158 (license license:gpl3+)
159 (home-page "https://www.gnu.org/software/aris/")))
161 (define-public c-graph
167 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
170 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
171 (build-system gnu-build-system)
173 `(("fortran" ,gfortran)))
174 (synopsis "Visualizing and demonstrating convolution")
176 "GNU C-Graph is a tool for demonstrating the theory of convolution.
177 Thus, it can serve as an excellent aid to students of signal and systems
178 theory in visualizing the convolution process. Rather than forcing the
179 student to write code, the program offers an intuitive interface with
180 interactive dialogs to guide them.")
181 (license license:gpl3+)
182 (home-page "https://www.gnu.org/software/c-graph/")))
191 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
192 version "/coda-" version ".tar.gz"))
194 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
195 (patches (search-patches "coda-use-system-libs.patch"))
196 (modules '((guix build utils)))
198 ;; Make sure we don't use the bundled software.
200 (for-each (lambda (d)
201 (delete-file-recursively (string-append "libcoda/" d)))
202 '("zlib" "pcre" "expat"))
205 `(("fortran" ,gfortran)
207 ("python-numpy" ,python-numpy)))
214 (build-system gnu-build-system)
216 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
217 "LIBS= -lz -lpcre -lexpat")))
218 (synopsis "A common interface to various earth observation data formats")
220 "The Common Data Access toolbox (CODA) provides a set of interfaces for
221 reading remote sensing data from earth observation data files. It consists of
222 command line applications and interfaces to the C, Fortran, Python, and Java
223 programming languages.")
224 (home-page "https://stcorp.nl/coda")
225 (license license:gpl2+)))
233 (uri (string-append "http://www.qhull.org/download/qhull-"
234 (car (string-split version #\.))
238 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
239 (build-system cmake-build-system)
240 (synopsis "Calculate convex hulls and related structures")
242 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
243 diagram, halfspace intersection about a point, furthest-site Delaunay
244 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
245 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
246 algorithm for computing the convex hull. It handles roundoff errors from
247 floating point arithmetic. It computes volumes, surface areas, and
248 approximations to the convex hull.
250 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
251 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
252 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
254 (home-page "http://qhull.org")
255 (license (license:non-copyleft "file://COPYING.txt"
256 "See COPYING in the distribution."))))
258 (define-public python-cvxopt
260 (name "python-cvxopt")
265 (url "https://github.com/cvxopt/cvxopt.git")
267 (file-name (git-file-name name version))
270 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
271 (build-system python-build-system)
274 (modify-phases %standard-phases
275 (add-after 'unpack 'find-libraries
276 (lambda* (#:key inputs #:allow-other-keys)
277 (setenv "CVXOPT_BLAS_LIB" "openblas")
278 (setenv "CVXOPT_BUILD_FFTW" "1")
279 (setenv "CVXOPT_BUILD_GLPK" "1")
280 (setenv "CVXOPT_BUILD_GSL" "1")
287 ("openblas" ,openblas)
288 ("suitesparse" ,suitesparse)))
289 (home-page "https://www.cvxopt.org")
290 (synopsis "Python library for convex optimization")
292 "CVXOPT is a package for convex optimization based on the Python
293 programming language. Its main purpose is to make the development of software
294 for convex optimization applications straightforward by building on Python’s
295 extensive standard library and on the strengths of Python as a high-level
296 programming language.")
297 (license license:gpl3+)))
299 (define-public python2-cvxopt
300 (package-with-python2 python-cvxopt))
308 (uri (string-append "mirror://gnu/units/units-" version
311 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
312 (build-system gnu-build-system)
314 `(("readline" ,readline)
315 ("python" ,python-wrapper) ;for 'units_cur' script
316 ("python-requests" ,python-requests)))
318 `(#:phases (modify-phases %standard-phases
319 (add-after 'install 'wrap-units_cur
320 (lambda* (#:key outputs #:allow-other-keys)
321 (let* ((out (assoc-ref outputs "out"))
322 (bin (string-append out "/bin")))
323 (wrap-program (string-append bin "/units_cur")
324 `("PYTHONPATH" ":" prefix
325 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
327 (synopsis "Conversion between thousands of scales")
329 "GNU Units converts numeric quantities between units of measure. It
330 can handle scale changes through adaptive usage of standard scale
331 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
332 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
333 enough to be used effectively as a scientific calculator.")
334 (license license:gpl3+)
335 (home-page "https://www.gnu.org/software/units/")))
337 (define-public double-conversion
339 (name "double-conversion")
341 (home-page "https://github.com/google/double-conversion")
344 (uri (git-reference (url home-page)
345 (commit (string-append "v" version))))
346 (file-name (git-file-name name version))
349 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
350 (build-system cmake-build-system)
352 '(#:test-target "test"
353 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
354 "-DBUILD_TESTING=ON")))
355 (synopsis "Conversion routines for IEEE doubles")
357 "The double-conversion library provides binary-decimal and decimal-binary
358 routines for IEEE doubles. The library consists of efficient conversion
359 routines that have been extracted from the V8 JavaScript engine.")
360 (license license:bsd-3)))
362 (define-public dionysus
368 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
372 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
373 (build-system gnu-build-system)
374 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
375 (synopsis "Local search for universal constants and scientific values")
377 "GNU Dionysus is a convenient system for quickly retrieving the values of
378 mathematical constants used in science and engineering. Values can be
379 searched using a simple command-line tool, choosing from three databases:
380 universal constants, atomic numbers, and constants related to
382 (license license:gpl3+)
383 (home-page "https://www.gnu.org/software/dionysus/")))
394 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
395 "dSFMT-src-" version ".tar.gz"))
398 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
399 (modules '((guix build utils)))
400 ;; Don't distribute html documentation with bundled jquery.
403 (delete-file-recursively "html") #t))
404 ;; Add patches borrowed from Julia.
410 "https://raw.githubusercontent.com/JuliaLang/julia/"
411 "v1.3.0/deps/patches/dSFMT.c.patch"))
413 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
414 (file-name "dSFMT.c.patch"))
418 "https://raw.githubusercontent.com/JuliaLang/julia/"
419 "v1.3.0/deps/patches/dSFMT.h.patch"))
421 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
422 (file-name "dSFMT.h.patch"))))))
423 (build-system gnu-build-system)
426 (modify-phases %standard-phases
427 (delete 'configure) ; no configure script
429 ;; Upstream Makefile does not build a shared library. Borrow from Julia
430 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
433 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
434 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
435 "-O3" "-finline-functions" "-fomit-frame-pointer"
436 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
437 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
438 "-o" "libdSFMT.so")))
439 (replace 'install ; no "install" target
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let* ((out (assoc-ref outputs "out"))
442 (lib (string-append out "/lib"))
443 (inc (string-append out "/include"))
444 (doc (string-append out "/share/doc/" ,name "-" ,version)))
445 (install-file "libdSFMT.so" lib)
446 (install-file "dSFMT.h" inc)
447 (install-file "LICENSE.txt" doc)
449 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
451 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
452 the expensive conversion of integer to double (floating point). dSFMT directly
453 generates double precision floating point pseudorandom numbers which have the
454 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
455 format. dSFMT is only available on the CPUs which use IEEE 754 format double
456 precision floating point numbers.")
457 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
458 (license license:bsd-3)))
466 (uri (string-append "mirror://gnu/gsl/gsl-"
470 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
471 (build-system gnu-build-system)
473 (let ((system (%current-system)))
475 ((or (string-prefix? "aarch64" system)
476 (string-prefix? "powerpc" system))
477 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
478 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
479 '(#:phases (modify-phases %standard-phases
480 (add-before 'check 'disable-failing-tests
482 (substitute* "spmatrix/test.c"
483 ((".*test_complex.*") "\n"))
485 ((string-prefix? "i686" system)
486 ;; There are rounding issues with these tests on i686:
487 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
488 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
489 '(#:phases (modify-phases %standard-phases
490 (add-before 'check 'disable-failing-tests
492 (substitute* "linalg/test.c"
493 ((".*gsl_test\\(test_LU_decomp.*") "\n")
494 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
495 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
496 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
497 (substitute* "spmatrix/test.c"
498 ((".*test_all.*") "\n")
499 ((".*test_float.*") "\n")
500 ((".*test_complex.*") "\n"))
503 (home-page "https://www.gnu.org/software/gsl/")
504 (synopsis "Numerical library for C and C++")
506 "The GNU Scientific Library is a library for numerical analysis in C
507 and C++. It includes a wide range of mathematical routines, with over 1000
508 functions in total. Subject areas covered by the library include:
509 differential equations, linear algebra, Fast Fourier Transforms and random
511 (license license:gpl3+)))
520 (uri (string-append "mirror://gnu/glpk/glpk-"
524 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
525 (build-system gnu-build-system)
529 `(#:configure-flags '("--with-gmp")))
530 (home-page "https://www.gnu.org/software/glpk/")
531 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
533 "GLPK is a C library for solving large-scale linear programming (LP),
534 mixed integer programming (MIP), and other related problems. It supports the
535 GNU MathProg modeling language, a subset of the AMPL language, and features a
536 translator for the language. In addition to the C library, a stand-alone
537 LP/MIP solver is included in the package.")
538 (license license:gpl3+)))
547 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
549 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
551 "/4ti2-" version ".tar.gz"))
553 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
554 (build-system gnu-build-system)
556 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
560 (home-page "http://www.4ti2.de/")
561 (synopsis "Mathematical tool suite for problems on linear spaces")
563 "4ti2 implements algorithms for solving algebraic, geometric and
564 combinatorial problems on linear spaces. Among others, it solves systems
565 of linear equations, computes extreme rays of polyhedral cones, solves
566 integer programming problems and computes Markov bases for statistics.")
567 (license license:gpl2+)))
569 (define-public cddlib
576 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
577 (string-delete #\. version) ".tar.gz"))
580 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
581 (build-system gnu-build-system)
584 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
585 (synopsis "Library for convex hulls and extreme rays of polyhedra")
587 "The C-library cddlib implements the Double Description Method of
588 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
589 rays of a general convex polyhedron given by a system of linear inequalities
590 in arbitrary dimension. It can also be used for the converse operation of
591 computing convex hulls.")
592 (license license:gpl2+)))
594 (define-public lrslib
601 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
603 (string-delete #\. version) ".tar.gz"))
606 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
607 (build-system gnu-build-system)
611 `(#:tests? #f ; no check phase
612 #:make-flags `("CC=gcc"
613 ,(string-append "prefix=" (assoc-ref %outputs "out"))
616 (modify-phases %standard-phases
619 (substitute* "makefile"
620 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
622 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
623 (synopsis "Convex hulls of polyhedra with exact arithmetic")
625 "The C code of lrslib implements the reverse search algorithm for
626 vertex enumeration and convex hull problems. Its input file format is
627 compatible with cddlib. All computations are done exactly in either
628 multiple precision or fixed integer arithmetic. Output is not stored
629 in memory, so even problems with very large output sizes can sometimes
631 (license license:gpl2+)))
640 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
641 "vinci/vinci-" version ".tar.gz"))
644 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
645 (build-system gnu-build-system)
647 `(("lrslib" ,lrslib)))
649 `(#:tests? #f ; no check phase
651 (modify-phases %standard-phases
653 ;; register the lrs location in the config file
654 (lambda* (#:key inputs #:allow-other-keys)
655 (let* ((lrs (assoc-ref inputs "lrslib"))
656 (lrsexec (string-append lrs "/bin/lrs")))
657 (substitute* "vinci.h"
658 (("#define LRS_EXEC \"lrs\"")
659 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
662 (lambda* (#:key outputs #:allow-other-keys)
663 (let* ((out (assoc-ref outputs "out"))
664 (bin (string-append out "/bin")))
665 (install-file "vinci" bin))
668 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
669 (synopsis "Volume computation for polytopes")
671 "Vinci implements a number of volume computation algorithms for convex
672 polytopes in arbitrary dimension. The polytopes can be given by their
673 V-representation (as the convex hull of a finite number of vertices), by
674 their H-representation (as the bounded intersection of a finite number of
675 halfspaces) or by their double description with both representations.")
676 (license license:gpl2+)))
678 (define-public arpack-ng
682 (home-page "https://github.com/opencollab/arpack-ng")
685 (uri (git-reference (url home-page) (commit version)))
686 (file-name (git-file-name name version))
689 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
690 (build-system gnu-build-system)
692 `(("autoconf" ,autoconf)
693 ("automake" ,automake)
694 ("libtool" ,libtool)))
697 ("fortran" ,gfortran)))
698 (synopsis "Fortran subroutines for solving eigenvalue problems")
700 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
701 large scale eigenvalue problems.")
702 (license (license:non-copyleft "file://COPYING"
703 "See COPYING in the distribution."))))
705 (define-public arpack-ng-3.3.0
709 (name (package-name arpack-ng))
710 (home-page (package-home-page arpack-ng))
714 (uri (string-append home-page "/archive/" version ".tar.gz"))
715 (file-name (string-append name "-" version ".tar.gz"))
718 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
720 (define-public arpack-ng-openmpi
721 (package (inherit arpack-ng)
722 (name "arpack-ng-openmpi")
725 ,@(package-inputs arpack-ng)))
727 (substitute-keyword-arguments (package-arguments arpack-ng)
728 ((#:configure-flags _ '())
730 ((#:phases phases '%standard-phases)
731 `(modify-phases ,phases
732 (add-before 'check 'mpi-setup
734 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
736 (define-public lapack
743 (uri (string-append "http://www.netlib.org/lapack/lapack-"
747 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
748 (build-system cmake-build-system)
749 (home-page "http://www.netlib.org/lapack/")
750 (inputs `(("fortran" ,gfortran)
751 ("python" ,python-wrapper)))
753 `(#:configure-flags (list
754 "-DBUILD_SHARED_LIBS:BOOL=YES"
756 ;; Build the 'LAPACKE_clatms' functions.
757 "-DLAPACKE_WITH_TMG=ON"
758 "-DBUILD_TESTING=ON")))
759 (synopsis "Library for numerical linear algebra")
761 "LAPACK is a Fortran 90 library for solving the most commonly occurring
762 problems in numerical linear algebra.")
763 (license (license:non-copyleft "file://LICENSE"
764 "See LICENSE in the distribution."))))
766 (define-public scalapack
773 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
777 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
778 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
779 (build-system cmake-build-system)
782 ("fortran" ,gfortran)
783 ("lapack" ,lapack))) ;for testing only
785 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
786 #:phases (modify-phases %standard-phases
787 (add-before 'check 'mpi-setup
789 (home-page "http://www.netlib.org/scalapack/")
790 (synopsis "Library for scalable numerical linear algebra")
792 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
793 routines on parallel distributed memory machines. ScaLAPACK solves dense and
794 banded linear systems, least squares problems, eigenvalue problems, and
795 singular value problems.")
796 (license (license:non-copyleft "file://LICENSE"
797 "See LICENSE in the distribution."))))
799 (define-public gnuplot
805 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
809 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
810 (build-system gnu-build-system)
811 (inputs `(("readline" ,readline)
817 `(("pkg-config" ,pkg-config)
818 ("texlive" ,texlive-tiny)))
819 (arguments `(#:configure-flags (list (string-append
820 "--with-texdir=" %output
821 "/texmf-local/tex/latex/gnuplot"))))
822 (home-page "http://www.gnuplot.info")
823 (synopsis "Command-line driven graphing utility")
824 (description "Gnuplot is a portable command-line driven graphing
825 utility. It was originally created to allow scientists and students to
826 visualize mathematical functions and data interactively, but has grown to
827 support many non-interactive uses such as web scripting. It is also used as a
828 plotting engine by third-party applications like Octave.")
829 ;; X11 Style with the additional restriction that derived works may only be
830 ;; distributed as patches to the original.
831 (license (license:fsf-free
832 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
842 (url "https://github.com/OkoSanto/GCTP.git")
843 (commit (string-append "v" version))))
844 (file-name (git-file-name name version))
846 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
848 `(("fortran" ,gfortran)))
849 (build-system gnu-build-system)
850 (synopsis "General Cartographic Transformation Package (GCTP)")
852 "The General Cartographic Transformation Package (GCTP) is a system of
853 software routines designed to permit the transformation of coordinate pairs
854 from one map projection to another. The GCTP is the standard computer
855 software used by the National Mapping Division for map projection
857 (home-page "https://github.com/OkoSanto/GCTP")
858 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
867 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
868 version "/src/hdf-" version ".tar.bz2"))
870 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
871 (patches (search-patches "hdf4-architectures.patch"
872 "hdf4-reproducibility.patch"
873 "hdf4-shared-fortran.patch"
874 "hdf4-tirpc.patch"))))
875 (build-system gnu-build-system)
877 `(("gfortran" ,gfortran)
882 ("libjpeg" ,libjpeg-turbo)
883 ("libtirpc" ,libtirpc)))
885 `(#:parallel-tests? #f
886 #:configure-flags (list "--enable-shared"
887 (string-append "CPPFLAGS=-I"
888 (assoc-ref %build-inputs "libtirpc")
891 (modify-phases %standard-phases
892 ;; This is inspired by two of Debian's patches.
893 (add-before 'configure 'add-more-aarch64-support
895 (substitute* '("mfhdf/ncgen/ncgen.l"
896 "mfhdf/ncgen/ncgenyy.c"
897 "mfhdf/libsrc/netcdf.h.in")
898 (("AIX5L64") "__aarch64__"))
900 (add-before 'configure 'patchbuild
903 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
905 (("/bin/mkdir") "mkdir"))
906 (substitute* (find-files "." "^Makefile\\.in$")
907 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
908 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
909 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
910 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
911 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
913 (add-after 'configure 'patch-settings
915 ;; libhdf4.settings contains the full path of the
916 ;; compilers used, and its contents are included in
917 ;; .so-files. We truncate the hashes to avoid
918 ;; unnecessary store references to those compilers:
919 (substitute* "libhdf4.settings"
920 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
921 (string-append prefix (string-take hash 10) "...")))
923 (add-after 'install 'provide-absolute-libjpeg-reference
924 (lambda* (#:key inputs outputs #:allow-other-keys)
925 (let ((out (assoc-ref outputs "out"))
926 (libjpeg (assoc-ref inputs "libjpeg")))
927 ;; libjpeg-turbo does not provide a .la file, so libtool is
928 ;; unable to add an absolute reference for -ljpeg in the .la
929 ;; files. Fix it manually to avoid having to propagate it.
930 (substitute* (find-files (string-append out "/lib") "\\.la$")
932 (string-append "-L" libjpeg "/lib -ljpeg")))
934 (home-page "https://www.hdfgroup.org/products/hdf4/")
936 "Library and multi-object file format for storing and managing data")
937 (description "HDF4 is a library and multi-object file format for storing
938 and managing data between machines. HDF4 is an older hierarchical data format,
939 incompatible with HDF5.")
941 (license:non-copyleft
942 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
944 (define-public hdf4-alt
949 (substitute-keyword-arguments (package-arguments hdf4)
950 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
952 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
961 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
962 "hdf5-" (version-major+minor version)
963 "/hdf5-" version "/src/hdf5-"
965 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
967 (match (string-split version #\.)
969 (string-append major minor)))
970 "/src/hdf5-" version ".tar.bz2")))
972 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
973 (patches (search-patches "hdf5-config-date.patch"
974 "hdf5-1.8-mpi-deprecations.patch"))))
975 (build-system gnu-build-system)
979 `(("gfortran" ,gfortran)
980 ("perl" ,perl))) ;part of the test machinery needs Perl
981 (outputs '("out" ; core library
982 "fortran")) ; fortran interface
984 `(;; Some of the users, notably Flann, need the C++ interface.
985 #:configure-flags '("--enable-cxx"
987 "--enable-fortran2003"
989 ;; Build a thread-safe library. Unfortunately,
990 ;; 'configure' invites you to either turn off C++,
991 ;; Fortran, and the high-level interface (HL), or
992 ;; to pass '--enable-unsupported'. Debian
993 ;; packagers chose to pass '--enable-unsupported'
994 ;; and we follow their lead here.
995 "--enable-threadsafe"
997 "--enable-unsupported")
998 ;; Use -fPIC to allow the R bindings to link with the static libraries
999 #:make-flags (list "CFLAGS=-fPIC"
1002 (modify-phases %standard-phases
1003 (add-before 'configure 'patch-configure
1004 (lambda* (#:key outputs #:allow-other-keys)
1005 (substitute* "configure"
1007 (substitute* "fortran/src/Makefile.in"
1008 (("libhdf5_fortran_la_LDFLAGS =")
1009 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1010 (assoc-ref outputs "fortran") "/lib")))
1011 (substitute* "hl/fortran/src/Makefile.in"
1012 (("libhdf5hl_fortran_la_LDFLAGS =")
1013 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1014 (assoc-ref outputs "fortran") "/lib")))
1016 (add-after 'configure 'patch-settings
1018 ;; libhdf5.settings contains the full path of the
1019 ;; compilers used, and its contents are included in
1020 ;; libhdf5.so. We truncate the hashes to avoid
1021 ;; unnecessary store references to those compilers:
1022 (substitute* "src/libhdf5.settings"
1023 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1024 (string-append prefix (string-take hash 10) "..."))
1025 ;; Don't record the build-time kernel version to make the
1026 ;; settings file reproducible.
1027 (("Uname information:.*")
1028 "Uname information: Linux\n"))
1030 (add-after 'install 'patch-references
1031 (lambda* (#:key inputs outputs #:allow-other-keys)
1032 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1033 (zlib (assoc-ref inputs "zlib")))
1034 (substitute* (find-files bin "h5p?cc")
1036 (string-append "-L" zlib "/lib " lib)))
1038 (add-after 'install 'split
1039 (lambda* (#:key inputs outputs #:allow-other-keys)
1040 ;; Move all fortran-related files
1041 (let* ((out (assoc-ref outputs "out"))
1042 (bin (string-append out "/bin"))
1043 (lib (string-append out "/lib"))
1044 (inc (string-append out "/include"))
1045 (ex (string-append out "/share/hdf5_examples/fortran"))
1046 (fort (assoc-ref outputs "fortran"))
1047 (fbin (string-append fort "/bin"))
1048 (flib (string-append fort "/lib"))
1049 (finc (string-append fort "/include"))
1050 (fex (string-append fort "/share/hdf5_examples/fortran")))
1055 ;; Note: When built with --enable-parallel, the 'h5fc' file
1056 ;; doesn't exist, hence this condition.
1057 (when (file-exists? (string-append bin "/h5fc"))
1058 (rename-file (string-append bin "/h5fc")
1059 (string-append fbin "/h5fc")))
1060 (for-each (lambda (file)
1062 (string-append flib "/" (basename file))))
1063 (find-files lib ".*fortran.*"))
1064 (for-each (lambda (file)
1066 (string-append finc "/" (basename file))))
1067 (find-files inc ".*mod"))
1068 (for-each (lambda (file)
1070 (string-append fex "/" (basename file))))
1071 (find-files ex ".*"))
1072 (delete-file-recursively ex))
1074 (home-page "https://www.hdfgroup.org")
1075 (synopsis "Management suite for extremely large and complex data")
1076 (description "HDF5 is a suite that makes possible the management of
1077 extremely large and complex data collections.")
1078 (license (license:x11-style
1079 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1081 (define-public hdf5-1.10
1082 (package (inherit hdf5)
1087 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1088 "hdf5-" (version-major+minor version)
1089 "/hdf5-" version "/src/hdf5-"
1091 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1093 (apply string-append
1094 (take (string-split version #\.) 2))
1095 "/src/hdf5-" version ".tar.bz2")))
1097 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
1098 (patches (search-patches "hdf5-config-date.patch"))))))
1100 (define-public hdf-java
1108 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1109 version "/src/CMake-hdfjava-" version ".tar.gz"))
1111 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1112 (modules '((guix build utils)))
1113 (snippet ; Make sure we don't use the bundled sources and binaries.
1115 (for-each delete-file
1116 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1117 "HDF4.tar.gz" "HDF5.tar.gz"))
1118 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1120 (build-system gnu-build-system)
1122 `(("jdk" ,icedtea "jdk")
1123 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1125 ("hamcrest-core" ,java-hamcrest-core)
1126 ("junit" ,java-junit)
1127 ("slf4j-simple" ,java-slf4j-simple)))
1132 ("libjpeg" ,libjpeg-turbo)
1133 ("slf4j-api" ,java-slf4j-api)))
1136 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1137 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1138 (assoc-ref %build-inputs "jdk") "/lib" )
1139 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1140 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1143 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1144 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1145 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1146 (string-append "JPEGLIB="
1147 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1151 (modify-phases %standard-phases
1152 (add-before 'configure 'chdir-to-source
1153 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1154 (add-before 'configure 'patch-build
1155 (lambda* (#:key inputs outputs #:allow-other-keys)
1156 (substitute* "configure"
1157 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1158 (("/bin/cat") (which "cat")))
1159 ;; Set classpath for compilation
1160 (substitute* '("hdf/hdf5lib/Makefile.in"
1161 "hdf/hdf5lib/exceptions/Makefile.in"
1162 "hdf/hdflib/Makefile.in")
1163 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1164 (string-append (assoc-ref inputs "slf4j-api")
1165 "/share/java/slf4j-api.jar")))
1166 ;; Replace outdated config.sub and config.guess:
1167 (with-directory-excursion "config"
1168 (for-each (lambda (file)
1170 (string-append (assoc-ref inputs "automake")
1172 ,(version-major+minor (package-version automake))
1174 '("config.sub" "config.guess")))
1176 ;; Fix embedded version number
1177 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1178 (substitute* "hdf/hdf5lib/H5.java"
1180 (string-join hdf5version ", "))))
1182 (mkdir-p (string-append (assoc-ref outputs "out")))
1183 ;; Set classpath for tests
1184 (let* ((build-dir (getcwd))
1185 (lib (string-append build-dir "/lib"))
1186 (jhdf (string-append lib "/jhdf.jar"))
1187 (jhdf5 (string-append lib "/jhdf5.jar"))
1190 (string-append (assoc-ref inputs i)
1191 "/share/java/" i ".jar"))
1192 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1194 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1196 (substitute* '("test/hdf5lib/Makefile.in"
1197 "test/hdf5lib/junit.sh.in"
1198 "examples/runExample.sh.in")
1200 (string-append (assoc-ref inputs "coreutils")
1203 (string-append (assoc-ref inputs "coreutils")
1205 (("CLASSPATH=[^\n]*")
1206 (string-append "CLASSPATH=" class-path)))
1207 (setenv "CLASSPATH" class-path))
1209 (add-before 'check 'build-examples
1211 (apply invoke `("javac"
1212 ,@(find-files "examples" ".*\\.java"))))))
1214 #:parallel-build? #f
1216 #:parallel-tests? #f ))
1217 (home-page "https://support.hdfgroup.org/products/java")
1218 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1219 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1220 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1223 ;; BSD-style license:
1224 (license (license:x11-style
1225 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1226 /current/src/unpacked/COPYING"))))
1228 (define-public hdf-eos2
1235 (uri "ftp://edhs1.gsfc.nasa.gov\
1236 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1238 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1239 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1240 "hdf-eos2-build-shared.patch"
1241 "hdf-eos2-fortrantests.patch"))))
1242 (build-system gnu-build-system)
1244 `(("gfortran" ,gfortran)))
1246 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1247 ;; XXX: These inputs are really dependencies of hdf4.
1249 ("libjpeg" ,libjpeg-turbo)
1250 ("libtirpc" ,libtirpc)
1254 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1255 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1256 #:parallel-tests? #f))
1257 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1258 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1259 (description "HDF-EOS2 is a software library built on HDF4 which supports
1260 the construction of data structures used in NASA's Earth Observing
1261 System (Grid, Point and Swath).")
1263 ;; Source files carry a permissive license header.
1264 (license (license:non-copyleft home-page))))
1266 (define-public hdf-eos5
1272 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1273 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1276 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1277 (patches (search-patches "hdf-eos5-build-shared.patch"
1278 "hdf-eos5-remove-gctp.patch"
1279 "hdf-eos5-fix-szip.patch"
1280 "hdf-eos5-fortrantests.patch"))))
1282 `(("gfortran" ,gfortran)))
1283 (build-system gnu-build-system)
1289 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1290 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1291 #:parallel-tests? #f))
1292 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1294 "HDF-EOS5 is a software library built on HDF5 to support the construction
1295 of data structures used in NASA's Earth Observing System (Grid, Point and
1297 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1299 ;; Source files carry a permissive license header.
1300 (license (license:non-copyleft home-page))))
1302 (define-public hdf5-parallel-openmpi
1303 (package (inherit hdf5)
1304 (name "hdf5-parallel-openmpi")
1307 ,@(package-inputs hdf5)))
1309 (substitute-keyword-arguments (package-arguments hdf5)
1310 ((#:configure-flags flags)
1311 ``("--enable-parallel"
1312 ,@(delete "--enable-cxx"
1313 (delete "--enable-threadsafe" ,flags))))
1315 `(modify-phases ,phases
1316 (add-after 'build 'mpi-setup
1318 (add-before 'check 'patch-tests
1320 ;; OpenMPI's mpirun will exit with non-zero status if it
1321 ;; detects an "abnormal termination", i.e. any process not
1322 ;; calling MPI_Finalize(). Since the test is explicitly
1323 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1324 ;; H5C_flush_cache from being called, mpirun will always
1325 ;; complain, so turn this test off.
1326 (substitute* "testpar/Makefile"
1327 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1328 (string-append front back "\n")))
1329 (substitute* "tools/h5diff/testph5diff.sh"
1330 (("/bin/sh") (which "sh")))
1332 (synopsis "Management suite for data with parallel IO support")))
1334 (define-public hdf5-blosc
1342 (url "https://github.com/Blosc/hdf5-blosc.git")
1343 (commit (string-append "v" version))))
1344 (file-name (git-file-name name version))
1346 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1347 (build-system cmake-build-system)
1350 (list (string-append "-DBLOSC_INSTALL_DIR="
1351 (assoc-ref %build-inputs "c-blosc"))
1352 (string-append "-DPLUGIN_INSTALL_PATH="
1353 (assoc-ref %outputs "out")
1354 "/hdf5/lib/plugin"))
1356 (modify-phases %standard-phases
1357 (add-after 'unpack 'do-not-build-blosc
1359 (substitute* "CMakeLists.txt"
1360 (("set\\(BLOSC_INSTALL_DIR.*") "")
1361 (("ExternalProject_Add\\(project_blosc") "message("))
1364 `(("c-blosc" ,c-blosc)
1365 ("hdf5" ,hdf5-1.10)))
1366 (home-page "https://github.com/Blosc/hdf5-blosc")
1367 (synopsis "Filter for HDF5 using the Blosc compressor")
1368 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1369 installing this filter, you can read and write HDF5 files with
1370 Blosc-compressed datasets.")
1371 (license license:expat)))
1373 (define-public h5check
1380 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1381 "h5check/src/h5check-" version ".tar.gz"))
1384 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1385 (build-system gnu-build-system)
1386 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1387 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1388 (synopsis "HDF5 format checker")
1389 (description "@code{h5check} is a validation tool for verifying that an
1390 HDF5 file is encoded according to the HDF File Format Specification.")
1391 (license (license:x11-style "file://COPYING"))))
1399 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1404 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1405 (build-system cmake-build-system)
1406 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1407 (inputs `(("lapack" ,lapack)
1409 ;; FIXME: Even though the fonts are available dvips complains:
1410 ;; "Font cmmi10 not found; characters will be left blank."
1412 `(("texlive" ,texlive-tiny)
1413 ("ghostscript" ,ghostscript)
1414 ("doxygen" ,doxygen)))
1415 (home-page "http://itpp.sourceforge.net")
1416 (synopsis "C++ library of maths, signal processing and communication classes")
1417 (description "IT++ is a C++ library of mathematical, signal processing and
1418 communication classes and functions. Its main use is in simulation of
1419 communication systems and for performing research in the area of
1420 communications. The kernel of the library consists of generic vector and
1421 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1422 similar to MATLAB, GNU Octave or SciPy.")
1423 (license license:gpl3+)))
1425 (define-public netcdf
1432 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1433 "netcdf-" version ".tar.gz"))
1436 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1437 (patches (search-patches "netcdf-date-time.patch"
1438 "netcdf-tst_h_par.patch"))))
1439 (build-system gnu-build-system)
1442 ("doxygen" ,doxygen)
1443 ("graphviz" ,graphviz)))
1445 `(("hdf4" ,hdf4-alt)
1448 ("libjpeg" ,libjpeg-turbo)))
1450 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1452 #:phases (modify-phases %standard-phases
1453 (add-before 'configure 'fix-source-date
1455 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1456 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1457 ;; to '1st hour of the current day', and therefore makes the
1458 ;; package not reproducible.
1459 (substitute* "./configure"
1460 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1461 "date --date='@0'"))
1463 (add-after 'configure 'patch-settings
1465 ;; libnetcdf.settings contains the full filename of the compilers
1466 ;; used to build the library. We truncate the hashes of those
1467 ;; filenames to avoid unnecessary references to the corresponding
1469 (substitute* "libnetcdf.settings"
1470 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1471 (string-append prefix (string-take hash 10) "...")))
1474 #:parallel-tests? #f)) ;various race conditions
1475 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1476 (synopsis "Library for scientific data")
1477 (description "NetCDF is an interface for scientific data access and a
1478 software library that provides an implementation of the interface. The netCDF
1479 library defines a machine-independent format for representing scientific data.
1480 Together, the interface, library, and format support the creation, access, and
1481 sharing of scientific data.")
1482 (license (license:x11-style "file://COPYRIGHT"))))
1484 (define-public netcdf-parallel-openmpi
1485 (package (inherit netcdf)
1486 (name "netcdf-parallel-openmpi")
1489 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1490 (package-inputs netcdf))))
1491 ;; TODO: Replace pkg-config references in nc-config with absolute references
1493 (substitute-keyword-arguments (package-arguments netcdf)
1494 ((#:configure-flags flags)
1495 `(cons* "CC=mpicc" "CXX=mpicxx"
1496 "--enable-parallel-tests"
1497 ;; Shared libraries not supported with parallel IO.
1498 "--disable-shared" "--with-pic"
1501 (define-public netcdf-fortran
1503 (name "netcdf-fortran")
1508 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1512 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1513 (build-system gnu-build-system)
1515 `(#:parallel-tests? #f))
1517 `(("netcdf" ,netcdf)))
1519 `(("gfortran" ,gfortran)))
1520 (synopsis "Fortran interface for the netCDF library")
1521 (description (package-description netcdf))
1522 (home-page (package-home-page netcdf))
1523 (license (package-license netcdf))))
1525 (define-public nlopt
1531 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1534 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1535 (build-system gnu-build-system)
1537 `(;; Shared libraries are not built by default. They are required to
1538 ;; build the Guile, Octave, and Python bindings.
1539 #:configure-flags '("--enable-shared")
1542 (modify-phases %standard-phases
1543 (add-before 'configure 'set-libnlopt-file-name
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 ;; Make sure the Scheme module refers to the library by its
1546 ;; absolute file name (we cannot do that from a snippet
1547 ;; because the expansion of @libdir@ contains
1549 (let ((out (assoc-ref outputs "out")))
1550 (substitute* "swig/nlopt.scm.in"
1552 (string-append out "/lib/libnlopt")))
1554 (inputs `(("guile" ,guile-2.0)))
1555 (native-inputs `(("pkg-config" ,pkg-config)))
1556 (home-page "http://ab-initio.mit.edu/wiki/")
1557 (synopsis "Library for nonlinear optimization")
1558 (description "NLopt is a library for nonlinear optimization, providing a
1559 common interface for a number of different free optimization routines available
1560 online as well as original implementations of various other algorithms.")
1561 (license license:lgpl2.1+)))
1563 (define-public ipopt
1570 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1574 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1575 (modules '((guix build utils)))
1577 ;; Make sure we don't use the bundled software.
1579 (delete-file-recursively "ThirdParty")
1581 (build-system gnu-build-system)
1583 '(#:phases (modify-phases %standard-phases
1584 (add-after 'install 'add--L-flags-in-ipopt.pc
1585 (lambda* (#:key inputs outputs #:allow-other-keys)
1586 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1587 ;; move it to "Libs.private" where it belongs, and add a
1588 ;; '-L' flag for LAPACK.
1589 (let ((out (assoc-ref outputs "out"))
1590 (lapack (assoc-ref inputs "lapack")))
1591 (substitute* (string-append out "/lib/pkgconfig/"
1593 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1594 (string-append "Libs: " before " " after "\n"
1595 "Libs.private: " before
1596 "-L" lapack "/lib -llapack -lblas "
1600 `(("gfortran" ,gfortran)))
1602 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1603 `(("lapack" ,lapack))) ;for both libblas and liblapack
1604 (home-page "https://www.coin-or.org")
1605 (synopsis "Large-scale nonlinear optimizer")
1607 "The Interior Point Optimizer (IPOPT) is a software package for
1608 large-scale nonlinear optimization. It provides C++, C, and Fortran
1610 (license license:epl1.0)))
1618 (uri (string-append "https://www.coin-or.org/download/source/"
1619 "Clp/Clp-" version ".tgz"))
1622 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1623 (modules '((guix build utils)))
1625 ;; Make sure we don't use the bundled software.
1627 (delete-file-recursively "ThirdParty")
1629 (build-system gnu-build-system)
1631 `(("gfortran" ,gfortran)
1632 ("pkg-config" ,pkg-config)))
1634 `(("openblas" ,openblas)))
1635 (home-page "https://www.coin-or.org")
1636 (synopsis "Linear programming solver")
1638 "CLP is a high quality linear programming solver. Its main strengths are
1639 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1640 linear and quadratic objectives. There are limited facilities for nonlinear
1641 and quadratic objectives using the Simplex algorithm.")
1642 (license license:epl1.0)))
1644 (define-public ceres
1646 (name "ceres-solver")
1648 (home-page "http://ceres-solver.org/")
1651 (uri (string-append home-page "ceres-solver-"
1655 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1656 (build-system cmake-build-system)
1658 ;; TODO: Build HTML user documentation and install separately.
1659 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1660 "-DBUILD_SHARED_LIBS=ON")
1662 #:phases (modify-phases %standard-phases
1663 (add-before 'configure 'set-library-directory
1665 ;; Install libraries to lib/, not lib64/.
1666 (substitute* "internal/ceres/CMakeLists.txt"
1667 (("set\\(LIB_SUFFIX \"64\"\\)")
1668 "set(LIB_SUFFIX \"\")"))
1671 `(("pkg-config" ,pkg-config)))
1673 `(("glog" ,glog))) ;for #include <glog/glog.h>
1678 ("suitesparse" ,suitesparse)
1679 ("gflags" ,gflags)))
1680 (synopsis "C++ library for solving large optimization problems")
1682 "Ceres Solver is a C++ library for modeling and solving large,
1683 complicated optimization problems. It is a feature rich, mature and
1684 performant library which has been used in production since 2010. Ceres Solver
1685 can solve two kinds of problems:
1687 @item non-linear least squares problems with bounds constraints;
1688 @item general unconstrained optimization problems.
1690 (license license:bsd-3)))
1692 ;; For a fully featured Octave, users are strongly recommended also to install
1693 ;; the following packages: less, ghostscript, gnuplot.
1694 (define-public octave-cli
1701 (uri (string-append "mirror://gnu/octave/octave-"
1705 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1706 (build-system gnu-build-system)
1708 `(("alsa-lib" ,alsa-lib)
1709 ("arpack" ,arpack-ng)
1715 ("fontconfig" ,fontconfig)
1716 ("freetype" ,freetype)
1720 ("graphicsmagick" ,graphicsmagick)
1722 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1723 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1724 ;; libtiff.la instead of having to provide it here.
1725 ("libjpeg" ,libjpeg-turbo)
1729 ("libsndfile" ,libsndfile)
1733 ("portaudio" ,portaudio)
1735 ("readline" ,readline)
1736 ("suitesparse" ,suitesparse)
1737 ("texinfo" ,texinfo)
1741 ("gfortran" ,gfortran)
1742 ("pkg-config" ,pkg-config)
1744 ;; The following inputs are not actually used in the build process.
1745 ;; However, the ./configure gratuitously tests for their existence and
1746 ;; assumes that programs not present at build time are also not, and
1747 ;; can never be, available at run time! If these inputs are therefore
1748 ;; not present, support for them will be built out. However, Octave
1749 ;; will still run without them, albeit without the features they
1752 ("ghostscript" ,ghostscript)
1753 ("gnuplot" ,gnuplot)))
1754 ;; Octave code uses this variable to detect directories holding multiple CA
1755 ;; certificates to verify peers with. This is required for the networking
1756 ;; functions that require encryption to work properly.
1757 (native-search-paths
1758 (list (search-path-specification
1759 (variable "CURLOPT_CAPATH")
1760 (files '("etc/ssl/certs")))))
1763 (list (string-append "--with-shell="
1764 (assoc-ref %build-inputs "bash")
1767 ;; XXX: Without this flag, linking octave-cli fails with
1768 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1769 ;; not pulling in liboctinterp.la for -lstdc++.
1770 "--enable-link-all-dependencies")
1772 (modify-phases %standard-phases
1773 (add-after 'configure 'configure-makeinfo
1774 (lambda* (#:key inputs #:allow-other-keys)
1775 (substitute* "libinterp/corefcn/help.h"
1778 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1780 (home-page "https://www.gnu.org/software/octave/")
1781 (synopsis "High-level language for numerical computation")
1782 (description "GNU Octave is a high-level interpreted language that is
1783 specialized for numerical computations. It can be used for both linear and
1784 non-linear applications and it provides great support for visualizing results.
1785 Work may be performed both at the interactive command-line as well as via
1787 (license license:gpl3+)))
1789 (define-public octave
1790 (package (inherit octave-cli)
1793 (inherit (package-source octave-cli))))
1795 `(("qscintilla" ,qscintilla)
1797 ,@(package-inputs octave-cli)))
1799 `(("qttools" , qttools) ;for lrelease
1800 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1801 ,@(package-native-inputs octave-cli)))
1803 (substitute-keyword-arguments (package-arguments octave-cli)
1805 `(modify-phases ,phases
1806 (add-before 'configure 'patch-qscintilla-library-name
1807 (lambda* (#:key inputs #:allow-other-keys)
1808 ;; The QScintilla library that the Octave configure script tries
1809 ;; to link with should be named libqscintilla-qt5.so, but the
1810 ;; QScintilla input provides the shared library as
1811 ;; libqscintilla2_qt5.so.
1812 (substitute* "configure"
1813 (("qscintilla2-qt5")
1817 (define-public opencascade-oce
1819 (name "opencascade-oce")
1825 (url "https://github.com/tpaviot/oce.git")
1826 (commit (string-append "OCE-" version))))
1827 (file-name (git-file-name name version))
1828 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1830 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1831 (build-system cmake-build-system)
1834 (list "-DOCE_TESTING:BOOL=ON"
1835 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1836 "-DOCE_DRAW:BOOL=ON"
1837 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1838 (assoc-ref %outputs "out"))
1839 "-UCMAKE_INSTALL_RPATH")))
1841 `(("freetype" ,freetype)
1848 `(("python" ,python-wrapper)))
1849 (home-page "https://github.com/tpaviot/oce")
1850 (synopsis "Libraries for 3D modeling and numerical simulation")
1852 "Open CASCADE is a set of libraries for the development of applications
1853 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1854 C++ class libraries providing services for 3D surface and solid modeling, CAD
1855 data exchange, and visualization. It is used for development of specialized
1856 software dealing with 3D models in design (CAD), manufacturing (CAM),
1857 numerical simulation (CAE), measurement equipment (CMM), and quality
1858 control (CAQ) domains.
1860 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1861 patches, improvements, and experiments contributed by users over the official
1862 Open CASCADE library.")
1863 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1864 ; use of header files; see
1865 ; OCCT_LGPL_EXCEPTION.txt
1866 license:public-domain; files
1867 ; src/Standard/Standard_StdAllocator.hxx and
1868 ; src/NCollection/NCollection_StdAllocator.hxx
1869 license:expat; file src/OpenGl/OpenGl_glext.h
1870 license:bsd-3)))); test framework gtest
1872 (define-public opencascade-occt
1874 (name "opencascade-occt")
1880 (url "https://git.dev.opencascade.org/repos/occt.git")
1883 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1885 (file-name (git-file-name name version))
1887 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1888 (modules '((guix build utils)))
1891 ;; Remove files specific to non-free operating systems.
1892 (delete-file-recursively "samples/ios")
1893 (delete-file-recursively "samples/mfc")
1894 (delete-file-recursively "samples/qt/FuncDemo")
1895 (delete-file "genconf.bat")
1896 (delete-file "gendoc.bat")
1897 (delete-file "genproj.bat")
1898 (delete-file "upgrade.bat")
1899 ;; Remove references to deleted files.
1900 (substitute* "dox/FILES_HTML.txt"
1901 ((".*standard.*") "" )
1902 ((".*UIKitSample.*") ""))
1904 (build-system cmake-build-system)
1906 '(;; There is no test target for make. OCCT provides an
1907 ;; 'Automated Testing System', which may be accessed after
1908 ;; installation via the draw.sh script. draw.sh is located in
1909 ;; the bin directory. For details see:
1910 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1911 ;; occt_dev_guides__tests.html
1913 ;; Configure without freeimage: attempting to link against the
1914 ;; freeimage version 3.17 library leads to 'undefined
1915 ;; reference' errors.
1917 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1919 "-DUSE_VTK:BOOL=OFF"
1920 "-DBUILD_DOC_Overview:BOOL=OFF"
1921 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1922 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1923 "-UCMAKE_INSTALL_LIBDIR")))
1925 `(("doxygen" ,doxygen)
1926 ;("freeimage" ,freeimage)
1927 ("freetype" ,freetype)
1929 ("libxext" ,libxext)
1936 ;; TODO: build Overview documentation and add 'doc' output.
1937 (home-page "https://www.opencascade.com")
1938 (synopsis "Libraries for 3D modeling and numerical simulation")
1940 "Open CASCADE is a set of libraries for the development of applications
1941 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1942 C++ class libraries providing services for 3D surface and solid modeling, CAD
1943 data exchange, and visualization. It is used for development of specialized
1944 software dealing with 3D models in design (CAD), manufacturing (CAM),
1945 numerical simulation (CAE), measurement equipment (CMM), and quality
1946 control (CAQ) domains.
1948 This is the certified version of the Open Cascade Technology (OCCT) library.")
1949 (license (list ;; OCCT library:
1950 license:lgpl2.1; with an exception for the use of header
1951 ; files, see OCCT_LGPL_EXCEPTION.txt.
1952 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1953 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1955 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1956 ;; src/StepFile/step.tab.*:
1957 license:gpl3+ ; with Bison 2.2 exception.
1958 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1959 (license:non-copyleft
1960 "https://www.unicode.org/license.html")
1961 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1962 license:public-domain))))
1972 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1974 (string-append "gmsh_"
1975 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1977 (file-name (git-file-name name version))
1979 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1980 (modules '((guix build utils)))
1982 ;; Remove non-free METIS code
1984 (delete-file-recursively "contrib/Metis")
1986 (build-system cmake-build-system)
1989 ("gfortran" ,gfortran)
1995 ("opencascade-oce" ,opencascade-oce)
1997 ("libxext" ,libxext)))
1999 `(("fontconfig" ,fontconfig)
2000 ("libxft" ,libxft)))
2002 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
2003 "-DENABLE_BUILD_SHARED:BOOL=ON"
2004 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2005 (home-page "http://gmsh.info/")
2006 (synopsis "3D finite element grid generator")
2007 (description "Gmsh is a 3D finite element grid generator with a built-in
2008 CAD engine and post-processor. Its design goal is to provide a fast, light
2009 and user-friendly meshing tool with parametric input and advanced
2010 visualization capabilities. Gmsh is built around four modules: geometry,
2011 mesh, solver and post-processing. The specification of any input to these
2012 modules is done either interactively using the graphical user interface or in
2013 ASCII text files using Gmsh's own scripting language.")
2014 (license license:gpl2+)))
2016 (define-public maxflow
2019 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2020 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2025 (url "https://github.com/gerddie/maxflow.git")
2027 (file-name (git-file-name name version))
2030 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2031 (build-system cmake-build-system)
2032 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2033 (synopsis "Library implementing Maxflow algorithm")
2034 (description "An implementation of the maxflow algorithm described in
2035 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2036 Energy Minimization in Computer Vision.\n
2037 Yuri Boykov and Vladimir Kolmogorov.\n
2038 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2040 (license license:gpl3+)))
2042 (define-public petsc
2049 ;; The *-lite-* tarball does not contain the *large* documentation
2050 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2051 "petsc-lite-" version ".tar.gz"))
2053 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2054 (outputs '("out" ; libraries and headers
2055 "examples")) ; ~30MiB of examples
2056 (build-system gnu-build-system)
2058 `(("python" ,python-2)))
2060 `(("gfortran" ,gfortran)
2062 ("superlu" ,superlu)
2063 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2064 ;; leaving out opengl, as configuration seems to only be for mac
2067 `(#:test-target "test"
2068 #:parallel-build? #f ; build is parallel by default
2074 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2075 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2076 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2078 (modify-phases %standard-phases
2080 ;; PETSc's configure script is actually a python script, so we can't
2081 ;; run it with bash.
2082 (lambda* (#:key outputs (configure-flags '())
2084 (let* ((prefix (assoc-ref outputs "out"))
2085 (flags `(,(string-append "--prefix=" prefix)
2086 ,@configure-flags)))
2087 (format #t "build directory: ~s~%" (getcwd))
2088 (format #t "configure flags: ~s~%" flags)
2089 (apply invoke "./configure" flags))))
2090 (add-after 'configure 'clean-local-references
2091 (lambda* (#:key outputs #:allow-other-keys)
2092 (let ((out (assoc-ref outputs "out")))
2093 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2094 ;; Prevent build directory from leaking into compiled code
2096 ;; Scrub timestamp for reproducibility
2097 ((".*Libraries compiled on.*") ""))
2098 (substitute* (find-files "." "petscvariables")
2099 ;; Do not expose build machine characteristics, set to defaults.
2100 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2101 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2103 (add-after 'install 'clean-install
2104 ;; Try to keep installed files from leaking build directory names.
2105 (lambda* (#:key inputs outputs #:allow-other-keys)
2106 (let ((out (assoc-ref outputs "out")))
2107 (substitute* (map (lambda (file)
2108 (string-append out "/lib/petsc/conf/" file))
2109 '("petscvariables"))
2111 ;; Make compiler references point to the store
2112 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2113 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2114 (string-append "= " (which compiler))))
2115 ;; PETSc installs some build logs, which aren't necessary.
2116 (for-each (lambda (file)
2117 (let ((f (string-append out "/lib/petsc/conf/" file)))
2118 (when (file-exists? f)
2120 '("configure.log" "make.log" "gmake.log"
2121 "test.log" "error.log" "RDict.db"
2122 "PETScBuildInternal.cmake"
2123 ;; Once installed, should uninstall with Guix
2126 (add-after 'install 'move-examples
2127 (lambda* (#:key outputs #:allow-other-keys)
2128 (let* ((out (assoc-ref outputs "out"))
2129 (examples (assoc-ref outputs "examples"))
2130 (exdir (string-append out "/share/petsc/examples"))
2131 (exdir' (string-append examples "/share/petsc/examples")))
2132 (copy-recursively exdir exdir')
2133 (delete-file-recursively exdir)
2135 (home-page "https://www.mcs.anl.gov/petsc")
2136 (synopsis "Library to solve PDEs")
2137 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2138 data structures and routines for the scalable (parallel) solution of
2139 scientific applications modeled by partial differential equations.")
2140 (license (license:non-copyleft
2141 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2143 (define-public petsc-complex
2144 (package (inherit petsc)
2145 (name "petsc-complex")
2147 (substitute-keyword-arguments (package-arguments petsc)
2148 ((#:configure-flags cf)
2149 `(cons "--with-scalar-type=complex" ,cf))))
2150 (synopsis "Library to solve PDEs (with complex scalars)")))
2152 (define-public petsc-openmpi
2153 (package (inherit petsc)
2154 (name "petsc-openmpi")
2156 `(("hdf5" ,hdf5-parallel-openmpi)
2157 ("hypre" ,hypre-openmpi)
2159 ("mumps" ,mumps-openmpi)
2160 ("openmpi" ,openmpi)
2161 ("scalapack" ,scalapack)
2162 ("scotch" ,pt-scotch32)
2163 ,@(package-inputs petsc)))
2165 (substitute-keyword-arguments (package-arguments petsc)
2166 ((#:configure-flags cf)
2168 "--with-mpiexec=mpirun"
2171 "--with-scalapack=1"
2173 ,(string-append "--with-mpi-dir="
2174 (assoc-ref %build-inputs "openmpi"))
2175 ,(string-append "--with-hdf5-include="
2176 (assoc-ref %build-inputs "hdf5") "/include")
2177 ,(string-append "--with-hdf5-lib="
2178 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2179 ,@(delete "--with-mpi=0" ,cf)))
2181 `(modify-phases ,phases
2182 (add-before 'configure 'mpi-setup
2183 ,%openmpi-setup)))))
2184 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2186 (define-public petsc-complex-openmpi
2187 (package (inherit petsc-complex)
2188 (name "petsc-complex-openmpi")
2190 `(("openmpi" ,openmpi)
2191 ,@(package-inputs petsc-complex)))
2193 (substitute-keyword-arguments (package-arguments petsc-complex)
2194 ((#:configure-flags cf)
2195 ``("--with-mpiexec=mpirun"
2196 ,(string-append "--with-mpi-dir="
2197 (assoc-ref %build-inputs "openmpi"))
2198 ,@(delete "--with-mpi=0" ,cf)))
2200 `(modify-phases ,phases
2201 (add-before 'configure 'mpi-setup
2202 ,%openmpi-setup)))))
2203 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2205 (define-public python-petsc4py
2207 (name "python-petsc4py")
2212 (uri (pypi-uri "petsc4py" version))
2215 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2216 (build-system python-build-system)
2219 (modify-phases %standard-phases
2220 (add-before 'build 'pre-build
2222 ;; Define path to PETSc installation.
2223 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2225 (add-before 'check 'mpi-setup
2228 `(("petsc" ,petsc-openmpi)
2229 ("python-numpy" ,python-numpy)))
2230 (home-page "https://bitbucket.org/petsc/petsc4py/")
2231 (synopsis "Python bindings for PETSc")
2232 (description "PETSc, the Portable, Extensible Toolkit for
2233 Scientific Computation, is a suite of data structures and routines for
2234 the scalable (parallel) solution of scientific applications modeled by
2235 partial differential equations. It employs the MPI standard for all
2236 message-passing communication. @code{petsc4py} provides Python
2237 bindings to almost all functions of PETSc.")
2238 (license license:bsd-3)))
2240 (define-public python-kiwisolver
2242 (name "python-kiwisolver")
2246 (uri (pypi-uri "kiwisolver" version))
2249 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2250 (build-system python-build-system)
2251 (home-page "https://github.com/nucleic/kiwi")
2252 (synopsis "Fast implementation of the Cassowary constraint solver")
2254 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2255 solving algorithm. Kiwi has been designed from the ground up to be
2256 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2257 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2258 savings are consistently > 5x.")
2259 (license license:bsd-3)))
2261 (define-public python2-kiwisolver
2262 (package-with-python2 python-kiwisolver))
2264 (define-public slepc
2271 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2275 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2276 (build-system gnu-build-system)
2278 `(("python" ,python-2)
2279 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2281 `(("arpack" ,arpack-ng)
2282 ("gfortran" ,gfortran)))
2284 `(("petsc" ,petsc)))
2286 `(#:parallel-build? #f ;build is parallel by default
2288 `(,(string-append "--with-arpack-dir="
2289 (assoc-ref %build-inputs "arpack") "/lib"))
2290 #:make-flags ;honor (parallel-job-count)
2291 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2292 ,(string-append "PETSCCONFIGDIR="
2293 (assoc-ref %build-inputs "petsc:examples")
2294 "/share/petsc/examples/config"))
2296 (modify-phases %standard-phases
2298 ;; configure is a python script, so we can't run it with bash.
2299 (lambda* (#:key inputs outputs (configure-flags '())
2301 (let* ((prefix (assoc-ref outputs "out"))
2302 (flags `(,(string-append "--prefix=" prefix)
2303 ,@configure-flags)))
2304 (format #t "build directory: ~s~%" (getcwd))
2305 (format #t "configure flags: ~s~%" flags)
2306 (setenv "SLEPC_DIR" (getcwd))
2307 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2308 (apply invoke "./configure" flags))))
2309 (add-after 'install 'delete-doc
2310 ;; TODO: SLEPc installs HTML documentation alongside headers in
2311 ;; $out/include. We'd like to move them to share/doc, but delete
2312 ;; them for now, as they are incomplete and installing the complete
2313 ;; documentation is difficult.
2314 (lambda* (#:key outputs #:allow-other-keys)
2315 (let* ((out (assoc-ref outputs "out")))
2316 (for-each delete-file (find-files out "\\.html$"))
2318 (add-after 'install 'clean-install
2319 ;; Clean up unnecessary build logs from installation.
2320 (lambda* (#:key outputs #:allow-other-keys)
2321 (let ((out (assoc-ref outputs "out")))
2322 (for-each (lambda (file)
2323 (let ((f (string-append out "/lib/slepc/conf/" file)))
2324 (when (file-exists? f)
2326 '("configure.log" "make.log" "gmake.log"
2327 "test.log" "error.log" "RDict.db"
2330 (home-page "http://slepc.upv.es")
2331 (synopsis "Scalable library for eigenproblems")
2332 (description "SLEPc is a software library for the solution of large sparse
2333 eigenproblems on parallel computers. It can be used for the solution of
2334 linear eigenvalue problems formulated in either standard or generalized form,
2335 as well as other related problems such as the singular value decomposition.
2336 The emphasis of the software is on methods and techniques appropriate for
2337 problems in which the associated matrices are sparse, for example, those
2338 arising after the discretization of partial differential equations.")
2339 (license license:bsd-2)))
2341 (define-public slepc-complex
2342 (package (inherit slepc)
2343 (name "slepc-complex")
2345 `(("petsc" ,petsc-complex)
2346 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2347 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2349 (define-public slepc-openmpi
2350 (package (inherit slepc)
2351 (name "slepc-openmpi")
2353 (substitute-keyword-arguments (package-arguments slepc)
2354 ((#:phases phases '%standard-phases)
2355 `(modify-phases ,phases
2356 (add-before 'check 'mpi-setup
2357 ,%openmpi-setup)))))
2360 ("arpack" ,arpack-ng-openmpi)
2361 ,@(alist-delete "arpack" (package-inputs slepc))))
2363 `(("petsc" ,petsc-openmpi)
2364 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2365 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2367 (define-public slepc-complex-openmpi
2368 (package (inherit slepc-openmpi)
2369 (name "slepc-complex-openmpi")
2371 `(("petsc" ,petsc-complex-openmpi)
2372 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2373 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2375 (define-public python-slepc4py
2377 (name "python-slepc4py")
2382 (uri (pypi-uri "slepc4py" version))
2385 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2386 (build-system python-build-system)
2389 (modify-phases %standard-phases
2390 (add-before 'build 'pre-build
2392 ;; Define path to PETSc installation.
2393 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2394 ;; Define path to SLEPc installation.
2395 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2397 (add-before 'check 'mpi-setup
2400 `(("python-numpy" ,python-numpy)
2401 ("python-petsc4py" ,python-petsc4py)
2402 ("slepc" ,slepc-openmpi)))
2403 (home-page "https://bitbucket.org/slepc/slepc4py/")
2404 (synopsis "Python bindings for SLEPc")
2405 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2406 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2407 Scientific Computation. It employs the MPI standard for all
2408 message-passing communication. @code{slepc4py} provides Python
2409 bindings to almost all functions of SLEPc.")
2410 (license license:bsd-3)))
2412 (define-public mumps
2419 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2423 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2424 (patches (search-patches "mumps-build-parallelism.patch"
2425 "mumps-shared-libseq.patch"
2426 "mumps-shared-mumps.patch"
2427 "mumps-shared-pord.patch"))))
2428 (build-system gnu-build-system)
2430 `(("fortran" ,gfortran)
2431 ;; These are required for linking against mumps, but we let the user
2432 ;; declare the dependency.
2435 ("scotch" ,scotch)))
2437 `(#:modules ((ice-9 match)
2440 ,@%gnu-build-system-modules)
2442 (modify-phases %standard-phases
2444 (lambda* (#:key inputs #:allow-other-keys)
2445 (call-with-output-file "Makefile.inc"
2456 INCSEQ = -I$(topdir)/libseq
2457 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2458 LIBSEQNEEDED = libseqneeded~;
2462 AR = ar vr # rules require trailing space, ugh...
2465 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2467 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2468 LIBOTHERS = -pthread
2471 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2475 LIBS = $(SCALAP) $(LIBSEQ)
2476 LPORDDIR = $(topdir)/PORD/lib
2477 IPORD = -I$(topdir)/PORD/include
2478 LPORD = $(LPORDDIR)/libpord.a
2479 ORDERINGSF = -Dpord~@[
2481 IMETIS = -I$(METISDIR)/include
2482 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2483 ORDERINGSF += -Dmetis~]~@[~:{
2485 ISCOTCH = -I$(SCOTCHDIR)/include
2486 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2487 ORDERINGSF += ~a~}~]
2488 ORDERINGSC = $(ORDERINGSF)
2489 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2490 IORDERINGSF = $(ISCOTCH)
2491 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2492 (assoc-ref inputs "mpi")
2493 (assoc-ref inputs "blas")
2494 (assoc-ref inputs "scalapack")
2495 (assoc-ref inputs "metis")
2496 (match (list (assoc-ref inputs "pt-scotch")
2497 (assoc-ref inputs "scotch"))
2501 `((,scotch "" "-Dscotch")))
2504 "-lptesmumps -lptscotch -lptscotcherr "
2505 "-Dptscotch")))))))))
2507 ;; By default only the d-precision library is built. Make with "all"
2508 ;; target so that all precision libraries and examples are built.
2510 (invoke "make" "all"
2511 (format #f "-j~a" (parallel-job-count)))))
2513 ;; Run the simple test drivers, which read test input from stdin:
2514 ;; from the "real" input for the single- and double-precision
2515 ;; testers, and from the "cmplx" input for complex-precision
2516 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2517 ;; package to prefix execution with "mpirun".
2518 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2519 (with-directory-excursion "examples"
2522 (let ((tester (apply open-pipe*
2525 ,(string-append "./" prec
2527 (input (open-input-file
2528 (string-append "input_simpletest_" type))))
2530 (dump-port input tester)
2532 (zero? (close-pipe tester)))))
2534 '("real" "real" "cmplx" "cmplx")))))
2536 (lambda* (#:key outputs #:allow-other-keys)
2537 (let* ((out (assoc-ref outputs "out"))
2538 (libdir (string-append out "/lib")))
2539 (copy-recursively "lib" libdir)
2540 (copy-recursively "include" (string-append out "/include"))
2541 (when (file-exists? "libseq/libmpiseq.a")
2542 (install-file "libseq/libmpiseq.a" libdir))
2543 (when (file-exists? "libseq/libmpiseq.so")
2544 (install-file "libseq/libmpiseq.so" libdir))
2546 (home-page "http://mumps.enseeiht.fr")
2547 (synopsis "Multifrontal sparse direct solver")
2549 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2550 sparse system of linear equations A x = b using Gaussian elimination.")
2551 (license license:cecill-c)))
2553 (define-public mumps-metis
2554 (package (inherit mumps)
2555 (name "mumps-metis")
2557 (alist-delete "scotch" (package-inputs mumps)))))
2559 (define-public mumps-openmpi
2560 (package (inherit mumps)
2561 (name "mumps-openmpi")
2564 ("scalapack" ,scalapack)
2565 ("pt-scotch" ,pt-scotch)
2566 ,@(alist-delete "scotch" (package-inputs mumps))))
2568 (substitute-keyword-arguments (package-arguments mumps)
2570 `(modify-phases ,phases
2571 (add-before 'check 'mpi-setup
2575 ((assoc-ref ,phases 'check)
2576 #:exec-prefix '("mpirun" "-n" "2"))))))))
2577 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2579 (define-public mumps-metis-openmpi
2580 (package (inherit mumps-openmpi)
2581 (name "mumps-metis-openmpi")
2583 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2585 (define-public ruby-asciimath
2587 (name "ruby-asciimath")
2592 (uri (rubygems-uri "asciimath" version))
2595 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2596 (build-system ruby-build-system)
2599 (modify-phases %standard-phases
2601 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2602 (add-after 'unpack 'patch-remove-spurious-backslashes
2604 (substitute* "spec/parser_spec.rb"
2609 `(("bundler" ,bundler)
2610 ("ruby-rspec" ,ruby-rspec)))
2611 (synopsis "AsciiMath parsing and conversion library")
2613 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2614 easy-to-write markup language for mathematics.")
2615 (home-page "https://github.com/asciidoctor/asciimath")
2616 (license license:expat)))
2618 (define-public superlu
2625 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2626 "superlu_" version ".tar.gz"))
2628 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2629 (modules '((guix build utils)))
2631 ;; Replace the non-free implementation of MC64 with a stub adapted
2634 (use-modules (ice-9 regex)
2636 (call-with-output-file "SRC/mc64ad.c"
2641 void mc64id_(int *a) {
2642 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2645 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2646 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2647 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2650 ;; Remove the corresponding license verbiage. MC64 license follows
2651 ;; a "------" line separator.
2652 (with-atomic-file-replacement "License.txt"
2653 (let ((rx (make-regexp "-{8}")))
2656 (let ((line (read-line in 'concat)))
2657 (unless (regexp-exec rx line)
2661 (build-system cmake-build-system)
2665 `(("blas" ,openblas)
2666 ("gfortran" ,gfortran)))
2668 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2669 "-DTPL_BLAS_LIBRARIES=openblas"
2670 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2671 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2672 (synopsis "Supernodal direct solver for sparse linear systems")
2674 "SuperLU is a general purpose library for the direct solution of large,
2675 sparse, nonsymmetric systems of linear equations on high performance machines.
2676 The library is written in C and is callable from either C or Fortran. The
2677 library routines perform an LU decomposition with partial pivoting and
2678 triangular system solves through forward and back substitution. The library
2679 also provides threshold-based ILU factorization preconditioners.")
2680 (license (list license:bsd-3
2681 license:gpl2+ ;EXAMPLE/*fgmr.c
2682 (license:fsf-free "file://SRC/colamd.h")))))
2684 (define-public superlu-dist
2686 (name "superlu-dist")
2691 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2692 "superlu_dist_" version ".tar.gz"))
2694 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2695 (modules '((guix build utils)))
2697 ;; Replace the non-free implementation of MC64 with a stub
2699 (call-with-output-file "SRC/mc64ad_dist.c"
2704 void mc64id_dist(int *a) {
2705 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2708 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2709 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2710 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2713 (substitute* "SRC/util.c" ;adjust default algorithm
2714 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2715 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2716 ;; general (i.e. non-square) processor-grid support.
2717 "RowPerm = NOROWPERM;"))
2719 (patches (search-patches "superlu-dist-scotchmetis.patch"
2720 "superlu-dist-awpm-grid.patch"))))
2721 (build-system cmake-build-system)
2725 `(("gfortran" ,gfortran)
2728 ("combblas" ,combinatorial-blas)))
2730 `(("mpi" ,openmpi) ;headers include MPI heades
2731 ("parmetis" ,pt-scotch32 "metis")
2732 ("pt-scotch" ,pt-scotch32)))
2734 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2735 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2736 "-DTPL_ENABLE_COMBBLASLIB=YES"
2737 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2738 "-DTPL_LAPACK_LIBRARIES=-llapack"
2739 (string-append "-DTPL_PARMETIS_LIBRARIES="
2741 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2742 "scotchmetis" "scotch" "scotcherr")
2744 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2745 (assoc-ref %build-inputs "parmetis")
2747 "-DTPL_ENABLE_COMBBLASLIB=ON"
2748 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2749 (assoc-ref %build-inputs "combblas")
2750 "/include/CombBLAS;"
2751 (assoc-ref %build-inputs "combblas")
2752 "/include/BipartiteMatchings")
2753 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2755 (modify-phases %standard-phases
2756 (add-before 'configure 'set-c++-standard
2758 (substitute* "CMakeLists.txt"
2759 ;; AWPM headers require C++14
2760 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2761 (add-before 'check 'mpi-setup
2763 (add-before 'check 'omp-setup
2764 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2765 (home-page (package-home-page superlu))
2766 (synopsis "Parallel supernodal direct solver")
2768 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2769 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2770 implemented in ANSI C, and MPI for communications.")
2771 (license license:bsd-3)))
2773 (define-public scotch
2780 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2781 "latestfile/298/scotch_" version ".tar.gz"))
2783 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2784 (patches (search-patches "scotch-build-parallelism.patch"
2785 "scotch-integer-declarations.patch"))))
2786 (build-system gnu-build-system)
2792 (outputs '("out" "metis"))
2794 `(#:make-flags (list (string-append "prefix=" %output))
2796 (modify-phases %standard-phases
2798 'unpack 'chdir-to-src
2799 (lambda _ (chdir "src") #t))
2803 (call-with-output-file "Makefile.inc"
2817 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2818 LDFLAGS = -lz -lm -lrt -lpthread
2820 LEX = flex -Pscotchyy -olex.yy.c
2825 YACC = bison -pscotchyy -y -b y
2827 '("COMMON_FILE_COMPRESS_GZ"
2829 "COMMON_RANDOM_FIXED_SEED"
2830 "INTSIZE64" ;use 'int64_t'
2831 ;; Prevents symbolc clashes with libesmumps
2833 ;; XXX: Causes invalid frees in superlu-dist tests
2835 ;; "SCOTCH_PTHREAD_NUMBER=2"
2836 "restrict=__restrict"))))
2838 (add-after 'build 'build-esmumps
2841 (format #f "-j~a" (parallel-job-count))
2843 (add-before 'install 'make-install-dirs
2844 (lambda* (#:key outputs #:allow-other-keys)
2845 (mkdir (assoc-ref outputs "out"))))
2846 (add-after 'install 'install-metis
2847 (lambda* (#:key outputs #:allow-other-keys)
2848 (let ((out (assoc-ref outputs "metis")))
2850 ;; metis files are not installed with 'make install'
2851 (for-each (lambda (f)
2852 (install-file f (string-append out "/include")))
2853 (find-files "../include/" ".*metis\\.h"))
2854 (for-each (lambda (f)
2855 (install-file f (string-append out "/lib")))
2856 (find-files "../lib/" ".*metis\\..*"))
2858 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2859 (synopsis "Programs and libraries for graph algorithms")
2860 (description "SCOTCH is a set of programs and libraries which implement
2861 the static mapping and sparse matrix reordering algorithms developed within
2862 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2863 conquer approach, to scientific computing problems such as graph and mesh
2864 partitioning, static mapping, and sparse matrix ordering, in application
2865 domains ranging from structural mechanics to operating systems or
2867 ;; See LICENSE_en.txt
2868 (license license:cecill-c)))
2870 (define-public scotch32
2871 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2872 ;; some applications.
2873 (package (inherit scotch)
2876 (substitute-keyword-arguments (package-arguments scotch)
2877 ((#:phases scotch-phases)
2878 `(modify-phases ,scotch-phases
2882 (call-with-output-file "Makefile.inc"
2896 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2897 LDFLAGS = -lz -lm -lrt -lpthread
2899 LEX = flex -Pscotchyy -olex.yy.c
2904 YACC = bison -pscotchyy -y -b y
2906 '("COMMON_FILE_COMPRESS_GZ"
2908 "COMMON_RANDOM_FIXED_SEED"
2909 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2910 ;; Prevents symbolc clashes with libesmumps
2912 ;; XXX: Causes invalid frees in superlu-dist tests
2914 ;; "SCOTCH_PTHREAD_NUMBER=2"
2915 "restrict=__restrict"))))))))))
2917 "Programs and libraries for graph algorithms (32-bit integers)")))
2919 (define-public pt-scotch
2920 (package (inherit scotch)
2923 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2925 (substitute-keyword-arguments (package-arguments scotch)
2926 ((#:phases scotch-phases)
2927 `(modify-phases ,scotch-phases
2931 (invoke "make" (format #f "-j~a" (parallel-job-count))
2932 "ptscotch" "ptesmumps")
2934 ;; Install the serial metis compatibility library
2935 (invoke "make" "-C" "libscotchmetis" "install")))
2936 (add-before 'check 'mpi-setup
2940 (invoke "make" "ptcheck")))))))
2941 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2943 (define-public pt-scotch32
2944 (package (inherit scotch32)
2945 (name "pt-scotch32")
2947 `(("openmpi" ,openmpi))) ;headers include MPI headers
2949 (substitute-keyword-arguments (package-arguments scotch32)
2950 ((#:phases scotch32-phases)
2951 `(modify-phases ,scotch32-phases
2954 (invoke "make" (format #f "-j~a" (parallel-job-count))
2955 "ptscotch" "ptesmumps")
2956 ;; Install the serial metis compatibility library
2957 (invoke "make" "-C" "libscotchmetis" "install")))
2958 (add-before 'check 'mpi-setup
2962 (invoke "make" "ptcheck")))))))
2964 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2966 (define-public metis
2973 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2974 "metis-" version ".tar.gz"))
2977 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2978 (build-system cmake-build-system)
2980 `(("blas" ,openblas)))
2982 `(#:tests? #f ;no tests
2983 #:configure-flags `("-DSHARED=ON"
2984 ,(string-append "-DGKLIB_PATH=" (getcwd)
2985 "/metis-" ,version "/GKlib"))))
2986 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2987 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2989 "METIS is a set of serial programs for partitioning graphs, partitioning
2990 finite element meshes, and producing fill-reducing orderings for sparse
2991 matrices. The algorithms implemented in METIS are based on the multilevel
2992 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2994 (license license:asl2.0))) ;As of version 5.0.3
2996 (define-public p4est
3003 (uri (string-append "http://p4est.github.io/release/p4est-"
3007 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3008 (build-system gnu-build-system)
3010 `(("fortran" ,gfortran)
3015 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3016 (assoc-ref %build-inputs "blas")
3018 ,(string-append "LAPACK_LIBS=-L"
3019 (assoc-ref %build-inputs "lapack")
3021 #:phases (modify-phases %standard-phases
3022 (add-before 'check 'mpi-setup
3024 (home-page "http://www.p4est.org")
3025 (synopsis "Adaptive mesh refinement on forests of octrees")
3027 "The p4est software library enables the dynamic management of a
3028 collection of adaptive octrees, conveniently called a forest of octrees.
3029 p4est is designed to work in parallel and scales to hundreds of thousands of
3031 (license license:gpl2+)))
3033 (define-public p4est-openmpi
3034 (package (inherit p4est)
3035 (name "p4est-openmpi")
3038 ,@(package-inputs p4est)))
3040 (substitute-keyword-arguments (package-arguments p4est)
3041 ((#:configure-flags cf)
3042 ``("--enable-mpi" ,@,cf))))
3043 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3045 (define-public gsegrafix
3052 (uri (string-append "mirror://gnu/" name "/" name "-"
3056 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3057 (build-system gnu-build-system)
3059 `(#:configure-flags '("LDFLAGS=-lm")))
3061 `(("libgnomecanvas" ,libgnomecanvas)
3062 ("libbonoboui" ,libbonoboui)
3063 ("libgnomeui" ,libgnomeui)
3064 ("libgnomeprintui" ,libgnomeprintui)
3067 `(("pkg-config" ,pkg-config)))
3068 (home-page "https://www.gnu.org/software/gsegrafix/")
3069 (synopsis "GNOME application to create scientific and engineering plots")
3070 (description "GSEGrafix is an application which produces high-quality graphical
3071 plots for science and engineering. Plots are specified via simple ASCII
3072 parameter files and data files and are presented in an anti-aliased GNOME
3073 canvas. The program supports rectangular two-dimensional plots, histograms,
3074 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3075 to BMP, JPEG or PNG image formats.")
3076 (license license:gpl3+)))
3078 (define-public maxima
3085 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3086 version "-source/" name "-" version ".tar.gz"))
3089 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
3090 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3091 (build-system gnu-build-system)
3094 ("gnuplot" ,gnuplot) ;for plots
3096 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3098 `(("texinfo" ,texinfo)
3100 ("python" ,python)))
3103 (list "--enable-gcl"
3104 (string-append "--with-posix-shell="
3105 (assoc-ref %build-inputs "bash")
3107 (string-append "--with-wish="
3108 (assoc-ref %build-inputs "tk")
3110 (let ((v ,(package-version tk)))
3111 (string-take v (string-index-right v #\.)))))
3112 ;; By default Maxima attempts to write temporary files to
3113 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3114 ;; Work around that.
3115 #:make-flags (list "TMPDIR=/tmp")
3117 (modify-phases %standard-phases
3118 (add-after 'unpack 'patch-paths
3119 (lambda* (#:key inputs #:allow-other-keys)
3120 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3121 (coreutils (assoc-ref inputs "coreutils"))
3122 (dirname (string-append coreutils "/bin/dirname"))
3123 (head (string-append coreutils "/bin/head"))
3124 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3125 (python (string-append (assoc-ref inputs "python")
3127 (substitute* "src/maxima.in"
3128 (("sed ") (string-append sed " "))
3129 (("dirname") dirname)
3131 (substitute* "doc/info/Makefile.in"
3132 (("/usr/bin/env perl") perl))
3133 (substitute* "doc/info/build_html.sh.in"
3134 (("python") python))
3136 (add-before 'check 'pre-check
3138 (chmod "src/maxima" #o555)
3142 ;; This is derived from the testing code in the "debian/rules" file
3143 ;; of Debian's Maxima package.
3144 ;; If Maxima can successfully run this, the binary to be installed
3150 "--batch-string=\"run_testsuite();\" "
3151 "| grep -q \"No unexpected errors found\""))))
3152 ;; Make sure the doc and emacs files are found in the
3153 ;; standard location. Also configure maxima to find gnuplot
3154 ;; without having it on the PATH.
3155 (add-after 'install 'post-install
3156 (lambda* (#:key outputs inputs #:allow-other-keys)
3157 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3158 (out (assoc-ref outputs "out"))
3159 (datadir (string-append out "/share/maxima/" ,version))
3160 (binutils (string-append (assoc-ref inputs "binutils")
3162 (with-directory-excursion out
3163 (mkdir-p "share/emacs")
3164 (mkdir-p "share/doc")
3166 (string-append datadir "/doc/")
3167 (string-append out "/share/doc/maxima"))
3168 (with-atomic-file-replacement
3169 (string-append datadir "/share/maxima-init.lisp")
3171 (format out "~a ~s~a~%"
3172 "(setf $gnuplot_command "
3173 (string-append gnuplot "/bin/gnuplot") ")")
3174 (dump-port in out))))
3175 ;; Ensure that Maxima will have access to the GNU binutils
3176 ;; components at runtime.
3177 (wrap-program (string-append out "/bin/maxima")
3178 `("PATH" prefix (,binutils))))
3180 (home-page "http://maxima.sourceforge.net")
3181 (synopsis "Numeric and symbolic expression manipulation")
3182 (description "Maxima is a system for the manipulation of symbolic and
3183 numerical expressions. It yields high precision numeric results by using
3184 exact fractions, arbitrary precision integers, and variable precision floating
3186 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3187 ;; Others simply say "GNU General Public License" without stating a
3188 ;; version (which implicitly means gpl1+).
3189 ;; At least one file (src/maxima.asd) says "version 2."
3190 ;; GPLv2 only is therefore the smallest subset.
3191 (license license:gpl2)))
3193 (define-public wxmaxima
3201 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
3202 (commit (string-append "Version-" version))))
3203 (file-name (git-file-name name version))
3205 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
3206 (build-system cmake-build-system)
3208 `(("gettext" ,gettext-minimal)
3209 ("xorg-server" ,xorg-server-for-tests)))
3210 ;; TODO: Add libomp for multithreading support.
3211 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3213 `(("wxwidgets" ,wxwidgets)
3216 ("adwaita-icon-theme" ,adwaita-icon-theme)
3218 ("shared-mime-info" ,shared-mime-info)))
3220 `(#:test-target "test"
3222 (modify-phases %standard-phases
3223 (add-before 'check 'pre-check
3225 ;; Tests require a running X server.
3226 (system "Xvfb :1 &")
3227 (setenv "DISPLAY" ":1")
3228 (setenv "HOME" (getcwd))
3230 (add-after 'install 'wrap-program
3231 (lambda* (#:key inputs outputs #:allow-other-keys)
3232 (wrap-program (string-append (assoc-ref outputs "out")
3235 (,(string-append (assoc-ref inputs "maxima")
3237 ;; For GtkFileChooserDialog.
3238 `("GSETTINGS_SCHEMA_DIR" =
3239 (,(string-append (assoc-ref inputs "gtk+")
3240 "/share/glib-2.0/schemas")))
3241 `("XDG_DATA_DIRS" ":" prefix
3242 (;; Needed by gdk-pixbuf to know supported icon formats.
3244 (assoc-ref inputs "shared-mime-info") "/share")
3245 ;; The default icon theme of GTK+.
3247 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3249 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3250 (synopsis "Graphical user interface for the Maxima computer algebra system")
3252 "wxMaxima is a graphical user interface for the Maxima computer algebra
3253 system. It eases the use of Maxima by making most of its commands available
3254 through a menu system and by providing input dialogs for commands that require
3255 more than one argument. It also implements its own display engine that
3256 outputs mathematical symbols directly instead of depicting them with ASCII
3259 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3260 text and mathematical calculations to create documents, exporting of input and
3261 output to TeX, and a browser for Maxima's manual including command index and
3262 full text searching.")
3263 (license license:gpl2+)))
3265 (define-public armadillo
3271 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3275 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3276 (build-system cmake-build-system)
3277 (arguments `(#:tests? #f)) ; no test target
3279 `(("openblas" ,openblas)
3281 ("arpack" ,arpack-ng)))
3282 (home-page "http://arma.sourceforge.net/")
3283 (synopsis "C++ linear algebra library")
3285 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3286 between speed and ease of use. It is useful for algorithm development
3287 directly in C++, or quick conversion of research code into production
3288 environments. It can be used for machine learning, pattern recognition,
3289 signal processing, bioinformatics, statistics, econometrics, etc. The library
3290 provides efficient classes for vectors, matrices and cubes, as well as 150+
3291 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3292 (license license:asl2.0)))
3294 (define-public muparser
3295 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3296 ;; different hash. In order to make `guix package --upgrade` work correctly,
3297 ;; we set a Guix packaging revision.
3298 ;; When the next version of muparser is released, we can remove
3299 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3300 (let ((upstream-version "2.2.5")
3304 (version (string-append upstream-version "-" revision))
3309 (url "https://github.com/beltoforion/muparser.git")
3310 (commit (string-append "v" upstream-version))))
3311 (file-name (git-file-name name version))
3313 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3314 (build-system gnu-build-system)
3316 `(#:configure-flags '("--enable-samples=no")
3317 #:tests? #f)) ;no "check" target
3318 (home-page "http://muparser.beltoforion.de/")
3319 (synopsis "Fast parser library for mathematical expressions")
3321 "muParser is an extensible high performance math parser library. It is
3322 based on transforming an expression into a bytecode and precalculating constant
3324 (license license:expat))))
3326 (define-public openblas
3333 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3334 version "%20version.tar.gz"))
3335 (file-name (string-append name "-" version ".tar.gz"))
3338 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3339 (build-system gnu-build-system)
3341 `(#:test-target "test"
3342 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3343 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3344 ;; we need to disable substitutions.
3346 ,(let ((system (or (%current-target-system) (%current-system))))
3347 (or (string-prefix? "x86_64" system)
3348 (string-prefix? "i686" system)
3349 (string-prefix? "mips" system)
3350 (string-prefix? "aarch64" system)))
3352 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3354 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3356 ;; This is the maximum number of threads OpenBLAS will ever use (that
3357 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3358 ;; is used.) If we don't set it, the makefile sets it to the number
3359 ;; of cores of the build machine, which is obviously wrong.
3362 ;; Build the library for all supported CPUs. This allows
3363 ;; switching CPU targets at runtime with the environment variable
3364 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3365 ;; Unfortunately, this is not supported on non-x86 architectures,
3366 ;; where it leads to failed builds.
3367 ,@(let ((system (or (%current-target-system) (%current-system))))
3369 ((or (string-prefix? "x86_64" system)
3370 (string-prefix? "i686" system))
3371 '("DYNAMIC_ARCH=1"))
3372 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3373 ;; two available MIPS targets special extended instructions
3374 ;; for Loongson cores are used.
3375 ((string-prefix? "mips" system)
3376 '("TARGET=SICORTEX"))
3377 ;; On aarch64 force the generic 'armv8-a' target
3378 ((string-prefix? "aarch64" system)
3381 ;; no configure script
3383 (modify-phases %standard-phases
3385 (add-before 'build 'set-extralib
3386 (lambda* (#:key inputs #:allow-other-keys)
3387 ;; Get libgfortran found when building in utest.
3389 (string-append "-L" (assoc-ref inputs "fortran-lib")
3393 `(("fortran-lib" ,gfortran "lib")))
3396 ("fortran" ,gfortran)
3398 (home-page "https://www.openblas.net/")
3399 (synopsis "Optimized BLAS library based on GotoBLAS")
3401 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3402 (license license:bsd-3)))
3404 (define-public openblas-ilp64
3405 (package/inherit openblas
3406 (name "openblas-ilp64")
3407 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3409 (substitute-keyword-arguments (package-arguments openblas)
3410 ((#:make-flags flags '())
3411 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3413 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3414 (license license:bsd-3)))
3416 (define* (make-blis implementation #:optional substitutable?)
3417 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3418 source tree for a list of implementations.)
3420 SUBSTITUTABLE? determines whether the package is made available as a
3423 Currently the specialization must be selected at configure-time, but work is
3424 underway to allow BLIS to select the right optimized kernels at run time:
3425 <https://github.com/flame/blis/issues/129>."
3427 (name (if (string=? implementation "reference")
3429 (string-append "blis-" implementation)))
3431 (home-page "https://github.com/flame/blis")
3434 (uri (git-reference (url home-page) (commit version)))
3437 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3438 (file-name (git-file-name "blis" version))))
3439 (build-system gnu-build-system)
3441 `(#:test-target "test"
3443 #:substitutable? ,substitutable?
3445 #:phases (modify-phases %standard-phases
3447 (lambda* (#:key outputs #:allow-other-keys)
3448 ;; This is a home-made 'configure' script.
3449 (let ((out (assoc-ref outputs "out")))
3450 (invoke "./configure" "-p" out
3454 "--enable-threading=openmp"
3457 (add-before 'check 'show-test-output
3459 ;; By default "make check" is silent. Make it verbose.
3460 (system "tail -F output.testsuite &")
3462 (synopsis "High-performance basic linear algebra (BLAS) routines")
3464 "BLIS is a portable software framework for instantiating high-performance
3465 BLAS-like dense linear algebra libraries. The framework was designed to
3466 isolate essential kernels of computation that, when optimized, immediately
3467 enable optimized implementations of most of its commonly used and
3468 computationally intensive operations. While BLIS exports a new BLAS-like API,
3469 it also includes a BLAS compatibility layer which gives application developers
3470 access to BLIS implementations via traditional BLAS routine calls.")
3471 (license license:bsd-3)))
3474 ;; This is the "reference" implementation, which is the non-optimized but
3475 ;; portable variant (no assembly).
3476 (make-blis "reference" #t))
3478 (define ignorance blis)
3480 (define-syntax-rule (blis/x86_64 processor)
3481 "Expand to a package specialized for PROCESSOR."
3483 (inherit (make-blis processor))
3484 (supported-systems '("x86_64-linux"))))
3486 (define-public blis-sandybridge
3487 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3488 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3489 (blis/x86_64 "sandybridge"))
3491 (define-public blis-haswell
3492 ;; BLIS specialized for Haswell processors (launched 2013):
3493 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3494 (blis/x86_64 "haswell"))
3496 (define-public blis-knl
3497 ;; BLIS specialized for Knights Landing processor (launched 2016):
3498 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3499 (blis/x86_64 "knl"))
3502 (define-public openlibm
3510 (url "https://github.com/JuliaLang/openlibm.git")
3511 (commit (string-append "v" version))))
3512 (file-name (git-file-name name version))
3514 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3515 (build-system gnu-build-system)
3518 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3520 ;; no configure script
3521 (modify-phases %standard-phases (delete 'configure))
3522 #:tests? #f)) ;the tests are part of the default target
3523 (home-page "https://openlibm.org/")
3524 (synopsis "Portable C mathematical library (libm)")
3526 "OpenLibm is an effort to have a high quality, portable, standalone C
3527 mathematical library (libm). It can be used standalone in applications and
3528 programming language implementations. The project was born out of a need to
3529 have a good libm for the Julia programming language that worked consistently
3530 across compilers and operating systems, and in 32-bit and 64-bit
3532 ;; Each architecture has its own make target, and there is none for mips.
3533 (supported-systems (delete "mips64el-linux" %supported-systems))
3534 ;; See LICENSE.md for details.
3535 (license (list license:expat
3538 license:public-domain
3539 license:lgpl2.1+))))
3541 (define-public openspecfun
3543 (name "openspecfun")
3549 (url "https://github.com/JuliaLang/openspecfun.git")
3550 (commit (string-append "v" version))))
3551 (file-name (git-file-name name version))
3553 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3554 (build-system gnu-build-system)
3556 '(#:tests? #f ; no "check" target
3558 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3560 (modify-phases %standard-phases
3561 (delete 'configure)))) ; no configure script
3563 `(("fortran" ,gfortran)))
3564 (home-page "https://github.com/JuliaLang/openspecfun")
3565 (synopsis "Collection of special mathematical functions")
3567 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3568 portable package for Bessel Functions of a Complex Argument and Nonnegative
3569 Order; it contains subroutines for computing Bessel functions and Airy
3570 functions. Faddeeva allows computing the various error functions of arbitrary
3571 complex arguments (Faddeeva function, error function, complementary error
3572 function, scaled complementary error function, imaginary error function, and
3573 Dawson function); given these, one can also easily compute Voigt functions,
3574 Fresnel integrals, and similar related functions as well.")
3575 ;; Faddeeva is released under the Expat license; AMOS is included as
3576 ;; public domain software.
3577 (license (list license:expat license:public-domain))))
3579 (define-public suitesparse
3581 (name "suitesparse")
3587 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse.git")
3588 (commit (string-append "v" version))))
3589 (file-name (git-file-name name version))
3592 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3593 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3594 (modules '((guix build utils)))
3596 ;; Remove bundled metis source
3598 (delete-file-recursively "metis-5.1.0")
3600 (build-system gnu-build-system)
3602 '(#:tests? #f ;no "check" target
3607 "MY_METIS_LIB=-lmetis"
3608 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3609 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3610 (assoc-ref %outputs "out")
3611 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3612 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3613 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3614 " -DCMAKE_SKIP_RPATH=TRUE"
3615 " -DCMAKE_BUILD_TYPE=Release")
3616 (string-append "INSTALL_LIB="
3617 (assoc-ref %outputs "out") "/lib")
3618 (string-append "INSTALL_INCLUDE="
3619 (assoc-ref %outputs "out") "/include")
3622 (modify-phases %standard-phases
3623 (delete 'configure)))) ;no configure script
3629 `(("cmake" ,cmake-minimal)
3631 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3632 (synopsis "Suite of sparse matrix software")
3634 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3635 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3636 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3637 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3638 CXSparse, a concise sparse Cholesky factorization package; and many other
3641 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3643 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3644 (license (list license:gpl2+ license:lgpl2.1+))))
3646 (define-public atlas
3652 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3653 version "/atlas" version ".tar.bz2"))
3656 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3657 (build-system gnu-build-system)
3658 (home-page "http://math-atlas.sourceforge.net/")
3659 (inputs `(("gfortran" ,gfortran)
3660 ("lapack-tar" ,(package-source lapack))))
3661 (outputs '("out" "doc"))
3662 ;; For the moment we drop support for MIPS at it fails to compile. See
3663 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3664 (supported-systems (delete "mips64el-linux" %supported-systems))
3666 `(#:parallel-build? #f
3667 #:parallel-tests? #f
3669 ;; ATLAS tunes itself for the machine it is built on, as explained at
3670 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3671 ;; For this reason, we want users to build it locally instead of using
3675 #:modules ((srfi srfi-26)
3676 (guix build gnu-build-system)
3679 `(;; Generate position independent code suitable for dynamic libraries
3680 ;; and use WALL timer to get more accurate timing.
3681 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3684 ,,(if (string-match "64" (%current-system))
3687 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3688 ;; needed to compile C files before it is generated.
3689 "-Ss" "pmake" "make -j 1"
3690 ;; Probe is failing for MIPS. We therefore define the system
3691 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3692 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3693 ,,@(if (string-prefix? "mips" (%current-system))
3694 (list "-A" "49" "-V" "1")
3696 ;; Generate shared libraries.
3698 ;; Build a full LAPACK library.
3699 ,(string-append "--with-netlib-lapack-tarfile="
3700 (assoc-ref %build-inputs "lapack-tar")))
3702 (modify-phases %standard-phases
3703 (add-after 'install 'install-doc
3704 (lambda* (#:key outputs inputs #:allow-other-keys)
3705 (let ((doc (string-append (assoc-ref outputs "doc")
3706 "/share/doc/atlas")))
3708 (for-each (cut install-file <> doc)
3709 (find-files "../ATLAS/doc" ".*"))
3711 (add-after 'check 'check-pt
3712 (lambda _ (invoke "make" "ptcheck")))
3713 ;; Fix files required to run configure.
3714 (add-before 'configure 'fix-/bin/sh
3716 ;; Use `sh', not `/bin/sh'.
3717 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3721 ;; Fix /bin/sh in generated make files.
3722 (add-after 'configure 'fix-/bin/sh-in-generated-files
3724 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3728 ;; ATLAS configure program does not accepts the default flags
3729 ;; passed by the 'gnu-build-system'.
3731 (lambda* (#:key native-inputs inputs outputs
3732 (configure-flags '())
3733 #:allow-other-keys #:rest args)
3734 (let* ((prefix (assoc-ref outputs "out"))
3735 (bash (or (and=> (assoc-ref
3736 (or native-inputs inputs) "bash")
3737 (cut string-append <> "/bin/bash"))
3739 (flags `(,(string-append "--prefix=" prefix)
3741 (abs-srcdir (getcwd))
3742 (srcdir (string-append "../" (basename abs-srcdir))))
3743 (format #t "source directory: ~s (relative from build: ~s)~%"
3747 (format #t "build directory: ~s~%" (getcwd))
3748 (format #t "configure flags: ~s~%" flags)
3750 (string-append srcdir "/configure")
3752 (synopsis "Automatically Tuned Linear Algebra Software")
3754 "ATLAS is an automatically tuned linear algebra software library
3755 providing C and Fortran77 interfaces to a portably efficient BLAS
3756 implementation, as well as a few routines from LAPACK.
3758 Optimization occurs at build time. For this reason, the library is built on
3759 the machine where it is installed, without resorting to pre-built substitutes.
3761 Before building the library, CPU throttling should be disabled. This can be
3762 done in the BIOS, or, on GNU/Linux, with the following command:
3765 # cpupower --governor performance
3768 Failure to do so will result in a library with poor performance.")
3769 (license license:bsd-3)))
3778 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3779 version "/glm-" version ".zip"))
3781 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
3782 (build-system cmake-build-system)
3784 `(#:phases (modify-phases %standard-phases
3786 (lambda* (#:key outputs #:allow-other-keys)
3787 ;; Since version 0.9.9.6, 'make install' is not supported
3788 ;; and we have to do it "manually". Upstream discussion:
3789 ;; <https://github.com/g-truc/glm/pull/968>.
3790 (let* ((source (string-append "../glm"))
3791 (out (assoc-ref outputs "out"))
3792 (inc (string-append out "/include"))
3793 (lib (string-append out "/lib"))
3794 (pkgconfig (string-append lib "/pkgconfig")))
3795 (with-directory-excursion source
3798 (copy-recursively "glm" (string-append inc "/glm"))
3799 (copy-recursively "cmake" (string-append lib "/cmake"))
3800 (call-with-output-file (string-append pkgconfig "/glm.pc")
3804 includedir=${prefix}/include
3807 Description: OpenGL Mathematics
3809 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3812 `(("unzip" ,unzip)))
3813 (home-page "https://glm.g-truc.net/")
3814 (synopsis "OpenGL Mathematics library")
3815 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3816 library for graphics software based on the OpenGL Shading Language (GLSL)
3818 (license license:expat)))
3820 (define-public lpsolve
3827 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3828 "/lp_solve_" version "_source.tar.gz"))
3831 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3832 (modules '((guix build utils)))
3835 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3837 ;; Pretend to be on a 64 bit platform to obtain a common directory
3838 ;; name for the build results on all architectures; nothing else
3839 ;; seems to depend on it.
3840 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3842 ;; The check for 'isnan' as it is written fails with
3843 ;; "non-floating-point argument in call to function
3844 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3845 ;; definition, which in turn leads to bad things. Fix the feature
3847 (("isnan\\(0\\)") "isnan(0.)"))
3849 (build-system gnu-build-system)
3851 `(#:tests? #f ; no check target
3853 (modify-phases %standard-phases
3854 (delete 'configure) ; no configure script
3857 (with-directory-excursion "lpsolve55"
3858 (invoke "bash" "ccc"))
3859 (with-directory-excursion "lp_solve"
3860 (invoke "bash" "ccc"))
3863 (lambda* (#:key outputs #:allow-other-keys)
3864 (let* ((out (assoc-ref outputs "out"))
3865 (bin (string-append out "/bin"))
3866 (lib (string-append out "/lib"))
3867 ;; This is where LibreOffice expects to find the header
3868 ;; files, and where they are installed by Debian.
3869 (include (string-append out "/include/lpsolve")))
3870 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3871 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3872 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3874 ;; Install a subset of the header files as on Debian
3875 ;; (plus lp_bit.h, which matches the regular expression).
3876 (for-each (lambda (name)
3877 (install-file name include))
3878 (find-files "." "lp_[HMSa-z].*\\.h$"))
3879 (with-directory-excursion "shared"
3880 (for-each (lambda (name)
3881 (install-file name include))
3882 (find-files "." "\\.h$")))
3884 (home-page "http://lpsolve.sourceforge.net/")
3885 (synopsis "Mixed integer linear programming (MILP) solver")
3887 "lp_solve is a mixed integer linear programming solver based on the
3888 revised simplex and the branch-and-bound methods.")
3889 (license license:lgpl2.1+)))
3891 (define-public dealii
3898 (uri (string-append "https://github.com/dealii/dealii/releases/"
3899 "download/v" version "/dealii-" version ".tar.gz"))
3902 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3903 (modules '((guix build utils)))
3905 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3907 (delete-file-recursively "bundled")
3909 (build-system cmake-build-system)
3917 ("arpack" ,arpack-ng)
3918 ("muparser" ,muparser)
3919 ("gfortran" ,gfortran)
3920 ("suitesparse" ,suitesparse))) ;for UMFPACK
3922 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3924 ;; Work around a bug in libsuitesparseconfig linking
3925 ;; see https://github.com/dealii/dealii/issues/4745
3926 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3927 (home-page "https://www.dealii.org")
3928 (synopsis "Finite element library")
3930 "Deal.II is a C++ program library targeted at the computational solution
3931 of partial differential equations using adaptive finite elements. The main
3932 aim of deal.II is to enable rapid development of modern finite element codes,
3933 using among other aspects adaptive meshes and a wide array of tools often used
3934 in finite element programs.")
3935 (license license:lgpl2.1+)))
3937 (define-public dealii-openmpi
3938 (package (inherit dealii)
3939 (name "dealii-openmpi")
3942 ;;Supported only with MPI:
3943 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3944 ("p4est" ,p4est-openmpi)
3945 ("petsc" ,petsc-openmpi)
3946 ("slepc" ,slepc-openmpi)
3947 ("metis" ,metis) ;for MUMPS
3948 ("scalapack" ,scalapack) ;for MUMPS
3949 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3950 ("arpack" ,arpack-ng-openmpi)
3951 ,@(fold alist-delete (package-inputs dealii)
3952 '("p4est" "arpack"))))
3954 (substitute-keyword-arguments (package-arguments dealii)
3955 ((#:configure-flags cf)
3956 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3958 ((#:phases phases '%standard-phases)
3959 `(modify-phases ,phases
3960 (add-before 'check 'mpi-setup
3961 ,%openmpi-setup)))))
3962 (synopsis "Finite element library (with MPI support)")))
3964 (define-public flann
3968 (home-page "https://github.com/mariusmuja/flann/")
3972 (uri (git-reference (url home-page) (commit version)))
3973 (file-name (git-file-name name version))
3976 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
3977 (patches (search-patches "flann-cmake-3.11.patch"))))
3978 (build-system cmake-build-system)
3981 `(("unzip" ,unzip)))
3984 ;; FIXME: 'mkoctfile' fails with a linker error:
3985 ;; ld: cannot find -loctinterp
3986 ;; ld: cannot find -loctave
3987 ;; Disable it for now.
3988 ;;("octave" ,octave-cli)
3989 ("python" ,python-2) ; print syntax
3990 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3993 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3994 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3995 #:strip-directories '("lib" "lib64" "libexec"
3996 "bin" "sbin" "share/flann/octave")
3998 ;; Save 12 MiB by not installing .a files. Passing
3999 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4000 #:phases (modify-phases %standard-phases
4001 (add-after 'install 'remove-static-libraries
4002 (lambda* (#:key outputs #:allow-other-keys)
4003 (let* ((out (assoc-ref outputs "out"))
4004 (lib (string-append out "/lib")))
4005 (for-each delete-file
4006 (find-files lib "\\.a$"))
4009 #:tests? #f)) ; The test data are downloaded from the Internet.
4010 (synopsis "Library for approximate nearest neighbors computation")
4011 (description "FLANN is a library for performing fast approximate
4012 nearest neighbor searches in high dimensional spaces. It implements a
4013 collection of algorithms and a system for automatically choosing the best
4014 algorithm and optimum parameters depending on the dataset.
4016 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4017 (license (license:non-copyleft "file://COPYING"
4018 "See COPYING in the distribution."))))
4020 (define-public wcalc
4027 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4028 "wcalc-" version ".tar.bz2"))
4031 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4032 (build-system gnu-build-system)
4035 ("readline" ,readline)))
4036 (home-page "http://w-calc.sourceforge.net/index.php")
4037 (synopsis "Flexible command-line scientific calculator")
4038 (description "Wcalc is a very capable calculator. It has standard functions
4039 (sin, asin, and sinh for example, in either radians or degrees), many
4040 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4041 variables, a command history, hex/octal/binary input and output, unit
4042 conversions, embedded comments, and an expandable expression entry field. It
4043 evaluates expressions using the standard order of operations.")
4044 (license license:gpl2+)))
4053 (url "https://github.com/xaos-project/XaoS")
4054 (commit (string-append "release-" version))))
4055 (file-name (git-file-name name version))
4058 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4059 (build-system gnu-build-system)
4060 (native-inputs `(("gettext" ,gettext-minimal)
4062 ("qttools" ,qttools)))
4063 (inputs `(("libx11" ,libx11)
4067 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4068 ;; not enough for this package to install properly. These phases fix that.
4070 `(#:tests? #f ;no "check" target
4072 (modify-phases %standard-phases
4073 (add-before 'configure 'make-qt-deterministic
4075 ;; Make Qt deterministic.
4076 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4079 (lambda* (#:key outputs #:allow-other-keys)
4080 (let ((out (assoc-ref outputs "out")))
4081 ;; The DESTDIR is originally set to install the xaos binary to
4082 ;; the "bin" folder inside the build directory. Setting make
4083 ;; flags doesn't seem to change this.
4084 (substitute* "XaoS.pro"
4086 (string-append "DESTDIR=" out "/bin")))
4087 (substitute* "src/include/config.h"
4088 (("/usr/share/XaoS")
4089 (string-append out "/share/XaoS")))
4091 (add-after 'install 'install-data
4092 (lambda* (#:key outputs #:allow-other-keys)
4093 (let* ((out (assoc-ref outputs "out"))
4094 (share (string-append out "/share")))
4098 (copy-recursively folder
4099 (string-append share "/XaoS/" folder)))
4100 '("catalogs" "examples" "tutorial"))
4101 (install-file "xdg/xaos.png"
4102 (string-append share "/pixmaps"))
4103 (install-file "xdg/xaos.desktop"
4104 (string-append share "/applications")))
4106 (synopsis "Real-time fractal zoomer")
4107 (description "GNU XaoS is a graphical program that generates fractal
4108 patterns and allows you to zoom in and out of them infinitely in a fluid,
4109 continuous manner. It also includes tutorials that help to explain how fractals
4110 are built. It can generate many different fractal types such as the Mandelbrot
4112 (home-page "https://xaos-project.github.io/")
4113 (license license:gpl2+)))
4115 (define-public hypre
4123 (url "https://github.com/LLNL/hypre.git")
4124 (commit (string-append "v" version))))
4125 (file-name (git-file-name name version))
4127 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4128 (modules '((guix build utils)))
4131 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4132 ;; substitute the release date.
4133 (substitute* "src/utilities/HYPRE_utilities.h"
4134 (("Date Compiled: .*$")
4135 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4137 (build-system gnu-build-system)
4138 (outputs '("out" ; 6.1 MiB of headers and libraries
4139 "doc")) ; 4.8 MiB of documentation
4143 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4144 ("texlive" ,(texlive-union (list texlive-xypic
4146 texlive-latex-hyperref
4148 ("ghostscript" ,ghostscript)))
4150 `(("blas" ,openblas)
4151 ("lapack" ,lapack)))
4153 `(#:modules ((srfi srfi-1)
4154 ,@%gnu-build-system-modules)
4155 #:configure-flags '("--enable-shared"
4163 (modify-phases %standard-phases
4164 (add-before 'build 'set-HOME
4166 ;; FIXME: texlive-union does not find the built
4167 ;; metafonts, so it tries to generate them in HOME.
4168 (setenv "HOME" "/tmp")
4170 (add-before 'configure 'chdir-src
4171 (lambda _ (chdir "src")))
4173 (lambda* (#:key build target configure-flags
4174 #:allow-other-keys #:rest args)
4175 (let* ((configure (assoc-ref %standard-phases 'configure)))
4178 (list #:configure-flags
4179 (cons (string-append
4180 "--host=" (or target build))
4181 configure-flags)))))))
4182 (add-after 'build 'build-docs
4184 (invoke "make" "-Cdocs" "pdf" "html")))
4187 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4188 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4189 (invoke "make" "check" "CHECKRUN=")
4190 (for-each (lambda (filename)
4191 (let ((size (stat:size (stat filename))))
4192 (when (positive? size)
4193 (error (format #f "~a size ~d; error indication~%"
4195 (find-files "test" ".*\\.err$"))
4197 (add-after 'install 'install-docs
4198 (lambda* (#:key outputs #:allow-other-keys)
4199 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4200 (let* ((doc (assoc-ref outputs "doc"))
4201 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4202 (with-directory-excursion "docs"
4203 (for-each (lambda (base)
4204 (install-file (string-append base ".pdf") docdir)
4205 (copy-recursively base docdir)) ; html docs
4206 '("HYPRE_usr_manual"
4207 "HYPRE_ref_manual")))
4209 (home-page "http://www.llnl.gov/casc/hypre/")
4210 (synopsis "Library of solvers and preconditioners for linear equations")
4212 "HYPRE is a software library of high performance preconditioners and
4213 solvers for the solution of large, sparse linear systems of equations. It
4214 features multigrid solvers for both structured and unstructured grid
4216 (license license:lgpl2.1)))
4218 (define-public hypre-openmpi
4219 (package (inherit hypre)
4220 (name "hypre-openmpi")
4223 ,@(package-inputs hypre)))
4225 (substitute-keyword-arguments (package-arguments hypre)
4226 ((#:configure-flags flags)
4228 ,@(delete "--without-MPI" ,flags)))
4230 `(modify-phases ,phases
4231 (add-before 'check 'mpi-setup
4232 ,%openmpi-setup)))))
4233 (synopsis "Parallel solvers and preconditioners for linear equations")
4235 "HYPRE is a software library of high performance preconditioners and
4236 solvers for the solution of large, sparse linear systems of equations on
4237 parallel computers. It features parallel multigrid solvers for both
4238 structured and unstructured grid problems.")))
4240 (define-public matio
4247 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4248 "matio-" version ".tar.gz"))
4251 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4252 (build-system gnu-build-system)
4256 (home-page "http://matio.sourceforge.net/")
4257 (synopsis "Library for reading and writing MAT files")
4258 (description "Matio is a library for reading and writing MAT files. It
4259 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4260 (license license:bsd-2)))
4267 (origin (method url-fetch)
4268 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4269 "download/" version "/Vc-" version ".tar.gz"))
4272 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4273 (build-system cmake-build-system)
4276 '("-DBUILD_TESTING=ON"
4277 ;; By default, Vc will optimize for the CPU of the build machine.
4278 ;; Setting this to "none" makes it create portable binaries. See
4279 ;; "cmake/OptimizeForArchitecture.cmake".
4280 "-DTARGET_ARCHITECTURE=none")
4281 #:phases (modify-phases %standard-phases
4282 (add-after 'unpack 'copy-testdata
4283 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4284 (let ((testdata (assoc-ref (or native-inputs inputs)
4286 (copy-recursively testdata "tests/testdata")
4289 `(("virtest" ,virtest)
4291 ;; This is a submodule in the git project, but not part of the
4292 ;; released sources. See the git branch for the commit to take.
4293 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4297 (url "https://github.com/VcDevel/vc-testdata")
4298 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4299 (file-name (git-file-name "vc-testdata"
4300 (string-take commit 7)))
4303 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4304 (synopsis "SIMD vector classes for C++")
4305 (description "Vc provides portable, zero-overhead C++ types for explicitly
4306 data-parallel programming. It is a library designed to ease explicit
4307 vectorization of C++ code. Its types enable explicitly stating data-parallel
4308 operations on multiple values. The parallelism is therefore added via the type
4309 system. Vc has an intuitive API and provides portability between different
4310 compilers and compiler versions as well as portability between different vector
4311 instruction sets. Thus, an application written with Vc can be compiled for:
4314 @item SSE2 up to SSE4.2 or SSE4a
4317 @item NEON (in development)
4318 @item NVIDIA GPUs / CUDA (in development)
4320 (home-page "https://github.com/VcDevel/Vc")
4321 ;; "No support_???.cpp file exists for this architecture."
4322 (supported-systems '("x86_64-linux" "i686-linux"))
4323 (license license:bsd-3)))
4325 (define-public reducelcs
4326 ;; This is the last commit which is available upstream, no
4327 ;; release happened since 2010.
4328 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4332 (version (string-append "1.0-" revision "." (string-take commit 7)))
4337 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4339 (file-name (string-append name "-" version "-checkout"))
4342 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4343 (build-system gnu-build-system)
4345 `(("openlibm" ,openlibm)))
4347 `(#:tests? #f ; no tests
4349 (modify-phases %standard-phases
4350 (delete 'configure) ; No configure script exists.
4351 (replace 'install ; No install phase exists.
4352 (lambda* (#:key outputs #:allow-other-keys)
4353 (let* ((out (assoc-ref outputs "out"))
4354 (bin (string-append out "/bin")))
4355 (install-file "Approximation" bin)
4356 (install-file "CollectResults" bin)
4357 (install-file "GenerateInstances" bin)
4359 (synopsis "Approximate Longest Commons Subsequence computation tool")
4361 "@code{reduceLCS} is an implementation of the Reduce-Expand
4362 algorithm for LCS. It is a fast program to compute the approximate
4363 Longest Commons Subsequence of a set of strings.")
4364 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4365 (license license:gpl3+))))
4367 (define-public jacal
4374 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4377 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4378 (patches (search-patches "jacal-fix-texinfo.patch"))))
4379 (build-system gnu-build-system)
4382 (modify-phases %standard-phases
4383 (add-before 'build 'pre-build
4384 ;; Don't use upstream's script - it really doesn't fit into
4385 ;; Guix's functional paradigm.
4386 (lambda* (#:key inputs outputs #:allow-other-keys)
4387 (substitute* "Makefile"
4388 (("^install: install-script") "install: "))))
4389 (add-after 'install 'post-install
4390 ;; Instead, we provide our own simplified script.
4391 (lambda* (#:key inputs outputs #:allow-other-keys)
4392 (let ((wrapper (string-append (assoc-ref outputs "out")
4394 (format (open wrapper (logior O_WRONLY O_CREAT))
4395 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4396 "-e '(slib:load \"~a/lib/jacal/math\") "
4399 (assoc-ref inputs "scm")
4400 (assoc-ref outputs "out"))
4401 (chmod wrapper #o555))))
4403 (lambda* (#:key outputs #:allow-other-keys)
4404 (invoke "./configure"
4405 (string-append "--prefix="
4406 (assoc-ref outputs "out"))))))))
4407 (inputs `(("scm" ,scm)))
4408 (native-inputs `(("unzip" ,unzip)
4409 ("texinfo" ,texinfo)))
4410 (synopsis "Symbolic mathematics system")
4411 (description "GNU JACAL is an interactive symbolic mathematics program based on
4412 Scheme. It manipulate and simplify a range of mathematical expressions such
4413 as equations, scalars, vectors, and matrices.")
4414 (home-page "https://www.gnu.org/software/jacal/")
4415 (license license:gpl3+)))
4421 (home-page "https://github.com/Z3Prover/z3")
4424 (uri (git-reference (url home-page)
4425 (commit (string-append "z3-" version))))
4426 (file-name (git-file-name name version))
4429 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
4430 (build-system gnu-build-system)
4432 `(#:imported-modules ((guix build python-build-system)
4433 ,@%gnu-build-system-modules)
4434 #:modules (((guix build python-build-system) #:select (site-packages))
4435 (guix build gnu-build-system)
4438 (modify-phases %standard-phases
4439 (add-after 'unpack 'enable-bytecode-determinism
4441 (setenv "PYTHONHASHSEED" "0")
4443 (add-after 'unpack 'fix-compatability
4444 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4446 (substitute* "src/util/mpz.cpp"
4447 (("#include <immintrin.h>") ""))
4449 (add-before 'configure 'bootstrap
4451 (invoke "python" "scripts/mk_make.py")))
4452 ;; work around gnu-build-system's setting --enable-fast-install
4453 ;; (z3's `configure' is a wrapper around the above python file,
4454 ;; which fails when passed --enable-fast-install)
4456 (lambda* (#:key inputs outputs #:allow-other-keys)
4457 (invoke "./configure"
4459 (string-append "--prefix=" (assoc-ref outputs "out"))
4460 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4461 (add-after 'configure 'change-directory
4465 (add-before 'check 'make-test-z3
4467 ;; Build the test suite executable.
4468 (invoke "make" "test-z3" "-j"
4469 (number->string (parallel-job-count)))))
4472 ;; Run all the tests that don't require arguments.
4473 (invoke "./test-z3" "/a"))))))
4476 ("python" ,python-wrapper)))
4477 (synopsis "Theorem prover")
4478 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4479 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4480 (license license:expat)))
4485 (version "2018.11.001")
4488 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4489 version "/elpa-" version ".tar.gz"))
4492 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4493 (build-system gnu-build-system)
4495 `(("fortran" ,gfortran)
4496 ("perl" ,perl))) ;for configure and deps
4498 `(("blas" ,openblas)))
4503 ;; ELPA unfortunately does not support runtime dispatch, so we can
4504 ;; only enable the "generic" kernels. See the "Cross compilation"
4505 ;; section of INSTALL.md.
4507 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4508 "--disable-avx" "--disable-avx2" "--disable-avx512"
4509 ,(string-append "CFLAGS=-O3 "
4510 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4511 "-ftree-vect-loop-version -ftree-vectorize "
4512 ,(let ((system (or (%current-target-system)
4513 (%current-system))))
4515 ((or (string-prefix? "x86_64" system)
4516 (string-prefix? "i686" system))
4519 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4521 (modify-phases %standard-phases
4522 (add-before 'configure 'patch-header-generation
4524 (substitute* "configure"
4525 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4526 (string-append & " CPP=\"$CPP\"")))
4528 (add-before 'check 'setup-tests
4530 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4531 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4532 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4533 ;; for Fortran. This also causes several tests to pass that
4534 ;; otherwise would otherwise fail with matrix size 5000; possibly
4535 ;; due to floating point tolerances that are too tight.
4536 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4537 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4538 (substitute* "Makefile"
4539 ;; Test scripts are generated, patch the shebang
4540 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4542 (home-page "http://elpa.mpcdf.mpg.de")
4543 (synopsis "Eigenvalue solvers for symmetric matrices")
4545 "The ELPA library provides efficient and scalable direct eigensolvers for
4546 symmetric matrices.")
4547 (license license:lgpl3)))
4549 (define-public elpa-openmpi
4550 (package (inherit elpa)
4551 (name "elpa-openmpi")
4554 ("scalapack" ,scalapack)
4555 ,@(package-inputs elpa)))
4557 (substitute-keyword-arguments (package-arguments elpa)
4558 ((#:configure-flags cf '())
4559 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4560 ((#:phases phases '%standard-phases)
4561 `(modify-phases ,phases
4562 (add-before 'check 'mpi-setup
4564 ;; Tests use 2 mpi tasks by default, use our remaining build
4565 ;; cores as OpenMP threads.
4566 (setenv "OMP_NUM_THREADS" (number->string
4567 (max (quotient (parallel-job-count) 2)
4569 (,%openmpi-setup)))))))
4570 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4572 (define-public elemental
4579 (url "https://github.com/elemental/Elemental.git")
4580 (commit (string-append "v" version))))
4581 (file-name (git-file-name name version))
4584 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4585 (build-system cmake-build-system)
4586 (home-page "https://github.com/elemental/Elemental")
4588 `(("gfortran" ,gfortran)))
4590 `(("blas" ,openblas)
4591 ("gfortran:lib" ,gfortran "lib")
4600 `(#:build-type "Release" ;default RelWithDebInfo not supported
4601 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4602 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4603 "-DEL_CACHE_WARNINGS:BOOL=YES"
4604 "-DEL_TESTS:BOOL=YES"
4605 "-DCMAKE_INSTALL_LIBDIR=lib"
4606 "-DGFORTRAN_LIB=gfortran")
4607 #:phases (modify-phases %standard-phases
4608 (add-before 'check 'mpi-setup
4610 (add-before 'check 'setup-tests
4612 ;; Parallelism is done at the MPI layer.
4613 (setenv "OMP_NUM_THREADS" "1")
4615 (add-after 'install 'remove-tests
4616 (lambda* (#:key outputs #:allow-other-keys)
4617 ;; Tests are installed, with no easy configuration
4618 ;; switch to prevent this, so delete them.
4619 (delete-file-recursively
4620 (string-append (assoc-ref outputs "out") "/bin"))
4622 (synopsis "Dense and sparse-direct linear algebra and optimization")
4623 (description "Elemental is a modern C++ library for distributed-memory
4624 dense and sparse-direct linear algebra, conic optimization, and lattice
4626 (license license:bsd-2)))
4628 (define-public mcrl2
4631 (version "201908.0")
4635 "https://www.mcrl2.org/download/release/mcrl2-"
4639 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4644 ("qtbase" ,qtbase)))
4645 (build-system cmake-build-system)
4646 (synopsis "Toolset for the mCRL2 formal specification language")
4648 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4649 specification language for describing concurrent discrete event systems. Its
4650 toolset supports analysis and automatic verification, linearisation, simulation,
4651 state-space exploration and generation, and tools to optimise and analyse
4652 specifications. Also, state spaces can be manipulated, visualised and
4654 (home-page "https://mcrl2.org")
4655 (license license:boost1.0)))
4657 (define-public mcrl2-minimal
4660 (name "mcrl2-minimal")
4662 `(("boost" ,boost)))
4664 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4666 (define-public tcalc
4673 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4677 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4678 (build-system gnu-build-system)
4679 (synopsis "The terminal calculator")
4681 "The terminal calculator is a small program to help users of the GNU/Linux
4682 terminal do calculations simply and quickly. The formula to be calculated can
4683 be fed to @command{tcalc} through the command line.")
4684 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4685 (license license:gpl3+)))
4687 (define-public sundials
4694 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4695 "sundials-" version ".tar.gz"))
4698 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4699 (build-system cmake-build-system)
4701 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4703 `(("fortran" ,gfortran) ;for fcmix
4705 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4707 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4708 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4709 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4710 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4711 "-DEXAMPLES_INSTALL:BOOL=OFF"
4713 "-DFCMIX_ENABLE:BOOL=ON"
4715 "-DKLU_ENABLE:BOOL=ON"
4716 ,(string-append "-DKLU_INCLUDE_DIR="
4717 (assoc-ref %build-inputs "suitesparse")
4719 ,(string-append "-DKLU_LIBRARY_DIR="
4720 (assoc-ref %build-inputs "suitesparse")
4722 (home-page "https://computation.llnl.gov/projects/sundials")
4723 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4724 (description "SUNDIALS is a family of software packages implemented with
4725 the goal of providing robust time integrators and nonlinear solvers that can
4726 easily be incorporated into existing simulation codes.")
4727 (license license:bsd-3)))
4729 (define-public sundials-openmpi
4730 (package (inherit sundials)
4731 (name "sundials-openmpi")
4734 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4735 ,@(package-inputs sundials)))
4737 (substitute-keyword-arguments (package-arguments sundials)
4738 ((#:configure-flags flags '())
4739 `(cons* "-DMPI_ENABLE:BOOL=ON"
4740 "-DPETSC_ENABLE:BOOL=ON"
4741 (string-append "-DPETSC_INCLUDE_DIR="
4742 (assoc-ref %build-inputs "petsc")
4744 (string-append "-DPETSC_LIBRARY_DIR="
4745 (assoc-ref %build-inputs "petsc")
4748 ((#:phases phases '%standard-phases)
4749 `(modify-phases ,phases
4750 (add-before 'check 'mpi-setup
4751 ,%openmpi-setup)))))
4752 (synopsis "SUNDIALS with OpenMPI support")))
4754 (define-public combinatorial-blas
4756 (name "combinatorial-blas")
4761 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4763 (match (string-split version #\.)
4764 ((major minor patch)
4765 (string-append major minor "_" patch))) ;e.g. "16_2"
4769 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4770 (patches (search-patches "combinatorial-blas-awpm.patch"
4771 "combinatorial-blas-io-fix.patch"))))
4772 (build-system cmake-build-system)
4775 ("test-data" ,(origin
4777 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4778 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4781 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4783 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4784 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4785 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4787 (modify-phases %standard-phases
4788 (add-before 'check 'mpi-setup
4790 (add-before 'check 'test-setup
4791 (lambda* (#:key inputs #:allow-other-keys)
4792 (setenv "OMP_NUM_THREADS" "2")
4793 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4794 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4795 (synopsis "Linear algebra primitives for graph analytics")
4796 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4797 distributed-memory parallel graph library offering a small but powerful set of
4798 linear algebra primitives specifically targeting graph analytics.")
4800 license:gpl2+ ;include/psort/(funnel|sort)*.h
4801 license:x11 ;usort and psort
4802 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4804 (define-public dune-common
4806 (name "dune-common")
4811 (uri (string-append "https://dune-project.org/download/"
4812 version "/dune-common-" version ".tar.gz"))
4815 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
4816 (build-system cmake-build-system)
4819 (modify-phases %standard-phases
4820 (add-after 'build 'build-tests
4821 (lambda* (#:key make-flags #:allow-other-keys)
4822 (apply invoke "make" "build_tests" make-flags))))))
4826 ("openblas" ,openblas)
4828 ("superlu" ,superlu)))
4830 `(("gfortran" ,gfortran)
4831 ("pkg-config" ,pkg-config)))
4832 (home-page "https://dune-project.org/")
4833 (synopsis "Distributed and Unified Numerics Environment")
4834 (description "DUNE, the Distributed and Unified Numerics Environment is a
4835 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4836 grid-based methods. It supports the easy implementation of methods like
4837 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4838 Differences} (FD).")
4839 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4840 (license license:gpl2)))
4842 (define-public dune-geometry
4844 (name "dune-geometry")
4849 (uri (string-append "https://dune-project.org/download/"
4850 version "/dune-geometry-" version ".tar.gz"))
4853 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
4854 (build-system cmake-build-system)
4857 (modify-phases %standard-phases
4858 (add-after 'build 'build-tests
4859 (lambda* (#:key make-flags #:allow-other-keys)
4860 (apply invoke "make" "build_tests" make-flags))))))
4862 `(("dune-common" ,dune-common)
4864 ("openblas" ,openblas)
4866 ("python" ,python)))
4868 `(("gfortran" ,gfortran)
4869 ("pkg-config" ,pkg-config)))
4870 (home-page "https://dune-project.org/")
4871 (synopsis "Distributed and Unified Numerics Environment")
4872 (description "DUNE, the Distributed and Unified Numerics Environment is a
4873 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4874 grid-based methods. It supports the easy implementation of methods like
4875 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4878 This package contains the basic DUNE geometry classes.")
4879 ;; GPL version 2 with "runtime exception"
4880 (license license:gpl2)))
4882 (define-public dune-uggrid
4884 (name "dune-uggrid")
4890 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
4891 (commit (string-append "v" version))))
4892 (file-name (git-file-name name version))
4895 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
4896 (build-system cmake-build-system)
4899 (modify-phases %standard-phases
4900 (add-after 'build 'build-tests
4901 (lambda* (#:key make-flags #:allow-other-keys)
4902 (apply invoke "make" "build_tests" make-flags))))))
4904 `(("dune-common" ,dune-common)))
4906 `(("gfortran" ,gfortran)
4907 ("pkg-config" ,pkg-config)))
4908 (home-page "https://dune-project.org/")
4909 (synopsis "Distributed and Unified Numerics Environment")
4910 (description "DUNE, the Distributed and Unified Numerics Environment is a
4911 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4912 grid-based methods. It supports the easy implementation of methods like
4913 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4916 This package contains the DUNE UG grid classes.")
4917 (license license:lgpl2.1)))
4919 (define-public dune-grid
4926 (uri (string-append "https://dune-project.org/download/"
4927 version "/dune-grid-" version ".tar.gz"))
4930 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
4931 (build-system cmake-build-system)
4934 (modify-phases %standard-phases
4935 (add-after 'build 'build-tests
4936 (lambda* (#:key make-flags #:allow-other-keys)
4937 (apply invoke "make" "build_tests" make-flags))))))
4939 `(("dune-common" ,dune-common)
4940 ("dune-geometry" ,dune-geometry)
4943 ("openblas" ,openblas)
4944 ("python" ,python)))
4946 `(("dune-uggrid" ,dune-uggrid)))
4948 `(("gfortran" ,gfortran)
4949 ("pkg-config" ,pkg-config)))
4950 (home-page "https://dune-project.org/")
4951 (synopsis "Distributed and Unified Numerics Environment")
4952 (description "DUNE, the Distributed and Unified Numerics Environment is a
4953 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4954 grid-based methods. It supports the easy implementation of methods like
4955 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4958 This package contains the basic DUNE grid classes.")
4959 ;; GPL version 2 with "runtime exception"
4960 (license license:gpl2)))
4962 (define-public dune-istl
4969 (uri (string-append "https://dune-project.org/download/"
4970 version "/dune-istl-" version ".tar.gz"))
4973 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
4974 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
4975 (build-system cmake-build-system)
4978 (modify-phases %standard-phases
4979 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
4980 ;; the stdlib types when the gfortran header is used. Remove gfortran
4981 ;; from CPLUS_INCLUDE_PATH as a workaround.
4982 (add-after 'set-paths 'hide-gfortran
4983 (lambda* (#:key inputs #:allow-other-keys)
4984 (let ((gfortran (assoc-ref inputs "gfortran")))
4985 (setenv "CPLUS_INCLUDE_PATH"
4987 (delete (string-append gfortran "/include/c++")
4988 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
4991 (add-after 'build 'build-tests
4992 (lambda* (#:key make-flags #:allow-other-keys)
4993 (apply invoke "make" "build_tests" make-flags))))))
4995 `(("dune-common" ,dune-common)
4998 ("suitesparse" ,suitesparse)
4999 ("superlu" ,superlu)
5000 ("openblas" ,openblas)
5002 ("python" ,python)))
5004 `(("gfortran" ,gfortran)
5005 ("pkg-config" ,pkg-config)))
5006 (home-page "https://dune-project.org/")
5007 (synopsis "Distributed and Unified Numerics Environment")
5008 (description "DUNE, the Distributed and Unified Numerics Environment is a
5009 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5012 This is the iterative solver template library which provides generic sparse
5013 matrix/vector classes and a variety of solvers based on these classes. A
5014 special feature is the use of templates to exploit the recursive block
5015 structure of finite element matrices at compile time. Available solvers
5016 include Krylov methods, (block-) incomplete decompositions and
5017 aggregation-based algebraic multigrid.")
5018 ;; GPL version 2 with "runtime exception"
5019 (license license:gpl2)))
5021 (define-public dune-localfunctions
5023 (name "dune-localfunctions")
5028 (uri (string-append "https://dune-project.org/download/"
5029 version "/dune-localfunctions-" version ".tar.gz"))
5032 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5033 (build-system cmake-build-system)
5036 (modify-phases %standard-phases
5037 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5038 ;; and fails to find the stdlib types when the gfortran header is used.
5039 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5040 (add-after 'set-paths 'hide-gfortran
5041 (lambda* (#:key inputs #:allow-other-keys)
5042 (let ((gfortran (assoc-ref inputs "gfortran")))
5043 (setenv "CPLUS_INCLUDE_PATH"
5045 (delete (string-append gfortran "/include/c++")
5046 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5049 (add-after 'build 'build-tests
5050 (lambda* (#:key make-flags #:allow-other-keys)
5051 (apply invoke "make" "build_tests" make-flags))))))
5053 `(("dune-common" ,dune-common)
5054 ("dune-geometry" ,dune-geometry)
5057 ("superlu" ,superlu)
5060 `(("gfortran" ,gfortran)
5061 ("pkg-config" ,pkg-config)))
5062 (home-page "https://dune-project.org/")
5063 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5064 (description "This DUNE module provides interface and implementation for
5065 shape functions defined on the DUNE reference elements. In addition to the
5066 shape function, interpolation operators and special keys are provided which
5067 can be used to assemble global function spaces on finite-element grids.
5069 This package provides an interface and implementation for shape functions
5070 defined on the DUNE reference elements. In addition to the shape function,
5071 interpolation operators and special keys are provided which can be used to
5072 assemble global function spaces on finite-element grids.")
5073 ;; GPL version 2 with "runtime exception"
5074 (license license:gpl2)))
5076 (define-public dune-alugrid
5078 (name "dune-alugrid")
5079 (version "2.7.0-git-81d35682")
5084 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5085 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5086 (file-name (git-file-name name version))
5089 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5090 (build-system cmake-build-system)
5093 (modify-phases %standard-phases
5094 (add-after 'unpack 'patch-include
5096 (substitute* "dune/alugrid/test/test-alugrid.cc"
5097 (("doc/grids/gridfactory/testgrids")
5098 "doc/dune-grid/grids/gridfactory/testgrids"))
5100 (add-after 'build 'build-tests
5101 (lambda* (#:key inputs make-flags #:allow-other-keys)
5102 (setenv "CPLUS_INCLUDE_PATH"
5103 (string-append (assoc-ref inputs "dune-grid") "/share"))
5104 (apply invoke "make" "build_tests" make-flags))))))
5106 `(("dune-common" ,dune-common)
5107 ("dune-geometry" ,dune-geometry)
5108 ("dune-grid" ,dune-grid)
5111 ("openblas" ,openblas)
5113 ("superlu" ,superlu)
5117 `(("gfortran" ,gfortran)
5118 ("pkg-config" ,pkg-config)))
5119 (home-page "https://dune-project.org/")
5120 (synopsis "Distributed and Unified Numerics Environment")
5121 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5122 implementation of the DUNE grid interface supporting either simplices or
5124 (license license:gpl2+)))
5126 (define-public dune-subgrid
5128 (name "dune-subgrid")
5129 (version "2.7.0-git-2103a363")
5134 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5135 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5136 (file-name (git-file-name name version))
5139 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5140 (build-system cmake-build-system)
5143 (modify-phases %standard-phases
5144 (add-after 'build 'build-tests
5145 (lambda* (#:key make-flags #:allow-other-keys)
5146 (apply invoke "make" "build_tests" make-flags))))))
5148 `(("dune-common" ,dune-common)
5149 ("dune-geometry" ,dune-geometry)
5150 ("dune-grid" ,dune-grid)
5153 ("openblas" ,openblas)
5156 `(("gfortran" ,gfortran)
5157 ("pkg-config" ,pkg-config)))
5158 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5159 (synopsis "Distributed and Unified Numerics Environment")
5160 (description "The dune-subgrid module marks elements of
5161 another hierarchical dune grid. The set of marked elements can then be
5162 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5163 provides the full grid interface including adaptive mesh refinement.")
5164 (license license:gpl2+)))
5166 (define-public dune-typetree
5168 (name "dune-typetree")
5174 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5175 (commit (string-append "v" version))))
5176 (file-name (git-file-name name version))
5179 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5180 (build-system cmake-build-system)
5183 (modify-phases %standard-phases
5184 (add-after 'build 'build-tests
5185 (lambda* (#:key make-flags #:allow-other-keys)
5186 (apply invoke "make" "build_tests" make-flags))))))
5188 `(("dune-common" ,dune-common)
5190 ("openblas" ,openblas)
5193 ("superlu" ,superlu)
5196 `(("gfortran" ,gfortran)
5197 ("pkg-config" ,pkg-config)))
5198 (home-page "https://dune-project.org/")
5199 (synopsis "Distributed and Unified Numerics Environment")
5200 (description "TypeTree is a template library for constructing and
5201 operating on statically typed trees of objects.")
5202 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5203 (license (list license:lgpl3+ license:gpl2))))
5205 (define-public dune-functions
5207 (name "dune-functions")
5213 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5214 (commit (string-append "v" version))))
5215 (file-name (git-file-name name version))
5218 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5219 (build-system cmake-build-system)
5222 (modify-phases %standard-phases
5223 (add-after 'unpack 'disable-failing-tests
5226 ;; unable to load GMSH file in this test
5227 "--exclude-regex gridviewfunctionspacebasistest")
5229 (add-after 'build 'build-tests
5230 (lambda* (#:key make-flags #:allow-other-keys)
5231 (apply invoke "make" "build_tests" make-flags))))))
5233 `(("dune-common" ,dune-common)
5234 ("dune-istl" ,dune-istl)
5235 ("dune-localfunctions" ,dune-localfunctions)
5236 ("dune-grid" ,dune-grid)
5237 ("dune-geometry" ,dune-geometry)
5238 ("dune-typetree" ,dune-typetree)
5239 ("openblas" ,openblas)
5242 ("superlu" ,superlu)
5245 `(("gfortran" ,gfortran)
5246 ("pkg-config" ,pkg-config)))
5247 (home-page "https://dune-project.org/")
5248 (synopsis "Distributed and Unified Numerics Environment")
5249 (description "The dune-functions module provides an abstraction layer for
5250 global finite element functions. Its two main concepts are functions
5251 implemented as callable objects, and bases of finite element spaces.")
5252 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5253 (license (list license:lgpl3+ license:gpl2))))
5255 (define-public dune-pdelab
5257 (name "dune-pdelab")
5258 (version "2.7.0-git-476fe437")
5263 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5264 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5265 (file-name (git-file-name name version))
5268 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5269 (build-system cmake-build-system)
5270 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5272 `(("dune-common" ,dune-common)
5273 ("dune-istl" ,dune-istl)
5274 ("dune-localfunctions" ,dune-localfunctions)
5275 ("dune-geometry" ,dune-geometry)
5276 ("dune-grid" ,dune-grid)
5277 ("dune-typetree" ,dune-typetree)
5278 ("dune-functions" ,dune-functions)
5280 ("openblas" ,openblas)
5284 ("superlu" ,superlu)
5287 `(("gfortran" ,gfortran)
5288 ("pkg-config" ,pkg-config)))
5289 (home-page "https://dune-project.org/")
5290 (synopsis "Differential equations solver toolbox")
5291 (description "PDELab is a partial differential equations solver toolbox
5292 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5293 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5294 (license (list license:lgpl3+ license:gpl2))))
5296 (define add-openmpi-to-dune-package
5297 (let ((dune-package?
5298 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5301 (if (dune-package? p)
5302 (package (inherit p)
5303 (name (string-append (package-name p) "-openmpi"))
5304 (inputs `(,@(package-inputs p)
5305 ("openmpi" ,openmpi)))
5307 (substitute-keyword-arguments (package-arguments p)
5308 ((#:phases phases '%standard-phases)
5309 `(modify-phases ,phases
5310 (add-before 'check 'mpi-setup
5311 ,%openmpi-setup)))))
5312 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5314 (negate dune-package?))))
5316 (define-public dune-common-openmpi
5317 (add-openmpi-to-dune-package dune-common))
5319 (define-public dune-geometry-openmpi
5320 (add-openmpi-to-dune-package dune-geometry))
5322 (define-public dune-istl-openmpi
5323 (add-openmpi-to-dune-package dune-istl))
5325 (define-public dune-typetree-openmpi
5326 (add-openmpi-to-dune-package dune-typetree))
5328 (define-public dune-uggrid-openmpi
5329 (add-openmpi-to-dune-package dune-uggrid))
5331 (define-public dune-grid-openmpi
5332 (add-openmpi-to-dune-package dune-grid))
5334 (define-public dune-alugrid-openmpi
5335 (add-openmpi-to-dune-package dune-alugrid))
5337 (define-public dune-subgrid-openmpi
5338 (add-openmpi-to-dune-package dune-subgrid))
5340 (define-public dune-localfunctions-openmpi
5341 (add-openmpi-to-dune-package dune-localfunctions))
5343 (define-public dune-functions-openmpi
5344 (add-openmpi-to-dune-package dune-functions))
5346 (define-public dune-pdelab-openmpi
5347 (add-openmpi-to-dune-package dune-pdelab))
5349 (define-public mlucas
5357 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5359 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5360 (build-system gnu-build-system)
5362 `(("python2" ,python-2)))
5364 `(#:tests? #f ; no tests
5366 (modify-phases %standard-phases
5370 (call-with-output-file "Makefile"
5372 (format port "CC = gcc
5373 CFLAGS = -O3 ~a -DUSE_THREADS
5374 LDLIBS = -lm -lpthread -lrt
5375 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5377 ,(let ((system (or (%current-target-system)
5378 (%current-system))))
5380 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5384 (lambda* (#:key outputs #:allow-other-keys)
5385 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5386 (install-file "Mlucas" bin)
5387 (install-file "primenet.py" bin))
5389 (home-page "https://www.mersenne.org")
5390 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5391 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5392 numbers in search of a world-record prime. You may use it to test any
5393 suitable number as you wish, but it is preferable that you do so in a
5394 coordinated fashion, as part of the Great Internet Mersenne Prime
5395 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5396 management via the GIMPS project's Primenet server.")
5397 (license license:gpl2+)))
5399 (define-public nauty
5407 "https://pallini.di.uniroma1.it/"
5408 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5410 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5411 (build-system gnu-build-system)
5412 (outputs '("out" "lib"))
5414 `(#:test-target "checks"
5415 #:configure-flags '("--enable-generic") ;prevent -march-native
5417 (modify-phases %standard-phases
5418 ;; Default make target does not build all available
5419 ;; executables. Create them now.
5420 (add-after 'build 'build-extra-programs
5422 (for-each (lambda (target) (invoke "make" target))
5423 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5425 ;; Upstream does not provide any install target.
5427 (lambda* (#:key outputs #:allow-other-keys)
5428 (let* ((out (assoc-ref outputs "out"))
5429 (lib-output (assoc-ref outputs "lib"))
5430 (bin (string-append out "/bin"))
5431 (doc (string-append out "/share/doc/nauty/"))
5432 (include (string-append lib-output "/include/nauty"))
5433 (lib (string-append lib-output "/lib/nauty")))
5434 (for-each (lambda (f) (install-file f bin))
5435 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5436 "bliss2dre" "catg" "checks6" "complg" "converseg"
5437 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5438 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5439 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5440 "gentourng" "gentreeg" "hamheuristic" "labelg"
5441 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5442 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5443 "sumlines" "twohamg" "underlyingg" "vcolg"
5444 "watercluster2" "NRswitchg"))
5445 (for-each (lambda (f) (install-file f include))
5446 (find-files "." "\\.h$"))
5447 (for-each (lambda (f) (install-file f lib))
5448 (find-files "." "\\.a$"))
5449 (for-each (lambda (f) (install-file f doc))
5450 (append '("formats.txt" "README" "schreier.txt")
5451 (find-files "." "\\.pdf$")))))))))
5453 `(("gmp" ,gmp))) ;for sumlines
5454 (home-page "https://pallini.di.uniroma1.it/")
5455 (synopsis "Library for graph automorphisms")
5456 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5457 procedures for computing automorphism groups of graphs and digraphs.
5459 @code{nauty} computes graph information in the form of a set of
5460 generators, the size of the group, and the orbits of the group; it can
5461 also produce a canonical label. The @code{nauty} suite is written in
5462 C and comes with a command-line interface, a collection of
5463 command-line tools, and an Application Programming Interface (API).
5465 This package provides the static libraries required to run programs
5466 compiled against the nauty library.")
5467 (license license:asl2.0)))
5476 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5477 "ftp/releases/" version
5478 "/ppl-" version ".tar.gz"))
5481 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5482 (build-system gnu-build-system)
5488 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5490 "Parma Polyhedra Library for computations with polyhedra")
5492 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5493 especially targeted at applications in the field of analysis and
5494 verification of complex systems. These abstractions include convex
5495 polyhedra, defined as the intersection of a finite number of (open or
5496 closed) halfspaces, each described by a linear inequality (strict or
5497 non-strict) with rational coefficients; some special classes of polyhedra
5498 shapes that offer interesting complexity/precision tradeoffs; and grids
5499 which represent regularly spaced points that satisfy a set of linear
5500 congruence relations. The library also supports finite powersets and
5501 products of (any kind of) polyhedra and grids, a mixed integer linear
5502 programming problem solver using an exact-arithmetic version of the simplex
5503 algorithm, a parametric integer programming solver, and primitives for
5504 termination analysis via the automatic synthesis of linear ranking
5506 (license license:gpl3+)))
5508 (define-public speedcrunch
5510 (name "speedcrunch")
5516 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5517 (commit (string-append "release-" version))))
5518 (file-name (git-file-name name version))
5521 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5522 (build-system cmake-build-system)
5523 (inputs `(("qtbase" ,qtbase)))
5524 (native-inputs `(("qttools" ,qttools)))
5527 (modify-phases %standard-phases
5528 (add-after 'unpack 'chdir-to-src
5529 (lambda _ (chdir "src") #t)))))
5530 (synopsis "High-precision scientific calculator")
5532 "SpeedCrunch is a high-precision scientific calculator. It features a
5533 syntax-highlighted scrollable display and is designed to be fully used via
5534 keyboard. Some distinctive features are auto-completion of functions and
5535 variables, a formula book, and quick insertion of constants from various
5536 fields of knowledge.")
5537 (home-page "https://speedcrunch.org/")
5538 (license license:gpl2+)))
5540 (define-public minisat
5541 ;; This is the last commit which is available upstream, no
5542 ;; release happened since 2010.
5543 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5547 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5552 (url "https://github.com/niklasso/minisat.git")
5554 (file-name (string-append name "-" version "-checkout"))
5557 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5559 (search-patches "minisat-friend-declaration.patch"
5560 "minisat-install.patch"))))
5561 (build-system gnu-build-system)
5563 '(#:make-flags (list (string-append "prefix=" %output))
5564 #:tests? #f ;no check target
5566 (modify-phases %standard-phases
5567 (delete 'configure))))
5569 `(("zlib:static" ,zlib "static")
5572 "Small, yet efficient, SAT solver")
5574 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5575 researchers and developers alike to get started on SAT.")
5577 "http://minisat.se/MiniSat.html")
5578 (license license:expat))))
5580 (define-public libqalculate
5582 (name "libqalculate")
5588 (url "https://github.com/Qalculate/libqalculate/")
5589 (commit (string-append "v" version))))
5590 (file-name (git-file-name name version))
5592 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5594 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5595 (build-system gnu-build-system)
5597 `(("pkg-config" ,pkg-config)
5598 ("gettext" ,gettext-minimal)
5599 ("intltool" ,intltool)
5600 ("automake" ,automake)
5601 ("autoconf" ,autoconf)
5602 ("libtool" ,libtool)
5603 ("doxygen" ,doxygen)
5608 ("libxml2" ,libxml2)
5611 ("gnuplot" ,gnuplot)
5612 ("readline" ,readline)
5613 ("libiconv" ,libiconv)))
5616 (modify-phases %standard-phases
5617 (add-before 'bootstrap 'setenv
5618 ;; Prevent the autogen.sh script to carry out the configure
5619 ;; script, which has not yet been patched to replace /bin/sh.
5621 (setenv "NOCONFIGURE" "TRUE")
5623 (home-page "https://qalculate.github.io/")
5624 (synopsis "Multi-purpose cli desktop calculator and library")
5626 "Libqalculate is a multi-purpose cli desktop calculator and library.
5627 It provides basic and advanced functionality. Features include customizable
5628 functions, unit calculations, and conversions, physical constants, symbolic
5629 calculations (including integrals and equations), arbitrary precision,
5630 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5632 (license license:gpl2+)))
5634 (define-public qalculate-gtk
5636 (name "qalculate-gtk")
5642 (url "https://github.com/Qalculate/qalculate-gtk/")
5643 (commit (string-append "v" version))))
5644 (file-name (git-file-name name version))
5646 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5647 (build-system glib-or-gtk-build-system)
5649 `(("pkg-config" ,pkg-config)
5650 ("intltool" ,intltool)
5651 ("automake" ,automake)
5652 ("autoconf" ,autoconf)
5653 ("libtool" ,libtool)
5658 ("libqalculate" ,libqalculate)
5659 ("libxml2" ,libxml2)
5664 (modify-phases %standard-phases
5665 (add-before 'bootstrap 'setenv
5666 ;; Prevent the autogen.sh script to carry out the configure
5667 ;; script, which has not yet been patched to replace /bin/sh.
5669 (setenv "NOCONFIGURE" "TRUE")
5671 (add-before 'check 'add-pot-file
5672 ;; the file contains translations and are currently not in use
5673 ;; left out on purpose so add it to POTFILES.skip
5675 (with-output-to-file "po/POTFILES.skip"
5677 (format #t "data/shortcuts.ui~%")
5680 (home-page "https://qalculate.github.io/")
5681 (synopsis "Multi-purpose graphical desktop calculator")
5683 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5684 multi-purpose GUI desktop calculator. It provides basic and advanced
5685 functionality. Features include customizable functions, unit calculations,
5686 and conversions, physical constants, symbolic calculations (including
5687 integrals and equations), arbitrary precision, uncertainity propagation,
5688 interval arithmetic, plotting.")
5689 (license license:gpl2+)))