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