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, 2017, 2018 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, 2017, 2018 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, 2018 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, 2018 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages maths)
47 #:use-module (ice-9 regex)
48 #:use-module (gnu packages)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module (guix utils)
54 #:use-module (guix build utils)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system ocaml)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system r)
60 #:use-module (guix build-system ruby)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages audio)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages boost)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages cmake)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages curl)
70 #:use-module (gnu packages cyrus-sasl)
71 #:use-module (gnu packages documentation)
72 #:use-module (gnu packages elf)
73 #:use-module (gnu packages flex)
74 #:use-module (gnu packages fltk)
75 #:use-module (gnu packages fontutils)
76 #:use-module (gnu packages gettext)
77 #:use-module (gnu packages gcc)
78 #:use-module (gnu packages gd)
79 #:use-module (gnu packages ghostscript)
80 #:use-module (gnu packages graphviz)
81 #:use-module (gnu packages gtk)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages java)
84 #:use-module (gnu packages less)
85 #:use-module (gnu packages lisp)
86 #:use-module (gnu packages linux)
87 #:use-module (gnu packages logging)
88 #:use-module (gnu packages lua)
89 #:use-module (gnu packages gnome)
90 #:use-module (gnu packages guile)
91 #:use-module (gnu packages xorg)
92 #:use-module (gnu packages gl)
93 #:use-module (gnu packages imagemagick)
94 #:use-module (gnu packages m4)
95 #:use-module (gnu packages mpi)
96 #:use-module (gnu packages multiprecision)
97 #:use-module (gnu packages netpbm)
98 #:use-module (gnu packages ocaml)
99 #:use-module (gnu packages pcre)
100 #:use-module (gnu packages popt)
101 #:use-module (gnu packages perl)
102 #:use-module (gnu packages pkg-config)
103 #:use-module (gnu packages pulseaudio)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-web)
106 #:use-module (gnu packages qt)
107 #:use-module (gnu packages readline)
108 #:use-module (gnu packages ruby)
109 #:use-module (gnu packages tbb)
110 #:use-module (gnu packages scheme)
111 #:use-module (gnu packages shells)
112 #:use-module (gnu packages tcl)
113 #:use-module (gnu packages texinfo)
114 #:use-module (gnu packages tex)
115 #:use-module (gnu packages tls)
116 #:use-module (gnu packages version-control)
117 #:use-module (gnu packages wxwidgets)
118 #:use-module (gnu packages xml)
119 #:use-module (srfi srfi-1))
127 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
129 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
130 (build-system gnu-build-system)
131 (inputs `(("gtk+" ,gtk+)
132 ("libxml2" ,libxml2)))
133 (native-inputs `(("pkg-config" ,pkg-config)))
134 (synopsis "Natural deduction first-order logic interface")
135 (description "Aris is a program for performing logical proofs. It supports
136 propositional and predicate logic, as well as Boolean algebra and
137 arithmetical logic. In addition to its predefined inference and equivalence
138 rules, Aris also supports references to older proofs. Its use of standard
139 logical symbols and its natural deduction interface make it easy to use for
141 (license license:gpl3+)
142 (home-page "https://www.gnu.org/software/aris/")))
144 (define-public c-graph
150 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
153 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
154 (build-system gnu-build-system)
156 `(("fortran" ,gfortran)))
157 (synopsis "Visualizing and demonstrating convolution")
159 "GNU C-Graph is a tool for demonstrating the theory of convolution.
160 Thus, it can serve as an excellent aid to students of signal and systems
161 theory in visualizing the convolution process. Rather than forcing the
162 student to write code, the program offers an intuitive interface with
163 interactive dialogs to guide them.")
164 (license license:gpl3+)
165 (home-page "https://www.gnu.org/software/c-graph/")))
174 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
175 version "/coda-" version ".tar.gz"))
177 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
178 (patches (search-patches "coda-use-system-libs.patch"))
179 (modules '((guix build utils)))
181 ;; Make sure we don't use the bundled software.
183 (for-each (lambda (d)
184 (delete-file-recursively (string-append "libcoda/" d)))
185 '("zlib" "pcre" "expat"))
188 `(("fortran" ,gfortran)
190 ("python-numpy" ,python-numpy)))
197 (build-system gnu-build-system)
199 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
200 "LIBS= -lz -lpcre -lexpat")))
201 (synopsis "A common interface to various earth observation data formats")
203 "The Common Data Access toolbox (CODA) provides a set of interfaces for
204 reading remote sensing data from earth observation data files. It consists of
205 command line applications and interfaces to the C, Fortran, Python, and Java
206 programming languages.")
207 (home-page "https://stcorp.nl/coda")
208 (license license:gpl2+)))
216 (uri (string-append "http://www.qhull.org/download/qhull-"
217 (car (string-split version #\.))
221 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
222 (build-system cmake-build-system)
223 (synopsis "Calculate convex hulls and related structures")
225 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
226 diagram, halfspace intersection about a point, furthest-site Delaunay
227 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
228 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
229 algorithm for computing the convex hull. It handles roundoff errors from
230 floating point arithmetic. It computes volumes, surface areas, and
231 approximations to the convex hull.
233 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
234 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
235 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
237 (home-page "http://qhull.org")
238 (license (license:non-copyleft "file://COPYING.txt"
239 "See COPYING in the distribution."))))
247 (uri (string-append "mirror://gnu/units/units-" version
250 "1n2xzpnxfn475zkd8rzs5gg58xszjbr4bdbgvk6hryzimvwwj0qz"))))
251 (build-system gnu-build-system)
253 `(("readline" ,readline)
254 ("python" ,python-wrapper) ;for 'units_cur' script
255 ("python-requests" ,python-requests)))
257 `(#:phases (modify-phases %standard-phases
258 (add-after 'install 'wrap-units_cur
259 (lambda* (#:key outputs #:allow-other-keys)
260 (let* ((out (assoc-ref outputs "out"))
261 (bin (string-append out "/bin")))
262 (wrap-program (string-append bin "/units_cur")
263 `("PYTHONPATH" ":" prefix
264 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
266 (synopsis "Conversion between thousands of scales")
268 "GNU Units converts numeric quantities between units of measure. It
269 can handle scale changes through adaptive usage of standard scale
270 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
271 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
272 enough to be used effectively as a scientific calculator.")
273 (license license:gpl3+)
274 (home-page "https://www.gnu.org/software/units/")))
276 (define-public double-conversion
278 (name "double-conversion")
283 "https://github.com/floitsch/double-conversion/archive/v"
285 (file-name (string-append name "-" version ".tar.gz"))
288 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
289 (build-system cmake-build-system)
291 '(#:test-target "test"
292 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
293 "-DBUILD_TESTING=ON")))
294 (home-page "https://github.com/floitsch/double-conversion")
295 (synopsis "Conversion routines for IEEE doubles")
297 "The double-conversion library provides binary-decimal and decimal-binary
298 routines for IEEE doubles. The library consists of efficient conversion
299 routines that have been extracted from the V8 JavaScript engine.")
300 (license license:bsd-3)))
302 (define-public dionysus
308 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
312 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
313 (build-system gnu-build-system)
314 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
315 (synopsis "Local search for universal constants and scientific values")
317 "GNU Dionysus is a convenient system for quickly retrieving the values of
318 mathematical constants used in science and engineering. Values can be
319 searched using a simple command-line tool, choosing from three databases:
320 universal constants, atomic numbers, and constants related to
322 (license license:gpl3+)
323 (home-page "https://www.gnu.org/software/dionysus/")))
331 (uri (string-append "mirror://gnu/gsl/gsl-"
335 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
336 (patches (search-patches "gsl-test-i686.patch"))))
337 (build-system gnu-build-system)
339 `(;; Currently there are numerous tests that fail on "exotic"
340 ;; architectures such as aarch64 and ppc64le.
341 ,@(if (string-prefix? "aarch64-linux"
342 (or (%current-target-system) (%current-system)))
345 (home-page "https://www.gnu.org/software/gsl/")
346 (synopsis "Numerical library for C and C++")
348 "The GNU Scientific Library is a library for numerical analysis in C
349 and C++. It includes a wide range of mathematical routines, with over 1000
350 functions in total. Subject areas covered by the library include:
351 differential equations, linear algebra, Fast Fourier Transforms and random
353 (license license:gpl3+)))
355 (define-public ocaml-gsl
364 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
365 version"/gsl-ocaml-" version ".tar.gz"))
368 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
369 (build-system ocaml-build-system)
372 (home-page "https://mmottl.github.io/gsl-ocaml")
373 (synopsis "Bindings to the GNU Scientific Library")
375 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
376 the OCaml language.")
377 (license license:gpl3+)))
379 (define-public ocaml4.01-gsl
380 (package-with-ocaml4.01 ocaml-gsl))
389 (uri (string-append "mirror://gnu/glpk/glpk-"
393 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
394 (build-system gnu-build-system)
398 `(#:configure-flags '("--with-gmp")))
399 (home-page "https://www.gnu.org/software/glpk/")
400 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
402 "GLPK is a C library for solving large-scale linear programming (LP),
403 mixed integer programming (MIP), and other related problems. It supports the
404 GNU MathProg modeling language, a subset of the AMPL language, and features a
405 translator for the language. In addition to the C library, a stand-alone
406 LP/MIP solver is included in the package.")
407 (license license:gpl3+)))
416 (uri (string-append "http://www.4ti2.de/version_" version
417 "/4ti2-" version ".tar.gz"))
420 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
421 (build-system gnu-build-system)
423 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
427 (home-page "http://www.4ti2.de/")
428 (synopsis "Mathematical tool suite for problems on linear spaces")
430 "4ti2 implements algorithms for solving algebraic, geometric and
431 combinatorial problems on linear spaces. Among others, it solves systems
432 of linear equations, computes extreme rays of polyhedral cones, solves
433 integer programming problems and computes Markov bases for statistics.")
434 (license license:gpl2+)))
436 (define-public cddlib
443 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
444 (string-delete #\. version) ".tar.gz"))
447 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
448 (build-system gnu-build-system)
451 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
452 (synopsis "Library for convex hulls and extreme rays of polyhedra")
454 "The C-library cddlib implements the Double Description Method of
455 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
456 rays of a general convex polyhedron given by a system of linear inequalities
457 in arbitrary dimension. It can also be used for the converse operation of
458 computing convex hulls.")
459 (license license:gpl2+)))
461 (define-public arpack-ng
465 (home-page "https://github.com/opencollab/arpack-ng")
469 (uri (string-append home-page "/archive/" version ".tar.gz"))
470 (file-name (string-append name "-" version ".tar.gz"))
473 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
474 (build-system gnu-build-system)
476 '(#:phases (modify-phases %standard-phases
477 (add-after 'unpack 'autoreconf
479 (invoke "autoreconf" "-vfi"))))))
481 `(("autoconf" ,autoconf)
482 ("automake" ,automake)
483 ("libtool" ,libtool)))
486 ("fortran" ,gfortran)))
487 (synopsis "Fortran subroutines for solving eigenvalue problems")
489 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
490 large scale eigenvalue problems.")
491 (license (license:non-copyleft "file://COPYING"
492 "See COPYING in the distribution."))))
494 (define-public arpack-ng-3.3.0
498 (name (package-name arpack-ng))
499 (home-page (package-home-page arpack-ng))
503 (uri (string-append home-page "/archive/" version ".tar.gz"))
504 (file-name (string-append name "-" version ".tar.gz"))
507 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
509 (define-public arpack-ng-openmpi
510 (package (inherit arpack-ng)
511 (name "arpack-ng-openmpi")
514 ,@(package-inputs arpack-ng)))
516 (substitute-keyword-arguments (package-arguments arpack-ng)
517 ((#:configure-flags _ '())
518 ''("--enable-mpi"))))
519 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
521 (define-public lapack
528 (uri (string-append "http://www.netlib.org/lapack/lapack-"
532 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
533 (build-system cmake-build-system)
534 (home-page "http://www.netlib.org/lapack/")
535 (inputs `(("fortran" ,gfortran)
536 ("python" ,python-2)))
538 `(#:configure-flags (list
539 "-DBUILD_SHARED_LIBS:BOOL=YES"
542 ;; Build the 'LAPACKE_clatms' functions.
543 "-DLAPACKE_WITH_TMG=ON")
545 (modify-phases %standard-phases
546 (add-before 'check 'patch-python
547 (lambda* (#:key inputs #:allow-other-keys)
548 (let ((python (assoc-ref inputs "python")))
549 (substitute* "lapack_testing.py"
550 (("/usr/bin/env python") python)))
552 (synopsis "Library for numerical linear algebra")
554 "LAPACK is a Fortran 90 library for solving the most commonly occurring
555 problems in numerical linear algebra.")
556 (license (license:non-copyleft "file://LICENSE"
557 "See LICENSE in the distribution."))))
559 (define-public scalapack
566 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
570 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
571 (build-system cmake-build-system)
574 ("fortran" ,gfortran)
575 ("lapack" ,lapack))) ;for testing only
577 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
578 #:phases (modify-phases %standard-phases
579 (add-before 'check 'set-test-environment
581 ;; By default, running the test suite would fail because
582 ;; 'ssh' could not be found in $PATH. Define this
583 ;; variable to placate Open MPI without adding a
584 ;; dependency on OpenSSH (the agent isn't used anyway.)
585 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
587 (home-page "http://www.netlib.org/scalapack/")
588 (synopsis "Library for scalable numerical linear algebra")
590 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
591 routines on parallel distributed memory machines. ScaLAPACK solves dense and
592 banded linear systems, least squares problems, eigenvalue problems, and
593 singular value problems.")
594 (license (license:bsd-style "file://LICENSE"
595 "See LICENSE in the distribution."))))
597 (define-public gnuplot
603 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
608 "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"))))
609 (build-system gnu-build-system)
610 (inputs `(("readline" ,readline)
616 `(("pkg-config" ,pkg-config)
617 ("texlive" ,texlive-tiny)))
618 (arguments `(#:configure-flags (list (string-append
619 "--with-texdir=" %output
620 "/texmf-local/tex/latex/gnuplot"))))
621 (home-page "http://www.gnuplot.info")
622 (synopsis "Command-line driven graphing utility")
623 (description "Gnuplot is a portable command-line driven graphing
624 utility. It was originally created to allow scientists and students to
625 visualize mathematical functions and data interactively, but has grown to
626 support many non-interactive uses such as web scripting. It is also used as a
627 plotting engine by third-party applications like Octave.")
628 ;; X11 Style with the additional restriction that derived works may only be
629 ;; distributed as patches to the original.
630 (license (license:fsf-free
631 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
640 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
642 (file-name (string-append name "-" version ".tar.gz"))
645 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
647 `(("fortran" ,gfortran)))
648 (build-system gnu-build-system)
649 (synopsis "General Cartographic Transformation Package (GCTP)")
651 "The General Cartographic Transformation Package (GCTP) is a system of
652 software routines designed to permit the transformation of coordinate pairs
653 from one map projection to another. The GCTP is the standard computer
654 software used by the National Mapping Division for map projection
656 (home-page "https://github.com/OkoSanto/GCTP")
657 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
666 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
667 version "/src/hdf-" version ".tar.bz2"))
669 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
670 (patches (search-patches "hdf4-architectures.patch"
671 "hdf4-reproducibility.patch"
672 "hdf4-shared-fortran.patch"))))
673 (build-system gnu-build-system)
675 `(("gfortran" ,gfortran)
680 ("libjpeg" ,libjpeg)))
682 `(#:parallel-tests? #f
683 #:configure-flags '("--enable-shared")
685 (modify-phases %standard-phases
686 ;; This is inspired by two of Debian's patches.
687 (add-before 'configure 'add-more-aarch64-support
689 (substitute* '("mfhdf/ncgen/ncgen.l"
690 "mfhdf/ncgen/ncgenyy.c"
691 "mfhdf/libsrc/netcdf.h.in")
692 (("AIX5L64") "__aarch64__"))
694 (add-before 'configure 'patchbuild
697 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
699 (("/bin/mkdir") "mkdir"))
700 (substitute* (find-files "." "^Makefile\\.in$")
701 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
702 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
703 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
704 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
705 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
707 (add-after 'configure 'patch-settings
709 ;; libhdf4.settings contains the full path of the
710 ;; compilers used, and its contents are included in
711 ;; .so-files. We truncate the hashes to avoid
712 ;; unnecessary store references to those compilers:
713 (substitute* "libhdf4.settings"
714 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
715 (string-append prefix (string-take hash 10) "...")))
718 (home-page "https://www.hdfgroup.org/products/hdf4/")
720 "Library and multi-object file format for storing and managing data")
721 (description "HDF4 is a library and multi-object file format for storing
722 and managing data between machines. HDF4 is an older hierarchical data format,
723 incompatible with HDF5.")
725 (license:non-copyleft
726 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
728 (define-public hdf4-alt
733 (substitute-keyword-arguments (package-arguments hdf4)
734 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
736 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
745 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
746 "hdf5-" (version-major+minor version)
747 "/hdf5-" version "/src/hdf5-"
749 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
752 (take (string-split version #\.) 2))
753 "/src/hdf5-" version ".tar.bz2")))
755 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
756 (patches (list (search-patch "hdf5-config-date.patch")))))
757 (build-system gnu-build-system)
761 `(("gfortran" ,gfortran)))
762 (outputs '("out" ; core library
763 "fortran")) ; fortran interface
765 `(;; Some of the users, notably Flann, need the C++ interface.
766 #:configure-flags '("--enable-cxx"
768 "--enable-fortran2003")
769 ;; Use -fPIC to allow the R bindings to link with the static libraries
770 #:make-flags (list "CFLAGS=-fPIC"
773 (modify-phases %standard-phases
774 (add-before 'configure 'patch-configure
775 (lambda* (#:key outputs #:allow-other-keys)
776 (substitute* "configure"
778 (substitute* "fortran/src/Makefile.in"
779 (("libhdf5_fortran_la_LDFLAGS =")
780 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
781 (assoc-ref outputs "fortran") "/lib")))
782 (substitute* "hl/fortran/src/Makefile.in"
783 (("libhdf5hl_fortran_la_LDFLAGS =")
784 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
785 (assoc-ref outputs "fortran") "/lib")))
787 (add-after 'configure 'patch-settings
789 ;; libhdf5.settings contains the full path of the
790 ;; compilers used, and its contents are included in
791 ;; libhdf5.so. We truncate the hashes to avoid
792 ;; unnecessary store references to those compilers:
793 (substitute* "src/libhdf5.settings"
794 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
795 (string-append prefix (string-take hash 10) "..."))
796 ;; Don't record the build-time kernel version to make the
797 ;; settings file reproducible.
798 (("Uname information:.*")
799 "Uname information: Linux\n"))
801 (add-after 'install 'patch-references
802 (lambda* (#:key inputs outputs #:allow-other-keys)
803 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
804 (zlib (assoc-ref inputs "zlib")))
805 (substitute* (find-files bin "h5p?cc")
807 (string-append "-L" zlib "/lib " lib)))
809 (add-after 'install 'split
810 (lambda* (#:key inputs outputs #:allow-other-keys)
811 ;; Move all fortran-related files
812 (let* ((out (assoc-ref outputs "out"))
813 (bin (string-append out "/bin"))
814 (lib (string-append out "/lib"))
815 (inc (string-append out "/include"))
816 (ex (string-append out "/share/hdf5_examples/fortran"))
817 (fort (assoc-ref outputs "fortran"))
818 (fbin (string-append fort "/bin"))
819 (flib (string-append fort "/lib"))
820 (finc (string-append fort "/include"))
821 (fex (string-append fort "/share/hdf5_examples/fortran")))
826 (rename-file (string-append bin "/h5fc")
827 (string-append fbin "/h5fc"))
828 (for-each (lambda (file)
830 (string-append flib "/" (basename file))))
831 (find-files lib ".*fortran.*"))
832 (for-each (lambda (file)
834 (string-append finc "/" (basename file))))
835 (find-files inc ".*mod"))
836 (for-each (lambda (file)
838 (string-append fex "/" (basename file))))
839 (find-files ex ".*"))
840 (delete-file-recursively ex))
842 (home-page "http://www.hdfgroup.org")
843 (synopsis "Management suite for extremely large and complex data")
844 (description "HDF5 is a suite that makes possible the management of
845 extremely large and complex data collections.")
846 (license (license:x11-style
847 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
849 (define-public hdf-java
857 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
858 version "/src/CMake-hdfjava-" version ".tar.gz"))
860 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
861 (modules '((guix build utils)))
862 (snippet ; Make sure we don't use the bundled sources and binaries.
864 (for-each delete-file
865 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
866 "HDF4.tar.gz" "HDF5.tar.gz"))
867 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
869 (build-system gnu-build-system)
871 `(("jdk" ,icedtea "jdk")
872 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
874 ("hamcrest-core" ,java-hamcrest-core)
875 ("junit" ,java-junit)
876 ("slf4j-simple" ,java-slf4j-simple)))
882 ("slf4j-api" ,java-slf4j-api)))
885 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
886 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
887 (assoc-ref %build-inputs "jdk") "/lib" )
888 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
889 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
892 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
893 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
894 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
895 (string-append "JPEGLIB="
896 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
900 (modify-phases %standard-phases
901 (add-before 'configure 'chdir-to-source
902 (lambda _ (chdir ,(string-append "hdfjava-" version))))
903 (add-before 'configure 'patch-build
904 (lambda* (#:key inputs outputs #:allow-other-keys)
905 (substitute* "configure"
906 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
907 (("/bin/cat") (which "cat")))
908 ;; Set classpath for compilation
909 (substitute* '("hdf/hdf5lib/Makefile.in"
910 "hdf/hdf5lib/exceptions/Makefile.in"
911 "hdf/hdflib/Makefile.in")
912 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
913 (string-append (assoc-ref inputs "slf4j-api")
914 "/share/java/slf4j-api.jar")))
915 ;; Replace outdated config.sub and config.guess:
916 (with-directory-excursion "config"
917 (for-each (lambda (file)
919 (string-append (assoc-ref inputs "automake")
920 "/share/automake-1.15/" file) file))
921 '("config.sub" "config.guess")))
922 (mkdir-p (string-append (assoc-ref outputs "out")))
923 ;; Set classpath for tests
924 (let* ((build-dir (getcwd))
925 (lib (string-append build-dir "/lib"))
926 (jhdf (string-append lib "/jhdf.jar"))
927 (jhdf5 (string-append lib "/jhdf5.jar"))
930 (string-append (assoc-ref inputs i)
931 "/share/java/" i ".jar"))
932 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
934 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
936 (substitute* '("test/hdf5lib/Makefile.in"
937 "test/hdf5lib/junit.sh.in"
938 "examples/runExample.sh.in")
940 (string-append (assoc-ref inputs "coreutils")
943 (string-append (assoc-ref inputs "coreutils")
945 (("CLASSPATH=[^\n]*")
946 (string-append "CLASSPATH=" class-path)))
947 (setenv "CLASSPATH" class-path))
949 (add-before 'check 'build-examples
951 (zero? (apply system* `("javac"
952 ,@(find-files "examples" ".*\\.java")))))))
956 #:parallel-tests? #f ))
957 (home-page "https://support.hdfgroup.org/products/java")
958 (synopsis "Java interface for the HDF4 and HDF5 libraries")
959 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
960 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
963 ;; BSD-style license:
964 (license (license:x11-style
965 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
966 /current/src/unpacked/COPYING"))))
968 (define-public hdf-eos2
975 (uri "ftp://edhs1.gsfc.nasa.gov\
976 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
978 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
979 (patches (search-patches "hdf-eos2-remove-gctp.patch"
980 "hdf-eos2-build-shared.patch"
981 "hdf-eos2-fortrantests.patch"))))
982 (build-system gnu-build-system)
984 `(("gfortran" ,gfortran)))
986 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
991 `( #:configure-flags '("--enable-install-include" "--enable-shared"
992 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
993 #:parallel-tests? #f))
994 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
995 (synopsis "HDF4-based data format for NASA's Earth Observing System")
996 (description "HDF-EOS2 is a software library built on HDF4 which supports
997 the construction of data structures used in NASA's Earth Observing
998 System (Grid, Point and Swath).")
1000 ;; Source files carry a permissive license header.
1001 (license (license:non-copyleft home-page))))
1003 (define-public hdf-eos5
1009 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1010 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1013 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1014 (patches (search-patches "hdf-eos5-build-shared.patch"
1015 "hdf-eos5-remove-gctp.patch"
1016 "hdf-eos5-fix-szip.patch"
1017 "hdf-eos5-fortrantests.patch"))))
1019 `(("gfortran" ,gfortran)))
1020 (build-system gnu-build-system)
1026 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1027 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1028 #:parallel-tests? #f))
1029 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1031 "HDF-EOS5 is a software library built on HDF5 to support the construction
1032 of data structures used in NASA's Earth Observing System (Grid, Point and
1034 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1036 ;; Source files carry a permissive license header.
1037 (license (license:non-copyleft home-page))))
1039 (define-public hdf5-parallel-openmpi
1040 (package (inherit hdf5)
1041 (name "hdf5-parallel-openmpi")
1044 ,@(package-inputs hdf5)))
1046 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1047 ,@(package-arguments hdf5))
1049 `(modify-phases ,phases
1050 (add-before 'check 'patch-tests
1052 ;; OpenMPI's mpirun will exit with non-zero status if it
1053 ;; detects an "abnormal termination", i.e. any process not
1054 ;; calling MPI_Finalize(). Since the test is explicitely
1055 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1056 ;; H5C_flush_cache from being called, mpirun will always
1057 ;; complain, so turn this test off.
1058 (substitute* "testpar/Makefile"
1059 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1060 (string-append front back "\n")))
1061 (substitute* "tools/h5diff/testph5diff.sh"
1062 (("/bin/sh") (which "sh")))
1064 (synopsis "Management suite for data with parallel IO support")))
1066 (define-public h5check
1073 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1074 "h5check/src/h5check-" version ".tar.gz"))
1077 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1078 (build-system gnu-build-system)
1079 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1080 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1081 (synopsis "HDF5 format checker")
1082 (description "@code{h5check} is a validation tool for verifying that an
1083 HDF5 file is encoded according to the HDF File Format Specification.")
1084 (license (license:x11-style "file://COPYING"))))
1092 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1097 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1098 (build-system cmake-build-system)
1099 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1100 (inputs `(("lapack" ,lapack)
1102 ;; FIXME: Even though the fonts are available dvips complains:
1103 ;; "Font cmmi10 not found; characters will be left blank."
1105 `(("texlive" ,texlive-tiny)
1106 ("ghostscript" ,ghostscript)
1107 ("doxygen" ,doxygen)))
1108 (home-page "http://itpp.sourceforge.net")
1109 (synopsis "C++ library of maths, signal processing and communication classes")
1110 (description "IT++ is a C++ library of mathematical, signal processing and
1111 communication classes and functions. Its main use is in simulation of
1112 communication systems and for performing research in the area of
1113 communications. The kernel of the library consists of generic vector and
1114 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1115 similar to MATLAB, GNU Octave or SciPy.")
1116 (license license:gpl3+)))
1118 (define-public netcdf
1125 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1126 "netcdf-" version ".tar.gz"))
1129 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1130 (patches (search-patches "netcdf-date-time.patch"
1131 "netcdf-tst_h_par.patch"))))
1132 (build-system gnu-build-system)
1135 ("doxygen" ,doxygen)
1136 ("graphviz" ,graphviz)))
1138 `(("hdf4" ,hdf4-alt)
1141 ("libjpeg" ,libjpeg)))
1143 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1145 #:phases (modify-phases %standard-phases
1146 (add-before 'configure 'fix-source-date
1148 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1149 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1150 ;; to '1st hour of the current day', and therefore makes the
1151 ;; package not reproducible.
1152 (substitute* "./configure"
1153 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1154 "date --date='@0'"))
1156 (add-after 'configure 'patch-settings
1158 ;; libnetcdf.settings contains the full filename of the compilers
1159 ;; used to build the library. We truncate the hashes of those
1160 ;; filenames to avoid unnecessary references to the corresponding
1162 (substitute* "libnetcdf.settings"
1163 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1164 (string-append prefix (string-take hash 10) "...")))
1167 #:parallel-tests? #f)) ;various race conditions
1168 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1169 (synopsis "Library for scientific data")
1170 (description "NetCDF is an interface for scientific data access and a
1171 software library that provides an implementation of the interface. The netCDF
1172 library defines a machine-independent format for representing scientific data.
1173 Together, the interface, library, and format support the creation, access, and
1174 sharing of scientific data.")
1175 (license (license:x11-style "file://COPYRIGHT"))))
1177 (define-public netcdf-parallel-openmpi
1178 (package (inherit netcdf)
1179 (name "netcdf-parallel-openmpi")
1182 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1183 (package-inputs netcdf))))
1184 ;; TODO: Replace pkg-config references in nc-config with absolute references
1186 (substitute-keyword-arguments (package-arguments netcdf)
1187 ((#:configure-flags flags)
1188 `(cons* "CC=mpicc" "CXX=mpicxx"
1189 "--enable-parallel-tests"
1190 ;; Shared libraries not supported with parallel IO.
1191 "--disable-shared" "--with-pic"
1194 (define-public netcdf-fortran
1196 (name "netcdf-fortran")
1201 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1205 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1206 (build-system gnu-build-system)
1208 `(#:parallel-tests? #f))
1210 `(("netcdf" ,netcdf)))
1212 `(("gfortran" ,gfortran)))
1213 (synopsis "Fortran interface for the netCDF library")
1214 (description (package-description netcdf))
1215 (home-page (package-home-page netcdf))
1216 (license (package-license netcdf))))
1218 (define-public nlopt
1224 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1227 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1228 (build-system gnu-build-system)
1230 `(;; Shared libraries are not built by default. They are required to
1231 ;; build the Guile, Octave, and Python bindings.
1232 #:configure-flags '("--enable-shared")
1235 (modify-phases %standard-phases
1236 (add-before 'configure 'set-libnlopt-file-name
1237 (lambda* (#:key outputs #:allow-other-keys)
1238 ;; Make sure the Scheme module refers to the library by its
1239 ;; absolute file name (we cannot do that from a snippet
1240 ;; because the expansion of @libdir@ contains
1242 (let ((out (assoc-ref outputs "out")))
1243 (substitute* "swig/nlopt.scm.in"
1245 (string-append out "/lib/libnlopt")))
1247 (inputs `(("guile" ,guile-2.0)))
1248 (native-inputs `(("pkg-config" ,pkg-config)))
1249 (home-page "http://ab-initio.mit.edu/wiki/")
1250 (synopsis "Library for nonlinear optimization")
1251 (description "NLopt is a library for nonlinear optimization, providing a
1252 common interface for a number of different free optimization routines available
1253 online as well as original implementations of various other algorithms.")
1254 (license license:lgpl2.1+)))
1256 (define-public ipopt
1263 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1267 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1268 (modules '((guix build utils)))
1270 ;; Make sure we don't use the bundled software.
1272 (delete-file-recursively "ThirdParty")
1274 (build-system gnu-build-system)
1276 '(#:phases (modify-phases %standard-phases
1277 (add-after 'install 'add--L-flags-in-ipopt.pc
1278 (lambda* (#:key inputs outputs #:allow-other-keys)
1279 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1280 ;; move it to "Libs.private" where it belongs, and add a
1281 ;; '-L' flag for LAPACK.
1282 (let ((out (assoc-ref outputs "out"))
1283 (lapack (assoc-ref inputs "lapack")))
1284 (substitute* (string-append out "/lib/pkgconfig/"
1286 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1287 (string-append "Libs: " before " " after "\n"
1288 "Libs.private: " before
1289 "-L" lapack "/lib -llapack -lblas "
1293 `(("gfortran" ,gfortran)))
1295 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1296 `(("lapack" ,lapack))) ;for both libblas and liblapack
1297 (home-page "http://www.coin-or.org")
1298 (synopsis "Large-scale nonlinear optimizer")
1300 "The Interior Point Optimizer (IPOPT) is a software package for
1301 large-scale nonlinear optimization. It provides C++, C, and Fortran
1303 (license license:epl1.0)))
1305 (define-public ceres
1307 (name "ceres-solver")
1309 (home-page "http://ceres-solver.org/")
1312 (uri (string-append home-page "ceres-solver-"
1316 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1317 (build-system cmake-build-system)
1319 ;; TODO: Build HTML user documentation and install separately.
1320 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1321 "-DBUILD_SHARED_LIBS=ON")
1323 #:phases (modify-phases %standard-phases
1324 (add-before 'configure 'set-library-directory
1326 ;; Install libraries to lib/, not lib64/.
1327 (substitute* "internal/ceres/CMakeLists.txt"
1328 (("set\\(LIB_SUFFIX \"64\"\\)")
1329 "set(LIB_SUFFIX \"\")"))
1332 `(("pkg-config" ,pkg-config)))
1334 `(("glog" ,glog))) ;for #include <glog/glog.h>
1339 ("suitesparse" ,suitesparse)
1340 ("gflags" ,gflags)))
1341 (synopsis "C++ library for solving large optimization problems")
1343 "Ceres Solver is a C++ library for modeling and solving large,
1344 complicated optimization problems. It is a feature rich, mature and
1345 performant library which has been used in production since 2010. Ceres Solver
1346 can solve two kinds of problems:
1348 @item non-linear least squares problems with bounds constraints;
1349 @item general unconstrained optimization problems.
1351 (license license:bsd-3)))
1353 ;; For a fully featured Octave, users are strongly recommended also to install
1354 ;; the following packages: less, ghostscript, gnuplot.
1355 (define-public octave
1362 (uri (string-append "mirror://gnu/octave/octave-"
1366 "0nm766737gbkq9wqry54a026k3dg7rb1065kngfpwgjz8b544xbp"))))
1367 (build-system gnu-build-system)
1369 `(("lapack" ,lapack)
1371 ("readline" ,readline)
1376 ("arpack" ,arpack-ng)
1379 ("fontconfig" ,fontconfig)
1380 ("freetype" ,freetype)
1387 ("texinfo" ,texinfo)
1388 ("graphicsmagick" ,graphicsmagick)
1389 ("suitesparse" ,suitesparse)
1390 ("libsndfile" ,libsndfile)
1391 ("portaudio" ,portaudio)
1392 ("alsa-lib" ,alsa-lib)))
1395 ("gfortran" ,gfortran)
1396 ("pkg-config" ,pkg-config)
1398 ;; The following inputs are not actually used in the build process.
1399 ;; However, the ./configure gratuitously tests for their existence and
1400 ;; assumes that programs not present at build time are also not, and
1401 ;; can never be, available at run time! If these inputs are therefore
1402 ;; not present, support for them will be built out. However, Octave
1403 ;; will still run without them, albeit without the features they
1406 ("ghostscript" ,ghostscript)
1407 ("gnuplot" ,gnuplot)))
1410 (list (string-append "--with-shell="
1411 (assoc-ref %build-inputs "bash")
1414 (modify-phases %standard-phases
1415 (add-after 'configure 'configure-makeinfo
1416 (lambda* (#:key inputs #:allow-other-keys)
1417 (substitute* "libinterp/corefcn/help.cc"
1418 (("Vmakeinfo_program = \"makeinfo\"")
1419 (string-append "Vmakeinfo_program = \""
1420 (assoc-ref inputs "texinfo")
1421 "/bin/makeinfo\"")))
1423 (home-page "https://www.gnu.org/software/octave/")
1424 (synopsis "High-level language for numerical computation")
1425 (description "GNU Octave is a high-level interpreted language that is
1426 specialized for numerical computations. It can be used for both linear and
1427 non-linear applications and it provides great support for visualizing results.
1428 Work may be performed both at the interactive command-line as well as via
1430 (license license:gpl3+)))
1432 (define-public qtoctave
1433 (package (inherit octave)
1436 (inherit (package-source octave))
1437 (patches (append (origin-patches (package-source octave))
1439 "qtoctave-qt-5.11-fix.patch")))))
1441 `(("qscintilla" ,qscintilla)
1443 ,@(package-inputs octave)))
1445 `(("qttools" , qttools) ;for lrelease
1446 ("texlive" ,texlive) ;for texi2dvi
1447 ,@(package-native-inputs octave)))
1449 (substitute-keyword-arguments (package-arguments octave)
1451 `(modify-phases ,phases
1452 (add-before 'configure 'patch-qscintilla-library-name
1453 (lambda* (#:key inputs #:allow-other-keys)
1454 ;; The QScintilla library that the Octave configure script tries
1455 ;; to link with should be named libqscintilla-qt5.so, but the
1456 ;; QScintilla input provides the shared library as
1457 ;; libqscintilla2_qt5.so.
1458 (substitute* "configure"
1459 (("qscintilla2-qt5")
1463 (define-public opencascade-oce
1465 (name "opencascade-oce")
1471 "https://github.com/tpaviot/oce/archive/OCE-"
1474 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1477 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1478 (build-system cmake-build-system)
1481 (list "-DOCE_TESTING:BOOL=ON"
1482 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1483 "-DOCE_DRAW:BOOL=ON"
1484 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1485 (assoc-ref %outputs "out"))
1486 "-UCMAKE_INSTALL_RPATH")))
1488 `(("freetype" ,freetype)
1495 `(("python" ,python-wrapper)))
1496 (home-page "https://github.com/tpaviot/oce")
1497 (synopsis "Libraries for 3D modeling and numerical simulation")
1499 "Open CASCADE is a set of libraries for the development of applications
1500 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1501 C++ class libraries providing services for 3D surface and solid modeling, CAD
1502 data exchange, and visualization. It is used for development of specialized
1503 software dealing with 3D models in design (CAD), manufacturing (CAM),
1504 numerical simulation (CAE), measurement equipment (CMM), and quality
1505 control (CAQ) domains.
1507 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1508 patches, improvements, and experiments contributed by users over the official
1509 Open CASCADE library.")
1510 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1511 ; use of header files; see
1512 ; OCCT_LGPL_EXCEPTION.txt
1513 license:public-domain; files
1514 ; src/Standard/Standard_StdAllocator.hxx and
1515 ; src/NCollection/NCollection_StdAllocator.hxx
1516 license:expat; file src/OpenGl/OpenGl_glext.h
1517 license:bsd-3)))); test framework gtest
1526 (uri (string-append "http://gmsh.info/src/gmsh-"
1527 version "-source.tgz"))
1529 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1530 (modules '((guix build utils)))
1532 ;; Remove non-free METIS code
1534 (delete-file-recursively "contrib/Metis")
1536 (build-system cmake-build-system)
1539 ("gfortran" ,gfortran)
1545 ("opencascade-oce" ,opencascade-oce)
1547 ("libxext" ,libxext)))
1549 `(("fontconfig" ,fontconfig)
1550 ("libxft" ,libxft)))
1552 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1553 "-DENABLE_BUILD_SHARED:BOOL=ON"
1554 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1555 (home-page "http://www.geuz.org/gmsh/")
1556 (synopsis "3D finite element grid generator")
1557 (description "Gmsh is a 3D finite element grid generator with a built-in
1558 CAD engine and post-processor. Its design goal is to provide a fast, light
1559 and user-friendly meshing tool with parametric input and advanced
1560 visualization capabilities. Gmsh is built around four modules: geometry,
1561 mesh, solver and post-processing. The specification of any input to these
1562 modules is done either interactively using the graphical user interface or in
1563 ASCII text files using Gmsh's own scripting language.")
1564 (license license:gpl2+)))
1566 (define-public maxflow
1573 (url "https://github.com/gerddie/maxflow.git")
1574 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1575 (file-name (string-append name "-" version "-checkout"))
1578 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1579 (build-system cmake-build-system)
1580 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1581 (synopsis "Library implementing Maxflow algorithm")
1582 (description "An implementation of the maxflow algorithm described in
1583 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1584 Energy Minimization in Computer Vision.\n
1585 Yuri Boykov and Vladimir Kolmogorov.\n
1586 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1588 (license license:gpl3+)))
1590 (define-public petsc
1597 ;; The *-lite-* tarball does not contain the *large* documentation
1598 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1599 "petsc-lite-" version ".tar.gz"))
1601 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1602 (build-system gnu-build-system)
1604 `(("python" ,python-2)))
1606 `(("gfortran" ,gfortran)
1608 ("superlu" ,superlu)
1609 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1610 ;; leaving out opengl, as configuration seems to only be for mac
1613 `(#:test-target "test"
1614 #:parallel-build? #f ;build is parallel by default
1619 ,(string-append "--with-superlu-include="
1620 (assoc-ref %build-inputs "superlu") "/include")
1621 ,(string-append "--with-superlu-lib="
1622 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1624 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1625 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1626 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1628 (modify-phases %standard-phases
1630 ;; PETSc's configure script is actually a python script, so we can't
1631 ;; run it with bash.
1632 (lambda* (#:key outputs (configure-flags '())
1634 (let* ((prefix (assoc-ref outputs "out"))
1635 (flags `(,(string-append "--prefix=" prefix)
1636 ,@configure-flags)))
1637 (format #t "build directory: ~s~%" (getcwd))
1638 (format #t "configure flags: ~s~%" flags)
1639 (apply invoke "./configure" flags))))
1640 (add-after 'configure 'clean-local-references
1641 (lambda* (#:key outputs #:allow-other-keys)
1642 (let ((out (assoc-ref outputs "out")))
1643 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1644 ;; Prevent build directory from leaking into compiled code
1646 ;; Scrub timestamp for reproducibility
1647 ((".*Libraries compiled on.*") ""))
1648 (substitute* (find-files "." "petscvariables")
1649 ;; Do not expose build machine characteristics, set to defaults.
1650 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1651 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1653 (add-after 'install 'clean-install
1654 ;; Try to keep installed files from leaking build directory names.
1655 (lambda* (#:key inputs outputs #:allow-other-keys)
1656 (let ((out (assoc-ref outputs "out")))
1657 (substitute* (map (lambda (file)
1658 (string-append out "/lib/petsc/conf/" file))
1659 '("petscvariables"))
1661 ;; Make compiler references point to the store
1662 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1663 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1664 (string-append "= " (which compiler))))
1665 ;; PETSc installs some build logs, which aren't necessary.
1666 (for-each (lambda (file)
1667 (let ((f (string-append out "/lib/petsc/conf/" file)))
1668 (when (file-exists? f)
1670 '("configure.log" "make.log" "gmake.log"
1671 "test.log" "error.log" "RDict.db"
1672 "PETScBuildInternal.cmake"
1673 ;; Once installed, should uninstall with Guix
1676 (home-page "http://www.mcs.anl.gov/petsc")
1677 (synopsis "Library to solve PDEs")
1678 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1679 data structures and routines for the scalable (parallel) solution of
1680 scientific applications modeled by partial differential equations.")
1681 (license (license:non-copyleft
1682 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1684 (define-public petsc-complex
1685 (package (inherit petsc)
1686 (name "petsc-complex")
1688 (substitute-keyword-arguments (package-arguments petsc)
1689 ((#:configure-flags cf)
1690 `(cons "--with-scalar-type=complex" ,cf))))
1691 (synopsis "Library to solve PDEs (with complex scalars)")))
1693 (define-public petsc-openmpi
1694 (package (inherit petsc)
1695 (name "petsc-openmpi")
1697 `(("openmpi" ,openmpi)
1698 ,@(package-inputs petsc)))
1700 (substitute-keyword-arguments (package-arguments petsc)
1701 ((#:configure-flags cf)
1702 ``("--with-mpiexec=mpirun"
1703 ,(string-append "--with-mpi-dir="
1704 (assoc-ref %build-inputs "openmpi"))
1705 ,@(delete "--with-mpi=0" ,cf)))))
1706 (synopsis "Library to solve PDEs (with MPI support)")))
1708 (define-public petsc-complex-openmpi
1709 (package (inherit petsc-complex)
1710 (name "petsc-complex-openmpi")
1712 `(("openmpi" ,openmpi)
1713 ,@(package-inputs petsc-complex)))
1715 (substitute-keyword-arguments (package-arguments petsc-complex)
1716 ((#:configure-flags cf)
1717 ``("--with-mpiexec=mpirun"
1718 ,(string-append "--with-mpi-dir="
1719 (assoc-ref %build-inputs "openmpi"))
1720 ,@(delete "--with-mpi=0" ,cf)))))
1721 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1724 (define-public python-kiwisolver
1726 (name "python-kiwisolver")
1730 (uri (pypi-uri "kiwisolver" version))
1733 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1734 (build-system python-build-system)
1735 (home-page "https://github.com/nucleic/kiwi")
1736 (synopsis "Fast implementation of the Cassowary constraint solver")
1738 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1739 solving algorithm. Kiwi has been designed from the ground up to be
1740 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1741 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1742 savings are consistently > 5x.")
1743 (license license:bsd-3)))
1745 (define-public python2-kiwisolver
1746 (package-with-python2 python-kiwisolver))
1748 (define-public slepc
1755 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1759 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1760 (build-system gnu-build-system)
1762 `(("python" ,python-2)))
1764 `(("arpack" ,arpack-ng)
1765 ("gfortran" ,gfortran)))
1767 `(("petsc" ,petsc)))
1769 `(#:parallel-build? #f ;build is parallel by default
1771 `(,(string-append "--with-arpack-dir="
1772 (assoc-ref %build-inputs "arpack") "/lib"))
1773 #:make-flags ;honor (parallel-job-count)
1774 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1776 (modify-phases %standard-phases
1778 ;; configure is a python script, so we can't run it with bash.
1779 (lambda* (#:key inputs outputs (configure-flags '())
1781 (let* ((prefix (assoc-ref outputs "out"))
1782 (flags `(,(string-append "--prefix=" prefix)
1783 ,@configure-flags)))
1784 (format #t "build directory: ~s~%" (getcwd))
1785 (format #t "configure flags: ~s~%" flags)
1786 (setenv "SLEPC_DIR" (getcwd))
1787 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1788 (apply invoke "./configure" flags))))
1789 (add-after 'install 'delete-doc
1790 ;; TODO: SLEPc installs HTML documentation alongside headers in
1791 ;; $out/include. We'd like to move them to share/doc, but delete
1792 ;; them for now, as they are incomplete and installing the complete
1793 ;; documentation is difficult.
1794 (lambda* (#:key outputs #:allow-other-keys)
1795 (let* ((out (assoc-ref outputs "out")))
1796 (for-each delete-file (find-files out "\\.html$"))
1798 (add-after 'install 'clean-install
1799 ;; Clean up unnecessary build logs from installation.
1800 (lambda* (#:key outputs #:allow-other-keys)
1801 (let ((out (assoc-ref outputs "out")))
1802 (for-each (lambda (file)
1803 (let ((f (string-append out "/lib/slepc/conf/" file)))
1804 (when (file-exists? f)
1806 '("configure.log" "make.log" "gmake.log"
1807 "test.log" "error.log" "RDict.db"
1810 (home-page "http://slepc.upv.es")
1811 (synopsis "Scalable library for eigenproblems")
1812 (description "SLEPc is a software library for the solution of large sparse
1813 eigenproblems on parallel computers. It can be used for the solution of
1814 linear eigenvalue problems formulated in either standard or generalized form,
1815 as well as other related problems such as the singular value decomposition.
1816 The emphasis of the software is on methods and techniques appropriate for
1817 problems in which the associated matrices are sparse, for example, those
1818 arising after the discretization of partial differential equations.")
1819 (license license:bsd-2)))
1821 (define-public slepc-complex
1822 (package (inherit slepc)
1823 (name "slepc-complex")
1825 `(("petsc" ,petsc-complex)
1826 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1827 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1829 (define-public slepc-openmpi
1830 (package (inherit slepc)
1831 (name "slepc-openmpi")
1833 (substitute-keyword-arguments (package-arguments slepc)
1834 ((#:phases phases '%standard-phases)
1835 `(modify-phases ,phases
1836 (add-before 'check 'set-test-environment
1838 ;; By default, running the test suite would fail because 'ssh'
1839 ;; could not be found in $PATH. Define this variable to
1840 ;; placate Open MPI without adding a dependency on OpenSSH (the
1841 ;; agent isn't used anyway.)
1842 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
1846 ("arpack" ,arpack-ng-openmpi)
1847 ,@(alist-delete "arpack" (package-inputs slepc))))
1849 `(("petsc" ,petsc-openmpi)
1850 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1851 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1853 (define-public slepc-complex-openmpi
1854 (package (inherit slepc-openmpi)
1855 (name "slepc-complex-openmpi")
1857 `(("petsc" ,petsc-complex-openmpi)
1858 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1859 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1861 (define-public mumps
1868 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1872 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
1873 (patches (search-patches "mumps-build-parallelism.patch"))))
1874 (build-system gnu-build-system)
1876 `(("fortran" ,gfortran)
1877 ;; These are required for linking against mumps, but we let the user
1878 ;; declare the dependency.
1881 ("scotch" ,scotch)))
1883 `(#:modules ((ice-9 match)
1886 ,@%gnu-build-system-modules)
1888 (modify-phases %standard-phases
1890 (lambda* (#:key inputs #:allow-other-keys)
1891 (call-with-output-file "Makefile.inc"
1902 INCSEQ = -I$(topdir)/libseq
1903 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1904 LIBSEQNEEDED = libseqneeded~;
1908 AR = ar vr # rules require trailing space, ugh...
1910 LIBBLAS = -L~a -lopenblas~@[
1911 SCALAP = -L~a -lscalapack~]
1912 LIBOTHERS = -pthread
1915 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1919 LIBS = $(SCALAP) $(LIBSEQ)
1920 LPORDDIR = $(topdir)/PORD/lib
1921 IPORD = -I$(topdir)/PORD/include
1922 LPORD = -L$(LPORDDIR) -lpord
1923 ORDERINGSF = -Dpord~@[
1925 IMETIS = -I$(METISDIR)/include
1926 LMETIS = -L$(METISDIR)/lib -lmetis
1927 ORDERINGSF += -Dmetis~]~@[~:{
1929 ISCOTCH = -I$(SCOTCHDIR)/include
1930 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1931 ORDERINGSF += ~a~}~]
1932 ORDERINGSC = $(ORDERINGSF)
1933 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1934 IORDERINGSF = $(ISCOTCH)
1935 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1936 (assoc-ref inputs "mpi")
1937 (assoc-ref inputs "blas")
1938 (assoc-ref inputs "scalapack")
1939 (assoc-ref inputs "metis")
1940 (match (list (assoc-ref inputs "pt-scotch")
1941 (assoc-ref inputs "scotch"))
1945 `((,scotch "" "-Dscotch")))
1948 "-lptesmumps -lptscotch -lptscotcherr "
1949 "-Dptscotch")))))))))
1951 ;; By default only the d-precision library is built. Make with "all"
1952 ;; target so that all precision libraries and examples are built.
1954 (invoke "make" "all"
1955 (format #f "-j~a" (parallel-job-count)))))
1957 ;; Run the simple test drivers, which read test input from stdin:
1958 ;; from the "real" input for the single- and double-precision
1959 ;; testers, and from the "cmplx" input for complex-precision
1960 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1961 ;; package to prefix execution with "mpirun".
1962 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1963 (with-directory-excursion "examples"
1966 (let ((tester (apply open-pipe*
1969 ,(string-append "./" prec
1971 (input (open-input-file
1972 (string-append "input_simpletest_" type))))
1974 (dump-port input tester)
1976 (zero? (close-pipe tester)))))
1978 '("real" "real" "cmplx" "cmplx")))))
1980 (lambda* (#:key outputs #:allow-other-keys)
1981 (let* ((out (assoc-ref outputs "out"))
1982 (libdir (string-append out "/lib")))
1983 (copy-recursively "lib" libdir)
1984 (copy-recursively "include" (string-append out "/include"))
1985 (when (file-exists? "libseq/libmpiseq.a")
1986 (install-file "libseq/libmpiseq.a" libdir))
1988 (home-page "http://mumps.enseeiht.fr")
1989 (synopsis "Multifrontal sparse direct solver")
1991 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1992 sparse system of linear equations A x = b using Guassian elimination.")
1993 (license license:cecill-c)))
1995 (define-public mumps-metis
1996 (package (inherit mumps)
1997 (name "mumps-metis")
1999 (alist-delete "scotch" (package-inputs mumps)))))
2001 (define-public mumps-openmpi
2002 (package (inherit mumps)
2003 (name "mumps-openmpi")
2006 ("scalapack" ,scalapack)
2007 ("pt-scotch" ,pt-scotch)
2008 ,@(alist-delete "scotch" (package-inputs mumps))))
2010 (substitute-keyword-arguments (package-arguments mumps)
2012 `(modify-phases ,phases
2013 (add-before 'check 'set-test-environment
2015 ;; By default, running the test suite would fail because 'ssh'
2016 ;; could not be found in $PATH. Define this variable to
2017 ;; placate Open MPI without adding a dependency on OpenSSH (the
2018 ;; agent isn't used anyway.)
2019 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2023 ((assoc-ref ,phases 'check)
2024 #:exec-prefix '("mpirun" "-n" "2"))))))))
2025 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2027 (define-public mumps-metis-openmpi
2028 (package (inherit mumps-openmpi)
2029 (name "mumps-metis-openmpi")
2031 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2033 (define-public r-quadprog
2040 (uri (cran-uri "quadprog" version))
2043 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2044 (build-system r-build-system)
2046 `(("gfortran" ,gfortran)))
2047 (home-page "https://cran.r-project.org/web/packages/quadprog")
2048 (synopsis "Functions to solve quadratic programming problems")
2050 "This package contains routines and documentation for solving quadratic
2051 programming problems.")
2052 (license license:gpl3+)))
2054 (define-public r-pracma
2060 (uri (cran-uri "pracma" version))
2062 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
2063 (build-system r-build-system)
2065 `(("r-quadprog" ,r-quadprog)))
2066 (home-page "https://cran.r-project.org/web/packages/pracma")
2067 (synopsis "Practical numerical math functions")
2068 (description "This package provides functions for numerical analysis and
2069 linear algebra, numerical optimization, differential equations, plus some
2070 special functions. It uses Matlab function names where appropriate to simplify
2072 (license license:gpl3+)))
2074 (define-public ruby-asciimath
2076 (name "ruby-asciimath")
2081 (uri (rubygems-uri "asciimath" version))
2084 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2085 (build-system ruby-build-system)
2088 (modify-phases %standard-phases
2090 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2091 (add-after 'unpack 'patch-remove-spurious-backslashes
2093 (substitute* "spec/parser_spec.rb"
2097 `(("bundler" ,bundler)
2098 ("ruby-rspec" ,ruby-rspec)))
2099 (synopsis "AsciiMath parsing and conversion library")
2101 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2102 easy-to-write markup language for mathematics.")
2103 (home-page "https://github.com/asciidoctor/asciimath")
2104 (license license:expat)))
2106 (define-public superlu
2113 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2114 "superlu_" version ".tar.gz"))
2116 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2117 (modules '((guix build utils)))
2119 ;; Replace the non-free implementation of MC64 with a stub adapted
2122 (use-modules (ice-9 regex)
2124 (call-with-output-file "SRC/mc64ad.c"
2129 void mc64id_(int *a) {
2130 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2133 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2134 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2135 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2138 ;; Remove the corresponding license verbiage. MC64 license follows
2139 ;; a "------" line separator.
2140 (with-atomic-file-replacement "License.txt"
2141 (let ((rx (make-regexp "-{8}")))
2144 (let ((line (read-line in 'concat)))
2145 (unless (regexp-exec rx line)
2149 (build-system cmake-build-system)
2153 `(("blas" ,openblas)
2154 ("gfortran" ,gfortran)))
2156 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2157 "-DTPL_BLAS_LIBRARIES=openblas"
2158 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2159 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2160 (synopsis "Supernodal direct solver for sparse linear systems")
2162 "SuperLU is a general purpose library for the direct solution of large,
2163 sparse, nonsymmetric systems of linear equations on high performance machines.
2164 The library is written in C and is callable from either C or Fortran. The
2165 library routines perform an LU decomposition with partial pivoting and
2166 triangular system solves through forward and back substitution. The library
2167 also provides threshold-based ILU factorization preconditioners.")
2168 (license (list license:bsd-3
2169 license:gpl2+ ;EXAMPLE/*fgmr.c
2170 (license:fsf-free "file://SRC/colamd.h")))))
2172 (define-public superlu-dist
2174 (name "superlu-dist")
2179 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2180 "superlu_dist_" version ".tar.gz"))
2182 (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
2183 (modules '((guix build utils)))
2185 ;; Replace the non-free implementation of MC64 with a stub
2187 (use-modules (ice-9 regex)
2189 (call-with-output-file "SRC/mc64ad_dist.c"
2194 void mc64id_dist(int *a) {
2195 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2198 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2199 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2200 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2203 (substitute* "SRC/util.c" ;adjust default algorithm
2204 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2205 "RowPerm = NOROWPERM"))
2207 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2208 (build-system gnu-build-system)
2212 `(("gfortran" ,gfortran)))
2214 `(("openmpi" ,openmpi) ;headers include MPI heades
2215 ("lapack" ,lapack) ;required to link with output library
2216 ("pt-scotch" ,pt-scotch))) ;same
2218 `(#:parallel-build? #f ;race conditions using ar
2220 (modify-phases %standard-phases
2222 (lambda* (#:key inputs outputs #:allow-other-keys)
2223 (call-with-output-file "make.inc"
2228 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2229 BLASDEF = -DUSE_VENDOR_BLAS
2230 BLASLIB = -L~a/lib -lblas
2231 PARMETISLIB = -L~a/lib \
2232 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2233 -lscotch -lscotcherr -lscotcherrexit
2234 METISLIB = -L~:*~a/lib \
2235 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2236 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2242 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2243 NOOPTS = -O0 -g $(PIC)
2245 FFLAGS = -O2 -g $(PIC)
2249 (assoc-ref outputs "out")
2250 (assoc-ref inputs "lapack")
2251 (assoc-ref inputs "pt-scotch"))))
2253 (add-after 'unpack 'remove-broken-symlinks
2255 (for-each delete-file
2256 (find-files "MAKE_INC" "\\.#make\\..*"))
2258 (add-before 'build 'create-install-directories
2259 (lambda* (#:key outputs #:allow-other-keys)
2262 (mkdir-p (string-append (assoc-ref outputs "out")
2268 ;; By default, running the test suite would fail because 'ssh'
2269 ;; could not be found in $PATH. Define this variable to placate
2270 ;; Open MPI without adding a dependency on OpenSSH (the agent
2271 ;; isn't used anyway.)
2272 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2273 (with-directory-excursion "EXAMPLE"
2274 (invoke "mpirun" "-n" "2"
2275 "./pddrive" "-r" "1" "-c" "2" "g20.rua")
2276 (invoke "mpirun" "-n" "2"
2277 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
2280 (lambda* (#:key outputs #:allow-other-keys)
2281 ;; Library is placed in lib during the build phase. Copy over
2282 ;; headers to include.
2283 (let* ((out (assoc-ref outputs "out"))
2284 (incdir (string-append out "/include")))
2285 (for-each (lambda (file)
2286 (let ((base (basename file)))
2287 (format #t "installing `~a' to `~a'~%"
2290 (string-append incdir "/" base))))
2291 (find-files "SRC" ".*\\.h$")))
2293 (home-page (package-home-page superlu))
2294 (synopsis "Parallel supernodal direct solver")
2296 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2297 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2298 implemented in ANSI C, and MPI for communications.")
2299 (license license:bsd-3)))
2301 (define-public scotch
2308 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2309 "latestfile/298/scotch_" version ".tar.gz"))
2311 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
2312 (patches (search-patches "scotch-test-threading.patch"
2313 "scotch-build-parallelism.patch"
2314 "scotch-graph-induce-type-64.patch"
2315 "scotch-graph-diam-64.patch"))))
2316 (build-system gnu-build-system)
2323 (modify-phases %standard-phases
2325 'unpack 'chdir-to-src
2326 (lambda _ (chdir "src") #t))
2330 (call-with-output-file "Makefile.inc"
2344 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2345 LDFLAGS = -lz -lm -lrt -lpthread
2347 LEX = flex -Pscotchyy -olex.yy.c
2352 YACC = bison -pscotchyy -y -b y
2354 '("COMMON_FILE_COMPRESS_GZ"
2356 "COMMON_RANDOM_FIXED_SEED"
2357 "INTSIZE64" ;use 'long' instead of 'int'
2358 ;; Prevents symbolc clashes with libesmumps
2360 ;; XXX: Causes invalid frees in superlu-dist tests
2362 ;; "SCOTCH_PTHREAD_NUMBER=2"
2363 "restrict=__restrict"))))
2366 'build 'build-esmumps
2368 ;; By default, running the test suite would fail because 'ssh'
2369 ;; could not be found in $PATH. Define this variable to placate
2370 ;; Open MPI without adding a dependency on OpenSSH (the agent
2371 ;; isn't used anyway.)
2372 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2375 (format #f "-j~a" (parallel-job-count))
2379 (lambda* (#:key outputs #:allow-other-keys)
2380 (let ((out (assoc-ref outputs "out")))
2383 (string-append "prefix=" out)
2385 ;; esmumps files are not installed with the above
2386 (for-each (lambda (f)
2387 (copy-file f (string-append out "/include/" f)))
2388 (find-files "../include" ".*esmumps.h$"))
2389 (for-each (lambda (f)
2390 (copy-file f (string-append out "/lib/" f)))
2391 (find-files "../lib" "^lib.*esmumps.*"))
2393 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2394 (synopsis "Programs and libraries for graph algorithms")
2395 (description "SCOTCH is a set of programs and libraries which implement
2396 the static mapping and sparse matrix reordering algorithms developed within
2397 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2398 conquer approach, to scientific computing problems such as graph and mesh
2399 partitioning, static mapping, and sparse matrix ordering, in application
2400 domains ranging from structural mechanics to operating systems or
2402 ;; See LICENSE_en.txt
2403 (license license:cecill-c)))
2405 (define-public scotch32
2406 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2407 ;; some applications.
2408 (package (inherit scotch)
2411 (substitute-keyword-arguments (package-arguments scotch)
2412 ((#:phases scotch-phases)
2413 `(modify-phases ,scotch-phases
2417 (call-with-output-file "Makefile.inc"
2431 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2432 LDFLAGS = -lz -lm -lrt -lpthread
2434 LEX = flex -Pscotchyy -olex.yy.c
2439 YACC = bison -pscotchyy -y -b y
2441 '("COMMON_FILE_COMPRESS_GZ"
2443 "COMMON_RANDOM_FIXED_SEED"
2444 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2445 ;; Prevents symbolc clashes with libesmumps
2447 ;; XXX: Causes invalid frees in superlu-dist tests
2449 ;; "SCOTCH_PTHREAD_NUMBER=2"
2450 "restrict=__restrict"))))))))))
2452 "Programs and libraries for graph algorithms (32-bit integers)")))
2454 (define-public pt-scotch
2455 (package (inherit scotch)
2458 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2460 (substitute-keyword-arguments (package-arguments scotch)
2461 ((#:phases scotch-phases)
2462 `(modify-phases ,scotch-phases
2467 (zero? (system* "make"
2468 (format #f "-j~a" (parallel-job-count))
2469 "ptscotch" "ptesmumps"))
2470 ;; Install the serial metis compatibility library
2471 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2474 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2475 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2477 (define-public pt-scotch32
2478 (package (inherit scotch32)
2479 (name "pt-scotch32")
2481 `(("openmpi" ,openmpi))) ;headers include MPI headers
2483 (substitute-keyword-arguments (package-arguments scotch32)
2484 ((#:phases scotch32-phases)
2485 `(modify-phases ,scotch32-phases
2489 (zero? (system* "make"
2490 (format #f "-j~a" (parallel-job-count))
2491 "ptscotch" "ptesmumps"))
2492 ;; Install the serial metis compatibility library
2493 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2496 (zero? (system* "make" "ptcheck"))))))))
2498 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2500 (define-public metis
2507 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2508 "metis-" version ".tar.gz"))
2511 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2512 (build-system cmake-build-system)
2514 `(("blas" ,openblas)))
2516 `(#:tests? #f ;no tests
2517 #:configure-flags `("-DSHARED=ON"
2518 ,(string-append "-DGKLIB_PATH=" (getcwd)
2519 "/metis-" ,version "/GKlib"))))
2520 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2521 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2523 "METIS is a set of serial programs for partitioning graphs, partitioning
2524 finite element meshes, and producing fill-reducing orderings for sparse
2525 matrices. The algorithms implemented in METIS are based on the multilevel
2526 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2528 (license license:asl2.0))) ;As of version 5.0.3
2530 (define-public p4est
2537 (uri (string-append "http://p4est.github.io/release/p4est-"
2541 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2542 (build-system gnu-build-system)
2544 `(("fortran" ,gfortran)
2549 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2550 (assoc-ref %build-inputs "blas")
2552 ,(string-append "LAPACK_LIBS=-L"
2553 (assoc-ref %build-inputs "lapack")
2555 #:phases (modify-phases %standard-phases
2556 (add-before 'check 'set-test-environment
2558 ;; By default, running the test suite would fail because
2559 ;; 'ssh' could not be found in $PATH. Define this
2560 ;; variable to placate Open MPI without adding a
2561 ;; dependency on OpenSSH (the agent isn't used anyway.)
2562 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2564 (home-page "http://www.p4est.org")
2565 (synopsis "Adaptive mesh refinement on forests of octrees")
2567 "The p4est software library enables the dynamic management of a
2568 collection of adaptive octrees, conveniently called a forest of octrees.
2569 p4est is designed to work in parallel and scales to hundreds of thousands of
2571 (license license:gpl2+)))
2573 (define-public p4est-openmpi
2574 (package (inherit p4est)
2575 (name "p4est-openmpi")
2578 ,@(package-inputs p4est)))
2580 (substitute-keyword-arguments (package-arguments p4est)
2581 ((#:configure-flags cf)
2582 ``("--enable-mpi" ,@,cf))))
2583 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2585 (define-public gsegrafix
2592 (uri (string-append "mirror://gnu/" name "/" name "-"
2596 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2597 (build-system gnu-build-system)
2599 `(#:configure-flags '("LDFLAGS=-lm")))
2601 `(("libgnomecanvas" ,libgnomecanvas)
2602 ("libbonoboui" ,libbonoboui)
2603 ("libgnomeui" ,libgnomeui)
2604 ("libgnomeprintui" ,libgnomeprintui)
2607 `(("pkg-config" ,pkg-config)))
2608 (home-page "https://www.gnu.org/software/gsegrafix/")
2609 (synopsis "GNOME application to create scientific and engineering plots")
2610 (description "GSEGrafix is an application which produces high-quality graphical
2611 plots for science and engineering. Plots are specified via simple ASCII
2612 parameter files and data files and are presented in an anti-aliased GNOME
2613 canvas. The program supports rectangular two-dimensional plots, histograms,
2614 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2615 to BMP, JPEG or PNG image formats.")
2616 (license license:gpl3+)))
2618 (define-public maxima
2625 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2626 version "-source/" name "-" version ".tar.gz"))
2629 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2630 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2631 (build-system gnu-build-system)
2634 ("gnuplot" ,gnuplot) ;for plots
2635 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2637 `(("texinfo" ,texinfo)
2639 ("python" ,python)))
2642 (list "--enable-gcl"
2643 (string-append "--with-posix-shell="
2644 (assoc-ref %build-inputs "bash")
2646 (string-append "--with-wish="
2647 (assoc-ref %build-inputs "tk")
2649 (let ((v ,(package-version tk)))
2650 (string-take v (string-index-right v #\.)))))
2651 ;; By default Maxima attempts to write temporary files to
2652 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2653 ;; Work around that.
2654 #:make-flags (list "TMPDIR=/tmp")
2656 (modify-phases %standard-phases
2657 (add-before 'check 'pre-check
2659 (chmod "src/maxima" #o555)
2661 ;; Make sure the doc and emacs files are found in the
2662 ;; standard location. Also configure maxima to find gnuplot
2663 ;; without having it on the PATH.
2664 (add-after 'install 'post-install
2665 (lambda* (#:key outputs inputs #:allow-other-keys)
2666 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2667 (out (assoc-ref outputs "out"))
2668 (datadir (string-append out "/share/maxima/" ,version))
2669 (binutils (string-append (assoc-ref inputs "binutils")
2671 (with-directory-excursion out
2672 (mkdir-p "share/emacs")
2673 (mkdir-p "share/doc")
2675 (string-append datadir "/emacs/")
2676 (string-append out "/share/emacs/site-lisp"))
2678 (string-append datadir "/doc/")
2679 (string-append out "/share/doc/maxima"))
2680 (with-atomic-file-replacement
2681 (string-append datadir "/share/maxima-init.lisp")
2683 (format out "~a ~s~a~%"
2684 "(setf $gnuplot_command "
2685 (string-append gnuplot "/bin/gnuplot") ")")
2686 (dump-port in out))))
2687 ;; Ensure that Maxima will have access to the GNU binutils
2688 ;; components at runtime.
2689 (wrap-program (string-append out "/bin/maxima")
2690 `("PATH" prefix (,binutils))))
2692 (home-page "http://maxima.sourceforge.net")
2693 (synopsis "Numeric and symbolic expression manipulation")
2694 (description "Maxima is a system for the manipulation of symbolic and
2695 numerical expressions. It yields high precision numeric results by using
2696 exact fractions, arbitrary precision integers, and variable precision floating
2698 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2699 ;; Others simply say "GNU General Public License" without stating a
2700 ;; version (which implicitly means gpl1+).
2701 ;; At least one file (src/maxima.asd) says "version 2."
2702 ;; GPLv2 only is therefore the smallest subset.
2703 (license license:gpl2)))
2705 (define-public wxmaxima
2712 (uri (string-append "https://github.com/andrejv/" name "/archive"
2713 "/Version-" version ".tar.gz"))
2714 (file-name (string-append name "-" version ".tar.gz"))
2717 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2719 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2720 (build-system cmake-build-system)
2722 `(("gettext" ,gettext-minimal)))
2724 `(("wxwidgets" ,wxwidgets)
2727 ("adwaita-icon-theme" ,adwaita-icon-theme)
2729 ("shared-mime-info" ,shared-mime-info)))
2731 `(#:tests? #f ; no check target
2733 (modify-phases %standard-phases
2734 (add-after 'install 'wrap-program
2735 (lambda* (#:key inputs outputs #:allow-other-keys)
2736 (wrap-program (string-append (assoc-ref outputs "out")
2739 (,(string-append (assoc-ref inputs "maxima")
2741 ;; For GtkFileChooserDialog.
2742 `("GSETTINGS_SCHEMA_DIR" =
2743 (,(string-append (assoc-ref inputs "gtk+")
2744 "/share/glib-2.0/schemas")))
2745 `("XDG_DATA_DIRS" ":" prefix
2746 (;; Needed by gdk-pixbuf to know supported icon formats.
2748 (assoc-ref inputs "shared-mime-info") "/share")
2749 ;; The default icon theme of GTK+.
2751 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2753 (home-page "https://andrejv.github.io/wxmaxima/")
2754 (synopsis "Graphical user interface for the Maxima computer algebra system")
2756 "wxMaxima is a graphical user interface for the Maxima computer algebra
2757 system. It eases the use of Maxima by making most of its commands available
2758 through a menu system and by providing input dialogs for commands that require
2759 more than one argument. It also implements its own display engine that
2760 outputs mathematical symbols directly instead of depicting them with ASCII
2763 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2764 text and mathematical calculations to create documents, exporting of input and
2765 output to TeX, and a browser for Maxima's manual including command index and
2766 full text searching.")
2767 (license license:gpl2+)))
2769 (define-public armadillo
2775 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2779 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2780 (build-system cmake-build-system)
2781 (arguments `(#:tests? #f)) ;no test target
2783 `(("openblas" ,openblas)
2785 ("arpack" ,arpack-ng)))
2786 (home-page "http://arma.sourceforge.net/")
2787 (synopsis "C++ linear algebra library")
2789 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2790 between speed and ease of use. It is useful for algorithm development
2791 directly in C++, or quick conversion of research code into production
2792 environments. It can be used for machine learning, pattern recognition,
2793 signal processing, bioinformatics, statistics, econometrics, etc. The library
2794 provides efficient classes for vectors, matrices and cubes, as well as 150+
2795 associated functions (eg. contiguous and non-contiguous submatrix views).")
2796 (license license:asl2.0)))
2798 (define-public muparser
2799 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2800 ;; different hash. In order to make `guix package --upgrade` work correctly,
2801 ;; we set a Guix packaging revision.
2802 ;; When the next version of muparser is released, we can remove
2803 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2804 (let ((upstream-version "2.2.5")
2808 (version (string-append upstream-version "-" revision))
2812 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2813 upstream-version ".tar.gz"))
2814 (file-name (string-append name "-" version ".tar.gz"))
2817 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2818 (build-system gnu-build-system)
2820 `(#:configure-flags '("--enable-samples=no")
2821 #:tests? #f)) ;no "check" target
2822 (home-page "http://muparser.beltoforion.de/")
2823 (synopsis "Fast parser library for mathematical expressions")
2825 "muParser is an extensible high performance math parser library. It is
2826 based on transforming an expression into a bytecode and precalculating constant
2828 (license license:expat))))
2830 (define-public openblas
2837 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2839 (file-name (string-append name "-" version ".tar.gz"))
2842 "14a9vyvp2k5zpd0axbnqk0d3khc1v3cck10nb5fj7d2sgn8490ky"))))
2843 (build-system gnu-build-system)
2845 `(#:test-target "test"
2846 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2847 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2848 ;; we need to disable substitutions.
2850 ,(let ((system (or (%current-target-system) (%current-system))))
2851 (or (string-prefix? "x86_64" system)
2852 (string-prefix? "i686" system)
2853 (string-prefix? "mips" system)
2854 (string-prefix? "aarch64" system)))
2856 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2858 ;; Build the library for all supported CPUs. This allows
2859 ;; switching CPU targets at runtime with the environment variable
2860 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2861 ;; Unfortunately, this is not supported on non-x86 architectures,
2862 ;; where it leads to failed builds.
2863 ,@(let ((system (or (%current-target-system) (%current-system))))
2865 ((or (string-prefix? "x86_64" system)
2866 (string-prefix? "i686" system))
2867 '("DYNAMIC_ARCH=1"))
2868 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2869 ;; two available MIPS targets special extended instructions
2870 ;; for Loongson cores are used.
2871 ((string-prefix? "mips" system)
2872 '("TARGET=SICORTEX"))
2873 ;; On aarch64 force the generic 'armv8-a' target
2874 ((string-prefix? "aarch64" system)
2877 ;; no configure script
2879 (modify-phases %standard-phases
2881 ;; Conditionally apply a patch on i686 to avoid rebuilding
2882 ;; all architectures. FIXME: This should be moved to the
2883 ;; (source (patches ...)) field in the next rebuild cycle.
2884 ,@(if (string-prefix? "i686" (or (%current-target-system)
2886 `((add-after 'unpack 'fix-tests
2887 (lambda* (#:key inputs #:allow-other-keys)
2888 (invoke "patch" "-p1"
2889 "--input" (assoc-ref inputs "i686-fix-tests.patch")))))
2891 (add-before 'build 'set-extralib
2892 (lambda* (#:key inputs #:allow-other-keys)
2893 ;; Get libgfortran found when building in utest.
2895 (string-append "-L" (assoc-ref inputs "fortran-lib")
2899 `(("fortran-lib" ,gfortran "lib")))
2902 ,@(if (string-prefix? "i686" (or (%current-target-system)
2904 `(("i686-fix-tests.patch"
2905 ,(search-patch "openblas-fix-tests-i686.patch")))
2907 ("fortran" ,gfortran)
2909 (home-page "http://www.openblas.net/")
2910 (synopsis "Optimized BLAS library based on GotoBLAS")
2912 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2913 (license license:bsd-3)))
2915 (define* (make-blis implementation #:optional substitutable?)
2916 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2917 source tree for a list of implementations.)
2919 SUBSTITUTABLE? determines whether the package is made available as a
2922 Currently the specialization must be selected at configure-time, but work is
2923 underway to allow BLIS to select the right optimized kernels at run time:
2924 <https://github.com/flame/blis/issues/129>."
2926 (name (if (string=? implementation "reference")
2928 (string-append "blis-" implementation)))
2930 (home-page "https://github.com/flame/blis")
2933 (uri (git-reference (url home-page) (commit version)))
2936 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2937 (file-name (git-file-name "blis" version))))
2938 (build-system gnu-build-system)
2940 `(#:test-target "test"
2942 #:substitutable? ,substitutable?
2944 #:phases (modify-phases %standard-phases
2946 (lambda* (#:key outputs #:allow-other-keys)
2947 ;; This is a home-made 'configure' script.
2948 (let ((out (assoc-ref outputs "out")))
2949 (zero? (system* "./configure" "-p" out
2953 "--enable-threading=openmp"
2955 ,implementation)))))
2956 (add-before 'check 'show-test-output
2958 ;; By default "make check" is silent. Make it verbose.
2959 (system "tail -F output.testsuite &")
2961 (synopsis "High-performance basic linear algebra (BLAS) routines")
2963 "BLIS is a portable software framework for instantiating high-performance
2964 BLAS-like dense linear algebra libraries. The framework was designed to
2965 isolate essential kernels of computation that, when optimized, immediately
2966 enable optimized implementations of most of its commonly used and
2967 computationally intensive operations. While BLIS exports a new BLAS-like API,
2968 it also includes a BLAS compatibility layer which gives application developers
2969 access to BLIS implementations via traditional BLAS routine calls.")
2970 (license license:bsd-3)))
2973 ;; This is the "reference" implementation, which is the non-optimized but
2974 ;; portable variant (no assembly).
2975 (make-blis "reference" #t))
2977 (define ignorance blis)
2979 (define-syntax-rule (blis/x86_64 processor)
2980 "Expand to a package specialized for PROCESSOR."
2982 (inherit (make-blis processor))
2983 (supported-systems '("x86_64-linux"))))
2985 (define-public blis-sandybridge
2986 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2987 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2988 (blis/x86_64 "sandybridge"))
2990 (define-public blis-haswell
2991 ;; BLIS specialized for Haswell processors (launched 2013):
2992 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2993 (blis/x86_64 "haswell"))
2995 (define-public blis-knl
2996 ;; BLIS specialized for Knights Landing processor (launched 2016):
2997 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2998 (blis/x86_64 "knl"))
3001 (define-public openlibm
3008 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
3010 (file-name (string-append name "-" version ".tar.gz"))
3013 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
3014 (build-system gnu-build-system)
3017 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3019 ;; no configure script
3020 (modify-phases %standard-phases (delete 'configure))
3021 #:tests? #f)) ;the tests are part of the default target
3022 (home-page "http://openlibm.org/")
3023 (synopsis "Portable C mathematical library (libm)")
3025 "OpenLibm is an effort to have a high quality, portable, standalone C
3026 mathematical library (libm). It can be used standalone in applications and
3027 programming language implementations. The project was born out of a need to
3028 have a good libm for the Julia programming language that worked consistently
3029 across compilers and operating systems, and in 32-bit and 64-bit
3031 ;; Each architecture has its own make target, and there is none for mips.
3032 (supported-systems (delete "mips64el-linux" %supported-systems))
3033 ;; See LICENSE.md for details.
3034 (license (list license:expat
3037 license:public-domain
3038 license:lgpl2.1+))))
3040 (define-public openspecfun
3042 (name "openspecfun")
3047 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3049 (file-name (string-append name "-" version ".tar.gz"))
3052 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
3053 (build-system gnu-build-system)
3055 '(#:tests? #f ; no "check" target
3057 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3059 (modify-phases %standard-phases
3060 (delete 'configure)))) ; no configure script
3062 `(("fortran" ,gfortran)))
3063 (home-page "https://github.com/JuliaLang/openspecfun")
3064 (synopsis "Collection of special mathematical functions")
3066 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3067 portable package for Bessel Functions of a Complex Argument and Nonnegative
3068 Order; it contains subroutines for computing Bessel functions and Airy
3069 functions. Faddeeva allows computing the various error functions of arbitrary
3070 complex arguments (Faddeeva function, error function, complementary error
3071 function, scaled complementary error function, imaginary error function, and
3072 Dawson function); given these, one can also easily compute Voigt functions,
3073 Fresnel integrals, and similar related functions as well.")
3074 ;; Faddeeva is released under the Expat license; AMOS is included as
3075 ;; public domain software.
3076 (license (list license:expat license:public-domain))))
3078 (define-public suitesparse
3080 (name "suitesparse")
3086 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3090 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3091 (modules '((guix build utils)))
3093 ;; Remove bundled metis source
3095 (delete-file-recursively "metis-5.1.0")
3097 (build-system gnu-build-system)
3099 '(#:tests? #f ;no "check" target
3104 "MY_METIS_LIB=-lmetis"
3105 (string-append "INSTALL_LIB="
3106 (assoc-ref %outputs "out") "/lib")
3107 (string-append "INSTALL_INCLUDE="
3108 (assoc-ref %outputs "out") "/include")
3111 (modify-phases %standard-phases
3112 (delete 'configure)))) ;no configure script
3117 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3118 (synopsis "Suite of sparse matrix software")
3120 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3121 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3122 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3123 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3124 CXSparse, a concise sparse Cholesky factorization package; and many other
3127 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3129 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3130 (license (list license:gpl2+ license:lgpl2.1+))))
3132 (define-public atlas
3138 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3139 version "/atlas" version ".tar.bz2"))
3142 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3143 (build-system gnu-build-system)
3144 (home-page "http://math-atlas.sourceforge.net/")
3145 (inputs `(("gfortran" ,gfortran)
3146 ("lapack-tar" ,(package-source lapack))))
3147 (outputs '("out" "doc"))
3148 ;; For the moment we drop support for MIPS at it fails to compile. See
3149 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3150 (supported-systems (delete "mips64el-linux" %supported-systems))
3152 `(#:parallel-build? #f
3153 #:parallel-tests? #f
3155 ;; ATLAS tunes itself for the machine it is built on, as explained at
3156 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3157 ;; For this reason, we want users to build it locally instead of using
3161 #:modules ((srfi srfi-26)
3163 (guix build gnu-build-system)
3166 `(;; Generate position independent code suitable for dynamic libraries
3167 ;; and use WALL timer to get more accurate timing.
3168 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3171 ,,(if (string-match "64" (%current-system))
3174 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3175 ;; needed to compile C files before it is generated.
3176 "-Ss" "pmake" "make -j 1"
3177 ;; Probe is failing for MIPS. We therefore define the system
3178 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3179 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3180 ,,@(if (string-prefix? "mips" (%current-system))
3181 (list "-A" "49" "-V" "1")
3183 ;; Generate shared libraries.
3185 ;; Build a full LAPACK library.
3186 ,(string-append "--with-netlib-lapack-tarfile="
3187 (assoc-ref %build-inputs "lapack-tar")))
3189 (modify-phases %standard-phases
3190 (add-after 'install 'install-doc
3191 (lambda* (#:key outputs inputs #:allow-other-keys)
3192 (let ((doc (string-append (assoc-ref outputs "doc")
3193 "/share/doc/atlas")))
3195 (fold (lambda (file previous)
3196 (and previous (zero? (system* "cp" file doc))))
3197 #t (find-files "../ATLAS/doc" ".*")))))
3198 (add-after 'check 'check-pt
3199 (lambda _ (zero? (system* "make" "ptcheck"))))
3200 ;; Fix files required to run configure.
3201 (add-before 'configure 'fix-/bin/sh
3203 ;; Use `sh', not `/bin/sh'.
3204 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3207 ;; Fix /bin/sh in generated make files.
3208 (add-after 'configure 'fix-/bin/sh-in-generated-files
3210 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3213 ;; ATLAS configure program does not accepts the default flags
3214 ;; passed by the 'gnu-build-system'.
3216 (lambda* (#:key native-inputs inputs outputs
3217 (configure-flags '())
3218 #:allow-other-keys #:rest args)
3219 (let* ((prefix (assoc-ref outputs "out"))
3220 (bash (or (and=> (assoc-ref
3221 (or native-inputs inputs) "bash")
3222 (cut string-append <> "/bin/bash"))
3224 (flags `(,(string-append "--prefix=" prefix)
3226 (abs-srcdir (getcwd))
3227 (srcdir (string-append "../" (basename abs-srcdir))))
3228 (format #t "source directory: ~s (relative from build: ~s)~%"
3232 (format #t "build directory: ~s~%" (getcwd))
3233 (format #t "configure flags: ~s~%" flags)
3234 (zero? (apply system* bash
3235 (string-append srcdir "/configure")
3237 (synopsis "Automatically Tuned Linear Algebra Software")
3239 "ATLAS is an automatically tuned linear algebra software library
3240 providing C and Fortran77 interfaces to a portably efficient BLAS
3241 implementation, as well as a few routines from LAPACK.
3243 Optimization occurs at build time. For this reason, the library is built on
3244 the machine where it is installed, without resorting to pre-built substitutes.
3246 Before building the library, CPU throttling should be disabled. This can be
3247 done in the BIOS, or, on GNU/Linux, with the following command:
3250 # cpupower --governor performance
3253 Failure to do so will result in a library with poor performance.")
3254 (license license:bsd-3)))
3263 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3264 version "/glm-" version ".zip"))
3267 "0ihjadp2sb8w312a276skfjsljm3y41bjscbxf79wn23gi00giz1"))))
3268 (build-system cmake-build-system)
3270 `(("unzip" ,unzip)))
3271 (home-page "https://glm.g-truc.net/")
3272 (synopsis "OpenGL Mathematics library")
3273 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3274 library for graphics software based on the OpenGL Shading Language (GLSL)
3276 (license license:expat)))
3278 (define-public lpsolve
3285 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3286 "/lp_solve_" version "_source.tar.gz"))
3289 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3290 (modules '((guix build utils)))
3293 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3295 ;; Pretend to be on a 64 bit platform to obtain a common directory
3296 ;; name for the build results on all architectures; nothing else
3297 ;; seems to depend on it.
3298 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3300 ;; The check for 'isnan' as it is written fails with
3301 ;; "non-floating-point argument in call to function
3302 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3303 ;; definition, which in turn leads to bad things. Fix the feature
3305 (("isnan\\(0\\)") "isnan(0.)"))
3307 (build-system gnu-build-system)
3309 `(#:tests? #f ; no check target
3311 (modify-phases %standard-phases
3312 (delete 'configure) ; no configure script
3315 (with-directory-excursion "lpsolve55"
3316 (invoke "bash" "ccc"))
3317 (with-directory-excursion "lp_solve"
3318 (invoke "bash" "ccc"))
3321 (lambda* (#:key outputs #:allow-other-keys)
3322 (let* ((out (assoc-ref outputs "out"))
3323 (bin (string-append out "/bin"))
3324 (lib (string-append out "/lib"))
3325 ;; This is where LibreOffice expects to find the header
3326 ;; files, and where they are installed by Debian.
3327 (include (string-append out "/include/lpsolve")))
3328 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3329 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3330 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3332 ;; Install a subset of the header files as on Debian
3333 ;; (plus lp_bit.h, which matches the regular expression).
3334 (for-each (lambda (name)
3335 (install-file name include))
3336 (find-files "." "lp_[HMSa-z].*\\.h$"))
3337 (with-directory-excursion "shared"
3338 (for-each (lambda (name)
3339 (install-file name include))
3340 (find-files "." "\\.h$")))
3342 (home-page "http://lpsolve.sourceforge.net/")
3343 (synopsis "Mixed integer linear programming (MILP) solver")
3345 "lp_solve is a mixed integer linear programming solver based on the
3346 revised simplex and the branch-and-bound methods.")
3347 (license license:lgpl2.1+)))
3349 (define-public dealii
3356 (uri (string-append "https://github.com/dealii/dealii/releases/"
3357 "download/v" version "/dealii-" version ".tar.gz"))
3360 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3361 (modules '((guix build utils)))
3363 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3365 (delete-file-recursively "bundled")
3367 (build-system cmake-build-system)
3375 ("arpack" ,arpack-ng)
3376 ("muparser" ,muparser)
3377 ("gfortran" ,gfortran)
3378 ("suitesparse" ,suitesparse))) ;for UMFPACK
3380 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3382 ;; Work around a bug in libsuitesparseconfig linking
3383 ;; see https://github.com/dealii/dealii/issues/4745
3384 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3385 (home-page "https://www.dealii.org")
3386 (synopsis "Finite element library")
3388 "Deal.II is a C++ program library targeted at the computational solution
3389 of partial differential equations using adaptive finite elements. The main
3390 aim of deal.II is to enable rapid development of modern finite element codes,
3391 using among other aspects adaptive meshes and a wide array of tools often used
3392 in finite element programs.")
3393 (license license:lgpl2.1+)))
3395 (define-public dealii-openmpi
3396 (package (inherit dealii)
3397 (name "dealii-openmpi")
3400 ;;Supported only with MPI:
3401 ("p4est" ,p4est-openmpi)
3402 ("petsc" ,petsc-openmpi)
3403 ("slepc" ,slepc-openmpi)
3404 ("metis" ,metis) ;for MUMPS
3405 ("scalapack" ,scalapack) ;for MUMPS
3406 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3407 ("arpack" ,arpack-ng-openmpi)
3408 ,@(fold alist-delete (package-inputs dealii)
3409 '("p4est" "arpack"))))
3411 (substitute-keyword-arguments (package-arguments dealii)
3412 ((#:configure-flags cf)
3413 ``("-DMPI_C_COMPILER=mpicc"
3414 "-DMPI_CXX_COMPILER=mpicxx"
3415 "-DMPI_Fortran_COMPILER=mpifort"
3417 (synopsis "Finite element library (with MPI support)")))
3419 (define-public flann
3428 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3429 version "-src.zip"))
3432 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3433 (patches (search-patches "flann-cmake-3.11.patch"))))
3434 (build-system cmake-build-system)
3436 "octave")) ;46 MiB .mex file that pulls Octave
3438 `(("unzip" ,unzip)))
3442 ("python" ,python-2) ; print syntax
3443 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3446 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3447 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3448 #:strip-directories '("lib" "lib64" "libexec"
3449 "bin" "sbin" "share/flann/octave")
3451 ;; Save 12 MiB by not installing .a files. Passing
3452 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3453 #:phases (modify-phases %standard-phases
3454 (add-before 'configure 'set-octave-directory
3455 (lambda* (#:key outputs #:allow-other-keys)
3456 ;; Install the .mex file in the "octave" output.
3457 (let ((out (assoc-ref outputs "octave")))
3458 (substitute* "src/matlab/CMakeLists.txt"
3459 (("share/flann/octave")
3460 (string-append out "/share/flann/octave")))
3462 (add-after 'install 'remove-static-libraries
3463 (lambda* (#:key outputs #:allow-other-keys)
3464 (let* ((out (assoc-ref outputs "out"))
3465 (lib (string-append out "/lib")))
3466 (for-each delete-file
3467 (find-files lib "\\.a$"))
3470 #:tests? #f)) ; The test data are downloaded from the Internet.
3471 (home-page "http://www.cs.ubc.ca/research/flann/")
3472 (synopsis "Library for approximate nearest neighbors computation")
3473 (description "FLANN is a library for performing fast approximate
3474 nearest neighbor searches in high dimensional spaces. It implements a
3475 collection of algorithms and a system for automatically choosing the best
3476 algorithm and optimum parameters depending on the dataset.
3478 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3479 (license (license:non-copyleft "file://COPYING"
3480 "See COPYING in the distribution."))))
3482 (define-public wcalc
3489 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3490 "wcalc-" version ".tar.bz2"))
3493 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3494 (build-system gnu-build-system)
3497 ("readline" ,readline)))
3498 (home-page "http://w-calc.sourceforge.net/index.php")
3499 (synopsis "Flexible command-line scientific calculator")
3500 (description "Wcalc is a very capable calculator. It has standard functions
3501 (sin, asin, and sinh for example, in either radians or degrees), many
3502 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3503 variables, a command history, hex/octal/binary input and output, unit
3504 conversions, embedded comments, and an expandable expression entry field. It
3505 evaluates expressions using the standard order of operations.")
3506 (license license:gpl2+)))
3514 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3515 "/xaos-" version ".tar.gz"))
3518 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3519 (build-system gnu-build-system)
3520 (native-inputs `(("gettext" ,gettext-minimal)))
3521 (inputs `(("libx11" ,libx11)
3526 `(#:tests? #f ;no "check" target
3527 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3528 (synopsis "Real-time fractal zoomer")
3529 (description "GNU XaoS is a graphical program that generates fractal
3530 patterns and allows you to zoom in and out of them infinitely in a fluid,
3531 continuous manner. It also includes tutorials that help to explain how fractals
3532 are built. It can generate many different fractal types such as the Mandelbrot
3534 (home-page "https://www.gnu.org/software/xaos/")
3535 (license license:gpl2+)))
3537 (define-public hypre
3543 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3544 "v" version ".tar.gz"))
3545 (file-name (string-append name "-" version ".tar.gz"))
3548 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3549 (modules '((guix build utils)))
3552 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3553 ;; substitute the tarball creation time.
3554 (substitute* "src/utilities/HYPRE_utilities.h"
3555 (("Date Compiled: .*$")
3556 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3558 (build-system gnu-build-system)
3559 (outputs '("out" ;6.1 MiB of headers and libraries
3560 "doc")) ;4.8 MiB of documentation
3564 ("perl" ,perl) ;needed to run 'ppmquant' during tests
3565 ("texlive" ,texlive) ;full package required for fonts
3566 ("ghostscript" ,ghostscript)))
3568 `(("blas" ,openblas)
3569 ("lapack" ,lapack)))
3571 `(#:modules ((srfi srfi-1)
3572 ,@%gnu-build-system-modules)
3573 #:configure-flags '("--enable-shared"
3581 (modify-phases %standard-phases
3582 (add-before 'configure 'chdir-src
3583 (lambda _ (chdir "src")))
3585 (lambda* (#:key build target configure-flags
3586 #:allow-other-keys #:rest args)
3587 (let* ((configure (assoc-ref %standard-phases 'configure)))
3590 (list #:configure-flags
3591 (cons (string-append
3592 "--host=" (or target build))
3593 configure-flags)))))))
3594 (add-after 'build 'build-docs
3596 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3599 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3600 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3601 (and (system* "make" "check" "CHECKRUN=")
3602 (fold (lambda (filename result)
3604 (let ((size (stat:size (stat filename))))
3605 (when (not (zero? size))
3606 (format #t "~a size ~d; error indication~%"
3610 (find-files "test" ".*\\.err$")))))
3611 (add-after 'install 'install-docs
3612 (lambda* (#:key outputs #:allow-other-keys)
3613 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3614 (let* ((doc (assoc-ref outputs "doc"))
3615 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3616 (with-directory-excursion "docs"
3617 (for-each (lambda (base)
3618 (install-file (string-append base ".pdf") docdir)
3619 (copy-recursively base docdir)) ;html docs
3620 '("HYPRE_usr_manual"
3621 "HYPRE_ref_manual")))
3623 (home-page "http://www.llnl.gov/casc/hypre/")
3624 (synopsis "Library of solvers and preconditioners for linear equations")
3626 "HYPRE is a software library of high performance preconditioners and
3627 solvers for the solution of large, sparse linear systems of equations. It
3628 features multigrid solvers for both structured and unstructured grid
3630 (license license:lgpl2.1)))
3632 (define-public hypre-openmpi
3633 (package (inherit hypre)
3634 (name "hypre-openmpi")
3637 ,@(package-inputs hypre)))
3639 (substitute-keyword-arguments (package-arguments hypre)
3640 ((#:configure-flags flags)
3642 ,@(delete "--without-MPI" ,flags)))
3644 `(modify-phases ,phases
3645 (add-before 'check 'set-test-environment
3647 ;; By default, running the test suite would fail because 'ssh'
3648 ;; could not be found in $PATH. Define this variable to
3649 ;; placate Open MPI without adding a dependency on OpenSSH (the
3650 ;; agent isn't used anyway.)
3651 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
3653 (synopsis "Parallel solvers and preconditioners for linear equations")
3655 "HYPRE is a software library of high performance preconditioners and
3656 solvers for the solution of large, sparse linear systems of equations on
3657 parallel computers. It features parallel multigrid solvers for both
3658 structured and unstructured grid problems.")))
3660 (define-public matio
3667 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3668 "matio-" version ".tar.gz"))
3671 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3672 (build-system gnu-build-system)
3676 (home-page "http://matio.sourceforge.net/")
3677 (synopsis "Library for reading and writing MAT files")
3678 (description "Matio is a library for reading and writing MAT files. It
3679 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3680 (license license:bsd-2)))
3687 (origin (method url-fetch)
3688 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3689 "download/" version "/Vc-" version ".tar.gz"))
3692 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3693 (build-system cmake-build-system)
3696 '("-DBUILD_TESTING=ON"
3697 ;; By default, Vc will optimize for the CPU of the build machine.
3698 ;; Setting this to "none" makes it create portable binaries. See
3699 ;; "cmake/OptimizeForArchitecture.cmake".
3700 "-DTARGET_ARCHITECTURE=none")))
3701 (synopsis "SIMD vector classes for C++")
3702 (description "Vc provides portable, zero-overhead C++ types for explicitly
3703 data-parallel programming. It is a library designed to ease explicit
3704 vectorization of C++ code. Its types enable explicitly stating data-parallel
3705 operations on multiple values. The parallelism is therefore added via the type
3706 system. Vc has an intuitive API and provides portability between different
3707 compilers and compiler versions as well as portability between different vector
3708 instruction sets. Thus, an application written with Vc can be compiled for:
3711 @item SSE2 up to SSE4.2 or SSE4a
3714 @item NEON (in development)
3715 @item NVIDIA GPUs / CUDA (in development)
3717 (home-page "https://github.com/VcDevel/Vc")
3718 ;; "No support_???.cpp file exists for this architecture."
3719 (supported-systems '("x86_64-linux" "i686-linux"))
3720 (license license:bsd-3)))
3722 (define-public reducelcs
3723 ;; This is the last commit which is available upstream, no
3724 ;; release happened since 2010.
3725 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3729 (version (string-append "1.0-" revision "." (string-take commit 7)))
3734 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3736 (file-name (string-append name "-" version "-checkout"))
3739 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3740 (build-system gnu-build-system)
3742 `(("openlibm" ,openlibm)))
3744 `(#:tests? #f ; no tests
3746 (modify-phases %standard-phases
3747 (delete 'configure) ; No configure script exists.
3748 (replace 'install ; No install phase exists.
3749 (lambda* (#:key outputs #:allow-other-keys)
3750 (let* ((out (assoc-ref outputs "out"))
3751 (bin (string-append out "/bin")))
3752 (install-file "Approximation" bin)
3753 (install-file "CollectResults" bin)
3754 (install-file "GenerateInstances" bin)
3756 (synopsis "Approximate Longest Commons Subsequence computation tool")
3758 "@code{reduceLCS} is an implementation of the Reduce-Expand
3759 algorithm for LCS. It is a fast program to compute the approximate
3760 Longest Commons Subsequence of a set of strings.")
3761 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3762 (license license:gpl3+))))
3764 (define-public jacal
3771 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3774 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3775 (patches (search-patches "jacal-fix-texinfo.patch"))))
3776 (build-system gnu-build-system)
3779 (modify-phases %standard-phases
3780 (add-before 'build 'pre-build
3781 ;; Don't use upstream's script - it really doesn't fit into
3782 ;; Guix's functional paradigm.
3783 (lambda* (#:key inputs outputs #:allow-other-keys)
3784 (substitute* "Makefile"
3785 (("^install: install-script") "install: "))))
3786 (add-after 'install 'post-install
3787 ;; Instead, we provide our own simplified script.
3788 (lambda* (#:key inputs outputs #:allow-other-keys)
3789 (let ((wrapper (string-append (assoc-ref outputs "out")
3791 (format (open wrapper (logior O_WRONLY O_CREAT))
3792 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3793 "-e '(slib:load \"~a/lib/jacal/math\") "
3796 (assoc-ref inputs "scm")
3797 (assoc-ref outputs "out"))
3798 (chmod wrapper #o555))))
3800 (lambda* (#:key inputs outputs #:allow-other-keys)
3801 (zero? (system* "./configure"
3802 (string-append "--prefix="
3803 (assoc-ref outputs "out")))))))))
3804 (inputs `(("scm" ,scm)))
3805 (native-inputs `(("unzip" ,unzip)
3806 ("texinfo" ,texinfo)))
3807 (synopsis "Symbolic mathematics system")
3808 (description "GNU JACAL is an interactive symbolic mathematics program based on
3809 Scheme. It manipulate and simplify a range of mathematical expressions such
3810 as equations, scalars, vectors, and matrices.")
3811 (home-page "https://www.gnu.org/software/jacal/")
3812 (license license:gpl3+)))
3821 "https://github.com/Z3Prover/z3/archive/z3-"
3825 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3826 (build-system cmake-build-system)
3829 (list "-DBUILD_PYTHON_BINDINGS=true"
3830 "-DINSTALL_PYTHON_BINDINGS=true"
3831 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3833 "/lib/python2.7/site-packages"))
3835 (modify-phases %standard-phases
3836 (add-before 'configure 'bootstrap
3839 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3840 (add-before 'check 'make-test-z3
3842 ;; Build the test suite executable.
3843 (zero? (system* "make" "test-z3" "-j"
3844 (number->string (parallel-job-count))))))
3847 ;; Run all the tests that don't require arguments.
3848 (zero? (system* "./test-z3" "/a")))))))
3850 `(("python" ,python-2)))
3851 (synopsis "Theorem prover")
3852 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3853 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3854 (home-page "https://github.com/Z3Prover/z3")
3855 (license license:expat)))
3857 (define-public cubicle
3863 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3867 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3868 (build-system gnu-build-system)
3871 ("which" ,(@@ (gnu packages base) which))))
3875 `(#:configure-flags (list "--with-z3")
3878 (modify-phases %standard-phases
3879 (add-before 'configure 'configure-for-release
3881 (substitute* "Makefile.in"
3882 (("SVNREV=") "#SVNREV="))))
3883 (add-before 'configure 'fix-/bin/sh
3885 (substitute* "configure"
3886 (("/bin/sh") (which "sh")))))
3887 (add-before 'configure 'fix-smt-z3wrapper.ml
3889 (substitute* "Makefile.in"
3890 (("\\\\n") "")))))))
3891 (home-page "http://cubicle.lri.fr/")
3892 (synopsis "Model checker for array-based systems")
3893 (description "Cubicle is a model checker for verifying safety properties
3894 of array-based systems. This is a syntactically restricted class of
3895 parametrized transition systems with states represented as arrays indexed by
3896 an arbitrary number of processes. Cache coherence protocols and mutual
3897 exclusion algorithms are typical examples of such systems.")
3898 (license license:asl2.0)))
3900 (define-public elemental
3906 (uri (string-append "https://github.com/elemental/Elemental/"
3907 "archive/v" version ".tar.gz"))
3908 (file-name (string-append name "-" version ".tar.gz"))
3911 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3912 (build-system cmake-build-system)
3913 (home-page "http://libelemental.org")
3915 `(("gfortran" ,gfortran)))
3917 `(("blas" ,openblas)
3918 ("gfortran:lib" ,gfortran "lib")
3927 `(#:build-type "Release" ;default RelWithDebInfo not supported
3928 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3929 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3930 "-DEL_CACHE_WARNINGS:BOOL=YES"
3931 "-DEL_TESTS:BOOL=YES"
3932 "-DCMAKE_INSTALL_LIBDIR=lib"
3933 "-DGFORTRAN_LIB=gfortran")
3934 #:phases (modify-phases %standard-phases
3935 (add-before 'check 'setup-tests
3937 ;; Parallelism is done at the MPI layer.
3938 (setenv "OMP_NUM_THREADS" "1")
3940 (add-after 'install 'remove-tests
3941 (lambda* (#:key outputs #:allow-other-keys)
3942 ;; Tests are installed, with no easy configuration
3943 ;; switch to prevent this, so delete them.
3944 (delete-file-recursively
3945 (string-append (assoc-ref outputs "out") "/bin"))
3947 (synopsis "Dense and sparse-direct linear algebra and optimization")
3948 (description "Elemental is a modern C++ library for distributed-memory
3949 dense and sparse-direct linear algebra, conic optimization, and lattice
3951 (license license:bsd-2)))
3953 (define-public mcrl2
3956 (version "201707.1.15162")
3959 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3964 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3966 `(("subversion" ,subversion)))
3972 (build-system cmake-build-system)
3973 (synopsis "Toolset for the mCRL2 formal specification language")
3975 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3976 specification language for describing concurrent discrete event systems. Its
3977 toolset supports analysis and automatic verification, linearisation, simulation,
3978 state-space exploration and generation, and tools to optimise and analyse
3979 specifications. Also, state spaces can be manipulated, visualised and
3981 (home-page "http://mcrl2.org")
3982 (license license:boost1.0)))
3984 (define-public r-subplex
3991 (uri (cran-uri "subplex" version))
3994 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
3995 (build-system r-build-system)
3997 `(("gfortran" ,gfortran)))
3998 (home-page "https://cran.r-project.org/web/packages/subplex")
3999 (synopsis "Unconstrained optimization using the subplex algorithm")
4000 (description "This package implements the Subplex optimization algorithm.
4001 It solves unconstrained optimization problems using a simplex method on
4002 subspaces. The method is well suited for optimizing objective functions that
4003 are noisy or are discontinuous at the solution.")
4004 (license license:gpl3+)))
4006 (define-public r-desolve
4013 (uri (cran-uri "deSolve" version))
4016 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
4017 (properties `((upstream-name . "deSolve")))
4018 (build-system r-build-system)
4020 `(("gfortran" ,gfortran)))
4021 (home-page "https://desolve.r-forge.r-project.org/")
4022 (synopsis "Solvers for initial value problems of differential equations")
4023 (description "This package provides functions that solve initial
4024 value problems of a system of first-order ordinary differential equations (ODE),
4025 of partial differential equations (PDE), of differential algebraic equations
4026 (DAE), and of delay differential equations. The functions provide an interface
4027 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4028 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4029 the Runge-Kutta family with fixed or variable time steps. The package contains
4030 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4031 differential equations (PDE) that have been converted to ODEs by numerical
4033 (license license:gpl2+)))
4035 (define-public tcalc
4042 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4046 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4047 (build-system gnu-build-system)
4048 (synopsis "The terminal calculator")
4050 "The terminal calculator is a small program to help users of the GNU/Linux
4051 terminal do calculations simply and quickly. The formula to be calculated can
4052 be fed to @command{tcalc} through the command line.")
4053 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4054 (license license:gpl3+)))