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