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, 2021 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–2021 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, 2021 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, 2021 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 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, 2021 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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) 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, 2021 Marius Bakke <marius@gnu.org>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019, 2021 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, 2021 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
41 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
42 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
43 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
44 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
45 ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
46 ;;; Copyright © 2021 Franck Pérignon <franck.perignon@univ-grenoble-alpes.fr>
47 ;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
48 ;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
49 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
50 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
51 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
53 ;;; This file is part of GNU Guix.
55 ;;; GNU Guix is free software; you can redistribute it and/or modify it
56 ;;; under the terms of the GNU General Public License as published by
57 ;;; the Free Software Foundation; either version 3 of the License, or (at
58 ;;; your option) any later version.
60 ;;; GNU Guix is distributed in the hope that it will be useful, but
61 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
62 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63 ;;; GNU General Public License for more details.
65 ;;; You should have received a copy of the GNU General Public License
66 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
68 (define-module (gnu packages maths)
69 #:use-module (ice-9 regex)
70 #:use-module (ice-9 match)
71 #:use-module (gnu packages)
72 #:use-module ((guix licenses) #:prefix license:)
73 #:use-module (guix packages)
74 #:use-module (guix download)
75 #:use-module (guix git-download)
76 #:use-module (guix gexp)
77 #:use-module (guix utils)
78 #:use-module ((guix build utils) #:select (alist-replace))
79 #:use-module (guix build-system cmake)
80 #:use-module (guix build-system glib-or-gtk)
81 #:use-module (guix build-system gnu)
82 #:use-module (guix build-system meson)
83 #:use-module (guix build-system ocaml)
84 #:use-module (guix build-system perl)
85 #:use-module (guix build-system python)
86 #:use-module (guix build-system ruby)
87 #:use-module (gnu packages algebra)
88 #:use-module (gnu packages audio)
89 #:use-module (gnu packages autotools)
90 #:use-module (gnu packages base)
91 #:use-module (gnu packages bash)
92 #:use-module (gnu packages bison)
93 #:use-module (gnu packages boost)
94 #:use-module (gnu packages check)
95 #:use-module (gnu packages cmake)
96 #:use-module (gnu packages compression)
97 #:use-module (gnu packages coq)
98 #:use-module (gnu packages curl)
99 #:use-module (gnu packages cyrus-sasl)
100 #:use-module (gnu packages datamash)
101 #:use-module (gnu packages dbm)
102 #:use-module (gnu packages documentation)
103 #:use-module (gnu packages elf)
104 #:use-module (gnu packages emacs)
105 #:use-module (gnu packages file)
106 #:use-module (gnu packages flex)
107 #:use-module (gnu packages fltk)
108 #:use-module (gnu packages fontutils)
109 #:use-module (gnu packages gettext)
110 #:use-module (gnu packages gcc)
111 #:use-module (gnu packages gd)
112 #:use-module (gnu packages ghostscript)
113 #:use-module (gnu packages glib)
114 #:use-module (gnu packages graphviz)
115 #:use-module (gnu packages gtk)
116 #:use-module (gnu packages icu4c)
117 #:use-module (gnu packages image)
118 #:use-module (gnu packages java)
119 #:use-module (gnu packages less)
120 #:use-module (gnu packages lisp)
121 #:use-module (gnu packages linux)
122 #:use-module (gnu packages llvm)
123 #:use-module (gnu packages logging)
124 #:use-module (gnu packages lua)
125 #:use-module (gnu packages gnome)
126 #:use-module (gnu packages guile)
127 #:use-module (gnu packages xorg)
128 #:use-module (gnu packages gl)
129 #:use-module (gnu packages imagemagick)
130 #:use-module (gnu packages m4)
131 #:use-module (gnu packages mpi)
132 #:use-module (gnu packages multiprecision)
133 #:use-module (gnu packages ncurses)
134 #:use-module (gnu packages netpbm)
135 #:use-module (gnu packages ocaml)
136 #:use-module (gnu packages onc-rpc)
137 #:use-module (gnu packages parallel)
138 #:use-module (gnu packages pcre)
139 #:use-module (gnu packages popt)
140 #:use-module (gnu packages perl)
141 #:use-module (gnu packages pkg-config)
142 #:use-module (gnu packages pulseaudio)
143 #:use-module (gnu packages python)
144 #:use-module (gnu packages python-web)
145 #:use-module (gnu packages python-xyz)
146 #:use-module (gnu packages qt)
147 #:use-module (gnu packages readline)
148 #:use-module (gnu packages ruby)
149 #:use-module (gnu packages tbb)
150 #:use-module (gnu packages scheme)
151 #:use-module (gnu packages serialization)
152 #:use-module (gnu packages shells)
153 #:use-module (gnu packages sphinx)
154 #:use-module (gnu packages tcl)
155 #:use-module (gnu packages texinfo)
156 #:use-module (gnu packages tex)
157 #:use-module (gnu packages tls)
158 #:use-module (gnu packages version-control)
159 #:use-module (gnu packages wxwidgets)
160 #:use-module (gnu packages xml)
161 #:use-module (srfi srfi-1)
162 #:use-module (srfi srfi-26))
170 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
172 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
173 (build-system gnu-build-system)
174 (inputs (list gtk+ libxml2))
175 (native-inputs (list pkg-config))
177 `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
178 (synopsis "Natural deduction first-order logic interface")
179 (description "Aris is a program for performing logical proofs. It supports
180 propositional and predicate logic, as well as Boolean algebra and
181 arithmetical logic. In addition to its predefined inference and equivalence
182 rules, Aris also supports references to older proofs. Its use of standard
183 logical symbols and its natural deduction interface make it easy to use for
185 (license license:gpl3+)
186 (home-page "https://www.gnu.org/software/aris/")))
188 (define-public bitwise
194 (uri (string-append "https://github.com/mellowcandle/bitwise"
195 "/releases/download/v" version
196 "/bitwise-v" version ".tar.gz"))
198 (base32 "1lniw4bsb5qs5ybf018qllf95pzixb1q3lvybzl4k3xz8zpkrm6k"))))
199 (build-system gnu-build-system)
201 (list ncurses readline))
203 (list cunit pkg-config))
204 (synopsis "Terminal based bit manipulator in ncurses")
205 (description "Bitwise is a multi base interactive calculator supporting
206 dynamic base conversion and bit manipulation. It's a handy tool for low level
207 hackers, kernel developers and device drivers developers.
209 Some of the features include:
211 @item Interactive ncurses interface.
212 @item Command line calculator supporting all bitwise operations.
213 @item Individual bit manipulator.
214 @item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
216 (license license:gpl3+)
217 (home-page "https://github.com/mellowcandle/bitwise/")))
219 (define-public c-graph
225 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
228 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
229 (build-system gnu-build-system)
232 (synopsis "Visualizing and demonstrating convolution")
234 "GNU C-Graph is a tool for demonstrating the theory of convolution.
235 Thus, it can serve as an excellent aid to students of signal and systems
236 theory in visualizing the convolution process. Rather than forcing the
237 student to write code, the program offers an intuitive interface with
238 interactive dialogs to guide them.")
239 (license license:gpl3+)
240 (home-page "https://www.gnu.org/software/c-graph/")))
249 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
250 version "/coda-" version ".tar.gz"))
252 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
253 (patches (search-patches "coda-use-system-libs.patch"))
254 (modules '((guix build utils)))
256 ;; Make sure we don't use the bundled software.
258 (for-each (lambda (d)
259 (delete-file-recursively (string-append "libcoda/" d)))
260 '("zlib" "pcre" "expat"))
263 `(("fortran" ,gfortran)
265 ("python-numpy" ,python-numpy)))
272 (build-system gnu-build-system)
274 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
275 "LIBS= -lz -lpcre -lexpat")))
276 (synopsis "Common interface to various earth observation data formats")
278 "The Common Data Access toolbox (CODA) provides a set of interfaces for
279 reading remote sensing data from earth observation data files. It consists of
280 command line applications and interfaces to the C, Fortran, Python, and Java
281 programming languages.")
282 (home-page "https://stcorp.nl/coda")
283 (license license:gpl2+)))
291 (uri (string-append "http://www.qhull.org/download/qhull-"
292 (car (string-split version #\.))
296 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
297 (build-system cmake-build-system)
299 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
300 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
301 (synopsis "Calculate convex hulls and related structures")
303 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
304 diagram, halfspace intersection about a point, furthest-site Delaunay
305 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
306 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
307 algorithm for computing the convex hull. It handles roundoff errors from
308 floating point arithmetic. It computes volumes, surface areas, and
309 approximations to the convex hull.
311 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
312 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
313 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
315 (home-page "http://qhull.org")
316 (license (license:non-copyleft "file://COPYING.txt"
317 "See COPYING in the distribution."))))
319 (define-public python-cvxopt
321 (name "python-cvxopt")
326 (url "https://github.com/cvxopt/cvxopt")
328 (file-name (git-file-name name version))
331 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
332 (build-system python-build-system)
335 (modify-phases %standard-phases
336 (add-after 'unpack 'find-libraries
337 (lambda* (#:key inputs #:allow-other-keys)
338 (setenv "CVXOPT_BLAS_LIB" "openblas")
339 (setenv "CVXOPT_BUILD_FFTW" "1")
340 (setenv "CVXOPT_BUILD_GLPK" "1")
341 (setenv "CVXOPT_BUILD_GSL" "1")
350 (home-page "https://www.cvxopt.org")
351 (synopsis "Python library for convex optimization")
353 "CVXOPT is a package for convex optimization based on the Python
354 programming language. Its main purpose is to make the development of software
355 for convex optimization applications straightforward by building on Python’s
356 extensive standard library and on the strengths of Python as a high-level
357 programming language.")
358 (license license:gpl3+)))
360 (define-public python2-cvxopt
361 (package-with-python2 python-cvxopt))
369 (uri (string-append "mirror://gnu/units/units-" version
372 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
373 (build-system gnu-build-system)
375 `(("readline" ,readline)
376 ("python" ,python-wrapper) ;for 'units_cur' script
377 ("python-requests" ,python-requests)))
379 `(#:phases (modify-phases %standard-phases
380 (add-after 'install 'wrap-units_cur
381 (lambda* (#:key outputs #:allow-other-keys)
382 (let* ((out (assoc-ref outputs "out"))
383 (bin (string-append out "/bin")))
384 (wrap-program (string-append bin "/units_cur")
385 `("GUIX_PYTHONPATH" ":" prefix
386 ,(search-path-as-string->list (getenv "GUIX_PYTHONPATH"))))
388 (synopsis "Conversion between thousands of scales")
390 "GNU Units converts numeric quantities between units of measure. It
391 can handle scale changes through adaptive usage of standard scale
392 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
393 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
394 enough to be used effectively as a scientific calculator.")
395 (license license:gpl3+)
396 (home-page "https://www.gnu.org/software/units/")))
398 (define-public double-conversion
400 (name "double-conversion")
402 (home-page "https://github.com/google/double-conversion")
405 (uri (git-reference (url home-page)
406 (commit (string-append "v" version))))
407 (file-name (git-file-name name version))
410 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
411 (build-system cmake-build-system)
413 '(#:test-target "test"
414 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
415 "-DBUILD_TESTING=ON")))
416 (synopsis "Conversion routines for IEEE doubles")
418 "The double-conversion library provides binary-decimal and decimal-binary
419 routines for IEEE doubles. The library consists of efficient conversion
420 routines that have been extracted from the V8 JavaScript engine.")
421 (license license:bsd-3)))
423 (define-public dionysus
429 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
433 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
434 (build-system gnu-build-system)
435 (inputs (list tcl)) ;for 'tclsh'
436 (synopsis "Local search for universal constants and scientific values")
438 "GNU Dionysus is a convenient system for quickly retrieving the values of
439 mathematical constants used in science and engineering. Values can be
440 searched using a simple command-line tool, choosing from three databases:
441 universal constants, atomic numbers, and constants related to
443 (license license:gpl3+)
444 (home-page "https://www.gnu.org/software/dionysus/")))
455 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
456 "dSFMT-src-" version ".tar.gz"))
459 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
460 (modules '((guix build utils)))
461 ;; Don't distribute html documentation with bundled jquery.
464 (delete-file-recursively "html") #t))
465 ;; Add patches borrowed from Julia.
471 "https://raw.githubusercontent.com/JuliaLang/julia/"
472 "v1.3.0/deps/patches/dSFMT.c.patch"))
474 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
475 (file-name "dSFMT.c.patch"))
479 "https://raw.githubusercontent.com/JuliaLang/julia/"
480 "v1.3.0/deps/patches/dSFMT.h.patch"))
482 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
483 (file-name "dSFMT.h.patch"))))))
484 (build-system gnu-build-system)
487 (modify-phases %standard-phases
488 (delete 'configure) ; no configure script
490 ;; Upstream Makefile does not build a shared library. Borrow from Julia
491 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
494 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
495 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
496 "-O3" "-finline-functions" "-fomit-frame-pointer"
497 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
498 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
499 "-o" "libdSFMT.so")))
500 (replace 'install ; no "install" target
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let* ((out (assoc-ref outputs "out"))
503 (lib (string-append out "/lib"))
504 (inc (string-append out "/include"))
505 (doc (string-append out "/share/doc/" ,name "-" ,version)))
506 (install-file "libdSFMT.so" lib)
507 (install-file "dSFMT.h" inc)
508 (install-file "LICENSE.txt" doc)
510 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
512 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
513 the expensive conversion of integer to double (floating point). dSFMT directly
514 generates double precision floating point pseudorandom numbers which have the
515 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
516 format. dSFMT is only available on the CPUs which use IEEE 754 format double
517 precision floating point numbers.")
518 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
519 (license license:bsd-3)))
527 (uri (string-append "mirror://gnu/gsl/gsl-"
531 "0av04cpblphvvs3kl5rwphniarml503501vrpqw31rd0bmwg7fzg"))))
532 (build-system gnu-build-system)
534 (let ((system (%current-system)))
535 `(#:configure-flags (list "--disable-static") ;halves package size
537 (modify-phases %standard-phases
539 ((or (string-prefix? "aarch64" system)
540 (string-prefix? "powerpc" system))
541 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
542 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
543 '((add-before 'check 'disable-failing-tests
545 (substitute* "spmatrix/test.c"
546 ((".*test_complex.*") "\n"))))))
548 ((string-prefix? "i686" system)
549 ;; There are rounding issues with these tests on i686:
550 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
551 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
552 '((add-before 'check 'disable-failing-tests
554 (substitute* "linalg/test.c"
555 ((".*gsl_test\\(test_LU_decomp.*") "\n")
556 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
557 ((".*gsl_test\\(test_QR_decomp_r.*") "\n")
558 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
559 ((".*gsl_test\\(test_pcholesky_solve.*") "\n")
560 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
561 (substitute* "spmatrix/test.c"
562 ((".*test_all.*") "\n")
563 ((".*test_float.*") "\n")
564 ((".*test_complex.*") "\n"))
566 ;; XXX: These tests abort with:
567 ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
568 (substitute* '("multifit_nlinear/test.c"
569 "multilarge_nlinear/test.c")
570 (("gsl_ieee_env_setup.*" all)
571 (string-append "exit (77);\n" all)))))))
574 (home-page "https://www.gnu.org/software/gsl/")
575 (synopsis "Numerical library for C and C++")
577 "The GNU Scientific Library is a library for numerical analysis in C
578 and C++. It includes a wide range of mathematical routines, with over 1000
579 functions in total. Subject areas covered by the library include:
580 differential equations, linear algebra, Fast Fourier Transforms and random
582 (license license:gpl3+)))
584 ;; TODO: Merge back into the gsl package as a separate output.
585 (define-public gsl-static
589 `(,@(package-arguments gsl)
590 #:configure-flags (list "--disable-shared")
591 #:make-flags (list "CFLAGS=-fPIC")))))
601 (url "https://github.com/shibatch/sleef")
603 (file-name (git-file-name name version))
605 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
606 (build-system cmake-build-system)
608 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
609 (string-append "-DCMAKE_INSTALL_LIBDIR="
610 (assoc-ref %outputs "out")
612 (string-append "-DCMAKE_INSTALL_PREFIX="
613 (assoc-ref %outputs "out")))
615 (modify-phases %standard-phases
616 ;; SLEEF generates a header library during the build process and writes
617 ;; to it via shell redirection. Make the checkout writable so the
618 ;; build can succeed.
619 (add-after 'unpack 'make-git-checkout-writable
621 (for-each make-file-writable (find-files "."))
624 (list fftw gmp mpfr openssl))
625 (home-page "https://sleef.org/")
626 (synopsis "SIMD library for evaluating elementary functions and DFT")
628 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
629 implements vectorized versions of all C99 real floating point math functions.
630 It can utilize SIMD instructions that are available on modern processors.")
631 (license (list license:boost1.0 ;sleef
632 license:cc-by4.0)))) ;simplex algorithm
641 (uri (string-append "mirror://gnu/glpk/glpk-"
645 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
646 (build-system gnu-build-system)
650 `(#:configure-flags '("--with-gmp"
651 "--disable-static")))
652 (home-page "https://www.gnu.org/software/glpk/")
653 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
655 "GLPK is a C library for solving large-scale linear programming (LP),
656 mixed integer programming (MIP), and other related problems. It supports the
657 GNU MathProg modeling language, a subset of the AMPL language, and features a
658 translator for the language. In addition to the C library, a stand-alone
659 LP/MIP solver is included in the package.")
660 (license license:gpl3+)))
662 (define-public glpk-4
670 (uri (string-append "mirror://gnu/glpk/glpk-"
674 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
683 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
685 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
687 "/4ti2-" version ".tar.gz"))
689 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
690 (build-system gnu-build-system)
692 (list (@ (gnu packages base) which))) ; for the tests
695 (home-page "http://www.4ti2.de/")
696 (synopsis "Mathematical tool suite for problems on linear spaces")
698 "4ti2 implements algorithms for solving algebraic, geometric and
699 combinatorial problems on linear spaces. Among others, it solves systems
700 of linear equations, computes extreme rays of polyhedral cones, solves
701 integer programming problems and computes Markov bases for statistics.")
702 (license license:gpl2+)))
704 (define-public cddlib
711 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
712 (string-delete #\. version) ".tar.gz"))
715 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
716 (build-system gnu-build-system)
719 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
720 (synopsis "Library for convex hulls and extreme rays of polyhedra")
722 "The C-library cddlib implements the Double Description Method of
723 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
724 rays of a general convex polyhedron given by a system of linear inequalities
725 in arbitrary dimension. It can also be used for the converse operation of
726 computing convex hulls.")
727 (license license:gpl2+)))
729 (define-public lrslib
736 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
738 (string-delete #\. version) ".tar.gz"))
741 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
742 (build-system gnu-build-system)
746 `(#:tests? #f ; no check phase
747 #:make-flags `("CC=gcc"
748 ,(string-append "prefix=" (assoc-ref %outputs "out"))
751 (modify-phases %standard-phases
754 (substitute* "makefile"
755 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
757 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
758 (synopsis "Convex hulls of polyhedra with exact arithmetic")
760 "The C code of lrslib implements the reverse search algorithm for
761 vertex enumeration and convex hull problems. Its input file format is
762 compatible with cddlib. All computations are done exactly in either
763 multiple precision or fixed integer arithmetic. Output is not stored
764 in memory, so even problems with very large output sizes can sometimes
766 (license license:gpl2+)))
768 (define-public libcerf
776 (url "https://jugit.fz-juelich.de/mlz/libcerf")
777 (commit (string-append "v" version))))
778 (file-name (git-file-name name version))
780 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
781 (build-system cmake-build-system)
784 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
785 (synopsis "Library for complex error functions")
787 "@code{libcerf} is a self-contained numeric library that provides an
788 efficient and accurate implementation of complex error functions, along with
789 Dawson, Faddeeva, and Voigt functions.")
790 (license license:expat)))
799 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
800 "vinci/vinci-" version ".tar.gz"))
803 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
804 (build-system gnu-build-system)
808 `(#:tests? #f ; no check phase
810 (modify-phases %standard-phases
812 ;; register the lrs location in the config file
813 (lambda* (#:key inputs #:allow-other-keys)
814 (let* ((lrs (assoc-ref inputs "lrslib"))
815 (lrsexec (string-append lrs "/bin/lrs")))
816 (substitute* "vinci.h"
817 (("#define LRS_EXEC \"lrs\"")
818 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
821 (lambda* (#:key outputs #:allow-other-keys)
822 (let* ((out (assoc-ref outputs "out"))
823 (bin (string-append out "/bin")))
824 (install-file "vinci" bin))
827 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
828 (synopsis "Volume computation for polytopes")
830 "Vinci implements a number of volume computation algorithms for convex
831 polytopes in arbitrary dimension. The polytopes can be given by their
832 V-representation (as the convex hull of a finite number of vertices), by
833 their H-representation (as the bounded intersection of a finite number of
834 halfspaces) or by their double description with both representations.")
835 (license license:gpl2+)))
837 (define-public arpack-ng
841 (home-page "https://github.com/opencollab/arpack-ng")
844 (uri (git-reference (url home-page) (commit version)))
845 (file-name (git-file-name name version))
848 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
849 (build-system gnu-build-system)
851 (list autoconf automake libtool pkg-config))
853 (list eigen lapack gfortran))
854 (synopsis "Fortran subroutines for solving eigenvalue problems")
856 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
857 large scale eigenvalue problems.")
858 (license (license:non-copyleft "file://COPYING"
859 "See COPYING in the distribution."))))
861 (define-public arpack-ng-3.3.0
868 (uri (git-reference (url (package-home-page arpack-ng))
870 (file-name (git-file-name (package-name arpack-ng) version))
873 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
875 (define-public arpack-ng-openmpi
876 (package (inherit arpack-ng)
877 (name "arpack-ng-openmpi")
880 ,@(package-inputs arpack-ng)))
882 (substitute-keyword-arguments (package-arguments arpack-ng)
883 ((#:configure-flags _ '())
885 ((#:phases phases '%standard-phases)
886 `(modify-phases ,phases
887 (add-before 'check 'mpi-setup
889 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
891 (define-public lapack
898 (uri (string-append "http://www.netlib.org/lapack/lapack-"
902 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
903 (build-system cmake-build-system)
904 (home-page "http://www.netlib.org/lapack/")
905 (inputs `(("fortran" ,gfortran)
906 ("python" ,python-wrapper)))
908 `(#:configure-flags (list
909 "-DBUILD_SHARED_LIBS:BOOL=YES"
911 ;; Build the 'LAPACKE_clatms' functions.
912 "-DLAPACKE_WITH_TMG=ON"
913 "-DBUILD_TESTING=ON")))
914 (synopsis "Library for numerical linear algebra")
916 "LAPACK is a Fortran 90 library for solving the most commonly occurring
917 problems in numerical linear algebra.")
918 (license (license:non-copyleft "file://LICENSE"
919 "See LICENSE in the distribution."))))
921 (define-public clapack
928 (uri (string-append "http://www.netlib.org/clapack/clapack-"
929 version "-CMAKE.tgz"))
932 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
933 (build-system cmake-build-system)
935 `(#:configure-flags '("-DCMAKE_C_FLAGS=-fcommon -O2")
937 (modify-phases %standard-phases
938 ;; These tests use a lot of stack variables and segfault without
939 ;; lifting resource limits.
940 (add-after 'unpack 'disable-broken-tests
942 (substitute* "TESTING/CMakeLists.txt"
943 (("add_lapack_test.* xeigtstz\\)") ""))))
945 (lambda* (#:key outputs #:allow-other-keys)
946 (let* ((out (assoc-ref outputs "out"))
947 (libdir (string-append out "/lib"))
948 (f2cinc (string-append out "/include/libf2c")))
951 (for-each (lambda (file)
952 (install-file file libdir))
954 "F2CLIBS/libf2c/libf2c.a"
955 "TESTING/MATGEN/libtmglib.a"
956 "BLAS/SRC/libblas.a"))
957 (for-each (lambda (file)
958 (install-file file f2cinc))
959 (cons "F2CLIBS/libf2c/arith.h"
960 (find-files (string-append "../clapack-"
961 ,version "-CMAKE/F2CLIBS/libf2c")
963 (copy-recursively (string-append "../clapack-"
964 ,version "-CMAKE/INCLUDE")
965 (string-append out "/include"))))))))
966 (home-page "https://www.netlib.org/clapack/")
967 (synopsis "Numerical linear algebra library for C")
969 "The CLAPACK library was built using a Fortran to C conversion utility
970 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
971 C code, and then modified to improve readability. CLAPACK's goal is to
972 provide LAPACK for someone who does not have access to a Fortran compiler.")
973 (license (license:non-copyleft "file://LICENSE"
974 "See LICENSE in the distribution."))))
976 (define-public scalapack
983 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
987 "19i0h9vdc3zsy58r6fy1vs2kz2l7amifkz0cf926j90xz1n23nb1"))
988 (patches (search-patches "scalapack-gcc-10-compilation.patch"))))
989 (build-system cmake-build-system)
992 ("fortran" ,gfortran)
993 ("lapack" ,lapack))) ;for testing only
995 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
996 #:phases (modify-phases %standard-phases
997 (add-before 'check 'mpi-setup
999 (add-after 'unpack 'skip-faulty-test
1001 ;; FIXME: Skip these two tests that fail to complete for
1003 ;; <https://github.com/Reference-ScaLAPACK/scalapack/issues/43>.
1004 (substitute* "TESTING/CMakeLists.txt"
1005 (("^add_test\\(x[sd]hseqr.*" all)
1006 (string-append "# " all "\n"))))))))
1007 (home-page "http://www.netlib.org/scalapack/")
1008 (synopsis "Library for scalable numerical linear algebra")
1010 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
1011 routines on parallel distributed memory machines. ScaLAPACK solves dense and
1012 banded linear systems, least squares problems, eigenvalue problems, and
1013 singular value problems.")
1014 (license (license:non-copyleft "file://LICENSE"
1015 "See LICENSE in the distribution."))))
1017 (define-public feedgnuplot
1019 (name "feedgnuplot")
1021 (home-page "https://github.com/dkogan/feedgnuplot")
1026 (commit (string-append "v" version))))
1027 (file-name (git-file-name name version))
1030 "0403hwlian2s431m36qdzcczhvfjvh7128m64hmmwbbrgh0n7md7"))))
1031 (build-system perl-build-system)
1034 (modify-phases %standard-phases
1035 (add-before 'check 'adjust-tests
1037 (substitute* "t/plots.t"
1038 ;; XXX: The vnlog tests uses 'echo' with escaped strings,
1039 ;; but does not enable escape interpretation.
1042 (add-after 'install 'install-documentation
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (let* ((out (assoc-ref outputs "out"))
1045 (doc (string-append out "/share/doc/feedgnuplot")))
1047 (invoke "pod2html" "--title=feedgnuplot" "bin/feedgnuplot"
1048 "--outfile" (string-append doc "/feedgnuplot.html")))))
1049 (add-after 'install 'wrap
1050 (lambda* (#:key inputs outputs #:allow-other-keys)
1051 (let* ((out (assoc-ref outputs "out"))
1052 (gnuplot (search-input-file inputs "/bin/gnuplot"))
1053 ;; XXX: We need List::MoreUtils as well as its supporting
1054 ;; (propagated) modules; for now just refer to labels.
1055 (modules '("perl-list-moreutils" "perl-exporter-tiny"))
1056 (PERL5LIB (string-join
1057 (map (lambda (input)
1058 (string-append (assoc-ref inputs input)
1059 "/lib/perl5/site_perl"))
1062 (wrap-program (string-append out "/bin/feedgnuplot")
1063 `("PERL5LIB" ":" suffix (,PERL5LIB))
1064 `("PATH" ":" suffix (,(dirname gnuplot))))))))))
1066 (list gnuplot perl-list-moreutils vnlog))
1069 (list perl-ipc-run perl-string-shellquote))
1070 (synopsis "Pipe-oriented plotting tool")
1072 "@command{feedgnuplot} is a tool to plot realtime and stored data
1073 from the command line, using @command{gnuplot}. It can read data from
1074 a pipe or file, make a variety of transformations, and render the result
1075 in the terminal or with an external viewer.")
1076 (license license:gpl1+))) ;any version
1078 (define-public gnuplot
1084 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1088 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
1089 (build-system gnu-build-system)
1090 (inputs (list readline cairo pango gd lua))
1092 `(("pkg-config" ,pkg-config)
1093 ("texlive" ,texlive-tiny)))
1094 (arguments `(#:configure-flags (list (string-append
1095 "--with-texdir=" %output
1096 "/texmf-local/tex/latex/gnuplot"))
1097 ;; Plot on a dumb terminal during tests.
1098 #:make-flags '("GNUTERM=dumb")))
1099 (home-page "http://www.gnuplot.info")
1100 (synopsis "Command-line driven graphing utility")
1101 (description "Gnuplot is a portable command-line driven graphing
1102 utility. It was originally created to allow scientists and students to
1103 visualize mathematical functions and data interactively, but has grown to
1104 support many non-interactive uses such as web scripting. It is also used as a
1105 plotting engine by third-party applications like Octave.")
1106 ;; X11 Style with the additional restriction that derived works may only be
1107 ;; distributed as patches to the original.
1108 (license (license:fsf-free
1109 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1119 (url "https://github.com/OkoSanto/GCTP")
1120 (commit (string-append "v" version))))
1121 (file-name (git-file-name name version))
1123 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1126 (build-system gnu-build-system)
1127 (synopsis "General Cartographic Transformation Package (GCTP)")
1129 "The General Cartographic Transformation Package (GCTP) is a system of
1130 software routines designed to permit the transformation of coordinate pairs
1131 from one map projection to another. The GCTP is the standard computer
1132 software used by the National Mapping Division for map projection
1134 (home-page "https://github.com/OkoSanto/GCTP")
1135 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1144 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1145 version "/src/hdf-" version ".tar.bz2"))
1147 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1148 (patches (search-patches "hdf4-architectures.patch"
1149 "hdf4-reproducibility.patch"
1150 "hdf4-shared-fortran.patch"
1151 "hdf4-tirpc.patch"))))
1152 (build-system gnu-build-system)
1154 (list gfortran bison flex))
1157 ("libjpeg" ,libjpeg-turbo)
1158 ("libtirpc" ,libtirpc)))
1160 `(#:parallel-tests? #f
1161 #:configure-flags (list "--enable-shared"
1162 "FCFLAGS=-fallow-argument-mismatch"
1163 "FFLAGS=-fallow-argument-mismatch"
1164 (string-append "CPPFLAGS=-I"
1165 (assoc-ref %build-inputs "libtirpc")
1168 (modify-phases %standard-phases
1169 ;; This is inspired by two of Debian's patches.
1170 (add-before 'configure 'add-more-aarch64-support
1172 (substitute* '("mfhdf/ncgen/ncgen.l"
1173 "mfhdf/ncgen/ncgenyy.c"
1174 "mfhdf/libsrc/netcdf.h.in")
1175 (("AIX5L64") "__aarch64__"))
1177 (add-before 'configure 'patchbuild
1180 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1182 (("/bin/mkdir") "mkdir"))
1183 (substitute* (find-files "." "^Makefile\\.in$")
1184 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1185 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1186 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1187 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1188 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1190 (add-after 'configure 'patch-settings
1192 ;; libhdf4.settings contains the full path of the
1193 ;; compilers used, and its contents are included in
1194 ;; .so-files. We truncate the hashes to avoid
1195 ;; unnecessary store references to those compilers:
1196 (substitute* "libhdf4.settings"
1197 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1198 (string-append prefix (string-take hash 10) "...")))
1200 (add-after 'install 'provide-absolute-libjpeg-reference
1201 (lambda* (#:key inputs outputs #:allow-other-keys)
1202 (let ((out (assoc-ref outputs "out"))
1203 (libjpeg (assoc-ref inputs "libjpeg")))
1204 ;; libjpeg-turbo does not provide a .la file, so libtool is
1205 ;; unable to add an absolute reference for -ljpeg in the .la
1206 ;; files. Fix it manually to avoid having to propagate it.
1207 (substitute* (find-files (string-append out "/lib") "\\.la$")
1209 (string-append "-L" libjpeg "/lib -ljpeg")))
1211 (home-page "https://www.hdfgroup.org/products/hdf4/")
1213 "Library and multi-object file format for storing and managing data")
1214 (description "HDF4 is a library and multi-object file format for storing
1215 and managing data between machines. HDF4 is an older hierarchical data format,
1216 incompatible with HDF5.")
1218 (license:non-copyleft
1219 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1221 (define-public hdf4-alt
1226 (substitute-keyword-arguments (package-arguments hdf4)
1227 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1229 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1231 (define-public hdf5-1.8
1238 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1239 "hdf5-" (version-major+minor version)
1240 "/hdf5-" version "/src/hdf5-"
1242 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1244 (match (string-split version #\.)
1245 ((major minor _ ...)
1246 (string-append major minor)))
1247 "/src/hdf5-" version ".tar.bz2")))
1249 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1250 (patches (search-patches "hdf5-config-date.patch"))))
1251 (build-system gnu-build-system)
1255 (list gfortran perl)) ;part of the test machinery needs Perl
1256 (outputs '("out" ; core library
1257 "fortran")) ; fortran interface
1259 `(;; Some of the users, notably Flann, need the C++ interface.
1260 #:configure-flags '("--enable-cxx"
1262 "--enable-fortran2003"
1264 ;; Build a thread-safe library. Unfortunately,
1265 ;; 'configure' invites you to either turn off C++,
1266 ;; Fortran, and the high-level interface (HL), or
1267 ;; to pass '--enable-unsupported'. Debian
1268 ;; packagers chose to pass '--enable-unsupported'
1269 ;; and we follow their lead here.
1270 "--enable-threadsafe"
1272 "--enable-unsupported")
1273 ;; Use -fPIC to allow the R bindings to link with the static libraries
1274 #:make-flags (list "CFLAGS=-fPIC"
1277 (modify-phases %standard-phases
1278 (add-before 'configure 'patch-configure
1279 (lambda* (#:key outputs #:allow-other-keys)
1280 (substitute* "configure"
1282 (substitute* "fortran/src/Makefile.in"
1283 (("libhdf5_fortran_la_LDFLAGS =")
1284 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1285 (assoc-ref outputs "fortran") "/lib")))
1286 (substitute* "hl/fortran/src/Makefile.in"
1287 (("libhdf5hl_fortran_la_LDFLAGS =")
1288 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1289 (assoc-ref outputs "fortran") "/lib")))
1291 (add-after 'configure 'patch-settings
1293 ;; libhdf5.settings contains the full path of the
1294 ;; compilers used, and its contents are included in
1295 ;; libhdf5.so. We truncate the hashes to avoid
1296 ;; unnecessary store references to those compilers:
1297 (substitute* "src/libhdf5.settings"
1298 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1299 (string-append prefix (string-take hash 10) "..."))
1300 ;; Don't record the build-time kernel version to make the
1301 ;; settings file reproducible.
1302 (("Uname information:.*")
1303 "Uname information: Linux\n"))
1305 (add-after 'install 'patch-references
1306 (lambda* (#:key inputs outputs #:allow-other-keys)
1307 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1308 (zlib (assoc-ref inputs "zlib")))
1309 (substitute* (find-files bin "h5p?cc")
1311 (string-append "-L" zlib "/lib " lib)))
1313 (add-after 'install 'split
1314 (lambda* (#:key inputs outputs #:allow-other-keys)
1315 ;; Move all fortran-related files
1316 (let* ((out (assoc-ref outputs "out"))
1317 (bin (string-append out "/bin"))
1318 (lib (string-append out "/lib"))
1319 (inc (string-append out "/include"))
1320 (ex (string-append out "/share/hdf5_examples/fortran"))
1321 (fort (assoc-ref outputs "fortran"))
1322 (fbin (string-append fort "/bin"))
1323 (flib (string-append fort "/lib"))
1324 (finc (string-append fort "/include"))
1325 (fex (string-append fort "/share/hdf5_examples/fortran")))
1330 ;; Note: When built with --enable-parallel, the 'h5fc' file
1331 ;; doesn't exist, hence this condition.
1332 (when (file-exists? (string-append bin "/h5fc"))
1333 (rename-file (string-append bin "/h5fc")
1334 (string-append fbin "/h5fc")))
1335 (for-each (lambda (file)
1337 (string-append flib "/" (basename file))))
1338 (find-files lib ".*fortran.*"))
1339 (for-each (lambda (file)
1341 (string-append finc "/" (basename file))))
1342 (find-files inc ".*mod"))
1343 (for-each (lambda (file)
1345 (string-append fex "/" (basename file))))
1346 (find-files ex ".*"))
1347 (delete-file-recursively ex))
1349 (home-page "https://www.hdfgroup.org")
1350 (synopsis "Management suite for extremely large and complex data")
1351 (description "HDF5 is a suite that makes possible the management of
1352 extremely large and complex data collections.")
1353 (license (license:x11-style
1354 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1356 (define-public hdf5-1.10
1363 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1364 "hdf5-" (version-major+minor version)
1365 "/hdf5-" version "/src/hdf5-"
1367 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1369 (apply string-append
1370 (take (string-split version #\.) 2))
1371 "/src/hdf5-" version ".tar.bz2")))
1373 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1374 (patches (search-patches "hdf5-config-date.patch"))))))
1376 (define-public hdf5-1.12
1383 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1384 "hdf5-" (version-major+minor version)
1385 "/hdf5-" version "/src/hdf5-"
1387 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1389 (apply string-append
1390 (take (string-split version #\.) 2))
1391 "/src/hdf5-" version ".tar.bz2")))
1393 (base32 "074g3z504xf77ff38igs30i1aqxpm508p7yw78ykva7dncrgbyda"))
1394 (patches (search-patches "hdf5-config-date.patch"))))))
1397 ;; Default version of HDF5.
1400 (define-public hdf-java
1408 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1409 version "/src/CMake-hdfjava-" version ".tar.gz"))
1411 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1412 (modules '((guix build utils)))
1413 (snippet ; Make sure we don't use the bundled sources and binaries.
1415 (for-each delete-file
1416 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1417 "HDF4.tar.gz" "HDF5.tar.gz"))
1418 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1420 (build-system gnu-build-system)
1422 `(("jdk" ,icedtea "jdk")
1423 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1425 ("hamcrest-core" ,java-hamcrest-core)
1426 ("junit" ,java-junit)
1427 ("slf4j-simple" ,java-slf4j-simple)))
1432 ("libjpeg" ,libjpeg-turbo)
1433 ("slf4j-api" ,java-slf4j-api)))
1436 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1437 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1438 (assoc-ref %build-inputs "jdk") "/lib" )
1439 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1440 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1443 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1444 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1445 (string-append "ZLIB=" (search-input-file %build-inputs "/lib/libz.so"))
1446 (string-append "JPEGLIB="
1447 (search-input-file %build-inputs "/lib/libjpeg.so"))
1451 (modify-phases %standard-phases
1452 (add-before 'configure 'chdir-to-source
1453 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1454 (add-before 'configure 'patch-build
1455 (lambda* (#:key inputs outputs #:allow-other-keys)
1456 (substitute* "configure"
1457 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1458 (("/bin/cat") (which "cat")))
1459 ;; Set classpath for compilation
1460 (substitute* '("hdf/hdf5lib/Makefile.in"
1461 "hdf/hdf5lib/exceptions/Makefile.in"
1462 "hdf/hdflib/Makefile.in")
1463 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1464 ;; 'slf4j-api-X.Y.Z.jar' is installed in a Maven-style
1465 ;; directory, so use 'find-files' to find it.
1466 (car (find-files (assoc-ref inputs "slf4j-api")
1467 "^slf4j-api.*\\.jar$"))))
1468 ;; Replace outdated config.sub and config.guess:
1469 (with-directory-excursion "config"
1470 (for-each (lambda (file)
1472 (search-input-file inputs
1475 ,(version-major+minor (package-version automake))
1478 '("config.sub" "config.guess")))
1480 ;; Fix embedded version number
1481 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1482 (substitute* "hdf/hdf5lib/H5.java"
1484 (string-join hdf5version ", "))))
1486 (mkdir-p (string-append (assoc-ref outputs "out")))
1487 ;; Set classpath for tests
1488 (let* ((build-dir (getcwd))
1489 (lib (string-append build-dir "/lib"))
1490 (jhdf (string-append lib "/jhdf.jar"))
1491 (jhdf5 (string-append lib "/jhdf5.jar"))
1495 (car (find-files (assoc-ref inputs i)
1496 (string-append "^" i
1498 '("slf4j-api" "slf4j-simple"))
1500 (car (find-files (assoc-ref inputs "junit") "jar$"))
1501 (car (find-files (assoc-ref inputs "hamcrest-core")
1504 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1506 (substitute* '("test/hdf5lib/Makefile.in"
1507 "test/hdf5lib/junit.sh.in"
1508 "examples/runExample.sh.in")
1510 (search-input-file inputs "/bin/test"))
1512 (search-input-file inputs "/bin/uname"))
1513 (("CLASSPATH=[^\n]*")
1514 (string-append "CLASSPATH=" class-path)))
1515 (setenv "CLASSPATH" class-path))
1517 (add-before 'check 'build-examples
1519 (apply invoke `("javac"
1520 ,@(find-files "examples" ".*\\.java"))))))
1522 #:parallel-build? #f
1524 #:parallel-tests? #f ))
1525 (home-page "https://support.hdfgroup.org/products/java")
1526 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1527 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1528 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1531 ;; BSD-style license:
1532 (license (license:x11-style
1533 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1534 /current/src/unpacked/COPYING"))))
1536 (define-public hdf-eos2
1543 (uri "ftp://edhs1.gsfc.nasa.gov\
1544 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1546 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1547 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1548 "hdf-eos2-build-shared.patch"
1549 "hdf-eos2-fortrantests.patch"))))
1550 (build-system gnu-build-system)
1554 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1555 ;; XXX: These inputs are really dependencies of hdf4.
1557 ("libjpeg" ,libjpeg-turbo)
1558 ("libtirpc" ,libtirpc)
1562 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1563 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1564 #:parallel-tests? #f))
1565 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1566 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1567 (description "HDF-EOS2 is a software library built on HDF4 which supports
1568 the construction of data structures used in NASA's Earth Observing
1569 System (Grid, Point and Swath).")
1571 ;; Source files carry a permissive license header.
1572 (license (license:non-copyleft home-page))))
1574 (define-public hdf-eos5
1580 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1581 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1584 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1585 (patches (search-patches "hdf-eos5-build-shared.patch"
1586 "hdf-eos5-remove-gctp.patch"
1587 "hdf-eos5-fix-szip.patch"
1588 "hdf-eos5-fortrantests.patch"))))
1591 (build-system gnu-build-system)
1593 (list hdf5-1.8 zlib gctp))
1595 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1596 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1597 #:parallel-tests? #f))
1598 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1600 "HDF-EOS5 is a software library built on HDF5 to support the construction
1601 of data structures used in NASA's Earth Observing System (Grid, Point and
1603 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1605 ;; Source files carry a permissive license header.
1606 (license (license:non-copyleft home-page))))
1608 (define-public hdf5-parallel-openmpi
1609 (package/inherit hdf5-1.10 ;use the latest
1610 (name "hdf5-parallel-openmpi")
1613 ,@(package-inputs hdf5)))
1615 (substitute-keyword-arguments (package-arguments hdf5)
1616 ((#:configure-flags flags)
1617 ``("--enable-parallel"
1618 ,@(delete "--enable-cxx"
1619 (delete "--enable-threadsafe" ,flags))))
1621 `(modify-phases ,phases
1622 (add-after 'build 'mpi-setup
1624 (add-before 'check 'patch-tests
1626 ;; OpenMPI's mpirun will exit with non-zero status if it
1627 ;; detects an "abnormal termination", i.e. any process not
1628 ;; calling MPI_Finalize(). Since the test is explicitly
1629 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1630 ;; H5C_flush_cache from being called, mpirun will always
1631 ;; complain, so turn this test off.
1632 (substitute* "testpar/Makefile"
1633 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1634 (string-append front back "\n")))
1635 (substitute* "tools/test/h5diff/testph5diff.sh"
1636 (("/bin/sh") (which "sh")))
1638 (synopsis "Management suite for data with parallel IO support")))
1640 (define-public hdf5-blosc
1648 (url "https://github.com/Blosc/hdf5-blosc")
1649 (commit (string-append "v" version))))
1650 (file-name (git-file-name name version))
1652 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1653 (build-system cmake-build-system)
1656 (list (string-append "-DBLOSC_INSTALL_DIR="
1657 (assoc-ref %build-inputs "c-blosc"))
1658 (string-append "-DPLUGIN_INSTALL_PATH="
1659 (assoc-ref %outputs "out")
1660 "/hdf5/lib/plugin"))
1662 (modify-phases %standard-phases
1663 (add-after 'unpack 'do-not-build-blosc
1665 (substitute* "CMakeLists.txt"
1666 (("set\\(BLOSC_INSTALL_DIR.*") "")
1667 (("ExternalProject_Add\\(project_blosc") "message("))
1670 (list c-blosc hdf5-1.10))
1671 (home-page "https://github.com/Blosc/hdf5-blosc")
1672 (synopsis "Filter for HDF5 using the Blosc compressor")
1673 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1674 installing this filter, you can read and write HDF5 files with
1675 Blosc-compressed datasets.")
1676 (license license:expat)))
1678 (define-public h5check
1685 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1686 "h5check/src/h5check-" version ".tar.gz"))
1689 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1690 (build-system gnu-build-system)
1691 (inputs (list hdf5-1.8)) ;h5cc for tests
1692 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1693 (synopsis "HDF5 format checker")
1694 (description "@code{h5check} is a validation tool for verifying that an
1695 HDF5 file is encoded according to the HDF File Format Specification.")
1696 (license (license:x11-style "file://COPYING"))))
1704 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1709 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1710 (build-system cmake-build-system)
1711 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1712 (inputs (list lapack fftw))
1713 ;; FIXME: Even though the fonts are available dvips complains:
1714 ;; "Font cmmi10 not found; characters will be left blank."
1716 `(("texlive" ,texlive-tiny)
1717 ("ghostscript" ,ghostscript)
1718 ("doxygen" ,doxygen)))
1719 (home-page "http://itpp.sourceforge.net")
1720 (synopsis "C++ library of maths, signal processing and communication classes")
1721 (description "IT++ is a C++ library of mathematical, signal processing and
1722 communication classes and functions. Its main use is in simulation of
1723 communication systems and for performing research in the area of
1724 communications. The kernel of the library consists of generic vector and
1725 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1726 similar to MATLAB, GNU Octave or SciPy.")
1727 (license license:gpl3+)))
1729 (define-public netcdf
1737 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1738 "netcdf-c-" version ".tar.gz"))
1741 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1742 (modules '((guix build utils)))
1744 ;; Make sure this variable is defined only once. Failing to do so
1745 ;; would break builds of 'netcdf-parallel-openmpi' with a
1746 ;; multiple-definition link error with GCC 10.
1747 '(substitute* "ncdump/ocprint.c"
1748 (("^int ocdebug") "static int ocdebug")))
1749 (patches (search-patches "netcdf-date-time.patch"))))
1750 (build-system gnu-build-system)
1752 (list m4 doxygen graphviz))
1754 `(("hdf4" ,hdf4-alt)
1758 ("libjpeg" ,libjpeg-turbo)))
1760 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1762 #:phases (modify-phases %standard-phases
1763 (add-before 'configure 'fix-source-date
1765 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1766 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1767 ;; to '1st hour of the current day', and therefore makes the
1768 ;; package not reproducible.
1769 (substitute* "./configure"
1770 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1771 "date --date='@0'"))
1773 (add-after 'configure 'patch-settings
1775 ;; libnetcdf.settings contains the full filename of the compilers
1776 ;; used to build the library. We truncate the hashes of those
1777 ;; filenames to avoid unnecessary references to the corresponding
1779 (substitute* "libnetcdf.settings"
1780 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1781 (string-append prefix (string-take hash 10) "...")))
1784 #:parallel-tests? #f)) ;various race conditions
1785 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1786 (synopsis "Library for scientific data")
1787 (description "NetCDF is an interface for scientific data access and a
1788 software library that provides an implementation of the interface. The netCDF
1789 library defines a machine-independent format for representing scientific data.
1790 Together, the interface, library, and format support the creation, access, and
1791 sharing of scientific data.")
1792 (license (license:x11-style "file://COPYRIGHT"))))
1794 (define-public netcdf-parallel-openmpi
1795 (package (inherit netcdf)
1796 (name "netcdf-parallel-openmpi")
1799 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1800 (package-inputs netcdf))))
1801 ;; TODO: Replace pkg-config references in nc-config with absolute references
1803 (substitute-keyword-arguments (package-arguments netcdf)
1804 ((#:configure-flags flags)
1805 `(cons* "CC=mpicc" "CXX=mpicxx"
1806 "--enable-parallel-tests"
1807 ;; Shared libraries not supported with parallel IO.
1808 "--disable-shared" "--with-pic"
1810 ((#:phases phases '%standard-phases)
1811 `(modify-phases ,phases
1812 (add-after 'build 'mpi-setup
1813 ,%openmpi-setup)))))))
1815 (define-public netcdf-fortran
1817 (name "netcdf-fortran")
1822 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1826 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1827 (build-system gnu-build-system)
1829 `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
1830 "FFLAGS=-fallow-argument-mismatch")
1831 #:parallel-tests? #f))
1836 (synopsis "Fortran interface for the netCDF library")
1837 (description (package-description netcdf))
1838 (home-page (package-home-page netcdf))
1839 (license (package-license netcdf))))
1841 (define-public nlopt
1847 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1850 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1851 (build-system gnu-build-system)
1853 `(;; Shared libraries are not built by default. They are required to
1854 ;; build the Guile, Octave, and Python bindings.
1855 #:configure-flags '("--enable-shared")
1858 (modify-phases %standard-phases
1859 (add-before 'configure 'set-libnlopt-file-name
1860 (lambda* (#:key outputs #:allow-other-keys)
1861 ;; Make sure the Scheme module refers to the library by its
1862 ;; absolute file name (we cannot do that from a snippet
1863 ;; because the expansion of @libdir@ contains
1865 (let ((out (assoc-ref outputs "out")))
1866 (substitute* "swig/nlopt.scm.in"
1868 (string-append out "/lib/libnlopt")))
1870 (inputs (list guile-2.0))
1871 (native-inputs (list pkg-config))
1872 (home-page "http://ab-initio.mit.edu/wiki/")
1873 (synopsis "Library for nonlinear optimization")
1874 (description "NLopt is a library for nonlinear optimization, providing a
1875 common interface for a number of different free optimization routines available
1876 online as well as original implementations of various other algorithms.")
1877 (license license:lgpl2.1+)))
1879 (define-public ipopt
1886 (url "https://github.com/coin-or/Ipopt")
1887 (commit (string-append "releases/" version))))
1888 (file-name (git-file-name name version))
1891 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1892 (build-system gnu-build-system)
1894 '(#:phases (modify-phases %standard-phases
1895 (add-after 'install 'add--L-flags-in-ipopt.pc
1896 (lambda* (#:key inputs outputs #:allow-other-keys)
1897 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1898 ;; move it to "Libs.private" where it belongs, and add a
1899 ;; '-L' flag for LAPACK.
1900 (let ((out (assoc-ref outputs "out"))
1901 (lapack (assoc-ref inputs "lapack")))
1902 (substitute* (string-append out "/lib/pkgconfig/"
1904 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1905 (string-append "Libs: " before " " after "\n"
1906 "Libs.private: " before
1907 "-L" lapack "/lib -llapack -lblas "
1911 (list gfortran pkg-config))
1913 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1914 (list lapack)) ;for both libblas and liblapack
1915 (home-page "https://www.coin-or.org")
1916 (synopsis "Large-scale nonlinear optimizer")
1918 "The Interior Point Optimizer (IPOPT) is a software package for
1919 large-scale nonlinear optimization. It provides C++, C, and Fortran
1921 (license license:epl2.0)))
1923 (define-public nomad-optimizer
1925 (name "nomad-optimizer")
1931 (url "https://github.com/bbopt/nomad/")
1932 (commit (string-append "v" version))))
1933 (file-name (git-file-name name version))
1936 "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
1937 (build-system cmake-build-system)
1939 `(("python" ,python-wrapper)
1940 ("python-cython" ,python-cython)))
1942 `(#:imported-modules ((guix build python-build-system)
1943 ,@%cmake-build-system-modules)
1944 #:modules (((guix build python-build-system)
1945 #:select (python-version site-packages))
1946 (guix build cmake-build-system)
1949 '("-DBUILD_INTERFACES=ON"
1952 (modify-phases %standard-phases
1953 (add-after 'unpack 'fix-sources-for-build
1954 (lambda* (#:key outputs #:allow-other-keys)
1955 (substitute* "CMakeLists.txt"
1956 ;; CMAKE_INSTALL_PREFIX is accidentally hardcoded.
1957 (("set\\(CMAKE_INSTALL_PREFIX .* FORCE\\)") "")
1958 ;; Requiring GCC version 8 or later is unwarranted.
1959 (("message\\(FATAL_ERROR \"GCC version < 8")
1960 "message(STATUS \"GCC version < 8"))
1962 (let ((out (assoc-ref outputs "out")))
1963 (substitute* "interfaces/PyNomad/CMakeLists.txt"
1964 ;; We don't want to build in-place, and anyway the install
1965 ;; command further below runs build_ext as a prerequisite.
1966 (("COMMAND python setup_PyNomad\\.py .* build_ext --inplace\n")
1968 ;; Don't install locally.
1969 (("COMMAND python (setup_PyNomad\\.py .* install) --user\n"
1971 (string-append "COMMAND ${CMAKE_COMMAND} -E env"
1972 " CC=" ,(cc-for-target)
1973 " CXX=" ,(cxx-for-target)
1974 " " (which "python")
1978 ;; Fix erroneous assumptions about the paths of the include and
1979 ;; library directories.
1980 (substitute* "interfaces/PyNomad/setup_PyNomad.py"
1981 (("^( +os_include_dirs = ).*" _ prefix)
1982 (string-append prefix "[\"../../src\"]\n"))
1983 (("^(installed_lib_dir = ).*" _ prefix)
1984 (string-append prefix "\"" out "/lib\"\n"))))
1987 ;; Fix the tests so they run in out-of-source builds.
1988 (add-after 'fix-sources-for-build 'fix-sources-for-tests
1991 (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
1993 (map (lambda (d) (string-append "basic/library/" d))
1994 '("example1" "example2" "example3"
1995 "single_obj_parallel"))
1996 (map (lambda (d) (string-append "advanced/library/" d))
1997 '("FixedVariable" "NMonly" "PSDMads" "Restart"
1998 "c_api/example1" "c_api/example2"
1999 "exampleSuggestAndObserve"))))
2000 ;; The built examples are assumed to be in the source tree
2001 ;; (which isn't the case here).
2002 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
2004 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
2005 ;; (Unrelated to support for out-of-source testing.)
2007 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
2009 (let* ((builddir (string-append (getcwd) "/../build"))
2010 ;; The BB_EXE and SURROGATE_EXE paths are interpreted
2011 ;; relative to the configuration file provided to NOMAD.
2012 ;; However, the configuration files are all in the source
2013 ;; tree rather than in the build tree (unlike the compiled
2015 (fix-exe-path (lambda* (dir #:optional
2018 (substitute* (string-append dir "/" file)
2019 (((string-append "^" exe-opt " +"))
2020 ;; The $ prevents NOMAD from prefixing
2021 ;; the executable with the path of the
2022 ;; parent directory of the configuration
2023 ;; file NOMAD was provided with as
2024 ;; argument (param.txt or some such).
2025 (string-append exe-opt " $"
2026 builddir "/" dir "/"))))))
2029 (let ((dir (string-append "examples/" dir)))
2030 (substitute* (string-append dir "/CMakeLists.txt")
2031 ;; The install phase has not yet run.
2032 (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
2033 "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
2035 (when (equal? dir "examples/basic/batch/surrogate_sort")
2036 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
2037 (append (map (lambda (d) (string-append "basic/batch/" d))
2038 '("example1" "example2"
2039 "single_obj" "single_obj_parallel"
2041 '("advanced/batch/LHonly")))
2043 (let ((dir "examples/advanced/batch/FixedVariable"))
2044 (substitute* (string-append dir "/runFixed.sh")
2045 ;; Hardcoded path to NOMAD executable.
2046 (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
2047 (string-append builddir "/src/nomad ")))
2049 (lambda (f) (fix-exe-path dir f))
2050 '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))
2053 ;; The information in the .egg-info file is not kept up to date.
2054 (add-after 'install 'delete-superfluous-egg-info
2055 (lambda* (#:key inputs outputs #:allow-other-keys)
2056 (delete-file (string-append
2057 (site-packages inputs outputs)
2059 (python-version (assoc-ref inputs "python"))
2062 (home-page "https://www.gerad.ca/nomad/")
2063 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
2065 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
2066 algorithm, designed for difficult blackbox optimization problems. These
2067 problems occur when the functions defining the objective and constraints are
2068 the result of costly computer simulations.")
2069 (license license:lgpl3+)))
2077 (uri (string-append "https://www.coin-or.org/download/source/"
2078 "Cbc/Cbc-" version ".tgz"))
2081 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
2082 (modules '((guix build utils)))
2084 ;; Make sure we don't use the bundled software.
2085 '(delete-file-recursively "ThirdParty"))))
2086 (build-system gnu-build-system)
2088 (list gfortran pkg-config))
2091 (home-page "https://www.coin-or.org")
2092 (synopsis "Branch-and-cut solver")
2094 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
2095 solver written in C++. It can be used as a library or as a standalone
2097 (license license:epl1.0)))
2105 (uri (string-append "https://www.coin-or.org/download/source/"
2106 "Clp/Clp-" version ".tgz"))
2109 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
2110 (modules '((guix build utils)))
2112 ;; Make sure we don't use the bundled software.
2114 (delete-file-recursively "ThirdParty")
2116 (build-system gnu-build-system)
2118 (list gfortran pkg-config))
2121 (home-page "https://www.coin-or.org")
2122 (synopsis "Linear programming solver")
2124 "CLP is a high quality linear programming solver. Its main strengths are
2125 its dual and primal Simplex algorithms. It also has a barrier algorithm for
2126 linear and quadratic objectives. There are limited facilities for nonlinear
2127 and quadratic objectives using the Simplex algorithm.")
2128 (license license:epl1.0)))
2130 (define-public gecode
2137 (url "https://github.com/Gecode/gecode")
2138 (commit (string-append "release-" version))))
2139 (file-name (git-file-name name version))
2142 "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
2143 (modules '((guix build utils)))
2146 ;; delete generated sources
2147 (for-each delete-file
2148 '("gecode/kernel/var-imp.hpp"
2149 "gecode/kernel/var-type.hpp"))))))
2150 (outputs '("out" "examples"))
2151 (build-system gnu-build-system)
2154 (list (string-append "GLDFLAGS=-Wl,-rpath="
2155 (assoc-ref %outputs "out")
2157 "--enable-examples=no")
2158 #:modules ((guix build gnu-build-system)
2163 (modify-phases %standard-phases
2164 (add-after 'build 'build-examples
2165 (lambda* (#:key outputs #:allow-other-keys)
2166 (invoke "make" "compileexamples")))
2167 ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
2168 ;; patch it ourselves... *sigh*
2169 (add-after 'install 'fix-rpath
2170 (lambda* (#:key outputs #:allow-other-keys)
2171 (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
2174 (let* ((pipe (open-pipe* OPEN_READ "patchelf"
2175 "--print-rpath" file))
2176 (line (read-line pipe)))
2177 (and (zero? (close-pipe pipe))
2178 (invoke "patchelf" "--set-rpath"
2179 (string-append libdir ":" line)
2181 (find-files libdir ".*\\.so$")))))
2182 (add-after 'install 'install-examples
2183 (lambda* (#:key outputs #:allow-other-keys)
2184 (invoke "make" "installexamples"
2185 (string-append "bindir=" (assoc-ref outputs "examples")
2187 ;; Tests depend on installed libraries.
2189 (add-after 'fix-rpath 'check
2190 (assoc-ref %standard-phases 'check)))))
2192 (list patchelf perl sed))
2193 (home-page "https://www.gecode.org")
2194 (synopsis "Toolkit for developing constraint-based systems")
2195 (description "Gecode is a C++ toolkit for developing constraint-based
2196 systems and applications. It provides a modular and extensible solver.")
2197 (license license:expat)))
2199 (define-public libflame
2203 (outputs '("out" "static"))
2208 (url "https://github.com/flame/libflame")
2210 (file-name (git-file-name name version))
2213 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
2214 (build-system gnu-build-system)
2217 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
2218 (list "--enable-dynamic-build"
2219 "--enable-max-arg-list-hack"
2220 "--enable-lapack2flame"
2221 "--enable-verbose-make-output"
2222 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
2223 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
2226 '("--enable-vector-intrinsics=sse")
2228 "--enable-supermatrix"
2229 "--enable-memory-alignment=16"
2230 "--enable-ldim-alignment")
2232 (modify-phases %standard-phases
2233 (add-after 'unpack 'patch-/usr/bin/env-bash
2235 (substitute* "build/config.mk.in"
2236 (("/usr/bin/env bash") (which "bash")))
2239 (lambda* (#:key tests? #:allow-other-keys)
2240 (substitute* "test/Makefile"
2241 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
2242 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
2244 (with-directory-excursion "test"
2247 (invoke "./test_libflame.x"))
2249 (add-after 'install 'install-static
2250 (lambda* (#:key outputs #:allow-other-keys)
2251 (let ((out (assoc-ref outputs "out"))
2252 (static (assoc-ref outputs "static")))
2253 (mkdir-p (string-append static "/lib"))
2254 (rename-file (string-append out "/lib/libflame.a")
2255 (string-append static "/lib/libflame.a"))
2256 (install-file (string-append out "/include/FLAME.h")
2257 (string-append static "/include"))
2262 `(("lapack" ,lapack)
2263 ("openblas" ,openblas)
2265 ("python" ,python-wrapper)))
2266 (home-page "https://github.com/flame/libflame")
2267 (synopsis "High-performance object-based library for DLA computations")
2268 (description "@code{libflame} is a portable library for dense matrix
2269 computations, providing much of the functionality present in LAPACK, developed
2270 by current and former members of the @acronym{SHPC, Science of High-Performance
2271 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
2272 Computational Engineering and Sciences} at The University of Texas at Austin.
2273 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
2274 includes a complete LAPACK implementation.")
2275 (license license:bsd-3)))
2277 (define-public libpotassco
2278 ;; No public release, update together with clasp
2279 (let ((revision "1")
2280 (commit "2f9fb7ca2c202f1b47643aa414054f2f4f9c1821"))
2282 (name "libpotassco")
2283 (version (git-version "0.0" revision commit))
2287 (url "https://github.com/potassco/libpotassco")
2289 (file-name (git-file-name name version))
2292 "1c32f9gqclf7qx07lpx8wd720vfhkjqhzc6nyy8mjmgwpmb3iyyn"))))
2294 `(#:configure-flags '("-DLIB_POTASSCO_BUILD_TESTS=on"
2295 "-DLIB_POTASSCO_INSTALL_LIB=on"
2296 "-DBUILD_SHARED_LIBS=on")
2298 (modify-phases %standard-phases
2299 (add-after 'unpack 'patch-cmake
2301 (substitute* "CMakeLists.txt"
2302 ;; clasp expects lowercase potassco and include directory is
2303 ;; lowercase as well, so let's use that
2304 (("\"cmake/Potassco\"") "\"cmake/potassco\"")
2305 (("PotasscoConfig\\.cmake") "potassco-config.cmake")
2306 (("PotasscoConfigVersion\\.cmake")
2307 "potassco-config-version.cmake"))
2308 (rename-file "cmake/PotasscoConfig.cmake.in"
2309 "cmake/potassco-config.cmake.in"))))))
2310 (build-system cmake-build-system)
2311 (home-page "https://potassco.org/")
2312 (synopsis "Utility library for Potassco's projects")
2313 (description "@code{libpotassco} is a utility library providing functions
2316 @item parsing, writing, and converting logic programs in aspif and smodels
2318 @item passing information between a grounder and a solver,
2319 @item and defining and parsing command-line options and for creating
2320 command-line applications.
2322 Furthermore, it comes with the tool @command{lpconvert} that converts either
2323 between aspif and smodels format or to a human-readable text format.")
2324 (license license:expat))))
2326 (define-public clasp
2333 (url "https://github.com/potassco/clasp")
2334 (commit (string-append "v" version))))
2335 (file-name (git-file-name name version))
2338 "0rahqiq530jckvx717858h1q5p8znp1kb6sjm95p8blkr4n3pvmj"))))
2339 (build-system cmake-build-system)
2341 `(#:configure-flags '("-DCLASP_BUILD_TESTS=on"
2342 "-DCLASP_INSTALL_LIB=on"
2343 "-DCLASP_USE_LOCAL_LIB_POTASSCO=off"
2344 "-DBUILD_SHARED_LIBS=on")
2346 (modify-phases %standard-phases
2347 (add-after 'unpack 'patch-cmake
2349 (substitute* "CMakeLists.txt"
2350 ;; Use lowercase to be consistent with libpotassco
2351 (("\"cmake/Clasp\"") "\"cmake/clasp\"")
2352 (("ClaspConfig\\.cmake") "clasp-config.cmake")
2353 (("ClaspConfigVersion\\.cmake")
2354 "clasp-config-version.cmake"))
2355 (substitute* "cmake/ClaspConfig.cmake.in"
2356 (("find_package\\(Potassco") "find_package(potassco"))
2357 (rename-file "cmake/ClaspConfig.cmake.in"
2358 "cmake/clasp-config.cmake.in"))))))
2361 (home-page "https://potassco.org/")
2362 (synopsis "Answer set solver")
2363 (description "clasp is an answer set solver for (extended) normal and
2364 disjunctive logic programs. The primary algorithm of clasp relies on
2365 conflict-driven nogood learning, a technique that proved very successful for
2366 satisfiability checking (SAT).")
2367 (license license:expat)))
2369 (define-public clingo
2376 (url "https://github.com/potassco/clingo")
2377 (commit (string-append "v" version))))
2378 (file-name (git-file-name name version))
2381 "0rfjwkcwm0mmf3r4i7asyjwb6cia4i7px7fn2kdbi9j85qvas4pb"))))
2382 (build-system cmake-build-system)
2384 `(#:configure-flags `("-DCLINGO_BUILD_TESTS=on"
2385 "-DCLINGO_INSTALL_LIB=on"
2386 "-DCLINGO_BUILD_STATIC=off"
2387 "-DCLINGO_BUILD_SHARED=on"
2388 ;; XXX: Clingo requries private headers and
2389 ;; sources from clasp
2391 "-DCLASP_SOURCE_DIR="
2392 (assoc-ref %build-inputs "clasp-src")))
2394 (modify-phases %standard-phases
2395 (add-after 'unpack 'patch-cmake
2397 (substitute* "CMakeLists.txt"
2398 (("add_subdirectory\\(clasp\\)")
2399 "find_package(clasp REQUIRED)"))
2400 (substitute* "libclingo/CMakeLists.txt"
2401 (("\"cmake/Clingo\"") "\"cmake/clingo\"")
2402 (("ClingoConfig\\.cmake") "clingo-config.cmake")
2403 (("ClingoConfigVersion\\.cmake")
2404 "clingo-config-version.cmake"))
2405 (substitute* "cmake/ClingoConfig.cmake.in"
2406 (("find_package\\(Clasp") "find_package(clasp"))
2407 (rename-file "cmake/ClingoConfig.cmake.in"
2408 "cmake/clingo-config.cmake.in")))
2409 (add-after 'unpack 'skip-failing-tests
2411 (with-directory-excursion "libclingo/tests"
2412 (substitute* "CMakeLists.txt"
2413 (("COMMAND test_clingo" all)
2416 "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\"")))
2417 (call-with-output-file "good.txt"
2419 (for-each (lambda (test) (format port "~s~%" test))
2420 '("parse-ast-v2" "add-ast-v2" "build-ast-v2"
2421 "unpool-ast-v2" "parse_term"
2422 "propagator" "propgator-sequence-mining"
2423 "symbol" "visitor"))))))))))
2425 (list clasp libpotassco))
2427 `(("clasp-src" ,(package-source clasp))))
2428 (home-page "https://potassco.org/")
2429 (synopsis "Grounder and solver for logic programs")
2430 (description "Clingo computes answer sets for a given logic program.")
2431 (license license:expat)))
2433 (define-public ceres
2435 (name "ceres-solver")
2437 (home-page "http://ceres-solver.org/")
2440 (uri (string-append home-page "ceres-solver-"
2444 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
2445 (build-system cmake-build-system)
2447 ;; TODO: Build HTML user documentation and install separately.
2448 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
2449 "-DBUILD_SHARED_LIBS=ON")
2451 #:phases (modify-phases %standard-phases
2452 (add-before 'configure 'set-library-directory
2454 ;; Install libraries to lib/, not lib64/.
2455 (substitute* "CMakeLists.txt"
2456 (("set\\(LIB_SUFFIX \"64\"\\)")
2457 "set(LIB_SUFFIX \"\")")))))))
2461 (list glog)) ;for #include <glog/glog.h>
2466 ("suitesparse" ,suitesparse)
2467 ("gflags" ,gflags)))
2468 (synopsis "C++ library for solving large optimization problems")
2470 "Ceres Solver is a C++ library for modeling and solving large,
2471 complicated optimization problems. It is a feature rich, mature and
2472 performant library which has been used in production since 2010. Ceres Solver
2473 can solve two kinds of problems:
2475 @item non-linear least squares problems with bounds constraints;
2476 @item general unconstrained optimization problems.
2478 (license license:bsd-3)
2480 ;; Mark as tunable to take advantage of SIMD code in Eigen.
2481 (properties `((tunable? . #t)))))
2483 ;; For a fully featured Octave, users are strongly recommended also to install
2484 ;; the following packages: less, ghostscript, gnuplot.
2485 (define-public octave-cli
2492 (uri (string-append "mirror://gnu/octave/octave-"
2496 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2497 (build-system gnu-build-system)
2499 `(("alsa-lib" ,alsa-lib)
2500 ("arpack" ,arpack-ng)
2506 ("fontconfig" ,fontconfig)
2507 ("freetype" ,freetype)
2511 ("graphicsmagick" ,graphicsmagick)
2513 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2514 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2515 ;; libtiff.la instead of having to provide it here.
2516 ("libjpeg" ,libjpeg-turbo)
2520 ("libsndfile" ,libsndfile)
2524 ("portaudio" ,portaudio)
2526 ("readline" ,readline)
2527 ("suitesparse" ,suitesparse)
2528 ("texinfo" ,texinfo)
2534 ;; The following inputs are not actually used in the build process.
2535 ;; However, the ./configure gratuitously tests for their existence and
2536 ;; assumes that programs not present at build time are also not, and
2537 ;; can never be, available at run time! If these inputs are therefore
2538 ;; not present, support for them will be built out. However, Octave
2539 ;; will still run without them, albeit without the features they
2544 ;; Octave code uses this variable to detect directories holding multiple CA
2545 ;; certificates to verify peers with. This is required for the networking
2546 ;; functions that require encryption to work properly.
2547 (native-search-paths
2548 (list (search-path-specification
2549 (variable "CURLOPT_CAPATH")
2550 (files '("etc/ssl/certs")))))
2553 (list (string-append "--with-shell="
2554 (assoc-ref %build-inputs "bash")
2557 ;; XXX: Without this flag, linking octave-cli fails with
2558 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2559 ;; not pulling in liboctinterp.la for -lstdc++.
2560 "--enable-link-all-dependencies")
2562 (modify-phases %standard-phases
2563 (add-after 'configure 'configure-makeinfo
2564 (lambda* (#:key inputs #:allow-other-keys)
2565 (substitute* "libinterp/corefcn/help.h"
2568 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2570 (home-page "https://www.gnu.org/software/octave/")
2571 (synopsis "High-level language for numerical computation (no GUI)")
2572 (description "GNU Octave is a high-level interpreted language that is
2573 specialized for numerical computations. It can be used for both linear and
2574 non-linear applications and it provides great support for visualizing results.
2575 Work may be performed both at the interactive command-line as well as via
2577 (license license:gpl3+)))
2579 (define-public octave
2580 (package (inherit octave-cli)
2583 `(("qscintilla" ,qscintilla)
2585 ,@(package-inputs octave-cli)))
2587 `(("qttools" , qttools) ;for lrelease
2588 ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
2589 ,@(package-native-inputs octave-cli)))
2591 (substitute-keyword-arguments (package-arguments octave-cli)
2593 `(modify-phases ,phases
2594 (add-before 'configure 'patch-qscintilla-library-name
2595 (lambda* (#:key inputs #:allow-other-keys)
2596 ;; The QScintilla library that the Octave configure script tries
2597 ;; to link with should be named libqscintilla-qt5.so, but the
2598 ;; QScintilla input provides the shared library as
2599 ;; libqscintilla2_qt5.so.
2600 (substitute* "configure"
2601 (("qscintilla2-qt5")
2604 (synopsis "High-level language for numerical computation (with GUI)")))
2606 (define-public opencascade-oce
2608 (name "opencascade-oce")
2614 (url "https://github.com/tpaviot/oce")
2615 (commit (string-append "OCE-" version))))
2616 (file-name (git-file-name name version))
2617 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2619 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2620 (build-system cmake-build-system)
2623 (list "-DOCE_TESTING:BOOL=ON"
2624 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2625 "-DOCE_DRAW:BOOL=ON"
2626 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2627 (assoc-ref %outputs "out"))
2628 "-UCMAKE_INSTALL_RPATH")))
2637 `(("python" ,python-wrapper)))
2638 (home-page "https://github.com/tpaviot/oce")
2639 (synopsis "Libraries for 3D modeling and numerical simulation")
2641 "Open CASCADE is a set of libraries for the development of applications
2642 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2643 C++ class libraries providing services for 3D surface and solid modeling, CAD
2644 data exchange, and visualization. It is used for development of specialized
2645 software dealing with 3D models in design (CAD), manufacturing (CAM),
2646 numerical simulation (CAE), measurement equipment (CMM), and quality
2647 control (CAQ) domains.
2649 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2650 patches, improvements, and experiments contributed by users over the official
2651 Open CASCADE library.")
2652 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2653 ; use of header files; see
2654 ; OCCT_LGPL_EXCEPTION.txt
2655 license:public-domain; files
2656 ; src/Standard/Standard_StdAllocator.hxx and
2657 ; src/NCollection/NCollection_StdAllocator.hxx
2658 license:expat; file src/OpenGl/OpenGl_glext.h
2659 license:bsd-3)))); test framework gtest
2661 (define-public opencascade-occt
2663 (name "opencascade-occt")
2669 (url "https://git.dev.opencascade.org/repos/occt.git")
2672 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2674 (file-name (git-file-name name version))
2676 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2677 (modules '((guix build utils)))
2680 ;; Remove files specific to non-free operating systems.
2681 (delete-file-recursively "samples/ios")
2682 (delete-file-recursively "samples/mfc")
2683 (delete-file-recursively "samples/qt/FuncDemo")
2684 (delete-file "genconf.bat")
2685 (delete-file "gendoc.bat")
2686 (delete-file "genproj.bat")
2687 (delete-file "upgrade.bat")
2688 ;; Remove references to deleted files.
2689 (substitute* "dox/FILES_HTML.txt"
2690 ((".*standard.*") "" )
2691 ((".*UIKitSample.*") ""))
2693 (build-system cmake-build-system)
2695 '(;; There is no test target for make. OCCT provides an
2696 ;; 'Automated Testing System', which may be accessed after
2697 ;; installation via the draw.sh script. draw.sh is located in
2698 ;; the bin directory. For details see:
2699 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2700 ;; occt_dev_guides__tests.html
2702 ;; Configure without freeimage: attempting to link against the
2703 ;; freeimage version 3.17 library leads to 'undefined
2704 ;; reference' errors.
2706 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2708 "-DUSE_VTK:BOOL=OFF"
2709 "-DBUILD_DOC_Overview:BOOL=OFF"
2710 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2711 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2712 "-UCMAKE_INSTALL_LIBDIR")))
2715 ;("freeimage" ,freeimage)
2725 ;; TODO: build Overview documentation and add 'doc' output.
2726 (home-page "https://www.opencascade.com")
2727 (synopsis "Libraries for 3D modeling and numerical simulation")
2729 "Open CASCADE is a set of libraries for the development of applications
2730 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2731 C++ class libraries providing services for 3D surface and solid modeling, CAD
2732 data exchange, and visualization. It is used for development of specialized
2733 software dealing with 3D models in design (CAD), manufacturing (CAM),
2734 numerical simulation (CAE), measurement equipment (CMM), and quality
2735 control (CAQ) domains.
2737 This is the certified version of the Open Cascade Technology (OCCT) library.")
2738 (license (list ;; OCCT library:
2739 license:lgpl2.1; with an exception for the use of header
2740 ; files, see OCCT_LGPL_EXCEPTION.txt.
2741 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2742 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2744 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2745 ;; src/StepFile/step.tab.*:
2746 license:gpl3+ ; with Bison 2.2 exception.
2747 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2748 (license:non-copyleft
2749 "https://www.unicode.org/license.html")
2750 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2751 license:public-domain))))
2761 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2763 (string-append "gmsh_"
2764 (string-replace-substring version "." "_")))))
2765 (file-name (git-file-name name version))
2767 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2768 (modules '((guix build utils)))
2771 (delete-file-recursively "contrib/metis")
2773 (build-system cmake-build-system)
2787 `(("fontconfig" ,fontconfig)
2789 ("python" ,python)))
2791 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2792 "-DENABLE_BUILD_SHARED:BOOL=ON"
2793 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2794 #:imported-modules (,@%cmake-build-system-modules
2795 (guix build python-build-system))
2796 #:modules (((guix build python-build-system) #:select (site-packages))
2797 (guix build cmake-build-system)
2800 (modify-phases %standard-phases
2801 (add-after 'unpack 'patch-paths
2802 (lambda* (#:key inputs outputs #:allow-other-keys)
2803 ;; Use the standard Guix site-package path for
2804 ;; installation of the Python API.
2805 (substitute* "CMakeLists.txt"
2806 (("include\\(GNUInstallDirs\\)\n")
2807 (string-append "include(GNUInstallDirs)\n"
2809 (site-packages inputs outputs) ")\n"))
2810 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2811 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2812 ;; Find the shared library.
2813 (let ((libgmsh (string-append (assoc-ref outputs "out")
2814 "/lib/libgmsh.so")))
2815 (substitute* "api/gmsh.py"
2816 (("find_library\\(\"gmsh\"\\)")
2817 (simple-format #f "\"~a\"" libgmsh))))
2819 (home-page "http://gmsh.info/")
2820 (synopsis "3D finite element grid generator")
2821 (description "Gmsh is a 3D finite element grid generator with a built-in
2822 CAD engine and post-processor. Its design goal is to provide a fast, light
2823 and user-friendly meshing tool with parametric input and advanced
2824 visualization capabilities. Gmsh is built around four modules: geometry,
2825 mesh, solver and post-processing. The specification of any input to these
2826 modules is done either interactively using the graphical user interface or in
2827 ASCII text files using Gmsh's own scripting language.")
2828 (license license:gpl2+)))
2830 (define-public veusz
2837 (uri (pypi-uri "veusz" version))
2839 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2840 (build-system python-build-system)
2842 `(;; Tests will fail because they depend on optional packages like
2843 ;; python-astropy, which is not packaged.
2846 (modify-phases %standard-phases
2847 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2848 ;; the path is defined in Guix, therefore we have to change it.
2849 (add-after 'unpack 'fix-sip-dir
2851 (substitute* "pyqtdistutils.py"
2852 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2854 ;; Now we have to pass the correct sip_dir to setup.py.
2856 (lambda* (#:key inputs #:allow-other-keys)
2857 ;; We need to tell setup.py where to locate QtCoremod.sip
2858 ((@@ (guix build python-build-system) call-setuppy)
2860 (list (string-append "--sip-dir="
2861 (assoc-ref inputs "python-pyqt")
2864 ;; Ensure that icons are found at runtime.
2865 (add-after 'install 'wrap-executable
2866 (lambda* (#:key inputs outputs #:allow-other-keys)
2867 (let ((out (assoc-ref outputs "out")))
2868 (wrap-program (string-append out "/bin/veusz")
2869 `("QT_PLUGIN_PATH" prefix
2870 ,(list (string-append (assoc-ref inputs "qtsvg")
2871 "/lib/qt5/plugins/"))))))))))
2874 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2875 qttools python-sip-4))
2877 (list ghostscript ;optional, for EPS/PS output
2879 python-h5py ;optional, for HDF5 data
2884 (list python-numpy))
2885 (home-page "https://veusz.github.io/")
2886 (synopsis "Scientific plotting package")
2888 "Veusz is a scientific plotting and graphing program with a graphical
2889 user interface, designed to produce publication-ready 2D and 3D plots. In
2890 addition it can be used as a module in Python for plotting. It supports
2891 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2892 (license license:gpl2+)))
2894 (define-public maxflow
2897 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2898 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2903 (url "https://github.com/gerddie/maxflow")
2905 (file-name (git-file-name name version))
2908 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2909 (build-system cmake-build-system)
2910 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2911 (synopsis "Library implementing Maxflow algorithm")
2912 (description "An implementation of the maxflow algorithm described in
2913 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2914 Energy Minimization in Computer Vision.\n
2915 Yuri Boykov and Vladimir Kolmogorov.\n
2916 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2918 (license license:gpl3+)))
2920 (define-public petsc
2927 ;; The *-lite-* tarball does not contain the *large* documentation
2928 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2929 "petsc-lite-" version ".tar.gz"))
2931 (base32 "0sm03vpg010q9icidiq587n325m0598cj6hab2rdv85nwyygg74h"))))
2932 (outputs '("out" ; libraries and headers
2933 "examples")) ; ~30MiB of examples
2934 (build-system gnu-build-system)
2936 (list python which))
2938 (list gfortran openblas superlu
2939 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2940 ;; leaving out opengl, as configuration seems to only be for mac
2944 #:test-target "test"
2945 #:parallel-build? #f ; build is parallel by default
2947 #~(list "--with-mpi=0"
2950 (string-append "--with-openblas-dir="
2951 #$(this-package-input "openblas"))
2954 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2955 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2956 #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
2958 #~(modify-phases %standard-phases
2960 ;; PETSc's configure script is actually a python script, so we can't
2961 ;; run it with bash.
2962 (lambda* (#:key outputs (configure-flags '())
2964 (let* ((prefix (assoc-ref outputs "out"))
2965 (flags `(,(string-append "--prefix=" prefix)
2966 ,@configure-flags)))
2967 (format #t "build directory: ~s~%" (getcwd))
2968 (format #t "configure flags: ~s~%" flags)
2969 (apply invoke "./configure" flags)
2971 ;; Generate test scripts with the right shebang.
2972 (substitute* "config/example_template.py"
2973 (("#!/usr/bin/env bash")
2974 (string-append "#!" (which "bash")))))))
2975 (add-after 'configure 'clean-local-references
2976 (lambda* (#:key outputs #:allow-other-keys)
2977 (let ((out (assoc-ref outputs "out")))
2978 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2979 ;; Prevent build directory from leaking into compiled code
2981 ;; Scrub timestamp for reproducibility
2982 ((".*Libraries compiled on.*") ""))
2983 (substitute* (find-files "." "petscvariables")
2984 ;; Do not expose build machine characteristics, set to defaults.
2985 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2986 (("NPMAX = [:digit:]+") "NPMAX = 2")))))
2987 (add-after 'install 'clean-install
2988 ;; Try to keep installed files from leaking build directory names.
2989 (lambda* (#:key inputs outputs #:allow-other-keys)
2990 (let ((out (assoc-ref outputs "out")))
2991 (substitute* (map (lambda (file)
2992 (string-append out "/lib/petsc/conf/" file))
2993 '("petscvariables"))
2995 ;; Make compiler references point to the store
2996 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2997 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2998 (string-append "= " (which compiler))))
2999 ;; PETSc installs some build logs, which aren't necessary.
3000 (for-each (lambda (file)
3001 (let ((f (string-append out "/lib/petsc/conf/" file)))
3002 (when (file-exists? f)
3004 '("configure.log" "make.log" "gmake.log"
3005 "test.log" "error.log" "RDict.db"
3006 "PETScBuildInternal.cmake"
3007 ;; Once installed, should uninstall with Guix
3009 (add-after 'install 'move-examples
3010 (lambda* (#:key outputs #:allow-other-keys)
3011 (let* ((out (assoc-ref outputs "out"))
3012 (examples (assoc-ref outputs "examples"))
3013 (exdir (string-append out "/share/petsc/examples"))
3014 (exdir' (string-append examples "/share/petsc/examples")))
3015 (copy-recursively exdir exdir')
3016 (delete-file-recursively exdir)))))))
3017 (home-page "https://www.mcs.anl.gov/petsc")
3018 (synopsis "Library to solve PDEs")
3019 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
3020 data structures and routines for the scalable (parallel) solution of
3021 scientific applications modeled by partial differential equations.")
3022 (license (license:non-copyleft
3023 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
3025 (define-public petsc-complex
3028 (name "petsc-complex")
3030 (substitute-keyword-arguments (package-arguments petsc)
3031 ((#:configure-flags cf)
3032 #~(cons "--with-scalar-type=complex" #$cf))))
3033 (synopsis "Library to solve PDEs (with complex scalars)")))
3035 (define-public petsc-openmpi
3038 (name "petsc-openmpi")
3040 `(("hdf5" ,hdf5-parallel-openmpi)
3041 ("hypre" ,hypre-openmpi)
3043 ("mumps" ,mumps-openmpi)
3044 ("openmpi" ,openmpi)
3045 ("scalapack" ,scalapack)
3046 ("scotch" ,pt-scotch32)
3047 ,@(package-inputs petsc)))
3049 (substitute-keyword-arguments (package-arguments petsc)
3050 ((#:configure-flags cf)
3051 #~`("--with-hypre=1"
3052 "--with-mpiexec=mpirun"
3055 "--with-scalapack=1"
3057 ,(string-append "--with-mpi-dir="
3058 #$(this-package-input "openmpi"))
3059 ,(string-append "--with-hdf5-include="
3060 #$(this-package-input "hdf5") "/include")
3061 ,(string-append "--with-hdf5-lib="
3062 #$(this-package-input "hdf5") "/lib/libhdf5.a")
3063 ,@(delete "--with-mpi=0" #$cf)))
3065 #~(modify-phases #$phases
3066 (add-before 'configure 'mpi-setup
3067 #$%openmpi-setup)))))
3068 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
3070 (define-public petsc-complex-openmpi
3072 (inherit petsc-complex)
3073 (name "petsc-complex-openmpi")
3075 (modify-inputs (package-inputs petsc-complex)
3078 (substitute-keyword-arguments (package-arguments petsc-complex)
3079 ((#:configure-flags cf)
3080 #~`("--with-mpiexec=mpirun"
3081 ,(string-append "--with-mpi-dir="
3082 #$(this-package-input "openmpi"))
3083 ,@(delete "--with-mpi=0" #$cf)))
3085 #~(modify-phases #$phases
3086 (add-before 'configure 'mpi-setup
3087 #$%openmpi-setup)))))
3088 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
3090 (define-public python-petsc4py
3092 (name "python-petsc4py")
3097 (uri (pypi-uri "petsc4py" version))
3100 "0pxr6qa7p0pmpq0av29lx8lzlrdcfdzj87ynixzr8dn42y13a662"))
3101 (modules '((guix build utils)))
3104 ;; Ensure source file is regenerated in the build phase.
3105 (delete-file "src/petsc4py.PETSc.c")
3106 ;; Remove legacy GC code. See
3107 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
3108 (substitute* "src/PETSc/cyclicgc.pxi"
3109 ((".*gc_refs.*") "" )
3110 ((".*PyGC_Head.*") ""))
3112 (build-system python-build-system)
3115 (modify-phases %standard-phases
3116 (add-before 'build 'pre-build
3118 ;; Define path to PETSc installation.
3119 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3121 (add-before 'check 'mpi-setup
3124 (list python-cython))
3126 `(("petsc" ,petsc-openmpi)
3127 ("python-numpy" ,python-numpy)))
3128 (home-page "https://bitbucket.org/petsc/petsc4py/")
3129 (synopsis "Python bindings for PETSc")
3130 (description "PETSc, the Portable, Extensible Toolkit for
3131 Scientific Computation, is a suite of data structures and routines for
3132 the scalable (parallel) solution of scientific applications modeled by
3133 partial differential equations. It employs the MPI standard for all
3134 message-passing communication. @code{petsc4py} provides Python
3135 bindings to almost all functions of PETSc.")
3136 (license license:bsd-3)))
3138 (define-public python-kiwisolver
3140 (name "python-kiwisolver")
3144 (uri (pypi-uri "kiwisolver" version))
3147 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
3148 (build-system python-build-system)
3149 (home-page "https://github.com/nucleic/kiwi")
3150 (synopsis "Fast implementation of the Cassowary constraint solver")
3152 "Kiwi is an efficient C++ implementation of the Cassowary constraint
3153 solving algorithm. Kiwi has been designed from the ground up to be
3154 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
3155 Cassowary solver with typical use cases gaining a 40x improvement. Memory
3156 savings are consistently > 5x.")
3157 (license license:bsd-3)))
3159 (define-public python2-kiwisolver
3160 (package-with-python2 python-kiwisolver))
3162 (define-public slepc
3169 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
3173 "1ysfm77s5fcissv3q0k5d65mlp93zi4anqg62q3cd25dn66sva5i"))))
3174 (build-system gnu-build-system)
3176 `(("python" ,python)
3178 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
3180 `(("arpack" ,arpack-ng)
3181 ("gfortran" ,gfortran)))
3185 `(#:parallel-build? #f ;build is parallel by default
3187 `(,(string-append "--with-arpack-dir="
3188 (assoc-ref %build-inputs "arpack") "/lib"))
3189 #:make-flags ;honor (parallel-job-count)
3190 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
3191 ,(string-append "PETSCCONFIGDIR="
3192 (assoc-ref %build-inputs "petsc:examples")
3193 "/share/petsc/examples/config"))
3195 (modify-phases %standard-phases
3197 ;; configure is a python script, so we can't run it with bash.
3198 (lambda* (#:key inputs outputs (configure-flags '())
3200 (let* ((prefix (assoc-ref outputs "out"))
3201 (flags `(,(string-append "--prefix=" prefix)
3202 ,@configure-flags)))
3203 (format #t "build directory: ~s~%" (getcwd))
3204 (format #t "configure flags: ~s~%" flags)
3205 (setenv "SLEPC_DIR" (getcwd))
3206 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
3207 (apply invoke "./configure" flags))))
3208 (add-after 'install 'delete-doc
3209 ;; TODO: SLEPc installs HTML documentation alongside headers in
3210 ;; $out/include. We'd like to move them to share/doc, but delete
3211 ;; them for now, as they are incomplete and installing the complete
3212 ;; documentation is difficult.
3213 (lambda* (#:key outputs #:allow-other-keys)
3214 (let* ((out (assoc-ref outputs "out")))
3215 (for-each delete-file (find-files out "\\.html$"))
3217 (add-after 'install 'clean-install
3218 ;; Clean up unnecessary build logs from installation.
3219 (lambda* (#:key outputs #:allow-other-keys)
3220 (let ((out (assoc-ref outputs "out")))
3221 (for-each (lambda (file)
3222 (let ((f (string-append out "/lib/slepc/conf/" file)))
3223 (when (file-exists? f)
3225 '("configure.log" "make.log" "gmake.log"
3226 "test.log" "error.log" "RDict.db"
3229 (home-page "https://slepc.upv.es")
3230 (synopsis "Scalable library for eigenproblems")
3231 (description "SLEPc is a software library for the solution of large sparse
3232 eigenproblems on parallel computers. It can be used for the solution of
3233 linear eigenvalue problems formulated in either standard or generalized form,
3234 as well as other related problems such as the singular value decomposition.
3235 The emphasis of the software is on methods and techniques appropriate for
3236 problems in which the associated matrices are sparse, for example, those
3237 arising after the discretization of partial differential equations.")
3238 (license license:bsd-2)
3240 `((release-monitoring-url . "http://slepc.upv.es/download/")))))
3242 (define-public slepc-complex
3243 (package (inherit slepc)
3244 (name "slepc-complex")
3246 `(("petsc" ,petsc-complex)
3247 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3248 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
3250 (define-public slepc-openmpi
3251 (package (inherit slepc)
3252 (name "slepc-openmpi")
3254 (substitute-keyword-arguments (package-arguments slepc)
3255 ((#:phases phases '%standard-phases)
3256 `(modify-phases ,phases
3257 (add-before 'check 'mpi-setup
3258 ,%openmpi-setup)))))
3261 ,@(alist-delete "arpack" (package-inputs slepc))))
3263 `(("petsc" ,petsc-openmpi)
3264 ("arpack" ,arpack-ng-openmpi)
3265 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3266 (synopsis "Scalable library for eigenproblems (with MPI support)")))
3268 (define-public slepc-complex-openmpi
3269 (package (inherit slepc-openmpi)
3270 (name "slepc-complex-openmpi")
3272 `(("petsc" ,petsc-complex-openmpi)
3273 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
3274 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
3276 (define-public python-slepc4py
3278 (name "python-slepc4py")
3283 (uri (pypi-uri "slepc4py" version))
3286 "0fq997y73ymvcvdrxycp450pxwdgnqaw62gv9rwncfgsfplkvs9w"))))
3287 (build-system python-build-system)
3290 (modify-phases %standard-phases
3291 (add-before 'build 'pre-build
3293 ;; Define path to PETSc installation.
3294 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3295 ;; Define path to SLEPc installation.
3296 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3298 (add-before 'check 'mpi-setup
3301 `(("python-numpy" ,python-numpy)
3302 ("python-petsc4py" ,python-petsc4py)
3303 ("slepc" ,slepc-openmpi)))
3304 (home-page "https://bitbucket.org/slepc/slepc4py/")
3305 (synopsis "Python bindings for SLEPc")
3306 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3307 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3308 Scientific Computation. It employs the MPI standard for all
3309 message-passing communication. @code{slepc4py} provides Python
3310 bindings to almost all functions of SLEPc.")
3311 (license license:bsd-3)))
3313 (define-public metamath
3321 (url "https://github.com/metamath/metamath-exe")
3322 (commit (string-append "v" version))))
3323 (file-name (git-file-name name version))
3325 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3326 (build-system gnu-build-system)
3328 (list autoconf automake))
3329 (home-page "http://us.metamath.org/")
3330 (synopsis "Proof verifier based on a minimalistic formalism")
3332 "Metamath is a tiny formal language and that can express theorems in
3333 abstract mathematics, with an accompyaning @command{metamath} executable that
3334 verifies databases of these proofs. There is a public database,
3335 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3336 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3337 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3338 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3340 (license license:gpl2+)))
3342 (define-public minizinc
3349 (url "https://github.com/MiniZinc/libminizinc")
3351 (file-name (git-file-name name version))
3354 "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
3355 (modules '((guix build utils)
3360 ;; Do not advertise proprietary solvers
3361 (with-directory-excursion "cmake/targets"
3362 (let ((targets '("libminizinc_fzn.cmake"
3363 "libminizinc_gecode.cmake"
3364 "libminizinc_mip.cmake"
3365 "libminizinc_nl.cmake"
3366 "libminizinc_osicbc.cmake"
3367 "libminizinc_parser.cmake"
3371 (for-each delete-file
3374 (member file (cons* "." ".." targets)))
3376 (substitute* "libmzn.cmake"
3377 (("include\\(cmake/targets/(.*)\\)" all target)
3378 (if (member target targets) all "")))))
3379 (with-directory-excursion "include/minizinc/solvers/MIP"
3380 (for-each delete-file
3383 (member file '("." ".."
3384 "MIP_osicbc_solverfactory.hh"
3385 "MIP_osicbc_wrap.hh"
3386 "MIP_solverinstance.hh"
3387 "MIP_solverinstance.hpp"
3390 (with-directory-excursion "solvers/MIP"
3391 (for-each delete-file
3394 (member file '("." ".."
3395 "MIP_osicbc_solverfactory.cpp"
3396 "MIP_osicbc_wrap.cpp"
3397 "MIP_solverinstance.cpp"
3400 (substitute* "CMakeLists.txt"
3401 (("find_package\\(([^ ]*).*\\)" all pkg)
3402 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
3405 ;; TODO: swap out miniz for zlib
3407 (build-system cmake-build-system)
3409 `(#:tests? #f ; no ‘check’ target
3410 #:modules ((guix build cmake-build-system)
3414 (modify-phases %standard-phases
3415 (add-after 'install 'install-solver-configs
3416 (lambda* (#:key inputs outputs #:allow-other-keys)
3417 (let ((gecode (assoc-ref inputs "gecode"))
3418 (pkgdatadir (string-append (assoc-ref outputs "out")
3419 "/share/minizinc")))
3420 (call-with-output-file (string-append pkgdatadir
3421 "/Preferences.json")
3426 [\"\", \"org.gecode.gecode\"],
3427 [\"gecode\", \"org.gecode.gecode\"]
3429 \"solverDefaults\": []
3434 (mkdir-p (string-append pkgdatadir "/solvers"))
3435 (call-with-output-file (string-append pkgdatadir
3436 "/solvers/gecode.msc")
3441 \"id\": \"org.gecode.gecode\",
3442 \"name\": \"Gecode\",
3443 \"description\": \"Gecode FlatZinc executable\",
3447 \"supportsMzn\": false,
3448 \"supportsFzn\": true,
3449 \"needsSolns2Out\": true,
3450 \"needsMznExecutable\": false,
3451 \"needsStdlibDir\": false,
3452 \"isGUIApplication\": false
3454 (last (string-split gecode #\-))
3455 (string-append gecode "/share/gecode/mznlib")
3456 (string-append gecode "/bin/fzn-gecode"))
3457 (newline port)))))))))
3461 (list cbc gecode zlib))
3462 (home-page "https://www.minizinc.org")
3463 (synopsis "High-level constraint modeling language")
3464 (description "MiniZinc is a high-level modeling language for constraint
3465 satisfaction and optimization problems. Models are compiled to FlatZinc, a
3466 language understood by many solvers.")
3467 (license license:mpl2.0)))
3469 (define-public mumps
3476 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
3480 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
3481 (patches (search-patches "mumps-build-parallelism.patch"
3482 "mumps-shared-libseq.patch"
3483 "mumps-shared-mumps.patch"
3484 "mumps-shared-pord.patch"))))
3485 (build-system gnu-build-system)
3487 `(("fortran" ,gfortran)
3488 ;; These are required for linking against mumps, but we let the user
3489 ;; declare the dependency.
3492 ("scotch" ,scotch)))
3494 `(#:modules ((ice-9 match)
3497 ,@%gnu-build-system-modules)
3499 (modify-phases %standard-phases
3501 (lambda* (#:key inputs #:allow-other-keys)
3502 (call-with-output-file "Makefile.inc"
3513 INCSEQ = -I$(topdir)/libseq
3514 LIBSEQ = $(topdir)/libseq/libmpiseq.a
3515 LIBSEQNEEDED = libseqneeded~;
3519 AR = ar vr # rules require trailing space, ugh...
3522 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
3524 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
3525 LIBOTHERS = -pthread
3528 OPTF = -O2 -DALLOW_NON_INIT -fallow-argument-mismatch $(PIC)
3532 LIBS = $(SCALAP) $(LIBSEQ)
3533 LPORDDIR = $(topdir)/PORD/lib
3534 IPORD = -I$(topdir)/PORD/include
3535 LPORD = $(LPORDDIR)/libpord.a
3536 ORDERINGSF = -Dpord~@[
3538 IMETIS = -I$(METISDIR)/include
3539 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3540 ORDERINGSF += -Dmetis~]~@[~:{
3542 ISCOTCH = -I$(SCOTCHDIR)/include
3543 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
3544 ORDERINGSF += ~a~}~]
3545 ORDERINGSC = $(ORDERINGSF)
3546 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
3547 IORDERINGSF = $(ISCOTCH)
3548 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3549 (assoc-ref inputs "mpi")
3550 (assoc-ref inputs "blas")
3551 (assoc-ref inputs "scalapack")
3552 (assoc-ref inputs "metis")
3553 (match (list (assoc-ref inputs "pt-scotch")
3554 (assoc-ref inputs "scotch"))
3558 `((,scotch "" "-Dscotch")))
3561 "-lptesmumps -lptscotch -lptscotcherr "
3562 "-Dptscotch")))))))))
3564 ;; By default only the d-precision library is built. Make with "all"
3565 ;; target so that all precision libraries and examples are built.
3567 (invoke "make" "all"
3568 (format #f "-j~a" (parallel-job-count)))))
3570 ;; Run the simple test drivers, which read test input from stdin:
3571 ;; from the "real" input for the single- and double-precision
3572 ;; testers, and from the "cmplx" input for complex-precision
3573 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3574 ;; package to prefix execution with "mpirun".
3575 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3576 (with-directory-excursion "examples"
3579 (let ((tester (apply open-pipe*
3582 ,(string-append "./" prec
3584 (input (open-input-file
3585 (string-append "input_simpletest_" type))))
3587 (dump-port input tester)
3589 (zero? (close-pipe tester)))))
3591 '("real" "real" "cmplx" "cmplx")))))
3593 (lambda* (#:key outputs #:allow-other-keys)
3594 (let* ((out (assoc-ref outputs "out"))
3595 (libdir (string-append out "/lib")))
3596 (copy-recursively "lib" libdir)
3597 (copy-recursively "include" (string-append out "/include"))
3598 (when (file-exists? "libseq/libmpiseq.a")
3599 (install-file "libseq/libmpiseq.a" libdir))
3600 (when (file-exists? "libseq/libmpiseq.so")
3601 (install-file "libseq/libmpiseq.so" libdir))
3603 (home-page "http://mumps.enseeiht.fr")
3604 (synopsis "Multifrontal sparse direct solver")
3606 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3607 sparse system of linear equations A x = b using Gaussian elimination.")
3608 (license license:cecill-c)))
3610 (define-public mumps-metis
3611 (package (inherit mumps)
3612 (name "mumps-metis")
3614 (alist-delete "scotch" (package-inputs mumps)))))
3616 (define-public mumps-openmpi
3617 (package (inherit mumps)
3618 (name "mumps-openmpi")
3621 ("scalapack" ,scalapack)
3622 ("pt-scotch" ,pt-scotch)
3623 ,@(alist-delete "scotch" (package-inputs mumps))))
3625 (substitute-keyword-arguments (package-arguments mumps)
3627 `(modify-phases ,phases
3628 (add-before 'check 'mpi-setup
3632 ((assoc-ref ,phases 'check)
3633 #:exec-prefix '("mpirun" "-n" "2"))))))))
3634 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3636 (define-public mumps-metis-openmpi
3637 (package (inherit mumps-openmpi)
3638 (name "mumps-metis-openmpi")
3640 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3642 (define-public ruby-asciimath
3644 (name "ruby-asciimath")
3649 (uri (rubygems-uri "asciimath" version))
3652 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3653 (build-system ruby-build-system)
3655 (list ruby-nokogiri ruby-rspec))
3656 (synopsis "AsciiMath parsing and conversion library")
3658 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3659 easy-to-write markup language for mathematics.")
3660 (home-page "https://github.com/asciidoctor/asciimath")
3661 (license license:expat)))
3663 (define-public superlu
3670 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3671 "superlu_" version ".tar.gz"))
3673 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3674 (modules '((guix build utils)))
3676 ;; Replace the non-free implementation of MC64 with a stub adapted
3679 (use-modules (ice-9 regex)
3681 (call-with-output-file "SRC/mc64ad.c"
3686 void mc64id_(int *a) {
3687 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3690 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3691 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3692 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3695 ;; Remove the corresponding license verbiage. MC64 license follows
3696 ;; a "------" line separator.
3697 (with-atomic-file-replacement "License.txt"
3698 (let ((rx (make-regexp "-{8}")))
3701 (let ((line (read-line in 'concat)))
3702 (unless (regexp-exec rx line)
3706 (build-system cmake-build-system)
3710 `(("blas" ,openblas)
3711 ("gfortran" ,gfortran)))
3713 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3714 "-DTPL_BLAS_LIBRARIES=openblas"
3715 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3716 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3717 (synopsis "Supernodal direct solver for sparse linear systems")
3719 "SuperLU is a general purpose library for the direct solution of large,
3720 sparse, nonsymmetric systems of linear equations on high performance machines.
3721 The library is written in C and is callable from either C or Fortran. The
3722 library routines perform an LU decomposition with partial pivoting and
3723 triangular system solves through forward and back substitution. The library
3724 also provides threshold-based ILU factorization preconditioners.")
3725 (license (list license:bsd-3
3726 license:gpl2+ ;EXAMPLE/*fgmr.c
3727 (license:fsf-free "file://SRC/colamd.h")))))
3729 (define-public superlu-dist
3731 (name "superlu-dist")
3737 (url "https://github.com/xiaoyeli/superlu_dist")
3738 (commit (string-append "v" version))))
3739 (file-name (git-file-name name version))
3741 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3742 (modules '((guix build utils)))
3744 ;; Replace the non-free implementation of MC64 with a stub
3746 (make-file-writable "SRC/mc64ad_dist.c")
3747 (call-with-output-file "SRC/mc64ad_dist.c"
3752 void mc64id_dist(int *a) {
3753 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3756 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3757 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3758 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3761 (substitute* "SRC/util.c" ;adjust default algorithm
3762 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3763 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3764 ;; general (i.e. non-square) processor-grid support.
3765 "RowPerm = NOROWPERM;"))
3767 (patches (search-patches "superlu-dist-scotchmetis.patch"
3768 "superlu-dist-awpm-grid.patch"))))
3769 (build-system cmake-build-system)
3773 `(("gfortran" ,gfortran)
3776 ("combblas" ,combinatorial-blas)))
3778 `(("mpi" ,openmpi) ;headers include MPI heades
3779 ("parmetis" ,pt-scotch32 "metis")
3780 ("pt-scotch" ,pt-scotch32)))
3782 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3783 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3784 "-DTPL_ENABLE_COMBBLASLIB=YES"
3785 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3786 "-DTPL_LAPACK_LIBRARIES=-llapack"
3787 (string-append "-DTPL_PARMETIS_LIBRARIES="
3789 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3790 "scotchmetis" "scotch" "scotcherr")
3792 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3793 (assoc-ref %build-inputs "parmetis")
3795 "-DTPL_ENABLE_COMBBLASLIB=ON"
3796 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3797 (assoc-ref %build-inputs "combblas")
3798 "/include/CombBLAS;"
3799 (assoc-ref %build-inputs "combblas")
3800 "/include/BipartiteMatchings")
3801 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3803 (modify-phases %standard-phases
3804 (add-before 'configure 'set-c++-standard
3806 (substitute* "CMakeLists.txt"
3807 ;; AWPM headers require C++14
3808 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3809 (add-before 'check 'mpi-setup
3811 (add-before 'check 'omp-setup
3812 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3813 (home-page (package-home-page superlu))
3814 (synopsis "Parallel supernodal direct solver")
3816 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3817 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3818 implemented in ANSI C, and MPI for communications.")
3819 (license license:bsd-3)))
3821 (define-public scotch
3828 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3829 "latestfile/298/scotch_" version ".tar.gz"))
3831 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3832 (patches (search-patches "scotch-build-parallelism.patch"
3833 "scotch-integer-declarations.patch"))))
3834 (build-system gnu-build-system)
3838 (list flex bison gfortran))
3839 (outputs '("out" "metis"))
3841 `(#:make-flags (list (string-append "prefix=" %output))
3843 (modify-phases %standard-phases
3845 'unpack 'chdir-to-src
3846 (lambda _ (chdir "src") #t))
3850 (call-with-output-file "Makefile.inc"
3865 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3866 LDFLAGS = -lz -lm -lrt -lpthread
3868 LEX = flex -Pscotchyy -olex.yy.c
3873 YACC = bison -pscotchyy -y -b y
3875 '("COMMON_FILE_COMPRESS_GZ"
3877 "COMMON_RANDOM_FIXED_SEED"
3878 "INTSIZE64" ;use 'int64_t'
3879 ;; Prevents symbol clashes with libesmumps
3881 ;; XXX: Causes invalid frees in superlu-dist tests
3883 ;; "SCOTCH_PTHREAD_NUMBER=2"
3884 "restrict=__restrict"))))
3886 (add-after 'build 'build-esmumps
3889 (format #f "-j~a" (parallel-job-count))
3891 (add-before 'install 'make-install-dirs
3892 (lambda* (#:key outputs #:allow-other-keys)
3893 (mkdir (assoc-ref outputs "out"))))
3894 (add-after 'install 'install-metis
3895 (lambda* (#:key outputs #:allow-other-keys)
3896 (let ((out (assoc-ref outputs "metis")))
3898 ;; metis files are not installed with 'make install'
3899 (for-each (lambda (f)
3900 (install-file f (string-append out "/include")))
3901 (find-files "../include/" ".*metis\\.h"))
3902 (for-each (lambda (f)
3903 (install-file f (string-append out "/lib")))
3904 (find-files "../lib/" ".*metis\\..*"))
3906 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3908 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3909 (synopsis "Programs and libraries for graph algorithms")
3910 (description "SCOTCH is a set of programs and libraries which implement
3911 the static mapping and sparse matrix reordering algorithms developed within
3912 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3913 conquer approach, to scientific computing problems such as graph and mesh
3914 partitioning, static mapping, and sparse matrix ordering, in application
3915 domains ranging from structural mechanics to operating systems or
3917 ;; See LICENSE_en.txt
3918 (license license:cecill-c)))
3920 (define-public scotch32
3921 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3922 ;; some applications.
3923 (package (inherit scotch)
3926 (substitute-keyword-arguments (package-arguments scotch)
3927 ((#:phases scotch-phases)
3928 `(modify-phases ,scotch-phases
3932 (call-with-output-file "Makefile.inc"
3947 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3948 LDFLAGS = -lz -lm -lrt -lpthread
3950 LEX = flex -Pscotchyy -olex.yy.c
3955 YACC = bison -pscotchyy -y -b y
3957 '("COMMON_FILE_COMPRESS_GZ"
3959 "COMMON_RANDOM_FIXED_SEED"
3960 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3961 ;; Prevents symbolc clashes with libesmumps
3963 ;; XXX: Causes invalid frees in superlu-dist tests
3965 ;; "SCOTCH_PTHREAD_NUMBER=2"
3966 "restrict=__restrict"))))))))))
3968 "Programs and libraries for graph algorithms (32-bit integers)")))
3970 (define-public scotch-shared
3971 (package (inherit scotch)
3972 (name "scotch-shared")
3974 (list gcc flex bison))
3976 (substitute-keyword-arguments (package-arguments scotch)
3977 ((#:phases scotch-shared-phases)
3978 `(modify-phases ,scotch-shared-phases
3982 ;; Otherwise, the RUNPATH will lack the final path component.
3983 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3984 (assoc-ref %outputs "out") "/lib"))
3985 (call-with-output-file "Makefile.inc"
3993 ARFLAGS = -shared -o
4000 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
4001 CLIBFLAGS = -shared -fPIC
4002 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
4004 LEX = flex -Pscotchyy -olex.yy.c
4009 YACC = bison -pscotchyy -y -b y
4011 '("COMMON_FILE_COMPRESS_GZ"
4013 "COMMON_RANDOM_FIXED_SEED"
4014 "INTSIZE64" ;use 'int64_t'
4015 ;; Prevents symbolc clashes with libesmumps
4017 ;; XXX: Causes invalid frees in superlu-dist tests
4019 ;; "SCOTCH_PTHREAD_NUMBER=2"
4020 "restrict=__restrict"
4024 "Programs and libraries for graph algorithms (shared libraries version)")))
4026 (define-public pt-scotch
4027 (package (inherit scotch)
4030 (list openmpi)) ;Headers include MPI headers
4032 (substitute-keyword-arguments (package-arguments scotch)
4033 ((#:phases scotch-phases)
4034 `(modify-phases ,scotch-phases
4038 (invoke "make" (format #f "-j~a" (parallel-job-count))
4039 "ptscotch" "ptesmumps")
4041 ;; Install the serial metis compatibility library
4042 (invoke "make" "-C" "libscotchmetis" "install")))
4043 (add-before 'check 'mpi-setup
4047 (invoke "make" "ptcheck")))))))
4048 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
4050 (define-public pt-scotch32
4051 (package (inherit scotch32)
4052 (name "pt-scotch32")
4054 (list openmpi)) ;headers include MPI headers
4056 (substitute-keyword-arguments (package-arguments scotch32)
4057 ((#:phases scotch32-phases)
4058 `(modify-phases ,scotch32-phases
4061 (invoke "make" (format #f "-j~a" (parallel-job-count))
4062 "ptscotch" "ptesmumps")
4063 ;; Install the serial metis compatibility library
4064 (invoke "make" "-C" "libscotchmetis" "install")))
4065 (add-before 'check 'mpi-setup
4069 (invoke "make" "ptcheck")))))))
4071 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
4073 (define-public pt-scotch-shared
4074 (package (inherit scotch-shared)
4075 (name "pt-scotch-shared")
4077 (list openmpi)) ;Headers include MPI headers
4079 (substitute-keyword-arguments (package-arguments scotch-shared)
4080 ((#:phases scotch-shared-phases)
4081 `(modify-phases ,scotch-shared-phases
4085 (invoke "make" (format #f "-j~a" (parallel-job-count))
4086 "ptscotch" "ptesmumps")
4088 ;; Install the serial metis compatibility library
4089 (invoke "make" "-C" "libscotchmetis" "install")))
4090 (add-before 'check 'mpi-setup
4091 ,%openmpi-setup)))))
4092 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
4095 (define-public metis
4102 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
4103 "metis-" version ".tar.gz"))
4106 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
4108 `((release-monitoring-url
4109 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
4110 (build-system cmake-build-system)
4112 `(("blas" ,openblas)))
4114 `(#:tests? #f ;no tests
4115 #:configure-flags `("-DSHARED=ON"
4116 ,(string-append "-DGKLIB_PATH=" (getcwd)
4117 "/metis-" ,version "/GKlib"))))
4118 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
4119 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
4121 "METIS is a set of serial programs for partitioning graphs, partitioning
4122 finite element meshes, and producing fill-reducing orderings for sparse
4123 matrices. The algorithms implemented in METIS are based on the multilevel
4124 recursive-bisection, multilevel k-way, and multi-constraint partitioning
4126 (license license:asl2.0))) ;As of version 5.0.3
4128 (define-public p4est
4135 (uri (string-append "http://p4est.github.io/release/p4est-"
4139 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
4140 (build-system gnu-build-system)
4142 `(("fortran" ,gfortran)
4147 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
4148 (assoc-ref %build-inputs "blas")
4150 ,(string-append "LAPACK_LIBS=-L"
4151 (assoc-ref %build-inputs "lapack")
4153 #:phases (modify-phases %standard-phases
4154 (add-before 'check 'mpi-setup
4156 (home-page "http://www.p4est.org")
4157 (synopsis "Adaptive mesh refinement on forests of octrees")
4159 "The p4est software library enables the dynamic management of a
4160 collection of adaptive octrees, conveniently called a forest of octrees.
4161 p4est is designed to work in parallel and scales to hundreds of thousands of
4163 (license license:gpl2+)))
4165 (define-public p4est-openmpi
4166 (package (inherit p4est)
4167 (name "p4est-openmpi")
4170 ,@(package-inputs p4est)))
4172 (substitute-keyword-arguments (package-arguments p4est)
4173 ((#:configure-flags cf)
4174 ``("--enable-mpi" ,@,cf))))
4175 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
4177 (define-public gsegrafix
4178 ;; This is an old and equally dead "experimental fork" of the longer-dead
4179 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
4180 ;; libraries, instead rendering plots with Pango.
4187 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
4188 "gsegrafix-experimental-" version ".tar.gz"))
4190 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
4191 (build-system gnu-build-system)
4194 (list "--disable-static")))
4199 (home-page "https://www.gnu.org/software/gsegrafix/")
4200 (synopsis "GNOME application to create scientific and engineering plots")
4202 "GSEGrafix is an application which produces high-quality graphical
4203 plots for science and engineering. Plots are specified via simple ASCII
4204 parameter files and data files and are presented in an anti-aliased GNOME
4205 canvas. The program supports rectangular two-dimensional plots, histograms,
4206 polar-axis plots and three-dimensional plots. Plots can be printed or saved
4207 to BMP, JPEG or PNG image formats.")
4208 (license license:gpl3+)))
4210 (define-public maxima
4217 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
4218 version "-source/" name "-" version ".tar.gz"))
4221 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
4222 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
4223 (build-system gnu-build-system)
4225 `(("bash" ,bash-minimal)
4226 ("gnuplot" ,gnuplot) ;for plots
4229 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
4231 (list texinfo perl python))
4234 ,#~(list "--enable-sbcl"
4235 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
4236 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
4237 (string-append "--with-wish=" #$tk "/bin/wish"
4238 #$(version-major+minor (package-version tk))))
4239 ;; By default Maxima attempts to write temporary files to
4240 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
4241 ;; Work around that.
4242 #:make-flags (list "TMPDIR=/tmp")
4244 (modify-phases %standard-phases
4245 (add-after 'unpack 'patch-paths
4246 (lambda* (#:key inputs #:allow-other-keys)
4247 (let* ((sed (search-input-file inputs "/bin/sed"))
4248 (coreutils (assoc-ref inputs "coreutils"))
4249 (dirname (string-append coreutils "/bin/dirname"))
4250 (head (string-append coreutils "/bin/head"))
4251 (perl (search-input-file inputs "/bin/perl"))
4252 (python (search-input-file inputs "/bin/python3")))
4253 (substitute* "src/maxima.in"
4254 (("sed ") (string-append sed " "))
4255 (("dirname") dirname)
4257 (substitute* "doc/info/Makefile.in"
4258 (("/usr/bin/env perl") perl))
4259 (substitute* "doc/info/build_html.sh.in"
4260 (("python") python))
4262 (add-before 'check 'pre-check
4264 (chmod "src/maxima" #o555)
4268 ;; This is derived from the testing code in the "debian/rules" file
4269 ;; of Debian's Maxima package.
4270 ;; If Maxima can successfully run this, the binary to be installed
4276 "--batch-string=\"run_testsuite();\" "
4277 "| grep -q \"No unexpected errors found\""))))
4278 ;; Make sure the doc and emacs files are found in the
4279 ;; standard location. Also configure maxima to find gnuplot
4280 ;; without having it on the PATH.
4281 (add-after 'install 'post-install
4282 (lambda* (#:key outputs inputs #:allow-other-keys)
4283 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
4284 (out (assoc-ref outputs "out"))
4285 (datadir (string-append out "/share/maxima/" ,version))
4286 (binutils (dirname (search-input-file inputs "/bin/as"))))
4287 (with-directory-excursion out
4288 (mkdir-p "share/emacs")
4289 (mkdir-p "share/doc")
4291 (string-append datadir "/doc/")
4292 (string-append out "/share/doc/maxima"))
4293 (with-atomic-file-replacement
4294 (string-append datadir "/share/maxima-init.lisp")
4296 (format out "~a ~s~a~%"
4297 "(setf $gnuplot_command "
4298 (string-append gnuplot "/bin/gnuplot") ")")
4299 (dump-port in out))))
4300 ;; Ensure that Maxima will have access to the GNU binutils
4301 ;; components at runtime.
4302 (wrap-program (string-append out "/bin/maxima")
4303 `("PATH" prefix (,binutils))))
4305 (home-page "https://maxima.sourceforge.io")
4306 (synopsis "Numeric and symbolic expression manipulation")
4307 (description "Maxima is a system for the manipulation of symbolic and
4308 numerical expressions. It yields high precision numeric results by using
4309 exact fractions, arbitrary precision integers, and variable precision floating
4311 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
4312 ;; Others simply say "GNU General Public License" without stating a
4313 ;; version (which implicitly means gpl1+).
4314 ;; At least one file (src/maxima.asd) says "version 2."
4315 ;; GPLv2 only is therefore the smallest subset.
4316 (license license:gpl2)))
4318 (define-public wxmaxima
4326 (url "https://github.com/wxMaxima-developers/wxmaxima")
4327 (commit (string-append "Version-" version))))
4328 (file-name (git-file-name name version))
4330 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
4331 (build-system cmake-build-system)
4333 `(("gettext" ,gettext-minimal)))
4342 `(#:tests? #f ; tests fail non-deterministically
4344 (modify-phases %standard-phases
4345 (add-after 'unpack 'patch-doc-path
4347 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
4348 ;; documentation. Only licensing information is placed there by
4350 (substitute* "src/Dirstructure.cpp"
4351 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
4353 (add-after 'install 'wrap-program
4354 (lambda* (#:key inputs outputs #:allow-other-keys)
4355 (wrap-program (string-append (assoc-ref outputs "out")
4358 (,(string-append (assoc-ref inputs "maxima")
4360 ;; For GtkFileChooserDialog.
4361 `("GSETTINGS_SCHEMA_DIR" =
4362 (,(string-append (assoc-ref inputs "gtk+")
4363 "/share/glib-2.0/schemas")))
4364 `("XDG_DATA_DIRS" ":" prefix
4365 (;; Needed by gdk-pixbuf to know supported icon formats.
4367 (assoc-ref inputs "shared-mime-info") "/share")
4368 ;; The default icon theme of GTK+.
4370 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
4372 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
4373 (synopsis "Graphical user interface for the Maxima computer algebra system")
4375 "wxMaxima is a graphical user interface for the Maxima computer algebra
4376 system. It eases the use of Maxima by making most of its commands available
4377 through a menu system and by providing input dialogs for commands that require
4378 more than one argument. It also implements its own display engine that
4379 outputs mathematical symbols directly instead of depicting them with ASCII
4382 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
4383 text and mathematical calculations to create documents, exporting of input and
4384 output to TeX, and a browser for Maxima's manual including command index and
4385 full text searching.")
4386 (license license:gpl2+)))
4388 (define-public armadillo
4394 (uri (string-append "mirror://sourceforge/arma/armadillo-"
4398 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
4399 (build-system cmake-build-system)
4400 (arguments `(#:tests? #f)) ; no test target
4402 `(("openblas" ,openblas)
4404 ("arpack" ,arpack-ng)))
4405 (home-page "http://arma.sourceforge.net/")
4406 (synopsis "C++ linear algebra library")
4408 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4409 between speed and ease of use. It is useful for algorithm development
4410 directly in C++, or quick conversion of research code into production
4411 environments. It can be used for machine learning, pattern recognition,
4412 signal processing, bioinformatics, statistics, econometrics, etc. The library
4413 provides efficient classes for vectors, matrices and cubes, as well as 150+
4414 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4415 (license license:asl2.0)))
4417 (define-public muparser
4418 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4419 ;; different hash. In order to make `guix package --upgrade` work correctly,
4420 ;; we set a Guix packaging revision.
4421 ;; When the next version of muparser is released, we can remove
4422 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4423 (let ((upstream-version "2.2.5")
4427 (version (string-append upstream-version "-" revision))
4432 (url "https://github.com/beltoforion/muparser")
4433 (commit (string-append "v" upstream-version))))
4434 (file-name (git-file-name name version))
4436 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4437 (build-system gnu-build-system)
4439 `(#:configure-flags '("--enable-samples=no")
4440 #:tests? #f)) ;no "check" target
4441 (home-page "http://muparser.beltoforion.de/")
4442 (synopsis "Fast parser library for mathematical expressions")
4444 "muParser is an extensible high performance math parser library. It is
4445 based on transforming an expression into a bytecode and precalculating constant
4447 (license license:expat))))
4449 (define-public openblas
4457 (url "https://github.com/xianyi/OpenBLAS")
4458 (commit (string-append "v" version))))
4459 (file-name (git-file-name name version))
4462 "17zdd8asylz2w71hczrz5y344p6d5ds1jn4901maw7zcp3dbk63g"))))
4463 (build-system gnu-build-system)
4465 `(#:test-target "test"
4466 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4467 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4468 ;; we need to disable substitutions.
4470 ,(let ((system (or (%current-target-system) (%current-system))))
4471 (or (string-prefix? "x86_64" system)
4472 (string-prefix? "i686" system)
4473 (string-prefix? "mips" system)
4474 (string-prefix? "aarch64" system)))
4476 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4478 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4479 "NO_STATIC=1" ;avoid a 67 MiB static archive
4481 ;; This is the maximum number of threads OpenBLAS will ever use (that
4482 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4483 ;; is used.) If we don't set it, the makefile sets it to the number
4484 ;; of cores of the build machine, which is obviously wrong.
4487 ;; Build the library for all supported CPUs. This allows
4488 ;; switching CPU targets at runtime with the environment variable
4489 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4490 ;; Unfortunately, this is not supported on all architectures,
4491 ;; where it leads to failed builds.
4492 ,@(let ((system (or (%current-target-system) (%current-system))))
4494 ((or (string-prefix? "x86_64" system)
4495 (string-prefix? "i686" system)
4496 (string-prefix? "powerpc64le" system)
4497 (string-prefix? "aarch64" system))
4498 ;; Dynamic older enables a few extra CPU architectures that
4499 ;; were released before 2010.
4500 '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
4501 ;; On some of these architectures the CPU can't be detected.
4502 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4503 ;; two available MIPS targets special extended instructions
4504 ;; for Loongson cores are used.
4505 ((string-prefix? "mips" system)
4506 '("TARGET=SICORTEX"))
4507 ;; Failed to detect CPU.
4508 ((string-prefix? "armhf" system)
4511 ;; no configure script
4513 (modify-phases %standard-phases
4515 (add-before 'build 'set-extralib
4516 (lambda* (#:key inputs #:allow-other-keys)
4517 ;; Get libgfortran found when building in utest.
4519 (string-append "-L" (assoc-ref inputs "fortran-lib")
4522 `(("fortran-lib" ,gfortran "lib")))
4525 ("fortran" ,gfortran)
4527 (home-page "https://www.openblas.net/")
4528 (synopsis "Optimized BLAS library based on GotoBLAS")
4530 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4531 (license license:bsd-3)))
4533 (define-public openblas-ilp64
4534 (package/inherit openblas
4535 (name "openblas-ilp64")
4536 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4538 (substitute-keyword-arguments (package-arguments openblas)
4539 ((#:make-flags flags '())
4540 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4542 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4543 (license license:bsd-3)))
4549 (home-page "https://github.com/flame/blis")
4552 (uri (git-reference (url home-page) (commit version)))
4555 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4556 (file-name (git-file-name "blis" version))))
4559 (build-system gnu-build-system)
4562 ((guix build gnu-build-system)
4565 #:test-target "test"
4567 (modify-phases %standard-phases
4569 (lambda* (#:key outputs
4572 (configure-flags '())
4574 ;; This is a home-made 'configure' script.
4575 (let* ((out (assoc-ref outputs "out"))
4576 ;; Guix-specific support for choosing the configuration
4577 ;; via #:configure-flags: see below for details.
4578 (config-flag-prefix "--blis-config=")
4579 (maybe-config-flag (find
4581 (string-prefix? config-flag-prefix s))
4583 (configure-flags (if maybe-config-flag
4584 (delete maybe-config-flag
4587 ;; Select the "configuration" to build.
4588 ;; The "generic" configuration is non-optimized but
4589 ;; portable (no assembly).
4590 ;; The "x86_64" configuration family includes
4591 ;; sub-configurations for all supported
4592 ;; x86_64 microarchitectures.
4593 ;; BLIS currently lacks runtime hardware detection
4594 ;; for other architectures: see
4595 ;; <https://github.com/flame/blis/commit/c534da6>.
4596 ;; Conservatively, we stick to "generic" on armhf,
4597 ;; aarch64, and ppc64le for now. (But perhaps
4598 ;; "power9", "cortexa9", and "cortexa57" might be
4599 ;; general enough to use?)
4600 ;; Another approach would be to use the "auto"
4601 ;; configuration and make this package
4602 ;; non-substitutable.
4603 ;; The build is fairly intensive, though.
4607 (substring maybe-config-flag
4608 (string-length config-flag-prefix)))
4609 ((string-prefix? "x86_64" (or target system))
4618 "--enable-threading=openmp"
4619 "--enable-verbose-make"
4622 (format #t "configure args: ~s~%" configure-args)
4627 (add-before 'check 'show-test-output
4629 ;; By default "make check" is silent. Make it verbose.
4630 (system "tail -F output.testsuite &")
4632 (synopsis "High-performance basic linear algebra (BLAS) routines")
4634 "BLIS is a portable software framework for instantiating high-performance
4635 BLAS-like dense linear algebra libraries. The framework was designed to
4636 isolate essential kernels of computation that, when optimized, immediately
4637 enable optimized implementations of most of its commonly used and
4638 computationally intensive operations. While BLIS exports a new BLAS-like API,
4639 it also includes a BLAS compatibility layer which gives application developers
4640 access to BLIS implementations via traditional BLAS routine calls.")
4641 (license license:bsd-3)))
4643 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4644 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4645 (define-public blis-knl (deprecated-package "blis-knl" blis))
4647 (define ignorance blis)
4649 (define-public openlibm
4657 (url "https://github.com/JuliaLang/openlibm")
4658 (commit (string-append "v" version))))
4659 (file-name (git-file-name name version))
4661 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4662 (build-system gnu-build-system)
4665 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4666 ,(string-append "CC=" (cc-for-target)))
4668 ;; no configure script
4669 (modify-phases %standard-phases (delete 'configure))
4670 #:tests? #f)) ;the tests are part of the default target
4671 (home-page "https://openlibm.org/")
4672 (synopsis "Portable C mathematical library (libm)")
4674 "OpenLibm is an effort to have a high quality, portable, standalone C
4675 mathematical library (libm). It can be used standalone in applications and
4676 programming language implementations. The project was born out of a need to
4677 have a good libm for the Julia programming language that worked consistently
4678 across compilers and operating systems, and in 32-bit and 64-bit
4680 ;; Each architecture has its own make target, and there is none for mips.
4681 (supported-systems (delete "mips64el-linux" %supported-systems))
4682 ;; See LICENSE.md for details.
4683 (license (list license:expat
4686 license:public-domain
4687 license:lgpl2.1+))))
4689 (define-public openspecfun
4691 (name "openspecfun")
4697 (url "https://github.com/JuliaLang/openspecfun")
4698 (commit (string-append "v" version))))
4699 (file-name (git-file-name name version))
4701 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4702 (build-system gnu-build-system)
4704 '(#:tests? #f ; no "check" target
4706 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4708 (modify-phases %standard-phases
4709 (delete 'configure)))) ; no configure script
4711 `(("fortran" ,gfortran)))
4712 (home-page "https://github.com/JuliaLang/openspecfun")
4713 (synopsis "Collection of special mathematical functions")
4715 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4716 portable package for Bessel Functions of a Complex Argument and Nonnegative
4717 Order; it contains subroutines for computing Bessel functions and Airy
4718 functions. Faddeeva allows computing the various error functions of arbitrary
4719 complex arguments (Faddeeva function, error function, complementary error
4720 function, scaled complementary error function, imaginary error function, and
4721 Dawson function); given these, one can also easily compute Voigt functions,
4722 Fresnel integrals, and similar related functions as well.")
4723 ;; Faddeeva is released under the Expat license; AMOS is included as
4724 ;; public domain software.
4725 (license (list license:expat license:public-domain))))
4727 (define-public suitesparse
4729 (name "suitesparse")
4735 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4736 (commit (string-append "v" version))))
4737 (file-name (git-file-name name version))
4740 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4741 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4742 (modules '((guix build utils)))
4744 ;; Remove bundled metis source
4746 (delete-file-recursively "metis-5.1.0")
4748 (build-system gnu-build-system)
4750 `(#:tests? #f ;no "check" target
4752 (list (string-append "CC=" ,(cc-for-target))
4754 "MY_METIS_LIB=-lmetis"
4756 ;; The default is to link against netlib lapack. Use OpenBLAS
4758 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4760 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4761 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4762 (assoc-ref %outputs "out")
4763 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4764 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4765 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4766 " -DCMAKE_SKIP_RPATH=TRUE"
4767 " -DCMAKE_BUILD_TYPE=Release"
4768 " -DCMAKE_INSTALL_LIBDIR=lib")
4769 (string-append "INSTALL_LIB="
4770 (assoc-ref %outputs "out") "/lib")
4771 (string-append "INSTALL_INCLUDE="
4772 (assoc-ref %outputs "out") "/include")
4775 (modify-phases %standard-phases
4776 (delete 'configure)))) ;no configure script
4778 (list tbb openblas gmp mpfr metis))
4780 `(("cmake" ,cmake-minimal)
4782 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4783 (synopsis "Suite of sparse matrix software")
4785 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4786 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4787 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4788 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4789 CXSparse, a concise sparse Cholesky factorization package; and many other
4792 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4794 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4795 (license (list license:gpl2+ license:lgpl2.1+))))
4797 (define-public atlas
4803 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4804 version "/atlas" version ".tar.bz2"))
4805 (patches (search-patches "atlas-gfortran-compat.patch"))
4808 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4809 (build-system gnu-build-system)
4810 (home-page "http://math-atlas.sourceforge.net/")
4811 (inputs `(("gfortran" ,gfortran)
4812 ("lapack-tar" ,(package-source lapack))))
4813 (outputs '("out" "doc"))
4814 ;; For the moment we drop support for MIPS at it fails to compile. See
4815 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4816 (supported-systems (delete "mips64el-linux" %supported-systems))
4818 `(#:parallel-build? #f
4819 #:parallel-tests? #f
4821 ;; ATLAS tunes itself for the machine it is built on, as explained at
4822 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4823 ;; For this reason, we want users to build it locally instead of using
4827 #:modules ((srfi srfi-26)
4828 (guix build gnu-build-system)
4831 `(;; Generate position independent code suitable for dynamic libraries
4832 ;; and use WALL timer to get more accurate timing.
4833 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4836 ,,(if (string-match "64" (%current-system))
4839 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4840 ;; needed to compile C files before it is generated.
4841 "-Ss" "pmake" "make -j 1"
4842 ;; Probe is failing for MIPS. We therefore define the system
4843 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4844 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4845 ,,@(if (string-prefix? "mips" (%current-system))
4846 (list "-A" "49" "-V" "1")
4848 ;; Generate shared libraries.
4850 ;; Build a full LAPACK library.
4851 ,(string-append "--with-netlib-lapack-tarfile="
4852 (assoc-ref %build-inputs "lapack-tar")))
4854 (modify-phases %standard-phases
4855 (add-after 'install 'install-doc
4856 (lambda* (#:key outputs inputs #:allow-other-keys)
4857 (let ((doc (string-append (assoc-ref outputs "doc")
4858 "/share/doc/atlas")))
4860 (for-each (cut install-file <> doc)
4861 (find-files "../ATLAS/doc" ".*"))
4863 (add-after 'check 'check-pt
4864 (lambda _ (invoke "make" "ptcheck")))
4865 ;; Fix files required to run configure.
4866 (add-before 'configure 'fix-/bin/sh
4868 ;; Use `sh', not `/bin/sh'.
4869 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4873 ;; Fix /bin/sh in generated make files.
4874 (add-after 'configure 'fix-/bin/sh-in-generated-files
4876 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4880 ;; ATLAS configure program does not accepts the default flags
4881 ;; passed by the 'gnu-build-system'.
4883 (lambda* (#:key native-inputs inputs outputs
4884 (configure-flags '())
4885 #:allow-other-keys #:rest args)
4886 (let* ((prefix (assoc-ref outputs "out"))
4887 (bash (or (and=> (assoc-ref
4888 (or native-inputs inputs) "bash")
4889 (cut string-append <> "/bin/bash"))
4891 (flags `(,(string-append "--prefix=" prefix)
4893 (abs-srcdir (getcwd))
4894 (srcdir (string-append "../" (basename abs-srcdir))))
4895 (format #t "source directory: ~s (relative from build: ~s)~%"
4899 (format #t "build directory: ~s~%" (getcwd))
4900 (format #t "configure flags: ~s~%" flags)
4902 (string-append srcdir "/configure")
4904 (synopsis "Automatically Tuned Linear Algebra Software")
4906 "ATLAS is an automatically tuned linear algebra software library
4907 providing C and Fortran77 interfaces to a portably efficient BLAS
4908 implementation, as well as a few routines from LAPACK.
4910 Optimization occurs at build time. For this reason, the library is built on
4911 the machine where it is installed, without resorting to pre-built substitutes.
4913 Before building the library, CPU throttling should be disabled. This can be
4914 done in the BIOS, or, on GNU/Linux, with the following command:
4917 # cpupower --governor performance
4920 Failure to do so will result in a library with poor performance.")
4921 ;; The test suite is notoriously lengthy and routinely exceeds the default
4922 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4923 (properties '((timeout . 86400))) ; 1 day
4924 (license license:bsd-3)))
4934 (url "https://github.com/recp/cglm")
4935 (commit (string-append "v" version))))
4936 (file-name (git-file-name name version))
4938 (base32 "0zgckh56vcdar3a4n51r84wrizyd2ssqal4nsvxd4qdjm0rvb4h0"))))
4939 (build-system meson-build-system)
4941 `(#:configure-flags '("-Dbuild_tests=true")))
4942 (home-page "https://github.com/recp/cglm")
4943 (synopsis "Mathematics C library for graphics programming")
4945 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4946 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4949 It's similar to the original C++ GLM library but written in C99 and compatible
4951 (license license:expat)))
4960 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4961 version "/glm-" version ".zip"))
4963 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4964 (build-system cmake-build-system)
4966 `(#:phases (modify-phases %standard-phases
4968 (lambda* (#:key outputs #:allow-other-keys)
4969 ;; Since version 0.9.9.6, 'make install' is not supported
4970 ;; and we have to do it "manually". Upstream discussion:
4971 ;; <https://github.com/g-truc/glm/pull/968>.
4972 (let* ((source (string-append "../glm"))
4973 (out (assoc-ref outputs "out"))
4974 (inc (string-append out "/include"))
4975 (lib (string-append out "/lib"))
4976 (pkgconfig (string-append lib "/pkgconfig")))
4977 (with-directory-excursion source
4980 (copy-recursively "glm" (string-append inc "/glm"))
4981 (copy-recursively "cmake" (string-append lib "/cmake"))
4982 (call-with-output-file (string-append pkgconfig "/glm.pc")
4986 includedir=${prefix}/include
4989 Description: OpenGL Mathematics
4991 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4995 (home-page "https://glm.g-truc.net/")
4996 (synopsis "OpenGL Mathematics library")
4997 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4998 library for graphics software based on the OpenGL Shading Language (GLSL)
5000 (license license:expat)))
5002 (define-public lpsolve
5009 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
5010 "/lp_solve_" version "_source.tar.gz"))
5013 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
5014 (modules '((guix build utils)))
5017 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
5019 ;; Pretend to be on a 64 bit platform to obtain a common directory
5020 ;; name for the build results on all architectures; nothing else
5021 ;; seems to depend on it.
5022 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
5024 ;; The check for 'isnan' as it is written fails with
5025 ;; "non-floating-point argument in call to function
5026 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
5027 ;; definition, which in turn leads to bad things. Fix the feature
5029 (("isnan\\(0\\)") "isnan(0.)"))
5031 (build-system gnu-build-system)
5033 `(#:tests? #f ; no check target
5035 (modify-phases %standard-phases
5036 (delete 'configure) ; no configure script
5039 (with-directory-excursion "lpsolve55"
5040 (invoke "bash" "ccc"))
5041 (with-directory-excursion "lp_solve"
5042 (invoke "bash" "ccc"))
5045 (lambda* (#:key outputs #:allow-other-keys)
5046 (let* ((out (assoc-ref outputs "out"))
5047 (bin (string-append out "/bin"))
5048 (lib (string-append out "/lib"))
5049 ;; This is where LibreOffice expects to find the header
5050 ;; files, and where they are installed by Debian.
5051 (include (string-append out "/include/lpsolve")))
5052 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
5053 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
5054 (install-file "lp_solve/bin/ux64/lp_solve" bin)
5056 ;; Install a subset of the header files as on Debian
5057 ;; (plus lp_bit.h, which matches the regular expression).
5058 (for-each (lambda (name)
5059 (install-file name include))
5060 (find-files "." "lp_[HMSa-z].*\\.h$"))
5061 (with-directory-excursion "shared"
5062 (for-each (lambda (name)
5063 (install-file name include))
5064 (find-files "." "\\.h$")))
5066 (home-page "http://lpsolve.sourceforge.net/")
5067 (synopsis "Mixed integer linear programming (MILP) solver")
5069 "lp_solve is a mixed integer linear programming solver based on the
5070 revised simplex and the branch-and-bound methods.")
5071 (license license:lgpl2.1+)))
5073 ;; Private Trilinos package for dealii-openmpi (similar to
5074 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
5075 ;; This version is the latest known to be compatible with deal.II [1].
5076 ;; Since the latest version of Trilinos is not necessarily supported by
5077 ;; deal.II, it may be worth keeping this package even if and when Trilinos
5078 ;; gets packaged separately for Guix (unless various versions of Trilinos are
5081 ;; An insightful source of information for building Trilinos for deal.II lies
5082 ;; in the Trilinos package for candi [2], which is a source-based installer
5083 ;; for deal.II and its dependencies.
5085 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
5086 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
5087 (define trilinos-for-dealii-openmpi
5089 (name "trilinos-for-dealii-openmpi")
5095 (url "https://github.com/trilinos/Trilinos/")
5097 (string-append "trilinos-release-"
5098 (string-replace-substring version "." "-")))))
5099 (file-name (git-file-name "trilinos" version))
5101 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
5102 (build-system cmake-build-system)
5104 `(("gfortran" ,gfortran)
5105 ;; Trilinos's repository contains several C-shell scripts, but adding
5106 ;; tcsh to the native inputs does not result in the check phase running
5107 ;; any more tests than without it (nor is tcsh required to build
5109 ;; It seems that Trilinos has replaced its use of C-shell test scripts
5110 ;; with CMake's testing facilities.
5112 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
5113 ;; states that Zoltan's C-shell test script
5114 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
5115 ;; performed through CMake.
5117 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
5119 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
5121 ("python" ,python-2)))
5123 `(("blas" ,openblas)
5125 ("mumps" ,mumps-openmpi)
5126 ("scalapack" ,scalapack)))
5128 `(("mpi" ,openmpi)))
5130 `(#:build-type "Release"
5132 `("-DBUILD_SHARED_LIBS=ON"
5133 ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release
5134 ;; default) rather than -O2 (the RelWithDebInfo default), to conform
5135 ;; to candi's trilinos.package's compilation flags, which are -g -O3.
5136 "-DCMAKE_C_FLAGS=-g"
5137 "-DCMAKE_CXX_FLAGS=-g"
5138 "-DCMAKE_Fortran_FLAGS=-g"
5140 ;; Trilinos libraries that deal.II can interface with.
5141 "-DTrilinos_ENABLE_Amesos=ON"
5142 "-DTrilinos_ENABLE_AztecOO=ON"
5143 "-DTrilinos_ENABLE_Epetra=ON"
5144 "-DTrilinos_ENABLE_EpetraExt=ON"
5145 "-DTrilinos_ENABLE_Ifpack=ON"
5146 "-DTrilinos_ENABLE_ML=ON"
5147 "-DTrilinos_ENABLE_MueLu=ON"
5148 "-DTrilinos_ENABLE_ROL=ON"
5149 ;; Optional; required for deal.II's GridIn::read_exodusii, but
5150 ;; depends on netcdf.
5151 ;; Enable if and when someone needs it.
5152 ;;"-DTrilinos_ENABLE_SEACAS=ON"
5153 "-DTrilinos_ENABLE_Sacado=ON"
5154 "-DTrilinos_ENABLE_Teuchos=ON"
5155 "-DTrilinos_ENABLE_Tpetra=ON"
5156 "-DTrilinos_ENABLE_Zoltan=ON"
5158 ;; Third-party libraries (TPLs) that Trilinos can interface with.
5159 "-DBLAS_LIBRARY_NAMES=openblas"
5160 "-DTPL_ENABLE_MPI=ON"
5161 "-DTPL_ENABLE_MUMPS=ON"
5162 "-DTPL_ENABLE_SCALAPACK=ON"
5164 ;; Enable the tests but not the examples (which are enabled by
5165 ;; default when enabling tests).
5166 ;; Although some examples are run as tests, they are otherwise
5167 ;; unnecessary since this is a private package meant for
5169 ;; Besides, some MueLu and ROL examples require a lot of memory to
5172 ;; (For future reference, note that some ROL and SEACAS examples
5173 ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the
5174 ;; dune-istl, dune-localfunctions and dune-alugrid packages.)
5175 "-DTrilinos_ENABLE_TESTS=ON"
5176 "-DTrilinos_ENABLE_EXAMPLES=OFF"
5177 ;; MueLu tests require considerably more time and memory to compile
5178 ;; than the rest of the tests.
5179 "-DMueLu_ENABLE_TESTS=OFF"
5181 ;; The following options were gleaned from candi's trilinos.package.
5182 ;; (We do not enable the complex instantiations, which are anyway
5183 ;; provided only as an option in trilinos.package, because they are
5184 ;; costly in compilation time and memory usage, and disk space [1].)
5186 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
5187 "-DTrilinos_ENABLE_Ifpack2=OFF"
5188 "-DTeuchos_ENABLE_FLOAT=ON"
5189 "-DTpetra_INST_INT_LONG=ON"
5190 "-DTPL_ENABLE_Boost=OFF")
5192 (modify-phases %standard-phases
5193 (add-after 'configure 'fix-kokkos-config
5195 ;; GNU Make 4.3 accidentally leaves the backslash preceding the
5196 ;; number sign in strings containing a literal backslash–number
5197 ;; sign (\#) [1, 2].
5198 ;; This is still an issue in Trilinos 13.0.1, but should be fixed
5199 ;; in the following version.
5200 ;; (The latest versions of Kokkos incorporate the fix [2].)
5202 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
5203 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
5204 (substitute* "KokkosCore_config.h"
5207 (add-before 'check 'mpi-setup
5209 (home-page "https://trilinos.github.io/")
5210 (synopsis "Algorithms for engineering and scientific problems")
5212 "The Trilinos Project is an effort to develop algorithms and enabling
5213 technologies within an object-oriented software framework for the solution of
5214 large-scale, complex multi-physics engineering and scientific problems.
5215 A unique design feature of Trilinos is its focus on packages.")
5216 ;; The packages are variously licensed under more than just BSD-3 and
5217 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
5218 ;; See https://trilinos.github.io/license.html.
5219 (license (list license:bsd-3 license:lgpl2.1+))))
5221 (define-public dealii
5228 (uri (string-append "https://github.com/dealii/dealii/releases/"
5229 "download/v" version "/dealii-" version ".tar.gz"))
5231 (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
5232 (modules '((guix build utils)))
5235 ;; Remove bundled boost, muparser, TBB and UMFPACK.
5236 (delete-file-recursively "bundled")
5238 (build-system cmake-build-system)
5239 (outputs '("out" "doc"))
5241 ;; Required to build the documentation.
5243 ("doxygen" ,doxygen)
5246 `(("arpack" ,arpack-ng)
5248 ("gfortran" ,gfortran)
5250 ("muparser" ,muparser)
5253 ;; Some scripts are installed into share/deal.II/scripts that require
5254 ;; perl and python, but they are not executable (and some are missing the
5255 ;; shebang line) and therefore must be explicitly passed to the
5257 ;; Anyway, they are meant to be used at build time, so rather than adding
5258 ;; the interpreters here, any package depending on them should just add
5259 ;; the requisite interpreter to its native inputs.
5260 (list boost hdf5 suitesparse ; For UMFPACK.
5263 `(#:build-type "DebugRelease" ; Supports only Debug, Release and DebugRelease.
5264 ;; The tests take too long and must be explicitly enabled with "make
5266 ;; See https://www.dealii.org/developer/developers/testsuite.html.
5267 ;; (They can also be run for an already installed deal.II.)
5270 (let ((doc (string-append (assoc-ref %outputs "doc")
5271 "/share/doc/" ,name "-" ,version)))
5272 `("-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
5273 ,(string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
5274 ,(string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
5275 ;; Don't compile the examples because the source and CMakeLists.txt
5276 ;; are installed anyway, allowing users to do so for themselves.
5277 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
5278 ,(string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc "/examples")))
5280 (modify-phases %standard-phases
5281 (add-after 'install 'remove-build-logs
5282 ;; These build logs leak the name of the build directory by storing
5283 ;; the values of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.
5284 (lambda* (#:key outputs #:allow-other-keys)
5285 (let ((doc (string-append (assoc-ref outputs "doc")
5286 "/share/doc/" ,name "-" ,version)))
5287 (for-each delete-file (map (lambda (f) (string-append doc "/" f))
5288 '("detailed.log" "summary.log"))))
5290 (home-page "https://www.dealii.org/")
5291 (synopsis "Finite element library")
5293 "Deal.II is a C++ program library targeted at the computational solution
5294 of partial differential equations using adaptive finite elements. The main
5295 aim of deal.II is to enable rapid development of modern finite element codes,
5296 using among other aspects adaptive meshes and a wide array of tools often used
5297 in finite element programs.")
5298 (license license:lgpl2.1+)))
5300 (define-public dealii-openmpi
5301 (package/inherit dealii
5302 (name "dealii-openmpi")
5304 `(("arpack" ,arpack-ng-openmpi)
5306 ("scalapack" ,scalapack)
5307 ,@(alist-delete "arpack" (package-inputs dealii))))
5309 `(("hdf5" ,hdf5-parallel-openmpi)
5311 ("p4est" ,p4est-openmpi)
5312 ("petsc" ,petsc-openmpi)
5313 ("slepc" ,slepc-openmpi)
5314 ("trilinos" ,trilinos-for-dealii-openmpi)
5315 ,@(alist-delete "hdf5" (package-propagated-inputs dealii))))
5317 (substitute-keyword-arguments (package-arguments dealii)
5318 ((#:configure-flags flags)
5319 `(cons "-DDEAL_II_WITH_MPI=ON" ,flags))))
5320 (synopsis "Finite element library (with MPI support)")))
5322 (define-public flann
5326 (home-page "https://github.com/mariusmuja/flann/")
5330 (uri (git-reference (url home-page) (commit version)))
5331 (file-name (git-file-name name version))
5334 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
5335 (patches (search-patches "flann-cmake-3.11.patch"))))
5336 (build-system cmake-build-system)
5342 ;; FIXME: 'mkoctfile' fails with a linker error:
5343 ;; ld: cannot find -loctinterp
5344 ;; ld: cannot find -loctave
5345 ;; Disable it for now.
5346 ;;("octave" ,octave-cli)
5347 ("python" ,python-2) ; print syntax
5348 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
5351 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
5352 ;; taken 46 MiB unstripped, and 6 MiB stripped.
5353 #:strip-directories '("lib" "lib64" "libexec"
5354 "bin" "sbin" "share/flann/octave")
5356 ;; Save 12 MiB by not installing .a files. Passing
5357 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
5358 #:phases (modify-phases %standard-phases
5359 (add-after 'install 'remove-static-libraries
5360 (lambda* (#:key outputs #:allow-other-keys)
5361 (let* ((out (assoc-ref outputs "out"))
5362 (lib (string-append out "/lib")))
5363 (for-each delete-file
5364 (find-files lib "\\.a$"))
5367 #:tests? #f)) ; The test data are downloaded from the Internet.
5368 (synopsis "Library for approximate nearest neighbors computation")
5369 (description "FLANN is a library for performing fast approximate
5370 nearest neighbor searches in high dimensional spaces. It implements a
5371 collection of algorithms and a system for automatically choosing the best
5372 algorithm and optimum parameters depending on the dataset.
5374 FLANN is written in C++ and contains bindings for C, Octave and Python.")
5375 (license (license:non-copyleft "file://COPYING"
5376 "See COPYING in the distribution."))))
5378 (define-public wcalc
5385 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
5386 "wcalc-" version ".tar.bz2"))
5389 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
5390 (build-system gnu-build-system)
5392 (list mpfr readline))
5393 (home-page "http://w-calc.sourceforge.net/index.php")
5394 (synopsis "Flexible command-line scientific calculator")
5395 (description "Wcalc is a very capable calculator. It has standard functions
5396 (sin, asin, and sinh for example, in either radians or degrees), many
5397 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
5398 variables, a command history, hex/octal/binary input and output, unit
5399 conversions, embedded comments, and an expandable expression entry field. It
5400 evaluates expressions using the standard order of operations.")
5401 (license license:gpl2+)))
5410 (url "https://github.com/xaos-project/XaoS")
5411 (commit (string-append "release-" version))))
5412 (file-name (git-file-name name version))
5415 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5416 (build-system gnu-build-system)
5417 (native-inputs `(("gettext" ,gettext-minimal)
5418 ("qtbase" ,qtbase-5)
5419 ("qttools" ,qttools)))
5420 (inputs (list libx11 zlib libpng gsl))
5421 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5422 ;; not enough for this package to install properly. These phases fix that.
5424 `(#:tests? #f ;no "check" target
5426 (modify-phases %standard-phases
5427 (add-before 'configure 'make-qt-deterministic
5429 ;; Make Qt deterministic.
5430 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5433 (lambda* (#:key outputs #:allow-other-keys)
5434 (let ((out (assoc-ref outputs "out")))
5435 (substitute* "XaoS.pro"
5436 ;; The DESTDIR is originally set to install the xaos binary to
5437 ;; the "bin" folder inside the build directory. Setting make
5438 ;; flags doesn't seem to change this.
5440 (string-append "DESTDIR=" out "/bin"))
5441 ;; Set the correct path to the lrelease binary.
5442 (("lrelease-qt5") "lrelease"))
5443 (substitute* "src/include/config.h"
5444 (("/usr/share/XaoS")
5445 (string-append out "/share/XaoS")))
5447 (add-after 'install 'install-data
5448 (lambda* (#:key outputs #:allow-other-keys)
5449 (let* ((out (assoc-ref outputs "out"))
5450 (share (string-append out "/share")))
5454 (copy-recursively folder
5455 (string-append share "/XaoS/" folder)))
5456 '("catalogs" "examples" "tutorial"))
5457 (install-file "xdg/xaos.png"
5458 (string-append share "/pixmaps"))
5459 (install-file "xdg/xaos.desktop"
5460 (string-append share "/applications")))
5462 (synopsis "Real-time fractal zoomer")
5463 (description "GNU XaoS is a graphical program that generates fractal
5464 patterns and allows you to zoom in and out of them infinitely in a fluid,
5465 continuous manner. It also includes tutorials that help to explain how fractals
5466 are built. It can generate many different fractal types such as the Mandelbrot
5468 (home-page "https://xaos-project.github.io/")
5469 (license license:gpl2+)))
5471 (define-public hypre
5479 (url "https://github.com/hypre-space/hypre")
5480 (commit (string-append "v" version))))
5481 (file-name (git-file-name name version))
5483 (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
5484 (build-system gnu-build-system)
5485 (outputs '("out" ;5.3 MiB of headers and libraries
5486 "doc")) ;12 MiB of documentation
5489 ("doxygen" ,doxygen)
5491 ("python-breathe" ,python-breathe)
5492 ("python-sphinx" ,python-sphinx)
5493 ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
5505 texlive-generic-listofitems
5506 texlive-generic-ulem
5507 texlive-latex-capt-of
5509 texlive-latex-colortbl
5511 texlive-latex-fancyhdr
5512 texlive-latex-fancyvrb
5514 texlive-latex-fncychap
5515 texlive-latex-framed
5516 texlive-latex-geometry
5517 texlive-latex-hanging
5519 texlive-latex-multirow
5520 texlive-latex-natbib
5521 texlive-latex-needspace
5522 texlive-latex-newunicodechar
5523 texlive-latex-parskip
5524 texlive-latex-stackengine
5525 texlive-latex-tabulary
5526 texlive-latex-titlesec
5527 texlive-latex-tocloft
5528 texlive-latex-upquote
5529 texlive-latex-varwidth
5531 texlive-latex-wrapfig)))))
5533 `(("blas" ,openblas)
5534 ("lapack" ,lapack)))
5536 `(#:modules ((srfi srfi-1)
5537 ,@%gnu-build-system-modules)
5538 #:configure-flags '("--enable-shared"
5546 (modify-phases %standard-phases
5547 (add-before 'configure 'chdir-src
5548 (lambda _ (chdir "src")))
5550 (lambda* (#:key build target configure-flags
5551 #:allow-other-keys #:rest args)
5552 (let* ((configure (assoc-ref %standard-phases 'configure)))
5555 (list #:configure-flags
5556 (cons (string-append
5557 "--host=" (or target build))
5558 configure-flags)))))))
5559 (add-after 'build 'build-docs
5561 (invoke "make" "-C" "docs")))
5564 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5565 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5566 (invoke "make" "check" "CHECKRUN=")
5567 (for-each (lambda (filename)
5568 (let ((size (stat:size (stat filename))))
5569 (when (positive? size)
5570 (error (format #f "~a size ~d; error indication~%"
5572 (find-files "test" ".*\\.err$"))))
5573 (add-after 'install 'install-docs
5574 (lambda* (#:key outputs #:allow-other-keys)
5575 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5576 (let* ((doc (assoc-ref outputs "doc"))
5577 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5578 (with-directory-excursion "docs"
5579 (for-each (lambda (base)
5580 (install-file (string-append base ".pdf") docdir)
5581 (copy-recursively (string-append base "-html")
5582 (string-append docdir "/" base)))
5583 '("usr-manual" "ref-manual")))))))))
5584 (home-page "https://computing.llnl.gov/projects\
5585 /hypre-scalable-linear-solvers-multigrid-methods")
5586 (synopsis "Library of solvers and preconditioners for linear equations")
5588 "HYPRE is a software library of high performance preconditioners and
5589 solvers for the solution of large, sparse linear systems of equations. It
5590 features multigrid solvers for both structured and unstructured grid
5592 (license license:lgpl2.1)))
5594 (define-public hypre-openmpi
5595 (package (inherit hypre)
5596 (name "hypre-openmpi")
5599 ,@(package-inputs hypre)))
5601 (substitute-keyword-arguments (package-arguments hypre)
5602 ((#:configure-flags flags)
5604 ,@(delete "--without-MPI" ,flags)))
5606 `(modify-phases ,phases
5607 (add-before 'check 'mpi-setup
5608 ,%openmpi-setup)))))
5609 (synopsis "Parallel solvers and preconditioners for linear equations")
5611 "HYPRE is a software library of high performance preconditioners and
5612 solvers for the solution of large, sparse linear systems of equations on
5613 parallel computers. It features parallel multigrid solvers for both
5614 structured and unstructured grid problems.")))
5616 (define-public matio
5623 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5624 "matio-" version ".tar.gz"))
5627 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5628 (build-system gnu-build-system)
5630 (list zlib hdf5-1.8))
5631 (home-page "http://matio.sourceforge.net/")
5632 (synopsis "Library for reading and writing MAT files")
5633 (description "Matio is a library for reading and writing MAT files. It
5634 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5635 (license license:bsd-2)))
5642 (origin (method url-fetch)
5643 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5644 "download/" version "/Vc-" version ".tar.gz"))
5647 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5648 (build-system cmake-build-system)
5651 '("-DBUILD_TESTING=ON"
5652 ;; By default, Vc will optimize for the CPU of the build machine.
5653 ;; Setting this to "none" makes it create portable binaries. See
5654 ;; "cmake/OptimizeForArchitecture.cmake".
5655 "-DTARGET_ARCHITECTURE=none")
5656 #:phases (modify-phases %standard-phases
5657 (add-after 'unpack 'copy-testdata
5658 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5659 (let ((testdata (assoc-ref (or native-inputs inputs)
5661 (copy-recursively testdata "tests/testdata")
5664 `(("virtest" ,virtest)
5666 ;; This is a submodule in the git project, but not part of the
5667 ;; released sources. See the git branch for the commit to take.
5668 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5672 (url "https://github.com/VcDevel/vc-testdata")
5673 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5674 (file-name (git-file-name "vc-testdata"
5675 (string-take commit 7)))
5678 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5679 (synopsis "SIMD vector classes for C++")
5680 (description "Vc provides portable, zero-overhead C++ types for explicitly
5681 data-parallel programming. It is a library designed to ease explicit
5682 vectorization of C++ code. Its types enable explicitly stating data-parallel
5683 operations on multiple values. The parallelism is therefore added via the type
5684 system. Vc has an intuitive API and provides portability between different
5685 compilers and compiler versions as well as portability between different vector
5686 instruction sets. Thus, an application written with Vc can be compiled for:
5689 @item SSE2 up to SSE4.2 or SSE4a
5692 @item NEON (in development)
5693 @item NVIDIA GPUs / CUDA (in development)
5695 (home-page "https://github.com/VcDevel/Vc")
5696 ;; "No support_???.cpp file exists for this architecture."
5697 (supported-systems '("x86_64-linux" "i686-linux"))
5698 (license license:bsd-3)))
5700 (define-public reducelcs
5701 ;; This is the last commit which is available upstream, no
5702 ;; release happened since 2010.
5703 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5707 (version (string-append "1.0-" revision "." (string-take commit 7)))
5712 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5714 (file-name (string-append name "-" version "-checkout"))
5717 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5718 (build-system gnu-build-system)
5722 `(#:tests? #f ; no tests
5724 (modify-phases %standard-phases
5725 (delete 'configure) ; No configure script exists.
5726 (replace 'install ; No install phase exists.
5727 (lambda* (#:key outputs #:allow-other-keys)
5728 (let* ((out (assoc-ref outputs "out"))
5729 (bin (string-append out "/bin")))
5730 (install-file "Approximation" bin)
5731 (install-file "CollectResults" bin)
5732 (install-file "GenerateInstances" bin)
5734 (synopsis "Approximate Longest Commons Subsequence computation tool")
5736 "@code{reduceLCS} is an implementation of the Reduce-Expand
5737 algorithm for LCS. It is a fast program to compute the approximate
5738 Longest Commons Subsequence of a set of strings.")
5739 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5740 (license license:gpl3+))))
5742 (define-public jacal
5749 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5752 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
5753 (patches (search-patches "jacal-fix-texinfo.patch"))))
5754 (build-system gnu-build-system)
5757 (modify-phases %standard-phases
5758 (add-before 'build 'pre-build
5759 ;; Don't use upstream's script - it really doesn't fit into
5760 ;; Guix's functional paradigm.
5761 (lambda* (#:key inputs outputs #:allow-other-keys)
5762 (substitute* "Makefile"
5763 (("^install: install-script") "install: "))))
5764 (add-after 'install 'post-install
5765 ;; Instead, we provide our own simplified script.
5766 (lambda* (#:key inputs outputs #:allow-other-keys)
5767 (let ((wrapper (string-append (assoc-ref outputs "out")
5769 (format (open wrapper (logior O_WRONLY O_CREAT))
5770 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5771 "-e '(slib:load \"~a/lib/jacal/math\") "
5774 (assoc-ref inputs "scm")
5775 (assoc-ref outputs "out"))
5776 (chmod wrapper #o555))))
5778 (lambda* (#:key outputs #:allow-other-keys)
5779 (invoke "./configure"
5780 (string-append "--prefix="
5781 (assoc-ref outputs "out"))))))))
5783 (native-inputs (list unzip texinfo))
5784 (synopsis "Symbolic mathematics system")
5785 (description "GNU JACAL is an interactive symbolic mathematics program based on
5786 Scheme. It manipulate and simplify a range of mathematical expressions such
5787 as equations, scalars, vectors, and matrices.")
5788 (home-page "https://www.gnu.org/software/jacal/")
5789 (license license:gpl3+)))
5795 (home-page "https://github.com/Z3Prover/z3")
5798 (uri (git-reference (url home-page)
5799 (commit (string-append "z3-" version))))
5800 (file-name (git-file-name name version))
5803 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5804 (build-system gnu-build-system)
5806 `(#:imported-modules ((guix build python-build-system)
5807 ,@%gnu-build-system-modules)
5808 #:modules (((guix build python-build-system) #:select (site-packages))
5809 (guix build gnu-build-system)
5812 (modify-phases %standard-phases
5813 (add-after 'unpack 'enable-bytecode-determinism
5815 (setenv "PYTHONHASHSEED" "0")
5817 (add-after 'unpack 'fix-compatability
5818 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5820 (substitute* "src/util/mpz.cpp"
5821 (("#include <immintrin.h>") ""))
5823 (add-before 'configure 'bootstrap
5825 (invoke "python" "scripts/mk_make.py")))
5826 ;; work around gnu-build-system's setting --enable-fast-install
5827 ;; (z3's `configure' is a wrapper around the above python file,
5828 ;; which fails when passed --enable-fast-install)
5830 (lambda* (#:key inputs outputs #:allow-other-keys)
5831 (invoke "./configure"
5833 (string-append "--prefix=" (assoc-ref outputs "out"))
5834 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5835 (add-after 'configure 'change-directory
5839 (add-before 'check 'make-test-z3
5841 ;; Build the test suite executable.
5842 (invoke "make" "test-z3" "-j"
5843 (number->string (parallel-job-count)))))
5846 ;; Run all the tests that don't require arguments.
5847 (invoke "./test-z3" "/a"))))))
5850 ("python" ,python-wrapper)))
5851 (synopsis "Theorem prover")
5852 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5853 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5854 (license license:expat)))
5856 (define-public ocaml-z3
5861 `(#:imported-modules ((guix build python-build-system)
5862 ,@%gnu-build-system-modules)
5863 #:modules (((guix build python-build-system) #:select (site-packages))
5864 (guix build gnu-build-system)
5866 #:tests? #f; no ml tests
5868 (modify-phases %standard-phases
5869 (add-before 'configure 'bootstrap
5870 (lambda* (#:key outputs #:allow-other-keys)
5871 (let ((out (assoc-ref outputs "out")))
5872 (setenv "OCAMLFIND_LDCONF" "ignore")
5873 (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
5874 (mkdir-p (string-append out "/lib/ocaml/site-lib"))
5875 (substitute* "scripts/mk_util.py"
5877 (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'"))
5878 ;; Do not build z3 again, use the library passed as input
5880 (("z3linkdep,") "\"\",")
5881 (("z3linkdep)") "\"\")"))
5882 (invoke "python" "scripts/mk_make.py"))))
5884 (lambda* (#:key inputs outputs #:allow-other-keys)
5885 (invoke "./configure"
5887 (string-append "--prefix=" (assoc-ref outputs "out")))))
5888 (add-after 'configure 'change-directory
5894 (invoke "make" "ml")))
5896 (lambda* (#:key outputs #:allow-other-keys)
5897 (invoke "ocamlfind" "install" "-destdir"
5898 (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")
5899 "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi"
5900 "api/ml/z3enums.cmx" "api/ml/z3native.mli"
5901 "api/ml/z3native.cmi" "api/ml/z3native.cmx"
5902 "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx"
5903 "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma"
5904 "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so"))))))
5907 ("python" ,python-wrapper)
5909 ("ocaml-findlib" ,ocaml-findlib)))
5911 (list ocaml-zarith))
5918 (version "2018.11.001")
5921 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5922 version "/elpa-" version ".tar.gz"))
5925 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5926 (build-system gnu-build-system)
5928 `(("fortran" ,gfortran)
5929 ("perl" ,perl))) ;for configure and deps
5931 `(("blas" ,openblas)))
5936 ;; ELPA unfortunately does not support runtime dispatch, so we can
5937 ;; only enable the "generic" kernels. See the "Cross compilation"
5938 ;; section of INSTALL.md.
5940 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5941 "--disable-avx" "--disable-avx2" "--disable-avx512"
5942 ,(string-append "CFLAGS=-O3 "
5943 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5944 "-ftree-vect-loop-version -ftree-vectorize "
5945 ,(let ((system (or (%current-target-system)
5946 (%current-system))))
5948 ((or (string-prefix? "x86_64" system)
5949 (string-prefix? "i686" system))
5952 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5954 (modify-phases %standard-phases
5955 (add-before 'configure 'patch-header-generation
5957 (substitute* "configure"
5958 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5959 (string-append & " CPP=\"$CPP\"")))
5961 (add-before 'check 'setup-tests
5963 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5964 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5965 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5966 ;; for Fortran. This also causes several tests to pass that
5967 ;; otherwise would otherwise fail with matrix size 5000; possibly
5968 ;; due to floating point tolerances that are too tight.
5969 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5970 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5971 (substitute* "Makefile"
5972 ;; Test scripts are generated, patch the shebang
5973 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5975 (home-page "https://elpa.mpcdf.mpg.de")
5976 (synopsis "Eigenvalue solvers for symmetric matrices")
5978 "The ELPA library provides efficient and scalable direct eigensolvers for
5979 symmetric matrices.")
5980 (license license:lgpl3)))
5982 (define-public elpa-openmpi
5983 (package (inherit elpa)
5984 (name "elpa-openmpi")
5987 ("scalapack" ,scalapack)
5988 ,@(package-inputs elpa)))
5990 (substitute-keyword-arguments (package-arguments elpa)
5991 ((#:configure-flags cf '())
5992 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5993 ((#:phases phases '%standard-phases)
5994 `(modify-phases ,phases
5995 (add-before 'check 'mpi-setup
5997 ;; Tests use 2 mpi tasks by default, use our remaining build
5998 ;; cores as OpenMP threads.
5999 (setenv "OMP_NUM_THREADS" (number->string
6000 (max (quotient (parallel-job-count) 2)
6002 (,%openmpi-setup)))))))
6003 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
6005 (define-public elemental
6012 (url "https://github.com/elemental/Elemental")
6013 (commit (string-append "v" version))))
6014 (file-name (git-file-name name version))
6017 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
6018 (build-system cmake-build-system)
6019 (home-page "https://github.com/elemental/Elemental")
6023 `(("blas" ,openblas)
6024 ("gfortran:lib" ,gfortran "lib")
6033 `(#:build-type "Release" ;default RelWithDebInfo not supported
6034 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
6035 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
6036 "-DEL_CACHE_WARNINGS:BOOL=YES"
6037 "-DEL_TESTS:BOOL=YES"
6038 "-DCMAKE_INSTALL_LIBDIR=lib"
6039 "-DGFORTRAN_LIB=gfortran")
6040 #:phases (modify-phases %standard-phases
6041 (add-before 'check 'mpi-setup
6043 (add-before 'check 'setup-tests
6045 ;; Parallelism is done at the MPI layer.
6046 (setenv "OMP_NUM_THREADS" "1")
6048 (add-after 'install 'remove-tests
6049 (lambda* (#:key outputs #:allow-other-keys)
6050 ;; Tests are installed, with no easy configuration
6051 ;; switch to prevent this, so delete them.
6052 (delete-file-recursively
6053 (string-append (assoc-ref outputs "out") "/bin"))
6055 (synopsis "Dense and sparse-direct linear algebra and optimization")
6056 (description "Elemental is a modern C++ library for distributed-memory
6057 dense and sparse-direct linear algebra, conic optimization, and lattice
6059 (license license:bsd-2)))
6061 (define-public mcrl2
6064 (version "202106.0")
6068 "https://www.mcrl2.org/download/release/mcrl2-"
6072 "1xgx3cd57vc7gbjic24j1q2za6j3ybz6nk4afvvpbwsf33xnlf4v"))))
6074 (list boost glu mesa qtbase-5))
6075 (build-system cmake-build-system)
6076 (synopsis "Toolset for the mCRL2 formal specification language")
6078 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
6079 specification language for describing concurrent discrete event systems. Its
6080 toolset supports analysis and automatic verification, linearisation, simulation,
6081 state-space exploration and generation, and tools to optimise and analyse
6082 specifications. Also, state spaces can be manipulated, visualised and
6084 (home-page "https://mcrl2.org")
6085 (license license:boost1.0)))
6087 (define-public mcrl2-minimal
6090 (name "mcrl2-minimal")
6094 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
6096 (define-public tcalc
6103 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
6107 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
6108 (build-system gnu-build-system)
6109 (synopsis "The terminal calculator")
6111 "The terminal calculator is a small program to help users of the GNU/Linux
6112 terminal do calculations simply and quickly. The formula to be calculated can
6113 be fed to @command{tcalc} through the command line.")
6114 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
6115 (license license:gpl3+)))
6117 (define-public tiny-bignum
6118 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
6120 (name "tiny-bignum")
6121 (version (git-version "0" "0" commit))
6126 (url "https://github.com/kokke/tiny-bignum-c")
6128 (file-name (git-file-name "tiny-bignum" commit))
6130 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
6131 (build-system gnu-build-system)
6134 (modify-phases %standard-phases
6136 (add-after 'unpack 'patch-tests
6138 (substitute* "scripts/test_rand.py"
6140 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
6143 (lambda* (#:key tests? #:allow-other-keys)
6145 (invoke "make" "test"))
6148 (lambda* (#:key outputs #:allow-other-keys)
6149 (let ((share (string-append (assoc-ref outputs "out") "/share"))
6150 (doc (string-append (assoc-ref outputs "out") "/doc")))
6152 (install-file "bn.c" share)
6153 (install-file "bn.h" share)
6155 (install-file "LICENSE" doc)
6156 (install-file "README.md" doc))
6159 `(("python" ,python-wrapper)))
6160 (home-page "https://github.com/kokke/tiny-bignum-c")
6161 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
6163 "This library provides portable Arbitrary-precision unsigned integer
6164 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
6165 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
6166 and comparisons are supported.")
6167 (license license:unlicense))))
6169 (define-public sundials
6176 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
6177 "sundials-" version ".tar.gz"))
6180 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
6181 (build-system cmake-build-system)
6183 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
6185 `(("fortran" ,gfortran) ;for fcmix
6187 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
6189 `(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
6190 "-DEXAMPLES_ENABLE_C:BOOL=ON"
6191 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
6192 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
6193 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
6194 "-DEXAMPLES_INSTALL:BOOL=OFF"
6196 "-DFCMIX_ENABLE:BOOL=ON"
6198 "-DKLU_ENABLE:BOOL=ON"
6199 ,(string-append "-DKLU_INCLUDE_DIR="
6200 (assoc-ref %build-inputs "suitesparse")
6202 ,(string-append "-DKLU_LIBRARY_DIR="
6203 (assoc-ref %build-inputs "suitesparse")
6205 (home-page "https://computation.llnl.gov/projects/sundials")
6206 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
6207 (description "SUNDIALS is a family of software packages implemented with
6208 the goal of providing robust time integrators and nonlinear solvers that can
6209 easily be incorporated into existing simulation codes.")
6211 '((release-monitoring-url
6212 . "https://computing.llnl.gov/projects/sundials/sundials-software")))
6213 (license license:bsd-3)))
6215 (define-public sundials-openmpi
6216 (package (inherit sundials)
6217 (name "sundials-openmpi")
6220 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
6221 ,@(package-inputs sundials)))
6223 (substitute-keyword-arguments (package-arguments sundials)
6224 ((#:configure-flags flags '())
6225 `(cons* "-DMPI_ENABLE:BOOL=ON"
6226 "-DPETSC_ENABLE:BOOL=ON"
6227 (string-append "-DPETSC_INCLUDE_DIR="
6228 (assoc-ref %build-inputs "petsc")
6230 (string-append "-DPETSC_LIBRARY_DIR="
6231 (assoc-ref %build-inputs "petsc")
6234 ((#:phases phases '%standard-phases)
6235 `(modify-phases ,phases
6236 (add-before 'check 'mpi-setup
6237 ,%openmpi-setup)))))
6238 (synopsis "SUNDIALS with OpenMPI support")))
6240 (define-public sundials-julia
6243 (name "sundials-julia")
6249 (url "https://github.com/LLNL/sundials")
6250 (commit (string-append "v" version))))
6251 (file-name (git-file-name name version))
6254 "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv"))))
6256 (modify-inputs (package-inputs sundials)
6259 (substitute-keyword-arguments (package-arguments sundials)
6260 ((#:configure-flags flags '())
6261 `(cons* "-DLAPACK_ENABLE:BOOL=ON"
6263 (synopsis "SUNDIALS with lapack support as required by julia-sundials-jll")))
6265 (define-public combinatorial-blas
6267 (name "combinatorial-blas")
6272 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
6274 (match (string-split version #\.)
6275 ((major minor patch)
6276 (string-append major minor "_" patch))) ;e.g. "16_2"
6280 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
6281 (patches (search-patches "combinatorial-blas-awpm.patch"
6282 "combinatorial-blas-io-fix.patch"))))
6283 (build-system cmake-build-system)
6286 ("test-data" ,(origin
6288 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
6289 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
6292 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
6294 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
6295 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
6296 #:parallel-tests? #f ;tests use 'mpiexec -n4'
6298 (modify-phases %standard-phases
6299 (add-before 'check 'mpi-setup
6301 (add-before 'check 'test-setup
6302 (lambda* (#:key inputs #:allow-other-keys)
6303 (setenv "OMP_NUM_THREADS" "2")
6304 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
6305 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
6306 (synopsis "Linear algebra primitives for graph analytics")
6307 (description "The Combinatorial BLAS (CombBLAS) is an extensible
6308 distributed-memory parallel graph library offering a small but powerful set of
6309 linear algebra primitives specifically targeting graph analytics.")
6311 license:gpl2+ ;include/psort/(funnel|sort)*.h
6312 license:x11 ;usort and psort
6313 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
6315 (define-public dune-common
6317 (name "dune-common")
6322 (uri (string-append "https://dune-project.org/download/"
6323 version "/dune-common-" version ".tar.gz"))
6326 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
6327 (build-system cmake-build-system)
6330 (modify-phases %standard-phases
6331 (add-after 'build 'build-tests
6332 (lambda* (#:key make-flags #:allow-other-keys)
6333 (apply invoke "make" "build_tests" make-flags))))))
6335 (list gmp metis openblas python superlu))
6337 (list gfortran pkg-config))
6338 (home-page "https://dune-project.org/")
6339 (synopsis "Distributed and Unified Numerics Environment")
6340 (description "DUNE, the Distributed and Unified Numerics Environment is a
6341 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6342 grid-based methods. It supports the easy implementation of methods like
6343 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6344 Differences} (FD).")
6345 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
6346 (license license:gpl2)))
6348 (define-public dune-geometry
6350 (name "dune-geometry")
6355 (uri (string-append "https://dune-project.org/download/"
6356 version "/dune-geometry-" version ".tar.gz"))
6359 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
6360 (build-system cmake-build-system)
6363 (modify-phases %standard-phases
6364 (add-after 'build 'build-tests
6365 (lambda* (#:key make-flags #:allow-other-keys)
6366 (apply invoke "make" "build_tests" make-flags))))))
6370 openblas gmp python))
6372 (list gfortran pkg-config))
6373 (home-page "https://dune-project.org/")
6374 (synopsis "Distributed and Unified Numerics Environment")
6375 (description "DUNE, the Distributed and Unified Numerics Environment is a
6376 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6377 grid-based methods. It supports the easy implementation of methods like
6378 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6381 This package contains the basic DUNE geometry classes.")
6382 ;; GPL version 2 with "runtime exception"
6383 (license license:gpl2)))
6385 (define-public dune-uggrid
6387 (name "dune-uggrid")
6393 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
6394 (commit (string-append "v" version))))
6395 (file-name (git-file-name name version))
6398 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
6399 (build-system cmake-build-system)
6402 (modify-phases %standard-phases
6403 (add-after 'build 'build-tests
6404 (lambda* (#:key make-flags #:allow-other-keys)
6405 (apply invoke "make" "build_tests" make-flags))))))
6409 (list gfortran pkg-config))
6410 (home-page "https://dune-project.org/")
6411 (synopsis "Distributed and Unified Numerics Environment")
6412 (description "DUNE, the Distributed and Unified Numerics Environment is a
6413 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6414 grid-based methods. It supports the easy implementation of methods like
6415 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6418 This package contains the DUNE UG grid classes.")
6419 (license license:lgpl2.1)))
6421 (define-public dune-grid
6428 (uri (string-append "https://dune-project.org/download/"
6429 version "/dune-grid-" version ".tar.gz"))
6432 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
6433 (build-system cmake-build-system)
6436 (modify-phases %standard-phases
6437 (add-after 'build 'build-tests
6438 (lambda* (#:key make-flags #:allow-other-keys)
6439 (apply invoke "make" "build_tests" make-flags))))))
6450 (list gfortran pkg-config))
6451 (home-page "https://dune-project.org/")
6452 (synopsis "Distributed and Unified Numerics Environment")
6453 (description "DUNE, the Distributed and Unified Numerics Environment is a
6454 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6455 grid-based methods. It supports the easy implementation of methods like
6456 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6459 This package contains the basic DUNE grid classes.")
6460 ;; GPL version 2 with "runtime exception"
6461 (license license:gpl2)))
6463 (define-public dune-istl
6470 (uri (string-append "https://dune-project.org/download/"
6471 version "/dune-istl-" version ".tar.gz"))
6474 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
6475 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
6476 (build-system cmake-build-system)
6479 (modify-phases %standard-phases
6480 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6481 ;; the stdlib types when the gfortran header is used. Remove gfortran
6482 ;; from CPLUS_INCLUDE_PATH as a workaround.
6483 (add-after 'set-paths 'hide-gfortran
6484 (lambda* (#:key inputs #:allow-other-keys)
6485 (let ((gfortran (assoc-ref inputs "gfortran")))
6486 (setenv "CPLUS_INCLUDE_PATH"
6488 (delete (string-append gfortran "/include/c++")
6489 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6492 (add-after 'build 'build-tests
6493 (lambda* (#:key make-flags #:allow-other-keys)
6494 (apply invoke "make" "build_tests" make-flags))))))
6505 (list gfortran pkg-config))
6506 (home-page "https://dune-project.org/")
6507 (synopsis "Distributed and Unified Numerics Environment")
6508 (description "DUNE, the Distributed and Unified Numerics Environment is a
6509 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6512 This is the iterative solver template library which provides generic sparse
6513 matrix/vector classes and a variety of solvers based on these classes. A
6514 special feature is the use of templates to exploit the recursive block
6515 structure of finite element matrices at compile time. Available solvers
6516 include Krylov methods, (block-) incomplete decompositions and
6517 aggregation-based algebraic multigrid.")
6518 ;; GPL version 2 with "runtime exception"
6519 (license license:gpl2)))
6521 (define-public dune-localfunctions
6523 (name "dune-localfunctions")
6528 (uri (string-append "https://dune-project.org/download/"
6529 version "/dune-localfunctions-" version ".tar.gz"))
6532 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
6533 (build-system cmake-build-system)
6536 (modify-phases %standard-phases
6537 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6538 ;; and fails to find the stdlib types when the gfortran header is used.
6539 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6540 (add-after 'set-paths 'hide-gfortran
6541 (lambda* (#:key inputs #:allow-other-keys)
6542 (let ((gfortran (assoc-ref inputs "gfortran")))
6543 (setenv "CPLUS_INCLUDE_PATH"
6545 (delete (string-append gfortran "/include/c++")
6546 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6549 (add-after 'build 'build-tests
6550 (lambda* (#:key make-flags #:allow-other-keys)
6551 (apply invoke "make" "build_tests" make-flags))))))
6560 (list gfortran pkg-config))
6561 (home-page "https://dune-project.org/")
6562 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6563 (description "This DUNE module provides interface and implementation for
6564 shape functions defined on the DUNE reference elements. In addition to the
6565 shape function, interpolation operators and special keys are provided which
6566 can be used to assemble global function spaces on finite-element grids.
6568 This package provides an interface and implementation for shape functions
6569 defined on the DUNE reference elements. In addition to the shape function,
6570 interpolation operators and special keys are provided which can be used to
6571 assemble global function spaces on finite-element grids.")
6572 ;; GPL version 2 with "runtime exception"
6573 (license license:gpl2)))
6575 (define-public dune-alugrid
6577 (name "dune-alugrid")
6578 (version "2.7.0-git-81d35682")
6583 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6584 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
6585 (file-name (git-file-name name version))
6588 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
6589 (build-system cmake-build-system)
6592 (modify-phases %standard-phases
6593 (add-after 'unpack 'patch-include
6595 (substitute* "dune/alugrid/test/test-alugrid.cc"
6596 (("doc/grids/gridfactory/testgrids")
6597 "doc/dune-grid/grids/gridfactory/testgrids"))
6599 (add-after 'build 'build-tests
6600 (lambda* (#:key inputs make-flags #:allow-other-keys)
6601 (setenv "CPLUS_INCLUDE_PATH"
6602 (string-append (assoc-ref inputs "dune-grid") "/share"))
6603 (apply invoke "make" "build_tests" make-flags))))))
6616 (list gfortran pkg-config))
6617 (home-page "https://dune-project.org/")
6618 (synopsis "Distributed and Unified Numerics Environment")
6619 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6620 implementation of the DUNE grid interface supporting either simplices or
6622 (license license:gpl2+)))
6624 (define-public dune-subgrid
6626 (name "dune-subgrid")
6627 (version "2.7.0-git-2103a363")
6632 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6633 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
6634 (file-name (git-file-name name version))
6637 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
6638 (build-system cmake-build-system)
6641 (modify-phases %standard-phases
6642 (add-after 'build 'build-tests
6643 (lambda* (#:key make-flags #:allow-other-keys)
6644 (apply invoke "make" "build_tests" make-flags))))))
6654 (list gfortran pkg-config))
6655 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6656 (synopsis "Distributed and Unified Numerics Environment")
6657 (description "The dune-subgrid module marks elements of
6658 another hierarchical dune grid. The set of marked elements can then be
6659 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6660 provides the full grid interface including adaptive mesh refinement.")
6661 (license license:gpl2+)))
6663 (define-public dune-typetree
6665 (name "dune-typetree")
6671 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6672 (commit (string-append "v" version))))
6673 (file-name (git-file-name name version))
6676 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
6677 (build-system cmake-build-system)
6680 (modify-phases %standard-phases
6681 (add-after 'build 'build-tests
6682 (lambda* (#:key make-flags #:allow-other-keys)
6683 (apply invoke "make" "build_tests" make-flags))))))
6693 (list gfortran pkg-config))
6694 (home-page "https://dune-project.org/")
6695 (synopsis "Distributed and Unified Numerics Environment")
6696 (description "TypeTree is a template library for constructing and
6697 operating on statically typed trees of objects.")
6698 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6699 (license (list license:lgpl3+ license:gpl2))))
6701 (define-public dune-functions
6703 (name "dune-functions")
6709 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6710 (commit (string-append "v" version))))
6711 (file-name (git-file-name name version))
6714 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
6715 (build-system cmake-build-system)
6718 (modify-phases %standard-phases
6719 (add-after 'unpack 'disable-failing-tests
6722 ;; unable to load GMSH file in this test
6723 "--exclude-regex gridviewfunctionspacebasistest")
6725 (add-after 'build 'build-tests
6726 (lambda* (#:key make-flags #:allow-other-keys)
6727 (apply invoke "make" "build_tests" make-flags))))))
6741 (list gfortran pkg-config))
6742 (home-page "https://dune-project.org/")
6743 (synopsis "Distributed and Unified Numerics Environment")
6744 (description "The dune-functions module provides an abstraction layer for
6745 global finite element functions. Its two main concepts are functions
6746 implemented as callable objects, and bases of finite element spaces.")
6747 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6748 (license (list license:lgpl3+ license:gpl2))))
6750 (define-public dune-pdelab
6752 (name "dune-pdelab")
6753 (version "2.7.0-git-476fe437")
6758 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6759 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
6760 (file-name (git-file-name name version))
6763 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
6764 (build-system cmake-build-system)
6765 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
6782 (list gfortran pkg-config))
6783 (home-page "https://dune-project.org/")
6784 (synopsis "Differential equations solver toolbox")
6785 (description "PDELab is a partial differential equations solver toolbox
6786 built on top of DUNE, the Distributed and Unified Numerics Environment.")
6787 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6788 (license (list license:lgpl3+ license:gpl2))))
6790 (define add-openmpi-to-dune-package
6791 (let ((dune-package?
6792 (lambda (p) (string-prefix? "dune-" (package-name p)))))
6795 (if (dune-package? p)
6796 (package (inherit p)
6797 (name (string-append (package-name p) "-openmpi"))
6798 (inputs `(,@(package-inputs p)
6799 ("openmpi" ,openmpi)))
6801 (substitute-keyword-arguments (package-arguments p)
6802 ((#:phases phases '%standard-phases)
6803 `(modify-phases ,phases
6804 (add-before 'check 'mpi-setup
6805 ,%openmpi-setup)))))
6806 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
6808 (negate dune-package?))))
6810 (define-public dune-common-openmpi
6811 (add-openmpi-to-dune-package dune-common))
6813 (define-public dune-geometry-openmpi
6814 (add-openmpi-to-dune-package dune-geometry))
6816 (define-public dune-istl-openmpi
6817 (add-openmpi-to-dune-package dune-istl))
6819 (define-public dune-typetree-openmpi
6820 (add-openmpi-to-dune-package dune-typetree))
6822 (define-public dune-uggrid-openmpi
6823 (add-openmpi-to-dune-package dune-uggrid))
6825 (define-public dune-grid-openmpi
6826 (add-openmpi-to-dune-package dune-grid))
6828 (define-public dune-alugrid-openmpi
6829 (add-openmpi-to-dune-package dune-alugrid))
6831 (define-public dune-subgrid-openmpi
6832 (add-openmpi-to-dune-package dune-subgrid))
6834 (define-public dune-localfunctions-openmpi
6835 (add-openmpi-to-dune-package dune-localfunctions))
6837 (define-public dune-functions-openmpi
6838 (add-openmpi-to-dune-package dune-functions))
6840 (define-public dune-pdelab-openmpi
6841 (add-openmpi-to-dune-package dune-pdelab))
6843 (define-public mlucas
6851 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
6853 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
6854 (build-system gnu-build-system)
6858 `(#:tests? #f ; no tests
6860 (modify-phases %standard-phases
6864 (call-with-output-file "Makefile"
6866 (format port "CC = gcc
6867 CFLAGS = -O3 ~a -DUSE_THREADS
6868 LDLIBS = -lm -lpthread -lrt
6869 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6871 ,(let ((system (or (%current-target-system)
6872 (%current-system))))
6874 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6878 (lambda* (#:key outputs #:allow-other-keys)
6879 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6880 (install-file "Mlucas" bin)
6881 (install-file "primenet.py" bin))
6883 (home-page "https://www.mersenne.org")
6884 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6885 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6886 numbers in search of a world-record prime. You may use it to test any
6887 suitable number as you wish, but it is preferable that you do so in a
6888 coordinated fashion, as part of the Great Internet Mersenne Prime
6889 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6890 management via the GIMPS project's Primenet server.")
6891 (license license:gpl2+)))
6893 (define-public nauty
6901 "https://pallini.di.uniroma1.it/"
6902 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6904 (base32 "1hl81gpf3xjf809w04jczvilq1ixy9ch1qrax8a7lgx52svna1jg"))))
6905 (build-system gnu-build-system)
6906 (outputs '("out" "lib"))
6908 `(#:test-target "checks"
6909 #:configure-flags '("--enable-generic") ;prevent -march-native
6911 (modify-phases %standard-phases
6912 ;; Default make target does not build all available
6913 ;; executables. Create them now.
6914 (add-after 'build 'build-extra-programs
6916 (for-each (lambda (target) (invoke "make" target))
6917 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6919 ;; Upstream does not provide any install target.
6921 (lambda* (#:key outputs #:allow-other-keys)
6922 (let* ((out (assoc-ref outputs "out"))
6923 (lib-output (assoc-ref outputs "lib"))
6924 (bin (string-append out "/bin"))
6925 (doc (string-append out "/share/doc/nauty/"))
6926 (include (string-append lib-output "/include/nauty"))
6927 (lib (string-append lib-output "/lib/nauty")))
6928 (for-each (lambda (f) (install-file f bin))
6929 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6930 "bliss2dre" "catg" "checks6" "complg" "converseg"
6931 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6932 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6933 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6934 "gentourng" "gentreeg" "hamheuristic" "labelg"
6935 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6936 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6937 "sumlines" "twohamg" "underlyingg" "vcolg"
6938 "watercluster2" "NRswitchg"))
6939 (for-each (lambda (f) (install-file f include))
6940 (find-files "." "\\.h$"))
6941 (for-each (lambda (f) (install-file f lib))
6942 (find-files "." "\\.a$"))
6943 (for-each (lambda (f) (install-file f doc))
6944 (append '("formats.txt" "README" "schreier.txt")
6945 (find-files "." "\\.pdf$")))))))))
6947 (list gmp)) ;for sumlines
6948 (home-page "https://pallini.di.uniroma1.it/")
6949 (synopsis "Library for graph automorphisms")
6950 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6951 procedures for computing automorphism groups of graphs and digraphs.
6953 @code{nauty} computes graph information in the form of a set of
6954 generators, the size of the group, and the orbits of the group; it can
6955 also produce a canonical label. The @code{nauty} suite is written in
6956 C and comes with a command-line interface, a collection of
6957 command-line tools, and an Application Programming Interface (API).
6959 This package provides the static libraries required to run programs
6960 compiled against the nauty library.")
6961 (license license:asl2.0)))
6970 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6971 "ftp/releases/" version
6972 "/ppl-" version ".tar.gz"))
6975 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6976 (build-system gnu-build-system)
6981 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6983 "Parma Polyhedra Library for computations with polyhedra")
6985 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6986 especially targeted at applications in the field of analysis and
6987 verification of complex systems. These abstractions include convex
6988 polyhedra, defined as the intersection of a finite number of (open or
6989 closed) halfspaces, each described by a linear inequality (strict or
6990 non-strict) with rational coefficients; some special classes of polyhedra
6991 shapes that offer interesting complexity/precision tradeoffs; and grids
6992 which represent regularly spaced points that satisfy a set of linear
6993 congruence relations. The library also supports finite powersets and
6994 products of (any kind of) polyhedra and grids, a mixed integer linear
6995 programming problem solver using an exact-arithmetic version of the simplex
6996 algorithm, a parametric integer programming solver, and primitives for
6997 termination analysis via the automatic synthesis of linear ranking
6999 (license license:gpl3+)))
7001 (define-public speedcrunch
7003 (name "speedcrunch")
7009 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
7010 (commit (string-append "release-" version))))
7011 (file-name (git-file-name name version))
7014 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
7015 (build-system cmake-build-system)
7016 (inputs (list qtbase-5))
7017 (native-inputs (list qttools))
7020 (modify-phases %standard-phases
7021 (add-after 'unpack 'chdir-to-src
7022 (lambda _ (chdir "src") #t)))))
7023 (synopsis "High-precision scientific calculator")
7025 "SpeedCrunch is a high-precision scientific calculator. It features a
7026 syntax-highlighted scrollable display and is designed to be fully used via
7027 keyboard. Some distinctive features are auto-completion of functions and
7028 variables, a formula book, and quick insertion of constants from various
7029 fields of knowledge.")
7030 (home-page "https://speedcrunch.org/")
7031 (license license:gpl2+)))
7033 (define-public minisat
7034 ;; This is the last commit which is available upstream, no
7035 ;; release happened since 2010.
7036 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
7040 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
7045 (url "https://github.com/niklasso/minisat")
7047 (file-name (string-append name "-" version "-checkout"))
7050 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
7052 (search-patches "minisat-friend-declaration.patch"
7053 "minisat-install.patch"))))
7054 (build-system gnu-build-system)
7056 '(#:make-flags (list (string-append "prefix=" %output))
7057 #:tests? #f ;no check target
7059 (modify-phases %standard-phases
7060 (delete 'configure))))
7062 `(("zlib:static" ,zlib "static")
7065 "Small, yet efficient, SAT solver")
7067 "MiniSat is a minimalistic, open-source SAT solver, developed to help
7068 researchers and developers alike to get started on SAT.")
7070 "http://minisat.se/MiniSat.html")
7071 (license license:expat))))
7073 (define-public libqalculate
7075 (name "libqalculate")
7081 (url "https://github.com/Qalculate/libqalculate/")
7082 (commit (string-append "v" version))))
7083 (file-name (git-file-name name version))
7085 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
7087 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
7088 (build-system gnu-build-system)
7090 `(("pkg-config" ,pkg-config)
7091 ("gettext" ,gettext-minimal)
7092 ("intltool" ,intltool)
7093 ("automake" ,automake)
7094 ("autoconf" ,autoconf)
7095 ("libtool" ,libtool)
7096 ("doxygen" ,doxygen)
7109 (modify-phases %standard-phases
7110 (add-before 'bootstrap 'setenv
7111 ;; Prevent the autogen.sh script to carry out the configure
7112 ;; script, which has not yet been patched to replace /bin/sh.
7114 (setenv "NOCONFIGURE" "TRUE")
7116 (home-page "https://qalculate.github.io/")
7117 (synopsis "Multi-purpose cli desktop calculator and library")
7119 "Libqalculate is a multi-purpose cli desktop calculator and library.
7120 It provides basic and advanced functionality. Features include customizable
7121 functions, unit calculations, and conversions, physical constants, symbolic
7122 calculations (including integrals and equations), arbitrary precision,
7123 uncertainty propagation, interval arithmetic, plotting and a user-friendly
7125 (license license:gpl2+)))
7127 (define-public qalculate-gtk
7129 (name "qalculate-gtk")
7135 (url "https://github.com/Qalculate/qalculate-gtk/")
7136 (commit (string-append "v" version))))
7137 (file-name (git-file-name name version))
7139 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
7140 (build-system glib-or-gtk-build-system)
7157 (modify-phases %standard-phases
7158 (add-before 'bootstrap 'setenv
7159 ;; Prevent the autogen.sh script to carry out the configure
7160 ;; script, which has not yet been patched to replace /bin/sh.
7162 (setenv "NOCONFIGURE" "TRUE")
7164 (home-page "https://qalculate.github.io/")
7165 (synopsis "Multi-purpose graphical desktop calculator")
7167 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
7168 multi-purpose GUI desktop calculator. It provides basic and advanced
7169 functionality. Features include customizable functions, unit calculations,
7170 and conversions, physical constants, symbolic calculations (including
7171 integrals and equations), arbitrary precision, uncertainty propagation,
7172 interval arithmetic, plotting.")
7173 (license license:gpl2+)))
7175 (define-public numdiff
7182 (uri (string-append "mirror://savannah/numdiff/numdiff-"
7186 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
7187 (build-system gnu-build-system)
7189 '(#:tests? #f ; There are no tests.
7191 (modify-phases %standard-phases
7192 (add-before 'compress-documentation 'delete-precompressed-info-file
7194 (delete-file (string-append (assoc-ref %outputs "out")
7195 "/share/info/numdiff.info.gz"))
7197 (home-page "https://nongnu.org/numdiff/")
7198 (synopsis "Compare files with numeric fields")
7200 "Numdiff compares files line by line and field by field, ignoring small
7201 numeric differences and differences in numeric formats.")
7202 (license license:gpl3+)))
7211 (url "https://gitlab.inria.fr/why3/why3")
7213 (file-name (git-file-name name version))
7216 "0pfsiddnk26f384wbazfpgzh1n1ibf3xq101q74mxvczi7z0a791"))))
7217 (build-system ocaml-build-system)
7219 (list autoconf automake coq ocaml which))
7221 (list camlzip ocaml-graph ocaml-menhir ocaml-num ocaml-zarith))
7223 (list coq-flocq emacs-minimal zlib))
7226 (modify-phases %standard-phases
7227 (add-before 'configure 'bootstrap
7229 (invoke "./autogen.sh")
7230 (setenv "CONFIG_SHELL" (which "sh"))
7231 (substitute* "configure"
7232 (("#! /bin/sh") (string-append "#!" (which "sh")))
7233 ;; find ocaml-num in the correct directory
7234 (("\\$DIR/nums.cma") "$DIR/num.cma")
7235 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
7237 (add-after 'configure 'fix-makefile
7239 (substitute* "Makefile"
7240 ;; find ocaml-num in the correct directory
7241 (("site-lib/num") "site-lib"))
7243 (add-after 'install 'install-lib
7245 (invoke "make" "byte")
7246 (invoke "make" "install-lib")
7248 (home-page "http://why3.lri.fr")
7249 (synopsis "Deductive program verification")
7250 (description "Why3 provides a language for specification and programming,
7251 called WhyML, and relies on external theorem provers, both automated and
7252 interactive, to discharge verification conditions. Why3 comes with a standard
7253 library of logical theories (integer and real arithmetic, Boolean operations,
7254 sets and maps, etc.) and basic programming data structures (arrays, queues,
7255 hash tables, etc.). A user can write WhyML programs directly and get
7256 correct-by-construction OCaml programs through an automated extraction
7257 mechanism. WhyML is also used as an intermediate language for the verification
7258 of C, Java, or Ada programs.")
7259 (license license:lgpl2.1)))
7261 (define-public frama-c
7267 (uri (string-append "http://frama-c.com/download/frama-c-"
7268 version "-Chromium.tar.gz"))
7271 "0x1xgip50jdz1phsb9rzwf2ra8lshn1hmd9g967xia402wrg3sjf"))))
7272 (build-system ocaml-build-system)
7274 `(#:tests? #f; no test target in Makefile
7276 (modify-phases %standard-phases
7277 (add-before 'configure 'export-shell
7278 (lambda* (#:key inputs #:allow-other-keys)
7279 (setenv "CONFIG_SHELL"
7280 (search-input-file inputs "/bin/sh")))))))
7290 (native-search-paths
7291 (list (search-path-specification
7292 (variable "FRAMAC_SHARE")
7293 (files '("share/frama-c"))
7295 (search-path-specification
7296 (variable "FRAMAC_LIB")
7297 (files '("lib/frama-c"))
7299 (home-page "http://frama-c.com")
7300 (synopsis "C source code analysis platform")
7301 (description "Frama-C is an extensible and collaborative platform dedicated
7302 to source-code analysis of C software. The Frama-C analyzers assist you in
7303 various source-code-related activities, from the navigation through unfamiliar
7304 projects up to the certification of critical software.")
7305 (license license:lgpl2.1+)))
7307 (define-public blitz
7315 (url "https://github.com/blitzpp/blitz")
7317 (file-name (git-file-name name version))
7319 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
7320 (build-system cmake-build-system)
7322 `(#:configure-flags '("-DBUILD_DOC=ON"
7323 "-DBUILD_TESTING=ON")
7324 ;; The default "check" target also includes examples and benchmarks.
7325 #:test-target "check-testsuite"
7327 (modify-phases %standard-phases
7328 (add-after 'build 'build-doc
7330 (invoke "make" "-j" (number->string (parallel-job-count))
7333 (list python texinfo))
7334 (synopsis "C++ template class library for multidimensional arrays")
7335 (description "Blitz++ is a C++ template class library that provides
7336 high-performance multidimensional array containers for scientific computing.")
7337 (home-page "https://github.com/blitzpp/blitz")
7338 (license (list license:artistic2.0
7342 (define-public fxdiv
7343 ;; There is currently no tag in this repo.
7344 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
7349 (version (git-version version revision commit))
7350 (home-page "https://github.com/Maratyszcza/FXdiv")
7353 (uri (git-reference (url home-page) (commit commit)))
7354 (file-name (git-file-name name version))
7357 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
7358 (patches (search-patches "fxdiv-system-libraries.patch"))))
7359 (build-system cmake-build-system)
7361 (list googletest googlebenchmark))
7363 "C++ library for division via fixed-point multiplication by inverse")
7365 "On modern CPUs and GPUs, integer division is several times slower than
7366 multiplication. FXdiv implements an algorithm to replace an integer division
7367 with a multiplication and two shifts. This algorithm improves performance
7368 when an application performs repeated divisions by the same divisor.")
7369 (license license:expat))))
7372 ;; There is currently no tag in this repo.
7373 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
7378 (version (git-version version revision commit))
7379 (home-page "https://github.com/Maratyszcza/FP16")
7382 (uri (git-reference (url home-page) (commit commit)))
7383 (file-name (git-file-name name version))
7386 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
7387 (patches (search-patches "fp16-system-libraries.patch"))))
7388 (build-system cmake-build-system)
7390 `(#:imported-modules ((guix build python-build-system)
7391 ,@%cmake-build-system-modules)
7392 #:modules (((guix build python-build-system)
7393 #:select (site-packages))
7394 (guix build cmake-build-system)
7396 #:phases (modify-phases %standard-phases
7397 (add-after 'install 'move-python-files
7398 (lambda* (#:key inputs outputs #:allow-other-keys)
7399 ;; Python files get installed to $includedir (!).
7400 ;; Move them to the usual Python site directory.
7401 (let* ((out (assoc-ref outputs "out"))
7402 (include (string-append out "/include"))
7403 (site (site-packages inputs outputs))
7404 (target (string-append site "/fp16")))
7406 (for-each (lambda (file)
7408 (string-append target "/"
7411 (find-files include "\\.py$"))))))))
7413 (list python-wrapper))
7415 (list psimd googletest googlebenchmark))
7416 (synopsis "C++ library for half-precision floating point formats")
7418 "This header-only C++ library implements conversion to and from
7419 half-precision floating point formats.")
7420 (license license:expat))))
7422 (define-public optizelle
7423 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
7426 (version (git-version "1.3.0" "0" commit))
7431 (url "https://github.com/OptimoJoe/Optizelle")
7433 (file-name (git-file-name "optizelle" commit))
7436 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
7437 (modules '((guix build utils)))
7440 ;; Reduce the stopping tolerance in one test so that the
7441 ;; convergence check returns the correct stopping
7444 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
7445 (("1e-13") "5e-14"))
7446 ;; Skip one set of python tests. See
7447 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
7449 "src/examples/inequality_scaling/CMakeLists.txt"
7450 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
7451 (string-append "add_unit" middle "\"cpp\"" end)))
7452 ;; Install the licence for Optizelle, without also
7453 ;; including the licences for the dependencies.
7454 (substitute* "licenses/CMakeLists.txt"
7455 (("file.*package.*$" all)
7456 (string-append "# " all))
7457 ((".*[^l].[.]txt\\)\n") "")
7458 (("add_license.*\"\n") ""))
7460 (build-system cmake-build-system)
7462 `(#:imported-modules ((guix build python-build-system)
7463 ,@%cmake-build-system-modules)
7464 #:modules (((guix build python-build-system) #:select
7466 (guix build cmake-build-system)
7468 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
7469 "-DENABLE_CPP_UNIT:BOOL=ON"
7470 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
7471 "-DENABLE_PYTHON:BOOL=ON"
7472 "-DENABLE_PYTHON_UNIT:BOOL=ON"
7473 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
7474 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
7475 (assoc-ref %build-inputs
7477 "/lib/libopenblas.so")
7478 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7479 (assoc-ref %build-inputs
7481 "/lib/libgfortran.so;"
7482 (assoc-ref %build-inputs
7484 "/lib/libquadmath.so"))
7486 (modify-phases %standard-phases
7487 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7488 (lambda* (#:key inputs #:allow-other-keys)
7489 (let* ((pyver (python-version (assoc-ref inputs "python")))
7490 (npdir (string-append (assoc-ref inputs "numpy")
7493 (substitute* "src/cmake/Modules/Optizelle.cmake"
7495 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7496 "PYTHONPATH=" npdir ":"))))))
7497 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7499 `(("blas/lapack" ,openblas)
7500 ("fortran:lib" ,gfortran "lib")
7501 ("jsoncpp" ,jsoncpp)
7502 ("numpy" ,python-numpy)
7503 ("python" ,python)))
7505 `(("fortran" ,gfortran)
7506 ("pkg-config" ,pkg-config)))
7507 (home-page "https://www.optimojoe.com/products/optizelle/")
7508 (synopsis "Mathematical optimization library")
7509 (description "@code{optizelle} is a software library designed to
7510 solve nonlinear optimization problems. Four types of problem are
7511 considered: unconstrained, equality constrained, inequality
7512 constrained and constrained. Constraints may be applied as values of
7513 functions or sets of partial differential equations (PDEs).
7515 Solution algorithms such as the preconditioned nonlinear conjugate
7516 gradient method, sequential quadratic programming (SQP) and the
7517 primal-dual interior-point method are made available. Interfaces are
7518 provided for applications written in C++ and Python. Parallel
7519 computation is supported via MPI.")
7520 (license license:bsd-2))))