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 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
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")
280 (home-page "https://github.com/google/double-conversion")
283 (uri (string-append home-page "/archive/v" version ".tar.gz"))
284 (file-name (string-append name "-" version ".tar.gz"))
287 "059r1czs28ljjd388pn6l3njg1ghbf1cv3q9nkxv3dj2a8siabqm"))))
288 (build-system cmake-build-system)
290 '(#:test-target "test"
291 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
292 "-DBUILD_TESTING=ON")))
293 (synopsis "Conversion routines for IEEE doubles")
295 "The double-conversion library provides binary-decimal and decimal-binary
296 routines for IEEE doubles. The library consists of efficient conversion
297 routines that have been extracted from the V8 JavaScript engine.")
298 (license license:bsd-3)))
300 (define-public dionysus
306 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
310 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
311 (build-system gnu-build-system)
312 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
313 (synopsis "Local search for universal constants and scientific values")
315 "GNU Dionysus is a convenient system for quickly retrieving the values of
316 mathematical constants used in science and engineering. Values can be
317 searched using a simple command-line tool, choosing from three databases:
318 universal constants, atomic numbers, and constants related to
320 (license license:gpl3+)
321 (home-page "https://www.gnu.org/software/dionysus/")))
329 (uri (string-append "mirror://gnu/gsl/gsl-"
333 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
334 (patches (search-patches "gsl-test-i686.patch"))))
335 (build-system gnu-build-system)
337 `(;; Currently there are numerous tests that fail on "exotic"
338 ;; architectures such as aarch64 and ppc64le.
339 ,@(if (string-prefix? "aarch64-linux"
340 (or (%current-target-system) (%current-system)))
343 (home-page "https://www.gnu.org/software/gsl/")
344 (synopsis "Numerical library for C and C++")
346 "The GNU Scientific Library is a library for numerical analysis in C
347 and C++. It includes a wide range of mathematical routines, with over 1000
348 functions in total. Subject areas covered by the library include:
349 differential equations, linear algebra, Fast Fourier Transforms and random
351 (license license:gpl3+)))
353 (define-public ocaml-gsl
362 "https://github.com/mmottl/gsl-ocaml/releases/download/"
363 version "/gsl-" version ".tbz"))
366 "17vcswipliq1b2idbzx1z95kskn1a4q4s5v04igilg0f7lnkaarb"))))
367 (build-system ocaml-build-system)
370 (home-page "https://mmottl.github.io/gsl-ocaml")
371 (synopsis "Bindings to the GNU Scientific Library")
373 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
374 the OCaml language.")
375 (license license:gpl3+)))
377 (define-public ocaml4.01-gsl
378 (package-with-ocaml4.01 ocaml-gsl))
387 (uri (string-append "mirror://gnu/glpk/glpk-"
391 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
392 (build-system gnu-build-system)
396 `(#:configure-flags '("--with-gmp")))
397 (home-page "https://www.gnu.org/software/glpk/")
398 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
400 "GLPK is a C library for solving large-scale linear programming (LP),
401 mixed integer programming (MIP), and other related problems. It supports the
402 GNU MathProg modeling language, a subset of the AMPL language, and features a
403 translator for the language. In addition to the C library, a stand-alone
404 LP/MIP solver is included in the package.")
405 (license license:gpl3+)))
414 (uri (string-append "http://www.4ti2.de/version_" version
415 "/4ti2-" version ".tar.gz"))
418 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
419 (build-system gnu-build-system)
421 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
425 (home-page "http://www.4ti2.de/")
426 (synopsis "Mathematical tool suite for problems on linear spaces")
428 "4ti2 implements algorithms for solving algebraic, geometric and
429 combinatorial problems on linear spaces. Among others, it solves systems
430 of linear equations, computes extreme rays of polyhedral cones, solves
431 integer programming problems and computes Markov bases for statistics.")
432 (license license:gpl2+)))
434 (define-public cddlib
441 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
442 (string-delete #\. version) ".tar.gz"))
445 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
446 (build-system gnu-build-system)
449 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
450 (synopsis "Library for convex hulls and extreme rays of polyhedra")
452 "The C-library cddlib implements the Double Description Method of
453 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
454 rays of a general convex polyhedron given by a system of linear inequalities
455 in arbitrary dimension. It can also be used for the converse operation of
456 computing convex hulls.")
457 (license license:gpl2+)))
459 (define-public arpack-ng
463 (home-page "https://github.com/opencollab/arpack-ng")
467 (uri (string-append home-page "/archive/" version ".tar.gz"))
468 (file-name (string-append name "-" version ".tar.gz"))
471 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
472 (build-system gnu-build-system)
474 '(#:phases (modify-phases %standard-phases
475 (add-after 'unpack 'autoreconf
477 (invoke "autoreconf" "-vfi"))))))
479 `(("autoconf" ,autoconf)
480 ("automake" ,automake)
481 ("libtool" ,libtool)))
484 ("fortran" ,gfortran)))
485 (synopsis "Fortran subroutines for solving eigenvalue problems")
487 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
488 large scale eigenvalue problems.")
489 (license (license:non-copyleft "file://COPYING"
490 "See COPYING in the distribution."))))
492 (define-public arpack-ng-3.3.0
496 (name (package-name arpack-ng))
497 (home-page (package-home-page arpack-ng))
501 (uri (string-append home-page "/archive/" version ".tar.gz"))
502 (file-name (string-append name "-" version ".tar.gz"))
505 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
507 (define-public arpack-ng-openmpi
508 (package (inherit arpack-ng)
509 (name "arpack-ng-openmpi")
512 ,@(package-inputs arpack-ng)))
514 (substitute-keyword-arguments (package-arguments arpack-ng)
515 ((#:configure-flags _ '())
516 ''("--enable-mpi"))))
517 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
519 (define-public lapack
526 (uri (string-append "http://www.netlib.org/lapack/lapack-"
530 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
531 (build-system cmake-build-system)
532 (home-page "http://www.netlib.org/lapack/")
533 (inputs `(("fortran" ,gfortran)
534 ("python" ,python-2)))
536 `(#:configure-flags (list
537 "-DBUILD_SHARED_LIBS:BOOL=YES"
540 ;; Build the 'LAPACKE_clatms' functions.
541 "-DLAPACKE_WITH_TMG=ON")
543 (modify-phases %standard-phases
544 (add-before 'check 'patch-python
545 (lambda* (#:key inputs #:allow-other-keys)
546 (let ((python (assoc-ref inputs "python")))
547 (substitute* "lapack_testing.py"
548 (("/usr/bin/env python") python)))
550 (synopsis "Library for numerical linear algebra")
552 "LAPACK is a Fortran 90 library for solving the most commonly occurring
553 problems in numerical linear algebra.")
554 (license (license:non-copyleft "file://LICENSE"
555 "See LICENSE in the distribution."))))
557 (define-public scalapack
564 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
568 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
569 (build-system cmake-build-system)
572 ("fortran" ,gfortran)
573 ("lapack" ,lapack))) ;for testing only
575 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
576 #:phases (modify-phases %standard-phases
577 (add-before 'check 'set-test-environment
579 ;; By default, running the test suite would fail because
580 ;; 'ssh' could not be found in $PATH. Define this
581 ;; variable to placate Open MPI without adding a
582 ;; dependency on OpenSSH (the agent isn't used anyway.)
583 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
585 (home-page "http://www.netlib.org/scalapack/")
586 (synopsis "Library for scalable numerical linear algebra")
588 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
589 routines on parallel distributed memory machines. ScaLAPACK solves dense and
590 banded linear systems, least squares problems, eigenvalue problems, and
591 singular value problems.")
592 (license (license:bsd-style "file://LICENSE"
593 "See LICENSE in the distribution."))))
595 (define-public gnuplot
601 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
606 "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m"))))
607 (build-system gnu-build-system)
608 (inputs `(("readline" ,readline)
614 `(("pkg-config" ,pkg-config)
615 ("texlive" ,texlive-tiny)))
616 (arguments `(#:configure-flags (list (string-append
617 "--with-texdir=" %output
618 "/texmf-local/tex/latex/gnuplot"))))
619 (home-page "http://www.gnuplot.info")
620 (synopsis "Command-line driven graphing utility")
621 (description "Gnuplot is a portable command-line driven graphing
622 utility. It was originally created to allow scientists and students to
623 visualize mathematical functions and data interactively, but has grown to
624 support many non-interactive uses such as web scripting. It is also used as a
625 plotting engine by third-party applications like Octave.")
626 ;; X11 Style with the additional restriction that derived works may only be
627 ;; distributed as patches to the original.
628 (license (license:fsf-free
629 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
638 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
640 (file-name (string-append name "-" version ".tar.gz"))
643 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
645 `(("fortran" ,gfortran)))
646 (build-system gnu-build-system)
647 (synopsis "General Cartographic Transformation Package (GCTP)")
649 "The General Cartographic Transformation Package (GCTP) is a system of
650 software routines designed to permit the transformation of coordinate pairs
651 from one map projection to another. The GCTP is the standard computer
652 software used by the National Mapping Division for map projection
654 (home-page "https://github.com/OkoSanto/GCTP")
655 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
664 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
665 version "/src/hdf-" version ".tar.bz2"))
667 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
668 (patches (search-patches "hdf4-architectures.patch"
669 "hdf4-reproducibility.patch"
670 "hdf4-shared-fortran.patch"))))
671 (build-system gnu-build-system)
673 `(("gfortran" ,gfortran)
678 ("libjpeg" ,libjpeg)))
680 `(#:parallel-tests? #f
681 #:configure-flags '("--enable-shared")
683 (modify-phases %standard-phases
684 ;; This is inspired by two of Debian's patches.
685 (add-before 'configure 'add-more-aarch64-support
687 (substitute* '("mfhdf/ncgen/ncgen.l"
688 "mfhdf/ncgen/ncgenyy.c"
689 "mfhdf/libsrc/netcdf.h.in")
690 (("AIX5L64") "__aarch64__"))
692 (add-before 'configure 'patchbuild
695 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
697 (("/bin/mkdir") "mkdir"))
698 (substitute* (find-files "." "^Makefile\\.in$")
699 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
700 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
701 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
702 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
703 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
705 (add-after 'configure 'patch-settings
707 ;; libhdf4.settings contains the full path of the
708 ;; compilers used, and its contents are included in
709 ;; .so-files. We truncate the hashes to avoid
710 ;; unnecessary store references to those compilers:
711 (substitute* "libhdf4.settings"
712 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
713 (string-append prefix (string-take hash 10) "...")))
716 (home-page "https://www.hdfgroup.org/products/hdf4/")
718 "Library and multi-object file format for storing and managing data")
719 (description "HDF4 is a library and multi-object file format for storing
720 and managing data between machines. HDF4 is an older hierarchical data format,
721 incompatible with HDF5.")
723 (license:non-copyleft
724 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
726 (define-public hdf4-alt
731 (substitute-keyword-arguments (package-arguments hdf4)
732 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
734 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
743 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
744 "hdf5-" (version-major+minor version)
745 "/hdf5-" version "/src/hdf5-"
747 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
750 (take (string-split version #\.) 2))
751 "/src/hdf5-" version ".tar.bz2")))
753 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
754 (patches (list (search-patch "hdf5-config-date.patch")))))
755 (build-system gnu-build-system)
759 `(("gfortran" ,gfortran)))
760 (outputs '("out" ; core library
761 "fortran")) ; fortran interface
763 `(;; Some of the users, notably Flann, need the C++ interface.
764 #:configure-flags '("--enable-cxx"
766 "--enable-fortran2003")
767 ;; Use -fPIC to allow the R bindings to link with the static libraries
768 #:make-flags (list "CFLAGS=-fPIC"
771 (modify-phases %standard-phases
772 (add-before 'configure 'patch-configure
773 (lambda* (#:key outputs #:allow-other-keys)
774 (substitute* "configure"
776 (substitute* "fortran/src/Makefile.in"
777 (("libhdf5_fortran_la_LDFLAGS =")
778 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
779 (assoc-ref outputs "fortran") "/lib")))
780 (substitute* "hl/fortran/src/Makefile.in"
781 (("libhdf5hl_fortran_la_LDFLAGS =")
782 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
783 (assoc-ref outputs "fortran") "/lib")))
785 (add-after 'configure 'patch-settings
787 ;; libhdf5.settings contains the full path of the
788 ;; compilers used, and its contents are included in
789 ;; libhdf5.so. We truncate the hashes to avoid
790 ;; unnecessary store references to those compilers:
791 (substitute* "src/libhdf5.settings"
792 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
793 (string-append prefix (string-take hash 10) "..."))
794 ;; Don't record the build-time kernel version to make the
795 ;; settings file reproducible.
796 (("Uname information:.*")
797 "Uname information: Linux\n"))
799 (add-after 'install 'patch-references
800 (lambda* (#:key inputs outputs #:allow-other-keys)
801 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
802 (zlib (assoc-ref inputs "zlib")))
803 (substitute* (find-files bin "h5p?cc")
805 (string-append "-L" zlib "/lib " lib)))
807 (add-after 'install 'split
808 (lambda* (#:key inputs outputs #:allow-other-keys)
809 ;; Move all fortran-related files
810 (let* ((out (assoc-ref outputs "out"))
811 (bin (string-append out "/bin"))
812 (lib (string-append out "/lib"))
813 (inc (string-append out "/include"))
814 (ex (string-append out "/share/hdf5_examples/fortran"))
815 (fort (assoc-ref outputs "fortran"))
816 (fbin (string-append fort "/bin"))
817 (flib (string-append fort "/lib"))
818 (finc (string-append fort "/include"))
819 (fex (string-append fort "/share/hdf5_examples/fortran")))
824 (rename-file (string-append bin "/h5fc")
825 (string-append fbin "/h5fc"))
826 (for-each (lambda (file)
828 (string-append flib "/" (basename file))))
829 (find-files lib ".*fortran.*"))
830 (for-each (lambda (file)
832 (string-append finc "/" (basename file))))
833 (find-files inc ".*mod"))
834 (for-each (lambda (file)
836 (string-append fex "/" (basename file))))
837 (find-files ex ".*"))
838 (delete-file-recursively ex))
840 (home-page "http://www.hdfgroup.org")
841 (synopsis "Management suite for extremely large and complex data")
842 (description "HDF5 is a suite that makes possible the management of
843 extremely large and complex data collections.")
844 (license (license:x11-style
845 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
847 (define-public hdf-java
855 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
856 version "/src/CMake-hdfjava-" version ".tar.gz"))
858 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
859 (modules '((guix build utils)))
860 (snippet ; Make sure we don't use the bundled sources and binaries.
862 (for-each delete-file
863 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
864 "HDF4.tar.gz" "HDF5.tar.gz"))
865 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
867 (build-system gnu-build-system)
869 `(("jdk" ,icedtea "jdk")
870 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
872 ("hamcrest-core" ,java-hamcrest-core)
873 ("junit" ,java-junit)
874 ("slf4j-simple" ,java-slf4j-simple)))
880 ("slf4j-api" ,java-slf4j-api)))
883 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
884 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
885 (assoc-ref %build-inputs "jdk") "/lib" )
886 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
887 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
890 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
891 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
892 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
893 (string-append "JPEGLIB="
894 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
898 (modify-phases %standard-phases
899 (add-before 'configure 'chdir-to-source
900 (lambda _ (chdir ,(string-append "hdfjava-" version))))
901 (add-before 'configure 'patch-build
902 (lambda* (#:key inputs outputs #:allow-other-keys)
903 (substitute* "configure"
904 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
905 (("/bin/cat") (which "cat")))
906 ;; Set classpath for compilation
907 (substitute* '("hdf/hdf5lib/Makefile.in"
908 "hdf/hdf5lib/exceptions/Makefile.in"
909 "hdf/hdflib/Makefile.in")
910 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
911 (string-append (assoc-ref inputs "slf4j-api")
912 "/share/java/slf4j-api.jar")))
913 ;; Replace outdated config.sub and config.guess:
914 (with-directory-excursion "config"
915 (for-each (lambda (file)
917 (string-append (assoc-ref inputs "automake")
918 "/share/automake-1.15/" file) file))
919 '("config.sub" "config.guess")))
920 (mkdir-p (string-append (assoc-ref outputs "out")))
921 ;; Set classpath for tests
922 (let* ((build-dir (getcwd))
923 (lib (string-append build-dir "/lib"))
924 (jhdf (string-append lib "/jhdf.jar"))
925 (jhdf5 (string-append lib "/jhdf5.jar"))
928 (string-append (assoc-ref inputs i)
929 "/share/java/" i ".jar"))
930 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
932 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
934 (substitute* '("test/hdf5lib/Makefile.in"
935 "test/hdf5lib/junit.sh.in"
936 "examples/runExample.sh.in")
938 (string-append (assoc-ref inputs "coreutils")
941 (string-append (assoc-ref inputs "coreutils")
943 (("CLASSPATH=[^\n]*")
944 (string-append "CLASSPATH=" class-path)))
945 (setenv "CLASSPATH" class-path))
947 (add-before 'check 'build-examples
949 (zero? (apply system* `("javac"
950 ,@(find-files "examples" ".*\\.java")))))))
954 #:parallel-tests? #f ))
955 (home-page "https://support.hdfgroup.org/products/java")
956 (synopsis "Java interface for the HDF4 and HDF5 libraries")
957 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
958 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
961 ;; BSD-style license:
962 (license (license:x11-style
963 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
964 /current/src/unpacked/COPYING"))))
966 (define-public hdf-eos2
973 (uri "ftp://edhs1.gsfc.nasa.gov\
974 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
976 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
977 (patches (search-patches "hdf-eos2-remove-gctp.patch"
978 "hdf-eos2-build-shared.patch"
979 "hdf-eos2-fortrantests.patch"))))
980 (build-system gnu-build-system)
982 `(("gfortran" ,gfortran)))
984 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
989 `( #:configure-flags '("--enable-install-include" "--enable-shared"
990 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
991 #:parallel-tests? #f))
992 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
993 (synopsis "HDF4-based data format for NASA's Earth Observing System")
994 (description "HDF-EOS2 is a software library built on HDF4 which supports
995 the construction of data structures used in NASA's Earth Observing
996 System (Grid, Point and Swath).")
998 ;; Source files carry a permissive license header.
999 (license (license:non-copyleft home-page))))
1001 (define-public hdf-eos5
1007 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1008 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1011 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1012 (patches (search-patches "hdf-eos5-build-shared.patch"
1013 "hdf-eos5-remove-gctp.patch"
1014 "hdf-eos5-fix-szip.patch"
1015 "hdf-eos5-fortrantests.patch"))))
1017 `(("gfortran" ,gfortran)))
1018 (build-system gnu-build-system)
1024 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1025 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1026 #:parallel-tests? #f))
1027 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1029 "HDF-EOS5 is a software library built on HDF5 to support the construction
1030 of data structures used in NASA's Earth Observing System (Grid, Point and
1032 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1034 ;; Source files carry a permissive license header.
1035 (license (license:non-copyleft home-page))))
1037 (define-public hdf5-parallel-openmpi
1038 (package (inherit hdf5)
1039 (name "hdf5-parallel-openmpi")
1042 ,@(package-inputs hdf5)))
1044 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1045 ,@(package-arguments hdf5))
1047 `(modify-phases ,phases
1048 (add-before 'check 'patch-tests
1050 ;; OpenMPI's mpirun will exit with non-zero status if it
1051 ;; detects an "abnormal termination", i.e. any process not
1052 ;; calling MPI_Finalize(). Since the test is explicitely
1053 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1054 ;; H5C_flush_cache from being called, mpirun will always
1055 ;; complain, so turn this test off.
1056 (substitute* "testpar/Makefile"
1057 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1058 (string-append front back "\n")))
1059 (substitute* "tools/h5diff/testph5diff.sh"
1060 (("/bin/sh") (which "sh")))
1062 (synopsis "Management suite for data with parallel IO support")))
1064 (define-public h5check
1071 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1072 "h5check/src/h5check-" version ".tar.gz"))
1075 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1076 (build-system gnu-build-system)
1077 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1078 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1079 (synopsis "HDF5 format checker")
1080 (description "@code{h5check} is a validation tool for verifying that an
1081 HDF5 file is encoded according to the HDF File Format Specification.")
1082 (license (license:x11-style "file://COPYING"))))
1090 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1095 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1096 (build-system cmake-build-system)
1097 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1098 (inputs `(("lapack" ,lapack)
1100 ;; FIXME: Even though the fonts are available dvips complains:
1101 ;; "Font cmmi10 not found; characters will be left blank."
1103 `(("texlive" ,texlive-tiny)
1104 ("ghostscript" ,ghostscript)
1105 ("doxygen" ,doxygen)))
1106 (home-page "http://itpp.sourceforge.net")
1107 (synopsis "C++ library of maths, signal processing and communication classes")
1108 (description "IT++ is a C++ library of mathematical, signal processing and
1109 communication classes and functions. Its main use is in simulation of
1110 communication systems and for performing research in the area of
1111 communications. The kernel of the library consists of generic vector and
1112 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1113 similar to MATLAB, GNU Octave or SciPy.")
1114 (license license:gpl3+)))
1116 (define-public netcdf
1123 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1124 "netcdf-" version ".tar.gz"))
1127 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1128 (patches (search-patches "netcdf-date-time.patch"
1129 "netcdf-tst_h_par.patch"))))
1130 (build-system gnu-build-system)
1133 ("doxygen" ,doxygen)
1134 ("graphviz" ,graphviz)))
1136 `(("hdf4" ,hdf4-alt)
1139 ("libjpeg" ,libjpeg)))
1141 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1143 #:phases (modify-phases %standard-phases
1144 (add-before 'configure 'fix-source-date
1146 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1147 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1148 ;; to '1st hour of the current day', and therefore makes the
1149 ;; package not reproducible.
1150 (substitute* "./configure"
1151 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1152 "date --date='@0'"))
1154 (add-after 'configure 'patch-settings
1156 ;; libnetcdf.settings contains the full filename of the compilers
1157 ;; used to build the library. We truncate the hashes of those
1158 ;; filenames to avoid unnecessary references to the corresponding
1160 (substitute* "libnetcdf.settings"
1161 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1162 (string-append prefix (string-take hash 10) "...")))
1165 #:parallel-tests? #f)) ;various race conditions
1166 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1167 (synopsis "Library for scientific data")
1168 (description "NetCDF is an interface for scientific data access and a
1169 software library that provides an implementation of the interface. The netCDF
1170 library defines a machine-independent format for representing scientific data.
1171 Together, the interface, library, and format support the creation, access, and
1172 sharing of scientific data.")
1173 (license (license:x11-style "file://COPYRIGHT"))))
1175 (define-public netcdf-parallel-openmpi
1176 (package (inherit netcdf)
1177 (name "netcdf-parallel-openmpi")
1180 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1181 (package-inputs netcdf))))
1182 ;; TODO: Replace pkg-config references in nc-config with absolute references
1184 (substitute-keyword-arguments (package-arguments netcdf)
1185 ((#:configure-flags flags)
1186 `(cons* "CC=mpicc" "CXX=mpicxx"
1187 "--enable-parallel-tests"
1188 ;; Shared libraries not supported with parallel IO.
1189 "--disable-shared" "--with-pic"
1192 (define-public netcdf-fortran
1194 (name "netcdf-fortran")
1199 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1203 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1204 (build-system gnu-build-system)
1206 `(#:parallel-tests? #f))
1208 `(("netcdf" ,netcdf)))
1210 `(("gfortran" ,gfortran)))
1211 (synopsis "Fortran interface for the netCDF library")
1212 (description (package-description netcdf))
1213 (home-page (package-home-page netcdf))
1214 (license (package-license netcdf))))
1216 (define-public nlopt
1222 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1225 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1226 (build-system gnu-build-system)
1228 `(;; Shared libraries are not built by default. They are required to
1229 ;; build the Guile, Octave, and Python bindings.
1230 #:configure-flags '("--enable-shared")
1233 (modify-phases %standard-phases
1234 (add-before 'configure 'set-libnlopt-file-name
1235 (lambda* (#:key outputs #:allow-other-keys)
1236 ;; Make sure the Scheme module refers to the library by its
1237 ;; absolute file name (we cannot do that from a snippet
1238 ;; because the expansion of @libdir@ contains
1240 (let ((out (assoc-ref outputs "out")))
1241 (substitute* "swig/nlopt.scm.in"
1243 (string-append out "/lib/libnlopt")))
1245 (inputs `(("guile" ,guile-2.0)))
1246 (native-inputs `(("pkg-config" ,pkg-config)))
1247 (home-page "http://ab-initio.mit.edu/wiki/")
1248 (synopsis "Library for nonlinear optimization")
1249 (description "NLopt is a library for nonlinear optimization, providing a
1250 common interface for a number of different free optimization routines available
1251 online as well as original implementations of various other algorithms.")
1252 (license license:lgpl2.1+)))
1254 (define-public ipopt
1261 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1265 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1266 (modules '((guix build utils)))
1268 ;; Make sure we don't use the bundled software.
1270 (delete-file-recursively "ThirdParty")
1272 (build-system gnu-build-system)
1274 '(#:phases (modify-phases %standard-phases
1275 (add-after 'install 'add--L-flags-in-ipopt.pc
1276 (lambda* (#:key inputs outputs #:allow-other-keys)
1277 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1278 ;; move it to "Libs.private" where it belongs, and add a
1279 ;; '-L' flag for LAPACK.
1280 (let ((out (assoc-ref outputs "out"))
1281 (lapack (assoc-ref inputs "lapack")))
1282 (substitute* (string-append out "/lib/pkgconfig/"
1284 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1285 (string-append "Libs: " before " " after "\n"
1286 "Libs.private: " before
1287 "-L" lapack "/lib -llapack -lblas "
1291 `(("gfortran" ,gfortran)))
1293 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1294 `(("lapack" ,lapack))) ;for both libblas and liblapack
1295 (home-page "http://www.coin-or.org")
1296 (synopsis "Large-scale nonlinear optimizer")
1298 "The Interior Point Optimizer (IPOPT) is a software package for
1299 large-scale nonlinear optimization. It provides C++, C, and Fortran
1301 (license license:epl1.0)))
1303 (define-public ceres
1305 (name "ceres-solver")
1307 (home-page "http://ceres-solver.org/")
1310 (uri (string-append home-page "ceres-solver-"
1314 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1315 (build-system cmake-build-system)
1317 ;; TODO: Build HTML user documentation and install separately.
1318 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1319 "-DBUILD_SHARED_LIBS=ON")
1321 #:phases (modify-phases %standard-phases
1322 (add-before 'configure 'set-library-directory
1324 ;; Install libraries to lib/, not lib64/.
1325 (substitute* "internal/ceres/CMakeLists.txt"
1326 (("set\\(LIB_SUFFIX \"64\"\\)")
1327 "set(LIB_SUFFIX \"\")"))
1330 `(("pkg-config" ,pkg-config)))
1332 `(("glog" ,glog))) ;for #include <glog/glog.h>
1337 ("suitesparse" ,suitesparse)
1338 ("gflags" ,gflags)))
1339 (synopsis "C++ library for solving large optimization problems")
1341 "Ceres Solver is a C++ library for modeling and solving large,
1342 complicated optimization problems. It is a feature rich, mature and
1343 performant library which has been used in production since 2010. Ceres Solver
1344 can solve two kinds of problems:
1346 @item non-linear least squares problems with bounds constraints;
1347 @item general unconstrained optimization problems.
1349 (license license:bsd-3)))
1351 ;; For a fully featured Octave, users are strongly recommended also to install
1352 ;; the following packages: less, ghostscript, gnuplot.
1353 (define-public octave
1360 (uri (string-append "mirror://gnu/octave/octave-"
1364 "0jsdgizlv02an2ppfjwk5qf209zpwi3317yb7jvlsjzxnir3lvhy"))))
1365 (build-system gnu-build-system)
1367 `(("lapack" ,lapack)
1369 ("readline" ,readline)
1374 ("arpack" ,arpack-ng)
1377 ("fontconfig" ,fontconfig)
1378 ("freetype" ,freetype)
1385 ("texinfo" ,texinfo)
1386 ("graphicsmagick" ,graphicsmagick)
1387 ("suitesparse" ,suitesparse)
1388 ("libsndfile" ,libsndfile)
1389 ("portaudio" ,portaudio)
1390 ("alsa-lib" ,alsa-lib)))
1393 ("gfortran" ,gfortran)
1394 ("pkg-config" ,pkg-config)
1396 ;; The following inputs are not actually used in the build process.
1397 ;; However, the ./configure gratuitously tests for their existence and
1398 ;; assumes that programs not present at build time are also not, and
1399 ;; can never be, available at run time! If these inputs are therefore
1400 ;; not present, support for them will be built out. However, Octave
1401 ;; will still run without them, albeit without the features they
1404 ("ghostscript" ,ghostscript)
1405 ("gnuplot" ,gnuplot)))
1408 (list (string-append "--with-shell="
1409 (assoc-ref %build-inputs "bash")
1412 (modify-phases %standard-phases
1413 (add-after 'configure 'configure-makeinfo
1414 (lambda* (#:key inputs #:allow-other-keys)
1415 (substitute* "libinterp/corefcn/help.cc"
1416 (("Vmakeinfo_program = \"makeinfo\"")
1417 (string-append "Vmakeinfo_program = \""
1418 (assoc-ref inputs "texinfo")
1419 "/bin/makeinfo\"")))
1421 (home-page "https://www.gnu.org/software/octave/")
1422 (synopsis "High-level language for numerical computation")
1423 (description "GNU Octave is a high-level interpreted language that is
1424 specialized for numerical computations. It can be used for both linear and
1425 non-linear applications and it provides great support for visualizing results.
1426 Work may be performed both at the interactive command-line as well as via
1428 (license license:gpl3+)))
1430 (define-public qtoctave
1431 (package (inherit octave)
1434 (inherit (package-source octave))))
1436 `(("qscintilla" ,qscintilla)
1438 ,@(package-inputs octave)))
1440 `(("qttools" , qttools) ;for lrelease
1441 ("texlive" ,texlive) ;for texi2dvi
1442 ,@(package-native-inputs octave)))
1444 (substitute-keyword-arguments (package-arguments octave)
1446 `(modify-phases ,phases
1447 (add-before 'configure 'patch-qscintilla-library-name
1448 (lambda* (#:key inputs #:allow-other-keys)
1449 ;; The QScintilla library that the Octave configure script tries
1450 ;; to link with should be named libqscintilla-qt5.so, but the
1451 ;; QScintilla input provides the shared library as
1452 ;; libqscintilla2_qt5.so.
1453 (substitute* "configure"
1454 (("qscintilla2-qt5")
1458 (define-public opencascade-oce
1460 (name "opencascade-oce")
1466 "https://github.com/tpaviot/oce/archive/OCE-"
1469 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1472 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1473 (build-system cmake-build-system)
1476 (list "-DOCE_TESTING:BOOL=ON"
1477 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1478 "-DOCE_DRAW:BOOL=ON"
1479 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1480 (assoc-ref %outputs "out"))
1481 "-UCMAKE_INSTALL_RPATH")))
1483 `(("freetype" ,freetype)
1490 `(("python" ,python-wrapper)))
1491 (home-page "https://github.com/tpaviot/oce")
1492 (synopsis "Libraries for 3D modeling and numerical simulation")
1494 "Open CASCADE is a set of libraries for the development of applications
1495 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1496 C++ class libraries providing services for 3D surface and solid modeling, CAD
1497 data exchange, and visualization. It is used for development of specialized
1498 software dealing with 3D models in design (CAD), manufacturing (CAM),
1499 numerical simulation (CAE), measurement equipment (CMM), and quality
1500 control (CAQ) domains.
1502 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1503 patches, improvements, and experiments contributed by users over the official
1504 Open CASCADE library.")
1505 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1506 ; use of header files; see
1507 ; OCCT_LGPL_EXCEPTION.txt
1508 license:public-domain; files
1509 ; src/Standard/Standard_StdAllocator.hxx and
1510 ; src/NCollection/NCollection_StdAllocator.hxx
1511 license:expat; file src/OpenGl/OpenGl_glext.h
1512 license:bsd-3)))); test framework gtest
1521 (uri (string-append "http://gmsh.info/src/gmsh-"
1522 version "-source.tgz"))
1524 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1525 (modules '((guix build utils)))
1527 ;; Remove non-free METIS code
1529 (delete-file-recursively "contrib/Metis")
1531 (build-system cmake-build-system)
1534 ("gfortran" ,gfortran)
1540 ("opencascade-oce" ,opencascade-oce)
1542 ("libxext" ,libxext)))
1544 `(("fontconfig" ,fontconfig)
1545 ("libxft" ,libxft)))
1547 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1548 "-DENABLE_BUILD_SHARED:BOOL=ON"
1549 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1550 (home-page "http://www.geuz.org/gmsh/")
1551 (synopsis "3D finite element grid generator")
1552 (description "Gmsh is a 3D finite element grid generator with a built-in
1553 CAD engine and post-processor. Its design goal is to provide a fast, light
1554 and user-friendly meshing tool with parametric input and advanced
1555 visualization capabilities. Gmsh is built around four modules: geometry,
1556 mesh, solver and post-processing. The specification of any input to these
1557 modules is done either interactively using the graphical user interface or in
1558 ASCII text files using Gmsh's own scripting language.")
1559 (license license:gpl2+)))
1561 (define-public maxflow
1568 (url "https://github.com/gerddie/maxflow.git")
1569 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1570 (file-name (string-append name "-" version "-checkout"))
1573 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1574 (build-system cmake-build-system)
1575 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1576 (synopsis "Library implementing Maxflow algorithm")
1577 (description "An implementation of the maxflow algorithm described in
1578 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1579 Energy Minimization in Computer Vision.\n
1580 Yuri Boykov and Vladimir Kolmogorov.\n
1581 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1583 (license license:gpl3+)))
1585 (define-public petsc
1592 ;; The *-lite-* tarball does not contain the *large* documentation
1593 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1594 "petsc-lite-" version ".tar.gz"))
1596 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1597 (build-system gnu-build-system)
1599 `(("python" ,python-2)))
1601 `(("gfortran" ,gfortran)
1603 ("superlu" ,superlu)
1604 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1605 ;; leaving out opengl, as configuration seems to only be for mac
1608 `(#:test-target "test"
1609 #:parallel-build? #f ;build is parallel by default
1614 ,(string-append "--with-superlu-include="
1615 (assoc-ref %build-inputs "superlu") "/include")
1616 ,(string-append "--with-superlu-lib="
1617 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1619 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1620 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1621 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1623 (modify-phases %standard-phases
1625 ;; PETSc's configure script is actually a python script, so we can't
1626 ;; run it with bash.
1627 (lambda* (#:key outputs (configure-flags '())
1629 (let* ((prefix (assoc-ref outputs "out"))
1630 (flags `(,(string-append "--prefix=" prefix)
1631 ,@configure-flags)))
1632 (format #t "build directory: ~s~%" (getcwd))
1633 (format #t "configure flags: ~s~%" flags)
1634 (apply invoke "./configure" flags))))
1635 (add-after 'configure 'clean-local-references
1636 (lambda* (#:key outputs #:allow-other-keys)
1637 (let ((out (assoc-ref outputs "out")))
1638 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1639 ;; Prevent build directory from leaking into compiled code
1641 ;; Scrub timestamp for reproducibility
1642 ((".*Libraries compiled on.*") ""))
1643 (substitute* (find-files "." "petscvariables")
1644 ;; Do not expose build machine characteristics, set to defaults.
1645 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1646 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1648 (add-after 'install 'clean-install
1649 ;; Try to keep installed files from leaking build directory names.
1650 (lambda* (#:key inputs outputs #:allow-other-keys)
1651 (let ((out (assoc-ref outputs "out")))
1652 (substitute* (map (lambda (file)
1653 (string-append out "/lib/petsc/conf/" file))
1654 '("petscvariables"))
1656 ;; Make compiler references point to the store
1657 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1658 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1659 (string-append "= " (which compiler))))
1660 ;; PETSc installs some build logs, which aren't necessary.
1661 (for-each (lambda (file)
1662 (let ((f (string-append out "/lib/petsc/conf/" file)))
1663 (when (file-exists? f)
1665 '("configure.log" "make.log" "gmake.log"
1666 "test.log" "error.log" "RDict.db"
1667 "PETScBuildInternal.cmake"
1668 ;; Once installed, should uninstall with Guix
1671 (home-page "http://www.mcs.anl.gov/petsc")
1672 (synopsis "Library to solve PDEs")
1673 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1674 data structures and routines for the scalable (parallel) solution of
1675 scientific applications modeled by partial differential equations.")
1676 (license (license:non-copyleft
1677 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1679 (define-public petsc-complex
1680 (package (inherit petsc)
1681 (name "petsc-complex")
1683 (substitute-keyword-arguments (package-arguments petsc)
1684 ((#:configure-flags cf)
1685 `(cons "--with-scalar-type=complex" ,cf))))
1686 (synopsis "Library to solve PDEs (with complex scalars)")))
1688 (define-public petsc-openmpi
1689 (package (inherit petsc)
1690 (name "petsc-openmpi")
1692 `(("openmpi" ,openmpi)
1693 ,@(package-inputs petsc)))
1695 (substitute-keyword-arguments (package-arguments petsc)
1696 ((#:configure-flags cf)
1697 ``("--with-mpiexec=mpirun"
1698 ,(string-append "--with-mpi-dir="
1699 (assoc-ref %build-inputs "openmpi"))
1700 ,@(delete "--with-mpi=0" ,cf)))))
1701 (synopsis "Library to solve PDEs (with MPI support)")))
1703 (define-public petsc-complex-openmpi
1704 (package (inherit petsc-complex)
1705 (name "petsc-complex-openmpi")
1707 `(("openmpi" ,openmpi)
1708 ,@(package-inputs petsc-complex)))
1710 (substitute-keyword-arguments (package-arguments petsc-complex)
1711 ((#:configure-flags cf)
1712 ``("--with-mpiexec=mpirun"
1713 ,(string-append "--with-mpi-dir="
1714 (assoc-ref %build-inputs "openmpi"))
1715 ,@(delete "--with-mpi=0" ,cf)))))
1716 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1719 (define-public python-kiwisolver
1721 (name "python-kiwisolver")
1725 (uri (pypi-uri "kiwisolver" version))
1728 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1729 (build-system python-build-system)
1730 (home-page "https://github.com/nucleic/kiwi")
1731 (synopsis "Fast implementation of the Cassowary constraint solver")
1733 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1734 solving algorithm. Kiwi has been designed from the ground up to be
1735 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1736 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1737 savings are consistently > 5x.")
1738 (license license:bsd-3)))
1740 (define-public python2-kiwisolver
1741 (package-with-python2 python-kiwisolver))
1743 (define-public slepc
1750 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1754 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1755 (build-system gnu-build-system)
1757 `(("python" ,python-2)))
1759 `(("arpack" ,arpack-ng)
1760 ("gfortran" ,gfortran)))
1762 `(("petsc" ,petsc)))
1764 `(#:parallel-build? #f ;build is parallel by default
1766 `(,(string-append "--with-arpack-dir="
1767 (assoc-ref %build-inputs "arpack") "/lib"))
1768 #:make-flags ;honor (parallel-job-count)
1769 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1771 (modify-phases %standard-phases
1773 ;; configure is a python script, so we can't run it with bash.
1774 (lambda* (#:key inputs outputs (configure-flags '())
1776 (let* ((prefix (assoc-ref outputs "out"))
1777 (flags `(,(string-append "--prefix=" prefix)
1778 ,@configure-flags)))
1779 (format #t "build directory: ~s~%" (getcwd))
1780 (format #t "configure flags: ~s~%" flags)
1781 (setenv "SLEPC_DIR" (getcwd))
1782 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1783 (apply invoke "./configure" flags))))
1784 (add-after 'install 'delete-doc
1785 ;; TODO: SLEPc installs HTML documentation alongside headers in
1786 ;; $out/include. We'd like to move them to share/doc, but delete
1787 ;; them for now, as they are incomplete and installing the complete
1788 ;; documentation is difficult.
1789 (lambda* (#:key outputs #:allow-other-keys)
1790 (let* ((out (assoc-ref outputs "out")))
1791 (for-each delete-file (find-files out "\\.html$"))
1793 (add-after 'install 'clean-install
1794 ;; Clean up unnecessary build logs from installation.
1795 (lambda* (#:key outputs #:allow-other-keys)
1796 (let ((out (assoc-ref outputs "out")))
1797 (for-each (lambda (file)
1798 (let ((f (string-append out "/lib/slepc/conf/" file)))
1799 (when (file-exists? f)
1801 '("configure.log" "make.log" "gmake.log"
1802 "test.log" "error.log" "RDict.db"
1805 (home-page "http://slepc.upv.es")
1806 (synopsis "Scalable library for eigenproblems")
1807 (description "SLEPc is a software library for the solution of large sparse
1808 eigenproblems on parallel computers. It can be used for the solution of
1809 linear eigenvalue problems formulated in either standard or generalized form,
1810 as well as other related problems such as the singular value decomposition.
1811 The emphasis of the software is on methods and techniques appropriate for
1812 problems in which the associated matrices are sparse, for example, those
1813 arising after the discretization of partial differential equations.")
1814 (license license:bsd-2)))
1816 (define-public slepc-complex
1817 (package (inherit slepc)
1818 (name "slepc-complex")
1820 `(("petsc" ,petsc-complex)
1821 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1822 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1824 (define-public slepc-openmpi
1825 (package (inherit slepc)
1826 (name "slepc-openmpi")
1828 (substitute-keyword-arguments (package-arguments slepc)
1829 ((#:phases phases '%standard-phases)
1830 `(modify-phases ,phases
1831 (add-before 'check 'set-test-environment
1833 ;; By default, running the test suite would fail because 'ssh'
1834 ;; could not be found in $PATH. Define this variable to
1835 ;; placate Open MPI without adding a dependency on OpenSSH (the
1836 ;; agent isn't used anyway.)
1837 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
1841 ("arpack" ,arpack-ng-openmpi)
1842 ,@(alist-delete "arpack" (package-inputs slepc))))
1844 `(("petsc" ,petsc-openmpi)
1845 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1846 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1848 (define-public slepc-complex-openmpi
1849 (package (inherit slepc-openmpi)
1850 (name "slepc-complex-openmpi")
1852 `(("petsc" ,petsc-complex-openmpi)
1853 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1854 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1856 (define-public mumps
1863 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1867 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
1868 (patches (search-patches "mumps-build-parallelism.patch"))))
1869 (build-system gnu-build-system)
1871 `(("fortran" ,gfortran)
1872 ;; These are required for linking against mumps, but we let the user
1873 ;; declare the dependency.
1876 ("scotch" ,scotch)))
1878 `(#:modules ((ice-9 match)
1881 ,@%gnu-build-system-modules)
1883 (modify-phases %standard-phases
1885 (lambda* (#:key inputs #:allow-other-keys)
1886 (call-with-output-file "Makefile.inc"
1897 INCSEQ = -I$(topdir)/libseq
1898 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1899 LIBSEQNEEDED = libseqneeded~;
1903 AR = ar vr # rules require trailing space, ugh...
1905 LIBBLAS = -L~a -lopenblas~@[
1906 SCALAP = -L~a -lscalapack~]
1907 LIBOTHERS = -pthread
1910 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1914 LIBS = $(SCALAP) $(LIBSEQ)
1915 LPORDDIR = $(topdir)/PORD/lib
1916 IPORD = -I$(topdir)/PORD/include
1917 LPORD = -L$(LPORDDIR) -lpord
1918 ORDERINGSF = -Dpord~@[
1920 IMETIS = -I$(METISDIR)/include
1921 LMETIS = -L$(METISDIR)/lib -lmetis
1922 ORDERINGSF += -Dmetis~]~@[~:{
1924 ISCOTCH = -I$(SCOTCHDIR)/include
1925 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1926 ORDERINGSF += ~a~}~]
1927 ORDERINGSC = $(ORDERINGSF)
1928 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1929 IORDERINGSF = $(ISCOTCH)
1930 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1931 (assoc-ref inputs "mpi")
1932 (assoc-ref inputs "blas")
1933 (assoc-ref inputs "scalapack")
1934 (assoc-ref inputs "metis")
1935 (match (list (assoc-ref inputs "pt-scotch")
1936 (assoc-ref inputs "scotch"))
1940 `((,scotch "" "-Dscotch")))
1943 "-lptesmumps -lptscotch -lptscotcherr "
1944 "-Dptscotch")))))))))
1946 ;; By default only the d-precision library is built. Make with "all"
1947 ;; target so that all precision libraries and examples are built.
1949 (invoke "make" "all"
1950 (format #f "-j~a" (parallel-job-count)))))
1952 ;; Run the simple test drivers, which read test input from stdin:
1953 ;; from the "real" input for the single- and double-precision
1954 ;; testers, and from the "cmplx" input for complex-precision
1955 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1956 ;; package to prefix execution with "mpirun".
1957 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1958 (with-directory-excursion "examples"
1961 (let ((tester (apply open-pipe*
1964 ,(string-append "./" prec
1966 (input (open-input-file
1967 (string-append "input_simpletest_" type))))
1969 (dump-port input tester)
1971 (zero? (close-pipe tester)))))
1973 '("real" "real" "cmplx" "cmplx")))))
1975 (lambda* (#:key outputs #:allow-other-keys)
1976 (let* ((out (assoc-ref outputs "out"))
1977 (libdir (string-append out "/lib")))
1978 (copy-recursively "lib" libdir)
1979 (copy-recursively "include" (string-append out "/include"))
1980 (when (file-exists? "libseq/libmpiseq.a")
1981 (install-file "libseq/libmpiseq.a" libdir))
1983 (home-page "http://mumps.enseeiht.fr")
1984 (synopsis "Multifrontal sparse direct solver")
1986 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1987 sparse system of linear equations A x = b using Guassian elimination.")
1988 (license license:cecill-c)))
1990 (define-public mumps-metis
1991 (package (inherit mumps)
1992 (name "mumps-metis")
1994 (alist-delete "scotch" (package-inputs mumps)))))
1996 (define-public mumps-openmpi
1997 (package (inherit mumps)
1998 (name "mumps-openmpi")
2001 ("scalapack" ,scalapack)
2002 ("pt-scotch" ,pt-scotch)
2003 ,@(alist-delete "scotch" (package-inputs mumps))))
2005 (substitute-keyword-arguments (package-arguments mumps)
2007 `(modify-phases ,phases
2008 (add-before 'check 'set-test-environment
2010 ;; By default, running the test suite would fail because 'ssh'
2011 ;; could not be found in $PATH. Define this variable to
2012 ;; placate Open MPI without adding a dependency on OpenSSH (the
2013 ;; agent isn't used anyway.)
2014 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2018 ((assoc-ref ,phases 'check)
2019 #:exec-prefix '("mpirun" "-n" "2"))))))))
2020 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2022 (define-public mumps-metis-openmpi
2023 (package (inherit mumps-openmpi)
2024 (name "mumps-metis-openmpi")
2026 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2028 (define-public r-quadprog
2035 (uri (cran-uri "quadprog" version))
2038 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2039 (build-system r-build-system)
2041 `(("gfortran" ,gfortran)))
2042 (home-page "https://cran.r-project.org/web/packages/quadprog")
2043 (synopsis "Functions to solve quadratic programming problems")
2045 "This package contains routines and documentation for solving quadratic
2046 programming problems.")
2047 (license license:gpl3+)))
2049 (define-public r-pracma
2055 (uri (cran-uri "pracma" version))
2057 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
2058 (build-system r-build-system)
2060 `(("r-quadprog" ,r-quadprog)))
2061 (home-page "https://cran.r-project.org/web/packages/pracma")
2062 (synopsis "Practical numerical math functions")
2063 (description "This package provides functions for numerical analysis and
2064 linear algebra, numerical optimization, differential equations, plus some
2065 special functions. It uses Matlab function names where appropriate to simplify
2067 (license license:gpl3+)))
2069 (define-public ruby-asciimath
2071 (name "ruby-asciimath")
2076 (uri (rubygems-uri "asciimath" version))
2079 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2080 (build-system ruby-build-system)
2083 (modify-phases %standard-phases
2085 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2086 (add-after 'unpack 'patch-remove-spurious-backslashes
2088 (substitute* "spec/parser_spec.rb"
2092 `(("bundler" ,bundler)
2093 ("ruby-rspec" ,ruby-rspec)))
2094 (synopsis "AsciiMath parsing and conversion library")
2096 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2097 easy-to-write markup language for mathematics.")
2098 (home-page "https://github.com/asciidoctor/asciimath")
2099 (license license:expat)))
2101 (define-public superlu
2108 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2109 "superlu_" version ".tar.gz"))
2111 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2112 (modules '((guix build utils)))
2114 ;; Replace the non-free implementation of MC64 with a stub adapted
2117 (use-modules (ice-9 regex)
2119 (call-with-output-file "SRC/mc64ad.c"
2124 void mc64id_(int *a) {
2125 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2128 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2129 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2130 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2133 ;; Remove the corresponding license verbiage. MC64 license follows
2134 ;; a "------" line separator.
2135 (with-atomic-file-replacement "License.txt"
2136 (let ((rx (make-regexp "-{8}")))
2139 (let ((line (read-line in 'concat)))
2140 (unless (regexp-exec rx line)
2144 (build-system cmake-build-system)
2148 `(("blas" ,openblas)
2149 ("gfortran" ,gfortran)))
2151 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2152 "-DTPL_BLAS_LIBRARIES=openblas"
2153 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2154 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2155 (synopsis "Supernodal direct solver for sparse linear systems")
2157 "SuperLU is a general purpose library for the direct solution of large,
2158 sparse, nonsymmetric systems of linear equations on high performance machines.
2159 The library is written in C and is callable from either C or Fortran. The
2160 library routines perform an LU decomposition with partial pivoting and
2161 triangular system solves through forward and back substitution. The library
2162 also provides threshold-based ILU factorization preconditioners.")
2163 (license (list license:bsd-3
2164 license:gpl2+ ;EXAMPLE/*fgmr.c
2165 (license:fsf-free "file://SRC/colamd.h")))))
2167 (define-public superlu-dist
2169 (name "superlu-dist")
2174 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2175 "superlu_dist_" version ".tar.gz"))
2177 (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
2178 (modules '((guix build utils)))
2180 ;; Replace the non-free implementation of MC64 with a stub
2182 (use-modules (ice-9 regex)
2184 (call-with-output-file "SRC/mc64ad_dist.c"
2189 void mc64id_dist(int *a) {
2190 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2193 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2194 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2195 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2198 (substitute* "SRC/util.c" ;adjust default algorithm
2199 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2200 "RowPerm = NOROWPERM"))
2202 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2203 (build-system gnu-build-system)
2207 `(("gfortran" ,gfortran)))
2209 `(("openmpi" ,openmpi) ;headers include MPI heades
2210 ("lapack" ,lapack) ;required to link with output library
2211 ("pt-scotch" ,pt-scotch))) ;same
2213 `(#:parallel-build? #f ;race conditions using ar
2215 (modify-phases %standard-phases
2217 (lambda* (#:key inputs outputs #:allow-other-keys)
2218 (call-with-output-file "make.inc"
2223 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2224 BLASDEF = -DUSE_VENDOR_BLAS
2225 BLASLIB = -L~a/lib -lblas
2226 PARMETISLIB = -L~a/lib \
2227 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2228 -lscotch -lscotcherr -lscotcherrexit
2229 METISLIB = -L~:*~a/lib \
2230 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2231 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2237 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2238 NOOPTS = -O0 -g $(PIC)
2240 FFLAGS = -O2 -g $(PIC)
2244 (assoc-ref outputs "out")
2245 (assoc-ref inputs "lapack")
2246 (assoc-ref inputs "pt-scotch"))))
2248 (add-after 'unpack 'remove-broken-symlinks
2250 (for-each delete-file
2251 (find-files "MAKE_INC" "\\.#make\\..*"))
2253 (add-before 'build 'create-install-directories
2254 (lambda* (#:key outputs #:allow-other-keys)
2257 (mkdir-p (string-append (assoc-ref outputs "out")
2263 ;; By default, running the test suite would fail because 'ssh'
2264 ;; could not be found in $PATH. Define this variable to placate
2265 ;; Open MPI without adding a dependency on OpenSSH (the agent
2266 ;; isn't used anyway.)
2267 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2268 (with-directory-excursion "EXAMPLE"
2269 (invoke "mpirun" "-n" "2"
2270 "./pddrive" "-r" "1" "-c" "2" "g20.rua")
2271 (invoke "mpirun" "-n" "2"
2272 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
2275 (lambda* (#:key outputs #:allow-other-keys)
2276 ;; Library is placed in lib during the build phase. Copy over
2277 ;; headers to include.
2278 (let* ((out (assoc-ref outputs "out"))
2279 (incdir (string-append out "/include")))
2280 (for-each (lambda (file)
2281 (let ((base (basename file)))
2282 (format #t "installing `~a' to `~a'~%"
2285 (string-append incdir "/" base))))
2286 (find-files "SRC" ".*\\.h$")))
2288 (home-page (package-home-page superlu))
2289 (synopsis "Parallel supernodal direct solver")
2291 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2292 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2293 implemented in ANSI C, and MPI for communications.")
2294 (license license:bsd-3)))
2296 (define-public scotch
2303 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2304 "latestfile/298/scotch_" version ".tar.gz"))
2306 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
2307 (patches (search-patches "scotch-test-threading.patch"
2308 "scotch-build-parallelism.patch"
2309 "scotch-graph-induce-type-64.patch"
2310 "scotch-graph-diam-64.patch"))))
2311 (build-system gnu-build-system)
2318 (modify-phases %standard-phases
2320 'unpack 'chdir-to-src
2321 (lambda _ (chdir "src") #t))
2325 (call-with-output-file "Makefile.inc"
2339 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2340 LDFLAGS = -lz -lm -lrt -lpthread
2342 LEX = flex -Pscotchyy -olex.yy.c
2347 YACC = bison -pscotchyy -y -b y
2349 '("COMMON_FILE_COMPRESS_GZ"
2351 "COMMON_RANDOM_FIXED_SEED"
2352 "INTSIZE64" ;use 'long' instead of 'int'
2353 ;; Prevents symbolc clashes with libesmumps
2355 ;; XXX: Causes invalid frees in superlu-dist tests
2357 ;; "SCOTCH_PTHREAD_NUMBER=2"
2358 "restrict=__restrict"))))
2361 'build 'build-esmumps
2363 ;; By default, running the test suite would fail because 'ssh'
2364 ;; could not be found in $PATH. Define this variable to placate
2365 ;; Open MPI without adding a dependency on OpenSSH (the agent
2366 ;; isn't used anyway.)
2367 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2370 (format #f "-j~a" (parallel-job-count))
2374 (lambda* (#:key outputs #:allow-other-keys)
2375 (let ((out (assoc-ref outputs "out")))
2378 (string-append "prefix=" out)
2380 ;; esmumps files are not installed with the above
2381 (for-each (lambda (f)
2382 (copy-file f (string-append out "/include/" f)))
2383 (find-files "../include" ".*esmumps.h$"))
2384 (for-each (lambda (f)
2385 (copy-file f (string-append out "/lib/" f)))
2386 (find-files "../lib" "^lib.*esmumps.*"))
2388 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2389 (synopsis "Programs and libraries for graph algorithms")
2390 (description "SCOTCH is a set of programs and libraries which implement
2391 the static mapping and sparse matrix reordering algorithms developed within
2392 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2393 conquer approach, to scientific computing problems such as graph and mesh
2394 partitioning, static mapping, and sparse matrix ordering, in application
2395 domains ranging from structural mechanics to operating systems or
2397 ;; See LICENSE_en.txt
2398 (license license:cecill-c)))
2400 (define-public scotch32
2401 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2402 ;; some applications.
2403 (package (inherit scotch)
2406 (substitute-keyword-arguments (package-arguments scotch)
2407 ((#:phases scotch-phases)
2408 `(modify-phases ,scotch-phases
2412 (call-with-output-file "Makefile.inc"
2426 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2427 LDFLAGS = -lz -lm -lrt -lpthread
2429 LEX = flex -Pscotchyy -olex.yy.c
2434 YACC = bison -pscotchyy -y -b y
2436 '("COMMON_FILE_COMPRESS_GZ"
2438 "COMMON_RANDOM_FIXED_SEED"
2439 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2440 ;; Prevents symbolc clashes with libesmumps
2442 ;; XXX: Causes invalid frees in superlu-dist tests
2444 ;; "SCOTCH_PTHREAD_NUMBER=2"
2445 "restrict=__restrict"))))))))))
2447 "Programs and libraries for graph algorithms (32-bit integers)")))
2449 (define-public pt-scotch
2450 (package (inherit scotch)
2453 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2455 (substitute-keyword-arguments (package-arguments scotch)
2456 ((#:phases scotch-phases)
2457 `(modify-phases ,scotch-phases
2462 (zero? (system* "make"
2463 (format #f "-j~a" (parallel-job-count))
2464 "ptscotch" "ptesmumps"))
2465 ;; Install the serial metis compatibility library
2466 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2469 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2470 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2472 (define-public pt-scotch32
2473 (package (inherit scotch32)
2474 (name "pt-scotch32")
2476 `(("openmpi" ,openmpi))) ;headers include MPI headers
2478 (substitute-keyword-arguments (package-arguments scotch32)
2479 ((#:phases scotch32-phases)
2480 `(modify-phases ,scotch32-phases
2484 (zero? (system* "make"
2485 (format #f "-j~a" (parallel-job-count))
2486 "ptscotch" "ptesmumps"))
2487 ;; Install the serial metis compatibility library
2488 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2491 (zero? (system* "make" "ptcheck"))))))))
2493 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2495 (define-public metis
2502 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2503 "metis-" version ".tar.gz"))
2506 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2507 (build-system cmake-build-system)
2509 `(("blas" ,openblas)))
2511 `(#:tests? #f ;no tests
2512 #:configure-flags `("-DSHARED=ON"
2513 ,(string-append "-DGKLIB_PATH=" (getcwd)
2514 "/metis-" ,version "/GKlib"))))
2515 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2516 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2518 "METIS is a set of serial programs for partitioning graphs, partitioning
2519 finite element meshes, and producing fill-reducing orderings for sparse
2520 matrices. The algorithms implemented in METIS are based on the multilevel
2521 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2523 (license license:asl2.0))) ;As of version 5.0.3
2525 (define-public p4est
2532 (uri (string-append "http://p4est.github.io/release/p4est-"
2536 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2537 (build-system gnu-build-system)
2539 `(("fortran" ,gfortran)
2544 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2545 (assoc-ref %build-inputs "blas")
2547 ,(string-append "LAPACK_LIBS=-L"
2548 (assoc-ref %build-inputs "lapack")
2550 #:phases (modify-phases %standard-phases
2551 (add-before 'check 'set-test-environment
2553 ;; By default, running the test suite would fail because
2554 ;; 'ssh' could not be found in $PATH. Define this
2555 ;; variable to placate Open MPI without adding a
2556 ;; dependency on OpenSSH (the agent isn't used anyway.)
2557 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2559 (home-page "http://www.p4est.org")
2560 (synopsis "Adaptive mesh refinement on forests of octrees")
2562 "The p4est software library enables the dynamic management of a
2563 collection of adaptive octrees, conveniently called a forest of octrees.
2564 p4est is designed to work in parallel and scales to hundreds of thousands of
2566 (license license:gpl2+)))
2568 (define-public p4est-openmpi
2569 (package (inherit p4est)
2570 (name "p4est-openmpi")
2573 ,@(package-inputs p4est)))
2575 (substitute-keyword-arguments (package-arguments p4est)
2576 ((#:configure-flags cf)
2577 ``("--enable-mpi" ,@,cf))))
2578 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2580 (define-public gsegrafix
2587 (uri (string-append "mirror://gnu/" name "/" name "-"
2591 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2592 (build-system gnu-build-system)
2594 `(#:configure-flags '("LDFLAGS=-lm")))
2596 `(("libgnomecanvas" ,libgnomecanvas)
2597 ("libbonoboui" ,libbonoboui)
2598 ("libgnomeui" ,libgnomeui)
2599 ("libgnomeprintui" ,libgnomeprintui)
2602 `(("pkg-config" ,pkg-config)))
2603 (home-page "https://www.gnu.org/software/gsegrafix/")
2604 (synopsis "GNOME application to create scientific and engineering plots")
2605 (description "GSEGrafix is an application which produces high-quality graphical
2606 plots for science and engineering. Plots are specified via simple ASCII
2607 parameter files and data files and are presented in an anti-aliased GNOME
2608 canvas. The program supports rectangular two-dimensional plots, histograms,
2609 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2610 to BMP, JPEG or PNG image formats.")
2611 (license license:gpl3+)))
2613 (define-public maxima
2620 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2621 version "-source/" name "-" version ".tar.gz"))
2624 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2625 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2626 (build-system gnu-build-system)
2629 ("gnuplot" ,gnuplot) ;for plots
2630 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2632 `(("texinfo" ,texinfo)
2634 ("python" ,python)))
2637 (list "--enable-gcl"
2638 (string-append "--with-posix-shell="
2639 (assoc-ref %build-inputs "bash")
2641 (string-append "--with-wish="
2642 (assoc-ref %build-inputs "tk")
2644 (let ((v ,(package-version tk)))
2645 (string-take v (string-index-right v #\.)))))
2646 ;; By default Maxima attempts to write temporary files to
2647 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2648 ;; Work around that.
2649 #:make-flags (list "TMPDIR=/tmp")
2651 (modify-phases %standard-phases
2652 (add-before 'check 'pre-check
2654 (chmod "src/maxima" #o555)
2656 ;; Make sure the doc and emacs files are found in the
2657 ;; standard location. Also configure maxima to find gnuplot
2658 ;; without having it on the PATH.
2659 (add-after 'install 'post-install
2660 (lambda* (#:key outputs inputs #:allow-other-keys)
2661 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2662 (out (assoc-ref outputs "out"))
2663 (datadir (string-append out "/share/maxima/" ,version))
2664 (binutils (string-append (assoc-ref inputs "binutils")
2666 (with-directory-excursion out
2667 (mkdir-p "share/emacs")
2668 (mkdir-p "share/doc")
2670 (string-append datadir "/emacs/")
2671 (string-append out "/share/emacs/site-lisp"))
2673 (string-append datadir "/doc/")
2674 (string-append out "/share/doc/maxima"))
2675 (with-atomic-file-replacement
2676 (string-append datadir "/share/maxima-init.lisp")
2678 (format out "~a ~s~a~%"
2679 "(setf $gnuplot_command "
2680 (string-append gnuplot "/bin/gnuplot") ")")
2681 (dump-port in out))))
2682 ;; Ensure that Maxima will have access to the GNU binutils
2683 ;; components at runtime.
2684 (wrap-program (string-append out "/bin/maxima")
2685 `("PATH" prefix (,binutils))))
2687 (home-page "http://maxima.sourceforge.net")
2688 (synopsis "Numeric and symbolic expression manipulation")
2689 (description "Maxima is a system for the manipulation of symbolic and
2690 numerical expressions. It yields high precision numeric results by using
2691 exact fractions, arbitrary precision integers, and variable precision floating
2693 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2694 ;; Others simply say "GNU General Public License" without stating a
2695 ;; version (which implicitly means gpl1+).
2696 ;; At least one file (src/maxima.asd) says "version 2."
2697 ;; GPLv2 only is therefore the smallest subset.
2698 (license license:gpl2)))
2700 (define-public wxmaxima
2707 (uri (string-append "https://github.com/andrejv/" name "/archive"
2708 "/Version-" version ".tar.gz"))
2709 (file-name (string-append name "-" version ".tar.gz"))
2712 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2714 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2715 (build-system cmake-build-system)
2717 `(("gettext" ,gettext-minimal)))
2719 `(("wxwidgets" ,wxwidgets)
2722 ("adwaita-icon-theme" ,adwaita-icon-theme)
2724 ("shared-mime-info" ,shared-mime-info)))
2726 `(#:tests? #f ; no check target
2728 (modify-phases %standard-phases
2729 (add-after 'install 'wrap-program
2730 (lambda* (#:key inputs outputs #:allow-other-keys)
2731 (wrap-program (string-append (assoc-ref outputs "out")
2734 (,(string-append (assoc-ref inputs "maxima")
2736 ;; For GtkFileChooserDialog.
2737 `("GSETTINGS_SCHEMA_DIR" =
2738 (,(string-append (assoc-ref inputs "gtk+")
2739 "/share/glib-2.0/schemas")))
2740 `("XDG_DATA_DIRS" ":" prefix
2741 (;; Needed by gdk-pixbuf to know supported icon formats.
2743 (assoc-ref inputs "shared-mime-info") "/share")
2744 ;; The default icon theme of GTK+.
2746 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2748 (home-page "https://andrejv.github.io/wxmaxima/")
2749 (synopsis "Graphical user interface for the Maxima computer algebra system")
2751 "wxMaxima is a graphical user interface for the Maxima computer algebra
2752 system. It eases the use of Maxima by making most of its commands available
2753 through a menu system and by providing input dialogs for commands that require
2754 more than one argument. It also implements its own display engine that
2755 outputs mathematical symbols directly instead of depicting them with ASCII
2758 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2759 text and mathematical calculations to create documents, exporting of input and
2760 output to TeX, and a browser for Maxima's manual including command index and
2761 full text searching.")
2762 (license license:gpl2+)))
2764 (define-public armadillo
2770 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2774 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
2775 (build-system cmake-build-system)
2776 (arguments `(#:tests? #f)) ; no test target
2778 `(("openblas" ,openblas)
2780 ("arpack" ,arpack-ng)))
2781 (home-page "http://arma.sourceforge.net/")
2782 (synopsis "C++ linear algebra library")
2784 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2785 between speed and ease of use. It is useful for algorithm development
2786 directly in C++, or quick conversion of research code into production
2787 environments. It can be used for machine learning, pattern recognition,
2788 signal processing, bioinformatics, statistics, econometrics, etc. The library
2789 provides efficient classes for vectors, matrices and cubes, as well as 150+
2790 associated functions (eg. contiguous and non-contiguous submatrix views).")
2791 (license license:asl2.0)))
2793 (define-public muparser
2794 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2795 ;; different hash. In order to make `guix package --upgrade` work correctly,
2796 ;; we set a Guix packaging revision.
2797 ;; When the next version of muparser is released, we can remove
2798 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2799 (let ((upstream-version "2.2.5")
2803 (version (string-append upstream-version "-" revision))
2807 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2808 upstream-version ".tar.gz"))
2809 (file-name (string-append name "-" version ".tar.gz"))
2812 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2813 (build-system gnu-build-system)
2815 `(#:configure-flags '("--enable-samples=no")
2816 #:tests? #f)) ;no "check" target
2817 (home-page "http://muparser.beltoforion.de/")
2818 (synopsis "Fast parser library for mathematical expressions")
2820 "muParser is an extensible high performance math parser library. It is
2821 based on transforming an expression into a bytecode and precalculating constant
2823 (license license:expat))))
2825 (define-public openblas
2832 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2834 (file-name (string-append name "-" version ".tar.gz"))
2837 "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq"))))
2838 (build-system gnu-build-system)
2840 `(#:test-target "test"
2841 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2842 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2843 ;; we need to disable substitutions.
2845 ,(let ((system (or (%current-target-system) (%current-system))))
2846 (or (string-prefix? "x86_64" system)
2847 (string-prefix? "i686" system)
2848 (string-prefix? "mips" system)
2849 (string-prefix? "aarch64" system)))
2851 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2853 ;; Build the library for all supported CPUs. This allows
2854 ;; switching CPU targets at runtime with the environment variable
2855 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2856 ;; Unfortunately, this is not supported on non-x86 architectures,
2857 ;; where it leads to failed builds.
2858 ,@(let ((system (or (%current-target-system) (%current-system))))
2860 ((or (string-prefix? "x86_64" system)
2861 (string-prefix? "i686" system))
2862 '("DYNAMIC_ARCH=1"))
2863 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2864 ;; two available MIPS targets special extended instructions
2865 ;; for Loongson cores are used.
2866 ((string-prefix? "mips" system)
2867 '("TARGET=SICORTEX"))
2868 ;; On aarch64 force the generic 'armv8-a' target
2869 ((string-prefix? "aarch64" system)
2872 ;; no configure script
2874 (modify-phases %standard-phases
2876 (add-before 'build 'set-extralib
2877 (lambda* (#:key inputs #:allow-other-keys)
2878 ;; Get libgfortran found when building in utest.
2880 (string-append "-L" (assoc-ref inputs "fortran-lib")
2884 `(("fortran-lib" ,gfortran "lib")))
2887 ("fortran" ,gfortran)
2889 (home-page "http://www.openblas.net/")
2890 (synopsis "Optimized BLAS library based on GotoBLAS")
2892 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2893 (license license:bsd-3)))
2895 (define* (make-blis implementation #:optional substitutable?)
2896 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2897 source tree for a list of implementations.)
2899 SUBSTITUTABLE? determines whether the package is made available as a
2902 Currently the specialization must be selected at configure-time, but work is
2903 underway to allow BLIS to select the right optimized kernels at run time:
2904 <https://github.com/flame/blis/issues/129>."
2906 (name (if (string=? implementation "reference")
2908 (string-append "blis-" implementation)))
2910 (home-page "https://github.com/flame/blis")
2913 (uri (git-reference (url home-page) (commit version)))
2916 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2917 (file-name (git-file-name "blis" version))))
2918 (build-system gnu-build-system)
2920 `(#:test-target "test"
2922 #:substitutable? ,substitutable?
2924 #:phases (modify-phases %standard-phases
2926 (lambda* (#:key outputs #:allow-other-keys)
2927 ;; This is a home-made 'configure' script.
2928 (let ((out (assoc-ref outputs "out")))
2929 (zero? (system* "./configure" "-p" out
2933 "--enable-threading=openmp"
2935 ,implementation)))))
2936 (add-before 'check 'show-test-output
2938 ;; By default "make check" is silent. Make it verbose.
2939 (system "tail -F output.testsuite &")
2941 (synopsis "High-performance basic linear algebra (BLAS) routines")
2943 "BLIS is a portable software framework for instantiating high-performance
2944 BLAS-like dense linear algebra libraries. The framework was designed to
2945 isolate essential kernels of computation that, when optimized, immediately
2946 enable optimized implementations of most of its commonly used and
2947 computationally intensive operations. While BLIS exports a new BLAS-like API,
2948 it also includes a BLAS compatibility layer which gives application developers
2949 access to BLIS implementations via traditional BLAS routine calls.")
2950 (license license:bsd-3)))
2953 ;; This is the "reference" implementation, which is the non-optimized but
2954 ;; portable variant (no assembly).
2955 (make-blis "reference" #t))
2957 (define ignorance blis)
2959 (define-syntax-rule (blis/x86_64 processor)
2960 "Expand to a package specialized for PROCESSOR."
2962 (inherit (make-blis processor))
2963 (supported-systems '("x86_64-linux"))))
2965 (define-public blis-sandybridge
2966 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2967 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2968 (blis/x86_64 "sandybridge"))
2970 (define-public blis-haswell
2971 ;; BLIS specialized for Haswell processors (launched 2013):
2972 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2973 (blis/x86_64 "haswell"))
2975 (define-public blis-knl
2976 ;; BLIS specialized for Knights Landing processor (launched 2016):
2977 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2978 (blis/x86_64 "knl"))
2981 (define-public openlibm
2988 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2990 (file-name (string-append name "-" version ".tar.gz"))
2993 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
2994 (build-system gnu-build-system)
2997 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2999 ;; no configure script
3000 (modify-phases %standard-phases (delete 'configure))
3001 #:tests? #f)) ;the tests are part of the default target
3002 (home-page "http://openlibm.org/")
3003 (synopsis "Portable C mathematical library (libm)")
3005 "OpenLibm is an effort to have a high quality, portable, standalone C
3006 mathematical library (libm). It can be used standalone in applications and
3007 programming language implementations. The project was born out of a need to
3008 have a good libm for the Julia programming language that worked consistently
3009 across compilers and operating systems, and in 32-bit and 64-bit
3011 ;; Each architecture has its own make target, and there is none for mips.
3012 (supported-systems (delete "mips64el-linux" %supported-systems))
3013 ;; See LICENSE.md for details.
3014 (license (list license:expat
3017 license:public-domain
3018 license:lgpl2.1+))))
3020 (define-public openspecfun
3022 (name "openspecfun")
3027 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3029 (file-name (string-append name "-" version ".tar.gz"))
3032 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
3033 (build-system gnu-build-system)
3035 '(#:tests? #f ; no "check" target
3037 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3039 (modify-phases %standard-phases
3040 (delete 'configure)))) ; no configure script
3042 `(("fortran" ,gfortran)))
3043 (home-page "https://github.com/JuliaLang/openspecfun")
3044 (synopsis "Collection of special mathematical functions")
3046 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3047 portable package for Bessel Functions of a Complex Argument and Nonnegative
3048 Order; it contains subroutines for computing Bessel functions and Airy
3049 functions. Faddeeva allows computing the various error functions of arbitrary
3050 complex arguments (Faddeeva function, error function, complementary error
3051 function, scaled complementary error function, imaginary error function, and
3052 Dawson function); given these, one can also easily compute Voigt functions,
3053 Fresnel integrals, and similar related functions as well.")
3054 ;; Faddeeva is released under the Expat license; AMOS is included as
3055 ;; public domain software.
3056 (license (list license:expat license:public-domain))))
3058 (define-public suitesparse
3060 (name "suitesparse")
3066 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3070 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3071 (modules '((guix build utils)))
3073 ;; Remove bundled metis source
3075 (delete-file-recursively "metis-5.1.0")
3077 (build-system gnu-build-system)
3079 '(#:tests? #f ;no "check" target
3084 "MY_METIS_LIB=-lmetis"
3085 (string-append "INSTALL_LIB="
3086 (assoc-ref %outputs "out") "/lib")
3087 (string-append "INSTALL_INCLUDE="
3088 (assoc-ref %outputs "out") "/include")
3091 (modify-phases %standard-phases
3092 (delete 'configure)))) ;no configure script
3097 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3098 (synopsis "Suite of sparse matrix software")
3100 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3101 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3102 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3103 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3104 CXSparse, a concise sparse Cholesky factorization package; and many other
3107 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3109 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3110 (license (list license:gpl2+ license:lgpl2.1+))))
3112 (define-public atlas
3118 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3119 version "/atlas" version ".tar.bz2"))
3122 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3123 (build-system gnu-build-system)
3124 (home-page "http://math-atlas.sourceforge.net/")
3125 (inputs `(("gfortran" ,gfortran)
3126 ("lapack-tar" ,(package-source lapack))))
3127 (outputs '("out" "doc"))
3128 ;; For the moment we drop support for MIPS at it fails to compile. See
3129 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3130 (supported-systems (delete "mips64el-linux" %supported-systems))
3132 `(#:parallel-build? #f
3133 #:parallel-tests? #f
3135 ;; ATLAS tunes itself for the machine it is built on, as explained at
3136 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3137 ;; For this reason, we want users to build it locally instead of using
3141 #:modules ((srfi srfi-26)
3143 (guix build gnu-build-system)
3146 `(;; Generate position independent code suitable for dynamic libraries
3147 ;; and use WALL timer to get more accurate timing.
3148 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3151 ,,(if (string-match "64" (%current-system))
3154 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3155 ;; needed to compile C files before it is generated.
3156 "-Ss" "pmake" "make -j 1"
3157 ;; Probe is failing for MIPS. We therefore define the system
3158 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3159 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3160 ,,@(if (string-prefix? "mips" (%current-system))
3161 (list "-A" "49" "-V" "1")
3163 ;; Generate shared libraries.
3165 ;; Build a full LAPACK library.
3166 ,(string-append "--with-netlib-lapack-tarfile="
3167 (assoc-ref %build-inputs "lapack-tar")))
3169 (modify-phases %standard-phases
3170 (add-after 'install 'install-doc
3171 (lambda* (#:key outputs inputs #:allow-other-keys)
3172 (let ((doc (string-append (assoc-ref outputs "doc")
3173 "/share/doc/atlas")))
3175 (fold (lambda (file previous)
3176 (and previous (zero? (system* "cp" file doc))))
3177 #t (find-files "../ATLAS/doc" ".*")))))
3178 (add-after 'check 'check-pt
3179 (lambda _ (zero? (system* "make" "ptcheck"))))
3180 ;; Fix files required to run configure.
3181 (add-before 'configure 'fix-/bin/sh
3183 ;; Use `sh', not `/bin/sh'.
3184 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3187 ;; Fix /bin/sh in generated make files.
3188 (add-after 'configure 'fix-/bin/sh-in-generated-files
3190 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3193 ;; ATLAS configure program does not accepts the default flags
3194 ;; passed by the 'gnu-build-system'.
3196 (lambda* (#:key native-inputs inputs outputs
3197 (configure-flags '())
3198 #:allow-other-keys #:rest args)
3199 (let* ((prefix (assoc-ref outputs "out"))
3200 (bash (or (and=> (assoc-ref
3201 (or native-inputs inputs) "bash")
3202 (cut string-append <> "/bin/bash"))
3204 (flags `(,(string-append "--prefix=" prefix)
3206 (abs-srcdir (getcwd))
3207 (srcdir (string-append "../" (basename abs-srcdir))))
3208 (format #t "source directory: ~s (relative from build: ~s)~%"
3212 (format #t "build directory: ~s~%" (getcwd))
3213 (format #t "configure flags: ~s~%" flags)
3214 (zero? (apply system* bash
3215 (string-append srcdir "/configure")
3217 (synopsis "Automatically Tuned Linear Algebra Software")
3219 "ATLAS is an automatically tuned linear algebra software library
3220 providing C and Fortran77 interfaces to a portably efficient BLAS
3221 implementation, as well as a few routines from LAPACK.
3223 Optimization occurs at build time. For this reason, the library is built on
3224 the machine where it is installed, without resorting to pre-built substitutes.
3226 Before building the library, CPU throttling should be disabled. This can be
3227 done in the BIOS, or, on GNU/Linux, with the following command:
3230 # cpupower --governor performance
3233 Failure to do so will result in a library with poor performance.")
3234 (license license:bsd-3)))
3243 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3244 version "/glm-" version ".zip"))
3247 "0ihjadp2sb8w312a276skfjsljm3y41bjscbxf79wn23gi00giz1"))))
3248 (build-system cmake-build-system)
3250 `(("unzip" ,unzip)))
3251 (home-page "https://glm.g-truc.net/")
3252 (synopsis "OpenGL Mathematics library")
3253 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3254 library for graphics software based on the OpenGL Shading Language (GLSL)
3256 (license license:expat)))
3258 (define-public lpsolve
3265 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3266 "/lp_solve_" version "_source.tar.gz"))
3269 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3270 (modules '((guix build utils)))
3273 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3275 ;; Pretend to be on a 64 bit platform to obtain a common directory
3276 ;; name for the build results on all architectures; nothing else
3277 ;; seems to depend on it.
3278 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3280 ;; The check for 'isnan' as it is written fails with
3281 ;; "non-floating-point argument in call to function
3282 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3283 ;; definition, which in turn leads to bad things. Fix the feature
3285 (("isnan\\(0\\)") "isnan(0.)"))
3287 (build-system gnu-build-system)
3289 `(#:tests? #f ; no check target
3291 (modify-phases %standard-phases
3292 (delete 'configure) ; no configure script
3295 (with-directory-excursion "lpsolve55"
3296 (invoke "bash" "ccc"))
3297 (with-directory-excursion "lp_solve"
3298 (invoke "bash" "ccc"))
3301 (lambda* (#:key outputs #:allow-other-keys)
3302 (let* ((out (assoc-ref outputs "out"))
3303 (bin (string-append out "/bin"))
3304 (lib (string-append out "/lib"))
3305 ;; This is where LibreOffice expects to find the header
3306 ;; files, and where they are installed by Debian.
3307 (include (string-append out "/include/lpsolve")))
3308 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3309 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3310 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3312 ;; Install a subset of the header files as on Debian
3313 ;; (plus lp_bit.h, which matches the regular expression).
3314 (for-each (lambda (name)
3315 (install-file name include))
3316 (find-files "." "lp_[HMSa-z].*\\.h$"))
3317 (with-directory-excursion "shared"
3318 (for-each (lambda (name)
3319 (install-file name include))
3320 (find-files "." "\\.h$")))
3322 (home-page "http://lpsolve.sourceforge.net/")
3323 (synopsis "Mixed integer linear programming (MILP) solver")
3325 "lp_solve is a mixed integer linear programming solver based on the
3326 revised simplex and the branch-and-bound methods.")
3327 (license license:lgpl2.1+)))
3329 (define-public dealii
3336 (uri (string-append "https://github.com/dealii/dealii/releases/"
3337 "download/v" version "/dealii-" version ".tar.gz"))
3340 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3341 (modules '((guix build utils)))
3343 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3345 (delete-file-recursively "bundled")
3347 (build-system cmake-build-system)
3355 ("arpack" ,arpack-ng)
3356 ("muparser" ,muparser)
3357 ("gfortran" ,gfortran)
3358 ("suitesparse" ,suitesparse))) ;for UMFPACK
3360 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3362 ;; Work around a bug in libsuitesparseconfig linking
3363 ;; see https://github.com/dealii/dealii/issues/4745
3364 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3365 (home-page "https://www.dealii.org")
3366 (synopsis "Finite element library")
3368 "Deal.II is a C++ program library targeted at the computational solution
3369 of partial differential equations using adaptive finite elements. The main
3370 aim of deal.II is to enable rapid development of modern finite element codes,
3371 using among other aspects adaptive meshes and a wide array of tools often used
3372 in finite element programs.")
3373 (license license:lgpl2.1+)))
3375 (define-public dealii-openmpi
3376 (package (inherit dealii)
3377 (name "dealii-openmpi")
3380 ;;Supported only with MPI:
3381 ("p4est" ,p4est-openmpi)
3382 ("petsc" ,petsc-openmpi)
3383 ("slepc" ,slepc-openmpi)
3384 ("metis" ,metis) ;for MUMPS
3385 ("scalapack" ,scalapack) ;for MUMPS
3386 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3387 ("arpack" ,arpack-ng-openmpi)
3388 ,@(fold alist-delete (package-inputs dealii)
3389 '("p4est" "arpack"))))
3391 (substitute-keyword-arguments (package-arguments dealii)
3392 ((#:configure-flags cf)
3393 ``("-DMPI_C_COMPILER=mpicc"
3394 "-DMPI_CXX_COMPILER=mpicxx"
3395 "-DMPI_Fortran_COMPILER=mpifort"
3397 (synopsis "Finite element library (with MPI support)")))
3399 (define-public flann
3408 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3409 version "-src.zip"))
3412 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3413 (patches (search-patches "flann-cmake-3.11.patch"))))
3414 (build-system cmake-build-system)
3416 "octave")) ;46 MiB .mex file that pulls Octave
3418 `(("unzip" ,unzip)))
3422 ("python" ,python-2) ; print syntax
3423 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3426 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3427 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3428 #:strip-directories '("lib" "lib64" "libexec"
3429 "bin" "sbin" "share/flann/octave")
3431 ;; Save 12 MiB by not installing .a files. Passing
3432 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3433 #:phases (modify-phases %standard-phases
3434 (add-before 'configure 'set-octave-directory
3435 (lambda* (#:key outputs #:allow-other-keys)
3436 ;; Install the .mex file in the "octave" output.
3437 (let ((out (assoc-ref outputs "octave")))
3438 (substitute* "src/matlab/CMakeLists.txt"
3439 (("share/flann/octave")
3440 (string-append out "/share/flann/octave")))
3442 (add-after 'install 'remove-static-libraries
3443 (lambda* (#:key outputs #:allow-other-keys)
3444 (let* ((out (assoc-ref outputs "out"))
3445 (lib (string-append out "/lib")))
3446 (for-each delete-file
3447 (find-files lib "\\.a$"))
3450 #:tests? #f)) ; The test data are downloaded from the Internet.
3451 (home-page "http://www.cs.ubc.ca/research/flann/")
3452 (synopsis "Library for approximate nearest neighbors computation")
3453 (description "FLANN is a library for performing fast approximate
3454 nearest neighbor searches in high dimensional spaces. It implements a
3455 collection of algorithms and a system for automatically choosing the best
3456 algorithm and optimum parameters depending on the dataset.
3458 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3459 (license (license:non-copyleft "file://COPYING"
3460 "See COPYING in the distribution."))))
3462 (define-public wcalc
3469 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3470 "wcalc-" version ".tar.bz2"))
3473 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3474 (build-system gnu-build-system)
3477 ("readline" ,readline)))
3478 (home-page "http://w-calc.sourceforge.net/index.php")
3479 (synopsis "Flexible command-line scientific calculator")
3480 (description "Wcalc is a very capable calculator. It has standard functions
3481 (sin, asin, and sinh for example, in either radians or degrees), many
3482 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3483 variables, a command history, hex/octal/binary input and output, unit
3484 conversions, embedded comments, and an expandable expression entry field. It
3485 evaluates expressions using the standard order of operations.")
3486 (license license:gpl2+)))
3494 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3495 "/xaos-" version ".tar.gz"))
3498 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3499 (build-system gnu-build-system)
3500 (native-inputs `(("gettext" ,gettext-minimal)))
3501 (inputs `(("libx11" ,libx11)
3506 `(#:tests? #f ;no "check" target
3507 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3508 (synopsis "Real-time fractal zoomer")
3509 (description "GNU XaoS is a graphical program that generates fractal
3510 patterns and allows you to zoom in and out of them infinitely in a fluid,
3511 continuous manner. It also includes tutorials that help to explain how fractals
3512 are built. It can generate many different fractal types such as the Mandelbrot
3514 (home-page "https://www.gnu.org/software/xaos/")
3515 (license license:gpl2+)))
3517 (define-public hypre
3523 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3524 "v" version ".tar.gz"))
3525 (file-name (string-append name "-" version ".tar.gz"))
3528 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3529 (modules '((guix build utils)))
3532 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3533 ;; substitute the tarball creation time.
3534 (substitute* "src/utilities/HYPRE_utilities.h"
3535 (("Date Compiled: .*$")
3536 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3538 (build-system gnu-build-system)
3539 (outputs '("out" ;6.1 MiB of headers and libraries
3540 "doc")) ;4.8 MiB of documentation
3544 ("perl" ,perl) ;needed to run 'ppmquant' during tests
3545 ("texlive" ,texlive) ;full package required for fonts
3546 ("ghostscript" ,ghostscript)))
3548 `(("blas" ,openblas)
3549 ("lapack" ,lapack)))
3551 `(#:modules ((srfi srfi-1)
3552 ,@%gnu-build-system-modules)
3553 #:configure-flags '("--enable-shared"
3561 (modify-phases %standard-phases
3562 (add-before 'configure 'chdir-src
3563 (lambda _ (chdir "src")))
3565 (lambda* (#:key build target configure-flags
3566 #:allow-other-keys #:rest args)
3567 (let* ((configure (assoc-ref %standard-phases 'configure)))
3570 (list #:configure-flags
3571 (cons (string-append
3572 "--host=" (or target build))
3573 configure-flags)))))))
3574 (add-after 'build 'build-docs
3576 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3579 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3580 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3581 (and (system* "make" "check" "CHECKRUN=")
3582 (fold (lambda (filename result)
3584 (let ((size (stat:size (stat filename))))
3585 (when (not (zero? size))
3586 (format #t "~a size ~d; error indication~%"
3590 (find-files "test" ".*\\.err$")))))
3591 (add-after 'install 'install-docs
3592 (lambda* (#:key outputs #:allow-other-keys)
3593 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3594 (let* ((doc (assoc-ref outputs "doc"))
3595 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3596 (with-directory-excursion "docs"
3597 (for-each (lambda (base)
3598 (install-file (string-append base ".pdf") docdir)
3599 (copy-recursively base docdir)) ;html docs
3600 '("HYPRE_usr_manual"
3601 "HYPRE_ref_manual")))
3603 (home-page "http://www.llnl.gov/casc/hypre/")
3604 (synopsis "Library of solvers and preconditioners for linear equations")
3606 "HYPRE is a software library of high performance preconditioners and
3607 solvers for the solution of large, sparse linear systems of equations. It
3608 features multigrid solvers for both structured and unstructured grid
3610 (license license:lgpl2.1)))
3612 (define-public hypre-openmpi
3613 (package (inherit hypre)
3614 (name "hypre-openmpi")
3617 ,@(package-inputs hypre)))
3619 (substitute-keyword-arguments (package-arguments hypre)
3620 ((#:configure-flags flags)
3622 ,@(delete "--without-MPI" ,flags)))
3624 `(modify-phases ,phases
3625 (add-before 'check 'set-test-environment
3627 ;; By default, running the test suite would fail because 'ssh'
3628 ;; could not be found in $PATH. Define this variable to
3629 ;; placate Open MPI without adding a dependency on OpenSSH (the
3630 ;; agent isn't used anyway.)
3631 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
3633 (synopsis "Parallel solvers and preconditioners for linear equations")
3635 "HYPRE is a software library of high performance preconditioners and
3636 solvers for the solution of large, sparse linear systems of equations on
3637 parallel computers. It features parallel multigrid solvers for both
3638 structured and unstructured grid problems.")))
3640 (define-public matio
3647 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3648 "matio-" version ".tar.gz"))
3651 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3652 (build-system gnu-build-system)
3656 (home-page "http://matio.sourceforge.net/")
3657 (synopsis "Library for reading and writing MAT files")
3658 (description "Matio is a library for reading and writing MAT files. It
3659 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3660 (license license:bsd-2)))
3667 (origin (method url-fetch)
3668 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3669 "download/" version "/Vc-" version ".tar.gz"))
3672 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3673 (build-system cmake-build-system)
3676 '("-DBUILD_TESTING=ON"
3677 ;; By default, Vc will optimize for the CPU of the build machine.
3678 ;; Setting this to "none" makes it create portable binaries. See
3679 ;; "cmake/OptimizeForArchitecture.cmake".
3680 "-DTARGET_ARCHITECTURE=none")))
3681 (synopsis "SIMD vector classes for C++")
3682 (description "Vc provides portable, zero-overhead C++ types for explicitly
3683 data-parallel programming. It is a library designed to ease explicit
3684 vectorization of C++ code. Its types enable explicitly stating data-parallel
3685 operations on multiple values. The parallelism is therefore added via the type
3686 system. Vc has an intuitive API and provides portability between different
3687 compilers and compiler versions as well as portability between different vector
3688 instruction sets. Thus, an application written with Vc can be compiled for:
3691 @item SSE2 up to SSE4.2 or SSE4a
3694 @item NEON (in development)
3695 @item NVIDIA GPUs / CUDA (in development)
3697 (home-page "https://github.com/VcDevel/Vc")
3698 ;; "No support_???.cpp file exists for this architecture."
3699 (supported-systems '("x86_64-linux" "i686-linux"))
3700 (license license:bsd-3)))
3702 (define-public reducelcs
3703 ;; This is the last commit which is available upstream, no
3704 ;; release happened since 2010.
3705 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3709 (version (string-append "1.0-" revision "." (string-take commit 7)))
3714 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3716 (file-name (string-append name "-" version "-checkout"))
3719 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3720 (build-system gnu-build-system)
3722 `(("openlibm" ,openlibm)))
3724 `(#:tests? #f ; no tests
3726 (modify-phases %standard-phases
3727 (delete 'configure) ; No configure script exists.
3728 (replace 'install ; No install phase exists.
3729 (lambda* (#:key outputs #:allow-other-keys)
3730 (let* ((out (assoc-ref outputs "out"))
3731 (bin (string-append out "/bin")))
3732 (install-file "Approximation" bin)
3733 (install-file "CollectResults" bin)
3734 (install-file "GenerateInstances" bin)
3736 (synopsis "Approximate Longest Commons Subsequence computation tool")
3738 "@code{reduceLCS} is an implementation of the Reduce-Expand
3739 algorithm for LCS. It is a fast program to compute the approximate
3740 Longest Commons Subsequence of a set of strings.")
3741 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3742 (license license:gpl3+))))
3744 (define-public jacal
3751 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3754 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3755 (patches (search-patches "jacal-fix-texinfo.patch"))))
3756 (build-system gnu-build-system)
3759 (modify-phases %standard-phases
3760 (add-before 'build 'pre-build
3761 ;; Don't use upstream's script - it really doesn't fit into
3762 ;; Guix's functional paradigm.
3763 (lambda* (#:key inputs outputs #:allow-other-keys)
3764 (substitute* "Makefile"
3765 (("^install: install-script") "install: "))))
3766 (add-after 'install 'post-install
3767 ;; Instead, we provide our own simplified script.
3768 (lambda* (#:key inputs outputs #:allow-other-keys)
3769 (let ((wrapper (string-append (assoc-ref outputs "out")
3771 (format (open wrapper (logior O_WRONLY O_CREAT))
3772 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3773 "-e '(slib:load \"~a/lib/jacal/math\") "
3776 (assoc-ref inputs "scm")
3777 (assoc-ref outputs "out"))
3778 (chmod wrapper #o555))))
3780 (lambda* (#:key inputs outputs #:allow-other-keys)
3781 (zero? (system* "./configure"
3782 (string-append "--prefix="
3783 (assoc-ref outputs "out")))))))))
3784 (inputs `(("scm" ,scm)))
3785 (native-inputs `(("unzip" ,unzip)
3786 ("texinfo" ,texinfo)))
3787 (synopsis "Symbolic mathematics system")
3788 (description "GNU JACAL is an interactive symbolic mathematics program based on
3789 Scheme. It manipulate and simplify a range of mathematical expressions such
3790 as equations, scalars, vectors, and matrices.")
3791 (home-page "https://www.gnu.org/software/jacal/")
3792 (license license:gpl3+)))
3801 "https://github.com/Z3Prover/z3/archive/z3-"
3805 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3806 (build-system cmake-build-system)
3809 (list "-DBUILD_PYTHON_BINDINGS=true"
3810 "-DINSTALL_PYTHON_BINDINGS=true"
3811 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3813 "/lib/python2.7/site-packages"))
3815 (modify-phases %standard-phases
3816 (add-before 'configure 'bootstrap
3819 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3820 (add-before 'check 'make-test-z3
3822 ;; Build the test suite executable.
3823 (zero? (system* "make" "test-z3" "-j"
3824 (number->string (parallel-job-count))))))
3827 ;; Run all the tests that don't require arguments.
3828 (zero? (system* "./test-z3" "/a")))))))
3830 `(("python" ,python-2)))
3831 (synopsis "Theorem prover")
3832 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3833 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3834 (home-page "https://github.com/Z3Prover/z3")
3835 (license license:expat)))
3837 (define-public cubicle
3843 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3847 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3848 (build-system gnu-build-system)
3851 ("which" ,(@@ (gnu packages base) which))))
3855 `(#:configure-flags (list "--with-z3")
3858 (modify-phases %standard-phases
3859 (add-before 'configure 'configure-for-release
3861 (substitute* "Makefile.in"
3862 (("SVNREV=") "#SVNREV="))))
3863 (add-before 'configure 'fix-/bin/sh
3865 (substitute* "configure"
3866 (("/bin/sh") (which "sh")))))
3867 (add-before 'configure 'fix-smt-z3wrapper.ml
3869 (substitute* "Makefile.in"
3870 (("\\\\n") "")))))))
3871 (home-page "http://cubicle.lri.fr/")
3872 (synopsis "Model checker for array-based systems")
3873 (description "Cubicle is a model checker for verifying safety properties
3874 of array-based systems. This is a syntactically restricted class of
3875 parametrized transition systems with states represented as arrays indexed by
3876 an arbitrary number of processes. Cache coherence protocols and mutual
3877 exclusion algorithms are typical examples of such systems.")
3878 (license license:asl2.0)))
3880 (define-public elemental
3886 (uri (string-append "https://github.com/elemental/Elemental/"
3887 "archive/v" version ".tar.gz"))
3888 (file-name (string-append name "-" version ".tar.gz"))
3891 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3892 (build-system cmake-build-system)
3893 (home-page "http://libelemental.org")
3895 `(("gfortran" ,gfortran)))
3897 `(("blas" ,openblas)
3898 ("gfortran:lib" ,gfortran "lib")
3907 `(#:build-type "Release" ;default RelWithDebInfo not supported
3908 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3909 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3910 "-DEL_CACHE_WARNINGS:BOOL=YES"
3911 "-DEL_TESTS:BOOL=YES"
3912 "-DCMAKE_INSTALL_LIBDIR=lib"
3913 "-DGFORTRAN_LIB=gfortran")
3914 #:phases (modify-phases %standard-phases
3915 (add-before 'check 'setup-tests
3917 ;; Parallelism is done at the MPI layer.
3918 (setenv "OMP_NUM_THREADS" "1")
3920 (add-after 'install 'remove-tests
3921 (lambda* (#:key outputs #:allow-other-keys)
3922 ;; Tests are installed, with no easy configuration
3923 ;; switch to prevent this, so delete them.
3924 (delete-file-recursively
3925 (string-append (assoc-ref outputs "out") "/bin"))
3927 (synopsis "Dense and sparse-direct linear algebra and optimization")
3928 (description "Elemental is a modern C++ library for distributed-memory
3929 dense and sparse-direct linear algebra, conic optimization, and lattice
3931 (license license:bsd-2)))
3933 (define-public mcrl2
3936 (version "201707.1.15162")
3939 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3944 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3946 `(("subversion" ,subversion)))
3951 ("qtbase" ,qtbase)))
3952 (build-system cmake-build-system)
3953 (synopsis "Toolset for the mCRL2 formal specification language")
3955 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3956 specification language for describing concurrent discrete event systems. Its
3957 toolset supports analysis and automatic verification, linearisation, simulation,
3958 state-space exploration and generation, and tools to optimise and analyse
3959 specifications. Also, state spaces can be manipulated, visualised and
3961 (home-page "http://mcrl2.org")
3962 (license license:boost1.0)))
3964 (define-public r-subplex
3971 (uri (cran-uri "subplex" version))
3974 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
3975 (build-system r-build-system)
3977 `(("gfortran" ,gfortran)))
3978 (home-page "https://cran.r-project.org/web/packages/subplex")
3979 (synopsis "Unconstrained optimization using the subplex algorithm")
3980 (description "This package implements the Subplex optimization algorithm.
3981 It solves unconstrained optimization problems using a simplex method on
3982 subspaces. The method is well suited for optimizing objective functions that
3983 are noisy or are discontinuous at the solution.")
3984 (license license:gpl3+)))
3986 (define-public r-desolve
3993 (uri (cran-uri "deSolve" version))
3996 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
3997 (properties `((upstream-name . "deSolve")))
3998 (build-system r-build-system)
4000 `(("gfortran" ,gfortran)))
4001 (home-page "https://desolve.r-forge.r-project.org/")
4002 (synopsis "Solvers for initial value problems of differential equations")
4003 (description "This package provides functions that solve initial
4004 value problems of a system of first-order ordinary differential equations (ODE),
4005 of partial differential equations (PDE), of differential algebraic equations
4006 (DAE), and of delay differential equations. The functions provide an interface
4007 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4008 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4009 the Runge-Kutta family with fixed or variable time steps. The package contains
4010 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4011 differential equations (PDE) that have been converted to ODEs by numerical
4013 (license license:gpl2+)))
4015 (define-public tcalc
4022 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4026 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4027 (build-system gnu-build-system)
4028 (synopsis "The terminal calculator")
4030 "The terminal calculator is a small program to help users of the GNU/Linux
4031 terminal do calculations simply and quickly. The formula to be calculated can
4032 be fed to @command{tcalc} through the command line.")
4033 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4034 (license license:gpl3+)))