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