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