gnu: w3m: Update to 0.5.3+git20180125 [fixes CVE-2018-{6196,6197,6198}].
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
b146763a 2;;; Copyright © 2013, 2014, 2015, 2016 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>
e01397b4 5;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
df354a77 6;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
182d6311 7;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
612a387f 8;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
32158110 9;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9aafbc0c 10;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
83a34647 11;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
45147b0c 12;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
ec8c7e47 13;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
3c8ba11a 14;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
5d4bd4cc 15;;; Copyright © 2016, 2017 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>
5d4bd4cc 18;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
54052a54 19;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
ba1be533 20;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
d109b1e8 21;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
5ca4fe96 22;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
59cd0ba4 23;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
dc7d6d4e 24;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
5b05dce7 25;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
8f8b2451
AE
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages maths)
ec322be2 43 #:use-module (ice-9 regex)
8f8b2451 44 #:use-module (gnu packages)
b5b73a82 45 #:use-module ((guix licenses) #:prefix license:)
8f8b2451
AE
46 #:use-module (guix packages)
47 #:use-module (guix download)
54052a54 48 #:use-module (guix git-download)
0e2672ae 49 #:use-module (guix utils)
cec86422 50 #:use-module (guix build utils)
da95c817 51 #:use-module (guix build-system cmake)
c9dfa3c7 52 #:use-module (guix build-system gnu)
ba1be533 53 #:use-module (guix build-system ocaml)
ec8c7e47 54 #:use-module (guix build-system r)
3de01d3f 55 #:use-module (gnu packages algebra)
5143517c 56 #:use-module (gnu packages autotools)
3de01d3f 57 #:use-module (gnu packages bison)
a17d4564 58 #:use-module (gnu packages boost)
e73b49fb 59 #:use-module (gnu packages check)
3de01d3f 60 #:use-module (gnu packages cmake)
c9dfa3c7 61 #:use-module (gnu packages compression)
668c06ac 62 #:use-module (gnu packages curl)
b7b27a8f 63 #:use-module (gnu packages cyrus-sasl)
528bb464 64 #:use-module (gnu packages documentation)
57e544e8 65 #:use-module (gnu packages elf)
3de01d3f 66 #:use-module (gnu packages flex)
668c06ac 67 #:use-module (gnu packages fltk)
f3929800 68 #:use-module (gnu packages fontutils)
1dba6407 69 #:use-module (gnu packages gettext)
da95c817 70 #:use-module (gnu packages gcc)
73fed4f8 71 #:use-module (gnu packages gd)
668c06ac 72 #:use-module (gnu packages ghostscript)
889187a4 73 #:use-module (gnu packages graphviz)
f3929800 74 #:use-module (gnu packages gtk)
45147b0c 75 #:use-module (gnu packages image)
2fd26d05 76 #:use-module (gnu packages java)
668c06ac 77 #:use-module (gnu packages less)
8731e527 78 #:use-module (gnu packages lisp)
bc3a2e35 79 #:use-module (gnu packages logging)
6e64766a 80 #:use-module (gnu packages lua)
5698b8b8 81 #:use-module (gnu packages gnome)
1b39a196 82 #:use-module (gnu packages guile)
668c06ac
JD
83 #:use-module (gnu packages xorg)
84 #:use-module (gnu packages gl)
9f913401 85 #:use-module (gnu packages imagemagick)
8731e527 86 #:use-module (gnu packages m4)
d8c7eeb9 87 #:use-module (gnu packages mpi)
b92eee75 88 #:use-module (gnu packages multiprecision)
528bb464 89 #:use-module (gnu packages netpbm)
ba1be533 90 #:use-module (gnu packages ocaml)
668c06ac 91 #:use-module (gnu packages pcre)
5698b8b8 92 #:use-module (gnu packages popt)
c9dfa3c7
AE
93 #:use-module (gnu packages perl)
94 #:use-module (gnu packages pkg-config)
da95c817 95 #:use-module (gnu packages python)
589e3f4e 96 #:use-module (gnu packages python-web)
5b05dce7 97 #:use-module (gnu packages qt)
c9dfa3c7 98 #:use-module (gnu packages readline)
2742f87e 99 #:use-module (gnu packages tbb)
479c4273 100 #:use-module (gnu packages scheme)
b7194849 101 #:use-module (gnu packages shells)
df354a77 102 #:use-module (gnu packages tcl)
668c06ac 103 #:use-module (gnu packages texinfo)
8f9ac901 104 #:use-module (gnu packages tex)
b7b27a8f 105 #:use-module (gnu packages tls)
5b05dce7 106 #:use-module (gnu packages version-control)
9aafbc0c 107 #:use-module (gnu packages wxwidgets)
c12efc72 108 #:use-module (gnu packages xml)
a17d4564 109 #:use-module (srfi srfi-1))
8f8b2451 110
193abc82
JD
111(define-public aris
112 (package
1f45f18a
JD
113 (name "aris")
114 (version "2.2")
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
118 (sha256 (base32
119 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
120 (build-system gnu-build-system)
121 (inputs `(("gtk+" ,gtk+)
122 ("libxml2" ,libxml2)))
123 (native-inputs `(("pkg-config" ,pkg-config)))
124 (synopsis "Natural deduction first-order logic interface")
125 (description "Aris is a program for performing logical proofs. It supports
126propositional and predicate logic, as well as Boolean algebra and
127arithmetical logic. In addition to its predefined inference and equivalence
128rules, Aris also supports references to older proofs. Its use of standard
129logical symbols and its natural deduction interface make it easy to use for
130beginners.")
131 (license license:gpl3+)
6fd52309 132 (home-page "https://www.gnu.org/software/aris/")))
193abc82 133
9c45c519
JD
134(define-public c-graph
135 (package
136 (name "c-graph")
137 (version "2.0")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
141 ".tar.gz"))
142 (sha256 (base32
143 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
144 (build-system gnu-build-system)
145 (inputs
146 `(("fortran" ,gfortran)))
a3947cb1 147 (synopsis "Visualizing and demonstrating convolution")
9c45c519 148 (description
a3947cb1
LC
149 "GNU C-Graph is a tool for demonstrating the theory of convolution.
150Thus, it can serve as an excellent aid to students of signal and systems
151theory in visualizing the convolution process. Rather than forcing the
152student to write code, the program offers an intuitive interface with
153interactive dialogs to guide them.")
9c45c519 154 (license license:gpl3+)
6fd52309 155 (home-page "https://www.gnu.org/software/c-graph/")))
9c45c519 156
d91025e3
TD
157(define-public coda
158 (package
159 (name "coda")
440c4273 160 (version "2.18.3")
d91025e3
TD
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
165 version "/coda-" version ".tar.gz"))
166 (sha256
440c4273 167 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
4b12fe5c
TD
168 (patches (search-patches "coda-use-system-libs.patch"))
169 (modules '((guix build utils)))
170 (snippet
171 ;; Make sure we don't use the bundled software.
172 '(for-each (lambda (d)
173 (delete-file-recursively (string-append "libcoda/" d)))
174 '("zlib" "pcre" "expat")))))
d91025e3
TD
175 (native-inputs
176 `(("fortran" ,gfortran)
177 ("python" ,python)
178 ("python-numpy" ,python-numpy)))
179 (inputs
180 `(("zlib" ,zlib)
4b12fe5c
TD
181 ("pcre" ,pcre)
182 ("expat" ,expat)
d91025e3
TD
183 ("hdf4" ,hdf4-alt)
184 ("hdf5" ,hdf5)))
185 (build-system gnu-build-system)
186 (arguments
4b12fe5c
TD
187 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
188 "LIBS= -lz -lpcre -lexpat")))
d91025e3
TD
189 (synopsis "A common interface to various earth observation data formats")
190 (description
191 "The Common Data Access toolbox (CODA) provides a set of interfaces for
192reading remote sensing data from earth observation data files. It consists of
193command line applications and interfaces to the C, Fortran, Python, and Java
194programming languages.")
195 (home-page "https://stcorp.nl/coda")
196 (license license:gpl2+)))
197
8f8b2451
AE
198(define-public units
199 (package
200 (name "units")
f11d2849 201 (version "2.16")
8f8b2451
AE
202 (source (origin
203 (method url-fetch)
204 (uri (string-append "mirror://gnu/units/units-" version
205 ".tar.gz"))
206 (sha256 (base32
f11d2849 207 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
8f8b2451 208 (build-system gnu-build-system)
0498d248 209 (inputs
a2549713
EB
210 `(("readline" ,readline)
211 ("python" ,python-wrapper) ;for 'units_cur' script
0498d248
EB
212 ("python-requests" ,python-requests)))
213 (arguments
214 `(#:phases (modify-phases %standard-phases
215 (add-after 'install 'wrap-units_cur
216 (lambda* (#:key outputs #:allow-other-keys)
217 (let* ((out (assoc-ref outputs "out"))
218 (bin (string-append out "/bin")))
219 (wrap-program (string-append bin "/units_cur")
220 `("PYTHONPATH" ":" prefix
221 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
222 #t))))))
8f8b2451
AE
223 (synopsis "Conversion between thousands of scales")
224 (description
574e86f9 225 "GNU Units converts numeric quantities between units of measure. It
7c125ce0
AK
226can handle scale changes through adaptive usage of standard scale
227prefixes (micro-, kilo-, etc.). It can also handle nonlinear
228conversions such as Fahrenheit to Celsius. Its interpreter is powerful
229enough to be used effectively as a scientific calculator.")
8f8b2451 230 (license license:gpl3+)
6fd52309 231 (home-page "https://www.gnu.org/software/units/")))
c9dfa3c7 232
61a529b4
RW
233(define-public double-conversion
234 (package
235 (name "double-conversion")
236 (version "1.1.5")
237 (source (origin
238 (method url-fetch)
239 (uri (string-append
240 "https://github.com/floitsch/double-conversion/archive/v"
241 version ".tar.gz"))
242 (file-name (string-append name "-" version ".tar.gz"))
243 (sha256
244 (base32
245 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
246 (build-system cmake-build-system)
247 (arguments
248 '(#:test-target "test"
249 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
250 "-DBUILD_TESTING=ON")))
251 (home-page "https://github.com/floitsch/double-conversion")
252 (synopsis "Conversion routines for IEEE doubles")
253 (description
254 "The double-conversion library provides binary-decimal and decimal-binary
255routines for IEEE doubles. The library consists of efficient conversion
256routines that have been extracted from the V8 JavaScript engine.")
257 (license license:bsd-3)))
258
182d6311
ML
259(define-public dionysus
260 (package
261 (name "dionysus")
262 (version "1.3.0")
263 (source (origin
264 (method url-fetch)
265 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
266 ".tar.gz"))
267 (sha256
268 (base32
269 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
270 (build-system gnu-build-system)
271 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
272 (synopsis "Local search for universal constants and scientific values")
273 (description
274 "GNU Dionysus is a convenient system for quickly retrieving the values of
275mathematical constants used in science and engineering. Values can be
276searched using a simple command-line tool, choosing from three databases:
277universal constants, atomic numbers, and constants related to
278semiconductors.")
279 (license license:gpl3+)
6fd52309 280 (home-page "https://www.gnu.org/software/dionysus/")))
182d6311 281
88bd1804
AE
282(define-public gsl
283 (package
284 (name "gsl")
f885fc05 285 (version "2.4")
ab2cc5cd
LC
286 (source (origin
287 (method url-fetch)
288 (uri (string-append "mirror://gnu/gsl/gsl-"
289 version ".tar.gz"))
290 (sha256
291 (base32
f885fc05 292 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
ab2cc5cd 293 (patches (search-patches "gsl-test-i686.patch"))))
88bd1804 294 (build-system gnu-build-system)
71e0f288 295 (arguments
f885fc05 296 `(;; Currently there are numerous tests that fail on "exotic"
6f766069
EF
297 ;; architectures such as aarch64 and ppc64le.
298 ,@(if (string-prefix? "aarch64-linux"
299 (or (%current-target-system) (%current-system)))
300 '(#:tests? #f)
301 '())))
302 (home-page "https://www.gnu.org/software/gsl/")
88bd1804
AE
303 (synopsis "Numerical library for C and C++")
304 (description
a22dc0c4
LC
305 "The GNU Scientific Library is a library for numerical analysis in C
306and C++. It includes a wide range of mathematical routines, with over 1000
307functions in total. Subject areas covered by the library include:
308differential equations, linear algebra, Fast Fourier Transforms and random
309numbers.")
88bd1804
AE
310 (license license:gpl3+)))
311
ba1be533
BW
312(define-public ocaml-gsl
313 (package
314 (name "ocaml-gsl")
315 (version "1.19.3")
316 (source
317 (origin
318 (method url-fetch)
319 (uri
320 (string-append
321 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
322 version"/gsl-ocaml-" version ".tar.gz"))
323 (sha256
324 (base32
325 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
326 (build-system ocaml-build-system)
327 (inputs
328 `(("gsl" ,gsl)))
329 (home-page "https://mmottl.github.io/gsl-ocaml")
330 (synopsis "Bindings to the GNU Scientific Library")
331 (description
332 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
333the OCaml language.")
334 (license license:gpl3+)))
335
7adaab9f
BW
336(define-public ocaml4.01-gsl
337 (package-with-ocaml4.01 ocaml-gsl))
338
b92eee75
AE
339(define-public glpk
340 (package
341 (name "glpk")
dec2ade1 342 (version "4.64")
b92eee75
AE
343 (source
344 (origin
345 (method url-fetch)
346 (uri (string-append "mirror://gnu/glpk/glpk-"
347 version ".tar.gz"))
348 (sha256
349 (base32
dec2ade1 350 "096cqgjc7vkq6wd8znhcxjbs1s2rym3qf753fqxrrq531vs6g4jk"))))
b92eee75
AE
351 (build-system gnu-build-system)
352 (inputs
353 `(("gmp" ,gmp)))
354 (arguments
355 `(#:configure-flags '("--with-gmp")))
82110ef6 356 (home-page "https://www.gnu.org/software/glpk/")
79c311b8 357 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
358 (description
359 "GLPK is a C library for solving large-scale linear programming (LP),
360mixed integer programming (MIP), and other related problems. It supports the
361GNU MathProg modeling language, a subset of the AMPL language, and features a
362translator for the language. In addition to the C library, a stand-alone
363LP/MIP solver is included in the package.")
364 (license license:gpl3+)))
365
b146763a
AE
366(define-public 4ti2
367 (package
368 (name "4ti2")
369 (version "1.6.7")
370 (source
371 (origin
372 (method url-fetch)
373 (uri (string-append "http://www.4ti2.de/version_" version
374 "/4ti2-" version ".tar.gz"))
375 (sha256
376 (base32
377 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
378 (build-system gnu-build-system)
379 (native-inputs
380 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
381 (inputs
382 `(("glpk" ,glpk)
383 ("gmp" ,gmp)))
384 (home-page "http://www.4ti2.de/")
385 (synopsis "Mathematical tool suite for problems on linear spaces")
386 (description
387 "4ti2 implements algorithms for solving algebraic, geometric and
388combinatorial problems on linear spaces. Among others, it solves systems
389of linear equations, computes extreme rays of polyhedral cones, solves
390integer programming problems and computes Markov bases for statistics.")
391 (license license:gpl2+)))
392
53696f10
AE
393(define-public cddlib
394 (package
395 (name "cddlib")
396 (version "0.94h")
397 (source
398 (origin
399 (method url-fetch)
182dde82 400 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
53696f10
AE
401 (string-delete #\. version) ".tar.gz"))
402 (sha256
403 (base32
404 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
405 (build-system gnu-build-system)
406 (inputs
407 `(("gmp" ,gmp)))
408 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
409 (synopsis "Library for convex hulls and extreme rays of polyhedra")
410 (description
411 "The C-library cddlib implements the Double Description Method of
412Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
413rays of a general convex polyhedron given by a system of linear inequalities
414in arbitrary dimension. It can also be used for the converse operation of
415computing convex hulls.")
416 (license license:gpl2+)))
417
865a69dd
RW
418(define-public arpack-ng
419 (package
420 (name "arpack-ng")
421 (version "3.2.0")
422 (source
423 (origin
424 (method url-fetch)
425 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
426 version ".tar.gz"))
f586c877 427 (file-name (string-append name "-" version ".tar.gz"))
865a69dd
RW
428 (sha256
429 (base32
430 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
431 (build-system gnu-build-system)
432 (home-page "https://github.com/opencollab/arpack-ng")
433 (inputs
434 `(("lapack" ,lapack)
19afbea1 435 ("fortran" ,gfortran)))
865a69dd
RW
436 (synopsis "Fortran subroutines for solving eigenvalue problems")
437 (description
438 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
439large scale eigenvalue problems.")
166191b3 440 (license (license:non-copyleft "file://COPYING"
865a69dd
RW
441 "See COPYING in the distribution."))))
442
8c94c886
EB
443(define-public arpack-ng-openmpi
444 (package (inherit arpack-ng)
445 (name "arpack-ng-openmpi")
446 (inputs
447 `(("mpi" ,openmpi)
448 ,@(package-inputs arpack-ng)))
449 (arguments `(#:configure-flags '("--enable-mpi")))
450 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
451
da95c817
NK
452(define-public lapack
453 (package
454 (name "lapack")
ef39a177 455 (version "3.7.1")
da95c817
NK
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append "http://www.netlib.org/lapack/lapack-"
460 version ".tgz"))
461 (sha256
462 (base32
7c0d4c3a 463 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
da95c817
NK
464 (build-system cmake-build-system)
465 (home-page "http://www.netlib.org/lapack/")
19afbea1 466 (inputs `(("fortran" ,gfortran)
da95c817
NK
467 ("python" ,python-2)))
468 (arguments
3ab869b6
LC
469 `(#:configure-flags (list
470 ;; Install to PREFIX/lib (the default is
471 ;; PREFIX/lib64).
472 (string-append "-DCMAKE_INSTALL_LIBDIR="
473 (assoc-ref %outputs "out")
474 "/lib")
11f0c4e8 475
3ab869b6
LC
476 "-DBUILD_SHARED_LIBS:BOOL=YES"
477 "-DLAPACKE=ON"
478
479 ;; Build the 'LAPACKE_clatms' functions.
480 "-DLAPACKE_WITH_TMG=ON")
dc1d3cde
KK
481 #:phases
482 (modify-phases %standard-phases
483 (add-before 'check 'patch-python
484 (lambda* (#:key inputs #:allow-other-keys)
485 (let ((python (assoc-ref inputs "python")))
486 (substitute* "lapack_testing.py"
487 (("/usr/bin/env python") python)))
488 #t)))))
da95c817
NK
489 (synopsis "Library for numerical linear algebra")
490 (description
491 "LAPACK is a Fortran 90 library for solving the most commonly occurring
492problems in numerical linear algebra.")
166191b3 493 (license (license:non-copyleft "file://LICENSE"
da95c817 494 "See LICENSE in the distribution."))))
73fed4f8 495
b509efb3
TF
496(define-public lapack-3.5
497 (package
498 (inherit lapack)
499 (version "3.5.0")
500 (source
501 (origin
502 (method url-fetch)
503 (uri (string-append "http://www.netlib.org/lapack/lapack-"
504 version ".tgz"))
505 (sha256
506 (base32
507 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
508
e1ff597a
EB
509(define-public scalapack
510 (package
511 (name "scalapack")
512 (version "2.0.2")
513 (source
514 (origin
515 (method url-fetch)
516 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
517 version ".tgz"))
518 (sha256
519 (base32
520 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
521 (build-system cmake-build-system)
522 (inputs
523 `(("mpi" ,openmpi)
524 ("fortran" ,gfortran)
525 ("lapack" ,lapack))) ;for testing only
526 (arguments
527 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
528 (home-page "http://www.netlib.org/scalapack/")
529 (synopsis "Library for scalable numerical linear algebra")
530 (description
531 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
532routines on parallel distributed memory machines. ScaLAPACK solves dense and
533banded linear systems, least squares problems, eigenvalue problems, and
534singular value problems.")
535 (license (license:bsd-style "file://LICENSE"
536 "See LICENSE in the distribution."))))
537
73fed4f8 538(define-public gnuplot
5f800540
KK
539 (package
540 (name "gnuplot")
7d873e0c 541 (version "5.0.6")
5f800540
KK
542 (source (origin
543 (method url-fetch)
544 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
545 version "/gnuplot-"
546 version ".tar.gz"))
547 (sha256
548 (base32
7d873e0c 549 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
5f800540
KK
550 (build-system gnu-build-system)
551 (inputs `(("readline" ,readline)
552 ("cairo" ,cairo)
553 ("pango" ,pango)
6e64766a
DM
554 ("gd" ,gd)
555 ("lua" ,lua)))
612a387f
RW
556 (native-inputs
557 `(("pkg-config" ,pkg-config)
558 ("texlive" ,texlive-tiny)))
5f800540
KK
559 (home-page "http://www.gnuplot.info")
560 (synopsis "Command-line driven graphing utility")
561 (description "Gnuplot is a portable command-line driven graphing
35b9e423 562utility. It was originally created to allow scientists and students to
73fed4f8 563visualize mathematical functions and data interactively, but has grown to
35b9e423 564support many non-interactive uses such as web scripting. It is also used as a
73fed4f8 565plotting engine by third-party applications like Octave.")
5f800540
KK
566 ;; X11 Style with the additional restriction that derived works may only be
567 ;; distributed as patches to the original.
568 (license (license:fsf-free
569 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
668c06ac 570
32f70e1f
TD
571(define-public gctp
572 (package
573 (name "gctp")
574 (version "2.0.0")
575 (source
576 (origin
577 (method url-fetch)
578 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
579 version ".tar.gz"))
580 (file-name (string-append name "-" version ".tar.gz"))
581 (sha256
582 (base32
583 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
584 (native-inputs
585 `(("fortran" ,gfortran)))
586 (build-system gnu-build-system)
587 (synopsis "General Cartographic Transformation Package (GCTP)")
588 (description
589 "The General Cartographic Transformation Package (GCTP) is a system of
590software routines designed to permit the transformation of coordinate pairs
591from one map projection to another. The GCTP is the standard computer
592software used by the National Mapping Division for map projection
593computations.")
594 (home-page "https://github.com/OkoSanto/GCTP")
0f7cd95b 595 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
32f70e1f 596
becbbefc
TD
597(define-public hdf4
598 (package
599 (name "hdf4")
0abf5264 600 (version "4.2.13")
becbbefc
TD
601 (source
602 (origin
603 (method url-fetch)
604 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
605 version "/src/hdf-" version ".tar.bz2"))
606 (sha256
0abf5264 607 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
15ca49b2
AE
608 (patches (search-patches "hdf4-architectures.patch"
609 "hdf4-reproducibility.patch"
becbbefc 610 "hdf4-shared-fortran.patch"))))
becbbefc
TD
611 (build-system gnu-build-system)
612 (native-inputs
613 `(("gfortran" ,gfortran)
614 ("bison" ,bison)
615 ("flex" ,flex)))
616 (inputs
617 `(("zlib" ,zlib)
618 ("libjpeg" ,libjpeg)))
619 (arguments
620 `(#:parallel-tests? #f
621 #:configure-flags '("--enable-shared")
622 #:phases
623 (modify-phases %standard-phases
953a12fa
EF
624 ;; This is inspired by two of Debian's patches.
625 (add-before 'configure 'add-more-aarch64-support
626 (lambda _
627 (substitute* '("mfhdf/ncgen/ncgen.l"
628 "mfhdf/ncgen/ncgenyy.c"
629 "mfhdf/libsrc/netcdf.h.in")
630 (("AIX5L64") "__aarch64__"))
631 #t))
becbbefc
TD
632 (add-before 'configure 'patchbuild
633 (lambda _
634 (substitute*
635 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
636 (("/bin/rm") "rm")
637 (("/bin/mkdir") "mkdir"))
638 (substitute* (find-files "." "^Makefile\\.in$")
639 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
640-R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
641 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
642-R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
953a12fa 643-R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
e464b455
TD
644 #t))
645 (add-after 'configure 'patch-settings
646 (lambda _
647 ;; libhdf4.settings contains the full path of the
648 ;; compilers used, and its contents are included in
649 ;; .so-files. We truncate the hashes to avoid
650 ;; unnecessary store references to those compilers:
651 (substitute* "libhdf4.settings"
652 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
653 (string-append prefix (string-take hash 10) "...")))
654 #t))
655 )))
becbbefc
TD
656 (home-page "https://www.hdfgroup.org/products/hdf4/")
657 (synopsis
658 "Library and multi-object file format for storing and managing data")
659 (description "HDF4 is a library and multi-object file format for storing
660and managing data between machines. HDF4 is an older hierarchical data format,
661incompatible with HDF5.")
662 (license
663 (license:non-copyleft
664 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
665
666(define-public hdf4-alt
667 (package
668 (inherit hdf4)
669 (name "hdf4-alt")
670 (arguments
671 (substitute-keyword-arguments (package-arguments hdf4)
672 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
673 (synopsis
674 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
675
7ee3f1a2
JD
676(define-public hdf5
677 (package
678 (name "hdf5")
2da63064 679 (version "1.8.19")
7ee3f1a2
JD
680 (source
681 (origin
682 (method url-fetch)
2da63064
TD
683 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
684 "hdf5-" (version-major+minor version)
685 "/hdf5-" version "/src/hdf5-"
dcd9d163
LF
686 version ".tar.bz2")
687 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
688 "current"
689 (apply string-append
690 (take (string-split version #\.) 2))
691 "/src/hdf5-" version ".tar.bz2")))
7ee3f1a2 692 (sha256
2da63064 693 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
b8d9c93b 694 (patches (list (search-patch "hdf5-config-date.patch")))))
7ee3f1a2 695 (build-system gnu-build-system)
12ed1216
AE
696 (inputs
697 `(("zlib" ,zlib)))
e3a1a1de
TD
698 (native-inputs
699 `(("gfortran" ,gfortran)))
700 (outputs '("out" ; core library
701 "fortran")) ; fortran interface
7ee3f1a2 702 (arguments
62126576 703 `(;; Some of the users, notably Flann, need the C++ interface.
e3a1a1de
TD
704 #:configure-flags '("--enable-cxx"
705 "--enable-fortran"
706 "--enable-fortran2003")
62126576
LC
707
708 #:phases
f622e212
EB
709 (modify-phases %standard-phases
710 (add-before 'configure 'patch-configure
e3a1a1de 711 (lambda* (#:key outputs #:allow-other-keys)
f622e212 712 (substitute* "configure"
b8d9c93b 713 (("/bin/mv") "mv"))
e3a1a1de
TD
714 (substitute* "fortran/src/Makefile.in"
715 (("libhdf5_fortran_la_LDFLAGS =")
716 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
717 (assoc-ref outputs "fortran") "/lib")))
718 (substitute* "hl/fortran/src/Makefile.in"
719 (("libhdf5hl_fortran_la_LDFLAGS =")
720 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
721 (assoc-ref outputs "fortran") "/lib")))
b8d9c93b 722 #t))
fd0378a1
TD
723 (add-after 'configure 'patch-settings
724 (lambda _
725 ;; libhdf5.settings contains the full path of the
726 ;; compilers used, and its contents are included in
727 ;; libhdf5.so. We truncate the hashes to avoid
728 ;; unnecessary store references to those compilers:
729 (substitute* "src/libhdf5.settings"
730 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
731 (string-append prefix (string-take hash 10) "...")))
732 #t))
f622e212
EB
733 (add-after 'install 'patch-references
734 (lambda* (#:key inputs outputs #:allow-other-keys)
735 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
736 (zlib (assoc-ref inputs "zlib")))
737 (substitute* (find-files bin "h5p?cc")
738 (("-lz" lib)
739 (string-append "-L" zlib "/lib " lib)))
e3a1a1de
TD
740 #t)))
741 (add-after 'install 'split
742 (lambda* (#:key inputs outputs #:allow-other-keys)
743 ;; Move all fortran-related files
744 (let* ((out (assoc-ref outputs "out"))
745 (bin (string-append out "/bin"))
746 (lib (string-append out "/lib"))
747 (inc (string-append out "/include"))
748 (ex (string-append out "/share/hdf5_examples/fortran"))
749 (fort (assoc-ref outputs "fortran"))
750 (fbin (string-append fort "/bin"))
751 (flib (string-append fort "/lib"))
752 (finc (string-append fort "/include"))
753 (fex (string-append fort "/share/hdf5_examples/fortran")))
754 (mkdir-p fbin)
755 (mkdir-p flib)
756 (mkdir-p finc)
757 (mkdir-p fex)
758 (rename-file (string-append bin "/h5fc")
759 (string-append fbin "/h5fc"))
760 (for-each (lambda (file)
761 (rename-file file
762 (string-append flib "/" (basename file))))
763 (find-files lib ".*fortran.*"))
764 (for-each (lambda (file)
765 (rename-file file
766 (string-append finc "/" (basename file))))
767 (find-files inc ".*mod"))
768 (for-each (lambda (file)
769 (rename-file file
770 (string-append fex "/" (basename file))))
771 (find-files ex ".*"))
772 (delete-file-recursively ex))
773 #t)))))
7ee3f1a2 774 (home-page "http://www.hdfgroup.org")
516e93f8 775 (synopsis "Management suite for extremely large and complex data")
7ee3f1a2
JD
776 (description "HDF5 is a suite that makes possible the management of
777extremely large and complex data collections.")
d4bf49b1
EB
778 (license (license:x11-style
779 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2 780
2fd26d05
TD
781(define-public hdf-java
782 (package
783 (name "hdf-java")
784 (version "3.3.2")
785 (source
786 (origin
787 (method url-fetch)
788 (uri (string-append
789 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
790 version "/src/CMake-hdfjava-" version ".tar.gz"))
791 (sha256
792 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
793 (modules '((guix build utils)))
794 (snippet ; Make sure we don't use the bundled sources and binaries.
795 `(begin
796 (for-each delete-file
797 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
798 "HDF4.tar.gz" "HDF5.tar.gz"))
799 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))))))
800 (build-system gnu-build-system)
801 (native-inputs
802 `(("jdk" ,icedtea "jdk")
803 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
804 ;; For tests:
805 ("hamcrest-core" ,java-hamcrest-core)
806 ("junit" ,java-junit)
807 ("slf4j-simple" ,java-slf4j-simple)))
808 (inputs
809 `(("hdf4" ,hdf4)
810 ("hdf5" ,hdf5)
811 ("zlib" ,zlib)
812 ("libjpeg" ,libjpeg)
813 ("slf4j-api" ,java-slf4j-api)))
814 (arguments
815 `(#:configure-flags
816 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
817 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
818 (assoc-ref %build-inputs "jdk") "/lib" )
819 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
820 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
821
822 #:make-flags
823 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
824 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
825 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
826 (string-append "JPEGLIB="
827 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
828 "LLEXT=so")
829
830 #:phases
831 (modify-phases %standard-phases
832 (add-before 'configure 'chdir-to-source
833 (lambda _ (chdir ,(string-append "hdfjava-" version))))
834 (add-before 'configure 'patch-build
835 (lambda* (#:key inputs outputs #:allow-other-keys)
836 (substitute* "configure"
837 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
838 (("/bin/cat") (which "cat")))
839 ;; Set classpath for compilation
840 (substitute* '("hdf/hdf5lib/Makefile.in"
841 "hdf/hdf5lib/exceptions/Makefile.in"
842 "hdf/hdflib/Makefile.in")
843 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
844 (string-append (assoc-ref inputs "slf4j-api")
845 "/share/java/slf4j-api.jar")))
846 ;; Replace outdated config.sub and config.guess:
847 (with-directory-excursion "config"
848 (for-each (lambda (file)
849 (copy-file
850 (string-append (assoc-ref inputs "automake")
851 "/share/automake-1.15/" file) file))
852 '("config.sub" "config.guess")))
853 (mkdir-p (string-append (assoc-ref outputs "out")))
854 ;; Set classpath for tests
855 (let* ((build-dir (getcwd))
856 (lib (string-append build-dir "/lib"))
857 (jhdf (string-append lib "/jhdf.jar"))
858 (jhdf5 (string-append lib "/jhdf5.jar"))
859 (testjars
860 (map (lambda (i)
861 (string-append (assoc-ref inputs i)
862 "/share/java/" i ".jar"))
863 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
864 (class-path
865 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
866
867 (substitute* '("test/hdf5lib/Makefile.in"
868 "test/hdf5lib/junit.sh.in"
869 "examples/runExample.sh.in")
870 (("/usr/bin/test")
871 (string-append (assoc-ref inputs "coreutils")
872 "/bin/test"))
873 (("/usr/bin/uname")
874 (string-append (assoc-ref inputs "coreutils")
875 "/bin/uname"))
876 (("CLASSPATH=[^\n]*")
877 (string-append "CLASSPATH=" class-path)))
878 (setenv "CLASSPATH" class-path))
879 #t))
880 (add-before 'check 'build-examples
881 (lambda _
882 (zero? (apply system* `("javac"
883 ,@(find-files "examples" ".*\\.java")))))))
884
885 #:parallel-build? #f
886
887 #:parallel-tests? #f ))
888 (home-page "https://support.hdfgroup.org/products/java")
889 (synopsis "Java interface for the HDF4 and HDF5 libraries")
890 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
891the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
892implemented in C.")
893
894 ;; BSD-style license:
895 (license (license:x11-style
896 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
897/current/src/unpacked/COPYING"))))
898
d3c4f3bb
TD
899(define-public hdf-eos2
900 (package
901 (name "hdf-eos2")
902 (version "19.1.0")
903 (source
904 (origin
905 (method url-fetch)
906 (uri "ftp://edhs1.gsfc.nasa.gov\
907/edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
908 (sha256
909 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
910 (patches (search-patches "hdf-eos2-remove-gctp.patch"
911 "hdf-eos2-build-shared.patch"
912 "hdf-eos2-fortrantests.patch"))))
913 (build-system gnu-build-system)
914 (native-inputs
915 `(("gfortran" ,gfortran)))
916 (inputs
917 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
918 ("zlib" ,zlib)
919 ("libjpeg" ,libjpeg)
920 ("gctp" ,gctp)))
921 (arguments
922 `( #:configure-flags '("--enable-install-include" "--enable-shared"
923 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
924 #:parallel-tests? #f))
925 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
926 (synopsis "HDF4-based data format for NASA's Earth Observing System")
927 (description "HDF-EOS2 is a software library built on HDF4 which supports
928the construction of data structures used in NASA's Earth Observing
929System (Grid, Point and Swath).")
930
931 ;; Source files carry a permissive license header.
932 (license (license:non-copyleft home-page))))
933
0f43f835
TD
934(define-public hdf-eos5
935 (package
936 (name "hdf-eos5")
937 (version "1.15")
938 (source (origin
939 (method url-fetch)
940 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
941/edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
942 (sha256
943 (base32
944 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
945 (patches (search-patches "hdf-eos5-build-shared.patch"
946 "hdf-eos5-remove-gctp.patch"
947 "hdf-eos5-fix-szip.patch"
948 "hdf-eos5-fortrantests.patch"))))
949 (native-inputs
950 `(("gfortran" ,gfortran)))
951 (build-system gnu-build-system)
952 (inputs
953 `(("hdf5" ,hdf5)
954 ("zlib" ,zlib)
955 ("gctp" ,gctp)))
956 (arguments
957 `(#:configure-flags '("--enable-install-include" "--enable-shared"
958 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
959 #:parallel-tests? #f))
960 (synopsis "HDF5-based data format for NASA's Earth Observing System")
961 (description
962 "HDF-EOS5 is a software library built on HDF5 to support the construction
963of data structures used in NASA's Earth Observing System (Grid, Point and
964Swath).")
965 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
966
967 ;; Source files carry a permissive license header.
968 (license (license:non-copyleft home-page))))
969
c8378eea
EB
970(define-public hdf5-parallel-openmpi
971 (package (inherit hdf5)
972 (name "hdf5-parallel-openmpi")
973 (inputs
974 `(("mpi" ,openmpi)
975 ,@(package-inputs hdf5)))
976 (arguments
977 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
978 ,@(package-arguments hdf5))
979 ((#:phases phases)
980 `(modify-phases ,phases
981 (add-before 'check 'patch-tests
982 (lambda _
983 ;; OpenMPI's mpirun will exit with non-zero status if it
984 ;; detects an "abnormal termination", i.e. any process not
985 ;; calling MPI_Finalize(). Since the test is explicitely
986 ;; avoiding MPI_Finalize so as not to have at_exit and thus
987 ;; H5C_flush_cache from being called, mpirun will always
988 ;; complain, so turn this test off.
989 (substitute* "testpar/Makefile"
990 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
991 (string-append front back "\n")))
992 (substitute* "tools/h5diff/testph5diff.sh"
993 (("/bin/sh") (which "sh")))
994 #t))))))
995 (synopsis "Management suite for data with parallel IO support")))
996
00775104
EB
997(define-public h5check
998 (package
999 (name "h5check")
1000 (version "2.0.1")
1001 (source
1002 (origin
1003 (method url-fetch)
1004 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1005 "h5check/src/h5check-" version ".tar.gz"))
1006 (sha256
1007 (base32
1008 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1009 (build-system gnu-build-system)
1010 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1011 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1012 (synopsis "HDF5 format checker")
1013 (description "@code{h5check} is a validation tool for verifying that an
1014HDF5 file is encoded according to the HDF File Format Specification.")
1015 (license (license:x11-style "file://COPYING"))))
1016
a53d6719
JD
1017(define-public itpp
1018 (package
1019 (name "itpp")
1020 (version "4.3.1")
1021 (source (origin
1022 (method url-fetch)
1023 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1024 version "/itpp-"
1025 version ".tar.gz"))
1026 (sha256
1027 (base32
1028 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1029 (build-system cmake-build-system)
1030 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1031 (inputs `(("lapack" ,lapack)
1032 ("fftw" ,fftw)))
3a4d5df2
RW
1033 ;; FIXME: Even though the fonts are available dvips complains:
1034 ;; "Font cmmi10 not found; characters will be left blank."
1035 (native-inputs
1036 `(("texlive" ,texlive-tiny)
1037 ("ghostscript" ,ghostscript)
1038 ("doxygen" ,doxygen)))
a53d6719
JD
1039 (home-page "http://itpp.sourceforge.net")
1040 (synopsis "C++ library of maths, signal processing and communication classes")
1041 (description "IT++ is a C++ library of mathematical, signal processing and
1042communication classes and functions. Its main use is in simulation of
1043communication systems and for performing research in the area of
1044communications. The kernel of the library consists of generic vector and
1045matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1046similar to MATLAB, GNU Octave or SciPy.")
1047 (license license:gpl3+)))
1048
889187a4
EB
1049(define-public netcdf
1050 (package
1051 (name "netcdf")
a4b0bfb1 1052 (version "4.4.1.1")
889187a4
EB
1053 (source
1054 (origin
1055 (method url-fetch)
1056 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1057 "netcdf-" version ".tar.gz"))
1058 (sha256
1059 (base32
a4b0bfb1
EB
1060 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1061 (patches (search-patches "netcdf-date-time.patch"
1062 "netcdf-tst_h_par.patch"))))
889187a4
EB
1063 (build-system gnu-build-system)
1064 (native-inputs
1065 `(("m4" ,m4)
1066 ("doxygen" ,doxygen)
1067 ("graphviz" ,graphviz)))
1068 (inputs
db825570
TD
1069 `(("hdf4" ,hdf4-alt)
1070 ("hdf5" ,hdf5)
1071 ("zlib" ,zlib)
1072 ("libjpeg" ,libjpeg)))
889187a4 1073 (arguments
db825570 1074 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
43d01672
TD
1075
1076 #:phases (modify-phases %standard-phases
1077 (add-before 'configure 'fix-source-date
1078 (lambda _
1079 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1080 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1081 ;; to '1st hour of the current day', and therefore makes the
1082 ;; package not reproducible.
1083 (substitute* "./configure"
1084 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1085 "date --date='@0'"))
1086 #t))
1087 (add-after 'configure 'patch-settings
1088 (lambda _
1089 ;; libnetcdf.settings contains the full filename of the compilers
1090 ;; used to build the library. We truncate the hashes of those
1091 ;; filenames to avoid unnecessary references to the corresponding
1092 ;; store items.
1093 (substitute* "libnetcdf.settings"
1094 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1095 (string-append prefix (string-take hash 10) "...")))
1096 #t)))
1097
889187a4
EB
1098 #:parallel-tests? #f)) ;various race conditions
1099 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1100 (synopsis "Library for scientific data")
1101 (description "NetCDF is an interface for scientific data access and a
1102software library that provides an implementation of the interface. The netCDF
1103library defines a machine-independent format for representing scientific data.
1104Together, the interface, library, and format support the creation, access, and
1105sharing of scientific data.")
1106 (license (license:x11-style "file://COPYRIGHT"))))
1107
1108(define-public netcdf-parallel-openmpi
1109 (package (inherit netcdf)
1110 (name "netcdf-parallel-openmpi")
1111 (inputs
1112 `(("mpi" ,openmpi)
1113 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1114 (package-inputs netcdf))))
1115 ;; TODO: Replace pkg-config references in nc-config with absolute references
1116 (arguments
1117 (substitute-keyword-arguments (package-arguments netcdf)
1118 ((#:configure-flags flags)
1119 `(cons* "CC=mpicc" "CXX=mpicxx"
1120 "--enable-parallel-tests"
1121 ;; Shared libraries not supported with parallel IO.
1122 "--disable-shared" "--with-pic"
1123 ,flags))))))
1124
300200b6
TD
1125(define-public netcdf-fortran
1126 (package
1127 (name "netcdf-fortran")
1128 (version "4.4.4")
1129 (source (origin
1130 (method url-fetch)
1131 (uri (string-append
1132 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1133 version ".tar.gz"))
1134 (sha256
1135 (base32
1136 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1137 (build-system gnu-build-system)
1138 (arguments
1139 `(#:parallel-tests? #f))
1140 (inputs
1141 `(("netcdf" ,netcdf)))
1142 (native-inputs
1143 `(("gfortran" ,gfortran)))
1144 (synopsis "Fortran interface for the netCDF library")
1145 (description (package-description netcdf))
1146 (home-page (package-home-page netcdf))
1147 (license (package-license netcdf))))
1148
1b39a196
RJ
1149(define-public nlopt
1150 (package
1151 (name "nlopt")
1152 (version "2.4.2")
1153 (source (origin
1154 (method url-fetch)
1155 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1156 version ".tar.gz"))
1157 (sha256
1158 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1159 (build-system gnu-build-system)
1160 (arguments
1161 `(;; Shared libraries are not built by default. They are required to
1162 ;; build the Guile, Octave, and Python bindings.
1163 #:configure-flags '("--enable-shared")
1164
1165 #:phases
1166 (modify-phases %standard-phases
1167 (add-before 'configure 'set-libnlopt-file-name
1168 (lambda* (#:key outputs #:allow-other-keys)
1169 ;; Make sure the Scheme module refers to the library by its
1170 ;; absolute file name (we cannot do that from a snippet
1171 ;; because the expansion of @libdir@ contains
1172 ;; ${exec_prefix}.)
1173 (let ((out (assoc-ref outputs "out")))
1174 (substitute* "swig/nlopt.scm.in"
1175 (("libnlopt")
1176 (string-append out "/lib/libnlopt")))
1177 #t))))))
1178 (inputs `(("guile" ,guile-2.0)))
1179 (native-inputs `(("pkg-config" ,pkg-config)))
1180 (home-page "http://ab-initio.mit.edu/wiki/")
1181 (synopsis "Library for nonlinear optimization")
1182 (description "NLopt is a library for nonlinear optimization, providing a
1183common interface for a number of different free optimization routines available
1184online as well as original implementations of various other algorithms.")
1185 (license license:lgpl2.1+)))
1186
005c787d
LC
1187(define-public ipopt
1188 (package
1189 (name "ipopt")
1190 (version "3.12.5")
1191 (source (origin
1192 (method url-fetch)
1193 (uri (string-append
1194 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1195 version".tgz"))
1196 (sha256
1197 (base32
1198 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1199 (modules '((guix build utils)))
1200 (snippet
1201 ;; Make sure we don't use the bundled software.
1202 '(delete-file-recursively "ThirdParty"))))
1203 (build-system gnu-build-system)
ad1c4537
LC
1204 (arguments
1205 '(#:phases (modify-phases %standard-phases
1206 (add-after 'install 'add--L-flags-in-ipopt.pc
1207 (lambda* (#:key inputs outputs #:allow-other-keys)
1208 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1209 ;; move it to "Libs.private" where it belongs, and add a
1210 ;; '-L' flag for LAPACK.
1211 (let ((out (assoc-ref outputs "out"))
1212 (lapack (assoc-ref inputs "lapack")))
1213 (substitute* (string-append out "/lib/pkgconfig/"
1214 "ipopt.pc")
1215 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1216 (string-append "Libs: " before " " after "\n"
1217 "Libs.private: " before
1218 "-L" lapack "/lib -llapack -lblas "
1219 after "\n")))
1220 #t))))))
005c787d
LC
1221 (native-inputs
1222 `(("gfortran" ,gfortran)))
1223 (inputs
1224 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
ad1c4537 1225 `(("lapack" ,lapack))) ;for both libblas and liblapack
005c787d
LC
1226 (home-page "http://www.coin-or.org")
1227 (synopsis "Large-scale nonlinear optimizer")
1228 (description
1229 "The Interior Point Optimizer (IPOPT) is a software package for
1230large-scale nonlinear optimization. It provides C++, C, and Fortran
1231interfaces.")
1232 (license license:epl1.0)))
1233
f9940ef1
LC
1234(define-public ceres
1235 (package
1236 (name "ceres-solver")
6ad0c92d 1237 (version "1.13.0")
f9940ef1
LC
1238 (home-page "http://ceres-solver.org/")
1239 (source (origin
1240 (method url-fetch)
1241 (uri (string-append home-page "ceres-solver-"
1242 version ".tar.gz"))
1243 (sha256
1244 (base32
6ad0c92d 1245 "1kbxgab3q1vgyq7hjqasr1lji4b2sgn7ss351amklkb3jyhr1x0x"))))
f9940ef1
LC
1246 (build-system cmake-build-system)
1247 (arguments
1248 ;; TODO: Build HTML user documentation and install separately.
bc3a2e35 1249 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
f9940ef1
LC
1250 "-DBUILD_SHARED_LIBS=ON")
1251
1252 #:phases (modify-phases %standard-phases
1253 (add-before 'configure 'set-library-directory
1254 (lambda _
1255 ;; Install libraries to lib/, not lib64/.
1256 (substitute* "internal/ceres/CMakeLists.txt"
1257 (("set\\(LIB_SUFFIX \"64\"\\)")
1258 "set(LIB_SUFFIX \"\")"))
1259 #t)))))
1260 (native-inputs
1261 `(("pkg-config" ,pkg-config)))
468e0b18
LC
1262 (propagated-inputs
1263 `(("glog" ,glog))) ;for #include <glog/glog.h>
f9940ef1
LC
1264 (inputs
1265 `(("eigen" ,eigen)
1266 ("blas" ,openblas)
1267 ("lapack" ,lapack)
1268 ("suitesparse" ,suitesparse)
1269 ("gflags" ,gflags)))
1270 (synopsis "C++ library for solving large optimization problems")
1271 (description
1272 "Ceres Solver is a C++ library for modeling and solving large,
1273complicated optimization problems. It is a feature rich, mature and
1274performant library which has been used in production since 2010. Ceres Solver
1275can solve two kinds of problems:
1276@enumerate
1277@item non-linear least squares problems with bounds constraints;
1278@item general unconstrained optimization problems.
1279@end enumerate\n")
1280 (license license:bsd-3)))
1281
668c06ac 1282;; For a fully featured Octave, users are strongly recommended also to install
5ca4fe96 1283;; the following packages: less, ghostscript, gnuplot.
668c06ac
JD
1284(define-public octave
1285 (package
1286 (name "octave")
e9d60eba 1287 (version "4.2.1")
668c06ac
JD
1288 (source
1289 (origin
1290 (method url-fetch)
1291 (uri (string-append "mirror://gnu/octave/octave-"
f5a077b1 1292 version ".tar.lz"))
668c06ac
JD
1293 (sha256
1294 (base32
e9d60eba 1295 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
668c06ac
JD
1296 (build-system gnu-build-system)
1297 (inputs
1298 `(("lapack" ,lapack)
1299 ("readline" ,readline)
181170c6 1300 ("gl2ps" ,gl2ps)
668c06ac 1301 ("glpk" ,glpk)
1ec78e9d
EB
1302 ("fftw" ,fftw)
1303 ("fftwf" ,fftwf)
1304 ("arpack" ,arpack-ng)
668c06ac
JD
1305 ("pcre" ,pcre)
1306 ("fltk" ,fltk)
1307 ("fontconfig" ,fontconfig)
1308 ("freetype" ,freetype)
40029cbe 1309 ("hdf5" ,hdf5)
668c06ac
JD
1310 ("libxft" ,libxft)
1311 ("mesa" ,mesa)
1ec78e9d 1312 ("glu" ,glu)
9f913401
AI
1313 ("zlib" ,zlib)
1314 ("curl" ,curl)
5ca4fe96 1315 ("texinfo" ,texinfo)
9f913401 1316 ("graphicsmagick" ,graphicsmagick)))
668c06ac 1317 (native-inputs
f5a077b1
EF
1318 `(("lzip" ,lzip)
1319 ("gfortran" ,gfortran)
668c06ac
JD
1320 ("pkg-config" ,pkg-config)
1321 ("perl" ,perl)
1ec78e9d
EB
1322 ;; The following inputs are not actually used in the build process.
1323 ;; However, the ./configure gratuitously tests for their existence and
1324 ;; assumes that programs not present at build time are also not, and
1325 ;; can never be, available at run time! If these inputs are therefore
1326 ;; not present, support for them will be built out. However, Octave
1327 ;; will still run without them, albeit without the features they
668c06ac
JD
1328 ;; provide.
1329 ("less" ,less)
668c06ac
JD
1330 ("ghostscript" ,ghostscript)
1331 ("gnuplot" ,gnuplot)))
1332 (arguments
b7b27a8f
KY
1333 `(#:configure-flags
1334 (list (string-append "--with-shell="
1335 (assoc-ref %build-inputs "bash")
5ca4fe96
AI
1336 "/bin/sh"))
1337 #:phases
1338 (modify-phases %standard-phases
1339 (add-after 'configure 'configure-makeinfo
1340 (lambda* (#:key inputs #:allow-other-keys)
1341 (substitute* "libinterp/corefcn/help.cc"
1342 (("Vmakeinfo_program = \"makeinfo\"")
1343 (string-append "Vmakeinfo_program = \""
1344 (assoc-ref inputs "texinfo")
1345 "/bin/makeinfo\"")))
1346 #t)))))
f5a077b1 1347 (home-page "https://www.gnu.org/software/octave/")
668c06ac 1348 (synopsis "High-level language for numerical computation")
1ec78e9d
EB
1349 (description "GNU Octave is a high-level interpreted language that is
1350specialized for numerical computations. It can be used for both linear and
1351non-linear applications and it provides great support for visualizing results.
1352Work may be performed both at the interactive command-line as well as via
1353script files.")
668c06ac 1354 (license license:gpl3+)))
3de01d3f 1355
5d4bd4cc
PG
1356(define-public opencascade-oce
1357 (package
1358 (name "opencascade-oce")
1359 (version "0.17.2")
1360 (source
1361 (origin
1362 (method url-fetch)
1363 (uri (string-append
1364 "https://github.com/tpaviot/oce/archive/OCE-"
1365 version
1366 ".tar.gz"))
1367 (sha256
1368 (base32
1369 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1370 (build-system cmake-build-system)
1371 (arguments
1372 '(#:configure-flags
1373 (list "-DOCE_TESTING:BOOL=ON"
1374 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1375 "-DOCE_DRAW:BOOL=ON"
1376 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1377 (assoc-ref %outputs "out"))
1378 "-UCMAKE_INSTALL_RPATH")))
1379 (inputs
1380 `(("freetype" ,freetype)
1381 ("glu" ,glu)
1382 ("libxmu" ,libxmu)
1383 ("mesa" ,mesa)
1384 ("tcl" ,tcl)
1385 ("tk" ,tk)))
1386 (native-inputs
1387 `(("python" ,python-wrapper)))
1388 (home-page "https://github.com/tpaviot/oce")
1389 (synopsis "Libraries for 3D modeling and numerical simulation")
1390 (description
1391 "Open CASCADE is a set of libraries for the development of applications
1392dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1393C++ class libraries providing services for 3D surface and solid modeling, CAD
1394data exchange, and visualization. It is used for development of specialized
1395software dealing with 3D models in design (CAD), manufacturing (CAM),
1396numerical simulation (CAE), measurement equipment (CMM), and quality
1397control (CAQ) domains.
1398
1399This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1400patches, improvements, and experiments contributed by users over the official
1401Open CASCADE library.")
1402 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1403 ; use of header files; see
1404 ; OCCT_LGPL_EXCEPTION.txt
1405 license:public-domain; files
1406 ; src/Standard/Standard_StdAllocator.hxx and
1407 ; src/NCollection/NCollection_StdAllocator.hxx
1408 license:expat; file src/OpenGl/OpenGl_glext.h
1409 license:bsd-3)))); test framework gtest
1410
3de01d3f
EB
1411(define-public gmsh
1412 (package
1413 (name "gmsh")
8a4d14fa 1414 (version "2.16.0")
3de01d3f
EB
1415 (source
1416 (origin
1417 (method url-fetch)
1c79e086 1418 (uri (string-append "http://gmsh.info/src/gmsh-"
3de01d3f
EB
1419 version "-source.tgz"))
1420 (sha256
8a4d14fa 1421 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
3de01d3f
EB
1422 (modules '((guix build utils)))
1423 (snippet
1424 ;; Remove non-free METIS code
1425 '(delete-file-recursively "contrib/Metis"))))
1426 (build-system cmake-build-system)
3de01d3f
EB
1427 (propagated-inputs
1428 `(("fltk" ,fltk)
19afbea1 1429 ("gfortran" ,gfortran)
3de01d3f 1430 ("gmp" ,gmp)
40029cbe 1431 ("hdf5" ,hdf5)
3de01d3f
EB
1432 ("lapack" ,lapack)
1433 ("mesa" ,mesa)
85f41902 1434 ("glu" ,glu)
45548139 1435 ("opencascade-oce" ,opencascade-oce)
3de01d3f
EB
1436 ("libx11" ,libx11)
1437 ("libxext" ,libxext)))
66395a61
EF
1438 (inputs
1439 `(("fontconfig" ,fontconfig)
1440 ("libxft" ,libxft)))
3de01d3f
EB
1441 (arguments
1442 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1443 "-DENABLE_BUILD_SHARED:BOOL=ON"
45548139 1444 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
3de01d3f
EB
1445 (home-page "http://www.geuz.org/gmsh/")
1446 (synopsis "3D finite element grid generator")
edf684ef
EB
1447 (description "Gmsh is a 3D finite element grid generator with a built-in
1448CAD engine and post-processor. Its design goal is to provide a fast, light
1449and user-friendly meshing tool with parametric input and advanced
1450visualization capabilities. Gmsh is built around four modules: geometry,
1451mesh, solver and post-processing. The specification of any input to these
1452modules is done either interactively using the graphical user interface or in
1453ASCII text files using Gmsh's own scripting language.")
3de01d3f 1454 (license license:gpl2+)))
b9100e2f 1455
6d5f63b6
JD
1456(define-public maxflow
1457 (package
1458 (name "maxflow")
1459 (version "3.04")
1460 (source (origin
1461 (method git-fetch)
1462 (uri (git-reference
1463 (url "https://github.com/gerddie/maxflow.git")
1464 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1465 (file-name (string-append name "-" version "-checkout"))
1466 (sha256
1467 (base32
1468 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1469 (build-system cmake-build-system)
1470 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1471 (synopsis "Library implementing Maxflow algorithm")
1472 (description "An implementation of the maxflow algorithm described in
1473@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1474Energy Minimization in Computer Vision.\n
1475Yuri Boykov and Vladimir Kolmogorov.\n
1476In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1477September 2004}")
1478 (license license:gpl3+)))
1479
b9100e2f
EB
1480(define-public petsc
1481 (package
1482 (name "petsc")
6fec298d 1483 (version "3.8.0")
b9100e2f
EB
1484 (source
1485 (origin
1486 (method url-fetch)
1487 ;; The *-lite-* tarball does not contain the *large* documentation
1488 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1489 "petsc-lite-" version ".tar.gz"))
1490 (sha256
6fec298d 1491 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
b9100e2f
EB
1492 (build-system gnu-build-system)
1493 (native-inputs
6fec298d 1494 `(("python" ,python-2)))
b9100e2f 1495 (inputs
19afbea1 1496 `(("gfortran" ,gfortran)
b9100e2f 1497 ("lapack" ,lapack)
f258212d 1498 ("superlu" ,superlu)
b9100e2f
EB
1499 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1500 ;; leaving out opengl, as configuration seems to only be for mac
1501 ))
1502 (arguments
1503 `(#:test-target "test"
9a899cce 1504 #:parallel-build? #f ;build is parallel by default
b9100e2f
EB
1505 #:configure-flags
1506 `("--with-mpi=0"
f258212d
EB
1507 "--with-openmp=1"
1508 "--with-superlu=1"
1509 ,(string-append "--with-superlu-include="
1510 (assoc-ref %build-inputs "superlu") "/include")
1511 ,(string-append "--with-superlu-lib="
1512 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
9731c412
EB
1513 #:make-flags
1514 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1515 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1516 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
b9100e2f 1517 #:phases
64dcc289
EB
1518 (modify-phases %standard-phases
1519 (replace 'configure
1520 ;; PETSc's configure script is actually a python script, so we can't
1521 ;; run it with bash.
1522 (lambda* (#:key outputs (configure-flags '())
1523 #:allow-other-keys)
1524 (let* ((prefix (assoc-ref outputs "out"))
1525 (flags `(,(string-append "--prefix=" prefix)
1526 ,@configure-flags)))
1527 (format #t "build directory: ~s~%" (getcwd))
1528 (format #t "configure flags: ~s~%" flags)
1529 (zero? (apply system* "./configure" flags)))))
1530 (add-after 'configure 'clean-local-references
9731c412 1531 (lambda* (#:key outputs #:allow-other-keys)
64dcc289
EB
1532 (let ((out (assoc-ref outputs "out")))
1533 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
b730b437
EB
1534 ;; Prevent build directory from leaking into compiled code
1535 (((getcwd)) out)
1536 ;; Scrub timestamp for reproducibility
fafd623e 1537 ((".*Libraries compiled on.*") ""))
9731c412
EB
1538 (substitute* (find-files "." "petscvariables")
1539 ;; Do not expose build machine characteristics, set to defaults.
1540 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1541 (("NPMAX = [:digit:]+") "NPMAX = 2"))
fafd623e 1542 #t)))
64dcc289 1543 (add-after 'install 'clean-install
10b11968
EB
1544 ;; Try to keep installed files from leaking build directory names.
1545 (lambda* (#:key inputs outputs #:allow-other-keys)
64dcc289 1546 (let ((out (assoc-ref outputs "out")))
10b11968 1547 (substitute* (map (lambda (file)
9a899cce 1548 (string-append out "/lib/petsc/conf/" file))
fafd623e 1549 '("petscvariables"))
10b11968
EB
1550 (((getcwd)) out))
1551 ;; Make compiler references point to the store
9a899cce 1552 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
1553 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1554 (string-append "= " (which compiler))))
10b11968
EB
1555 ;; PETSc installs some build logs, which aren't necessary.
1556 (for-each (lambda (file)
9a899cce 1557 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
1558 (when (file-exists? f)
1559 (delete-file f))))
9a899cce
EB
1560 '("configure.log" "make.log" "gmake.log"
1561 "test.log" "error.log" "RDict.db"
fafd623e 1562 "PETScBuildInternal.cmake"
10b11968 1563 ;; Once installed, should uninstall with Guix
fafd623e
EB
1564 "uninstall.py"))
1565 #t))))))
b9100e2f 1566 (home-page "http://www.mcs.anl.gov/petsc")
16ecf3ff 1567 (synopsis "Library to solve PDEs")
b9100e2f
EB
1568 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1569data structures and routines for the scalable (parallel) solution of
1570scientific applications modeled by partial differential equations.")
166191b3 1571 (license (license:non-copyleft
b9100e2f
EB
1572 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1573
1574(define-public petsc-complex
1575 (package (inherit petsc)
1576 (name "petsc-complex")
1577 (arguments
1578 (substitute-keyword-arguments (package-arguments petsc)
1579 ((#:configure-flags cf)
1580 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 1581 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 1582
d8c7eeb9
EB
1583(define-public petsc-openmpi
1584 (package (inherit petsc)
1585 (name "petsc-openmpi")
1586 (inputs
1587 `(("openmpi" ,openmpi)
1588 ,@(package-inputs petsc)))
1589 (arguments
1590 (substitute-keyword-arguments (package-arguments petsc)
1591 ((#:configure-flags cf)
1592 ``("--with-mpiexec=mpirun"
1593 ,(string-append "--with-mpi-dir="
1594 (assoc-ref %build-inputs "openmpi"))
1595 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 1596 (synopsis "Library to solve PDEs (with MPI support)")))
d8c7eeb9
EB
1597
1598(define-public petsc-complex-openmpi
1599 (package (inherit petsc-complex)
1600 (name "petsc-complex-openmpi")
1601 (inputs
1602 `(("openmpi" ,openmpi)
1603 ,@(package-inputs petsc-complex)))
1604 (arguments
1605 (substitute-keyword-arguments (package-arguments petsc-complex)
1606 ((#:configure-flags cf)
1607 ``("--with-mpiexec=mpirun"
1608 ,(string-append "--with-mpi-dir="
1609 (assoc-ref %build-inputs "openmpi"))
1610 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 1611 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 1612
a7f01414
EB
1613(define-public slepc
1614 (package
1615 (name "slepc")
cc809f16 1616 (version "3.8.2")
a7f01414
EB
1617 (source
1618 (origin
1619 (method url-fetch)
baeaf882
EB
1620 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1621 version ".tar.gz"))
a7f01414
EB
1622 (sha256
1623 (base32
cc809f16 1624 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
a7f01414
EB
1625 (build-system gnu-build-system)
1626 (native-inputs
1627 `(("python" ,python-2)))
1628 (inputs
1629 `(("arpack" ,arpack-ng)
1630 ("gfortran" ,gfortran)))
1631 (propagated-inputs
1632 `(("petsc" ,petsc)))
1633 (arguments
1634 `(#:parallel-build? #f ;build is parallel by default
1635 #:configure-flags
1636 `(,(string-append "--with-arpack-dir="
9cf52454 1637 (assoc-ref %build-inputs "arpack") "/lib"))
9731c412
EB
1638 #:make-flags ;honor (parallel-job-count)
1639 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
a7f01414
EB
1640 #:phases
1641 (modify-phases %standard-phases
8787c555 1642 (replace 'configure
a7f01414
EB
1643 ;; configure is a python script, so we can't run it with bash.
1644 (lambda* (#:key inputs outputs (configure-flags '())
1645 #:allow-other-keys)
1646 (let* ((prefix (assoc-ref outputs "out"))
1647 (flags `(,(string-append "--prefix=" prefix)
1648 ,@configure-flags)))
1649 (format #t "build directory: ~s~%" (getcwd))
1650 (format #t "configure flags: ~s~%" flags)
1651 (setenv "SLEPC_DIR" (getcwd))
9cf52454 1652 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
c6840089 1653 (apply invoke "./configure" flags))))
8787c555 1654 (add-after 'install 'delete-doc
a7f01414
EB
1655 ;; TODO: SLEPc installs HTML documentation alongside headers in
1656 ;; $out/include. We'd like to move them to share/doc, but delete
1657 ;; them for now, as they are incomplete and installing the complete
1658 ;; documentation is difficult.
1659 (lambda* (#:key outputs #:allow-other-keys)
1660 (let* ((out (assoc-ref outputs "out")))
1661 (for-each delete-file (find-files out "\\.html$")))))
8787c555 1662 (add-after 'install 'clean-install
a7f01414
EB
1663 ;; Clean up unnecessary build logs from installation.
1664 (lambda* (#:key outputs #:allow-other-keys)
1665 (let ((out (assoc-ref outputs "out")))
1666 (for-each (lambda (file)
1667 (let ((f (string-append out "/lib/slepc/conf/" file)))
1668 (when (file-exists? f)
1669 (delete-file f))))
1670 '("configure.log" "make.log" "gmake.log"
1671 "test.log" "error.log" "RDict.db"
1672 "uninstall.py"))))))))
1673 (home-page "http://slepc.upv.es")
1674 (synopsis "Scalable library for eigenproblems")
1675 (description "SLEPc is a software library for the solution of large sparse
1676eigenproblems on parallel computers. It can be used for the solution of
1677linear eigenvalue problems formulated in either standard or generalized form,
1678as well as other related problems such as the singular value decomposition.
1679The emphasis of the software is on methods and techniques appropriate for
1680problems in which the associated matrices are sparse, for example, those
1681arising after the discretization of partial differential equations.")
3c524f21 1682 (license license:bsd-2)))
a7f01414
EB
1683
1684(define-public slepc-complex
1685 (package (inherit slepc)
1686 (name "slepc-complex")
1687 (propagated-inputs
1688 `(("petsc" ,petsc-complex)
1689 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1690 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1691
1692(define-public slepc-openmpi
1693 (package (inherit slepc)
1694 (name "slepc-openmpi")
1695 (inputs
1696 `(("mpi" ,openmpi)
1697 ("arpack" ,arpack-ng-openmpi)
1698 ,@(alist-delete "arpack" (package-inputs slepc))))
1699 (propagated-inputs
1700 `(("petsc" ,petsc-openmpi)
1701 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1702 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1703
1704(define-public slepc-complex-openmpi
1705 (package (inherit slepc-openmpi)
1706 (name "slepc-complex-openmpi")
1707 (propagated-inputs
1708 `(("petsc" ,petsc-complex-openmpi)
1709 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1710 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1711
cec86422
EB
1712(define-public mumps
1713 (package
1714 (name "mumps")
fba78d18 1715 (version "5.0.2")
cec86422
EB
1716 (source
1717 (origin
1718 (method url-fetch)
1719 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1720 version ".tar.gz"))
1721 (sha256
1722 (base32
fba78d18 1723 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
fc1adab1 1724 (patches (search-patches "mumps-build-parallelism.patch"))))
cec86422
EB
1725 (build-system gnu-build-system)
1726 (inputs
1727 `(("fortran" ,gfortran)
1728 ;; These are required for linking against mumps, but we let the user
1729 ;; declare the dependency.
1730 ("blas" ,openblas)
1731 ("metis" ,metis)
1732 ("scotch" ,scotch)))
1733 (arguments
1734 `(#:modules ((ice-9 match)
1735 (ice-9 popen)
1736 (srfi srfi-1)
1737 ,@%gnu-build-system-modules)
1738 #:phases
1739 (modify-phases %standard-phases
fba78d18 1740 (replace 'configure
cec86422
EB
1741 (lambda* (#:key inputs #:allow-other-keys)
1742 (call-with-output-file "Makefile.inc"
1743 (lambda (port)
1744 (format port "
1745PLAT =
1746LIBEXT = .a
1747OUTC = -o
1748OUTF = -o
1749RM = rm -f~:[
1750CC = gcc
1751FC = gfortran
1752FL = gfortran
1753INCSEQ = -I$(topdir)/libseq
1754LIBSEQ = -L$(topdir)/libseq -lmpiseq
1755LIBSEQNEEDED = libseqneeded~;
1756CC = mpicc
1757FC = mpifort
1758FL = mpifort~]
1759AR = ar vr # rules require trailing space, ugh...
1760RANLIB = ranlib
1761LIBBLAS = -L~a -lopenblas~@[
1762SCALAP = -L~a -lscalapack~]
1763LIBOTHERS = -pthread
1764CDEFS = -DAdd_
1765PIC = -fPIC
1766OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1767OPTL = -O2 $(PIC)
1768OPTC = -O2 $(PIC)
1769INCS = $(INCSEQ)
1770LIBS = $(SCALAP) $(LIBSEQ)
1771LPORDDIR = $(topdir)/PORD/lib
1772IPORD = -I$(topdir)/PORD/include
1773LPORD = -L$(LPORDDIR) -lpord
1774ORDERINGSF = -Dpord~@[
1775METISDIR = ~a
1776IMETIS = -I$(METISDIR)/include
1777LMETIS = -L$(METISDIR)/lib -lmetis
1778ORDERINGSF += -Dmetis~]~@[~:{
1779SCOTCHDIR = ~a
1780ISCOTCH = -I$(SCOTCHDIR)/include
1781LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1782ORDERINGSF += ~a~}~]
1783ORDERINGSC = $(ORDERINGSF)
1784LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1785IORDERINGSF = $(ISCOTCH)
1786IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1787 (assoc-ref inputs "mpi")
1788 (assoc-ref inputs "blas")
1789 (assoc-ref inputs "scalapack")
1790 (assoc-ref inputs "metis")
1791 (match (list (assoc-ref inputs "pt-scotch")
1792 (assoc-ref inputs "scotch"))
1793 ((#f #f)
1794 #f)
1795 ((#f scotch)
1796 `((,scotch "" "-Dscotch")))
1797 ((ptscotch _)
1798 `((,ptscotch
1799 "-lptesmumps -lptscotch -lptscotcherr "
1800 "-Dptscotch")))))))))
fba78d18 1801 (replace 'build
cec86422
EB
1802 ;; By default only the d-precision library is built. Make with "all"
1803 ;; target so that all precision libraries and examples are built.
1804 (lambda _
1805 (zero? (system* "make" "all"
1806 (format #f "-j~a" (parallel-job-count))))))
fba78d18 1807 (replace 'check
cec86422
EB
1808 ;; Run the simple test drivers, which read test input from stdin:
1809 ;; from the "real" input for the single- and double-precision
1810 ;; testers, and from the "cmplx" input for complex-precision
1811 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1812 ;; package to prefix execution with "mpirun".
1813 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1814 (with-directory-excursion "examples"
1815 (every
1816 (lambda (prec type)
1817 (let ((tester (apply open-pipe*
1818 `(,OPEN_WRITE
1819 ,@exec-prefix
1820 ,(string-append "./" prec
1821 "simpletest"))))
1822 (input (open-input-file
1823 (string-append "input_simpletest_" type))))
1824 (begin
1825 (dump-port input tester)
1826 (close-port input)
1827 (zero? (close-pipe tester)))))
1828 '("s" "d" "c" "z")
1829 '("real" "real" "cmplx" "cmplx")))))
fba78d18
EB
1830 (replace 'install
1831 (lambda* (#:key outputs #:allow-other-keys)
1832 (let* ((out (assoc-ref outputs "out"))
1833 (libdir (string-append out "/lib")))
1834 (copy-recursively "lib" libdir)
1835 (copy-recursively "include" (string-append out "/include"))
1836 (when (file-exists? "libseq/libmpiseq.a")
1837 (install-file "libseq/libmpiseq.a" libdir))
1838 #t))))))
cec86422
EB
1839 (home-page "http://mumps.enseeiht.fr")
1840 (synopsis "Multifrontal sparse direct solver")
1841 (description
1842 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1843sparse system of linear equations A x = b using Guassian elimination.")
1844 (license license:cecill-c)))
1845
1846(define-public mumps-metis
1847 (package (inherit mumps)
1848 (name "mumps-metis")
1849 (inputs
1850 (alist-delete "scotch" (package-inputs mumps)))))
1851
1852(define-public mumps-openmpi
1853 (package (inherit mumps)
1854 (name "mumps-openmpi")
1855 (inputs
1856 `(("mpi" ,openmpi)
1857 ("scalapack" ,scalapack)
1858 ("pt-scotch" ,pt-scotch)
1859 ,@(alist-delete "scotch" (package-inputs mumps))))
1860 (arguments
1861 (substitute-keyword-arguments (package-arguments mumps)
1862 ((#:phases phases)
1863 `(modify-phases ,phases
1864 (replace
1865 'check
1866 (lambda _
1867 ((assoc-ref ,phases 'check)
1868 #:exec-prefix '("mpirun" "-n" "2"))))))))
1869 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1870
1871(define-public mumps-metis-openmpi
1872 (package (inherit mumps-openmpi)
1873 (name "mumps-metis-openmpi")
1874 (inputs
1875 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1876
2d047896
RW
1877(define-public r-quadprog
1878 (package
1879 (name "r-quadprog")
1880 (version "1.5-5")
1881 (source
1882 (origin
1883 (method url-fetch)
1884 (uri (cran-uri "quadprog" version))
1885 (sha256
1886 (base32
1887 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1888 (build-system r-build-system)
1889 (native-inputs
1890 `(("gfortran" ,gfortran)))
e9960d8c 1891 (home-page "https://cran.r-project.org/web/packages/quadprog")
2d047896
RW
1892 (synopsis "Functions to solve quadratic programming problems")
1893 (description
1894 "This package contains routines and documentation for solving quadratic
1895programming problems.")
1896 (license license:gpl3+)))
1897
ec8c7e47
RJ
1898(define-public r-pracma
1899 (package
1900 (name "r-pracma")
05fd8e6b 1901 (version "2.1.1")
ec8c7e47
RJ
1902 (source (origin
1903 (method url-fetch)
1904 (uri (cran-uri "pracma" version))
1905 (sha256
05fd8e6b 1906 (base32 "1mylrrkyycaw9m01mmg6xkn5wgdlabs5l0qyws60r0n2ycblp897"))))
ec8c7e47 1907 (build-system r-build-system)
ccd9b151
RW
1908 (propagated-inputs
1909 `(("r-quadprog" ,r-quadprog)))
e9960d8c 1910 (home-page "https://cran.r-project.org/web/packages/pracma")
ec8c7e47
RJ
1911 (synopsis "Practical numerical math functions")
1912 (description "This package provides functions for numerical analysis and
1913linear algebra, numerical optimization, differential equations, plus some
1914special functions. It uses Matlab function names where appropriate to simplify
1915porting.")
1916 (license license:gpl3+)))
1917
183e44ae
EB
1918(define-public superlu
1919 (package
1920 (name "superlu")
995a09e0 1921 (version "5.2.1")
183e44ae
EB
1922 (source
1923 (origin
1924 (method url-fetch)
1925 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1926 "superlu_" version ".tar.gz"))
1927 (sha256
995a09e0
EB
1928 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1929 (modules '((guix build utils)))
1930 (snippet
1931 ;; Replace the non-free implementation of MC64 with a stub adapted
1932 ;; from Debian
1933 '(begin
1934 (use-modules (ice-9 regex)
1935 (ice-9 rdelim))
1936 (call-with-output-file "SRC/mc64ad.c"
1937 (lambda (port)
1938 (display "
1939#include <stdio.h>
1940#include <stdlib.h>
1941void mc64id_(int *a) {
1942 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1943 abort ();
1944}
1945void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1946 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1947 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1948 abort ();
1949}\n" port)))
1950 ;; Remove the corresponding license verbiage. MC64 license follows
1951 ;; a "------" line separator.
1952 (with-atomic-file-replacement "License.txt"
1953 (let ((rx (make-regexp "-{8}")))
1954 (lambda (in out)
1955 (let loop ()
1956 (let ((line (read-line in 'concat)))
1957 (unless (regexp-exec rx line)
1958 (display line out)
1959 (loop)))))))))))
1960 (build-system cmake-build-system)
183e44ae
EB
1961 (native-inputs
1962 `(("tcsh" ,tcsh)))
1963 (inputs
995a09e0 1964 `(("blas" ,openblas)
19afbea1 1965 ("gfortran" ,gfortran)))
183e44ae 1966 (arguments
995a09e0
EB
1967 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1968 "-DTPL_BLAS_LIBRARIES=openblas"
1969 "-DBUILD_SHARED_LIBS:BOOL=YES"
1970 "-DCMAKE_INSTALL_LIBDIR=lib")))
183e44ae
EB
1971 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1972 (synopsis "Supernodal direct solver for sparse linear systems")
1973 (description
1974 "SuperLU is a general purpose library for the direct solution of large,
1975sparse, nonsymmetric systems of linear equations on high performance machines.
1976The library is written in C and is callable from either C or Fortran. The
1977library routines perform an LU decomposition with partial pivoting and
1978triangular system solves through forward and back substitution. The library
1979also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
1980 (license (list license:bsd-3
1981 license:gpl2+ ;EXAMPLE/*fgmr.c
1982 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 1983
a54aefea
EB
1984(define-public superlu-dist
1985 (package
1986 (name "superlu-dist")
1987 (version "3.3")
1988 (source
1989 (origin
1990 (method url-fetch)
1991 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1992 "superlu_dist_" version ".tar.gz"))
1993 (sha256
1994 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
29080870
EB
1995 (modules '((guix build utils)))
1996 (snippet
1997 ;; Replace the non-free implementation of MC64 with a stub
1998 '(begin
1999 (use-modules (ice-9 regex)
2000 (ice-9 rdelim))
2001 (call-with-output-file "SRC/mc64ad.c"
2002 (lambda (port)
2003 (display "
2004#include <stdio.h>
2005#include <stdlib.h>
2006void mc64id_(int *a) {
2007 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2008 abort ();
2009}
2010void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2011 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2012 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2013 abort ();
2014}\n" port)))
2015 (delete-file "SRC/mc64ad.f.bak")
2016 (substitute* "SRC/util.c" ;adjust default algorithm
2017 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2018 "RowPerm = NOROWPERM"))))
fc1adab1 2019 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
a54aefea
EB
2020 (build-system gnu-build-system)
2021 (native-inputs
2022 `(("tcsh" ,tcsh)))
2023 (inputs
19afbea1 2024 `(("gfortran" ,gfortran)))
a54aefea
EB
2025 (propagated-inputs
2026 `(("openmpi" ,openmpi) ;headers include MPI heades
2027 ("lapack" ,lapack) ;required to link with output library
2028 ("pt-scotch" ,pt-scotch))) ;same
2029 (arguments
2030 `(#:parallel-build? #f ;race conditions using ar
2031 #:phases
dc1d3cde
KK
2032 (modify-phases %standard-phases
2033 (replace 'configure
2034 (lambda* (#:key inputs outputs #:allow-other-keys)
2035 (call-with-output-file "make.inc"
2036 (lambda (port)
2037 (format port "
a54aefea
EB
2038PLAT =
2039DSuperLUroot = ~a
2040DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2041BLASDEF = -DUSE_VENDOR_BLAS
2042BLASLIB = -L~a/lib -lblas
2043PARMETISLIB = -L~a/lib \
2044 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2045 -lscotch -lscotcherr -lscotcherrexit
2046METISLIB = -L~:*~a/lib \
2047 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2048LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2049ARCH = ar
2050ARCHFLAGS = cr
2051RANLIB = ranlib
2052CC = mpicc
2053PIC = -fPIC
2054CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2055NOOPTS = -O0 -g $(PIC)
2056FORTRAN = mpifort
2057FFLAGS = -O2 -g $(PIC)
2058LOADER = $(CC)
2059CDEFS = -DAdd_"
dc1d3cde
KK
2060 (getcwd)
2061 (assoc-ref outputs "out")
2062 (assoc-ref inputs "lapack")
2063 (assoc-ref inputs "pt-scotch"))))
2064 #t))
2065 (add-after 'unpack 'remove-broken-symlinks
2066 (lambda _
2067 (for-each delete-file
2068 (find-files "MAKE_INC" "\\.#make\\..*"))
2069 #t))
2070 (add-before 'build 'create-install-directories
2071 (lambda* (#:key outputs #:allow-other-keys)
2072 (for-each
2073 (lambda (dir)
2074 (mkdir-p (string-append (assoc-ref outputs "out")
2075 "/" dir)))
2076 '("lib" "include"))
2077 #t))
2078 (replace 'check
a54aefea
EB
2079 (lambda _
2080 (with-directory-excursion "EXAMPLE"
2081 (and
2082 (zero? (system* "mpirun" "-n" "2"
2083 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2084 (zero? (system* "mpirun" "-n" "2"
dc1d3cde
KK
2085 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2086 (replace 'install
2087 (lambda* (#:key outputs #:allow-other-keys)
2088 ;; Library is placed in lib during the build phase. Copy over
2089 ;; headers to include.
2090 (let* ((out (assoc-ref outputs "out"))
2091 (incdir (string-append out "/include")))
2092 (for-each (lambda (file)
2093 (let ((base (basename file)))
2094 (format #t "installing `~a' to `~a'~%"
2095 base incdir)
2096 (copy-file file
2097 (string-append incdir "/" base))))
2098 (find-files "SRC" ".*\\.h$")))
2099 #t)))))
a54aefea
EB
2100 (home-page (package-home-page superlu))
2101 (synopsis "Parallel supernodal direct solver")
2102 (description
2103 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2104It is targeted for distributed memory parallel machines. SuperLU_DIST is
2105implemented in ANSI C, and MPI for communications.")
2106 (license license:bsd-3)))
2107
f8ed036a
EB
2108(define-public scotch
2109 (package
2110 (name "scotch")
6c798540 2111 (version "6.0.4")
f8ed036a
EB
2112 (source
2113 (origin
2114 (method url-fetch)
6c798540 2115 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
f8ed036a
EB
2116 "scotch_" version ".tar.gz"))
2117 (sha256
6c798540 2118 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
fc1adab1
AK
2119 (patches (search-patches "scotch-test-threading.patch"
2120 "pt-scotch-build-parallelism.patch"))))
f8ed036a
EB
2121 (build-system gnu-build-system)
2122 (inputs
2123 `(("zlib" ,zlib)
5e54f4ad 2124 ("flex" ,flex)
f8ed036a
EB
2125 ("bison" ,bison)))
2126 (arguments
2127 `(#:phases
d6602ee9
EB
2128 (modify-phases %standard-phases
2129 (add-after
2130 'unpack 'chdir-to-src
2131 (lambda _ (chdir "src")))
2132 (replace
2133 'configure
2134 (lambda _
2135 (call-with-output-file "Makefile.inc"
2136 (lambda (port)
2137 (format port "
f8ed036a
EB
2138EXE =
2139LIB = .a
2140OBJ = .o
2141MAKE = make
2142AR = ar
2143ARFLAGS = -ruv
cf0ec6c4 2144CAT = cat
f8ed036a
EB
2145CCS = gcc
2146CCP = mpicc
2147CCD = gcc
2148CPPFLAGS =~{ -D~a~}
6c798540 2149CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2150LDFLAGS = -lz -lm -lrt -lpthread
2151CP = cp
2152LEX = flex -Pscotchyy -olex.yy.c
2153LN = ln
2154MKDIR = mkdir
2155MV = mv
2156RANLIB = ranlib
2157YACC = bison -pscotchyy -y -b y
2158"
d6602ee9
EB
2159 '("COMMON_FILE_COMPRESS_GZ"
2160 "COMMON_PTHREAD"
2161 "COMMON_RANDOM_FIXED_SEED"
26599d69 2162 "INTSIZE64" ;use 'long' instead of 'int'
cf0ec6c4
EB
2163 ;; Prevents symbolc clashes with libesmumps
2164 "SCOTCH_RENAME"
d6602ee9
EB
2165 ;; XXX: Causes invalid frees in superlu-dist tests
2166 ;; "SCOTCH_PTHREAD"
2167 ;; "SCOTCH_PTHREAD_NUMBER=2"
2168 "restrict=__restrict"))))))
cf0ec6c4
EB
2169 (add-after
2170 'build 'build-esmumps
2171 (lambda _
2172 (zero? (system* "make"
2173 (format #f "-j~a" (parallel-job-count))
2174 "esmumps"))))
d6602ee9 2175 (replace
f8ed036a
EB
2176 'install
2177 (lambda* (#:key outputs #:allow-other-keys)
2178 (let ((out (assoc-ref outputs "out")))
2179 (mkdir out)
2180 (zero? (system* "make"
2181 (string-append "prefix=" out)
cf0ec6c4
EB
2182 "install"))
2183 ;; esmumps files are not installed with the above
2184 (for-each (lambda (f)
2185 (copy-file f (string-append out "/include/" f)))
2186 (find-files "../include" ".*esmumps.h$"))
2187 (for-each (lambda (f)
2188 (copy-file f (string-append out "/lib/" f)))
2189 (find-files "../lib" "^lib.*esmumps.*"))))))))
f8ed036a
EB
2190 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2191 (synopsis "Programs and libraries for graph algorithms")
2192 (description "SCOTCH is a set of programs and libraries which implement
2193the static mapping and sparse matrix reordering algorithms developed within
2194the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2195conquer approach, to scientific computing problems such as graph and mesh
2196partitioning, static mapping, and sparse matrix ordering, in application
2197domains ranging from structural mechanics to operating systems or
2198bio-chemistry.")
2199 ;; See LICENSE_en.txt
2200 (license license:cecill-c)))
6acb4adb 2201
1c39f3b8
PG
2202(define-public scotch32
2203 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2204 ;; some applications.
2205 (package (inherit scotch)
2206 (name "scotch32")
2207 (arguments
2208 (substitute-keyword-arguments (package-arguments scotch)
2209 ((#:phases scotch-phases)
2210 `(modify-phases ,scotch-phases
2211 (replace
2212 'configure
2213 (lambda _
2214 (call-with-output-file "Makefile.inc"
2215 (lambda (port)
2216 (format port "
2217EXE =
2218LIB = .a
2219OBJ = .o
2220MAKE = make
2221AR = ar
2222ARFLAGS = -ruv
2223CAT = cat
2224CCS = gcc
2225CCP = mpicc
2226CCD = gcc
2227CPPFLAGS =~{ -D~a~}
2228CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2229LDFLAGS = -lz -lm -lrt -lpthread
2230CP = cp
2231LEX = flex -Pscotchyy -olex.yy.c
2232LN = ln
2233MKDIR = mkdir
2234MV = mv
2235RANLIB = ranlib
2236YACC = bison -pscotchyy -y -b y
2237"
2238 '("COMMON_FILE_COMPRESS_GZ"
2239 "COMMON_PTHREAD"
2240 "COMMON_RANDOM_FIXED_SEED"
2241 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2242 ;; Prevents symbolc clashes with libesmumps
2243 "SCOTCH_RENAME"
2244 ;; XXX: Causes invalid frees in superlu-dist tests
2245 ;; "SCOTCH_PTHREAD"
2246 ;; "SCOTCH_PTHREAD_NUMBER=2"
2247 "restrict=__restrict"))))))))))
2248 (synopsis
2249 "Programs and libraries for graph algorithms (32-bit integers)")))
2250
6acb4adb
EB
2251(define-public pt-scotch
2252 (package (inherit scotch)
2253 (name "pt-scotch")
2254 (propagated-inputs
2255 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2256 (arguments
2257 (substitute-keyword-arguments (package-arguments scotch)
2258 ((#:phases scotch-phases)
d6602ee9
EB
2259 `(modify-phases ,scotch-phases
2260 (replace
2261 'build
d6602ee9
EB
2262 (lambda _
2263 (and
cf0ec6c4
EB
2264 (zero? (system* "make"
2265 (format #f "-j~a" (parallel-job-count))
2266 "ptscotch" "ptesmumps"))
d6602ee9
EB
2267 ;; Install the serial metis compatibility library
2268 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2269 (replace
2270 'check
2271 (lambda _ (zero? (system* "make" "ptcheck"))))))))
6acb4adb 2272 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 2273
1c25a52c
PG
2274(define-public pt-scotch32
2275 (package (inherit scotch32)
2276 (name "pt-scotch32")
2277 (propagated-inputs
2278 `(("openmpi" ,openmpi))) ;headers include MPI headers
2279 (arguments
c4d4a779
PG
2280 (substitute-keyword-arguments (package-arguments scotch32)
2281 ((#:phases scotch32-phases)
2282 `(modify-phases ,scotch32-phases
1c25a52c
PG
2283 (replace 'build
2284 (lambda _
2285 (and
2286 (zero? (system* "make"
2287 (format #f "-j~a" (parallel-job-count))
2288 "ptscotch" "ptesmumps"))
2289 ;; Install the serial metis compatibility library
2290 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2291 (replace 'check
2292 (lambda _
2293 (zero? (system* "make" "ptcheck"))))))))
2294 (synopsis
2295 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2296
aa75ad00
EB
2297(define-public metis
2298 (package
2299 (name "metis")
2300 (version "5.1.0")
2301 (source
2302 (origin
2303 (method url-fetch)
2304 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2305 "metis-" version ".tar.gz"))
2306 (sha256
2307 (base32
2308 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2309 (build-system cmake-build-system)
2310 (inputs
2311 `(("blas" ,openblas)))
2312 (arguments
2313 `(#:tests? #f ;no tests
2314 #:configure-flags `("-DSHARED=ON"
2315 ,(string-append "-DGKLIB_PATH=" (getcwd)
2316 "/metis-" ,version "/GKlib"))))
2317 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2318 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2319 (description
2320 "METIS is a set of serial programs for partitioning graphs, partitioning
2321finite element meshes, and producing fill-reducing orderings for sparse
2322matrices. The algorithms implemented in METIS are based on the multilevel
2323recursive-bisection, multilevel k-way, and multi-constraint partitioning
2324schemes.")
2325 (license license:asl2.0))) ;As of version 5.0.3
2326
700ff222
EB
2327(define-public p4est
2328 (package
2329 (name "p4est")
4150da63 2330 (version "2.0")
700ff222
EB
2331 (source
2332 (origin
2333 (method url-fetch)
2334 (uri (string-append "http://p4est.github.io/release/p4est-"
2335 version ".tar.gz"))
2336 (sha256
2337 (base32
4150da63 2338 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
2339 (build-system gnu-build-system)
2340 (inputs
2341 `(("fortran" ,gfortran)
2342 ("blas" ,openblas)
2343 ("lapack" ,lapack)
2344 ("zlib" ,zlib)))
2345 (arguments
2346 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2347 (assoc-ref %build-inputs "blas")
2348 " -lopenblas")
2349 ,(string-append "LAPACK_LIBS=-L"
2350 (assoc-ref %build-inputs "lapack")
2351 " -llapack"))))
2352 (home-page "http://www.p4est.org")
2353 (synopsis "Adaptive mesh refinement on forests of octrees")
2354 (description
2355 "The p4est software library enables the dynamic management of a
2356collection of adaptive octrees, conveniently called a forest of octrees.
2357p4est is designed to work in parallel and scales to hundreds of thousands of
2358processor cores.")
2359 (license license:gpl2+)))
2360
2361(define-public p4est-openmpi
2362 (package (inherit p4est)
2363 (name "p4est-openmpi")
2364 (inputs
2365 `(("mpi" ,openmpi)
2366 ,@(package-inputs p4est)))
2367 (arguments
2368 (substitute-keyword-arguments (package-arguments p4est)
2369 ((#:configure-flags cf)
2370 ``("--enable-mpi" ,@,cf))))
2371 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2372
5698b8b8
JD
2373(define-public gsegrafix
2374 (package
2375 (name "gsegrafix")
2376 (version "1.0.6")
2377 (source
2378 (origin
2379 (method url-fetch)
2380 (uri (string-append "mirror://gnu/" name "/" name "-"
2381 version ".tar.gz"))
2382 (sha256
2383 (base32
2384 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2385 (build-system gnu-build-system)
2386 (arguments
2387 `(#:configure-flags '("LDFLAGS=-lm")))
2388 (inputs
2389 `(("libgnomecanvas" ,libgnomecanvas)
2390 ("libbonoboui" ,libbonoboui)
2391 ("libgnomeui" ,libgnomeui)
2392 ("libgnomeprintui" ,libgnomeprintui)
2393 ("popt" ,popt)))
2394 (native-inputs
2395 `(("pkg-config" ,pkg-config)))
6fd52309 2396 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
2397 (synopsis "GNOME application to create scientific and engineering plots")
2398 (description "GSEGrafix is an application which produces high-quality graphical
2399plots for science and engineering. Plots are specified via simple ASCII
2400parameter files and data files and are presented in an anti-aliased GNOME
2401canvas. The program supports rectangular two-dimensional plots, histograms,
2402polar-axis plots and three-dimensional plots. Plots can be printed or saved
2403to BMP, JPEG or PNG image formats.")
2404 (license license:gpl3+)))
8731e527
JD
2405
2406(define-public maxima
2407 (package
2408 (name "maxima")
b3b2efc8 2409 (version "5.41.0")
8731e527
JD
2410 (source
2411 (origin
2412 (method url-fetch)
2413 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2414 version "-source/" name "-" version ".tar.gz"))
2415 (sha256
2416 (base32
b3b2efc8 2417 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
fc1adab1 2418 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 2419 (build-system gnu-build-system)
df354a77 2420 (inputs
6b2eafaa 2421 `(("gcl" ,gcl)
df354a77 2422 ("gnuplot" ,gnuplot) ;for plots
f36afe4d 2423 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
2424 (native-inputs
2425 `(("texinfo" ,texinfo)
ccbc5758
KK
2426 ("perl" ,perl)
2427 ("python" ,python)))
8731e527 2428 (arguments
df354a77
FB
2429 `(#:configure-flags
2430 (list "--enable-gcl"
2431 (string-append "--with-posix-shell="
2432 (assoc-ref %build-inputs "bash")
2433 "/bin/sh")
2434 (string-append "--with-wish="
2435 (assoc-ref %build-inputs "tk")
2436 "/bin/wish"
2437 (let ((v ,(package-version tk)))
2438 (string-take v (string-index-right v #\.)))))
df354a77 2439 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
2440 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2441 ;; Work around that.
df354a77 2442 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
2443 #:phases
2444 (modify-phases %standard-phases
2445 (add-before 'check 'pre-check
2446 (lambda _
2447 (chmod "src/maxima" #o555)
2448 #t))
2449 ;; Make sure the doc and emacs files are found in the
2450 ;; standard location. Also configure maxima to find gnuplot
2451 ;; without having it on the PATH.
2452 (add-after 'install 'post-install
2453 (lambda* (#:key outputs inputs #:allow-other-keys)
2454 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2455 (out (assoc-ref outputs "out"))
2456 (datadir (string-append out "/share/maxima/" ,version))
2457 (binutils (string-append (assoc-ref inputs "binutils")
2458 "/bin")))
2459 (with-directory-excursion out
2460 (mkdir-p "share/emacs")
2461 (mkdir-p "share/doc")
2462 (symlink
2463 (string-append datadir "/emacs/")
2464 (string-append out "/share/emacs/site-lisp"))
2465 (symlink
2466 (string-append datadir "/doc/")
2467 (string-append out "/share/doc/maxima"))
2468 (with-atomic-file-replacement
2469 (string-append datadir "/share/maxima-init.lisp")
2470 (lambda (in out)
2471 (format out "~a ~s~a~%"
2472 "(setf $gnuplot_command "
2473 (string-append gnuplot "/bin/gnuplot") ")")
2474 (dump-port in out))))
2475 ;; Ensure that Maxima will have access to the GNU binutils
2476 ;; components at runtime.
2477 (wrap-program (string-append out "/bin/maxima")
2478 `("PATH" prefix (,binutils))))
2479 #t)))))
8731e527
JD
2480 (home-page "http://maxima.sourceforge.net")
2481 (synopsis "Numeric and symbolic expression manipulation")
2482 (description "Maxima is a system for the manipulation of symbolic and
2483numerical expressions. It yields high precision numeric results by using
2484exact fractions, arbitrary precision integers, and variable precision floating
e881752c 2485point numbers.")
8731e527
JD
2486 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2487 ;; Others simply say "GNU General Public License" without stating a
2488 ;; version (which implicitly means gpl1+).
2489 ;; At least one file (src/maxima.asd) says "version 2."
2490 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 2491 (license license:gpl2)))
ec322be2 2492
9aafbc0c
MW
2493(define-public wxmaxima
2494 (package
2495 (name "wxmaxima")
a8db968f 2496 (version "17.10.1")
9aafbc0c
MW
2497 (source
2498 (origin
2499 (method url-fetch)
5143517c
KK
2500 (uri (string-append "https://github.com/andrejv/" name "/archive"
2501 "/Version-" version ".tar.gz"))
2502 (file-name (string-append name "-" version ".tar.gz"))
9aafbc0c
MW
2503 (sha256
2504 (base32
a8db968f 2505 "0qlzc31cqkwpfgrb9cif9bcnkj3rq487plg4rns7jxv6pq4609v1"))))
9aafbc0c 2506 (build-system gnu-build-system)
5143517c
KK
2507 (native-inputs
2508 `(("autoconf" ,autoconf)
2509 ("automake" ,automake)
2510 ("gettext" ,gettext-minimal)))
9aafbc0c
MW
2511 (inputs
2512 `(("wxwidgets" ,wxwidgets)
de477809
SB
2513 ("maxima" ,maxima)
2514 ;; Runtime support.
2515 ("adwaita-icon-theme" ,adwaita-icon-theme)
2516 ("gtk+" ,gtk+)
2517 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 2518 (arguments
ac2ddcc6
KK
2519 `(#:phases
2520 (modify-phases %standard-phases
2521 (add-after 'unpack 'autoconf
2522 (lambda _
2523 (zero? (system* "sh" "bootstrap"))))
2524 (add-after 'install 'wrap-program
2525 (lambda* (#:key inputs outputs #:allow-other-keys)
2526 (wrap-program (string-append (assoc-ref outputs "out")
2527 "/bin/wxmaxima")
2528 `("PATH" ":" prefix
2529 (,(string-append (assoc-ref inputs "maxima")
2530 "/bin")))
2531 ;; For GtkFileChooserDialog.
2532 `("GSETTINGS_SCHEMA_DIR" =
2533 (,(string-append (assoc-ref inputs "gtk+")
2534 "/share/glib-2.0/schemas")))
2535 `("XDG_DATA_DIRS" ":" prefix
2536 (;; Needed by gdk-pixbuf to know supported icon formats.
2537 ,(string-append
2538 (assoc-ref inputs "shared-mime-info") "/share")
2539 ;; The default icon theme of GTK+.
2540 ,(string-append
2541 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2542 #t)))))
9aafbc0c
MW
2543 (home-page "https://andrejv.github.io/wxmaxima/")
2544 (synopsis "Graphical user interface for the Maxima computer algebra system")
2545 (description
2546 "wxMaxima is a graphical user interface for the Maxima computer algebra
2547system. It eases the use of Maxima by making most of its commands available
2548through a menu system and by providing input dialogs for commands that require
2549more than one argument. It also implements its own display engine that
2550outputs mathematical symbols directly instead of depicting them with ASCII
2551characters.
2552
2553wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2554text and mathematical calculations to create documents, exporting of input and
2555output to TeX, and a browser for Maxima's manual including command index and
2556full text searching.")
2557 (license license:gpl2+)))
2558
b15e47f9
RW
2559(define-public armadillo
2560 (package
2561 (name "armadillo")
133cba8c 2562 (version "7.800.2")
b15e47f9
RW
2563 (source (origin
2564 (method url-fetch)
2565 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 2566 version ".tar.xz"))
b15e47f9
RW
2567 (sha256
2568 (base32
133cba8c 2569 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
b15e47f9
RW
2570 (build-system cmake-build-system)
2571 (arguments `(#:tests? #f)) ;no test target
2572 (inputs
2573 `(("openblas" ,openblas)
2574 ("lapack" ,lapack)
2575 ("arpack" ,arpack-ng)))
2576 (home-page "http://arma.sourceforge.net/")
2577 (synopsis "C++ linear algebra library")
2578 (description
2579 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2580between speed and ease of use. It is useful for algorithm development
2581directly in C++, or quick conversion of research code into production
2582environments. It can be used for machine learning, pattern recognition,
2583signal processing, bioinformatics, statistics, econometrics, etc. The library
2584provides efficient classes for vectors, matrices and cubes, as well as 150+
2585associated functions (eg. contiguous and non-contiguous submatrix views).")
fe418cc5 2586 (license license:asl2.0)))
b15e47f9 2587
279663ef 2588(define-public muparser
d7cff656
LF
2589 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2590 ;; different hash. In order to make `guix package --upgrade` work correctly,
2591 ;; we set a Guix packaging revision.
2592 ;; When the next version of muparser is released, we can remove
2593 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2594 (let ((upstream-version "2.2.5")
2595 (revision "2"))
2596 (package
2597 (name "muparser")
2598 (version (string-append upstream-version "-" revision))
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2603 upstream-version ".tar.gz"))
2604 (file-name (string-append name "-" version ".tar.gz"))
2605 (sha256
2606 (base32
2607 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2608 (build-system gnu-build-system)
2609 (arguments
2610 `(#:configure-flags '("--enable-samples=no")
2611 #:tests? #f)) ;no "check" target
2612 (home-page "http://muparser.beltoforion.de/")
2613 (synopsis "Fast parser library for mathematical expressions")
2614 (description
2615 "muParser is an extensible high performance math parser library. It is
2616based on transforming an expression into a bytecode and precalculating constant
2617parts of it.")
2618 (license license:expat))))
279663ef 2619
e73b49fb
RW
2620(define-public openblas
2621 (package
2622 (name "openblas")
883d0a7d 2623 (version "0.2.19")
e73b49fb
RW
2624 (source
2625 (origin
2626 (method url-fetch)
2627 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2628 version))
2629 (file-name (string-append name "-" version ".tar.gz"))
2630 (sha256
2631 (base32
883d0a7d 2632 "071zqnmnxhh0c9phzyn3f198yxa0hjxda7016azdbq2056sm70w7"))))
e73b49fb
RW
2633 (build-system gnu-build-system)
2634 (arguments
5b5ea159 2635 `(#:tests? #f ;no "check" target
bd0b4379
RW
2636 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2637 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2638 ;; we need to disable substitutions.
71923a91
AE
2639 #:substitutable?
2640 ,(let ((system (or (%current-target-system) (%current-system))))
2641 (or (string-prefix? "x86_64" system)
bd0b4379 2642 (string-prefix? "i686" system)
83a34647
EF
2643 (string-prefix? "mips" system)
2644 (string-prefix? "aarch64" system)))
e73b49fb
RW
2645 #:make-flags
2646 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2647 "SHELL=bash"
af5b817e
RW
2648 ;; Build the library for all supported CPUs. This allows
2649 ;; switching CPU targets at runtime with the environment variable
2650 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
2651 ;; Unfortunately, this is not supported on non-x86 architectures,
2652 ;; where it leads to failed builds.
2653 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
2654 (cond
2655 ((or (string-prefix? "x86_64" system)
71923a91 2656 (string-prefix? "i686" system))
8a637e79
RW
2657 '("DYNAMIC_ARCH=1"))
2658 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2659 ;; two available MIPS targets special extended instructions
2660 ;; for Loongson cores are used.
2661 ((string-prefix? "mips" system)
2662 '("TARGET=SICORTEX"))
83a34647
EF
2663 ;; On aarch64 force the generic 'armv8-a' target
2664 ((string-prefix? "aarch64" system)
2665 '("TARGET=ARMV8"))
8a637e79 2666 (else '()))))
e73b49fb 2667 ;; no configure script
493937ae
DL
2668 #:phases
2669 (modify-phases %standard-phases
2670 (delete 'configure)
2671 (add-before 'build 'set-extralib
2672 (lambda* (#:key inputs #:allow-other-keys)
2673 ;; Get libgfortran found when building in utest.
2674 (setenv "FEXTRALIB"
2675 (string-append "-L" (assoc-ref inputs "fortran-lib")
2676 "/lib"))
2677 #t)))))
e73b49fb 2678 (inputs
493937ae 2679 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
2680 (native-inputs
2681 `(("cunit" ,cunit)
493937ae 2682 ("fortran" ,gfortran)
e73b49fb
RW
2683 ("perl" ,perl)))
2684 (home-page "http://www.openblas.net/")
2685 (synopsis "Optimized BLAS library based on GotoBLAS")
2686 (description
2687 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2688 (license license:bsd-3)))
2689
5a7deb11
LC
2690(define* (make-blis implementation #:optional substitutable?)
2691 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2692source tree for a list of implementations.)
2693
2694SUBSTITUTABLE? determines whether the package is made available as a
2695substitute.
2696
2697Currently the specialization must be selected at configure-time, but work is
2698underway to allow BLIS to select the right optimized kernels at run time:
2699<https://github.com/flame/blis/issues/129>."
2700 (package
2701 (name (if (string=? implementation "reference")
2702 "blis"
2703 (string-append "blis-" implementation)))
2704 (version "0.2.2")
2705 (home-page "https://github.com/flame/blis")
2706 (source (origin
2707 (method git-fetch)
2708 (uri (git-reference (url home-page) (commit version)))
2709 (sha256
2710 (base32
2711 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2712 (file-name (git-file-name "blis" version))))
2713 (build-system gnu-build-system)
2714 (arguments
2715 `(#:test-target "test"
2716
2717 #:substitutable? ,substitutable?
2718
2719 #:phases (modify-phases %standard-phases
2720 (replace 'configure
2721 (lambda* (#:key outputs #:allow-other-keys)
2722 ;; This is a home-made 'configure' script.
2723 (let ((out (assoc-ref outputs "out")))
2724 (zero? (system* "./configure" "-p" out
2725 "-d" "opt"
2726 "--disable-static"
2727 "--enable-shared"
2728 "--enable-threading=openmp"
2729
2730 ,implementation)))))
2731 (add-before 'check 'show-test-output
2732 (lambda _
2733 ;; By default "make check" is silent. Make it verbose.
2734 (system "tail -F output.testsuite &")
2735 #t)))))
2736 (synopsis "High-performance basic linear algebra (BLAS) routines")
2737 (description
2738 "BLIS is a portable software framework for instantiating high-performance
2739BLAS-like dense linear algebra libraries. The framework was designed to
2740isolate essential kernels of computation that, when optimized, immediately
2741enable optimized implementations of most of its commonly used and
2742computationally intensive operations. While BLIS exports a new BLAS-like API,
2743it also includes a BLAS compatibility layer which gives application developers
2744access to BLIS implementations via traditional BLAS routine calls.")
2745 (license license:bsd-3)))
2746
2747(define-public blis
2748 ;; This is the "reference" implementation, which is the non-optimized but
2749 ;; portable variant (no assembly).
2750 (make-blis "reference" #t))
2751
2752(define ignorance blis)
2753
2754(define-syntax-rule (blis/x86_64 processor)
2755 "Expand to a package specialized for PROCESSOR."
2756 (package
2757 (inherit (make-blis processor))
2758 (supported-systems '("x86_64-linux"))))
2759
2760(define-public blis-sandybridge
2761 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2762 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2763 (blis/x86_64 "sandybridge"))
2764
2765(define-public blis-haswell
2766 ;; BLIS specialized for Haswell processors (launched 2013):
2767 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2768 (blis/x86_64 "haswell"))
2769
2770(define-public blis-knl
2771 ;; BLIS specialized for Knights Landing processor (launched 2016):
2772 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2773 (blis/x86_64 "knl"))
2774
2775
e1605e36
RW
2776(define-public openlibm
2777 (package
2778 (name "openlibm")
26f6e565 2779 (version "0.5.1")
e1605e36
RW
2780 (source
2781 (origin
2782 (method url-fetch)
2783 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2784 version ".tar.gz"))
2785 (file-name (string-append name "-" version ".tar.gz"))
2786 (sha256
2787 (base32
26f6e565 2788 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
e1605e36
RW
2789 (build-system gnu-build-system)
2790 (arguments
2791 `(#:make-flags
2792 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2793 #:phases
2794 ;; no configure script
dc1d3cde 2795 (modify-phases %standard-phases (delete 'configure))
e1605e36
RW
2796 #:tests? #f)) ;the tests are part of the default target
2797 (home-page "http://openlibm.org/")
2798 (synopsis "Portable C mathematical library (libm)")
2799 (description
2800 "OpenLibm is an effort to have a high quality, portable, standalone C
2801mathematical library (libm). It can be used standalone in applications and
2802programming language implementations. The project was born out of a need to
e881752c 2803have a good libm for the Julia programming language that worked consistently
e1605e36
RW
2804across compilers and operating systems, and in 32-bit and 64-bit
2805environments.")
538c0e3b
EF
2806 ;; Each architecture has its own make target, and there is none for mips.
2807 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
2808 ;; See LICENSE.md for details.
2809 (license (list license:expat
2810 license:isc
2811 license:bsd-2
2812 license:public-domain
2813 license:lgpl2.1+))))
2814
e62be58f
RW
2815(define-public openspecfun
2816 (package
2817 (name "openspecfun")
59cd0ba4 2818 (version "0.5.3")
e62be58f
RW
2819 (source
2820 (origin
2821 (method url-fetch)
2822 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2823 version ".tar.gz"))
2824 (file-name (string-append name "-" version ".tar.gz"))
2825 (sha256
2826 (base32
59cd0ba4 2827 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
e62be58f
RW
2828 (build-system gnu-build-system)
2829 (arguments
59cd0ba4 2830 '(#:tests? #f ; no "check" target
e62be58f
RW
2831 #:make-flags
2832 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
2833 #:phases
2834 (modify-phases %standard-phases
2835 (delete 'configure)))) ; no configure script
e62be58f 2836 (inputs
19afbea1 2837 `(("fortran" ,gfortran)))
e62be58f
RW
2838 (home-page "https://github.com/JuliaLang/openspecfun")
2839 (synopsis "Collection of special mathematical functions")
2840 (description
2841 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2842portable package for Bessel Functions of a Complex Argument and Nonnegative
2843Order; it contains subroutines for computing Bessel functions and Airy
2844functions. Faddeeva allows computing the various error functions of arbitrary
2845complex arguments (Faddeeva function, error function, complementary error
2846function, scaled complementary error function, imaginary error function, and
2847Dawson function); given these, one can also easily compute Voigt functions,
2848Fresnel integrals, and similar related functions as well.")
2849 ;; Faddeeva is released under the Expat license; AMOS is included as
2850 ;; public domain software.
2851 (license (list license:expat license:public-domain))))
2852
2742f87e
RW
2853(define-public suitesparse
2854 (package
2855 (name "suitesparse")
bd5b5ac0 2856 (version "4.5.5")
2742f87e
RW
2857 (source
2858 (origin
2859 (method url-fetch)
2860 (uri (string-append
2861 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2862 version ".tar.gz"))
2863 (sha256
2864 (base32
bd5b5ac0
EB
2865 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2866 (modules '((guix build utils)))
2867 (snippet
2868 ;; Remove bundled metis source
2869 '(delete-file-recursively "metis-5.1.0"))))
2742f87e
RW
2870 (build-system gnu-build-system)
2871 (arguments
bd5b5ac0 2872 '(#:tests? #f ;no "check" target
2742f87e
RW
2873 #:make-flags
2874 (list "CC=gcc"
2875 "BLAS=-lblas"
2876 "TBB=-ltbb"
bd5b5ac0 2877 "MY_METIS_LIB=-lmetis"
2742f87e
RW
2878 (string-append "INSTALL_LIB="
2879 (assoc-ref %outputs "out") "/lib")
2880 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
2881 (assoc-ref %outputs "out") "/include")
2882 "library")
2742f87e 2883 #:phases
2509522c 2884 (modify-phases %standard-phases
bd5b5ac0 2885 (delete 'configure)))) ;no configure script
2742f87e
RW
2886 (inputs
2887 `(("tbb" ,tbb)
bd5b5ac0
EB
2888 ("lapack" ,lapack)
2889 ("metis" ,metis)))
2742f87e
RW
2890 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2891 (synopsis "Suite of sparse matrix software")
2892 (description
2893 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2894multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2895multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2896simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2897CXSparse, a concise sparse Cholesky factorization package; and many other
2898packages.")
2899 ;; LGPLv2.1+:
2900 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2901 ;; GPLv2+:
2902 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2903 (license (list license:gpl2+ license:lgpl2.1+))))
2904
ec322be2
FB
2905(define-public atlas
2906 (package
2907 (name "atlas")
3c98ac02 2908 (version "3.10.3")
ec322be2
FB
2909 (source (origin
2910 (method url-fetch)
de67e922
LF
2911 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2912 version "/atlas" version ".tar.bz2"))
ec322be2
FB
2913 (sha256
2914 (base32
3c98ac02 2915 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
2916 (build-system gnu-build-system)
2917 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 2918 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
2919 ("lapack-tar" ,(package-source lapack))))
2920 (outputs '("out" "doc"))
01480b9e
FB
2921 ;; For the moment we drop support for MIPS at it fails to compile. See
2922 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2923 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
2924 (arguments
2925 `(#:parallel-build? #f
2926 #:parallel-tests? #f
f15615b1
LC
2927
2928 ;; ATLAS tunes itself for the machine it is built on, as explained at
2929 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2930 ;; For this reason, we want users to build it locally instead of using
2931 ;; substitutes.
2932 #:substitutable? #f
2933
ec322be2
FB
2934 #:modules ((srfi srfi-26)
2935 (srfi srfi-1)
2936 (guix build gnu-build-system)
2937 (guix build utils))
40029cbe 2938 #:configure-flags
ec322be2
FB
2939 `(;; Generate position independent code suitable for dynamic libraries
2940 ;; and use WALL timer to get more accurate timing.
2941 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2942 ;; Set word width.
2943 "-b"
2944 ,,(if (string-match "64" (%current-system))
2945 "64"
2946 "32")
2947 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2948 ;; needed to compile C files before it is generated.
2949 "-Ss" "pmake" "make -j 1"
af89a667
FB
2950 ;; Probe is failing for MIPS. We therefore define the system
2951 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2952 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2953 ,,@(if (string-prefix? "mips" (%current-system))
2954 (list "-A" "49" "-V" "1")
2955 (list))
ec322be2
FB
2956 ;; Generate shared libraries.
2957 "--shared"
2958 ;; Build a full LAPACK library.
2959 ,(string-append "--with-netlib-lapack-tarfile="
2960 (assoc-ref %build-inputs "lapack-tar")))
2961 #:phases
e5b4b96b
EF
2962 (modify-phases %standard-phases
2963 (add-after 'install 'install-doc
2964 (lambda* (#:key outputs inputs #:allow-other-keys)
2965 (let ((doc (string-append (assoc-ref outputs "doc")
2966 "/share/doc/atlas")))
2967 (mkdir-p doc)
2968 (fold (lambda (file previous)
2969 (and previous (zero? (system* "cp" file doc))))
2970 #t (find-files "../ATLAS/doc" ".*")))))
2971 (add-after 'check 'check-pt
2972 (lambda _ (zero? (system* "make" "ptcheck"))))
2973 ;; Fix files required to run configure.
2974 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
2975 (lambda _
2976 ;; Use `sh', not `/bin/sh'.
2977 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2978 (("/bin/sh")
e5b4b96b
EF
2979 "sh"))))
2980 ;; Fix /bin/sh in generated make files.
2981 (add-after 'configure 'fix-/bin/sh-in-generated-files
2982 (lambda _
2983 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2984 (("/bin/sh")
2985 "sh"))))
2986 ;; ATLAS configure program does not accepts the default flags
2987 ;; passed by the 'gnu-build-system'.
2988 (replace 'configure
2989 (lambda* (#:key native-inputs inputs outputs
2990 (configure-flags '())
2991 #:allow-other-keys #:rest args)
2992 (let* ((prefix (assoc-ref outputs "out"))
2993 (bash (or (and=> (assoc-ref
2994 (or native-inputs inputs) "bash")
2995 (cut string-append <> "/bin/bash"))
2996 "/bin/sh"))
2997 (flags `(,(string-append "--prefix=" prefix)
2998 ,@configure-flags))
2999 (abs-srcdir (getcwd))
3000 (srcdir (string-append "../" (basename abs-srcdir))))
3001 (format #t "source directory: ~s (relative from build: ~s)~%"
3002 abs-srcdir srcdir)
3003 (mkdir "../build")
3004 (chdir "../build")
3005 (format #t "build directory: ~s~%" (getcwd))
3006 (format #t "configure flags: ~s~%" flags)
3007 (zero? (apply system* bash
3008 (string-append srcdir "/configure")
3009 flags))))))))
ec322be2
FB
3010 (synopsis "Automatically Tuned Linear Algebra Software")
3011 (description
3012 "ATLAS is an automatically tuned linear algebra software library
3013providing C and Fortran77 interfaces to a portably efficient BLAS
3014implementation, as well as a few routines from LAPACK.
3015
f15615b1
LC
3016Optimization occurs at build time. For this reason, the library is built on
3017the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3018
f15615b1 3019Before building the library, CPU throttling should be disabled. This can be
d97c429a 3020done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3021
8e9ba611 3022@example
d97c429a 3023# cpupower --governor performance
8e9ba611 3024@end example
ec322be2 3025
d97c429a 3026Failure to do so will result in a library with poor performance.")
ec322be2 3027 (license license:bsd-3)))
c12efc72
AE
3028
3029(define-public glm
3030 (package
3031 (name "glm")
3032 (version "0.9.6.3")
3033 (source
3034 (origin
3035 (method url-fetch)
de67e922
LF
3036 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3037 "/glm-" version ".zip"))
c12efc72
AE
3038 (sha256
3039 (base32
3040 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3041 (build-system cmake-build-system)
3042 (native-inputs
3043 `(("unzip" ,unzip)))
3044 (home-page "http://glm.g-truc.net")
3045 (synopsis "OpenGL Mathematics library")
3046 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3047library for graphics software based on the OpenGL Shading Language (GLSL)
3048specifications.")
3049 (license license:expat)))
7f18257b
AE
3050
3051(define-public lpsolve
3052 (package
3053 (name "lpsolve")
3054 (version "5.5.2.0")
3055 (source
3056 (origin
3057 (method url-fetch)
3058 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3059 "/lp_solve_" version "_source.tar.gz"))
3060 (sha256
3061 (base32
3062 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
3063 (modules '((guix build utils)))
3064 (snippet
3065 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3066 (("^c=cc") "c=gcc")
3067 ;; Pretend to be on a 64 bit platform to obtain a common directory
3068 ;; name for the build results on all architectures; nothing else
3069 ;; seems to depend on it.
5dbfbef7
LC
3070 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3071
3072 ;; The check for 'isnan' as it is written fails with
3073 ;; "non-floating-point argument in call to function
3074 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3075 ;; definition, which in turn leads to bad things. Fix the feature
3076 ;; test.
3077 (("isnan\\(0\\)") "isnan(0.)")))))
7f18257b
AE
3078 (build-system gnu-build-system)
3079 (arguments
3080 `(#:tests? #f ; no check target
3081 #:phases
3082 (modify-phases %standard-phases
3083 (delete 'configure)
3084 (replace 'build
3085 (lambda _
6689d094
LC
3086 (and (with-directory-excursion "lpsolve55"
3087 (zero? (system* "bash" "ccc")))
3088 (with-directory-excursion "lp_solve"
3089 (zero? (system* "bash" "ccc"))))))
7f18257b
AE
3090 (replace 'install
3091 (lambda* (#:key outputs #:allow-other-keys)
3092 (let* ((out (assoc-ref outputs "out"))
3093 (bin (string-append out "/bin"))
3094 (lib (string-append out "/lib"))
3095 ;; This is where LibreOffice expects to find the header
3096 ;; files, and where they are installed by Debian.
3097 (include (string-append out "/include/lpsolve")))
3098 (mkdir-p lib)
3099 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
3100 (string-append lib "/liblpsolve55.a"))
3101 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
3102 (string-append lib "/liblpsolve55.so"))
96c46210
LC
3103 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3104
7f18257b
AE
3105 ;; Install a subset of the header files as on Debian
3106 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3107 (for-each (lambda (name)
3108 (install-file name include))
3109 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3110 (with-directory-excursion "shared"
96c46210
LC
3111 (for-each (lambda (name)
3112 (install-file name include))
3113 (find-files "." "\\.h$")))
7f18257b
AE
3114 #t))))))
3115 (home-page "http://lpsolve.sourceforge.net/")
3116 (synopsis "Mixed integer linear programming (MILP) solver")
3117 (description
3118 "lp_solve is a mixed integer linear programming solver based on the
3119revised simplex and the branch-and-bound methods.")
3120 (license license:lgpl2.1+)))
a17d4564
EB
3121
3122(define-public dealii
3123 (package
3124 (name "dealii")
24404eaf 3125 (version "8.5.1")
a17d4564
EB
3126 (source
3127 (origin
3128 (method url-fetch)
3129 (uri (string-append "https://github.com/dealii/dealii/releases/"
3130 "download/v" version "/dealii-" version ".tar.gz"))
3131 (sha256
3132 (base32
24404eaf 3133 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
a17d4564
EB
3134 (modules '((guix build utils)))
3135 (snippet
3136 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3137 '(delete-file-recursively "bundled"))))
3138 (build-system cmake-build-system)
3139 (inputs
3140 `(("tbb" ,tbb)
3141 ("zlib" ,zlib)
3142 ("boost" ,boost)
3143 ("p4est" ,p4est)
3144 ("blas" ,openblas)
3145 ("lapack" ,lapack)
3146 ("arpack" ,arpack-ng)
3147 ("muparser" ,muparser)
3148 ("gfortran" ,gfortran)
3149 ("suitesparse" ,suitesparse))) ;for UMFPACK
3150 (arguments
3151 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3152 #:configure-flags
3153 ;; Work around a bug in libsuitesparseconfig linking
3154 ;; see https://github.com/dealii/dealii/issues/4745
3155 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3156 (home-page "https://www.dealii.org")
3157 (synopsis "Finite element library")
3158 (description
3159 "Deal.II is a C++ program library targeted at the computational solution
3160of partial differential equations using adaptive finite elements. The main
3161aim of deal.II is to enable rapid development of modern finite element codes,
3162using among other aspects adaptive meshes and a wide array of tools often used
3163in finite element programs.")
3164 (license license:lgpl2.1+)))
3165
3166(define-public dealii-openmpi
3167 (package (inherit dealii)
3168 (name "dealii-openmpi")
3169 (inputs
3170 `(("mpi" ,openmpi)
3171 ;;Supported only with MPI:
3172 ("p4est" ,p4est-openmpi)
3173 ("petsc" ,petsc-openmpi)
3174 ("slepc" ,slepc-openmpi)
3175 ("metis" ,metis) ;for MUMPS
3176 ("scalapack" ,scalapack) ;for MUMPS
3177 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3178 ("arpack" ,arpack-ng-openmpi)
3179 ,@(fold alist-delete (package-inputs dealii)
3180 '("p4est" "arpack"))))
3181 (arguments
3182 (substitute-keyword-arguments (package-arguments dealii)
3183 ((#:configure-flags cf)
3184 ``("-DMPI_C_COMPILER=mpicc"
3185 "-DMPI_CXX_COMPILER=mpicxx"
3186 "-DMPI_Fortran_COMPILER=mpifort"
3187 ,@,cf))))
3188 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
3189
3190(define-public flann
3191 (package
3192 (name "flann")
3193 (version "1.8.4")
3194 (source
3195 (origin
3196 (method url-fetch)
3197 (uri
3198 (string-append
3199 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3200 version "-src.zip"))
3201 (sha256
3202 (base32
3203 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3204 (build-system cmake-build-system)
6b6aca9b
LC
3205 (outputs '("out"
3206 "octave")) ;46 MiB .mex file that pulls Octave
194c7f95
AE
3207 (native-inputs
3208 `(("unzip" ,unzip)))
3209 (inputs
3210 `(("hdf5" ,hdf5)
3211 ("octave" ,octave)
3212 ("python" ,python-2) ; print syntax
3213 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3214 ("zlib" ,zlib)))
3215 (arguments
39b30337
LC
3216 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3217 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3218 #:strip-directories '("lib" "lib64" "libexec"
3219 "bin" "sbin" "share/flann/octave")
3220
9684e30b
LC
3221 ;; Save 12 MiB by not installing .a files. Passing
3222 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3223 #:phases (modify-phases %standard-phases
6b6aca9b
LC
3224 (add-before 'configure 'set-octave-directory
3225 (lambda* (#:key outputs #:allow-other-keys)
3226 ;; Install the .mex file in the "octave" output.
3227 (let ((out (assoc-ref outputs "octave")))
3228 (substitute* "src/matlab/CMakeLists.txt"
3229 (("share/flann/octave")
3230 (string-append out "/share/flann/octave")))
3231 #t)))
9684e30b
LC
3232 (add-after 'install 'remove-static-libraries
3233 (lambda* (#:key outputs #:allow-other-keys)
3234 (let* ((out (assoc-ref outputs "out"))
3235 (lib (string-append out "/lib")))
3236 (for-each delete-file
3237 (find-files lib "\\.a$"))
3238 #t))))
3239
39b30337 3240 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
3241 (home-page "http://www.cs.ubc.ca/research/flann/")
3242 (synopsis "Library for approximate nearest neighbors computation")
3243 (description "FLANN is a library for performing fast approximate
3244nearest neighbor searches in high dimensional spaces. It implements a
3245collection of algorithms and a system for automatically choosing the best
3246algorithm and optimum parameters depending on the dataset.
3247
3248FLANN is written in C++ and contains bindings for C, Octave and Python.")
3249 (license (license:non-copyleft "file://COPYING"
3250 "See COPYING in the distribution."))))
d8c97beb
EF
3251
3252(define-public wcalc
3253 (package
3254 (name "wcalc")
3255 (version "2.5")
3256 (source
3257 (origin
3258 (method url-fetch)
de67e922
LF
3259 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3260 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
3261 (sha256
3262 (base32
3263 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3264 (build-system gnu-build-system)
3265 (inputs
3266 `(("mpfr" ,mpfr)
3267 ("readline" ,readline)))
3268 (home-page "http://w-calc.sourceforge.net/index.php")
3269 (synopsis "Flexible command-line scientific calculator")
3270 (description "Wcalc is a very capable calculator. It has standard functions
3271(sin, asin, and sinh for example, in either radians or degrees), many
3272pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3273variables, a command history, hex/octal/binary input and output, unit
3274conversions, embedded comments, and an expandable expression entry field. It
3275evaluates expressions using the standard order of operations.")
3276 (license license:gpl2+)))
45147b0c
FH
3277
3278(define-public xaos
3279 (package
3280 (name "xaos")
3281 (version "3.6")
3282 (source (origin
3283 (method url-fetch)
de67e922
LF
3284 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3285 "/xaos-" version ".tar.gz"))
45147b0c
FH
3286 (sha256
3287 (base32
3288 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3289 (build-system gnu-build-system)
b94a6ca0 3290 (native-inputs `(("gettext" ,gettext-minimal)))
45147b0c
FH
3291 (inputs `(("libx11" ,libx11)
3292 ("zlib" ,zlib)
3293 ("libpng" ,libpng)
3294 ("gsl" ,gsl)))
3295 (arguments
3296 `(#:tests? #f ;no "check" target
3297 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3298 (synopsis "Real-time fractal zoomer")
3299 (description "GNU XaoS is a graphical program that generates fractal
3300patterns and allows you to zoom in and out of them infinitely in a fluid,
3301continuous manner. It also includes tutorials that help to explain how fractals
3302are built. It can generate many different fractal types such as the Mandelbrot
3303set.")
6fd52309 3304 (home-page "https://www.gnu.org/software/xaos/")
45147b0c 3305 (license license:gpl2+)))
528bb464
EB
3306
3307(define-public hypre
3308 (package
3309 (name "hypre")
3310 (version "2.11.0")
3311 (source (origin
3312 (method url-fetch)
3313 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3314 "v" version ".tar.gz"))
3315 (file-name (string-append name "-" version ".tar.gz"))
3316 (sha256
3317 (base32
3318 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3319 (modules '((guix build utils)))
3320 (snippet
3321 '(begin
3322 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3323 ;; substitute the tarball creation time.
3324 (substitute* "src/utilities/HYPRE_utilities.h"
3325 (("Date Compiled: .*$")
3326 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3327 #t))))
3328 (build-system gnu-build-system)
3329 (outputs '("out" ;6.1 MiB of headers and libraries
3330 "doc")) ;4.8 MiB of documentation
3331 (native-inputs
3332 `(("doc++" ,doc++)
3333 ("netpbm" ,netpbm)
3334 ("texlive" ,texlive) ;full package required for fonts
3335 ("ghostscript" ,ghostscript)))
3336 (inputs
3337 `(("blas" ,openblas)
3338 ("lapack" ,lapack)))
3339 (arguments
3340 `(#:modules ((srfi srfi-1)
3341 ,@%gnu-build-system-modules)
3342 #:configure-flags '("--enable-shared"
3343 "--disable-fortran"
3344 "--without-MPI"
3345 "--with-openmp"
3346 "--with-fei"
3347 "--with-lapack"
3348 "--with-blas")
3349 #:phases
3350 (modify-phases %standard-phases
3351 (add-before 'configure 'chdir-src
3352 (lambda _ (chdir "src")))
3353 (replace 'configure
3354 (lambda* (#:key build target configure-flags
3355 #:allow-other-keys #:rest args)
3356 (let* ((configure (assoc-ref %standard-phases 'configure)))
3357 (apply configure
3358 (append args
3359 (list #:configure-flags
3360 (cons (string-append
3361 "--host=" (or target build))
3362 configure-flags)))))))
3363 (add-after 'build 'build-docs
3364 (lambda _
3365 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3366 (replace 'check
3367 (lambda _
3368 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3369 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3370 (and (system* "make" "check" "CHECKRUN=")
3371 (fold (lambda (filename result)
3372 (and result
3373 (let ((size (stat:size (stat filename))))
3374 (when (not (zero? size))
3375 (format #t "~a size ~d; error indication~%"
3376 filename size))
3377 (zero? size))))
3378 #t
3379 (find-files "test" ".*\\.err$")))))
3380 (add-after 'install 'install-docs
3381 (lambda* (#:key outputs #:allow-other-keys)
3382 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3383 (let* ((doc (assoc-ref outputs "doc"))
3384 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
3385 (with-directory-excursion "docs"
3386 (for-each (lambda (base)
3387 (install-file (string-append base ".pdf") docdir)
3388 (copy-recursively base docdir)) ;html docs
3389 '("HYPRE_usr_manual"
3390 "HYPRE_ref_manual")))
3391 #t))))))
3392 (home-page "http://www.llnl.gov/casc/hypre/")
3393 (synopsis "Library of solvers and preconditioners for linear equations")
3394 (description
3395 "HYPRE is a software library of high performance preconditioners and
3396solvers for the solution of large, sparse linear systems of equations. It
3397features multigrid solvers for both structured and unstructured grid
3398problems.")
3399 (license license:lgpl2.1)))
3400
3401(define-public hypre-openmpi
3402 (package (inherit hypre)
3403 (name "hypre-openmpi")
3404 (inputs
3405 `(("mpi" ,openmpi)
3406 ,@(package-inputs hypre)))
3407 (arguments
3408 (substitute-keyword-arguments (package-arguments hypre)
3409 ((#:configure-flags flags)
3410 ``("--with-MPI"
3411 ,@(delete "--without-MPI" ,flags)))))
3412 (synopsis "Parallel solvers and preconditioners for linear equations")
3413 (description
3414 "HYPRE is a software library of high performance preconditioners and
3415solvers for the solution of large, sparse linear systems of equations on
3416parallel computers. It features parallel multigrid solvers for both
3417structured and unstructured grid problems.")))
6c90e183
EB
3418
3419(define-public matio
3420 (package
3421 (name "matio")
3422 (version "1.5.6")
3423 (source
3424 (origin
3425 (method url-fetch)
de67e922 3426 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
3427 "matio-" version ".tar.gz"))
3428 (sha256
3429 (base32
3430 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3431 (build-system gnu-build-system)
3432 (inputs
3433 `(("zlib" ,zlib)
3434 ("hdf5" ,hdf5)))
3435 (home-page "http://matio.sourceforge.net/")
3436 (synopsis "Library for reading and writing MAT files")
3437 (description "Matio is a library for reading and writing MAT files. It
3438supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3439 (license license:bsd-2)))
d721c83a 3440
517318ad
LF
3441(define-public vc
3442 (package
3443 (name "vc")
3444 (version "1.2.0")
3445 (source
3446 (origin (method url-fetch)
3447 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3448 "download/" version "/Vc-" version ".tar.gz"))
3449 (sha256
3450 (base32
3451 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
3452 (build-system cmake-build-system)
3453 (arguments
3454 '(#:configure-flags
3455 '("-DBUILD_TESTING=ON")))
3456 (synopsis "SIMD vector classes for C++")
3457 (description "Vc provides portable, zero-overhead C++ types for explicitly
3458data-parallel programming. It is a library designed to ease explicit
3459vectorization of C++ code. Its types enable explicitly stating data-parallel
3460operations on multiple values. The parallelism is therefore added via the type
3461system. Vc has an intuitive API and provides portability between different
3462compilers and compiler versions as well as portability between different vector
3463instruction sets. Thus, an application written with Vc can be compiled for:
3464@enumerate
3465@item AVX and AVX2
d1e4ad1b 3466@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
3467@item Scalar
3468@item MIC
3469@item NEON (in development)
3470@item NVIDIA GPUs / CUDA (in development)
3471@end enumerate\n")
3472 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
3473 ;; "No support_???.cpp file exists for this architecture."
3474 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 3475 (license license:bsd-3)))
54052a54 3476
3477(define-public reducelcs
3478 ;; This is the last commit which is available upstream, no
3479 ;; release happened since 2010.
3480 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3481 (revision "1"))
3482 (package
3483 (name "reducelcs")
3484 (version (string-append "1.0-" revision "." (string-take commit 7)))
3485 (source
3486 (origin
3487 (method git-fetch)
3488 (uri (git-reference
3489 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3490 (commit commit)))
3491 (file-name (string-append name "-" version "-checkout"))
3492 (sha256
3493 (base32
3494 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3495 (build-system gnu-build-system)
3496 (inputs
3497 `(("openlibm" ,openlibm)))
3498 (arguments
3499 `(#:tests? #f ; no tests
3500 #:phases
3501 (modify-phases %standard-phases
3502 (delete 'configure) ; No configure script exists.
3503 (replace 'install ; No install phase exists.
3504 (lambda* (#:key outputs #:allow-other-keys)
3505 (let* ((out (assoc-ref outputs "out"))
3506 (bin (string-append out "/bin")))
3507 (install-file "Approximation" bin)
3508 (install-file "CollectResults" bin)
3509 (install-file "GenerateInstances" bin)
3510 #t))))))
3511 (synopsis "Approximate Longest Commons Subsequence computation tool")
3512 (description
3513 "@code{reduceLCS} is an implementation of the Reduce-Expand
3514algorithm for LCS. It is a fast program to compute the approximate
3515Longest Commons Subsequence of a set of strings.")
3516 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 3517 (license license:gpl3+))))
479c4273
JD
3518
3519(define-public jacal
3520 (package
3521 (name "jacal")
3522 (version "1c4")
3523 (source (origin
3524 (method url-fetch)
3525 (uri (string-append
3526 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3527 version ".zip"))
3528 (sha256 (base32
3529 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3530 (patches (search-patches "jacal-fix-texinfo.patch"))))
3531 (build-system gnu-build-system)
3532 (arguments
3533 `(#:phases
3534 (modify-phases %standard-phases
3535 (add-before 'build 'pre-build
3536 ;; Don't use upstream's script - it really doesn't fit into
3537 ;; Guix's functional paradigm.
3538 (lambda* (#:key inputs outputs #:allow-other-keys)
3539 (substitute* "Makefile"
3540 (("^install: install-script") "install: "))))
3541 (add-after 'install 'post-install
3542 ;; Instead, we provide our own simplified script.
3543 (lambda* (#:key inputs outputs #:allow-other-keys)
3544 (let ((wrapper (string-append (assoc-ref outputs "out")
3545 "/bin/jacal")))
3546 (format (open wrapper (logior O_WRONLY O_CREAT))
3547 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3548 "-e '(slib:load \"~a/lib/jacal/math\") "
3549 "(math)' \"$@\"\n")
3550 (which "bash")
3551 (assoc-ref inputs "scm")
3552 (assoc-ref outputs "out"))
3553 (chmod wrapper #o555))))
3554 (replace 'configure
3555 (lambda* (#:key inputs outputs #:allow-other-keys)
3556 (zero? (system* "./configure"
3557 (string-append "--prefix="
3558 (assoc-ref outputs "out")))))))))
3559 (inputs `(("scm" ,scm)))
3560 (native-inputs `(("unzip" ,unzip)
3561 ("texinfo" ,texinfo)))
3562 (synopsis "Symbolic mathematics system")
3563 (description "GNU JACAL is an interactive symbolic mathematics program based on
3564Scheme. It manipulate and simplify a range of mathematical expressions such
3565as equations, scalars, vectors, and matrices.")
6fd52309 3566 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
3567 (license license:gpl3+)))
3568
313844d9
TF
3569(define-public z3
3570 (package
3571 (name "z3")
3572 (version "4.5.0")
3573 (source (origin
3574 (method url-fetch)
3575 (uri (string-append
3576 "https://github.com/Z3Prover/z3/archive/z3-"
3577 version ".tar.gz"))
3578 (sha256
3579 (base32
3580 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
cf684d87 3581 (build-system cmake-build-system)
313844d9 3582 (arguments
cf684d87
TF
3583 `(#:configure-flags
3584 (list "-DBUILD_PYTHON_BINDINGS=true"
3585 "-DINSTALL_PYTHON_BINDINGS=true"
3586 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3587 %output
3588 "/lib/python2.7/site-packages")
3589 (string-append "-DCMAKE_INSTALL_LIBDIR="
3590 %output
3591 "/lib"))
3592
313844d9
TF
3593 #:phases
3594 (modify-phases %standard-phases
cf684d87
TF
3595 (add-before 'configure 'bootstrap
3596 (lambda _
313844d9 3597 (zero?
cf684d87
TF
3598 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3599 (add-before 'check 'make-test-z3
313844d9 3600 (lambda _
cf684d87
TF
3601 ;; Build the test suite executable.
3602 (zero? (system* "make" "test-z3" "-j"
3603 (number->string (parallel-job-count))))))
3604 (replace 'check
3605 (lambda _
3606 ;; Run all the tests that don't require arguments.
3607 (zero? (system* "./test-z3" "/a")))))))
313844d9
TF
3608 (native-inputs
3609 `(("python" ,python-2)))
3610 (synopsis "Theorem prover")
3611 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 3612theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9
TF
3613 (home-page "https://github.com/Z3Prover/z3")
3614 (license license:expat)))
3d5d87a3
JL
3615
3616(define-public cubicle
3617 (package
3618 (name "cubicle")
3619 (version "1.1.1")
3620 (source (origin
3621 (method url-fetch)
3622 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3623 version ".tar.gz"))
3624 (sha256
3625 (base32
3626 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3627 (build-system gnu-build-system)
3628 (native-inputs
3629 `(("ocaml" ,ocaml)
83fef82b 3630 ("which" ,(@@ (gnu packages base) which))))
3d5d87a3
JL
3631 (propagated-inputs
3632 `(("z3" ,z3)))
3633 (arguments
3634 `(#:configure-flags (list "--with-z3")
3635 #:tests? #f
3636 #:phases
3637 (modify-phases %standard-phases
3638 (add-before 'configure 'configure-for-release
3639 (lambda _
3640 (substitute* "Makefile.in"
3641 (("SVNREV=") "#SVNREV="))))
3642 (add-before 'configure 'fix-/bin/sh
3643 (lambda _
3644 (substitute* "configure"
3645 (("/bin/sh") (which "sh")))))
3646 (add-before 'configure 'fix-smt-z3wrapper.ml
3647 (lambda _
3648 (substitute* "Makefile.in"
3649 (("\\\\n") "")))))))
3650 (home-page "http://cubicle.lri.fr/")
3651 (synopsis "Model checker for array-based systems")
5a80c15c
RW
3652 (description "Cubicle is a model checker for verifying safety properties
3653of array-based systems. This is a syntactically restricted class of
3654parametrized transition systems with states represented as arrays indexed by
3655an arbitrary number of processes. Cache coherence protocols and mutual
3656exclusion algorithms are typical examples of such systems.")
3d5d87a3 3657 (license license:asl2.0)))
e01397b4
EB
3658
3659(define-public elemental
3660 (package
3661 (name "elemental")
3662 (version "0.87.7")
3663 (source (origin
3664 (method url-fetch)
3665 (uri (string-append "https://github.com/elemental/Elemental/"
3666 "archive/v" version ".tar.gz"))
3667 (file-name (string-append name "-" version ".tar.gz"))
3668 (sha256
3669 (base32
3670 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3671 (build-system cmake-build-system)
3672 (home-page "http://libelemental.org")
3673 (native-inputs
3674 `(("gfortran" ,gfortran)))
3675 (inputs
3676 `(("blas" ,openblas)
3677 ("gfortran:lib" ,gfortran "lib")
3678 ("gmp" ,gmp)
3679 ("lapack" ,lapack)
3680 ("metis" ,metis)
3681 ("mpc" ,mpc)
3682 ("mpfr" ,mpfr)
3683 ("mpi" ,openmpi)
3684 ("qd" ,qd)))
3685 (arguments
3686 `(#:build-type "Release" ;default RelWithDebInfo not supported
3687 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3688 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3689 "-DEL_CACHE_WARNINGS:BOOL=YES"
3690 "-DEL_TESTS:BOOL=YES"
3691 "-DCMAKE_INSTALL_LIBDIR=lib"
3692 "-DGFORTRAN_LIB=gfortran")
3693 #:phases (modify-phases %standard-phases
3694 (add-before 'check 'setup-tests
3695 (lambda _
3696 ;; Parallelism is done at the MPI layer.
3697 (setenv "OMP_NUM_THREADS" "1")
3698 #t))
3699 (add-after 'install 'remove-tests
3700 (lambda* (#:key outputs #:allow-other-keys)
3701 ;; Tests are installed, with no easy configuration
3702 ;; switch to prevent this, so delete them.
3703 (delete-file-recursively
3704 (string-append (assoc-ref outputs "out") "/bin"))
3705 #t)))))
3706 (synopsis "Dense and sparse-direct linear algebra and optimization")
3707 (description "Elemental is a modern C++ library for distributed-memory
3708dense and sparse-direct linear algebra, conic optimization, and lattice
3709reduction.")
3710 (license license:bsd-2)))
5b05dce7
JN
3711
3712(define-public mcrl2
3713 (package
3714 (name "mcrl2")
3715 (version "201707.1.15162")
3716 (source (origin
3717 (method url-fetch)
3718 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3719 version
3720 ".tar.gz"))
3721 (sha256
3722 (base32
3723 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3724 (native-inputs
3725 `(("subversion" ,subversion)))
3726 (inputs
3727 `(("boost" ,boost)
3728 ("glu" ,glu)
3729 ("mesa" ,mesa)
3730 ("qt" ,qt)))
3731 (build-system cmake-build-system)
ed0c5d3c 3732 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 3733 (description
ed0c5d3c
TGR
3734 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3735specification language for describing concurrent discrete event systems. Its
3736toolset supports analysis and automatic verification, linearisation, simulation,
3737state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
3738specifications. Also, state spaces can be manipulated, visualised and
3739analysed.")
3740 (home-page "http://mcrl2.org")
3741 (license license:boost1.0)))