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 "A 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 ;; For a fully featured Octave, users are strongly recommended also to install
2481 ;; the following packages: less, ghostscript, gnuplot.
2482 (define-public octave-cli
2489 (uri (string-append "mirror://gnu/octave/octave-"
2493 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2494 (build-system gnu-build-system)
2496 `(("alsa-lib" ,alsa-lib)
2497 ("arpack" ,arpack-ng)
2503 ("fontconfig" ,fontconfig)
2504 ("freetype" ,freetype)
2508 ("graphicsmagick" ,graphicsmagick)
2510 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2511 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2512 ;; libtiff.la instead of having to provide it here.
2513 ("libjpeg" ,libjpeg-turbo)
2517 ("libsndfile" ,libsndfile)
2521 ("portaudio" ,portaudio)
2523 ("readline" ,readline)
2524 ("suitesparse" ,suitesparse)
2525 ("texinfo" ,texinfo)
2531 ;; The following inputs are not actually used in the build process.
2532 ;; However, the ./configure gratuitously tests for their existence and
2533 ;; assumes that programs not present at build time are also not, and
2534 ;; can never be, available at run time! If these inputs are therefore
2535 ;; not present, support for them will be built out. However, Octave
2536 ;; will still run without them, albeit without the features they
2541 ;; Octave code uses this variable to detect directories holding multiple CA
2542 ;; certificates to verify peers with. This is required for the networking
2543 ;; functions that require encryption to work properly.
2544 (native-search-paths
2545 (list (search-path-specification
2546 (variable "CURLOPT_CAPATH")
2547 (files '("etc/ssl/certs")))))
2550 (list (string-append "--with-shell="
2551 (assoc-ref %build-inputs "bash")
2554 ;; XXX: Without this flag, linking octave-cli fails with
2555 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2556 ;; not pulling in liboctinterp.la for -lstdc++.
2557 "--enable-link-all-dependencies")
2559 (modify-phases %standard-phases
2560 (add-after 'configure 'configure-makeinfo
2561 (lambda* (#:key inputs #:allow-other-keys)
2562 (substitute* "libinterp/corefcn/help.h"
2565 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2567 (home-page "https://www.gnu.org/software/octave/")
2568 (synopsis "High-level language for numerical computation (no GUI)")
2569 (description "GNU Octave is a high-level interpreted language that is
2570 specialized for numerical computations. It can be used for both linear and
2571 non-linear applications and it provides great support for visualizing results.
2572 Work may be performed both at the interactive command-line as well as via
2574 (license license:gpl3+)))
2576 (define-public octave
2577 (package (inherit octave-cli)
2580 `(("qscintilla" ,qscintilla)
2582 ,@(package-inputs octave-cli)))
2584 `(("qttools" , qttools) ;for lrelease
2585 ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
2586 ,@(package-native-inputs octave-cli)))
2588 (substitute-keyword-arguments (package-arguments octave-cli)
2590 `(modify-phases ,phases
2591 (add-before 'configure 'patch-qscintilla-library-name
2592 (lambda* (#:key inputs #:allow-other-keys)
2593 ;; The QScintilla library that the Octave configure script tries
2594 ;; to link with should be named libqscintilla-qt5.so, but the
2595 ;; QScintilla input provides the shared library as
2596 ;; libqscintilla2_qt5.so.
2597 (substitute* "configure"
2598 (("qscintilla2-qt5")
2601 (synopsis "High-level language for numerical computation (with GUI)")))
2603 (define-public opencascade-oce
2605 (name "opencascade-oce")
2611 (url "https://github.com/tpaviot/oce")
2612 (commit (string-append "OCE-" version))))
2613 (file-name (git-file-name name version))
2614 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2616 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2617 (build-system cmake-build-system)
2620 (list "-DOCE_TESTING:BOOL=ON"
2621 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2622 "-DOCE_DRAW:BOOL=ON"
2623 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2624 (assoc-ref %outputs "out"))
2625 "-UCMAKE_INSTALL_RPATH")))
2634 `(("python" ,python-wrapper)))
2635 (home-page "https://github.com/tpaviot/oce")
2636 (synopsis "Libraries for 3D modeling and numerical simulation")
2638 "Open CASCADE is a set of libraries for the development of applications
2639 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2640 C++ class libraries providing services for 3D surface and solid modeling, CAD
2641 data exchange, and visualization. It is used for development of specialized
2642 software dealing with 3D models in design (CAD), manufacturing (CAM),
2643 numerical simulation (CAE), measurement equipment (CMM), and quality
2644 control (CAQ) domains.
2646 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2647 patches, improvements, and experiments contributed by users over the official
2648 Open CASCADE library.")
2649 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2650 ; use of header files; see
2651 ; OCCT_LGPL_EXCEPTION.txt
2652 license:public-domain; files
2653 ; src/Standard/Standard_StdAllocator.hxx and
2654 ; src/NCollection/NCollection_StdAllocator.hxx
2655 license:expat; file src/OpenGl/OpenGl_glext.h
2656 license:bsd-3)))); test framework gtest
2658 (define-public opencascade-occt
2660 (name "opencascade-occt")
2666 (url "https://git.dev.opencascade.org/repos/occt.git")
2669 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2671 (file-name (git-file-name name version))
2673 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2674 (modules '((guix build utils)))
2677 ;; Remove files specific to non-free operating systems.
2678 (delete-file-recursively "samples/ios")
2679 (delete-file-recursively "samples/mfc")
2680 (delete-file-recursively "samples/qt/FuncDemo")
2681 (delete-file "genconf.bat")
2682 (delete-file "gendoc.bat")
2683 (delete-file "genproj.bat")
2684 (delete-file "upgrade.bat")
2685 ;; Remove references to deleted files.
2686 (substitute* "dox/FILES_HTML.txt"
2687 ((".*standard.*") "" )
2688 ((".*UIKitSample.*") ""))
2690 (build-system cmake-build-system)
2692 '(;; There is no test target for make. OCCT provides an
2693 ;; 'Automated Testing System', which may be accessed after
2694 ;; installation via the draw.sh script. draw.sh is located in
2695 ;; the bin directory. For details see:
2696 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2697 ;; occt_dev_guides__tests.html
2699 ;; Configure without freeimage: attempting to link against the
2700 ;; freeimage version 3.17 library leads to 'undefined
2701 ;; reference' errors.
2703 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2705 "-DUSE_VTK:BOOL=OFF"
2706 "-DBUILD_DOC_Overview:BOOL=OFF"
2707 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2708 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2709 "-UCMAKE_INSTALL_LIBDIR")))
2712 ;("freeimage" ,freeimage)
2722 ;; TODO: build Overview documentation and add 'doc' output.
2723 (home-page "https://www.opencascade.com")
2724 (synopsis "Libraries for 3D modeling and numerical simulation")
2726 "Open CASCADE is a set of libraries for the development of applications
2727 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2728 C++ class libraries providing services for 3D surface and solid modeling, CAD
2729 data exchange, and visualization. It is used for development of specialized
2730 software dealing with 3D models in design (CAD), manufacturing (CAM),
2731 numerical simulation (CAE), measurement equipment (CMM), and quality
2732 control (CAQ) domains.
2734 This is the certified version of the Open Cascade Technology (OCCT) library.")
2735 (license (list ;; OCCT library:
2736 license:lgpl2.1; with an exception for the use of header
2737 ; files, see OCCT_LGPL_EXCEPTION.txt.
2738 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2739 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2741 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2742 ;; src/StepFile/step.tab.*:
2743 license:gpl3+ ; with Bison 2.2 exception.
2744 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2745 (license:non-copyleft
2746 "https://www.unicode.org/license.html")
2747 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2748 license:public-domain))))
2758 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2760 (string-append "gmsh_"
2761 (string-replace-substring version "." "_")))))
2762 (file-name (git-file-name name version))
2764 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2765 (modules '((guix build utils)))
2768 (delete-file-recursively "contrib/metis")
2770 (build-system cmake-build-system)
2784 `(("fontconfig" ,fontconfig)
2786 ("python" ,python)))
2788 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2789 "-DENABLE_BUILD_SHARED:BOOL=ON"
2790 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2791 #:imported-modules (,@%cmake-build-system-modules
2792 (guix build python-build-system))
2793 #:modules (((guix build python-build-system) #:select (site-packages))
2794 (guix build cmake-build-system)
2797 (modify-phases %standard-phases
2798 (add-after 'unpack 'patch-paths
2799 (lambda* (#:key inputs outputs #:allow-other-keys)
2800 ;; Use the standard Guix site-package path for
2801 ;; installation of the Python API.
2802 (substitute* "CMakeLists.txt"
2803 (("include\\(GNUInstallDirs\\)\n")
2804 (string-append "include(GNUInstallDirs)\n"
2806 (site-packages inputs outputs) ")\n"))
2807 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2808 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2809 ;; Find the shared library.
2810 (let ((libgmsh (string-append (assoc-ref outputs "out")
2811 "/lib/libgmsh.so")))
2812 (substitute* "api/gmsh.py"
2813 (("find_library\\(\"gmsh\"\\)")
2814 (simple-format #f "\"~a\"" libgmsh))))
2816 (home-page "http://gmsh.info/")
2817 (synopsis "3D finite element grid generator")
2818 (description "Gmsh is a 3D finite element grid generator with a built-in
2819 CAD engine and post-processor. Its design goal is to provide a fast, light
2820 and user-friendly meshing tool with parametric input and advanced
2821 visualization capabilities. Gmsh is built around four modules: geometry,
2822 mesh, solver and post-processing. The specification of any input to these
2823 modules is done either interactively using the graphical user interface or in
2824 ASCII text files using Gmsh's own scripting language.")
2825 (license license:gpl2+)))
2827 (define-public veusz
2834 (uri (pypi-uri "veusz" version))
2836 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2837 (build-system python-build-system)
2839 `(;; Tests will fail because they depend on optional packages like
2840 ;; python-astropy, which is not packaged.
2843 (modify-phases %standard-phases
2844 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2845 ;; the path is defined in Guix, therefore we have to change it.
2846 (add-after 'unpack 'fix-sip-dir
2848 (substitute* "pyqtdistutils.py"
2849 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2851 ;; Now we have to pass the correct sip_dir to setup.py.
2853 (lambda* (#:key inputs #:allow-other-keys)
2854 ;; We need to tell setup.py where to locate QtCoremod.sip
2855 ((@@ (guix build python-build-system) call-setuppy)
2857 (list (string-append "--sip-dir="
2858 (assoc-ref inputs "python-pyqt")
2861 ;; Ensure that icons are found at runtime.
2862 (add-after 'install 'wrap-executable
2863 (lambda* (#:key inputs outputs #:allow-other-keys)
2864 (let ((out (assoc-ref outputs "out")))
2865 (wrap-program (string-append out "/bin/veusz")
2866 `("QT_PLUGIN_PATH" prefix
2867 ,(list (string-append (assoc-ref inputs "qtsvg")
2868 "/lib/qt5/plugins/"))))))))))
2871 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2872 qttools python-sip-4))
2874 (list ghostscript ;optional, for EPS/PS output
2876 python-h5py ;optional, for HDF5 data
2881 (list python-numpy))
2882 (home-page "https://veusz.github.io/")
2883 (synopsis "Scientific plotting package")
2885 "Veusz is a scientific plotting and graphing program with a graphical
2886 user interface, designed to produce publication-ready 2D and 3D plots. In
2887 addition it can be used as a module in Python for plotting. It supports
2888 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2889 (license license:gpl2+)))
2891 (define-public maxflow
2894 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2895 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2900 (url "https://github.com/gerddie/maxflow")
2902 (file-name (git-file-name name version))
2905 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2906 (build-system cmake-build-system)
2907 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2908 (synopsis "Library implementing Maxflow algorithm")
2909 (description "An implementation of the maxflow algorithm described in
2910 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2911 Energy Minimization in Computer Vision.\n
2912 Yuri Boykov and Vladimir Kolmogorov.\n
2913 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2915 (license license:gpl3+)))
2917 (define-public petsc
2924 ;; The *-lite-* tarball does not contain the *large* documentation
2925 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2926 "petsc-lite-" version ".tar.gz"))
2928 (base32 "0sm03vpg010q9icidiq587n325m0598cj6hab2rdv85nwyygg74h"))))
2929 (outputs '("out" ; libraries and headers
2930 "examples")) ; ~30MiB of examples
2931 (build-system gnu-build-system)
2933 (list python which))
2935 (list gfortran openblas superlu
2936 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2937 ;; leaving out opengl, as configuration seems to only be for mac
2941 #:test-target "test"
2942 #:parallel-build? #f ; build is parallel by default
2944 #~(list "--with-mpi=0"
2947 (string-append "--with-openblas-dir="
2948 #$(this-package-input "openblas"))
2951 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2952 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2953 #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
2955 #~(modify-phases %standard-phases
2957 ;; PETSc's configure script is actually a python script, so we can't
2958 ;; run it with bash.
2959 (lambda* (#:key outputs (configure-flags '())
2961 (let* ((prefix (assoc-ref outputs "out"))
2962 (flags `(,(string-append "--prefix=" prefix)
2963 ,@configure-flags)))
2964 (format #t "build directory: ~s~%" (getcwd))
2965 (format #t "configure flags: ~s~%" flags)
2966 (apply invoke "./configure" flags)
2968 ;; Generate test scripts with the right shebang.
2969 (substitute* "config/example_template.py"
2970 (("#!/usr/bin/env bash")
2971 (string-append "#!" (which "bash")))))))
2972 (add-after 'configure 'clean-local-references
2973 (lambda* (#:key outputs #:allow-other-keys)
2974 (let ((out (assoc-ref outputs "out")))
2975 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2976 ;; Prevent build directory from leaking into compiled code
2978 ;; Scrub timestamp for reproducibility
2979 ((".*Libraries compiled on.*") ""))
2980 (substitute* (find-files "." "petscvariables")
2981 ;; Do not expose build machine characteristics, set to defaults.
2982 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2983 (("NPMAX = [:digit:]+") "NPMAX = 2")))))
2984 (add-after 'install 'clean-install
2985 ;; Try to keep installed files from leaking build directory names.
2986 (lambda* (#:key inputs outputs #:allow-other-keys)
2987 (let ((out (assoc-ref outputs "out")))
2988 (substitute* (map (lambda (file)
2989 (string-append out "/lib/petsc/conf/" file))
2990 '("petscvariables"))
2992 ;; Make compiler references point to the store
2993 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2994 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2995 (string-append "= " (which compiler))))
2996 ;; PETSc installs some build logs, which aren't necessary.
2997 (for-each (lambda (file)
2998 (let ((f (string-append out "/lib/petsc/conf/" file)))
2999 (when (file-exists? f)
3001 '("configure.log" "make.log" "gmake.log"
3002 "test.log" "error.log" "RDict.db"
3003 "PETScBuildInternal.cmake"
3004 ;; Once installed, should uninstall with Guix
3006 (add-after 'install 'move-examples
3007 (lambda* (#:key outputs #:allow-other-keys)
3008 (let* ((out (assoc-ref outputs "out"))
3009 (examples (assoc-ref outputs "examples"))
3010 (exdir (string-append out "/share/petsc/examples"))
3011 (exdir' (string-append examples "/share/petsc/examples")))
3012 (copy-recursively exdir exdir')
3013 (delete-file-recursively exdir)))))))
3014 (home-page "https://www.mcs.anl.gov/petsc")
3015 (synopsis "Library to solve PDEs")
3016 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
3017 data structures and routines for the scalable (parallel) solution of
3018 scientific applications modeled by partial differential equations.")
3019 (license (license:non-copyleft
3020 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
3022 (define-public petsc-complex
3025 (name "petsc-complex")
3027 (substitute-keyword-arguments (package-arguments petsc)
3028 ((#:configure-flags cf)
3029 #~(cons "--with-scalar-type=complex" #$cf))))
3030 (synopsis "Library to solve PDEs (with complex scalars)")))
3032 (define-public petsc-openmpi
3035 (name "petsc-openmpi")
3037 `(("hdf5" ,hdf5-parallel-openmpi)
3038 ("hypre" ,hypre-openmpi)
3040 ("mumps" ,mumps-openmpi)
3041 ("openmpi" ,openmpi)
3042 ("scalapack" ,scalapack)
3043 ("scotch" ,pt-scotch32)
3044 ,@(package-inputs petsc)))
3046 (substitute-keyword-arguments (package-arguments petsc)
3047 ((#:configure-flags cf)
3048 #~`("--with-hypre=1"
3049 "--with-mpiexec=mpirun"
3052 "--with-scalapack=1"
3054 ,(string-append "--with-mpi-dir="
3055 #$(this-package-input "openmpi"))
3056 ,(string-append "--with-hdf5-include="
3057 #$(this-package-input "hdf5") "/include")
3058 ,(string-append "--with-hdf5-lib="
3059 #$(this-package-input "hdf5") "/lib/libhdf5.a")
3060 ,@(delete "--with-mpi=0" #$cf)))
3062 #~(modify-phases #$phases
3063 (add-before 'configure 'mpi-setup
3064 #$%openmpi-setup)))))
3065 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
3067 (define-public petsc-complex-openmpi
3069 (inherit petsc-complex)
3070 (name "petsc-complex-openmpi")
3072 (modify-inputs (package-inputs petsc-complex)
3075 (substitute-keyword-arguments (package-arguments petsc-complex)
3076 ((#:configure-flags cf)
3077 #~`("--with-mpiexec=mpirun"
3078 ,(string-append "--with-mpi-dir="
3079 #$(this-package-input "openmpi"))
3080 ,@(delete "--with-mpi=0" #$cf)))
3082 #~(modify-phases #$phases
3083 (add-before 'configure 'mpi-setup
3084 #$%openmpi-setup)))))
3085 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
3087 (define-public python-petsc4py
3089 (name "python-petsc4py")
3094 (uri (pypi-uri "petsc4py" version))
3097 "0pxr6qa7p0pmpq0av29lx8lzlrdcfdzj87ynixzr8dn42y13a662"))
3098 (modules '((guix build utils)))
3101 ;; Ensure source file is regenerated in the build phase.
3102 (delete-file "src/petsc4py.PETSc.c")
3103 ;; Remove legacy GC code. See
3104 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
3105 (substitute* "src/PETSc/cyclicgc.pxi"
3106 ((".*gc_refs.*") "" )
3107 ((".*PyGC_Head.*") ""))
3109 (build-system python-build-system)
3112 (modify-phases %standard-phases
3113 (add-before 'build 'pre-build
3115 ;; Define path to PETSc installation.
3116 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3118 (add-before 'check 'mpi-setup
3121 (list python-cython))
3123 `(("petsc" ,petsc-openmpi)
3124 ("python-numpy" ,python-numpy)))
3125 (home-page "https://bitbucket.org/petsc/petsc4py/")
3126 (synopsis "Python bindings for PETSc")
3127 (description "PETSc, the Portable, Extensible Toolkit for
3128 Scientific Computation, is a suite of data structures and routines for
3129 the scalable (parallel) solution of scientific applications modeled by
3130 partial differential equations. It employs the MPI standard for all
3131 message-passing communication. @code{petsc4py} provides Python
3132 bindings to almost all functions of PETSc.")
3133 (license license:bsd-3)))
3135 (define-public python-kiwisolver
3137 (name "python-kiwisolver")
3141 (uri (pypi-uri "kiwisolver" version))
3144 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
3145 (build-system python-build-system)
3146 (home-page "https://github.com/nucleic/kiwi")
3147 (synopsis "Fast implementation of the Cassowary constraint solver")
3149 "Kiwi is an efficient C++ implementation of the Cassowary constraint
3150 solving algorithm. Kiwi has been designed from the ground up to be
3151 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
3152 Cassowary solver with typical use cases gaining a 40x improvement. Memory
3153 savings are consistently > 5x.")
3154 (license license:bsd-3)))
3156 (define-public python2-kiwisolver
3157 (package-with-python2 python-kiwisolver))
3159 (define-public slepc
3166 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
3170 "1ysfm77s5fcissv3q0k5d65mlp93zi4anqg62q3cd25dn66sva5i"))))
3171 (build-system gnu-build-system)
3173 `(("python" ,python)
3175 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
3177 `(("arpack" ,arpack-ng)
3178 ("gfortran" ,gfortran)))
3182 `(#:parallel-build? #f ;build is parallel by default
3184 `(,(string-append "--with-arpack-dir="
3185 (assoc-ref %build-inputs "arpack") "/lib"))
3186 #:make-flags ;honor (parallel-job-count)
3187 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
3188 ,(string-append "PETSCCONFIGDIR="
3189 (assoc-ref %build-inputs "petsc:examples")
3190 "/share/petsc/examples/config"))
3192 (modify-phases %standard-phases
3194 ;; configure is a python script, so we can't run it with bash.
3195 (lambda* (#:key inputs outputs (configure-flags '())
3197 (let* ((prefix (assoc-ref outputs "out"))
3198 (flags `(,(string-append "--prefix=" prefix)
3199 ,@configure-flags)))
3200 (format #t "build directory: ~s~%" (getcwd))
3201 (format #t "configure flags: ~s~%" flags)
3202 (setenv "SLEPC_DIR" (getcwd))
3203 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
3204 (apply invoke "./configure" flags))))
3205 (add-after 'install 'delete-doc
3206 ;; TODO: SLEPc installs HTML documentation alongside headers in
3207 ;; $out/include. We'd like to move them to share/doc, but delete
3208 ;; them for now, as they are incomplete and installing the complete
3209 ;; documentation is difficult.
3210 (lambda* (#:key outputs #:allow-other-keys)
3211 (let* ((out (assoc-ref outputs "out")))
3212 (for-each delete-file (find-files out "\\.html$"))
3214 (add-after 'install 'clean-install
3215 ;; Clean up unnecessary build logs from installation.
3216 (lambda* (#:key outputs #:allow-other-keys)
3217 (let ((out (assoc-ref outputs "out")))
3218 (for-each (lambda (file)
3219 (let ((f (string-append out "/lib/slepc/conf/" file)))
3220 (when (file-exists? f)
3222 '("configure.log" "make.log" "gmake.log"
3223 "test.log" "error.log" "RDict.db"
3226 (home-page "https://slepc.upv.es")
3227 (synopsis "Scalable library for eigenproblems")
3228 (description "SLEPc is a software library for the solution of large sparse
3229 eigenproblems on parallel computers. It can be used for the solution of
3230 linear eigenvalue problems formulated in either standard or generalized form,
3231 as well as other related problems such as the singular value decomposition.
3232 The emphasis of the software is on methods and techniques appropriate for
3233 problems in which the associated matrices are sparse, for example, those
3234 arising after the discretization of partial differential equations.")
3235 (license license:bsd-2)
3237 `((release-monitoring-url . "http://slepc.upv.es/download/")))))
3239 (define-public slepc-complex
3240 (package (inherit slepc)
3241 (name "slepc-complex")
3243 `(("petsc" ,petsc-complex)
3244 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3245 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
3247 (define-public slepc-openmpi
3248 (package (inherit slepc)
3249 (name "slepc-openmpi")
3251 (substitute-keyword-arguments (package-arguments slepc)
3252 ((#:phases phases '%standard-phases)
3253 `(modify-phases ,phases
3254 (add-before 'check 'mpi-setup
3255 ,%openmpi-setup)))))
3258 ,@(alist-delete "arpack" (package-inputs slepc))))
3260 `(("petsc" ,petsc-openmpi)
3261 ("arpack" ,arpack-ng-openmpi)
3262 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3263 (synopsis "Scalable library for eigenproblems (with MPI support)")))
3265 (define-public slepc-complex-openmpi
3266 (package (inherit slepc-openmpi)
3267 (name "slepc-complex-openmpi")
3269 `(("petsc" ,petsc-complex-openmpi)
3270 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
3271 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
3273 (define-public python-slepc4py
3275 (name "python-slepc4py")
3280 (uri (pypi-uri "slepc4py" version))
3283 "0fq997y73ymvcvdrxycp450pxwdgnqaw62gv9rwncfgsfplkvs9w"))))
3284 (build-system python-build-system)
3287 (modify-phases %standard-phases
3288 (add-before 'build 'pre-build
3290 ;; Define path to PETSc installation.
3291 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3292 ;; Define path to SLEPc installation.
3293 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3295 (add-before 'check 'mpi-setup
3298 `(("python-numpy" ,python-numpy)
3299 ("python-petsc4py" ,python-petsc4py)
3300 ("slepc" ,slepc-openmpi)))
3301 (home-page "https://bitbucket.org/slepc/slepc4py/")
3302 (synopsis "Python bindings for SLEPc")
3303 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3304 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3305 Scientific Computation. It employs the MPI standard for all
3306 message-passing communication. @code{slepc4py} provides Python
3307 bindings to almost all functions of SLEPc.")
3308 (license license:bsd-3)))
3310 (define-public metamath
3318 (url "https://github.com/metamath/metamath-exe")
3319 (commit (string-append "v" version))))
3320 (file-name (git-file-name name version))
3322 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3323 (build-system gnu-build-system)
3325 (list autoconf automake))
3326 (home-page "http://us.metamath.org/")
3327 (synopsis "Proof verifier based on a minimalistic formalism")
3329 "Metamath is a tiny formal language and that can express theorems in
3330 abstract mathematics, with an accompyaning @command{metamath} executable that
3331 verifies databases of these proofs. There is a public database,
3332 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3333 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3334 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3335 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3337 (license license:gpl2+)))
3339 (define-public minizinc
3346 (url "https://github.com/MiniZinc/libminizinc")
3348 (file-name (git-file-name name version))
3351 "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
3352 (modules '((guix build utils)
3357 ;; Do not advertise proprietary solvers
3358 (with-directory-excursion "cmake/targets"
3359 (let ((targets '("libminizinc_fzn.cmake"
3360 "libminizinc_gecode.cmake"
3361 "libminizinc_mip.cmake"
3362 "libminizinc_nl.cmake"
3363 "libminizinc_osicbc.cmake"
3364 "libminizinc_parser.cmake"
3368 (for-each delete-file
3371 (member file (cons* "." ".." targets)))
3373 (substitute* "libmzn.cmake"
3374 (("include\\(cmake/targets/(.*)\\)" all target)
3375 (if (member target targets) all "")))))
3376 (with-directory-excursion "include/minizinc/solvers/MIP"
3377 (for-each delete-file
3380 (member file '("." ".."
3381 "MIP_osicbc_solverfactory.hh"
3382 "MIP_osicbc_wrap.hh"
3383 "MIP_solverinstance.hh"
3384 "MIP_solverinstance.hpp"
3387 (with-directory-excursion "solvers/MIP"
3388 (for-each delete-file
3391 (member file '("." ".."
3392 "MIP_osicbc_solverfactory.cpp"
3393 "MIP_osicbc_wrap.cpp"
3394 "MIP_solverinstance.cpp"
3397 (substitute* "CMakeLists.txt"
3398 (("find_package\\(([^ ]*).*\\)" all pkg)
3399 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
3402 ;; TODO: swap out miniz for zlib
3404 (build-system cmake-build-system)
3406 `(#:tests? #f ; no ‘check’ target
3407 #:modules ((guix build cmake-build-system)
3411 (modify-phases %standard-phases
3412 (add-after 'install 'install-solver-configs
3413 (lambda* (#:key inputs outputs #:allow-other-keys)
3414 (let ((gecode (assoc-ref inputs "gecode"))
3415 (pkgdatadir (string-append (assoc-ref outputs "out")
3416 "/share/minizinc")))
3417 (call-with-output-file (string-append pkgdatadir
3418 "/Preferences.json")
3423 [\"\", \"org.gecode.gecode\"],
3424 [\"gecode\", \"org.gecode.gecode\"]
3426 \"solverDefaults\": []
3431 (mkdir-p (string-append pkgdatadir "/solvers"))
3432 (call-with-output-file (string-append pkgdatadir
3433 "/solvers/gecode.msc")
3438 \"id\": \"org.gecode.gecode\",
3439 \"name\": \"Gecode\",
3440 \"description\": \"Gecode FlatZinc executable\",
3444 \"supportsMzn\": false,
3445 \"supportsFzn\": true,
3446 \"needsSolns2Out\": true,
3447 \"needsMznExecutable\": false,
3448 \"needsStdlibDir\": false,
3449 \"isGUIApplication\": false
3451 (last (string-split gecode #\-))
3452 (string-append gecode "/share/gecode/mznlib")
3453 (string-append gecode "/bin/fzn-gecode"))
3454 (newline port)))))))))
3458 (list cbc gecode zlib))
3459 (home-page "https://www.minizinc.org")
3460 (synopsis "High-level constraint modeling language")
3461 (description "MiniZinc is a high-level modeling language for constraint
3462 satisfaction and optimization problems. Models are compiled to FlatZinc, a
3463 language understood by many solvers.")
3464 (license license:mpl2.0)))
3466 (define-public mumps
3473 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
3477 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
3478 (patches (search-patches "mumps-build-parallelism.patch"
3479 "mumps-shared-libseq.patch"
3480 "mumps-shared-mumps.patch"
3481 "mumps-shared-pord.patch"))))
3482 (build-system gnu-build-system)
3484 `(("fortran" ,gfortran)
3485 ;; These are required for linking against mumps, but we let the user
3486 ;; declare the dependency.
3489 ("scotch" ,scotch)))
3491 `(#:modules ((ice-9 match)
3494 ,@%gnu-build-system-modules)
3496 (modify-phases %standard-phases
3498 (lambda* (#:key inputs #:allow-other-keys)
3499 (call-with-output-file "Makefile.inc"
3510 INCSEQ = -I$(topdir)/libseq
3511 LIBSEQ = $(topdir)/libseq/libmpiseq.a
3512 LIBSEQNEEDED = libseqneeded~;
3516 AR = ar vr # rules require trailing space, ugh...
3519 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
3521 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
3522 LIBOTHERS = -pthread
3525 OPTF = -O2 -DALLOW_NON_INIT -fallow-argument-mismatch $(PIC)
3529 LIBS = $(SCALAP) $(LIBSEQ)
3530 LPORDDIR = $(topdir)/PORD/lib
3531 IPORD = -I$(topdir)/PORD/include
3532 LPORD = $(LPORDDIR)/libpord.a
3533 ORDERINGSF = -Dpord~@[
3535 IMETIS = -I$(METISDIR)/include
3536 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3537 ORDERINGSF += -Dmetis~]~@[~:{
3539 ISCOTCH = -I$(SCOTCHDIR)/include
3540 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
3541 ORDERINGSF += ~a~}~]
3542 ORDERINGSC = $(ORDERINGSF)
3543 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
3544 IORDERINGSF = $(ISCOTCH)
3545 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3546 (assoc-ref inputs "mpi")
3547 (assoc-ref inputs "blas")
3548 (assoc-ref inputs "scalapack")
3549 (assoc-ref inputs "metis")
3550 (match (list (assoc-ref inputs "pt-scotch")
3551 (assoc-ref inputs "scotch"))
3555 `((,scotch "" "-Dscotch")))
3558 "-lptesmumps -lptscotch -lptscotcherr "
3559 "-Dptscotch")))))))))
3561 ;; By default only the d-precision library is built. Make with "all"
3562 ;; target so that all precision libraries and examples are built.
3564 (invoke "make" "all"
3565 (format #f "-j~a" (parallel-job-count)))))
3567 ;; Run the simple test drivers, which read test input from stdin:
3568 ;; from the "real" input for the single- and double-precision
3569 ;; testers, and from the "cmplx" input for complex-precision
3570 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3571 ;; package to prefix execution with "mpirun".
3572 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3573 (with-directory-excursion "examples"
3576 (let ((tester (apply open-pipe*
3579 ,(string-append "./" prec
3581 (input (open-input-file
3582 (string-append "input_simpletest_" type))))
3584 (dump-port input tester)
3586 (zero? (close-pipe tester)))))
3588 '("real" "real" "cmplx" "cmplx")))))
3590 (lambda* (#:key outputs #:allow-other-keys)
3591 (let* ((out (assoc-ref outputs "out"))
3592 (libdir (string-append out "/lib")))
3593 (copy-recursively "lib" libdir)
3594 (copy-recursively "include" (string-append out "/include"))
3595 (when (file-exists? "libseq/libmpiseq.a")
3596 (install-file "libseq/libmpiseq.a" libdir))
3597 (when (file-exists? "libseq/libmpiseq.so")
3598 (install-file "libseq/libmpiseq.so" libdir))
3600 (home-page "http://mumps.enseeiht.fr")
3601 (synopsis "Multifrontal sparse direct solver")
3603 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3604 sparse system of linear equations A x = b using Gaussian elimination.")
3605 (license license:cecill-c)))
3607 (define-public mumps-metis
3608 (package (inherit mumps)
3609 (name "mumps-metis")
3611 (alist-delete "scotch" (package-inputs mumps)))))
3613 (define-public mumps-openmpi
3614 (package (inherit mumps)
3615 (name "mumps-openmpi")
3618 ("scalapack" ,scalapack)
3619 ("pt-scotch" ,pt-scotch)
3620 ,@(alist-delete "scotch" (package-inputs mumps))))
3622 (substitute-keyword-arguments (package-arguments mumps)
3624 `(modify-phases ,phases
3625 (add-before 'check 'mpi-setup
3629 ((assoc-ref ,phases 'check)
3630 #:exec-prefix '("mpirun" "-n" "2"))))))))
3631 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3633 (define-public mumps-metis-openmpi
3634 (package (inherit mumps-openmpi)
3635 (name "mumps-metis-openmpi")
3637 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3639 (define-public ruby-asciimath
3641 (name "ruby-asciimath")
3646 (uri (rubygems-uri "asciimath" version))
3649 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3650 (build-system ruby-build-system)
3652 (list ruby-nokogiri ruby-rspec))
3653 (synopsis "AsciiMath parsing and conversion library")
3655 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3656 easy-to-write markup language for mathematics.")
3657 (home-page "https://github.com/asciidoctor/asciimath")
3658 (license license:expat)))
3660 (define-public superlu
3667 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3668 "superlu_" version ".tar.gz"))
3670 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3671 (modules '((guix build utils)))
3673 ;; Replace the non-free implementation of MC64 with a stub adapted
3676 (use-modules (ice-9 regex)
3678 (call-with-output-file "SRC/mc64ad.c"
3683 void mc64id_(int *a) {
3684 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3687 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3688 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3689 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3692 ;; Remove the corresponding license verbiage. MC64 license follows
3693 ;; a "------" line separator.
3694 (with-atomic-file-replacement "License.txt"
3695 (let ((rx (make-regexp "-{8}")))
3698 (let ((line (read-line in 'concat)))
3699 (unless (regexp-exec rx line)
3703 (build-system cmake-build-system)
3707 `(("blas" ,openblas)
3708 ("gfortran" ,gfortran)))
3710 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3711 "-DTPL_BLAS_LIBRARIES=openblas"
3712 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3713 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3714 (synopsis "Supernodal direct solver for sparse linear systems")
3716 "SuperLU is a general purpose library for the direct solution of large,
3717 sparse, nonsymmetric systems of linear equations on high performance machines.
3718 The library is written in C and is callable from either C or Fortran. The
3719 library routines perform an LU decomposition with partial pivoting and
3720 triangular system solves through forward and back substitution. The library
3721 also provides threshold-based ILU factorization preconditioners.")
3722 (license (list license:bsd-3
3723 license:gpl2+ ;EXAMPLE/*fgmr.c
3724 (license:fsf-free "file://SRC/colamd.h")))))
3726 (define-public superlu-dist
3728 (name "superlu-dist")
3734 (url "https://github.com/xiaoyeli/superlu_dist")
3735 (commit (string-append "v" version))))
3736 (file-name (git-file-name name version))
3738 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3739 (modules '((guix build utils)))
3741 ;; Replace the non-free implementation of MC64 with a stub
3743 (make-file-writable "SRC/mc64ad_dist.c")
3744 (call-with-output-file "SRC/mc64ad_dist.c"
3749 void mc64id_dist(int *a) {
3750 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3753 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3754 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3755 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3758 (substitute* "SRC/util.c" ;adjust default algorithm
3759 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3760 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3761 ;; general (i.e. non-square) processor-grid support.
3762 "RowPerm = NOROWPERM;"))
3764 (patches (search-patches "superlu-dist-scotchmetis.patch"
3765 "superlu-dist-awpm-grid.patch"))))
3766 (build-system cmake-build-system)
3770 `(("gfortran" ,gfortran)
3773 ("combblas" ,combinatorial-blas)))
3775 `(("mpi" ,openmpi) ;headers include MPI heades
3776 ("parmetis" ,pt-scotch32 "metis")
3777 ("pt-scotch" ,pt-scotch32)))
3779 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3780 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3781 "-DTPL_ENABLE_COMBBLASLIB=YES"
3782 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3783 "-DTPL_LAPACK_LIBRARIES=-llapack"
3784 (string-append "-DTPL_PARMETIS_LIBRARIES="
3786 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3787 "scotchmetis" "scotch" "scotcherr")
3789 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3790 (assoc-ref %build-inputs "parmetis")
3792 "-DTPL_ENABLE_COMBBLASLIB=ON"
3793 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3794 (assoc-ref %build-inputs "combblas")
3795 "/include/CombBLAS;"
3796 (assoc-ref %build-inputs "combblas")
3797 "/include/BipartiteMatchings")
3798 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3800 (modify-phases %standard-phases
3801 (add-before 'configure 'set-c++-standard
3803 (substitute* "CMakeLists.txt"
3804 ;; AWPM headers require C++14
3805 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3806 (add-before 'check 'mpi-setup
3808 (add-before 'check 'omp-setup
3809 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3810 (home-page (package-home-page superlu))
3811 (synopsis "Parallel supernodal direct solver")
3813 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3814 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3815 implemented in ANSI C, and MPI for communications.")
3816 (license license:bsd-3)))
3818 (define-public scotch
3825 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3826 "latestfile/298/scotch_" version ".tar.gz"))
3828 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3829 (patches (search-patches "scotch-build-parallelism.patch"
3830 "scotch-integer-declarations.patch"))))
3831 (build-system gnu-build-system)
3835 (list flex bison gfortran))
3836 (outputs '("out" "metis"))
3838 `(#:make-flags (list (string-append "prefix=" %output))
3840 (modify-phases %standard-phases
3842 'unpack 'chdir-to-src
3843 (lambda _ (chdir "src") #t))
3847 (call-with-output-file "Makefile.inc"
3862 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3863 LDFLAGS = -lz -lm -lrt -lpthread
3865 LEX = flex -Pscotchyy -olex.yy.c
3870 YACC = bison -pscotchyy -y -b y
3872 '("COMMON_FILE_COMPRESS_GZ"
3874 "COMMON_RANDOM_FIXED_SEED"
3875 "INTSIZE64" ;use 'int64_t'
3876 ;; Prevents symbol clashes with libesmumps
3878 ;; XXX: Causes invalid frees in superlu-dist tests
3880 ;; "SCOTCH_PTHREAD_NUMBER=2"
3881 "restrict=__restrict"))))
3883 (add-after 'build 'build-esmumps
3886 (format #f "-j~a" (parallel-job-count))
3888 (add-before 'install 'make-install-dirs
3889 (lambda* (#:key outputs #:allow-other-keys)
3890 (mkdir (assoc-ref outputs "out"))))
3891 (add-after 'install 'install-metis
3892 (lambda* (#:key outputs #:allow-other-keys)
3893 (let ((out (assoc-ref outputs "metis")))
3895 ;; metis files are not installed with 'make install'
3896 (for-each (lambda (f)
3897 (install-file f (string-append out "/include")))
3898 (find-files "../include/" ".*metis\\.h"))
3899 (for-each (lambda (f)
3900 (install-file f (string-append out "/lib")))
3901 (find-files "../lib/" ".*metis\\..*"))
3903 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3905 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3906 (synopsis "Programs and libraries for graph algorithms")
3907 (description "SCOTCH is a set of programs and libraries which implement
3908 the static mapping and sparse matrix reordering algorithms developed within
3909 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3910 conquer approach, to scientific computing problems such as graph and mesh
3911 partitioning, static mapping, and sparse matrix ordering, in application
3912 domains ranging from structural mechanics to operating systems or
3914 ;; See LICENSE_en.txt
3915 (license license:cecill-c)))
3917 (define-public scotch32
3918 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3919 ;; some applications.
3920 (package (inherit scotch)
3923 (substitute-keyword-arguments (package-arguments scotch)
3924 ((#:phases scotch-phases)
3925 `(modify-phases ,scotch-phases
3929 (call-with-output-file "Makefile.inc"
3944 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3945 LDFLAGS = -lz -lm -lrt -lpthread
3947 LEX = flex -Pscotchyy -olex.yy.c
3952 YACC = bison -pscotchyy -y -b y
3954 '("COMMON_FILE_COMPRESS_GZ"
3956 "COMMON_RANDOM_FIXED_SEED"
3957 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3958 ;; Prevents symbolc clashes with libesmumps
3960 ;; XXX: Causes invalid frees in superlu-dist tests
3962 ;; "SCOTCH_PTHREAD_NUMBER=2"
3963 "restrict=__restrict"))))))))))
3965 "Programs and libraries for graph algorithms (32-bit integers)")))
3967 (define-public scotch-shared
3968 (package (inherit scotch)
3969 (name "scotch-shared")
3971 (list gcc flex bison))
3973 (substitute-keyword-arguments (package-arguments scotch)
3974 ((#:phases scotch-shared-phases)
3975 `(modify-phases ,scotch-shared-phases
3979 ;; Otherwise, the RUNPATH will lack the final path component.
3980 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3981 (assoc-ref %outputs "out") "/lib"))
3982 (call-with-output-file "Makefile.inc"
3990 ARFLAGS = -shared -o
3997 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3998 CLIBFLAGS = -shared -fPIC
3999 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
4001 LEX = flex -Pscotchyy -olex.yy.c
4006 YACC = bison -pscotchyy -y -b y
4008 '("COMMON_FILE_COMPRESS_GZ"
4010 "COMMON_RANDOM_FIXED_SEED"
4011 "INTSIZE64" ;use 'int64_t'
4012 ;; Prevents symbolc clashes with libesmumps
4014 ;; XXX: Causes invalid frees in superlu-dist tests
4016 ;; "SCOTCH_PTHREAD_NUMBER=2"
4017 "restrict=__restrict"
4021 "Programs and libraries for graph algorithms (shared libraries version)")))
4023 (define-public pt-scotch
4024 (package (inherit scotch)
4027 (list openmpi)) ;Headers include MPI headers
4029 (substitute-keyword-arguments (package-arguments scotch)
4030 ((#:phases scotch-phases)
4031 `(modify-phases ,scotch-phases
4035 (invoke "make" (format #f "-j~a" (parallel-job-count))
4036 "ptscotch" "ptesmumps")
4038 ;; Install the serial metis compatibility library
4039 (invoke "make" "-C" "libscotchmetis" "install")))
4040 (add-before 'check 'mpi-setup
4044 (invoke "make" "ptcheck")))))))
4045 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
4047 (define-public pt-scotch32
4048 (package (inherit scotch32)
4049 (name "pt-scotch32")
4051 (list openmpi)) ;headers include MPI headers
4053 (substitute-keyword-arguments (package-arguments scotch32)
4054 ((#:phases scotch32-phases)
4055 `(modify-phases ,scotch32-phases
4058 (invoke "make" (format #f "-j~a" (parallel-job-count))
4059 "ptscotch" "ptesmumps")
4060 ;; Install the serial metis compatibility library
4061 (invoke "make" "-C" "libscotchmetis" "install")))
4062 (add-before 'check 'mpi-setup
4066 (invoke "make" "ptcheck")))))))
4068 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
4070 (define-public pt-scotch-shared
4071 (package (inherit scotch-shared)
4072 (name "pt-scotch-shared")
4074 (list openmpi)) ;Headers include MPI headers
4076 (substitute-keyword-arguments (package-arguments scotch-shared)
4077 ((#:phases scotch-shared-phases)
4078 `(modify-phases ,scotch-shared-phases
4082 (invoke "make" (format #f "-j~a" (parallel-job-count))
4083 "ptscotch" "ptesmumps")
4085 ;; Install the serial metis compatibility library
4086 (invoke "make" "-C" "libscotchmetis" "install")))
4087 (add-before 'check 'mpi-setup
4088 ,%openmpi-setup)))))
4089 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
4092 (define-public metis
4099 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
4100 "metis-" version ".tar.gz"))
4103 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
4105 `((release-monitoring-url
4106 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
4107 (build-system cmake-build-system)
4109 `(("blas" ,openblas)))
4111 `(#:tests? #f ;no tests
4112 #:configure-flags `("-DSHARED=ON"
4113 ,(string-append "-DGKLIB_PATH=" (getcwd)
4114 "/metis-" ,version "/GKlib"))))
4115 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
4116 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
4118 "METIS is a set of serial programs for partitioning graphs, partitioning
4119 finite element meshes, and producing fill-reducing orderings for sparse
4120 matrices. The algorithms implemented in METIS are based on the multilevel
4121 recursive-bisection, multilevel k-way, and multi-constraint partitioning
4123 (license license:asl2.0))) ;As of version 5.0.3
4125 (define-public p4est
4132 (uri (string-append "http://p4est.github.io/release/p4est-"
4136 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
4137 (build-system gnu-build-system)
4139 `(("fortran" ,gfortran)
4144 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
4145 (assoc-ref %build-inputs "blas")
4147 ,(string-append "LAPACK_LIBS=-L"
4148 (assoc-ref %build-inputs "lapack")
4150 #:phases (modify-phases %standard-phases
4151 (add-before 'check 'mpi-setup
4153 (home-page "http://www.p4est.org")
4154 (synopsis "Adaptive mesh refinement on forests of octrees")
4156 "The p4est software library enables the dynamic management of a
4157 collection of adaptive octrees, conveniently called a forest of octrees.
4158 p4est is designed to work in parallel and scales to hundreds of thousands of
4160 (license license:gpl2+)))
4162 (define-public p4est-openmpi
4163 (package (inherit p4est)
4164 (name "p4est-openmpi")
4167 ,@(package-inputs p4est)))
4169 (substitute-keyword-arguments (package-arguments p4est)
4170 ((#:configure-flags cf)
4171 ``("--enable-mpi" ,@,cf))))
4172 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
4174 (define-public gsegrafix
4175 ;; This is an old and equally dead "experimental fork" of the longer-dead
4176 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
4177 ;; libraries, instead rendering plots with Pango.
4184 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
4185 "gsegrafix-experimental-" version ".tar.gz"))
4187 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
4188 (build-system gnu-build-system)
4191 (list "--disable-static")))
4196 (home-page "https://www.gnu.org/software/gsegrafix/")
4197 (synopsis "GNOME application to create scientific and engineering plots")
4199 "GSEGrafix is an application which produces high-quality graphical
4200 plots for science and engineering. Plots are specified via simple ASCII
4201 parameter files and data files and are presented in an anti-aliased GNOME
4202 canvas. The program supports rectangular two-dimensional plots, histograms,
4203 polar-axis plots and three-dimensional plots. Plots can be printed or saved
4204 to BMP, JPEG or PNG image formats.")
4205 (license license:gpl3+)))
4207 (define-public maxima
4214 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
4215 version "-source/" name "-" version ".tar.gz"))
4218 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
4219 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
4220 (build-system gnu-build-system)
4222 `(("bash" ,bash-minimal)
4223 ("gnuplot" ,gnuplot) ;for plots
4226 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
4228 (list texinfo perl python))
4231 ,#~(list "--enable-sbcl"
4232 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
4233 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
4234 (string-append "--with-wish=" #$tk "/bin/wish"
4235 #$(version-major+minor (package-version tk))))
4236 ;; By default Maxima attempts to write temporary files to
4237 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
4238 ;; Work around that.
4239 #:make-flags (list "TMPDIR=/tmp")
4241 (modify-phases %standard-phases
4242 (add-after 'unpack 'patch-paths
4243 (lambda* (#:key inputs #:allow-other-keys)
4244 (let* ((sed (search-input-file inputs "/bin/sed"))
4245 (coreutils (assoc-ref inputs "coreutils"))
4246 (dirname (string-append coreutils "/bin/dirname"))
4247 (head (string-append coreutils "/bin/head"))
4248 (perl (search-input-file inputs "/bin/perl"))
4249 (python (search-input-file inputs "/bin/python3")))
4250 (substitute* "src/maxima.in"
4251 (("sed ") (string-append sed " "))
4252 (("dirname") dirname)
4254 (substitute* "doc/info/Makefile.in"
4255 (("/usr/bin/env perl") perl))
4256 (substitute* "doc/info/build_html.sh.in"
4257 (("python") python))
4259 (add-before 'check 'pre-check
4261 (chmod "src/maxima" #o555)
4265 ;; This is derived from the testing code in the "debian/rules" file
4266 ;; of Debian's Maxima package.
4267 ;; If Maxima can successfully run this, the binary to be installed
4273 "--batch-string=\"run_testsuite();\" "
4274 "| grep -q \"No unexpected errors found\""))))
4275 ;; Make sure the doc and emacs files are found in the
4276 ;; standard location. Also configure maxima to find gnuplot
4277 ;; without having it on the PATH.
4278 (add-after 'install 'post-install
4279 (lambda* (#:key outputs inputs #:allow-other-keys)
4280 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
4281 (out (assoc-ref outputs "out"))
4282 (datadir (string-append out "/share/maxima/" ,version))
4283 (binutils (dirname (search-input-file inputs "/bin/as"))))
4284 (with-directory-excursion out
4285 (mkdir-p "share/emacs")
4286 (mkdir-p "share/doc")
4288 (string-append datadir "/doc/")
4289 (string-append out "/share/doc/maxima"))
4290 (with-atomic-file-replacement
4291 (string-append datadir "/share/maxima-init.lisp")
4293 (format out "~a ~s~a~%"
4294 "(setf $gnuplot_command "
4295 (string-append gnuplot "/bin/gnuplot") ")")
4296 (dump-port in out))))
4297 ;; Ensure that Maxima will have access to the GNU binutils
4298 ;; components at runtime.
4299 (wrap-program (string-append out "/bin/maxima")
4300 `("PATH" prefix (,binutils))))
4302 (home-page "https://maxima.sourceforge.io")
4303 (synopsis "Numeric and symbolic expression manipulation")
4304 (description "Maxima is a system for the manipulation of symbolic and
4305 numerical expressions. It yields high precision numeric results by using
4306 exact fractions, arbitrary precision integers, and variable precision floating
4308 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
4309 ;; Others simply say "GNU General Public License" without stating a
4310 ;; version (which implicitly means gpl1+).
4311 ;; At least one file (src/maxima.asd) says "version 2."
4312 ;; GPLv2 only is therefore the smallest subset.
4313 (license license:gpl2)))
4315 (define-public wxmaxima
4323 (url "https://github.com/wxMaxima-developers/wxmaxima")
4324 (commit (string-append "Version-" version))))
4325 (file-name (git-file-name name version))
4327 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
4328 (build-system cmake-build-system)
4330 `(("gettext" ,gettext-minimal)))
4339 `(#:tests? #f ; tests fail non-deterministically
4341 (modify-phases %standard-phases
4342 (add-after 'unpack 'patch-doc-path
4344 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
4345 ;; documentation. Only licensing information is placed there by
4347 (substitute* "src/Dirstructure.cpp"
4348 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
4350 (add-after 'install 'wrap-program
4351 (lambda* (#:key inputs outputs #:allow-other-keys)
4352 (wrap-program (string-append (assoc-ref outputs "out")
4355 (,(string-append (assoc-ref inputs "maxima")
4357 ;; For GtkFileChooserDialog.
4358 `("GSETTINGS_SCHEMA_DIR" =
4359 (,(string-append (assoc-ref inputs "gtk+")
4360 "/share/glib-2.0/schemas")))
4361 `("XDG_DATA_DIRS" ":" prefix
4362 (;; Needed by gdk-pixbuf to know supported icon formats.
4364 (assoc-ref inputs "shared-mime-info") "/share")
4365 ;; The default icon theme of GTK+.
4367 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
4369 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
4370 (synopsis "Graphical user interface for the Maxima computer algebra system")
4372 "wxMaxima is a graphical user interface for the Maxima computer algebra
4373 system. It eases the use of Maxima by making most of its commands available
4374 through a menu system and by providing input dialogs for commands that require
4375 more than one argument. It also implements its own display engine that
4376 outputs mathematical symbols directly instead of depicting them with ASCII
4379 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
4380 text and mathematical calculations to create documents, exporting of input and
4381 output to TeX, and a browser for Maxima's manual including command index and
4382 full text searching.")
4383 (license license:gpl2+)))
4385 (define-public armadillo
4391 (uri (string-append "mirror://sourceforge/arma/armadillo-"
4395 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
4396 (build-system cmake-build-system)
4397 (arguments `(#:tests? #f)) ; no test target
4399 `(("openblas" ,openblas)
4401 ("arpack" ,arpack-ng)))
4402 (home-page "http://arma.sourceforge.net/")
4403 (synopsis "C++ linear algebra library")
4405 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4406 between speed and ease of use. It is useful for algorithm development
4407 directly in C++, or quick conversion of research code into production
4408 environments. It can be used for machine learning, pattern recognition,
4409 signal processing, bioinformatics, statistics, econometrics, etc. The library
4410 provides efficient classes for vectors, matrices and cubes, as well as 150+
4411 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4412 (license license:asl2.0)))
4414 (define-public muparser
4415 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4416 ;; different hash. In order to make `guix package --upgrade` work correctly,
4417 ;; we set a Guix packaging revision.
4418 ;; When the next version of muparser is released, we can remove
4419 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4420 (let ((upstream-version "2.2.5")
4424 (version (string-append upstream-version "-" revision))
4429 (url "https://github.com/beltoforion/muparser")
4430 (commit (string-append "v" upstream-version))))
4431 (file-name (git-file-name name version))
4433 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4434 (build-system gnu-build-system)
4436 `(#:configure-flags '("--enable-samples=no")
4437 #:tests? #f)) ;no "check" target
4438 (home-page "http://muparser.beltoforion.de/")
4439 (synopsis "Fast parser library for mathematical expressions")
4441 "muParser is an extensible high performance math parser library. It is
4442 based on transforming an expression into a bytecode and precalculating constant
4444 (license license:expat))))
4446 (define-public openblas
4454 (url "https://github.com/xianyi/OpenBLAS")
4455 (commit (string-append "v" version))))
4456 (file-name (git-file-name name version))
4459 "17zdd8asylz2w71hczrz5y344p6d5ds1jn4901maw7zcp3dbk63g"))))
4460 (build-system gnu-build-system)
4462 `(#:test-target "test"
4463 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4464 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4465 ;; we need to disable substitutions.
4467 ,(let ((system (or (%current-target-system) (%current-system))))
4468 (or (string-prefix? "x86_64" system)
4469 (string-prefix? "i686" system)
4470 (string-prefix? "mips" system)
4471 (string-prefix? "aarch64" system)))
4473 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4475 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4476 "NO_STATIC=1" ;avoid a 67 MiB static archive
4478 ;; This is the maximum number of threads OpenBLAS will ever use (that
4479 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4480 ;; is used.) If we don't set it, the makefile sets it to the number
4481 ;; of cores of the build machine, which is obviously wrong.
4484 ;; Build the library for all supported CPUs. This allows
4485 ;; switching CPU targets at runtime with the environment variable
4486 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4487 ;; Unfortunately, this is not supported on all architectures,
4488 ;; where it leads to failed builds.
4489 ,@(let ((system (or (%current-target-system) (%current-system))))
4491 ((or (string-prefix? "x86_64" system)
4492 (string-prefix? "i686" system)
4493 (string-prefix? "powerpc64le" system)
4494 (string-prefix? "aarch64" system))
4495 ;; Dynamic older enables a few extra CPU architectures that
4496 ;; were released before 2010.
4497 '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
4498 ;; On some of these architectures the CPU can't be detected.
4499 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4500 ;; two available MIPS targets special extended instructions
4501 ;; for Loongson cores are used.
4502 ((string-prefix? "mips" system)
4503 '("TARGET=SICORTEX"))
4504 ;; Failed to detect CPU.
4505 ((string-prefix? "armhf" system)
4508 ;; no configure script
4510 (modify-phases %standard-phases
4512 (add-before 'build 'set-extralib
4513 (lambda* (#:key inputs #:allow-other-keys)
4514 ;; Get libgfortran found when building in utest.
4516 (string-append "-L" (assoc-ref inputs "fortran-lib")
4519 `(("fortran-lib" ,gfortran "lib")))
4522 ("fortran" ,gfortran)
4524 (home-page "https://www.openblas.net/")
4525 (synopsis "Optimized BLAS library based on GotoBLAS")
4527 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4528 (license license:bsd-3)))
4530 (define-public openblas-ilp64
4531 (package/inherit openblas
4532 (name "openblas-ilp64")
4533 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4535 (substitute-keyword-arguments (package-arguments openblas)
4536 ((#:make-flags flags '())
4537 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4539 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4540 (license license:bsd-3)))
4546 (home-page "https://github.com/flame/blis")
4549 (uri (git-reference (url home-page) (commit version)))
4552 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4553 (file-name (git-file-name "blis" version))))
4556 (build-system gnu-build-system)
4559 ((guix build gnu-build-system)
4562 #:test-target "test"
4564 (modify-phases %standard-phases
4566 (lambda* (#:key outputs
4569 (configure-flags '())
4571 ;; This is a home-made 'configure' script.
4572 (let* ((out (assoc-ref outputs "out"))
4573 ;; Guix-specific support for choosing the configuration
4574 ;; via #:configure-flags: see below for details.
4575 (config-flag-prefix "--blis-config=")
4576 (maybe-config-flag (find
4578 (string-prefix? config-flag-prefix s))
4580 (configure-flags (if maybe-config-flag
4581 (delete maybe-config-flag
4584 ;; Select the "configuration" to build.
4585 ;; The "generic" configuration is non-optimized but
4586 ;; portable (no assembly).
4587 ;; The "x86_64" configuration family includes
4588 ;; sub-configurations for all supported
4589 ;; x86_64 microarchitectures.
4590 ;; BLIS currently lacks runtime hardware detection
4591 ;; for other architectures: see
4592 ;; <https://github.com/flame/blis/commit/c534da6>.
4593 ;; Conservatively, we stick to "generic" on armhf,
4594 ;; aarch64, and ppc64le for now. (But perhaps
4595 ;; "power9", "cortexa9", and "cortexa57" might be
4596 ;; general enough to use?)
4597 ;; Another approach would be to use the "auto"
4598 ;; configuration and make this package
4599 ;; non-substitutable.
4600 ;; The build is fairly intensive, though.
4604 (substring maybe-config-flag
4605 (string-length config-flag-prefix)))
4606 ((string-prefix? "x86_64" (or target system))
4615 "--enable-threading=openmp"
4616 "--enable-verbose-make"
4619 (format #t "configure args: ~s~%" configure-args)
4624 (add-before 'check 'show-test-output
4626 ;; By default "make check" is silent. Make it verbose.
4627 (system "tail -F output.testsuite &")
4629 (synopsis "High-performance basic linear algebra (BLAS) routines")
4631 "BLIS is a portable software framework for instantiating high-performance
4632 BLAS-like dense linear algebra libraries. The framework was designed to
4633 isolate essential kernels of computation that, when optimized, immediately
4634 enable optimized implementations of most of its commonly used and
4635 computationally intensive operations. While BLIS exports a new BLAS-like API,
4636 it also includes a BLAS compatibility layer which gives application developers
4637 access to BLIS implementations via traditional BLAS routine calls.")
4638 (license license:bsd-3)))
4640 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4641 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4642 (define-public blis-knl (deprecated-package "blis-knl" blis))
4644 (define ignorance blis)
4646 (define-public openlibm
4654 (url "https://github.com/JuliaLang/openlibm")
4655 (commit (string-append "v" version))))
4656 (file-name (git-file-name name version))
4658 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4659 (build-system gnu-build-system)
4662 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4663 ,(string-append "CC=" (cc-for-target)))
4665 ;; no configure script
4666 (modify-phases %standard-phases (delete 'configure))
4667 #:tests? #f)) ;the tests are part of the default target
4668 (home-page "https://openlibm.org/")
4669 (synopsis "Portable C mathematical library (libm)")
4671 "OpenLibm is an effort to have a high quality, portable, standalone C
4672 mathematical library (libm). It can be used standalone in applications and
4673 programming language implementations. The project was born out of a need to
4674 have a good libm for the Julia programming language that worked consistently
4675 across compilers and operating systems, and in 32-bit and 64-bit
4677 ;; Each architecture has its own make target, and there is none for mips.
4678 (supported-systems (delete "mips64el-linux" %supported-systems))
4679 ;; See LICENSE.md for details.
4680 (license (list license:expat
4683 license:public-domain
4684 license:lgpl2.1+))))
4686 (define-public openspecfun
4688 (name "openspecfun")
4694 (url "https://github.com/JuliaLang/openspecfun")
4695 (commit (string-append "v" version))))
4696 (file-name (git-file-name name version))
4698 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4699 (build-system gnu-build-system)
4701 '(#:tests? #f ; no "check" target
4703 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4705 (modify-phases %standard-phases
4706 (delete 'configure)))) ; no configure script
4708 `(("fortran" ,gfortran)))
4709 (home-page "https://github.com/JuliaLang/openspecfun")
4710 (synopsis "Collection of special mathematical functions")
4712 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4713 portable package for Bessel Functions of a Complex Argument and Nonnegative
4714 Order; it contains subroutines for computing Bessel functions and Airy
4715 functions. Faddeeva allows computing the various error functions of arbitrary
4716 complex arguments (Faddeeva function, error function, complementary error
4717 function, scaled complementary error function, imaginary error function, and
4718 Dawson function); given these, one can also easily compute Voigt functions,
4719 Fresnel integrals, and similar related functions as well.")
4720 ;; Faddeeva is released under the Expat license; AMOS is included as
4721 ;; public domain software.
4722 (license (list license:expat license:public-domain))))
4724 (define-public suitesparse
4726 (name "suitesparse")
4732 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4733 (commit (string-append "v" version))))
4734 (file-name (git-file-name name version))
4737 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4738 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4739 (modules '((guix build utils)))
4741 ;; Remove bundled metis source
4743 (delete-file-recursively "metis-5.1.0")
4745 (build-system gnu-build-system)
4747 `(#:tests? #f ;no "check" target
4749 (list (string-append "CC=" ,(cc-for-target))
4751 "MY_METIS_LIB=-lmetis"
4753 ;; The default is to link against netlib lapack. Use OpenBLAS
4755 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4757 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4758 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4759 (assoc-ref %outputs "out")
4760 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4761 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4762 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4763 " -DCMAKE_SKIP_RPATH=TRUE"
4764 " -DCMAKE_BUILD_TYPE=Release"
4765 " -DCMAKE_INSTALL_LIBDIR=lib")
4766 (string-append "INSTALL_LIB="
4767 (assoc-ref %outputs "out") "/lib")
4768 (string-append "INSTALL_INCLUDE="
4769 (assoc-ref %outputs "out") "/include")
4772 (modify-phases %standard-phases
4773 (delete 'configure)))) ;no configure script
4775 (list tbb openblas gmp mpfr metis))
4777 `(("cmake" ,cmake-minimal)
4779 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4780 (synopsis "Suite of sparse matrix software")
4782 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4783 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4784 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4785 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4786 CXSparse, a concise sparse Cholesky factorization package; and many other
4789 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4791 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4792 (license (list license:gpl2+ license:lgpl2.1+))))
4794 (define-public atlas
4800 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4801 version "/atlas" version ".tar.bz2"))
4802 (patches (search-patches "atlas-gfortran-compat.patch"))
4805 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4806 (build-system gnu-build-system)
4807 (home-page "http://math-atlas.sourceforge.net/")
4808 (inputs `(("gfortran" ,gfortran)
4809 ("lapack-tar" ,(package-source lapack))))
4810 (outputs '("out" "doc"))
4811 ;; For the moment we drop support for MIPS at it fails to compile. See
4812 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4813 (supported-systems (delete "mips64el-linux" %supported-systems))
4815 `(#:parallel-build? #f
4816 #:parallel-tests? #f
4818 ;; ATLAS tunes itself for the machine it is built on, as explained at
4819 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4820 ;; For this reason, we want users to build it locally instead of using
4824 #:modules ((srfi srfi-26)
4825 (guix build gnu-build-system)
4828 `(;; Generate position independent code suitable for dynamic libraries
4829 ;; and use WALL timer to get more accurate timing.
4830 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4833 ,,(if (string-match "64" (%current-system))
4836 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4837 ;; needed to compile C files before it is generated.
4838 "-Ss" "pmake" "make -j 1"
4839 ;; Probe is failing for MIPS. We therefore define the system
4840 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4841 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4842 ,,@(if (string-prefix? "mips" (%current-system))
4843 (list "-A" "49" "-V" "1")
4845 ;; Generate shared libraries.
4847 ;; Build a full LAPACK library.
4848 ,(string-append "--with-netlib-lapack-tarfile="
4849 (assoc-ref %build-inputs "lapack-tar")))
4851 (modify-phases %standard-phases
4852 (add-after 'install 'install-doc
4853 (lambda* (#:key outputs inputs #:allow-other-keys)
4854 (let ((doc (string-append (assoc-ref outputs "doc")
4855 "/share/doc/atlas")))
4857 (for-each (cut install-file <> doc)
4858 (find-files "../ATLAS/doc" ".*"))
4860 (add-after 'check 'check-pt
4861 (lambda _ (invoke "make" "ptcheck")))
4862 ;; Fix files required to run configure.
4863 (add-before 'configure 'fix-/bin/sh
4865 ;; Use `sh', not `/bin/sh'.
4866 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4870 ;; Fix /bin/sh in generated make files.
4871 (add-after 'configure 'fix-/bin/sh-in-generated-files
4873 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4877 ;; ATLAS configure program does not accepts the default flags
4878 ;; passed by the 'gnu-build-system'.
4880 (lambda* (#:key native-inputs inputs outputs
4881 (configure-flags '())
4882 #:allow-other-keys #:rest args)
4883 (let* ((prefix (assoc-ref outputs "out"))
4884 (bash (or (and=> (assoc-ref
4885 (or native-inputs inputs) "bash")
4886 (cut string-append <> "/bin/bash"))
4888 (flags `(,(string-append "--prefix=" prefix)
4890 (abs-srcdir (getcwd))
4891 (srcdir (string-append "../" (basename abs-srcdir))))
4892 (format #t "source directory: ~s (relative from build: ~s)~%"
4896 (format #t "build directory: ~s~%" (getcwd))
4897 (format #t "configure flags: ~s~%" flags)
4899 (string-append srcdir "/configure")
4901 (synopsis "Automatically Tuned Linear Algebra Software")
4903 "ATLAS is an automatically tuned linear algebra software library
4904 providing C and Fortran77 interfaces to a portably efficient BLAS
4905 implementation, as well as a few routines from LAPACK.
4907 Optimization occurs at build time. For this reason, the library is built on
4908 the machine where it is installed, without resorting to pre-built substitutes.
4910 Before building the library, CPU throttling should be disabled. This can be
4911 done in the BIOS, or, on GNU/Linux, with the following command:
4914 # cpupower --governor performance
4917 Failure to do so will result in a library with poor performance.")
4918 ;; The test suite is notoriously lengthy and routinely exceeds the default
4919 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4920 (properties '((timeout . 86400))) ; 1 day
4921 (license license:bsd-3)))
4931 (url "https://github.com/recp/cglm")
4932 (commit (string-append "v" version))))
4933 (file-name (git-file-name name version))
4935 (base32 "0zgckh56vcdar3a4n51r84wrizyd2ssqal4nsvxd4qdjm0rvb4h0"))))
4936 (build-system meson-build-system)
4938 `(#:configure-flags '("-Dbuild_tests=true")))
4939 (home-page "https://github.com/recp/cglm")
4940 (synopsis "Mathematics C library for graphics programming")
4942 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4943 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4946 It's similar to the original C++ GLM library but written in C99 and compatible
4948 (license license:expat)))
4957 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4958 version "/glm-" version ".zip"))
4960 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4961 (build-system cmake-build-system)
4963 `(#:phases (modify-phases %standard-phases
4965 (lambda* (#:key outputs #:allow-other-keys)
4966 ;; Since version 0.9.9.6, 'make install' is not supported
4967 ;; and we have to do it "manually". Upstream discussion:
4968 ;; <https://github.com/g-truc/glm/pull/968>.
4969 (let* ((source (string-append "../glm"))
4970 (out (assoc-ref outputs "out"))
4971 (inc (string-append out "/include"))
4972 (lib (string-append out "/lib"))
4973 (pkgconfig (string-append lib "/pkgconfig")))
4974 (with-directory-excursion source
4977 (copy-recursively "glm" (string-append inc "/glm"))
4978 (copy-recursively "cmake" (string-append lib "/cmake"))
4979 (call-with-output-file (string-append pkgconfig "/glm.pc")
4983 includedir=${prefix}/include
4986 Description: OpenGL Mathematics
4988 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4992 (home-page "https://glm.g-truc.net/")
4993 (synopsis "OpenGL Mathematics library")
4994 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4995 library for graphics software based on the OpenGL Shading Language (GLSL)
4997 (license license:expat)))
4999 (define-public lpsolve
5006 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
5007 "/lp_solve_" version "_source.tar.gz"))
5010 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
5011 (modules '((guix build utils)))
5014 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
5016 ;; Pretend to be on a 64 bit platform to obtain a common directory
5017 ;; name for the build results on all architectures; nothing else
5018 ;; seems to depend on it.
5019 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
5021 ;; The check for 'isnan' as it is written fails with
5022 ;; "non-floating-point argument in call to function
5023 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
5024 ;; definition, which in turn leads to bad things. Fix the feature
5026 (("isnan\\(0\\)") "isnan(0.)"))
5028 (build-system gnu-build-system)
5030 `(#:tests? #f ; no check target
5032 (modify-phases %standard-phases
5033 (delete 'configure) ; no configure script
5036 (with-directory-excursion "lpsolve55"
5037 (invoke "bash" "ccc"))
5038 (with-directory-excursion "lp_solve"
5039 (invoke "bash" "ccc"))
5042 (lambda* (#:key outputs #:allow-other-keys)
5043 (let* ((out (assoc-ref outputs "out"))
5044 (bin (string-append out "/bin"))
5045 (lib (string-append out "/lib"))
5046 ;; This is where LibreOffice expects to find the header
5047 ;; files, and where they are installed by Debian.
5048 (include (string-append out "/include/lpsolve")))
5049 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
5050 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
5051 (install-file "lp_solve/bin/ux64/lp_solve" bin)
5053 ;; Install a subset of the header files as on Debian
5054 ;; (plus lp_bit.h, which matches the regular expression).
5055 (for-each (lambda (name)
5056 (install-file name include))
5057 (find-files "." "lp_[HMSa-z].*\\.h$"))
5058 (with-directory-excursion "shared"
5059 (for-each (lambda (name)
5060 (install-file name include))
5061 (find-files "." "\\.h$")))
5063 (home-page "http://lpsolve.sourceforge.net/")
5064 (synopsis "Mixed integer linear programming (MILP) solver")
5066 "lp_solve is a mixed integer linear programming solver based on the
5067 revised simplex and the branch-and-bound methods.")
5068 (license license:lgpl2.1+)))
5070 ;; Private Trilinos package for dealii-openmpi (similar to
5071 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
5072 ;; This version is the latest known to be compatible with deal.II [1].
5073 ;; Since the latest version of Trilinos is not necessarily supported by
5074 ;; deal.II, it may be worth keeping this package even if and when Trilinos
5075 ;; gets packaged separately for Guix (unless various versions of Trilinos are
5078 ;; An insightful source of information for building Trilinos for deal.II lies
5079 ;; in the Trilinos package for candi [2], which is a source-based installer
5080 ;; for deal.II and its dependencies.
5082 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
5083 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
5084 (define trilinos-for-dealii-openmpi
5086 (name "trilinos-for-dealii-openmpi")
5092 (url "https://github.com/trilinos/Trilinos/")
5094 (string-append "trilinos-release-"
5095 (string-replace-substring version "." "-")))))
5096 (file-name (git-file-name "trilinos" version))
5098 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
5099 (build-system cmake-build-system)
5101 `(("gfortran" ,gfortran)
5102 ;; Trilinos's repository contains several C-shell scripts, but adding
5103 ;; tcsh to the native inputs does not result in the check phase running
5104 ;; any more tests than without it (nor is tcsh required to build
5106 ;; It seems that Trilinos has replaced its use of C-shell test scripts
5107 ;; with CMake's testing facilities.
5109 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
5110 ;; states that Zoltan's C-shell test script
5111 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
5112 ;; performed through CMake.
5114 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
5116 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
5118 ("python" ,python-2)))
5120 `(("blas" ,openblas)
5122 ("mumps" ,mumps-openmpi)
5123 ("scalapack" ,scalapack)))
5125 `(("mpi" ,openmpi)))
5127 `(#:build-type "Release"
5129 `("-DBUILD_SHARED_LIBS=ON"
5130 ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release
5131 ;; default) rather than -O2 (the RelWithDebInfo default), to conform
5132 ;; to candi's trilinos.package's compilation flags, which are -g -O3.
5133 "-DCMAKE_C_FLAGS=-g"
5134 "-DCMAKE_CXX_FLAGS=-g"
5135 "-DCMAKE_Fortran_FLAGS=-g"
5137 ;; Trilinos libraries that deal.II can interface with.
5138 "-DTrilinos_ENABLE_Amesos=ON"
5139 "-DTrilinos_ENABLE_AztecOO=ON"
5140 "-DTrilinos_ENABLE_Epetra=ON"
5141 "-DTrilinos_ENABLE_EpetraExt=ON"
5142 "-DTrilinos_ENABLE_Ifpack=ON"
5143 "-DTrilinos_ENABLE_ML=ON"
5144 "-DTrilinos_ENABLE_MueLu=ON"
5145 "-DTrilinos_ENABLE_ROL=ON"
5146 ;; Optional; required for deal.II's GridIn::read_exodusii, but
5147 ;; depends on netcdf.
5148 ;; Enable if and when someone needs it.
5149 ;;"-DTrilinos_ENABLE_SEACAS=ON"
5150 "-DTrilinos_ENABLE_Sacado=ON"
5151 "-DTrilinos_ENABLE_Teuchos=ON"
5152 "-DTrilinos_ENABLE_Tpetra=ON"
5153 "-DTrilinos_ENABLE_Zoltan=ON"
5155 ;; Third-party libraries (TPLs) that Trilinos can interface with.
5156 "-DBLAS_LIBRARY_NAMES=openblas"
5157 "-DTPL_ENABLE_MPI=ON"
5158 "-DTPL_ENABLE_MUMPS=ON"
5159 "-DTPL_ENABLE_SCALAPACK=ON"
5161 ;; Enable the tests but not the examples (which are enabled by
5162 ;; default when enabling tests).
5163 ;; Although some examples are run as tests, they are otherwise
5164 ;; unnecessary since this is a private package meant for
5166 ;; Besides, some MueLu and ROL examples require a lot of memory to
5169 ;; (For future reference, note that some ROL and SEACAS examples
5170 ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the
5171 ;; dune-istl, dune-localfunctions and dune-alugrid packages.)
5172 "-DTrilinos_ENABLE_TESTS=ON"
5173 "-DTrilinos_ENABLE_EXAMPLES=OFF"
5174 ;; MueLu tests require considerably more time and memory to compile
5175 ;; than the rest of the tests.
5176 "-DMueLu_ENABLE_TESTS=OFF"
5178 ;; The following options were gleaned from candi's trilinos.package.
5179 ;; (We do not enable the complex instantiations, which are anyway
5180 ;; provided only as an option in trilinos.package, because they are
5181 ;; costly in compilation time and memory usage, and disk space [1].)
5183 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
5184 "-DTrilinos_ENABLE_Ifpack2=OFF"
5185 "-DTeuchos_ENABLE_FLOAT=ON"
5186 "-DTpetra_INST_INT_LONG=ON"
5187 "-DTPL_ENABLE_Boost=OFF")
5189 (modify-phases %standard-phases
5190 (add-after 'configure 'fix-kokkos-config
5192 ;; GNU Make 4.3 accidentally leaves the backslash preceding the
5193 ;; number sign in strings containing a literal backslash–number
5194 ;; sign (\#) [1, 2].
5195 ;; This is still an issue in Trilinos 13.0.1, but should be fixed
5196 ;; in the following version.
5197 ;; (The latest versions of Kokkos incorporate the fix [2].)
5199 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
5200 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
5201 (substitute* "KokkosCore_config.h"
5204 (add-before 'check 'mpi-setup
5206 (home-page "https://trilinos.github.io/")
5207 (synopsis "Algorithms for engineering and scientific problems")
5209 "The Trilinos Project is an effort to develop algorithms and enabling
5210 technologies within an object-oriented software framework for the solution of
5211 large-scale, complex multi-physics engineering and scientific problems.
5212 A unique design feature of Trilinos is its focus on packages.")
5213 ;; The packages are variously licensed under more than just BSD-3 and
5214 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
5215 ;; See https://trilinos.github.io/license.html.
5216 (license (list license:bsd-3 license:lgpl2.1+))))
5218 (define-public dealii
5225 (uri (string-append "https://github.com/dealii/dealii/releases/"
5226 "download/v" version "/dealii-" version ".tar.gz"))
5228 (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
5229 (modules '((guix build utils)))
5232 ;; Remove bundled boost, muparser, TBB and UMFPACK.
5233 (delete-file-recursively "bundled")
5235 (build-system cmake-build-system)
5236 (outputs '("out" "doc"))
5238 ;; Required to build the documentation.
5240 ("doxygen" ,doxygen)
5243 `(("arpack" ,arpack-ng)
5245 ("gfortran" ,gfortran)
5247 ("muparser" ,muparser)
5250 ;; Some scripts are installed into share/deal.II/scripts that require
5251 ;; perl and python, but they are not executable (and some are missing the
5252 ;; shebang line) and therefore must be explicitly passed to the
5254 ;; Anyway, they are meant to be used at build time, so rather than adding
5255 ;; the interpreters here, any package depending on them should just add
5256 ;; the requisite interpreter to its native inputs.
5257 (list boost hdf5 suitesparse ; For UMFPACK.
5260 `(#:build-type "DebugRelease" ; Supports only Debug, Release and DebugRelease.
5261 ;; The tests take too long and must be explicitly enabled with "make
5263 ;; See https://www.dealii.org/developer/developers/testsuite.html.
5264 ;; (They can also be run for an already installed deal.II.)
5267 (let ((doc (string-append (assoc-ref %outputs "doc")
5268 "/share/doc/" ,name "-" ,version)))
5269 `("-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
5270 ,(string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
5271 ,(string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
5272 ;; Don't compile the examples because the source and CMakeLists.txt
5273 ;; are installed anyway, allowing users to do so for themselves.
5274 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
5275 ,(string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc "/examples")))
5277 (modify-phases %standard-phases
5278 (add-after 'install 'remove-build-logs
5279 ;; These build logs leak the name of the build directory by storing
5280 ;; the values of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.
5281 (lambda* (#:key outputs #:allow-other-keys)
5282 (let ((doc (string-append (assoc-ref outputs "doc")
5283 "/share/doc/" ,name "-" ,version)))
5284 (for-each delete-file (map (lambda (f) (string-append doc "/" f))
5285 '("detailed.log" "summary.log"))))
5287 (home-page "https://www.dealii.org/")
5288 (synopsis "Finite element library")
5290 "Deal.II is a C++ program library targeted at the computational solution
5291 of partial differential equations using adaptive finite elements. The main
5292 aim of deal.II is to enable rapid development of modern finite element codes,
5293 using among other aspects adaptive meshes and a wide array of tools often used
5294 in finite element programs.")
5295 (license license:lgpl2.1+)))
5297 (define-public dealii-openmpi
5298 (package/inherit dealii
5299 (name "dealii-openmpi")
5301 `(("arpack" ,arpack-ng-openmpi)
5303 ("scalapack" ,scalapack)
5304 ,@(alist-delete "arpack" (package-inputs dealii))))
5306 `(("hdf5" ,hdf5-parallel-openmpi)
5308 ("p4est" ,p4est-openmpi)
5309 ("petsc" ,petsc-openmpi)
5310 ("slepc" ,slepc-openmpi)
5311 ("trilinos" ,trilinos-for-dealii-openmpi)
5312 ,@(alist-delete "hdf5" (package-propagated-inputs dealii))))
5314 (substitute-keyword-arguments (package-arguments dealii)
5315 ((#:configure-flags flags)
5316 `(cons "-DDEAL_II_WITH_MPI=ON" ,flags))))
5317 (synopsis "Finite element library (with MPI support)")))
5319 (define-public flann
5323 (home-page "https://github.com/mariusmuja/flann/")
5327 (uri (git-reference (url home-page) (commit version)))
5328 (file-name (git-file-name name version))
5331 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
5332 (patches (search-patches "flann-cmake-3.11.patch"))))
5333 (build-system cmake-build-system)
5339 ;; FIXME: 'mkoctfile' fails with a linker error:
5340 ;; ld: cannot find -loctinterp
5341 ;; ld: cannot find -loctave
5342 ;; Disable it for now.
5343 ;;("octave" ,octave-cli)
5344 ("python" ,python-2) ; print syntax
5345 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
5348 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
5349 ;; taken 46 MiB unstripped, and 6 MiB stripped.
5350 #:strip-directories '("lib" "lib64" "libexec"
5351 "bin" "sbin" "share/flann/octave")
5353 ;; Save 12 MiB by not installing .a files. Passing
5354 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
5355 #:phases (modify-phases %standard-phases
5356 (add-after 'install 'remove-static-libraries
5357 (lambda* (#:key outputs #:allow-other-keys)
5358 (let* ((out (assoc-ref outputs "out"))
5359 (lib (string-append out "/lib")))
5360 (for-each delete-file
5361 (find-files lib "\\.a$"))
5364 #:tests? #f)) ; The test data are downloaded from the Internet.
5365 (synopsis "Library for approximate nearest neighbors computation")
5366 (description "FLANN is a library for performing fast approximate
5367 nearest neighbor searches in high dimensional spaces. It implements a
5368 collection of algorithms and a system for automatically choosing the best
5369 algorithm and optimum parameters depending on the dataset.
5371 FLANN is written in C++ and contains bindings for C, Octave and Python.")
5372 (license (license:non-copyleft "file://COPYING"
5373 "See COPYING in the distribution."))))
5375 (define-public wcalc
5382 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
5383 "wcalc-" version ".tar.bz2"))
5386 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
5387 (build-system gnu-build-system)
5389 (list mpfr readline))
5390 (home-page "http://w-calc.sourceforge.net/index.php")
5391 (synopsis "Flexible command-line scientific calculator")
5392 (description "Wcalc is a very capable calculator. It has standard functions
5393 (sin, asin, and sinh for example, in either radians or degrees), many
5394 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
5395 variables, a command history, hex/octal/binary input and output, unit
5396 conversions, embedded comments, and an expandable expression entry field. It
5397 evaluates expressions using the standard order of operations.")
5398 (license license:gpl2+)))
5407 (url "https://github.com/xaos-project/XaoS")
5408 (commit (string-append "release-" version))))
5409 (file-name (git-file-name name version))
5412 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5413 (build-system gnu-build-system)
5414 (native-inputs `(("gettext" ,gettext-minimal)
5415 ("qtbase" ,qtbase-5)
5416 ("qttools" ,qttools)))
5417 (inputs (list libx11 zlib libpng gsl))
5418 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5419 ;; not enough for this package to install properly. These phases fix that.
5421 `(#:tests? #f ;no "check" target
5423 (modify-phases %standard-phases
5424 (add-before 'configure 'make-qt-deterministic
5426 ;; Make Qt deterministic.
5427 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5430 (lambda* (#:key outputs #:allow-other-keys)
5431 (let ((out (assoc-ref outputs "out")))
5432 (substitute* "XaoS.pro"
5433 ;; The DESTDIR is originally set to install the xaos binary to
5434 ;; the "bin" folder inside the build directory. Setting make
5435 ;; flags doesn't seem to change this.
5437 (string-append "DESTDIR=" out "/bin"))
5438 ;; Set the correct path to the lrelease binary.
5439 (("lrelease-qt5") "lrelease"))
5440 (substitute* "src/include/config.h"
5441 (("/usr/share/XaoS")
5442 (string-append out "/share/XaoS")))
5444 (add-after 'install 'install-data
5445 (lambda* (#:key outputs #:allow-other-keys)
5446 (let* ((out (assoc-ref outputs "out"))
5447 (share (string-append out "/share")))
5451 (copy-recursively folder
5452 (string-append share "/XaoS/" folder)))
5453 '("catalogs" "examples" "tutorial"))
5454 (install-file "xdg/xaos.png"
5455 (string-append share "/pixmaps"))
5456 (install-file "xdg/xaos.desktop"
5457 (string-append share "/applications")))
5459 (synopsis "Real-time fractal zoomer")
5460 (description "GNU XaoS is a graphical program that generates fractal
5461 patterns and allows you to zoom in and out of them infinitely in a fluid,
5462 continuous manner. It also includes tutorials that help to explain how fractals
5463 are built. It can generate many different fractal types such as the Mandelbrot
5465 (home-page "https://xaos-project.github.io/")
5466 (license license:gpl2+)))
5468 (define-public hypre
5476 (url "https://github.com/hypre-space/hypre")
5477 (commit (string-append "v" version))))
5478 (file-name (git-file-name name version))
5480 (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
5481 (build-system gnu-build-system)
5482 (outputs '("out" ;5.3 MiB of headers and libraries
5483 "doc")) ;12 MiB of documentation
5486 ("doxygen" ,doxygen)
5488 ("python-breathe" ,python-breathe)
5489 ("python-sphinx" ,python-sphinx)
5490 ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
5502 texlive-generic-listofitems
5503 texlive-generic-ulem
5504 texlive-latex-capt-of
5506 texlive-latex-colortbl
5508 texlive-latex-fancyhdr
5509 texlive-latex-fancyvrb
5511 texlive-latex-fncychap
5512 texlive-latex-framed
5513 texlive-latex-geometry
5514 texlive-latex-hanging
5516 texlive-latex-multirow
5517 texlive-latex-natbib
5518 texlive-latex-needspace
5519 texlive-latex-newunicodechar
5520 texlive-latex-parskip
5521 texlive-latex-stackengine
5522 texlive-latex-tabulary
5523 texlive-latex-titlesec
5524 texlive-latex-tocloft
5525 texlive-latex-upquote
5526 texlive-latex-varwidth
5528 texlive-latex-wrapfig)))))
5530 `(("blas" ,openblas)
5531 ("lapack" ,lapack)))
5533 `(#:modules ((srfi srfi-1)
5534 ,@%gnu-build-system-modules)
5535 #:configure-flags '("--enable-shared"
5543 (modify-phases %standard-phases
5544 (add-before 'configure 'chdir-src
5545 (lambda _ (chdir "src")))
5547 (lambda* (#:key build target configure-flags
5548 #:allow-other-keys #:rest args)
5549 (let* ((configure (assoc-ref %standard-phases 'configure)))
5552 (list #:configure-flags
5553 (cons (string-append
5554 "--host=" (or target build))
5555 configure-flags)))))))
5556 (add-after 'build 'build-docs
5558 (invoke "make" "-C" "docs")))
5561 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5562 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5563 (invoke "make" "check" "CHECKRUN=")
5564 (for-each (lambda (filename)
5565 (let ((size (stat:size (stat filename))))
5566 (when (positive? size)
5567 (error (format #f "~a size ~d; error indication~%"
5569 (find-files "test" ".*\\.err$"))))
5570 (add-after 'install 'install-docs
5571 (lambda* (#:key outputs #:allow-other-keys)
5572 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5573 (let* ((doc (assoc-ref outputs "doc"))
5574 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5575 (with-directory-excursion "docs"
5576 (for-each (lambda (base)
5577 (install-file (string-append base ".pdf") docdir)
5578 (copy-recursively (string-append base "-html")
5579 (string-append docdir "/" base)))
5580 '("usr-manual" "ref-manual")))))))))
5581 (home-page "https://computing.llnl.gov/projects\
5582 /hypre-scalable-linear-solvers-multigrid-methods")
5583 (synopsis "Library of solvers and preconditioners for linear equations")
5585 "HYPRE is a software library of high performance preconditioners and
5586 solvers for the solution of large, sparse linear systems of equations. It
5587 features multigrid solvers for both structured and unstructured grid
5589 (license license:lgpl2.1)))
5591 (define-public hypre-openmpi
5592 (package (inherit hypre)
5593 (name "hypre-openmpi")
5596 ,@(package-inputs hypre)))
5598 (substitute-keyword-arguments (package-arguments hypre)
5599 ((#:configure-flags flags)
5601 ,@(delete "--without-MPI" ,flags)))
5603 `(modify-phases ,phases
5604 (add-before 'check 'mpi-setup
5605 ,%openmpi-setup)))))
5606 (synopsis "Parallel solvers and preconditioners for linear equations")
5608 "HYPRE is a software library of high performance preconditioners and
5609 solvers for the solution of large, sparse linear systems of equations on
5610 parallel computers. It features parallel multigrid solvers for both
5611 structured and unstructured grid problems.")))
5613 (define-public matio
5620 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5621 "matio-" version ".tar.gz"))
5624 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5625 (build-system gnu-build-system)
5627 (list zlib hdf5-1.8))
5628 (home-page "http://matio.sourceforge.net/")
5629 (synopsis "Library for reading and writing MAT files")
5630 (description "Matio is a library for reading and writing MAT files. It
5631 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5632 (license license:bsd-2)))
5639 (origin (method url-fetch)
5640 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5641 "download/" version "/Vc-" version ".tar.gz"))
5644 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5645 (build-system cmake-build-system)
5648 '("-DBUILD_TESTING=ON"
5649 ;; By default, Vc will optimize for the CPU of the build machine.
5650 ;; Setting this to "none" makes it create portable binaries. See
5651 ;; "cmake/OptimizeForArchitecture.cmake".
5652 "-DTARGET_ARCHITECTURE=none")
5653 #:phases (modify-phases %standard-phases
5654 (add-after 'unpack 'copy-testdata
5655 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5656 (let ((testdata (assoc-ref (or native-inputs inputs)
5658 (copy-recursively testdata "tests/testdata")
5661 `(("virtest" ,virtest)
5663 ;; This is a submodule in the git project, but not part of the
5664 ;; released sources. See the git branch for the commit to take.
5665 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5669 (url "https://github.com/VcDevel/vc-testdata")
5670 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5671 (file-name (git-file-name "vc-testdata"
5672 (string-take commit 7)))
5675 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5676 (synopsis "SIMD vector classes for C++")
5677 (description "Vc provides portable, zero-overhead C++ types for explicitly
5678 data-parallel programming. It is a library designed to ease explicit
5679 vectorization of C++ code. Its types enable explicitly stating data-parallel
5680 operations on multiple values. The parallelism is therefore added via the type
5681 system. Vc has an intuitive API and provides portability between different
5682 compilers and compiler versions as well as portability between different vector
5683 instruction sets. Thus, an application written with Vc can be compiled for:
5686 @item SSE2 up to SSE4.2 or SSE4a
5689 @item NEON (in development)
5690 @item NVIDIA GPUs / CUDA (in development)
5692 (home-page "https://github.com/VcDevel/Vc")
5693 ;; "No support_???.cpp file exists for this architecture."
5694 (supported-systems '("x86_64-linux" "i686-linux"))
5695 (license license:bsd-3)))
5697 (define-public reducelcs
5698 ;; This is the last commit which is available upstream, no
5699 ;; release happened since 2010.
5700 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5704 (version (string-append "1.0-" revision "." (string-take commit 7)))
5709 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5711 (file-name (string-append name "-" version "-checkout"))
5714 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5715 (build-system gnu-build-system)
5719 `(#:tests? #f ; no tests
5721 (modify-phases %standard-phases
5722 (delete 'configure) ; No configure script exists.
5723 (replace 'install ; No install phase exists.
5724 (lambda* (#:key outputs #:allow-other-keys)
5725 (let* ((out (assoc-ref outputs "out"))
5726 (bin (string-append out "/bin")))
5727 (install-file "Approximation" bin)
5728 (install-file "CollectResults" bin)
5729 (install-file "GenerateInstances" bin)
5731 (synopsis "Approximate Longest Commons Subsequence computation tool")
5733 "@code{reduceLCS} is an implementation of the Reduce-Expand
5734 algorithm for LCS. It is a fast program to compute the approximate
5735 Longest Commons Subsequence of a set of strings.")
5736 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5737 (license license:gpl3+))))
5739 (define-public jacal
5746 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5749 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
5750 (patches (search-patches "jacal-fix-texinfo.patch"))))
5751 (build-system gnu-build-system)
5754 (modify-phases %standard-phases
5755 (add-before 'build 'pre-build
5756 ;; Don't use upstream's script - it really doesn't fit into
5757 ;; Guix's functional paradigm.
5758 (lambda* (#:key inputs outputs #:allow-other-keys)
5759 (substitute* "Makefile"
5760 (("^install: install-script") "install: "))))
5761 (add-after 'install 'post-install
5762 ;; Instead, we provide our own simplified script.
5763 (lambda* (#:key inputs outputs #:allow-other-keys)
5764 (let ((wrapper (string-append (assoc-ref outputs "out")
5766 (format (open wrapper (logior O_WRONLY O_CREAT))
5767 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5768 "-e '(slib:load \"~a/lib/jacal/math\") "
5771 (assoc-ref inputs "scm")
5772 (assoc-ref outputs "out"))
5773 (chmod wrapper #o555))))
5775 (lambda* (#:key outputs #:allow-other-keys)
5776 (invoke "./configure"
5777 (string-append "--prefix="
5778 (assoc-ref outputs "out"))))))))
5780 (native-inputs (list unzip texinfo))
5781 (synopsis "Symbolic mathematics system")
5782 (description "GNU JACAL is an interactive symbolic mathematics program based on
5783 Scheme. It manipulate and simplify a range of mathematical expressions such
5784 as equations, scalars, vectors, and matrices.")
5785 (home-page "https://www.gnu.org/software/jacal/")
5786 (license license:gpl3+)))
5792 (home-page "https://github.com/Z3Prover/z3")
5795 (uri (git-reference (url home-page)
5796 (commit (string-append "z3-" version))))
5797 (file-name (git-file-name name version))
5800 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5801 (build-system gnu-build-system)
5803 `(#:imported-modules ((guix build python-build-system)
5804 ,@%gnu-build-system-modules)
5805 #:modules (((guix build python-build-system) #:select (site-packages))
5806 (guix build gnu-build-system)
5809 (modify-phases %standard-phases
5810 (add-after 'unpack 'enable-bytecode-determinism
5812 (setenv "PYTHONHASHSEED" "0")
5814 (add-after 'unpack 'fix-compatability
5815 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5817 (substitute* "src/util/mpz.cpp"
5818 (("#include <immintrin.h>") ""))
5820 (add-before 'configure 'bootstrap
5822 (invoke "python" "scripts/mk_make.py")))
5823 ;; work around gnu-build-system's setting --enable-fast-install
5824 ;; (z3's `configure' is a wrapper around the above python file,
5825 ;; which fails when passed --enable-fast-install)
5827 (lambda* (#:key inputs outputs #:allow-other-keys)
5828 (invoke "./configure"
5830 (string-append "--prefix=" (assoc-ref outputs "out"))
5831 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5832 (add-after 'configure 'change-directory
5836 (add-before 'check 'make-test-z3
5838 ;; Build the test suite executable.
5839 (invoke "make" "test-z3" "-j"
5840 (number->string (parallel-job-count)))))
5843 ;; Run all the tests that don't require arguments.
5844 (invoke "./test-z3" "/a"))))))
5847 ("python" ,python-wrapper)))
5848 (synopsis "Theorem prover")
5849 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5850 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5851 (license license:expat)))
5853 (define-public ocaml-z3
5858 `(#:imported-modules ((guix build python-build-system)
5859 ,@%gnu-build-system-modules)
5860 #:modules (((guix build python-build-system) #:select (site-packages))
5861 (guix build gnu-build-system)
5863 #:tests? #f; no ml tests
5865 (modify-phases %standard-phases
5866 (add-before 'configure 'bootstrap
5867 (lambda* (#:key outputs #:allow-other-keys)
5868 (let ((out (assoc-ref outputs "out")))
5869 (setenv "OCAMLFIND_LDCONF" "ignore")
5870 (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
5871 (mkdir-p (string-append out "/lib/ocaml/site-lib"))
5872 (substitute* "scripts/mk_util.py"
5874 (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'"))
5875 ;; Do not build z3 again, use the library passed as input
5877 (("z3linkdep,") "\"\",")
5878 (("z3linkdep)") "\"\")"))
5879 (invoke "python" "scripts/mk_make.py"))))
5881 (lambda* (#:key inputs outputs #:allow-other-keys)
5882 (invoke "./configure"
5884 (string-append "--prefix=" (assoc-ref outputs "out")))))
5885 (add-after 'configure 'change-directory
5891 (invoke "make" "ml")))
5893 (lambda* (#:key outputs #:allow-other-keys)
5894 (invoke "ocamlfind" "install" "-destdir"
5895 (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")
5896 "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi"
5897 "api/ml/z3enums.cmx" "api/ml/z3native.mli"
5898 "api/ml/z3native.cmi" "api/ml/z3native.cmx"
5899 "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx"
5900 "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma"
5901 "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so"))))))
5904 ("python" ,python-wrapper)
5906 ("ocaml-findlib" ,ocaml-findlib)))
5908 (list ocaml-zarith))
5915 (version "2018.11.001")
5918 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5919 version "/elpa-" version ".tar.gz"))
5922 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5923 (build-system gnu-build-system)
5925 `(("fortran" ,gfortran)
5926 ("perl" ,perl))) ;for configure and deps
5928 `(("blas" ,openblas)))
5933 ;; ELPA unfortunately does not support runtime dispatch, so we can
5934 ;; only enable the "generic" kernels. See the "Cross compilation"
5935 ;; section of INSTALL.md.
5937 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5938 "--disable-avx" "--disable-avx2" "--disable-avx512"
5939 ,(string-append "CFLAGS=-O3 "
5940 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5941 "-ftree-vect-loop-version -ftree-vectorize "
5942 ,(let ((system (or (%current-target-system)
5943 (%current-system))))
5945 ((or (string-prefix? "x86_64" system)
5946 (string-prefix? "i686" system))
5949 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5951 (modify-phases %standard-phases
5952 (add-before 'configure 'patch-header-generation
5954 (substitute* "configure"
5955 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5956 (string-append & " CPP=\"$CPP\"")))
5958 (add-before 'check 'setup-tests
5960 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5961 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5962 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5963 ;; for Fortran. This also causes several tests to pass that
5964 ;; otherwise would otherwise fail with matrix size 5000; possibly
5965 ;; due to floating point tolerances that are too tight.
5966 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5967 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5968 (substitute* "Makefile"
5969 ;; Test scripts are generated, patch the shebang
5970 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5972 (home-page "https://elpa.mpcdf.mpg.de")
5973 (synopsis "Eigenvalue solvers for symmetric matrices")
5975 "The ELPA library provides efficient and scalable direct eigensolvers for
5976 symmetric matrices.")
5977 (license license:lgpl3)))
5979 (define-public elpa-openmpi
5980 (package (inherit elpa)
5981 (name "elpa-openmpi")
5984 ("scalapack" ,scalapack)
5985 ,@(package-inputs elpa)))
5987 (substitute-keyword-arguments (package-arguments elpa)
5988 ((#:configure-flags cf '())
5989 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5990 ((#:phases phases '%standard-phases)
5991 `(modify-phases ,phases
5992 (add-before 'check 'mpi-setup
5994 ;; Tests use 2 mpi tasks by default, use our remaining build
5995 ;; cores as OpenMP threads.
5996 (setenv "OMP_NUM_THREADS" (number->string
5997 (max (quotient (parallel-job-count) 2)
5999 (,%openmpi-setup)))))))
6000 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
6002 (define-public elemental
6009 (url "https://github.com/elemental/Elemental")
6010 (commit (string-append "v" version))))
6011 (file-name (git-file-name name version))
6014 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
6015 (build-system cmake-build-system)
6016 (home-page "https://github.com/elemental/Elemental")
6020 `(("blas" ,openblas)
6021 ("gfortran:lib" ,gfortran "lib")
6030 `(#:build-type "Release" ;default RelWithDebInfo not supported
6031 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
6032 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
6033 "-DEL_CACHE_WARNINGS:BOOL=YES"
6034 "-DEL_TESTS:BOOL=YES"
6035 "-DCMAKE_INSTALL_LIBDIR=lib"
6036 "-DGFORTRAN_LIB=gfortran")
6037 #:phases (modify-phases %standard-phases
6038 (add-before 'check 'mpi-setup
6040 (add-before 'check 'setup-tests
6042 ;; Parallelism is done at the MPI layer.
6043 (setenv "OMP_NUM_THREADS" "1")
6045 (add-after 'install 'remove-tests
6046 (lambda* (#:key outputs #:allow-other-keys)
6047 ;; Tests are installed, with no easy configuration
6048 ;; switch to prevent this, so delete them.
6049 (delete-file-recursively
6050 (string-append (assoc-ref outputs "out") "/bin"))
6052 (synopsis "Dense and sparse-direct linear algebra and optimization")
6053 (description "Elemental is a modern C++ library for distributed-memory
6054 dense and sparse-direct linear algebra, conic optimization, and lattice
6056 (license license:bsd-2)))
6058 (define-public mcrl2
6061 (version "202106.0")
6065 "https://www.mcrl2.org/download/release/mcrl2-"
6069 "1xgx3cd57vc7gbjic24j1q2za6j3ybz6nk4afvvpbwsf33xnlf4v"))))
6071 (list boost glu mesa qtbase-5))
6072 (build-system cmake-build-system)
6073 (synopsis "Toolset for the mCRL2 formal specification language")
6075 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
6076 specification language for describing concurrent discrete event systems. Its
6077 toolset supports analysis and automatic verification, linearisation, simulation,
6078 state-space exploration and generation, and tools to optimise and analyse
6079 specifications. Also, state spaces can be manipulated, visualised and
6081 (home-page "https://mcrl2.org")
6082 (license license:boost1.0)))
6084 (define-public mcrl2-minimal
6087 (name "mcrl2-minimal")
6091 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
6093 (define-public tcalc
6100 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
6104 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
6105 (build-system gnu-build-system)
6106 (synopsis "The terminal calculator")
6108 "The terminal calculator is a small program to help users of the GNU/Linux
6109 terminal do calculations simply and quickly. The formula to be calculated can
6110 be fed to @command{tcalc} through the command line.")
6111 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
6112 (license license:gpl3+)))
6114 (define-public tiny-bignum
6115 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
6117 (name "tiny-bignum")
6118 (version (git-version "0" "0" commit))
6123 (url "https://github.com/kokke/tiny-bignum-c")
6125 (file-name (git-file-name "tiny-bignum" commit))
6127 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
6128 (build-system gnu-build-system)
6131 (modify-phases %standard-phases
6133 (add-after 'unpack 'patch-tests
6135 (substitute* "scripts/test_rand.py"
6137 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
6140 (lambda* (#:key tests? #:allow-other-keys)
6142 (invoke "make" "test"))
6145 (lambda* (#:key outputs #:allow-other-keys)
6146 (let ((share (string-append (assoc-ref outputs "out") "/share"))
6147 (doc (string-append (assoc-ref outputs "out") "/doc")))
6149 (install-file "bn.c" share)
6150 (install-file "bn.h" share)
6152 (install-file "LICENSE" doc)
6153 (install-file "README.md" doc))
6156 `(("python" ,python-wrapper)))
6157 (home-page "https://github.com/kokke/tiny-bignum-c")
6158 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
6160 "This library provides portable Arbitrary-precision unsigned integer
6161 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
6162 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
6163 and comparisons are supported.")
6164 (license license:unlicense))))
6166 (define-public sundials
6173 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
6174 "sundials-" version ".tar.gz"))
6177 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
6178 (build-system cmake-build-system)
6180 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
6182 `(("fortran" ,gfortran) ;for fcmix
6184 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
6186 `(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
6187 "-DEXAMPLES_ENABLE_C:BOOL=ON"
6188 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
6189 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
6190 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
6191 "-DEXAMPLES_INSTALL:BOOL=OFF"
6193 "-DFCMIX_ENABLE:BOOL=ON"
6195 "-DKLU_ENABLE:BOOL=ON"
6196 ,(string-append "-DKLU_INCLUDE_DIR="
6197 (assoc-ref %build-inputs "suitesparse")
6199 ,(string-append "-DKLU_LIBRARY_DIR="
6200 (assoc-ref %build-inputs "suitesparse")
6202 (home-page "https://computation.llnl.gov/projects/sundials")
6203 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
6204 (description "SUNDIALS is a family of software packages implemented with
6205 the goal of providing robust time integrators and nonlinear solvers that can
6206 easily be incorporated into existing simulation codes.")
6208 '((release-monitoring-url
6209 . "https://computing.llnl.gov/projects/sundials/sundials-software")))
6210 (license license:bsd-3)))
6212 (define-public sundials-openmpi
6213 (package (inherit sundials)
6214 (name "sundials-openmpi")
6217 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
6218 ,@(package-inputs sundials)))
6220 (substitute-keyword-arguments (package-arguments sundials)
6221 ((#:configure-flags flags '())
6222 `(cons* "-DMPI_ENABLE:BOOL=ON"
6223 "-DPETSC_ENABLE:BOOL=ON"
6224 (string-append "-DPETSC_INCLUDE_DIR="
6225 (assoc-ref %build-inputs "petsc")
6227 (string-append "-DPETSC_LIBRARY_DIR="
6228 (assoc-ref %build-inputs "petsc")
6231 ((#:phases phases '%standard-phases)
6232 `(modify-phases ,phases
6233 (add-before 'check 'mpi-setup
6234 ,%openmpi-setup)))))
6235 (synopsis "SUNDIALS with OpenMPI support")))
6237 (define-public sundials-julia
6240 (name "sundials-julia")
6246 (url "https://github.com/LLNL/sundials")
6247 (commit (string-append "v" version))))
6248 (file-name (git-file-name name version))
6251 "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv"))))
6253 (modify-inputs (package-inputs sundials)
6256 (substitute-keyword-arguments (package-arguments sundials)
6257 ((#:configure-flags flags '())
6258 `(cons* "-DLAPACK_ENABLE:BOOL=ON"
6260 (synopsis "SUNDIALS with lapack support as required by julia-sundials-jll")))
6262 (define-public combinatorial-blas
6264 (name "combinatorial-blas")
6269 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
6271 (match (string-split version #\.)
6272 ((major minor patch)
6273 (string-append major minor "_" patch))) ;e.g. "16_2"
6277 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
6278 (patches (search-patches "combinatorial-blas-awpm.patch"
6279 "combinatorial-blas-io-fix.patch"))))
6280 (build-system cmake-build-system)
6283 ("test-data" ,(origin
6285 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
6286 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
6289 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
6291 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
6292 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
6293 #:parallel-tests? #f ;tests use 'mpiexec -n4'
6295 (modify-phases %standard-phases
6296 (add-before 'check 'mpi-setup
6298 (add-before 'check 'test-setup
6299 (lambda* (#:key inputs #:allow-other-keys)
6300 (setenv "OMP_NUM_THREADS" "2")
6301 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
6302 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
6303 (synopsis "Linear algebra primitives for graph analytics")
6304 (description "The Combinatorial BLAS (CombBLAS) is an extensible
6305 distributed-memory parallel graph library offering a small but powerful set of
6306 linear algebra primitives specifically targeting graph analytics.")
6308 license:gpl2+ ;include/psort/(funnel|sort)*.h
6309 license:x11 ;usort and psort
6310 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
6312 (define-public dune-common
6314 (name "dune-common")
6319 (uri (string-append "https://dune-project.org/download/"
6320 version "/dune-common-" version ".tar.gz"))
6323 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
6324 (build-system cmake-build-system)
6327 (modify-phases %standard-phases
6328 (add-after 'build 'build-tests
6329 (lambda* (#:key make-flags #:allow-other-keys)
6330 (apply invoke "make" "build_tests" make-flags))))))
6332 (list gmp metis openblas python superlu))
6334 (list gfortran pkg-config))
6335 (home-page "https://dune-project.org/")
6336 (synopsis "Distributed and Unified Numerics Environment")
6337 (description "DUNE, the Distributed and Unified Numerics Environment is a
6338 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6339 grid-based methods. It supports the easy implementation of methods like
6340 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6341 Differences} (FD).")
6342 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
6343 (license license:gpl2)))
6345 (define-public dune-geometry
6347 (name "dune-geometry")
6352 (uri (string-append "https://dune-project.org/download/"
6353 version "/dune-geometry-" version ".tar.gz"))
6356 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
6357 (build-system cmake-build-system)
6360 (modify-phases %standard-phases
6361 (add-after 'build 'build-tests
6362 (lambda* (#:key make-flags #:allow-other-keys)
6363 (apply invoke "make" "build_tests" make-flags))))))
6367 openblas gmp python))
6369 (list gfortran pkg-config))
6370 (home-page "https://dune-project.org/")
6371 (synopsis "Distributed and Unified Numerics Environment")
6372 (description "DUNE, the Distributed and Unified Numerics Environment is a
6373 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6374 grid-based methods. It supports the easy implementation of methods like
6375 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6378 This package contains the basic DUNE geometry classes.")
6379 ;; GPL version 2 with "runtime exception"
6380 (license license:gpl2)))
6382 (define-public dune-uggrid
6384 (name "dune-uggrid")
6390 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
6391 (commit (string-append "v" version))))
6392 (file-name (git-file-name name version))
6395 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
6396 (build-system cmake-build-system)
6399 (modify-phases %standard-phases
6400 (add-after 'build 'build-tests
6401 (lambda* (#:key make-flags #:allow-other-keys)
6402 (apply invoke "make" "build_tests" make-flags))))))
6406 (list gfortran pkg-config))
6407 (home-page "https://dune-project.org/")
6408 (synopsis "Distributed and Unified Numerics Environment")
6409 (description "DUNE, the Distributed and Unified Numerics Environment is a
6410 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6411 grid-based methods. It supports the easy implementation of methods like
6412 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6415 This package contains the DUNE UG grid classes.")
6416 (license license:lgpl2.1)))
6418 (define-public dune-grid
6425 (uri (string-append "https://dune-project.org/download/"
6426 version "/dune-grid-" version ".tar.gz"))
6429 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
6430 (build-system cmake-build-system)
6433 (modify-phases %standard-phases
6434 (add-after 'build 'build-tests
6435 (lambda* (#:key make-flags #:allow-other-keys)
6436 (apply invoke "make" "build_tests" make-flags))))))
6447 (list gfortran pkg-config))
6448 (home-page "https://dune-project.org/")
6449 (synopsis "Distributed and Unified Numerics Environment")
6450 (description "DUNE, the Distributed and Unified Numerics Environment is a
6451 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6452 grid-based methods. It supports the easy implementation of methods like
6453 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6456 This package contains the basic DUNE grid classes.")
6457 ;; GPL version 2 with "runtime exception"
6458 (license license:gpl2)))
6460 (define-public dune-istl
6467 (uri (string-append "https://dune-project.org/download/"
6468 version "/dune-istl-" version ".tar.gz"))
6471 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
6472 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
6473 (build-system cmake-build-system)
6476 (modify-phases %standard-phases
6477 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6478 ;; the stdlib types when the gfortran header is used. Remove gfortran
6479 ;; from CPLUS_INCLUDE_PATH as a workaround.
6480 (add-after 'set-paths 'hide-gfortran
6481 (lambda* (#:key inputs #:allow-other-keys)
6482 (let ((gfortran (assoc-ref inputs "gfortran")))
6483 (setenv "CPLUS_INCLUDE_PATH"
6485 (delete (string-append gfortran "/include/c++")
6486 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6489 (add-after 'build 'build-tests
6490 (lambda* (#:key make-flags #:allow-other-keys)
6491 (apply invoke "make" "build_tests" make-flags))))))
6502 (list gfortran pkg-config))
6503 (home-page "https://dune-project.org/")
6504 (synopsis "Distributed and Unified Numerics Environment")
6505 (description "DUNE, the Distributed and Unified Numerics Environment is a
6506 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6509 This is the iterative solver template library which provides generic sparse
6510 matrix/vector classes and a variety of solvers based on these classes. A
6511 special feature is the use of templates to exploit the recursive block
6512 structure of finite element matrices at compile time. Available solvers
6513 include Krylov methods, (block-) incomplete decompositions and
6514 aggregation-based algebraic multigrid.")
6515 ;; GPL version 2 with "runtime exception"
6516 (license license:gpl2)))
6518 (define-public dune-localfunctions
6520 (name "dune-localfunctions")
6525 (uri (string-append "https://dune-project.org/download/"
6526 version "/dune-localfunctions-" version ".tar.gz"))
6529 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
6530 (build-system cmake-build-system)
6533 (modify-phases %standard-phases
6534 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6535 ;; and fails to find the stdlib types when the gfortran header is used.
6536 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6537 (add-after 'set-paths 'hide-gfortran
6538 (lambda* (#:key inputs #:allow-other-keys)
6539 (let ((gfortran (assoc-ref inputs "gfortran")))
6540 (setenv "CPLUS_INCLUDE_PATH"
6542 (delete (string-append gfortran "/include/c++")
6543 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6546 (add-after 'build 'build-tests
6547 (lambda* (#:key make-flags #:allow-other-keys)
6548 (apply invoke "make" "build_tests" make-flags))))))
6557 (list gfortran pkg-config))
6558 (home-page "https://dune-project.org/")
6559 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6560 (description "This DUNE module provides interface and implementation for
6561 shape functions defined on the DUNE reference elements. In addition to the
6562 shape function, interpolation operators and special keys are provided which
6563 can be used to assemble global function spaces on finite-element grids.
6565 This package provides an interface and implementation for shape functions
6566 defined on the DUNE reference elements. In addition to the shape function,
6567 interpolation operators and special keys are provided which can be used to
6568 assemble global function spaces on finite-element grids.")
6569 ;; GPL version 2 with "runtime exception"
6570 (license license:gpl2)))
6572 (define-public dune-alugrid
6574 (name "dune-alugrid")
6575 (version "2.7.0-git-81d35682")
6580 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6581 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
6582 (file-name (git-file-name name version))
6585 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
6586 (build-system cmake-build-system)
6589 (modify-phases %standard-phases
6590 (add-after 'unpack 'patch-include
6592 (substitute* "dune/alugrid/test/test-alugrid.cc"
6593 (("doc/grids/gridfactory/testgrids")
6594 "doc/dune-grid/grids/gridfactory/testgrids"))
6596 (add-after 'build 'build-tests
6597 (lambda* (#:key inputs make-flags #:allow-other-keys)
6598 (setenv "CPLUS_INCLUDE_PATH"
6599 (string-append (assoc-ref inputs "dune-grid") "/share"))
6600 (apply invoke "make" "build_tests" make-flags))))))
6613 (list gfortran pkg-config))
6614 (home-page "https://dune-project.org/")
6615 (synopsis "Distributed and Unified Numerics Environment")
6616 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6617 implementation of the DUNE grid interface supporting either simplices or
6619 (license license:gpl2+)))
6621 (define-public dune-subgrid
6623 (name "dune-subgrid")
6624 (version "2.7.0-git-2103a363")
6629 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6630 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
6631 (file-name (git-file-name name version))
6634 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
6635 (build-system cmake-build-system)
6638 (modify-phases %standard-phases
6639 (add-after 'build 'build-tests
6640 (lambda* (#:key make-flags #:allow-other-keys)
6641 (apply invoke "make" "build_tests" make-flags))))))
6651 (list gfortran pkg-config))
6652 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6653 (synopsis "Distributed and Unified Numerics Environment")
6654 (description "The dune-subgrid module marks elements of
6655 another hierarchical dune grid. The set of marked elements can then be
6656 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6657 provides the full grid interface including adaptive mesh refinement.")
6658 (license license:gpl2+)))
6660 (define-public dune-typetree
6662 (name "dune-typetree")
6668 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6669 (commit (string-append "v" version))))
6670 (file-name (git-file-name name version))
6673 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
6674 (build-system cmake-build-system)
6677 (modify-phases %standard-phases
6678 (add-after 'build 'build-tests
6679 (lambda* (#:key make-flags #:allow-other-keys)
6680 (apply invoke "make" "build_tests" make-flags))))))
6690 (list gfortran pkg-config))
6691 (home-page "https://dune-project.org/")
6692 (synopsis "Distributed and Unified Numerics Environment")
6693 (description "TypeTree is a template library for constructing and
6694 operating on statically typed trees of objects.")
6695 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6696 (license (list license:lgpl3+ license:gpl2))))
6698 (define-public dune-functions
6700 (name "dune-functions")
6706 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6707 (commit (string-append "v" version))))
6708 (file-name (git-file-name name version))
6711 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
6712 (build-system cmake-build-system)
6715 (modify-phases %standard-phases
6716 (add-after 'unpack 'disable-failing-tests
6719 ;; unable to load GMSH file in this test
6720 "--exclude-regex gridviewfunctionspacebasistest")
6722 (add-after 'build 'build-tests
6723 (lambda* (#:key make-flags #:allow-other-keys)
6724 (apply invoke "make" "build_tests" make-flags))))))
6738 (list gfortran pkg-config))
6739 (home-page "https://dune-project.org/")
6740 (synopsis "Distributed and Unified Numerics Environment")
6741 (description "The dune-functions module provides an abstraction layer for
6742 global finite element functions. Its two main concepts are functions
6743 implemented as callable objects, and bases of finite element spaces.")
6744 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6745 (license (list license:lgpl3+ license:gpl2))))
6747 (define-public dune-pdelab
6749 (name "dune-pdelab")
6750 (version "2.7.0-git-476fe437")
6755 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6756 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
6757 (file-name (git-file-name name version))
6760 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
6761 (build-system cmake-build-system)
6762 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
6779 (list gfortran pkg-config))
6780 (home-page "https://dune-project.org/")
6781 (synopsis "Differential equations solver toolbox")
6782 (description "PDELab is a partial differential equations solver toolbox
6783 built on top of DUNE, the Distributed and Unified Numerics Environment.")
6784 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6785 (license (list license:lgpl3+ license:gpl2))))
6787 (define add-openmpi-to-dune-package
6788 (let ((dune-package?
6789 (lambda (p) (string-prefix? "dune-" (package-name p)))))
6792 (if (dune-package? p)
6793 (package (inherit p)
6794 (name (string-append (package-name p) "-openmpi"))
6795 (inputs `(,@(package-inputs p)
6796 ("openmpi" ,openmpi)))
6798 (substitute-keyword-arguments (package-arguments p)
6799 ((#:phases phases '%standard-phases)
6800 `(modify-phases ,phases
6801 (add-before 'check 'mpi-setup
6802 ,%openmpi-setup)))))
6803 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
6805 (negate dune-package?))))
6807 (define-public dune-common-openmpi
6808 (add-openmpi-to-dune-package dune-common))
6810 (define-public dune-geometry-openmpi
6811 (add-openmpi-to-dune-package dune-geometry))
6813 (define-public dune-istl-openmpi
6814 (add-openmpi-to-dune-package dune-istl))
6816 (define-public dune-typetree-openmpi
6817 (add-openmpi-to-dune-package dune-typetree))
6819 (define-public dune-uggrid-openmpi
6820 (add-openmpi-to-dune-package dune-uggrid))
6822 (define-public dune-grid-openmpi
6823 (add-openmpi-to-dune-package dune-grid))
6825 (define-public dune-alugrid-openmpi
6826 (add-openmpi-to-dune-package dune-alugrid))
6828 (define-public dune-subgrid-openmpi
6829 (add-openmpi-to-dune-package dune-subgrid))
6831 (define-public dune-localfunctions-openmpi
6832 (add-openmpi-to-dune-package dune-localfunctions))
6834 (define-public dune-functions-openmpi
6835 (add-openmpi-to-dune-package dune-functions))
6837 (define-public dune-pdelab-openmpi
6838 (add-openmpi-to-dune-package dune-pdelab))
6840 (define-public mlucas
6848 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
6850 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
6851 (build-system gnu-build-system)
6855 `(#:tests? #f ; no tests
6857 (modify-phases %standard-phases
6861 (call-with-output-file "Makefile"
6863 (format port "CC = gcc
6864 CFLAGS = -O3 ~a -DUSE_THREADS
6865 LDLIBS = -lm -lpthread -lrt
6866 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6868 ,(let ((system (or (%current-target-system)
6869 (%current-system))))
6871 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6875 (lambda* (#:key outputs #:allow-other-keys)
6876 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6877 (install-file "Mlucas" bin)
6878 (install-file "primenet.py" bin))
6880 (home-page "https://www.mersenne.org")
6881 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6882 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6883 numbers in search of a world-record prime. You may use it to test any
6884 suitable number as you wish, but it is preferable that you do so in a
6885 coordinated fashion, as part of the Great Internet Mersenne Prime
6886 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6887 management via the GIMPS project's Primenet server.")
6888 (license license:gpl2+)))
6890 (define-public nauty
6898 "https://pallini.di.uniroma1.it/"
6899 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6901 (base32 "1hl81gpf3xjf809w04jczvilq1ixy9ch1qrax8a7lgx52svna1jg"))))
6902 (build-system gnu-build-system)
6903 (outputs '("out" "lib"))
6905 `(#:test-target "checks"
6906 #:configure-flags '("--enable-generic") ;prevent -march-native
6908 (modify-phases %standard-phases
6909 ;; Default make target does not build all available
6910 ;; executables. Create them now.
6911 (add-after 'build 'build-extra-programs
6913 (for-each (lambda (target) (invoke "make" target))
6914 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6916 ;; Upstream does not provide any install target.
6918 (lambda* (#:key outputs #:allow-other-keys)
6919 (let* ((out (assoc-ref outputs "out"))
6920 (lib-output (assoc-ref outputs "lib"))
6921 (bin (string-append out "/bin"))
6922 (doc (string-append out "/share/doc/nauty/"))
6923 (include (string-append lib-output "/include/nauty"))
6924 (lib (string-append lib-output "/lib/nauty")))
6925 (for-each (lambda (f) (install-file f bin))
6926 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6927 "bliss2dre" "catg" "checks6" "complg" "converseg"
6928 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6929 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6930 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6931 "gentourng" "gentreeg" "hamheuristic" "labelg"
6932 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6933 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6934 "sumlines" "twohamg" "underlyingg" "vcolg"
6935 "watercluster2" "NRswitchg"))
6936 (for-each (lambda (f) (install-file f include))
6937 (find-files "." "\\.h$"))
6938 (for-each (lambda (f) (install-file f lib))
6939 (find-files "." "\\.a$"))
6940 (for-each (lambda (f) (install-file f doc))
6941 (append '("formats.txt" "README" "schreier.txt")
6942 (find-files "." "\\.pdf$")))))))))
6944 (list gmp)) ;for sumlines
6945 (home-page "https://pallini.di.uniroma1.it/")
6946 (synopsis "Library for graph automorphisms")
6947 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6948 procedures for computing automorphism groups of graphs and digraphs.
6950 @code{nauty} computes graph information in the form of a set of
6951 generators, the size of the group, and the orbits of the group; it can
6952 also produce a canonical label. The @code{nauty} suite is written in
6953 C and comes with a command-line interface, a collection of
6954 command-line tools, and an Application Programming Interface (API).
6956 This package provides the static libraries required to run programs
6957 compiled against the nauty library.")
6958 (license license:asl2.0)))
6967 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6968 "ftp/releases/" version
6969 "/ppl-" version ".tar.gz"))
6972 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6973 (build-system gnu-build-system)
6978 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6980 "Parma Polyhedra Library for computations with polyhedra")
6982 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6983 especially targeted at applications in the field of analysis and
6984 verification of complex systems. These abstractions include convex
6985 polyhedra, defined as the intersection of a finite number of (open or
6986 closed) halfspaces, each described by a linear inequality (strict or
6987 non-strict) with rational coefficients; some special classes of polyhedra
6988 shapes that offer interesting complexity/precision tradeoffs; and grids
6989 which represent regularly spaced points that satisfy a set of linear
6990 congruence relations. The library also supports finite powersets and
6991 products of (any kind of) polyhedra and grids, a mixed integer linear
6992 programming problem solver using an exact-arithmetic version of the simplex
6993 algorithm, a parametric integer programming solver, and primitives for
6994 termination analysis via the automatic synthesis of linear ranking
6996 (license license:gpl3+)))
6998 (define-public speedcrunch
7000 (name "speedcrunch")
7006 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
7007 (commit (string-append "release-" version))))
7008 (file-name (git-file-name name version))
7011 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
7012 (build-system cmake-build-system)
7013 (inputs (list qtbase-5))
7014 (native-inputs (list qttools))
7017 (modify-phases %standard-phases
7018 (add-after 'unpack 'chdir-to-src
7019 (lambda _ (chdir "src") #t)))))
7020 (synopsis "High-precision scientific calculator")
7022 "SpeedCrunch is a high-precision scientific calculator. It features a
7023 syntax-highlighted scrollable display and is designed to be fully used via
7024 keyboard. Some distinctive features are auto-completion of functions and
7025 variables, a formula book, and quick insertion of constants from various
7026 fields of knowledge.")
7027 (home-page "https://speedcrunch.org/")
7028 (license license:gpl2+)))
7030 (define-public minisat
7031 ;; This is the last commit which is available upstream, no
7032 ;; release happened since 2010.
7033 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
7037 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
7042 (url "https://github.com/niklasso/minisat")
7044 (file-name (string-append name "-" version "-checkout"))
7047 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
7049 (search-patches "minisat-friend-declaration.patch"
7050 "minisat-install.patch"))))
7051 (build-system gnu-build-system)
7053 '(#:make-flags (list (string-append "prefix=" %output))
7054 #:tests? #f ;no check target
7056 (modify-phases %standard-phases
7057 (delete 'configure))))
7059 `(("zlib:static" ,zlib "static")
7062 "Small, yet efficient, SAT solver")
7064 "MiniSat is a minimalistic, open-source SAT solver, developed to help
7065 researchers and developers alike to get started on SAT.")
7067 "http://minisat.se/MiniSat.html")
7068 (license license:expat))))
7070 (define-public libqalculate
7072 (name "libqalculate")
7078 (url "https://github.com/Qalculate/libqalculate/")
7079 (commit (string-append "v" version))))
7080 (file-name (git-file-name name version))
7082 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
7084 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
7085 (build-system gnu-build-system)
7087 `(("pkg-config" ,pkg-config)
7088 ("gettext" ,gettext-minimal)
7089 ("intltool" ,intltool)
7090 ("automake" ,automake)
7091 ("autoconf" ,autoconf)
7092 ("libtool" ,libtool)
7093 ("doxygen" ,doxygen)
7106 (modify-phases %standard-phases
7107 (add-before 'bootstrap 'setenv
7108 ;; Prevent the autogen.sh script to carry out the configure
7109 ;; script, which has not yet been patched to replace /bin/sh.
7111 (setenv "NOCONFIGURE" "TRUE")
7113 (home-page "https://qalculate.github.io/")
7114 (synopsis "Multi-purpose cli desktop calculator and library")
7116 "Libqalculate is a multi-purpose cli desktop calculator and library.
7117 It provides basic and advanced functionality. Features include customizable
7118 functions, unit calculations, and conversions, physical constants, symbolic
7119 calculations (including integrals and equations), arbitrary precision,
7120 uncertainty propagation, interval arithmetic, plotting and a user-friendly
7122 (license license:gpl2+)))
7124 (define-public qalculate-gtk
7126 (name "qalculate-gtk")
7132 (url "https://github.com/Qalculate/qalculate-gtk/")
7133 (commit (string-append "v" version))))
7134 (file-name (git-file-name name version))
7136 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
7137 (build-system glib-or-gtk-build-system)
7154 (modify-phases %standard-phases
7155 (add-before 'bootstrap 'setenv
7156 ;; Prevent the autogen.sh script to carry out the configure
7157 ;; script, which has not yet been patched to replace /bin/sh.
7159 (setenv "NOCONFIGURE" "TRUE")
7161 (home-page "https://qalculate.github.io/")
7162 (synopsis "Multi-purpose graphical desktop calculator")
7164 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
7165 multi-purpose GUI desktop calculator. It provides basic and advanced
7166 functionality. Features include customizable functions, unit calculations,
7167 and conversions, physical constants, symbolic calculations (including
7168 integrals and equations), arbitrary precision, uncertainty propagation,
7169 interval arithmetic, plotting.")
7170 (license license:gpl2+)))
7172 (define-public numdiff
7179 (uri (string-append "mirror://savannah/numdiff/numdiff-"
7183 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
7184 (build-system gnu-build-system)
7186 '(#:tests? #f ; There are no tests.
7188 (modify-phases %standard-phases
7189 (add-before 'compress-documentation 'delete-precompressed-info-file
7191 (delete-file (string-append (assoc-ref %outputs "out")
7192 "/share/info/numdiff.info.gz"))
7194 (home-page "https://nongnu.org/numdiff/")
7195 (synopsis "Compare files with numeric fields")
7197 "Numdiff compares files line by line and field by field, ignoring small
7198 numeric differences and differences in numeric formats.")
7199 (license license:gpl3+)))
7208 (url "https://gitlab.inria.fr/why3/why3")
7210 (file-name (git-file-name name version))
7213 "0pfsiddnk26f384wbazfpgzh1n1ibf3xq101q74mxvczi7z0a791"))))
7214 (build-system ocaml-build-system)
7216 (list autoconf automake coq ocaml which))
7218 (list camlzip ocaml-graph ocaml-menhir ocaml-num ocaml-zarith))
7220 (list coq-flocq emacs-minimal zlib))
7223 (modify-phases %standard-phases
7224 (add-before 'configure 'bootstrap
7226 (invoke "./autogen.sh")
7227 (setenv "CONFIG_SHELL" (which "sh"))
7228 (substitute* "configure"
7229 (("#! /bin/sh") (string-append "#!" (which "sh")))
7230 ;; find ocaml-num in the correct directory
7231 (("\\$DIR/nums.cma") "$DIR/num.cma")
7232 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
7234 (add-after 'configure 'fix-makefile
7236 (substitute* "Makefile"
7237 ;; find ocaml-num in the correct directory
7238 (("site-lib/num") "site-lib"))
7240 (add-after 'install 'install-lib
7242 (invoke "make" "byte")
7243 (invoke "make" "install-lib")
7245 (home-page "http://why3.lri.fr")
7246 (synopsis "Deductive program verification")
7247 (description "Why3 provides a language for specification and programming,
7248 called WhyML, and relies on external theorem provers, both automated and
7249 interactive, to discharge verification conditions. Why3 comes with a standard
7250 library of logical theories (integer and real arithmetic, Boolean operations,
7251 sets and maps, etc.) and basic programming data structures (arrays, queues,
7252 hash tables, etc.). A user can write WhyML programs directly and get
7253 correct-by-construction OCaml programs through an automated extraction
7254 mechanism. WhyML is also used as an intermediate language for the verification
7255 of C, Java, or Ada programs.")
7256 (license license:lgpl2.1)))
7258 (define-public frama-c
7264 (uri (string-append "http://frama-c.com/download/frama-c-"
7265 version "-Chromium.tar.gz"))
7268 "0x1xgip50jdz1phsb9rzwf2ra8lshn1hmd9g967xia402wrg3sjf"))))
7269 (build-system ocaml-build-system)
7271 `(#:tests? #f; no test target in Makefile
7273 (modify-phases %standard-phases
7274 (add-before 'configure 'export-shell
7275 (lambda* (#:key inputs #:allow-other-keys)
7276 (setenv "CONFIG_SHELL"
7277 (search-input-file inputs "/bin/sh")))))))
7287 (native-search-paths
7288 (list (search-path-specification
7289 (variable "FRAMAC_SHARE")
7290 (files '("share/frama-c"))
7292 (search-path-specification
7293 (variable "FRAMAC_LIB")
7294 (files '("lib/frama-c"))
7296 (home-page "http://frama-c.com")
7297 (synopsis "C source code analysis platform")
7298 (description "Frama-C is an extensible and collaborative platform dedicated
7299 to source-code analysis of C software. The Frama-C analyzers assist you in
7300 various source-code-related activities, from the navigation through unfamiliar
7301 projects up to the certification of critical software.")
7302 (license license:lgpl2.1+)))
7304 (define-public blitz
7312 (url "https://github.com/blitzpp/blitz")
7314 (file-name (git-file-name name version))
7316 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
7317 (build-system cmake-build-system)
7319 `(#:configure-flags '("-DBUILD_DOC=ON"
7320 "-DBUILD_TESTING=ON")
7321 ;; The default "check" target also includes examples and benchmarks.
7322 #:test-target "check-testsuite"
7324 (modify-phases %standard-phases
7325 (add-after 'build 'build-doc
7327 (invoke "make" "-j" (number->string (parallel-job-count))
7330 (list python texinfo))
7331 (synopsis "C++ template class library for multidimensional arrays")
7332 (description "Blitz++ is a C++ template class library that provides
7333 high-performance multidimensional array containers for scientific computing.")
7334 (home-page "https://github.com/blitzpp/blitz")
7335 (license (list license:artistic2.0
7339 (define-public fxdiv
7340 ;; There is currently no tag in this repo.
7341 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
7346 (version (git-version version revision commit))
7347 (home-page "https://github.com/Maratyszcza/FXdiv")
7350 (uri (git-reference (url home-page) (commit commit)))
7351 (file-name (git-file-name name version))
7354 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
7355 (patches (search-patches "fxdiv-system-libraries.patch"))))
7356 (build-system cmake-build-system)
7358 (list googletest googlebenchmark))
7360 "C++ library for division via fixed-point multiplication by inverse")
7362 "On modern CPUs and GPUs, integer division is several times slower than
7363 multiplication. FXdiv implements an algorithm to replace an integer division
7364 with a multiplication and two shifts. This algorithm improves performance
7365 when an application performs repeated divisions by the same divisor.")
7366 (license license:expat))))
7369 ;; There is currently no tag in this repo.
7370 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
7375 (version (git-version version revision commit))
7376 (home-page "https://github.com/Maratyszcza/FP16")
7379 (uri (git-reference (url home-page) (commit commit)))
7380 (file-name (git-file-name name version))
7383 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
7384 (patches (search-patches "fp16-system-libraries.patch"))))
7385 (build-system cmake-build-system)
7387 `(#:imported-modules ((guix build python-build-system)
7388 ,@%cmake-build-system-modules)
7389 #:modules (((guix build python-build-system)
7390 #:select (site-packages))
7391 (guix build cmake-build-system)
7393 #:phases (modify-phases %standard-phases
7394 (add-after 'install 'move-python-files
7395 (lambda* (#:key inputs outputs #:allow-other-keys)
7396 ;; Python files get installed to $includedir (!).
7397 ;; Move them to the usual Python site directory.
7398 (let* ((out (assoc-ref outputs "out"))
7399 (include (string-append out "/include"))
7400 (site (site-packages inputs outputs))
7401 (target (string-append site "/fp16")))
7403 (for-each (lambda (file)
7405 (string-append target "/"
7408 (find-files include "\\.py$"))))))))
7410 (list python-wrapper))
7412 (list psimd googletest googlebenchmark))
7413 (synopsis "C++ library for half-precision floating point formats")
7415 "This header-only C++ library implements conversion to and from
7416 half-precision floating point formats.")
7417 (license license:expat))))
7419 (define-public optizelle
7420 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
7423 (version (git-version "1.3.0" "0" commit))
7428 (url "https://github.com/OptimoJoe/Optizelle")
7430 (file-name (git-file-name "optizelle" commit))
7433 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
7434 (modules '((guix build utils)))
7437 ;; Reduce the stopping tolerance in one test so that the
7438 ;; convergence check returns the correct stopping
7441 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
7442 (("1e-13") "5e-14"))
7443 ;; Skip one set of python tests. See
7444 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
7446 "src/examples/inequality_scaling/CMakeLists.txt"
7447 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
7448 (string-append "add_unit" middle "\"cpp\"" end)))
7449 ;; Install the licence for Optizelle, without also
7450 ;; including the licences for the dependencies.
7451 (substitute* "licenses/CMakeLists.txt"
7452 (("file.*package.*$" all)
7453 (string-append "# " all))
7454 ((".*[^l].[.]txt\\)\n") "")
7455 (("add_license.*\"\n") ""))
7457 (build-system cmake-build-system)
7459 `(#:imported-modules ((guix build python-build-system)
7460 ,@%cmake-build-system-modules)
7461 #:modules (((guix build python-build-system) #:select
7463 (guix build cmake-build-system)
7465 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
7466 "-DENABLE_CPP_UNIT:BOOL=ON"
7467 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
7468 "-DENABLE_PYTHON:BOOL=ON"
7469 "-DENABLE_PYTHON_UNIT:BOOL=ON"
7470 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
7471 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
7472 (assoc-ref %build-inputs
7474 "/lib/libopenblas.so")
7475 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7476 (assoc-ref %build-inputs
7478 "/lib/libgfortran.so;"
7479 (assoc-ref %build-inputs
7481 "/lib/libquadmath.so"))
7483 (modify-phases %standard-phases
7484 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7485 (lambda* (#:key inputs #:allow-other-keys)
7486 (let* ((pyver (python-version (assoc-ref inputs "python")))
7487 (npdir (string-append (assoc-ref inputs "numpy")
7490 (substitute* "src/cmake/Modules/Optizelle.cmake"
7492 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7493 "PYTHONPATH=" npdir ":"))))))
7494 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7496 `(("blas/lapack" ,openblas)
7497 ("fortran:lib" ,gfortran "lib")
7498 ("jsoncpp" ,jsoncpp)
7499 ("numpy" ,python-numpy)
7500 ("python" ,python)))
7502 `(("fortran" ,gfortran)
7503 ("pkg-config" ,pkg-config)))
7504 (home-page "https://www.optimojoe.com/products/optizelle/")
7505 (synopsis "Mathematical optimization library")
7506 (description "@code{optizelle} is a software library designed to
7507 solve nonlinear optimization problems. Four types of problem are
7508 considered: unconstrained, equality constrained, inequality
7509 constrained and constrained. Constraints may be applied as values of
7510 functions or sets of partial differential equations (PDEs).
7512 Solution algorithms such as the preconditioned nonlinear conjugate
7513 gradient method, sequential quadratic programming (SQP) and the
7514 primal-dual interior-point method are made available. Interfaces are
7515 provided for applications written in C++ and Python. Parallel
7516 computation is supported via MPI.")
7517 (license license:bsd-2))))