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