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