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