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-2022 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–2022 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-2022 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-2022 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, 2022 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, 2022 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, 2022 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–2022 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, 2022 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>
52 ;;; Copyright © 2021 Pierre-Antoine Bouttier <pierre-antoine.bouttier@univ-grenoble-alpes.fr>
53 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
54 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
55 ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
56 ;;; Copyright © 2022 Marek Felšöci <marek@felsoci.sk>
57 ;;; Copyright © 2022 vicvbcun <guix@ikherbers.com>
59 ;;; This file is part of GNU Guix.
61 ;;; GNU Guix is free software; you can redistribute it and/or modify it
62 ;;; under the terms of the GNU General Public License as published by
63 ;;; the Free Software Foundation; either version 3 of the License, or (at
64 ;;; your option) any later version.
66 ;;; GNU Guix is distributed in the hope that it will be useful, but
67 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
68 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69 ;;; GNU General Public License for more details.
71 ;;; You should have received a copy of the GNU General Public License
72 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
74 (define-module (gnu packages maths)
75 #:use-module (ice-9 regex)
76 #:use-module (ice-9 match)
77 #:use-module (gnu packages)
78 #:use-module ((guix licenses) #:prefix license:)
79 #:use-module (guix gexp)
80 #:use-module (guix packages)
81 #:use-module (guix download)
82 #:use-module (guix git-download)
83 #:use-module (guix gexp)
84 #:use-module (guix utils)
85 #:use-module ((guix build utils) #:select (alist-replace))
86 #:use-module (guix build-system cmake)
87 #:use-module (guix build-system glib-or-gtk)
88 #:use-module (guix build-system gnu)
89 #:use-module (guix build-system meson)
90 #:use-module (guix build-system ocaml)
91 #:use-module (guix build-system perl)
92 #:use-module (guix build-system python)
93 #:use-module (guix build-system ruby)
94 #:use-module (gnu packages algebra)
95 #:use-module (gnu packages audio)
96 #:use-module (gnu packages autotools)
97 #:use-module (gnu packages base)
98 #:use-module (gnu packages bash)
99 #:use-module (gnu packages bison)
100 #:use-module (gnu packages boost)
101 #:use-module (gnu packages check)
102 #:use-module (gnu packages cmake)
103 #:use-module (gnu packages compression)
104 #:use-module (gnu packages coq)
105 #:use-module (gnu packages curl)
106 #:use-module (gnu packages cyrus-sasl)
107 #:use-module (gnu packages datamash)
108 #:use-module (gnu packages dbm)
109 #:use-module (gnu packages documentation)
110 #:use-module (gnu packages elf)
111 #:use-module (gnu packages emacs)
112 #:use-module (gnu packages file)
113 #:use-module (gnu packages flex)
114 #:use-module (gnu packages fltk)
115 #:use-module (gnu packages fontutils)
116 #:use-module (gnu packages gettext)
117 #:use-module (gnu packages gcc)
118 #:use-module (gnu packages gd)
119 #:use-module (gnu packages ghostscript)
120 #:use-module (gnu packages glib)
121 #:use-module (gnu packages graphviz)
122 #:use-module (gnu packages gtk)
123 #:use-module (gnu packages icu4c)
124 #:use-module (gnu packages image)
125 #:use-module (gnu packages java)
126 #:use-module (gnu packages less)
127 #:use-module (gnu packages lisp)
128 #:use-module (gnu packages linux)
129 #:use-module (gnu packages llvm)
130 #:use-module (gnu packages logging)
131 #:use-module (gnu packages lua)
132 #:use-module (gnu packages gnome)
133 #:use-module (gnu packages guile)
134 #:use-module (gnu packages xorg)
135 #:use-module (gnu packages gl)
136 #:use-module (gnu packages imagemagick)
137 #:use-module (gnu packages m4)
138 #:use-module (gnu packages mpi)
139 #:use-module (gnu packages multiprecision)
140 #:use-module (gnu packages ncurses)
141 #:use-module (gnu packages netpbm)
142 #:use-module (gnu packages ocaml)
143 #:use-module (gnu packages onc-rpc)
144 #:use-module (gnu packages parallel)
145 #:use-module (gnu packages pcre)
146 #:use-module (gnu packages popt)
147 #:use-module (gnu packages perl)
148 #:use-module (gnu packages pkg-config)
149 #:use-module (gnu packages pulseaudio)
150 #:use-module (gnu packages python)
151 #:use-module (gnu packages python-web)
152 #:use-module (gnu packages python-xyz)
153 #:use-module (gnu packages qt)
154 #:use-module (gnu packages readline)
155 #:use-module (gnu packages ruby)
156 #:use-module (gnu packages tbb)
157 #:use-module (gnu packages scheme)
158 #:use-module (gnu packages serialization)
159 #:use-module (gnu packages shells)
160 #:use-module (gnu packages sphinx)
161 #:use-module (gnu packages swig)
162 #:use-module (gnu packages tcl)
163 #:use-module (gnu packages texinfo)
164 #:use-module (gnu packages tex)
165 #:use-module (gnu packages tls)
166 #:use-module (gnu packages version-control)
167 #:use-module (gnu packages wxwidgets)
168 #:use-module (gnu packages xml)
169 #:use-module (srfi srfi-1)
170 #:use-module (srfi srfi-26))
178 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
180 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
181 (build-system gnu-build-system)
182 (inputs (list gtk+ libxml2))
183 (native-inputs (list pkg-config))
185 `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
186 (synopsis "Natural deduction first-order logic interface")
187 (description "Aris is a program for performing logical proofs. It supports
188 propositional and predicate logic, as well as Boolean algebra and
189 arithmetical logic. In addition to its predefined inference and equivalence
190 rules, Aris also supports references to older proofs. Its use of standard
191 logical symbols and its natural deduction interface make it easy to use for
193 (license license:gpl3+)
194 (home-page "https://www.gnu.org/software/aris/")))
196 (define-public bitwise
202 (uri (string-append "https://github.com/mellowcandle/bitwise"
203 "/releases/download/v" version
204 "/bitwise-v" version ".tar.gz"))
206 (base32 "1lniw4bsb5qs5ybf018qllf95pzixb1q3lvybzl4k3xz8zpkrm6k"))))
207 (build-system gnu-build-system)
209 (list ncurses readline))
211 (list cunit pkg-config))
212 (synopsis "Terminal based bit manipulator in ncurses")
213 (description "Bitwise is a multi base interactive calculator supporting
214 dynamic base conversion and bit manipulation. It's a handy tool for low level
215 hackers, kernel developers and device drivers developers.
217 Some of the features include:
219 @item Interactive ncurses interface.
220 @item Command line calculator supporting all bitwise operations.
221 @item Individual bit manipulator.
222 @item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
224 (license license:gpl3+)
225 (home-page "https://github.com/mellowcandle/bitwise/")))
227 (define-public c-graph
233 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
236 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
237 (build-system gnu-build-system)
240 (synopsis "Visualizing and demonstrating convolution")
242 "GNU C-Graph is a tool for demonstrating the theory of convolution.
243 Thus, it can serve as an excellent aid to students of signal and systems
244 theory in visualizing the convolution process. Rather than forcing the
245 student to write code, the program offers an intuitive interface with
246 interactive dialogs to guide them.")
247 (license license:gpl3+)
248 (home-page "https://www.gnu.org/software/c-graph/")))
257 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
258 version "/coda-" version ".tar.gz"))
260 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
261 (patches (search-patches "coda-use-system-libs.patch"))
262 (modules '((guix build utils)))
264 ;; Make sure we don't use the bundled software.
266 (for-each (lambda (d)
267 (delete-file-recursively (string-append "libcoda/" d)))
268 '("zlib" "pcre" "expat"))
271 `(("fortran" ,gfortran)
273 ("python-numpy" ,python-numpy)))
280 (build-system gnu-build-system)
282 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
283 "LIBS= -lz -lpcre -lexpat")))
284 (synopsis "Common interface to various earth observation data formats")
286 "The Common Data Access toolbox (CODA) provides a set of interfaces for
287 reading remote sensing data from earth observation data files. It consists of
288 command line applications and interfaces to the C, Fortran, Python, and Java
289 programming languages.")
290 (home-page "https://stcorp.nl/coda")
291 (license license:gpl2+)))
299 (uri (string-append "http://www.qhull.org/download/qhull-"
300 (car (string-split version #\.))
304 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
305 (build-system cmake-build-system)
307 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
308 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
309 (synopsis "Calculate convex hulls and related structures")
311 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
312 diagram, halfspace intersection about a point, furthest-site Delaunay
313 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
314 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
315 algorithm for computing the convex hull. It handles roundoff errors from
316 floating point arithmetic. It computes volumes, surface areas, and
317 approximations to the convex hull.
319 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
320 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
321 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
323 (home-page "http://qhull.org")
324 (license (license:non-copyleft "file://COPYING.txt"
325 "See COPYING in the distribution."))))
327 (define-public python-cvxopt
329 (name "python-cvxopt")
334 (url "https://github.com/cvxopt/cvxopt")
336 (file-name (git-file-name name version))
339 "114z34wwx1bsv4q6xj9p5q99dffgnj9s4i4arx10g191xq9q8i5y"))))
340 (build-system python-build-system)
343 (modify-phases %standard-phases
344 (add-after 'unpack 'find-libraries
345 (lambda* (#:key inputs #:allow-other-keys)
346 (setenv "CVXOPT_BLAS_LIB" "openblas")
347 (setenv "CVXOPT_BUILD_FFTW" "1")
348 (setenv "CVXOPT_BUILD_GLPK" "1")
349 (setenv "CVXOPT_BUILD_GSL" "1")
358 (home-page "https://www.cvxopt.org")
359 (synopsis "Python library for convex optimization")
361 "CVXOPT is a package for convex optimization based on the Python
362 programming language. Its main purpose is to make the development of software
363 for convex optimization applications straightforward by building on Python’s
364 extensive standard library and on the strengths of Python as a high-level
365 programming language.")
366 (license license:gpl3+)))
374 (uri (string-append "mirror://gnu/units/units-" version
377 "0j2q2a9sgldqwcifsnb7qagsmp8fvj91vfh6v4k7gzi1fwhf24sx"))))
378 (build-system gnu-build-system)
380 `(("readline" ,readline)
381 ("python" ,python-wrapper) ;for 'units_cur' script
382 ("python-requests" ,python-requests)))
384 `(#:phases (modify-phases %standard-phases
385 (add-after 'install 'wrap-units_cur
386 (lambda* (#:key outputs #:allow-other-keys)
387 (let* ((out (assoc-ref outputs "out"))
388 (bin (string-append out "/bin")))
389 (wrap-program (string-append bin "/units_cur")
390 `("GUIX_PYTHONPATH" ":" prefix
391 ,(search-path-as-string->list (getenv "GUIX_PYTHONPATH"))))
393 (synopsis "Conversion between thousands of scales")
395 "GNU Units converts numeric quantities between units of measure. It
396 can handle scale changes through adaptive usage of standard scale
397 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
398 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
399 enough to be used effectively as a scientific calculator.")
400 (license license:gpl3+)
401 (home-page "https://www.gnu.org/software/units/")))
403 (define-public double-conversion
405 (name "double-conversion")
407 (home-page "https://github.com/google/double-conversion")
410 (uri (git-reference (url home-page)
411 (commit (string-append "v" version))))
412 (file-name (git-file-name name version))
415 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
416 (build-system cmake-build-system)
418 '(#:test-target "test"
419 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
420 "-DBUILD_TESTING=ON")))
421 (synopsis "Conversion routines for IEEE doubles")
423 "The double-conversion library provides binary-decimal and decimal-binary
424 routines for IEEE doubles. The library consists of efficient conversion
425 routines that have been extracted from the V8 JavaScript engine.")
426 (license license:bsd-3)))
428 (define-public dionysus
434 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
438 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
439 (build-system gnu-build-system)
440 (inputs (list tcl)) ;for 'tclsh'
441 (synopsis "Local search for universal constants and scientific values")
443 "GNU Dionysus is a convenient system for quickly retrieving the values of
444 mathematical constants used in science and engineering. Values can be
445 searched using a simple command-line tool, choosing from three databases:
446 universal constants, atomic numbers, and constants related to
448 (license license:gpl3+)
449 (home-page "https://www.gnu.org/software/dionysus/")))
460 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
461 "dSFMT-src-" version ".tar.gz"))
464 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
465 (modules '((guix build utils)))
466 ;; Don't distribute html documentation with bundled jquery.
469 (delete-file-recursively "html") #t))
470 ;; Add patches borrowed from Julia.
476 "https://raw.githubusercontent.com/JuliaLang/julia/"
477 "v1.3.0/deps/patches/dSFMT.c.patch"))
479 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
480 (file-name "dSFMT.c.patch"))
484 "https://raw.githubusercontent.com/JuliaLang/julia/"
485 "v1.3.0/deps/patches/dSFMT.h.patch"))
487 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
488 (file-name "dSFMT.h.patch"))))))
489 (build-system gnu-build-system)
492 (modify-phases %standard-phases
493 (delete 'configure) ; no configure script
495 ;; Upstream Makefile does not build a shared library. Borrow from Julia
496 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
499 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
500 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
501 "-O3" "-finline-functions" "-fomit-frame-pointer"
502 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
503 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
504 "-o" "libdSFMT.so")))
505 (replace 'install ; no "install" target
506 (lambda* (#:key outputs #:allow-other-keys)
507 (let* ((out (assoc-ref outputs "out"))
508 (lib (string-append out "/lib"))
509 (inc (string-append out "/include"))
510 (doc (string-append out "/share/doc/" ,name "-" ,version)))
511 (install-file "libdSFMT.so" lib)
512 (install-file "dSFMT.h" inc)
513 (install-file "LICENSE.txt" doc)
515 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
517 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
518 the expensive conversion of integer to double (floating point). dSFMT directly
519 generates double precision floating point pseudorandom numbers which have the
520 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
521 format. dSFMT is only available on the CPUs which use IEEE 754 format double
522 precision floating point numbers.")
523 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
524 (license license:bsd-3)))
532 (uri (string-append "mirror://gnu/gsl/gsl-"
536 "0av04cpblphvvs3kl5rwphniarml503501vrpqw31rd0bmwg7fzg"))))
537 (build-system gnu-build-system)
539 (let ((system (%current-system)))
540 `(#:configure-flags (list "--disable-static") ;halves package size
542 (modify-phases %standard-phases
544 ((and (target-riscv64?)
545 (%current-target-system))
546 '((add-after 'unpack 'force-bootstrap
548 ;; gsl ships with an old configure script that does not
549 ;; support riscv64. Regenerate it.
550 (delete-file "configure")))))
552 ((or (string-prefix? "aarch64" system)
553 (string-prefix? "powerpc" system))
554 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
555 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
556 '((add-before 'check 'disable-failing-tests
558 (substitute* "spmatrix/test.c"
559 ((".*test_complex.*") "\n"))))))
561 ((string-prefix? "i686" system)
562 ;; There are rounding issues with these tests on i686:
563 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
564 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
565 '((add-before 'check 'disable-failing-tests
567 (substitute* "linalg/test.c"
568 ((".*gsl_test\\(test_LU_decomp.*") "\n")
569 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
570 ((".*gsl_test\\(test_QR_decomp_r.*") "\n")
571 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
572 ((".*gsl_test\\(test_pcholesky_solve.*") "\n")
573 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
574 (substitute* "spmatrix/test.c"
575 ((".*test_all.*") "\n")
576 ((".*test_float.*") "\n")
577 ((".*test_complex.*") "\n"))
579 ;; XXX: These tests abort with:
580 ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
581 (substitute* '("multifit_nlinear/test.c"
582 "multilarge_nlinear/test.c")
583 (("gsl_ieee_env_setup.*" all)
584 (string-append "exit (77);\n" all)))))))
588 (if (and (target-riscv64?)
589 (%current-target-system))
590 (list autoconf automake libtool)
592 (home-page "https://www.gnu.org/software/gsl/")
593 (synopsis "Numerical library for C and C++")
595 "The GNU Scientific Library is a library for numerical analysis in C
596 and C++. It includes a wide range of mathematical routines, with over 1000
597 functions in total. Subject areas covered by the library include:
598 differential equations, linear algebra, Fast Fourier Transforms and random
601 ;; Linear algebra routines should benefit from SIMD optimizations.
602 (properties `((tunable? . #t)))
604 (license license:gpl3+)))
606 ;; TODO: Merge back into the gsl package as a separate output.
607 (define-public gsl-static
611 `(,@(package-arguments gsl)
612 #:configure-flags (list "--disable-shared")
613 #:make-flags (list "CFLAGS=-fPIC")))))
623 (url "https://github.com/shibatch/sleef")
625 (file-name (git-file-name name version))
627 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
628 (build-system cmake-build-system)
630 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
631 (string-append "-DCMAKE_INSTALL_LIBDIR="
632 (assoc-ref %outputs "out")
634 (string-append "-DCMAKE_INSTALL_PREFIX="
635 (assoc-ref %outputs "out")))
637 (modify-phases %standard-phases
638 ;; SLEEF generates a header library during the build process and writes
639 ;; to it via shell redirection. Make the checkout writable so the
640 ;; build can succeed.
641 (add-after 'unpack 'make-git-checkout-writable
643 (for-each make-file-writable (find-files "."))
646 (list fftw gmp mpfr openssl))
647 (home-page "https://sleef.org/")
648 (synopsis "SIMD library for evaluating elementary functions and DFT")
650 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
651 implements vectorized versions of all C99 real floating point math functions.
652 It can utilize SIMD instructions that are available on modern processors.")
653 (license (list license:boost1.0 ;sleef
654 license:cc-by4.0)))) ;simplex algorithm
663 (uri (string-append "mirror://gnu/glpk/glpk-"
667 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
668 (build-system gnu-build-system)
672 `(#:configure-flags '("--with-gmp"
673 "--disable-static")))
674 (home-page "https://www.gnu.org/software/glpk/")
675 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
677 "GLPK is a C library for solving large-scale linear programming (LP),
678 mixed integer programming (MIP), and other related problems. It supports the
679 GNU MathProg modeling language, a subset of the AMPL language, and features a
680 translator for the language. In addition to the C library, a stand-alone
681 LP/MIP solver is included in the package.")
682 (license license:gpl3+)))
684 (define-public glpk-4
692 (uri (string-append "mirror://gnu/glpk/glpk-"
696 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
705 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
707 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
709 "/4ti2-" version ".tar.gz"))
711 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
712 (build-system gnu-build-system)
714 (list (@ (gnu packages base) which))) ; for the tests
717 (home-page "http://www.4ti2.de/")
718 (synopsis "Mathematical tool suite for problems on linear spaces")
720 "4ti2 implements algorithms for solving algebraic, geometric and
721 combinatorial problems on linear spaces. Among others, it solves systems
722 of linear equations, computes extreme rays of polyhedral cones, solves
723 integer programming problems and computes Markov bases for statistics.")
724 (license license:gpl2+)))
726 (define-public cddlib
734 (url "https://github.com/cddlib/cddlib")
738 "09s8323h5w9j6mpl1yc6lm770dkskfxd2ayyafkcjllmnncxzfa0"))))
739 (build-system gnu-build-system)
742 (native-inputs (list autoconf
746 texlive-dvips-l3backend
747 texlive-latex-graphics
748 texlive-latex-l3backend
751 (list #:configure-flags
752 #~(list (string-append "--docdir=" #$output
753 "/share/doc/" #$name "-" #$version))))
754 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
755 (synopsis "Library for convex hulls and extreme rays of polyhedra")
757 "The C-library cddlib implements the Double Description Method of
758 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
759 rays of a general convex polyhedron given by a system of linear inequalities
760 in arbitrary dimension. It can also be used for the converse operation of
761 computing convex hulls.")
762 (license license:gpl2+)))
764 (define-public lrslib
771 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
773 (string-delete #\. version) ".tar.gz"))
776 "1w1jsnfgny8cihndr5gfm99pvwp48qsvxkqfsi2q87gd3m57aj7w"))))
777 (build-system gnu-build-system)
781 `(#:tests? #f ; no check phase
782 #:make-flags `("CC=gcc"
783 ,(string-append "prefix=" (assoc-ref %outputs "out"))
786 (modify-phases %standard-phases
789 (substitute* "makefile"
790 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
792 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
793 (synopsis "Convex hulls of polyhedra with exact arithmetic")
795 "The C code of lrslib implements the reverse search algorithm for
796 vertex enumeration and convex hull problems. Its input file format is
797 compatible with cddlib. All computations are done exactly in either
798 multiple precision or fixed integer arithmetic. Output is not stored
799 in memory, so even problems with very large output sizes can sometimes
801 (license license:gpl2+)))
803 (define-public libcerf
811 (url "https://jugit.fz-juelich.de/mlz/libcerf")
812 (commit (string-append "v" version))))
813 (file-name (git-file-name name version))
815 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
816 (build-system cmake-build-system)
819 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
820 (synopsis "Library for complex error functions")
822 "@code{libcerf} is a self-contained numeric library that provides an
823 efficient and accurate implementation of complex error functions, along with
824 Dawson, Faddeeva, and Voigt functions.")
825 (license license:expat)))
834 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
835 "vinci/vinci-" version ".tar.gz"))
838 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
839 (build-system gnu-build-system)
843 `(#:tests? #f ; no check phase
845 (modify-phases %standard-phases
847 ;; register the lrs location in the config file
848 (lambda* (#:key inputs #:allow-other-keys)
849 (let* ((lrs (assoc-ref inputs "lrslib"))
850 (lrsexec (string-append lrs "/bin/lrs")))
851 (substitute* "vinci.h"
852 (("#define LRS_EXEC \"lrs\"")
853 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
856 (lambda* (#:key outputs #:allow-other-keys)
857 (let* ((out (assoc-ref outputs "out"))
858 (bin (string-append out "/bin")))
859 (install-file "vinci" bin))
862 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
863 (synopsis "Volume computation for polytopes")
865 "Vinci implements a number of volume computation algorithms for convex
866 polytopes in arbitrary dimension. The polytopes can be given by their
867 V-representation (as the convex hull of a finite number of vertices), by
868 their H-representation (as the bounded intersection of a finite number of
869 halfspaces) or by their double description with both representations.")
870 (license license:gpl2+)))
872 (define-public arpack-ng
876 (home-page "https://github.com/opencollab/arpack-ng")
879 (uri (git-reference (url home-page) (commit version)))
880 (file-name (git-file-name name version))
883 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
884 (build-system gnu-build-system)
886 (list autoconf automake libtool pkg-config))
888 (list eigen lapack gfortran))
889 (synopsis "Fortran subroutines for solving eigenvalue problems")
891 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
892 large scale eigenvalue problems.")
893 (license (license:non-copyleft "file://COPYING"
894 "See COPYING in the distribution."))))
896 (define-public arpack-ng-3.3.0
903 (uri (git-reference (url (package-home-page arpack-ng))
905 (file-name (git-file-name (package-name arpack-ng) version))
908 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
910 (define-public arpack-ng-openmpi
911 (package (inherit arpack-ng)
912 (name "arpack-ng-openmpi")
915 ,@(package-inputs arpack-ng)))
917 (substitute-keyword-arguments (package-arguments arpack-ng)
918 ((#:configure-flags _ '())
920 ((#:phases phases '%standard-phases)
921 `(modify-phases ,phases
922 (add-before 'check 'mpi-setup
924 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
926 (define-public lapack
933 (uri (string-append "http://www.netlib.org/lapack/lapack-"
937 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
938 (build-system cmake-build-system)
939 (home-page "http://www.netlib.org/lapack/")
940 (inputs `(("fortran" ,gfortran)
941 ("python" ,python-wrapper)))
943 `(#:configure-flags (list
944 "-DBUILD_SHARED_LIBS:BOOL=YES"
946 ;; Build the 'LAPACKE_clatms' functions.
947 "-DLAPACKE_WITH_TMG=ON"
948 "-DBUILD_TESTING=ON")))
949 (synopsis "Library for numerical linear algebra")
951 "LAPACK is a Fortran 90 library for solving the most commonly occurring
952 problems in numerical linear algebra.")
953 (license (license:non-copyleft "file://LICENSE"
954 "See LICENSE in the distribution."))))
956 (define-public clapack
963 (uri (string-append "http://www.netlib.org/clapack/clapack-"
964 version "-CMAKE.tgz"))
967 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
968 (build-system cmake-build-system)
970 `(#:configure-flags '("-DCMAKE_C_FLAGS=-fcommon -O2")
972 (modify-phases %standard-phases
973 ;; These tests use a lot of stack variables and segfault without
974 ;; lifting resource limits.
975 (add-after 'unpack 'disable-broken-tests
977 (substitute* "TESTING/CMakeLists.txt"
978 (("add_lapack_test.* xeigtstz\\)") ""))))
980 (lambda* (#:key outputs #:allow-other-keys)
981 (let* ((out (assoc-ref outputs "out"))
982 (libdir (string-append out "/lib"))
983 (f2cinc (string-append out "/include/libf2c")))
986 (for-each (lambda (file)
987 (install-file file libdir))
989 "F2CLIBS/libf2c/libf2c.a"
990 "TESTING/MATGEN/libtmglib.a"
991 "BLAS/SRC/libblas.a"))
992 (for-each (lambda (file)
993 (install-file file f2cinc))
994 (cons "F2CLIBS/libf2c/arith.h"
995 (find-files (string-append "../clapack-"
996 ,version "-CMAKE/F2CLIBS/libf2c")
998 (copy-recursively (string-append "../clapack-"
999 ,version "-CMAKE/INCLUDE")
1000 (string-append out "/include"))))))))
1001 (home-page "https://www.netlib.org/clapack/")
1002 (synopsis "Numerical linear algebra library for C")
1004 "The CLAPACK library was built using a Fortran to C conversion utility
1005 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
1006 C code, and then modified to improve readability. CLAPACK's goal is to
1007 provide LAPACK for someone who does not have access to a Fortran compiler.")
1008 (license (license:non-copyleft "file://LICENSE"
1009 "See LICENSE in the distribution."))))
1011 (define-public scalapack
1018 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
1022 "19i0h9vdc3zsy58r6fy1vs2kz2l7amifkz0cf926j90xz1n23nb1"))
1023 (patches (search-patches "scalapack-gcc-10-compilation.patch"))))
1024 (build-system cmake-build-system)
1027 ("fortran" ,gfortran)
1028 ("lapack" ,lapack))) ;for testing only
1030 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
1031 #:phases (modify-phases %standard-phases
1032 (add-before 'check 'mpi-setup
1034 (add-after 'unpack 'skip-faulty-test
1036 ;; FIXME: Skip these two tests that fail to complete for
1038 ;; <https://github.com/Reference-ScaLAPACK/scalapack/issues/43>.
1039 (substitute* "TESTING/CMakeLists.txt"
1040 (("^add_test\\(x[sd]hseqr.*" all)
1041 (string-append "# " all "\n"))))))))
1042 (home-page "http://www.netlib.org/scalapack/")
1043 (synopsis "Library for scalable numerical linear algebra")
1045 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
1046 routines on parallel distributed memory machines. ScaLAPACK solves dense and
1047 banded linear systems, least squares problems, eigenvalue problems, and
1048 singular value problems.")
1049 (license (license:non-copyleft "file://LICENSE"
1050 "See LICENSE in the distribution."))))
1052 (define-public feedgnuplot
1054 (name "feedgnuplot")
1056 (home-page "https://github.com/dkogan/feedgnuplot")
1061 (commit (string-append "v" version))))
1062 (file-name (git-file-name name version))
1065 "0403hwlian2s431m36qdzcczhvfjvh7128m64hmmwbbrgh0n7md7"))))
1066 (build-system perl-build-system)
1069 (modify-phases %standard-phases
1070 (add-before 'check 'adjust-tests
1072 (substitute* "t/plots.t"
1073 ;; XXX: The vnlog tests uses 'echo' with escaped strings,
1074 ;; but does not enable escape interpretation.
1077 (add-after 'install 'install-documentation
1078 (lambda* (#:key outputs #:allow-other-keys)
1079 (let* ((out (assoc-ref outputs "out"))
1080 (doc (string-append out "/share/doc/feedgnuplot")))
1082 (invoke "pod2html" "--title=feedgnuplot" "bin/feedgnuplot"
1083 "--outfile" (string-append doc "/feedgnuplot.html")))))
1084 (add-after 'install 'wrap
1085 (lambda* (#:key inputs outputs #:allow-other-keys)
1086 (let* ((out (assoc-ref outputs "out"))
1087 (gnuplot (search-input-file inputs "/bin/gnuplot"))
1088 ;; XXX: We need List::MoreUtils as well as its supporting
1089 ;; (propagated) modules; for now just refer to labels.
1090 (modules '("perl-list-moreutils" "perl-exporter-tiny"))
1091 (PERL5LIB (string-join
1092 (map (lambda (input)
1093 (string-append (assoc-ref inputs input)
1094 "/lib/perl5/site_perl"))
1097 (wrap-program (string-append out "/bin/feedgnuplot")
1098 `("PERL5LIB" ":" suffix (,PERL5LIB))
1099 `("PATH" ":" suffix (,(dirname gnuplot))))))))))
1101 (list gnuplot perl-list-moreutils vnlog))
1104 (list perl-ipc-run perl-string-shellquote))
1105 (synopsis "Pipe-oriented plotting tool")
1107 "@command{feedgnuplot} is a tool to plot realtime and stored data
1108 from the command line, using @command{gnuplot}. It can read data from
1109 a pipe or file, make a variety of transformations, and render the result
1110 in the terminal or with an external viewer.")
1111 (license license:gpl1+))) ;any version
1121 (url "https://github.com/danieljprice/giza")
1122 (commit (string-append "v" version))))
1124 (base32 "1clklh3nzgwrwg80h3k5x65gdymbvcc84c44nql7m4bv9b8rqfsq"))
1125 (file-name (git-file-name name version))))
1126 (build-system gnu-build-system)
1128 (list perl pkg-config))
1130 (list cairo freetype gfortran))
1131 (home-page "https://danieljprice.github.io/giza/")
1132 (synopsis "Scientific plotting library for C/Fortran")
1134 "Giza is a lightweight scientific plotting library built on top of
1135 @code{cairo} that provides uniform output to multiple devices.")
1136 (license license:gpl2+)))
1138 (define-public gnuplot
1144 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1148 (base32 "00h97y8njhvfjbdvc0njw0znxbrlfynd1iazn8w3anvzhsvh08rp"))))
1149 (build-system gnu-build-system)
1151 (list pkg-config texlive-tiny))
1153 (list cairo gd lua pango readline))
1155 (list #:configure-flags
1156 #~(list (string-append "--with-texdir=" #$output
1157 "/texmf-local/tex/latex/gnuplot"))
1158 ;; Plot on a dumb terminal during tests.
1159 #:make-flags #~'("GNUTERM=dumb")))
1160 (home-page "http://www.gnuplot.info")
1161 (synopsis "Command-line driven graphing utility")
1162 (description "Gnuplot is a portable command-line driven graphing
1163 utility. It was originally created to allow scientists and students to
1164 visualize mathematical functions and data interactively, but has grown to
1165 support many non-interactive uses such as web scripting. It is also used as a
1166 plotting engine by third-party applications like Octave.")
1167 ;; X11 Style with the additional restriction that derived works may only be
1168 ;; distributed as patches to the original.
1169 (license (license:fsf-free
1170 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1180 (url "https://github.com/OkoSanto/GCTP")
1181 (commit (string-append "v" version))))
1182 (file-name (git-file-name name version))
1184 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1187 (build-system gnu-build-system)
1188 (synopsis "General Cartographic Transformation Package (GCTP)")
1190 "The General Cartographic Transformation Package (GCTP) is a system of
1191 software routines designed to permit the transformation of coordinate pairs
1192 from one map projection to another. The GCTP is the standard computer
1193 software used by the National Mapping Division for map projection
1195 (home-page "https://github.com/OkoSanto/GCTP")
1196 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1205 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1206 version "/src/hdf-" version ".tar.bz2"))
1208 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1209 (patches (search-patches "hdf4-architectures.patch"
1210 "hdf4-reproducibility.patch"
1211 "hdf4-shared-fortran.patch"
1212 "hdf4-tirpc.patch"))))
1213 (build-system gnu-build-system)
1215 (list gfortran bison flex))
1218 ("libjpeg" ,libjpeg-turbo)
1219 ("libtirpc" ,libtirpc)))
1221 `(#:parallel-tests? #f
1222 #:configure-flags (list "--enable-shared"
1223 "FCFLAGS=-fallow-argument-mismatch"
1224 "FFLAGS=-fallow-argument-mismatch"
1225 (string-append "CPPFLAGS=-I"
1226 (assoc-ref %build-inputs "libtirpc")
1229 (modify-phases %standard-phases
1230 ;; This is inspired by two of Debian's patches.
1231 (add-before 'configure 'add-more-aarch64-support
1233 (substitute* '("mfhdf/ncgen/ncgen.l"
1234 "mfhdf/ncgen/ncgenyy.c"
1235 "mfhdf/libsrc/netcdf.h.in")
1236 (("AIX5L64") "__aarch64__"))
1238 (add-before 'configure 'patchbuild
1241 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1243 (("/bin/mkdir") "mkdir"))
1244 (substitute* (find-files "." "^Makefile\\.in$")
1245 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1246 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1247 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1248 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1249 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1251 (add-after 'configure 'patch-settings
1253 ;; libhdf4.settings contains the full path of the
1254 ;; compilers used, and its contents are included in
1255 ;; .so-files. We truncate the hashes to avoid
1256 ;; unnecessary store references to those compilers:
1257 (substitute* "libhdf4.settings"
1258 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1259 (string-append prefix (string-take hash 10) "...")))
1261 (add-after 'install 'provide-absolute-libjpeg-reference
1262 (lambda* (#:key inputs outputs #:allow-other-keys)
1263 (let ((out (assoc-ref outputs "out"))
1264 (libjpeg (assoc-ref inputs "libjpeg")))
1265 ;; libjpeg-turbo does not provide a .la file, so libtool is
1266 ;; unable to add an absolute reference for -ljpeg in the .la
1267 ;; files. Fix it manually to avoid having to propagate it.
1268 (substitute* (find-files (string-append out "/lib") "\\.la$")
1270 (string-append "-L" libjpeg "/lib -ljpeg")))
1272 (home-page "https://www.hdfgroup.org/products/hdf4/")
1274 "Library and multi-object file format for storing and managing data")
1275 (description "HDF4 is a library and multi-object file format for storing
1276 and managing data between machines. HDF4 is an older hierarchical data format,
1277 incompatible with HDF5.")
1279 (license:non-copyleft
1280 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1282 (define-public hdf4-alt
1287 (substitute-keyword-arguments (package-arguments hdf4)
1288 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1290 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1292 (define-public hdf5-1.8
1299 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1300 "hdf5-" (version-major+minor version)
1301 "/hdf5-" version "/src/hdf5-"
1303 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1305 (match (string-split version #\.)
1306 ((major minor _ ...)
1307 (string-append major minor)))
1308 "/src/hdf5-" version ".tar.bz2")))
1310 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1311 (patches (search-patches "hdf5-config-date.patch"))))
1312 (build-system gnu-build-system)
1316 (list gfortran perl)) ;part of the test machinery needs Perl
1317 (outputs '("out" ; core library
1318 "fortran")) ; fortran interface
1320 `(;; Some of the users, notably Flann, need the C++ interface.
1321 #:configure-flags '("--enable-cxx"
1323 "--enable-fortran2003"
1325 ;; Build a thread-safe library. Unfortunately,
1326 ;; 'configure' invites you to either turn off C++,
1327 ;; Fortran, and the high-level interface (HL), or
1328 ;; to pass '--enable-unsupported'. Debian
1329 ;; packagers chose to pass '--enable-unsupported'
1330 ;; and we follow their lead here.
1331 "--enable-threadsafe"
1333 "--enable-unsupported")
1334 ;; Use -fPIC to allow the R bindings to link with the static libraries
1335 #:make-flags (list "CFLAGS=-fPIC"
1338 (modify-phases %standard-phases
1339 (add-before 'configure 'patch-configure
1340 (lambda* (#:key outputs #:allow-other-keys)
1341 (substitute* "configure"
1343 (substitute* "fortran/src/Makefile.in"
1344 (("libhdf5_fortran_la_LDFLAGS =")
1345 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl,-rpath="
1346 (assoc-ref outputs "fortran") "/lib")))
1347 (substitute* "hl/fortran/src/Makefile.in"
1348 (("libhdf5hl_fortran_la_LDFLAGS =")
1349 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1350 (assoc-ref outputs "fortran") "/lib")))
1352 (add-after 'configure 'patch-settings
1354 ;; libhdf5.settings contains the full path of the
1355 ;; compilers used, and its contents are included in
1356 ;; libhdf5.so. We truncate the hashes to avoid
1357 ;; unnecessary store references to those compilers:
1358 (substitute* "src/libhdf5.settings"
1359 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1360 (string-append prefix (string-take hash 10) "..."))
1361 ;; Don't record the build-time kernel version to make the
1362 ;; settings file reproducible.
1363 (("Uname information:.*")
1364 "Uname information: Linux\n"))
1366 (add-after 'install 'patch-references
1367 (lambda* (#:key inputs outputs #:allow-other-keys)
1368 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1369 (zlib (assoc-ref inputs "zlib")))
1370 (substitute* (find-files bin "h5p?cc")
1372 (string-append "-L" zlib "/lib " lib)))
1374 (add-after 'install 'split
1375 (lambda* (#:key inputs outputs #:allow-other-keys)
1376 ;; Move all fortran-related files
1377 (let* ((out (assoc-ref outputs "out"))
1378 (bin (string-append out "/bin"))
1379 (lib (string-append out "/lib"))
1380 (inc (string-append out "/include"))
1381 (ex (string-append out "/share/hdf5_examples/fortran"))
1382 (fort (assoc-ref outputs "fortran"))
1383 (fbin (string-append fort "/bin"))
1384 (flib (string-append fort "/lib"))
1385 (finc (string-append fort "/include"))
1386 (fex (string-append fort "/share/hdf5_examples/fortran")))
1391 ;; Note: When built with --enable-parallel, the 'h5fc' file
1392 ;; doesn't exist, hence this condition.
1393 (when (file-exists? (string-append bin "/h5fc"))
1394 (rename-file (string-append bin "/h5fc")
1395 (string-append fbin "/h5fc")))
1396 (for-each (lambda (file)
1398 (string-append flib "/" (basename file))))
1399 (find-files lib ".*fortran.*"))
1400 (for-each (lambda (file)
1402 (string-append finc "/" (basename file))))
1403 (find-files inc ".*mod"))
1404 (for-each (lambda (file)
1406 (string-append fex "/" (basename file))))
1407 (find-files ex ".*"))
1408 (delete-file-recursively ex))
1410 (home-page "https://www.hdfgroup.org")
1411 (synopsis "Management suite for extremely large and complex data")
1412 (description "HDF5 is a suite that makes possible the management of
1413 extremely large and complex data collections.")
1414 (license (license:x11-style
1415 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1417 (define-public hdf5-1.10
1424 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1425 "hdf5-" (version-major+minor version)
1426 "/hdf5-" version "/src/hdf5-"
1428 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1430 (apply string-append
1431 (take (string-split version #\.) 2))
1432 "/src/hdf5-" version ".tar.bz2")))
1434 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1435 (patches (search-patches "hdf5-config-date.patch"))))))
1437 (define-public hdf5-1.12
1444 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1445 "hdf5-" (version-major+minor version)
1446 "/hdf5-" version "/src/hdf5-"
1448 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1450 (apply string-append
1451 (take (string-split version #\.) 2))
1452 "/src/hdf5-" version ".tar.bz2")))
1454 (base32 "074g3z504xf77ff38igs30i1aqxpm508p7yw78ykva7dncrgbyda"))
1455 (patches (search-patches "hdf5-config-date.patch"))))))
1458 ;; Default version of HDF5.
1461 (define-public hdf-java
1469 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1470 version "/src/CMake-hdfjava-" version ".tar.gz"))
1472 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1473 (modules '((guix build utils)))
1474 (snippet ; Make sure we don't use the bundled sources and binaries.
1476 (for-each delete-file
1477 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1478 "HDF4.tar.gz" "HDF5.tar.gz"))
1479 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1481 (build-system gnu-build-system)
1483 `(("jdk" ,icedtea "jdk")
1484 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1486 ("hamcrest-core" ,java-hamcrest-core)
1487 ("junit" ,java-junit)
1488 ("slf4j-simple" ,java-slf4j-simple)))
1493 ("libjpeg" ,libjpeg-turbo)
1494 ("slf4j-api" ,java-slf4j-api)))
1497 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1498 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1499 (assoc-ref %build-inputs "jdk") "/lib" )
1500 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1501 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1504 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1505 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1506 (string-append "ZLIB=" (search-input-file %build-inputs "/lib/libz.so"))
1507 (string-append "JPEGLIB="
1508 (search-input-file %build-inputs "/lib/libjpeg.so"))
1512 (modify-phases %standard-phases
1513 (add-before 'configure 'chdir-to-source
1514 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1515 (add-before 'configure 'patch-build
1516 (lambda* (#:key inputs outputs #:allow-other-keys)
1517 (substitute* "configure"
1518 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1519 (("/bin/cat") (which "cat")))
1520 ;; Set classpath for compilation
1521 (substitute* '("hdf/hdf5lib/Makefile.in"
1522 "hdf/hdf5lib/exceptions/Makefile.in"
1523 "hdf/hdflib/Makefile.in")
1524 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1525 ;; 'slf4j-api-X.Y.Z.jar' is installed in a Maven-style
1526 ;; directory, so use 'find-files' to find it.
1527 (car (find-files (assoc-ref inputs "slf4j-api")
1528 "^slf4j-api.*\\.jar$"))))
1529 ;; Replace outdated config.sub and config.guess:
1530 (with-directory-excursion "config"
1531 (for-each (lambda (file)
1533 (search-input-file inputs
1536 ,(version-major+minor (package-version automake))
1539 '("config.sub" "config.guess")))
1541 ;; Fix embedded version number
1542 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1543 (substitute* "hdf/hdf5lib/H5.java"
1545 (string-join hdf5version ", "))))
1547 (mkdir-p (string-append (assoc-ref outputs "out")))
1548 ;; Set classpath for tests
1549 (let* ((build-dir (getcwd))
1550 (lib (string-append build-dir "/lib"))
1551 (jhdf (string-append lib "/jhdf.jar"))
1552 (jhdf5 (string-append lib "/jhdf5.jar"))
1556 (car (find-files (assoc-ref inputs i)
1557 (string-append "^" i
1559 '("slf4j-api" "slf4j-simple"))
1561 (car (find-files (assoc-ref inputs "junit") "jar$"))
1562 (car (find-files (assoc-ref inputs "hamcrest-core")
1565 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1567 (substitute* '("test/hdf5lib/Makefile.in"
1568 "test/hdf5lib/junit.sh.in"
1569 "examples/runExample.sh.in")
1571 (search-input-file inputs "/bin/test"))
1573 (search-input-file inputs "/bin/uname"))
1574 (("CLASSPATH=[^\n]*")
1575 (string-append "CLASSPATH=" class-path)))
1576 (setenv "CLASSPATH" class-path))
1578 (add-before 'check 'build-examples
1580 (apply invoke `("javac"
1581 ,@(find-files "examples" ".*\\.java"))))))
1583 #:parallel-build? #f
1585 #:parallel-tests? #f ))
1586 (home-page "https://support.hdfgroup.org/products/java")
1587 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1588 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1589 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1592 ;; BSD-style license:
1593 (license (license:x11-style
1594 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1595 /current/src/unpacked/COPYING"))))
1597 (define-public hdf-eos2
1604 (uri "ftp://edhs1.gsfc.nasa.gov\
1605 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1607 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1608 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1609 "hdf-eos2-build-shared.patch"
1610 "hdf-eos2-fortrantests.patch"))))
1611 (build-system gnu-build-system)
1615 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1616 ;; XXX: These inputs are really dependencies of hdf4.
1618 ("libjpeg" ,libjpeg-turbo)
1619 ("libtirpc" ,libtirpc)
1623 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1624 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1625 #:parallel-tests? #f))
1626 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1627 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1628 (description "HDF-EOS2 is a software library built on HDF4 which supports
1629 the construction of data structures used in NASA's Earth Observing
1630 System (Grid, Point and Swath).")
1632 ;; Source files carry a permissive license header.
1633 (license (license:non-copyleft home-page))))
1635 (define-public hdf-eos5
1641 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1642 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1645 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1646 (patches (search-patches "hdf-eos5-build-shared.patch"
1647 "hdf-eos5-remove-gctp.patch"
1648 "hdf-eos5-fix-szip.patch"
1649 "hdf-eos5-fortrantests.patch"))))
1652 (build-system gnu-build-system)
1654 (list hdf5-1.8 zlib gctp))
1656 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1657 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1658 #:parallel-tests? #f))
1659 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1661 "HDF-EOS5 is a software library built on HDF5 to support the construction
1662 of data structures used in NASA's Earth Observing System (Grid, Point and
1664 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1666 ;; Source files carry a permissive license header.
1667 (license (license:non-copyleft home-page))))
1669 (define-public hdf5-parallel-openmpi
1670 (package/inherit hdf5-1.10 ;use the latest
1671 (name "hdf5-parallel-openmpi")
1674 ,@(package-inputs hdf5)))
1676 (substitute-keyword-arguments (package-arguments hdf5)
1677 ((#:configure-flags flags)
1678 ``("--enable-parallel"
1679 ,@(delete "--enable-cxx"
1680 (delete "--enable-threadsafe" ,flags))))
1682 `(modify-phases ,phases
1683 (add-after 'build 'mpi-setup
1685 (add-before 'check 'patch-tests
1687 ;; OpenMPI's mpirun will exit with non-zero status if it
1688 ;; detects an "abnormal termination", i.e. any process not
1689 ;; calling MPI_Finalize(). Since the test is explicitly
1690 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1691 ;; H5C_flush_cache from being called, mpirun will always
1692 ;; complain, so turn this test off.
1693 (substitute* "testpar/Makefile"
1694 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1695 (string-append front back "\n")))
1696 (substitute* "tools/test/h5diff/testph5diff.sh"
1697 (("/bin/sh") (which "sh")))
1699 (synopsis "Management suite for data with parallel IO support")))
1701 (define-public hdf5-blosc
1709 (url "https://github.com/Blosc/hdf5-blosc")
1710 (commit (string-append "v" version))))
1711 (file-name (git-file-name name version))
1713 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1714 (build-system cmake-build-system)
1717 (list (string-append "-DBLOSC_INSTALL_DIR="
1718 (assoc-ref %build-inputs "c-blosc"))
1719 (string-append "-DPLUGIN_INSTALL_PATH="
1720 (assoc-ref %outputs "out")
1721 "/hdf5/lib/plugin"))
1723 (modify-phases %standard-phases
1724 (add-after 'unpack 'do-not-build-blosc
1726 (substitute* "CMakeLists.txt"
1727 (("set\\(BLOSC_INSTALL_DIR.*") "")
1728 (("ExternalProject_Add\\(project_blosc") "message("))
1731 (list c-blosc hdf5-1.10))
1732 (home-page "https://github.com/Blosc/hdf5-blosc")
1733 (synopsis "Filter for HDF5 using the Blosc compressor")
1734 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1735 installing this filter, you can read and write HDF5 files with
1736 Blosc-compressed datasets.")
1737 (license license:expat)))
1739 (define-public h5check
1746 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1747 "h5check/src/h5check-" version ".tar.gz"))
1750 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1751 (build-system gnu-build-system)
1752 (inputs (list hdf5-1.8)) ;h5cc for tests
1753 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1754 (synopsis "HDF5 format checker")
1755 (description "@code{h5check} is a validation tool for verifying that an
1756 HDF5 file is encoded according to the HDF File Format Specification.")
1757 (license (license:x11-style "file://COPYING"))))
1759 (define-public itex2mml
1765 (uri (string-append "https://golem.ph.utexas.edu"
1766 "/~distler/blog/files/itexToMML-"
1771 "0pz51c0hfh2mg8xli0wj7hf92s3b7yf5r4114g8z8722lcm5gwiy"))
1774 (use-modules (guix build utils))
1775 (delete-file-recursively "itex-binaries")))))
1776 (build-system gnu-build-system)
1782 #:make-flags #~(list (string-append "BINDIR=" #$output "/bin/")
1783 (string-append "CC=" #$(cc-for-target)))
1784 #:tests? #f ;; there are none
1786 #~(modify-phases %standard-phases
1788 (add-before 'build 'chdir
1790 (chdir "itex-src")))
1791 (add-before 'install 'make-bindir
1793 (mkdir-p (string-append #$output "/bin"))))
1794 (add-after 'install 'install-doc
1795 (lambda* (#:key outputs #:allow-other-keys)
1796 (let* ((doc-prefix (or (assoc-ref outputs "doc")
1798 (itex2mml+version (strip-store-file-name #$output))
1799 (doc-dir (string-append doc-prefix
1802 (install-file "../README" doc-dir)))))))
1803 (home-page "https://golem.ph.utexas.edu/~distler/blog/itex2MML.html")
1804 (synopsis "LaTeX to XHTML/MathML converter")
1806 "The @command{itex2MML} utility is a stream filter. It takes text with
1807 embedded itex equations, converts the itex equations to MathML, and outputs
1808 the resulting text.")
1809 (license (list license:lgpl2.0+ license:gpl2+ license:mpl1.1))))
1817 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1822 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1823 (build-system cmake-build-system)
1824 (arguments `(#:tests? #f ; Tests require googletest *sources*
1826 (modify-phases %standard-phases
1827 (add-after 'install 'delete-formulas-log
1828 ;; Contains date and timing information which is unreproducible,
1829 ;; and should not be needed when using the package
1830 (lambda* (#:key outputs #:allow-other-keys)
1831 (let ((out (assoc-ref outputs "out")))
1832 (delete-file (string-append out "/share/doc/itpp/html/_formulas.log")))))
1833 (add-after 'unpack 'set-man-page-date
1835 (substitute* "itpp-config.1.cmake.in"
1836 ((".PACKAGE_DATE.") "2012-04-18"))))
1837 (add-before 'build 'set-force-source-date
1838 ;; for reproducible dates, texlive needs this to respect respect
1839 ;; SOURCE_DATE_EPOCH
1841 (setenv "FORCE_SOURCE_DATE" "1"))))))
1842 (inputs (list lapack fftw))
1843 ;; FIXME: Even though the fonts are available dvips complains:
1844 ;; "Font cmmi10 not found; characters will be left blank."
1846 `(("texlive" ,texlive-tiny)
1847 ("ghostscript" ,ghostscript)
1848 ("doxygen" ,doxygen)))
1849 (home-page "http://itpp.sourceforge.net")
1850 (synopsis "C++ library of maths, signal processing and communication classes")
1851 (description "IT++ is a C++ library of mathematical, signal processing and
1852 communication classes and functions. Its main use is in simulation of
1853 communication systems and for performing research in the area of
1854 communications. The kernel of the library consists of generic vector and
1855 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1856 similar to MATLAB, GNU Octave or SciPy.")
1857 (license license:gpl3+)))
1859 (define-public netcdf
1867 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1868 "netcdf-c-" version ".tar.gz"))
1871 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1872 (modules '((guix build utils)))
1874 ;; Make sure this variable is defined only once. Failing to do so
1875 ;; would break builds of 'netcdf-parallel-openmpi' with a
1876 ;; multiple-definition link error with GCC 10.
1877 '(substitute* "ncdump/ocprint.c"
1878 (("^int ocdebug") "static int ocdebug")))
1879 (patches (search-patches "netcdf-date-time.patch"))))
1880 (build-system gnu-build-system)
1882 (list m4 doxygen graphviz))
1884 `(("hdf4" ,hdf4-alt)
1888 ("libjpeg" ,libjpeg-turbo)))
1890 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1892 #:phases (modify-phases %standard-phases
1893 (add-before 'configure 'fix-source-date
1895 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1896 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1897 ;; to '1st hour of the current day', and therefore makes the
1898 ;; package not reproducible.
1899 (substitute* "./configure"
1900 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1901 "date --date='@0'"))
1903 (add-after 'configure 'patch-settings
1905 ;; libnetcdf.settings contains the full filename of the compilers
1906 ;; used to build the library. We truncate the hashes of those
1907 ;; filenames to avoid unnecessary references to the corresponding
1909 (substitute* "libnetcdf.settings"
1910 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
1911 (string-append prefix (string-take hash 10) "...")))
1914 #:parallel-tests? #f)) ;various race conditions
1915 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1916 (synopsis "Library for scientific data")
1917 (description "NetCDF is an interface for scientific data access and a
1918 software library that provides an implementation of the interface. The netCDF
1919 library defines a machine-independent format for representing scientific data.
1920 Together, the interface, library, and format support the creation, access, and
1921 sharing of scientific data.")
1922 (license (license:x11-style "file://COPYRIGHT"))))
1924 (define-public netcdf-parallel-openmpi
1925 (package (inherit netcdf)
1926 (name "netcdf-parallel-openmpi")
1929 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1930 (package-inputs netcdf))))
1931 ;; TODO: Replace pkg-config references in nc-config with absolute references
1933 (substitute-keyword-arguments (package-arguments netcdf)
1934 ((#:configure-flags flags)
1935 `(cons* "CC=mpicc" "CXX=mpicxx"
1936 "--enable-parallel-tests"
1937 ;; Shared libraries not supported with parallel IO.
1938 "--disable-shared" "--with-pic"
1940 ((#:phases phases '%standard-phases)
1941 `(modify-phases ,phases
1942 (add-after 'build 'mpi-setup
1943 ,%openmpi-setup)))))))
1945 (define-public netcdf-fortran
1947 (name "netcdf-fortran")
1952 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1956 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1957 (build-system gnu-build-system)
1959 `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
1960 "FFLAGS=-fallow-argument-mismatch")
1961 #:parallel-tests? #f))
1966 (synopsis "Fortran interface for the netCDF library")
1967 (description (package-description netcdf))
1968 (home-page (package-home-page netcdf))
1969 (license (package-license netcdf))))
1978 (url "https://github.com/CompPhysVienna/n2p2")
1979 (commit (string-append "v" version))))
1980 (file-name (git-file-name name version))
1983 "1lw195ihpxwh08387i4gamk1glhalpq888q6nj8l5vswbgnrv1pq"))))
1984 (build-system gnu-build-system)
1986 `(#:make-flags '("MODE=shared" "-C" "src")
1988 (modify-phases %standard-phases
1989 (add-after 'unpack 'post-unpack
1990 (lambda* (#:key inputs #:allow-other-keys)
1991 (substitute* "src/makefile.gnu"
1992 (("PROJECT_EIGEN=/usr/include/eigen3")
1993 (string-append "PROJECT_EIGEN="
1994 (assoc-ref inputs "eigen") "/include/eigen3")))
1995 (substitute* "src/makefile.gnu"
1997 (string-append "-L" (assoc-ref inputs "openblas")
2001 (substitute* "src/application/makefile"
2003 "LDFLAGS=-Wl,-rpath='$$ORIGIN/../lib' "))))
2007 (lambda* (#:key outputs #:allow-other-keys)
2008 (let* ((out (assoc-ref outputs "out"))
2009 (bindir (string-append out "/bin"))
2010 (libdir (string-append out "/lib"))
2011 (incdir (string-append out "/include")))
2012 (for-each (lambda (f) (install-file f bindir))
2013 (find-files "bin" "^nnp-"))
2014 (for-each (lambda (f) (install-file f libdir))
2015 (find-files "lib" "\\.so$"))
2016 (for-each (lambda (f) (install-file f incdir))
2017 (find-files "include" "\\.h$"))))))))
2019 (list openmpi gsl openblas eigen))
2020 (synopsis "Neural network potentials for chemistry and physics")
2021 (description "This package contains software that will allow you to use
2022 existing neural network potential parameterizations to predict energies and
2023 forces (with standalone tools but also in conjunction with the MD software
2024 LAMMPS). In addition it is possible to train new neural network potentials
2025 with the provided training tools.")
2026 (home-page "https://compphysvienna.github.io/n2p2/")
2027 (properties '((tunable? . #t))) ;to benefit from SIMD code in Eigen
2028 (license license:gpl3+)))
2030 (define-public nlopt
2037 (url "https://github.com/stevengj/nlopt/")
2038 (commit (string-append "v" version))))
2039 (file-name (git-file-name name version))
2041 (base32 "1xpdza28i8w441fwv6a5f3qk4zi7ys6ws9fx6kr5ny27dfdz6rr1"))))
2042 (build-system cmake-build-system)
2045 (modify-phases %standard-phases
2046 (add-before 'configure 'set-libnlopt-file-name
2047 (lambda* (#:key outputs #:allow-other-keys)
2048 ;; Make sure the Scheme module refers to the library by its
2049 ;; absolute file name.
2050 (let ((out (assoc-ref outputs "out")))
2051 (substitute* "src/swig/nlopt-guile.i"
2052 (("\"nlopt_guile\"")
2054 `(format #f "~anlopt_guile"
2055 (if (getenv "NLOPT_UNINSTALLED")
2057 ,(format #f "~a/lib/guile/3.0/extensions/" out))))))
2058 (setenv "NLOPT_UNINSTALLED" "1")))))))
2059 (inputs (list guile-3.0 octave python))
2060 (native-inputs (list pkg-config swig))
2061 (home-page "http://ab-initio.mit.edu/wiki/")
2062 (synopsis "Library for nonlinear optimization")
2063 (description "NLopt is a library for nonlinear optimization, providing a
2064 common interface for a number of different free optimization routines available
2065 online as well as original implementations of various other algorithms.")
2066 (license license:lgpl2.1+)))
2068 (define-public ipopt
2075 (url "https://github.com/coin-or/Ipopt")
2076 (commit (string-append "releases/" version))))
2077 (file-name (git-file-name name version))
2080 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
2081 (build-system gnu-build-system)
2083 '(#:phases (modify-phases %standard-phases
2084 (add-after 'install 'add--L-flags-in-ipopt.pc
2085 (lambda* (#:key inputs outputs #:allow-other-keys)
2086 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
2087 ;; move it to "Libs.private" where it belongs, and add a
2088 ;; '-L' flag for LAPACK.
2089 (let ((out (assoc-ref outputs "out"))
2090 (lapack (assoc-ref inputs "lapack")))
2091 (substitute* (string-append out "/lib/pkgconfig/"
2093 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
2094 (string-append "Libs: " before " " after "\n"
2095 "Libs.private: " before
2096 "-L" lapack "/lib -llapack -lblas "
2100 (list gfortran pkg-config))
2102 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
2103 (list lapack)) ;for both libblas and liblapack
2104 (home-page "https://www.coin-or.org")
2105 (synopsis "Large-scale nonlinear optimizer")
2107 "The Interior Point Optimizer (IPOPT) is a software package for
2108 large-scale nonlinear optimization. It provides C++, C, and Fortran
2110 (license license:epl2.0)))
2112 (define-public nomad-optimizer
2114 (name "nomad-optimizer")
2120 (url "https://github.com/bbopt/nomad/")
2121 (commit (string-append "v." version))))
2122 (file-name (git-file-name name version))
2125 "1r4ygy3xn83dnppsw1451ynklsxpb238g5gk57inn84ghmdk08mj"))))
2126 (build-system cmake-build-system)
2128 (list python-wrapper python-cython))
2130 `(#:imported-modules ((guix build python-build-system)
2131 ,@%cmake-build-system-modules)
2132 #:modules (((guix build python-build-system)
2133 #:select (python-version site-packages))
2134 (guix build cmake-build-system)
2137 '("-DBUILD_INTERFACE_C=ON"
2138 "-DBUILD_INTERFACE_PYTHON=ON"
2141 (modify-phases %standard-phases
2142 (add-after 'unpack 'fix-sources-for-build
2143 (lambda* (#:key outputs #:allow-other-keys)
2144 (substitute* "CMakeLists.txt"
2145 ;; CMAKE_INSTALL_PREFIX is accidentally hardcoded.
2146 (("set\\(CMAKE_INSTALL_PREFIX .* FORCE\\)") "")
2147 ;; Requiring GCC version 8 or later is unwarranted.
2148 (("message\\(FATAL_ERROR \"GCC version < 8")
2149 "message(STATUS \"GCC version < 8"))
2151 (let ((out (assoc-ref outputs "out")))
2152 (substitute* "interfaces/PyNomad/CMakeLists.txt"
2153 ;; We don't want to build in-place, and anyway the install
2154 ;; command further below runs build_ext as a prerequisite.
2155 (("COMMAND python setup_PyNomad\\.py .* build_ext --inplace\n")
2157 ;; Don't install locally.
2158 (("COMMAND python (setup_PyNomad\\.py .* install) --user\n"
2160 (string-append "COMMAND ${CMAKE_COMMAND} -E env"
2161 " CC=" ,(cc-for-target)
2162 " CXX=" ,(cxx-for-target)
2163 " " (which "python")
2167 ;; Fix erroneous assumptions about the paths of the include and
2168 ;; library directories.
2169 (substitute* "interfaces/PyNomad/setup_PyNomad.py"
2170 (("^( +os_include_dirs = ).*" _ prefix)
2171 (string-append prefix "[\"../../src\"]\n"))
2172 (("^(installed_lib_dir1 = ).*" _ prefix)
2173 (string-append prefix "\"" out "/lib\"\n"))
2174 (("^installed_lib_dir2 = .*") "")
2175 (("^ +link_args\\.append\\(\"-Wl,-rpath,\" \\+ installed_lib_dir2\\)\n")
2178 ;; Fix the tests so they run in out-of-source builds.
2180 ;; TODO: Add support for examples/basic/batch/single_obj_MPIparallel,
2181 ;; by adding openmpi to native-inputs and adjusting the example's
2182 ;; BB_EXE parameter.
2183 (add-after 'fix-sources-for-build 'fix-sources-for-tests
2185 (substitute* "examples/CMakeLists.txt"
2186 ;; This test passes only sometimes.
2187 ;; See https://github.com/bbopt/nomad/issues/72.
2188 (("^ +add_subdirectory\\(\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/advanced/library/PSDMads\\)\n")
2190 ;; examples/basic/batch/example3 is accidentally omitted.
2191 (("^(add_subdirectory\\(\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/basic/batch/example)2(\\)\n)"
2193 (string-append prefix "2" suffix
2196 ;; The generated runExampleTest.sh script runs the test as part
2197 ;; of a pipeline and incorrectly (because pipefail is unset)
2198 ;; relies on the value of the exit status immediately after the
2200 ;; (The patch-shebangs phase runs later than this one, so no
2201 ;; need to update the path to bash here.)
2202 (("#!/bin/bash") "#!/bin/bash\nset -o pipefail"))
2205 (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
2207 (map (lambda (d) (string-append "basic/library/" d))
2208 '("example1" "example2" "example3"
2209 "single_obj_parallel"))
2210 (map (lambda (d) (string-append "advanced/library/" d))
2211 '("FixedVariable" "NMonly" "PSDMads" "Restart"
2212 "c_api/example1" "c_api/example2"
2213 "exampleSuggestAndObserve"))))
2214 ;; The runExampleTest.sh script is run with WORKING_DIRECTORY
2215 ;; set to CMAKE_CURRENT_SOURCE_DIR.
2216 ;; Other scripts invoked by that script (for example
2217 ;; examples/advanced/batch/SuggestAndObserve/loopSuggestAndObserve.sh)
2218 ;; are in that same directory, but compiled examples are
2219 ;; located in CMAKE_CURRENT_BINARY_DIR.
2220 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
2222 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
2224 ;; The examples/basic/batch/example3 executable is already named
2226 (substitute* "examples/basic/batch/single_obj_parallel/CMakeLists.txt"
2227 (("bb3.exe") "bb_parallel.exe"))
2229 ;; (Unrelated to support for out-of-source testing.)
2231 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
2233 (let ((builddir (string-append (getcwd) "/../build")))
2234 (let ((dir "examples/advanced/library/FixedVariable"))
2235 (substitute* (string-append dir "/fixedVariable.cpp")
2236 (("^( +std::string sExe = ).*" _ prefix)
2237 (string-append prefix "\"" builddir "/" dir "/ufl.exe" "\";\n"))))
2239 ;; The BB_EXE and SURROGATE_EXE paths are interpreted relative
2240 ;; to the configuration file provided to NOMAD.
2241 ;; However, the configuration files are all in the source tree
2242 ;; rather than in the build tree (unlike the compiled
2244 (let ((fix-exe-path (lambda* (dir #:optional
2247 (substitute* (string-append dir "/" file)
2248 (((string-append "^" exe-opt " +"))
2249 ;; The $ prevents NOMAD from prefixing
2250 ;; the executable with the path of the
2251 ;; parent directory of the configuration
2252 ;; file NOMAD was provided with as
2253 ;; argument (param.txt or some such).
2254 (string-append exe-opt " $"
2255 builddir "/" dir "/"))))))
2258 (let ((dir (string-append "examples/" dir)))
2259 (substitute* (string-append dir "/CMakeLists.txt")
2260 ;; The install phase has not yet run.
2261 (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
2262 "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
2264 (when (equal? dir "examples/basic/batch/surrogate_sort")
2265 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
2266 (append (map (lambda (d) (string-append "basic/batch/" d))
2267 '("example1" "example2" "example3"
2269 "single_obj_parallel"
2270 ;; "single_obj_MPIparallel"
2272 '("advanced/batch/LHonly")))
2274 (let ((dir "examples/advanced/batch/FixedVariable"))
2275 (substitute* (string-append dir "/runFixed.sh")
2276 ;; Hardcoded path to NOMAD executable.
2277 (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
2278 (string-append builddir "/src/nomad ")))
2280 (lambda (f) (fix-exe-path dir f))
2281 '("param1.txt" "param2.txt" "param3.txt" "param10.txt")))))))
2283 ;; The information in the .egg-info file is not kept up to date.
2284 (add-after 'install 'delete-superfluous-egg-info
2285 (lambda* (#:key inputs outputs #:allow-other-keys)
2286 (delete-file (string-append
2287 (site-packages inputs outputs)
2289 (python-version (assoc-ref inputs "python"))
2291 (home-page "https://www.gerad.ca/nomad/")
2292 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
2294 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
2295 algorithm, designed for difficult blackbox optimization problems. These
2296 problems occur when the functions defining the objective and constraints are
2297 the result of costly computer simulations.")
2298 (license license:lgpl3+)))
2306 (uri (string-append "https://www.coin-or.org/download/source/"
2307 "Cbc/Cbc-" version ".tgz"))
2310 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
2311 (modules '((guix build utils)))
2313 ;; Make sure we don't use the bundled software.
2314 '(delete-file-recursively "ThirdParty"))))
2315 (build-system gnu-build-system)
2317 (list gfortran pkg-config))
2320 (home-page "https://www.coin-or.org")
2321 (synopsis "Branch-and-cut solver")
2323 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
2324 solver written in C++. It can be used as a library or as a standalone
2326 (license license:epl1.0)))
2334 (uri (string-append "https://www.coin-or.org/download/source/"
2335 "Clp/Clp-" version ".tgz"))
2338 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
2339 (modules '((guix build utils)))
2341 ;; Make sure we don't use the bundled software.
2343 (delete-file-recursively "ThirdParty")
2345 (build-system gnu-build-system)
2347 (list gfortran pkg-config))
2350 (home-page "https://www.coin-or.org")
2351 (synopsis "Linear programming solver")
2353 "CLP is a high quality linear programming solver. Its main strengths are
2354 its dual and primal Simplex algorithms. It also has a barrier algorithm for
2355 linear and quadratic objectives. There are limited facilities for nonlinear
2356 and quadratic objectives using the Simplex algorithm.")
2357 (license license:epl1.0)))
2359 (define-public gecode
2366 (url "https://github.com/Gecode/gecode")
2367 (commit (string-append "release-" version))))
2368 (file-name (git-file-name name version))
2371 "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
2372 (modules '((guix build utils)))
2375 ;; delete generated sources
2376 (for-each delete-file
2377 '("gecode/kernel/var-imp.hpp"
2378 "gecode/kernel/var-type.hpp"))))))
2379 (outputs '("out" "examples"))
2380 (build-system gnu-build-system)
2383 (list (string-append "GLDFLAGS=-Wl,-rpath="
2384 (assoc-ref %outputs "out")
2386 "--enable-examples=no")
2387 #:modules ((guix build gnu-build-system)
2392 (modify-phases %standard-phases
2393 (add-after 'build 'build-examples
2394 (lambda* (#:key outputs #:allow-other-keys)
2395 (invoke "make" "compileexamples")))
2396 ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
2397 ;; patch it ourselves... *sigh*
2398 (add-after 'install 'fix-rpath
2399 (lambda* (#:key outputs #:allow-other-keys)
2400 (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
2403 (let* ((pipe (open-pipe* OPEN_READ "patchelf"
2404 "--print-rpath" file))
2405 (line (read-line pipe)))
2406 (and (zero? (close-pipe pipe))
2407 (invoke "patchelf" "--set-rpath"
2408 (string-append libdir ":" line)
2410 (find-files libdir ".*\\.so$")))))
2411 (add-after 'install 'install-examples
2412 (lambda* (#:key outputs #:allow-other-keys)
2413 (invoke "make" "installexamples"
2414 (string-append "bindir=" (assoc-ref outputs "examples")
2416 ;; Tests depend on installed libraries.
2418 (add-after 'fix-rpath 'check
2419 (assoc-ref %standard-phases 'check)))))
2421 (list patchelf perl sed))
2422 (home-page "https://www.gecode.org")
2423 (synopsis "Toolkit for developing constraint-based systems")
2424 (description "Gecode is a C++ toolkit for developing constraint-based
2425 systems and applications. It provides a modular and extensible solver.")
2426 (license license:expat)))
2428 (define-public libflame
2432 (outputs '("out" "static"))
2437 (url "https://github.com/flame/libflame")
2439 (file-name (git-file-name name version))
2442 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
2443 (build-system gnu-build-system)
2446 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
2447 (list "--enable-dynamic-build"
2448 "--enable-max-arg-list-hack"
2449 "--enable-lapack2flame"
2450 "--enable-verbose-make-output"
2451 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
2452 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
2455 '("--enable-vector-intrinsics=sse")
2457 "--enable-supermatrix"
2458 "--enable-memory-alignment=16"
2459 "--enable-ldim-alignment")
2461 (modify-phases %standard-phases
2462 (add-after 'unpack 'patch-/usr/bin/env-bash
2464 (substitute* "build/config.mk.in"
2465 (("/usr/bin/env bash") (which "bash")))
2468 (lambda* (#:key tests? #:allow-other-keys)
2469 (substitute* "test/Makefile"
2470 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
2471 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
2473 (with-directory-excursion "test"
2476 (invoke "./test_libflame.x"))
2478 (add-after 'install 'install-static
2479 (lambda* (#:key outputs #:allow-other-keys)
2480 (let ((out (assoc-ref outputs "out"))
2481 (static (assoc-ref outputs "static")))
2482 (mkdir-p (string-append static "/lib"))
2483 (rename-file (string-append out "/lib/libflame.a")
2484 (string-append static "/lib/libflame.a"))
2485 (install-file (string-append out "/include/FLAME.h")
2486 (string-append static "/include"))
2491 `(("lapack" ,lapack)
2492 ("openblas" ,openblas)
2494 ("python" ,python-wrapper)))
2495 (home-page "https://github.com/flame/libflame")
2496 (synopsis "High-performance object-based library for DLA computations")
2497 (description "@code{libflame} is a portable library for dense matrix
2498 computations, providing much of the functionality present in LAPACK, developed
2499 by current and former members of the @acronym{SHPC, Science of High-Performance
2500 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
2501 Computational Engineering and Sciences} at The University of Texas at Austin.
2502 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
2503 includes a complete LAPACK implementation.")
2504 (license license:bsd-3)))
2506 (define-public libpotassco
2507 ;; No public release, update together with clasp
2508 (let ((revision "1")
2509 (commit "2f9fb7ca2c202f1b47643aa414054f2f4f9c1821"))
2511 (name "libpotassco")
2512 (version (git-version "0.0" revision commit))
2516 (url "https://github.com/potassco/libpotassco")
2518 (file-name (git-file-name name version))
2521 "1c32f9gqclf7qx07lpx8wd720vfhkjqhzc6nyy8mjmgwpmb3iyyn"))))
2523 `(#:configure-flags '("-DLIB_POTASSCO_BUILD_TESTS=on"
2524 "-DLIB_POTASSCO_INSTALL_LIB=on"
2525 "-DBUILD_SHARED_LIBS=on")
2527 (modify-phases %standard-phases
2528 (add-after 'unpack 'patch-cmake
2530 (substitute* "CMakeLists.txt"
2531 ;; clasp expects lowercase potassco and include directory is
2532 ;; lowercase as well, so let's use that
2533 (("\"cmake/Potassco\"") "\"cmake/potassco\"")
2534 (("PotasscoConfig\\.cmake") "potassco-config.cmake")
2535 (("PotasscoConfigVersion\\.cmake")
2536 "potassco-config-version.cmake"))
2537 (rename-file "cmake/PotasscoConfig.cmake.in"
2538 "cmake/potassco-config.cmake.in"))))))
2539 (build-system cmake-build-system)
2540 (home-page "https://potassco.org/")
2541 (synopsis "Utility library for Potassco's projects")
2542 (description "@code{libpotassco} is a utility library providing functions
2545 @item parsing, writing, and converting logic programs in aspif and smodels
2547 @item passing information between a grounder and a solver,
2548 @item and defining and parsing command-line options and for creating
2549 command-line applications.
2551 Furthermore, it comes with the tool @command{lpconvert} that converts either
2552 between aspif and smodels format or to a human-readable text format.")
2553 (license license:expat))))
2555 (define-public clasp
2562 (url "https://github.com/potassco/clasp")
2563 (commit (string-append "v" version))))
2564 (file-name (git-file-name name version))
2567 "0rahqiq530jckvx717858h1q5p8znp1kb6sjm95p8blkr4n3pvmj"))))
2568 (build-system cmake-build-system)
2570 `(#:configure-flags '("-DCLASP_BUILD_TESTS=on"
2571 "-DCLASP_INSTALL_LIB=on"
2572 "-DCLASP_USE_LOCAL_LIB_POTASSCO=off"
2573 "-DBUILD_SHARED_LIBS=on")
2575 (modify-phases %standard-phases
2576 (add-after 'unpack 'patch-cmake
2578 (substitute* "CMakeLists.txt"
2579 ;; Use lowercase to be consistent with libpotassco
2580 (("\"cmake/Clasp\"") "\"cmake/clasp\"")
2581 (("ClaspConfig\\.cmake") "clasp-config.cmake")
2582 (("ClaspConfigVersion\\.cmake")
2583 "clasp-config-version.cmake"))
2584 (substitute* "cmake/ClaspConfig.cmake.in"
2585 (("find_package\\(Potassco") "find_package(potassco"))
2586 (rename-file "cmake/ClaspConfig.cmake.in"
2587 "cmake/clasp-config.cmake.in"))))))
2590 (home-page "https://potassco.org/")
2591 (synopsis "Answer set solver")
2592 (description "clasp is an answer set solver for (extended) normal and
2593 disjunctive logic programs. The primary algorithm of clasp relies on
2594 conflict-driven nogood learning, a technique that proved very successful for
2595 satisfiability checking (SAT).")
2596 (license license:expat)))
2598 (define-public clingo
2605 (url "https://github.com/potassco/clingo")
2606 (commit (string-append "v" version))))
2607 (file-name (git-file-name name version))
2610 "0rfjwkcwm0mmf3r4i7asyjwb6cia4i7px7fn2kdbi9j85qvas4pb"))))
2611 (build-system cmake-build-system)
2613 `(#:configure-flags `("-DCLINGO_BUILD_TESTS=on"
2614 "-DCLINGO_INSTALL_LIB=on"
2615 "-DCLINGO_BUILD_STATIC=off"
2616 "-DCLINGO_BUILD_SHARED=on"
2617 ;; XXX: Clingo requries private headers and
2618 ;; sources from clasp
2620 "-DCLASP_SOURCE_DIR="
2621 (assoc-ref %build-inputs "clasp-src")))
2623 (modify-phases %standard-phases
2624 (add-after 'unpack 'patch-cmake
2626 (substitute* "CMakeLists.txt"
2627 (("add_subdirectory\\(clasp\\)")
2628 "find_package(clasp REQUIRED)"))
2629 (substitute* "libclingo/CMakeLists.txt"
2630 (("\"cmake/Clingo\"") "\"cmake/clingo\"")
2631 (("ClingoConfig\\.cmake") "clingo-config.cmake")
2632 (("ClingoConfigVersion\\.cmake")
2633 "clingo-config-version.cmake"))
2634 (substitute* "cmake/ClingoConfig.cmake.in"
2635 (("find_package\\(Clasp") "find_package(clasp"))
2636 (rename-file "cmake/ClingoConfig.cmake.in"
2637 "cmake/clingo-config.cmake.in")))
2638 (add-after 'unpack 'skip-failing-tests
2640 (with-directory-excursion "libclingo/tests"
2641 (substitute* "CMakeLists.txt"
2642 (("COMMAND test_clingo" all)
2645 "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\"")))
2646 (call-with-output-file "good.txt"
2648 (for-each (lambda (test) (format port "~s~%" test))
2649 '("parse-ast-v2" "add-ast-v2" "build-ast-v2"
2650 "unpool-ast-v2" "parse_term"
2651 "propagator" "propgator-sequence-mining"
2652 "symbol" "visitor"))))))))))
2654 (list clasp libpotassco))
2656 `(("clasp-src" ,(package-source clasp))))
2657 (home-page "https://potassco.org/")
2658 (synopsis "Grounder and solver for logic programs")
2659 (description "Clingo computes answer sets for a given logic program.")
2660 (license license:expat)))
2662 (define-public ceres
2664 (name "ceres-solver")
2666 (home-page "http://ceres-solver.org/")
2669 (uri (string-append home-page "ceres-solver-"
2673 "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h"))))
2674 (build-system cmake-build-system)
2676 ;; TODO: Build HTML user documentation and install separately.
2677 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
2678 "-DBUILD_SHARED_LIBS=ON")
2680 #:phases (modify-phases %standard-phases
2681 (add-before 'configure 'set-library-directory
2683 ;; Install libraries to lib/, not lib64/.
2684 (substitute* "CMakeLists.txt"
2685 (("set\\(LIB_SUFFIX \"64\"\\)")
2686 "set(LIB_SUFFIX \"\")")))))))
2690 (list glog)) ;for #include <glog/glog.h>
2697 (synopsis "C++ library for solving large optimization problems")
2699 "Ceres Solver is a C++ library for modeling and solving large,
2700 complicated optimization problems. It is a feature rich, mature and
2701 performant library which has been used in production since 2010. Ceres Solver
2702 can solve two kinds of problems:
2704 @item non-linear least squares problems with bounds constraints;
2705 @item general unconstrained optimization problems.
2707 (license license:bsd-3)
2709 ;; Mark as tunable to take advantage of SIMD code in Eigen.
2710 (properties `((tunable? . #t)))))
2712 (define-public ceres-solver-benchmarks
2715 (name "ceres-solver-benchmarks")
2717 '(#:modules ((ice-9 popen)
2720 (guix build cmake-build-system))
2722 #:phases (modify-phases %standard-phases
2725 (lambda* (#:key outputs #:allow-other-keys)
2726 (let* ((out (assoc-ref outputs "out"))
2727 (bin (string-append out "/bin")))
2730 (read-line (open-pipe* OPEN_READ
2731 "pkg-config" "eigen3"
2734 (define (compile-file top-dir)
2736 (let ((source (string-append file ".cc")))
2737 (format #t "building '~a'...~%" file)
2738 (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG"
2739 source "-lceres" "-lbenchmark" "-lglog"
2741 "-o" (string-append bin "/" file)
2742 "-I" top-dir flags))))
2745 (with-directory-excursion "internal/ceres"
2746 (for-each (compile-file "..")
2747 '("schur_eliminator_benchmark"
2748 "small_blas_gemm_benchmark"
2749 "small_blas_gemv_benchmark"))
2750 (with-directory-excursion "autodiff_benchmarks"
2751 ((compile-file "../..") "autodiff_benchmarks"))))))
2753 (delete 'install))))
2754 (inputs (modify-inputs (package-inputs ceres)
2755 (prepend googlebenchmark ceres)))
2756 (synopsis "Benchmarks of the Ceres optimization problem solver")))
2758 ;; For a fully featured Octave, users are strongly recommended also to install
2759 ;; the following packages: less, ghostscript, gnuplot.
2760 (define-public octave-cli
2767 (uri (string-append "mirror://gnu/octave/octave-"
2771 "0wv26nsfi6cq80np6p4av4wfrvbaflca6szajf6c60mbpdg63m1z"))))
2772 (build-system gnu-build-system)
2774 `(("alsa-lib" ,alsa-lib)
2775 ("arpack" ,arpack-ng)
2781 ("fontconfig" ,fontconfig)
2782 ("freetype" ,freetype)
2786 ("graphicsmagick" ,graphicsmagick)
2788 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2789 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2790 ;; libtiff.la instead of having to provide it here.
2791 ("libjpeg" ,libjpeg-turbo)
2795 ("libsndfile" ,libsndfile)
2799 ("portaudio" ,portaudio)
2801 ("readline" ,readline)
2802 ("suitesparse" ,suitesparse)
2803 ("texinfo" ,texinfo)
2809 ;; The following inputs are not actually used in the build process.
2810 ;; However, the ./configure gratuitously tests for their existence and
2811 ;; assumes that programs not present at build time are also not, and
2812 ;; can never be, available at run time! If these inputs are therefore
2813 ;; not present, support for them will be built out. However, Octave
2814 ;; will still run without them, albeit without the features they
2819 ;; Octave code uses this variable to detect directories holding multiple CA
2820 ;; certificates to verify peers with. This is required for the networking
2821 ;; functions that require encryption to work properly.
2822 (native-search-paths
2823 (list (search-path-specification
2824 (variable "CURLOPT_CAPATH")
2825 (files '("etc/ssl/certs")))))
2828 (list (string-append "--with-shell="
2829 (assoc-ref %build-inputs "bash")
2832 ;; XXX: Without this flag, linking octave-cli fails with
2833 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2834 ;; not pulling in liboctinterp.la for -lstdc++.
2835 "--enable-link-all-dependencies")
2837 (modify-phases %standard-phases
2838 (add-after 'configure 'configure-makeinfo
2839 (lambda* (#:key inputs #:allow-other-keys)
2840 (substitute* "libinterp/corefcn/help.h"
2843 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2845 (home-page "https://www.gnu.org/software/octave/")
2846 (synopsis "High-level language for numerical computation (no GUI)")
2847 (description "GNU Octave is a high-level interpreted language that is
2848 specialized for numerical computations. It can be used for both linear and
2849 non-linear applications and it provides great support for visualizing results.
2850 Work may be performed both at the interactive command-line as well as via
2852 (license license:gpl3+)))
2854 (define-public octave
2855 (package (inherit octave-cli)
2858 `(("qscintilla" ,qscintilla)
2860 ,@(package-inputs octave-cli)))
2862 `(("qttools-5" , qttools-5) ;for lrelease
2863 ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
2864 ,@(package-native-inputs octave-cli)))
2866 (substitute-keyword-arguments (package-arguments octave-cli)
2868 `(modify-phases ,phases
2869 (add-before 'configure 'patch-qscintilla-library-name
2870 (lambda* (#:key inputs #:allow-other-keys)
2871 ;; The QScintilla library that the Octave configure script tries
2872 ;; to link with should be named libqscintilla-qt5.so, but the
2873 ;; QScintilla input provides the shared library as
2874 ;; libqscintilla2_qt5.so.
2875 (substitute* "configure"
2876 (("qscintilla2-qt5")
2879 (synopsis "High-level language for numerical computation (with GUI)")))
2881 (define-public opencascade-oce
2883 (name "opencascade-oce")
2889 (url "https://github.com/tpaviot/oce")
2890 (commit (string-append "OCE-" version))))
2891 (file-name (git-file-name name version))
2892 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2894 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2895 (build-system cmake-build-system)
2898 (list "-DOCE_TESTING:BOOL=ON"
2899 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2900 "-DOCE_DRAW:BOOL=ON"
2901 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2902 (assoc-ref %outputs "out"))
2903 "-UCMAKE_INSTALL_RPATH")))
2912 `(("python" ,python-wrapper)))
2913 (home-page "https://github.com/tpaviot/oce")
2914 (synopsis "Libraries for 3D modeling and numerical simulation")
2916 "Open CASCADE is a set of libraries for the development of applications
2917 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2918 C++ class libraries providing services for 3D surface and solid modeling, CAD
2919 data exchange, and visualization. It is used for development of specialized
2920 software dealing with 3D models in design (CAD), manufacturing (CAM),
2921 numerical simulation (CAE), measurement equipment (CMM), and quality
2922 control (CAQ) domains.
2924 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2925 patches, improvements, and experiments contributed by users over the official
2926 Open CASCADE library.")
2927 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2928 ; use of header files; see
2929 ; OCCT_LGPL_EXCEPTION.txt
2930 license:public-domain; files
2931 ; src/Standard/Standard_StdAllocator.hxx and
2932 ; src/NCollection/NCollection_StdAllocator.hxx
2933 license:expat; file src/OpenGl/OpenGl_glext.h
2934 license:bsd-3)))); test framework gtest
2936 (define-public opencascade-occt
2938 (name "opencascade-occt")
2944 (url "https://git.dev.opencascade.org/repos/occt.git")
2947 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2949 (file-name (git-file-name name version))
2951 (base32 "1rcwm9fkx0j4wrsyikb6g7qd611kpry7dand5dzdjvs5vzd13zvd"))
2952 (modules '((guix build utils)))
2955 ;; Remove files specific to non-free operating systems.
2956 (delete-file-recursively "samples/ios")
2957 (delete-file-recursively "samples/mfc")
2958 (delete-file-recursively "samples/qt/FuncDemo")
2959 (delete-file "genconf.bat")
2960 (delete-file "gendoc.bat")
2961 (delete-file "genproj.bat")
2962 (delete-file "upgrade.bat")
2963 ;; Remove references to deleted files.
2964 (substitute* "dox/FILES_HTML.txt"
2965 ((".*standard.*") "" )
2966 ((".*UIKitSample.*") ""))
2968 (build-system cmake-build-system)
2970 '(;; There is no test target for make. OCCT provides an
2971 ;; 'Automated Testing System', which may be accessed after
2972 ;; installation via the draw.sh script. draw.sh is located in
2973 ;; the bin directory. For details see:
2974 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2975 ;; occt_dev_guides__tests.html
2977 ;; Configure without freeimage: attempting to link against the
2978 ;; freeimage version 3.17 library leads to 'undefined
2979 ;; reference' errors.
2981 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2983 "-DUSE_VTK:BOOL=OFF"
2984 "-DBUILD_DOC_Overview:BOOL=OFF"
2985 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2986 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2987 "-UCMAKE_INSTALL_LIBDIR")))
2988 (native-inputs (list fontconfig))
2991 ;("freeimage" ,freeimage)
3001 ;; TODO: build Overview documentation and add 'doc' output.
3002 (home-page "https://www.opencascade.com")
3003 (synopsis "Libraries for 3D modeling and numerical simulation")
3005 "Open CASCADE is a set of libraries for the development of applications
3006 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
3007 C++ class libraries providing services for 3D surface and solid modeling, CAD
3008 data exchange, and visualization. It is used for development of specialized
3009 software dealing with 3D models in design (CAD), manufacturing (CAM),
3010 numerical simulation (CAE), measurement equipment (CMM), and quality
3011 control (CAQ) domains.
3013 This is the certified version of the Open Cascade Technology (OCCT) library.")
3014 (license (list ;; OCCT library:
3015 license:lgpl2.1; with an exception for the use of header
3016 ; files, see OCCT_LGPL_EXCEPTION.txt.
3017 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
3018 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
3020 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
3021 ;; src/StepFile/step.tab.*:
3022 license:gpl3+ ; with Bison 2.2 exception.
3023 ;; File src/NCollection/NCollection_UtfIterator.lxx:
3024 (license:non-copyleft
3025 "https://www.unicode.org/license.html")
3026 ;; File src/NCollection/NCollection_StdAllocator.hxx:
3027 license:public-domain))))
3037 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
3039 (string-append "gmsh_"
3040 (string-replace-substring version "." "_")))))
3041 (file-name (git-file-name name version))
3043 (base32 "08p39yjgf3lbnjg90skpmsq9n1a9pmwppdmy5s94dc6sq2nfr7xl"))
3044 (modules '((guix build utils)))
3046 '(delete-file-recursively "contrib/metis"))))
3047 (build-system cmake-build-system)
3065 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
3066 "-DENABLE_BUILD_SHARED:BOOL=ON"
3067 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
3068 #:imported-modules (,@%cmake-build-system-modules
3069 (guix build python-build-system))
3070 #:modules (((guix build python-build-system) #:select (site-packages))
3071 (guix build cmake-build-system)
3074 (modify-phases %standard-phases
3075 (add-after 'unpack 'patch-paths
3076 (lambda* (#:key inputs outputs #:allow-other-keys)
3077 ;; Use the standard Guix site-package path for
3078 ;; installation of the Python API.
3079 (substitute* "CMakeLists.txt"
3080 (("include\\(GNUInstallDirs\\)\n")
3081 (string-append "include(GNUInstallDirs)\n"
3083 (site-packages inputs outputs) ")\n"))
3084 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
3085 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
3086 ;; Find the shared library.
3087 (let ((libgmsh (string-append (assoc-ref outputs "out")
3088 "/lib/libgmsh.so")))
3089 (substitute* "api/gmsh.py"
3090 (("find_library\\(\"gmsh\"\\)")
3091 (simple-format #f "\"~a\"" libgmsh)))))))))
3092 (home-page "http://gmsh.info/")
3093 (synopsis "3D finite element grid generator")
3094 (description "Gmsh is a 3D finite element grid generator with a built-in
3095 CAD engine and post-processor. Its design goal is to provide a fast, light
3096 and user-friendly meshing tool with parametric input and advanced
3097 visualization capabilities. Gmsh is built around four modules: geometry,
3098 mesh, solver and post-processing. The specification of any input to these
3099 modules is done either interactively using the graphical user interface or in
3100 ASCII text files using Gmsh's own scripting language.")
3101 (license license:gpl2+)))
3103 (define-public veusz
3110 (uri (pypi-uri "veusz" version))
3112 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
3113 (build-system python-build-system)
3115 `(;; Tests will fail because they depend on optional packages like
3116 ;; python-astropy, which is not packaged.
3119 (modify-phases %standard-phases
3120 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
3121 ;; the path is defined in Guix, therefore we have to change it.
3122 (add-after 'unpack 'fix-sip-dir
3124 (substitute* "pyqtdistutils.py"
3125 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
3127 ;; Now we have to pass the correct sip_dir to setup.py.
3129 (lambda* (#:key inputs #:allow-other-keys)
3130 ;; We need to tell setup.py where to locate QtCoremod.sip
3131 ((@@ (guix build python-build-system) call-setuppy)
3133 (list (string-append "--sip-dir="
3134 (assoc-ref inputs "python-pyqt")
3137 ;; Ensure that icons are found at runtime.
3138 (add-after 'install 'wrap-executable
3139 (lambda* (#:key inputs outputs #:allow-other-keys)
3140 (let ((out (assoc-ref outputs "out")))
3141 (wrap-program (string-append out "/bin/veusz")
3142 `("QT_PLUGIN_PATH" prefix
3143 ,(list (string-append (assoc-ref inputs "qtsvg")
3144 "/lib/qt5/plugins/"))))))))))
3147 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
3148 qttools-5 python-sip-4))
3150 (list ghostscript ;optional, for EPS/PS output
3152 python-h5py ;optional, for HDF5 data
3157 (list python-numpy))
3158 (home-page "https://veusz.github.io/")
3159 (synopsis "Scientific plotting package")
3161 "Veusz is a scientific plotting and graphing program with a graphical
3162 user interface, designed to produce publication-ready 2D and 3D plots. In
3163 addition it can be used as a module in Python for plotting. It supports
3164 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
3165 (license license:gpl2+)))
3167 (define-public maxflow
3170 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
3171 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
3176 (url "https://github.com/gerddie/maxflow")
3178 (file-name (git-file-name name version))
3181 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
3182 (build-system cmake-build-system)
3183 (home-page "https://pub.ist.ac.at/~vnk/software.html")
3184 (synopsis "Library implementing Maxflow algorithm")
3185 (description "An implementation of the maxflow algorithm described in
3186 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
3187 Energy Minimization in Computer Vision.\n
3188 Yuri Boykov and Vladimir Kolmogorov.\n
3189 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
3191 (license license:gpl3+)))
3193 (define-public petsc
3200 ;; The *-lite-* tarball does not contain the *large* documentation
3201 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
3202 "petsc-lite-" version ".tar.gz"))
3204 (base32 "0sm03vpg010q9icidiq587n325m0598cj6hab2rdv85nwyygg74h"))))
3205 (outputs '("out" ; libraries and headers
3206 "examples")) ; ~30MiB of examples
3207 (build-system gnu-build-system)
3209 (list python which))
3211 (list gfortran openblas superlu
3212 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
3213 ;; leaving out opengl, as configuration seems to only be for mac
3217 #:test-target "test"
3218 #:parallel-build? #f ; build is parallel by default
3220 #~(list "--with-mpi=0"
3223 (string-append "--with-openblas-dir="
3224 #$(this-package-input "openblas"))
3227 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
3228 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
3229 #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
3231 #~(modify-phases %standard-phases
3233 ;; PETSc's configure script is actually a python script, so we can't
3234 ;; run it with bash.
3235 (lambda* (#:key outputs (configure-flags '())
3237 (let* ((prefix (assoc-ref outputs "out"))
3238 (flags `(,(string-append "--prefix=" prefix)
3239 ,@configure-flags)))
3240 (format #t "build directory: ~s~%" (getcwd))
3241 (format #t "configure flags: ~s~%" flags)
3242 (apply invoke "./configure" flags)
3244 ;; Generate test scripts with the right shebang.
3245 (substitute* "config/example_template.py"
3246 (("#!/usr/bin/env bash")
3247 (string-append "#!" (which "bash")))))))
3248 (add-after 'configure 'clean-local-references
3249 (lambda* (#:key outputs #:allow-other-keys)
3250 (let ((out (assoc-ref outputs "out")))
3251 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
3252 ;; Prevent build directory from leaking into compiled code
3254 ;; Scrub timestamp for reproducibility
3255 ((".*Libraries compiled on.*") ""))
3256 (substitute* (find-files "." "petscvariables")
3257 ;; Do not expose build machine characteristics, set to defaults.
3258 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
3259 (("NPMAX = [:digit:]+") "NPMAX = 2")))))
3260 (add-after 'install 'clean-install
3261 ;; Try to keep installed files from leaking build directory names.
3262 (lambda* (#:key inputs outputs #:allow-other-keys)
3263 (let ((out (assoc-ref outputs "out")))
3264 (substitute* (map (lambda (file)
3265 (string-append out "/lib/petsc/conf/" file))
3266 '("petscvariables"))
3268 ;; Make compiler references point to the store
3269 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
3270 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
3271 (string-append "= " (which compiler))))
3272 ;; PETSc installs some build logs, which aren't necessary.
3273 (for-each (lambda (file)
3274 (let ((f (string-append out "/lib/petsc/conf/" file)))
3275 (when (file-exists? f)
3277 '("configure.log" "make.log" "gmake.log"
3278 "test.log" "error.log" "RDict.db"
3279 "PETScBuildInternal.cmake"
3280 ;; Once installed, should uninstall with Guix
3282 (add-after 'install 'move-examples
3283 (lambda* (#:key outputs #:allow-other-keys)
3284 (let* ((out (assoc-ref outputs "out"))
3285 (examples (assoc-ref outputs "examples"))
3286 (exdir (string-append out "/share/petsc/examples"))
3287 (exdir' (string-append examples "/share/petsc/examples")))
3288 (copy-recursively exdir exdir')
3289 (delete-file-recursively exdir)))))))
3290 (home-page "https://www.mcs.anl.gov/petsc")
3291 (synopsis "Library to solve PDEs")
3292 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
3293 data structures and routines for the scalable (parallel) solution of
3294 scientific applications modeled by partial differential equations.")
3295 (license (license:non-copyleft
3296 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
3298 (define-public petsc-complex
3301 (name "petsc-complex")
3303 (substitute-keyword-arguments (package-arguments petsc)
3304 ((#:configure-flags cf)
3305 #~(cons "--with-scalar-type=complex" #$cf))))
3306 (synopsis "Library to solve PDEs (with complex scalars)")))
3308 (define-public petsc-openmpi
3311 (name "petsc-openmpi")
3313 (modify-inputs (package-inputs petsc)
3314 (prepend hdf5-parallel-openmpi
3321 `(,pt-scotch32 "metis"))))
3323 (substitute-keyword-arguments (package-arguments petsc)
3324 ((#:configure-flags cf)
3325 #~`("--with-hypre=1"
3326 "--with-mpiexec=mpirun"
3329 "--with-scalapack=1"
3331 ,(string-append "--with-mpi-dir="
3332 #$(this-package-input "openmpi"))
3333 ,(string-append "--with-hdf5-include="
3334 #$(this-package-input "hdf5-parallel-openmpi")
3336 ,(string-append "--with-hdf5-lib="
3337 #$(this-package-input "hdf5-parallel-openmpi")
3339 ,@(delete "--with-mpi=0" #$cf)))
3341 #~(modify-phases #$phases
3342 (add-before 'configure 'adjust-pt-scotch-library-names
3344 ;; Adjust to the library name changes in Scotch 7.0.
3345 (substitute* "config/BuildSystem/config/packages/PTScotch.py"
3346 (("libptesmumps") "libesmumps")
3347 (("libptscotchparmetis") "libptscotchparmetisv3"))))
3348 (add-before 'configure 'mpi-setup
3350 (add-after 'install 'patch-header-inclusions
3351 ;; TODO: Replace with ‘patch-header-inclusions’ when (some form
3352 ;; of) https://issues.guix.gnu.org/54780#19 is merged.
3354 (substitute* (string-append #$output "/include/petsclayouthdf5.h")
3355 (("<(H5Ipublic.h)>" _ header)
3356 (format #f "<~a/include/~a>"
3357 #$(this-package-input "hdf5-parallel-openmpi")
3359 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
3361 (define-public petsc-complex-openmpi
3363 (inherit petsc-complex)
3364 (name "petsc-complex-openmpi")
3366 (modify-inputs (package-inputs petsc-complex)
3369 (substitute-keyword-arguments (package-arguments petsc-complex)
3370 ((#:configure-flags cf)
3371 #~`("--with-mpiexec=mpirun"
3372 ,(string-append "--with-mpi-dir="
3373 #$(this-package-input "openmpi"))
3374 ,@(delete "--with-mpi=0" #$cf)))
3376 #~(modify-phases #$phases
3377 (add-before 'configure 'mpi-setup
3378 #$%openmpi-setup)))))
3379 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
3381 (define-public python-petsc4py
3383 (name "python-petsc4py")
3388 (uri (pypi-uri "petsc4py" version))
3391 "0pxr6qa7p0pmpq0av29lx8lzlrdcfdzj87ynixzr8dn42y13a662"))
3392 (modules '((guix build utils)))
3395 ;; Ensure source file is regenerated in the build phase.
3396 (delete-file "src/petsc4py.PETSc.c")
3397 ;; Remove legacy GC code. See
3398 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
3399 (substitute* "src/PETSc/cyclicgc.pxi"
3400 ((".*gc_refs.*") "" )
3401 ((".*PyGC_Head.*") ""))
3403 (build-system python-build-system)
3406 (modify-phases %standard-phases
3407 (add-before 'build 'pre-build
3409 ;; Define path to PETSc installation.
3410 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3412 (add-before 'check 'mpi-setup
3415 (list python-cython))
3417 `(("petsc" ,petsc-openmpi)
3418 ("python-numpy" ,python-numpy)))
3419 (home-page "https://bitbucket.org/petsc/petsc4py/")
3420 (synopsis "Python bindings for PETSc")
3421 (description "PETSc, the Portable, Extensible Toolkit for
3422 Scientific Computation, is a suite of data structures and routines for
3423 the scalable (parallel) solution of scientific applications modeled by
3424 partial differential equations. It employs the MPI standard for all
3425 message-passing communication. @code{petsc4py} provides Python
3426 bindings to almost all functions of PETSc.")
3427 (license license:bsd-3)))
3429 (define-public python-kiwisolver
3431 (name "python-kiwisolver")
3435 (uri (pypi-uri "kiwisolver" version))
3438 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
3439 (build-system python-build-system)
3440 (home-page "https://github.com/nucleic/kiwi")
3441 (synopsis "Fast implementation of the Cassowary constraint solver")
3443 "Kiwi is an efficient C++ implementation of the Cassowary constraint
3444 solving algorithm. Kiwi has been designed from the ground up to be
3445 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
3446 Cassowary solver with typical use cases gaining a 40x improvement. Memory
3447 savings are consistently > 5x.")
3448 (license license:bsd-3)))
3450 (define-public slepc
3457 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
3461 "1ysfm77s5fcissv3q0k5d65mlp93zi4anqg62q3cd25dn66sva5i"))))
3462 (build-system gnu-build-system)
3464 `(("python" ,python)
3466 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
3468 `(("arpack" ,arpack-ng)
3469 ("gfortran" ,gfortran)))
3473 `(#:parallel-build? #f ;build is parallel by default
3475 `(,(string-append "--with-arpack-dir="
3476 (assoc-ref %build-inputs "arpack") "/lib"))
3477 #:make-flags ;honor (parallel-job-count)
3478 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
3479 ,(string-append "PETSCCONFIGDIR="
3480 (assoc-ref %build-inputs "petsc:examples")
3481 "/share/petsc/examples/config"))
3483 (modify-phases %standard-phases
3485 ;; configure is a python script, so we can't run it with bash.
3486 (lambda* (#:key inputs outputs (configure-flags '())
3488 (let* ((prefix (assoc-ref outputs "out"))
3489 (flags `(,(string-append "--prefix=" prefix)
3490 ,@configure-flags)))
3491 (format #t "build directory: ~s~%" (getcwd))
3492 (format #t "configure flags: ~s~%" flags)
3493 (setenv "SLEPC_DIR" (getcwd))
3494 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
3495 (apply invoke "./configure" flags))))
3496 (add-after 'install 'delete-doc
3497 ;; TODO: SLEPc installs HTML documentation alongside headers in
3498 ;; $out/include. We'd like to move them to share/doc, but delete
3499 ;; them for now, as they are incomplete and installing the complete
3500 ;; documentation is difficult.
3501 (lambda* (#:key outputs #:allow-other-keys)
3502 (let* ((out (assoc-ref outputs "out")))
3503 (for-each delete-file (find-files out "\\.html$"))
3505 (add-after 'install 'clean-install
3506 ;; Clean up unnecessary build logs from installation.
3507 (lambda* (#:key outputs #:allow-other-keys)
3508 (let ((out (assoc-ref outputs "out")))
3509 (for-each (lambda (file)
3510 (let ((f (string-append out "/lib/slepc/conf/" file)))
3511 (when (file-exists? f)
3513 '("configure.log" "make.log" "gmake.log"
3514 "test.log" "error.log" "RDict.db"
3517 (home-page "https://slepc.upv.es")
3518 (synopsis "Scalable library for eigenproblems")
3519 (description "SLEPc is a software library for the solution of large sparse
3520 eigenproblems on parallel computers. It can be used for the solution of
3521 linear eigenvalue problems formulated in either standard or generalized form,
3522 as well as other related problems such as the singular value decomposition.
3523 The emphasis of the software is on methods and techniques appropriate for
3524 problems in which the associated matrices are sparse, for example, those
3525 arising after the discretization of partial differential equations.")
3526 (license license:bsd-2)
3528 `((release-monitoring-url . "http://slepc.upv.es/download/")))))
3530 (define-public slepc-complex
3531 (package (inherit slepc)
3532 (name "slepc-complex")
3534 `(("petsc" ,petsc-complex)
3535 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3536 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
3538 (define-public slepc-openmpi
3539 (package (inherit slepc)
3540 (name "slepc-openmpi")
3542 (substitute-keyword-arguments (package-arguments slepc)
3543 ((#:phases phases '%standard-phases)
3544 `(modify-phases ,phases
3545 (add-before 'check 'mpi-setup
3546 ,%openmpi-setup)))))
3549 ,@(alist-delete "arpack" (package-inputs slepc))))
3551 `(("petsc" ,petsc-openmpi)
3552 ("arpack" ,arpack-ng-openmpi)
3553 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3554 (synopsis "Scalable library for eigenproblems (with MPI support)")))
3556 (define-public slepc-complex-openmpi
3557 (package (inherit slepc-openmpi)
3558 (name "slepc-complex-openmpi")
3560 `(("petsc" ,petsc-complex-openmpi)
3561 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
3562 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
3564 (define-public python-slepc4py
3566 (name "python-slepc4py")
3571 (uri (pypi-uri "slepc4py" version))
3574 "0fq997y73ymvcvdrxycp450pxwdgnqaw62gv9rwncfgsfplkvs9w"))))
3575 (build-system python-build-system)
3578 (modify-phases %standard-phases
3579 (add-before 'build 'pre-build
3581 ;; Define path to PETSc installation.
3582 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3583 ;; Define path to SLEPc installation.
3584 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3586 (add-before 'check 'mpi-setup
3589 `(("python-numpy" ,python-numpy)
3590 ("python-petsc4py" ,python-petsc4py)
3591 ("slepc" ,slepc-openmpi)))
3592 (home-page "https://bitbucket.org/slepc/slepc4py/")
3593 (synopsis "Python bindings for SLEPc")
3594 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3595 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3596 Scientific Computation. It employs the MPI standard for all
3597 message-passing communication. @code{slepc4py} provides Python
3598 bindings to almost all functions of SLEPc.")
3599 (license license:bsd-3)))
3601 (define-public metamath
3609 (url "https://github.com/metamath/metamath-exe")
3610 (commit (string-append "v" version))))
3611 (file-name (git-file-name name version))
3613 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3614 (build-system gnu-build-system)
3616 (list autoconf automake))
3617 (home-page "http://us.metamath.org/")
3618 (synopsis "Proof verifier based on a minimalistic formalism")
3620 "Metamath is a tiny formal language and that can express theorems in
3621 abstract mathematics, with an accompyaning @command{metamath} executable that
3622 verifies databases of these proofs. There is a public database,
3623 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3624 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3625 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3626 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3628 (license license:gpl2+)))
3630 (define-public minizinc
3637 (url "https://github.com/MiniZinc/libminizinc")
3639 (file-name (git-file-name name version))
3642 "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
3643 (modules '((guix build utils)
3648 ;; Do not advertise proprietary solvers
3649 (with-directory-excursion "cmake/targets"
3650 (let ((targets '("libminizinc_fzn.cmake"
3651 "libminizinc_gecode.cmake"
3652 "libminizinc_mip.cmake"
3653 "libminizinc_nl.cmake"
3654 "libminizinc_osicbc.cmake"
3655 "libminizinc_parser.cmake"
3659 (for-each delete-file
3662 (member file (cons* "." ".." targets)))
3664 (substitute* "libmzn.cmake"
3665 (("include\\(cmake/targets/(.*)\\)" all target)
3666 (if (member target targets) all "")))))
3667 (with-directory-excursion "include/minizinc/solvers/MIP"
3668 (for-each delete-file
3671 (member file '("." ".."
3672 "MIP_osicbc_solverfactory.hh"
3673 "MIP_osicbc_wrap.hh"
3674 "MIP_solverinstance.hh"
3675 "MIP_solverinstance.hpp"
3678 (with-directory-excursion "solvers/MIP"
3679 (for-each delete-file
3682 (member file '("." ".."
3683 "MIP_osicbc_solverfactory.cpp"
3684 "MIP_osicbc_wrap.cpp"
3685 "MIP_solverinstance.cpp"
3688 (substitute* "CMakeLists.txt"
3689 (("find_package\\(([^ ]*).*\\)" all pkg)
3690 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
3693 ;; TODO: swap out miniz for zlib
3695 (build-system cmake-build-system)
3697 `(#:tests? #f ; no ‘check’ target
3698 #:modules ((guix build cmake-build-system)
3702 (modify-phases %standard-phases
3703 (add-after 'install 'install-solver-configs
3704 (lambda* (#:key inputs outputs #:allow-other-keys)
3705 (let ((gecode (assoc-ref inputs "gecode"))
3706 (pkgdatadir (string-append (assoc-ref outputs "out")
3707 "/share/minizinc")))
3708 (call-with-output-file (string-append pkgdatadir
3709 "/Preferences.json")
3714 [\"\", \"org.gecode.gecode\"],
3715 [\"gecode\", \"org.gecode.gecode\"]
3717 \"solverDefaults\": []
3722 (mkdir-p (string-append pkgdatadir "/solvers"))
3723 (call-with-output-file (string-append pkgdatadir
3724 "/solvers/gecode.msc")
3729 \"id\": \"org.gecode.gecode\",
3730 \"name\": \"Gecode\",
3731 \"description\": \"Gecode FlatZinc executable\",
3735 \"supportsMzn\": false,
3736 \"supportsFzn\": true,
3737 \"needsSolns2Out\": true,
3738 \"needsMznExecutable\": false,
3739 \"needsStdlibDir\": false,
3740 \"isGUIApplication\": false
3742 (last (string-split gecode #\-))
3743 (string-append gecode "/share/gecode/mznlib")
3744 (string-append gecode "/bin/fzn-gecode"))
3745 (newline port)))))))))
3749 (list cbc gecode zlib))
3750 (home-page "https://www.minizinc.org")
3751 (synopsis "High-level constraint modeling language")
3752 (description "MiniZinc is a high-level modeling language for constraint
3753 satisfaction and optimization problems. Models are compiled to FlatZinc, a
3754 language understood by many solvers.")
3755 (license license:mpl2.0)))
3757 (define-public mumps
3764 (uri (list (string-append "http://mumps.enseeiht.fr/MUMPS_"
3767 "https://ftp.mcs.anl.gov/pub/petsc/externalpackages"
3768 "/MUMPS_" version ".tar.gz")))
3771 "05gs2i8b76m9flm1826fxpyfnwibjjawbmfza3ylrvj7zaag5gqs"))))
3772 (build-system gnu-build-system)
3775 ;; These are required for linking against mumps, but we let the user
3776 ;; declare the dependency.
3781 `(#:modules ((ice-9 match)
3784 ,@%gnu-build-system-modules)
3786 (modify-phases %standard-phases
3788 (lambda* (#:key inputs outputs #:allow-other-keys)
3789 (call-with-output-file "Makefile.inc"
3798 LIBBLAS = -Wl,-rpath=$(BLASDIR)/lib -Wl,-rpath='$$ORIGIN'
3799 LIBBLAS += -L$(BLASDIR)/lib
3800 LIBBLAS += -lopenblas~@[
3802 SCALAP = -Wl,-rpath=$(SCALAPDIR)/lib -Wl,-rpath='$$ORIGIN'
3803 SCALAP += -L$(SCALAPDIR)/lib -lscalapack~]
3808 INCSEQ = -I$(topdir)/libseq
3809 LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq
3810 LIBSEQNEEDED = libseqneeded
3817 LIBPAR = $(SCALAP) $(LAPACK)
3821 AR = ar vr # rules require trailing space, ugh...
3823 LIBOTHERS = -pthread
3827 RPATH_OPT = -Wl,-rpath,~a/lib
3828 OPTF = -O2 -fopenmp -DALLOW_NON_INIT -DBLR_MT
3829 OPTF += -fallow-argument-mismatch $(PIC)
3830 OPTL = -O2 -fopenmp $(PIC)
3831 OPTC = -O2 -fopenmp $(PIC)
3832 LPORDDIR = $(topdir)/PORD/lib
3833 IPORD = -I$(topdir)/PORD/include
3834 LPORD = $(LPORDDIR)/libpord.a
3835 ORDERINGSF = -Dpord~@[
3837 IMETIS = -I$(METISDIR)/include
3838 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3839 ORDERINGSF += -Dmetis~]~@[~:{
3841 ISCOTCH = -I$(SCOTCHDIR)/include
3842 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a -lesmumps
3843 LSCOTCH += -lscotch -lscotcherr
3844 ORDERINGSF += ~a~}~]
3845 ORDERINGSC = $(ORDERINGSF)
3846 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
3847 IORDERINGSF = $(ISCOTCH)
3848 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3849 (assoc-ref inputs "openblas")
3850 (assoc-ref inputs "scalapack")
3851 (->bool (which "mpicc")) ;; MPI support enabled?
3852 (assoc-ref outputs "out")
3853 (assoc-ref inputs "metis")
3854 (match (list (assoc-ref inputs "pt-scotch")
3855 (assoc-ref inputs "scotch"))
3859 `((,scotch "" "-Dscotch")))
3862 "-lesmumps -lptscotch -lptscotcherr "
3863 "-Dptscotch")))))))))
3865 ;; By default only the d-precision library is built. Make with "all"
3866 ;; target so that all precision libraries and examples are built.
3867 ;; Then, "make allshared" builts equivalent shared libraries as well.
3869 (invoke "make" "all"
3870 (format #f "-j~a" (parallel-job-count)))
3871 (invoke "make" "allshared"
3872 (format #f "-j~a" (parallel-job-count)))))
3874 ;; Run the simple test drivers, which read test input from stdin:
3875 ;; from the "real" input for the single- and double-precision
3876 ;; testers, and from the "cmplx" input for complex-precision
3877 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3878 ;; package to prefix execution with "mpirun".
3879 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3880 (with-directory-excursion "examples"
3883 (let ((tester (apply open-pipe*
3886 ,(string-append "./" prec
3888 (input (open-input-file
3889 (string-append "input_simpletest_" type))))
3891 (dump-port input tester)
3893 (zero? (close-pipe tester)))))
3895 '("real" "real" "cmplx" "cmplx")))))
3897 (lambda* (#:key outputs #:allow-other-keys)
3898 (let* ((out (assoc-ref outputs "out"))
3899 (libdir (string-append out "/lib")))
3900 (copy-recursively "lib" libdir)
3901 (copy-recursively "include" (string-append out "/include"))
3902 (when (file-exists? "libseq/libmpiseq.a")
3903 (install-file "libseq/libmpiseq.a" libdir))
3904 (when (file-exists? "libseq/libmpiseq.so")
3905 (install-file "libseq/libmpiseq.so" libdir))
3907 (home-page "http://mumps.enseeiht.fr")
3908 (synopsis "Multifrontal sparse direct solver")
3910 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3911 sparse system of linear equations A x = b using Gaussian elimination.")
3912 (license license:cecill-c)))
3914 (define-public mumps-metis
3917 (name "mumps-metis")
3918 (inputs (modify-inputs (package-inputs mumps)
3919 (delete "scotch")))))
3921 (define-public mumps-openmpi
3924 (name "mumps-openmpi")
3926 (modify-inputs (package-inputs mumps)
3928 (prepend openmpi scalapack pt-scotch)))
3930 (substitute-keyword-arguments (package-arguments mumps)
3932 `(modify-phases ,phases
3933 (add-before 'check 'mpi-setup
3937 ((assoc-ref ,phases 'check)
3938 #:exec-prefix '("mpirun" "-n" "2"))))))))
3939 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3941 (define-public mumps-metis-openmpi
3943 (inherit mumps-openmpi)
3944 (name "mumps-metis-openmpi")
3945 (inputs (modify-inputs (package-inputs mumps-openmpi)
3946 (delete "pt-scotch")))))
3948 (define-public ruby-asciimath
3950 (name "ruby-asciimath")
3955 (uri (rubygems-uri "asciimath" version))
3958 "1fy2jrn3gr7cl33qydp3pwyfilcmb4m4z6hfhnvydzg8r3srp36j"))))
3959 (build-system ruby-build-system)
3961 (list ruby-nokogiri ruby-rspec))
3962 (synopsis "AsciiMath parsing and conversion library")
3964 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3965 easy-to-write markup language for mathematics.")
3966 (home-page "https://github.com/asciidoctor/asciimath")
3967 (license license:expat)))
3969 (define-public superlu
3976 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3977 "superlu-" version ".tar.gz"))
3979 (base32 "0xvib7nk2rlbsiv1iwkwl9kxppkalkciv628bsyiiv0pv754n48q"))
3980 (modules '((guix build utils)))
3982 ;; Replace the non-free implementation of MC64 with a stub adapted
3985 (use-modules (ice-9 regex)
3987 (call-with-output-file "SRC/mc64ad.c"
3992 void mc64id_(int *a) {
3993 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3996 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3997 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3998 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
4001 ;; Remove the corresponding license verbiage. MC64 license follows
4002 ;; a "------" line separator.
4003 (with-atomic-file-replacement "License.txt"
4004 (let ((rx (make-regexp "-{8}")))
4007 (let ((line (read-line in 'concat)))
4008 (unless (regexp-exec rx line)
4012 (build-system cmake-build-system)
4016 `(("blas" ,openblas)
4017 ("gfortran" ,gfortran)))
4019 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
4020 "-DTPL_BLAS_LIBRARIES=openblas"
4021 "-DBUILD_SHARED_LIBS:BOOL=YES")))
4022 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
4023 (synopsis "Supernodal direct solver for sparse linear systems")
4025 "SuperLU is a general purpose library for the direct solution of large,
4026 sparse, nonsymmetric systems of linear equations on high performance machines.
4027 The library is written in C and is callable from either C or Fortran. The
4028 library routines perform an LU decomposition with partial pivoting and
4029 triangular system solves through forward and back substitution. The library
4030 also provides threshold-based ILU factorization preconditioners.")
4031 (license (list license:bsd-3
4032 license:gpl2+ ;EXAMPLE/*fgmr.c
4033 (license:fsf-free "file://SRC/colamd.h")))))
4035 (define-public superlu-dist
4037 (name "superlu-dist")
4043 (url "https://github.com/xiaoyeli/superlu_dist")
4044 (commit (string-append "v" version))))
4045 (file-name (git-file-name name version))
4047 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
4048 (modules '((guix build utils)))
4050 ;; Replace the non-free implementation of MC64 with a stub
4052 (make-file-writable "SRC/mc64ad_dist.c")
4053 (call-with-output-file "SRC/mc64ad_dist.c"
4058 void mc64id_dist(int *a) {
4059 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
4062 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
4063 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
4064 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
4067 (substitute* "SRC/util.c" ;adjust default algorithm
4068 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
4069 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
4070 ;; general (i.e. non-square) processor-grid support.
4071 "RowPerm = NOROWPERM;"))
4073 (patches (search-patches "superlu-dist-scotchmetis.patch"
4074 "superlu-dist-awpm-grid.patch"))))
4075 (build-system cmake-build-system)
4079 `(("gfortran" ,gfortran)
4082 ("combblas" ,combinatorial-blas)))
4084 `(("mpi" ,openmpi) ;headers include MPI heades
4085 ("parmetis" ,pt-scotch32 "metis")
4086 ("pt-scotch" ,pt-scotch32)))
4088 `(#:parallel-tests? #f ;tests use MPI and OpenMP
4089 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
4090 "-DTPL_ENABLE_COMBBLASLIB=YES"
4091 "-DTPL_BLAS_LIBRARIES=-lopenblas"
4092 "-DTPL_LAPACK_LIBRARIES=-llapack"
4093 (string-append "-DTPL_PARMETIS_LIBRARIES="
4095 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
4096 "scotchmetis" "scotch" "scotcherr")
4098 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
4099 (assoc-ref %build-inputs "parmetis")
4101 "-DTPL_ENABLE_COMBBLASLIB=ON"
4102 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
4103 (assoc-ref %build-inputs "combblas")
4104 "/include/CombBLAS;"
4105 (assoc-ref %build-inputs "combblas")
4106 "/include/BipartiteMatchings")
4107 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
4109 (modify-phases %standard-phases
4110 (add-before 'configure 'set-c++-standard
4112 (substitute* "CMakeLists.txt"
4113 ;; AWPM headers require C++14
4114 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
4115 (add-before 'check 'mpi-setup
4117 (add-before 'check 'omp-setup
4118 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
4119 (home-page (package-home-page superlu))
4120 (synopsis "Parallel supernodal direct solver")
4122 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
4123 It is targeted for distributed memory parallel machines. SuperLU_DIST is
4124 implemented in ANSI C, and MPI for communications.")
4125 (license license:bsd-3)))
4127 (define-public scotch
4135 (url "https://gitlab.inria.fr/scotch/scotch")
4136 (commit (string-append "v" version))))
4137 (file-name (git-file-name name version))
4139 (base32 "1fvgxd3ipl5xswswyadvxvlcgv6an8c229ispnlksgnlwphg10ig"))))
4140 (build-system cmake-build-system)
4144 (list flex bison gfortran))
4145 (outputs '("out" "metis"))
4147 `(#:configure-flags '("-DBUILD_SHARED_LIBS=YES" "-DINTSIZE=64"
4148 "-DBUILD_PTSCOTCH=OFF")
4150 (modify-phases %standard-phases
4151 (add-after 'install 'install-metis
4152 (lambda* (#:key outputs #:allow-other-keys)
4153 (let* ((out (assoc-ref outputs "out"))
4154 (metis (assoc-ref outputs "metis"))
4155 (prefix (string-length out)))
4156 (for-each (lambda (file)
4157 (let ((target (string-append
4159 (string-drop file prefix))))
4160 (mkdir-p (dirname target))
4161 (rename-file file target)))
4162 (find-files out "metis"))))))))
4163 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
4165 `((release-monitoring-url
4166 . "https://gitlab.inria.fr/scotch/scotch/-/releases")))
4167 (synopsis "Programs and libraries for graph algorithms")
4168 (description "SCOTCH is a set of programs and libraries which implement
4169 the static mapping and sparse matrix reordering algorithms developed within
4170 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
4171 conquer approach, to scientific computing problems such as graph and mesh
4172 partitioning, static mapping, and sparse matrix ordering, in application
4173 domains ranging from structural mechanics to operating systems or
4175 ;; See LICENSE_en.txt
4176 (license license:cecill-c)))
4178 (define-public scotch32
4179 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
4180 ;; some applications.
4185 (substitute-keyword-arguments (package-arguments scotch)
4186 ((#:configure-flags flags ''())
4187 ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=OFF"
4190 "Programs and libraries for graph algorithms (32-bit integers)")))
4192 (define-public pt-scotch
4197 (list openmpi)) ;headers include MPI headers
4199 (substitute-keyword-arguments (package-arguments scotch)
4200 ((#:configure-flags flags ''())
4201 ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"
4203 ((#:phases phases '%standard-phases)
4204 `(modify-phases ,phases
4205 (add-before 'check 'mpi-setup
4206 ,%openmpi-setup)))))
4207 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
4209 (define-public pt-scotch32
4212 (name "pt-scotch32")
4214 (list openmpi)) ;headers include MPI headers
4216 (substitute-keyword-arguments (package-arguments pt-scotch)
4217 ((#:configure-flags flags ''())
4218 ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"
4221 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
4223 (define-public scotch-shared
4224 ;; There used to be separate shared library variants while the default would
4225 ;; provide .a files including PIC objects. With the switch to CMake, .a
4226 ;; files contain non-PIC objects, which breaks some users, and switching to
4227 ;; shared libraries by default seems to make more sense, as discussed here:
4228 ;; <https://issues.guix.gnu.org/47619#2>.
4229 (deprecated-package "scotch-shared" scotch))
4231 (define-public pt-scotch-shared
4232 (deprecated-package "pt-scotch-shared" pt-scotch))
4235 (define-public metis
4242 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
4243 "metis-" version ".tar.gz"))
4246 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
4248 `((release-monitoring-url
4249 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
4250 (build-system cmake-build-system)
4252 `(("blas" ,openblas)))
4254 `(#:tests? #f ;no tests
4255 #:configure-flags `("-DSHARED=ON"
4256 ,(string-append "-DGKLIB_PATH=" (getcwd)
4257 "/metis-" ,version "/GKlib"))))
4258 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
4259 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
4261 "METIS is a set of serial programs for partitioning graphs, partitioning
4262 finite element meshes, and producing fill-reducing orderings for sparse
4263 matrices. The algorithms implemented in METIS are based on the multilevel
4264 recursive-bisection, multilevel k-way, and multi-constraint partitioning
4266 (license license:asl2.0))) ;As of version 5.0.3
4268 (define-public p4est
4275 (uri (string-append "http://p4est.github.io/release/p4est-"
4279 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
4280 (build-system gnu-build-system)
4282 `(("fortran" ,gfortran)
4287 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
4288 (assoc-ref %build-inputs "blas")
4290 ,(string-append "LAPACK_LIBS=-L"
4291 (assoc-ref %build-inputs "lapack")
4293 #:phases (modify-phases %standard-phases
4294 (add-before 'check 'mpi-setup
4296 (home-page "http://www.p4est.org")
4297 (synopsis "Adaptive mesh refinement on forests of octrees")
4299 "The p4est software library enables the dynamic management of a
4300 collection of adaptive octrees, conveniently called a forest of octrees.
4301 p4est is designed to work in parallel and scales to hundreds of thousands of
4303 (license license:gpl2+)))
4305 (define-public p4est-openmpi
4306 (package (inherit p4est)
4307 (name "p4est-openmpi")
4310 ,@(package-inputs p4est)))
4312 (substitute-keyword-arguments (package-arguments p4est)
4313 ((#:configure-flags cf)
4314 ``("--enable-mpi" ,@,cf))))
4315 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
4317 (define-public gsegrafix
4318 ;; This is an old and equally dead "experimental fork" of the longer-dead
4319 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
4320 ;; libraries, instead rendering plots with Pango.
4327 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
4328 "gsegrafix-experimental-" version ".tar.gz"))
4330 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
4331 (build-system gnu-build-system)
4334 (list "--disable-static")))
4339 (home-page "https://www.gnu.org/software/gsegrafix/")
4340 (synopsis "GNOME application to create scientific and engineering plots")
4342 "GSEGrafix is an application which produces high-quality graphical
4343 plots for science and engineering. Plots are specified via simple ASCII
4344 parameter files and data files and are presented in an anti-aliased GNOME
4345 canvas. The program supports rectangular two-dimensional plots, histograms,
4346 polar-axis plots and three-dimensional plots. Plots can be printed or saved
4347 to BMP, JPEG or PNG image formats.")
4348 (license license:gpl3+)))
4350 (define-public maxima
4357 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
4358 version "-source/" name "-" version ".tar.gz"))
4361 "01wbm8jj43p7gpdj4h55aij0b44bjydn4bwb7q1wjrfs91mz143k"))
4362 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
4363 (build-system gnu-build-system)
4365 `(("bash" ,bash-minimal)
4366 ("gnuplot" ,gnuplot) ;for plots
4369 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
4371 (list texinfo perl python))
4374 ,#~(list "--enable-sbcl"
4375 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
4376 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
4377 (string-append "--with-wish=" #$tk "/bin/wish"
4378 #$(version-major+minor (package-version tk))))
4379 ;; By default Maxima attempts to write temporary files to
4380 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
4381 ;; Work around that.
4382 #:make-flags (list "TMPDIR=/tmp")
4384 (modify-phases %standard-phases
4385 (add-after 'unpack 'patch-paths
4386 (lambda* (#:key inputs #:allow-other-keys)
4387 (let* ((sed (search-input-file inputs "/bin/sed"))
4388 (coreutils (assoc-ref inputs "coreutils"))
4389 (dirname (string-append coreutils "/bin/dirname"))
4390 (head (string-append coreutils "/bin/head"))
4391 (perl (search-input-file inputs "/bin/perl"))
4392 (python (search-input-file inputs "/bin/python3")))
4393 (substitute* "src/maxima.in"
4394 (("sed ") (string-append sed " "))
4395 (("dirname") dirname)
4397 (substitute* "doc/info/Makefile.in"
4398 (("/usr/bin/env perl") perl))
4399 (substitute* "doc/info/build_html.sh.in"
4400 (("python") python))
4402 (add-before 'check 'pre-check
4404 (chmod "src/maxima" #o555)
4408 ;; This is derived from the testing code in the "debian/rules" file
4409 ;; of Debian's Maxima package.
4410 ;; If Maxima can successfully run this, the binary to be installed
4416 "--batch-string=\"run_testsuite();\" "
4417 "| grep -q \"No unexpected errors found\""))))
4418 ;; Make sure the doc and emacs files are found in the
4419 ;; standard location. Also configure maxima to find gnuplot
4420 ;; without having it on the PATH.
4421 (add-after 'install 'post-install
4422 (lambda* (#:key outputs inputs #:allow-other-keys)
4423 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
4424 (out (assoc-ref outputs "out"))
4425 (datadir (string-append out "/share/maxima/" ,version))
4426 (binutils (dirname (search-input-file inputs "/bin/as"))))
4427 (with-directory-excursion out
4428 (mkdir-p "share/emacs")
4429 (mkdir-p "share/doc")
4431 (string-append datadir "/doc/")
4432 (string-append out "/share/doc/maxima"))
4433 (with-atomic-file-replacement
4434 (string-append datadir "/share/maxima-init.lisp")
4436 (format out "~a ~s~a~%"
4437 "(setf $gnuplot_command "
4438 (string-append gnuplot "/bin/gnuplot") ")")
4439 (dump-port in out))))
4440 ;; Ensure that Maxima will have access to the GNU binutils
4441 ;; components at runtime.
4442 (wrap-program (string-append out "/bin/maxima")
4443 `("PATH" prefix (,binutils))))
4445 ;; The Maxima command ‘describe’ allows picking the relevant portions
4446 ;; from Maxima’s Texinfo docs. However it does not support reading
4447 ;; gzipped info files.
4448 (delete 'compress-documentation))))
4449 (home-page "https://maxima.sourceforge.io")
4450 (synopsis "Numeric and symbolic expression manipulation")
4451 (description "Maxima is a system for the manipulation of symbolic and
4452 numerical expressions. It yields high precision numeric results by using
4453 exact fractions, arbitrary precision integers, and variable precision floating
4455 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
4456 ;; Others simply say "GNU General Public License" without stating a
4457 ;; version (which implicitly means gpl1+).
4458 ;; At least one file (src/maxima.asd) says "version 2."
4459 ;; GPLv2 only is therefore the smallest subset.
4460 (license license:gpl2)))
4462 (define-public wxmaxima
4470 (url "https://github.com/wxMaxima-developers/wxmaxima")
4471 (commit (string-append "Version-" version))))
4472 (file-name (git-file-name name version))
4474 (base32 "1va56v9dys97yln4m1z3fz3k90lpy8i3kvcq0v1cbg36689aghm5"))))
4475 (build-system cmake-build-system)
4477 `(("gettext" ,gettext-minimal)))
4486 `(#:tests? #f ; tests fail non-deterministically
4488 (modify-phases %standard-phases
4489 (add-after 'unpack 'patch-doc-path
4491 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
4492 ;; documentation. Only licensing information is placed there by
4494 (substitute* "src/Dirstructure.cpp"
4495 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
4497 (add-after 'install 'wrap-program
4498 (lambda* (#:key inputs outputs #:allow-other-keys)
4499 (wrap-program (string-append (assoc-ref outputs "out")
4502 (,(string-append (assoc-ref inputs "maxima")
4504 ;; For GtkFileChooserDialog.
4505 `("GSETTINGS_SCHEMA_DIR" =
4506 (,(string-append (assoc-ref inputs "gtk+")
4507 "/share/glib-2.0/schemas")))
4508 `("XDG_DATA_DIRS" ":" prefix
4509 (;; Needed by gdk-pixbuf to know supported icon formats.
4511 (assoc-ref inputs "shared-mime-info") "/share")
4512 ;; The default icon theme of GTK+.
4514 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
4516 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
4517 (synopsis "Graphical user interface for the Maxima computer algebra system")
4519 "wxMaxima is a graphical user interface for the Maxima computer algebra
4520 system. It eases the use of Maxima by making most of its commands available
4521 through a menu system and by providing input dialogs for commands that require
4522 more than one argument. It also implements its own display engine that
4523 outputs mathematical symbols directly instead of depicting them with ASCII
4526 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
4527 text and mathematical calculations to create documents, exporting of input and
4528 output to TeX, and a browser for Maxima's manual including command index and
4529 full text searching.")
4530 (license license:gpl2+)))
4532 (define-public armadillo
4538 (uri (string-append "mirror://sourceforge/arma/armadillo-"
4542 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
4543 (build-system cmake-build-system)
4544 (arguments `(#:tests? #f)) ; no test target
4546 `(("openblas" ,openblas)
4548 ("arpack" ,arpack-ng)))
4549 (home-page "http://arma.sourceforge.net/")
4550 (synopsis "C++ linear algebra library")
4552 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4553 between speed and ease of use. It is useful for algorithm development
4554 directly in C++, or quick conversion of research code into production
4555 environments. It can be used for machine learning, pattern recognition,
4556 signal processing, bioinformatics, statistics, econometrics, etc. The library
4557 provides efficient classes for vectors, matrices and cubes, as well as 150+
4558 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4559 (license license:asl2.0)))
4561 (define-public muparser
4562 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4563 ;; different hash. In order to make `guix package --upgrade` work correctly,
4564 ;; we set a Guix packaging revision.
4565 ;; When the next version of muparser is released, we can remove
4566 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4567 (let ((upstream-version "2.2.5")
4571 (version (string-append upstream-version "-" revision))
4576 (url "https://github.com/beltoforion/muparser")
4577 (commit (string-append "v" upstream-version))))
4578 (file-name (git-file-name name version))
4580 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4581 (build-system gnu-build-system)
4583 `(#:configure-flags '("--enable-samples=no")
4584 #:tests? #f)) ;no "check" target
4585 (home-page "http://muparser.beltoforion.de/")
4586 (synopsis "Fast parser library for mathematical expressions")
4588 "muParser is an extensible high performance math parser library. It is
4589 based on transforming an expression into a bytecode and precalculating constant
4591 (license license:expat))))
4593 (define-public openblas
4601 (url "https://github.com/xianyi/OpenBLAS")
4602 (commit (string-append "v" version))))
4603 (file-name (git-file-name name version))
4606 "0r4sz3rn68fyc2paq0a04pgfi7iszpm95f6ggbzxpvjzx9qxbcql"))))
4607 (build-system gnu-build-system)
4609 `(#:test-target "test"
4610 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4611 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4612 ;; we need to disable substitutions.
4614 ,(let ((system (or (%current-target-system) (%current-system))))
4615 (or (string-prefix? "x86_64" system)
4616 (string-prefix? "i686" system)
4617 (string-prefix? "mips" system)
4618 (string-prefix? "aarch64" system)))
4620 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4622 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4623 "NO_STATIC=1" ;avoid a 67 MiB static archive
4625 ;; This is the maximum number of threads OpenBLAS will ever use (that
4626 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4627 ;; is used.) If we don't set it, the makefile sets it to the number
4628 ;; of cores of the build machine, which is obviously wrong.
4631 ;; Build the library for all supported CPUs. This allows
4632 ;; switching CPU targets at runtime with the environment variable
4633 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4634 ;; Unfortunately, this is not supported on all architectures,
4635 ;; where it leads to failed builds.
4636 ,@(let ((system (or (%current-target-system) (%current-system))))
4638 ((or (string-prefix? "x86_64" system)
4639 (string-prefix? "i686" system)
4640 (string-prefix? "powerpc64le" system)
4641 (string-prefix? "aarch64" system))
4642 ;; Dynamic older enables a few extra CPU architectures that
4643 ;; were released before 2010.
4644 '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
4645 ;; On some of these architectures the CPU can't be detected.
4646 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4647 ;; two available MIPS targets special extended instructions
4648 ;; for Loongson cores are used.
4649 ((string-prefix? "mips" system)
4650 '("TARGET=SICORTEX"))
4651 ;; Failed to detect CPU.
4652 ((string-prefix? "armhf" system)
4654 ((string-prefix? "riscv64" system)
4655 '("TARGET=RISCV64_GENERIC"))
4657 ;; no configure script
4659 (modify-phases %standard-phases
4661 (add-before 'build 'set-extralib
4662 (lambda* (#:key inputs #:allow-other-keys)
4663 ;; Get libgfortran found when building in utest.
4668 (search-input-file inputs "/lib/libgfortran.so")))))))))
4670 (list `(,gfortran "lib")))
4672 (list cunit gfortran perl))
4673 (home-page "https://www.openblas.net/")
4674 (synopsis "Optimized BLAS library based on GotoBLAS")
4676 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4677 (license license:bsd-3)))
4679 (define-public openblas-ilp64
4680 (package/inherit openblas
4681 (name "openblas-ilp64")
4682 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4684 (substitute-keyword-arguments (package-arguments openblas)
4685 ((#:make-flags flags '())
4686 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4688 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4689 (license license:bsd-3)))
4695 (home-page "https://github.com/flame/blis")
4698 (uri (git-reference (url home-page) (commit version)))
4701 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4702 (file-name (git-file-name "blis" version))))
4705 (build-system gnu-build-system)
4708 ((guix build gnu-build-system)
4711 #:test-target "test"
4713 (modify-phases %standard-phases
4715 (lambda* (#:key outputs
4718 (configure-flags '())
4720 ;; This is a home-made 'configure' script.
4721 (let* ((out (assoc-ref outputs "out"))
4722 ;; Guix-specific support for choosing the configuration
4723 ;; via #:configure-flags: see below for details.
4724 (config-flag-prefix "--blis-config=")
4725 (maybe-config-flag (find
4727 (string-prefix? config-flag-prefix s))
4729 (configure-flags (if maybe-config-flag
4730 (delete maybe-config-flag
4733 ;; Select the "configuration" to build.
4734 ;; The "generic" configuration is non-optimized but
4735 ;; portable (no assembly).
4736 ;; The "x86_64" configuration family includes
4737 ;; sub-configurations for all supported
4738 ;; x86_64 microarchitectures.
4739 ;; BLIS currently lacks runtime hardware detection
4740 ;; for other architectures: see
4741 ;; <https://github.com/flame/blis/commit/c534da6>.
4742 ;; Conservatively, we stick to "generic" on armhf,
4743 ;; aarch64, and ppc64le for now. (But perhaps
4744 ;; "power9", "cortexa9", and "cortexa57" might be
4745 ;; general enough to use?)
4746 ;; Another approach would be to use the "auto"
4747 ;; configuration and make this package
4748 ;; non-substitutable.
4749 ;; The build is fairly intensive, though.
4753 (substring maybe-config-flag
4754 (string-length config-flag-prefix)))
4755 ((string-prefix? "x86_64" (or target system))
4764 "--enable-threading=openmp"
4765 "--enable-verbose-make"
4768 (format #t "configure args: ~s~%" configure-args)
4773 (add-before 'check 'show-test-output
4775 ;; By default "make check" is silent. Make it verbose.
4776 (system "tail -F output.testsuite &")
4778 (synopsis "High-performance basic linear algebra (BLAS) routines")
4780 "BLIS is a portable software framework for instantiating high-performance
4781 BLAS-like dense linear algebra libraries. The framework was designed to
4782 isolate essential kernels of computation that, when optimized, immediately
4783 enable optimized implementations of most of its commonly used and
4784 computationally intensive operations. While BLIS exports a new BLAS-like API,
4785 it also includes a BLAS compatibility layer which gives application developers
4786 access to BLIS implementations via traditional BLAS routine calls.")
4787 (license license:bsd-3)))
4789 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4790 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4791 (define-public blis-knl (deprecated-package "blis-knl" blis))
4793 (define ignorance blis)
4795 (define-public openlibm
4803 (url "https://github.com/JuliaLang/openlibm")
4804 (commit (string-append "v" version))))
4805 (file-name (git-file-name name version))
4807 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4808 (build-system gnu-build-system)
4811 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4812 ,(string-append "CC=" (cc-for-target)))
4814 ;; no configure script
4815 (modify-phases %standard-phases (delete 'configure))
4816 #:tests? #f)) ;the tests are part of the default target
4817 (home-page "https://openlibm.org/")
4818 (synopsis "Portable C mathematical library (libm)")
4820 "OpenLibm is an effort to have a high quality, portable, standalone C
4821 mathematical library (libm). It can be used standalone in applications and
4822 programming language implementations. The project was born out of a need to
4823 have a good libm for the Julia programming language that worked consistently
4824 across compilers and operating systems, and in 32-bit and 64-bit
4826 ;; Each architecture has its own make target, and there is none for mips.
4827 (supported-systems (delete "mips64el-linux" %supported-systems))
4828 ;; See LICENSE.md for details.
4829 (license (list license:expat
4832 license:public-domain
4833 license:lgpl2.1+))))
4835 (define-public openspecfun
4837 (name "openspecfun")
4843 (url "https://github.com/JuliaLang/openspecfun")
4844 (commit (string-append "v" version))))
4845 (file-name (git-file-name name version))
4847 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4848 (build-system gnu-build-system)
4850 '(#:tests? #f ; no "check" target
4852 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4854 (modify-phases %standard-phases
4855 (delete 'configure)))) ; no configure script
4857 `(("fortran" ,gfortran)))
4858 (home-page "https://github.com/JuliaLang/openspecfun")
4859 (synopsis "Collection of special mathematical functions")
4861 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4862 portable package for Bessel Functions of a Complex Argument and Nonnegative
4863 Order; it contains subroutines for computing Bessel functions and Airy
4864 functions. Faddeeva allows computing the various error functions of arbitrary
4865 complex arguments (Faddeeva function, error function, complementary error
4866 function, scaled complementary error function, imaginary error function, and
4867 Dawson function); given these, one can also easily compute Voigt functions,
4868 Fresnel integrals, and similar related functions as well.")
4869 ;; Faddeeva is released under the Expat license; AMOS is included as
4870 ;; public domain software.
4871 (license (list license:expat license:public-domain))))
4873 (define-public suitesparse
4875 (name "suitesparse")
4881 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4882 (commit (string-append "v" version))))
4883 (file-name (git-file-name name version))
4886 "0zpl51pfpv7ap7z97jlryba2la1qdmzm11bhzkn55wlb03xzi6k6"))
4887 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4888 (modules '((guix build utils)))
4890 ;; Remove bundled metis source
4892 (delete-file-recursively "metis-5.1.0")
4894 (build-system gnu-build-system)
4896 `(#:tests? #f ;no "check" target
4898 (list (string-append "CC=" ,(cc-for-target))
4900 "MY_METIS_LIB=-lmetis"
4902 ;; The default is to link against netlib lapack. Use OpenBLAS
4904 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4906 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4907 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4908 (assoc-ref %outputs "out")
4909 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4910 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4911 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4912 " -DCMAKE_SKIP_RPATH=TRUE"
4913 " -DCMAKE_BUILD_TYPE=Release"
4914 " -DCMAKE_INSTALL_LIBDIR=lib")
4915 (string-append "INSTALL_LIB="
4916 (assoc-ref %outputs "out") "/lib")
4917 (string-append "INSTALL_INCLUDE="
4918 (assoc-ref %outputs "out") "/include")
4921 (modify-phases %standard-phases
4922 (delete 'configure)))) ;no configure script
4924 (list tbb openblas gmp mpfr metis))
4926 `(("cmake" ,cmake-minimal)
4928 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4929 (synopsis "Suite of sparse matrix software")
4931 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4932 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4933 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4934 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4935 CXSparse, a concise sparse Cholesky factorization package; and many other
4938 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4940 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4941 (license (list license:gpl2+ license:lgpl2.1+))))
4943 (define-public atlas
4949 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4950 version "/atlas" version ".tar.bz2"))
4951 (patches (search-patches "atlas-gfortran-compat.patch"))
4954 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4955 (build-system gnu-build-system)
4956 (home-page "http://math-atlas.sourceforge.net/")
4957 (inputs `(("gfortran" ,gfortran)
4958 ("lapack-tar" ,(package-source lapack))))
4959 (outputs '("out" "doc"))
4960 ;; For the moment we drop support for MIPS at it fails to compile. See
4961 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4962 (supported-systems (delete "mips64el-linux" %supported-systems))
4964 `(#:parallel-build? #f
4965 #:parallel-tests? #f
4967 ;; ATLAS tunes itself for the machine it is built on, as explained at
4968 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4969 ;; For this reason, we want users to build it locally instead of using
4973 #:modules ((srfi srfi-26)
4974 (guix build gnu-build-system)
4977 `(;; Generate position independent code suitable for dynamic libraries
4978 ;; and use WALL timer to get more accurate timing.
4979 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4982 ,,(if (string-match "64" (%current-system))
4985 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4986 ;; needed to compile C files before it is generated.
4987 "-Ss" "pmake" "make -j 1"
4988 ;; Probe is failing for MIPS. We therefore define the system
4989 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4990 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4991 ,,@(if (string-prefix? "mips" (%current-system))
4992 (list "-A" "49" "-V" "1")
4994 ;; Generate shared libraries.
4996 ;; Build a full LAPACK library.
4997 ,(string-append "--with-netlib-lapack-tarfile="
4998 (assoc-ref %build-inputs "lapack-tar")))
5000 (modify-phases %standard-phases
5001 (add-after 'install 'install-doc
5002 (lambda* (#:key outputs inputs #:allow-other-keys)
5003 (let ((doc (string-append (assoc-ref outputs "doc")
5004 "/share/doc/atlas")))
5006 (for-each (cut install-file <> doc)
5007 (find-files "../ATLAS/doc" ".*"))
5009 (add-after 'check 'check-pt
5010 (lambda _ (invoke "make" "ptcheck")))
5011 ;; Fix files required to run configure.
5012 (add-before 'configure 'fix-/bin/sh
5014 ;; Use `sh', not `/bin/sh'.
5015 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
5019 ;; Fix /bin/sh in generated make files.
5020 (add-after 'configure 'fix-/bin/sh-in-generated-files
5022 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
5026 ;; ATLAS configure program does not accepts the default flags
5027 ;; passed by the 'gnu-build-system'.
5029 (lambda* (#:key native-inputs inputs outputs
5030 (configure-flags '())
5031 #:allow-other-keys #:rest args)
5032 (let* ((prefix (assoc-ref outputs "out"))
5033 (bash (or (and=> (assoc-ref
5034 (or native-inputs inputs) "bash")
5035 (cut string-append <> "/bin/bash"))
5037 (flags `(,(string-append "--prefix=" prefix)
5039 (abs-srcdir (getcwd))
5040 (srcdir (string-append "../" (basename abs-srcdir))))
5041 (format #t "source directory: ~s (relative from build: ~s)~%"
5045 (format #t "build directory: ~s~%" (getcwd))
5046 (format #t "configure flags: ~s~%" flags)
5048 (string-append srcdir "/configure")
5050 (synopsis "Automatically Tuned Linear Algebra Software")
5052 "ATLAS is an automatically tuned linear algebra software library
5053 providing C and Fortran77 interfaces to a portably efficient BLAS
5054 implementation, as well as a few routines from LAPACK.
5056 Optimization occurs at build time. For this reason, the library is built on
5057 the machine where it is installed, without resorting to pre-built substitutes.
5059 Before building the library, CPU throttling should be disabled. This can be
5060 done in the BIOS, or, on GNU/Linux, with the following command:
5063 # cpupower --governor performance
5066 Failure to do so will result in a library with poor performance.")
5067 ;; The test suite is notoriously lengthy and routinely exceeds the default
5068 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
5069 (properties '((timeout . 86400))) ; 1 day
5070 (license license:bsd-3)))
5080 (url "https://github.com/recp/cglm")
5081 (commit (string-append "v" version))))
5082 (file-name (git-file-name name version))
5084 (base32 "0zgckh56vcdar3a4n51r84wrizyd2ssqal4nsvxd4qdjm0rvb4h0"))))
5085 (build-system meson-build-system)
5087 `(#:configure-flags '("-Dbuild_tests=true")))
5088 (home-page "https://github.com/recp/cglm")
5089 (synopsis "Mathematics C library for graphics programming")
5091 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
5092 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
5095 It's similar to the original C++ GLM library but written in C99 and compatible
5097 (license license:expat)))
5106 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
5107 version "/glm-" version ".zip"))
5109 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
5110 (build-system cmake-build-system)
5112 `(#:phases (modify-phases %standard-phases
5114 (lambda* (#:key outputs #:allow-other-keys)
5115 ;; Since version 0.9.9.6, 'make install' is not supported
5116 ;; and we have to do it "manually". Upstream discussion:
5117 ;; <https://github.com/g-truc/glm/pull/968>.
5118 (let* ((source (string-append "../glm"))
5119 (out (assoc-ref outputs "out"))
5120 (inc (string-append out "/include"))
5121 (lib (string-append out "/lib"))
5122 (pkgconfig (string-append lib "/pkgconfig")))
5123 (with-directory-excursion source
5126 (copy-recursively "glm" (string-append inc "/glm"))
5127 (copy-recursively "cmake" (string-append lib "/cmake"))
5128 (call-with-output-file (string-append pkgconfig "/glm.pc")
5132 includedir=${prefix}/include
5135 Description: OpenGL Mathematics
5137 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
5141 (home-page "https://glm.g-truc.net/")
5142 (synopsis "OpenGL Mathematics library")
5143 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
5144 library for graphics software based on the OpenGL Shading Language (GLSL)
5146 (license license:expat)))
5148 (define-public lpsolve
5155 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
5156 "/lp_solve_" version "_source.tar.gz"))
5159 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
5160 (modules '((guix build utils)))
5163 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
5165 ;; Pretend to be on a 64 bit platform to obtain a common directory
5166 ;; name for the build results on all architectures; nothing else
5167 ;; seems to depend on it.
5168 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
5170 ;; The check for 'isnan' as it is written fails with
5171 ;; "non-floating-point argument in call to function
5172 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
5173 ;; definition, which in turn leads to bad things. Fix the feature
5175 (("isnan\\(0\\)") "isnan(0.)"))
5177 (build-system gnu-build-system)
5179 `(#:tests? #f ; no check target
5181 (modify-phases %standard-phases
5182 (delete 'configure) ; no configure script
5185 (with-directory-excursion "lpsolve55"
5186 (invoke "bash" "ccc"))
5187 (with-directory-excursion "lp_solve"
5188 (invoke "bash" "ccc"))
5191 (lambda* (#:key outputs #:allow-other-keys)
5192 (let* ((out (assoc-ref outputs "out"))
5193 (bin (string-append out "/bin"))
5194 (lib (string-append out "/lib"))
5195 ;; This is where LibreOffice expects to find the header
5196 ;; files, and where they are installed by Debian.
5197 (include (string-append out "/include/lpsolve")))
5198 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
5199 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
5200 (install-file "lp_solve/bin/ux64/lp_solve" bin)
5202 ;; Install a subset of the header files as on Debian
5203 ;; (plus lp_bit.h, which matches the regular expression).
5204 (for-each (lambda (name)
5205 (install-file name include))
5206 (find-files "." "lp_[HMSa-z].*\\.h$"))
5207 (with-directory-excursion "shared"
5208 (for-each (lambda (name)
5209 (install-file name include))
5210 (find-files "." "\\.h$")))
5212 (home-page "http://lpsolve.sourceforge.net/")
5213 (synopsis "Mixed integer linear programming (MILP) solver")
5215 "lp_solve is a mixed integer linear programming solver based on the
5216 revised simplex and the branch-and-bound methods.")
5217 (license license:lgpl2.1+)))
5219 ;; Private Trilinos package for dealii-openmpi (similar to
5220 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
5221 ;; This version is the latest known to be compatible with deal.II [1].
5222 ;; Since the latest version of Trilinos is not necessarily supported by
5223 ;; deal.II, it may be worth keeping this package even if and when Trilinos
5224 ;; gets packaged separately for Guix (unless various versions of Trilinos are
5227 ;; An insightful source of information for building Trilinos for deal.II lies
5228 ;; in the Trilinos package for candi [2], which is a source-based installer
5229 ;; for deal.II and its dependencies.
5231 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
5232 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
5233 (define trilinos-for-dealii-openmpi
5235 (name "trilinos-for-dealii-openmpi")
5241 (url "https://github.com/trilinos/Trilinos/")
5243 (string-append "trilinos-release-"
5244 (string-replace-substring version "." "-")))))
5245 (file-name (git-file-name "trilinos" version))
5247 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
5248 (build-system cmake-build-system)
5251 ;; The build fails with the current gcc.
5252 ;; Use the version from when Trilinos was added.
5255 ;; Trilinos's repository contains several C-shell scripts, but adding
5256 ;; tcsh to the native inputs does not result in the check phase running
5257 ;; any more tests than without it (nor is tcsh required to build
5259 ;; It seems that Trilinos has replaced its use of C-shell test scripts
5260 ;; with CMake's testing facilities.
5262 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
5263 ;; states that Zoltan's C-shell test script
5264 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
5265 ;; performed through CMake.
5267 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
5269 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
5280 (list #:build-type "Release"
5282 #~(list "-DBUILD_SHARED_LIBS=ON"
5283 ;; Obtain the equivalent of RelWithDebInfo but with -O3
5284 ;; (the Release default) rather than -O2 (the
5285 ;; RelWithDebInfo default), to conform to candi's
5286 ;; trilinos.package's compilation flags, which are -g -O3.
5287 "-DCMAKE_C_FLAGS=-g"
5288 "-DCMAKE_CXX_FLAGS=-g"
5289 "-DCMAKE_Fortran_FLAGS=-g"
5291 ;; Trilinos libraries that deal.II can interface with.
5292 "-DTrilinos_ENABLE_Amesos=ON"
5293 "-DTrilinos_ENABLE_AztecOO=ON"
5294 "-DTrilinos_ENABLE_Epetra=ON"
5295 "-DTrilinos_ENABLE_EpetraExt=ON"
5296 "-DTrilinos_ENABLE_Ifpack=ON"
5297 "-DTrilinos_ENABLE_ML=ON"
5298 "-DTrilinos_ENABLE_MueLu=ON"
5299 "-DTrilinos_ENABLE_ROL=ON"
5300 ;; Optional; required for deal.II's GridIn::read_exodusii,
5301 ;; but depends on netcdf.
5302 ;; Enable if and when someone needs it.
5303 ;;"-DTrilinos_ENABLE_SEACAS=ON"
5304 "-DTrilinos_ENABLE_Sacado=ON"
5305 "-DTrilinos_ENABLE_Teuchos=ON"
5306 "-DTrilinos_ENABLE_Tpetra=ON"
5307 "-DTrilinos_ENABLE_Zoltan=ON"
5309 ;; Third-party libraries (TPLs) that Trilinos can interface
5311 "-DBLAS_LIBRARY_NAMES=openblas"
5312 "-DTPL_ENABLE_MPI=ON"
5313 "-DTPL_ENABLE_MUMPS=ON"
5314 "-DTPL_ENABLE_SCALAPACK=ON"
5316 ;; Enable the tests but not the examples (which are enabled
5317 ;; by default when enabling tests).
5318 ;; Although some examples are run as tests, they are
5319 ;; otherwise unnecessary since this is a private package
5320 ;; meant for dealii-openmpi.
5321 ;; Besides, some MueLu and ROL examples require a lot of
5322 ;; memory to compile.
5324 ;; (For future reference, note that some ROL and SEACAS
5325 ;; examples require removing gfortran from
5326 ;; CPLUS_INCLUDE_PATH as in the dune-istl,
5327 ;; dune-localfunctions and dune-alugrid packages.)
5328 "-DTrilinos_ENABLE_TESTS=ON"
5329 "-DTrilinos_ENABLE_EXAMPLES=OFF"
5330 ;; MueLu tests require considerably more time and memory to
5331 ;; compile than the rest of the tests.
5332 "-DMueLu_ENABLE_TESTS=OFF"
5334 ;; The following options were gleaned from candi's
5335 ;; trilinos.package.
5336 ;; (We do not enable the complex instantiations, which are
5337 ;; anyway provided only as an option in trilinos.package,
5338 ;; because they are costly in compilation time and memory
5339 ;; usage, and disk space [1].)
5341 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
5342 "-DTrilinos_ENABLE_Ifpack2=OFF"
5343 "-DTeuchos_ENABLE_FLOAT=ON"
5344 "-DTpetra_INST_INT_LONG=ON"
5345 "-DTPL_ENABLE_Boost=OFF")
5347 #~(modify-phases %standard-phases
5348 (add-after 'configure 'fix-kokkos-config
5350 ;; GNU Make 4.3 accidentally leaves the backslash preceding
5351 ;; the number sign in strings containing a literal
5352 ;; backslash–number sign (\#) [1, 2].
5353 ;; This is still an issue in Trilinos 13.0.1, but should be
5354 ;; fixed in the following version.
5355 ;; (The latest versions of Kokkos incorporate the fix [2].)
5357 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
5358 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
5359 (substitute* "KokkosCore_config.h"
5361 (add-before 'check 'mpi-setup
5362 #$%openmpi-setup))))
5363 (home-page "https://trilinos.github.io/")
5364 (synopsis "Algorithms for engineering and scientific problems")
5366 "The Trilinos Project is an effort to develop algorithms and enabling
5367 technologies within an object-oriented software framework for the solution of
5368 large-scale, complex multi-physics engineering and scientific problems.
5369 A unique design feature of Trilinos is its focus on packages.")
5370 ;; The packages are variously licensed under more than just BSD-3 and
5371 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
5372 ;; See https://trilinos.github.io/license.html.
5373 (license (list license:bsd-3 license:lgpl2.1+))))
5375 (define-public dealii
5382 (uri (string-append "https://github.com/dealii/dealii/releases/"
5383 "download/v" version "/dealii-" version ".tar.gz"))
5385 (base32 "0v73q6f35f2yrjihaq6vh9lma07qc4cdv75nwmc3c5yrdh07g1i3"))
5386 (modules '((guix build utils)))
5388 ;; Remove bundled boost, muparser, TBB and UMFPACK.
5389 #~(delete-file-recursively "bundled"))))
5390 (build-system cmake-build-system)
5391 (outputs '("out" "doc"))
5393 ;; Required to build the documentation.
5394 (list graphviz doxygen perl))
5403 ;; Some scripts are installed into share/deal.II/scripts that require
5404 ;; perl and python, but they are not executable (and some are missing the
5405 ;; shebang line) and therefore must be explicitly passed to the
5407 ;; Anyway, they are meant to be used at build time, so rather than adding
5408 ;; the interpreters here, any package depending on them should just add
5409 ;; the requisite interpreter to its native inputs.
5412 suitesparse ; For UMFPACK.
5416 (list #:build-type "DebugRelease" ; Only Debug, Release or DebugRelease.
5417 ;; The tests take too long and must be explicitly enabled with
5418 ;; "make setup_tests".
5419 ;; See https://www.dealii.org/developer/developers/testsuite.html.
5420 ;; (They can also be run for an already installed deal.II.)
5423 #~(let ((doc (string-append #$output:doc "/share/doc/"
5424 #$name "-" #$version)))
5425 (list "-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
5426 (string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
5427 (string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
5428 ;; Don't compile the examples because the source and
5429 ;; CMakeLists.txt are installed anyway, allowing users to
5430 ;; do so for themselves.
5431 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
5432 (string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc
5435 #~(modify-phases %standard-phases
5436 (add-after 'install 'remove-build-logs
5437 ;; These build logs leak the name of the build directory by
5438 ;; storing the values of CMAKE_SOURCE_DIR and
5439 ;; CMAKE_BINARY_DIR.
5441 (let ((doc (string-append #$output:doc "/share/doc/"
5442 #$name "-" #$version)))
5443 (for-each delete-file
5444 (map (lambda (f) (string-append doc "/" f))
5445 '("detailed.log" "summary.log")))))))))
5446 (home-page "https://www.dealii.org/")
5447 (synopsis "Finite element library")
5449 "Deal.II is a C++ program library targeted at the computational solution
5450 of partial differential equations using adaptive finite elements. The main
5451 aim of deal.II is to enable rapid development of modern finite element codes,
5452 using among other aspects adaptive meshes and a wide array of tools often used
5453 in finite element programs.")
5454 (license license:lgpl2.1+)))
5456 (define-public dealii-openmpi
5457 (package/inherit dealii
5458 (name "dealii-openmpi")
5460 (modify-inputs (package-inputs dealii)
5462 (prepend arpack-ng-openmpi
5466 (modify-inputs (package-propagated-inputs dealii)
5467 (delete "hdf5" "sundials")
5468 (prepend hdf5-parallel-openmpi
5474 trilinos-for-dealii-openmpi)))
5476 (substitute-keyword-arguments (package-arguments dealii)
5477 ((#:configure-flags flags)
5478 #~(cons "-DDEAL_II_WITH_MPI=ON" #$flags))))
5479 (synopsis "Finite element library (with MPI support)")))
5481 (define-public flann
5485 (home-page "https://github.com/mariusmuja/flann/")
5489 (uri (git-reference (url home-page) (commit version)))
5490 (file-name (git-file-name name version))
5493 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
5494 (patches (search-patches "flann-cmake-3.11.patch"))))
5495 (build-system cmake-build-system)
5501 ;; FIXME: 'mkoctfile' fails with a linker error:
5502 ;; ld: cannot find -loctinterp
5503 ;; ld: cannot find -loctave
5504 ;; Disable it for now.
5505 ;;("octave" ,octave-cli)
5506 ("python" ,python-2) ; print syntax
5509 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
5510 ;; taken 46 MiB unstripped, and 6 MiB stripped.
5511 #:strip-directories '("lib" "lib64" "libexec"
5512 "bin" "sbin" "share/flann/octave")
5514 ;; Save 12 MiB by not installing .a files. Passing
5515 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
5516 #:phases (modify-phases %standard-phases
5517 (add-after 'install 'remove-static-libraries
5518 (lambda* (#:key outputs #:allow-other-keys)
5519 (let* ((out (assoc-ref outputs "out"))
5520 (lib (string-append out "/lib")))
5521 (for-each delete-file
5522 (find-files lib "\\.a$"))
5525 #:tests? #f)) ; The test data are downloaded from the Internet.
5526 (synopsis "Library for approximate nearest neighbors computation")
5527 (description "FLANN is a library for performing fast approximate
5528 nearest neighbor searches in high dimensional spaces. It implements a
5529 collection of algorithms and a system for automatically choosing the best
5530 algorithm and optimum parameters depending on the dataset.
5532 FLANN is written in C++ and contains bindings for C, Octave and Python.")
5533 (license (license:non-copyleft "file://COPYING"
5534 "See COPYING in the distribution."))))
5536 (define-public wcalc
5543 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
5544 "wcalc-" version ".tar.bz2"))
5547 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))
5550 (for-each delete-file
5551 (list "src/common/scanner.c"
5552 "src/common/parser.c"
5553 "src/common/parser.h"))))))
5554 (build-system gnu-build-system)
5556 (list mpfr readline))
5559 (home-page "http://w-calc.sourceforge.net/index.php")
5560 (synopsis "Flexible command-line scientific calculator")
5561 (description "Wcalc is a very capable calculator. It has standard functions
5562 (sin, asin, and sinh for example, in either radians or degrees), many
5563 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
5564 variables, a command history, hex/octal/binary input and output, unit
5565 conversions, embedded comments, and an expandable expression entry field. It
5566 evaluates expressions using the standard order of operations.")
5567 (license license:gpl2+)))
5576 (url "https://github.com/xaos-project/XaoS")
5577 (commit (string-append "release-" version))))
5578 (file-name (git-file-name name version))
5581 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5582 (build-system gnu-build-system)
5583 (native-inputs `(("gettext" ,gettext-minimal)
5584 ("qtbase" ,qtbase-5)
5585 ("qttools-5" ,qttools-5)))
5586 (inputs (list libx11 zlib libpng gsl))
5587 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5588 ;; not enough for this package to install properly. These phases fix that.
5590 `(#:tests? #f ;no "check" target
5592 (modify-phases %standard-phases
5593 (add-before 'configure 'make-qt-deterministic
5595 ;; Make Qt deterministic.
5596 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5599 (lambda* (#:key outputs #:allow-other-keys)
5600 (let ((out (assoc-ref outputs "out")))
5601 (substitute* "XaoS.pro"
5602 ;; The DESTDIR is originally set to install the xaos binary to
5603 ;; the "bin" folder inside the build directory. Setting make
5604 ;; flags doesn't seem to change this.
5606 (string-append "DESTDIR=" out "/bin"))
5607 ;; Set the correct path to the lrelease binary.
5608 (("lrelease-qt5") "lrelease"))
5609 (substitute* "src/include/config.h"
5610 (("/usr/share/XaoS")
5611 (string-append out "/share/XaoS")))
5613 (add-after 'install 'install-data
5614 (lambda* (#:key outputs #:allow-other-keys)
5615 (let* ((out (assoc-ref outputs "out"))
5616 (share (string-append out "/share")))
5620 (copy-recursively folder
5621 (string-append share "/XaoS/" folder)))
5622 '("catalogs" "examples" "tutorial"))
5623 (install-file "xdg/xaos.png"
5624 (string-append share "/pixmaps"))
5625 (install-file "xdg/xaos.desktop"
5626 (string-append share "/applications")))
5628 (synopsis "Real-time fractal zoomer")
5629 (description "GNU XaoS is a graphical program that generates fractal
5630 patterns and allows you to zoom in and out of them infinitely in a fluid,
5631 continuous manner. It also includes tutorials that help to explain how fractals
5632 are built. It can generate many different fractal types such as the Mandelbrot
5634 (home-page "https://xaos-project.github.io/")
5635 (license license:gpl2+)))
5637 (define-public hypre
5645 (url "https://github.com/hypre-space/hypre")
5646 (commit (string-append "v" version))))
5647 (file-name (git-file-name name version))
5649 (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
5650 (build-system gnu-build-system)
5651 (outputs '("out" ;5.3 MiB of headers and libraries
5652 "doc")) ;12 MiB of documentation
5659 (texlive-updmap.cfg (list texlive-adjustbox
5674 texlive-generic-listofitems
5676 texlive-latex-colortbl
5678 texlive-latex-fancyhdr
5679 texlive-latex-fancyvrb
5681 texlive-latex-fncychap
5682 texlive-latex-framed
5683 texlive-latex-geometry
5684 texlive-latex-hanging
5686 texlive-latex-multirow
5687 texlive-latex-natbib
5688 texlive-latex-needspace
5689 texlive-latex-newunicodechar
5690 texlive-latex-parskip
5691 texlive-latex-stackengine
5692 texlive-latex-tabulary
5693 texlive-latex-titlesec
5694 texlive-latex-tocloft
5695 texlive-latex-upquote
5696 texlive-latex-varwidth
5701 (list openblas lapack))
5703 `(#:modules ((srfi srfi-1)
5704 ,@%gnu-build-system-modules)
5705 #:configure-flags '("--enable-shared"
5713 (modify-phases %standard-phases
5714 (add-before 'configure 'chdir-src
5715 (lambda _ (chdir "src")))
5717 (lambda* (#:key build target configure-flags
5718 #:allow-other-keys #:rest args)
5719 (let* ((configure (assoc-ref %standard-phases 'configure)))
5722 (list #:configure-flags
5723 (cons (string-append
5724 "--host=" (or target build))
5725 configure-flags)))))))
5726 (add-after 'build 'build-docs
5728 (invoke "make" "-C" "docs")))
5731 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5732 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5733 (invoke "make" "check" "CHECKRUN=")
5734 (for-each (lambda (filename)
5735 (let ((size (stat:size (stat filename))))
5736 (when (positive? size)
5737 (error (format #f "~a size ~d; error indication~%"
5739 (find-files "test" ".*\\.err$"))))
5740 (add-after 'install 'install-docs
5741 (lambda* (#:key outputs #:allow-other-keys)
5742 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5743 (let* ((doc (assoc-ref outputs "doc"))
5744 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5745 (with-directory-excursion "docs"
5746 (for-each (lambda (base)
5747 (install-file (string-append base ".pdf") docdir)
5748 (copy-recursively (string-append base "-html")
5749 (string-append docdir "/" base)))
5750 '("usr-manual" "ref-manual")))))))))
5751 (home-page "https://computing.llnl.gov/projects\
5752 /hypre-scalable-linear-solvers-multigrid-methods")
5753 (synopsis "Library of solvers and preconditioners for linear equations")
5755 "HYPRE is a software library of high performance preconditioners and
5756 solvers for the solution of large, sparse linear systems of equations. It
5757 features multigrid solvers for both structured and unstructured grid
5759 (license license:lgpl2.1)))
5761 (define-public hypre-openmpi
5764 (name "hypre-openmpi")
5765 (inputs (modify-inputs (package-inputs hypre)
5768 (substitute-keyword-arguments (package-arguments hypre)
5769 ((#:configure-flags flags)
5771 ,@(delete "--without-MPI" ,flags)))
5773 `(modify-phases ,phases
5774 (add-before 'check 'mpi-setup
5775 ,%openmpi-setup)))))
5776 (synopsis "Parallel solvers and preconditioners for linear equations")
5778 "HYPRE is a software library of high performance preconditioners and
5779 solvers for the solution of large, sparse linear systems of equations on
5780 parallel computers. It features parallel multigrid solvers for both
5781 structured and unstructured grid problems.")))
5783 (define-public matio
5790 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5791 "matio-" version ".tar.gz"))
5794 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5795 (build-system gnu-build-system)
5797 (list zlib hdf5-1.8))
5798 (home-page "http://matio.sourceforge.net/")
5799 (synopsis "Library for reading and writing MAT files")
5800 (description "Matio is a library for reading and writing MAT files. It
5801 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5802 (license license:bsd-2)))
5809 (origin (method url-fetch)
5810 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5811 "download/" version "/Vc-" version ".tar.gz"))
5814 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5815 (build-system cmake-build-system)
5818 '("-DBUILD_TESTING=ON"
5819 ;; By default, Vc will optimize for the CPU of the build machine.
5820 ;; Setting this to "none" makes it create portable binaries. See
5821 ;; "cmake/OptimizeForArchitecture.cmake".
5822 "-DTARGET_ARCHITECTURE=none")
5823 #:phases (modify-phases %standard-phases
5824 (add-after 'unpack 'copy-testdata
5825 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5826 (let ((testdata (assoc-ref (or native-inputs inputs)
5828 (copy-recursively testdata "tests/testdata")
5831 `(("virtest" ,virtest)
5833 ;; This is a submodule in the git project, but not part of the
5834 ;; released sources. See the git branch for the commit to take.
5835 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5839 (url "https://github.com/VcDevel/vc-testdata")
5840 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5841 (file-name (git-file-name "vc-testdata"
5842 (string-take commit 7)))
5845 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5846 (synopsis "SIMD vector classes for C++")
5847 (description "Vc provides portable, zero-overhead C++ types for explicitly
5848 data-parallel programming. It is a library designed to ease explicit
5849 vectorization of C++ code. Its types enable explicitly stating data-parallel
5850 operations on multiple values. The parallelism is therefore added via the type
5851 system. Vc has an intuitive API and provides portability between different
5852 compilers and compiler versions as well as portability between different vector
5853 instruction sets. Thus, an application written with Vc can be compiled for:
5856 @item SSE2 up to SSE4.2 or SSE4a
5859 @item NEON (in development)
5860 @item NVIDIA GPUs / CUDA (in development)
5862 (home-page "https://github.com/VcDevel/Vc")
5863 ;; "No support_???.cpp file exists for this architecture."
5864 (supported-systems '("x86_64-linux" "i686-linux"))
5865 (license license:bsd-3)))
5867 (define-public reducelcs
5868 ;; This is the last commit which is available upstream, no
5869 ;; release happened since 2010.
5870 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5874 (version (string-append "1.0-" revision "." (string-take commit 7)))
5879 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5881 (file-name (string-append name "-" version "-checkout"))
5884 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5885 (build-system gnu-build-system)
5889 `(#:tests? #f ; no tests
5891 (modify-phases %standard-phases
5892 (delete 'configure) ; No configure script exists.
5893 (replace 'install ; No install phase exists.
5894 (lambda* (#:key outputs #:allow-other-keys)
5895 (let* ((out (assoc-ref outputs "out"))
5896 (bin (string-append out "/bin")))
5897 (install-file "Approximation" bin)
5898 (install-file "CollectResults" bin)
5899 (install-file "GenerateInstances" bin)
5901 (synopsis "Approximate Longest Commons Subsequence computation tool")
5903 "@code{reduceLCS} is an implementation of the Reduce-Expand
5904 algorithm for LCS. It is a fast program to compute the approximate
5905 Longest Commons Subsequence of a set of strings.")
5906 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5907 (license license:gpl3+))))
5909 (define-public jacal
5916 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5919 (base32 "06a5sx9ikd62bpnd898g3yk818b020b1a27mk7dbfla2zizib4xz"))))
5920 (build-system gnu-build-system)
5923 (modify-phases %standard-phases
5924 (add-before 'build 'pre-build
5925 ;; Don't use upstream's script - it really doesn't fit into
5926 ;; Guix's functional paradigm.
5927 (lambda* (#:key inputs outputs #:allow-other-keys)
5928 (substitute* "Makefile"
5929 (("^install: install-script") "install: "))))
5930 (add-after 'install 'post-install
5931 ;; Instead, we provide our own simplified script.
5932 (lambda* (#:key inputs outputs #:allow-other-keys)
5933 (let ((wrapper (string-append (assoc-ref outputs "out")
5935 (format (open wrapper (logior O_WRONLY O_CREAT))
5936 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5937 "-e '(slib:load \"~a/lib/jacal/math\") "
5940 (assoc-ref inputs "scm")
5941 (assoc-ref outputs "out"))
5942 (chmod wrapper #o555))))
5944 (lambda* (#:key outputs #:allow-other-keys)
5945 (invoke "sh" "configure"
5946 (string-append "--prefix="
5947 (assoc-ref outputs "out"))))))))
5949 (native-inputs (list unzip texinfo))
5950 (synopsis "Symbolic mathematics system")
5951 (description "GNU JACAL is an interactive symbolic mathematics program based on
5952 Scheme. It manipulate and simplify a range of mathematical expressions such
5953 as equations, scalars, vectors, and matrices.")
5954 (home-page "https://www.gnu.org/software/jacal/")
5955 (license license:gpl3+)))
5961 (home-page "https://github.com/Z3Prover/z3")
5964 (uri (git-reference (url home-page)
5965 (commit (string-append "z3-" version))))
5966 (file-name (git-file-name name version))
5969 "1vvb09q7w7zd29qc4qjysrrhyylszm1wf6azkff004ixwn026b05"))))
5970 (build-system cmake-build-system)
5973 #:imported-modules `((guix build python-build-system)
5974 ,@%cmake-build-system-modules)
5975 #:modules '((guix build cmake-build-system)
5977 ((guix build python-build-system) #:select (site-packages)))
5979 #~(list "-DZ3_BUILD_PYTHON_BINDINGS=ON"
5980 "-DZ3_LINK_TIME_OPTIMIZATION=ON"
5982 "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
5983 #$output "/lib/python"
5984 #$(version-major+minor (package-version python-wrapper))
5987 #~(modify-phases %standard-phases
5989 (lambda* (#:key parallel-build? tests? #:allow-other-keys)
5991 (invoke "make" "test-z3"
5994 (parallel-job-count)
5996 (invoke "./test-z3" "/a"))))
5997 (add-after 'install 'compile-python-modules
5999 (setenv "PYTHONHASHSEED" "0")
6001 (invoke "python" "-m" "compileall"
6002 "--invalidation-mode=unchecked-hash"
6004 ;; This step is missing in the CMake build system, do it here.
6005 (add-after 'compile-python-modules 'fix-z3-library-path
6006 (lambda* (#:key inputs outputs #:allow-other-keys)
6007 (let* ((dest (string-append (site-packages inputs outputs)
6008 "/z3/lib/libz3.so"))
6009 (z3-lib (string-append #$output "/lib/libz3.so")))
6010 (mkdir-p (dirname dest))
6011 (symlink z3-lib dest)))))))
6013 (list which python-wrapper))
6014 (synopsis "Theorem prover")
6015 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
6016 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
6017 (license license:expat)))
6019 (define-public ocaml-z3
6023 (build-system gnu-build-system)
6025 `(#:imported-modules ((guix build python-build-system)
6026 ,@%gnu-build-system-modules)
6027 #:modules (((guix build python-build-system) #:select (site-packages))
6028 (guix build gnu-build-system)
6030 #:tests? #f; no ml tests
6032 (modify-phases %standard-phases
6033 (add-before 'configure 'bootstrap
6034 (lambda* (#:key outputs #:allow-other-keys)
6035 (let ((out (assoc-ref outputs "out")))
6036 (setenv "OCAMLFIND_LDCONF" "ignore")
6037 (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
6038 (mkdir-p (string-append out "/lib/ocaml/site-lib"))
6039 (substitute* "scripts/mk_util.py"
6041 (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'"))
6042 ;; Do not build z3 again, use the library passed as input
6044 (("z3linkdep,") "\"\",")
6045 (("z3linkdep)") "\"\")"))
6046 (invoke "python" "scripts/mk_make.py"))))
6048 (lambda* (#:key inputs outputs #:allow-other-keys)
6049 (invoke "./configure"
6051 (string-append "--prefix=" (assoc-ref outputs "out")))))
6052 (add-after 'configure 'change-directory
6058 (invoke "make" "ml")))
6060 (lambda* (#:key outputs #:allow-other-keys)
6061 (invoke "ocamlfind" "install" "-destdir"
6062 (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")
6063 "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi"
6064 "api/ml/z3enums.cmx" "api/ml/z3native.mli"
6065 "api/ml/z3native.cmi" "api/ml/z3native.cmx"
6066 "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx"
6067 "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma"
6068 "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so"))))))
6071 ("python" ,python-wrapper)
6073 ("ocaml-findlib" ,ocaml-findlib)))
6075 (list ocaml-zarith))
6082 (version "2018.11.001")
6085 (uri (string-append "https://elpa.mpcdf.mpg.de/software/"
6086 "tarball-archive/Releases/"
6087 version "/elpa-" version ".tar.gz"))
6090 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
6091 (build-system gnu-build-system)
6093 `(("fortran" ,gfortran)
6094 ("perl" ,perl))) ;for configure and deps
6096 `(("blas" ,openblas)))
6101 ;; ELPA unfortunately does not support runtime dispatch, so we can
6102 ;; only enable the "generic" kernels. See the "Cross compilation"
6103 ;; section of INSTALL.md.
6105 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
6106 "--disable-avx" "--disable-avx2" "--disable-avx512"
6107 ,(string-append "CFLAGS=-O3 "
6108 "-funsafe-loop-optimizations -funsafe-math-optimizations "
6109 "-ftree-vect-loop-version -ftree-vectorize "
6110 ,(let ((system (or (%current-target-system)
6111 (%current-system))))
6113 ((or (string-prefix? "x86_64" system)
6114 (string-prefix? "i686" system))
6117 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
6119 (modify-phases %standard-phases
6120 (add-before 'configure 'patch-header-generation
6122 (substitute* "configure"
6123 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
6124 (string-append & " CPP=\"$CPP\"")))
6126 (add-before 'check 'setup-tests
6128 ;; Decrease test time and RAM use by computing fewer eigenvalues.
6129 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
6130 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
6131 ;; for Fortran. This also causes several tests to pass that
6132 ;; otherwise would otherwise fail with matrix size 5000; possibly
6133 ;; due to floating point tolerances that are too tight.
6134 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
6135 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
6136 (substitute* "Makefile"
6137 ;; Test scripts are generated, patch the shebang
6138 (("#!/bin/bash") (string-append "#!" (which "sh"))))
6140 (home-page "https://elpa.mpcdf.mpg.de")
6141 (synopsis "Eigenvalue solvers for symmetric matrices")
6143 "The ELPA library provides efficient and scalable direct eigensolvers for
6144 symmetric matrices.")
6145 (license license:lgpl3)))
6147 (define-public elpa-openmpi
6148 (package (inherit elpa)
6149 (name "elpa-openmpi")
6152 ("scalapack" ,scalapack)
6153 ,@(package-inputs elpa)))
6155 (substitute-keyword-arguments (package-arguments elpa)
6156 ((#:configure-flags cf '())
6157 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
6158 ((#:phases phases '%standard-phases)
6159 `(modify-phases ,phases
6160 (add-before 'check 'mpi-setup
6162 ;; Tests use 2 mpi tasks by default, use our remaining build
6163 ;; cores as OpenMP threads.
6164 (setenv "OMP_NUM_THREADS" (number->string
6165 (max (quotient (parallel-job-count) 2)
6167 (,%openmpi-setup)))))))
6168 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
6170 (define-public elemental
6177 (url "https://github.com/elemental/Elemental")
6178 (commit (string-append "v" version))))
6179 (file-name (git-file-name name version))
6182 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
6183 (build-system cmake-build-system)
6184 (home-page "https://github.com/elemental/Elemental")
6188 `(("blas" ,openblas)
6189 ("gfortran:lib" ,gfortran "lib")
6198 `(#:build-type "Release" ;default RelWithDebInfo not supported
6199 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
6200 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
6201 "-DEL_CACHE_WARNINGS:BOOL=YES"
6202 "-DEL_TESTS:BOOL=YES"
6203 "-DCMAKE_INSTALL_LIBDIR=lib"
6204 "-DGFORTRAN_LIB=gfortran")
6205 #:phases (modify-phases %standard-phases
6206 (add-before 'check 'mpi-setup
6208 (add-before 'check 'setup-tests
6210 ;; Parallelism is done at the MPI layer.
6211 (setenv "OMP_NUM_THREADS" "1")
6213 (add-after 'install 'remove-tests
6214 (lambda* (#:key outputs #:allow-other-keys)
6215 ;; Tests are installed, with no easy configuration
6216 ;; switch to prevent this, so delete them.
6217 (delete-file-recursively
6218 (string-append (assoc-ref outputs "out") "/bin"))
6220 (synopsis "Dense and sparse-direct linear algebra and optimization")
6221 (description "Elemental is a modern C++ library for distributed-memory
6222 dense and sparse-direct linear algebra, conic optimization, and lattice
6224 (license license:bsd-2)))
6226 (define-public mcrl2
6229 (version "202206.0")
6233 "https://www.mcrl2.org/download/release/mcrl2-"
6235 (patches (search-patches "mcrl2-fix-1687.patch"
6236 "mcrl2-fix-counterexample.patch"))
6239 "0alpck09pbvwk4axqmrvcjmsabsn20yayq5b3apq284n0hcbf01q"))))
6241 (list boost glu mesa qtbase-5))
6242 (build-system cmake-build-system)
6243 (synopsis "Toolset for the mCRL2 formal specification language")
6245 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
6246 specification language for describing concurrent discrete event systems. Its
6247 toolset supports analysis and automatic verification, linearisation, simulation,
6248 state-space exploration and generation, and tools to optimise and analyse
6249 specifications. Also, state spaces can be manipulated, visualised and
6251 (home-page "https://mcrl2.org")
6252 (license license:boost1.0)))
6254 (define-public mcrl2-minimal
6257 (name "mcrl2-minimal")
6261 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
6263 (define-public tcalc
6270 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
6274 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
6275 (build-system gnu-build-system)
6276 (synopsis "The terminal calculator")
6278 "The terminal calculator is a small program to help users of the GNU/Linux
6279 terminal do calculations simply and quickly. The formula to be calculated can
6280 be fed to @command{tcalc} through the command line.")
6281 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
6282 (license license:gpl3+)))
6284 (define-public tiny-bignum
6285 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
6287 (name "tiny-bignum")
6288 (version (git-version "0" "0" commit))
6293 (url "https://github.com/kokke/tiny-bignum-c")
6295 (file-name (git-file-name "tiny-bignum" commit))
6297 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
6298 (build-system gnu-build-system)
6301 (modify-phases %standard-phases
6303 (add-after 'unpack 'patch-tests
6305 (substitute* "scripts/test_rand.py"
6307 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
6310 (lambda* (#:key tests? #:allow-other-keys)
6312 (invoke "make" "test"))
6315 (lambda* (#:key outputs #:allow-other-keys)
6316 (let ((share (string-append (assoc-ref outputs "out") "/share"))
6317 (doc (string-append (assoc-ref outputs "out") "/doc")))
6319 (install-file "bn.c" share)
6320 (install-file "bn.h" share)
6322 (install-file "LICENSE" doc)
6323 (install-file "README.md" doc))
6326 `(("python" ,python-wrapper)))
6327 (home-page "https://github.com/kokke/tiny-bignum-c")
6328 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
6330 "This library provides portable Arbitrary-precision unsigned integer
6331 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
6332 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
6333 and comparisons are supported.")
6334 (license license:unlicense))))
6336 (define-public sundials
6343 (uri (string-append "https://github.com/LLNL/sundials/releases/download/v"
6344 version "/sundials-" version ".tar.gz"))
6347 "07gk9060xk3bzfqf8v4fqlp0rcxswiwlsy887zv87i1gfy9map8r"))))
6348 (build-system cmake-build-system)
6350 (list python-2)) ; For tests; syntax incompatible with Python 3.
6352 (list openblas suitesparse))
6354 '(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
6356 "-DSUNDIALS_INDEX_SIZE=32"
6357 ;; Incompatible with 32-bit indices.
6358 ;;"-DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON"
6360 "-DEXAMPLES_ENABLE_C:BOOL=ON"
6361 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
6362 ;; Requires -DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON.
6363 ;;"-DEXAMPLES_ENABLE_F2003:BOOL=ON"
6364 "-DEXAMPLES_INSTALL:BOOL=OFF"
6366 "-DENABLE_KLU:BOOL=ON"
6367 ,(string-append "-DKLU_INCLUDE_DIR="
6368 (assoc-ref %build-inputs "suitesparse")
6370 ,(string-append "-DKLU_LIBRARY_DIR="
6371 (assoc-ref %build-inputs "suitesparse")
6373 (home-page "https://computation.llnl.gov/projects/sundials")
6374 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
6375 (description "SUNDIALS is a family of software packages implemented with
6376 the goal of providing robust time integrators and nonlinear solvers that can
6377 easily be incorporated into existing simulation codes.")
6379 '((release-monitoring-url
6380 . "https://computing.llnl.gov/projects/sundials/sundials-software")))
6381 (license license:bsd-3)))
6383 (define-public sundials-openmpi
6384 (package/inherit sundials
6385 (name "sundials-openmpi")
6388 ;; Support for the below requires MPI.
6392 (substitute-keyword-arguments (package-arguments sundials)
6393 ((#:configure-flags flags '())
6394 `(cons* "-DENABLE_MPI:BOOL=ON"
6395 "-DENABLE_HYPRE:BOOL=ON"
6396 (string-append "-DHYPRE_INCLUDE_DIR="
6397 (assoc-ref %build-inputs "hypre-openmpi")
6399 (string-append "-DHYPRE_LIBRARY_DIR="
6400 (assoc-ref %build-inputs "hypre-openmpi")
6402 "-DENABLE_PETSC:BOOL=ON"
6403 (string-append "-DPETSC_DIR="
6404 (assoc-ref %build-inputs "petsc-openmpi"))
6406 ((#:phases phases '%standard-phases)
6407 `(modify-phases ,phases
6408 (add-before 'check 'mpi-setup
6409 ,%openmpi-setup)))))
6410 (synopsis "SUNDIALS with MPI support")))
6412 (define-public sundials-5
6420 (uri (string-append "https://github.com/LLNL/sundials/releases/download/v"
6421 version "/sundials-" version ".tar.gz"))
6424 "04x2x0jchf9kbcw2a1c6f4h4as8sr6k2snfz8z9k897pa4rl1vfl"))))))
6426 (define-public sundials-openmpi-5
6427 (package/inherit sundials-5
6428 (name "sundials-openmpi")
6430 (package-propagated-inputs sundials-openmpi))
6432 (package-arguments sundials-openmpi))
6433 (synopsis (package-synopsis sundials-openmpi))))
6435 (define-public sundials-julia
6438 (name "sundials-julia")
6444 (url "https://github.com/LLNL/sundials")
6445 (commit (string-append "v" version))))
6446 (file-name (git-file-name name version))
6449 "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv"))))
6451 (modify-inputs (package-inputs sundials)
6452 (prepend gfortran lapack)))
6454 '(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
6455 "-DSUNDIALS_INDEX_SIZE=32"
6456 "-DKLU_ENABLE:BOOL=ON"
6457 ,(string-append "-DKLU_INCLUDE_DIR="
6458 (assoc-ref %build-inputs "suitesparse")
6460 ,(string-append "-DKLU_LIBRARY_DIR="
6461 (assoc-ref %build-inputs "suitesparse")
6463 "-DLAPACK_ENABLE:BOOL=ON")))
6464 (synopsis "SUNDIALS with LAPACK support as required by julia-sundials-jll")))
6466 (define-public combinatorial-blas
6468 (name "combinatorial-blas")
6473 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
6475 (match (string-split version #\.)
6476 ((major minor patch)
6477 (string-append major minor "_" patch))) ;e.g. "16_2"
6481 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
6482 (patches (search-patches "combinatorial-blas-awpm.patch"
6483 "combinatorial-blas-io-fix.patch"))))
6484 (build-system cmake-build-system)
6487 ("test-data" ,(origin
6489 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
6490 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
6493 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
6495 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
6496 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
6497 #:parallel-tests? #f ;tests use 'mpiexec -n4'
6499 (modify-phases %standard-phases
6500 (add-before 'check 'mpi-setup
6502 (add-before 'check 'test-setup
6503 (lambda* (#:key inputs #:allow-other-keys)
6504 (setenv "OMP_NUM_THREADS" "2")
6505 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
6506 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
6507 (synopsis "Linear algebra primitives for graph analytics")
6508 (description "The Combinatorial BLAS (CombBLAS) is an extensible
6509 distributed-memory parallel graph library offering a small but powerful set of
6510 linear algebra primitives specifically targeting graph analytics.")
6512 license:gpl2+ ;include/psort/(funnel|sort)*.h
6513 license:x11 ;usort and psort
6514 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
6516 (define-public dune-common
6518 (name "dune-common")
6523 (uri (string-append "https://dune-project.org/download/"
6524 version "/dune-common-" version ".tar.gz"))
6527 "0sidwdkyrrqjkqhpvrlc991pzi5xzlvxk91s2n7qk3widwy7fch2"))))
6528 (build-system cmake-build-system)
6531 (modify-phases %standard-phases
6532 (add-after 'build 'build-tests
6533 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6534 (apply invoke "make" "build_tests"
6535 `(,@(if parallel-build?
6536 `("-j" ,(number->string (parallel-job-count)))
6540 (list gmp metis openblas python superlu))
6542 (list gfortran pkg-config))
6543 (home-page "https://dune-project.org/")
6544 (synopsis "Distributed and Unified Numerics Environment")
6545 (description "DUNE, the Distributed and Unified Numerics Environment is a
6546 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6547 grid-based methods. It supports the easy implementation of methods like
6548 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6549 Differences} (FD).")
6550 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
6551 (license license:gpl2)))
6553 (define-public dune-geometry
6555 (name "dune-geometry")
6560 (uri (string-append "https://dune-project.org/download/"
6561 version "/dune-geometry-" version ".tar.gz"))
6564 "068mh3fd110xl27rwxqlqy4d9cpqw2vqm2pzfrripiaqscb3byfy"))))
6565 (build-system cmake-build-system)
6568 (modify-phases %standard-phases
6569 (add-after 'build 'build-tests
6570 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6571 (apply invoke "make" "build_tests"
6572 `(,@(if parallel-build?
6573 `("-j" ,(number->string (parallel-job-count)))
6579 openblas gmp python))
6581 (list gfortran pkg-config))
6582 (home-page "https://dune-project.org/")
6583 (synopsis "Distributed and Unified Numerics Environment")
6584 (description "DUNE, the Distributed and Unified Numerics Environment is a
6585 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6586 grid-based methods. It supports the easy implementation of methods like
6587 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6590 This package contains the basic DUNE geometry classes.")
6591 ;; GPL version 2 with "runtime exception"
6592 (license license:gpl2)))
6594 (define-public dune-uggrid
6596 (name "dune-uggrid")
6602 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
6603 (commit (string-append "v" version))))
6604 (file-name (git-file-name name version))
6607 "11qz52g9d5k96fqik2lyi80xryw174rnny074pj70ardl6zzz83p"))))
6608 (build-system cmake-build-system)
6611 (modify-phases %standard-phases
6612 (add-after 'build 'build-tests
6613 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6614 (apply invoke "make" "build_tests"
6615 `(,@(if parallel-build?
6616 `("-j" ,(number->string (parallel-job-count)))
6622 (list gfortran pkg-config))
6623 (home-page "https://dune-project.org/")
6624 (synopsis "Distributed and Unified Numerics Environment")
6625 (description "DUNE, the Distributed and Unified Numerics Environment is a
6626 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6627 grid-based methods. It supports the easy implementation of methods like
6628 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6631 This package contains the DUNE UG grid classes.")
6632 (license license:lgpl2.1)))
6634 (define-public dune-grid
6641 (uri (string-append "https://dune-project.org/download/"
6642 version "/dune-grid-" version ".tar.gz"))
6645 "15iws03hkbmr4a4rqqb0rriz1m8szl96wdr7gw0jmrcnlzbdbbx5"))))
6646 (build-system cmake-build-system)
6649 (modify-phases %standard-phases
6650 (add-after 'build 'build-tests
6651 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6652 (apply invoke "make" "build_tests"
6653 `(,@(if parallel-build?
6654 `("-j" ,(number->string (parallel-job-count)))
6667 (list gfortran pkg-config))
6668 (home-page "https://dune-project.org/")
6669 (synopsis "Distributed and Unified Numerics Environment")
6670 (description "DUNE, the Distributed and Unified Numerics Environment is a
6671 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6672 grid-based methods. It supports the easy implementation of methods like
6673 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6676 This package contains the basic DUNE grid classes.")
6677 ;; GPL version 2 with "runtime exception"
6678 (license license:gpl2)))
6680 (define-public dune-istl
6687 (uri (string-append "https://dune-project.org/download/"
6688 version "/dune-istl-" version ".tar.gz"))
6691 "1cy69s1266hvnh8blznlvvkrf8i2g640rc3mf7kp872wgvdz4nb9"))))
6692 (build-system cmake-build-system)
6695 (modify-phases %standard-phases
6696 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6697 ;; the stdlib types when the gfortran header is used. Remove gfortran
6698 ;; from CPLUS_INCLUDE_PATH as a workaround.
6699 (add-after 'set-paths 'hide-gfortran
6700 (lambda* (#:key inputs #:allow-other-keys)
6701 (let ((gfortran (assoc-ref inputs "gfortran")))
6702 (setenv "CPLUS_INCLUDE_PATH"
6704 (delete (string-append gfortran "/include/c++")
6705 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6708 (add-after 'build 'build-tests
6709 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6710 (apply invoke "make" "build_tests"
6711 `(,@(if parallel-build?
6712 `("-j" ,(number->string (parallel-job-count)))
6725 (list gfortran pkg-config))
6726 (home-page "https://dune-project.org/")
6727 (synopsis "Distributed and Unified Numerics Environment")
6728 (description "DUNE, the Distributed and Unified Numerics Environment is a
6729 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6732 This is the iterative solver template library which provides generic sparse
6733 matrix/vector classes and a variety of solvers based on these classes. A
6734 special feature is the use of templates to exploit the recursive block
6735 structure of finite element matrices at compile time. Available solvers
6736 include Krylov methods, (block-) incomplete decompositions and
6737 aggregation-based algebraic multigrid.")
6738 ;; GPL version 2 with "runtime exception"
6739 (license license:gpl2)))
6741 (define-public dune-localfunctions
6743 (name "dune-localfunctions")
6748 (uri (string-append "https://dune-project.org/download/"
6749 version "/dune-localfunctions-" version ".tar.gz"))
6752 "031i42anrhi0ngpvp42rdjbkic7v3008fwild9xg7flffwvnpshg"))))
6753 (build-system cmake-build-system)
6756 (modify-phases %standard-phases
6757 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6758 ;; and fails to find the stdlib types when the gfortran header is used.
6759 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6760 (add-after 'set-paths 'hide-gfortran
6761 (lambda* (#:key inputs #:allow-other-keys)
6762 (let ((gfortran (assoc-ref inputs "gfortran")))
6763 (setenv "CPLUS_INCLUDE_PATH"
6765 (delete (string-append gfortran "/include/c++")
6766 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6769 (add-after 'build 'build-tests
6770 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6771 (apply invoke "make" "build_tests"
6772 `(,@(if parallel-build?
6773 `("-j" ,(number->string (parallel-job-count)))
6784 (list gfortran pkg-config))
6785 (home-page "https://dune-project.org/")
6786 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6787 (description "This DUNE module provides interface and implementation for
6788 shape functions defined on the DUNE reference elements. In addition to the
6789 shape function, interpolation operators and special keys are provided which
6790 can be used to assemble global function spaces on finite-element grids.
6792 This package provides an interface and implementation for shape functions
6793 defined on the DUNE reference elements. In addition to the shape function,
6794 interpolation operators and special keys are provided which can be used to
6795 assemble global function spaces on finite-element grids.")
6796 ;; GPL version 2 with "runtime exception"
6797 (license license:gpl2)))
6799 (define-public dune-alugrid
6800 ;; This was the last commit on the releases/2.7 branch as of 2021-12-17,
6801 ;; unfortunately there was no tag for any 2.7 release.
6802 (let ((commit "51bde29a2dfa7cfac4fb73d40ffd42b9c1eb1d3d"))
6804 (name "dune-alugrid")
6805 (version (git-version "2.7.1" "0" commit))
6810 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6812 (file-name (git-file-name name version))
6815 "0z16wg6llzxs7vjg2yilg31vwnkz8k050j6bspg3blbym0razy15"))))
6816 (build-system cmake-build-system)
6819 (modify-phases %standard-phases
6820 (add-after 'unpack 'patch-include
6822 (substitute* "dune/alugrid/test/test-alugrid.cc"
6823 (("doc/grids/gridfactory/testgrids")
6824 "doc/dune-grid/grids/gridfactory/testgrids"))
6826 (add-after 'build 'build-tests
6827 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6828 (setenv "CPLUS_INCLUDE_PATH"
6829 (string-append (assoc-ref inputs "dune-grid") "/share"))
6830 (apply invoke "make" "build_tests"
6831 `(,@(if parallel-build?
6832 `("-j" ,(number->string (parallel-job-count)))
6847 (list gfortran pkg-config))
6848 (home-page "https://dune-project.org/")
6849 (synopsis "Distributed and Unified Numerics Environment")
6850 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6851 implementation of the DUNE grid interface supporting either simplices or
6853 (license license:gpl2+))))
6855 (define-public dune-subgrid
6856 ;; This was the last commit on the releases/2.7 branch as of 2021-12-17.
6857 ;; Unfortunately the dune-subgrid repository contains no release tags.
6858 (let ((commit "45d1ee9f3f711e209695deee97912f4954f7f280"))
6860 (name "dune-subgrid")
6861 (version (git-version "2.7.1" "0" commit))
6866 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6868 (file-name (git-file-name name version))
6871 "0xjf7865wil7kzym608kv3nc3ff3m3nlqich4k9wjyvy3lz6panh"))))
6872 (build-system cmake-build-system)
6875 (modify-phases %standard-phases
6876 (add-after 'build 'build-tests
6877 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6878 (apply invoke "make" "build_tests"
6879 `(,@(if parallel-build?
6880 `("-j" ,(number->string (parallel-job-count)))
6892 (list gfortran pkg-config))
6893 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6894 (synopsis "Distributed and Unified Numerics Environment")
6895 (description "The dune-subgrid module marks elements of
6896 another hierarchical dune grid. The set of marked elements can then be
6897 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6898 provides the full grid interface including adaptive mesh refinement.")
6899 (license license:gpl2+))))
6901 (define-public dune-typetree
6903 (name "dune-typetree")
6909 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6910 (commit (string-append "v" version))))
6911 (file-name (git-file-name name version))
6914 "1kx9k8i7pdw6l6ny6nq85v5p1nd6yxldzaj8k3nizaz3q1j407pv"))))
6915 (build-system cmake-build-system)
6918 (modify-phases %standard-phases
6919 (add-after 'build 'build-tests
6920 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6921 (apply invoke "make" "build_tests"
6922 `(,@(if parallel-build?
6923 `("-j" ,(number->string (parallel-job-count)))
6935 (list gfortran pkg-config))
6936 (home-page "https://dune-project.org/")
6937 (synopsis "Distributed and Unified Numerics Environment")
6938 (description "TypeTree is a template library for constructing and
6939 operating on statically typed trees of objects.")
6940 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6941 (license (list license:lgpl3+ license:gpl2))))
6943 (define-public dune-functions
6945 (name "dune-functions")
6951 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6952 (commit (string-append "v" version))))
6953 (file-name (git-file-name name version))
6956 "04dhr4asnl38bf1gp8hrk31maav33m7q71lhl2n5yk1q1x6i77nw"))))
6957 (build-system cmake-build-system)
6960 (modify-phases %standard-phases
6961 (add-after 'unpack 'disable-failing-tests
6964 ;; unable to load GMSH file in this test
6965 "--exclude-regex gridviewfunctionspacebasistest")
6967 (add-after 'build 'build-tests
6968 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
6969 (apply invoke "make" "build_tests"
6970 `(,@(if parallel-build?
6971 `("-j" ,(number->string (parallel-job-count)))
6987 (list gfortran pkg-config))
6988 (home-page "https://dune-project.org/")
6989 (synopsis "Distributed and Unified Numerics Environment")
6990 (description "The dune-functions module provides an abstraction layer for
6991 global finite element functions. Its two main concepts are functions
6992 implemented as callable objects, and bases of finite element spaces.")
6993 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6994 (license (list license:lgpl3+ license:gpl2))))
6996 (define-public dune-pdelab
6997 ;; This was the last commit on the releases/2.7 branch as of 2021-12-17,
6998 ;; unfortunately there was no tag for any 2.7 release.
6999 (let ((commit "09aef74d95661d18a7789d2f517ae77797eec738"))
7001 (name "dune-pdelab")
7002 (version (git-version "2.7.1" "0" commit))
7007 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
7009 (file-name (git-file-name name version))
7012 "0nv69ayr4gln9m1s94z9zkrxqi8nzar3z6awnvgqz595nmjf82ac"))))
7013 (build-system cmake-build-system)
7014 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
7031 (list gfortran pkg-config))
7032 (home-page "https://dune-project.org/")
7033 (synopsis "Differential equations solver toolbox")
7034 (description "PDELab is a partial differential equations solver toolbox
7035 built on top of DUNE, the Distributed and Unified Numerics Environment.")
7036 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
7037 (license (list license:lgpl3+ license:gpl2)))))
7039 (define add-openmpi-to-dune-package
7040 (let ((dune-package?
7041 (lambda (p) (string-prefix? "dune-" (package-name p)))))
7044 (if (dune-package? p)
7045 (package (inherit p)
7046 (name (string-append (package-name p) "-openmpi"))
7047 (inputs (modify-inputs (package-inputs p)
7050 (substitute-keyword-arguments (package-arguments p)
7051 ((#:phases phases '%standard-phases)
7052 `(modify-phases ,phases
7053 (add-before 'check 'mpi-setup
7054 ,%openmpi-setup)))))
7055 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
7057 (negate dune-package?))))
7059 (define-public dune-common-openmpi
7060 (add-openmpi-to-dune-package dune-common))
7062 (define-public dune-geometry-openmpi
7063 (add-openmpi-to-dune-package dune-geometry))
7065 (define-public dune-istl-openmpi
7066 (add-openmpi-to-dune-package dune-istl))
7068 (define-public dune-typetree-openmpi
7069 (add-openmpi-to-dune-package dune-typetree))
7071 (define-public dune-uggrid-openmpi
7072 (add-openmpi-to-dune-package dune-uggrid))
7074 (define-public dune-grid-openmpi
7075 (add-openmpi-to-dune-package dune-grid))
7077 (define-public dune-alugrid-openmpi
7078 (add-openmpi-to-dune-package dune-alugrid))
7080 (define-public dune-subgrid-openmpi
7081 (add-openmpi-to-dune-package dune-subgrid))
7083 (define-public dune-localfunctions-openmpi
7084 (add-openmpi-to-dune-package dune-localfunctions))
7086 (define-public dune-functions-openmpi
7087 (add-openmpi-to-dune-package dune-functions))
7089 (define-public dune-pdelab-openmpi
7090 (add-openmpi-to-dune-package dune-pdelab))
7092 (define-public mlucas
7100 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
7102 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
7103 (build-system gnu-build-system)
7107 `(#:tests? #f ; no tests
7109 (modify-phases %standard-phases
7113 (call-with-output-file "Makefile"
7115 (format port "CC = gcc
7116 CFLAGS = -O3 ~a -DUSE_THREADS
7117 LDLIBS = -lm -lpthread -lrt
7118 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
7120 ,(let ((system (or (%current-target-system)
7121 (%current-system))))
7123 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
7127 (lambda* (#:key outputs #:allow-other-keys)
7128 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
7129 (install-file "Mlucas" bin)
7130 (install-file "primenet.py" bin))
7132 (home-page "https://www.mersenne.org")
7133 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
7134 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
7135 numbers in search of a world-record prime. You may use it to test any
7136 suitable number as you wish, but it is preferable that you do so in a
7137 coordinated fashion, as part of the Great Internet Mersenne Prime
7138 Search (GIMPS). Mlucas also includes a simple Python script for assignment
7139 management via the GIMPS project's Primenet server.")
7140 (license license:gpl2+)))
7142 (define-public nauty
7150 "https://pallini.di.uniroma1.it/"
7151 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
7153 (base32 "19j8i10cgnqavphj0p7kq939azxckj9ayjpjr6sg76g2dxdch45q"))))
7154 (build-system gnu-build-system)
7155 (outputs '("out" "lib"))
7158 #:test-target "checks"
7159 #:configure-flags #~(list "--enable-generic") ;prevent -march-native
7161 #~(modify-phases %standard-phases
7162 ;; Default make target does not build all available
7163 ;; executables. Create them now.
7164 (add-after 'build 'build-extra-programs
7166 (for-each (lambda (target) (invoke "make" target))
7167 '("blisstog" "bliss2dre" "checks6" "sumlines"))))
7168 ;; Upstream does not provide any install target.
7171 (let* ((bin (string-append #$output "/bin"))
7172 (doc (string-append #$output "/share/doc/nauty/"))
7173 (include (string-append #$output:lib "/include/nauty"))
7174 (lib (string-append #$output:lib "/lib/nauty")))
7175 (for-each (lambda (f) (install-file f bin))
7176 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
7177 "bliss2dre" "catg" "checks6" "complg" "converseg"
7178 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
7179 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
7180 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
7181 "gentourng" "gentreeg" "hamheuristic" "labelg"
7182 "linegraphg" "listg" "multig" "newedgeg" "pickg"
7183 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
7184 "sumlines" "twohamg" "underlyingg" "vcolg"
7185 "watercluster2" "NRswitchg"))
7186 (for-each (lambda (f) (install-file f include))
7187 (find-files "." "\\.h$"))
7188 (for-each (lambda (f) (install-file f lib))
7189 (find-files "." "\\.a$"))
7190 (for-each (lambda (f) (install-file f doc))
7191 (append '("formats.txt" "README" "schreier.txt")
7192 (find-files "." "\\.pdf$")))))))))
7194 (list gmp)) ;for sumlines
7195 (home-page "https://pallini.di.uniroma1.it/")
7196 (synopsis "Library for graph automorphisms")
7197 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
7198 procedures for computing automorphism groups of graphs and digraphs.
7200 @code{nauty} computes graph information in the form of a set of
7201 generators, the size of the group, and the orbits of the group; it can
7202 also produce a canonical label. The @code{nauty} suite is written in
7203 C and comes with a command-line interface, a collection of
7204 command-line tools, and an Application Programming Interface (API).
7206 This package provides the static libraries required to run programs
7207 compiled against the nauty library.")
7208 (license license:asl2.0)))
7217 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
7218 "ftp/releases/" version
7219 "/ppl-" version ".tar.gz"))
7222 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
7223 (build-system gnu-build-system)
7228 (home-page "https://www.bugseng.com/parma-polyhedra-library")
7230 "Parma Polyhedra Library for computations with polyhedra")
7232 "The Parma Polyhedra Library (PPL) provides numerical abstractions
7233 especially targeted at applications in the field of analysis and
7234 verification of complex systems. These abstractions include convex
7235 polyhedra, defined as the intersection of a finite number of (open or
7236 closed) halfspaces, each described by a linear inequality (strict or
7237 non-strict) with rational coefficients; some special classes of polyhedra
7238 shapes that offer interesting complexity/precision tradeoffs; and grids
7239 which represent regularly spaced points that satisfy a set of linear
7240 congruence relations. The library also supports finite powersets and
7241 products of (any kind of) polyhedra and grids, a mixed integer linear
7242 programming problem solver using an exact-arithmetic version of the simplex
7243 algorithm, a parametric integer programming solver, and primitives for
7244 termination analysis via the automatic synthesis of linear ranking
7246 (license license:gpl3+)))
7248 (define-public speedcrunch
7250 (name "speedcrunch")
7256 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
7257 (commit (string-append "release-" version))))
7258 (file-name (git-file-name name version))
7261 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
7262 (build-system cmake-build-system)
7263 (inputs (list qtbase-5))
7264 (native-inputs (list qttools-5))
7267 (modify-phases %standard-phases
7268 (add-after 'unpack 'chdir-to-src
7269 (lambda _ (chdir "src") #t)))))
7270 (synopsis "High-precision scientific calculator")
7272 "SpeedCrunch is a high-precision scientific calculator. It features a
7273 syntax-highlighted scrollable display and is designed to be fully used via
7274 keyboard. Some distinctive features are auto-completion of functions and
7275 variables, a formula book, and quick insertion of constants from various
7276 fields of knowledge.")
7277 (home-page "https://speedcrunch.org/")
7278 (license license:gpl2+)))
7280 (define-public minisat
7281 ;; This is the last commit which is available upstream, no
7282 ;; release happened since 2010.
7283 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
7287 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
7292 (url "https://github.com/niklasso/minisat")
7294 (file-name (string-append name "-" version "-checkout"))
7297 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
7299 (search-patches "minisat-friend-declaration.patch"
7300 "minisat-install.patch"))))
7301 (build-system gnu-build-system)
7303 '(#:make-flags (list (string-append "prefix=" %output))
7304 #:tests? #f ;no check target
7306 (modify-phases %standard-phases
7307 (delete 'configure))))
7309 `(("zlib:static" ,zlib "static")
7312 "Small, yet efficient, SAT solver")
7314 "MiniSat is a minimalistic, open-source SAT solver, developed to help
7315 researchers and developers alike to get started on SAT.")
7317 "http://minisat.se/MiniSat.html")
7318 (license license:expat))))
7320 (define-public kissat
7328 (url "https://github.com/arminbiere/kissat")
7329 (commit (string-append "rel-" version))))
7330 (file-name (git-file-name name version))
7333 "04x4w760srbdi4zci0s747qxk717x5d2x59ixraxh5104s9nyn8b"))))
7334 (build-system gnu-build-system)
7335 (inputs (list xz gzip lzip bzip2 p7zip))
7338 #:test-target "test"
7339 #:configure-flags #~(list "-shared")
7341 #~(modify-phases %standard-phases
7342 (add-after 'unpack 'patch-source
7343 (lambda* (#:key inputs #:allow-other-keys)
7344 (substitute* "src/file.c"
7345 (("(bzip2|gzip|lzma|xz) -c" all cmd)
7346 (string-append (search-input-file inputs
7347 (string-append "bin/" cmd))
7349 (("7z ([ax])" all mode)
7350 (string-append (search-input-file inputs "bin/7z")
7352 ;; Since we hard-coded the paths, we no longer need to find
7354 (("bool found = kissat_find_executable \\(name\\);")
7355 "bool found = true;"))
7356 (substitute* "test/testmain.c"
7357 ;; SIGINT is ignored inside invoke.
7358 (("^SIGNAL\\(SIGINT\\)") ""))))
7360 (lambda* (#:key configure-flags #:allow-other-keys)
7361 ;; The configure script does not support standard GNU options.
7362 (apply invoke "./configure" configure-flags)))
7364 (lambda* (#:key inputs outputs #:allow-other-keys)
7365 (let ((out (assoc-ref outputs "out")))
7366 (install-file "build/kissat" (string-append out "/bin"))
7367 (install-file "build/libkissat.so" (string-append out "/lib"))
7368 (install-file "src/kissat.h"
7369 (string-append out "/include"))))))))
7370 (home-page "https://github.com/arminbiere/kissat")
7371 (synopsis "Bare-metal SAT solver")
7373 "Kissat is a bare-metal SAT-solver written in C. It is a port of CaDiCaL
7374 back to C with improved data structures, better scheduling of inprocessing and
7375 optimized algorithms and implementation.")
7376 (license license:expat)))
7378 (define-public libqalculate
7380 (name "libqalculate")
7386 (url "https://github.com/Qalculate/libqalculate/")
7387 (commit (string-append "v" version))))
7388 (file-name (git-file-name name version))
7390 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
7392 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
7393 (build-system gnu-build-system)
7395 `(("pkg-config" ,pkg-config)
7396 ("gettext" ,gettext-minimal)
7397 ("intltool" ,intltool)
7398 ("automake" ,automake)
7399 ("autoconf" ,autoconf)
7400 ("libtool" ,libtool)
7401 ("doxygen" ,doxygen)
7413 (modify-phases %standard-phases
7414 (add-before 'bootstrap 'setenv
7415 ;; Prevent the autogen.sh script to carry out the configure
7416 ;; script, which has not yet been patched to replace /bin/sh.
7418 (setenv "NOCONFIGURE" "TRUE")
7420 (home-page "https://qalculate.github.io/")
7421 (synopsis "Multi-purpose cli desktop calculator and library")
7423 "Libqalculate is a multi-purpose cli desktop calculator and library.
7424 It provides basic and advanced functionality. Features include customizable
7425 functions, unit calculations, and conversions, physical constants, symbolic
7426 calculations (including integrals and equations), arbitrary precision,
7427 uncertainty propagation, interval arithmetic, plotting and a user-friendly
7429 (license license:gpl2+)))
7431 (define-public qalculate-gtk
7433 (name "qalculate-gtk")
7439 (url "https://github.com/Qalculate/qalculate-gtk/")
7440 (commit (string-append "v" version))))
7441 (file-name (git-file-name name version))
7443 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
7444 (build-system glib-or-gtk-build-system)
7461 (modify-phases %standard-phases
7462 (add-before 'bootstrap 'setenv
7463 ;; Prevent the autogen.sh script to carry out the configure
7464 ;; script, which has not yet been patched to replace /bin/sh.
7466 (setenv "NOCONFIGURE" "TRUE")
7468 (home-page "https://qalculate.github.io/")
7469 (synopsis "Multi-purpose graphical desktop calculator")
7471 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
7472 multi-purpose GUI desktop calculator. It provides basic and advanced
7473 functionality. Features include customizable functions, unit calculations,
7474 and conversions, physical constants, symbolic calculations (including
7475 integrals and equations), arbitrary precision, uncertainty propagation,
7476 interval arithmetic, plotting.")
7477 (license license:gpl2+)))
7479 (define-public numdiff
7486 (uri (string-append "mirror://savannah/numdiff/numdiff-"
7490 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
7491 (build-system gnu-build-system)
7493 '(#:tests? #f ; There are no tests.
7495 (modify-phases %standard-phases
7496 (add-before 'compress-documentation 'delete-precompressed-info-file
7498 (delete-file (string-append (assoc-ref %outputs "out")
7499 "/share/info/numdiff.info.gz"))
7501 (home-page "https://nongnu.org/numdiff/")
7502 (synopsis "Compare files with numeric fields")
7504 "Numdiff compares files line by line and field by field, ignoring small
7505 numeric differences and differences in numeric formats.")
7506 (license license:gpl3+)))
7515 (url "https://gitlab.inria.fr/why3/why3")
7517 (file-name (git-file-name name version))
7520 "1yca6mx8bjm8x0i594ivh31aw45s6fbimmwfj8g2v9zwrgmr1i4s"))))
7521 (build-system ocaml-build-system)
7523 (list autoconf automake coq ocaml which))
7525 (list camlzip ocaml-graph ocaml-menhir ocaml-num ocaml-zarith))
7527 (list coq-flocq emacs-minimal zlib))
7530 (modify-phases %standard-phases
7531 (add-before 'configure 'bootstrap
7533 (invoke "./autogen.sh")
7534 (setenv "CONFIG_SHELL" (which "sh"))
7535 (substitute* "configure"
7536 (("#! /bin/sh") (string-append "#!" (which "sh")))
7537 ;; find ocaml-num in the correct directory
7538 (("\\$DIR/nums.cma") "$DIR/num.cma")
7539 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
7541 (add-after 'configure 'fix-makefile
7543 (substitute* "Makefile"
7544 ;; find ocaml-num in the correct directory
7545 (("site-lib/num") "site-lib"))
7547 (add-after 'install 'install-lib
7549 (invoke "make" "byte")
7550 (invoke "make" "install-lib")
7552 (home-page "http://why3.lri.fr")
7553 (synopsis "Deductive program verification")
7554 (description "Why3 provides a language for specification and programming,
7555 called WhyML, and relies on external theorem provers, both automated and
7556 interactive, to discharge verification conditions. Why3 comes with a standard
7557 library of logical theories (integer and real arithmetic, Boolean operations,
7558 sets and maps, etc.) and basic programming data structures (arrays, queues,
7559 hash tables, etc.). A user can write WhyML programs directly and get
7560 correct-by-construction OCaml programs through an automated extraction
7561 mechanism. WhyML is also used as an intermediate language for the verification
7562 of C, Java, or Ada programs.")
7563 (license license:lgpl2.1)))
7565 (define-public frama-c
7571 (uri (string-append "http://frama-c.com/download/frama-c-"
7572 version "-Chromium.tar.gz"))
7575 "0x1xgip50jdz1phsb9rzwf2ra8lshn1hmd9g967xia402wrg3sjf"))))
7576 (build-system ocaml-build-system)
7578 `(#:tests? #f; no test target in Makefile
7580 (modify-phases %standard-phases
7581 (add-before 'configure 'export-shell
7582 (lambda* (#:key inputs #:allow-other-keys)
7583 (setenv "CONFIG_SHELL"
7584 (search-input-file inputs "/bin/sh")))))))
7593 ocaml-lablgtk3-sourceview3
7596 (native-search-paths
7597 (list (search-path-specification
7598 (variable "FRAMAC_SHARE")
7599 (files '("share/frama-c"))
7601 (search-path-specification
7602 (variable "FRAMAC_LIB")
7603 (files '("lib/frama-c"))
7605 (home-page "http://frama-c.com")
7606 (synopsis "C source code analysis platform")
7607 (description "Frama-C is an extensible and collaborative platform dedicated
7608 to source-code analysis of C software. The Frama-C analyzers assist you in
7609 various source-code-related activities, from the navigation through unfamiliar
7610 projects up to the certification of critical software.")
7611 (license license:lgpl2.1+)))
7613 (define-public blitz
7621 (url "https://github.com/blitzpp/blitz")
7623 (file-name (git-file-name name version))
7625 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
7626 (build-system cmake-build-system)
7628 `(#:configure-flags '("-DBUILD_DOC=ON"
7629 "-DBUILD_TESTING=ON")
7630 ;; The default "check" target also includes examples and benchmarks.
7631 #:test-target "check-testsuite"
7633 (modify-phases %standard-phases
7634 (add-after 'build 'build-doc
7636 (invoke "make" "-j" (number->string (parallel-job-count))
7639 (list python texinfo))
7640 (synopsis "C++ template class library for multidimensional arrays")
7641 (description "Blitz++ is a C++ template class library that provides
7642 high-performance multidimensional array containers for scientific computing.")
7643 (home-page "https://github.com/blitzpp/blitz")
7644 (license (list license:artistic2.0
7648 (define-public fxdiv
7649 ;; There is currently no tag in this repo.
7650 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
7655 (version (git-version version revision commit))
7656 (home-page "https://github.com/Maratyszcza/FXdiv")
7659 (uri (git-reference (url home-page) (commit commit)))
7660 (file-name (git-file-name name version))
7663 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
7664 (patches (search-patches "fxdiv-system-libraries.patch"))))
7665 (build-system cmake-build-system)
7667 (list googletest googlebenchmark))
7669 "C++ library for division via fixed-point multiplication by inverse")
7671 "On modern CPUs and GPUs, integer division is several times slower than
7672 multiplication. FXdiv implements an algorithm to replace an integer division
7673 with a multiplication and two shifts. This algorithm improves performance
7674 when an application performs repeated divisions by the same divisor.")
7675 (license license:expat))))
7678 ;; There is currently no tag in this repo.
7679 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
7684 (version (git-version version revision commit))
7685 (home-page "https://github.com/Maratyszcza/FP16")
7688 (uri (git-reference (url home-page) (commit commit)))
7689 (file-name (git-file-name name version))
7692 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
7693 (patches (search-patches "fp16-implicit-double.patch"
7694 "fp16-system-libraries.patch"))))
7695 (build-system cmake-build-system)
7697 `(#:imported-modules ((guix build python-build-system)
7698 ,@%cmake-build-system-modules)
7699 #:modules (((guix build python-build-system)
7700 #:select (site-packages))
7701 (guix build cmake-build-system)
7703 #:phases (modify-phases %standard-phases
7704 (add-after 'install 'move-python-files
7705 (lambda* (#:key inputs outputs #:allow-other-keys)
7706 ;; Python files get installed to $includedir (!).
7707 ;; Move them to the usual Python site directory.
7708 (let* ((out (assoc-ref outputs "out"))
7709 (include (string-append out "/include"))
7710 (site (site-packages inputs outputs))
7711 (target (string-append site "/fp16")))
7713 (for-each (lambda (file)
7715 (string-append target "/"
7718 (find-files include "\\.py$"))))))))
7720 (list python-wrapper))
7722 (list psimd googletest googlebenchmark))
7723 (synopsis "C++ library for half-precision floating point formats")
7725 "This header-only C++ library implements conversion to and from
7726 half-precision floating point formats.")
7727 (license license:expat))))
7729 (define-public optizelle
7730 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
7733 (version (git-version "1.3.0" "0" commit))
7738 (url "https://github.com/OptimoJoe/Optizelle")
7740 (file-name (git-file-name "optizelle" commit))
7743 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
7744 (modules '((guix build utils)))
7747 ;; Reduce the stopping tolerance in one test so that the
7748 ;; convergence check returns the correct stopping
7751 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
7752 (("1e-13") "5e-14"))
7753 ;; Skip one set of python tests. See
7754 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
7756 "src/examples/inequality_scaling/CMakeLists.txt"
7757 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
7758 (string-append "add_unit" middle "\"cpp\"" end)))
7759 ;; Install the licence for Optizelle, without also
7760 ;; including the licences for the dependencies.
7761 (substitute* "licenses/CMakeLists.txt"
7762 (("file.*package.*$" all)
7763 (string-append "# " all))
7764 ((".*[^l].[.]txt\\)\n") "")
7765 (("add_license.*\"\n") ""))
7767 (build-system cmake-build-system)
7769 `(#:imported-modules ((guix build python-build-system)
7770 ,@%cmake-build-system-modules)
7771 #:modules (((guix build python-build-system) #:select
7773 (guix build cmake-build-system)
7775 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
7776 "-DENABLE_CPP_UNIT:BOOL=ON"
7777 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
7778 "-DENABLE_PYTHON:BOOL=ON"
7779 "-DENABLE_PYTHON_UNIT:BOOL=ON"
7780 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
7781 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
7782 (assoc-ref %build-inputs
7784 "/lib/libopenblas.so")
7785 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7786 (assoc-ref %build-inputs
7788 "/lib/libgfortran.so;"
7789 (assoc-ref %build-inputs
7791 "/lib/libquadmath.so"))
7793 (modify-phases %standard-phases
7794 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7795 (lambda* (#:key inputs #:allow-other-keys)
7796 (let* ((pyver (python-version (assoc-ref inputs "python")))
7797 (npdir (string-append (assoc-ref inputs "numpy")
7800 (substitute* "src/cmake/Modules/Optizelle.cmake"
7802 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7803 "PYTHONPATH=" npdir ":"))))))
7804 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7806 `(("blas/lapack" ,openblas)
7807 ("fortran:lib" ,gfortran "lib")
7808 ("jsoncpp" ,jsoncpp)
7809 ("numpy" ,python-numpy)
7810 ("python" ,python)))
7812 `(("fortran" ,gfortran)
7813 ("pkg-config" ,pkg-config)))
7814 (home-page "https://www.optimojoe.com/products/optizelle/")
7815 (synopsis "Mathematical optimization library")
7816 (description "@code{optizelle} is a software library designed to
7817 solve nonlinear optimization problems. Four types of problem are
7818 considered: unconstrained, equality constrained, inequality
7819 constrained and constrained. Constraints may be applied as values of
7820 functions or sets of partial differential equations (PDEs).
7822 Solution algorithms such as the preconditioned nonlinear conjugate
7823 gradient method, sequential quadratic programming (SQP) and the
7824 primal-dual interior-point method are made available. Interfaces are
7825 provided for applications written in C++ and Python. Parallel
7826 computation is supported via MPI.")
7827 (license license:bsd-2))))