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