gnu: fetchmail: Update to 6.4.8.
[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 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nikita <nikita@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
35 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
36 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
37 ;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
38 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
39 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
40 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
41 ;;;
42 ;;; This file is part of GNU Guix.
43 ;;;
44 ;;; GNU Guix is free software; you can redistribute it and/or modify it
45 ;;; under the terms of the GNU General Public License as published by
46 ;;; the Free Software Foundation; either version 3 of the License, or (at
47 ;;; your option) any later version.
48 ;;;
49 ;;; GNU Guix is distributed in the hope that it will be useful, but
50 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
51 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ;;; GNU General Public License for more details.
53 ;;;
54 ;;; You should have received a copy of the GNU General Public License
55 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
56
57 (define-module (gnu packages maths)
58 #:use-module (ice-9 regex)
59 #:use-module (ice-9 match)
60 #:use-module (gnu packages)
61 #:use-module ((guix licenses) #:prefix license:)
62 #:use-module (guix packages)
63 #:use-module (guix download)
64 #:use-module (guix git-download)
65 #:use-module (guix utils)
66 #:use-module ((guix build utils) #:select (alist-replace))
67 #:use-module (guix build-system cmake)
68 #:use-module (guix build-system glib-or-gtk)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system python)
71 #:use-module (guix build-system ruby)
72 #:use-module (gnu packages algebra)
73 #:use-module (gnu packages audio)
74 #:use-module (gnu packages autotools)
75 #:use-module (gnu packages base)
76 #:use-module (gnu packages bison)
77 #:use-module (gnu packages boost)
78 #:use-module (gnu packages check)
79 #:use-module (gnu packages cmake)
80 #:use-module (gnu packages compression)
81 #:use-module (gnu packages curl)
82 #:use-module (gnu packages cyrus-sasl)
83 #:use-module (gnu packages dbm)
84 #:use-module (gnu packages documentation)
85 #:use-module (gnu packages elf)
86 #:use-module (gnu packages file)
87 #:use-module (gnu packages flex)
88 #:use-module (gnu packages fltk)
89 #:use-module (gnu packages fontutils)
90 #:use-module (gnu packages gettext)
91 #:use-module (gnu packages gcc)
92 #:use-module (gnu packages gd)
93 #:use-module (gnu packages ghostscript)
94 #:use-module (gnu packages glib)
95 #:use-module (gnu packages graphviz)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages icu4c)
98 #:use-module (gnu packages image)
99 #:use-module (gnu packages java)
100 #:use-module (gnu packages less)
101 #:use-module (gnu packages lisp)
102 #:use-module (gnu packages linux)
103 #:use-module (gnu packages logging)
104 #:use-module (gnu packages lua)
105 #:use-module (gnu packages gnome)
106 #:use-module (gnu packages guile)
107 #:use-module (gnu packages xorg)
108 #:use-module (gnu packages gl)
109 #:use-module (gnu packages imagemagick)
110 #:use-module (gnu packages m4)
111 #:use-module (gnu packages mpi)
112 #:use-module (gnu packages multiprecision)
113 #:use-module (gnu packages netpbm)
114 #:use-module (gnu packages onc-rpc)
115 #:use-module (gnu packages pcre)
116 #:use-module (gnu packages popt)
117 #:use-module (gnu packages perl)
118 #:use-module (gnu packages pkg-config)
119 #:use-module (gnu packages pulseaudio)
120 #:use-module (gnu packages python)
121 #:use-module (gnu packages python-web)
122 #:use-module (gnu packages python-xyz)
123 #:use-module (gnu packages qt)
124 #:use-module (gnu packages readline)
125 #:use-module (gnu packages ruby)
126 #:use-module (gnu packages tbb)
127 #:use-module (gnu packages scheme)
128 #:use-module (gnu packages shells)
129 #:use-module (gnu packages tcl)
130 #:use-module (gnu packages texinfo)
131 #:use-module (gnu packages tex)
132 #:use-module (gnu packages tls)
133 #:use-module (gnu packages version-control)
134 #:use-module (gnu packages wxwidgets)
135 #:use-module (gnu packages xml)
136 #:use-module (srfi srfi-1))
137
138 (define-public aris
139 (package
140 (name "aris")
141 (version "2.2")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
145 (sha256 (base32
146 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
147 (build-system gnu-build-system)
148 (inputs `(("gtk+" ,gtk+)
149 ("libxml2" ,libxml2)))
150 (native-inputs `(("pkg-config" ,pkg-config)))
151 (synopsis "Natural deduction first-order logic interface")
152 (description "Aris is a program for performing logical proofs. It supports
153 propositional and predicate logic, as well as Boolean algebra and
154 arithmetical logic. In addition to its predefined inference and equivalence
155 rules, Aris also supports references to older proofs. Its use of standard
156 logical symbols and its natural deduction interface make it easy to use for
157 beginners.")
158 (license license:gpl3+)
159 (home-page "https://www.gnu.org/software/aris/")))
160
161 (define-public c-graph
162 (package
163 (name "c-graph")
164 (version "2.0.1")
165 (source (origin
166 (method url-fetch)
167 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
168 ".tar.gz"))
169 (sha256 (base32
170 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
171 (build-system gnu-build-system)
172 (inputs
173 `(("fortran" ,gfortran)))
174 (synopsis "Visualizing and demonstrating convolution")
175 (description
176 "GNU C-Graph is a tool for demonstrating the theory of convolution.
177 Thus, it can serve as an excellent aid to students of signal and systems
178 theory in visualizing the convolution process. Rather than forcing the
179 student to write code, the program offers an intuitive interface with
180 interactive dialogs to guide them.")
181 (license license:gpl3+)
182 (home-page "https://www.gnu.org/software/c-graph/")))
183
184 (define-public coda
185 (package
186 (name "coda")
187 (version "2.19")
188 (source
189 (origin
190 (method url-fetch)
191 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
192 version "/coda-" version ".tar.gz"))
193 (sha256
194 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
195 (patches (search-patches "coda-use-system-libs.patch"))
196 (modules '((guix build utils)))
197 (snippet
198 ;; Make sure we don't use the bundled software.
199 '(begin
200 (for-each (lambda (d)
201 (delete-file-recursively (string-append "libcoda/" d)))
202 '("zlib" "pcre" "expat"))
203 #t))))
204 (native-inputs
205 `(("fortran" ,gfortran)
206 ("python" ,python)
207 ("python-numpy" ,python-numpy)))
208 (inputs
209 `(("zlib" ,zlib)
210 ("pcre" ,pcre)
211 ("expat" ,expat)
212 ("hdf4" ,hdf4-alt)
213 ("hdf5" ,hdf5)))
214 (build-system gnu-build-system)
215 (arguments
216 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
217 "LIBS= -lz -lpcre -lexpat")))
218 (synopsis "A common interface to various earth observation data formats")
219 (description
220 "The Common Data Access toolbox (CODA) provides a set of interfaces for
221 reading remote sensing data from earth observation data files. It consists of
222 command line applications and interfaces to the C, Fortran, Python, and Java
223 programming languages.")
224 (home-page "https://stcorp.nl/coda")
225 (license license:gpl2+)))
226
227 (define-public qhull
228 (package
229 (name "qhull")
230 (version "2019.1")
231 (source (origin
232 (method url-fetch)
233 (uri (string-append "http://www.qhull.org/download/qhull-"
234 (car (string-split version #\.))
235 "-src-7.3.2.tgz"))
236 (sha256
237 (base32
238 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
239 (build-system cmake-build-system)
240 (synopsis "Calculate convex hulls and related structures")
241 (description
242 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
243 diagram, halfspace intersection about a point, furthest-site Delaunay
244 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
245 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
246 algorithm for computing the convex hull. It handles roundoff errors from
247 floating point arithmetic. It computes volumes, surface areas, and
248 approximations to the convex hull.
249
250 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
251 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
252 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
253 triangulations.")
254 (home-page "http://qhull.org")
255 (license (license:non-copyleft "file://COPYING.txt"
256 "See COPYING in the distribution."))))
257
258 (define-public python-cvxopt
259 (package
260 (name "python-cvxopt")
261 (version "1.2.3")
262 (source (origin
263 (method git-fetch)
264 (uri (git-reference
265 (url "https://github.com/cvxopt/cvxopt.git")
266 (commit version)))
267 (file-name (git-file-name name version))
268 (sha256
269 (base32
270 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
271 (build-system python-build-system)
272 (arguments
273 `(#:phases
274 (modify-phases %standard-phases
275 (add-after 'unpack 'find-libraries
276 (lambda* (#:key inputs #:allow-other-keys)
277 (setenv "CVXOPT_BLAS_LIB" "openblas")
278 (setenv "CVXOPT_BUILD_FFTW" "1")
279 (setenv "CVXOPT_BUILD_GLPK" "1")
280 (setenv "CVXOPT_BUILD_GSL" "1")
281 #t)))))
282 (inputs
283 `(("fftw" ,fftw)
284 ("glpk" ,glpk)
285 ("gsl" ,gsl)
286 ("lapack" ,lapack)
287 ("openblas" ,openblas)
288 ("suitesparse" ,suitesparse)))
289 (home-page "https://www.cvxopt.org")
290 (synopsis "Python library for convex optimization")
291 (description
292 "CVXOPT is a package for convex optimization based on the Python
293 programming language. Its main purpose is to make the development of software
294 for convex optimization applications straightforward by building on Python’s
295 extensive standard library and on the strengths of Python as a high-level
296 programming language.")
297 (license license:gpl3+)))
298
299 (define-public python2-cvxopt
300 (package-with-python2 python-cvxopt))
301
302 (define-public units
303 (package
304 (name "units")
305 (version "2.19")
306 (source (origin
307 (method url-fetch)
308 (uri (string-append "mirror://gnu/units/units-" version
309 ".tar.gz"))
310 (sha256 (base32
311 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
312 (build-system gnu-build-system)
313 (inputs
314 `(("readline" ,readline)
315 ("python" ,python-wrapper) ;for 'units_cur' script
316 ("python-requests" ,python-requests)))
317 (arguments
318 `(#:phases (modify-phases %standard-phases
319 (add-after 'install 'wrap-units_cur
320 (lambda* (#:key outputs #:allow-other-keys)
321 (let* ((out (assoc-ref outputs "out"))
322 (bin (string-append out "/bin")))
323 (wrap-program (string-append bin "/units_cur")
324 `("PYTHONPATH" ":" prefix
325 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
326 #t))))))
327 (synopsis "Conversion between thousands of scales")
328 (description
329 "GNU Units converts numeric quantities between units of measure. It
330 can handle scale changes through adaptive usage of standard scale
331 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
332 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
333 enough to be used effectively as a scientific calculator.")
334 (license license:gpl3+)
335 (home-page "https://www.gnu.org/software/units/")))
336
337 (define-public double-conversion
338 (package
339 (name "double-conversion")
340 (version "3.1.5")
341 (home-page "https://github.com/google/double-conversion")
342 (source (origin
343 (method git-fetch)
344 (uri (git-reference (url home-page)
345 (commit (string-append "v" version))))
346 (file-name (git-file-name name version))
347 (sha256
348 (base32
349 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
350 (build-system cmake-build-system)
351 (arguments
352 '(#:test-target "test"
353 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
354 "-DBUILD_TESTING=ON")))
355 (synopsis "Conversion routines for IEEE doubles")
356 (description
357 "The double-conversion library provides binary-decimal and decimal-binary
358 routines for IEEE doubles. The library consists of efficient conversion
359 routines that have been extracted from the V8 JavaScript engine.")
360 (license license:bsd-3)))
361
362 (define-public dionysus
363 (package
364 (name "dionysus")
365 (version "1.4.0")
366 (source (origin
367 (method url-fetch)
368 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
369 ".tar.xz"))
370 (sha256
371 (base32
372 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
373 (build-system gnu-build-system)
374 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
375 (synopsis "Local search for universal constants and scientific values")
376 (description
377 "GNU Dionysus is a convenient system for quickly retrieving the values of
378 mathematical constants used in science and engineering. Values can be
379 searched using a simple command-line tool, choosing from three databases:
380 universal constants, atomic numbers, and constants related to
381 semiconductors.")
382 (license license:gpl3+)
383 (home-page "https://www.gnu.org/software/dionysus/")))
384
385 (define-public dsfmt
386 (package
387 (name "dsfmt")
388 (version "2.2.3")
389 (source
390 (origin
391 (method url-fetch)
392 (uri
393 (string-append
394 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
395 "dSFMT-src-" version ".tar.gz"))
396 (sha256
397 (base32
398 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
399 (modules '((guix build utils)))
400 ;; Don't distribute html documentation with bundled jquery.
401 (snippet
402 '(begin
403 (delete-file-recursively "html") #t))
404 ;; Add patches borrowed from Julia.
405 (patches
406 (list
407 (origin
408 (method url-fetch)
409 (uri (string-append
410 "https://raw.githubusercontent.com/JuliaLang/julia/"
411 "v1.3.0/deps/patches/dSFMT.c.patch"))
412 (sha256 (base32
413 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
414 (file-name "dSFMT.c.patch"))
415 (origin
416 (method url-fetch)
417 (uri (string-append
418 "https://raw.githubusercontent.com/JuliaLang/julia/"
419 "v1.3.0/deps/patches/dSFMT.h.patch"))
420 (sha256 (base32
421 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
422 (file-name "dSFMT.h.patch"))))))
423 (build-system gnu-build-system)
424 (arguments
425 `(#:phases
426 (modify-phases %standard-phases
427 (delete 'configure) ; no configure script
428 (replace 'build
429 ;; Upstream Makefile does not build a shared library. Borrow from Julia
430 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
431 (lambda _
432 (invoke
433 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
434 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
435 "-O3" "-finline-functions" "-fomit-frame-pointer"
436 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
437 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
438 "-o" "libdSFMT.so")))
439 (replace 'install ; no "install" target
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let* ((out (assoc-ref outputs "out"))
442 (lib (string-append out "/lib"))
443 (inc (string-append out "/include"))
444 (doc (string-append out "/share/doc/" ,name "-" ,version)))
445 (install-file "libdSFMT.so" lib)
446 (install-file "dSFMT.h" inc)
447 (install-file "LICENSE.txt" doc)
448 #t))))))
449 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
450 (description
451 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
452 the expensive conversion of integer to double (floating point). dSFMT directly
453 generates double precision floating point pseudorandom numbers which have the
454 IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
455 format. dSFMT is only available on the CPUs which use IEEE 754 format double
456 precision floating point numbers.")
457 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
458 (license license:bsd-3)))
459
460 (define-public gsl
461 (package
462 (name "gsl")
463 (version "2.6")
464 (source (origin
465 (method url-fetch)
466 (uri (string-append "mirror://gnu/gsl/gsl-"
467 version ".tar.gz"))
468 (sha256
469 (base32
470 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
471 (build-system gnu-build-system)
472 (arguments
473 (let ((system (%current-system)))
474 (cond
475 ((or (string-prefix? "aarch64" system)
476 (string-prefix? "powerpc" system))
477 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
478 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
479 '(#:phases (modify-phases %standard-phases
480 (add-before 'check 'disable-failing-tests
481 (lambda _
482 (substitute* "spmatrix/test.c"
483 ((".*test_complex.*") "\n"))
484 #t)))))
485 ((string-prefix? "i686" system)
486 ;; There are rounding issues with these tests on i686:
487 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
488 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
489 '(#:phases (modify-phases %standard-phases
490 (add-before 'check 'disable-failing-tests
491 (lambda _
492 (substitute* "linalg/test.c"
493 ((".*gsl_test\\(test_LU_decomp.*") "\n")
494 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
495 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
496 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
497 (substitute* "spmatrix/test.c"
498 ((".*test_all.*") "\n")
499 ((".*test_float.*") "\n")
500 ((".*test_complex.*") "\n"))
501 #t)))))
502 (else '()))))
503 (home-page "https://www.gnu.org/software/gsl/")
504 (synopsis "Numerical library for C and C++")
505 (description
506 "The GNU Scientific Library is a library for numerical analysis in C
507 and C++. It includes a wide range of mathematical routines, with over 1000
508 functions in total. Subject areas covered by the library include:
509 differential equations, linear algebra, Fast Fourier Transforms and random
510 numbers.")
511 (license license:gpl3+)))
512
513 (define-public glpk
514 (package
515 (name "glpk")
516 (version "4.65")
517 (source
518 (origin
519 (method url-fetch)
520 (uri (string-append "mirror://gnu/glpk/glpk-"
521 version ".tar.gz"))
522 (sha256
523 (base32
524 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
525 (build-system gnu-build-system)
526 (inputs
527 `(("gmp" ,gmp)))
528 (arguments
529 `(#:configure-flags '("--with-gmp")))
530 (home-page "https://www.gnu.org/software/glpk/")
531 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
532 (description
533 "GLPK is a C library for solving large-scale linear programming (LP),
534 mixed integer programming (MIP), and other related problems. It supports the
535 GNU MathProg modeling language, a subset of the AMPL language, and features a
536 translator for the language. In addition to the C library, a stand-alone
537 LP/MIP solver is included in the package.")
538 (license license:gpl3+)))
539
540 (define-public 4ti2
541 (package
542 (name "4ti2")
543 (version "1.6.9")
544 (source
545 (origin
546 (method url-fetch)
547 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
548 "Release_"
549 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
550 version)
551 "/4ti2-" version ".tar.gz"))
552 (sha256
553 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
554 (build-system gnu-build-system)
555 (native-inputs
556 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
557 (inputs
558 `(("glpk" ,glpk)
559 ("gmp" ,gmp)))
560 (home-page "http://www.4ti2.de/")
561 (synopsis "Mathematical tool suite for problems on linear spaces")
562 (description
563 "4ti2 implements algorithms for solving algebraic, geometric and
564 combinatorial problems on linear spaces. Among others, it solves systems
565 of linear equations, computes extreme rays of polyhedral cones, solves
566 integer programming problems and computes Markov bases for statistics.")
567 (license license:gpl2+)))
568
569 (define-public cddlib
570 (package
571 (name "cddlib")
572 (version "0.94i")
573 (source
574 (origin
575 (method url-fetch)
576 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
577 (string-delete #\. version) ".tar.gz"))
578 (sha256
579 (base32
580 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
581 (build-system gnu-build-system)
582 (inputs
583 `(("gmp" ,gmp)))
584 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
585 (synopsis "Library for convex hulls and extreme rays of polyhedra")
586 (description
587 "The C-library cddlib implements the Double Description Method of
588 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
589 rays of a general convex polyhedron given by a system of linear inequalities
590 in arbitrary dimension. It can also be used for the converse operation of
591 computing convex hulls.")
592 (license license:gpl2+)))
593
594 (define-public lrslib
595 (package
596 (name "lrslib")
597 (version "7.0a")
598 (source
599 (origin
600 (method url-fetch)
601 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
602 "lrslib-0"
603 (string-delete #\. version) ".tar.gz"))
604 (sha256
605 (base32
606 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
607 (build-system gnu-build-system)
608 (inputs
609 `(("gmp" ,gmp)))
610 (arguments
611 `(#:tests? #f ; no check phase
612 #:make-flags `("CC=gcc"
613 ,(string-append "prefix=" (assoc-ref %outputs "out"))
614 "all-shared")
615 #:phases
616 (modify-phases %standard-phases
617 (replace 'configure
618 (lambda _
619 (substitute* "makefile"
620 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
621 #t)))))
622 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
623 (synopsis "Convex hulls of polyhedra with exact arithmetic")
624 (description
625 "The C code of lrslib implements the reverse search algorithm for
626 vertex enumeration and convex hull problems. Its input file format is
627 compatible with cddlib. All computations are done exactly in either
628 multiple precision or fixed integer arithmetic. Output is not stored
629 in memory, so even problems with very large output sizes can sometimes
630 be solved.")
631 (license license:gpl2+)))
632
633 (define-public vinci
634 (package
635 (name "vinci")
636 (version "1.0.5")
637 (source
638 (origin
639 (method url-fetch)
640 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
641 "vinci/vinci-" version ".tar.gz"))
642 (sha256
643 (base32
644 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
645 (build-system gnu-build-system)
646 (inputs
647 `(("lrslib" ,lrslib)))
648 (arguments
649 `(#:tests? #f ; no check phase
650 #:phases
651 (modify-phases %standard-phases
652 (replace 'configure
653 ;; register the lrs location in the config file
654 (lambda* (#:key inputs #:allow-other-keys)
655 (let* ((lrs (assoc-ref inputs "lrslib"))
656 (lrsexec (string-append lrs "/bin/lrs")))
657 (substitute* "vinci.h"
658 (("#define LRS_EXEC \"lrs\"")
659 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
660 #t))
661 (replace 'install
662 (lambda* (#:key outputs #:allow-other-keys)
663 (let* ((out (assoc-ref outputs "out"))
664 (bin (string-append out "/bin")))
665 (install-file "vinci" bin))
666 #t)))))
667 (home-page
668 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
669 (synopsis "Volume computation for polytopes")
670 (description
671 "Vinci implements a number of volume computation algorithms for convex
672 polytopes in arbitrary dimension. The polytopes can be given by their
673 V-representation (as the convex hull of a finite number of vertices), by
674 their H-representation (as the bounded intersection of a finite number of
675 halfspaces) or by their double description with both representations.")
676 (license license:gpl2+)))
677
678 (define-public arpack-ng
679 (package
680 (name "arpack-ng")
681 (version "3.6.3")
682 (home-page "https://github.com/opencollab/arpack-ng")
683 (source (origin
684 (method git-fetch)
685 (uri (git-reference (url home-page) (commit version)))
686 (file-name (git-file-name name version))
687 (sha256
688 (base32
689 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
690 (build-system gnu-build-system)
691 (native-inputs
692 `(("autoconf" ,autoconf)
693 ("automake" ,automake)
694 ("libtool" ,libtool)))
695 (inputs
696 `(("lapack" ,lapack)
697 ("fortran" ,gfortran)))
698 (synopsis "Fortran subroutines for solving eigenvalue problems")
699 (description
700 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
701 large scale eigenvalue problems.")
702 (license (license:non-copyleft "file://COPYING"
703 "See COPYING in the distribution."))))
704
705 (define-public arpack-ng-3.3.0
706 (package
707 (inherit arpack-ng)
708 (version "3.3.0")
709 (name (package-name arpack-ng))
710 (home-page (package-home-page arpack-ng))
711 (source
712 (origin
713 (method url-fetch)
714 (uri (string-append home-page "/archive/" version ".tar.gz"))
715 (file-name (string-append name "-" version ".tar.gz"))
716 (sha256
717 (base32
718 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
719
720 (define-public arpack-ng-openmpi
721 (package (inherit arpack-ng)
722 (name "arpack-ng-openmpi")
723 (inputs
724 `(("mpi" ,openmpi)
725 ,@(package-inputs arpack-ng)))
726 (arguments
727 (substitute-keyword-arguments (package-arguments arpack-ng)
728 ((#:configure-flags _ '())
729 ''("--enable-mpi"))
730 ((#:phases phases '%standard-phases)
731 `(modify-phases ,phases
732 (add-before 'check 'mpi-setup
733 ,%openmpi-setup)))))
734 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
735
736 (define-public lapack
737 (package
738 (name "lapack")
739 (version "3.9.0")
740 (source
741 (origin
742 (method url-fetch)
743 (uri (string-append "http://www.netlib.org/lapack/lapack-"
744 version ".tgz"))
745 (sha256
746 (base32
747 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
748 (build-system cmake-build-system)
749 (home-page "http://www.netlib.org/lapack/")
750 (inputs `(("fortran" ,gfortran)
751 ("python" ,python-wrapper)))
752 (arguments
753 `(#:configure-flags (list
754 "-DBUILD_SHARED_LIBS:BOOL=YES"
755 "-DLAPACKE=ON"
756 ;; Build the 'LAPACKE_clatms' functions.
757 "-DLAPACKE_WITH_TMG=ON"
758 "-DBUILD_TESTING=ON")))
759 (synopsis "Library for numerical linear algebra")
760 (description
761 "LAPACK is a Fortran 90 library for solving the most commonly occurring
762 problems in numerical linear algebra.")
763 (license (license:non-copyleft "file://LICENSE"
764 "See LICENSE in the distribution."))))
765
766 (define-public scalapack
767 (package
768 (name "scalapack")
769 (version "2.0.2")
770 (source
771 (origin
772 (method url-fetch)
773 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
774 version ".tgz"))
775 (sha256
776 (base32
777 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
778 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
779 (build-system cmake-build-system)
780 (inputs
781 `(("mpi" ,openmpi)
782 ("fortran" ,gfortran)
783 ("lapack" ,lapack))) ;for testing only
784 (arguments
785 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
786 #:phases (modify-phases %standard-phases
787 (add-before 'check 'mpi-setup
788 ,%openmpi-setup))))
789 (home-page "http://www.netlib.org/scalapack/")
790 (synopsis "Library for scalable numerical linear algebra")
791 (description
792 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
793 routines on parallel distributed memory machines. ScaLAPACK solves dense and
794 banded linear systems, least squares problems, eigenvalue problems, and
795 singular value problems.")
796 (license (license:non-copyleft "file://LICENSE"
797 "See LICENSE in the distribution."))))
798
799 (define-public gnuplot
800 (package
801 (name "gnuplot")
802 (version "5.2.7")
803 (source (origin
804 (method url-fetch)
805 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
806 version "/gnuplot-"
807 version ".tar.gz"))
808 (sha256
809 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
810 (build-system gnu-build-system)
811 (inputs `(("readline" ,readline)
812 ("cairo" ,cairo)
813 ("pango" ,pango)
814 ("gd" ,gd)
815 ("lua" ,lua)))
816 (native-inputs
817 `(("pkg-config" ,pkg-config)
818 ("texlive" ,texlive-tiny)))
819 (arguments `(#:configure-flags (list (string-append
820 "--with-texdir=" %output
821 "/texmf-local/tex/latex/gnuplot"))))
822 (home-page "http://www.gnuplot.info")
823 (synopsis "Command-line driven graphing utility")
824 (description "Gnuplot is a portable command-line driven graphing
825 utility. It was originally created to allow scientists and students to
826 visualize mathematical functions and data interactively, but has grown to
827 support many non-interactive uses such as web scripting. It is also used as a
828 plotting engine by third-party applications like Octave.")
829 ;; X11 Style with the additional restriction that derived works may only be
830 ;; distributed as patches to the original.
831 (license (license:fsf-free
832 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
833
834 (define-public gctp
835 (package
836 (name "gctp")
837 (version "2.0.0")
838 (source
839 (origin
840 (method git-fetch)
841 (uri (git-reference
842 (url "https://github.com/OkoSanto/GCTP.git")
843 (commit (string-append "v" version))))
844 (file-name (git-file-name name version))
845 (sha256
846 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
847 (native-inputs
848 `(("fortran" ,gfortran)))
849 (build-system gnu-build-system)
850 (synopsis "General Cartographic Transformation Package (GCTP)")
851 (description
852 "The General Cartographic Transformation Package (GCTP) is a system of
853 software routines designed to permit the transformation of coordinate pairs
854 from one map projection to another. The GCTP is the standard computer
855 software used by the National Mapping Division for map projection
856 computations.")
857 (home-page "https://github.com/OkoSanto/GCTP")
858 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
859
860 (define-public hdf4
861 (package
862 (name "hdf4")
863 (version "4.2.14")
864 (source
865 (origin
866 (method url-fetch)
867 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
868 version "/src/hdf-" version ".tar.bz2"))
869 (sha256
870 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
871 (patches (search-patches "hdf4-architectures.patch"
872 "hdf4-reproducibility.patch"
873 "hdf4-shared-fortran.patch"
874 "hdf4-tirpc.patch"))))
875 (build-system gnu-build-system)
876 (native-inputs
877 `(("gfortran" ,gfortran)
878 ("bison" ,bison)
879 ("flex" ,flex)))
880 (inputs
881 `(("zlib" ,zlib)
882 ("libjpeg" ,libjpeg-turbo)
883 ("libtirpc" ,libtirpc)))
884 (arguments
885 `(#:parallel-tests? #f
886 #:configure-flags (list "--enable-shared"
887 (string-append "CPPFLAGS=-I"
888 (assoc-ref %build-inputs "libtirpc")
889 "/include/tirpc"))
890 #:phases
891 (modify-phases %standard-phases
892 ;; This is inspired by two of Debian's patches.
893 (add-before 'configure 'add-more-aarch64-support
894 (lambda _
895 (substitute* '("mfhdf/ncgen/ncgen.l"
896 "mfhdf/ncgen/ncgenyy.c"
897 "mfhdf/libsrc/netcdf.h.in")
898 (("AIX5L64") "__aarch64__"))
899 #t))
900 (add-before 'configure 'patchbuild
901 (lambda _
902 (substitute*
903 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
904 (("/bin/rm") "rm")
905 (("/bin/mkdir") "mkdir"))
906 (substitute* (find-files "." "^Makefile\\.in$")
907 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
908 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
909 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
910 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
911 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
912 #t))
913 (add-after 'configure 'patch-settings
914 (lambda _
915 ;; libhdf4.settings contains the full path of the
916 ;; compilers used, and its contents are included in
917 ;; .so-files. We truncate the hashes to avoid
918 ;; unnecessary store references to those compilers:
919 (substitute* "libhdf4.settings"
920 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
921 (string-append prefix (string-take hash 10) "...")))
922 #t))
923 (add-after 'install 'provide-absolute-libjpeg-reference
924 (lambda* (#:key inputs outputs #:allow-other-keys)
925 (let ((out (assoc-ref outputs "out"))
926 (libjpeg (assoc-ref inputs "libjpeg")))
927 ;; libjpeg-turbo does not provide a .la file, so libtool is
928 ;; unable to add an absolute reference for -ljpeg in the .la
929 ;; files. Fix it manually to avoid having to propagate it.
930 (substitute* (find-files (string-append out "/lib") "\\.la$")
931 (("-ljpeg")
932 (string-append "-L" libjpeg "/lib -ljpeg")))
933 #t))))))
934 (home-page "https://www.hdfgroup.org/products/hdf4/")
935 (synopsis
936 "Library and multi-object file format for storing and managing data")
937 (description "HDF4 is a library and multi-object file format for storing
938 and managing data between machines. HDF4 is an older hierarchical data format,
939 incompatible with HDF5.")
940 (license
941 (license:non-copyleft
942 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
943
944 (define-public hdf4-alt
945 (package
946 (inherit hdf4)
947 (name "hdf4-alt")
948 (arguments
949 (substitute-keyword-arguments (package-arguments hdf4)
950 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
951 (synopsis
952 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
953
954 (define-public hdf5
955 (package
956 (name "hdf5")
957 (version "1.8.21")
958 (source
959 (origin
960 (method url-fetch)
961 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
962 "hdf5-" (version-major+minor version)
963 "/hdf5-" version "/src/hdf5-"
964 version ".tar.bz2")
965 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
966 "current"
967 (match (string-split version #\.)
968 ((major minor _ ...)
969 (string-append major minor)))
970 "/src/hdf5-" version ".tar.bz2")))
971 (sha256
972 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
973 (patches (search-patches "hdf5-config-date.patch"
974 "hdf5-1.8-mpi-deprecations.patch"))))
975 (build-system gnu-build-system)
976 (inputs
977 `(("zlib" ,zlib)))
978 (native-inputs
979 `(("gfortran" ,gfortran)
980 ("perl" ,perl))) ;part of the test machinery needs Perl
981 (outputs '("out" ; core library
982 "fortran")) ; fortran interface
983 (arguments
984 `(;; Some of the users, notably Flann, need the C++ interface.
985 #:configure-flags '("--enable-cxx"
986 "--enable-fortran"
987 "--enable-fortran2003"
988
989 ;; Build a thread-safe library. Unfortunately,
990 ;; 'configure' invites you to either turn off C++,
991 ;; Fortran, and the high-level interface (HL), or
992 ;; to pass '--enable-unsupported'. Debian
993 ;; packagers chose to pass '--enable-unsupported'
994 ;; and we follow their lead here.
995 "--enable-threadsafe"
996 "--with-pthread"
997 "--enable-unsupported")
998 ;; Use -fPIC to allow the R bindings to link with the static libraries
999 #:make-flags (list "CFLAGS=-fPIC"
1000 "CXXFLAGS=-fPIC")
1001 #:phases
1002 (modify-phases %standard-phases
1003 (add-before 'configure 'patch-configure
1004 (lambda* (#:key outputs #:allow-other-keys)
1005 (substitute* "configure"
1006 (("/bin/mv") "mv"))
1007 (substitute* "fortran/src/Makefile.in"
1008 (("libhdf5_fortran_la_LDFLAGS =")
1009 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1010 (assoc-ref outputs "fortran") "/lib")))
1011 (substitute* "hl/fortran/src/Makefile.in"
1012 (("libhdf5hl_fortran_la_LDFLAGS =")
1013 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1014 (assoc-ref outputs "fortran") "/lib")))
1015 #t))
1016 (add-after 'configure 'patch-settings
1017 (lambda _
1018 ;; libhdf5.settings contains the full path of the
1019 ;; compilers used, and its contents are included in
1020 ;; libhdf5.so. We truncate the hashes to avoid
1021 ;; unnecessary store references to those compilers:
1022 (substitute* "src/libhdf5.settings"
1023 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1024 (string-append prefix (string-take hash 10) "..."))
1025 ;; Don't record the build-time kernel version to make the
1026 ;; settings file reproducible.
1027 (("Uname information:.*")
1028 "Uname information: Linux\n"))
1029 #t))
1030 (add-after 'install 'patch-references
1031 (lambda* (#:key inputs outputs #:allow-other-keys)
1032 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1033 (zlib (assoc-ref inputs "zlib")))
1034 (substitute* (find-files bin "h5p?cc")
1035 (("-lz" lib)
1036 (string-append "-L" zlib "/lib " lib)))
1037 #t)))
1038 (add-after 'install 'split
1039 (lambda* (#:key inputs outputs #:allow-other-keys)
1040 ;; Move all fortran-related files
1041 (let* ((out (assoc-ref outputs "out"))
1042 (bin (string-append out "/bin"))
1043 (lib (string-append out "/lib"))
1044 (inc (string-append out "/include"))
1045 (ex (string-append out "/share/hdf5_examples/fortran"))
1046 (fort (assoc-ref outputs "fortran"))
1047 (fbin (string-append fort "/bin"))
1048 (flib (string-append fort "/lib"))
1049 (finc (string-append fort "/include"))
1050 (fex (string-append fort "/share/hdf5_examples/fortran")))
1051 (mkdir-p fbin)
1052 (mkdir-p flib)
1053 (mkdir-p finc)
1054 (mkdir-p fex)
1055 ;; Note: When built with --enable-parallel, the 'h5fc' file
1056 ;; doesn't exist, hence this condition.
1057 (when (file-exists? (string-append bin "/h5fc"))
1058 (rename-file (string-append bin "/h5fc")
1059 (string-append fbin "/h5fc")))
1060 (for-each (lambda (file)
1061 (rename-file file
1062 (string-append flib "/" (basename file))))
1063 (find-files lib ".*fortran.*"))
1064 (for-each (lambda (file)
1065 (rename-file file
1066 (string-append finc "/" (basename file))))
1067 (find-files inc ".*mod"))
1068 (for-each (lambda (file)
1069 (rename-file file
1070 (string-append fex "/" (basename file))))
1071 (find-files ex ".*"))
1072 (delete-file-recursively ex))
1073 #t)))))
1074 (home-page "https://www.hdfgroup.org")
1075 (synopsis "Management suite for extremely large and complex data")
1076 (description "HDF5 is a suite that makes possible the management of
1077 extremely large and complex data collections.")
1078 (license (license:x11-style
1079 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
1080
1081 (define-public hdf5-1.10
1082 (package (inherit hdf5)
1083 (version "1.10.6")
1084 (source
1085 (origin
1086 (method url-fetch)
1087 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1088 "hdf5-" (version-major+minor version)
1089 "/hdf5-" version "/src/hdf5-"
1090 version ".tar.bz2")
1091 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1092 "current"
1093 (apply string-append
1094 (take (string-split version #\.) 2))
1095 "/src/hdf5-" version ".tar.bz2")))
1096 (sha256
1097 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
1098 (patches (search-patches "hdf5-config-date.patch"))))))
1099
1100 (define-public hdf-java
1101 (package
1102 (name "hdf-java")
1103 (version "3.3.2")
1104 (source
1105 (origin
1106 (method url-fetch)
1107 (uri (string-append
1108 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
1109 version "/src/CMake-hdfjava-" version ".tar.gz"))
1110 (sha256
1111 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1112 (modules '((guix build utils)))
1113 (snippet ; Make sure we don't use the bundled sources and binaries.
1114 `(begin
1115 (for-each delete-file
1116 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1117 "HDF4.tar.gz" "HDF5.tar.gz"))
1118 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1119 #t))))
1120 (build-system gnu-build-system)
1121 (native-inputs
1122 `(("jdk" ,icedtea "jdk")
1123 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1124 ;; For tests:
1125 ("hamcrest-core" ,java-hamcrest-core)
1126 ("junit" ,java-junit)
1127 ("slf4j-simple" ,java-slf4j-simple)))
1128 (inputs
1129 `(("hdf4" ,hdf4)
1130 ("hdf5" ,hdf5)
1131 ("zlib" ,zlib)
1132 ("libjpeg" ,libjpeg-turbo)
1133 ("slf4j-api" ,java-slf4j-api)))
1134 (arguments
1135 `(#:configure-flags
1136 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1137 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1138 (assoc-ref %build-inputs "jdk") "/lib" )
1139 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1140 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
1141
1142 #:make-flags
1143 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1144 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1145 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1146 (string-append "JPEGLIB="
1147 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1148 "LLEXT=so")
1149
1150 #:phases
1151 (modify-phases %standard-phases
1152 (add-before 'configure 'chdir-to-source
1153 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1154 (add-before 'configure 'patch-build
1155 (lambda* (#:key inputs outputs #:allow-other-keys)
1156 (substitute* "configure"
1157 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1158 (("/bin/cat") (which "cat")))
1159 ;; Set classpath for compilation
1160 (substitute* '("hdf/hdf5lib/Makefile.in"
1161 "hdf/hdf5lib/exceptions/Makefile.in"
1162 "hdf/hdflib/Makefile.in")
1163 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1164 (string-append (assoc-ref inputs "slf4j-api")
1165 "/share/java/slf4j-api.jar")))
1166 ;; Replace outdated config.sub and config.guess:
1167 (with-directory-excursion "config"
1168 (for-each (lambda (file)
1169 (install-file
1170 (string-append (assoc-ref inputs "automake")
1171 "/share/automake-"
1172 ,(version-major+minor (package-version automake))
1173 "/" file) "."))
1174 '("config.sub" "config.guess")))
1175
1176 ;; Fix embedded version number
1177 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1178 (substitute* "hdf/hdf5lib/H5.java"
1179 (("1, 8, 19")
1180 (string-join hdf5version ", "))))
1181
1182 (mkdir-p (string-append (assoc-ref outputs "out")))
1183 ;; Set classpath for tests
1184 (let* ((build-dir (getcwd))
1185 (lib (string-append build-dir "/lib"))
1186 (jhdf (string-append lib "/jhdf.jar"))
1187 (jhdf5 (string-append lib "/jhdf5.jar"))
1188 (testjars
1189 (map (lambda (i)
1190 (string-append (assoc-ref inputs i)
1191 "/share/java/" i ".jar"))
1192 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1193 (class-path
1194 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1195
1196 (substitute* '("test/hdf5lib/Makefile.in"
1197 "test/hdf5lib/junit.sh.in"
1198 "examples/runExample.sh.in")
1199 (("/usr/bin/test")
1200 (string-append (assoc-ref inputs "coreutils")
1201 "/bin/test"))
1202 (("/usr/bin/uname")
1203 (string-append (assoc-ref inputs "coreutils")
1204 "/bin/uname"))
1205 (("CLASSPATH=[^\n]*")
1206 (string-append "CLASSPATH=" class-path)))
1207 (setenv "CLASSPATH" class-path))
1208 #t))
1209 (add-before 'check 'build-examples
1210 (lambda _
1211 (apply invoke `("javac"
1212 ,@(find-files "examples" ".*\\.java"))))))
1213
1214 #:parallel-build? #f
1215
1216 #:parallel-tests? #f ))
1217 (home-page "https://support.hdfgroup.org/products/java")
1218 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1219 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1220 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1221 implemented in C.")
1222
1223 ;; BSD-style license:
1224 (license (license:x11-style
1225 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1226 /current/src/unpacked/COPYING"))))
1227
1228 (define-public hdf-eos2
1229 (package
1230 (name "hdf-eos2")
1231 (version "19.1.0")
1232 (source
1233 (origin
1234 (method url-fetch)
1235 (uri "ftp://edhs1.gsfc.nasa.gov\
1236 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1237 (sha256
1238 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1239 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1240 "hdf-eos2-build-shared.patch"
1241 "hdf-eos2-fortrantests.patch"))))
1242 (build-system gnu-build-system)
1243 (native-inputs
1244 `(("gfortran" ,gfortran)))
1245 (inputs
1246 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1247 ;; XXX: These inputs are really dependencies of hdf4.
1248 ("zlib" ,zlib)
1249 ("libjpeg" ,libjpeg-turbo)
1250 ("libtirpc" ,libtirpc)
1251
1252 ("gctp" ,gctp)))
1253 (arguments
1254 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1255 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1256 #:parallel-tests? #f))
1257 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
1258 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1259 (description "HDF-EOS2 is a software library built on HDF4 which supports
1260 the construction of data structures used in NASA's Earth Observing
1261 System (Grid, Point and Swath).")
1262
1263 ;; Source files carry a permissive license header.
1264 (license (license:non-copyleft home-page))))
1265
1266 (define-public hdf-eos5
1267 (package
1268 (name "hdf-eos5")
1269 (version "1.15")
1270 (source (origin
1271 (method url-fetch)
1272 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1273 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1274 (sha256
1275 (base32
1276 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1277 (patches (search-patches "hdf-eos5-build-shared.patch"
1278 "hdf-eos5-remove-gctp.patch"
1279 "hdf-eos5-fix-szip.patch"
1280 "hdf-eos5-fortrantests.patch"))))
1281 (native-inputs
1282 `(("gfortran" ,gfortran)))
1283 (build-system gnu-build-system)
1284 (inputs
1285 `(("hdf5" ,hdf5)
1286 ("zlib" ,zlib)
1287 ("gctp" ,gctp)))
1288 (arguments
1289 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1290 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1291 #:parallel-tests? #f))
1292 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1293 (description
1294 "HDF-EOS5 is a software library built on HDF5 to support the construction
1295 of data structures used in NASA's Earth Observing System (Grid, Point and
1296 Swath).")
1297 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1298
1299 ;; Source files carry a permissive license header.
1300 (license (license:non-copyleft home-page))))
1301
1302 (define-public hdf5-parallel-openmpi
1303 (package (inherit hdf5)
1304 (name "hdf5-parallel-openmpi")
1305 (inputs
1306 `(("mpi" ,openmpi)
1307 ,@(package-inputs hdf5)))
1308 (arguments
1309 (substitute-keyword-arguments (package-arguments hdf5)
1310 ((#:configure-flags flags)
1311 ``("--enable-parallel"
1312 ,@(delete "--enable-cxx"
1313 (delete "--enable-threadsafe" ,flags))))
1314 ((#:phases phases)
1315 `(modify-phases ,phases
1316 (add-after 'build 'mpi-setup
1317 ,%openmpi-setup)
1318 (add-before 'check 'patch-tests
1319 (lambda _
1320 ;; OpenMPI's mpirun will exit with non-zero status if it
1321 ;; detects an "abnormal termination", i.e. any process not
1322 ;; calling MPI_Finalize(). Since the test is explicitly
1323 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1324 ;; H5C_flush_cache from being called, mpirun will always
1325 ;; complain, so turn this test off.
1326 (substitute* "testpar/Makefile"
1327 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1328 (string-append front back "\n")))
1329 (substitute* "tools/h5diff/testph5diff.sh"
1330 (("/bin/sh") (which "sh")))
1331 #t))))))
1332 (synopsis "Management suite for data with parallel IO support")))
1333
1334 (define-public hdf5-blosc
1335 (package
1336 (name "hdf5-blosc")
1337 (version "1.0.0")
1338 (source
1339 (origin
1340 (method git-fetch)
1341 (uri (git-reference
1342 (url "https://github.com/Blosc/hdf5-blosc.git")
1343 (commit (string-append "v" version))))
1344 (file-name (git-file-name name version))
1345 (sha256
1346 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1347 (build-system cmake-build-system)
1348 (arguments
1349 `(#:configure-flags
1350 (list (string-append "-DBLOSC_INSTALL_DIR="
1351 (assoc-ref %build-inputs "c-blosc"))
1352 (string-append "-DPLUGIN_INSTALL_PATH="
1353 (assoc-ref %outputs "out")
1354 "/hdf5/lib/plugin"))
1355 #:phases
1356 (modify-phases %standard-phases
1357 (add-after 'unpack 'do-not-build-blosc
1358 (lambda _
1359 (substitute* "CMakeLists.txt"
1360 (("set\\(BLOSC_INSTALL_DIR.*") "")
1361 (("ExternalProject_Add\\(project_blosc") "message("))
1362 #t)))))
1363 (inputs
1364 `(("c-blosc" ,c-blosc)
1365 ("hdf5" ,hdf5-1.10)))
1366 (home-page "https://github.com/Blosc/hdf5-blosc")
1367 (synopsis "Filter for HDF5 using the Blosc compressor")
1368 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1369 installing this filter, you can read and write HDF5 files with
1370 Blosc-compressed datasets.")
1371 (license license:expat)))
1372
1373 (define-public h5check
1374 (package
1375 (name "h5check")
1376 (version "2.0.1")
1377 (source
1378 (origin
1379 (method url-fetch)
1380 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
1381 "h5check/src/h5check-" version ".tar.gz"))
1382 (sha256
1383 (base32
1384 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1385 (build-system gnu-build-system)
1386 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1387 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1388 (synopsis "HDF5 format checker")
1389 (description "@code{h5check} is a validation tool for verifying that an
1390 HDF5 file is encoded according to the HDF File Format Specification.")
1391 (license (license:x11-style "file://COPYING"))))
1392
1393 (define-public itpp
1394 (package
1395 (name "itpp")
1396 (version "4.3.1")
1397 (source (origin
1398 (method url-fetch)
1399 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1400 version "/itpp-"
1401 version ".tar.gz"))
1402 (sha256
1403 (base32
1404 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1405 (build-system cmake-build-system)
1406 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1407 (inputs `(("lapack" ,lapack)
1408 ("fftw" ,fftw)))
1409 ;; FIXME: Even though the fonts are available dvips complains:
1410 ;; "Font cmmi10 not found; characters will be left blank."
1411 (native-inputs
1412 `(("texlive" ,texlive-tiny)
1413 ("ghostscript" ,ghostscript)
1414 ("doxygen" ,doxygen)))
1415 (home-page "http://itpp.sourceforge.net")
1416 (synopsis "C++ library of maths, signal processing and communication classes")
1417 (description "IT++ is a C++ library of mathematical, signal processing and
1418 communication classes and functions. Its main use is in simulation of
1419 communication systems and for performing research in the area of
1420 communications. The kernel of the library consists of generic vector and
1421 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1422 similar to MATLAB, GNU Octave or SciPy.")
1423 (license license:gpl3+)))
1424
1425 (define-public netcdf
1426 (package
1427 (name "netcdf")
1428 (version "4.4.1.1")
1429 (source
1430 (origin
1431 (method url-fetch)
1432 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1433 "netcdf-" version ".tar.gz"))
1434 (sha256
1435 (base32
1436 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1437 (patches (search-patches "netcdf-date-time.patch"
1438 "netcdf-tst_h_par.patch"))))
1439 (build-system gnu-build-system)
1440 (native-inputs
1441 `(("m4" ,m4)
1442 ("doxygen" ,doxygen)
1443 ("graphviz" ,graphviz)))
1444 (inputs
1445 `(("hdf4" ,hdf4-alt)
1446 ("hdf5" ,hdf5)
1447 ("zlib" ,zlib)
1448 ("libjpeg" ,libjpeg-turbo)))
1449 (arguments
1450 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1451
1452 #:phases (modify-phases %standard-phases
1453 (add-before 'configure 'fix-source-date
1454 (lambda _
1455 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1456 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1457 ;; to '1st hour of the current day', and therefore makes the
1458 ;; package not reproducible.
1459 (substitute* "./configure"
1460 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1461 "date --date='@0'"))
1462 #t))
1463 (add-after 'configure 'patch-settings
1464 (lambda _
1465 ;; libnetcdf.settings contains the full filename of the compilers
1466 ;; used to build the library. We truncate the hashes of those
1467 ;; filenames to avoid unnecessary references to the corresponding
1468 ;; store items.
1469 (substitute* "libnetcdf.settings"
1470 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1471 (string-append prefix (string-take hash 10) "...")))
1472 #t)))
1473
1474 #:parallel-tests? #f)) ;various race conditions
1475 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
1476 (synopsis "Library for scientific data")
1477 (description "NetCDF is an interface for scientific data access and a
1478 software library that provides an implementation of the interface. The netCDF
1479 library defines a machine-independent format for representing scientific data.
1480 Together, the interface, library, and format support the creation, access, and
1481 sharing of scientific data.")
1482 (license (license:x11-style "file://COPYRIGHT"))))
1483
1484 (define-public netcdf-parallel-openmpi
1485 (package (inherit netcdf)
1486 (name "netcdf-parallel-openmpi")
1487 (inputs
1488 `(("mpi" ,openmpi)
1489 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1490 (package-inputs netcdf))))
1491 ;; TODO: Replace pkg-config references in nc-config with absolute references
1492 (arguments
1493 (substitute-keyword-arguments (package-arguments netcdf)
1494 ((#:configure-flags flags)
1495 `(cons* "CC=mpicc" "CXX=mpicxx"
1496 "--enable-parallel-tests"
1497 ;; Shared libraries not supported with parallel IO.
1498 "--disable-shared" "--with-pic"
1499 ,flags))))))
1500
1501 (define-public netcdf-fortran
1502 (package
1503 (name "netcdf-fortran")
1504 (version "4.4.4")
1505 (source (origin
1506 (method url-fetch)
1507 (uri (string-append
1508 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1509 version ".tar.gz"))
1510 (sha256
1511 (base32
1512 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1513 (build-system gnu-build-system)
1514 (arguments
1515 `(#:parallel-tests? #f))
1516 (inputs
1517 `(("netcdf" ,netcdf)))
1518 (native-inputs
1519 `(("gfortran" ,gfortran)))
1520 (synopsis "Fortran interface for the netCDF library")
1521 (description (package-description netcdf))
1522 (home-page (package-home-page netcdf))
1523 (license (package-license netcdf))))
1524
1525 (define-public nlopt
1526 (package
1527 (name "nlopt")
1528 (version "2.4.2")
1529 (source (origin
1530 (method url-fetch)
1531 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1532 version ".tar.gz"))
1533 (sha256
1534 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1535 (build-system gnu-build-system)
1536 (arguments
1537 `(;; Shared libraries are not built by default. They are required to
1538 ;; build the Guile, Octave, and Python bindings.
1539 #:configure-flags '("--enable-shared")
1540
1541 #:phases
1542 (modify-phases %standard-phases
1543 (add-before 'configure 'set-libnlopt-file-name
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 ;; Make sure the Scheme module refers to the library by its
1546 ;; absolute file name (we cannot do that from a snippet
1547 ;; because the expansion of @libdir@ contains
1548 ;; ${exec_prefix}.)
1549 (let ((out (assoc-ref outputs "out")))
1550 (substitute* "swig/nlopt.scm.in"
1551 (("libnlopt")
1552 (string-append out "/lib/libnlopt")))
1553 #t))))))
1554 (inputs `(("guile" ,guile-2.0)))
1555 (native-inputs `(("pkg-config" ,pkg-config)))
1556 (home-page "http://ab-initio.mit.edu/wiki/")
1557 (synopsis "Library for nonlinear optimization")
1558 (description "NLopt is a library for nonlinear optimization, providing a
1559 common interface for a number of different free optimization routines available
1560 online as well as original implementations of various other algorithms.")
1561 (license license:lgpl2.1+)))
1562
1563 (define-public ipopt
1564 (package
1565 (name "ipopt")
1566 (version "3.12.12")
1567 (source (origin
1568 (method url-fetch)
1569 (uri (string-append
1570 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
1571 version".tgz"))
1572 (sha256
1573 (base32
1574 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1575 (modules '((guix build utils)))
1576 (snippet
1577 ;; Make sure we don't use the bundled software.
1578 '(begin
1579 (delete-file-recursively "ThirdParty")
1580 #t))))
1581 (build-system gnu-build-system)
1582 (arguments
1583 '(#:phases (modify-phases %standard-phases
1584 (add-after 'install 'add--L-flags-in-ipopt.pc
1585 (lambda* (#:key inputs outputs #:allow-other-keys)
1586 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1587 ;; move it to "Libs.private" where it belongs, and add a
1588 ;; '-L' flag for LAPACK.
1589 (let ((out (assoc-ref outputs "out"))
1590 (lapack (assoc-ref inputs "lapack")))
1591 (substitute* (string-append out "/lib/pkgconfig/"
1592 "ipopt.pc")
1593 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1594 (string-append "Libs: " before " " after "\n"
1595 "Libs.private: " before
1596 "-L" lapack "/lib -llapack -lblas "
1597 after "\n")))
1598 #t))))))
1599 (native-inputs
1600 `(("gfortran" ,gfortran)))
1601 (inputs
1602 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1603 `(("lapack" ,lapack))) ;for both libblas and liblapack
1604 (home-page "https://www.coin-or.org")
1605 (synopsis "Large-scale nonlinear optimizer")
1606 (description
1607 "The Interior Point Optimizer (IPOPT) is a software package for
1608 large-scale nonlinear optimization. It provides C++, C, and Fortran
1609 interfaces.")
1610 (license license:epl1.0)))
1611
1612 (define-public clp
1613 (package
1614 (name "clp")
1615 (version "1.17.6")
1616 (source (origin
1617 (method url-fetch)
1618 (uri (string-append "https://www.coin-or.org/download/source/"
1619 "Clp/Clp-" version ".tgz"))
1620 (sha256
1621 (base32
1622 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
1623 (modules '((guix build utils)))
1624 (snippet
1625 ;; Make sure we don't use the bundled software.
1626 '(begin
1627 (delete-file-recursively "ThirdParty")
1628 #t))))
1629 (build-system gnu-build-system)
1630 (native-inputs
1631 `(("gfortran" ,gfortran)
1632 ("pkg-config" ,pkg-config)))
1633 (inputs
1634 `(("openblas" ,openblas)))
1635 (home-page "https://www.coin-or.org")
1636 (synopsis "Linear programming solver")
1637 (description
1638 "CLP is a high quality linear programming solver. Its main strengths are
1639 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1640 linear and quadratic objectives. There are limited facilities for nonlinear
1641 and quadratic objectives using the Simplex algorithm.")
1642 (license license:epl1.0)))
1643
1644 (define-public ceres
1645 (package
1646 (name "ceres-solver")
1647 (version "1.14.0")
1648 (home-page "http://ceres-solver.org/")
1649 (source (origin
1650 (method url-fetch)
1651 (uri (string-append home-page "ceres-solver-"
1652 version ".tar.gz"))
1653 (sha256
1654 (base32
1655 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1656 (build-system cmake-build-system)
1657 (arguments
1658 ;; TODO: Build HTML user documentation and install separately.
1659 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1660 "-DBUILD_SHARED_LIBS=ON")
1661
1662 #:phases (modify-phases %standard-phases
1663 (add-before 'configure 'set-library-directory
1664 (lambda _
1665 ;; Install libraries to lib/, not lib64/.
1666 (substitute* "internal/ceres/CMakeLists.txt"
1667 (("set\\(LIB_SUFFIX \"64\"\\)")
1668 "set(LIB_SUFFIX \"\")"))
1669 #t)))))
1670 (native-inputs
1671 `(("pkg-config" ,pkg-config)))
1672 (propagated-inputs
1673 `(("glog" ,glog))) ;for #include <glog/glog.h>
1674 (inputs
1675 `(("eigen" ,eigen)
1676 ("blas" ,openblas)
1677 ("lapack" ,lapack)
1678 ("suitesparse" ,suitesparse)
1679 ("gflags" ,gflags)))
1680 (synopsis "C++ library for solving large optimization problems")
1681 (description
1682 "Ceres Solver is a C++ library for modeling and solving large,
1683 complicated optimization problems. It is a feature rich, mature and
1684 performant library which has been used in production since 2010. Ceres Solver
1685 can solve two kinds of problems:
1686 @enumerate
1687 @item non-linear least squares problems with bounds constraints;
1688 @item general unconstrained optimization problems.
1689 @end enumerate\n")
1690 (license license:bsd-3)))
1691
1692 ;; For a fully featured Octave, users are strongly recommended also to install
1693 ;; the following packages: less, ghostscript, gnuplot.
1694 (define-public octave-cli
1695 (package
1696 (name "octave-cli")
1697 (version "5.2.0")
1698 (source
1699 (origin
1700 (method url-fetch)
1701 (uri (string-append "mirror://gnu/octave/octave-"
1702 version ".tar.lz"))
1703 (sha256
1704 (base32
1705 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
1706 (build-system gnu-build-system)
1707 (inputs
1708 `(("alsa-lib" ,alsa-lib)
1709 ("arpack" ,arpack-ng)
1710 ("bdb" ,bdb)
1711 ("curl" ,curl)
1712 ("fftw" ,fftw)
1713 ("fftwf" ,fftwf)
1714 ("fltk" ,fltk)
1715 ("fontconfig" ,fontconfig)
1716 ("freetype" ,freetype)
1717 ("gl2ps" ,gl2ps)
1718 ("glpk" ,glpk)
1719 ("glu" ,glu)
1720 ("graphicsmagick" ,graphicsmagick)
1721
1722 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1723 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1724 ;; libtiff.la instead of having to provide it here.
1725 ("libjpeg" ,libjpeg-turbo)
1726
1727 ("hdf5" ,hdf5)
1728 ("lapack" ,lapack)
1729 ("libsndfile" ,libsndfile)
1730 ("libxft" ,libxft)
1731 ("mesa" ,mesa)
1732 ("pcre" ,pcre)
1733 ("portaudio" ,portaudio)
1734 ("qhull" ,qhull)
1735 ("readline" ,readline)
1736 ("suitesparse" ,suitesparse)
1737 ("texinfo" ,texinfo)
1738 ("zlib" ,zlib)))
1739 (native-inputs
1740 `(("lzip" ,lzip)
1741 ("gfortran" ,gfortran)
1742 ("pkg-config" ,pkg-config)
1743 ("perl" ,perl)
1744 ;; The following inputs are not actually used in the build process.
1745 ;; However, the ./configure gratuitously tests for their existence and
1746 ;; assumes that programs not present at build time are also not, and
1747 ;; can never be, available at run time! If these inputs are therefore
1748 ;; not present, support for them will be built out. However, Octave
1749 ;; will still run without them, albeit without the features they
1750 ;; provide.
1751 ("less" ,less)
1752 ("ghostscript" ,ghostscript)
1753 ("gnuplot" ,gnuplot)))
1754 ;; Octave code uses this variable to detect directories holding multiple CA
1755 ;; certificates to verify peers with. This is required for the networking
1756 ;; functions that require encryption to work properly.
1757 (native-search-paths
1758 (list (search-path-specification
1759 (variable "CURLOPT_CAPATH")
1760 (files '("etc/ssl/certs")))))
1761 (arguments
1762 `(#:configure-flags
1763 (list (string-append "--with-shell="
1764 (assoc-ref %build-inputs "bash")
1765 "/bin/sh")
1766
1767 ;; XXX: Without this flag, linking octave-cli fails with
1768 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1769 ;; not pulling in liboctinterp.la for -lstdc++.
1770 "--enable-link-all-dependencies")
1771 #:phases
1772 (modify-phases %standard-phases
1773 (add-after 'configure 'configure-makeinfo
1774 (lambda* (#:key inputs #:allow-other-keys)
1775 (substitute* "libinterp/corefcn/help.h"
1776 (("\"makeinfo\"")
1777 (string-append
1778 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1779 #t)))))
1780 (home-page "https://www.gnu.org/software/octave/")
1781 (synopsis "High-level language for numerical computation")
1782 (description "GNU Octave is a high-level interpreted language that is
1783 specialized for numerical computations. It can be used for both linear and
1784 non-linear applications and it provides great support for visualizing results.
1785 Work may be performed both at the interactive command-line as well as via
1786 script files.")
1787 (license license:gpl3+)))
1788
1789 (define-public octave
1790 (package (inherit octave-cli)
1791 (name "octave")
1792 (source (origin
1793 (inherit (package-source octave-cli))))
1794 (inputs
1795 `(("qscintilla" ,qscintilla)
1796 ("qt" ,qtbase)
1797 ,@(package-inputs octave-cli)))
1798 (native-inputs
1799 `(("qttools" , qttools) ;for lrelease
1800 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1801 ,@(package-native-inputs octave-cli)))
1802 (arguments
1803 (substitute-keyword-arguments (package-arguments octave-cli)
1804 ((#:phases phases)
1805 `(modify-phases ,phases
1806 (add-before 'configure 'patch-qscintilla-library-name
1807 (lambda* (#:key inputs #:allow-other-keys)
1808 ;; The QScintilla library that the Octave configure script tries
1809 ;; to link with should be named libqscintilla-qt5.so, but the
1810 ;; QScintilla input provides the shared library as
1811 ;; libqscintilla2_qt5.so.
1812 (substitute* "configure"
1813 (("qscintilla2-qt5")
1814 "qscintilla2_qt5"))
1815 #t))))))))
1816
1817 (define-public opencascade-oce
1818 (package
1819 (name "opencascade-oce")
1820 (version "0.17.2")
1821 (source
1822 (origin
1823 (method git-fetch)
1824 (uri (git-reference
1825 (url "https://github.com/tpaviot/oce.git")
1826 (commit (string-append "OCE-" version))))
1827 (file-name (git-file-name name version))
1828 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1829 (sha256
1830 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1831 (build-system cmake-build-system)
1832 (arguments
1833 '(#:configure-flags
1834 (list "-DOCE_TESTING:BOOL=ON"
1835 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1836 "-DOCE_DRAW:BOOL=ON"
1837 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1838 (assoc-ref %outputs "out"))
1839 "-UCMAKE_INSTALL_RPATH")))
1840 (inputs
1841 `(("freetype" ,freetype)
1842 ("glu" ,glu)
1843 ("libxmu" ,libxmu)
1844 ("mesa" ,mesa)
1845 ("tcl" ,tcl)
1846 ("tk" ,tk)))
1847 (native-inputs
1848 `(("python" ,python-wrapper)))
1849 (home-page "https://github.com/tpaviot/oce")
1850 (synopsis "Libraries for 3D modeling and numerical simulation")
1851 (description
1852 "Open CASCADE is a set of libraries for the development of applications
1853 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1854 C++ class libraries providing services for 3D surface and solid modeling, CAD
1855 data exchange, and visualization. It is used for development of specialized
1856 software dealing with 3D models in design (CAD), manufacturing (CAM),
1857 numerical simulation (CAE), measurement equipment (CMM), and quality
1858 control (CAQ) domains.
1859
1860 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1861 patches, improvements, and experiments contributed by users over the official
1862 Open CASCADE library.")
1863 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1864 ; use of header files; see
1865 ; OCCT_LGPL_EXCEPTION.txt
1866 license:public-domain; files
1867 ; src/Standard/Standard_StdAllocator.hxx and
1868 ; src/NCollection/NCollection_StdAllocator.hxx
1869 license:expat; file src/OpenGl/OpenGl_glext.h
1870 license:bsd-3)))); test framework gtest
1871
1872 (define-public opencascade-occt
1873 (package
1874 (name "opencascade-occt")
1875 (version "7.3.0p3")
1876 (source
1877 (origin
1878 (method git-fetch)
1879 (uri (git-reference
1880 (url "https://git.dev.opencascade.org/repos/occt.git")
1881 (commit
1882 (string-append "V"
1883 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1884 version)))))
1885 (file-name (git-file-name name version))
1886 (sha256
1887 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1888 (modules '((guix build utils)))
1889 (snippet
1890 '(begin
1891 ;; Remove files specific to non-free operating systems.
1892 (delete-file-recursively "samples/ios")
1893 (delete-file-recursively "samples/mfc")
1894 (delete-file-recursively "samples/qt/FuncDemo")
1895 (delete-file "genconf.bat")
1896 (delete-file "gendoc.bat")
1897 (delete-file "genproj.bat")
1898 (delete-file "upgrade.bat")
1899 ;; Remove references to deleted files.
1900 (substitute* "dox/FILES_HTML.txt"
1901 ((".*standard.*") "" )
1902 ((".*UIKitSample.*") ""))
1903 #t))))
1904 (build-system cmake-build-system)
1905 (arguments
1906 '(;; There is no test target for make. OCCT provides an
1907 ;; 'Automated Testing System', which may be accessed after
1908 ;; installation via the draw.sh script. draw.sh is located in
1909 ;; the bin directory. For details see:
1910 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1911 ;; occt_dev_guides__tests.html
1912 #:tests? #f
1913 ;; Configure without freeimage: attempting to link against the
1914 ;; freeimage version 3.17 library leads to 'undefined
1915 ;; reference' errors.
1916 #:configure-flags
1917 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1918 "-DUSE_TBB:BOOL=ON"
1919 "-DUSE_VTK:BOOL=OFF"
1920 "-DBUILD_DOC_Overview:BOOL=OFF"
1921 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1922 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1923 "-UCMAKE_INSTALL_LIBDIR")))
1924 (inputs
1925 `(("doxygen" ,doxygen)
1926 ;("freeimage" ,freeimage)
1927 ("freetype" ,freetype)
1928 ("glu" ,glu)
1929 ("libxext" ,libxext)
1930 ("libxi" ,libxi)
1931 ("libxmu" ,libxmu)
1932 ("mesa" ,mesa)
1933 ("tbb" ,tbb)
1934 ("tcl" ,tcl)
1935 ("tk" ,tk)))
1936 ;; TODO: build Overview documentation and add 'doc' output.
1937 (home-page "https://www.opencascade.com")
1938 (synopsis "Libraries for 3D modeling and numerical simulation")
1939 (description
1940 "Open CASCADE is a set of libraries for the development of applications
1941 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1942 C++ class libraries providing services for 3D surface and solid modeling, CAD
1943 data exchange, and visualization. It is used for development of specialized
1944 software dealing with 3D models in design (CAD), manufacturing (CAM),
1945 numerical simulation (CAE), measurement equipment (CMM), and quality
1946 control (CAQ) domains.
1947
1948 This is the certified version of the Open Cascade Technology (OCCT) library.")
1949 (license (list ;; OCCT library:
1950 license:lgpl2.1; with an exception for the use of header
1951 ; files, see OCCT_LGPL_EXCEPTION.txt.
1952 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1953 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1954 license:expat
1955 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1956 ;; src/StepFile/step.tab.*:
1957 license:gpl3+ ; with Bison 2.2 exception.
1958 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1959 (license:non-copyleft
1960 "https://www.unicode.org/license.html")
1961 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1962 license:public-domain))))
1963
1964 (define-public gmsh
1965 (package
1966 (name "gmsh")
1967 (version "2.16.0")
1968 (source
1969 (origin
1970 (method git-fetch)
1971 (uri (git-reference
1972 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1973 (commit
1974 (string-append "gmsh_"
1975 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1976 version)))))
1977 (file-name (git-file-name name version))
1978 (sha256
1979 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1980 (modules '((guix build utils)))
1981 (snippet
1982 ;; Remove non-free METIS code
1983 '(begin
1984 (delete-file-recursively "contrib/Metis")
1985 #t))))
1986 (build-system cmake-build-system)
1987 (propagated-inputs
1988 `(("fltk" ,fltk)
1989 ("gfortran" ,gfortran)
1990 ("gmp" ,gmp)
1991 ("hdf5" ,hdf5)
1992 ("lapack" ,lapack)
1993 ("mesa" ,mesa)
1994 ("glu" ,glu)
1995 ("opencascade-oce" ,opencascade-oce)
1996 ("libx11" ,libx11)
1997 ("libxext" ,libxext)))
1998 (inputs
1999 `(("fontconfig" ,fontconfig)
2000 ("libxft" ,libxft)))
2001 (arguments
2002 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
2003 "-DENABLE_BUILD_SHARED:BOOL=ON"
2004 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
2005 (home-page "http://gmsh.info/")
2006 (synopsis "3D finite element grid generator")
2007 (description "Gmsh is a 3D finite element grid generator with a built-in
2008 CAD engine and post-processor. Its design goal is to provide a fast, light
2009 and user-friendly meshing tool with parametric input and advanced
2010 visualization capabilities. Gmsh is built around four modules: geometry,
2011 mesh, solver and post-processing. The specification of any input to these
2012 modules is done either interactively using the graphical user interface or in
2013 ASCII text files using Gmsh's own scripting language.")
2014 (license license:gpl2+)))
2015
2016 (define-public maxflow
2017 (package
2018 (name "maxflow")
2019 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2020 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2021 (version "3.0.5")
2022 (source (origin
2023 (method git-fetch)
2024 (uri (git-reference
2025 (url "https://github.com/gerddie/maxflow.git")
2026 (commit version)))
2027 (file-name (git-file-name name version))
2028 (sha256
2029 (base32
2030 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2031 (build-system cmake-build-system)
2032 (home-page "https://pub.ist.ac.at/~vnk/software.html")
2033 (synopsis "Library implementing Maxflow algorithm")
2034 (description "An implementation of the maxflow algorithm described in
2035 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2036 Energy Minimization in Computer Vision.\n
2037 Yuri Boykov and Vladimir Kolmogorov.\n
2038 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2039 September 2004}")
2040 (license license:gpl3+)))
2041
2042 (define-public petsc
2043 (package
2044 (name "petsc")
2045 (version "3.11.2")
2046 (source
2047 (origin
2048 (method url-fetch)
2049 ;; The *-lite-* tarball does not contain the *large* documentation
2050 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2051 "petsc-lite-" version ".tar.gz"))
2052 (sha256
2053 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
2054 (outputs '("out" ; libraries and headers
2055 "examples")) ; ~30MiB of examples
2056 (build-system gnu-build-system)
2057 (native-inputs
2058 `(("python" ,python-2)))
2059 (inputs
2060 `(("gfortran" ,gfortran)
2061 ("lapack" ,lapack)
2062 ("superlu" ,superlu)
2063 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2064 ;; leaving out opengl, as configuration seems to only be for mac
2065 ))
2066 (arguments
2067 `(#:test-target "test"
2068 #:parallel-build? #f ; build is parallel by default
2069 #:configure-flags
2070 `("--with-mpi=0"
2071 "--with-openmp=1"
2072 "--with-superlu=1")
2073 #:make-flags
2074 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2075 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2076 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
2077 #:phases
2078 (modify-phases %standard-phases
2079 (replace 'configure
2080 ;; PETSc's configure script is actually a python script, so we can't
2081 ;; run it with bash.
2082 (lambda* (#:key outputs (configure-flags '())
2083 #:allow-other-keys)
2084 (let* ((prefix (assoc-ref outputs "out"))
2085 (flags `(,(string-append "--prefix=" prefix)
2086 ,@configure-flags)))
2087 (format #t "build directory: ~s~%" (getcwd))
2088 (format #t "configure flags: ~s~%" flags)
2089 (apply invoke "./configure" flags))))
2090 (add-after 'configure 'clean-local-references
2091 (lambda* (#:key outputs #:allow-other-keys)
2092 (let ((out (assoc-ref outputs "out")))
2093 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
2094 ;; Prevent build directory from leaking into compiled code
2095 (((getcwd)) out)
2096 ;; Scrub timestamp for reproducibility
2097 ((".*Libraries compiled on.*") ""))
2098 (substitute* (find-files "." "petscvariables")
2099 ;; Do not expose build machine characteristics, set to defaults.
2100 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2101 (("NPMAX = [:digit:]+") "NPMAX = 2"))
2102 #t)))
2103 (add-after 'install 'clean-install
2104 ;; Try to keep installed files from leaking build directory names.
2105 (lambda* (#:key inputs outputs #:allow-other-keys)
2106 (let ((out (assoc-ref outputs "out")))
2107 (substitute* (map (lambda (file)
2108 (string-append out "/lib/petsc/conf/" file))
2109 '("petscvariables"))
2110 (((getcwd)) out))
2111 ;; Make compiler references point to the store
2112 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
2113 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2114 (string-append "= " (which compiler))))
2115 ;; PETSc installs some build logs, which aren't necessary.
2116 (for-each (lambda (file)
2117 (let ((f (string-append out "/lib/petsc/conf/" file)))
2118 (when (file-exists? f)
2119 (delete-file f))))
2120 '("configure.log" "make.log" "gmake.log"
2121 "test.log" "error.log" "RDict.db"
2122 "PETScBuildInternal.cmake"
2123 ;; Once installed, should uninstall with Guix
2124 "uninstall.py"))
2125 #t)))
2126 (add-after 'install 'move-examples
2127 (lambda* (#:key outputs #:allow-other-keys)
2128 (let* ((out (assoc-ref outputs "out"))
2129 (examples (assoc-ref outputs "examples"))
2130 (exdir (string-append out "/share/petsc/examples"))
2131 (exdir' (string-append examples "/share/petsc/examples")))
2132 (copy-recursively exdir exdir')
2133 (delete-file-recursively exdir)
2134 #t))))))
2135 (home-page "https://www.mcs.anl.gov/petsc")
2136 (synopsis "Library to solve PDEs")
2137 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2138 data structures and routines for the scalable (parallel) solution of
2139 scientific applications modeled by partial differential equations.")
2140 (license (license:non-copyleft
2141 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
2142
2143 (define-public petsc-complex
2144 (package (inherit petsc)
2145 (name "petsc-complex")
2146 (arguments
2147 (substitute-keyword-arguments (package-arguments petsc)
2148 ((#:configure-flags cf)
2149 `(cons "--with-scalar-type=complex" ,cf))))
2150 (synopsis "Library to solve PDEs (with complex scalars)")))
2151
2152 (define-public petsc-openmpi
2153 (package (inherit petsc)
2154 (name "petsc-openmpi")
2155 (inputs
2156 `(("hdf5" ,hdf5-parallel-openmpi)
2157 ("hypre" ,hypre-openmpi)
2158 ("metis" ,metis)
2159 ("mumps" ,mumps-openmpi)
2160 ("openmpi" ,openmpi)
2161 ("scalapack" ,scalapack)
2162 ("scotch" ,pt-scotch32)
2163 ,@(package-inputs petsc)))
2164 (arguments
2165 (substitute-keyword-arguments (package-arguments petsc)
2166 ((#:configure-flags cf)
2167 ``("--with-hypre=1"
2168 "--with-mpiexec=mpirun"
2169 "--with-metis=1"
2170 "--with-mumps=1"
2171 "--with-scalapack=1"
2172 "--with-ptscotch=1"
2173 ,(string-append "--with-mpi-dir="
2174 (assoc-ref %build-inputs "openmpi"))
2175 ,(string-append "--with-hdf5-include="
2176 (assoc-ref %build-inputs "hdf5") "/include")
2177 ,(string-append "--with-hdf5-lib="
2178 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2179 ,@(delete "--with-mpi=0" ,cf)))
2180 ((#:phases phases)
2181 `(modify-phases ,phases
2182 (add-before 'configure 'mpi-setup
2183 ,%openmpi-setup)))))
2184 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
2185
2186 (define-public petsc-complex-openmpi
2187 (package (inherit petsc-complex)
2188 (name "petsc-complex-openmpi")
2189 (inputs
2190 `(("openmpi" ,openmpi)
2191 ,@(package-inputs petsc-complex)))
2192 (arguments
2193 (substitute-keyword-arguments (package-arguments petsc-complex)
2194 ((#:configure-flags cf)
2195 ``("--with-mpiexec=mpirun"
2196 ,(string-append "--with-mpi-dir="
2197 (assoc-ref %build-inputs "openmpi"))
2198 ,@(delete "--with-mpi=0" ,cf)))
2199 ((#:phases phases)
2200 `(modify-phases ,phases
2201 (add-before 'configure 'mpi-setup
2202 ,%openmpi-setup)))))
2203 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
2204
2205 (define-public python-petsc4py
2206 (package
2207 (name "python-petsc4py")
2208 (version "3.11.0")
2209 (source
2210 (origin
2211 (method url-fetch)
2212 (uri (pypi-uri "petsc4py" version))
2213 (sha256
2214 (base32
2215 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
2216 (build-system python-build-system)
2217 (arguments
2218 `(#:phases
2219 (modify-phases %standard-phases
2220 (add-before 'build 'pre-build
2221 (lambda _
2222 ;; Define path to PETSc installation.
2223 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2224 #t))
2225 (add-before 'check 'mpi-setup
2226 ,%openmpi-setup))))
2227 (inputs
2228 `(("petsc" ,petsc-openmpi)
2229 ("python-numpy" ,python-numpy)))
2230 (home-page "https://bitbucket.org/petsc/petsc4py/")
2231 (synopsis "Python bindings for PETSc")
2232 (description "PETSc, the Portable, Extensible Toolkit for
2233 Scientific Computation, is a suite of data structures and routines for
2234 the scalable (parallel) solution of scientific applications modeled by
2235 partial differential equations. It employs the MPI standard for all
2236 message-passing communication. @code{petsc4py} provides Python
2237 bindings to almost all functions of PETSc.")
2238 (license license:bsd-3)))
2239
2240 (define-public python-kiwisolver
2241 (package
2242 (name "python-kiwisolver")
2243 (version "1.0.1")
2244 (source (origin
2245 (method url-fetch)
2246 (uri (pypi-uri "kiwisolver" version))
2247 (sha256
2248 (base32
2249 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2250 (build-system python-build-system)
2251 (home-page "https://github.com/nucleic/kiwi")
2252 (synopsis "Fast implementation of the Cassowary constraint solver")
2253 (description
2254 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2255 solving algorithm. Kiwi has been designed from the ground up to be
2256 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2257 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2258 savings are consistently > 5x.")
2259 (license license:bsd-3)))
2260
2261 (define-public python2-kiwisolver
2262 (package-with-python2 python-kiwisolver))
2263
2264 (define-public slepc
2265 (package
2266 (name "slepc")
2267 (version "3.11.1")
2268 (source
2269 (origin
2270 (method url-fetch)
2271 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2272 version ".tar.gz"))
2273 (sha256
2274 (base32
2275 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2276 (build-system gnu-build-system)
2277 (native-inputs
2278 `(("python" ,python-2)
2279 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2280 (inputs
2281 `(("arpack" ,arpack-ng)
2282 ("gfortran" ,gfortran)))
2283 (propagated-inputs
2284 `(("petsc" ,petsc)))
2285 (arguments
2286 `(#:parallel-build? #f ;build is parallel by default
2287 #:configure-flags
2288 `(,(string-append "--with-arpack-dir="
2289 (assoc-ref %build-inputs "arpack") "/lib"))
2290 #:make-flags ;honor (parallel-job-count)
2291 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2292 ,(string-append "PETSCCONFIGDIR="
2293 (assoc-ref %build-inputs "petsc:examples")
2294 "/share/petsc/examples/config"))
2295 #:phases
2296 (modify-phases %standard-phases
2297 (replace 'configure
2298 ;; configure is a python script, so we can't run it with bash.
2299 (lambda* (#:key inputs outputs (configure-flags '())
2300 #:allow-other-keys)
2301 (let* ((prefix (assoc-ref outputs "out"))
2302 (flags `(,(string-append "--prefix=" prefix)
2303 ,@configure-flags)))
2304 (format #t "build directory: ~s~%" (getcwd))
2305 (format #t "configure flags: ~s~%" flags)
2306 (setenv "SLEPC_DIR" (getcwd))
2307 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2308 (apply invoke "./configure" flags))))
2309 (add-after 'install 'delete-doc
2310 ;; TODO: SLEPc installs HTML documentation alongside headers in
2311 ;; $out/include. We'd like to move them to share/doc, but delete
2312 ;; them for now, as they are incomplete and installing the complete
2313 ;; documentation is difficult.
2314 (lambda* (#:key outputs #:allow-other-keys)
2315 (let* ((out (assoc-ref outputs "out")))
2316 (for-each delete-file (find-files out "\\.html$"))
2317 #t)))
2318 (add-after 'install 'clean-install
2319 ;; Clean up unnecessary build logs from installation.
2320 (lambda* (#:key outputs #:allow-other-keys)
2321 (let ((out (assoc-ref outputs "out")))
2322 (for-each (lambda (file)
2323 (let ((f (string-append out "/lib/slepc/conf/" file)))
2324 (when (file-exists? f)
2325 (delete-file f))))
2326 '("configure.log" "make.log" "gmake.log"
2327 "test.log" "error.log" "RDict.db"
2328 "uninstall.py"))
2329 #t))))))
2330 (home-page "http://slepc.upv.es")
2331 (synopsis "Scalable library for eigenproblems")
2332 (description "SLEPc is a software library for the solution of large sparse
2333 eigenproblems on parallel computers. It can be used for the solution of
2334 linear eigenvalue problems formulated in either standard or generalized form,
2335 as well as other related problems such as the singular value decomposition.
2336 The emphasis of the software is on methods and techniques appropriate for
2337 problems in which the associated matrices are sparse, for example, those
2338 arising after the discretization of partial differential equations.")
2339 (license license:bsd-2)))
2340
2341 (define-public slepc-complex
2342 (package (inherit slepc)
2343 (name "slepc-complex")
2344 (propagated-inputs
2345 `(("petsc" ,petsc-complex)
2346 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2347 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2348
2349 (define-public slepc-openmpi
2350 (package (inherit slepc)
2351 (name "slepc-openmpi")
2352 (arguments
2353 (substitute-keyword-arguments (package-arguments slepc)
2354 ((#:phases phases '%standard-phases)
2355 `(modify-phases ,phases
2356 (add-before 'check 'mpi-setup
2357 ,%openmpi-setup)))))
2358 (inputs
2359 `(("mpi" ,openmpi)
2360 ("arpack" ,arpack-ng-openmpi)
2361 ,@(alist-delete "arpack" (package-inputs slepc))))
2362 (propagated-inputs
2363 `(("petsc" ,petsc-openmpi)
2364 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2365 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2366
2367 (define-public slepc-complex-openmpi
2368 (package (inherit slepc-openmpi)
2369 (name "slepc-complex-openmpi")
2370 (propagated-inputs
2371 `(("petsc" ,petsc-complex-openmpi)
2372 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2373 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2374
2375 (define-public python-slepc4py
2376 (package
2377 (name "python-slepc4py")
2378 (version "3.11.0")
2379 (source
2380 (origin
2381 (method url-fetch)
2382 (uri (pypi-uri "slepc4py" version))
2383 (sha256
2384 (base32
2385 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
2386 (build-system python-build-system)
2387 (arguments
2388 `(#:phases
2389 (modify-phases %standard-phases
2390 (add-before 'build 'pre-build
2391 (lambda _
2392 ;; Define path to PETSc installation.
2393 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2394 ;; Define path to SLEPc installation.
2395 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2396 #t))
2397 (add-before 'check 'mpi-setup
2398 ,%openmpi-setup))))
2399 (inputs
2400 `(("python-numpy" ,python-numpy)
2401 ("python-petsc4py" ,python-petsc4py)
2402 ("slepc" ,slepc-openmpi)))
2403 (home-page "https://bitbucket.org/slepc/slepc4py/")
2404 (synopsis "Python bindings for SLEPc")
2405 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2406 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2407 Scientific Computation. It employs the MPI standard for all
2408 message-passing communication. @code{slepc4py} provides Python
2409 bindings to almost all functions of SLEPc.")
2410 (license license:bsd-3)))
2411
2412 (define-public mumps
2413 (package
2414 (name "mumps")
2415 (version "5.2.1")
2416 (source
2417 (origin
2418 (method url-fetch)
2419 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2420 version ".tar.gz"))
2421 (sha256
2422 (base32
2423 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
2424 (patches (search-patches "mumps-build-parallelism.patch"
2425 "mumps-shared-libseq.patch"
2426 "mumps-shared-mumps.patch"
2427 "mumps-shared-pord.patch"))))
2428 (build-system gnu-build-system)
2429 (inputs
2430 `(("fortran" ,gfortran)
2431 ;; These are required for linking against mumps, but we let the user
2432 ;; declare the dependency.
2433 ("blas" ,openblas)
2434 ("metis" ,metis)
2435 ("scotch" ,scotch)))
2436 (arguments
2437 `(#:modules ((ice-9 match)
2438 (ice-9 popen)
2439 (srfi srfi-1)
2440 ,@%gnu-build-system-modules)
2441 #:phases
2442 (modify-phases %standard-phases
2443 (replace 'configure
2444 (lambda* (#:key inputs #:allow-other-keys)
2445 (call-with-output-file "Makefile.inc"
2446 (lambda (port)
2447 (format port "
2448 PLAT =
2449 LIBEXT = .a
2450 OUTC = -o
2451 OUTF = -o
2452 RM = rm -f~:[
2453 CC = gcc
2454 FC = gfortran
2455 FL = gfortran
2456 INCSEQ = -I$(topdir)/libseq
2457 LIBSEQ = $(topdir)/libseq/libmpiseq.a
2458 LIBSEQNEEDED = libseqneeded~;
2459 CC = mpicc
2460 FC = mpifort
2461 FL = mpifort~]
2462 AR = ar vr # rules require trailing space, ugh...
2463 RANLIB = ranlib
2464 BLASDIR = ~a
2465 LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2466 SCALAPDIR = ~a
2467 SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
2468 LIBOTHERS = -pthread
2469 CDEFS = -DAdd_
2470 PIC = -fPIC
2471 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2472 OPTL = -O2 $(PIC)
2473 OPTC = -O2 $(PIC)
2474 INCS = $(INCSEQ)
2475 LIBS = $(SCALAP) $(LIBSEQ)
2476 LPORDDIR = $(topdir)/PORD/lib
2477 IPORD = -I$(topdir)/PORD/include
2478 LPORD = $(LPORDDIR)/libpord.a
2479 ORDERINGSF = -Dpord~@[
2480 METISDIR = ~a
2481 IMETIS = -I$(METISDIR)/include
2482 LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
2483 ORDERINGSF += -Dmetis~]~@[~:{
2484 SCOTCHDIR = ~a
2485 ISCOTCH = -I$(SCOTCHDIR)/include
2486 LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2487 ORDERINGSF += ~a~}~]
2488 ORDERINGSC = $(ORDERINGSF)
2489 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
2490 IORDERINGSF = $(ISCOTCH)
2491 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2492 (assoc-ref inputs "mpi")
2493 (assoc-ref inputs "blas")
2494 (assoc-ref inputs "scalapack")
2495 (assoc-ref inputs "metis")
2496 (match (list (assoc-ref inputs "pt-scotch")
2497 (assoc-ref inputs "scotch"))
2498 ((#f #f)
2499 #f)
2500 ((#f scotch)
2501 `((,scotch "" "-Dscotch")))
2502 ((ptscotch _)
2503 `((,ptscotch
2504 "-lptesmumps -lptscotch -lptscotcherr "
2505 "-Dptscotch")))))))))
2506 (replace 'build
2507 ;; By default only the d-precision library is built. Make with "all"
2508 ;; target so that all precision libraries and examples are built.
2509 (lambda _
2510 (invoke "make" "all"
2511 (format #f "-j~a" (parallel-job-count)))))
2512 (replace 'check
2513 ;; Run the simple test drivers, which read test input from stdin:
2514 ;; from the "real" input for the single- and double-precision
2515 ;; testers, and from the "cmplx" input for complex-precision
2516 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2517 ;; package to prefix execution with "mpirun".
2518 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2519 (with-directory-excursion "examples"
2520 (every
2521 (lambda (prec type)
2522 (let ((tester (apply open-pipe*
2523 `(,OPEN_WRITE
2524 ,@exec-prefix
2525 ,(string-append "./" prec
2526 "simpletest"))))
2527 (input (open-input-file
2528 (string-append "input_simpletest_" type))))
2529 (begin
2530 (dump-port input tester)
2531 (close-port input)
2532 (zero? (close-pipe tester)))))
2533 '("s" "d" "c" "z")
2534 '("real" "real" "cmplx" "cmplx")))))
2535 (replace 'install
2536 (lambda* (#:key outputs #:allow-other-keys)
2537 (let* ((out (assoc-ref outputs "out"))
2538 (libdir (string-append out "/lib")))
2539 (copy-recursively "lib" libdir)
2540 (copy-recursively "include" (string-append out "/include"))
2541 (when (file-exists? "libseq/libmpiseq.a")
2542 (install-file "libseq/libmpiseq.a" libdir))
2543 (when (file-exists? "libseq/libmpiseq.so")
2544 (install-file "libseq/libmpiseq.so" libdir))
2545 #t))))))
2546 (home-page "http://mumps.enseeiht.fr")
2547 (synopsis "Multifrontal sparse direct solver")
2548 (description
2549 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2550 sparse system of linear equations A x = b using Gaussian elimination.")
2551 (license license:cecill-c)))
2552
2553 (define-public mumps-metis
2554 (package (inherit mumps)
2555 (name "mumps-metis")
2556 (inputs
2557 (alist-delete "scotch" (package-inputs mumps)))))
2558
2559 (define-public mumps-openmpi
2560 (package (inherit mumps)
2561 (name "mumps-openmpi")
2562 (inputs
2563 `(("mpi" ,openmpi)
2564 ("scalapack" ,scalapack)
2565 ("pt-scotch" ,pt-scotch)
2566 ,@(alist-delete "scotch" (package-inputs mumps))))
2567 (arguments
2568 (substitute-keyword-arguments (package-arguments mumps)
2569 ((#:phases phases)
2570 `(modify-phases ,phases
2571 (add-before 'check 'mpi-setup
2572 ,%openmpi-setup)
2573 (replace 'check
2574 (lambda _
2575 ((assoc-ref ,phases 'check)
2576 #:exec-prefix '("mpirun" "-n" "2"))))))))
2577 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2578
2579 (define-public mumps-metis-openmpi
2580 (package (inherit mumps-openmpi)
2581 (name "mumps-metis-openmpi")
2582 (inputs
2583 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2584
2585 (define-public ruby-asciimath
2586 (package
2587 (name "ruby-asciimath")
2588 (version "1.0.4")
2589 (source
2590 (origin
2591 (method url-fetch)
2592 (uri (rubygems-uri "asciimath" version))
2593 (sha256
2594 (base32
2595 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2596 (build-system ruby-build-system)
2597 (arguments
2598 '(#:phases
2599 (modify-phases %standard-phases
2600 ;; Apply this patch
2601 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2602 (add-after 'unpack 'patch-remove-spurious-backslashes
2603 (lambda _
2604 (substitute* "spec/parser_spec.rb"
2605 (("\\\\\"")
2606 "\""))
2607 #t)))))
2608 (native-inputs
2609 `(("bundler" ,bundler)
2610 ("ruby-rspec" ,ruby-rspec)))
2611 (synopsis "AsciiMath parsing and conversion library")
2612 (description
2613 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2614 easy-to-write markup language for mathematics.")
2615 (home-page "https://github.com/asciidoctor/asciimath")
2616 (license license:expat)))
2617
2618 (define-public superlu
2619 (package
2620 (name "superlu")
2621 (version "5.2.1")
2622 (source
2623 (origin
2624 (method url-fetch)
2625 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2626 "superlu_" version ".tar.gz"))
2627 (sha256
2628 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2629 (modules '((guix build utils)))
2630 (snippet
2631 ;; Replace the non-free implementation of MC64 with a stub adapted
2632 ;; from Debian
2633 '(begin
2634 (use-modules (ice-9 regex)
2635 (ice-9 rdelim))
2636 (call-with-output-file "SRC/mc64ad.c"
2637 (lambda (port)
2638 (display "
2639 #include <stdio.h>
2640 #include <stdlib.h>
2641 void mc64id_(int *a) {
2642 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2643 abort ();
2644 }
2645 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2646 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2647 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2648 abort ();
2649 }\n" port)))
2650 ;; Remove the corresponding license verbiage. MC64 license follows
2651 ;; a "------" line separator.
2652 (with-atomic-file-replacement "License.txt"
2653 (let ((rx (make-regexp "-{8}")))
2654 (lambda (in out)
2655 (let loop ()
2656 (let ((line (read-line in 'concat)))
2657 (unless (regexp-exec rx line)
2658 (display line out)
2659 (loop))))
2660 #t)))))))
2661 (build-system cmake-build-system)
2662 (native-inputs
2663 `(("tcsh" ,tcsh)))
2664 (inputs
2665 `(("blas" ,openblas)
2666 ("gfortran" ,gfortran)))
2667 (arguments
2668 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2669 "-DTPL_BLAS_LIBRARIES=openblas"
2670 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2671 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
2672 (synopsis "Supernodal direct solver for sparse linear systems")
2673 (description
2674 "SuperLU is a general purpose library for the direct solution of large,
2675 sparse, nonsymmetric systems of linear equations on high performance machines.
2676 The library is written in C and is callable from either C or Fortran. The
2677 library routines perform an LU decomposition with partial pivoting and
2678 triangular system solves through forward and back substitution. The library
2679 also provides threshold-based ILU factorization preconditioners.")
2680 (license (list license:bsd-3
2681 license:gpl2+ ;EXAMPLE/*fgmr.c
2682 (license:fsf-free "file://SRC/colamd.h")))))
2683
2684 (define-public superlu-dist
2685 (package
2686 (name "superlu-dist")
2687 (version "6.2.0")
2688 (source
2689 (origin
2690 (method url-fetch)
2691 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
2692 "superlu_dist_" version ".tar.gz"))
2693 (sha256
2694 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
2695 (modules '((guix build utils)))
2696 (snippet
2697 ;; Replace the non-free implementation of MC64 with a stub
2698 '(begin
2699 (call-with-output-file "SRC/mc64ad_dist.c"
2700 (lambda (port)
2701 (display "
2702 #include <stdio.h>
2703 #include <stdlib.h>
2704 void mc64id_dist(int *a) {
2705 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2706 abort ();
2707 }
2708 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2709 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2710 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2711 abort ();
2712 }\n" port)))
2713 (substitute* "SRC/util.c" ;adjust default algorithm
2714 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2715 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2716 ;; general (i.e. non-square) processor-grid support.
2717 "RowPerm = NOROWPERM;"))
2718 #t))
2719 (patches (search-patches "superlu-dist-scotchmetis.patch"
2720 "superlu-dist-awpm-grid.patch"))))
2721 (build-system cmake-build-system)
2722 (native-inputs
2723 `(("tcsh" ,tcsh)))
2724 (inputs
2725 `(("gfortran" ,gfortran)
2726 ("blas" ,openblas)
2727 ("lapack" ,lapack)
2728 ("combblas" ,combinatorial-blas)))
2729 (propagated-inputs
2730 `(("mpi" ,openmpi) ;headers include MPI heades
2731 ("parmetis" ,pt-scotch32 "metis")
2732 ("pt-scotch" ,pt-scotch32)))
2733 (arguments
2734 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2735 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2736 "-DTPL_ENABLE_COMBBLASLIB=YES"
2737 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2738 "-DTPL_LAPACK_LIBRARIES=-llapack"
2739 (string-append "-DTPL_PARMETIS_LIBRARIES="
2740 (string-join
2741 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2742 "scotchmetis" "scotch" "scotcherr")
2743 ";"))
2744 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2745 (assoc-ref %build-inputs "parmetis")
2746 "/include")
2747 "-DTPL_ENABLE_COMBBLASLIB=ON"
2748 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2749 (assoc-ref %build-inputs "combblas")
2750 "/include/CombBLAS;"
2751 (assoc-ref %build-inputs "combblas")
2752 "/include/BipartiteMatchings")
2753 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2754 #:phases
2755 (modify-phases %standard-phases
2756 (add-before 'configure 'set-c++-standard
2757 (lambda _
2758 (substitute* "CMakeLists.txt"
2759 ;; AWPM headers require C++14
2760 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2761 (add-before 'check 'mpi-setup
2762 ,%openmpi-setup)
2763 (add-before 'check 'omp-setup
2764 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2765 (home-page (package-home-page superlu))
2766 (synopsis "Parallel supernodal direct solver")
2767 (description
2768 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2769 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2770 implemented in ANSI C, and MPI for communications.")
2771 (license license:bsd-3)))
2772
2773 (define-public scotch
2774 (package
2775 (name "scotch")
2776 (version "6.0.6")
2777 (source
2778 (origin
2779 (method url-fetch)
2780 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2781 "latestfile/298/scotch_" version ".tar.gz"))
2782 (sha256
2783 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2784 (patches (search-patches "scotch-build-parallelism.patch"
2785 "scotch-integer-declarations.patch"))))
2786 (build-system gnu-build-system)
2787 (inputs
2788 `(("zlib" ,zlib)))
2789 (native-inputs
2790 `(("flex" ,flex)
2791 ("bison" ,bison)))
2792 (outputs '("out" "metis"))
2793 (arguments
2794 `(#:make-flags (list (string-append "prefix=" %output))
2795 #:phases
2796 (modify-phases %standard-phases
2797 (add-after
2798 'unpack 'chdir-to-src
2799 (lambda _ (chdir "src") #t))
2800 (replace
2801 'configure
2802 (lambda _
2803 (call-with-output-file "Makefile.inc"
2804 (lambda (port)
2805 (format port "
2806 EXE =
2807 LIB = .a
2808 OBJ = .o
2809 MAKE = make
2810 AR = ar
2811 ARFLAGS = -ruv
2812 CAT = cat
2813 CCS = gcc
2814 CCP = mpicc
2815 CCD = gcc
2816 CPPFLAGS =~{ -D~a~}
2817 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2818 LDFLAGS = -lz -lm -lrt -lpthread
2819 CP = cp
2820 LEX = flex -Pscotchyy -olex.yy.c
2821 LN = ln
2822 MKDIR = mkdir
2823 MV = mv
2824 RANLIB = ranlib
2825 YACC = bison -pscotchyy -y -b y
2826 "
2827 '("COMMON_FILE_COMPRESS_GZ"
2828 "COMMON_PTHREAD"
2829 "COMMON_RANDOM_FIXED_SEED"
2830 "INTSIZE64" ;use 'int64_t'
2831 ;; Prevents symbolc clashes with libesmumps
2832 "SCOTCH_RENAME"
2833 ;; XXX: Causes invalid frees in superlu-dist tests
2834 ;; "SCOTCH_PTHREAD"
2835 ;; "SCOTCH_PTHREAD_NUMBER=2"
2836 "restrict=__restrict"))))
2837 #t))
2838 (add-after 'build 'build-esmumps
2839 (lambda _
2840 (invoke "make"
2841 (format #f "-j~a" (parallel-job-count))
2842 "esmumps")))
2843 (add-before 'install 'make-install-dirs
2844 (lambda* (#:key outputs #:allow-other-keys)
2845 (mkdir (assoc-ref outputs "out"))))
2846 (add-after 'install 'install-metis
2847 (lambda* (#:key outputs #:allow-other-keys)
2848 (let ((out (assoc-ref outputs "metis")))
2849 (mkdir out)
2850 ;; metis files are not installed with 'make install'
2851 (for-each (lambda (f)
2852 (install-file f (string-append out "/include")))
2853 (find-files "../include/" ".*metis\\.h"))
2854 (for-each (lambda (f)
2855 (install-file f (string-append out "/lib")))
2856 (find-files "../lib/" ".*metis\\..*"))
2857 #t))))))
2858 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
2859 (synopsis "Programs and libraries for graph algorithms")
2860 (description "SCOTCH is a set of programs and libraries which implement
2861 the static mapping and sparse matrix reordering algorithms developed within
2862 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2863 conquer approach, to scientific computing problems such as graph and mesh
2864 partitioning, static mapping, and sparse matrix ordering, in application
2865 domains ranging from structural mechanics to operating systems or
2866 bio-chemistry.")
2867 ;; See LICENSE_en.txt
2868 (license license:cecill-c)))
2869
2870 (define-public scotch32
2871 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2872 ;; some applications.
2873 (package (inherit scotch)
2874 (name "scotch32")
2875 (arguments
2876 (substitute-keyword-arguments (package-arguments scotch)
2877 ((#:phases scotch-phases)
2878 `(modify-phases ,scotch-phases
2879 (replace
2880 'configure
2881 (lambda _
2882 (call-with-output-file "Makefile.inc"
2883 (lambda (port)
2884 (format port "
2885 EXE =
2886 LIB = .a
2887 OBJ = .o
2888 MAKE = make
2889 AR = ar
2890 ARFLAGS = -ruv
2891 CAT = cat
2892 CCS = gcc
2893 CCP = mpicc
2894 CCD = gcc
2895 CPPFLAGS =~{ -D~a~}
2896 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2897 LDFLAGS = -lz -lm -lrt -lpthread
2898 CP = cp
2899 LEX = flex -Pscotchyy -olex.yy.c
2900 LN = ln
2901 MKDIR = mkdir
2902 MV = mv
2903 RANLIB = ranlib
2904 YACC = bison -pscotchyy -y -b y
2905 "
2906 '("COMMON_FILE_COMPRESS_GZ"
2907 "COMMON_PTHREAD"
2908 "COMMON_RANDOM_FIXED_SEED"
2909 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2910 ;; Prevents symbolc clashes with libesmumps
2911 "SCOTCH_RENAME"
2912 ;; XXX: Causes invalid frees in superlu-dist tests
2913 ;; "SCOTCH_PTHREAD"
2914 ;; "SCOTCH_PTHREAD_NUMBER=2"
2915 "restrict=__restrict"))))))))))
2916 (synopsis
2917 "Programs and libraries for graph algorithms (32-bit integers)")))
2918
2919 (define-public pt-scotch
2920 (package (inherit scotch)
2921 (name "pt-scotch")
2922 (propagated-inputs
2923 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2924 (arguments
2925 (substitute-keyword-arguments (package-arguments scotch)
2926 ((#:phases scotch-phases)
2927 `(modify-phases ,scotch-phases
2928 (replace
2929 'build
2930 (lambda _
2931 (invoke "make" (format #f "-j~a" (parallel-job-count))
2932 "ptscotch" "ptesmumps")
2933
2934 ;; Install the serial metis compatibility library
2935 (invoke "make" "-C" "libscotchmetis" "install")))
2936 (add-before 'check 'mpi-setup
2937 ,%openmpi-setup)
2938 (replace 'check
2939 (lambda _
2940 (invoke "make" "ptcheck")))))))
2941 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2942
2943 (define-public pt-scotch32
2944 (package (inherit scotch32)
2945 (name "pt-scotch32")
2946 (propagated-inputs
2947 `(("openmpi" ,openmpi))) ;headers include MPI headers
2948 (arguments
2949 (substitute-keyword-arguments (package-arguments scotch32)
2950 ((#:phases scotch32-phases)
2951 `(modify-phases ,scotch32-phases
2952 (replace 'build
2953 (lambda _
2954 (invoke "make" (format #f "-j~a" (parallel-job-count))
2955 "ptscotch" "ptesmumps")
2956 ;; Install the serial metis compatibility library
2957 (invoke "make" "-C" "libscotchmetis" "install")))
2958 (add-before 'check 'mpi-setup
2959 ,%openmpi-setup)
2960 (replace 'check
2961 (lambda _
2962 (invoke "make" "ptcheck")))))))
2963 (synopsis
2964 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2965
2966 (define-public metis
2967 (package
2968 (name "metis")
2969 (version "5.1.0")
2970 (source
2971 (origin
2972 (method url-fetch)
2973 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2974 "metis-" version ".tar.gz"))
2975 (sha256
2976 (base32
2977 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2978 (build-system cmake-build-system)
2979 (inputs
2980 `(("blas" ,openblas)))
2981 (arguments
2982 `(#:tests? #f ;no tests
2983 #:configure-flags `("-DSHARED=ON"
2984 ,(string-append "-DGKLIB_PATH=" (getcwd)
2985 "/metis-" ,version "/GKlib"))))
2986 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2987 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2988 (description
2989 "METIS is a set of serial programs for partitioning graphs, partitioning
2990 finite element meshes, and producing fill-reducing orderings for sparse
2991 matrices. The algorithms implemented in METIS are based on the multilevel
2992 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2993 schemes.")
2994 (license license:asl2.0))) ;As of version 5.0.3
2995
2996 (define-public p4est
2997 (package
2998 (name "p4est")
2999 (version "2.0")
3000 (source
3001 (origin
3002 (method url-fetch)
3003 (uri (string-append "http://p4est.github.io/release/p4est-"
3004 version ".tar.gz"))
3005 (sha256
3006 (base32
3007 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
3008 (build-system gnu-build-system)
3009 (inputs
3010 `(("fortran" ,gfortran)
3011 ("blas" ,openblas)
3012 ("lapack" ,lapack)
3013 ("zlib" ,zlib)))
3014 (arguments
3015 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3016 (assoc-ref %build-inputs "blas")
3017 " -lopenblas")
3018 ,(string-append "LAPACK_LIBS=-L"
3019 (assoc-ref %build-inputs "lapack")
3020 " -llapack"))
3021 #:phases (modify-phases %standard-phases
3022 (add-before 'check 'mpi-setup
3023 ,%openmpi-setup))))
3024 (home-page "http://www.p4est.org")
3025 (synopsis "Adaptive mesh refinement on forests of octrees")
3026 (description
3027 "The p4est software library enables the dynamic management of a
3028 collection of adaptive octrees, conveniently called a forest of octrees.
3029 p4est is designed to work in parallel and scales to hundreds of thousands of
3030 processor cores.")
3031 (license license:gpl2+)))
3032
3033 (define-public p4est-openmpi
3034 (package (inherit p4est)
3035 (name "p4est-openmpi")
3036 (inputs
3037 `(("mpi" ,openmpi)
3038 ,@(package-inputs p4est)))
3039 (arguments
3040 (substitute-keyword-arguments (package-arguments p4est)
3041 ((#:configure-flags cf)
3042 ``("--enable-mpi" ,@,cf))))
3043 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3044
3045 (define-public gsegrafix
3046 (package
3047 (name "gsegrafix")
3048 (version "1.0.6")
3049 (source
3050 (origin
3051 (method url-fetch)
3052 (uri (string-append "mirror://gnu/" name "/" name "-"
3053 version ".tar.gz"))
3054 (sha256
3055 (base32
3056 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3057 (build-system gnu-build-system)
3058 (arguments
3059 `(#:configure-flags '("LDFLAGS=-lm")))
3060 (inputs
3061 `(("libgnomecanvas" ,libgnomecanvas)
3062 ("libbonoboui" ,libbonoboui)
3063 ("libgnomeui" ,libgnomeui)
3064 ("libgnomeprintui" ,libgnomeprintui)
3065 ("popt" ,popt)))
3066 (native-inputs
3067 `(("pkg-config" ,pkg-config)))
3068 (home-page "https://www.gnu.org/software/gsegrafix/")
3069 (synopsis "GNOME application to create scientific and engineering plots")
3070 (description "GSEGrafix is an application which produces high-quality graphical
3071 plots for science and engineering. Plots are specified via simple ASCII
3072 parameter files and data files and are presented in an anti-aliased GNOME
3073 canvas. The program supports rectangular two-dimensional plots, histograms,
3074 polar-axis plots and three-dimensional plots. Plots can be printed or saved
3075 to BMP, JPEG or PNG image formats.")
3076 (license license:gpl3+)))
3077
3078 (define-public maxima
3079 (package
3080 (name "maxima")
3081 (version "5.43.0")
3082 (source
3083 (origin
3084 (method url-fetch)
3085 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3086 version "-source/" name "-" version ".tar.gz"))
3087 (sha256
3088 (base32
3089 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
3090 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
3091 (build-system gnu-build-system)
3092 (inputs
3093 `(("gcl" ,gcl)
3094 ("gnuplot" ,gnuplot) ;for plots
3095 ("sed" ,sed)
3096 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
3097 (native-inputs
3098 `(("texinfo" ,texinfo)
3099 ("perl" ,perl)
3100 ("python" ,python)))
3101 (arguments
3102 `(#:configure-flags
3103 (list "--enable-gcl"
3104 (string-append "--with-posix-shell="
3105 (assoc-ref %build-inputs "bash")
3106 "/bin/sh")
3107 (string-append "--with-wish="
3108 (assoc-ref %build-inputs "tk")
3109 "/bin/wish"
3110 (let ((v ,(package-version tk)))
3111 (string-take v (string-index-right v #\.)))))
3112 ;; By default Maxima attempts to write temporary files to
3113 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3114 ;; Work around that.
3115 #:make-flags (list "TMPDIR=/tmp")
3116 #:phases
3117 (modify-phases %standard-phases
3118 (add-after 'unpack 'patch-paths
3119 (lambda* (#:key inputs #:allow-other-keys)
3120 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3121 (coreutils (assoc-ref inputs "coreutils"))
3122 (dirname (string-append coreutils "/bin/dirname"))
3123 (head (string-append coreutils "/bin/head"))
3124 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3125 (python (string-append (assoc-ref inputs "python")
3126 "/bin/python3")))
3127 (substitute* "src/maxima.in"
3128 (("sed ") (string-append sed " "))
3129 (("dirname") dirname)
3130 (("head") head))
3131 (substitute* "doc/info/Makefile.in"
3132 (("/usr/bin/env perl") perl))
3133 (substitute* "doc/info/build_html.sh.in"
3134 (("python") python))
3135 #t)))
3136 (add-before 'check 'pre-check
3137 (lambda _
3138 (chmod "src/maxima" #o555)
3139 #t))
3140 (replace 'check
3141 (lambda _
3142 ;; This is derived from the testing code in the "debian/rules" file
3143 ;; of Debian's Maxima package.
3144 ;; If Maxima can successfully run this, the binary to be installed
3145 ;; should be fine.
3146 (invoke "sh" "-c"
3147 (string-append
3148 "./maxima-local "
3149 "--lisp=gcl "
3150 "--batch-string=\"run_testsuite();\" "
3151 "| grep -q \"No unexpected errors found\""))))
3152 ;; Make sure the doc and emacs files are found in the
3153 ;; standard location. Also configure maxima to find gnuplot
3154 ;; without having it on the PATH.
3155 (add-after 'install 'post-install
3156 (lambda* (#:key outputs inputs #:allow-other-keys)
3157 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3158 (out (assoc-ref outputs "out"))
3159 (datadir (string-append out "/share/maxima/" ,version))
3160 (binutils (string-append (assoc-ref inputs "binutils")
3161 "/bin")))
3162 (with-directory-excursion out
3163 (mkdir-p "share/emacs")
3164 (mkdir-p "share/doc")
3165 (symlink
3166 (string-append datadir "/doc/")
3167 (string-append out "/share/doc/maxima"))
3168 (with-atomic-file-replacement
3169 (string-append datadir "/share/maxima-init.lisp")
3170 (lambda (in out)
3171 (format out "~a ~s~a~%"
3172 "(setf $gnuplot_command "
3173 (string-append gnuplot "/bin/gnuplot") ")")
3174 (dump-port in out))))
3175 ;; Ensure that Maxima will have access to the GNU binutils
3176 ;; components at runtime.
3177 (wrap-program (string-append out "/bin/maxima")
3178 `("PATH" prefix (,binutils))))
3179 #t)))))
3180 (home-page "http://maxima.sourceforge.net")
3181 (synopsis "Numeric and symbolic expression manipulation")
3182 (description "Maxima is a system for the manipulation of symbolic and
3183 numerical expressions. It yields high precision numeric results by using
3184 exact fractions, arbitrary precision integers, and variable precision floating
3185 point numbers.")
3186 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3187 ;; Others simply say "GNU General Public License" without stating a
3188 ;; version (which implicitly means gpl1+).
3189 ;; At least one file (src/maxima.asd) says "version 2."
3190 ;; GPLv2 only is therefore the smallest subset.
3191 (license license:gpl2)))
3192
3193 (define-public wxmaxima
3194 (package
3195 (name "wxmaxima")
3196 (version "20.04.0")
3197 (source
3198 (origin
3199 (method git-fetch)
3200 (uri (git-reference
3201 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
3202 (commit (string-append "Version-" version))))
3203 (file-name (git-file-name name version))
3204 (sha256
3205 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
3206 (build-system cmake-build-system)
3207 (native-inputs
3208 `(("gettext" ,gettext-minimal)
3209 ("xorg-server" ,xorg-server-for-tests)))
3210 ;; TODO: Add libomp for multithreading support.
3211 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
3212 (inputs
3213 `(("wxwidgets" ,wxwidgets)
3214 ("maxima" ,maxima)
3215 ;; Runtime support.
3216 ("adwaita-icon-theme" ,adwaita-icon-theme)
3217 ("gtk+" ,gtk+)
3218 ("shared-mime-info" ,shared-mime-info)))
3219 (arguments
3220 `(#:test-target "test"
3221 #:phases
3222 (modify-phases %standard-phases
3223 (add-before 'check 'pre-check
3224 (lambda _
3225 ;; Tests require a running X server.
3226 (system "Xvfb :1 &")
3227 (setenv "DISPLAY" ":1")
3228 (setenv "HOME" (getcwd))
3229 #t))
3230 (add-after 'install 'wrap-program
3231 (lambda* (#:key inputs outputs #:allow-other-keys)
3232 (wrap-program (string-append (assoc-ref outputs "out")
3233 "/bin/wxmaxima")
3234 `("PATH" ":" prefix
3235 (,(string-append (assoc-ref inputs "maxima")
3236 "/bin")))
3237 ;; For GtkFileChooserDialog.
3238 `("GSETTINGS_SCHEMA_DIR" =
3239 (,(string-append (assoc-ref inputs "gtk+")
3240 "/share/glib-2.0/schemas")))
3241 `("XDG_DATA_DIRS" ":" prefix
3242 (;; Needed by gdk-pixbuf to know supported icon formats.
3243 ,(string-append
3244 (assoc-ref inputs "shared-mime-info") "/share")
3245 ;; The default icon theme of GTK+.
3246 ,(string-append
3247 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3248 #t)))))
3249 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
3250 (synopsis "Graphical user interface for the Maxima computer algebra system")
3251 (description
3252 "wxMaxima is a graphical user interface for the Maxima computer algebra
3253 system. It eases the use of Maxima by making most of its commands available
3254 through a menu system and by providing input dialogs for commands that require
3255 more than one argument. It also implements its own display engine that
3256 outputs mathematical symbols directly instead of depicting them with ASCII
3257 characters.
3258
3259 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3260 text and mathematical calculations to create documents, exporting of input and
3261 output to TeX, and a browser for Maxima's manual including command index and
3262 full text searching.")
3263 (license license:gpl2+)))
3264
3265 (define-public armadillo
3266 (package
3267 (name "armadillo")
3268 (version "9.100.5")
3269 (source (origin
3270 (method url-fetch)
3271 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3272 version ".tar.xz"))
3273 (sha256
3274 (base32
3275 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3276 (build-system cmake-build-system)
3277 (arguments `(#:tests? #f)) ; no test target
3278 (inputs
3279 `(("openblas" ,openblas)
3280 ("lapack" ,lapack)
3281 ("arpack" ,arpack-ng)))
3282 (home-page "http://arma.sourceforge.net/")
3283 (synopsis "C++ linear algebra library")
3284 (description
3285 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3286 between speed and ease of use. It is useful for algorithm development
3287 directly in C++, or quick conversion of research code into production
3288 environments. It can be used for machine learning, pattern recognition,
3289 signal processing, bioinformatics, statistics, econometrics, etc. The library
3290 provides efficient classes for vectors, matrices and cubes, as well as 150+
3291 associated functions (e.g., contiguous and non-contiguous submatrix views).")
3292 (license license:asl2.0)))
3293
3294 (define-public muparser
3295 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3296 ;; different hash. In order to make `guix package --upgrade` work correctly,
3297 ;; we set a Guix packaging revision.
3298 ;; When the next version of muparser is released, we can remove
3299 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3300 (let ((upstream-version "2.2.5")
3301 (revision "2"))
3302 (package
3303 (name "muparser")
3304 (version (string-append upstream-version "-" revision))
3305 (source
3306 (origin
3307 (method git-fetch)
3308 (uri (git-reference
3309 (url "https://github.com/beltoforion/muparser.git")
3310 (commit (string-append "v" upstream-version))))
3311 (file-name (git-file-name name version))
3312 (sha256
3313 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3314 (build-system gnu-build-system)
3315 (arguments
3316 `(#:configure-flags '("--enable-samples=no")
3317 #:tests? #f)) ;no "check" target
3318 (home-page "http://muparser.beltoforion.de/")
3319 (synopsis "Fast parser library for mathematical expressions")
3320 (description
3321 "muParser is an extensible high performance math parser library. It is
3322 based on transforming an expression into a bytecode and precalculating constant
3323 parts of it.")
3324 (license license:expat))))
3325
3326 (define-public openblas
3327 (package
3328 (name "openblas")
3329 (version "0.3.9")
3330 (source
3331 (origin
3332 (method url-fetch)
3333 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3334 version "%20version.tar.gz"))
3335 (file-name (string-append name "-" version ".tar.gz"))
3336 (sha256
3337 (base32
3338 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
3339 (build-system gnu-build-system)
3340 (arguments
3341 `(#:test-target "test"
3342 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3343 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3344 ;; we need to disable substitutions.
3345 #:substitutable?
3346 ,(let ((system (or (%current-target-system) (%current-system))))
3347 (or (string-prefix? "x86_64" system)
3348 (string-prefix? "i686" system)
3349 (string-prefix? "mips" system)
3350 (string-prefix? "aarch64" system)))
3351 #:make-flags
3352 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3353 "SHELL=bash"
3354 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3355
3356 ;; This is the maximum number of threads OpenBLAS will ever use (that
3357 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3358 ;; is used.) If we don't set it, the makefile sets it to the number
3359 ;; of cores of the build machine, which is obviously wrong.
3360 "NUM_THREADS=128"
3361
3362 ;; Build the library for all supported CPUs. This allows
3363 ;; switching CPU targets at runtime with the environment variable
3364 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3365 ;; Unfortunately, this is not supported on non-x86 architectures,
3366 ;; where it leads to failed builds.
3367 ,@(let ((system (or (%current-target-system) (%current-system))))
3368 (cond
3369 ((or (string-prefix? "x86_64" system)
3370 (string-prefix? "i686" system))
3371 '("DYNAMIC_ARCH=1"))
3372 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3373 ;; two available MIPS targets special extended instructions
3374 ;; for Loongson cores are used.
3375 ((string-prefix? "mips" system)
3376 '("TARGET=SICORTEX"))
3377 ;; On aarch64 force the generic 'armv8-a' target
3378 ((string-prefix? "aarch64" system)
3379 '("TARGET=ARMV8"))
3380 (else '()))))
3381 ;; no configure script
3382 #:phases
3383 (modify-phases %standard-phases
3384 (delete 'configure)
3385 (add-before 'build 'set-extralib
3386 (lambda* (#:key inputs #:allow-other-keys)
3387 ;; Get libgfortran found when building in utest.
3388 (setenv "FEXTRALIB"
3389 (string-append "-L" (assoc-ref inputs "fortran-lib")
3390 "/lib"))
3391 #t)))))
3392 (inputs
3393 `(("fortran-lib" ,gfortran "lib")))
3394 (native-inputs
3395 `(("cunit" ,cunit)
3396 ("fortran" ,gfortran)
3397 ("perl" ,perl)))
3398 (home-page "https://www.openblas.net/")
3399 (synopsis "Optimized BLAS library based on GotoBLAS")
3400 (description
3401 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3402 (license license:bsd-3)))
3403
3404 (define-public openblas-ilp64
3405 (package/inherit openblas
3406 (name "openblas-ilp64")
3407 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3408 (arguments
3409 (substitute-keyword-arguments (package-arguments openblas)
3410 ((#:make-flags flags '())
3411 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3412 ,flags))))
3413 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3414 (license license:bsd-3)))
3415
3416 (define* (make-blis implementation #:optional substitutable?)
3417 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3418 source tree for a list of implementations.)
3419
3420 SUBSTITUTABLE? determines whether the package is made available as a
3421 substitute.
3422
3423 Currently the specialization must be selected at configure-time, but work is
3424 underway to allow BLIS to select the right optimized kernels at run time:
3425 <https://github.com/flame/blis/issues/129>."
3426 (package
3427 (name (if (string=? implementation "reference")
3428 "blis"
3429 (string-append "blis-" implementation)))
3430 (version "0.2.2")
3431 (home-page "https://github.com/flame/blis")
3432 (source (origin
3433 (method git-fetch)
3434 (uri (git-reference (url home-page) (commit version)))
3435 (sha256
3436 (base32
3437 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3438 (file-name (git-file-name "blis" version))))
3439 (build-system gnu-build-system)
3440 (arguments
3441 `(#:test-target "test"
3442
3443 #:substitutable? ,substitutable?
3444
3445 #:phases (modify-phases %standard-phases
3446 (replace 'configure
3447 (lambda* (#:key outputs #:allow-other-keys)
3448 ;; This is a home-made 'configure' script.
3449 (let ((out (assoc-ref outputs "out")))
3450 (invoke "./configure" "-p" out
3451 "-d" "opt"
3452 "--disable-static"
3453 "--enable-shared"
3454 "--enable-threading=openmp"
3455
3456 ,implementation))))
3457 (add-before 'check 'show-test-output
3458 (lambda _
3459 ;; By default "make check" is silent. Make it verbose.
3460 (system "tail -F output.testsuite &")
3461 #t)))))
3462 (synopsis "High-performance basic linear algebra (BLAS) routines")
3463 (description
3464 "BLIS is a portable software framework for instantiating high-performance
3465 BLAS-like dense linear algebra libraries. The framework was designed to
3466 isolate essential kernels of computation that, when optimized, immediately
3467 enable optimized implementations of most of its commonly used and
3468 computationally intensive operations. While BLIS exports a new BLAS-like API,
3469 it also includes a BLAS compatibility layer which gives application developers
3470 access to BLIS implementations via traditional BLAS routine calls.")
3471 (license license:bsd-3)))
3472
3473 (define-public blis
3474 ;; This is the "reference" implementation, which is the non-optimized but
3475 ;; portable variant (no assembly).
3476 (make-blis "reference" #t))
3477
3478 (define ignorance blis)
3479
3480 (define-syntax-rule (blis/x86_64 processor)
3481 "Expand to a package specialized for PROCESSOR."
3482 (package
3483 (inherit (make-blis processor))
3484 (supported-systems '("x86_64-linux"))))
3485
3486 (define-public blis-sandybridge
3487 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3488 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3489 (blis/x86_64 "sandybridge"))
3490
3491 (define-public blis-haswell
3492 ;; BLIS specialized for Haswell processors (launched 2013):
3493 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3494 (blis/x86_64 "haswell"))
3495
3496 (define-public blis-knl
3497 ;; BLIS specialized for Knights Landing processor (launched 2016):
3498 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3499 (blis/x86_64 "knl"))
3500
3501
3502 (define-public openlibm
3503 (package
3504 (name "openlibm")
3505 (version "0.6.0")
3506 (source
3507 (origin
3508 (method git-fetch)
3509 (uri (git-reference
3510 (url "https://github.com/JuliaLang/openlibm.git")
3511 (commit (string-append "v" version))))
3512 (file-name (git-file-name name version))
3513 (sha256
3514 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3515 (build-system gnu-build-system)
3516 (arguments
3517 `(#:make-flags
3518 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3519 #:phases
3520 ;; no configure script
3521 (modify-phases %standard-phases (delete 'configure))
3522 #:tests? #f)) ;the tests are part of the default target
3523 (home-page "https://openlibm.org/")
3524 (synopsis "Portable C mathematical library (libm)")
3525 (description
3526 "OpenLibm is an effort to have a high quality, portable, standalone C
3527 mathematical library (libm). It can be used standalone in applications and
3528 programming language implementations. The project was born out of a need to
3529 have a good libm for the Julia programming language that worked consistently
3530 across compilers and operating systems, and in 32-bit and 64-bit
3531 environments.")
3532 ;; Each architecture has its own make target, and there is none for mips.
3533 (supported-systems (delete "mips64el-linux" %supported-systems))
3534 ;; See LICENSE.md for details.
3535 (license (list license:expat
3536 license:isc
3537 license:bsd-2
3538 license:public-domain
3539 license:lgpl2.1+))))
3540
3541 (define-public openspecfun
3542 (package
3543 (name "openspecfun")
3544 (version "0.5.3")
3545 (source
3546 (origin
3547 (method git-fetch)
3548 (uri (git-reference
3549 (url "https://github.com/JuliaLang/openspecfun.git")
3550 (commit (string-append "v" version))))
3551 (file-name (git-file-name name version))
3552 (sha256
3553 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3554 (build-system gnu-build-system)
3555 (arguments
3556 '(#:tests? #f ; no "check" target
3557 #:make-flags
3558 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3559 #:phases
3560 (modify-phases %standard-phases
3561 (delete 'configure)))) ; no configure script
3562 (inputs
3563 `(("fortran" ,gfortran)))
3564 (home-page "https://github.com/JuliaLang/openspecfun")
3565 (synopsis "Collection of special mathematical functions")
3566 (description
3567 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3568 portable package for Bessel Functions of a Complex Argument and Nonnegative
3569 Order; it contains subroutines for computing Bessel functions and Airy
3570 functions. Faddeeva allows computing the various error functions of arbitrary
3571 complex arguments (Faddeeva function, error function, complementary error
3572 function, scaled complementary error function, imaginary error function, and
3573 Dawson function); given these, one can also easily compute Voigt functions,
3574 Fresnel integrals, and similar related functions as well.")
3575 ;; Faddeeva is released under the Expat license; AMOS is included as
3576 ;; public domain software.
3577 (license (list license:expat license:public-domain))))
3578
3579 (define-public suitesparse
3580 (package
3581 (name "suitesparse")
3582 (version "5.7.1")
3583 (source
3584 (origin
3585 (method git-fetch)
3586 (uri (git-reference
3587 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse.git")
3588 (commit (string-append "v" version))))
3589 (file-name (git-file-name name version))
3590 (sha256
3591 (base32
3592 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3593 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
3594 (modules '((guix build utils)))
3595 (snippet
3596 ;; Remove bundled metis source
3597 '(begin
3598 (delete-file-recursively "metis-5.1.0")
3599 #t))))
3600 (build-system gnu-build-system)
3601 (arguments
3602 '(#:tests? #f ;no "check" target
3603 #:make-flags
3604 (list "CC=gcc"
3605 "BLAS=-lblas"
3606 "TBB=-ltbb"
3607 "MY_METIS_LIB=-lmetis"
3608 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3609 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3610 (assoc-ref %outputs "out")
3611 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3612 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3613 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3614 " -DCMAKE_SKIP_RPATH=TRUE"
3615 " -DCMAKE_BUILD_TYPE=Release")
3616 (string-append "INSTALL_LIB="
3617 (assoc-ref %outputs "out") "/lib")
3618 (string-append "INSTALL_INCLUDE="
3619 (assoc-ref %outputs "out") "/include")
3620 "library")
3621 #:phases
3622 (modify-phases %standard-phases
3623 (delete 'configure)))) ;no configure script
3624 (inputs
3625 `(("tbb" ,tbb)
3626 ("lapack" ,lapack)
3627 ("metis" ,metis)))
3628 (native-inputs
3629 `(("cmake" ,cmake-minimal)
3630 ("m4" ,m4)))
3631 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3632 (synopsis "Suite of sparse matrix software")
3633 (description
3634 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3635 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3636 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3637 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3638 CXSparse, a concise sparse Cholesky factorization package; and many other
3639 packages.")
3640 ;; LGPLv2.1+:
3641 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3642 ;; GPLv2+:
3643 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3644 (license (list license:gpl2+ license:lgpl2.1+))))
3645
3646 (define-public atlas
3647 (package
3648 (name "atlas")
3649 (version "3.10.3")
3650 (source (origin
3651 (method url-fetch)
3652 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3653 version "/atlas" version ".tar.bz2"))
3654 (sha256
3655 (base32
3656 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3657 (build-system gnu-build-system)
3658 (home-page "http://math-atlas.sourceforge.net/")
3659 (inputs `(("gfortran" ,gfortran)
3660 ("lapack-tar" ,(package-source lapack))))
3661 (outputs '("out" "doc"))
3662 ;; For the moment we drop support for MIPS at it fails to compile. See
3663 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3664 (supported-systems (delete "mips64el-linux" %supported-systems))
3665 (arguments
3666 `(#:parallel-build? #f
3667 #:parallel-tests? #f
3668
3669 ;; ATLAS tunes itself for the machine it is built on, as explained at
3670 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3671 ;; For this reason, we want users to build it locally instead of using
3672 ;; substitutes.
3673 #:substitutable? #f
3674
3675 #:modules ((srfi srfi-26)
3676 (guix build gnu-build-system)
3677 (guix build utils))
3678 #:configure-flags
3679 `(;; Generate position independent code suitable for dynamic libraries
3680 ;; and use WALL timer to get more accurate timing.
3681 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3682 ;; Set word width.
3683 "-b"
3684 ,,(if (string-match "64" (%current-system))
3685 "64"
3686 "32")
3687 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3688 ;; needed to compile C files before it is generated.
3689 "-Ss" "pmake" "make -j 1"
3690 ;; Probe is failing for MIPS. We therefore define the system
3691 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3692 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3693 ,,@(if (string-prefix? "mips" (%current-system))
3694 (list "-A" "49" "-V" "1")
3695 (list))
3696 ;; Generate shared libraries.
3697 "--shared"
3698 ;; Build a full LAPACK library.
3699 ,(string-append "--with-netlib-lapack-tarfile="
3700 (assoc-ref %build-inputs "lapack-tar")))
3701 #:phases
3702 (modify-phases %standard-phases
3703 (add-after 'install 'install-doc
3704 (lambda* (#:key outputs inputs #:allow-other-keys)
3705 (let ((doc (string-append (assoc-ref outputs "doc")
3706 "/share/doc/atlas")))
3707 (mkdir-p doc)
3708 (for-each (cut install-file <> doc)
3709 (find-files "../ATLAS/doc" ".*"))
3710 #t)))
3711 (add-after 'check 'check-pt
3712 (lambda _ (invoke "make" "ptcheck")))
3713 ;; Fix files required to run configure.
3714 (add-before 'configure 'fix-/bin/sh
3715 (lambda _
3716 ;; Use `sh', not `/bin/sh'.
3717 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3718 (("/bin/sh")
3719 "sh"))
3720 #t))
3721 ;; Fix /bin/sh in generated make files.
3722 (add-after 'configure 'fix-/bin/sh-in-generated-files
3723 (lambda _
3724 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3725 (("/bin/sh")
3726 "sh"))
3727 #t))
3728 ;; ATLAS configure program does not accepts the default flags
3729 ;; passed by the 'gnu-build-system'.
3730 (replace 'configure
3731 (lambda* (#:key native-inputs inputs outputs
3732 (configure-flags '())
3733 #:allow-other-keys #:rest args)
3734 (let* ((prefix (assoc-ref outputs "out"))
3735 (bash (or (and=> (assoc-ref
3736 (or native-inputs inputs) "bash")
3737 (cut string-append <> "/bin/bash"))
3738 "/bin/sh"))
3739 (flags `(,(string-append "--prefix=" prefix)
3740 ,@configure-flags))
3741 (abs-srcdir (getcwd))
3742 (srcdir (string-append "../" (basename abs-srcdir))))
3743 (format #t "source directory: ~s (relative from build: ~s)~%"
3744 abs-srcdir srcdir)
3745 (mkdir "../build")
3746 (chdir "../build")
3747 (format #t "build directory: ~s~%" (getcwd))
3748 (format #t "configure flags: ~s~%" flags)
3749 (apply invoke bash
3750 (string-append srcdir "/configure")
3751 flags)))))))
3752 (synopsis "Automatically Tuned Linear Algebra Software")
3753 (description
3754 "ATLAS is an automatically tuned linear algebra software library
3755 providing C and Fortran77 interfaces to a portably efficient BLAS
3756 implementation, as well as a few routines from LAPACK.
3757
3758 Optimization occurs at build time. For this reason, the library is built on
3759 the machine where it is installed, without resorting to pre-built substitutes.
3760
3761 Before building the library, CPU throttling should be disabled. This can be
3762 done in the BIOS, or, on GNU/Linux, with the following command:
3763
3764 @example
3765 # cpupower --governor performance
3766 @end example
3767
3768 Failure to do so will result in a library with poor performance.")
3769 (license license:bsd-3)))
3770
3771 (define-public glm
3772 (package
3773 (name "glm")
3774 (version "0.9.9.8")
3775 (source
3776 (origin
3777 (method url-fetch)
3778 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3779 version "/glm-" version ".zip"))
3780 (sha256
3781 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
3782 (build-system cmake-build-system)
3783 (arguments
3784 `(#:phases (modify-phases %standard-phases
3785 (replace 'install
3786 (lambda* (#:key outputs #:allow-other-keys)
3787 ;; Since version 0.9.9.6, 'make install' is not supported
3788 ;; and we have to do it "manually". Upstream discussion:
3789 ;; <https://github.com/g-truc/glm/pull/968>.
3790 (let* ((source (string-append "../glm"))
3791 (out (assoc-ref outputs "out"))
3792 (inc (string-append out "/include"))
3793 (lib (string-append out "/lib"))
3794 (pkgconfig (string-append lib "/pkgconfig")))
3795 (with-directory-excursion source
3796 (mkdir-p inc)
3797 (mkdir-p pkgconfig)
3798 (copy-recursively "glm" (string-append inc "/glm"))
3799 (copy-recursively "cmake" (string-append lib "/cmake"))
3800 (call-with-output-file (string-append pkgconfig "/glm.pc")
3801 (lambda (port)
3802 (format port
3803 "prefix=~a
3804 includedir=${prefix}/include
3805
3806 Name: GLM
3807 Description: OpenGL Mathematics
3808 Version: ~a
3809 Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3810 #t))))))
3811 (native-inputs
3812 `(("unzip" ,unzip)))
3813 (home-page "https://glm.g-truc.net/")
3814 (synopsis "OpenGL Mathematics library")
3815 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3816 library for graphics software based on the OpenGL Shading Language (GLSL)
3817 specifications.")
3818 (license license:expat)))
3819
3820 (define-public lpsolve
3821 (package
3822 (name "lpsolve")
3823 (version "5.5.2.5")
3824 (source
3825 (origin
3826 (method url-fetch)
3827 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3828 "/lp_solve_" version "_source.tar.gz"))
3829 (sha256
3830 (base32
3831 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3832 (modules '((guix build utils)))
3833 (snippet
3834 '(begin
3835 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3836 (("^c=cc") "c=gcc")
3837 ;; Pretend to be on a 64 bit platform to obtain a common directory
3838 ;; name for the build results on all architectures; nothing else
3839 ;; seems to depend on it.
3840 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3841
3842 ;; The check for 'isnan' as it is written fails with
3843 ;; "non-floating-point argument in call to function
3844 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3845 ;; definition, which in turn leads to bad things. Fix the feature
3846 ;; test.
3847 (("isnan\\(0\\)") "isnan(0.)"))
3848 #t))))
3849 (build-system gnu-build-system)
3850 (arguments
3851 `(#:tests? #f ; no check target
3852 #:phases
3853 (modify-phases %standard-phases
3854 (delete 'configure) ; no configure script
3855 (replace 'build
3856 (lambda _
3857 (with-directory-excursion "lpsolve55"
3858 (invoke "bash" "ccc"))
3859 (with-directory-excursion "lp_solve"
3860 (invoke "bash" "ccc"))
3861 #t))
3862 (replace 'install
3863 (lambda* (#:key outputs #:allow-other-keys)
3864 (let* ((out (assoc-ref outputs "out"))
3865 (bin (string-append out "/bin"))
3866 (lib (string-append out "/lib"))
3867 ;; This is where LibreOffice expects to find the header
3868 ;; files, and where they are installed by Debian.
3869 (include (string-append out "/include/lpsolve")))
3870 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3871 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3872 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3873
3874 ;; Install a subset of the header files as on Debian
3875 ;; (plus lp_bit.h, which matches the regular expression).
3876 (for-each (lambda (name)
3877 (install-file name include))
3878 (find-files "." "lp_[HMSa-z].*\\.h$"))
3879 (with-directory-excursion "shared"
3880 (for-each (lambda (name)
3881 (install-file name include))
3882 (find-files "." "\\.h$")))
3883 #t))))))
3884 (home-page "http://lpsolve.sourceforge.net/")
3885 (synopsis "Mixed integer linear programming (MILP) solver")
3886 (description
3887 "lp_solve is a mixed integer linear programming solver based on the
3888 revised simplex and the branch-and-bound methods.")
3889 (license license:lgpl2.1+)))
3890
3891 (define-public dealii
3892 (package
3893 (name "dealii")
3894 (version "9.1.1")
3895 (source
3896 (origin
3897 (method url-fetch)
3898 (uri (string-append "https://github.com/dealii/dealii/releases/"
3899 "download/v" version "/dealii-" version ".tar.gz"))
3900 (sha256
3901 (base32
3902 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3903 (modules '((guix build utils)))
3904 (snippet
3905 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3906 '(begin
3907 (delete-file-recursively "bundled")
3908 #t))))
3909 (build-system cmake-build-system)
3910 (inputs
3911 `(("tbb" ,tbb)
3912 ("zlib" ,zlib)
3913 ("boost" ,boost)
3914 ("p4est" ,p4est)
3915 ("blas" ,openblas)
3916 ("lapack" ,lapack)
3917 ("arpack" ,arpack-ng)
3918 ("muparser" ,muparser)
3919 ("gfortran" ,gfortran)
3920 ("suitesparse" ,suitesparse))) ;for UMFPACK
3921 (arguments
3922 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3923 #:configure-flags
3924 ;; Work around a bug in libsuitesparseconfig linking
3925 ;; see https://github.com/dealii/dealii/issues/4745
3926 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3927 (home-page "https://www.dealii.org")
3928 (synopsis "Finite element library")
3929 (description
3930 "Deal.II is a C++ program library targeted at the computational solution
3931 of partial differential equations using adaptive finite elements. The main
3932 aim of deal.II is to enable rapid development of modern finite element codes,
3933 using among other aspects adaptive meshes and a wide array of tools often used
3934 in finite element programs.")
3935 (license license:lgpl2.1+)))
3936
3937 (define-public dealii-openmpi
3938 (package (inherit dealii)
3939 (name "dealii-openmpi")
3940 (inputs
3941 `(("mpi" ,openmpi)
3942 ;;Supported only with MPI:
3943 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3944 ("p4est" ,p4est-openmpi)
3945 ("petsc" ,petsc-openmpi)
3946 ("slepc" ,slepc-openmpi)
3947 ("metis" ,metis) ;for MUMPS
3948 ("scalapack" ,scalapack) ;for MUMPS
3949 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3950 ("arpack" ,arpack-ng-openmpi)
3951 ,@(fold alist-delete (package-inputs dealii)
3952 '("p4est" "arpack"))))
3953 (arguments
3954 (substitute-keyword-arguments (package-arguments dealii)
3955 ((#:configure-flags cf)
3956 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3957 ,cf))
3958 ((#:phases phases '%standard-phases)
3959 `(modify-phases ,phases
3960 (add-before 'check 'mpi-setup
3961 ,%openmpi-setup)))))
3962 (synopsis "Finite element library (with MPI support)")))
3963
3964 (define-public flann
3965 (package
3966 (name "flann")
3967 (version "1.9.1")
3968 (home-page "https://github.com/mariusmuja/flann/")
3969 (source
3970 (origin
3971 (method git-fetch)
3972 (uri (git-reference (url home-page) (commit version)))
3973 (file-name (git-file-name name version))
3974 (sha256
3975 (base32
3976 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
3977 (patches (search-patches "flann-cmake-3.11.patch"))))
3978 (build-system cmake-build-system)
3979 (outputs '("out"))
3980 (native-inputs
3981 `(("unzip" ,unzip)))
3982 (inputs
3983 `(("hdf5" ,hdf5)
3984 ;; FIXME: 'mkoctfile' fails with a linker error:
3985 ;; ld: cannot find -loctinterp
3986 ;; ld: cannot find -loctave
3987 ;; Disable it for now.
3988 ;;("octave" ,octave-cli)
3989 ("python" ,python-2) ; print syntax
3990 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3991 ("zlib" ,zlib)))
3992 (arguments
3993 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3994 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3995 #:strip-directories '("lib" "lib64" "libexec"
3996 "bin" "sbin" "share/flann/octave")
3997
3998 ;; Save 12 MiB by not installing .a files. Passing
3999 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4000 #:phases (modify-phases %standard-phases
4001 (add-after 'install 'remove-static-libraries
4002 (lambda* (#:key outputs #:allow-other-keys)
4003 (let* ((out (assoc-ref outputs "out"))
4004 (lib (string-append out "/lib")))
4005 (for-each delete-file
4006 (find-files lib "\\.a$"))
4007 #t))))
4008
4009 #:tests? #f)) ; The test data are downloaded from the Internet.
4010 (synopsis "Library for approximate nearest neighbors computation")
4011 (description "FLANN is a library for performing fast approximate
4012 nearest neighbor searches in high dimensional spaces. It implements a
4013 collection of algorithms and a system for automatically choosing the best
4014 algorithm and optimum parameters depending on the dataset.
4015
4016 FLANN is written in C++ and contains bindings for C, Octave and Python.")
4017 (license (license:non-copyleft "file://COPYING"
4018 "See COPYING in the distribution."))))
4019
4020 (define-public wcalc
4021 (package
4022 (name "wcalc")
4023 (version "2.5")
4024 (source
4025 (origin
4026 (method url-fetch)
4027 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4028 "wcalc-" version ".tar.bz2"))
4029 (sha256
4030 (base32
4031 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4032 (build-system gnu-build-system)
4033 (inputs
4034 `(("mpfr" ,mpfr)
4035 ("readline" ,readline)))
4036 (home-page "http://w-calc.sourceforge.net/index.php")
4037 (synopsis "Flexible command-line scientific calculator")
4038 (description "Wcalc is a very capable calculator. It has standard functions
4039 (sin, asin, and sinh for example, in either radians or degrees), many
4040 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4041 variables, a command history, hex/octal/binary input and output, unit
4042 conversions, embedded comments, and an expandable expression entry field. It
4043 evaluates expressions using the standard order of operations.")
4044 (license license:gpl2+)))
4045
4046 (define-public xaos
4047 (package
4048 (name "xaos")
4049 (version "4.0")
4050 (source (origin
4051 (method git-fetch)
4052 (uri (git-reference
4053 (url "https://github.com/xaos-project/XaoS")
4054 (commit (string-append "release-" version))))
4055 (file-name (git-file-name name version))
4056 (sha256
4057 (base32
4058 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
4059 (build-system gnu-build-system)
4060 (native-inputs `(("gettext" ,gettext-minimal)
4061 ("qtbase" ,qtbase)
4062 ("qttools" ,qttools)))
4063 (inputs `(("libx11" ,libx11)
4064 ("zlib" ,zlib)
4065 ("libpng" ,libpng)
4066 ("gsl" ,gsl)))
4067 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4068 ;; not enough for this package to install properly. These phases fix that.
4069 (arguments
4070 `(#:tests? #f ;no "check" target
4071 #:phases
4072 (modify-phases %standard-phases
4073 (add-before 'configure 'make-qt-deterministic
4074 (lambda _
4075 ;; Make Qt deterministic.
4076 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4077 #t))
4078 (replace 'configure
4079 (lambda* (#:key outputs #:allow-other-keys)
4080 (let ((out (assoc-ref outputs "out")))
4081 ;; The DESTDIR is originally set to install the xaos binary to
4082 ;; the "bin" folder inside the build directory. Setting make
4083 ;; flags doesn't seem to change this.
4084 (substitute* "XaoS.pro"
4085 (("DESTDIR.*$")
4086 (string-append "DESTDIR=" out "/bin")))
4087 (substitute* "src/include/config.h"
4088 (("/usr/share/XaoS")
4089 (string-append out "/share/XaoS")))
4090 (invoke "qmake"))))
4091 (add-after 'install 'install-data
4092 (lambda* (#:key outputs #:allow-other-keys)
4093 (let* ((out (assoc-ref outputs "out"))
4094 (share (string-append out "/share")))
4095 (mkdir-p share)
4096 (for-each
4097 (lambda (folder)
4098 (copy-recursively folder
4099 (string-append share "/XaoS/" folder)))
4100 '("catalogs" "examples" "tutorial"))
4101 (install-file "xdg/xaos.png"
4102 (string-append share "/pixmaps"))
4103 (install-file "xdg/xaos.desktop"
4104 (string-append share "/applications")))
4105 #t)))))
4106 (synopsis "Real-time fractal zoomer")
4107 (description "GNU XaoS is a graphical program that generates fractal
4108 patterns and allows you to zoom in and out of them infinitely in a fluid,
4109 continuous manner. It also includes tutorials that help to explain how fractals
4110 are built. It can generate many different fractal types such as the Mandelbrot
4111 set.")
4112 (home-page "https://xaos-project.github.io/")
4113 (license license:gpl2+)))
4114
4115 (define-public hypre
4116 (package
4117 (name "hypre")
4118 (version "2.15.1")
4119 (source
4120 (origin
4121 (method git-fetch)
4122 (uri (git-reference
4123 (url "https://github.com/LLNL/hypre.git")
4124 (commit (string-append "v" version))))
4125 (file-name (git-file-name name version))
4126 (sha256
4127 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
4128 (modules '((guix build utils)))
4129 (snippet
4130 '(begin
4131 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
4132 ;; substitute the release date.
4133 (substitute* "src/utilities/HYPRE_utilities.h"
4134 (("Date Compiled: .*$")
4135 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
4136 #t))))
4137 (build-system gnu-build-system)
4138 (outputs '("out" ; 6.1 MiB of headers and libraries
4139 "doc")) ; 4.8 MiB of documentation
4140 (native-inputs
4141 `(("doc++" ,doc++)
4142 ("netpbm" ,netpbm)
4143 ("perl" ,perl) ; needed to run 'ppmquant' during tests
4144 ("texlive" ,(texlive-union (list texlive-xypic
4145 texlive-cm
4146 texlive-latex-hyperref
4147 texlive-bibtex)))
4148 ("ghostscript" ,ghostscript)))
4149 (inputs
4150 `(("blas" ,openblas)
4151 ("lapack" ,lapack)))
4152 (arguments
4153 `(#:modules ((srfi srfi-1)
4154 ,@%gnu-build-system-modules)
4155 #:configure-flags '("--enable-shared"
4156 "--disable-fortran"
4157 "--without-MPI"
4158 "--with-openmp"
4159 "--with-fei"
4160 "--with-lapack"
4161 "--with-blas")
4162 #:phases
4163 (modify-phases %standard-phases
4164 (add-before 'build 'set-HOME
4165 (lambda _
4166 ;; FIXME: texlive-union does not find the built
4167 ;; metafonts, so it tries to generate them in HOME.
4168 (setenv "HOME" "/tmp")
4169 #t))
4170 (add-before 'configure 'chdir-src
4171 (lambda _ (chdir "src")))
4172 (replace 'configure
4173 (lambda* (#:key build target configure-flags
4174 #:allow-other-keys #:rest args)
4175 (let* ((configure (assoc-ref %standard-phases 'configure)))
4176 (apply configure
4177 (append args
4178 (list #:configure-flags
4179 (cons (string-append
4180 "--host=" (or target build))
4181 configure-flags)))))))
4182 (add-after 'build 'build-docs
4183 (lambda _
4184 (invoke "make" "-Cdocs" "pdf" "html")))
4185 (replace 'check
4186 (lambda _
4187 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4188 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
4189 (invoke "make" "check" "CHECKRUN=")
4190 (for-each (lambda (filename)
4191 (let ((size (stat:size (stat filename))))
4192 (when (positive? size)
4193 (error (format #f "~a size ~d; error indication~%"
4194 filename size)))))
4195 (find-files "test" ".*\\.err$"))
4196 #t))
4197 (add-after 'install 'install-docs
4198 (lambda* (#:key outputs #:allow-other-keys)
4199 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4200 (let* ((doc (assoc-ref outputs "doc"))
4201 (docdir (string-append doc "/share/doc/hypre-" ,version)))
4202 (with-directory-excursion "docs"
4203 (for-each (lambda (base)
4204 (install-file (string-append base ".pdf") docdir)
4205 (copy-recursively base docdir)) ; html docs
4206 '("HYPRE_usr_manual"
4207 "HYPRE_ref_manual")))
4208 #t))))))
4209 (home-page "http://www.llnl.gov/casc/hypre/")
4210 (synopsis "Library of solvers and preconditioners for linear equations")
4211 (description
4212 "HYPRE is a software library of high performance preconditioners and
4213 solvers for the solution of large, sparse linear systems of equations. It
4214 features multigrid solvers for both structured and unstructured grid
4215 problems.")
4216 (license license:lgpl2.1)))
4217
4218 (define-public hypre-openmpi
4219 (package (inherit hypre)
4220 (name "hypre-openmpi")
4221 (inputs
4222 `(("mpi" ,openmpi)
4223 ,@(package-inputs hypre)))
4224 (arguments
4225 (substitute-keyword-arguments (package-arguments hypre)
4226 ((#:configure-flags flags)
4227 ``("--with-MPI"
4228 ,@(delete "--without-MPI" ,flags)))
4229 ((#:phases phases)
4230 `(modify-phases ,phases
4231 (add-before 'check 'mpi-setup
4232 ,%openmpi-setup)))))
4233 (synopsis "Parallel solvers and preconditioners for linear equations")
4234 (description
4235 "HYPRE is a software library of high performance preconditioners and
4236 solvers for the solution of large, sparse linear systems of equations on
4237 parallel computers. It features parallel multigrid solvers for both
4238 structured and unstructured grid problems.")))
4239
4240 (define-public matio
4241 (package
4242 (name "matio")
4243 (version "1.5.6")
4244 (source
4245 (origin
4246 (method url-fetch)
4247 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
4248 "matio-" version ".tar.gz"))
4249 (sha256
4250 (base32
4251 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4252 (build-system gnu-build-system)
4253 (inputs
4254 `(("zlib" ,zlib)
4255 ("hdf5" ,hdf5)))
4256 (home-page "http://matio.sourceforge.net/")
4257 (synopsis "Library for reading and writing MAT files")
4258 (description "Matio is a library for reading and writing MAT files. It
4259 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4260 (license license:bsd-2)))
4261
4262 (define-public vc
4263 (package
4264 (name "vc")
4265 (version "1.4.1")
4266 (source
4267 (origin (method url-fetch)
4268 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4269 "download/" version "/Vc-" version ".tar.gz"))
4270 (sha256
4271 (base32
4272 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
4273 (build-system cmake-build-system)
4274 (arguments
4275 '(#:configure-flags
4276 '("-DBUILD_TESTING=ON"
4277 ;; By default, Vc will optimize for the CPU of the build machine.
4278 ;; Setting this to "none" makes it create portable binaries. See
4279 ;; "cmake/OptimizeForArchitecture.cmake".
4280 "-DTARGET_ARCHITECTURE=none")
4281 #:phases (modify-phases %standard-phases
4282 (add-after 'unpack 'copy-testdata
4283 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4284 (let ((testdata (assoc-ref (or native-inputs inputs)
4285 "testdata")))
4286 (copy-recursively testdata "tests/testdata")
4287 #t))))))
4288 (native-inputs
4289 `(("virtest" ,virtest)
4290
4291 ;; This is a submodule in the git project, but not part of the
4292 ;; released sources. See the git branch for the commit to take.
4293 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4294 (origin
4295 (method git-fetch)
4296 (uri (git-reference
4297 (url "https://github.com/VcDevel/vc-testdata")
4298 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4299 (file-name (git-file-name "vc-testdata"
4300 (string-take commit 7)))
4301 (sha256
4302 (base32
4303 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
4304 (synopsis "SIMD vector classes for C++")
4305 (description "Vc provides portable, zero-overhead C++ types for explicitly
4306 data-parallel programming. It is a library designed to ease explicit
4307 vectorization of C++ code. Its types enable explicitly stating data-parallel
4308 operations on multiple values. The parallelism is therefore added via the type
4309 system. Vc has an intuitive API and provides portability between different
4310 compilers and compiler versions as well as portability between different vector
4311 instruction sets. Thus, an application written with Vc can be compiled for:
4312 @enumerate
4313 @item AVX and AVX2
4314 @item SSE2 up to SSE4.2 or SSE4a
4315 @item Scalar
4316 @item MIC
4317 @item NEON (in development)
4318 @item NVIDIA GPUs / CUDA (in development)
4319 @end enumerate\n")
4320 (home-page "https://github.com/VcDevel/Vc")
4321 ;; "No support_???.cpp file exists for this architecture."
4322 (supported-systems '("x86_64-linux" "i686-linux"))
4323 (license license:bsd-3)))
4324
4325 (define-public reducelcs
4326 ;; This is the last commit which is available upstream, no
4327 ;; release happened since 2010.
4328 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4329 (revision "1"))
4330 (package
4331 (name "reducelcs")
4332 (version (string-append "1.0-" revision "." (string-take commit 7)))
4333 (source
4334 (origin
4335 (method git-fetch)
4336 (uri (git-reference
4337 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4338 (commit commit)))
4339 (file-name (string-append name "-" version "-checkout"))
4340 (sha256
4341 (base32
4342 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4343 (build-system gnu-build-system)
4344 (inputs
4345 `(("openlibm" ,openlibm)))
4346 (arguments
4347 `(#:tests? #f ; no tests
4348 #:phases
4349 (modify-phases %standard-phases
4350 (delete 'configure) ; No configure script exists.
4351 (replace 'install ; No install phase exists.
4352 (lambda* (#:key outputs #:allow-other-keys)
4353 (let* ((out (assoc-ref outputs "out"))
4354 (bin (string-append out "/bin")))
4355 (install-file "Approximation" bin)
4356 (install-file "CollectResults" bin)
4357 (install-file "GenerateInstances" bin)
4358 #t))))))
4359 (synopsis "Approximate Longest Commons Subsequence computation tool")
4360 (description
4361 "@code{reduceLCS} is an implementation of the Reduce-Expand
4362 algorithm for LCS. It is a fast program to compute the approximate
4363 Longest Commons Subsequence of a set of strings.")
4364 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4365 (license license:gpl3+))))
4366
4367 (define-public jacal
4368 (package
4369 (name "jacal")
4370 (version "1c4")
4371 (source (origin
4372 (method url-fetch)
4373 (uri (string-append
4374 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4375 version ".zip"))
4376 (sha256 (base32
4377 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4378 (patches (search-patches "jacal-fix-texinfo.patch"))))
4379 (build-system gnu-build-system)
4380 (arguments
4381 `(#:phases
4382 (modify-phases %standard-phases
4383 (add-before 'build 'pre-build
4384 ;; Don't use upstream's script - it really doesn't fit into
4385 ;; Guix's functional paradigm.
4386 (lambda* (#:key inputs outputs #:allow-other-keys)
4387 (substitute* "Makefile"
4388 (("^install: install-script") "install: "))))
4389 (add-after 'install 'post-install
4390 ;; Instead, we provide our own simplified script.
4391 (lambda* (#:key inputs outputs #:allow-other-keys)
4392 (let ((wrapper (string-append (assoc-ref outputs "out")
4393 "/bin/jacal")))
4394 (format (open wrapper (logior O_WRONLY O_CREAT))
4395 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4396 "-e '(slib:load \"~a/lib/jacal/math\") "
4397 "(math)' \"$@\"\n")
4398 (which "bash")
4399 (assoc-ref inputs "scm")
4400 (assoc-ref outputs "out"))
4401 (chmod wrapper #o555))))
4402 (replace 'configure
4403 (lambda* (#:key outputs #:allow-other-keys)
4404 (invoke "./configure"
4405 (string-append "--prefix="
4406 (assoc-ref outputs "out"))))))))
4407 (inputs `(("scm" ,scm)))
4408 (native-inputs `(("unzip" ,unzip)
4409 ("texinfo" ,texinfo)))
4410 (synopsis "Symbolic mathematics system")
4411 (description "GNU JACAL is an interactive symbolic mathematics program based on
4412 Scheme. It manipulate and simplify a range of mathematical expressions such
4413 as equations, scalars, vectors, and matrices.")
4414 (home-page "https://www.gnu.org/software/jacal/")
4415 (license license:gpl3+)))
4416
4417 (define-public z3
4418 (package
4419 (name "z3")
4420 (version "4.8.8")
4421 (home-page "https://github.com/Z3Prover/z3")
4422 (source (origin
4423 (method git-fetch)
4424 (uri (git-reference (url home-page)
4425 (commit (string-append "z3-" version))))
4426 (file-name (git-file-name name version))
4427 (sha256
4428 (base32
4429 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
4430 (build-system gnu-build-system)
4431 (arguments
4432 `(#:imported-modules ((guix build python-build-system)
4433 ,@%gnu-build-system-modules)
4434 #:modules (((guix build python-build-system) #:select (site-packages))
4435 (guix build gnu-build-system)
4436 (guix build utils))
4437 #:phases
4438 (modify-phases %standard-phases
4439 (add-after 'unpack 'enable-bytecode-determinism
4440 (lambda _
4441 (setenv "PYTHONHASHSEED" "0")
4442 #t))
4443 (add-after 'unpack 'fix-compatability
4444 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4445 (lambda _
4446 (substitute* "src/util/mpz.cpp"
4447 (("#include <immintrin.h>") ""))
4448 #t))
4449 (add-before 'configure 'bootstrap
4450 (lambda _
4451 (invoke "python" "scripts/mk_make.py")))
4452 ;; work around gnu-build-system's setting --enable-fast-install
4453 ;; (z3's `configure' is a wrapper around the above python file,
4454 ;; which fails when passed --enable-fast-install)
4455 (replace 'configure
4456 (lambda* (#:key inputs outputs #:allow-other-keys)
4457 (invoke "./configure"
4458 "--python"
4459 (string-append "--prefix=" (assoc-ref outputs "out"))
4460 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
4461 (add-after 'configure 'change-directory
4462 (lambda _
4463 (chdir "build")
4464 #t))
4465 (add-before 'check 'make-test-z3
4466 (lambda _
4467 ;; Build the test suite executable.
4468 (invoke "make" "test-z3" "-j"
4469 (number->string (parallel-job-count)))))
4470 (replace 'check
4471 (lambda _
4472 ;; Run all the tests that don't require arguments.
4473 (invoke "./test-z3" "/a"))))))
4474 (native-inputs
4475 `(("which" ,which)
4476 ("python" ,python-wrapper)))
4477 (synopsis "Theorem prover")
4478 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4479 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4480 (license license:expat)))
4481
4482 (define-public elpa
4483 (package
4484 (name "elpa")
4485 (version "2018.11.001")
4486 (source (origin
4487 (method url-fetch)
4488 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4489 version "/elpa-" version ".tar.gz"))
4490 (sha256
4491 (base32
4492 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4493 (build-system gnu-build-system)
4494 (native-inputs
4495 `(("fortran" ,gfortran)
4496 ("perl" ,perl))) ;for configure and deps
4497 (inputs
4498 `(("blas" ,openblas)))
4499 (arguments
4500 `(#:configure-flags
4501 `("--enable-openmp"
4502 "--with-mpi=no"
4503 ;; ELPA unfortunately does not support runtime dispatch, so we can
4504 ;; only enable the "generic" kernels. See the "Cross compilation"
4505 ;; section of INSTALL.md.
4506 "--enable-generic"
4507 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4508 "--disable-avx" "--disable-avx2" "--disable-avx512"
4509 ,(string-append "CFLAGS=-O3 "
4510 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4511 "-ftree-vect-loop-version -ftree-vectorize "
4512 ,(let ((system (or (%current-target-system)
4513 (%current-system))))
4514 (cond
4515 ((or (string-prefix? "x86_64" system)
4516 (string-prefix? "i686" system))
4517 "-msse2")
4518 (else "")))))
4519 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4520 #:phases
4521 (modify-phases %standard-phases
4522 (add-before 'configure 'patch-header-generation
4523 (lambda _
4524 (substitute* "configure"
4525 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4526 (string-append & " CPP=\"$CPP\"")))
4527 #t))
4528 (add-before 'check 'setup-tests
4529 (lambda _
4530 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4531 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4532 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4533 ;; for Fortran. This also causes several tests to pass that
4534 ;; otherwise would otherwise fail with matrix size 5000; possibly
4535 ;; due to floating point tolerances that are too tight.
4536 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4537 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4538 (substitute* "Makefile"
4539 ;; Test scripts are generated, patch the shebang
4540 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4541 #t)))))
4542 (home-page "http://elpa.mpcdf.mpg.de")
4543 (synopsis "Eigenvalue solvers for symmetric matrices")
4544 (description
4545 "The ELPA library provides efficient and scalable direct eigensolvers for
4546 symmetric matrices.")
4547 (license license:lgpl3)))
4548
4549 (define-public elpa-openmpi
4550 (package (inherit elpa)
4551 (name "elpa-openmpi")
4552 (inputs
4553 `(("mpi" ,openmpi)
4554 ("scalapack" ,scalapack)
4555 ,@(package-inputs elpa)))
4556 (arguments
4557 (substitute-keyword-arguments (package-arguments elpa)
4558 ((#:configure-flags cf '())
4559 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4560 ((#:phases phases '%standard-phases)
4561 `(modify-phases ,phases
4562 (add-before 'check 'mpi-setup
4563 (lambda _
4564 ;; Tests use 2 mpi tasks by default, use our remaining build
4565 ;; cores as OpenMP threads.
4566 (setenv "OMP_NUM_THREADS" (number->string
4567 (max (quotient (parallel-job-count) 2)
4568 1)))
4569 (,%openmpi-setup)))))))
4570 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4571
4572 (define-public elemental
4573 (package
4574 (name "elemental")
4575 (version "0.87.7")
4576 (source (origin
4577 (method git-fetch)
4578 (uri (git-reference
4579 (url "https://github.com/elemental/Elemental.git")
4580 (commit (string-append "v" version))))
4581 (file-name (git-file-name name version))
4582 (sha256
4583 (base32
4584 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4585 (build-system cmake-build-system)
4586 (home-page "https://github.com/elemental/Elemental")
4587 (native-inputs
4588 `(("gfortran" ,gfortran)))
4589 (inputs
4590 `(("blas" ,openblas)
4591 ("gfortran:lib" ,gfortran "lib")
4592 ("gmp" ,gmp)
4593 ("lapack" ,lapack)
4594 ("metis" ,metis)
4595 ("mpc" ,mpc)
4596 ("mpfr" ,mpfr)
4597 ("mpi" ,openmpi)
4598 ("qd" ,qd)))
4599 (arguments
4600 `(#:build-type "Release" ;default RelWithDebInfo not supported
4601 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4602 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4603 "-DEL_CACHE_WARNINGS:BOOL=YES"
4604 "-DEL_TESTS:BOOL=YES"
4605 "-DCMAKE_INSTALL_LIBDIR=lib"
4606 "-DGFORTRAN_LIB=gfortran")
4607 #:phases (modify-phases %standard-phases
4608 (add-before 'check 'mpi-setup
4609 ,%openmpi-setup)
4610 (add-before 'check 'setup-tests
4611 (lambda _
4612 ;; Parallelism is done at the MPI layer.
4613 (setenv "OMP_NUM_THREADS" "1")
4614 #t))
4615 (add-after 'install 'remove-tests
4616 (lambda* (#:key outputs #:allow-other-keys)
4617 ;; Tests are installed, with no easy configuration
4618 ;; switch to prevent this, so delete them.
4619 (delete-file-recursively
4620 (string-append (assoc-ref outputs "out") "/bin"))
4621 #t)))))
4622 (synopsis "Dense and sparse-direct linear algebra and optimization")
4623 (description "Elemental is a modern C++ library for distributed-memory
4624 dense and sparse-direct linear algebra, conic optimization, and lattice
4625 reduction.")
4626 (license license:bsd-2)))
4627
4628 (define-public mcrl2
4629 (package
4630 (name "mcrl2")
4631 (version "201908.0")
4632 (source (origin
4633 (method url-fetch)
4634 (uri (string-append
4635 "https://www.mcrl2.org/download/release/mcrl2-"
4636 version ".tar.gz"))
4637 (sha256
4638 (base32
4639 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4640 (inputs
4641 `(("boost" ,boost)
4642 ("glu" ,glu)
4643 ("mesa" ,mesa)
4644 ("qtbase" ,qtbase)))
4645 (build-system cmake-build-system)
4646 (synopsis "Toolset for the mCRL2 formal specification language")
4647 (description
4648 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4649 specification language for describing concurrent discrete event systems. Its
4650 toolset supports analysis and automatic verification, linearisation, simulation,
4651 state-space exploration and generation, and tools to optimise and analyse
4652 specifications. Also, state spaces can be manipulated, visualised and
4653 analysed.")
4654 (home-page "https://mcrl2.org")
4655 (license license:boost1.0)))
4656
4657 (define-public mcrl2-minimal
4658 (package
4659 (inherit mcrl2)
4660 (name "mcrl2-minimal")
4661 (inputs
4662 `(("boost" ,boost)))
4663 (arguments
4664 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4665
4666 (define-public tcalc
4667 (package
4668 (name "tcalc")
4669 (version "2.0")
4670 (source
4671 (origin
4672 (method url-fetch)
4673 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4674 version ".tar.gz"))
4675 (sha256
4676 (base32
4677 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4678 (build-system gnu-build-system)
4679 (synopsis "The terminal calculator")
4680 (description
4681 "The terminal calculator is a small program to help users of the GNU/Linux
4682 terminal do calculations simply and quickly. The formula to be calculated can
4683 be fed to @command{tcalc} through the command line.")
4684 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4685 (license license:gpl3+)))
4686
4687 (define-public sundials
4688 (package
4689 (name "sundials")
4690 (version "3.1.1")
4691 (source
4692 (origin
4693 (method url-fetch)
4694 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4695 "sundials-" version ".tar.gz"))
4696 (sha256
4697 (base32
4698 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4699 (build-system cmake-build-system)
4700 (native-inputs
4701 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4702 (inputs
4703 `(("fortran" ,gfortran) ;for fcmix
4704 ("blas" ,openblas)
4705 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4706 (arguments
4707 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4708 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4709 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4710 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4711 "-DEXAMPLES_INSTALL:BOOL=OFF"
4712
4713 "-DFCMIX_ENABLE:BOOL=ON"
4714
4715 "-DKLU_ENABLE:BOOL=ON"
4716 ,(string-append "-DKLU_INCLUDE_DIR="
4717 (assoc-ref %build-inputs "suitesparse")
4718 "/include")
4719 ,(string-append "-DKLU_LIBRARY_DIR="
4720 (assoc-ref %build-inputs "suitesparse")
4721 "/lib"))))
4722 (home-page "https://computation.llnl.gov/projects/sundials")
4723 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4724 (description "SUNDIALS is a family of software packages implemented with
4725 the goal of providing robust time integrators and nonlinear solvers that can
4726 easily be incorporated into existing simulation codes.")
4727 (license license:bsd-3)))
4728
4729 (define-public sundials-openmpi
4730 (package (inherit sundials)
4731 (name "sundials-openmpi")
4732 (inputs
4733 `(("mpi" ,openmpi)
4734 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4735 ,@(package-inputs sundials)))
4736 (arguments
4737 (substitute-keyword-arguments (package-arguments sundials)
4738 ((#:configure-flags flags '())
4739 `(cons* "-DMPI_ENABLE:BOOL=ON"
4740 "-DPETSC_ENABLE:BOOL=ON"
4741 (string-append "-DPETSC_INCLUDE_DIR="
4742 (assoc-ref %build-inputs "petsc")
4743 "/include")
4744 (string-append "-DPETSC_LIBRARY_DIR="
4745 (assoc-ref %build-inputs "petsc")
4746 "/lib")
4747 ,flags))
4748 ((#:phases phases '%standard-phases)
4749 `(modify-phases ,phases
4750 (add-before 'check 'mpi-setup
4751 ,%openmpi-setup)))))
4752 (synopsis "SUNDIALS with OpenMPI support")))
4753
4754 (define-public combinatorial-blas
4755 (package
4756 (name "combinatorial-blas")
4757 (version "1.6.2")
4758 (source
4759 (origin
4760 (method url-fetch)
4761 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4762 "CombBLAS_beta_"
4763 (match (string-split version #\.)
4764 ((major minor patch)
4765 (string-append major minor "_" patch))) ;e.g. "16_2"
4766 ".tgz"))
4767 (sha256
4768 (base32
4769 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4770 (patches (search-patches "combinatorial-blas-awpm.patch"
4771 "combinatorial-blas-io-fix.patch"))))
4772 (build-system cmake-build-system)
4773 (inputs
4774 `(("mpi" ,openmpi)
4775 ("test-data" ,(origin
4776 (method url-fetch)
4777 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4778 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4779 (sha256
4780 (base32
4781 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4782 (arguments
4783 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4784 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4785 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4786 #:phases
4787 (modify-phases %standard-phases
4788 (add-before 'check 'mpi-setup
4789 ,%openmpi-setup)
4790 (add-before 'check 'test-setup
4791 (lambda* (#:key inputs #:allow-other-keys)
4792 (setenv "OMP_NUM_THREADS" "2")
4793 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4794 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4795 (synopsis "Linear algebra primitives for graph analytics")
4796 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4797 distributed-memory parallel graph library offering a small but powerful set of
4798 linear algebra primitives specifically targeting graph analytics.")
4799 (license (list
4800 license:gpl2+ ;include/psort/(funnel|sort)*.h
4801 license:x11 ;usort and psort
4802 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4803
4804 (define-public dune-common
4805 (package
4806 (name "dune-common")
4807 (version "2.7.0")
4808 (source
4809 (origin
4810 (method url-fetch)
4811 (uri (string-append "https://dune-project.org/download/"
4812 version "/dune-common-" version ".tar.gz"))
4813 (sha256
4814 (base32
4815 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
4816 (build-system cmake-build-system)
4817 (arguments
4818 `(#:phases
4819 (modify-phases %standard-phases
4820 (add-after 'build 'build-tests
4821 (lambda* (#:key make-flags #:allow-other-keys)
4822 (apply invoke "make" "build_tests" make-flags))))))
4823 (inputs
4824 `(("gmp" ,gmp)
4825 ("metis" ,metis)
4826 ("openblas" ,openblas)
4827 ("python" ,python)
4828 ("superlu" ,superlu)))
4829 (native-inputs
4830 `(("gfortran" ,gfortran)
4831 ("pkg-config" ,pkg-config)))
4832 (home-page "https://dune-project.org/")
4833 (synopsis "Distributed and Unified Numerics Environment")
4834 (description "DUNE, the Distributed and Unified Numerics Environment is a
4835 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4836 grid-based methods. It supports the easy implementation of methods like
4837 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4838 Differences} (FD).")
4839 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4840 (license license:gpl2)))
4841
4842 (define-public dune-geometry
4843 (package
4844 (name "dune-geometry")
4845 (version "2.7.0")
4846 (source
4847 (origin
4848 (method url-fetch)
4849 (uri (string-append "https://dune-project.org/download/"
4850 version "/dune-geometry-" version ".tar.gz"))
4851 (sha256
4852 (base32
4853 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
4854 (build-system cmake-build-system)
4855 (arguments
4856 `(#:phases
4857 (modify-phases %standard-phases
4858 (add-after 'build 'build-tests
4859 (lambda* (#:key make-flags #:allow-other-keys)
4860 (apply invoke "make" "build_tests" make-flags))))))
4861 (inputs
4862 `(("dune-common" ,dune-common)
4863 ;; Optional
4864 ("openblas" ,openblas)
4865 ("gmp" ,gmp)
4866 ("python" ,python)))
4867 (native-inputs
4868 `(("gfortran" ,gfortran)
4869 ("pkg-config" ,pkg-config)))
4870 (home-page "https://dune-project.org/")
4871 (synopsis "Distributed and Unified Numerics Environment")
4872 (description "DUNE, the Distributed and Unified Numerics Environment is a
4873 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4874 grid-based methods. It supports the easy implementation of methods like
4875 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4876 Differences} (FD).
4877
4878 This package contains the basic DUNE geometry classes.")
4879 ;; GPL version 2 with "runtime exception"
4880 (license license:gpl2)))
4881
4882 (define-public dune-uggrid
4883 (package
4884 (name "dune-uggrid")
4885 (version "2.7.0")
4886 (source
4887 (origin
4888 (method git-fetch)
4889 (uri (git-reference
4890 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
4891 (commit (string-append "v" version))))
4892 (file-name (git-file-name name version))
4893 (sha256
4894 (base32
4895 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
4896 (build-system cmake-build-system)
4897 (arguments
4898 `(#:phases
4899 (modify-phases %standard-phases
4900 (add-after 'build 'build-tests
4901 (lambda* (#:key make-flags #:allow-other-keys)
4902 (apply invoke "make" "build_tests" make-flags))))))
4903 (inputs
4904 `(("dune-common" ,dune-common)))
4905 (native-inputs
4906 `(("gfortran" ,gfortran)
4907 ("pkg-config" ,pkg-config)))
4908 (home-page "https://dune-project.org/")
4909 (synopsis "Distributed and Unified Numerics Environment")
4910 (description "DUNE, the Distributed and Unified Numerics Environment is a
4911 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4912 grid-based methods. It supports the easy implementation of methods like
4913 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4914 Differences} (FD).
4915
4916 This package contains the DUNE UG grid classes.")
4917 (license license:lgpl2.1)))
4918
4919 (define-public dune-grid
4920 (package
4921 (name "dune-grid")
4922 (version "2.7.0")
4923 (source
4924 (origin
4925 (method url-fetch)
4926 (uri (string-append "https://dune-project.org/download/"
4927 version "/dune-grid-" version ".tar.gz"))
4928 (sha256
4929 (base32
4930 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
4931 (build-system cmake-build-system)
4932 (arguments
4933 `(#:phases
4934 (modify-phases %standard-phases
4935 (add-after 'build 'build-tests
4936 (lambda* (#:key make-flags #:allow-other-keys)
4937 (apply invoke "make" "build_tests" make-flags))))))
4938 (inputs
4939 `(("dune-common" ,dune-common)
4940 ("dune-geometry" ,dune-geometry)
4941 ("gmp" ,gmp)
4942 ("metis" ,metis)
4943 ("openblas" ,openblas)
4944 ("python" ,python)))
4945 (propagated-inputs
4946 `(("dune-uggrid" ,dune-uggrid)))
4947 (native-inputs
4948 `(("gfortran" ,gfortran)
4949 ("pkg-config" ,pkg-config)))
4950 (home-page "https://dune-project.org/")
4951 (synopsis "Distributed and Unified Numerics Environment")
4952 (description "DUNE, the Distributed and Unified Numerics Environment is a
4953 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4954 grid-based methods. It supports the easy implementation of methods like
4955 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4956 Differences} (FD).
4957
4958 This package contains the basic DUNE grid classes.")
4959 ;; GPL version 2 with "runtime exception"
4960 (license license:gpl2)))
4961
4962 (define-public dune-istl
4963 (package
4964 (name "dune-istl")
4965 (version "2.7.0")
4966 (source
4967 (origin
4968 (method url-fetch)
4969 (uri (string-append "https://dune-project.org/download/"
4970 version "/dune-istl-" version ".tar.gz"))
4971 (sha256
4972 (base32
4973 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
4974 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
4975 (build-system cmake-build-system)
4976 (arguments
4977 `(#:phases
4978 (modify-phases %standard-phases
4979 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
4980 ;; the stdlib types when the gfortran header is used. Remove gfortran
4981 ;; from CPLUS_INCLUDE_PATH as a workaround.
4982 (add-after 'set-paths 'hide-gfortran
4983 (lambda* (#:key inputs #:allow-other-keys)
4984 (let ((gfortran (assoc-ref inputs "gfortran")))
4985 (setenv "CPLUS_INCLUDE_PATH"
4986 (string-join
4987 (delete (string-append gfortran "/include/c++")
4988 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
4989 ":"))
4990 #t)))
4991 (add-after 'build 'build-tests
4992 (lambda* (#:key make-flags #:allow-other-keys)
4993 (apply invoke "make" "build_tests" make-flags))))))
4994 (inputs
4995 `(("dune-common" ,dune-common)
4996 ;; Optional
4997 ("metis" ,metis)
4998 ("suitesparse" ,suitesparse)
4999 ("superlu" ,superlu)
5000 ("openblas" ,openblas)
5001 ("gmp" ,gmp)
5002 ("python" ,python)))
5003 (native-inputs
5004 `(("gfortran" ,gfortran)
5005 ("pkg-config" ,pkg-config)))
5006 (home-page "https://dune-project.org/")
5007 (synopsis "Distributed and Unified Numerics Environment")
5008 (description "DUNE, the Distributed and Unified Numerics Environment is a
5009 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5010 grid-based methods.
5011
5012 This is the iterative solver template library which provides generic sparse
5013 matrix/vector classes and a variety of solvers based on these classes. A
5014 special feature is the use of templates to exploit the recursive block
5015 structure of finite element matrices at compile time. Available solvers
5016 include Krylov methods, (block-) incomplete decompositions and
5017 aggregation-based algebraic multigrid.")
5018 ;; GPL version 2 with "runtime exception"
5019 (license license:gpl2)))
5020
5021 (define-public dune-localfunctions
5022 (package
5023 (name "dune-localfunctions")
5024 (version "2.7.0")
5025 (source
5026 (origin
5027 (method url-fetch)
5028 (uri (string-append "https://dune-project.org/download/"
5029 version "/dune-localfunctions-" version ".tar.gz"))
5030 (sha256
5031 (base32
5032 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5033 (build-system cmake-build-system)
5034 (arguments
5035 `(#:phases
5036 (modify-phases %standard-phases
5037 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5038 ;; and fails to find the stdlib types when the gfortran header is used.
5039 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5040 (add-after 'set-paths 'hide-gfortran
5041 (lambda* (#:key inputs #:allow-other-keys)
5042 (let ((gfortran (assoc-ref inputs "gfortran")))
5043 (setenv "CPLUS_INCLUDE_PATH"
5044 (string-join
5045 (delete (string-append gfortran "/include/c++")
5046 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5047 ":"))
5048 #t)))
5049 (add-after 'build 'build-tests
5050 (lambda* (#:key make-flags #:allow-other-keys)
5051 (apply invoke "make" "build_tests" make-flags))))))
5052 (inputs
5053 `(("dune-common" ,dune-common)
5054 ("dune-geometry" ,dune-geometry)
5055 ;; Optional
5056 ("metis" ,metis)
5057 ("superlu" ,superlu)
5058 ("gmp" ,gmp)))
5059 (native-inputs
5060 `(("gfortran" ,gfortran)
5061 ("pkg-config" ,pkg-config)))
5062 (home-page "https://dune-project.org/")
5063 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5064 (description "This DUNE module provides interface and implementation for
5065 shape functions defined on the DUNE reference elements. In addition to the
5066 shape function, interpolation operators and special keys are provided which
5067 can be used to assemble global function spaces on finite-element grids.
5068
5069 This package provides an interface and implementation for shape functions
5070 defined on the DUNE reference elements. In addition to the shape function,
5071 interpolation operators and special keys are provided which can be used to
5072 assemble global function spaces on finite-element grids.")
5073 ;; GPL version 2 with "runtime exception"
5074 (license license:gpl2)))
5075
5076 (define-public dune-alugrid
5077 (package
5078 (name "dune-alugrid")
5079 (version "2.7.0-git-81d35682")
5080 (source
5081 (origin
5082 (method git-fetch)
5083 (uri (git-reference
5084 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5085 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5086 (file-name (git-file-name name version))
5087 (sha256
5088 (base32
5089 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
5090 (build-system cmake-build-system)
5091 (arguments
5092 `(#:phases
5093 (modify-phases %standard-phases
5094 (add-after 'unpack 'patch-include
5095 (lambda _
5096 (substitute* "dune/alugrid/test/test-alugrid.cc"
5097 (("doc/grids/gridfactory/testgrids")
5098 "doc/dune-grid/grids/gridfactory/testgrids"))
5099 #t))
5100 (add-after 'build 'build-tests
5101 (lambda* (#:key inputs make-flags #:allow-other-keys)
5102 (setenv "CPLUS_INCLUDE_PATH"
5103 (string-append (assoc-ref inputs "dune-grid") "/share"))
5104 (apply invoke "make" "build_tests" make-flags))))))
5105 (inputs
5106 `(("dune-common" ,dune-common)
5107 ("dune-geometry" ,dune-geometry)
5108 ("dune-grid" ,dune-grid)
5109 ;; Optional
5110 ("metis" ,metis)
5111 ("openblas" ,openblas)
5112 ("python" ,python)
5113 ("superlu" ,superlu)
5114 ("gmp" ,gmp)
5115 ("zlib" ,zlib)))
5116 (native-inputs
5117 `(("gfortran" ,gfortran)
5118 ("pkg-config" ,pkg-config)))
5119 (home-page "https://dune-project.org/")
5120 (synopsis "Distributed and Unified Numerics Environment")
5121 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5122 implementation of the DUNE grid interface supporting either simplices or
5123 cubes.")
5124 (license license:gpl2+)))
5125
5126 (define-public dune-subgrid
5127 (package
5128 (name "dune-subgrid")
5129 (version "2.7.0-git-2103a363")
5130 (source
5131 (origin
5132 (method git-fetch)
5133 (uri (git-reference
5134 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
5135 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
5136 (file-name (git-file-name name version))
5137 (sha256
5138 (base32
5139 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
5140 (build-system cmake-build-system)
5141 (arguments
5142 `(#:phases
5143 (modify-phases %standard-phases
5144 (add-after 'build 'build-tests
5145 (lambda* (#:key make-flags #:allow-other-keys)
5146 (apply invoke "make" "build_tests" make-flags))))))
5147 (inputs
5148 `(("dune-common" ,dune-common)
5149 ("dune-geometry" ,dune-geometry)
5150 ("dune-grid" ,dune-grid)
5151 ;; Optional
5152 ("metis" ,metis)
5153 ("openblas" ,openblas)
5154 ("gmp" ,gmp)))
5155 (native-inputs
5156 `(("gfortran" ,gfortran)
5157 ("pkg-config" ,pkg-config)))
5158 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5159 (synopsis "Distributed and Unified Numerics Environment")
5160 (description "The dune-subgrid module marks elements of
5161 another hierarchical dune grid. The set of marked elements can then be
5162 accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5163 provides the full grid interface including adaptive mesh refinement.")
5164 (license license:gpl2+)))
5165
5166 (define-public dune-typetree
5167 (package
5168 (name "dune-typetree")
5169 (version "2.7.0")
5170 (source
5171 (origin
5172 (method git-fetch)
5173 (uri (git-reference
5174 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5175 (commit (string-append "v" version))))
5176 (file-name (git-file-name name version))
5177 (sha256
5178 (base32
5179 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
5180 (build-system cmake-build-system)
5181 (arguments
5182 `(#:phases
5183 (modify-phases %standard-phases
5184 (add-after 'build 'build-tests
5185 (lambda* (#:key make-flags #:allow-other-keys)
5186 (apply invoke "make" "build_tests" make-flags))))))
5187 (inputs
5188 `(("dune-common" ,dune-common)
5189 ;; Optional
5190 ("openblas" ,openblas)
5191 ("python" ,python)
5192 ("metis" ,metis)
5193 ("superlu" ,superlu)
5194 ("gmp" ,gmp)))
5195 (native-inputs
5196 `(("gfortran" ,gfortran)
5197 ("pkg-config" ,pkg-config)))
5198 (home-page "https://dune-project.org/")
5199 (synopsis "Distributed and Unified Numerics Environment")
5200 (description "TypeTree is a template library for constructing and
5201 operating on statically typed trees of objects.")
5202 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5203 (license (list license:lgpl3+ license:gpl2))))
5204
5205 (define-public dune-functions
5206 (package
5207 (name "dune-functions")
5208 (version "2.7.0")
5209 (source
5210 (origin
5211 (method git-fetch)
5212 (uri (git-reference
5213 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5214 (commit (string-append "v" version))))
5215 (file-name (git-file-name name version))
5216 (sha256
5217 (base32
5218 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
5219 (build-system cmake-build-system)
5220 (arguments
5221 `(#:phases
5222 (modify-phases %standard-phases
5223 (add-after 'unpack 'disable-failing-tests
5224 (lambda _
5225 (setenv "ARGS"
5226 ;; unable to load GMSH file in this test
5227 "--exclude-regex gridviewfunctionspacebasistest")
5228 #t))
5229 (add-after 'build 'build-tests
5230 (lambda* (#:key make-flags #:allow-other-keys)
5231 (apply invoke "make" "build_tests" make-flags))))))
5232 (inputs
5233 `(("dune-common" ,dune-common)
5234 ("dune-istl" ,dune-istl)
5235 ("dune-localfunctions" ,dune-localfunctions)
5236 ("dune-grid" ,dune-grid)
5237 ("dune-geometry" ,dune-geometry)
5238 ("dune-typetree" ,dune-typetree)
5239 ("openblas" ,openblas)
5240 ("metis" ,metis)
5241 ("python" ,python)
5242 ("superlu" ,superlu)
5243 ("gmp" ,gmp)))
5244 (native-inputs
5245 `(("gfortran" ,gfortran)
5246 ("pkg-config" ,pkg-config)))
5247 (home-page "https://dune-project.org/")
5248 (synopsis "Distributed and Unified Numerics Environment")
5249 (description "The dune-functions module provides an abstraction layer for
5250 global finite element functions. Its two main concepts are functions
5251 implemented as callable objects, and bases of finite element spaces.")
5252 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5253 (license (list license:lgpl3+ license:gpl2))))
5254
5255 (define-public dune-pdelab
5256 (package
5257 (name "dune-pdelab")
5258 (version "2.7.0-git-476fe437")
5259 (source
5260 (origin
5261 (method git-fetch)
5262 (uri (git-reference
5263 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
5264 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
5265 (file-name (git-file-name name version))
5266 (sha256
5267 (base32
5268 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
5269 (build-system cmake-build-system)
5270 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5271 (inputs
5272 `(("dune-common" ,dune-common)
5273 ("dune-istl" ,dune-istl)
5274 ("dune-localfunctions" ,dune-localfunctions)
5275 ("dune-geometry" ,dune-geometry)
5276 ("dune-grid" ,dune-grid)
5277 ("dune-typetree" ,dune-typetree)
5278 ("dune-functions" ,dune-functions)
5279 ;; Optional
5280 ("openblas" ,openblas)
5281 ("eigen" ,eigen)
5282 ("metis" ,metis)
5283 ("python" ,python)
5284 ("superlu" ,superlu)
5285 ("gmp" ,gmp)))
5286 (native-inputs
5287 `(("gfortran" ,gfortran)
5288 ("pkg-config" ,pkg-config)))
5289 (home-page "https://dune-project.org/")
5290 (synopsis "Differential equations solver toolbox")
5291 (description "PDELab is a partial differential equations solver toolbox
5292 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5293 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5294 (license (list license:lgpl3+ license:gpl2))))
5295
5296 (define add-openmpi-to-dune-package
5297 (let ((dune-package?
5298 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5299 (package-mapping
5300 (lambda (p)
5301 (if (dune-package? p)
5302 (package (inherit p)
5303 (name (string-append (package-name p) "-openmpi"))
5304 (inputs `(,@(package-inputs p)
5305 ("openmpi" ,openmpi)))
5306 (arguments
5307 (substitute-keyword-arguments (package-arguments p)
5308 ((#:phases phases '%standard-phases)
5309 `(modify-phases ,phases
5310 (add-before 'check 'mpi-setup
5311 ,%openmpi-setup)))))
5312 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5313 p))
5314 (negate dune-package?))))
5315
5316 (define-public dune-common-openmpi
5317 (add-openmpi-to-dune-package dune-common))
5318
5319 (define-public dune-geometry-openmpi
5320 (add-openmpi-to-dune-package dune-geometry))
5321
5322 (define-public dune-istl-openmpi
5323 (add-openmpi-to-dune-package dune-istl))
5324
5325 (define-public dune-typetree-openmpi
5326 (add-openmpi-to-dune-package dune-typetree))
5327
5328 (define-public dune-uggrid-openmpi
5329 (add-openmpi-to-dune-package dune-uggrid))
5330
5331 (define-public dune-grid-openmpi
5332 (add-openmpi-to-dune-package dune-grid))
5333
5334 (define-public dune-alugrid-openmpi
5335 (add-openmpi-to-dune-package dune-alugrid))
5336
5337 (define-public dune-subgrid-openmpi
5338 (add-openmpi-to-dune-package dune-subgrid))
5339
5340 (define-public dune-localfunctions-openmpi
5341 (add-openmpi-to-dune-package dune-localfunctions))
5342
5343 (define-public dune-functions-openmpi
5344 (add-openmpi-to-dune-package dune-functions))
5345
5346 (define-public dune-pdelab-openmpi
5347 (add-openmpi-to-dune-package dune-pdelab))
5348
5349 (define-public mlucas
5350 (package
5351 (name "mlucas")
5352 (version "18")
5353 (source
5354 (origin
5355 (method url-fetch)
5356 (uri (string-append
5357 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5358 (sha256
5359 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5360 (build-system gnu-build-system)
5361 (inputs
5362 `(("python2" ,python-2)))
5363 (arguments
5364 `(#:tests? #f ; no tests
5365 #:phases
5366 (modify-phases %standard-phases
5367 (replace 'configure
5368 (lambda _
5369 (chdir "src")
5370 (call-with-output-file "Makefile"
5371 (lambda (port)
5372 (format port "CC = gcc
5373 CFLAGS = -O3 ~a -DUSE_THREADS
5374 LDLIBS = -lm -lpthread -lrt
5375 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5376 "
5377 ,(let ((system (or (%current-target-system)
5378 (%current-system))))
5379 (cond
5380 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5381 (else ""))))))
5382 #t))
5383 (replace 'install
5384 (lambda* (#:key outputs #:allow-other-keys)
5385 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5386 (install-file "Mlucas" bin)
5387 (install-file "primenet.py" bin))
5388 #t)))))
5389 (home-page "https://www.mersenne.org")
5390 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5391 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5392 numbers in search of a world-record prime. You may use it to test any
5393 suitable number as you wish, but it is preferable that you do so in a
5394 coordinated fashion, as part of the Great Internet Mersenne Prime
5395 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5396 management via the GIMPS project's Primenet server.")
5397 (license license:gpl2+)))
5398
5399 (define-public nauty
5400 (package
5401 (name "nauty")
5402 (version "2.7r1")
5403 (source
5404 (origin
5405 (method url-fetch)
5406 (uri (string-append
5407 "https://pallini.di.uniroma1.it/"
5408 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5409 (sha256
5410 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
5411 (build-system gnu-build-system)
5412 (outputs '("out" "lib"))
5413 (arguments
5414 `(#:test-target "checks"
5415 #:configure-flags '("--enable-generic") ;prevent -march-native
5416 #:phases
5417 (modify-phases %standard-phases
5418 ;; Default make target does not build all available
5419 ;; executables. Create them now.
5420 (add-after 'build 'build-extra-programs
5421 (lambda _
5422 (for-each (lambda (target) (invoke "make" target))
5423 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5424 #t))
5425 ;; Upstream does not provide any install target.
5426 (replace 'install
5427 (lambda* (#:key outputs #:allow-other-keys)
5428 (let* ((out (assoc-ref outputs "out"))
5429 (lib-output (assoc-ref outputs "lib"))
5430 (bin (string-append out "/bin"))
5431 (doc (string-append out "/share/doc/nauty/"))
5432 (include (string-append lib-output "/include/nauty"))
5433 (lib (string-append lib-output "/lib/nauty")))
5434 (for-each (lambda (f) (install-file f bin))
5435 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5436 "bliss2dre" "catg" "checks6" "complg" "converseg"
5437 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5438 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
5439 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5440 "gentourng" "gentreeg" "hamheuristic" "labelg"
5441 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5442 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5443 "sumlines" "twohamg" "underlyingg" "vcolg"
5444 "watercluster2" "NRswitchg"))
5445 (for-each (lambda (f) (install-file f include))
5446 (find-files "." "\\.h$"))
5447 (for-each (lambda (f) (install-file f lib))
5448 (find-files "." "\\.a$"))
5449 (for-each (lambda (f) (install-file f doc))
5450 (append '("formats.txt" "README" "schreier.txt")
5451 (find-files "." "\\.pdf$")))))))))
5452 (inputs
5453 `(("gmp" ,gmp))) ;for sumlines
5454 (home-page "https://pallini.di.uniroma1.it/")
5455 (synopsis "Library for graph automorphisms")
5456 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5457 procedures for computing automorphism groups of graphs and digraphs.
5458
5459 @code{nauty} computes graph information in the form of a set of
5460 generators, the size of the group, and the orbits of the group; it can
5461 also produce a canonical label. The @code{nauty} suite is written in
5462 C and comes with a command-line interface, a collection of
5463 command-line tools, and an Application Programming Interface (API).
5464
5465 This package provides the static libraries required to run programs
5466 compiled against the nauty library.")
5467 (license license:asl2.0)))
5468
5469 (define-public ppl
5470 (package
5471 (name "ppl")
5472 (version "1.2")
5473 (source
5474 (origin
5475 (method url-fetch)
5476 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5477 "ftp/releases/" version
5478 "/ppl-" version ".tar.gz"))
5479 (sha256
5480 (base32
5481 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5482 (build-system gnu-build-system)
5483 (native-inputs
5484 `(("m4", m4)))
5485 (inputs
5486 `(("glpk" ,glpk)
5487 ("gmp", gmp)))
5488 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5489 (synopsis
5490 "Parma Polyhedra Library for computations with polyhedra")
5491 (description
5492 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5493 especially targeted at applications in the field of analysis and
5494 verification of complex systems. These abstractions include convex
5495 polyhedra, defined as the intersection of a finite number of (open or
5496 closed) halfspaces, each described by a linear inequality (strict or
5497 non-strict) with rational coefficients; some special classes of polyhedra
5498 shapes that offer interesting complexity/precision tradeoffs; and grids
5499 which represent regularly spaced points that satisfy a set of linear
5500 congruence relations. The library also supports finite powersets and
5501 products of (any kind of) polyhedra and grids, a mixed integer linear
5502 programming problem solver using an exact-arithmetic version of the simplex
5503 algorithm, a parametric integer programming solver, and primitives for
5504 termination analysis via the automatic synthesis of linear ranking
5505 functions.")
5506 (license license:gpl3+)))
5507
5508 (define-public speedcrunch
5509 (package
5510 (name "speedcrunch")
5511 (version "0.12.0")
5512 (source
5513 (origin
5514 (method git-fetch)
5515 (uri (git-reference
5516 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5517 (commit (string-append "release-" version))))
5518 (file-name (git-file-name name version))
5519 (sha256
5520 (base32
5521 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5522 (build-system cmake-build-system)
5523 (inputs `(("qtbase" ,qtbase)))
5524 (native-inputs `(("qttools" ,qttools)))
5525 (arguments
5526 `(#:phases
5527 (modify-phases %standard-phases
5528 (add-after 'unpack 'chdir-to-src
5529 (lambda _ (chdir "src") #t)))))
5530 (synopsis "High-precision scientific calculator")
5531 (description
5532 "SpeedCrunch is a high-precision scientific calculator. It features a
5533 syntax-highlighted scrollable display and is designed to be fully used via
5534 keyboard. Some distinctive features are auto-completion of functions and
5535 variables, a formula book, and quick insertion of constants from various
5536 fields of knowledge.")
5537 (home-page "https://speedcrunch.org/")
5538 (license license:gpl2+)))
5539
5540 (define-public minisat
5541 ;; This is the last commit which is available upstream, no
5542 ;; release happened since 2010.
5543 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5544 (revision "1"))
5545 (package
5546 (name "minisat")
5547 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5548 (source
5549 (origin
5550 (method git-fetch)
5551 (uri (git-reference
5552 (url "https://github.com/niklasso/minisat.git")
5553 (commit commit)))
5554 (file-name (string-append name "-" version "-checkout"))
5555 (sha256
5556 (base32
5557 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5558 (patches
5559 (search-patches "minisat-friend-declaration.patch"
5560 "minisat-install.patch"))))
5561 (build-system gnu-build-system)
5562 (arguments
5563 '(#:make-flags (list (string-append "prefix=" %output))
5564 #:tests? #f ;no check target
5565 #:phases
5566 (modify-phases %standard-phases
5567 (delete 'configure))))
5568 (inputs
5569 `(("zlib:static" ,zlib "static")
5570 ("zlib" ,zlib)))
5571 (synopsis
5572 "Small, yet efficient, SAT solver")
5573 (description
5574 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5575 researchers and developers alike to get started on SAT.")
5576 (home-page
5577 "http://minisat.se/MiniSat.html")
5578 (license license:expat))))
5579
5580 (define-public libqalculate
5581 (package
5582 (name "libqalculate")
5583 (version "3.8.0")
5584 (source
5585 (origin
5586 (method git-fetch)
5587 (uri (git-reference
5588 (url "https://github.com/Qalculate/libqalculate/")
5589 (commit (string-append "v" version))))
5590 (file-name (git-file-name name version))
5591 (sha256
5592 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5593 (patches
5594 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
5595 (build-system gnu-build-system)
5596 (native-inputs
5597 `(("pkg-config" ,pkg-config)
5598 ("gettext" ,gettext-minimal)
5599 ("intltool" ,intltool)
5600 ("automake" ,automake)
5601 ("autoconf" ,autoconf)
5602 ("libtool" ,libtool)
5603 ("doxygen" ,doxygen)
5604 ("file" ,file)))
5605 (inputs
5606 `(("gmp" ,gmp)
5607 ("mpfr" ,mpfr)
5608 ("libxml2" ,libxml2)
5609 ("curl" ,curl)
5610 ("icu4c" ,icu4c)
5611 ("gnuplot" ,gnuplot)
5612 ("readline" ,readline)
5613 ("libiconv" ,libiconv)))
5614 (arguments
5615 `(#:phases
5616 (modify-phases %standard-phases
5617 (add-before 'bootstrap 'setenv
5618 ;; Prevent the autogen.sh script to carry out the configure
5619 ;; script, which has not yet been patched to replace /bin/sh.
5620 (lambda _
5621 (setenv "NOCONFIGURE" "TRUE")
5622 #t)))))
5623 (home-page "https://qalculate.github.io/")
5624 (synopsis "Multi-purpose cli desktop calculator and library")
5625 (description
5626 "Libqalculate is a multi-purpose cli desktop calculator and library.
5627 It provides basic and advanced functionality. Features include customizable
5628 functions, unit calculations, and conversions, physical constants, symbolic
5629 calculations (including integrals and equations), arbitrary precision,
5630 uncertainty propagation, interval arithmetic, plotting and a user-friendly
5631 cli.")
5632 (license license:gpl2+)))
5633
5634 (define-public qalculate-gtk
5635 (package
5636 (name "qalculate-gtk")
5637 (version "3.8.0")
5638 (source
5639 (origin
5640 (method git-fetch)
5641 (uri (git-reference
5642 (url "https://github.com/Qalculate/qalculate-gtk/")
5643 (commit (string-append "v" version))))
5644 (file-name (git-file-name name version))
5645 (sha256
5646 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5647 (build-system glib-or-gtk-build-system)
5648 (native-inputs
5649 `(("pkg-config" ,pkg-config)
5650 ("intltool" ,intltool)
5651 ("automake" ,automake)
5652 ("autoconf" ,autoconf)
5653 ("libtool" ,libtool)
5654 ("file" ,file)))
5655 (inputs
5656 `(("gmp" ,gmp)
5657 ("mpfr" ,mpfr)
5658 ("libqalculate" ,libqalculate)
5659 ("libxml2" ,libxml2)
5660 ("glib" ,glib)
5661 ("gtk+" ,gtk+)))
5662 (arguments
5663 `(#:phases
5664 (modify-phases %standard-phases
5665 (add-before 'bootstrap 'setenv
5666 ;; Prevent the autogen.sh script to carry out the configure
5667 ;; script, which has not yet been patched to replace /bin/sh.
5668 (lambda _
5669 (setenv "NOCONFIGURE" "TRUE")
5670 #t))
5671 (add-before 'check 'add-pot-file
5672 ;; the file contains translations and are currently not in use
5673 ;; left out on purpose so add it to POTFILES.skip
5674 (lambda _
5675 (with-output-to-file "po/POTFILES.skip"
5676 (lambda _
5677 (format #t "data/shortcuts.ui~%")
5678 #t))
5679 #t)))))
5680 (home-page "https://qalculate.github.io/")
5681 (synopsis "Multi-purpose graphical desktop calculator")
5682 (description
5683 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5684 multi-purpose GUI desktop calculator. It provides basic and advanced
5685 functionality. Features include customizable functions, unit calculations,
5686 and conversions, physical constants, symbolic calculations (including
5687 integrals and equations), arbitrary precision, uncertainity propagation,
5688 interval arithmetic, plotting.")
5689 (license license:gpl2+)))