gnu: frama-c: Update to 23.1.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020, 2021 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nikita <nikita@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
35 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020, 2021 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
41 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
42 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
43 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
44 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
45 ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
46 ;;; Copyright © 2021 Franck Pérignon <franck.perignon@univ-grenoble-alpes.fr>
47 ;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
48 ;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
49 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
50 ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
51 ;;;
52 ;;; This file is part of GNU Guix.
53 ;;;
54 ;;; GNU Guix is free software; you can redistribute it and/or modify it
55 ;;; under the terms of the GNU General Public License as published by
56 ;;; the Free Software Foundation; either version 3 of the License, or (at
57 ;;; your option) any later version.
58 ;;;
59 ;;; GNU Guix is distributed in the hope that it will be useful, but
60 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
61 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 ;;; GNU General Public License for more details.
63 ;;;
64 ;;; You should have received a copy of the GNU General Public License
65 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
66
67 (define-module (gnu packages maths)
68 #:use-module (ice-9 regex)
69 #:use-module (ice-9 match)
70 #:use-module (gnu packages)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module (guix utils)
76 #:use-module ((guix build utils) #:select (alist-replace))
77 #:use-module (guix build-system cmake)
78 #:use-module (guix build-system glib-or-gtk)
79 #:use-module (guix build-system gnu)
80 #:use-module (guix build-system ocaml)
81 #:use-module (guix build-system python)
82 #:use-module (guix build-system ruby)
83 #:use-module (gnu packages algebra)
84 #:use-module (gnu packages audio)
85 #:use-module (gnu packages autotools)
86 #:use-module (gnu packages base)
87 #:use-module (gnu packages bison)
88 #:use-module (gnu packages boost)
89 #:use-module (gnu packages check)
90 #:use-module (gnu packages cmake)
91 #:use-module (gnu packages compression)
92 #:use-module (gnu packages coq)
93 #:use-module (gnu packages curl)
94 #:use-module (gnu packages cyrus-sasl)
95 #:use-module (gnu packages dbm)
96 #:use-module (gnu packages documentation)
97 #:use-module (gnu packages elf)
98 #:use-module (gnu packages emacs)
99 #:use-module (gnu packages file)
100 #:use-module (gnu packages flex)
101 #:use-module (gnu packages fltk)
102 #:use-module (gnu packages fontutils)
103 #:use-module (gnu packages gettext)
104 #:use-module (gnu packages gcc)
105 #:use-module (gnu packages gd)
106 #:use-module (gnu packages ghostscript)
107 #:use-module (gnu packages glib)
108 #:use-module (gnu packages graphviz)
109 #:use-module (gnu packages gtk)
110 #:use-module (gnu packages icu4c)
111 #:use-module (gnu packages image)
112 #:use-module (gnu packages java)
113 #:use-module (gnu packages less)
114 #:use-module (gnu packages lisp)
115 #:use-module (gnu packages linux)
116 #:use-module (gnu packages llvm)
117 #:use-module (gnu packages logging)
118 #:use-module (gnu packages lua)
119 #:use-module (gnu packages gnome)
120 #:use-module (gnu packages guile)
121 #:use-module (gnu packages xorg)
122 #:use-module (gnu packages gl)
123 #:use-module (gnu packages imagemagick)
124 #:use-module (gnu packages m4)
125 #:use-module (gnu packages mpi)
126 #:use-module (gnu packages multiprecision)
127 #:use-module (gnu packages ncurses)
128 #:use-module (gnu packages netpbm)
129 #:use-module (gnu packages ocaml)
130 #:use-module (gnu packages onc-rpc)
131 #:use-module (gnu packages parallel)
132 #:use-module (gnu packages pcre)
133 #:use-module (gnu packages popt)
134 #:use-module (gnu packages perl)
135 #:use-module (gnu packages pkg-config)
136 #:use-module (gnu packages pulseaudio)
137 #:use-module (gnu packages python)
138 #:use-module (gnu packages python-web)
139 #:use-module (gnu packages python-xyz)
140 #:use-module (gnu packages qt)
141 #:use-module (gnu packages readline)
142 #:use-module (gnu packages ruby)
143 #:use-module (gnu packages tbb)
144 #:use-module (gnu packages scheme)
145 #:use-module (gnu packages serialization)
146 #:use-module (gnu packages shells)
147 #:use-module (gnu packages tcl)
148 #:use-module (gnu packages texinfo)
149 #:use-module (gnu packages tex)
150 #:use-module (gnu packages tls)
151 #:use-module (gnu packages version-control)
152 #:use-module (gnu packages wxwidgets)
153 #:use-module (gnu packages xml)
154 #:use-module (srfi srfi-1)
155 #:use-module (srfi srfi-26))
156
157 (define-public aris
158 (package
159 (name "aris")
160 (version "2.2")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
164 (sha256 (base32
165 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
166 (build-system gnu-build-system)
167 (inputs `(("gtk+" ,gtk+)
168 ("libxml2" ,libxml2)))
169 (native-inputs `(("pkg-config" ,pkg-config)))
170 (synopsis "Natural deduction first-order logic interface")
171 (description "Aris is a program for performing logical proofs. It supports
172 propositional and predicate logic, as well as Boolean algebra and
173 arithmetical logic. In addition to its predefined inference and equivalence
174 rules, Aris also supports references to older proofs. Its use of standard
175 logical symbols and its natural deduction interface make it easy to use for
176 beginners.")
177 (license license:gpl3+)
178 (home-page "https://www.gnu.org/software/aris/")))
179
180 (define-public bitwise
181 (package
182 (name "bitwise")
183 (version "0.42")
184 (source (origin
185 (method url-fetch)
186 (uri (string-append "https://github.com/mellowcandle/bitwise"
187 "/releases/download/v" version
188 "/bitwise-v" version ".tar.gz"))
189 (sha256
190 (base32 "1lniw4bsb5qs5ybf018qllf95pzixb1q3lvybzl4k3xz8zpkrm6k"))))
191 (build-system gnu-build-system)
192 (inputs
193 `(("ncurses" ,ncurses)
194 ("readline" ,readline)))
195 (native-inputs
196 `(("cunit" ,cunit)
197 ("pkg-config" ,pkg-config)))
198 (synopsis "Terminal based bit manipulator in ncurses")
199 (description "Bitwise is a multi base interactive calculator supporting
200 dynamic base conversion and bit manipulation. It's a handy tool for low level
201 hackers, kernel developers and device drivers developers.
202
203 Some of the features include:
204 @itemize
205 @item Interactive ncurses interface.
206 @item Command line calculator supporting all bitwise operations.
207 @item Individual bit manipulator.
208 @item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
209 @end itemize")
210 (license license:gpl3+)
211 (home-page "https://github.com/mellowcandle/bitwise/")))
212
213 (define-public c-graph
214 (package
215 (name "c-graph")
216 (version "2.0.1")
217 (source (origin
218 (method url-fetch)
219 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
220 ".tar.gz"))
221 (sha256 (base32
222 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
223 (build-system gnu-build-system)
224 (inputs
225 `(("fortran" ,gfortran)))
226 (synopsis "Visualizing and demonstrating convolution")
227 (description
228 "GNU C-Graph is a tool for demonstrating the theory of convolution.
229 Thus, it can serve as an excellent aid to students of signal and systems
230 theory in visualizing the convolution process. Rather than forcing the
231 student to write code, the program offers an intuitive interface with
232 interactive dialogs to guide them.")
233 (license license:gpl3+)
234 (home-page "https://www.gnu.org/software/c-graph/")))
235
236 (define-public coda
237 (package
238 (name "coda")
239 (version "2.19")
240 (source
241 (origin
242 (method url-fetch)
243 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
244 version "/coda-" version ".tar.gz"))
245 (sha256
246 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
247 (patches (search-patches "coda-use-system-libs.patch"))
248 (modules '((guix build utils)))
249 (snippet
250 ;; Make sure we don't use the bundled software.
251 '(begin
252 (for-each (lambda (d)
253 (delete-file-recursively (string-append "libcoda/" d)))
254 '("zlib" "pcre" "expat"))
255 #t))))
256 (native-inputs
257 `(("fortran" ,gfortran)
258 ("python" ,python)
259 ("python-numpy" ,python-numpy)))
260 (inputs
261 `(("zlib" ,zlib)
262 ("pcre" ,pcre)
263 ("expat" ,expat)
264 ("hdf4" ,hdf4-alt)
265 ("hdf5" ,hdf5)))
266 (build-system gnu-build-system)
267 (arguments
268 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
269 "LIBS= -lz -lpcre -lexpat")))
270 (synopsis "A common interface to various earth observation data formats")
271 (description
272 "The Common Data Access toolbox (CODA) provides a set of interfaces for
273 reading remote sensing data from earth observation data files. It consists of
274 command line applications and interfaces to the C, Fortran, Python, and Java
275 programming languages.")
276 (home-page "https://stcorp.nl/coda")
277 (license license:gpl2+)))
278
279 (define-public qhull
280 (package
281 (name "qhull")
282 (version "2020.2")
283 (source (origin
284 (method url-fetch)
285 (uri (string-append "http://www.qhull.org/download/qhull-"
286 (car (string-split version #\.))
287 "-src-8.0.2.tgz"))
288 (sha256
289 (base32
290 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
291 (build-system cmake-build-system)
292 (arguments
293 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
294 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
295 (synopsis "Calculate convex hulls and related structures")
296 (description
297 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
298 diagram, halfspace intersection about a point, furthest-site Delaunay
299 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
300 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
301 algorithm for computing the convex hull. It handles roundoff errors from
302 floating point arithmetic. It computes volumes, surface areas, and
303 approximations to the convex hull.
304
305 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
306 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
307 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
308 triangulations.")
309 (home-page "http://qhull.org")
310 (license (license:non-copyleft "file://COPYING.txt"
311 "See COPYING in the distribution."))))
312
313 (define-public python-cvxopt
314 (package
315 (name "python-cvxopt")
316 (version "1.2.3")
317 (source (origin
318 (method git-fetch)
319 (uri (git-reference
320 (url "https://github.com/cvxopt/cvxopt")
321 (commit version)))
322 (file-name (git-file-name name version))
323 (sha256
324 (base32
325 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
326 (build-system python-build-system)
327 (arguments
328 `(#:phases
329 (modify-phases %standard-phases
330 (add-after 'unpack 'find-libraries
331 (lambda* (#:key inputs #:allow-other-keys)
332 (setenv "CVXOPT_BLAS_LIB" "openblas")
333 (setenv "CVXOPT_BUILD_FFTW" "1")
334 (setenv "CVXOPT_BUILD_GLPK" "1")
335 (setenv "CVXOPT_BUILD_GSL" "1")
336 #t)))))
337 (inputs
338 `(("fftw" ,fftw)
339 ("glpk" ,glpk)
340 ("gsl" ,gsl)
341 ("lapack" ,lapack)
342 ("openblas" ,openblas)
343 ("suitesparse" ,suitesparse)))
344 (home-page "https://www.cvxopt.org")
345 (synopsis "Python library for convex optimization")
346 (description
347 "CVXOPT is a package for convex optimization based on the Python
348 programming language. Its main purpose is to make the development of software
349 for convex optimization applications straightforward by building on Python’s
350 extensive standard library and on the strengths of Python as a high-level
351 programming language.")
352 (license license:gpl3+)))
353
354 (define-public python2-cvxopt
355 (package-with-python2 python-cvxopt))
356
357 (define-public units
358 (package
359 (name "units")
360 (version "2.21")
361 (source (origin
362 (method url-fetch)
363 (uri (string-append "mirror://gnu/units/units-" version
364 ".tar.gz"))
365 (sha256 (base32
366 "1bybhqs4yrly9myb5maz3kdmf8k4fhk2m1d5cbcryn40z6lq0gkc"))))
367 (build-system gnu-build-system)
368 (inputs
369 `(("readline" ,readline)
370 ("python" ,python-wrapper) ;for 'units_cur' script
371 ("python-requests" ,python-requests)))
372 (arguments
373 `(#:phases (modify-phases %standard-phases
374 (add-after 'install 'wrap-units_cur
375 (lambda* (#:key outputs #:allow-other-keys)
376 (let* ((out (assoc-ref outputs "out"))
377 (bin (string-append out "/bin")))
378 (wrap-program (string-append bin "/units_cur")
379 `("PYTHONPATH" ":" prefix
380 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
381 #t))))))
382 (synopsis "Conversion between thousands of scales")
383 (description
384 "GNU Units converts numeric quantities between units of measure. It
385 can handle scale changes through adaptive usage of standard scale
386 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
387 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
388 enough to be used effectively as a scientific calculator.")
389 (license license:gpl3+)
390 (home-page "https://www.gnu.org/software/units/")))
391
392 (define-public double-conversion
393 (package
394 (name "double-conversion")
395 (version "3.1.5")
396 (home-page "https://github.com/google/double-conversion")
397 (source (origin
398 (method git-fetch)
399 (uri (git-reference (url home-page)
400 (commit (string-append "v" version))))
401 (file-name (git-file-name name version))
402 (sha256
403 (base32
404 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
405 (build-system cmake-build-system)
406 (arguments
407 '(#:test-target "test"
408 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
409 "-DBUILD_TESTING=ON")))
410 (synopsis "Conversion routines for IEEE doubles")
411 (description
412 "The double-conversion library provides binary-decimal and decimal-binary
413 routines for IEEE doubles. The library consists of efficient conversion
414 routines that have been extracted from the V8 JavaScript engine.")
415 (license license:bsd-3)))
416
417 (define-public dionysus
418 (package
419 (name "dionysus")
420 (version "1.4.0")
421 (source (origin
422 (method url-fetch)
423 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
424 ".tar.xz"))
425 (sha256
426 (base32
427 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
428 (build-system gnu-build-system)
429 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
430 (synopsis "Local search for universal constants and scientific values")
431 (description
432 "GNU Dionysus is a convenient system for quickly retrieving the values of
433 mathematical constants used in science and engineering. Values can be
434 searched using a simple command-line tool, choosing from three databases:
435 universal constants, atomic numbers, and constants related to
436 semiconductors.")
437 (license license:gpl3+)
438 (home-page "https://www.gnu.org/software/dionysus/")))
439
440 (define-public dsfmt
441 (package
442 (name "dsfmt")
443 (version "2.2.3")
444 (source
445 (origin
446 (method url-fetch)
447 (uri
448 (string-append
449 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
450 "dSFMT-src-" version ".tar.gz"))
451 (sha256
452 (base32
453 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
454 (modules '((guix build utils)))
455 ;; Don't distribute html documentation with bundled jquery.
456 (snippet
457 '(begin
458 (delete-file-recursively "html") #t))
459 ;; Add patches borrowed from Julia.
460 (patches
461 (list
462 (origin
463 (method url-fetch)
464 (uri (string-append
465 "https://raw.githubusercontent.com/JuliaLang/julia/"
466 "v1.3.0/deps/patches/dSFMT.c.patch"))
467 (sha256 (base32
468 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
469 (file-name "dSFMT.c.patch"))
470 (origin
471 (method url-fetch)
472 (uri (string-append
473 "https://raw.githubusercontent.com/JuliaLang/julia/"
474 "v1.3.0/deps/patches/dSFMT.h.patch"))
475 (sha256 (base32
476 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
477 (file-name "dSFMT.h.patch"))))))
478 (build-system gnu-build-system)
479 (arguments
480 `(#:phases
481 (modify-phases %standard-phases
482 (delete 'configure) ; no configure script
483 (replace 'build
484 ;; Upstream Makefile does not build a shared library. Borrow from Julia
485 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
486 (lambda _
487 (invoke
488 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
489 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
490 "-O3" "-finline-functions" "-fomit-frame-pointer"
491 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
492 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
493 "-o" "libdSFMT.so")))
494 (replace 'install ; no "install" target
495 (lambda* (#:key outputs #:allow-other-keys)
496 (let* ((out (assoc-ref outputs "out"))
497 (lib (string-append out "/lib"))
498 (inc (string-append out "/include"))
499 (doc (string-append out "/share/doc/" ,name "-" ,version)))
500 (install-file "libdSFMT.so" lib)
501 (install-file "dSFMT.h" inc)
502 (install-file "LICENSE.txt" doc)
503 #t))))))
504 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
505 (description
506 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
507 the expensive conversion of integer to double (floating point). dSFMT directly
508 generates double precision floating point pseudorandom numbers which have the
509 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
510 format. dSFMT is only available on the CPUs which use IEEE 754 format double
511 precision floating point numbers.")
512 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
513 (license license:bsd-3)))
514
515 (define-public gsl
516 (package
517 (name "gsl")
518 (version "2.6")
519 (source (origin
520 (method url-fetch)
521 (uri (string-append "mirror://gnu/gsl/gsl-"
522 version ".tar.gz"))
523 (sha256
524 (base32
525 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
526 (build-system gnu-build-system)
527 (arguments
528 (let ((system (%current-system)))
529 (cond
530 ((or (string-prefix? "aarch64" system)
531 (string-prefix? "powerpc" system))
532 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
533 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
534 '(#:phases (modify-phases %standard-phases
535 (add-before 'check 'disable-failing-tests
536 (lambda _
537 (substitute* "spmatrix/test.c"
538 ((".*test_complex.*") "\n"))
539 #t)))))
540 ((string-prefix? "i686" system)
541 ;; There are rounding issues with these tests on i686:
542 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
543 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
544 '(#:phases (modify-phases %standard-phases
545 (add-before 'check 'disable-failing-tests
546 (lambda _
547 (substitute* "linalg/test.c"
548 ((".*gsl_test\\(test_LU_decomp.*") "\n")
549 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
550 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
551 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
552 (substitute* "spmatrix/test.c"
553 ((".*test_all.*") "\n")
554 ((".*test_float.*") "\n")
555 ((".*test_complex.*") "\n"))
556 #t)))))
557 (else '()))))
558 (home-page "https://www.gnu.org/software/gsl/")
559 (synopsis "Numerical library for C and C++")
560 (description
561 "The GNU Scientific Library is a library for numerical analysis in C
562 and C++. It includes a wide range of mathematical routines, with over 1000
563 functions in total. Subject areas covered by the library include:
564 differential equations, linear algebra, Fast Fourier Transforms and random
565 numbers.")
566 (license license:gpl3+)))
567
568 (define-public sleef
569 (package
570 (name "sleef")
571 (version "3.5.1")
572 (source
573 (origin
574 (method git-fetch)
575 (uri (git-reference
576 (url "https://github.com/shibatch/sleef")
577 (commit version)))
578 (file-name (git-file-name name version))
579 (sha256
580 (base32 "1jybqrl2dvjxzg30xrhh847s375n2jr1pix644wi6hb5wh5mx3f7"))))
581 (build-system cmake-build-system)
582 (arguments
583 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
584 (string-append "-DCMAKE_INSTALL_LIBDIR="
585 (assoc-ref %outputs "out")
586 "/lib")
587 (string-append "-DCMAKE_INSTALL_PREFIX="
588 (assoc-ref %outputs "out")))
589 #:phases
590 (modify-phases %standard-phases
591 ;; SLEEF generates a header library during the build process and writes
592 ;; to it via shell redirection. Make the checkout writable so the
593 ;; build can succeed.
594 (add-after 'unpack 'make-git-checkout-writable
595 (lambda _
596 (for-each make-file-writable (find-files "."))
597 #t)))))
598 (inputs
599 `(("fftw" ,fftw)
600 ("gmp" ,gmp)
601 ("mpfr" ,mpfr)
602 ("openssl" ,openssl)))
603 (home-page "https://sleef.org/")
604 (synopsis "SIMD library for evaluating elementary functions and DFT")
605 (description
606 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
607 implements vectorized versions of all C99 real floating point math functions.
608 It can utilize SIMD instructions that are available on modern processors.")
609 (license (list license:boost1.0 ;sleef
610 license:cc-by4.0)))) ;simplex algorithm
611
612 (define-public glpk
613 (package
614 (name "glpk")
615 (version "5.0")
616 (source
617 (origin
618 (method url-fetch)
619 (uri (string-append "mirror://gnu/glpk/glpk-"
620 version ".tar.gz"))
621 (sha256
622 (base32
623 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
624 (build-system gnu-build-system)
625 (inputs
626 `(("gmp" ,gmp)))
627 (arguments
628 `(#:configure-flags '("--with-gmp"
629 "--disable-static")))
630 (home-page "https://www.gnu.org/software/glpk/")
631 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
632 (description
633 "GLPK is a C library for solving large-scale linear programming (LP),
634 mixed integer programming (MIP), and other related problems. It supports the
635 GNU MathProg modeling language, a subset of the AMPL language, and features a
636 translator for the language. In addition to the C library, a stand-alone
637 LP/MIP solver is included in the package.")
638 (license license:gpl3+)))
639
640 (define-public glpk-4
641 (package
642 (inherit glpk)
643 (name "glpk")
644 (version "4.65")
645 (source
646 (origin
647 (method url-fetch)
648 (uri (string-append "mirror://gnu/glpk/glpk-"
649 version ".tar.gz"))
650 (sha256
651 (base32
652 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))))
653
654 (define-public 4ti2
655 (package
656 (name "4ti2")
657 (version "1.6.9")
658 (source
659 (origin
660 (method url-fetch)
661 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
662 "Release_"
663 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
664 version)
665 "/4ti2-" version ".tar.gz"))
666 (sha256
667 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
668 (build-system gnu-build-system)
669 (native-inputs
670 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
671 (inputs
672 `(("glpk" ,glpk)
673 ("gmp" ,gmp)))
674 (home-page "http://www.4ti2.de/")
675 (synopsis "Mathematical tool suite for problems on linear spaces")
676 (description
677 "4ti2 implements algorithms for solving algebraic, geometric and
678 combinatorial problems on linear spaces. Among others, it solves systems
679 of linear equations, computes extreme rays of polyhedral cones, solves
680 integer programming problems and computes Markov bases for statistics.")
681 (license license:gpl2+)))
682
683 (define-public cddlib
684 (package
685 (name "cddlib")
686 (version "0.94i")
687 (source
688 (origin
689 (method url-fetch)
690 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
691 (string-delete #\. version) ".tar.gz"))
692 (sha256
693 (base32
694 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
695 (build-system gnu-build-system)
696 (inputs
697 `(("gmp" ,gmp)))
698 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
699 (synopsis "Library for convex hulls and extreme rays of polyhedra")
700 (description
701 "The C-library cddlib implements the Double Description Method of
702 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
703 rays of a general convex polyhedron given by a system of linear inequalities
704 in arbitrary dimension. It can also be used for the converse operation of
705 computing convex hulls.")
706 (license license:gpl2+)))
707
708 (define-public lrslib
709 (package
710 (name "lrslib")
711 (version "7.1")
712 (source
713 (origin
714 (method url-fetch)
715 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
716 "lrslib-0"
717 (string-delete #\. version) ".tar.gz"))
718 (sha256
719 (base32
720 "05kq3hzam31dlmkccv3v358r478kpvx76mw37ka12c6ypwv5dsnk"))))
721 (build-system gnu-build-system)
722 (inputs
723 `(("gmp" ,gmp)))
724 (arguments
725 `(#:tests? #f ; no check phase
726 #:make-flags `("CC=gcc"
727 ,(string-append "prefix=" (assoc-ref %outputs "out"))
728 "all-shared")
729 #:phases
730 (modify-phases %standard-phases
731 (replace 'configure
732 (lambda _
733 (substitute* "makefile"
734 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
735 #t)))))
736 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
737 (synopsis "Convex hulls of polyhedra with exact arithmetic")
738 (description
739 "The C code of lrslib implements the reverse search algorithm for
740 vertex enumeration and convex hull problems. Its input file format is
741 compatible with cddlib. All computations are done exactly in either
742 multiple precision or fixed integer arithmetic. Output is not stored
743 in memory, so even problems with very large output sizes can sometimes
744 be solved.")
745 (license license:gpl2+)))
746
747 (define-public libcerf
748 (package
749 (name "libcerf")
750 (version "1.14")
751 (source
752 (origin
753 (method git-fetch)
754 (uri (git-reference
755 (url "https://jugit.fz-juelich.de/mlz/libcerf")
756 (commit (string-append "v" version))))
757 (file-name (git-file-name name version))
758 (sha256
759 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
760 (build-system cmake-build-system)
761 (native-inputs
762 `(("perl" ,perl)))
763 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
764 (synopsis "Library for complex error functions")
765 (description
766 "@code{libcerf} is a self-contained numeric library that provides an
767 efficient and accurate implementation of complex error functions, along with
768 Dawson, Faddeeva, and Voigt functions.")
769 (license license:expat)))
770
771 (define-public vinci
772 (package
773 (name "vinci")
774 (version "1.0.5")
775 (source
776 (origin
777 (method url-fetch)
778 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
779 "vinci/vinci-" version ".tar.gz"))
780 (sha256
781 (base32
782 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
783 (build-system gnu-build-system)
784 (inputs
785 `(("lrslib" ,lrslib)))
786 (arguments
787 `(#:tests? #f ; no check phase
788 #:phases
789 (modify-phases %standard-phases
790 (replace 'configure
791 ;; register the lrs location in the config file
792 (lambda* (#:key inputs #:allow-other-keys)
793 (let* ((lrs (assoc-ref inputs "lrslib"))
794 (lrsexec (string-append lrs "/bin/lrs")))
795 (substitute* "vinci.h"
796 (("#define LRS_EXEC \"lrs\"")
797 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
798 #t))
799 (replace 'install
800 (lambda* (#:key outputs #:allow-other-keys)
801 (let* ((out (assoc-ref outputs "out"))
802 (bin (string-append out "/bin")))
803 (install-file "vinci" bin))
804 #t)))))
805 (home-page
806 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
807 (synopsis "Volume computation for polytopes")
808 (description
809 "Vinci implements a number of volume computation algorithms for convex
810 polytopes in arbitrary dimension. The polytopes can be given by their
811 V-representation (as the convex hull of a finite number of vertices), by
812 their H-representation (as the bounded intersection of a finite number of
813 halfspaces) or by their double description with both representations.")
814 (license license:gpl2+)))
815
816 (define-public arpack-ng
817 (package
818 (name "arpack-ng")
819 (version "3.8.0")
820 (home-page "https://github.com/opencollab/arpack-ng")
821 (source (origin
822 (method git-fetch)
823 (uri (git-reference (url home-page) (commit version)))
824 (file-name (git-file-name name version))
825 (sha256
826 (base32
827 "0l7as5z6xvbxly8alam9s4kws70952qq35a6vkljzayi4b9gbklx"))))
828 (build-system gnu-build-system)
829 (native-inputs
830 `(("autoconf" ,autoconf)
831 ("automake" ,automake)
832 ("libtool" ,libtool)
833 ("pkg-config" ,pkg-config)))
834 (inputs
835 `(("eigen" ,eigen)
836 ("lapack" ,lapack)
837 ("fortran" ,gfortran)))
838 (synopsis "Fortran subroutines for solving eigenvalue problems")
839 (description
840 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
841 large scale eigenvalue problems.")
842 (license (license:non-copyleft "file://COPYING"
843 "See COPYING in the distribution."))))
844
845 (define-public arpack-ng-3.3.0
846 (package
847 (inherit arpack-ng)
848 (version "3.3.0")
849 (source
850 (origin
851 (method git-fetch)
852 (uri (git-reference (url (package-home-page arpack-ng))
853 (commit version)))
854 (file-name (git-file-name (package-name arpack-ng) version))
855 (sha256
856 (base32
857 "00h6bjvxjq7bv0b8pwnc0gw33ns6brlqv00xx2rh3w9b5n205918"))))))
858
859 (define-public arpack-ng-openmpi
860 (package (inherit arpack-ng)
861 (name "arpack-ng-openmpi")
862 (inputs
863 `(("mpi" ,openmpi)
864 ,@(package-inputs arpack-ng)))
865 (arguments
866 (substitute-keyword-arguments (package-arguments arpack-ng)
867 ((#:configure-flags _ '())
868 ''("--enable-mpi"))
869 ((#:phases phases '%standard-phases)
870 `(modify-phases ,phases
871 (add-before 'check 'mpi-setup
872 ,%openmpi-setup)))))
873 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
874
875 (define-public lapack
876 (package
877 (name "lapack")
878 (version "3.9.0")
879 (source
880 (origin
881 (method url-fetch)
882 (uri (string-append "http://www.netlib.org/lapack/lapack-"
883 version ".tgz"))
884 (sha256
885 (base32
886 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
887 (build-system cmake-build-system)
888 (home-page "http://www.netlib.org/lapack/")
889 (inputs `(("fortran" ,gfortran)
890 ("python" ,python-wrapper)))
891 (arguments
892 `(#:configure-flags (list
893 "-DBUILD_SHARED_LIBS:BOOL=YES"
894 "-DLAPACKE=ON"
895 ;; Build the 'LAPACKE_clatms' functions.
896 "-DLAPACKE_WITH_TMG=ON"
897 "-DBUILD_TESTING=ON")))
898 (synopsis "Library for numerical linear algebra")
899 (description
900 "LAPACK is a Fortran 90 library for solving the most commonly occurring
901 problems in numerical linear algebra.")
902 (license (license:non-copyleft "file://LICENSE"
903 "See LICENSE in the distribution."))))
904
905 (define-public clapack
906 (package
907 (name "clapack")
908 (version "3.2.1")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (string-append "http://www.netlib.org/clapack/clapack-"
913 version "-CMAKE.tgz"))
914 (sha256
915 (base32
916 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
917 (build-system cmake-build-system)
918 (arguments
919 `(#:phases
920 (modify-phases %standard-phases
921 ;; These tests use a lot of stack variables and segfault without
922 ;; lifting resource limits.
923 (add-after 'unpack 'disable-broken-tests
924 (lambda _
925 (substitute* "TESTING/CMakeLists.txt"
926 (("add_lapack_test.* xeigtstz\\)") ""))
927 #t))
928 (replace 'install
929 (lambda* (#:key outputs #:allow-other-keys)
930 (let* ((out (assoc-ref outputs "out"))
931 (libdir (string-append out "/lib"))
932 (f2cinc (string-append out "/include/libf2c")))
933 (mkdir-p f2cinc)
934 (display (getcwd))
935 (for-each (lambda (file)
936 (install-file file libdir))
937 '("SRC/liblapack.a"
938 "F2CLIBS/libf2c/libf2c.a"
939 "TESTING/MATGEN/libtmglib.a"
940 "BLAS/SRC/libblas.a"))
941 (for-each (lambda (file)
942 (install-file file f2cinc))
943 (cons "F2CLIBS/libf2c/arith.h"
944 (find-files (string-append "../clapack-"
945 ,version "-CMAKE/F2CLIBS/libf2c")
946 "\\.h$")))
947 (copy-recursively (string-append "../clapack-"
948 ,version "-CMAKE/INCLUDE")
949 (string-append out "/include"))
950 #t))))))
951 (home-page "https://www.netlib.org/clapack/")
952 (synopsis "Numerical linear algebra library for C")
953 (description
954 "The CLAPACK library was built using a Fortran to C conversion utility
955 called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
956 C code, and then modified to improve readability. CLAPACK's goal is to
957 provide LAPACK for someone who does not have access to a Fortran compiler.")
958 (license (license:non-copyleft "file://LICENSE"
959 "See LICENSE in the distribution."))))
960
961 (define-public scalapack
962 (package
963 (name "scalapack")
964 (version "2.0.2")
965 (source
966 (origin
967 (method url-fetch)
968 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
969 version ".tgz"))
970 (sha256
971 (base32
972 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
973 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
974 (build-system cmake-build-system)
975 (inputs
976 `(("mpi" ,openmpi)
977 ("fortran" ,gfortran)
978 ("lapack" ,lapack))) ;for testing only
979 (arguments
980 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
981 #:phases (modify-phases %standard-phases
982 (add-before 'check 'mpi-setup
983 ,%openmpi-setup))))
984 (home-page "http://www.netlib.org/scalapack/")
985 (synopsis "Library for scalable numerical linear algebra")
986 (description
987 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
988 routines on parallel distributed memory machines. ScaLAPACK solves dense and
989 banded linear systems, least squares problems, eigenvalue problems, and
990 singular value problems.")
991 (license (license:non-copyleft "file://LICENSE"
992 "See LICENSE in the distribution."))))
993
994 (define-public gnuplot
995 (package
996 (name "gnuplot")
997 (version "5.4.2")
998 (source (origin
999 (method url-fetch)
1000 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1001 version "/gnuplot-"
1002 version ".tar.gz"))
1003 (sha256
1004 (base32 "1fp7rbhjmz2w63r72kicf8lfszzimz2csfx868fracw167hpaz75"))))
1005 (build-system gnu-build-system)
1006 (inputs `(("readline" ,readline)
1007 ("cairo" ,cairo)
1008 ("pango" ,pango)
1009 ("gd" ,gd)
1010 ("lua" ,lua)))
1011 (native-inputs
1012 `(("pkg-config" ,pkg-config)
1013 ("texlive" ,texlive-tiny)))
1014 (arguments `(#:configure-flags (list (string-append
1015 "--with-texdir=" %output
1016 "/texmf-local/tex/latex/gnuplot"))
1017 ;; Plot on a dumb terminal during tests.
1018 #:make-flags '("GNUTERM=dumb")))
1019 (home-page "http://www.gnuplot.info")
1020 (synopsis "Command-line driven graphing utility")
1021 (description "Gnuplot is a portable command-line driven graphing
1022 utility. It was originally created to allow scientists and students to
1023 visualize mathematical functions and data interactively, but has grown to
1024 support many non-interactive uses such as web scripting. It is also used as a
1025 plotting engine by third-party applications like Octave.")
1026 ;; X11 Style with the additional restriction that derived works may only be
1027 ;; distributed as patches to the original.
1028 (license (license:fsf-free
1029 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1030
1031 (define-public gctp
1032 (package
1033 (name "gctp")
1034 (version "2.0.0")
1035 (source
1036 (origin
1037 (method git-fetch)
1038 (uri (git-reference
1039 (url "https://github.com/OkoSanto/GCTP")
1040 (commit (string-append "v" version))))
1041 (file-name (git-file-name name version))
1042 (sha256
1043 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
1044 (native-inputs
1045 `(("fortran" ,gfortran)))
1046 (build-system gnu-build-system)
1047 (synopsis "General Cartographic Transformation Package (GCTP)")
1048 (description
1049 "The General Cartographic Transformation Package (GCTP) is a system of
1050 software routines designed to permit the transformation of coordinate pairs
1051 from one map projection to another. The GCTP is the standard computer
1052 software used by the National Mapping Division for map projection
1053 computations.")
1054 (home-page "https://github.com/OkoSanto/GCTP")
1055 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
1056
1057 (define-public hdf4
1058 (package
1059 (name "hdf4")
1060 (version "4.2.14")
1061 (source
1062 (origin
1063 (method url-fetch)
1064 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
1065 version "/src/hdf-" version ".tar.bz2"))
1066 (sha256
1067 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
1068 (patches (search-patches "hdf4-architectures.patch"
1069 "hdf4-reproducibility.patch"
1070 "hdf4-shared-fortran.patch"
1071 "hdf4-tirpc.patch"))))
1072 (build-system gnu-build-system)
1073 (native-inputs
1074 `(("gfortran" ,gfortran)
1075 ("bison" ,bison)
1076 ("flex" ,flex)))
1077 (inputs
1078 `(("zlib" ,zlib)
1079 ("libjpeg" ,libjpeg-turbo)
1080 ("libtirpc" ,libtirpc)))
1081 (arguments
1082 `(#:parallel-tests? #f
1083 #:configure-flags (list "--enable-shared"
1084 (string-append "CPPFLAGS=-I"
1085 (assoc-ref %build-inputs "libtirpc")
1086 "/include/tirpc"))
1087 #:phases
1088 (modify-phases %standard-phases
1089 ;; This is inspired by two of Debian's patches.
1090 (add-before 'configure 'add-more-aarch64-support
1091 (lambda _
1092 (substitute* '("mfhdf/ncgen/ncgen.l"
1093 "mfhdf/ncgen/ncgenyy.c"
1094 "mfhdf/libsrc/netcdf.h.in")
1095 (("AIX5L64") "__aarch64__"))
1096 #t))
1097 (add-before 'configure 'patchbuild
1098 (lambda _
1099 (substitute*
1100 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
1101 (("/bin/rm") "rm")
1102 (("/bin/mkdir") "mkdir"))
1103 (substitute* (find-files "." "^Makefile\\.in$")
1104 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
1105 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
1106 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
1107 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
1108 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
1109 #t))
1110 (add-after 'configure 'patch-settings
1111 (lambda _
1112 ;; libhdf4.settings contains the full path of the
1113 ;; compilers used, and its contents are included in
1114 ;; .so-files. We truncate the hashes to avoid
1115 ;; unnecessary store references to those compilers:
1116 (substitute* "libhdf4.settings"
1117 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1118 (string-append prefix (string-take hash 10) "...")))
1119 #t))
1120 (add-after 'install 'provide-absolute-libjpeg-reference
1121 (lambda* (#:key inputs outputs #:allow-other-keys)
1122 (let ((out (assoc-ref outputs "out"))
1123 (libjpeg (assoc-ref inputs "libjpeg")))
1124 ;; libjpeg-turbo does not provide a .la file, so libtool is
1125 ;; unable to add an absolute reference for -ljpeg in the .la
1126 ;; files. Fix it manually to avoid having to propagate it.
1127 (substitute* (find-files (string-append out "/lib") "\\.la$")
1128 (("-ljpeg")
1129 (string-append "-L" libjpeg "/lib -ljpeg")))
1130 #t))))))
1131 (home-page "https://www.hdfgroup.org/products/hdf4/")
1132 (synopsis
1133 "Library and multi-object file format for storing and managing data")
1134 (description "HDF4 is a library and multi-object file format for storing
1135 and managing data between machines. HDF4 is an older hierarchical data format,
1136 incompatible with HDF5.")
1137 (license
1138 (license:non-copyleft
1139 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
1140
1141 (define-public hdf4-alt
1142 (package
1143 (inherit hdf4)
1144 (name "hdf4-alt")
1145 (arguments
1146 (substitute-keyword-arguments (package-arguments hdf4)
1147 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
1148 (synopsis
1149 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
1150
1151 (define-public hdf5-1.8
1152 (package
1153 (name "hdf5")
1154 (version "1.8.22")
1155 (source
1156 (origin
1157 (method url-fetch)
1158 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1159 "hdf5-" (version-major+minor version)
1160 "/hdf5-" version "/src/hdf5-"
1161 version ".tar.bz2")
1162 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1163 "current"
1164 (match (string-split version #\.)
1165 ((major minor _ ...)
1166 (string-append major minor)))
1167 "/src/hdf5-" version ".tar.bz2")))
1168 (sha256
1169 (base32 "194ki2s5jrgl4czkvy5nc9nwjyapah0fj72l0gb0aysplp38i6v8"))
1170 (patches (search-patches "hdf5-config-date.patch"))))
1171 (build-system gnu-build-system)
1172 (inputs
1173 `(("zlib" ,zlib)))
1174 (native-inputs
1175 `(("gfortran" ,gfortran)
1176 ("perl" ,perl))) ;part of the test machinery needs Perl
1177 (outputs '("out" ; core library
1178 "fortran")) ; fortran interface
1179 (arguments
1180 `(;; Some of the users, notably Flann, need the C++ interface.
1181 #:configure-flags '("--enable-cxx"
1182 "--enable-fortran"
1183 "--enable-fortran2003"
1184
1185 ;; Build a thread-safe library. Unfortunately,
1186 ;; 'configure' invites you to either turn off C++,
1187 ;; Fortran, and the high-level interface (HL), or
1188 ;; to pass '--enable-unsupported'. Debian
1189 ;; packagers chose to pass '--enable-unsupported'
1190 ;; and we follow their lead here.
1191 "--enable-threadsafe"
1192 "--with-pthread"
1193 "--enable-unsupported")
1194 ;; Use -fPIC to allow the R bindings to link with the static libraries
1195 #:make-flags (list "CFLAGS=-fPIC"
1196 "CXXFLAGS=-fPIC")
1197 #:phases
1198 (modify-phases %standard-phases
1199 (add-before 'configure 'patch-configure
1200 (lambda* (#:key outputs #:allow-other-keys)
1201 (substitute* "configure"
1202 (("/bin/mv") "mv"))
1203 (substitute* "fortran/src/Makefile.in"
1204 (("libhdf5_fortran_la_LDFLAGS =")
1205 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1206 (assoc-ref outputs "fortran") "/lib")))
1207 (substitute* "hl/fortran/src/Makefile.in"
1208 (("libhdf5hl_fortran_la_LDFLAGS =")
1209 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1210 (assoc-ref outputs "fortran") "/lib")))
1211 #t))
1212 (add-after 'configure 'patch-settings
1213 (lambda _
1214 ;; libhdf5.settings contains the full path of the
1215 ;; compilers used, and its contents are included in
1216 ;; libhdf5.so. We truncate the hashes to avoid
1217 ;; unnecessary store references to those compilers:
1218 (substitute* "src/libhdf5.settings"
1219 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1220 (string-append prefix (string-take hash 10) "..."))
1221 ;; Don't record the build-time kernel version to make the
1222 ;; settings file reproducible.
1223 (("Uname information:.*")
1224 "Uname information: Linux\n"))
1225 #t))
1226 (add-after 'install 'patch-references
1227 (lambda* (#:key inputs outputs #:allow-other-keys)
1228 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1229 (zlib (assoc-ref inputs "zlib")))
1230 (substitute* (find-files bin "h5p?cc")
1231 (("-lz" lib)
1232 (string-append "-L" zlib "/lib " lib)))
1233 #t)))
1234 (add-after 'install 'split
1235 (lambda* (#:key inputs outputs #:allow-other-keys)
1236 ;; Move all fortran-related files
1237 (let* ((out (assoc-ref outputs "out"))
1238 (bin (string-append out "/bin"))
1239 (lib (string-append out "/lib"))
1240 (inc (string-append out "/include"))
1241 (ex (string-append out "/share/hdf5_examples/fortran"))
1242 (fort (assoc-ref outputs "fortran"))
1243 (fbin (string-append fort "/bin"))
1244 (flib (string-append fort "/lib"))
1245 (finc (string-append fort "/include"))
1246 (fex (string-append fort "/share/hdf5_examples/fortran")))
1247 (mkdir-p fbin)
1248 (mkdir-p flib)
1249 (mkdir-p finc)
1250 (mkdir-p fex)
1251 ;; Note: When built with --enable-parallel, the 'h5fc' file
1252 ;; doesn't exist, hence this condition.
1253 (when (file-exists? (string-append bin "/h5fc"))
1254 (rename-file (string-append bin "/h5fc")
1255 (string-append fbin "/h5fc")))
1256 (for-each (lambda (file)
1257 (rename-file file
1258 (string-append flib "/" (basename file))))
1259 (find-files lib ".*fortran.*"))
1260 (for-each (lambda (file)
1261 (rename-file file
1262 (string-append finc "/" (basename file))))
1263 (find-files inc ".*mod"))
1264 (for-each (lambda (file)
1265 (rename-file file
1266 (string-append fex "/" (basename file))))
1267 (find-files ex ".*"))
1268 (delete-file-recursively ex))
1269 #t)))))
1270 (home-page "https://www.hdfgroup.org")
1271 (synopsis "Management suite for extremely large and complex data")
1272 (description "HDF5 is a suite that makes possible the management of
1273 extremely large and complex data collections.")
1274 (license (license:x11-style
1275 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1276
1277 (define-public hdf5-1.10
1278 (package
1279 (inherit hdf5-1.8)
1280 (version "1.10.7")
1281 (source
1282 (origin
1283 (method url-fetch)
1284 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1285 "hdf5-" (version-major+minor version)
1286 "/hdf5-" version "/src/hdf5-"
1287 version ".tar.bz2")
1288 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1289 "current"
1290 (apply string-append
1291 (take (string-split version #\.) 2))
1292 "/src/hdf5-" version ".tar.bz2")))
1293 (sha256
1294 (base32 "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082"))
1295 (patches (search-patches "hdf5-config-date.patch"))))))
1296
1297 (define-public hdf5-1.12
1298 (package
1299 (inherit hdf5-1.8)
1300 (version "1.12.0")
1301 (source
1302 (origin
1303 (method url-fetch)
1304 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1305 "hdf5-" (version-major+minor version)
1306 "/hdf5-" version "/src/hdf5-"
1307 version ".tar.bz2")
1308 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1309 "current"
1310 (apply string-append
1311 (take (string-split version #\.) 2))
1312 "/src/hdf5-" version ".tar.bz2")))
1313 (sha256
1314 (base32 "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p"))
1315 (patches (search-patches "hdf5-config-date.patch"))))))
1316
1317 (define-public hdf5
1318 ;; Default version of HDF5.
1319 hdf5-1.10)
1320
1321 (define-public hdf-java
1322 (package
1323 (name "hdf-java")
1324 (version "3.3.2")
1325 (source
1326 (origin
1327 (method url-fetch)
1328 (uri (string-append
1329 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1330 version "/src/CMake-hdfjava-" version ".tar.gz"))
1331 (sha256
1332 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1333 (modules '((guix build utils)))
1334 (snippet ; Make sure we don't use the bundled sources and binaries.
1335 `(begin
1336 (for-each delete-file
1337 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1338 "HDF4.tar.gz" "HDF5.tar.gz"))
1339 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1340 #t))))
1341 (build-system gnu-build-system)
1342 (native-inputs
1343 `(("jdk" ,icedtea "jdk")
1344 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1345 ;; For tests:
1346 ("hamcrest-core" ,java-hamcrest-core)
1347 ("junit" ,java-junit)
1348 ("slf4j-simple" ,java-slf4j-simple)))
1349 (inputs
1350 `(("hdf4" ,hdf4)
1351 ("hdf5" ,hdf5-1.8)
1352 ("zlib" ,zlib)
1353 ("libjpeg" ,libjpeg-turbo)
1354 ("slf4j-api" ,java-slf4j-api)))
1355 (arguments
1356 `(#:configure-flags
1357 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1358 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1359 (assoc-ref %build-inputs "jdk") "/lib" )
1360 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1361 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1362
1363 #:make-flags
1364 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1365 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1366 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1367 (string-append "JPEGLIB="
1368 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1369 "LLEXT=so")
1370
1371 #:phases
1372 (modify-phases %standard-phases
1373 (add-before 'configure 'chdir-to-source
1374 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1375 (add-before 'configure 'patch-build
1376 (lambda* (#:key inputs outputs #:allow-other-keys)
1377 (substitute* "configure"
1378 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1379 (("/bin/cat") (which "cat")))
1380 ;; Set classpath for compilation
1381 (substitute* '("hdf/hdf5lib/Makefile.in"
1382 "hdf/hdf5lib/exceptions/Makefile.in"
1383 "hdf/hdflib/Makefile.in")
1384 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1385 (string-append (assoc-ref inputs "slf4j-api")
1386 "/share/java/slf4j-api.jar")))
1387 ;; Replace outdated config.sub and config.guess:
1388 (with-directory-excursion "config"
1389 (for-each (lambda (file)
1390 (install-file
1391 (string-append (assoc-ref inputs "automake")
1392 "/share/automake-"
1393 ,(version-major+minor (package-version automake))
1394 "/" file) "."))
1395 '("config.sub" "config.guess")))
1396
1397 ;; Fix embedded version number
1398 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1399 (substitute* "hdf/hdf5lib/H5.java"
1400 (("1, 8, 19")
1401 (string-join hdf5version ", "))))
1402
1403 (mkdir-p (string-append (assoc-ref outputs "out")))
1404 ;; Set classpath for tests
1405 (let* ((build-dir (getcwd))
1406 (lib (string-append build-dir "/lib"))
1407 (jhdf (string-append lib "/jhdf.jar"))
1408 (jhdf5 (string-append lib "/jhdf5.jar"))
1409 (testjars
1410 (append
1411 (map (lambda (i)
1412 (string-append (assoc-ref inputs i)
1413 "/share/java/" i ".jar"))
1414 '("slf4j-api" "slf4j-simple"))
1415 (list
1416 (car (find-files (assoc-ref inputs "junit") "jar$"))
1417 (car (find-files (assoc-ref inputs "hamcrest-core")
1418 "jar$")))))
1419 (class-path
1420 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1421
1422 (substitute* '("test/hdf5lib/Makefile.in"
1423 "test/hdf5lib/junit.sh.in"
1424 "examples/runExample.sh.in")
1425 (("/usr/bin/test")
1426 (string-append (assoc-ref inputs "coreutils")
1427 "/bin/test"))
1428 (("/usr/bin/uname")
1429 (string-append (assoc-ref inputs "coreutils")
1430 "/bin/uname"))
1431 (("CLASSPATH=[^\n]*")
1432 (string-append "CLASSPATH=" class-path)))
1433 (setenv "CLASSPATH" class-path))
1434 #t))
1435 (add-before 'check 'build-examples
1436 (lambda _
1437 (apply invoke `("javac"
1438 ,@(find-files "examples" ".*\\.java"))))))
1439
1440 #:parallel-build? #f
1441
1442 #:parallel-tests? #f ))
1443 (home-page "https://support.hdfgroup.org/products/java")
1444 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1445 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1446 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1447 implemented in C.")
1448
1449 ;; BSD-style license:
1450 (license (license:x11-style
1451 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1452 /current/src/unpacked/COPYING"))))
1453
1454 (define-public hdf-eos2
1455 (package
1456 (name "hdf-eos2")
1457 (version "19.1.0")
1458 (source
1459 (origin
1460 (method url-fetch)
1461 (uri "ftp://edhs1.gsfc.nasa.gov\
1462 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1463 (sha256
1464 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1465 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1466 "hdf-eos2-build-shared.patch"
1467 "hdf-eos2-fortrantests.patch"))))
1468 (build-system gnu-build-system)
1469 (native-inputs
1470 `(("gfortran" ,gfortran)))
1471 (inputs
1472 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1473 ;; XXX: These inputs are really dependencies of hdf4.
1474 ("zlib" ,zlib)
1475 ("libjpeg" ,libjpeg-turbo)
1476 ("libtirpc" ,libtirpc)
1477
1478 ("gctp" ,gctp)))
1479 (arguments
1480 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1481 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1482 #:parallel-tests? #f))
1483 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1484 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1485 (description "HDF-EOS2 is a software library built on HDF4 which supports
1486 the construction of data structures used in NASA's Earth Observing
1487 System (Grid, Point and Swath).")
1488
1489 ;; Source files carry a permissive license header.
1490 (license (license:non-copyleft home-page))))
1491
1492 (define-public hdf-eos5
1493 (package
1494 (name "hdf-eos5")
1495 (version "1.15")
1496 (source (origin
1497 (method url-fetch)
1498 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1499 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1500 (sha256
1501 (base32
1502 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1503 (patches (search-patches "hdf-eos5-build-shared.patch"
1504 "hdf-eos5-remove-gctp.patch"
1505 "hdf-eos5-fix-szip.patch"
1506 "hdf-eos5-fortrantests.patch"))))
1507 (native-inputs
1508 `(("gfortran" ,gfortran)))
1509 (build-system gnu-build-system)
1510 (inputs
1511 `(("hdf5" ,hdf5-1.8)
1512 ("zlib" ,zlib)
1513 ("gctp" ,gctp)))
1514 (arguments
1515 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1516 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1517 #:parallel-tests? #f))
1518 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1519 (description
1520 "HDF-EOS5 is a software library built on HDF5 to support the construction
1521 of data structures used in NASA's Earth Observing System (Grid, Point and
1522 Swath).")
1523 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1524
1525 ;; Source files carry a permissive license header.
1526 (license (license:non-copyleft home-page))))
1527
1528 (define-public hdf5-parallel-openmpi
1529 (package/inherit hdf5-1.10 ;use the latest
1530 (name "hdf5-parallel-openmpi")
1531 (inputs
1532 `(("mpi" ,openmpi)
1533 ,@(package-inputs hdf5)))
1534 (arguments
1535 (substitute-keyword-arguments (package-arguments hdf5)
1536 ((#:configure-flags flags)
1537 ``("--enable-parallel"
1538 ,@(delete "--enable-cxx"
1539 (delete "--enable-threadsafe" ,flags))))
1540 ((#:phases phases)
1541 `(modify-phases ,phases
1542 (add-after 'build 'mpi-setup
1543 ,%openmpi-setup)
1544 (add-before 'check 'patch-tests
1545 (lambda _
1546 ;; OpenMPI's mpirun will exit with non-zero status if it
1547 ;; detects an "abnormal termination", i.e. any process not
1548 ;; calling MPI_Finalize(). Since the test is explicitly
1549 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1550 ;; H5C_flush_cache from being called, mpirun will always
1551 ;; complain, so turn this test off.
1552 (substitute* "testpar/Makefile"
1553 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1554 (string-append front back "\n")))
1555 (substitute* "tools/test/h5diff/testph5diff.sh"
1556 (("/bin/sh") (which "sh")))
1557 #t))))))
1558 (synopsis "Management suite for data with parallel IO support")))
1559
1560 (define-public hdf5-blosc
1561 (package
1562 (name "hdf5-blosc")
1563 (version "1.0.0")
1564 (source
1565 (origin
1566 (method git-fetch)
1567 (uri (git-reference
1568 (url "https://github.com/Blosc/hdf5-blosc")
1569 (commit (string-append "v" version))))
1570 (file-name (git-file-name name version))
1571 (sha256
1572 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1573 (build-system cmake-build-system)
1574 (arguments
1575 `(#:configure-flags
1576 (list (string-append "-DBLOSC_INSTALL_DIR="
1577 (assoc-ref %build-inputs "c-blosc"))
1578 (string-append "-DPLUGIN_INSTALL_PATH="
1579 (assoc-ref %outputs "out")
1580 "/hdf5/lib/plugin"))
1581 #:phases
1582 (modify-phases %standard-phases
1583 (add-after 'unpack 'do-not-build-blosc
1584 (lambda _
1585 (substitute* "CMakeLists.txt"
1586 (("set\\(BLOSC_INSTALL_DIR.*") "")
1587 (("ExternalProject_Add\\(project_blosc") "message("))
1588 #t)))))
1589 (inputs
1590 `(("c-blosc" ,c-blosc)
1591 ("hdf5" ,hdf5-1.10)))
1592 (home-page "https://github.com/Blosc/hdf5-blosc")
1593 (synopsis "Filter for HDF5 using the Blosc compressor")
1594 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1595 installing this filter, you can read and write HDF5 files with
1596 Blosc-compressed datasets.")
1597 (license license:expat)))
1598
1599 (define-public h5check
1600 (package
1601 (name "h5check")
1602 (version "2.0.1")
1603 (source
1604 (origin
1605 (method url-fetch)
1606 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1607 "h5check/src/h5check-" version ".tar.gz"))
1608 (sha256
1609 (base32
1610 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1611 (build-system gnu-build-system)
1612 (inputs `(("hdf5" ,hdf5-1.8))) ;h5cc for tests
1613 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1614 (synopsis "HDF5 format checker")
1615 (description "@code{h5check} is a validation tool for verifying that an
1616 HDF5 file is encoded according to the HDF File Format Specification.")
1617 (license (license:x11-style "file://COPYING"))))
1618
1619 (define-public itpp
1620 (package
1621 (name "itpp")
1622 (version "4.3.1")
1623 (source (origin
1624 (method url-fetch)
1625 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1626 version "/itpp-"
1627 version ".tar.gz"))
1628 (sha256
1629 (base32
1630 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1631 (build-system cmake-build-system)
1632 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1633 (inputs `(("lapack" ,lapack)
1634 ("fftw" ,fftw)))
1635 ;; FIXME: Even though the fonts are available dvips complains:
1636 ;; "Font cmmi10 not found; characters will be left blank."
1637 (native-inputs
1638 `(("texlive" ,texlive-tiny)
1639 ("ghostscript" ,ghostscript)
1640 ("doxygen" ,doxygen)))
1641 (home-page "http://itpp.sourceforge.net")
1642 (synopsis "C++ library of maths, signal processing and communication classes")
1643 (description "IT++ is a C++ library of mathematical, signal processing and
1644 communication classes and functions. Its main use is in simulation of
1645 communication systems and for performing research in the area of
1646 communications. The kernel of the library consists of generic vector and
1647 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1648 similar to MATLAB, GNU Octave or SciPy.")
1649 (license license:gpl3+)))
1650
1651 (define-public netcdf
1652 (package
1653 (name "netcdf")
1654 (version "4.7.4")
1655 (source
1656 (origin
1657 (method url-fetch)
1658 (uri (string-append
1659 "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
1660 "netcdf-c-" version ".tar.gz"))
1661 (sha256
1662 (base32
1663 "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
1664 (patches (search-patches "netcdf-date-time.patch"))))
1665 (build-system gnu-build-system)
1666 (native-inputs
1667 `(("m4" ,m4)
1668 ("doxygen" ,doxygen)
1669 ("graphviz" ,graphviz)))
1670 (inputs
1671 `(("hdf4" ,hdf4-alt)
1672 ("hdf5" ,hdf5)
1673 ("curl" ,curl)
1674 ("zlib" ,zlib)
1675 ("libjpeg" ,libjpeg-turbo)))
1676 (arguments
1677 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1678
1679 #:phases (modify-phases %standard-phases
1680 (add-before 'configure 'fix-source-date
1681 (lambda _
1682 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1683 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1684 ;; to '1st hour of the current day', and therefore makes the
1685 ;; package not reproducible.
1686 (substitute* "./configure"
1687 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1688 "date --date='@0'"))
1689 #t))
1690 (add-after 'configure 'patch-settings
1691 (lambda _
1692 ;; libnetcdf.settings contains the full filename of the compilers
1693 ;; used to build the library. We truncate the hashes of those
1694 ;; filenames to avoid unnecessary references to the corresponding
1695 ;; store items.
1696 (substitute* "libnetcdf.settings"
1697 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1698 (string-append prefix (string-take hash 10) "...")))
1699 #t)))
1700
1701 #:parallel-tests? #f)) ;various race conditions
1702 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1703 (synopsis "Library for scientific data")
1704 (description "NetCDF is an interface for scientific data access and a
1705 software library that provides an implementation of the interface. The netCDF
1706 library defines a machine-independent format for representing scientific data.
1707 Together, the interface, library, and format support the creation, access, and
1708 sharing of scientific data.")
1709 (license (license:x11-style "file://COPYRIGHT"))))
1710
1711 (define-public netcdf-parallel-openmpi
1712 (package (inherit netcdf)
1713 (name "netcdf-parallel-openmpi")
1714 (inputs
1715 `(("mpi" ,openmpi)
1716 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1717 (package-inputs netcdf))))
1718 ;; TODO: Replace pkg-config references in nc-config with absolute references
1719 (arguments
1720 (substitute-keyword-arguments (package-arguments netcdf)
1721 ((#:configure-flags flags)
1722 `(cons* "CC=mpicc" "CXX=mpicxx"
1723 "--enable-parallel-tests"
1724 ;; Shared libraries not supported with parallel IO.
1725 "--disable-shared" "--with-pic"
1726 ,flags))
1727 ((#:phases phases '%standard-phases)
1728 `(modify-phases ,phases
1729 (add-after 'build 'mpi-setup
1730 ,%openmpi-setup)))))))
1731
1732 (define-public netcdf-fortran
1733 (package
1734 (name "netcdf-fortran")
1735 (version "4.5.3")
1736 (source (origin
1737 (method url-fetch)
1738 (uri (string-append
1739 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1740 version ".tar.gz"))
1741 (sha256
1742 (base32
1743 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
1744 (build-system gnu-build-system)
1745 (arguments
1746 `(#:parallel-tests? #f))
1747 (inputs
1748 `(("netcdf" ,netcdf)))
1749 (native-inputs
1750 `(("gfortran" ,gfortran)))
1751 (synopsis "Fortran interface for the netCDF library")
1752 (description (package-description netcdf))
1753 (home-page (package-home-page netcdf))
1754 (license (package-license netcdf))))
1755
1756 (define-public nlopt
1757 (package
1758 (name "nlopt")
1759 (version "2.4.2")
1760 (source (origin
1761 (method url-fetch)
1762 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1763 version ".tar.gz"))
1764 (sha256
1765 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1766 (build-system gnu-build-system)
1767 (arguments
1768 `(;; Shared libraries are not built by default. They are required to
1769 ;; build the Guile, Octave, and Python bindings.
1770 #:configure-flags '("--enable-shared")
1771
1772 #:phases
1773 (modify-phases %standard-phases
1774 (add-before 'configure 'set-libnlopt-file-name
1775 (lambda* (#:key outputs #:allow-other-keys)
1776 ;; Make sure the Scheme module refers to the library by its
1777 ;; absolute file name (we cannot do that from a snippet
1778 ;; because the expansion of @libdir@ contains
1779 ;; ${exec_prefix}.)
1780 (let ((out (assoc-ref outputs "out")))
1781 (substitute* "swig/nlopt.scm.in"
1782 (("libnlopt")
1783 (string-append out "/lib/libnlopt")))
1784 #t))))))
1785 (inputs `(("guile" ,guile-2.0)))
1786 (native-inputs `(("pkg-config" ,pkg-config)))
1787 (home-page "http://ab-initio.mit.edu/wiki/")
1788 (synopsis "Library for nonlinear optimization")
1789 (description "NLopt is a library for nonlinear optimization, providing a
1790 common interface for a number of different free optimization routines available
1791 online as well as original implementations of various other algorithms.")
1792 (license license:lgpl2.1+)))
1793
1794 (define-public ipopt
1795 (package
1796 (name "ipopt")
1797 (version "3.13.4")
1798 (source (origin
1799 (method git-fetch)
1800 (uri (git-reference
1801 (url "https://github.com/coin-or/Ipopt")
1802 (commit (string-append "releases/" version))))
1803 (file-name (git-file-name name version))
1804 (sha256
1805 (base32
1806 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
1807 (build-system gnu-build-system)
1808 (arguments
1809 '(#:phases (modify-phases %standard-phases
1810 (add-after 'install 'add--L-flags-in-ipopt.pc
1811 (lambda* (#:key inputs outputs #:allow-other-keys)
1812 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1813 ;; move it to "Libs.private" where it belongs, and add a
1814 ;; '-L' flag for LAPACK.
1815 (let ((out (assoc-ref outputs "out"))
1816 (lapack (assoc-ref inputs "lapack")))
1817 (substitute* (string-append out "/lib/pkgconfig/"
1818 "ipopt.pc")
1819 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1820 (string-append "Libs: " before " " after "\n"
1821 "Libs.private: " before
1822 "-L" lapack "/lib -llapack -lblas "
1823 after "\n")))
1824 #t))))))
1825 (native-inputs
1826 `(("gfortran" ,gfortran)
1827 ("pkg-config" ,pkg-config)))
1828 (inputs
1829 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1830 `(("lapack" ,lapack))) ;for both libblas and liblapack
1831 (home-page "https://www.coin-or.org")
1832 (synopsis "Large-scale nonlinear optimizer")
1833 (description
1834 "The Interior Point Optimizer (IPOPT) is a software package for
1835 large-scale nonlinear optimization. It provides C++, C, and Fortran
1836 interfaces.")
1837 (license license:epl2.0)))
1838
1839 (define-public nomad-optimizer
1840 (package
1841 (name "nomad-optimizer")
1842 (version "4.1.0")
1843 (source
1844 (origin
1845 (method git-fetch)
1846 (uri (git-reference
1847 (url "https://github.com/bbopt/nomad/")
1848 (commit (string-append "v" version))))
1849 (file-name (git-file-name name version))
1850 (sha256
1851 (base32
1852 "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
1853 (build-system cmake-build-system)
1854 (native-inputs
1855 `(("python" ,python-wrapper)
1856 ("python-cython" ,python-cython)))
1857 (arguments
1858 `(#:imported-modules ((guix build python-build-system)
1859 ,@%cmake-build-system-modules)
1860 #:modules (((guix build python-build-system)
1861 #:select (python-version site-packages))
1862 (guix build cmake-build-system)
1863 (guix build utils))
1864 #:configure-flags
1865 '("-DBUILD_INTERFACES=ON"
1866 "-DBUILD_TESTS=ON")
1867 #:phases
1868 (modify-phases %standard-phases
1869 (add-after 'unpack 'fix-sources-for-build
1870 (lambda* (#:key outputs #:allow-other-keys)
1871 (substitute* "CMakeLists.txt"
1872 ;; CMAKE_INSTALL_PREFIX is accidentally hardcoded.
1873 (("set\\(CMAKE_INSTALL_PREFIX .* FORCE\\)") "")
1874 ;; Requiring GCC version 8 or later is unwarranted.
1875 (("message\\(FATAL_ERROR \"GCC version < 8")
1876 "message(STATUS \"GCC version < 8"))
1877
1878 (let ((out (assoc-ref outputs "out")))
1879 (substitute* "interfaces/PyNomad/CMakeLists.txt"
1880 ;; We don't want to build in-place, and anyway the install
1881 ;; command further below runs build_ext as a prerequisite.
1882 (("COMMAND python setup_PyNomad\\.py .* build_ext --inplace\n")
1883 "")
1884 ;; Don't install locally.
1885 (("COMMAND python (setup_PyNomad\\.py .* install) --user\n"
1886 _ args)
1887 (string-append "COMMAND ${CMAKE_COMMAND} -E env"
1888 " CC=" ,(cc-for-target)
1889 " CXX=" ,(cxx-for-target)
1890 " " (which "python")
1891 " " args
1892 " --prefix=" out
1893 "\n")))
1894 ;; Fix erroneous assumptions about the paths of the include and
1895 ;; library directories.
1896 (substitute* "interfaces/PyNomad/setup_PyNomad.py"
1897 (("^( +os_include_dirs = ).*" _ prefix)
1898 (string-append prefix "[\"../../src\"]\n"))
1899 (("^(installed_lib_dir = ).*" _ prefix)
1900 (string-append prefix "\"" out "/lib\"\n"))))
1901 #t))
1902
1903 ;; Fix the tests so they run in out-of-source builds.
1904 (add-after 'fix-sources-for-build 'fix-sources-for-tests
1905 (lambda _
1906 (substitute*
1907 (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
1908 (append
1909 (map (lambda (d) (string-append "basic/library/" d))
1910 '("example1" "example2" "example3"
1911 "single_obj_parallel"))
1912 (map (lambda (d) (string-append "advanced/library/" d))
1913 '("FixedVariable" "NMonly" "PSDMads" "Restart"
1914 "c_api/example1" "c_api/example2"
1915 "exampleSuggestAndObserve"))))
1916 ;; The built examples are assumed to be in the source tree
1917 ;; (which isn't the case here).
1918 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
1919 _ command test)
1920 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
1921 ;; (Unrelated to support for out-of-source testing.)
1922 (make-file-writable
1923 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
1924
1925 (let* ((builddir (string-append (getcwd) "/../build"))
1926 ;; The BB_EXE and SURROGATE_EXE paths are interpreted
1927 ;; relative to the configuration file provided to NOMAD.
1928 ;; However, the configuration files are all in the source
1929 ;; tree rather than in the build tree (unlike the compiled
1930 ;; executables).
1931 (fix-exe-path (lambda* (dir #:optional
1932 (file "param.txt")
1933 (exe-opt "BB_EXE"))
1934 (substitute* (string-append dir "/" file)
1935 (((string-append "^" exe-opt " +"))
1936 ;; The $ prevents NOMAD from prefixing
1937 ;; the executable with the path of the
1938 ;; parent directory of the configuration
1939 ;; file NOMAD was provided with as
1940 ;; argument (param.txt or some such).
1941 (string-append exe-opt " $"
1942 builddir "/" dir "/"))))))
1943 (for-each
1944 (lambda (dir)
1945 (let ((dir (string-append "examples/" dir)))
1946 (substitute* (string-append dir "/CMakeLists.txt")
1947 ;; The install phase has not yet run.
1948 (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
1949 "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
1950 (fix-exe-path dir)
1951 (when (equal? dir "examples/basic/batch/surrogate_sort")
1952 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
1953 (append (map (lambda (d) (string-append "basic/batch/" d))
1954 '("example1" "example2"
1955 "single_obj" "single_obj_parallel"
1956 "surrogate_sort"))
1957 '("advanced/batch/LHonly")))
1958
1959 (let ((dir "examples/advanced/batch/FixedVariable"))
1960 (substitute* (string-append dir "/runFixed.sh")
1961 ;; Hardcoded path to NOMAD executable.
1962 (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
1963 (string-append builddir "/src/nomad ")))
1964 (for-each
1965 (lambda (f) (fix-exe-path dir f))
1966 '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))
1967 #t))
1968
1969 ;; The information in the .egg-info file is not kept up to date.
1970 (add-after 'install 'delete-superfluous-egg-info
1971 (lambda* (#:key inputs outputs #:allow-other-keys)
1972 (delete-file (string-append
1973 (site-packages inputs outputs)
1974 "PyNomad-0.0.0-py"
1975 (python-version (assoc-ref inputs "python"))
1976 ".egg-info"))
1977 #t)))))
1978 (home-page "https://www.gerad.ca/nomad/")
1979 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
1980 (description
1981 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
1982 algorithm, designed for difficult blackbox optimization problems. These
1983 problems occur when the functions defining the objective and constraints are
1984 the result of costly computer simulations.")
1985 (license license:lgpl3+)))
1986
1987 (define-public cbc
1988 (package
1989 (name "cbc")
1990 (version "2.10.5")
1991 (source (origin
1992 (method url-fetch)
1993 (uri (string-append "https://www.coin-or.org/download/source/"
1994 "Cbc/Cbc-" version ".tgz"))
1995 (sha256
1996 (base32
1997 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
1998 (modules '((guix build utils)))
1999 (snippet
2000 ;; Make sure we don't use the bundled software.
2001 '(delete-file-recursively "ThirdParty"))))
2002 (build-system gnu-build-system)
2003 (native-inputs
2004 `(("gfortran" ,gfortran)
2005 ("pkg-config" ,pkg-config)))
2006 (inputs
2007 `(("openblas" ,openblas)))
2008 (home-page "https://www.coin-or.org")
2009 (synopsis "Branch-and-cut solver")
2010 (description
2011 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
2012 solver written in C++. It can be used as a library or as a standalone
2013 executable.")
2014 (license license:epl1.0)))
2015
2016 (define-public clp
2017 (package
2018 (name "clp")
2019 (version "1.17.6")
2020 (source (origin
2021 (method url-fetch)
2022 (uri (string-append "https://www.coin-or.org/download/source/"
2023 "Clp/Clp-" version ".tgz"))
2024 (sha256
2025 (base32
2026 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
2027 (modules '((guix build utils)))
2028 (snippet
2029 ;; Make sure we don't use the bundled software.
2030 '(begin
2031 (delete-file-recursively "ThirdParty")
2032 #t))))
2033 (build-system gnu-build-system)
2034 (native-inputs
2035 `(("gfortran" ,gfortran)
2036 ("pkg-config" ,pkg-config)))
2037 (inputs
2038 `(("openblas" ,openblas)))
2039 (home-page "https://www.coin-or.org")
2040 (synopsis "Linear programming solver")
2041 (description
2042 "CLP is a high quality linear programming solver. Its main strengths are
2043 its dual and primal Simplex algorithms. It also has a barrier algorithm for
2044 linear and quadratic objectives. There are limited facilities for nonlinear
2045 and quadratic objectives using the Simplex algorithm.")
2046 (license license:epl1.0)))
2047
2048 (define-public gecode
2049 (package
2050 (name "gecode")
2051 (version "6.2.0")
2052 (source (origin
2053 (method git-fetch)
2054 (uri (git-reference
2055 (url "https://github.com/Gecode/gecode")
2056 (commit (string-append "release-" version))))
2057 (file-name (git-file-name name version))
2058 (sha256
2059 (base32
2060 "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
2061 (modules '((guix build utils)))
2062 (snippet
2063 '(begin
2064 ;; delete generated sources
2065 (for-each delete-file
2066 '("gecode/kernel/var-imp.hpp"
2067 "gecode/kernel/var-type.hpp"))))))
2068 (outputs '("out" "examples"))
2069 (build-system gnu-build-system)
2070 (arguments
2071 `(#:configure-flags
2072 (list (string-append "GLDFLAGS=-Wl,-rpath="
2073 (assoc-ref %outputs "out")
2074 "/lib")
2075 "--enable-examples=no")
2076 #:modules ((guix build gnu-build-system)
2077 (guix build utils)
2078 (ice-9 rdelim)
2079 (ice-9 popen))
2080 #:phases
2081 (modify-phases %standard-phases
2082 (add-after 'build 'build-examples
2083 (lambda* (#:key outputs #:allow-other-keys)
2084 (invoke "make" "compileexamples")))
2085 ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
2086 ;; patch it ourselves... *sigh*
2087 (add-after 'install 'fix-rpath
2088 (lambda* (#:key outputs #:allow-other-keys)
2089 (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
2090 (for-each
2091 (lambda (file)
2092 (let* ((pipe (open-pipe* OPEN_READ "patchelf"
2093 "--print-rpath" file))
2094 (line (read-line pipe)))
2095 (and (zero? (close-pipe pipe))
2096 (invoke "patchelf" "--set-rpath"
2097 (string-append libdir ":" line)
2098 file))))
2099 (find-files libdir ".*\\.so$")))))
2100 (add-after 'install 'install-examples
2101 (lambda* (#:key outputs #:allow-other-keys)
2102 (invoke "make" "installexamples"
2103 (string-append "bindir=" (assoc-ref outputs "examples")
2104 "/bin"))))
2105 ;; Tests depend on installed libraries.
2106 (delete 'check)
2107 (add-after 'fix-rpath 'check
2108 (assoc-ref %standard-phases 'check)))))
2109 (native-inputs
2110 `(("patchelf" ,patchelf)
2111 ("perl" ,perl)
2112 ("sed" ,sed)))
2113 (home-page "https://www.gecode.org")
2114 (synopsis "Toolkit for developing constraint-based systems")
2115 (description "Gecode is a C++ toolkit for developing constraint-based
2116 systems and applications. It provides a modular and extensible solver.")
2117 (license license:expat)))
2118
2119 (define-public libflame
2120 (package
2121 (name "libflame")
2122 (version "5.2.0")
2123 (outputs '("out" "static"))
2124 (source
2125 (origin
2126 (method git-fetch)
2127 (uri (git-reference
2128 (url "https://github.com/flame/libflame")
2129 (commit version)))
2130 (file-name (git-file-name name version))
2131 (sha256
2132 (base32
2133 "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
2134 (build-system gnu-build-system)
2135 (arguments
2136 `(#:configure-flags
2137 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
2138 (list "--enable-dynamic-build"
2139 "--enable-max-arg-list-hack"
2140 "--enable-lapack2flame"
2141 "--enable-verbose-make-output"
2142 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
2143 ,@(if (any (cute string-prefix? <> (or (%current-target-system)
2144 (%current-system)))
2145 '("x86_64" "i686"))
2146 '("--enable-vector-intrinsics=sse")
2147 '())
2148 "--enable-supermatrix"
2149 "--enable-memory-alignment=16"
2150 "--enable-ldim-alignment")
2151 #:phases
2152 (modify-phases %standard-phases
2153 (add-after 'unpack 'patch-/usr/bin/env-bash
2154 (lambda _
2155 (substitute* "build/config.mk.in"
2156 (("/usr/bin/env bash") (which "bash")))
2157 #t))
2158 (replace 'check
2159 (lambda* (#:key tests? #:allow-other-keys)
2160 (substitute* "test/Makefile"
2161 (("LIBBLAS .*") "LIBBLAS = -lblas\n")
2162 (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
2163 (if tests?
2164 (with-directory-excursion "test"
2165 (mkdir "obj")
2166 (invoke "make")
2167 (invoke "./test_libflame.x"))
2168 #t)))
2169 (add-after 'install 'install-static
2170 (lambda* (#:key outputs #:allow-other-keys)
2171 (let ((out (assoc-ref outputs "out"))
2172 (static (assoc-ref outputs "static")))
2173 (mkdir-p (string-append static "/lib"))
2174 (rename-file (string-append out "/lib/libflame.a")
2175 (string-append static "/lib/libflame.a"))
2176 (install-file (string-append out "/include/FLAME.h")
2177 (string-append static "/include"))
2178 #t))))))
2179 (inputs
2180 `(("gfortran" ,gfortran)))
2181 (native-inputs
2182 `(("lapack" ,lapack)
2183 ("openblas" ,openblas)
2184 ("perl" ,perl)
2185 ("python" ,python-wrapper)))
2186 (home-page "https://github.com/flame/libflame")
2187 (synopsis "High-performance object-based library for DLA computations")
2188 (description "@code{libflame} is a portable library for dense matrix
2189 computations, providing much of the functionality present in LAPACK, developed
2190 by current and former members of the @acronym{SHPC, Science of High-Performance
2191 Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
2192 Computational Engineering and Sciences} at The University of Texas at Austin.
2193 @code{libflame} includes a compatibility layer, @code{lapack2flame}, which
2194 includes a complete LAPACK implementation.")
2195 (license license:bsd-3)))
2196
2197 (define-public ceres
2198 (package
2199 (name "ceres-solver")
2200 (version "1.14.0")
2201 (home-page "http://ceres-solver.org/")
2202 (source (origin
2203 (method url-fetch)
2204 (uri (string-append home-page "ceres-solver-"
2205 version ".tar.gz"))
2206 (sha256
2207 (base32
2208 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
2209 (build-system cmake-build-system)
2210 (arguments
2211 ;; TODO: Build HTML user documentation and install separately.
2212 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
2213 "-DBUILD_SHARED_LIBS=ON")
2214
2215 #:phases (modify-phases %standard-phases
2216 (add-before 'configure 'set-library-directory
2217 (lambda _
2218 ;; Install libraries to lib/, not lib64/.
2219 (substitute* "internal/ceres/CMakeLists.txt"
2220 (("set\\(LIB_SUFFIX \"64\"\\)")
2221 "set(LIB_SUFFIX \"\")"))
2222 #t)))))
2223 (native-inputs
2224 `(("pkg-config" ,pkg-config)))
2225 (propagated-inputs
2226 `(("glog" ,glog))) ;for #include <glog/glog.h>
2227 (inputs
2228 `(("eigen" ,eigen)
2229 ("blas" ,openblas)
2230 ("lapack" ,lapack)
2231 ("suitesparse" ,suitesparse)
2232 ("gflags" ,gflags)))
2233 (synopsis "C++ library for solving large optimization problems")
2234 (description
2235 "Ceres Solver is a C++ library for modeling and solving large,
2236 complicated optimization problems. It is a feature rich, mature and
2237 performant library which has been used in production since 2010. Ceres Solver
2238 can solve two kinds of problems:
2239 @enumerate
2240 @item non-linear least squares problems with bounds constraints;
2241 @item general unconstrained optimization problems.
2242 @end enumerate\n")
2243 (license license:bsd-3)))
2244
2245 ;; For a fully featured Octave, users are strongly recommended also to install
2246 ;; the following packages: less, ghostscript, gnuplot.
2247 (define-public octave-cli
2248 (package
2249 (name "octave-cli")
2250 (version "6.2.0")
2251 (source
2252 (origin
2253 (method url-fetch)
2254 (uri (string-append "mirror://gnu/octave/octave-"
2255 version ".tar.xz"))
2256 (sha256
2257 (base32
2258 "06id09zspya24gshcwgp039cp35c06150mdlxysawgnbrhj16wkv"))))
2259 (build-system gnu-build-system)
2260 (inputs
2261 `(("alsa-lib" ,alsa-lib)
2262 ("arpack" ,arpack-ng)
2263 ("bdb" ,bdb)
2264 ("curl" ,curl)
2265 ("fftw" ,fftw)
2266 ("fftwf" ,fftwf)
2267 ("fltk" ,fltk)
2268 ("fontconfig" ,fontconfig)
2269 ("freetype" ,freetype)
2270 ("gl2ps" ,gl2ps)
2271 ("glpk" ,glpk)
2272 ("glu" ,glu)
2273 ("graphicsmagick" ,graphicsmagick)
2274
2275 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
2276 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
2277 ;; libtiff.la instead of having to provide it here.
2278 ("libjpeg" ,libjpeg-turbo)
2279
2280 ("hdf5" ,hdf5)
2281 ("lapack" ,lapack)
2282 ("libsndfile" ,libsndfile)
2283 ("libxft" ,libxft)
2284 ("mesa" ,mesa)
2285 ("pcre" ,pcre)
2286 ("portaudio" ,portaudio)
2287 ("qhull" ,qhull)
2288 ("readline" ,readline)
2289 ("suitesparse" ,suitesparse)
2290 ("texinfo" ,texinfo)
2291 ("zlib" ,zlib)))
2292 (native-inputs
2293 `(("gfortran" ,gfortran)
2294 ("pkg-config" ,pkg-config)
2295 ("perl" ,perl)
2296 ;; The following inputs are not actually used in the build process.
2297 ;; However, the ./configure gratuitously tests for their existence and
2298 ;; assumes that programs not present at build time are also not, and
2299 ;; can never be, available at run time! If these inputs are therefore
2300 ;; not present, support for them will be built out. However, Octave
2301 ;; will still run without them, albeit without the features they
2302 ;; provide.
2303 ("less" ,less)
2304 ("ghostscript" ,ghostscript)
2305 ("gnuplot" ,gnuplot)))
2306 ;; Octave code uses this variable to detect directories holding multiple CA
2307 ;; certificates to verify peers with. This is required for the networking
2308 ;; functions that require encryption to work properly.
2309 (native-search-paths
2310 (list (search-path-specification
2311 (variable "CURLOPT_CAPATH")
2312 (files '("etc/ssl/certs")))))
2313 (arguments
2314 `(#:configure-flags
2315 (list (string-append "--with-shell="
2316 (assoc-ref %build-inputs "bash")
2317 "/bin/sh")
2318
2319 ;; XXX: Without this flag, linking octave-cli fails with
2320 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
2321 ;; not pulling in liboctinterp.la for -lstdc++.
2322 "--enable-link-all-dependencies")
2323 #:phases
2324 (modify-phases %standard-phases
2325 (add-after 'configure 'configure-makeinfo
2326 (lambda* (#:key inputs #:allow-other-keys)
2327 (substitute* "libinterp/corefcn/help.h"
2328 (("\"makeinfo\"")
2329 (string-append
2330 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
2331 #t)))))
2332 (home-page "https://www.gnu.org/software/octave/")
2333 (synopsis "High-level language for numerical computation (no GUI)")
2334 (description "GNU Octave is a high-level interpreted language that is
2335 specialized for numerical computations. It can be used for both linear and
2336 non-linear applications and it provides great support for visualizing results.
2337 Work may be performed both at the interactive command-line as well as via
2338 script files.")
2339 (license license:gpl3+)))
2340
2341 (define-public octave
2342 (package (inherit octave-cli)
2343 (name "octave")
2344 (inputs
2345 `(("qscintilla" ,qscintilla)
2346 ("qt" ,qtbase-5)
2347 ,@(package-inputs octave-cli)))
2348 (native-inputs
2349 `(("qttools" , qttools) ;for lrelease
2350 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
2351 ,@(package-native-inputs octave-cli)))
2352 (arguments
2353 (substitute-keyword-arguments (package-arguments octave-cli)
2354 ((#:phases phases)
2355 `(modify-phases ,phases
2356 (add-before 'configure 'patch-qscintilla-library-name
2357 (lambda* (#:key inputs #:allow-other-keys)
2358 ;; The QScintilla library that the Octave configure script tries
2359 ;; to link with should be named libqscintilla-qt5.so, but the
2360 ;; QScintilla input provides the shared library as
2361 ;; libqscintilla2_qt5.so.
2362 (substitute* "configure"
2363 (("qscintilla2-qt5")
2364 "qscintilla2_qt5"))
2365 #t))))))
2366 (synopsis "High-level language for numerical computation (with GUI)")))
2367
2368 (define-public opencascade-oce
2369 (package
2370 (name "opencascade-oce")
2371 (version "0.17.2")
2372 (source
2373 (origin
2374 (method git-fetch)
2375 (uri (git-reference
2376 (url "https://github.com/tpaviot/oce")
2377 (commit (string-append "OCE-" version))))
2378 (file-name (git-file-name name version))
2379 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
2380 (sha256
2381 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
2382 (build-system cmake-build-system)
2383 (arguments
2384 '(#:configure-flags
2385 (list "-DOCE_TESTING:BOOL=ON"
2386 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
2387 "-DOCE_DRAW:BOOL=ON"
2388 (string-append "-DOCE_INSTALL_PREFIX:PATH="
2389 (assoc-ref %outputs "out"))
2390 "-UCMAKE_INSTALL_RPATH")))
2391 (inputs
2392 `(("freetype" ,freetype)
2393 ("glu" ,glu)
2394 ("libxmu" ,libxmu)
2395 ("mesa" ,mesa)
2396 ("tcl" ,tcl)
2397 ("tk" ,tk)))
2398 (native-inputs
2399 `(("python" ,python-wrapper)))
2400 (home-page "https://github.com/tpaviot/oce")
2401 (synopsis "Libraries for 3D modeling and numerical simulation")
2402 (description
2403 "Open CASCADE is a set of libraries for the development of applications
2404 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2405 C++ class libraries providing services for 3D surface and solid modeling, CAD
2406 data exchange, and visualization. It is used for development of specialized
2407 software dealing with 3D models in design (CAD), manufacturing (CAM),
2408 numerical simulation (CAE), measurement equipment (CMM), and quality
2409 control (CAQ) domains.
2410
2411 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
2412 patches, improvements, and experiments contributed by users over the official
2413 Open CASCADE library.")
2414 (license (list license:lgpl2.1; OCE libraries, with an exception for the
2415 ; use of header files; see
2416 ; OCCT_LGPL_EXCEPTION.txt
2417 license:public-domain; files
2418 ; src/Standard/Standard_StdAllocator.hxx and
2419 ; src/NCollection/NCollection_StdAllocator.hxx
2420 license:expat; file src/OpenGl/OpenGl_glext.h
2421 license:bsd-3)))); test framework gtest
2422
2423 (define-public opencascade-occt
2424 (package
2425 (name "opencascade-occt")
2426 (version "7.3.0p3")
2427 (source
2428 (origin
2429 (method git-fetch)
2430 (uri (git-reference
2431 (url "https://git.dev.opencascade.org/repos/occt.git")
2432 (commit
2433 (string-append "V"
2434 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2435 version)))))
2436 (file-name (git-file-name name version))
2437 (sha256
2438 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
2439 (modules '((guix build utils)))
2440 (snippet
2441 '(begin
2442 ;; Remove files specific to non-free operating systems.
2443 (delete-file-recursively "samples/ios")
2444 (delete-file-recursively "samples/mfc")
2445 (delete-file-recursively "samples/qt/FuncDemo")
2446 (delete-file "genconf.bat")
2447 (delete-file "gendoc.bat")
2448 (delete-file "genproj.bat")
2449 (delete-file "upgrade.bat")
2450 ;; Remove references to deleted files.
2451 (substitute* "dox/FILES_HTML.txt"
2452 ((".*standard.*") "" )
2453 ((".*UIKitSample.*") ""))
2454 #t))))
2455 (build-system cmake-build-system)
2456 (arguments
2457 '(;; There is no test target for make. OCCT provides an
2458 ;; 'Automated Testing System', which may be accessed after
2459 ;; installation via the draw.sh script. draw.sh is located in
2460 ;; the bin directory. For details see:
2461 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
2462 ;; occt_dev_guides__tests.html
2463 #:tests? #f
2464 ;; Configure without freeimage: attempting to link against the
2465 ;; freeimage version 3.17 library leads to 'undefined
2466 ;; reference' errors.
2467 #:configure-flags
2468 (list "-DUSE_FREEIMAGE:BOOL=OFF"
2469 "-DUSE_TBB:BOOL=ON"
2470 "-DUSE_VTK:BOOL=OFF"
2471 "-DBUILD_DOC_Overview:BOOL=OFF"
2472 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
2473 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
2474 "-UCMAKE_INSTALL_LIBDIR")))
2475 (inputs
2476 `(("doxygen" ,doxygen)
2477 ;("freeimage" ,freeimage)
2478 ("freetype" ,freetype)
2479 ("glu" ,glu)
2480 ("libxext" ,libxext)
2481 ("libxi" ,libxi)
2482 ("libxmu" ,libxmu)
2483 ("mesa" ,mesa)
2484 ("tbb" ,tbb)
2485 ("tcl" ,tcl)
2486 ("tk" ,tk)))
2487 ;; TODO: build Overview documentation and add 'doc' output.
2488 (home-page "https://www.opencascade.com")
2489 (synopsis "Libraries for 3D modeling and numerical simulation")
2490 (description
2491 "Open CASCADE is a set of libraries for the development of applications
2492 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
2493 C++ class libraries providing services for 3D surface and solid modeling, CAD
2494 data exchange, and visualization. It is used for development of specialized
2495 software dealing with 3D models in design (CAD), manufacturing (CAM),
2496 numerical simulation (CAE), measurement equipment (CMM), and quality
2497 control (CAQ) domains.
2498
2499 This is the certified version of the Open Cascade Technology (OCCT) library.")
2500 (license (list ;; OCCT library:
2501 license:lgpl2.1; with an exception for the use of header
2502 ; files, see OCCT_LGPL_EXCEPTION.txt.
2503 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2504 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2505 license:expat
2506 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2507 ;; src/StepFile/step.tab.*:
2508 license:gpl3+ ; with Bison 2.2 exception.
2509 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2510 (license:non-copyleft
2511 "https://www.unicode.org/license.html")
2512 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2513 license:public-domain))))
2514
2515 (define-public gmsh
2516 (package
2517 (name "gmsh")
2518 (version "4.8.4")
2519 (source
2520 (origin
2521 (method git-fetch)
2522 (uri (git-reference
2523 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2524 (commit
2525 (string-append "gmsh_"
2526 (string-replace-substring version "." "_")))))
2527 (file-name (git-file-name name version))
2528 (sha256
2529 (base32 "07mi6ja3b9libgcdp2b4dwnkap1b9ha2wi2zdn9mhmwvp3g1pxhp"))
2530 (modules '((guix build utils)))
2531 (snippet
2532 '(begin
2533 (delete-file-recursively "contrib/metis")
2534 #t))))
2535 (build-system cmake-build-system)
2536 (propagated-inputs
2537 `(("fltk" ,fltk)
2538 ("gfortran" ,gfortran)
2539 ("glu" ,glu)
2540 ("gmp" ,gmp)
2541 ("hdf5" ,hdf5)
2542 ("lapack" ,lapack)
2543 ("libx11" ,libx11)
2544 ("libxext" ,libxext)
2545 ("mesa" ,mesa)
2546 ("metis" ,metis)
2547 ("opencascade-occt" ,opencascade-occt)))
2548 (inputs
2549 `(("fontconfig" ,fontconfig)
2550 ("libxft" ,libxft)
2551 ("python" ,python)))
2552 (arguments
2553 `(#:configure-flags `("-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
2554 "-DENABLE_BUILD_SHARED:BOOL=ON"
2555 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
2556 #:imported-modules (,@%cmake-build-system-modules
2557 (guix build python-build-system))
2558 #:modules (((guix build python-build-system) #:select (site-packages))
2559 (guix build cmake-build-system)
2560 (guix build utils))
2561 #:phases
2562 (modify-phases %standard-phases
2563 (add-after 'unpack 'patch-paths
2564 (lambda* (#:key inputs outputs #:allow-other-keys)
2565 ;; Use the standard Guix site-package path for
2566 ;; installation of the Python API.
2567 (substitute* "CMakeLists.txt"
2568 (("include\\(GNUInstallDirs\\)\n")
2569 (string-append "include(GNUInstallDirs)\n"
2570 " set(GMSH_PY_LIB "
2571 (site-packages inputs outputs) ")\n"))
2572 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
2573 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
2574 ;; Find the shared library.
2575 (let ((libgmsh (string-append (assoc-ref outputs "out")
2576 "/lib/libgmsh.so")))
2577 (substitute* "api/gmsh.py"
2578 (("find_library\\(\"gmsh\"\\)")
2579 (simple-format #f "\"~a\"" libgmsh))))
2580 #t)))))
2581 (home-page "http://gmsh.info/")
2582 (synopsis "3D finite element grid generator")
2583 (description "Gmsh is a 3D finite element grid generator with a built-in
2584 CAD engine and post-processor. Its design goal is to provide a fast, light
2585 and user-friendly meshing tool with parametric input and advanced
2586 visualization capabilities. Gmsh is built around four modules: geometry,
2587 mesh, solver and post-processing. The specification of any input to these
2588 modules is done either interactively using the graphical user interface or in
2589 ASCII text files using Gmsh's own scripting language.")
2590 (license license:gpl2+)))
2591
2592 (define-public veusz
2593 (package
2594 (name "veusz")
2595 (version "3.3.1")
2596 (source
2597 (origin
2598 (method url-fetch)
2599 (uri (pypi-uri "veusz" version))
2600 (sha256
2601 (base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0"))))
2602 (build-system python-build-system)
2603 (arguments
2604 `(;; Tests will fail because they depend on optional packages like
2605 ;; python-astropy, which is not packaged.
2606 #:tests? #f
2607 #:phases
2608 (modify-phases %standard-phases
2609 ;; Veusz will append 'PyQt5' to sip_dir by default. That is not how
2610 ;; the path is defined in Guix, therefore we have to change it.
2611 (add-after 'unpack 'fix-sip-dir
2612 (lambda _
2613 (substitute* "pyqtdistutils.py"
2614 (("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir"))
2615 #t))
2616 ;; Now we have to pass the correct sip_dir to setup.py.
2617 (replace 'build
2618 (lambda* (#:key inputs #:allow-other-keys)
2619 ;; We need to tell setup.py where to locate QtCoremod.sip
2620 ((@@ (guix build python-build-system) call-setuppy)
2621 "build_ext"
2622 (list (string-append "--sip-dir="
2623 (assoc-ref inputs "python-pyqt")
2624 "/share/sip"))
2625 #t)))
2626 ;; Ensure that icons are found at runtime.
2627 (add-after 'install 'wrap-executable
2628 (lambda* (#:key inputs outputs #:allow-other-keys)
2629 (let ((out (assoc-ref outputs "out")))
2630 (wrap-program (string-append out "/bin/veusz")
2631 `("QT_PLUGIN_PATH" prefix
2632 ,(list (string-append (assoc-ref inputs "qtsvg")
2633 "/lib/qt5/plugins/"))))))))))
2634 (native-inputs
2635 `(("pkg-config" ,pkg-config)
2636 ;;("python-astropy" ,python-astropy) ;; FIXME: Package this.
2637 ("qttools" ,qttools)
2638 ("python-sip" ,python-sip-4)))
2639 (inputs
2640 `(("ghostscript" ,ghostscript) ;optional, for EPS/PS output
2641 ("python-dbus" ,python-dbus)
2642 ("python-h5py" ,python-h5py) ;optional, for HDF5 data
2643 ("python-pyqt" ,python-pyqt)
2644 ("qtbase" ,qtbase-5)
2645 ("qtsvg" ,qtsvg)))
2646 (propagated-inputs
2647 `(("python-numpy" ,python-numpy)))
2648 (home-page "https://veusz.github.io/")
2649 (synopsis "Scientific plotting package")
2650 (description
2651 "Veusz is a scientific plotting and graphing program with a graphical
2652 user interface, designed to produce publication-ready 2D and 3D plots. In
2653 addition it can be used as a module in Python for plotting. It supports
2654 vector and bitmap output, including PDF, Postscript, SVG and EMF.")
2655 (license license:gpl2+)))
2656
2657 (define-public maxflow
2658 (package
2659 (name "maxflow")
2660 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2661 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2662 (version "3.0.5")
2663 (source (origin
2664 (method git-fetch)
2665 (uri (git-reference
2666 (url "https://github.com/gerddie/maxflow")
2667 (commit version)))
2668 (file-name (git-file-name name version))
2669 (sha256
2670 (base32
2671 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2672 (build-system cmake-build-system)
2673 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2674 (synopsis "Library implementing Maxflow algorithm")
2675 (description "An implementation of the maxflow algorithm described in
2676 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2677 Energy Minimization in Computer Vision.\n
2678 Yuri Boykov and Vladimir Kolmogorov.\n
2679 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2680 September 2004}")
2681 (license license:gpl3+)))
2682
2683 (define-public petsc
2684 (package
2685 (name "petsc")
2686 (version "3.11.2")
2687 (source
2688 (origin
2689 (method url-fetch)
2690 ;; The *-lite-* tarball does not contain the *large* documentation
2691 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2692 "petsc-lite-" version ".tar.gz"))
2693 (sha256
2694 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2695 (outputs '("out" ; libraries and headers
2696 "examples")) ; ~30MiB of examples
2697 (build-system gnu-build-system)
2698 (native-inputs
2699 `(("python" ,python-2)))
2700 (inputs
2701 `(("gfortran" ,gfortran)
2702 ("openblas" ,openblas)
2703 ("superlu" ,superlu)
2704 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2705 ;; leaving out opengl, as configuration seems to only be for mac
2706 ))
2707 (arguments
2708 `(#:test-target "test"
2709 #:parallel-build? #f ; build is parallel by default
2710 #:configure-flags
2711 `("--with-mpi=0"
2712 "--with-openmp=1"
2713 "--with-openblas=1"
2714 "--with-superlu=1")
2715 #:make-flags
2716 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2717 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2718 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2719 #:phases
2720 (modify-phases %standard-phases
2721 (replace 'configure
2722 ;; PETSc's configure script is actually a python script, so we can't
2723 ;; run it with bash.
2724 (lambda* (#:key outputs (configure-flags '())
2725 #:allow-other-keys)
2726 (let* ((prefix (assoc-ref outputs "out"))
2727 (flags `(,(string-append "--prefix=" prefix)
2728 ,@configure-flags)))
2729 (format #t "build directory: ~s~%" (getcwd))
2730 (format #t "configure flags: ~s~%" flags)
2731 (apply invoke "./configure" flags))))
2732 (add-after 'configure 'clean-local-references
2733 (lambda* (#:key outputs #:allow-other-keys)
2734 (let ((out (assoc-ref outputs "out")))
2735 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2736 ;; Prevent build directory from leaking into compiled code
2737 (((getcwd)) out)
2738 ;; Scrub timestamp for reproducibility
2739 ((".*Libraries compiled on.*") ""))
2740 (substitute* (find-files "." "petscvariables")
2741 ;; Do not expose build machine characteristics, set to defaults.
2742 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2743 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2744 #t)))
2745 (add-after 'install 'clean-install
2746 ;; Try to keep installed files from leaking build directory names.
2747 (lambda* (#:key inputs outputs #:allow-other-keys)
2748 (let ((out (assoc-ref outputs "out")))
2749 (substitute* (map (lambda (file)
2750 (string-append out "/lib/petsc/conf/" file))
2751 '("petscvariables"))
2752 (((getcwd)) out))
2753 ;; Make compiler references point to the store
2754 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2755 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2756 (string-append "= " (which compiler))))
2757 ;; PETSc installs some build logs, which aren't necessary.
2758 (for-each (lambda (file)
2759 (let ((f (string-append out "/lib/petsc/conf/" file)))
2760 (when (file-exists? f)
2761 (delete-file f))))
2762 '("configure.log" "make.log" "gmake.log"
2763 "test.log" "error.log" "RDict.db"
2764 "PETScBuildInternal.cmake"
2765 ;; Once installed, should uninstall with Guix
2766 "uninstall.py"))
2767 #t)))
2768 (add-after 'install 'move-examples
2769 (lambda* (#:key outputs #:allow-other-keys)
2770 (let* ((out (assoc-ref outputs "out"))
2771 (examples (assoc-ref outputs "examples"))
2772 (exdir (string-append out "/share/petsc/examples"))
2773 (exdir' (string-append examples "/share/petsc/examples")))
2774 (copy-recursively exdir exdir')
2775 (delete-file-recursively exdir)
2776 #t))))))
2777 (home-page "https://www.mcs.anl.gov/petsc")
2778 (synopsis "Library to solve PDEs")
2779 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2780 data structures and routines for the scalable (parallel) solution of
2781 scientific applications modeled by partial differential equations.")
2782 (license (license:non-copyleft
2783 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2784
2785 (define-public petsc-complex
2786 (package (inherit petsc)
2787 (name "petsc-complex")
2788 (arguments
2789 (substitute-keyword-arguments (package-arguments petsc)
2790 ((#:configure-flags cf)
2791 `(cons "--with-scalar-type=complex" ,cf))))
2792 (synopsis "Library to solve PDEs (with complex scalars)")))
2793
2794 (define-public petsc-openmpi
2795 (package (inherit petsc)
2796 (name "petsc-openmpi")
2797 (inputs
2798 `(("hdf5" ,hdf5-parallel-openmpi)
2799 ("hypre" ,hypre-openmpi)
2800 ("metis" ,metis)
2801 ("mumps" ,mumps-openmpi)
2802 ("openmpi" ,openmpi)
2803 ("scalapack" ,scalapack)
2804 ("scotch" ,pt-scotch32)
2805 ,@(package-inputs petsc)))
2806 (arguments
2807 (substitute-keyword-arguments (package-arguments petsc)
2808 ((#:configure-flags cf)
2809 ``("--with-hypre=1"
2810 "--with-mpiexec=mpirun"
2811 "--with-metis=1"
2812 "--with-mumps=1"
2813 "--with-scalapack=1"
2814 "--with-ptscotch=1"
2815 ,(string-append "--with-mpi-dir="
2816 (assoc-ref %build-inputs "openmpi"))
2817 ,(string-append "--with-hdf5-include="
2818 (assoc-ref %build-inputs "hdf5") "/include")
2819 ,(string-append "--with-hdf5-lib="
2820 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2821 ,@(delete "--with-mpi=0" ,cf)))
2822 ((#:phases phases)
2823 `(modify-phases ,phases
2824 (add-before 'configure 'mpi-setup
2825 ,%openmpi-setup)))))
2826 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2827
2828 (define-public petsc-complex-openmpi
2829 (package (inherit petsc-complex)
2830 (name "petsc-complex-openmpi")
2831 (inputs
2832 `(("openmpi" ,openmpi)
2833 ,@(package-inputs petsc-complex)))
2834 (arguments
2835 (substitute-keyword-arguments (package-arguments petsc-complex)
2836 ((#:configure-flags cf)
2837 ``("--with-mpiexec=mpirun"
2838 ,(string-append "--with-mpi-dir="
2839 (assoc-ref %build-inputs "openmpi"))
2840 ,@(delete "--with-mpi=0" ,cf)))
2841 ((#:phases phases)
2842 `(modify-phases ,phases
2843 (add-before 'configure 'mpi-setup
2844 ,%openmpi-setup)))))
2845 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2846
2847 (define-public python-petsc4py
2848 (package
2849 (name "python-petsc4py")
2850 (version "3.11.0")
2851 (source
2852 (origin
2853 (method url-fetch)
2854 (uri (pypi-uri "petsc4py" version))
2855 (sha256
2856 (base32
2857 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))
2858 (modules '((guix build utils)))
2859 (snippet
2860 '(begin
2861 ;; Ensure source file is regenerated in the build phase.
2862 (delete-file "src/petsc4py.PETSc.c")
2863 ;; Remove legacy GC code. See
2864 ;; https://bitbucket.org/petsc/petsc4py/issues/125.
2865 (substitute* "src/PETSc/cyclicgc.pxi"
2866 ((".*gc_refs.*") "" )
2867 ((".*PyGC_Head.*") ""))
2868 #t))))
2869 (build-system python-build-system)
2870 (arguments
2871 `(#:phases
2872 (modify-phases %standard-phases
2873 (add-before 'build 'pre-build
2874 (lambda _
2875 ;; Define path to PETSc installation.
2876 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2877 #t))
2878 (add-before 'check 'mpi-setup
2879 ,%openmpi-setup))))
2880 (native-inputs
2881 `(("python-cython" ,python-cython)))
2882 (inputs
2883 `(("petsc" ,petsc-openmpi)
2884 ("python-numpy" ,python-numpy)))
2885 (home-page "https://bitbucket.org/petsc/petsc4py/")
2886 (synopsis "Python bindings for PETSc")
2887 (description "PETSc, the Portable, Extensible Toolkit for
2888 Scientific Computation, is a suite of data structures and routines for
2889 the scalable (parallel) solution of scientific applications modeled by
2890 partial differential equations. It employs the MPI standard for all
2891 message-passing communication. @code{petsc4py} provides Python
2892 bindings to almost all functions of PETSc.")
2893 (license license:bsd-3)))
2894
2895 (define-public python-kiwisolver
2896 (package
2897 (name "python-kiwisolver")
2898 (version "1.0.1")
2899 (source (origin
2900 (method url-fetch)
2901 (uri (pypi-uri "kiwisolver" version))
2902 (sha256
2903 (base32
2904 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2905 (build-system python-build-system)
2906 (home-page "https://github.com/nucleic/kiwi")
2907 (synopsis "Fast implementation of the Cassowary constraint solver")
2908 (description
2909 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2910 solving algorithm. Kiwi has been designed from the ground up to be
2911 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2912 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2913 savings are consistently > 5x.")
2914 (license license:bsd-3)))
2915
2916 (define-public python2-kiwisolver
2917 (package-with-python2 python-kiwisolver))
2918
2919 (define-public slepc
2920 (package
2921 (name "slepc")
2922 (version "3.11.1")
2923 (source
2924 (origin
2925 (method url-fetch)
2926 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2927 version ".tar.gz"))
2928 (sha256
2929 (base32
2930 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2931 (build-system gnu-build-system)
2932 (native-inputs
2933 `(("python" ,python-2)
2934 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2935 (inputs
2936 `(("arpack" ,arpack-ng)
2937 ("gfortran" ,gfortran)))
2938 (propagated-inputs
2939 `(("petsc" ,petsc)))
2940 (arguments
2941 `(#:parallel-build? #f ;build is parallel by default
2942 #:configure-flags
2943 `(,(string-append "--with-arpack-dir="
2944 (assoc-ref %build-inputs "arpack") "/lib"))
2945 #:make-flags ;honor (parallel-job-count)
2946 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2947 ,(string-append "PETSCCONFIGDIR="
2948 (assoc-ref %build-inputs "petsc:examples")
2949 "/share/petsc/examples/config"))
2950 #:phases
2951 (modify-phases %standard-phases
2952 (replace 'configure
2953 ;; configure is a python script, so we can't run it with bash.
2954 (lambda* (#:key inputs outputs (configure-flags '())
2955 #:allow-other-keys)
2956 (let* ((prefix (assoc-ref outputs "out"))
2957 (flags `(,(string-append "--prefix=" prefix)
2958 ,@configure-flags)))
2959 (format #t "build directory: ~s~%" (getcwd))
2960 (format #t "configure flags: ~s~%" flags)
2961 (setenv "SLEPC_DIR" (getcwd))
2962 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2963 (apply invoke "./configure" flags))))
2964 (add-after 'install 'delete-doc
2965 ;; TODO: SLEPc installs HTML documentation alongside headers in
2966 ;; $out/include. We'd like to move them to share/doc, but delete
2967 ;; them for now, as they are incomplete and installing the complete
2968 ;; documentation is difficult.
2969 (lambda* (#:key outputs #:allow-other-keys)
2970 (let* ((out (assoc-ref outputs "out")))
2971 (for-each delete-file (find-files out "\\.html$"))
2972 #t)))
2973 (add-after 'install 'clean-install
2974 ;; Clean up unnecessary build logs from installation.
2975 (lambda* (#:key outputs #:allow-other-keys)
2976 (let ((out (assoc-ref outputs "out")))
2977 (for-each (lambda (file)
2978 (let ((f (string-append out "/lib/slepc/conf/" file)))
2979 (when (file-exists? f)
2980 (delete-file f))))
2981 '("configure.log" "make.log" "gmake.log"
2982 "test.log" "error.log" "RDict.db"
2983 "uninstall.py"))
2984 #t))))))
2985 (home-page "https://slepc.upv.es")
2986 (synopsis "Scalable library for eigenproblems")
2987 (description "SLEPc is a software library for the solution of large sparse
2988 eigenproblems on parallel computers. It can be used for the solution of
2989 linear eigenvalue problems formulated in either standard or generalized form,
2990 as well as other related problems such as the singular value decomposition.
2991 The emphasis of the software is on methods and techniques appropriate for
2992 problems in which the associated matrices are sparse, for example, those
2993 arising after the discretization of partial differential equations.")
2994 (license license:bsd-2)))
2995
2996 (define-public slepc-complex
2997 (package (inherit slepc)
2998 (name "slepc-complex")
2999 (propagated-inputs
3000 `(("petsc" ,petsc-complex)
3001 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3002 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
3003
3004 (define-public slepc-openmpi
3005 (package (inherit slepc)
3006 (name "slepc-openmpi")
3007 (arguments
3008 (substitute-keyword-arguments (package-arguments slepc)
3009 ((#:phases phases '%standard-phases)
3010 `(modify-phases ,phases
3011 (add-before 'check 'mpi-setup
3012 ,%openmpi-setup)))))
3013 (inputs
3014 `(("mpi" ,openmpi)
3015 ("arpack" ,arpack-ng-openmpi)
3016 ,@(alist-delete "arpack" (package-inputs slepc))))
3017 (propagated-inputs
3018 `(("petsc" ,petsc-openmpi)
3019 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
3020 (synopsis "Scalable library for eigenproblems (with MPI support)")))
3021
3022 (define-public slepc-complex-openmpi
3023 (package (inherit slepc-openmpi)
3024 (name "slepc-complex-openmpi")
3025 (propagated-inputs
3026 `(("petsc" ,petsc-complex-openmpi)
3027 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
3028 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
3029
3030 (define-public python-slepc4py
3031 (package
3032 (name "python-slepc4py")
3033 (version "3.11.0")
3034 (source
3035 (origin
3036 (method url-fetch)
3037 (uri (pypi-uri "slepc4py" version))
3038 (sha256
3039 (base32
3040 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
3041 (build-system python-build-system)
3042 (arguments
3043 `(#:phases
3044 (modify-phases %standard-phases
3045 (add-before 'build 'pre-build
3046 (lambda _
3047 ;; Define path to PETSc installation.
3048 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
3049 ;; Define path to SLEPc installation.
3050 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
3051 #t))
3052 (add-before 'check 'mpi-setup
3053 ,%openmpi-setup))))
3054 (inputs
3055 `(("python-numpy" ,python-numpy)
3056 ("python-petsc4py" ,python-petsc4py)
3057 ("slepc" ,slepc-openmpi)))
3058 (home-page "https://bitbucket.org/slepc/slepc4py/")
3059 (synopsis "Python bindings for SLEPc")
3060 (description "SLEPc, the Scalable Library for Eigenvalue Problem
3061 Computations, is based on PETSc, the Portable, Extensible Toolkit for
3062 Scientific Computation. It employs the MPI standard for all
3063 message-passing communication. @code{slepc4py} provides Python
3064 bindings to almost all functions of SLEPc.")
3065 (license license:bsd-3)))
3066
3067 (define-public metamath
3068 (package
3069 (name "metamath")
3070 (version "0.193")
3071 (source
3072 (origin
3073 (method git-fetch)
3074 (uri (git-reference
3075 (url "https://github.com/metamath/metamath-exe")
3076 (commit (string-append "v" version))))
3077 (file-name (git-file-name name version))
3078 (sha256
3079 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
3080 (build-system gnu-build-system)
3081 (native-inputs
3082 `(("autoconf" ,autoconf)
3083 ("automake" ,automake)))
3084 (home-page "http://us.metamath.org/")
3085 (synopsis "Proof verifier based on a minimalistic formalism")
3086 (description
3087 "Metamath is a tiny formal language and that can express theorems in
3088 abstract mathematics, with an accompyaning @command{metamath} executable that
3089 verifies databases of these proofs. There is a public database,
3090 @url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
3091 logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
3092 associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
3093 the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
3094 book.")
3095 (license license:gpl2+)))
3096
3097 (define-public minizinc
3098 (package
3099 (name "minizinc")
3100 (version "2.5.5")
3101 (source (origin
3102 (method git-fetch)
3103 (uri (git-reference
3104 (url "https://github.com/MiniZinc/libminizinc")
3105 (commit version)))
3106 (file-name (git-file-name name version))
3107 (sha256
3108 (base32
3109 "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
3110 (modules '((guix build utils)
3111 (ice-9 ftw)
3112 (srfi srfi-1)))
3113 (snippet
3114 '(begin
3115 ;; Do not advertise proprietary solvers
3116 (with-directory-excursion "cmake/targets"
3117 (let ((targets '("libminizinc_fzn.cmake"
3118 "libminizinc_gecode.cmake"
3119 "libminizinc_mip.cmake"
3120 "libminizinc_nl.cmake"
3121 "libminizinc_osicbc.cmake"
3122 "libminizinc_parser.cmake"
3123 "libmzn.cmake"
3124 "minizinc.cmake"
3125 "mzn2doc.cmake")))
3126 (for-each delete-file
3127 (remove
3128 (lambda (file)
3129 (member file (cons* "." ".." targets)))
3130 (scandir ".")))
3131 (substitute* "libmzn.cmake"
3132 (("include\\(cmake/targets/(.*)\\)" all target)
3133 (if (member target targets) all "")))))
3134 (with-directory-excursion "include/minizinc/solvers/MIP"
3135 (for-each delete-file
3136 (remove
3137 (lambda (file)
3138 (member file '("." ".."
3139 "MIP_osicbc_solverfactory.hh"
3140 "MIP_osicbc_wrap.hh"
3141 "MIP_solverinstance.hh"
3142 "MIP_solverinstance.hpp"
3143 "MIP_wrap.hh")))
3144 (scandir "."))))
3145 (with-directory-excursion "solvers/MIP"
3146 (for-each delete-file
3147 (remove
3148 (lambda (file)
3149 (member file '("." ".."
3150 "MIP_osicbc_solverfactory.cpp"
3151 "MIP_osicbc_wrap.cpp"
3152 "MIP_solverinstance.cpp"
3153 "MIP_wrap.cpp")))
3154 (scandir "."))))
3155 (substitute* "CMakeLists.txt"
3156 (("find_package\\(([^ ]*).*\\)" all pkg)
3157 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
3158 all
3159 "")))
3160 ;; TODO: swap out miniz for zlib
3161 #t))))
3162 (build-system cmake-build-system)
3163 (arguments
3164 `(#:tests? #f ; no ‘check’ target
3165 #:modules ((guix build cmake-build-system)
3166 (guix build utils)
3167 (srfi srfi-1))
3168 #:phases
3169 (modify-phases %standard-phases
3170 (add-after 'install 'install-solver-configs
3171 (lambda* (#:key inputs outputs #:allow-other-keys)
3172 (let ((gecode (assoc-ref inputs "gecode"))
3173 (pkgdatadir (string-append (assoc-ref outputs "out")
3174 "/share/minizinc")))
3175 (call-with-output-file (string-append pkgdatadir
3176 "/Preferences.json")
3177 (lambda (port)
3178 (display "\
3179 {
3180 \"tagDefaults\": [
3181 [\"\", \"org.gecode.gecode\"],
3182 [\"gecode\", \"org.gecode.gecode\"]
3183 ],
3184 \"solverDefaults\": []
3185 }"
3186 port)
3187 (newline port)))
3188
3189 (mkdir-p (string-append pkgdatadir "/solvers"))
3190 (call-with-output-file (string-append pkgdatadir
3191 "/solvers/gecode.msc")
3192 (lambda (port)
3193 (format port
3194 "\
3195 {
3196 \"id\": \"org.gecode.gecode\",
3197 \"name\": \"Gecode\",
3198 \"description\": \"Gecode FlatZinc executable\",
3199 \"version\": ~s,
3200 \"mznlib\": ~s,
3201 \"executable\": ~s,
3202 \"supportsMzn\": false,
3203 \"supportsFzn\": true,
3204 \"needsSolns2Out\": true,
3205 \"needsMznExecutable\": false,
3206 \"needsStdlibDir\": false,
3207 \"isGUIApplication\": false
3208 }"
3209 (last (string-split gecode #\-))
3210 (string-append gecode "/share/gecode/mznlib")
3211 (string-append gecode "/bin/fzn-gecode"))
3212 (newline port)))))))))
3213 (native-inputs
3214 `(("bison" ,bison)
3215 ("flex" ,flex)))
3216 (inputs
3217 `(("cbc" ,cbc)
3218 ("gecode" ,gecode)
3219 ("zlib" ,zlib)))
3220 (home-page "https://www.minizinc.org")
3221 (synopsis "High-level constraint modeling language")
3222 (description "MiniZinc is a high-level modeling language for constraint
3223 satisfaction and optimization problems. Models are compiled to FlatZinc, a
3224 language understood by many solvers.")
3225 (license license:mpl2.0)))
3226
3227 (define-public mumps
3228 (package
3229 (name "mumps")
3230 (version "5.2.1")
3231 (source
3232 (origin
3233 (method url-fetch)
3234 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
3235 version ".tar.gz"))
3236 (sha256
3237 (base32
3238 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
3239 (patches (search-patches "mumps-build-parallelism.patch"
3240 "mumps-shared-libseq.patch"
3241 "mumps-shared-mumps.patch"
3242 "mumps-shared-pord.patch"))))
3243 (build-system gnu-build-system)
3244 (inputs
3245 `(("fortran" ,gfortran)
3246 ;; These are required for linking against mumps, but we let the user
3247 ;; declare the dependency.
3248 ("blas" ,openblas)
3249 ("metis" ,metis)
3250 ("scotch" ,scotch)))
3251 (arguments
3252 `(#:modules ((ice-9 match)
3253 (ice-9 popen)
3254 (srfi srfi-1)
3255 ,@%gnu-build-system-modules)
3256 #:phases
3257 (modify-phases %standard-phases
3258 (replace 'configure
3259 (lambda* (#:key inputs #:allow-other-keys)
3260 (call-with-output-file "Makefile.inc"
3261 (lambda (port)
3262 (format port "
3263 PLAT =
3264 LIBEXT = .a
3265 OUTC = -o
3266 OUTF = -o
3267 RM = rm -f~:[
3268 CC = gcc
3269 FC = gfortran
3270 FL = gfortran
3271 INCSEQ = -I$(topdir)/libseq
3272 LIBSEQ = $(topdir)/libseq/libmpiseq.a
3273 LIBSEQNEEDED = libseqneeded~;
3274 CC = mpicc
3275 FC = mpifort
3276 FL = mpifort~]
3277 AR = ar vr # rules require trailing space, ugh...
3278 RANLIB = ranlib
3279 BLASDIR = ~a
3280 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
3281 SCALAPDIR = ~a
3282 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
3283 LIBOTHERS = -pthread
3284 CDEFS = -DAdd_
3285 PIC = -fPIC
3286 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
3287 OPTL = -O2 $(PIC)
3288 OPTC = -O2 $(PIC)
3289 INCS = $(INCSEQ)
3290 LIBS = $(SCALAP) $(LIBSEQ)
3291 LPORDDIR = $(topdir)/PORD/lib
3292 IPORD = -I$(topdir)/PORD/include
3293 LPORD = $(LPORDDIR)/libpord.a
3294 ORDERINGSF = -Dpord~@[
3295 METISDIR = ~a
3296 IMETIS = -I$(METISDIR)/include
3297 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
3298 ORDERINGSF += -Dmetis~]~@[~:{
3299 SCOTCHDIR = ~a
3300 ISCOTCH = -I$(SCOTCHDIR)/include
3301 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
3302 ORDERINGSF += ~a~}~]
3303 ORDERINGSC = $(ORDERINGSF)
3304 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
3305 IORDERINGSF = $(ISCOTCH)
3306 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
3307 (assoc-ref inputs "mpi")
3308 (assoc-ref inputs "blas")
3309 (assoc-ref inputs "scalapack")
3310 (assoc-ref inputs "metis")
3311 (match (list (assoc-ref inputs "pt-scotch")
3312 (assoc-ref inputs "scotch"))
3313 ((#f #f)
3314 #f)
3315 ((#f scotch)
3316 `((,scotch "" "-Dscotch")))
3317 ((ptscotch _)
3318 `((,ptscotch
3319 "-lptesmumps -lptscotch -lptscotcherr "
3320 "-Dptscotch")))))))))
3321 (replace 'build
3322 ;; By default only the d-precision library is built. Make with "all"
3323 ;; target so that all precision libraries and examples are built.
3324 (lambda _
3325 (invoke "make" "all"
3326 (format #f "-j~a" (parallel-job-count)))))
3327 (replace 'check
3328 ;; Run the simple test drivers, which read test input from stdin:
3329 ;; from the "real" input for the single- and double-precision
3330 ;; testers, and from the "cmplx" input for complex-precision
3331 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
3332 ;; package to prefix execution with "mpirun".
3333 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
3334 (with-directory-excursion "examples"
3335 (every
3336 (lambda (prec type)
3337 (let ((tester (apply open-pipe*
3338 `(,OPEN_WRITE
3339 ,@exec-prefix
3340 ,(string-append "./" prec
3341 "simpletest"))))
3342 (input (open-input-file
3343 (string-append "input_simpletest_" type))))
3344 (begin
3345 (dump-port input tester)
3346 (close-port input)
3347 (zero? (close-pipe tester)))))
3348 '("s" "d" "c" "z")
3349 '("real" "real" "cmplx" "cmplx")))))
3350 (replace 'install
3351 (lambda* (#:key outputs #:allow-other-keys)
3352 (let* ((out (assoc-ref outputs "out"))
3353 (libdir (string-append out "/lib")))
3354 (copy-recursively "lib" libdir)
3355 (copy-recursively "include" (string-append out "/include"))
3356 (when (file-exists? "libseq/libmpiseq.a")
3357 (install-file "libseq/libmpiseq.a" libdir))
3358 (when (file-exists? "libseq/libmpiseq.so")
3359 (install-file "libseq/libmpiseq.so" libdir))
3360 #t))))))
3361 (home-page "http://mumps.enseeiht.fr")
3362 (synopsis "Multifrontal sparse direct solver")
3363 (description
3364 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
3365 sparse system of linear equations A x = b using Gaussian elimination.")
3366 (license license:cecill-c)))
3367
3368 (define-public mumps-metis
3369 (package (inherit mumps)
3370 (name "mumps-metis")
3371 (inputs
3372 (alist-delete "scotch" (package-inputs mumps)))))
3373
3374 (define-public mumps-openmpi
3375 (package (inherit mumps)
3376 (name "mumps-openmpi")
3377 (inputs
3378 `(("mpi" ,openmpi)
3379 ("scalapack" ,scalapack)
3380 ("pt-scotch" ,pt-scotch)
3381 ,@(alist-delete "scotch" (package-inputs mumps))))
3382 (arguments
3383 (substitute-keyword-arguments (package-arguments mumps)
3384 ((#:phases phases)
3385 `(modify-phases ,phases
3386 (add-before 'check 'mpi-setup
3387 ,%openmpi-setup)
3388 (replace 'check
3389 (lambda _
3390 ((assoc-ref ,phases 'check)
3391 #:exec-prefix '("mpirun" "-n" "2"))))))))
3392 (synopsis "Multifrontal sparse direct solver (with MPI)")))
3393
3394 (define-public mumps-metis-openmpi
3395 (package (inherit mumps-openmpi)
3396 (name "mumps-metis-openmpi")
3397 (inputs
3398 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
3399
3400 (define-public ruby-asciimath
3401 (package
3402 (name "ruby-asciimath")
3403 (version "2.0.1")
3404 (source
3405 (origin
3406 (method url-fetch)
3407 (uri (rubygems-uri "asciimath" version))
3408 (sha256
3409 (base32
3410 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
3411 (build-system ruby-build-system)
3412 (native-inputs
3413 `(("ruby-nokogiri" ,ruby-nokogiri)
3414 ("ruby-rspec" ,ruby-rspec)))
3415 (synopsis "AsciiMath parsing and conversion library")
3416 (description
3417 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
3418 easy-to-write markup language for mathematics.")
3419 (home-page "https://github.com/asciidoctor/asciimath")
3420 (license license:expat)))
3421
3422 (define-public superlu
3423 (package
3424 (name "superlu")
3425 (version "5.2.2")
3426 (source
3427 (origin
3428 (method url-fetch)
3429 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
3430 "superlu_" version ".tar.gz"))
3431 (sha256
3432 (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
3433 (modules '((guix build utils)))
3434 (snippet
3435 ;; Replace the non-free implementation of MC64 with a stub adapted
3436 ;; from Debian
3437 '(begin
3438 (use-modules (ice-9 regex)
3439 (ice-9 rdelim))
3440 (call-with-output-file "SRC/mc64ad.c"
3441 (lambda (port)
3442 (display "
3443 #include <stdio.h>
3444 #include <stdlib.h>
3445 void mc64id_(int *a) {
3446 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3447 abort ();
3448 }
3449 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3450 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3451 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
3452 abort ();
3453 }\n" port)))
3454 ;; Remove the corresponding license verbiage. MC64 license follows
3455 ;; a "------" line separator.
3456 (with-atomic-file-replacement "License.txt"
3457 (let ((rx (make-regexp "-{8}")))
3458 (lambda (in out)
3459 (let loop ()
3460 (let ((line (read-line in 'concat)))
3461 (unless (regexp-exec rx line)
3462 (display line out)
3463 (loop))))
3464 #t)))))))
3465 (build-system cmake-build-system)
3466 (native-inputs
3467 `(("tcsh" ,tcsh)))
3468 (inputs
3469 `(("blas" ,openblas)
3470 ("gfortran" ,gfortran)))
3471 (arguments
3472 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
3473 "-DTPL_BLAS_LIBRARIES=openblas"
3474 "-DBUILD_SHARED_LIBS:BOOL=YES")))
3475 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
3476 (synopsis "Supernodal direct solver for sparse linear systems")
3477 (description
3478 "SuperLU is a general purpose library for the direct solution of large,
3479 sparse, nonsymmetric systems of linear equations on high performance machines.
3480 The library is written in C and is callable from either C or Fortran. The
3481 library routines perform an LU decomposition with partial pivoting and
3482 triangular system solves through forward and back substitution. The library
3483 also provides threshold-based ILU factorization preconditioners.")
3484 (license (list license:bsd-3
3485 license:gpl2+ ;EXAMPLE/*fgmr.c
3486 (license:fsf-free "file://SRC/colamd.h")))))
3487
3488 (define-public superlu-dist
3489 (package
3490 (name "superlu-dist")
3491 (version "6.4.0")
3492 (source
3493 (origin
3494 (method git-fetch)
3495 (uri (git-reference
3496 (url "https://github.com/xiaoyeli/superlu_dist")
3497 (commit (string-append "v" version))))
3498 (file-name (git-file-name name version))
3499 (sha256
3500 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
3501 (modules '((guix build utils)))
3502 (snippet
3503 ;; Replace the non-free implementation of MC64 with a stub
3504 '(begin
3505 (make-file-writable "SRC/mc64ad_dist.c")
3506 (call-with-output-file "SRC/mc64ad_dist.c"
3507 (lambda (port)
3508 (display "
3509 #include <stdio.h>
3510 #include <stdlib.h>
3511 void mc64id_dist(int *a) {
3512 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3513 abort ();
3514 }
3515 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
3516 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
3517 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
3518 abort ();
3519 }\n" port)))
3520 (substitute* "SRC/util.c" ;adjust default algorithm
3521 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
3522 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
3523 ;; general (i.e. non-square) processor-grid support.
3524 "RowPerm = NOROWPERM;"))
3525 #t))
3526 (patches (search-patches "superlu-dist-scotchmetis.patch"
3527 "superlu-dist-awpm-grid.patch"))))
3528 (build-system cmake-build-system)
3529 (native-inputs
3530 `(("tcsh" ,tcsh)))
3531 (inputs
3532 `(("gfortran" ,gfortran)
3533 ("blas" ,openblas)
3534 ("lapack" ,lapack)
3535 ("combblas" ,combinatorial-blas)))
3536 (propagated-inputs
3537 `(("mpi" ,openmpi) ;headers include MPI heades
3538 ("parmetis" ,pt-scotch32 "metis")
3539 ("pt-scotch" ,pt-scotch32)))
3540 (arguments
3541 `(#:parallel-tests? #f ;tests use MPI and OpenMP
3542 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
3543 "-DTPL_ENABLE_COMBBLASLIB=YES"
3544 "-DTPL_BLAS_LIBRARIES=-lopenblas"
3545 "-DTPL_LAPACK_LIBRARIES=-llapack"
3546 (string-append "-DTPL_PARMETIS_LIBRARIES="
3547 (string-join
3548 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
3549 "scotchmetis" "scotch" "scotcherr")
3550 ";"))
3551 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
3552 (assoc-ref %build-inputs "parmetis")
3553 "/include")
3554 "-DTPL_ENABLE_COMBBLASLIB=ON"
3555 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
3556 (assoc-ref %build-inputs "combblas")
3557 "/include/CombBLAS;"
3558 (assoc-ref %build-inputs "combblas")
3559 "/include/BipartiteMatchings")
3560 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
3561 #:phases
3562 (modify-phases %standard-phases
3563 (add-before 'configure 'set-c++-standard
3564 (lambda _
3565 (substitute* "CMakeLists.txt"
3566 ;; AWPM headers require C++14
3567 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
3568 (add-before 'check 'mpi-setup
3569 ,%openmpi-setup)
3570 (add-before 'check 'omp-setup
3571 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
3572 (home-page (package-home-page superlu))
3573 (synopsis "Parallel supernodal direct solver")
3574 (description
3575 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
3576 It is targeted for distributed memory parallel machines. SuperLU_DIST is
3577 implemented in ANSI C, and MPI for communications.")
3578 (license license:bsd-3)))
3579
3580 (define-public scotch
3581 (package
3582 (name "scotch")
3583 (version "6.1.1")
3584 (source
3585 (origin
3586 (method url-fetch)
3587 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
3588 "latestfile/298/scotch_" version ".tar.gz"))
3589 (sha256
3590 (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
3591 (patches (search-patches "scotch-build-parallelism.patch"
3592 "scotch-integer-declarations.patch"))))
3593 (build-system gnu-build-system)
3594 (inputs
3595 `(("zlib" ,zlib)))
3596 (native-inputs
3597 `(("flex" ,flex)
3598 ("bison" ,bison)
3599 ("gfortran" ,gfortran)))
3600 (outputs '("out" "metis"))
3601 (arguments
3602 `(#:make-flags (list (string-append "prefix=" %output))
3603 #:phases
3604 (modify-phases %standard-phases
3605 (add-after
3606 'unpack 'chdir-to-src
3607 (lambda _ (chdir "src") #t))
3608 (replace
3609 'configure
3610 (lambda _
3611 (call-with-output-file "Makefile.inc"
3612 (lambda (port)
3613 (format port "
3614 EXE =
3615 LIB = .a
3616 OBJ = .o
3617 MAKE = make
3618 AR = ar
3619 ARFLAGS = -ruv
3620 CAT = cat
3621 CCS = gcc
3622 CCP = mpicc
3623 CCD = gcc
3624 FC = gfortran
3625 CPPFLAGS =~{ -D~a~}
3626 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3627 LDFLAGS = -lz -lm -lrt -lpthread
3628 CP = cp
3629 LEX = flex -Pscotchyy -olex.yy.c
3630 LN = ln
3631 MKDIR = mkdir
3632 MV = mv
3633 RANLIB = ranlib
3634 YACC = bison -pscotchyy -y -b y
3635 "
3636 '("COMMON_FILE_COMPRESS_GZ"
3637 "COMMON_PTHREAD"
3638 "COMMON_RANDOM_FIXED_SEED"
3639 "INTSIZE64" ;use 'int64_t'
3640 ;; Prevents symbol clashes with libesmumps
3641 "SCOTCH_RENAME"
3642 ;; XXX: Causes invalid frees in superlu-dist tests
3643 ;; "SCOTCH_PTHREAD"
3644 ;; "SCOTCH_PTHREAD_NUMBER=2"
3645 "restrict=__restrict"))))
3646 #t))
3647 (add-after 'build 'build-esmumps
3648 (lambda _
3649 (invoke "make"
3650 (format #f "-j~a" (parallel-job-count))
3651 "esmumps")))
3652 (add-before 'install 'make-install-dirs
3653 (lambda* (#:key outputs #:allow-other-keys)
3654 (mkdir (assoc-ref outputs "out"))))
3655 (add-after 'install 'install-metis
3656 (lambda* (#:key outputs #:allow-other-keys)
3657 (let ((out (assoc-ref outputs "metis")))
3658 (mkdir out)
3659 ;; metis files are not installed with 'make install'
3660 (for-each (lambda (f)
3661 (install-file f (string-append out "/include")))
3662 (find-files "../include/" ".*metis\\.h"))
3663 (for-each (lambda (f)
3664 (install-file f (string-append out "/lib")))
3665 (find-files "../lib/" ".*metis\\..*"))
3666 #t))))))
3667 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
3668 (properties
3669 `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
3670 (synopsis "Programs and libraries for graph algorithms")
3671 (description "SCOTCH is a set of programs and libraries which implement
3672 the static mapping and sparse matrix reordering algorithms developed within
3673 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
3674 conquer approach, to scientific computing problems such as graph and mesh
3675 partitioning, static mapping, and sparse matrix ordering, in application
3676 domains ranging from structural mechanics to operating systems or
3677 bio-chemistry.")
3678 ;; See LICENSE_en.txt
3679 (license license:cecill-c)))
3680
3681 (define-public scotch32
3682 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
3683 ;; some applications.
3684 (package (inherit scotch)
3685 (name "scotch32")
3686 (arguments
3687 (substitute-keyword-arguments (package-arguments scotch)
3688 ((#:phases scotch-phases)
3689 `(modify-phases ,scotch-phases
3690 (replace
3691 'configure
3692 (lambda _
3693 (call-with-output-file "Makefile.inc"
3694 (lambda (port)
3695 (format port "
3696 EXE =
3697 LIB = .a
3698 OBJ = .o
3699 MAKE = make
3700 AR = ar
3701 ARFLAGS = -ruv
3702 CAT = cat
3703 CCS = gcc
3704 CCP = mpicc
3705 CCD = gcc
3706 FC = gfortran
3707 CPPFLAGS =~{ -D~a~}
3708 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
3709 LDFLAGS = -lz -lm -lrt -lpthread
3710 CP = cp
3711 LEX = flex -Pscotchyy -olex.yy.c
3712 LN = ln
3713 MKDIR = mkdir
3714 MV = mv
3715 RANLIB = ranlib
3716 YACC = bison -pscotchyy -y -b y
3717 "
3718 '("COMMON_FILE_COMPRESS_GZ"
3719 "COMMON_PTHREAD"
3720 "COMMON_RANDOM_FIXED_SEED"
3721 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
3722 ;; Prevents symbolc clashes with libesmumps
3723 "SCOTCH_RENAME"
3724 ;; XXX: Causes invalid frees in superlu-dist tests
3725 ;; "SCOTCH_PTHREAD"
3726 ;; "SCOTCH_PTHREAD_NUMBER=2"
3727 "restrict=__restrict"))))))))))
3728 (synopsis
3729 "Programs and libraries for graph algorithms (32-bit integers)")))
3730
3731 (define-public scotch-shared
3732 (package (inherit scotch)
3733 (name "scotch-shared")
3734 (native-inputs
3735 `(("gcc" ,gcc)
3736 ("flex" ,flex)
3737 ("bison" ,bison)))
3738 (arguments
3739 (substitute-keyword-arguments (package-arguments scotch)
3740 ((#:phases scotch-shared-phases)
3741 `(modify-phases ,scotch-shared-phases
3742 (replace
3743 'configure
3744 (lambda _
3745 ;; Otherwise, the RUNPATH will lack the final path component.
3746 (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
3747 (assoc-ref %outputs "out") "/lib"))
3748 (call-with-output-file "Makefile.inc"
3749 (lambda (port)
3750 (format port "
3751 EXE =
3752 LIB = .so
3753 OBJ = .o
3754 MAKE = make
3755 AR = gcc
3756 ARFLAGS = -shared -o
3757 CAT = cat
3758 CCS = gcc
3759 CCP = mpicc
3760 CCD = gcc
3761 FC = gfortran
3762 CPPFLAGS =~{ -D~a~}
3763 CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
3764 CLIBFLAGS = -shared -fPIC
3765 LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
3766 CP = cp
3767 LEX = flex -Pscotchyy -olex.yy.c
3768 LN = ln
3769 MKDIR = mkdir
3770 MV = mv
3771 RANLIB = echo
3772 YACC = bison -pscotchyy -y -b y
3773 "
3774 '("COMMON_FILE_COMPRESS_GZ"
3775 "COMMON_PTHREAD"
3776 "COMMON_RANDOM_FIXED_SEED"
3777 "INTSIZE64" ;use 'int64_t'
3778 ;; Prevents symbolc clashes with libesmumps
3779 "SCOTCH_RENAME"
3780 ;; XXX: Causes invalid frees in superlu-dist tests
3781 ;; "SCOTCH_PTHREAD"
3782 ;; "SCOTCH_PTHREAD_NUMBER=2"
3783 "restrict=__restrict"
3784 ))))#t))
3785 (delete 'check)))))
3786 (synopsis
3787 "Programs and libraries for graph algorithms (shared libraries version)")))
3788
3789 (define-public pt-scotch
3790 (package (inherit scotch)
3791 (name "pt-scotch")
3792 (propagated-inputs
3793 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3794 (arguments
3795 (substitute-keyword-arguments (package-arguments scotch)
3796 ((#:phases scotch-phases)
3797 `(modify-phases ,scotch-phases
3798 (replace
3799 'build
3800 (lambda _
3801 (invoke "make" (format #f "-j~a" (parallel-job-count))
3802 "ptscotch" "ptesmumps")
3803
3804 ;; Install the serial metis compatibility library
3805 (invoke "make" "-C" "libscotchmetis" "install")))
3806 (add-before 'check 'mpi-setup
3807 ,%openmpi-setup)
3808 (replace 'check
3809 (lambda _
3810 (invoke "make" "ptcheck")))))))
3811 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
3812
3813 (define-public pt-scotch32
3814 (package (inherit scotch32)
3815 (name "pt-scotch32")
3816 (propagated-inputs
3817 `(("openmpi" ,openmpi))) ;headers include MPI headers
3818 (arguments
3819 (substitute-keyword-arguments (package-arguments scotch32)
3820 ((#:phases scotch32-phases)
3821 `(modify-phases ,scotch32-phases
3822 (replace 'build
3823 (lambda _
3824 (invoke "make" (format #f "-j~a" (parallel-job-count))
3825 "ptscotch" "ptesmumps")
3826 ;; Install the serial metis compatibility library
3827 (invoke "make" "-C" "libscotchmetis" "install")))
3828 (add-before 'check 'mpi-setup
3829 ,%openmpi-setup)
3830 (replace 'check
3831 (lambda _
3832 (invoke "make" "ptcheck")))))))
3833 (synopsis
3834 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3835
3836 (define-public pt-scotch-shared
3837 (package (inherit scotch-shared)
3838 (name "pt-scotch-shared")
3839 (propagated-inputs
3840 `(("openmpi" ,openmpi))) ;Headers include MPI headers
3841 (arguments
3842 (substitute-keyword-arguments (package-arguments scotch-shared)
3843 ((#:phases scotch-shared-phases)
3844 `(modify-phases ,scotch-shared-phases
3845 (replace
3846 'build
3847 (lambda _
3848 (invoke "make" (format #f "-j~a" (parallel-job-count))
3849 "ptscotch" "ptesmumps")
3850
3851 ;; Install the serial metis compatibility library
3852 (invoke "make" "-C" "libscotchmetis" "install")))
3853 (add-before 'check 'mpi-setup
3854 ,%openmpi-setup)))))
3855 (synopsis "Graph algorithms (shared libraries version, with MPI)")))
3856
3857
3858 (define-public metis
3859 (package
3860 (name "metis")
3861 (version "5.1.0")
3862 (source
3863 (origin
3864 (method url-fetch)
3865 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3866 "metis-" version ".tar.gz"))
3867 (sha256
3868 (base32
3869 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3870 (properties
3871 `((release-monitoring-url
3872 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
3873 (build-system cmake-build-system)
3874 (inputs
3875 `(("blas" ,openblas)))
3876 (arguments
3877 `(#:tests? #f ;no tests
3878 #:configure-flags `("-DSHARED=ON"
3879 ,(string-append "-DGKLIB_PATH=" (getcwd)
3880 "/metis-" ,version "/GKlib"))))
3881 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3882 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3883 (description
3884 "METIS is a set of serial programs for partitioning graphs, partitioning
3885 finite element meshes, and producing fill-reducing orderings for sparse
3886 matrices. The algorithms implemented in METIS are based on the multilevel
3887 recursive-bisection, multilevel k-way, and multi-constraint partitioning
3888 schemes.")
3889 (license license:asl2.0))) ;As of version 5.0.3
3890
3891 (define-public p4est
3892 (package
3893 (name "p4est")
3894 (version "2.0")
3895 (source
3896 (origin
3897 (method url-fetch)
3898 (uri (string-append "http://p4est.github.io/release/p4est-"
3899 version ".tar.gz"))
3900 (sha256
3901 (base32
3902 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3903 (build-system gnu-build-system)
3904 (inputs
3905 `(("fortran" ,gfortran)
3906 ("blas" ,openblas)
3907 ("lapack" ,lapack)
3908 ("zlib" ,zlib)))
3909 (arguments
3910 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3911 (assoc-ref %build-inputs "blas")
3912 " -lopenblas")
3913 ,(string-append "LAPACK_LIBS=-L"
3914 (assoc-ref %build-inputs "lapack")
3915 " -llapack"))
3916 #:phases (modify-phases %standard-phases
3917 (add-before 'check 'mpi-setup
3918 ,%openmpi-setup))))
3919 (home-page "http://www.p4est.org")
3920 (synopsis "Adaptive mesh refinement on forests of octrees")
3921 (description
3922 "The p4est software library enables the dynamic management of a
3923 collection of adaptive octrees, conveniently called a forest of octrees.
3924 p4est is designed to work in parallel and scales to hundreds of thousands of
3925 processor cores.")
3926 (license license:gpl2+)))
3927
3928 (define-public p4est-openmpi
3929 (package (inherit p4est)
3930 (name "p4est-openmpi")
3931 (inputs
3932 `(("mpi" ,openmpi)
3933 ,@(package-inputs p4est)))
3934 (arguments
3935 (substitute-keyword-arguments (package-arguments p4est)
3936 ((#:configure-flags cf)
3937 ``("--enable-mpi" ,@,cf))))
3938 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3939
3940 (define-public gsegrafix
3941 ;; This is an old and equally dead "experimental fork" of the longer-dead
3942 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
3943 ;; libraries, instead rendering plots with Pango.
3944 (package
3945 (name "gsegrafix")
3946 (version "1.0.7.2")
3947 (source
3948 (origin
3949 (method url-fetch)
3950 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
3951 "gsegrafix-experimental-" version ".tar.gz"))
3952 (sha256
3953 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
3954 (build-system gnu-build-system)
3955 (arguments
3956 `(#:configure-flags
3957 (list "--disable-static")))
3958 (inputs
3959 `(("glib" ,glib)
3960 ("gtk+" ,gtk+)))
3961 (native-inputs
3962 `(("pkg-config" ,pkg-config)))
3963 (home-page "https://www.gnu.org/software/gsegrafix/")
3964 (synopsis "GNOME application to create scientific and engineering plots")
3965 (description
3966 "GSEGrafix is an application which produces high-quality graphical
3967 plots for science and engineering. Plots are specified via simple ASCII
3968 parameter files and data files and are presented in an anti-aliased GNOME
3969 canvas. The program supports rectangular two-dimensional plots, histograms,
3970 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3971 to BMP, JPEG or PNG image formats.")
3972 (license license:gpl3+)))
3973
3974 (define-public maxima
3975 (package
3976 (name "maxima")
3977 (version "5.45.1")
3978 (source
3979 (origin
3980 (method url-fetch)
3981 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3982 version "-source/" name "-" version ".tar.gz"))
3983 (sha256
3984 (base32
3985 "1p77nk5sz1qfkn5zr97szpbi8ib4b22k8i52l4ag5gkhd4kid47y"))
3986 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3987 (build-system gnu-build-system)
3988 (inputs
3989 `(("gcl" ,gcl)
3990 ("gnuplot" ,gnuplot) ;for plots
3991 ("sed" ,sed)
3992 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3993 (native-inputs
3994 `(("texinfo" ,texinfo)
3995 ("perl" ,perl)
3996 ("python" ,python)))
3997 (arguments
3998 `(#:configure-flags
3999 (list "--enable-gcl"
4000 (string-append "--with-posix-shell="
4001 (assoc-ref %build-inputs "bash")
4002 "/bin/sh")
4003 (string-append "--with-wish="
4004 (assoc-ref %build-inputs "tk")
4005 "/bin/wish"
4006 (let ((v ,(package-version tk)))
4007 (string-take v (string-index-right v #\.)))))
4008 ;; By default Maxima attempts to write temporary files to
4009 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
4010 ;; Work around that.
4011 #:make-flags (list "TMPDIR=/tmp")
4012 #:phases
4013 (modify-phases %standard-phases
4014 (add-after 'unpack 'patch-paths
4015 (lambda* (#:key inputs #:allow-other-keys)
4016 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
4017 (coreutils (assoc-ref inputs "coreutils"))
4018 (dirname (string-append coreutils "/bin/dirname"))
4019 (head (string-append coreutils "/bin/head"))
4020 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
4021 (python (string-append (assoc-ref inputs "python")
4022 "/bin/python3")))
4023 (substitute* "src/maxima.in"
4024 (("sed ") (string-append sed " "))
4025 (("dirname") dirname)
4026 (("head") head))
4027 (substitute* "doc/info/Makefile.in"
4028 (("/usr/bin/env perl") perl))
4029 (substitute* "doc/info/build_html.sh.in"
4030 (("python") python))
4031 #t)))
4032 (add-before 'check 'pre-check
4033 (lambda _
4034 (chmod "src/maxima" #o555)
4035 #t))
4036 (replace 'check
4037 (lambda _
4038 ;; This is derived from the testing code in the "debian/rules" file
4039 ;; of Debian's Maxima package.
4040 ;; If Maxima can successfully run this, the binary to be installed
4041 ;; should be fine.
4042 (invoke "sh" "-c"
4043 (string-append
4044 "./maxima-local "
4045 "--lisp=gcl "
4046 "--batch-string=\"run_testsuite();\" "
4047 "| grep -q \"No unexpected errors found\""))))
4048 ;; Make sure the doc and emacs files are found in the
4049 ;; standard location. Also configure maxima to find gnuplot
4050 ;; without having it on the PATH.
4051 (add-after 'install 'post-install
4052 (lambda* (#:key outputs inputs #:allow-other-keys)
4053 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
4054 (out (assoc-ref outputs "out"))
4055 (datadir (string-append out "/share/maxima/" ,version))
4056 (binutils (string-append (assoc-ref inputs "binutils")
4057 "/bin")))
4058 (with-directory-excursion out
4059 (mkdir-p "share/emacs")
4060 (mkdir-p "share/doc")
4061 (symlink
4062 (string-append datadir "/doc/")
4063 (string-append out "/share/doc/maxima"))
4064 (with-atomic-file-replacement
4065 (string-append datadir "/share/maxima-init.lisp")
4066 (lambda (in out)
4067 (format out "~a ~s~a~%"
4068 "(setf $gnuplot_command "
4069 (string-append gnuplot "/bin/gnuplot") ")")
4070 (dump-port in out))))
4071 ;; Ensure that Maxima will have access to the GNU binutils
4072 ;; components at runtime.
4073 (wrap-program (string-append out "/bin/maxima")
4074 `("PATH" prefix (,binutils))))
4075 #t)))))
4076 (home-page "https://maxima.sourceforge.io")
4077 (synopsis "Numeric and symbolic expression manipulation")
4078 (description "Maxima is a system for the manipulation of symbolic and
4079 numerical expressions. It yields high precision numeric results by using
4080 exact fractions, arbitrary precision integers, and variable precision floating
4081 point numbers.")
4082 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
4083 ;; Others simply say "GNU General Public License" without stating a
4084 ;; version (which implicitly means gpl1+).
4085 ;; At least one file (src/maxima.asd) says "version 2."
4086 ;; GPLv2 only is therefore the smallest subset.
4087 (license license:gpl2)))
4088
4089 (define-public wxmaxima
4090 (package
4091 (name "wxmaxima")
4092 (version "21.05.2")
4093 (source
4094 (origin
4095 (method git-fetch)
4096 (uri (git-reference
4097 (url "https://github.com/wxMaxima-developers/wxmaxima")
4098 (commit (string-append "Version-" version))))
4099 (file-name (git-file-name name version))
4100 (sha256
4101 (base32 "0h7ryykh2dapcyvpp4f1j1b3vrrz80x9k8nkci2yxifgdb29vyhw"))))
4102 (build-system cmake-build-system)
4103 (native-inputs
4104 `(("gettext" ,gettext-minimal)))
4105 (inputs
4106 `(("wxwidgets" ,wxwidgets)
4107 ("maxima" ,maxima)
4108 ;; Runtime support.
4109 ("adwaita-icon-theme" ,adwaita-icon-theme)
4110 ("gtk+" ,gtk+)
4111 ("shared-mime-info" ,shared-mime-info)))
4112 (arguments
4113 `(#:tests? #f ; tests fail non-deterministically
4114 #:phases
4115 (modify-phases %standard-phases
4116 (add-after 'unpack 'patch-doc-path
4117 (lambda _
4118 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
4119 ;; documentation. Only licensing information is placed there by
4120 ;; Guix.
4121 (substitute* "src/Dirstructure.cpp"
4122 (("/doc/wxmaxima-\\%s") "/doc/wxmaxima"))
4123 #t))
4124 (add-after 'install 'wrap-program
4125 (lambda* (#:key inputs outputs #:allow-other-keys)
4126 (wrap-program (string-append (assoc-ref outputs "out")
4127 "/bin/wxmaxima")
4128 `("PATH" ":" prefix
4129 (,(string-append (assoc-ref inputs "maxima")
4130 "/bin")))
4131 ;; For GtkFileChooserDialog.
4132 `("GSETTINGS_SCHEMA_DIR" =
4133 (,(string-append (assoc-ref inputs "gtk+")
4134 "/share/glib-2.0/schemas")))
4135 `("XDG_DATA_DIRS" ":" prefix
4136 (;; Needed by gdk-pixbuf to know supported icon formats.
4137 ,(string-append
4138 (assoc-ref inputs "shared-mime-info") "/share")
4139 ;; The default icon theme of GTK+.
4140 ,(string-append
4141 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
4142 #t)))))
4143 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
4144 (synopsis "Graphical user interface for the Maxima computer algebra system")
4145 (description
4146 "wxMaxima is a graphical user interface for the Maxima computer algebra
4147 system. It eases the use of Maxima by making most of its commands available
4148 through a menu system and by providing input dialogs for commands that require
4149 more than one argument. It also implements its own display engine that
4150 outputs mathematical symbols directly instead of depicting them with ASCII
4151 characters.
4152
4153 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
4154 text and mathematical calculations to create documents, exporting of input and
4155 output to TeX, and a browser for Maxima's manual including command index and
4156 full text searching.")
4157 (license license:gpl2+)))
4158
4159 (define-public armadillo
4160 (package
4161 (name "armadillo")
4162 (version "9.100.5")
4163 (source (origin
4164 (method url-fetch)
4165 (uri (string-append "mirror://sourceforge/arma/armadillo-"
4166 version ".tar.xz"))
4167 (sha256
4168 (base32
4169 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
4170 (build-system cmake-build-system)
4171 (arguments `(#:tests? #f)) ; no test target
4172 (inputs
4173 `(("openblas" ,openblas)
4174 ("lapack" ,lapack)
4175 ("arpack" ,arpack-ng)))
4176 (home-page "http://arma.sourceforge.net/")
4177 (synopsis "C++ linear algebra library")
4178 (description
4179 "Armadillo is a C++ linear algebra library, aiming towards a good balance
4180 between speed and ease of use. It is useful for algorithm development
4181 directly in C++, or quick conversion of research code into production
4182 environments. It can be used for machine learning, pattern recognition,
4183 signal processing, bioinformatics, statistics, econometrics, etc. The library
4184 provides efficient classes for vectors, matrices and cubes, as well as 150+
4185 associated functions (e.g., contiguous and non-contiguous submatrix views).")
4186 (license license:asl2.0)))
4187
4188 (define-public muparser
4189 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
4190 ;; different hash. In order to make `guix package --upgrade` work correctly,
4191 ;; we set a Guix packaging revision.
4192 ;; When the next version of muparser is released, we can remove
4193 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
4194 (let ((upstream-version "2.2.5")
4195 (revision "2"))
4196 (package
4197 (name "muparser")
4198 (version (string-append upstream-version "-" revision))
4199 (source
4200 (origin
4201 (method git-fetch)
4202 (uri (git-reference
4203 (url "https://github.com/beltoforion/muparser")
4204 (commit (string-append "v" upstream-version))))
4205 (file-name (git-file-name name version))
4206 (sha256
4207 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
4208 (build-system gnu-build-system)
4209 (arguments
4210 `(#:configure-flags '("--enable-samples=no")
4211 #:tests? #f)) ;no "check" target
4212 (home-page "http://muparser.beltoforion.de/")
4213 (synopsis "Fast parser library for mathematical expressions")
4214 (description
4215 "muParser is an extensible high performance math parser library. It is
4216 based on transforming an expression into a bytecode and precalculating constant
4217 parts of it.")
4218 (license license:expat))))
4219
4220 (define-public openblas
4221 (package
4222 (name "openblas")
4223 (version "0.3.9")
4224 (source
4225 (origin
4226 (method url-fetch)
4227 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
4228 version "%20version.tar.gz"))
4229 (file-name (string-append name "-" version ".tar.gz"))
4230 (sha256
4231 (base32
4232 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
4233 (build-system gnu-build-system)
4234 (arguments
4235 `(#:test-target "test"
4236 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
4237 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
4238 ;; we need to disable substitutions.
4239 #:substitutable?
4240 ,(let ((system (or (%current-target-system) (%current-system))))
4241 (or (string-prefix? "x86_64" system)
4242 (string-prefix? "i686" system)
4243 (string-prefix? "mips" system)
4244 (string-prefix? "aarch64" system)))
4245 #:make-flags
4246 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4247 "SHELL=bash"
4248 "MAKE_NB_JOBS=0" ;use jobserver for submakes
4249
4250 ;; This is the maximum number of threads OpenBLAS will ever use (that
4251 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
4252 ;; is used.) If we don't set it, the makefile sets it to the number
4253 ;; of cores of the build machine, which is obviously wrong.
4254 "NUM_THREADS=128"
4255
4256 ;; Build the library for all supported CPUs. This allows
4257 ;; switching CPU targets at runtime with the environment variable
4258 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
4259 ;; Unfortunately, this is not supported on all architectures,
4260 ;; where it leads to failed builds.
4261 ,@(let ((system (or (%current-target-system) (%current-system))))
4262 (cond
4263 ((or (string-prefix? "x86_64" system)
4264 (string-prefix? "i686" system))
4265 '("DYNAMIC_ARCH=1"))
4266 ;; On some of these architectures the CPU can't be detected.
4267 ((string-prefix? "powerpc64le" system)
4268 '("DYNAMIC_ARCH=1"
4269 "TARGET=GENERIC"))
4270 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
4271 ;; two available MIPS targets special extended instructions
4272 ;; for Loongson cores are used.
4273 ((string-prefix? "mips" system)
4274 '("TARGET=SICORTEX"))
4275 ;; On aarch64 force the generic 'armv8-a' target
4276 ((string-prefix? "aarch64" system)
4277 '("TARGET=ARMV8"))
4278 ;; Failed to detect CPU.
4279 ((string-prefix? "armhf" system)
4280 '("TARGET=ARMV7"))
4281 (else '()))))
4282 ;; no configure script
4283 #:phases
4284 (modify-phases %standard-phases
4285 (delete 'configure)
4286 (add-before 'build 'set-extralib
4287 (lambda* (#:key inputs #:allow-other-keys)
4288 ;; Get libgfortran found when building in utest.
4289 (setenv "FEXTRALIB"
4290 (string-append "-L" (assoc-ref inputs "fortran-lib")
4291 "/lib"))
4292 #t)))))
4293 (inputs
4294 `(("fortran-lib" ,gfortran "lib")))
4295 (native-inputs
4296 `(("cunit" ,cunit)
4297 ("fortran" ,gfortran)
4298 ("perl" ,perl)))
4299 (home-page "https://www.openblas.net/")
4300 (synopsis "Optimized BLAS library based on GotoBLAS")
4301 (description
4302 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
4303 (license license:bsd-3)))
4304
4305 (define-public openblas-ilp64
4306 (package/inherit openblas
4307 (name "openblas-ilp64")
4308 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
4309 (arguments
4310 (substitute-keyword-arguments (package-arguments openblas)
4311 ((#:make-flags flags '())
4312 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
4313 ,flags))))
4314 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
4315 (license license:bsd-3)))
4316
4317 (define-public blis
4318 (package
4319 (name "blis")
4320 (version "0.8.1")
4321 (home-page "https://github.com/flame/blis")
4322 (source (origin
4323 (method git-fetch)
4324 (uri (git-reference (url home-page) (commit version)))
4325 (sha256
4326 (base32
4327 "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
4328 (file-name (git-file-name "blis" version))))
4329 (native-inputs
4330 `(("python" ,python)
4331 ("perl" ,perl)))
4332 (build-system gnu-build-system)
4333 (arguments
4334 `(#:modules
4335 ((guix build gnu-build-system)
4336 (guix build utils)
4337 (srfi srfi-1))
4338 #:test-target "test"
4339 #:phases
4340 (modify-phases %standard-phases
4341 (replace 'configure
4342 (lambda* (#:key outputs
4343 target
4344 system
4345 (configure-flags '())
4346 #:allow-other-keys)
4347 ;; This is a home-made 'configure' script.
4348 (let* ((out (assoc-ref outputs "out"))
4349 ;; Guix-specific support for choosing the configuration
4350 ;; via #:configure-flags: see below for details.
4351 (config-flag-prefix "--blis-config=")
4352 (maybe-config-flag (find
4353 (lambda (s)
4354 (string-prefix? config-flag-prefix s))
4355 configure-flags))
4356 (configure-flags (if maybe-config-flag
4357 (delete maybe-config-flag
4358 configure-flags)
4359 configure-flags))
4360 ;; Select the "configuration" to build.
4361 ;; The "generic" configuration is non-optimized but
4362 ;; portable (no assembly).
4363 ;; The "x86_64" configuration family includes
4364 ;; sub-configurations for all supported
4365 ;; x86_64 microarchitectures.
4366 ;; BLIS currently lacks runtime hardware detection
4367 ;; for other architectures: see
4368 ;; <https://github.com/flame/blis/commit/c534da6>.
4369 ;; Conservatively, we stick to "generic" on armhf,
4370 ;; aarch64, and ppc64le for now. (But perhaps
4371 ;; "power9", "cortexa9", and "cortexa57" might be
4372 ;; general enough to use?)
4373 ;; Another approach would be to use the "auto"
4374 ;; configuration and make this package
4375 ;; non-substitutable.
4376 ;; The build is fairly intensive, though.
4377 (blis-config
4378 (cond
4379 (maybe-config-flag
4380 (substring maybe-config-flag
4381 (string-length config-flag-prefix)))
4382 ((string-prefix? "x86_64" (or target system))
4383 "x86_64")
4384 (else
4385 "generic")))
4386 (configure-args
4387 `("-p" ,out
4388 "-d" "opt"
4389 "--disable-static"
4390 "--enable-shared"
4391 "--enable-threading=openmp"
4392 "--enable-verbose-make"
4393 ,@configure-flags
4394 ,blis-config)))
4395 (format #t "configure args: ~s~%" configure-args)
4396 (apply invoke
4397 "./configure"
4398 configure-args)
4399 #t)))
4400 (add-before 'check 'show-test-output
4401 (lambda _
4402 ;; By default "make check" is silent. Make it verbose.
4403 (system "tail -F output.testsuite &")
4404 #t)))))
4405 (synopsis "High-performance basic linear algebra (BLAS) routines")
4406 (description
4407 "BLIS is a portable software framework for instantiating high-performance
4408 BLAS-like dense linear algebra libraries. The framework was designed to
4409 isolate essential kernels of computation that, when optimized, immediately
4410 enable optimized implementations of most of its commonly used and
4411 computationally intensive operations. While BLIS exports a new BLAS-like API,
4412 it also includes a BLAS compatibility layer which gives application developers
4413 access to BLIS implementations via traditional BLAS routine calls.")
4414 (license license:bsd-3)))
4415
4416 (define-public blis-sandybridge (deprecated-package "blis-sandybridge" blis))
4417 (define-public blis-haswell (deprecated-package "blis-haswell" blis))
4418 (define-public blis-knl (deprecated-package "blis-knl" blis))
4419
4420 (define ignorance blis)
4421
4422 (define-public openlibm
4423 (package
4424 (name "openlibm")
4425 (version "0.7.4")
4426 (source
4427 (origin
4428 (method git-fetch)
4429 (uri (git-reference
4430 (url "https://github.com/JuliaLang/openlibm")
4431 (commit (string-append "v" version))))
4432 (file-name (git-file-name name version))
4433 (sha256
4434 (base32 "1azms0lpxb7vxb3bln5lyz0wpwx6jnzbffkclclpq2v5aiw8d14i"))))
4435 (build-system gnu-build-system)
4436 (arguments
4437 `(#:make-flags
4438 (list (string-append "prefix=" (assoc-ref %outputs "out"))
4439 ,(string-append "CC=" (cc-for-target)))
4440 #:phases
4441 ;; no configure script
4442 (modify-phases %standard-phases (delete 'configure))
4443 #:tests? #f)) ;the tests are part of the default target
4444 (home-page "https://openlibm.org/")
4445 (synopsis "Portable C mathematical library (libm)")
4446 (description
4447 "OpenLibm is an effort to have a high quality, portable, standalone C
4448 mathematical library (libm). It can be used standalone in applications and
4449 programming language implementations. The project was born out of a need to
4450 have a good libm for the Julia programming language that worked consistently
4451 across compilers and operating systems, and in 32-bit and 64-bit
4452 environments.")
4453 ;; Each architecture has its own make target, and there is none for mips.
4454 (supported-systems (delete "mips64el-linux" %supported-systems))
4455 ;; See LICENSE.md for details.
4456 (license (list license:expat
4457 license:isc
4458 license:bsd-2
4459 license:public-domain
4460 license:lgpl2.1+))))
4461
4462 (define-public openspecfun
4463 (package
4464 (name "openspecfun")
4465 (version "0.5.3")
4466 (source
4467 (origin
4468 (method git-fetch)
4469 (uri (git-reference
4470 (url "https://github.com/JuliaLang/openspecfun")
4471 (commit (string-append "v" version))))
4472 (file-name (git-file-name name version))
4473 (sha256
4474 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
4475 (build-system gnu-build-system)
4476 (arguments
4477 '(#:tests? #f ; no "check" target
4478 #:make-flags
4479 (list (string-append "prefix=" (assoc-ref %outputs "out")))
4480 #:phases
4481 (modify-phases %standard-phases
4482 (delete 'configure)))) ; no configure script
4483 (inputs
4484 `(("fortran" ,gfortran)))
4485 (home-page "https://github.com/JuliaLang/openspecfun")
4486 (synopsis "Collection of special mathematical functions")
4487 (description
4488 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
4489 portable package for Bessel Functions of a Complex Argument and Nonnegative
4490 Order; it contains subroutines for computing Bessel functions and Airy
4491 functions. Faddeeva allows computing the various error functions of arbitrary
4492 complex arguments (Faddeeva function, error function, complementary error
4493 function, scaled complementary error function, imaginary error function, and
4494 Dawson function); given these, one can also easily compute Voigt functions,
4495 Fresnel integrals, and similar related functions as well.")
4496 ;; Faddeeva is released under the Expat license; AMOS is included as
4497 ;; public domain software.
4498 (license (list license:expat license:public-domain))))
4499
4500 (define-public suitesparse
4501 (package
4502 (name "suitesparse")
4503 (version "5.10.1")
4504 (source
4505 (origin
4506 (method git-fetch)
4507 (uri (git-reference
4508 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
4509 (commit (string-append "v" version))))
4510 (file-name (git-file-name name version))
4511 (sha256
4512 (base32
4513 "19gx5wlgqnqpgz6mvam9lalyzpbfwgqhppps8z3np9sh0mgaiyw9"))
4514 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
4515 (modules '((guix build utils)))
4516 (snippet
4517 ;; Remove bundled metis source
4518 '(begin
4519 (delete-file-recursively "metis-5.1.0")
4520 #t))))
4521 (build-system gnu-build-system)
4522 (arguments
4523 `(#:tests? #f ;no "check" target
4524 #:make-flags
4525 (list (string-append "CC=" ,(cc-for-target))
4526 "TBB=-ltbb"
4527 "MY_METIS_LIB=-lmetis"
4528
4529 ;; The default is to link against netlib lapack. Use OpenBLAS
4530 ;; instead.
4531 "BLAS=-lopenblas" "LAPACK=-lopenblas"
4532
4533 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
4534 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
4535 (assoc-ref %outputs "out")
4536 " -DCMAKE_VERBOSE_MAKEFILE=ON"
4537 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
4538 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
4539 " -DCMAKE_SKIP_RPATH=TRUE"
4540 " -DCMAKE_BUILD_TYPE=Release"
4541 " -DCMAKE_INSTALL_LIBDIR=lib")
4542 (string-append "INSTALL_LIB="
4543 (assoc-ref %outputs "out") "/lib")
4544 (string-append "INSTALL_INCLUDE="
4545 (assoc-ref %outputs "out") "/include")
4546 "library")
4547 #:phases
4548 (modify-phases %standard-phases
4549 (delete 'configure)))) ;no configure script
4550 (inputs
4551 `(("tbb" ,tbb)
4552 ("openblas" ,openblas)
4553 ("gmp" ,gmp)
4554 ("mpfr" ,mpfr)
4555 ("metis" ,metis)))
4556 (native-inputs
4557 `(("cmake" ,cmake-minimal)
4558 ("m4" ,m4)))
4559 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
4560 (synopsis "Suite of sparse matrix software")
4561 (description
4562 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
4563 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
4564 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
4565 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
4566 CXSparse, a concise sparse Cholesky factorization package; and many other
4567 packages.")
4568 ;; LGPLv2.1+:
4569 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
4570 ;; GPLv2+:
4571 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
4572 (license (list license:gpl2+ license:lgpl2.1+))))
4573
4574 (define-public atlas
4575 (package
4576 (name "atlas")
4577 (version "3.10.3")
4578 (source (origin
4579 (method url-fetch)
4580 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
4581 version "/atlas" version ".tar.bz2"))
4582 (sha256
4583 (base32
4584 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
4585 (build-system gnu-build-system)
4586 (home-page "http://math-atlas.sourceforge.net/")
4587 (inputs `(("gfortran" ,gfortran)
4588 ("lapack-tar" ,(package-source lapack))))
4589 (outputs '("out" "doc"))
4590 ;; For the moment we drop support for MIPS at it fails to compile. See
4591 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
4592 (supported-systems (delete "mips64el-linux" %supported-systems))
4593 (arguments
4594 `(#:parallel-build? #f
4595 #:parallel-tests? #f
4596
4597 ;; ATLAS tunes itself for the machine it is built on, as explained at
4598 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
4599 ;; For this reason, we want users to build it locally instead of using
4600 ;; substitutes.
4601 #:substitutable? #f
4602
4603 #:modules ((srfi srfi-26)
4604 (guix build gnu-build-system)
4605 (guix build utils))
4606 #:configure-flags
4607 `(;; Generate position independent code suitable for dynamic libraries
4608 ;; and use WALL timer to get more accurate timing.
4609 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
4610 ;; Set word width.
4611 "-b"
4612 ,,(if (string-match "64" (%current-system))
4613 "64"
4614 "32")
4615 ;; Disable parallel build as it gives errors: atlas_pthread.h is
4616 ;; needed to compile C files before it is generated.
4617 "-Ss" "pmake" "make -j 1"
4618 ;; Probe is failing for MIPS. We therefore define the system
4619 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
4620 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
4621 ,,@(if (string-prefix? "mips" (%current-system))
4622 (list "-A" "49" "-V" "1")
4623 (list))
4624 ;; Generate shared libraries.
4625 "--shared"
4626 ;; Build a full LAPACK library.
4627 ,(string-append "--with-netlib-lapack-tarfile="
4628 (assoc-ref %build-inputs "lapack-tar")))
4629 #:phases
4630 (modify-phases %standard-phases
4631 (add-after 'install 'install-doc
4632 (lambda* (#:key outputs inputs #:allow-other-keys)
4633 (let ((doc (string-append (assoc-ref outputs "doc")
4634 "/share/doc/atlas")))
4635 (mkdir-p doc)
4636 (for-each (cut install-file <> doc)
4637 (find-files "../ATLAS/doc" ".*"))
4638 #t)))
4639 (add-after 'check 'check-pt
4640 (lambda _ (invoke "make" "ptcheck")))
4641 ;; Fix files required to run configure.
4642 (add-before 'configure 'fix-/bin/sh
4643 (lambda _
4644 ;; Use `sh', not `/bin/sh'.
4645 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
4646 (("/bin/sh")
4647 "sh"))
4648 #t))
4649 ;; Fix /bin/sh in generated make files.
4650 (add-after 'configure 'fix-/bin/sh-in-generated-files
4651 (lambda _
4652 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
4653 (("/bin/sh")
4654 "sh"))
4655 #t))
4656 ;; ATLAS configure program does not accepts the default flags
4657 ;; passed by the 'gnu-build-system'.
4658 (replace 'configure
4659 (lambda* (#:key native-inputs inputs outputs
4660 (configure-flags '())
4661 #:allow-other-keys #:rest args)
4662 (let* ((prefix (assoc-ref outputs "out"))
4663 (bash (or (and=> (assoc-ref
4664 (or native-inputs inputs) "bash")
4665 (cut string-append <> "/bin/bash"))
4666 "/bin/sh"))
4667 (flags `(,(string-append "--prefix=" prefix)
4668 ,@configure-flags))
4669 (abs-srcdir (getcwd))
4670 (srcdir (string-append "../" (basename abs-srcdir))))
4671 (format #t "source directory: ~s (relative from build: ~s)~%"
4672 abs-srcdir srcdir)
4673 (mkdir "../build")
4674 (chdir "../build")
4675 (format #t "build directory: ~s~%" (getcwd))
4676 (format #t "configure flags: ~s~%" flags)
4677 (apply invoke bash
4678 (string-append srcdir "/configure")
4679 flags)))))))
4680 (synopsis "Automatically Tuned Linear Algebra Software")
4681 (description
4682 "ATLAS is an automatically tuned linear algebra software library
4683 providing C and Fortran77 interfaces to a portably efficient BLAS
4684 implementation, as well as a few routines from LAPACK.
4685
4686 Optimization occurs at build time. For this reason, the library is built on
4687 the machine where it is installed, without resorting to pre-built substitutes.
4688
4689 Before building the library, CPU throttling should be disabled. This can be
4690 done in the BIOS, or, on GNU/Linux, with the following command:
4691
4692 @example
4693 # cpupower --governor performance
4694 @end example
4695
4696 Failure to do so will result in a library with poor performance.")
4697 ;; The test suite is notoriously lengthy and routinely exceeds the default
4698 ;; timeout of 21600 seconds on the not unbeefy berlin build nodes.
4699 (properties '((timeout . 86400))) ; 1 day
4700 (license license:bsd-3)))
4701
4702 (define-public cglm
4703 (package
4704 (name "cglm")
4705 (version "0.8.2")
4706 (source
4707 (origin
4708 (method git-fetch)
4709 (uri (git-reference
4710 (url "https://github.com/recp/cglm")
4711 (commit (string-append "v" version))))
4712 (file-name (git-file-name name version))
4713 (sha256
4714 (base32 "1lcfl9ph4bnl3hckpx4hzwh8r4llnw94ik75igc5qy38wk468gmk"))))
4715 (build-system cmake-build-system)
4716 (arguments
4717 `(#:configure-flags
4718 (list "-DCGLM_USE_TEST=ON")))
4719 (home-page "https://github.com/recp/cglm")
4720 (synopsis "Mathematics C library for graphics programming")
4721 (description
4722 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
4723 for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
4724 specifications.
4725
4726 It's similar to the original C++ GLM library but written in C99 and compatible
4727 with C89.")
4728 (license license:expat)))
4729
4730 (define-public glm
4731 (package
4732 (name "glm")
4733 (version "0.9.9.8")
4734 (source
4735 (origin
4736 (method url-fetch)
4737 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
4738 version "/glm-" version ".zip"))
4739 (sha256
4740 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
4741 (build-system cmake-build-system)
4742 (arguments
4743 `(#:phases (modify-phases %standard-phases
4744 (replace 'install
4745 (lambda* (#:key outputs #:allow-other-keys)
4746 ;; Since version 0.9.9.6, 'make install' is not supported
4747 ;; and we have to do it "manually". Upstream discussion:
4748 ;; <https://github.com/g-truc/glm/pull/968>.
4749 (let* ((source (string-append "../glm"))
4750 (out (assoc-ref outputs "out"))
4751 (inc (string-append out "/include"))
4752 (lib (string-append out "/lib"))
4753 (pkgconfig (string-append lib "/pkgconfig")))
4754 (with-directory-excursion source
4755 (mkdir-p inc)
4756 (mkdir-p pkgconfig)
4757 (copy-recursively "glm" (string-append inc "/glm"))
4758 (copy-recursively "cmake" (string-append lib "/cmake"))
4759 (call-with-output-file (string-append pkgconfig "/glm.pc")
4760 (lambda (port)
4761 (format port
4762 "prefix=~a
4763 includedir=${prefix}/include
4764
4765 Name: GLM
4766 Description: OpenGL Mathematics
4767 Version: ~a
4768 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
4769 #t))))))
4770 (native-inputs
4771 `(("unzip" ,unzip)))
4772 (home-page "https://glm.g-truc.net/")
4773 (synopsis "OpenGL Mathematics library")
4774 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
4775 library for graphics software based on the OpenGL Shading Language (GLSL)
4776 specifications.")
4777 (license license:expat)))
4778
4779 (define-public lpsolve
4780 (package
4781 (name "lpsolve")
4782 (version "5.5.2.5")
4783 (source
4784 (origin
4785 (method url-fetch)
4786 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
4787 "/lp_solve_" version "_source.tar.gz"))
4788 (sha256
4789 (base32
4790 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
4791 (modules '((guix build utils)))
4792 (snippet
4793 '(begin
4794 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
4795 (("^c=cc") "c=gcc")
4796 ;; Pretend to be on a 64 bit platform to obtain a common directory
4797 ;; name for the build results on all architectures; nothing else
4798 ;; seems to depend on it.
4799 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
4800
4801 ;; The check for 'isnan' as it is written fails with
4802 ;; "non-floating-point argument in call to function
4803 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
4804 ;; definition, which in turn leads to bad things. Fix the feature
4805 ;; test.
4806 (("isnan\\(0\\)") "isnan(0.)"))
4807 #t))))
4808 (build-system gnu-build-system)
4809 (arguments
4810 `(#:tests? #f ; no check target
4811 #:phases
4812 (modify-phases %standard-phases
4813 (delete 'configure) ; no configure script
4814 (replace 'build
4815 (lambda _
4816 (with-directory-excursion "lpsolve55"
4817 (invoke "bash" "ccc"))
4818 (with-directory-excursion "lp_solve"
4819 (invoke "bash" "ccc"))
4820 #t))
4821 (replace 'install
4822 (lambda* (#:key outputs #:allow-other-keys)
4823 (let* ((out (assoc-ref outputs "out"))
4824 (bin (string-append out "/bin"))
4825 (lib (string-append out "/lib"))
4826 ;; This is where LibreOffice expects to find the header
4827 ;; files, and where they are installed by Debian.
4828 (include (string-append out "/include/lpsolve")))
4829 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
4830 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
4831 (install-file "lp_solve/bin/ux64/lp_solve" bin)
4832
4833 ;; Install a subset of the header files as on Debian
4834 ;; (plus lp_bit.h, which matches the regular expression).
4835 (for-each (lambda (name)
4836 (install-file name include))
4837 (find-files "." "lp_[HMSa-z].*\\.h$"))
4838 (with-directory-excursion "shared"
4839 (for-each (lambda (name)
4840 (install-file name include))
4841 (find-files "." "\\.h$")))
4842 #t))))))
4843 (home-page "http://lpsolve.sourceforge.net/")
4844 (synopsis "Mixed integer linear programming (MILP) solver")
4845 (description
4846 "lp_solve is a mixed integer linear programming solver based on the
4847 revised simplex and the branch-and-bound methods.")
4848 (license license:lgpl2.1+)))
4849
4850 ;; Private Trilinos package for dealii-openmpi (similar to
4851 ;; trilinos-serial-xyce and trilinos-parallel-xyce).
4852 ;; This version is the latest known to be compatible with deal.II [1].
4853 ;; Since the latest version of Trilinos is not necessarily supported by
4854 ;; deal.II, it may be worth keeping this package even if and when Trilinos
4855 ;; gets packaged separately for Guix (unless various versions of Trilinos are
4856 ;; packaged).
4857 ;;
4858 ;; An insightful source of information for building Trilinos for deal.II lies
4859 ;; in the Trilinos package for candi [2], which is a source-based installer
4860 ;; for deal.II and its dependencies.
4861 ;;
4862 ;; [1]: https://www.dealii.org/current/external-libs/trilinos.html
4863 ;; [2]: https://github.com/dealii/candi/blob/master/deal.II-toolchain/packages/trilinos.package
4864 (define trilinos-for-dealii-openmpi
4865 (package
4866 (name "trilinos-for-dealii-openmpi")
4867 (version "12.18.1")
4868 (source
4869 (origin
4870 (method git-fetch)
4871 (uri (git-reference
4872 (url "https://github.com/trilinos/Trilinos/")
4873 (commit
4874 (string-append "trilinos-release-"
4875 (string-replace-substring version "." "-")))))
4876 (file-name (git-file-name "trilinos" version))
4877 (sha256
4878 (base32 "0fnwlhzsh85qj38cq3igbs8nm1b2jdgr2z734sapmyyzsy21mkgp"))))
4879 (build-system cmake-build-system)
4880 (native-inputs
4881 `(("gfortran" ,gfortran)
4882 ;; Trilinos's repository contains several C-shell scripts, but adding
4883 ;; tcsh to the native inputs does not result in the check phase running
4884 ;; any more tests than without it (nor is tcsh required to build
4885 ;; Trilinos).
4886 ;; It seems that Trilinos has replaced its use of C-shell test scripts
4887 ;; with CMake's testing facilities.
4888 ;; For example,
4889 ;; packages/zoltan/doc/Zoltan_html/dev_html/dev_test_script.html [1]
4890 ;; states that Zoltan's C-shell test script
4891 ;; packages/zoltan/test/test_zoltan has been obsoleted by the tests now
4892 ;; performed through CMake.
4893 ;;
4894 ;; Perl is required for some Zoltan tests and Python 2 for one ML test.
4895 ;;
4896 ;; [1]: https://cs.sandia.gov/zoltan/dev_html/dev_test_script.html
4897 ("perl" ,perl)
4898 ("python" ,python-2)))
4899 (inputs
4900 `(("blas" ,openblas)
4901 ("lapack" ,lapack)
4902 ("mumps" ,mumps-openmpi)
4903 ("scalapack" ,scalapack)))
4904 (propagated-inputs
4905 `(("mpi" ,openmpi)))
4906 (arguments
4907 `(#:build-type "Release"
4908 #:configure-flags
4909 `("-DBUILD_SHARED_LIBS=ON"
4910 ;; Obtain the equivalent of RelWithDebInfo but with -O3 (the Release
4911 ;; default) rather than -O2 (the RelWithDebInfo default), to conform
4912 ;; to candi's trilinos.package's compilation flags, which are -g -O3.
4913 "-DCMAKE_C_FLAGS=-g"
4914 "-DCMAKE_CXX_FLAGS=-g"
4915 "-DCMAKE_Fortran_FLAGS=-g"
4916
4917 ;; Trilinos libraries that deal.II can interface with.
4918 "-DTrilinos_ENABLE_Amesos=ON"
4919 "-DTrilinos_ENABLE_AztecOO=ON"
4920 "-DTrilinos_ENABLE_Epetra=ON"
4921 "-DTrilinos_ENABLE_EpetraExt=ON"
4922 "-DTrilinos_ENABLE_Ifpack=ON"
4923 "-DTrilinos_ENABLE_ML=ON"
4924 "-DTrilinos_ENABLE_MueLu=ON"
4925 "-DTrilinos_ENABLE_ROL=ON"
4926 ;; Optional; required for deal.II's GridIn::read_exodusii, but
4927 ;; depends on netcdf.
4928 ;; Enable if and when someone needs it.
4929 ;;"-DTrilinos_ENABLE_SEACAS=ON"
4930 "-DTrilinos_ENABLE_Sacado=ON"
4931 "-DTrilinos_ENABLE_Teuchos=ON"
4932 "-DTrilinos_ENABLE_Tpetra=ON"
4933 "-DTrilinos_ENABLE_Zoltan=ON"
4934
4935 ;; Third-party libraries (TPLs) that Trilinos can interface with.
4936 "-DBLAS_LIBRARY_NAMES=openblas"
4937 "-DTPL_ENABLE_MPI=ON"
4938 "-DTPL_ENABLE_MUMPS=ON"
4939 "-DTPL_ENABLE_SCALAPACK=ON"
4940
4941 ;; Enable the tests but not the examples (which are enabled by
4942 ;; default when enabling tests).
4943 ;; Although some examples are run as tests, they are otherwise
4944 ;; unnecessary since this is a private package meant for
4945 ;; dealii-openmpi.
4946 ;; Besides, some MueLu and ROL examples require a lot of memory to
4947 ;; compile.
4948 ;;
4949 ;; (For future reference, note that some ROL and SEACAS examples
4950 ;; require removing gfortran from CPLUS_INCLUDE_PATH as in the
4951 ;; dune-istl, dune-localfunctions and dune-alugrid packages.)
4952 "-DTrilinos_ENABLE_TESTS=ON"
4953 "-DTrilinos_ENABLE_EXAMPLES=OFF"
4954 ;; MueLu tests require considerably more time and memory to compile
4955 ;; than the rest of the tests.
4956 "-DMueLu_ENABLE_TESTS=OFF"
4957
4958 ;; The following options were gleaned from candi's trilinos.package.
4959 ;; (We do not enable the complex instantiations, which are anyway
4960 ;; provided only as an option in trilinos.package, because they are
4961 ;; costly in compilation time and memory usage, and disk space [1].)
4962 ;;
4963 ;; [1]: https://www.docs.trilinos.org/files/TrilinosBuildReference.html#enabling-float-and-complex-scalar-types
4964 "-DTrilinos_ENABLE_Ifpack2=OFF"
4965 "-DTeuchos_ENABLE_FLOAT=ON"
4966 "-DTpetra_INST_INT_LONG=ON"
4967 "-DTPL_ENABLE_Boost=OFF")
4968 #:phases
4969 (modify-phases %standard-phases
4970 (add-after 'configure 'fix-kokkos-config
4971 (lambda _
4972 ;; GNU Make 4.3 accidentally leaves the backslash preceding the
4973 ;; number sign in strings containing a literal backslash–number
4974 ;; sign (\#) [1, 2].
4975 ;; This is still an issue in Trilinos 13.0.1, but should be fixed
4976 ;; in the following version.
4977 ;; (The latest versions of Kokkos incorporate the fix [2].)
4978 ;;
4979 ;; [1]: https://github.com/GEOSX/thirdPartyLibs/issues/136
4980 ;; [2]: https://github.com/kokkos/kokkos/blob/3.4.00/Makefile.kokkos#L441
4981 (substitute* "KokkosCore_config.h"
4982 (("\\\\#") "#"))
4983 #t))
4984 (add-before 'check 'mpi-setup
4985 ,%openmpi-setup))))
4986 (home-page "https://trilinos.github.io/")
4987 (synopsis "Algorithms for engineering and scientific problems")
4988 (description
4989 "The Trilinos Project is an effort to develop algorithms and enabling
4990 technologies within an object-oriented software framework for the solution of
4991 large-scale, complex multi-physics engineering and scientific problems.
4992 A unique design feature of Trilinos is its focus on packages.")
4993 ;; The packages are variously licensed under more than just BSD-3 and
4994 ;; LGPL-2.1+, but all the licenses are either BSD- or LGPL-compatible.
4995 ;; See https://trilinos.github.io/license.html.
4996 (license (list license:bsd-3 license:lgpl2.1+))))
4997
4998 (define-public dealii
4999 (package
5000 (name "dealii")
5001 (version "9.3.1")
5002 (source
5003 (origin
5004 (method url-fetch)
5005 (uri (string-append "https://github.com/dealii/dealii/releases/"
5006 "download/v" version "/dealii-" version ".tar.gz"))
5007 (sha256
5008 (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
5009 (modules '((guix build utils)))
5010 (snippet
5011 '(begin
5012 ;; Remove bundled boost, muparser, TBB and UMFPACK.
5013 (delete-file-recursively "bundled")
5014 #t))))
5015 (build-system cmake-build-system)
5016 (outputs '("out" "doc"))
5017 (native-inputs
5018 ;; Required to build the documentation.
5019 `(("dot" ,graphviz)
5020 ("doxygen" ,doxygen)
5021 ("perl" ,perl)))
5022 (inputs
5023 `(("arpack" ,arpack-ng)
5024 ("blas" ,openblas)
5025 ("gfortran" ,gfortran)
5026 ("lapack" ,lapack)
5027 ("muparser" ,muparser)
5028 ("zlib" ,zlib)))
5029 (propagated-inputs
5030 ;; Some scripts are installed into share/deal.II/scripts that require
5031 ;; perl and python, but they are not executable (and some are missing the
5032 ;; shebang line) and therefore must be explicitly passed to the
5033 ;; interpreter.
5034 ;; Anyway, they are meant to be used at build time, so rather than adding
5035 ;; the interpreters here, any package depending on them should just add
5036 ;; the requisite interpreter to its native inputs.
5037 `(("boost" ,boost)
5038 ("hdf5" ,hdf5)
5039 ("suitesparse" ,suitesparse) ; For UMFPACK.
5040 ("tbb" ,tbb)))
5041 (arguments
5042 `(#:build-type "DebugRelease" ; Supports only Debug, Release and DebugRelease.
5043 ;; The tests take too long and must be explicitly enabled with "make
5044 ;; setup_tests".
5045 ;; See https://www.dealii.org/developer/developers/testsuite.html.
5046 ;; (They can also be run for an already installed deal.II.)
5047 #:tests? #f
5048 #:configure-flags
5049 (let ((doc (string-append (assoc-ref %outputs "doc")
5050 "/share/doc/" ,name "-" ,version)))
5051 `("-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
5052 ,(string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
5053 ,(string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
5054 ;; Don't compile the examples because the source and CMakeLists.txt
5055 ;; are installed anyway, allowing users to do so for themselves.
5056 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
5057 ,(string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc "/examples")))
5058 #:phases
5059 (modify-phases %standard-phases
5060 (add-after 'install 'remove-build-logs
5061 ;; These build logs leak the name of the build directory by storing
5062 ;; the values of CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.
5063 (lambda* (#:key outputs #:allow-other-keys)
5064 (let ((doc (string-append (assoc-ref outputs "doc")
5065 "/share/doc/" ,name "-" ,version)))
5066 (for-each delete-file (map (lambda (f) (string-append doc "/" f))
5067 '("detailed.log" "summary.log"))))
5068 #t)))))
5069 (home-page "https://www.dealii.org/")
5070 (synopsis "Finite element library")
5071 (description
5072 "Deal.II is a C++ program library targeted at the computational solution
5073 of partial differential equations using adaptive finite elements. The main
5074 aim of deal.II is to enable rapid development of modern finite element codes,
5075 using among other aspects adaptive meshes and a wide array of tools often used
5076 in finite element programs.")
5077 (license license:lgpl2.1+)))
5078
5079 (define-public dealii-openmpi
5080 (package/inherit dealii
5081 (name "dealii-openmpi")
5082 (inputs
5083 `(("arpack" ,arpack-ng-openmpi)
5084 ("metis" ,metis)
5085 ("scalapack" ,scalapack)
5086 ,@(alist-delete "arpack" (package-inputs dealii))))
5087 (propagated-inputs
5088 `(("hdf5" ,hdf5-parallel-openmpi)
5089 ("mpi" ,openmpi)
5090 ("p4est" ,p4est-openmpi)
5091 ("petsc" ,petsc-openmpi)
5092 ("slepc" ,slepc-openmpi)
5093 ("trilinos" ,trilinos-for-dealii-openmpi)
5094 ,@(alist-delete "hdf5" (package-propagated-inputs dealii))))
5095 (arguments
5096 (substitute-keyword-arguments (package-arguments dealii)
5097 ((#:configure-flags flags)
5098 `(cons "-DDEAL_II_WITH_MPI=ON" ,flags))))
5099 (synopsis "Finite element library (with MPI support)")))
5100
5101 (define-public flann
5102 (package
5103 (name "flann")
5104 (version "1.9.1")
5105 (home-page "https://github.com/mariusmuja/flann/")
5106 (source
5107 (origin
5108 (method git-fetch)
5109 (uri (git-reference (url home-page) (commit version)))
5110 (file-name (git-file-name name version))
5111 (sha256
5112 (base32
5113 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
5114 (patches (search-patches "flann-cmake-3.11.patch"))))
5115 (build-system cmake-build-system)
5116 (outputs '("out"))
5117 (native-inputs
5118 `(("unzip" ,unzip)))
5119 (inputs
5120 `(("hdf5" ,hdf5)
5121 ;; FIXME: 'mkoctfile' fails with a linker error:
5122 ;; ld: cannot find -loctinterp
5123 ;; ld: cannot find -loctave
5124 ;; Disable it for now.
5125 ;;("octave" ,octave-cli)
5126 ("python" ,python-2) ; print syntax
5127 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
5128 ("zlib" ,zlib)))
5129 (arguments
5130 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
5131 ;; taken 46 MiB unstripped, and 6 MiB stripped.
5132 #:strip-directories '("lib" "lib64" "libexec"
5133 "bin" "sbin" "share/flann/octave")
5134
5135 ;; Save 12 MiB by not installing .a files. Passing
5136 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
5137 #:phases (modify-phases %standard-phases
5138 (add-after 'install 'remove-static-libraries
5139 (lambda* (#:key outputs #:allow-other-keys)
5140 (let* ((out (assoc-ref outputs "out"))
5141 (lib (string-append out "/lib")))
5142 (for-each delete-file
5143 (find-files lib "\\.a$"))
5144 #t))))
5145
5146 #:tests? #f)) ; The test data are downloaded from the Internet.
5147 (synopsis "Library for approximate nearest neighbors computation")
5148 (description "FLANN is a library for performing fast approximate
5149 nearest neighbor searches in high dimensional spaces. It implements a
5150 collection of algorithms and a system for automatically choosing the best
5151 algorithm and optimum parameters depending on the dataset.
5152
5153 FLANN is written in C++ and contains bindings for C, Octave and Python.")
5154 (license (license:non-copyleft "file://COPYING"
5155 "See COPYING in the distribution."))))
5156
5157 (define-public wcalc
5158 (package
5159 (name "wcalc")
5160 (version "2.5")
5161 (source
5162 (origin
5163 (method url-fetch)
5164 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
5165 "wcalc-" version ".tar.bz2"))
5166 (sha256
5167 (base32
5168 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
5169 (build-system gnu-build-system)
5170 (inputs
5171 `(("mpfr" ,mpfr)
5172 ("readline" ,readline)))
5173 (home-page "http://w-calc.sourceforge.net/index.php")
5174 (synopsis "Flexible command-line scientific calculator")
5175 (description "Wcalc is a very capable calculator. It has standard functions
5176 (sin, asin, and sinh for example, in either radians or degrees), many
5177 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
5178 variables, a command history, hex/octal/binary input and output, unit
5179 conversions, embedded comments, and an expandable expression entry field. It
5180 evaluates expressions using the standard order of operations.")
5181 (license license:gpl2+)))
5182
5183 (define-public xaos
5184 (package
5185 (name "xaos")
5186 (version "4.2.1")
5187 (source (origin
5188 (method git-fetch)
5189 (uri (git-reference
5190 (url "https://github.com/xaos-project/XaoS")
5191 (commit (string-append "release-" version))))
5192 (file-name (git-file-name name version))
5193 (sha256
5194 (base32
5195 "0maw5am6rrkyjrprfg113zjq37mqj0iaznkg4h2927ff7wrprc94"))))
5196 (build-system gnu-build-system)
5197 (native-inputs `(("gettext" ,gettext-minimal)
5198 ("qtbase" ,qtbase-5)
5199 ("qttools" ,qttools)))
5200 (inputs `(("libx11" ,libx11)
5201 ("zlib" ,zlib)
5202 ("libpng" ,libpng)
5203 ("gsl" ,gsl)))
5204 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
5205 ;; not enough for this package to install properly. These phases fix that.
5206 (arguments
5207 `(#:tests? #f ;no "check" target
5208 #:phases
5209 (modify-phases %standard-phases
5210 (add-before 'configure 'make-qt-deterministic
5211 (lambda _
5212 ;; Make Qt deterministic.
5213 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
5214 #t))
5215 (replace 'configure
5216 (lambda* (#:key outputs #:allow-other-keys)
5217 (let ((out (assoc-ref outputs "out")))
5218 (substitute* "XaoS.pro"
5219 ;; The DESTDIR is originally set to install the xaos binary to
5220 ;; the "bin" folder inside the build directory. Setting make
5221 ;; flags doesn't seem to change this.
5222 (("DESTDIR.*$")
5223 (string-append "DESTDIR=" out "/bin"))
5224 ;; Set the correct path to the lrelease binary.
5225 (("lrelease-qt5") "lrelease"))
5226 (substitute* "src/include/config.h"
5227 (("/usr/share/XaoS")
5228 (string-append out "/share/XaoS")))
5229 (invoke "qmake"))))
5230 (add-after 'install 'install-data
5231 (lambda* (#:key outputs #:allow-other-keys)
5232 (let* ((out (assoc-ref outputs "out"))
5233 (share (string-append out "/share")))
5234 (mkdir-p share)
5235 (for-each
5236 (lambda (folder)
5237 (copy-recursively folder
5238 (string-append share "/XaoS/" folder)))
5239 '("catalogs" "examples" "tutorial"))
5240 (install-file "xdg/xaos.png"
5241 (string-append share "/pixmaps"))
5242 (install-file "xdg/xaos.desktop"
5243 (string-append share "/applications")))
5244 #t)))))
5245 (synopsis "Real-time fractal zoomer")
5246 (description "GNU XaoS is a graphical program that generates fractal
5247 patterns and allows you to zoom in and out of them infinitely in a fluid,
5248 continuous manner. It also includes tutorials that help to explain how fractals
5249 are built. It can generate many different fractal types such as the Mandelbrot
5250 set.")
5251 (home-page "https://xaos-project.github.io/")
5252 (license license:gpl2+)))
5253
5254 (define-public hypre
5255 (package
5256 (name "hypre")
5257 (version "2.15.1")
5258 (source
5259 (origin
5260 (method git-fetch)
5261 (uri (git-reference
5262 (url "https://github.com/hypre-space/hypre")
5263 (commit (string-append "v" version))))
5264 (file-name (git-file-name name version))
5265 (sha256
5266 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
5267 (modules '((guix build utils)))
5268 (snippet
5269 '(begin
5270 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
5271 ;; substitute the release date.
5272 (substitute* "src/utilities/HYPRE_utilities.h"
5273 (("Date Compiled: .*$")
5274 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
5275 #t))))
5276 (build-system gnu-build-system)
5277 (outputs '("out" ; 6.1 MiB of headers and libraries
5278 "doc")) ; 4.8 MiB of documentation
5279 (native-inputs
5280 `(("doc++" ,doc++)
5281 ("netpbm" ,netpbm)
5282 ("perl" ,perl) ; needed to run 'ppmquant' during tests
5283 ("texlive" ,(texlive-union (list texlive-xypic
5284 texlive-cm
5285 texlive-latex-hyperref
5286 texlive-bibtex)))
5287 ("ghostscript" ,ghostscript)))
5288 (inputs
5289 `(("blas" ,openblas)
5290 ("lapack" ,lapack)))
5291 (arguments
5292 `(#:modules ((srfi srfi-1)
5293 ,@%gnu-build-system-modules)
5294 #:configure-flags '("--enable-shared"
5295 "--disable-fortran"
5296 "--without-MPI"
5297 "--with-openmp"
5298 "--with-fei"
5299 "--with-lapack"
5300 "--with-blas")
5301 #:phases
5302 (modify-phases %standard-phases
5303 (add-before 'build 'set-HOME
5304 (lambda _
5305 ;; FIXME: texlive-union does not find the built
5306 ;; metafonts, so it tries to generate them in HOME.
5307 (setenv "HOME" "/tmp")
5308 #t))
5309 (add-before 'configure 'chdir-src
5310 (lambda _ (chdir "src")))
5311 (replace 'configure
5312 (lambda* (#:key build target configure-flags
5313 #:allow-other-keys #:rest args)
5314 (let* ((configure (assoc-ref %standard-phases 'configure)))
5315 (apply configure
5316 (append args
5317 (list #:configure-flags
5318 (cons (string-append
5319 "--host=" (or target build))
5320 configure-flags)))))))
5321 (add-after 'build 'build-docs
5322 (lambda _
5323 (invoke "make" "-Cdocs" "pdf" "html")))
5324 (replace 'check
5325 (lambda _
5326 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
5327 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
5328 (invoke "make" "check" "CHECKRUN=")
5329 (for-each (lambda (filename)
5330 (let ((size (stat:size (stat filename))))
5331 (when (positive? size)
5332 (error (format #f "~a size ~d; error indication~%"
5333 filename size)))))
5334 (find-files "test" ".*\\.err$"))
5335 #t))
5336 (add-after 'install 'install-docs
5337 (lambda* (#:key outputs #:allow-other-keys)
5338 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
5339 (let* ((doc (assoc-ref outputs "doc"))
5340 (docdir (string-append doc "/share/doc/hypre-" ,version)))
5341 (with-directory-excursion "docs"
5342 (for-each (lambda (base)
5343 (install-file (string-append base ".pdf") docdir)
5344 (copy-recursively base docdir)) ; html docs
5345 '("HYPRE_usr_manual"
5346 "HYPRE_ref_manual")))
5347 #t))))))
5348 (home-page "https://computing.llnl.gov/projects\
5349 /hypre-scalable-linear-solvers-multigrid-methods")
5350 (synopsis "Library of solvers and preconditioners for linear equations")
5351 (description
5352 "HYPRE is a software library of high performance preconditioners and
5353 solvers for the solution of large, sparse linear systems of equations. It
5354 features multigrid solvers for both structured and unstructured grid
5355 problems.")
5356 (license license:lgpl2.1)))
5357
5358 (define-public hypre-openmpi
5359 (package (inherit hypre)
5360 (name "hypre-openmpi")
5361 (inputs
5362 `(("mpi" ,openmpi)
5363 ,@(package-inputs hypre)))
5364 (arguments
5365 (substitute-keyword-arguments (package-arguments hypre)
5366 ((#:configure-flags flags)
5367 ``("--with-MPI"
5368 ,@(delete "--without-MPI" ,flags)))
5369 ((#:phases phases)
5370 `(modify-phases ,phases
5371 (add-before 'check 'mpi-setup
5372 ,%openmpi-setup)))))
5373 (synopsis "Parallel solvers and preconditioners for linear equations")
5374 (description
5375 "HYPRE is a software library of high performance preconditioners and
5376 solvers for the solution of large, sparse linear systems of equations on
5377 parallel computers. It features parallel multigrid solvers for both
5378 structured and unstructured grid problems.")))
5379
5380 (define-public matio
5381 (package
5382 (name "matio")
5383 (version "1.5.19")
5384 (source
5385 (origin
5386 (method url-fetch)
5387 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
5388 "matio-" version ".tar.gz"))
5389 (sha256
5390 (base32
5391 "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4"))))
5392 (build-system gnu-build-system)
5393 (inputs
5394 `(("zlib" ,zlib)
5395 ("hdf5" ,hdf5-1.8)))
5396 (home-page "http://matio.sourceforge.net/")
5397 (synopsis "Library for reading and writing MAT files")
5398 (description "Matio is a library for reading and writing MAT files. It
5399 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
5400 (license license:bsd-2)))
5401
5402 (define-public vc
5403 (package
5404 (name "vc")
5405 (version "1.4.2")
5406 (source
5407 (origin (method url-fetch)
5408 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
5409 "download/" version "/Vc-" version ".tar.gz"))
5410 (sha256
5411 (base32
5412 "0lirdqzcxys9walz04bllsphydynk7973aimd5k1h1qbwi8z3lsh"))))
5413 (build-system cmake-build-system)
5414 (arguments
5415 '(#:configure-flags
5416 '("-DBUILD_TESTING=ON"
5417 ;; By default, Vc will optimize for the CPU of the build machine.
5418 ;; Setting this to "none" makes it create portable binaries. See
5419 ;; "cmake/OptimizeForArchitecture.cmake".
5420 "-DTARGET_ARCHITECTURE=none")
5421 #:phases (modify-phases %standard-phases
5422 (add-after 'unpack 'copy-testdata
5423 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5424 (let ((testdata (assoc-ref (or native-inputs inputs)
5425 "testdata")))
5426 (copy-recursively testdata "tests/testdata")
5427 #t))))))
5428 (native-inputs
5429 `(("virtest" ,virtest)
5430
5431 ;; This is a submodule in the git project, but not part of the
5432 ;; released sources. See the git branch for the commit to take.
5433 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
5434 (origin
5435 (method git-fetch)
5436 (uri (git-reference
5437 (url "https://github.com/VcDevel/vc-testdata")
5438 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
5439 (file-name (git-file-name "vc-testdata"
5440 (string-take commit 7)))
5441 (sha256
5442 (base32
5443 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
5444 (synopsis "SIMD vector classes for C++")
5445 (description "Vc provides portable, zero-overhead C++ types for explicitly
5446 data-parallel programming. It is a library designed to ease explicit
5447 vectorization of C++ code. Its types enable explicitly stating data-parallel
5448 operations on multiple values. The parallelism is therefore added via the type
5449 system. Vc has an intuitive API and provides portability between different
5450 compilers and compiler versions as well as portability between different vector
5451 instruction sets. Thus, an application written with Vc can be compiled for:
5452 @enumerate
5453 @item AVX and AVX2
5454 @item SSE2 up to SSE4.2 or SSE4a
5455 @item Scalar
5456 @item MIC
5457 @item NEON (in development)
5458 @item NVIDIA GPUs / CUDA (in development)
5459 @end enumerate\n")
5460 (home-page "https://github.com/VcDevel/Vc")
5461 ;; "No support_???.cpp file exists for this architecture."
5462 (supported-systems '("x86_64-linux" "i686-linux"))
5463 (license license:bsd-3)))
5464
5465 (define-public reducelcs
5466 ;; This is the last commit which is available upstream, no
5467 ;; release happened since 2010.
5468 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
5469 (revision "1"))
5470 (package
5471 (name "reducelcs")
5472 (version (string-append "1.0-" revision "." (string-take commit 7)))
5473 (source
5474 (origin
5475 (method git-fetch)
5476 (uri (git-reference
5477 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
5478 (commit commit)))
5479 (file-name (string-append name "-" version "-checkout"))
5480 (sha256
5481 (base32
5482 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
5483 (build-system gnu-build-system)
5484 (inputs
5485 `(("openlibm" ,openlibm)))
5486 (arguments
5487 `(#:tests? #f ; no tests
5488 #:phases
5489 (modify-phases %standard-phases
5490 (delete 'configure) ; No configure script exists.
5491 (replace 'install ; No install phase exists.
5492 (lambda* (#:key outputs #:allow-other-keys)
5493 (let* ((out (assoc-ref outputs "out"))
5494 (bin (string-append out "/bin")))
5495 (install-file "Approximation" bin)
5496 (install-file "CollectResults" bin)
5497 (install-file "GenerateInstances" bin)
5498 #t))))))
5499 (synopsis "Approximate Longest Commons Subsequence computation tool")
5500 (description
5501 "@code{reduceLCS} is an implementation of the Reduce-Expand
5502 algorithm for LCS. It is a fast program to compute the approximate
5503 Longest Commons Subsequence of a set of strings.")
5504 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
5505 (license license:gpl3+))))
5506
5507 (define-public jacal
5508 (package
5509 (name "jacal")
5510 (version "1c4")
5511 (source (origin
5512 (method url-fetch)
5513 (uri (string-append
5514 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
5515 version ".zip"))
5516 (sha256 (base32
5517 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
5518 (patches (search-patches "jacal-fix-texinfo.patch"))))
5519 (build-system gnu-build-system)
5520 (arguments
5521 `(#:phases
5522 (modify-phases %standard-phases
5523 (add-before 'build 'pre-build
5524 ;; Don't use upstream's script - it really doesn't fit into
5525 ;; Guix's functional paradigm.
5526 (lambda* (#:key inputs outputs #:allow-other-keys)
5527 (substitute* "Makefile"
5528 (("^install: install-script") "install: "))))
5529 (add-after 'install 'post-install
5530 ;; Instead, we provide our own simplified script.
5531 (lambda* (#:key inputs outputs #:allow-other-keys)
5532 (let ((wrapper (string-append (assoc-ref outputs "out")
5533 "/bin/jacal")))
5534 (format (open wrapper (logior O_WRONLY O_CREAT))
5535 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
5536 "-e '(slib:load \"~a/lib/jacal/math\") "
5537 "(math)' \"$@\"\n")
5538 (which "bash")
5539 (assoc-ref inputs "scm")
5540 (assoc-ref outputs "out"))
5541 (chmod wrapper #o555))))
5542 (replace 'configure
5543 (lambda* (#:key outputs #:allow-other-keys)
5544 (invoke "./configure"
5545 (string-append "--prefix="
5546 (assoc-ref outputs "out"))))))))
5547 (inputs `(("scm" ,scm)))
5548 (native-inputs `(("unzip" ,unzip)
5549 ("texinfo" ,texinfo)))
5550 (synopsis "Symbolic mathematics system")
5551 (description "GNU JACAL is an interactive symbolic mathematics program based on
5552 Scheme. It manipulate and simplify a range of mathematical expressions such
5553 as equations, scalars, vectors, and matrices.")
5554 (home-page "https://www.gnu.org/software/jacal/")
5555 (license license:gpl3+)))
5556
5557 (define-public z3
5558 (package
5559 (name "z3")
5560 (version "4.8.9")
5561 (home-page "https://github.com/Z3Prover/z3")
5562 (source (origin
5563 (method git-fetch)
5564 (uri (git-reference (url home-page)
5565 (commit (string-append "z3-" version))))
5566 (file-name (git-file-name name version))
5567 (sha256
5568 (base32
5569 "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx"))))
5570 (build-system gnu-build-system)
5571 (arguments
5572 `(#:imported-modules ((guix build python-build-system)
5573 ,@%gnu-build-system-modules)
5574 #:modules (((guix build python-build-system) #:select (site-packages))
5575 (guix build gnu-build-system)
5576 (guix build utils))
5577 #:phases
5578 (modify-phases %standard-phases
5579 (add-after 'unpack 'enable-bytecode-determinism
5580 (lambda _
5581 (setenv "PYTHONHASHSEED" "0")
5582 #t))
5583 (add-after 'unpack 'fix-compatability
5584 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
5585 (lambda _
5586 (substitute* "src/util/mpz.cpp"
5587 (("#include <immintrin.h>") ""))
5588 #t))
5589 (add-before 'configure 'bootstrap
5590 (lambda _
5591 (invoke "python" "scripts/mk_make.py")))
5592 ;; work around gnu-build-system's setting --enable-fast-install
5593 ;; (z3's `configure' is a wrapper around the above python file,
5594 ;; which fails when passed --enable-fast-install)
5595 (replace 'configure
5596 (lambda* (#:key inputs outputs #:allow-other-keys)
5597 (invoke "./configure"
5598 "--python"
5599 (string-append "--prefix=" (assoc-ref outputs "out"))
5600 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
5601 (add-after 'configure 'change-directory
5602 (lambda _
5603 (chdir "build")
5604 #t))
5605 (add-before 'check 'make-test-z3
5606 (lambda _
5607 ;; Build the test suite executable.
5608 (invoke "make" "test-z3" "-j"
5609 (number->string (parallel-job-count)))))
5610 (replace 'check
5611 (lambda _
5612 ;; Run all the tests that don't require arguments.
5613 (invoke "./test-z3" "/a"))))))
5614 (native-inputs
5615 `(("which" ,which)
5616 ("python" ,python-wrapper)))
5617 (synopsis "Theorem prover")
5618 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
5619 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
5620 (license license:expat)))
5621
5622 (define-public elpa
5623 (package
5624 (name "elpa")
5625 (version "2018.11.001")
5626 (source (origin
5627 (method url-fetch)
5628 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
5629 version "/elpa-" version ".tar.gz"))
5630 (sha256
5631 (base32
5632 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
5633 (build-system gnu-build-system)
5634 (native-inputs
5635 `(("fortran" ,gfortran)
5636 ("perl" ,perl))) ;for configure and deps
5637 (inputs
5638 `(("blas" ,openblas)))
5639 (arguments
5640 `(#:configure-flags
5641 `("--enable-openmp"
5642 "--with-mpi=no"
5643 ;; ELPA unfortunately does not support runtime dispatch, so we can
5644 ;; only enable the "generic" kernels. See the "Cross compilation"
5645 ;; section of INSTALL.md.
5646 "--enable-generic"
5647 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
5648 "--disable-avx" "--disable-avx2" "--disable-avx512"
5649 ,(string-append "CFLAGS=-O3 "
5650 "-funsafe-loop-optimizations -funsafe-math-optimizations "
5651 "-ftree-vect-loop-version -ftree-vectorize "
5652 ,(let ((system (or (%current-target-system)
5653 (%current-system))))
5654 (cond
5655 ((or (string-prefix? "x86_64" system)
5656 (string-prefix? "i686" system))
5657 "-msse2")
5658 (else "")))))
5659 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
5660 #:phases
5661 (modify-phases %standard-phases
5662 (add-before 'configure 'patch-header-generation
5663 (lambda _
5664 (substitute* "configure"
5665 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
5666 (string-append & " CPP=\"$CPP\"")))
5667 #t))
5668 (add-before 'check 'setup-tests
5669 (lambda _
5670 ;; Decrease test time and RAM use by computing fewer eigenvalues.
5671 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
5672 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
5673 ;; for Fortran. This also causes several tests to pass that
5674 ;; otherwise would otherwise fail with matrix size 5000; possibly
5675 ;; due to floating point tolerances that are too tight.
5676 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
5677 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
5678 (substitute* "Makefile"
5679 ;; Test scripts are generated, patch the shebang
5680 (("#!/bin/bash") (string-append "#!" (which "sh"))))
5681 #t)))))
5682 (home-page "https://elpa.mpcdf.mpg.de")
5683 (synopsis "Eigenvalue solvers for symmetric matrices")
5684 (description
5685 "The ELPA library provides efficient and scalable direct eigensolvers for
5686 symmetric matrices.")
5687 (license license:lgpl3)))
5688
5689 (define-public elpa-openmpi
5690 (package (inherit elpa)
5691 (name "elpa-openmpi")
5692 (inputs
5693 `(("mpi" ,openmpi)
5694 ("scalapack" ,scalapack)
5695 ,@(package-inputs elpa)))
5696 (arguments
5697 (substitute-keyword-arguments (package-arguments elpa)
5698 ((#:configure-flags cf '())
5699 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
5700 ((#:phases phases '%standard-phases)
5701 `(modify-phases ,phases
5702 (add-before 'check 'mpi-setup
5703 (lambda _
5704 ;; Tests use 2 mpi tasks by default, use our remaining build
5705 ;; cores as OpenMP threads.
5706 (setenv "OMP_NUM_THREADS" (number->string
5707 (max (quotient (parallel-job-count) 2)
5708 1)))
5709 (,%openmpi-setup)))))))
5710 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
5711
5712 (define-public elemental
5713 (package
5714 (name "elemental")
5715 (version "0.87.7")
5716 (source (origin
5717 (method git-fetch)
5718 (uri (git-reference
5719 (url "https://github.com/elemental/Elemental")
5720 (commit (string-append "v" version))))
5721 (file-name (git-file-name name version))
5722 (sha256
5723 (base32
5724 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
5725 (build-system cmake-build-system)
5726 (home-page "https://github.com/elemental/Elemental")
5727 (native-inputs
5728 `(("gfortran" ,gfortran)))
5729 (inputs
5730 `(("blas" ,openblas)
5731 ("gfortran:lib" ,gfortran "lib")
5732 ("gmp" ,gmp)
5733 ("lapack" ,lapack)
5734 ("metis" ,metis)
5735 ("mpc" ,mpc)
5736 ("mpfr" ,mpfr)
5737 ("mpi" ,openmpi)
5738 ("qd" ,qd)))
5739 (arguments
5740 `(#:build-type "Release" ;default RelWithDebInfo not supported
5741 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
5742 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
5743 "-DEL_CACHE_WARNINGS:BOOL=YES"
5744 "-DEL_TESTS:BOOL=YES"
5745 "-DCMAKE_INSTALL_LIBDIR=lib"
5746 "-DGFORTRAN_LIB=gfortran")
5747 #:phases (modify-phases %standard-phases
5748 (add-before 'check 'mpi-setup
5749 ,%openmpi-setup)
5750 (add-before 'check 'setup-tests
5751 (lambda _
5752 ;; Parallelism is done at the MPI layer.
5753 (setenv "OMP_NUM_THREADS" "1")
5754 #t))
5755 (add-after 'install 'remove-tests
5756 (lambda* (#:key outputs #:allow-other-keys)
5757 ;; Tests are installed, with no easy configuration
5758 ;; switch to prevent this, so delete them.
5759 (delete-file-recursively
5760 (string-append (assoc-ref outputs "out") "/bin"))
5761 #t)))))
5762 (synopsis "Dense and sparse-direct linear algebra and optimization")
5763 (description "Elemental is a modern C++ library for distributed-memory
5764 dense and sparse-direct linear algebra, conic optimization, and lattice
5765 reduction.")
5766 (license license:bsd-2)))
5767
5768 (define-public mcrl2
5769 (package
5770 (name "mcrl2")
5771 (version "202106.0")
5772 (source (origin
5773 (method url-fetch)
5774 (uri (string-append
5775 "https://www.mcrl2.org/download/release/mcrl2-"
5776 version ".tar.gz"))
5777 (sha256
5778 (base32
5779 "1xgx3cd57vc7gbjic24j1q2za6j3ybz6nk4afvvpbwsf33xnlf4v"))))
5780 (inputs
5781 `(("boost" ,boost)
5782 ("glu" ,glu)
5783 ("mesa" ,mesa)
5784 ("qtbase" ,qtbase-5)))
5785 (build-system cmake-build-system)
5786 (synopsis "Toolset for the mCRL2 formal specification language")
5787 (description
5788 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
5789 specification language for describing concurrent discrete event systems. Its
5790 toolset supports analysis and automatic verification, linearisation, simulation,
5791 state-space exploration and generation, and tools to optimise and analyse
5792 specifications. Also, state spaces can be manipulated, visualised and
5793 analysed.")
5794 (home-page "https://mcrl2.org")
5795 (license license:boost1.0)))
5796
5797 (define-public mcrl2-minimal
5798 (package
5799 (inherit mcrl2)
5800 (name "mcrl2-minimal")
5801 (inputs
5802 `(("boost" ,boost)))
5803 (arguments
5804 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
5805
5806 (define-public tcalc
5807 (package
5808 (name "tcalc")
5809 (version "2.0")
5810 (source
5811 (origin
5812 (method url-fetch)
5813 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
5814 version ".tar.gz"))
5815 (sha256
5816 (base32
5817 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
5818 (build-system gnu-build-system)
5819 (synopsis "The terminal calculator")
5820 (description
5821 "The terminal calculator is a small program to help users of the GNU/Linux
5822 terminal do calculations simply and quickly. The formula to be calculated can
5823 be fed to @command{tcalc} through the command line.")
5824 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
5825 (license license:gpl3+)))
5826
5827 (define-public tiny-bignum
5828 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
5829 (package
5830 (name "tiny-bignum")
5831 (version (git-version "0" "0" commit))
5832 (source
5833 (origin
5834 (method git-fetch)
5835 (uri (git-reference
5836 (url "https://github.com/kokke/tiny-bignum-c")
5837 (commit commit)))
5838 (file-name (git-file-name "tiny-bignum" commit))
5839 (sha256
5840 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
5841 (build-system gnu-build-system)
5842 (arguments
5843 `(#:phases
5844 (modify-phases %standard-phases
5845 (delete 'configure)
5846 (add-after 'unpack 'patch-tests
5847 (lambda _
5848 (substitute* "scripts/test_rand.py"
5849 (("\t") " ")
5850 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
5851 #t))
5852 (replace 'check
5853 (lambda* (#:key tests? #:allow-other-keys)
5854 (when tests?
5855 (invoke "make" "test"))
5856 #t))
5857 (replace 'install
5858 (lambda* (#:key outputs #:allow-other-keys)
5859 (let ((share (string-append (assoc-ref outputs "out") "/share"))
5860 (doc (string-append (assoc-ref outputs "out") "/doc")))
5861 (mkdir-p share)
5862 (install-file "bn.c" share)
5863 (install-file "bn.h" share)
5864 (mkdir-p doc)
5865 (install-file "LICENSE" doc)
5866 (install-file "README.md" doc))
5867 #t)))))
5868 (native-inputs
5869 `(("python" ,python-wrapper)))
5870 (home-page "https://github.com/kokke/tiny-bignum-c")
5871 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
5872 (description
5873 "This library provides portable Arbitrary-precision unsigned integer
5874 arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
5875 *, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
5876 and comparisons are supported.")
5877 (license license:unlicense))))
5878
5879 (define-public sundials
5880 (package
5881 (name "sundials")
5882 (version "3.1.1")
5883 (source
5884 (origin
5885 (method url-fetch)
5886 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
5887 "sundials-" version ".tar.gz"))
5888 (sha256
5889 (base32
5890 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
5891 (build-system cmake-build-system)
5892 (native-inputs
5893 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
5894 (inputs
5895 `(("fortran" ,gfortran) ;for fcmix
5896 ("blas" ,openblas)
5897 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
5898 (arguments
5899 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
5900 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
5901 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
5902 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
5903 "-DEXAMPLES_INSTALL:BOOL=OFF"
5904
5905 "-DFCMIX_ENABLE:BOOL=ON"
5906
5907 "-DKLU_ENABLE:BOOL=ON"
5908 ,(string-append "-DKLU_INCLUDE_DIR="
5909 (assoc-ref %build-inputs "suitesparse")
5910 "/include")
5911 ,(string-append "-DKLU_LIBRARY_DIR="
5912 (assoc-ref %build-inputs "suitesparse")
5913 "/lib"))))
5914 (home-page "https://computation.llnl.gov/projects/sundials")
5915 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
5916 (description "SUNDIALS is a family of software packages implemented with
5917 the goal of providing robust time integrators and nonlinear solvers that can
5918 easily be incorporated into existing simulation codes.")
5919 (license license:bsd-3)))
5920
5921 (define-public sundials-openmpi
5922 (package (inherit sundials)
5923 (name "sundials-openmpi")
5924 (inputs
5925 `(("mpi" ,openmpi)
5926 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
5927 ,@(package-inputs sundials)))
5928 (arguments
5929 (substitute-keyword-arguments (package-arguments sundials)
5930 ((#:configure-flags flags '())
5931 `(cons* "-DMPI_ENABLE:BOOL=ON"
5932 "-DPETSC_ENABLE:BOOL=ON"
5933 (string-append "-DPETSC_INCLUDE_DIR="
5934 (assoc-ref %build-inputs "petsc")
5935 "/include")
5936 (string-append "-DPETSC_LIBRARY_DIR="
5937 (assoc-ref %build-inputs "petsc")
5938 "/lib")
5939 ,flags))
5940 ((#:phases phases '%standard-phases)
5941 `(modify-phases ,phases
5942 (add-before 'check 'mpi-setup
5943 ,%openmpi-setup)))))
5944 (synopsis "SUNDIALS with OpenMPI support")))
5945
5946 (define-public combinatorial-blas
5947 (package
5948 (name "combinatorial-blas")
5949 (version "1.6.2")
5950 (source
5951 (origin
5952 (method url-fetch)
5953 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
5954 "CombBLAS_beta_"
5955 (match (string-split version #\.)
5956 ((major minor patch)
5957 (string-append major minor "_" patch))) ;e.g. "16_2"
5958 ".tgz"))
5959 (sha256
5960 (base32
5961 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
5962 (patches (search-patches "combinatorial-blas-awpm.patch"
5963 "combinatorial-blas-io-fix.patch"))))
5964 (build-system cmake-build-system)
5965 (inputs
5966 `(("mpi" ,openmpi)
5967 ("test-data" ,(origin
5968 (method url-fetch)
5969 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
5970 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
5971 (sha256
5972 (base32
5973 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
5974 (arguments
5975 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
5976 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
5977 #:parallel-tests? #f ;tests use 'mpiexec -n4'
5978 #:phases
5979 (modify-phases %standard-phases
5980 (add-before 'check 'mpi-setup
5981 ,%openmpi-setup)
5982 (add-before 'check 'test-setup
5983 (lambda* (#:key inputs #:allow-other-keys)
5984 (setenv "OMP_NUM_THREADS" "2")
5985 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
5986 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
5987 (synopsis "Linear algebra primitives for graph analytics")
5988 (description "The Combinatorial BLAS (CombBLAS) is an extensible
5989 distributed-memory parallel graph library offering a small but powerful set of
5990 linear algebra primitives specifically targeting graph analytics.")
5991 (license (list
5992 license:gpl2+ ;include/psort/(funnel|sort)*.h
5993 license:x11 ;usort and psort
5994 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
5995
5996 (define-public dune-common
5997 (package
5998 (name "dune-common")
5999 (version "2.7.0")
6000 (source
6001 (origin
6002 (method url-fetch)
6003 (uri (string-append "https://dune-project.org/download/"
6004 version "/dune-common-" version ".tar.gz"))
6005 (sha256
6006 (base32
6007 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
6008 (build-system cmake-build-system)
6009 (arguments
6010 `(#:phases
6011 (modify-phases %standard-phases
6012 (add-after 'build 'build-tests
6013 (lambda* (#:key make-flags #:allow-other-keys)
6014 (apply invoke "make" "build_tests" make-flags))))))
6015 (inputs
6016 `(("gmp" ,gmp)
6017 ("metis" ,metis)
6018 ("openblas" ,openblas)
6019 ("python" ,python)
6020 ("superlu" ,superlu)))
6021 (native-inputs
6022 `(("gfortran" ,gfortran)
6023 ("pkg-config" ,pkg-config)))
6024 (home-page "https://dune-project.org/")
6025 (synopsis "Distributed and Unified Numerics Environment")
6026 (description "DUNE, the Distributed and Unified Numerics Environment is a
6027 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6028 grid-based methods. It supports the easy implementation of methods like
6029 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6030 Differences} (FD).")
6031 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
6032 (license license:gpl2)))
6033
6034 (define-public dune-geometry
6035 (package
6036 (name "dune-geometry")
6037 (version "2.7.0")
6038 (source
6039 (origin
6040 (method url-fetch)
6041 (uri (string-append "https://dune-project.org/download/"
6042 version "/dune-geometry-" version ".tar.gz"))
6043 (sha256
6044 (base32
6045 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
6046 (build-system cmake-build-system)
6047 (arguments
6048 `(#:phases
6049 (modify-phases %standard-phases
6050 (add-after 'build 'build-tests
6051 (lambda* (#:key make-flags #:allow-other-keys)
6052 (apply invoke "make" "build_tests" make-flags))))))
6053 (inputs
6054 `(("dune-common" ,dune-common)
6055 ;; Optional
6056 ("openblas" ,openblas)
6057 ("gmp" ,gmp)
6058 ("python" ,python)))
6059 (native-inputs
6060 `(("gfortran" ,gfortran)
6061 ("pkg-config" ,pkg-config)))
6062 (home-page "https://dune-project.org/")
6063 (synopsis "Distributed and Unified Numerics Environment")
6064 (description "DUNE, the Distributed and Unified Numerics Environment is a
6065 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6066 grid-based methods. It supports the easy implementation of methods like
6067 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6068 Differences} (FD).
6069
6070 This package contains the basic DUNE geometry classes.")
6071 ;; GPL version 2 with "runtime exception"
6072 (license license:gpl2)))
6073
6074 (define-public dune-uggrid
6075 (package
6076 (name "dune-uggrid")
6077 (version "2.7.0")
6078 (source
6079 (origin
6080 (method git-fetch)
6081 (uri (git-reference
6082 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
6083 (commit (string-append "v" version))))
6084 (file-name (git-file-name name version))
6085 (sha256
6086 (base32
6087 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
6088 (build-system cmake-build-system)
6089 (arguments
6090 `(#:phases
6091 (modify-phases %standard-phases
6092 (add-after 'build 'build-tests
6093 (lambda* (#:key make-flags #:allow-other-keys)
6094 (apply invoke "make" "build_tests" make-flags))))))
6095 (inputs
6096 `(("dune-common" ,dune-common)))
6097 (native-inputs
6098 `(("gfortran" ,gfortran)
6099 ("pkg-config" ,pkg-config)))
6100 (home-page "https://dune-project.org/")
6101 (synopsis "Distributed and Unified Numerics Environment")
6102 (description "DUNE, the Distributed and Unified Numerics Environment is a
6103 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6104 grid-based methods. It supports the easy implementation of methods like
6105 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6106 Differences} (FD).
6107
6108 This package contains the DUNE UG grid classes.")
6109 (license license:lgpl2.1)))
6110
6111 (define-public dune-grid
6112 (package
6113 (name "dune-grid")
6114 (version "2.7.0")
6115 (source
6116 (origin
6117 (method url-fetch)
6118 (uri (string-append "https://dune-project.org/download/"
6119 version "/dune-grid-" version ".tar.gz"))
6120 (sha256
6121 (base32
6122 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
6123 (build-system cmake-build-system)
6124 (arguments
6125 `(#:phases
6126 (modify-phases %standard-phases
6127 (add-after 'build 'build-tests
6128 (lambda* (#:key make-flags #:allow-other-keys)
6129 (apply invoke "make" "build_tests" make-flags))))))
6130 (inputs
6131 `(("dune-common" ,dune-common)
6132 ("dune-geometry" ,dune-geometry)
6133 ("gmp" ,gmp)
6134 ("metis" ,metis)
6135 ("openblas" ,openblas)
6136 ("python" ,python)))
6137 (propagated-inputs
6138 `(("dune-uggrid" ,dune-uggrid)))
6139 (native-inputs
6140 `(("gfortran" ,gfortran)
6141 ("pkg-config" ,pkg-config)))
6142 (home-page "https://dune-project.org/")
6143 (synopsis "Distributed and Unified Numerics Environment")
6144 (description "DUNE, the Distributed and Unified Numerics Environment is a
6145 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6146 grid-based methods. It supports the easy implementation of methods like
6147 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
6148 Differences} (FD).
6149
6150 This package contains the basic DUNE grid classes.")
6151 ;; GPL version 2 with "runtime exception"
6152 (license license:gpl2)))
6153
6154 (define-public dune-istl
6155 (package
6156 (name "dune-istl")
6157 (version "2.7.0")
6158 (source
6159 (origin
6160 (method url-fetch)
6161 (uri (string-append "https://dune-project.org/download/"
6162 version "/dune-istl-" version ".tar.gz"))
6163 (sha256
6164 (base32
6165 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
6166 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
6167 (build-system cmake-build-system)
6168 (arguments
6169 `(#:phases
6170 (modify-phases %standard-phases
6171 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
6172 ;; the stdlib types when the gfortran header is used. Remove gfortran
6173 ;; from CPLUS_INCLUDE_PATH as a workaround.
6174 (add-after 'set-paths 'hide-gfortran
6175 (lambda* (#:key inputs #:allow-other-keys)
6176 (let ((gfortran (assoc-ref inputs "gfortran")))
6177 (setenv "CPLUS_INCLUDE_PATH"
6178 (string-join
6179 (delete (string-append gfortran "/include/c++")
6180 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6181 ":"))
6182 #t)))
6183 (add-after 'build 'build-tests
6184 (lambda* (#:key make-flags #:allow-other-keys)
6185 (apply invoke "make" "build_tests" make-flags))))))
6186 (inputs
6187 `(("dune-common" ,dune-common)
6188 ;; Optional
6189 ("metis" ,metis)
6190 ("suitesparse" ,suitesparse)
6191 ("superlu" ,superlu)
6192 ("openblas" ,openblas)
6193 ("gmp" ,gmp)
6194 ("python" ,python)))
6195 (native-inputs
6196 `(("gfortran" ,gfortran)
6197 ("pkg-config" ,pkg-config)))
6198 (home-page "https://dune-project.org/")
6199 (synopsis "Distributed and Unified Numerics Environment")
6200 (description "DUNE, the Distributed and Unified Numerics Environment is a
6201 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
6202 grid-based methods.
6203
6204 This is the iterative solver template library which provides generic sparse
6205 matrix/vector classes and a variety of solvers based on these classes. A
6206 special feature is the use of templates to exploit the recursive block
6207 structure of finite element matrices at compile time. Available solvers
6208 include Krylov methods, (block-) incomplete decompositions and
6209 aggregation-based algebraic multigrid.")
6210 ;; GPL version 2 with "runtime exception"
6211 (license license:gpl2)))
6212
6213 (define-public dune-localfunctions
6214 (package
6215 (name "dune-localfunctions")
6216 (version "2.7.0")
6217 (source
6218 (origin
6219 (method url-fetch)
6220 (uri (string-append "https://dune-project.org/download/"
6221 version "/dune-localfunctions-" version ".tar.gz"))
6222 (sha256
6223 (base32
6224 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
6225 (build-system cmake-build-system)
6226 (arguments
6227 `(#:phases
6228 (modify-phases %standard-phases
6229 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
6230 ;; and fails to find the stdlib types when the gfortran header is used.
6231 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
6232 (add-after 'set-paths 'hide-gfortran
6233 (lambda* (#:key inputs #:allow-other-keys)
6234 (let ((gfortran (assoc-ref inputs "gfortran")))
6235 (setenv "CPLUS_INCLUDE_PATH"
6236 (string-join
6237 (delete (string-append gfortran "/include/c++")
6238 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
6239 ":"))
6240 #t)))
6241 (add-after 'build 'build-tests
6242 (lambda* (#:key make-flags #:allow-other-keys)
6243 (apply invoke "make" "build_tests" make-flags))))))
6244 (inputs
6245 `(("dune-common" ,dune-common)
6246 ("dune-geometry" ,dune-geometry)
6247 ;; Optional
6248 ("metis" ,metis)
6249 ("superlu" ,superlu)
6250 ("gmp" ,gmp)))
6251 (native-inputs
6252 `(("gfortran" ,gfortran)
6253 ("pkg-config" ,pkg-config)))
6254 (home-page "https://dune-project.org/")
6255 (synopsis "Distributed and Unified Numerics Environment") ; TODO
6256 (description "This DUNE module provides interface and implementation for
6257 shape functions defined on the DUNE reference elements. In addition to the
6258 shape function, interpolation operators and special keys are provided which
6259 can be used to assemble global function spaces on finite-element grids.
6260
6261 This package provides an interface and implementation for shape functions
6262 defined on the DUNE reference elements. In addition to the shape function,
6263 interpolation operators and special keys are provided which can be used to
6264 assemble global function spaces on finite-element grids.")
6265 ;; GPL version 2 with "runtime exception"
6266 (license license:gpl2)))
6267
6268 (define-public dune-alugrid
6269 (package
6270 (name "dune-alugrid")
6271 (version "2.7.0-git-81d35682")
6272 (source
6273 (origin
6274 (method git-fetch)
6275 (uri (git-reference
6276 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
6277 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
6278 (file-name (git-file-name name version))
6279 (sha256
6280 (base32
6281 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
6282 (build-system cmake-build-system)
6283 (arguments
6284 `(#:phases
6285 (modify-phases %standard-phases
6286 (add-after 'unpack 'patch-include
6287 (lambda _
6288 (substitute* "dune/alugrid/test/test-alugrid.cc"
6289 (("doc/grids/gridfactory/testgrids")
6290 "doc/dune-grid/grids/gridfactory/testgrids"))
6291 #t))
6292 (add-after 'build 'build-tests
6293 (lambda* (#:key inputs make-flags #:allow-other-keys)
6294 (setenv "CPLUS_INCLUDE_PATH"
6295 (string-append (assoc-ref inputs "dune-grid") "/share"))
6296 (apply invoke "make" "build_tests" make-flags))))))
6297 (inputs
6298 `(("dune-common" ,dune-common)
6299 ("dune-geometry" ,dune-geometry)
6300 ("dune-grid" ,dune-grid)
6301 ;; Optional
6302 ("metis" ,metis)
6303 ("openblas" ,openblas)
6304 ("python" ,python)
6305 ("superlu" ,superlu)
6306 ("gmp" ,gmp)
6307 ("zlib" ,zlib)))
6308 (native-inputs
6309 `(("gfortran" ,gfortran)
6310 ("pkg-config" ,pkg-config)))
6311 (home-page "https://dune-project.org/")
6312 (synopsis "Distributed and Unified Numerics Environment")
6313 (description "ALUGrid is an adaptive, loadbalancing, unstructured
6314 implementation of the DUNE grid interface supporting either simplices or
6315 cubes.")
6316 (license license:gpl2+)))
6317
6318 (define-public dune-subgrid
6319 (package
6320 (name "dune-subgrid")
6321 (version "2.7.0-git-2103a363")
6322 (source
6323 (origin
6324 (method git-fetch)
6325 (uri (git-reference
6326 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6327 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
6328 (file-name (git-file-name name version))
6329 (sha256
6330 (base32
6331 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
6332 (build-system cmake-build-system)
6333 (arguments
6334 `(#:phases
6335 (modify-phases %standard-phases
6336 (add-after 'build 'build-tests
6337 (lambda* (#:key make-flags #:allow-other-keys)
6338 (apply invoke "make" "build_tests" make-flags))))))
6339 (inputs
6340 `(("dune-common" ,dune-common)
6341 ("dune-geometry" ,dune-geometry)
6342 ("dune-grid" ,dune-grid)
6343 ;; Optional
6344 ("metis" ,metis)
6345 ("openblas" ,openblas)
6346 ("gmp" ,gmp)))
6347 (native-inputs
6348 `(("gfortran" ,gfortran)
6349 ("pkg-config" ,pkg-config)))
6350 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
6351 (synopsis "Distributed and Unified Numerics Environment")
6352 (description "The dune-subgrid module marks elements of
6353 another hierarchical dune grid. The set of marked elements can then be
6354 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
6355 provides the full grid interface including adaptive mesh refinement.")
6356 (license license:gpl2+)))
6357
6358 (define-public dune-typetree
6359 (package
6360 (name "dune-typetree")
6361 (version "2.7.0")
6362 (source
6363 (origin
6364 (method git-fetch)
6365 (uri (git-reference
6366 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
6367 (commit (string-append "v" version))))
6368 (file-name (git-file-name name version))
6369 (sha256
6370 (base32
6371 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
6372 (build-system cmake-build-system)
6373 (arguments
6374 `(#:phases
6375 (modify-phases %standard-phases
6376 (add-after 'build 'build-tests
6377 (lambda* (#:key make-flags #:allow-other-keys)
6378 (apply invoke "make" "build_tests" make-flags))))))
6379 (inputs
6380 `(("dune-common" ,dune-common)
6381 ;; Optional
6382 ("openblas" ,openblas)
6383 ("python" ,python)
6384 ("metis" ,metis)
6385 ("superlu" ,superlu)
6386 ("gmp" ,gmp)))
6387 (native-inputs
6388 `(("gfortran" ,gfortran)
6389 ("pkg-config" ,pkg-config)))
6390 (home-page "https://dune-project.org/")
6391 (synopsis "Distributed and Unified Numerics Environment")
6392 (description "TypeTree is a template library for constructing and
6393 operating on statically typed trees of objects.")
6394 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6395 (license (list license:lgpl3+ license:gpl2))))
6396
6397 (define-public dune-functions
6398 (package
6399 (name "dune-functions")
6400 (version "2.7.0")
6401 (source
6402 (origin
6403 (method git-fetch)
6404 (uri (git-reference
6405 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
6406 (commit (string-append "v" version))))
6407 (file-name (git-file-name name version))
6408 (sha256
6409 (base32
6410 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
6411 (build-system cmake-build-system)
6412 (arguments
6413 `(#:phases
6414 (modify-phases %standard-phases
6415 (add-after 'unpack 'disable-failing-tests
6416 (lambda _
6417 (setenv "ARGS"
6418 ;; unable to load GMSH file in this test
6419 "--exclude-regex gridviewfunctionspacebasistest")
6420 #t))
6421 (add-after 'build 'build-tests
6422 (lambda* (#:key make-flags #:allow-other-keys)
6423 (apply invoke "make" "build_tests" make-flags))))))
6424 (inputs
6425 `(("dune-common" ,dune-common)
6426 ("dune-istl" ,dune-istl)
6427 ("dune-localfunctions" ,dune-localfunctions)
6428 ("dune-grid" ,dune-grid)
6429 ("dune-geometry" ,dune-geometry)
6430 ("dune-typetree" ,dune-typetree)
6431 ("openblas" ,openblas)
6432 ("metis" ,metis)
6433 ("python" ,python)
6434 ("superlu" ,superlu)
6435 ("gmp" ,gmp)))
6436 (native-inputs
6437 `(("gfortran" ,gfortran)
6438 ("pkg-config" ,pkg-config)))
6439 (home-page "https://dune-project.org/")
6440 (synopsis "Distributed and Unified Numerics Environment")
6441 (description "The dune-functions module provides an abstraction layer for
6442 global finite element functions. Its two main concepts are functions
6443 implemented as callable objects, and bases of finite element spaces.")
6444 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6445 (license (list license:lgpl3+ license:gpl2))))
6446
6447 (define-public dune-pdelab
6448 (package
6449 (name "dune-pdelab")
6450 (version "2.7.0-git-476fe437")
6451 (source
6452 (origin
6453 (method git-fetch)
6454 (uri (git-reference
6455 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6456 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
6457 (file-name (git-file-name name version))
6458 (sha256
6459 (base32
6460 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
6461 (build-system cmake-build-system)
6462 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
6463 (inputs
6464 `(("dune-common" ,dune-common)
6465 ("dune-istl" ,dune-istl)
6466 ("dune-localfunctions" ,dune-localfunctions)
6467 ("dune-geometry" ,dune-geometry)
6468 ("dune-grid" ,dune-grid)
6469 ("dune-typetree" ,dune-typetree)
6470 ("dune-functions" ,dune-functions)
6471 ;; Optional
6472 ("openblas" ,openblas)
6473 ("eigen" ,eigen)
6474 ("metis" ,metis)
6475 ("python" ,python)
6476 ("superlu" ,superlu)
6477 ("gmp" ,gmp)))
6478 (native-inputs
6479 `(("gfortran" ,gfortran)
6480 ("pkg-config" ,pkg-config)))
6481 (home-page "https://dune-project.org/")
6482 (synopsis "Differential equations solver toolbox")
6483 (description "PDELab is a partial differential equations solver toolbox
6484 built on top of DUNE, the Distributed and Unified Numerics Environment.")
6485 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
6486 (license (list license:lgpl3+ license:gpl2))))
6487
6488 (define add-openmpi-to-dune-package
6489 (let ((dune-package?
6490 (lambda (p) (string-prefix? "dune-" (package-name p)))))
6491 (package-mapping
6492 (lambda (p)
6493 (if (dune-package? p)
6494 (package (inherit p)
6495 (name (string-append (package-name p) "-openmpi"))
6496 (inputs `(,@(package-inputs p)
6497 ("openmpi" ,openmpi)))
6498 (arguments
6499 (substitute-keyword-arguments (package-arguments p)
6500 ((#:phases phases '%standard-phases)
6501 `(modify-phases ,phases
6502 (add-before 'check 'mpi-setup
6503 ,%openmpi-setup)))))
6504 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
6505 p))
6506 (negate dune-package?))))
6507
6508 (define-public dune-common-openmpi
6509 (add-openmpi-to-dune-package dune-common))
6510
6511 (define-public dune-geometry-openmpi
6512 (add-openmpi-to-dune-package dune-geometry))
6513
6514 (define-public dune-istl-openmpi
6515 (add-openmpi-to-dune-package dune-istl))
6516
6517 (define-public dune-typetree-openmpi
6518 (add-openmpi-to-dune-package dune-typetree))
6519
6520 (define-public dune-uggrid-openmpi
6521 (add-openmpi-to-dune-package dune-uggrid))
6522
6523 (define-public dune-grid-openmpi
6524 (add-openmpi-to-dune-package dune-grid))
6525
6526 (define-public dune-alugrid-openmpi
6527 (add-openmpi-to-dune-package dune-alugrid))
6528
6529 (define-public dune-subgrid-openmpi
6530 (add-openmpi-to-dune-package dune-subgrid))
6531
6532 (define-public dune-localfunctions-openmpi
6533 (add-openmpi-to-dune-package dune-localfunctions))
6534
6535 (define-public dune-functions-openmpi
6536 (add-openmpi-to-dune-package dune-functions))
6537
6538 (define-public dune-pdelab-openmpi
6539 (add-openmpi-to-dune-package dune-pdelab))
6540
6541 (define-public mlucas
6542 (package
6543 (name "mlucas")
6544 (version "18")
6545 (source
6546 (origin
6547 (method url-fetch)
6548 (uri (string-append
6549 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
6550 (sha256
6551 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
6552 (build-system gnu-build-system)
6553 (inputs
6554 `(("python2" ,python-2)))
6555 (arguments
6556 `(#:tests? #f ; no tests
6557 #:phases
6558 (modify-phases %standard-phases
6559 (replace 'configure
6560 (lambda _
6561 (chdir "src")
6562 (call-with-output-file "Makefile"
6563 (lambda (port)
6564 (format port "CC = gcc
6565 CFLAGS = -O3 ~a -DUSE_THREADS
6566 LDLIBS = -lm -lpthread -lrt
6567 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
6568 "
6569 ,(let ((system (or (%current-target-system)
6570 (%current-system))))
6571 (cond
6572 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
6573 (else ""))))))
6574 #t))
6575 (replace 'install
6576 (lambda* (#:key outputs #:allow-other-keys)
6577 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6578 (install-file "Mlucas" bin)
6579 (install-file "primenet.py" bin))
6580 #t)))))
6581 (home-page "https://www.mersenne.org")
6582 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
6583 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
6584 numbers in search of a world-record prime. You may use it to test any
6585 suitable number as you wish, but it is preferable that you do so in a
6586 coordinated fashion, as part of the Great Internet Mersenne Prime
6587 Search (GIMPS). Mlucas also includes a simple Python script for assignment
6588 management via the GIMPS project's Primenet server.")
6589 (license license:gpl2+)))
6590
6591 (define-public nauty
6592 (package
6593 (name "nauty")
6594 (version "2.7r3")
6595 (source
6596 (origin
6597 (method url-fetch)
6598 (uri (string-append
6599 "https://pallini.di.uniroma1.it/"
6600 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
6601 (sha256
6602 (base32 "1hl81gpf3xjf809w04jczvilq1ixy9ch1qrax8a7lgx52svna1jg"))))
6603 (build-system gnu-build-system)
6604 (outputs '("out" "lib"))
6605 (arguments
6606 `(#:test-target "checks"
6607 #:configure-flags '("--enable-generic") ;prevent -march-native
6608 #:phases
6609 (modify-phases %standard-phases
6610 ;; Default make target does not build all available
6611 ;; executables. Create them now.
6612 (add-after 'build 'build-extra-programs
6613 (lambda _
6614 (for-each (lambda (target) (invoke "make" target))
6615 '("blisstog" "bliss2dre" "checks6" "sumlines"))
6616 #t))
6617 ;; Upstream does not provide any install target.
6618 (replace 'install
6619 (lambda* (#:key outputs #:allow-other-keys)
6620 (let* ((out (assoc-ref outputs "out"))
6621 (lib-output (assoc-ref outputs "lib"))
6622 (bin (string-append out "/bin"))
6623 (doc (string-append out "/share/doc/nauty/"))
6624 (include (string-append lib-output "/include/nauty"))
6625 (lib (string-append lib-output "/lib/nauty")))
6626 (for-each (lambda (f) (install-file f bin))
6627 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
6628 "bliss2dre" "catg" "checks6" "complg" "converseg"
6629 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
6630 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6631 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
6632 "gentourng" "gentreeg" "hamheuristic" "labelg"
6633 "linegraphg" "listg" "multig" "newedgeg" "pickg"
6634 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
6635 "sumlines" "twohamg" "underlyingg" "vcolg"
6636 "watercluster2" "NRswitchg"))
6637 (for-each (lambda (f) (install-file f include))
6638 (find-files "." "\\.h$"))
6639 (for-each (lambda (f) (install-file f lib))
6640 (find-files "." "\\.a$"))
6641 (for-each (lambda (f) (install-file f doc))
6642 (append '("formats.txt" "README" "schreier.txt")
6643 (find-files "." "\\.pdf$")))))))))
6644 (inputs
6645 `(("gmp" ,gmp))) ;for sumlines
6646 (home-page "https://pallini.di.uniroma1.it/")
6647 (synopsis "Library for graph automorphisms")
6648 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
6649 procedures for computing automorphism groups of graphs and digraphs.
6650
6651 @code{nauty} computes graph information in the form of a set of
6652 generators, the size of the group, and the orbits of the group; it can
6653 also produce a canonical label. The @code{nauty} suite is written in
6654 C and comes with a command-line interface, a collection of
6655 command-line tools, and an Application Programming Interface (API).
6656
6657 This package provides the static libraries required to run programs
6658 compiled against the nauty library.")
6659 (license license:asl2.0)))
6660
6661 (define-public ppl
6662 (package
6663 (name "ppl")
6664 (version "1.2")
6665 (source
6666 (origin
6667 (method url-fetch)
6668 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
6669 "ftp/releases/" version
6670 "/ppl-" version ".tar.gz"))
6671 (sha256
6672 (base32
6673 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
6674 (build-system gnu-build-system)
6675 (native-inputs
6676 `(("m4" ,m4)))
6677 (inputs
6678 `(("glpk" ,glpk)
6679 ("gmp" ,gmp)))
6680 (home-page "https://www.bugseng.com/parma-polyhedra-library")
6681 (synopsis
6682 "Parma Polyhedra Library for computations with polyhedra")
6683 (description
6684 "The Parma Polyhedra Library (PPL) provides numerical abstractions
6685 especially targeted at applications in the field of analysis and
6686 verification of complex systems. These abstractions include convex
6687 polyhedra, defined as the intersection of a finite number of (open or
6688 closed) halfspaces, each described by a linear inequality (strict or
6689 non-strict) with rational coefficients; some special classes of polyhedra
6690 shapes that offer interesting complexity/precision tradeoffs; and grids
6691 which represent regularly spaced points that satisfy a set of linear
6692 congruence relations. The library also supports finite powersets and
6693 products of (any kind of) polyhedra and grids, a mixed integer linear
6694 programming problem solver using an exact-arithmetic version of the simplex
6695 algorithm, a parametric integer programming solver, and primitives for
6696 termination analysis via the automatic synthesis of linear ranking
6697 functions.")
6698 (license license:gpl3+)))
6699
6700 (define-public speedcrunch
6701 (package
6702 (name "speedcrunch")
6703 (version "0.12.0")
6704 (source
6705 (origin
6706 (method git-fetch)
6707 (uri (git-reference
6708 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
6709 (commit (string-append "release-" version))))
6710 (file-name (git-file-name name version))
6711 (sha256
6712 (base32
6713 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
6714 (build-system cmake-build-system)
6715 (inputs `(("qtbase" ,qtbase-5)))
6716 (native-inputs `(("qttools" ,qttools)))
6717 (arguments
6718 `(#:phases
6719 (modify-phases %standard-phases
6720 (add-after 'unpack 'chdir-to-src
6721 (lambda _ (chdir "src") #t)))))
6722 (synopsis "High-precision scientific calculator")
6723 (description
6724 "SpeedCrunch is a high-precision scientific calculator. It features a
6725 syntax-highlighted scrollable display and is designed to be fully used via
6726 keyboard. Some distinctive features are auto-completion of functions and
6727 variables, a formula book, and quick insertion of constants from various
6728 fields of knowledge.")
6729 (home-page "https://speedcrunch.org/")
6730 (license license:gpl2+)))
6731
6732 (define-public minisat
6733 ;; This is the last commit which is available upstream, no
6734 ;; release happened since 2010.
6735 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
6736 (revision "1"))
6737 (package
6738 (name "minisat")
6739 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
6740 (source
6741 (origin
6742 (method git-fetch)
6743 (uri (git-reference
6744 (url "https://github.com/niklasso/minisat")
6745 (commit commit)))
6746 (file-name (string-append name "-" version "-checkout"))
6747 (sha256
6748 (base32
6749 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
6750 (patches
6751 (search-patches "minisat-friend-declaration.patch"
6752 "minisat-install.patch"))))
6753 (build-system gnu-build-system)
6754 (arguments
6755 '(#:make-flags (list (string-append "prefix=" %output))
6756 #:tests? #f ;no check target
6757 #:phases
6758 (modify-phases %standard-phases
6759 (delete 'configure))))
6760 (inputs
6761 `(("zlib:static" ,zlib "static")
6762 ("zlib" ,zlib)))
6763 (synopsis
6764 "Small, yet efficient, SAT solver")
6765 (description
6766 "MiniSat is a minimalistic, open-source SAT solver, developed to help
6767 researchers and developers alike to get started on SAT.")
6768 (home-page
6769 "http://minisat.se/MiniSat.html")
6770 (license license:expat))))
6771
6772 (define-public libqalculate
6773 (package
6774 (name "libqalculate")
6775 (version "3.19.0")
6776 (source
6777 (origin
6778 (method git-fetch)
6779 (uri (git-reference
6780 (url "https://github.com/Qalculate/libqalculate/")
6781 (commit (string-append "v" version))))
6782 (file-name (git-file-name name version))
6783 (sha256
6784 (base32 "1w44407wb552q21dz4m2nwwdi8b9hzjb2w1l3ffsikzqckc7wbyj"))
6785 (patches
6786 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
6787 (build-system gnu-build-system)
6788 (native-inputs
6789 `(("pkg-config" ,pkg-config)
6790 ("gettext" ,gettext-minimal)
6791 ("intltool" ,intltool)
6792 ("automake" ,automake)
6793 ("autoconf" ,autoconf)
6794 ("libtool" ,libtool)
6795 ("doxygen" ,doxygen)
6796 ("file" ,file)))
6797 (inputs
6798 `(("gmp" ,gmp)
6799 ("mpfr" ,mpfr)
6800 ("libxml2" ,libxml2)
6801 ("curl" ,curl)
6802 ("icu4c" ,icu4c)
6803 ("gnuplot" ,gnuplot)
6804 ("readline" ,readline)
6805 ("libiconv" ,libiconv)))
6806 (arguments
6807 `(#:phases
6808 (modify-phases %standard-phases
6809 (add-before 'bootstrap 'setenv
6810 ;; Prevent the autogen.sh script to carry out the configure
6811 ;; script, which has not yet been patched to replace /bin/sh.
6812 (lambda _
6813 (setenv "NOCONFIGURE" "TRUE")
6814 #t)))))
6815 (home-page "https://qalculate.github.io/")
6816 (synopsis "Multi-purpose cli desktop calculator and library")
6817 (description
6818 "Libqalculate is a multi-purpose cli desktop calculator and library.
6819 It provides basic and advanced functionality. Features include customizable
6820 functions, unit calculations, and conversions, physical constants, symbolic
6821 calculations (including integrals and equations), arbitrary precision,
6822 uncertainty propagation, interval arithmetic, plotting and a user-friendly
6823 cli.")
6824 (license license:gpl2+)))
6825
6826 (define-public qalculate-gtk
6827 (package
6828 (name "qalculate-gtk")
6829 (version "3.19.0")
6830 (source
6831 (origin
6832 (method git-fetch)
6833 (uri (git-reference
6834 (url "https://github.com/Qalculate/qalculate-gtk/")
6835 (commit (string-append "v" version))))
6836 (file-name (git-file-name name version))
6837 (sha256
6838 (base32 "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v"))))
6839 (build-system glib-or-gtk-build-system)
6840 (native-inputs
6841 `(("pkg-config" ,pkg-config)
6842 ("intltool" ,intltool)
6843 ("automake" ,automake)
6844 ("autoconf" ,autoconf)
6845 ("libtool" ,libtool)
6846 ("file" ,file)))
6847 (inputs
6848 `(("gmp" ,gmp)
6849 ("mpfr" ,mpfr)
6850 ("libqalculate" ,libqalculate)
6851 ("libxml2" ,libxml2)
6852 ("glib" ,glib)
6853 ("gtk+" ,gtk+)))
6854 (arguments
6855 `(#:phases
6856 (modify-phases %standard-phases
6857 (add-before 'bootstrap 'setenv
6858 ;; Prevent the autogen.sh script to carry out the configure
6859 ;; script, which has not yet been patched to replace /bin/sh.
6860 (lambda _
6861 (setenv "NOCONFIGURE" "TRUE")
6862 #t)))))
6863 (home-page "https://qalculate.github.io/")
6864 (synopsis "Multi-purpose graphical desktop calculator")
6865 (description
6866 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
6867 multi-purpose GUI desktop calculator. It provides basic and advanced
6868 functionality. Features include customizable functions, unit calculations,
6869 and conversions, physical constants, symbolic calculations (including
6870 integrals and equations), arbitrary precision, uncertainty propagation,
6871 interval arithmetic, plotting.")
6872 (license license:gpl2+)))
6873
6874 (define-public numdiff
6875 (package
6876 (name "numdiff")
6877 (version "5.9.0")
6878 (source
6879 (origin
6880 (method url-fetch)
6881 (uri (string-append "mirror://savannah/numdiff/numdiff-"
6882 version ".tar.gz"))
6883 (sha256
6884 (base32
6885 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
6886 (build-system gnu-build-system)
6887 (arguments
6888 '(#:tests? #f ; There are no tests.
6889 #:phases
6890 (modify-phases %standard-phases
6891 (add-before 'compress-documentation 'delete-precompressed-info-file
6892 (lambda _
6893 (delete-file (string-append (assoc-ref %outputs "out")
6894 "/share/info/numdiff.info.gz"))
6895 #t)))))
6896 (home-page "https://nongnu.org/numdiff/")
6897 (synopsis "Compare files with numeric fields")
6898 (description
6899 "Numdiff compares files line by line and field by field, ignoring small
6900 numeric differences and differences in numeric formats.")
6901 (license license:gpl3+)))
6902
6903 (define-public why3
6904 (package
6905 (name "why3")
6906 (version "1.4.0")
6907 (source (origin
6908 (method git-fetch)
6909 (uri (git-reference
6910 (url "https://gitlab.inria.fr/why3/why3")
6911 (commit version)))
6912 (file-name (git-file-name name version))
6913 (sha256
6914 (base32
6915 "0pfsiddnk26f384wbazfpgzh1n1ibf3xq101q74mxvczi7z0a791"))))
6916 (build-system ocaml-build-system)
6917 (native-inputs
6918 `(("autoconf" ,autoconf)
6919 ("automake" ,automake)
6920 ("coq" ,coq)
6921 ("ocaml" ,ocaml)
6922 ("which" ,which)))
6923 (propagated-inputs
6924 `(("camlzip" ,camlzip)
6925 ("ocaml-graph" ,ocaml-graph)
6926 ("ocaml-menhir" ,ocaml-menhir)
6927 ("ocaml-num" ,ocaml-num)
6928 ("ocaml-zarith" ,ocaml-zarith)))
6929 (inputs
6930 `(("coq-flocq" ,coq-flocq)
6931 ("emacs-minimal" ,emacs-minimal)
6932 ("zlib" ,zlib)))
6933 (arguments
6934 `(#:phases
6935 (modify-phases %standard-phases
6936 (add-before 'configure 'bootstrap
6937 (lambda _
6938 (invoke "./autogen.sh")
6939 (setenv "CONFIG_SHELL" (which "sh"))
6940 (substitute* "configure"
6941 (("#! /bin/sh") (string-append "#!" (which "sh")))
6942 ;; find ocaml-num in the correct directory
6943 (("\\$DIR/nums.cma") "$DIR/num.cma")
6944 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))
6945 #t))
6946 (add-after 'configure 'fix-makefile
6947 (lambda _
6948 (substitute* "Makefile"
6949 ;; find ocaml-num in the correct directory
6950 (("site-lib/num") "site-lib"))
6951 #t))
6952 (add-after 'install 'install-lib
6953 (lambda _
6954 (invoke "make" "byte")
6955 (invoke "make" "install-lib")
6956 #t)))))
6957 (home-page "http://why3.lri.fr")
6958 (synopsis "Deductive program verification")
6959 (description "Why3 provides a language for specification and programming,
6960 called WhyML, and relies on external theorem provers, both automated and
6961 interactive, to discharge verification conditions. Why3 comes with a standard
6962 library of logical theories (integer and real arithmetic, Boolean operations,
6963 sets and maps, etc.) and basic programming data structures (arrays, queues,
6964 hash tables, etc.). A user can write WhyML programs directly and get
6965 correct-by-construction OCaml programs through an automated extraction
6966 mechanism. WhyML is also used as an intermediate language for the verification
6967 of C, Java, or Ada programs.")
6968 (license license:lgpl2.1)))
6969
6970 (define-public frama-c
6971 (package
6972 (name "frama-c")
6973 (version "23.1")
6974 (source (origin
6975 (method url-fetch)
6976 (uri (string-append "http://frama-c.com/download/frama-c-"
6977 version "-Vanadium.tar.gz"))
6978 (sha256
6979 (base32
6980 "1rgkq9sg436smw005ag0j6y3xryhjn18a07m5wjfrfp0s1438nnj"))))
6981 (build-system ocaml-build-system)
6982 (arguments
6983 `(#:tests? #f; no test target in Makefile
6984 #:phases
6985 (modify-phases %standard-phases
6986 (add-before 'configure 'export-shell
6987 (lambda* (#:key inputs #:allow-other-keys)
6988 (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
6989 "/bin/sh"))
6990 #t)))))
6991 (inputs
6992 `(("gmp" ,gmp)))
6993 (propagated-inputs
6994 `(("ocaml-biniou" ,ocaml-biniou)
6995 ("ocaml-easy-format" ,ocaml-easy-format)
6996 ("ocaml-graph" ,ocaml-graph)
6997 ("ocaml-yojson" ,ocaml-yojson)
6998 ("ocaml-zarith" ,ocaml-zarith)
6999 ("why3" ,why3)))
7000 (native-search-paths
7001 (list (search-path-specification
7002 (variable "FRAMAC_SHARE")
7003 (files '("share/frama-c"))
7004 (separator #f))
7005 (search-path-specification
7006 (variable "FRAMAC_LIB")
7007 (files '("lib/frama-c"))
7008 (separator #f))))
7009 (home-page "http://frama-c.com")
7010 (synopsis "C source code analysis platform")
7011 (description "Frama-C is an extensible and collaborative platform dedicated
7012 to source-code analysis of C software. The Frama-C analyzers assist you in
7013 various source-code-related activities, from the navigation through unfamiliar
7014 projects up to the certification of critical software.")
7015 (license license:lgpl2.1+)))
7016
7017 (define-public blitz
7018 (package
7019 (name "blitz")
7020 (version "1.0.2")
7021 (source
7022 (origin
7023 (method git-fetch)
7024 (uri (git-reference
7025 (url "https://github.com/blitzpp/blitz")
7026 (commit version)))
7027 (file-name (git-file-name name version))
7028 (sha256
7029 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
7030 (build-system cmake-build-system)
7031 (arguments
7032 `(#:configure-flags '("-DBUILD_DOC=ON"
7033 "-DBUILD_TESTING=ON")
7034 ;; The default "check" target also includes examples and benchmarks.
7035 #:test-target "check-testsuite"
7036 #:phases
7037 (modify-phases %standard-phases
7038 (add-after 'build 'build-doc
7039 (lambda _
7040 (invoke "make" "-j" (number->string (parallel-job-count))
7041 "blitz-doc"))))))
7042 (native-inputs
7043 `(("python" ,python)
7044 ("texinfo" ,texinfo)))
7045 (synopsis "C++ template class library for multidimensional arrays")
7046 (description "Blitz++ is a C++ template class library that provides
7047 high-performance multidimensional array containers for scientific computing.")
7048 (home-page "https://github.com/blitzpp/blitz")
7049 (license (list license:artistic2.0
7050 license:bsd-3
7051 license:lgpl3+))))
7052
7053 (define-public fxdiv
7054 ;; There is currently no tag in this repo.
7055 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
7056 (version "0.0")
7057 (revision "1"))
7058 (package
7059 (name "fxdiv")
7060 (version (git-version version revision commit))
7061 (home-page "https://github.com/Maratyszcza/FXdiv")
7062 (source (origin
7063 (method git-fetch)
7064 (uri (git-reference (url home-page) (commit commit)))
7065 (file-name (git-file-name name version))
7066 (sha256
7067 (base32
7068 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
7069 (patches (search-patches "fxdiv-system-libraries.patch"))))
7070 (build-system cmake-build-system)
7071 (inputs
7072 `(("googletest" ,googletest)
7073 ("googlebenchmark" ,googlebenchmark)))
7074 (synopsis
7075 "C++ library for division via fixed-point multiplication by inverse")
7076 (description
7077 "On modern CPUs and GPUs, integer division is several times slower than
7078 multiplication. FXdiv implements an algorithm to replace an integer division
7079 with a multiplication and two shifts. This algorithm improves performance
7080 when an application performs repeated divisions by the same divisor.")
7081 (license license:expat))))
7082
7083 (define-public fp16
7084 ;; There is currently no tag in this repo.
7085 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
7086 (version "0.0")
7087 (revision "1"))
7088 (package
7089 (name "fp16")
7090 (version (git-version version revision commit))
7091 (home-page "https://github.com/Maratyszcza/FP16")
7092 (source (origin
7093 (method git-fetch)
7094 (uri (git-reference (url home-page) (commit commit)))
7095 (file-name (git-file-name name version))
7096 (sha256
7097 (base32
7098 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
7099 (patches (search-patches "fp16-system-libraries.patch"))))
7100 (build-system cmake-build-system)
7101 (arguments
7102 `(#:imported-modules ((guix build python-build-system)
7103 ,@%cmake-build-system-modules)
7104 #:modules (((guix build python-build-system)
7105 #:select (site-packages))
7106 (guix build cmake-build-system)
7107 (guix build utils))
7108 #:phases (modify-phases %standard-phases
7109 (add-after 'install 'move-python-files
7110 (lambda* (#:key inputs outputs #:allow-other-keys)
7111 ;; Python files get installed to $includedir (!).
7112 ;; Move them to the usual Python site directory.
7113 (let* ((out (assoc-ref outputs "out"))
7114 (include (string-append out "/include"))
7115 (site (site-packages inputs outputs))
7116 (target (string-append site "/fp16")))
7117 (mkdir-p target)
7118 (for-each (lambda (file)
7119 (rename-file file
7120 (string-append target "/"
7121 (basename
7122 file))))
7123 (find-files include "\\.py$"))))))))
7124 (native-inputs
7125 `(("python-wrapper" ,python-wrapper)))
7126 (inputs
7127 `(("psimd" ,psimd)
7128 ("googletest" ,googletest)
7129 ("googlebenchmark" ,googlebenchmark)))
7130 (synopsis "C++ library for half-precision floating point formats")
7131 (description
7132 "This header-only C++ library implements conversion to and from
7133 half-precision floating point formats.")
7134 (license license:expat))))
7135
7136 (define-public optizelle
7137 (let ((commit "ed4160b5287518448caeb34789d92dc6a0b7e2cc"))
7138 (package
7139 (name "optizelle")
7140 (version (git-version "1.3.0" "0" commit))
7141 (source
7142 (origin
7143 (method git-fetch)
7144 (uri (git-reference
7145 (url "https://github.com/OptimoJoe/Optizelle")
7146 (commit commit)))
7147 (file-name (git-file-name "optizelle" commit))
7148 (sha256
7149 (base32
7150 "0rjrs5sdmd33a9f4xm8an7p0953aa0bxsmr4hs3ss1aad9k181vq"))
7151 (modules '((guix build utils)))
7152 (snippet
7153 '(begin
7154 ;; Reduce the stopping tolerance in one test so that the
7155 ;; convergence check returns the correct stopping
7156 ;; condition.
7157 (substitute*
7158 "src/unit/linear_algebra/tcg_loss_of_orthogonality.cpp"
7159 (("1e-13") "5e-14"))
7160 ;; Skip one set of python tests. See
7161 ;; https://github.com/OptimoJoe/Optizelle/issues/2.
7162 (substitute*
7163 "src/examples/inequality_scaling/CMakeLists.txt"
7164 (("add_unit(.*)\\$\\{interfaces\\}(.*)$" all middle end)
7165 (string-append "add_unit" middle "\"cpp\"" end)))
7166 ;; Install the licence for Optizelle, without also
7167 ;; including the licences for the dependencies.
7168 (substitute* "licenses/CMakeLists.txt"
7169 (("file.*package.*$" all)
7170 (string-append "# " all))
7171 ((".*[^l].[.]txt\\)\n") "")
7172 (("add_license.*\"\n") ""))
7173 #t))))
7174 (build-system cmake-build-system)
7175 (arguments
7176 `(#:imported-modules ((guix build python-build-system)
7177 ,@%cmake-build-system-modules)
7178 #:modules (((guix build python-build-system) #:select
7179 (python-version))
7180 (guix build cmake-build-system)
7181 (guix build utils))
7182 #:configure-flags `("-DCMAKE_CXX_FLAGS:STRING=-pthread"
7183 "-DENABLE_CPP_UNIT:BOOL=ON"
7184 "-DENABLE_CPP_EXAMPLES:BOOL=ON"
7185 "-DENABLE_PYTHON:BOOL=ON"
7186 "-DENABLE_PYTHON_UNIT:BOOL=ON"
7187 "-DENABLE_PYTHON_EXAMPLES:BOOL=ON"
7188 ,(string-append "-DBLAS_LIBRARY:FILEPATH="
7189 (assoc-ref %build-inputs
7190 "blas/lapack")
7191 "/lib/libopenblas.so")
7192 ,(string-append "-DLAPACK_LIBRARY:FILEPATH="
7193 (assoc-ref %build-inputs
7194 "fortran:lib")
7195 "/lib/libgfortran.so;"
7196 (assoc-ref %build-inputs
7197 "fortran:lib")
7198 "/lib/libquadmath.so"))
7199 #:phases
7200 (modify-phases %standard-phases
7201 (add-after 'unpack 'set-numpy-path ; Needed for the unit tests.
7202 (lambda* (#:key inputs #:allow-other-keys)
7203 (let* ((pyver (python-version (assoc-ref inputs "python")))
7204 (npdir (string-append (assoc-ref inputs "numpy")
7205 "/lib/python" pyver
7206 "/site-packages")))
7207 (substitute* "src/cmake/Modules/Optizelle.cmake"
7208 (("PYTHONPATH=")
7209 (string-append "LD_LIBRARY_PATH=$ENV{LIBRARY_PATH};"
7210 "PYTHONPATH=" npdir ":"))))))
7211 (delete 'install-license-files)))) ; LICENSE.txt is installed.
7212 (inputs
7213 `(("blas/lapack" ,openblas)
7214 ("fortran:lib" ,gfortran "lib")
7215 ("jsoncpp" ,jsoncpp)
7216 ("numpy" ,python-numpy)
7217 ("python" ,python)))
7218 (native-inputs
7219 `(("fortran" ,gfortran)
7220 ("pkg-config" ,pkg-config)))
7221 (home-page "https://www.optimojoe.com/products/optizelle/")
7222 (synopsis "Mathematical optimization library")
7223 (description "@code{optizelle} is a software library designed to
7224 solve nonlinear optimization problems. Four types of problem are
7225 considered: unconstrained, equality constrained, inequality
7226 constrained and constrained. Constraints may be applied as values of
7227 functions or sets of partial differential equations (PDEs).
7228
7229 Solution algorithms such as the preconditioned nonlinear conjugate
7230 gradient method, sequential quadratic programming (SQP) and the
7231 primal-dual interior-point method are made available. Interfaces are
7232 provided for applications written in C++ and Python. Parallel
7233 computation is supported via MPI.")
7234 (license license:bsd-2))))