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