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