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, 2019 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, 2019 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, 2019 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, 2019 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, 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019 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>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
34 ;;; This file is part of GNU Guix.
36 ;;; GNU Guix is free software; you can redistribute it and/or modify it
37 ;;; under the terms of the GNU General Public License as published by
38 ;;; the Free Software Foundation; either version 3 of the License, or (at
39 ;;; your option) any later version.
41 ;;; GNU Guix is distributed in the hope that it will be useful, but
42 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 ;;; GNU General Public License for more details.
46 ;;; You should have received a copy of the GNU General Public License
47 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
49 (define-module (gnu packages maths)
50 #:use-module (ice-9 regex)
51 #:use-module (ice-9 match)
52 #:use-module (gnu packages)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module (guix utils)
58 #:use-module ((guix build utils) #:select (alist-replace))
59 #:use-module (guix build-system cmake)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system python)
62 #:use-module (guix build-system r)
63 #:use-module (guix build-system ruby)
64 #:use-module (gnu packages algebra)
65 #:use-module (gnu packages audio)
66 #:use-module (gnu packages autotools)
67 #:use-module (gnu packages base)
68 #:use-module (gnu packages bison)
69 #:use-module (gnu packages boost)
70 #:use-module (gnu packages check)
71 #:use-module (gnu packages cmake)
72 #:use-module (gnu packages compression)
73 #:use-module (gnu packages curl)
74 #:use-module (gnu packages cyrus-sasl)
75 #:use-module (gnu packages documentation)
76 #:use-module (gnu packages elf)
77 #:use-module (gnu packages flex)
78 #:use-module (gnu packages fltk)
79 #:use-module (gnu packages fontutils)
80 #:use-module (gnu packages gettext)
81 #:use-module (gnu packages gcc)
82 #:use-module (gnu packages gd)
83 #:use-module (gnu packages ghostscript)
84 #:use-module (gnu packages graphviz)
85 #:use-module (gnu packages gtk)
86 #:use-module (gnu packages image)
87 #:use-module (gnu packages java)
88 #:use-module (gnu packages less)
89 #:use-module (gnu packages lisp)
90 #:use-module (gnu packages linux)
91 #:use-module (gnu packages logging)
92 #:use-module (gnu packages lua)
93 #:use-module (gnu packages gnome)
94 #:use-module (gnu packages guile)
95 #:use-module (gnu packages xorg)
96 #:use-module (gnu packages gl)
97 #:use-module (gnu packages imagemagick)
98 #:use-module (gnu packages m4)
99 #:use-module (gnu packages mpi)
100 #:use-module (gnu packages multiprecision)
101 #:use-module (gnu packages netpbm)
102 #:use-module (gnu packages pcre)
103 #:use-module (gnu packages popt)
104 #:use-module (gnu packages perl)
105 #:use-module (gnu packages pkg-config)
106 #:use-module (gnu packages pulseaudio)
107 #:use-module (gnu packages python)
108 #:use-module (gnu packages python-web)
109 #:use-module (gnu packages python-xyz)
110 #:use-module (gnu packages qt)
111 #:use-module (gnu packages readline)
112 #:use-module (gnu packages ruby)
113 #:use-module (gnu packages tbb)
114 #:use-module (gnu packages scheme)
115 #:use-module (gnu packages shells)
116 #:use-module (gnu packages tcl)
117 #:use-module (gnu packages texinfo)
118 #:use-module (gnu packages tex)
119 #:use-module (gnu packages tls)
120 #:use-module (gnu packages version-control)
121 #:use-module (gnu packages wxwidgets)
122 #:use-module (gnu packages xml)
123 #:use-module (srfi srfi-1))
131 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
133 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
134 (build-system gnu-build-system)
135 (inputs `(("gtk+" ,gtk+)
136 ("libxml2" ,libxml2)))
137 (native-inputs `(("pkg-config" ,pkg-config)))
138 (synopsis "Natural deduction first-order logic interface")
139 (description "Aris is a program for performing logical proofs. It supports
140 propositional and predicate logic, as well as Boolean algebra and
141 arithmetical logic. In addition to its predefined inference and equivalence
142 rules, Aris also supports references to older proofs. Its use of standard
143 logical symbols and its natural deduction interface make it easy to use for
145 (license license:gpl3+)
146 (home-page "https://www.gnu.org/software/aris/")))
148 (define-public c-graph
154 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
157 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
158 (build-system gnu-build-system)
160 `(("fortran" ,gfortran)))
161 (synopsis "Visualizing and demonstrating convolution")
163 "GNU C-Graph is a tool for demonstrating the theory of convolution.
164 Thus, it can serve as an excellent aid to students of signal and systems
165 theory in visualizing the convolution process. Rather than forcing the
166 student to write code, the program offers an intuitive interface with
167 interactive dialogs to guide them.")
168 (license license:gpl3+)
169 (home-page "https://www.gnu.org/software/c-graph/")))
178 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
179 version "/coda-" version ".tar.gz"))
181 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
182 (patches (search-patches "coda-use-system-libs.patch"))
183 (modules '((guix build utils)))
185 ;; Make sure we don't use the bundled software.
187 (for-each (lambda (d)
188 (delete-file-recursively (string-append "libcoda/" d)))
189 '("zlib" "pcre" "expat"))
192 `(("fortran" ,gfortran)
194 ("python-numpy" ,python-numpy)))
201 (build-system gnu-build-system)
203 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
204 "LIBS= -lz -lpcre -lexpat")))
205 (synopsis "A common interface to various earth observation data formats")
207 "The Common Data Access toolbox (CODA) provides a set of interfaces for
208 reading remote sensing data from earth observation data files. It consists of
209 command line applications and interfaces to the C, Fortran, Python, and Java
210 programming languages.")
211 (home-page "https://stcorp.nl/coda")
212 (license license:gpl2+)))
220 (uri (string-append "http://www.qhull.org/download/qhull-"
221 (car (string-split version #\.))
225 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
226 (build-system cmake-build-system)
227 (synopsis "Calculate convex hulls and related structures")
229 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
230 diagram, halfspace intersection about a point, furthest-site Delaunay
231 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
232 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
233 algorithm for computing the convex hull. It handles roundoff errors from
234 floating point arithmetic. It computes volumes, surface areas, and
235 approximations to the convex hull.
237 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
238 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
239 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
241 (home-page "http://qhull.org")
242 (license (license:non-copyleft "file://COPYING.txt"
243 "See COPYING in the distribution."))))
245 (define-public python-cvxopt
247 (name "python-cvxopt")
252 (url "https://github.com/cvxopt/cvxopt.git")
254 (file-name (git-file-name name version))
257 "05mnjil9palaa48xafdfh4f5pr4z7aqjr995rwl08qfyxs8y0crf"))))
258 (build-system python-build-system)
261 (modify-phases %standard-phases
262 (add-after 'unpack 'find-libraries
263 (lambda* (#:key inputs #:allow-other-keys)
264 (setenv "CVXOPT_BLAS_LIB" "openblas")
265 (setenv "CVXOPT_BUILD_FFTW" "1")
266 (setenv "CVXOPT_BUILD_GLPK" "1")
267 (setenv "CVXOPT_BUILD_GSL" "1")
274 ("openblas" ,openblas)
275 ("suitesparse" ,suitesparse)))
276 (home-page "https://www.cvxopt.org")
277 (synopsis "Python library for convex optimization")
279 "CVXOPT is a package for convex optimization based on the Python
280 programming language. Its main purpose is to make the development of software
281 for convex optimization applications straightforward by building on Python’s
282 extensive standard library and on the strengths of Python as a high-level
283 programming language.")
284 (license license:gpl3+)))
286 (define-public python2-cvxopt
287 (package-with-python2 python-cvxopt))
295 (uri (string-append "mirror://gnu/units/units-" version
298 "0y26kj349i048y4z3xrk90bvciw2j6ds3rka7r7yn3183hirr5b4"))))
299 (build-system gnu-build-system)
301 `(("readline" ,readline)
302 ("python" ,python-wrapper) ;for 'units_cur' script
303 ("python-requests" ,python-requests)))
305 `(#:phases (modify-phases %standard-phases
306 (add-after 'install 'wrap-units_cur
307 (lambda* (#:key outputs #:allow-other-keys)
308 (let* ((out (assoc-ref outputs "out"))
309 (bin (string-append out "/bin")))
310 (wrap-program (string-append bin "/units_cur")
311 `("PYTHONPATH" ":" prefix
312 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
314 (synopsis "Conversion between thousands of scales")
316 "GNU Units converts numeric quantities between units of measure. It
317 can handle scale changes through adaptive usage of standard scale
318 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
319 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
320 enough to be used effectively as a scientific calculator.")
321 (license license:gpl3+)
322 (home-page "https://www.gnu.org/software/units/")))
324 (define-public double-conversion
326 (name "double-conversion")
328 (home-page "https://github.com/google/double-conversion")
331 (uri (git-reference (url home-page) (commit version)))
332 (file-name (git-file-name name version))
335 "123rb2p4snqagrybw66vnapchqdwn2rfpr1wcq0ya9gwbyl7xccx"))))
336 (build-system cmake-build-system)
338 '(#:test-target "test"
339 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
340 "-DBUILD_TESTING=ON")))
341 (synopsis "Conversion routines for IEEE doubles")
343 "The double-conversion library provides binary-decimal and decimal-binary
344 routines for IEEE doubles. The library consists of efficient conversion
345 routines that have been extracted from the V8 JavaScript engine.")
346 (license license:bsd-3)))
348 (define-public dionysus
354 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
358 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
359 (build-system gnu-build-system)
360 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
361 (synopsis "Local search for universal constants and scientific values")
363 "GNU Dionysus is a convenient system for quickly retrieving the values of
364 mathematical constants used in science and engineering. Values can be
365 searched using a simple command-line tool, choosing from three databases:
366 universal constants, atomic numbers, and constants related to
368 (license license:gpl3+)
369 (home-page "https://www.gnu.org/software/dionysus/")))
377 (uri (string-append "mirror://gnu/gsl/gsl-"
381 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
382 (patches (search-patches "gsl-test-i686.patch"))))
383 (build-system gnu-build-system)
385 `(;; Currently there are numerous tests that fail on "exotic"
386 ;; architectures such as aarch64 and ppc64le.
387 ,@(if (string-prefix? "aarch64-linux"
388 (or (%current-target-system) (%current-system)))
391 (home-page "https://www.gnu.org/software/gsl/")
392 (synopsis "Numerical library for C and C++")
394 "The GNU Scientific Library is a library for numerical analysis in C
395 and C++. It includes a wide range of mathematical routines, with over 1000
396 functions in total. Subject areas covered by the library include:
397 differential equations, linear algebra, Fast Fourier Transforms and random
399 (license license:gpl3+)))
408 (uri (string-append "mirror://gnu/glpk/glpk-"
412 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
413 (build-system gnu-build-system)
417 `(#:configure-flags '("--with-gmp")))
418 (home-page "https://www.gnu.org/software/glpk/")
419 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
421 "GLPK is a C library for solving large-scale linear programming (LP),
422 mixed integer programming (MIP), and other related problems. It supports the
423 GNU MathProg modeling language, a subset of the AMPL language, and features a
424 translator for the language. In addition to the C library, a stand-alone
425 LP/MIP solver is included in the package.")
426 (license license:gpl3+)))
435 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
437 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
439 "/4ti2-" version ".tar.gz"))
441 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
442 (build-system gnu-build-system)
444 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
448 (home-page "http://www.4ti2.de/")
449 (synopsis "Mathematical tool suite for problems on linear spaces")
451 "4ti2 implements algorithms for solving algebraic, geometric and
452 combinatorial problems on linear spaces. Among others, it solves systems
453 of linear equations, computes extreme rays of polyhedral cones, solves
454 integer programming problems and computes Markov bases for statistics.")
455 (license license:gpl2+)))
457 (define-public cddlib
464 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
465 (string-delete #\. version) ".tar.gz"))
468 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
469 (build-system gnu-build-system)
472 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
473 (synopsis "Library for convex hulls and extreme rays of polyhedra")
475 "The C-library cddlib implements the Double Description Method of
476 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
477 rays of a general convex polyhedron given by a system of linear inequalities
478 in arbitrary dimension. It can also be used for the converse operation of
479 computing convex hulls.")
480 (license license:gpl2+)))
482 (define-public arpack-ng
486 (home-page "https://github.com/opencollab/arpack-ng")
489 (uri (git-reference (url home-page) (commit version)))
490 (file-name (git-file-name name version))
493 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
494 (build-system gnu-build-system)
496 `(("autoconf" ,autoconf)
497 ("automake" ,automake)
498 ("libtool" ,libtool)))
501 ("fortran" ,gfortran)))
502 (synopsis "Fortran subroutines for solving eigenvalue problems")
504 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
505 large scale eigenvalue problems.")
506 (license (license:non-copyleft "file://COPYING"
507 "See COPYING in the distribution."))))
509 (define-public arpack-ng-3.3.0
513 (name (package-name arpack-ng))
514 (home-page (package-home-page arpack-ng))
518 (uri (string-append home-page "/archive/" version ".tar.gz"))
519 (file-name (string-append name "-" version ".tar.gz"))
522 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
524 (define-public arpack-ng-openmpi
525 (package (inherit arpack-ng)
526 (name "arpack-ng-openmpi")
529 ,@(package-inputs arpack-ng)))
531 (substitute-keyword-arguments (package-arguments arpack-ng)
532 ((#:configure-flags _ '())
534 ((#:phases phases '%standard-phases)
535 `(modify-phases ,phases
536 (add-before 'check 'mpi-setup
538 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
540 (define-public lapack
547 (uri (string-append "http://www.netlib.org/lapack/lapack-"
551 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
552 (build-system cmake-build-system)
553 (home-page "http://www.netlib.org/lapack/")
554 (inputs `(("fortran" ,gfortran)
555 ("python" ,python-2)))
557 `(#:configure-flags (list
558 "-DBUILD_SHARED_LIBS:BOOL=YES"
561 ;; Build the 'LAPACKE_clatms' functions.
562 "-DLAPACKE_WITH_TMG=ON")
564 (modify-phases %standard-phases
565 (add-before 'check 'patch-python
566 (lambda* (#:key inputs #:allow-other-keys)
567 (let ((python (assoc-ref inputs "python")))
568 (substitute* "lapack_testing.py"
569 (("/usr/bin/env python") python)))
571 (synopsis "Library for numerical linear algebra")
573 "LAPACK is a Fortran 90 library for solving the most commonly occurring
574 problems in numerical linear algebra.")
575 (license (license:non-copyleft "file://LICENSE"
576 "See LICENSE in the distribution."))))
578 (define-public scalapack
585 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
589 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
590 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
591 (build-system cmake-build-system)
594 ("fortran" ,gfortran)
595 ("lapack" ,lapack))) ;for testing only
597 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
598 #:phases (modify-phases %standard-phases
599 (add-before 'check 'mpi-setup
601 (home-page "http://www.netlib.org/scalapack/")
602 (synopsis "Library for scalable numerical linear algebra")
604 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
605 routines on parallel distributed memory machines. ScaLAPACK solves dense and
606 banded linear systems, least squares problems, eigenvalue problems, and
607 singular value problems.")
608 (license (license:bsd-style "file://LICENSE"
609 "See LICENSE in the distribution."))))
611 (define-public gnuplot
617 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
621 (base32 "1vllgap08nhvdmc03idmkdnk9cfl2bp81hps50q1pqrr640qzp9m"))))
622 (build-system gnu-build-system)
623 (inputs `(("readline" ,readline)
629 `(("pkg-config" ,pkg-config)
630 ("texlive" ,texlive-tiny)))
631 (arguments `(#:configure-flags (list (string-append
632 "--with-texdir=" %output
633 "/texmf-local/tex/latex/gnuplot"))))
634 (home-page "http://www.gnuplot.info")
635 (synopsis "Command-line driven graphing utility")
636 (description "Gnuplot is a portable command-line driven graphing
637 utility. It was originally created to allow scientists and students to
638 visualize mathematical functions and data interactively, but has grown to
639 support many non-interactive uses such as web scripting. It is also used as a
640 plotting engine by third-party applications like Octave.")
641 ;; X11 Style with the additional restriction that derived works may only be
642 ;; distributed as patches to the original.
643 (license (license:fsf-free
644 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
653 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
655 (file-name (string-append name "-" version ".tar.gz"))
658 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
660 `(("fortran" ,gfortran)))
661 (build-system gnu-build-system)
662 (synopsis "General Cartographic Transformation Package (GCTP)")
664 "The General Cartographic Transformation Package (GCTP) is a system of
665 software routines designed to permit the transformation of coordinate pairs
666 from one map projection to another. The GCTP is the standard computer
667 software used by the National Mapping Division for map projection
669 (home-page "https://github.com/OkoSanto/GCTP")
670 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
679 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
680 version "/src/hdf-" version ".tar.bz2"))
682 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
683 (patches (search-patches "hdf4-architectures.patch"
684 "hdf4-reproducibility.patch"
685 "hdf4-shared-fortran.patch"))))
686 (build-system gnu-build-system)
688 `(("gfortran" ,gfortran)
693 ("libjpeg" ,libjpeg)))
695 `(#:parallel-tests? #f
696 #:configure-flags '("--enable-shared")
698 (modify-phases %standard-phases
699 ;; This is inspired by two of Debian's patches.
700 (add-before 'configure 'add-more-aarch64-support
702 (substitute* '("mfhdf/ncgen/ncgen.l"
703 "mfhdf/ncgen/ncgenyy.c"
704 "mfhdf/libsrc/netcdf.h.in")
705 (("AIX5L64") "__aarch64__"))
707 (add-before 'configure 'patchbuild
710 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
712 (("/bin/mkdir") "mkdir"))
713 (substitute* (find-files "." "^Makefile\\.in$")
714 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
715 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
716 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
717 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
718 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
720 (add-after 'configure 'patch-settings
722 ;; libhdf4.settings contains the full path of the
723 ;; compilers used, and its contents are included in
724 ;; .so-files. We truncate the hashes to avoid
725 ;; unnecessary store references to those compilers:
726 (substitute* "libhdf4.settings"
727 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
728 (string-append prefix (string-take hash 10) "...")))
731 (home-page "https://www.hdfgroup.org/products/hdf4/")
733 "Library and multi-object file format for storing and managing data")
734 (description "HDF4 is a library and multi-object file format for storing
735 and managing data between machines. HDF4 is an older hierarchical data format,
736 incompatible with HDF5.")
738 (license:non-copyleft
739 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
741 (define-public hdf4-alt
746 (substitute-keyword-arguments (package-arguments hdf4)
747 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
749 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
758 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
759 "hdf5-" (version-major+minor version)
760 "/hdf5-" version "/src/hdf5-"
762 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
764 (match (string-split version #\.)
766 (string-append major minor)))
767 "/src/hdf5-" version ".tar.bz2")))
769 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
770 (patches (search-patches "hdf5-config-date.patch"
771 "hdf5-1.8-mpi-deprecations.patch"))))
772 (build-system gnu-build-system)
776 `(("gfortran" ,gfortran)))
777 (outputs '("out" ; core library
778 "fortran")) ; fortran interface
780 `(;; Some of the users, notably Flann, need the C++ interface.
781 #:configure-flags '("--enable-cxx"
783 "--enable-fortran2003")
784 ;; Use -fPIC to allow the R bindings to link with the static libraries
785 #:make-flags (list "CFLAGS=-fPIC"
788 (modify-phases %standard-phases
789 (add-before 'configure 'patch-configure
790 (lambda* (#:key outputs #:allow-other-keys)
791 (substitute* "configure"
793 (substitute* "fortran/src/Makefile.in"
794 (("libhdf5_fortran_la_LDFLAGS =")
795 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
796 (assoc-ref outputs "fortran") "/lib")))
797 (substitute* "hl/fortran/src/Makefile.in"
798 (("libhdf5hl_fortran_la_LDFLAGS =")
799 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
800 (assoc-ref outputs "fortran") "/lib")))
802 (add-after 'configure 'patch-settings
804 ;; libhdf5.settings contains the full path of the
805 ;; compilers used, and its contents are included in
806 ;; libhdf5.so. We truncate the hashes to avoid
807 ;; unnecessary store references to those compilers:
808 (substitute* "src/libhdf5.settings"
809 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
810 (string-append prefix (string-take hash 10) "..."))
811 ;; Don't record the build-time kernel version to make the
812 ;; settings file reproducible.
813 (("Uname information:.*")
814 "Uname information: Linux\n"))
816 (add-after 'install 'patch-references
817 (lambda* (#:key inputs outputs #:allow-other-keys)
818 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
819 (zlib (assoc-ref inputs "zlib")))
820 (substitute* (find-files bin "h5p?cc")
822 (string-append "-L" zlib "/lib " lib)))
824 (add-after 'install 'split
825 (lambda* (#:key inputs outputs #:allow-other-keys)
826 ;; Move all fortran-related files
827 (let* ((out (assoc-ref outputs "out"))
828 (bin (string-append out "/bin"))
829 (lib (string-append out "/lib"))
830 (inc (string-append out "/include"))
831 (ex (string-append out "/share/hdf5_examples/fortran"))
832 (fort (assoc-ref outputs "fortran"))
833 (fbin (string-append fort "/bin"))
834 (flib (string-append fort "/lib"))
835 (finc (string-append fort "/include"))
836 (fex (string-append fort "/share/hdf5_examples/fortran")))
841 ;; Note: When built with --enable-parallel, the 'h5fc' file
842 ;; doesn't exist, hence this condition.
843 (when (file-exists? (string-append bin "/h5fc"))
844 (rename-file (string-append bin "/h5fc")
845 (string-append fbin "/h5fc")))
846 (for-each (lambda (file)
848 (string-append flib "/" (basename file))))
849 (find-files lib ".*fortran.*"))
850 (for-each (lambda (file)
852 (string-append finc "/" (basename file))))
853 (find-files inc ".*mod"))
854 (for-each (lambda (file)
856 (string-append fex "/" (basename file))))
857 (find-files ex ".*"))
858 (delete-file-recursively ex))
860 (home-page "http://www.hdfgroup.org")
861 (synopsis "Management suite for extremely large and complex data")
862 (description "HDF5 is a suite that makes possible the management of
863 extremely large and complex data collections.")
864 (license (license:x11-style
865 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
867 (define-public hdf5-1.10
868 (package (inherit hdf5)
873 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
874 "hdf5-" (version-major+minor version)
875 "/hdf5-" version "/src/hdf5-"
877 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
880 (take (string-split version #\.) 2))
881 "/src/hdf5-" version ".tar.bz2")))
883 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
884 (patches (search-patches "hdf5-config-date.patch"
885 "hdf5-mpi-deprecations.patch"))))))
887 (define-public hdf-java
895 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
896 version "/src/CMake-hdfjava-" version ".tar.gz"))
898 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
899 (modules '((guix build utils)))
900 (snippet ; Make sure we don't use the bundled sources and binaries.
902 (for-each delete-file
903 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
904 "HDF4.tar.gz" "HDF5.tar.gz"))
905 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
907 (build-system gnu-build-system)
909 `(("jdk" ,icedtea "jdk")
910 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
912 ("hamcrest-core" ,java-hamcrest-core)
913 ("junit" ,java-junit)
914 ("slf4j-simple" ,java-slf4j-simple)))
920 ("slf4j-api" ,java-slf4j-api)))
923 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
924 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
925 (assoc-ref %build-inputs "jdk") "/lib" )
926 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
927 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
930 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
931 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
932 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
933 (string-append "JPEGLIB="
934 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
938 (modify-phases %standard-phases
939 (add-before 'configure 'chdir-to-source
940 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
941 (add-before 'configure 'patch-build
942 (lambda* (#:key inputs outputs #:allow-other-keys)
943 (substitute* "configure"
944 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
945 (("/bin/cat") (which "cat")))
946 ;; Set classpath for compilation
947 (substitute* '("hdf/hdf5lib/Makefile.in"
948 "hdf/hdf5lib/exceptions/Makefile.in"
949 "hdf/hdflib/Makefile.in")
950 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
951 (string-append (assoc-ref inputs "slf4j-api")
952 "/share/java/slf4j-api.jar")))
953 ;; Replace outdated config.sub and config.guess:
954 (with-directory-excursion "config"
955 (for-each (lambda (file)
957 (string-append (assoc-ref inputs "automake")
959 ,(version-major+minor (package-version automake))
961 '("config.sub" "config.guess")))
963 ;; Fix embedded version number
964 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
965 (substitute* "hdf/hdf5lib/H5.java"
967 (string-join hdf5version ", "))))
969 (mkdir-p (string-append (assoc-ref outputs "out")))
970 ;; Set classpath for tests
971 (let* ((build-dir (getcwd))
972 (lib (string-append build-dir "/lib"))
973 (jhdf (string-append lib "/jhdf.jar"))
974 (jhdf5 (string-append lib "/jhdf5.jar"))
977 (string-append (assoc-ref inputs i)
978 "/share/java/" i ".jar"))
979 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
981 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
983 (substitute* '("test/hdf5lib/Makefile.in"
984 "test/hdf5lib/junit.sh.in"
985 "examples/runExample.sh.in")
987 (string-append (assoc-ref inputs "coreutils")
990 (string-append (assoc-ref inputs "coreutils")
992 (("CLASSPATH=[^\n]*")
993 (string-append "CLASSPATH=" class-path)))
994 (setenv "CLASSPATH" class-path))
996 (add-before 'check 'build-examples
998 (apply invoke `("javac"
999 ,@(find-files "examples" ".*\\.java"))))))
1001 #:parallel-build? #f
1003 #:parallel-tests? #f ))
1004 (home-page "https://support.hdfgroup.org/products/java")
1005 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1006 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1007 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1010 ;; BSD-style license:
1011 (license (license:x11-style
1012 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1013 /current/src/unpacked/COPYING"))))
1015 (define-public hdf-eos2
1022 (uri "ftp://edhs1.gsfc.nasa.gov\
1023 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1025 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1026 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1027 "hdf-eos2-build-shared.patch"
1028 "hdf-eos2-fortrantests.patch"))))
1029 (build-system gnu-build-system)
1031 `(("gfortran" ,gfortran)))
1033 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1035 ("libjpeg" ,libjpeg)
1038 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1039 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1040 #:parallel-tests? #f))
1041 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1042 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1043 (description "HDF-EOS2 is a software library built on HDF4 which supports
1044 the construction of data structures used in NASA's Earth Observing
1045 System (Grid, Point and Swath).")
1047 ;; Source files carry a permissive license header.
1048 (license (license:non-copyleft home-page))))
1050 (define-public hdf-eos5
1056 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1057 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1060 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1061 (patches (search-patches "hdf-eos5-build-shared.patch"
1062 "hdf-eos5-remove-gctp.patch"
1063 "hdf-eos5-fix-szip.patch"
1064 "hdf-eos5-fortrantests.patch"))))
1066 `(("gfortran" ,gfortran)))
1067 (build-system gnu-build-system)
1073 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1074 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1075 #:parallel-tests? #f))
1076 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1078 "HDF-EOS5 is a software library built on HDF5 to support the construction
1079 of data structures used in NASA's Earth Observing System (Grid, Point and
1081 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1083 ;; Source files carry a permissive license header.
1084 (license (license:non-copyleft home-page))))
1086 (define-public hdf5-parallel-openmpi
1087 (package (inherit hdf5)
1088 (name "hdf5-parallel-openmpi")
1091 ,@(package-inputs hdf5)))
1093 (substitute-keyword-arguments (package-arguments hdf5)
1094 ((#:configure-flags flags)
1095 ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags)))
1097 `(modify-phases ,phases
1098 (add-after 'build 'mpi-setup
1100 (add-before 'check 'patch-tests
1102 ;; OpenMPI's mpirun will exit with non-zero status if it
1103 ;; detects an "abnormal termination", i.e. any process not
1104 ;; calling MPI_Finalize(). Since the test is explicitely
1105 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1106 ;; H5C_flush_cache from being called, mpirun will always
1107 ;; complain, so turn this test off.
1108 (substitute* "testpar/Makefile"
1109 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1110 (string-append front back "\n")))
1111 (substitute* "tools/h5diff/testph5diff.sh"
1112 (("/bin/sh") (which "sh")))
1114 (synopsis "Management suite for data with parallel IO support")))
1116 (define-public h5check
1123 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1124 "h5check/src/h5check-" version ".tar.gz"))
1127 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1128 (build-system gnu-build-system)
1129 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1130 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1131 (synopsis "HDF5 format checker")
1132 (description "@code{h5check} is a validation tool for verifying that an
1133 HDF5 file is encoded according to the HDF File Format Specification.")
1134 (license (license:x11-style "file://COPYING"))))
1142 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1147 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1148 (build-system cmake-build-system)
1149 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1150 (inputs `(("lapack" ,lapack)
1152 ;; FIXME: Even though the fonts are available dvips complains:
1153 ;; "Font cmmi10 not found; characters will be left blank."
1155 `(("texlive" ,texlive-tiny)
1156 ("ghostscript" ,ghostscript)
1157 ("doxygen" ,doxygen)))
1158 (home-page "http://itpp.sourceforge.net")
1159 (synopsis "C++ library of maths, signal processing and communication classes")
1160 (description "IT++ is a C++ library of mathematical, signal processing and
1161 communication classes and functions. Its main use is in simulation of
1162 communication systems and for performing research in the area of
1163 communications. The kernel of the library consists of generic vector and
1164 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1165 similar to MATLAB, GNU Octave or SciPy.")
1166 (license license:gpl3+)))
1168 (define-public netcdf
1175 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1176 "netcdf-" version ".tar.gz"))
1179 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1180 (patches (search-patches "netcdf-date-time.patch"
1181 "netcdf-tst_h_par.patch"))))
1182 (build-system gnu-build-system)
1185 ("doxygen" ,doxygen)
1186 ("graphviz" ,graphviz)))
1188 `(("hdf4" ,hdf4-alt)
1191 ("libjpeg" ,libjpeg)))
1193 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1195 #:phases (modify-phases %standard-phases
1196 (add-before 'configure 'fix-source-date
1198 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1199 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1200 ;; to '1st hour of the current day', and therefore makes the
1201 ;; package not reproducible.
1202 (substitute* "./configure"
1203 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1204 "date --date='@0'"))
1206 (add-after 'configure 'patch-settings
1208 ;; libnetcdf.settings contains the full filename of the compilers
1209 ;; used to build the library. We truncate the hashes of those
1210 ;; filenames to avoid unnecessary references to the corresponding
1212 (substitute* "libnetcdf.settings"
1213 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1214 (string-append prefix (string-take hash 10) "...")))
1217 #:parallel-tests? #f)) ;various race conditions
1218 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1219 (synopsis "Library for scientific data")
1220 (description "NetCDF is an interface for scientific data access and a
1221 software library that provides an implementation of the interface. The netCDF
1222 library defines a machine-independent format for representing scientific data.
1223 Together, the interface, library, and format support the creation, access, and
1224 sharing of scientific data.")
1225 (license (license:x11-style "file://COPYRIGHT"))))
1227 (define-public netcdf-parallel-openmpi
1228 (package (inherit netcdf)
1229 (name "netcdf-parallel-openmpi")
1232 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1233 (package-inputs netcdf))))
1234 ;; TODO: Replace pkg-config references in nc-config with absolute references
1236 (substitute-keyword-arguments (package-arguments netcdf)
1237 ((#:configure-flags flags)
1238 `(cons* "CC=mpicc" "CXX=mpicxx"
1239 "--enable-parallel-tests"
1240 ;; Shared libraries not supported with parallel IO.
1241 "--disable-shared" "--with-pic"
1244 (define-public netcdf-fortran
1246 (name "netcdf-fortran")
1251 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1255 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1256 (build-system gnu-build-system)
1258 `(#:parallel-tests? #f))
1260 `(("netcdf" ,netcdf)))
1262 `(("gfortran" ,gfortran)))
1263 (synopsis "Fortran interface for the netCDF library")
1264 (description (package-description netcdf))
1265 (home-page (package-home-page netcdf))
1266 (license (package-license netcdf))))
1268 (define-public nlopt
1274 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1277 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1278 (build-system gnu-build-system)
1280 `(;; Shared libraries are not built by default. They are required to
1281 ;; build the Guile, Octave, and Python bindings.
1282 #:configure-flags '("--enable-shared")
1285 (modify-phases %standard-phases
1286 (add-before 'configure 'set-libnlopt-file-name
1287 (lambda* (#:key outputs #:allow-other-keys)
1288 ;; Make sure the Scheme module refers to the library by its
1289 ;; absolute file name (we cannot do that from a snippet
1290 ;; because the expansion of @libdir@ contains
1292 (let ((out (assoc-ref outputs "out")))
1293 (substitute* "swig/nlopt.scm.in"
1295 (string-append out "/lib/libnlopt")))
1297 (inputs `(("guile" ,guile-2.0)))
1298 (native-inputs `(("pkg-config" ,pkg-config)))
1299 (home-page "http://ab-initio.mit.edu/wiki/")
1300 (synopsis "Library for nonlinear optimization")
1301 (description "NLopt is a library for nonlinear optimization, providing a
1302 common interface for a number of different free optimization routines available
1303 online as well as original implementations of various other algorithms.")
1304 (license license:lgpl2.1+)))
1306 (define-public ipopt
1313 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1317 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1318 (modules '((guix build utils)))
1320 ;; Make sure we don't use the bundled software.
1322 (delete-file-recursively "ThirdParty")
1324 (build-system gnu-build-system)
1326 '(#:phases (modify-phases %standard-phases
1327 (add-after 'install 'add--L-flags-in-ipopt.pc
1328 (lambda* (#:key inputs outputs #:allow-other-keys)
1329 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1330 ;; move it to "Libs.private" where it belongs, and add a
1331 ;; '-L' flag for LAPACK.
1332 (let ((out (assoc-ref outputs "out"))
1333 (lapack (assoc-ref inputs "lapack")))
1334 (substitute* (string-append out "/lib/pkgconfig/"
1336 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1337 (string-append "Libs: " before " " after "\n"
1338 "Libs.private: " before
1339 "-L" lapack "/lib -llapack -lblas "
1343 `(("gfortran" ,gfortran)))
1345 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1346 `(("lapack" ,lapack))) ;for both libblas and liblapack
1347 (home-page "http://www.coin-or.org")
1348 (synopsis "Large-scale nonlinear optimizer")
1350 "The Interior Point Optimizer (IPOPT) is a software package for
1351 large-scale nonlinear optimization. It provides C++, C, and Fortran
1353 (license license:epl1.0)))
1355 (define-public ceres
1357 (name "ceres-solver")
1359 (home-page "http://ceres-solver.org/")
1362 (uri (string-append home-page "ceres-solver-"
1366 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1367 (build-system cmake-build-system)
1369 ;; TODO: Build HTML user documentation and install separately.
1370 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1371 "-DBUILD_SHARED_LIBS=ON")
1373 #:phases (modify-phases %standard-phases
1374 (add-before 'configure 'set-library-directory
1376 ;; Install libraries to lib/, not lib64/.
1377 (substitute* "internal/ceres/CMakeLists.txt"
1378 (("set\\(LIB_SUFFIX \"64\"\\)")
1379 "set(LIB_SUFFIX \"\")"))
1382 `(("pkg-config" ,pkg-config)))
1384 `(("glog" ,glog))) ;for #include <glog/glog.h>
1389 ("suitesparse" ,suitesparse)
1390 ("gflags" ,gflags)))
1391 (synopsis "C++ library for solving large optimization problems")
1393 "Ceres Solver is a C++ library for modeling and solving large,
1394 complicated optimization problems. It is a feature rich, mature and
1395 performant library which has been used in production since 2010. Ceres Solver
1396 can solve two kinds of problems:
1398 @item non-linear least squares problems with bounds constraints;
1399 @item general unconstrained optimization problems.
1401 (license license:bsd-3)))
1403 ;; For a fully featured Octave, users are strongly recommended also to install
1404 ;; the following packages: less, ghostscript, gnuplot.
1405 (define-public octave-cli
1412 (uri (string-append "mirror://gnu/octave/octave-"
1416 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1417 (build-system gnu-build-system)
1419 `(("lapack" ,lapack)
1421 ("readline" ,readline)
1426 ("arpack" ,arpack-ng)
1429 ("fontconfig" ,fontconfig)
1430 ("freetype" ,freetype)
1437 ("texinfo" ,texinfo)
1438 ("graphicsmagick" ,graphicsmagick)
1439 ("suitesparse" ,suitesparse)
1440 ("libsndfile" ,libsndfile)
1441 ("portaudio" ,portaudio)
1442 ("alsa-lib" ,alsa-lib)))
1445 ("gfortran" ,gfortran)
1446 ("pkg-config" ,pkg-config)
1448 ;; The following inputs are not actually used in the build process.
1449 ;; However, the ./configure gratuitously tests for their existence and
1450 ;; assumes that programs not present at build time are also not, and
1451 ;; can never be, available at run time! If these inputs are therefore
1452 ;; not present, support for them will be built out. However, Octave
1453 ;; will still run without them, albeit without the features they
1456 ("ghostscript" ,ghostscript)
1457 ("gnuplot" ,gnuplot)))
1458 ;; Octave code uses this variable to detect directories holding multiple CA
1459 ;; certificates to verify peers with. This is required for the networking
1460 ;; functions that require encryption to work properly.
1461 (native-search-paths
1462 (list (search-path-specification
1463 (variable "CURLOPT_CAPATH")
1464 (files '("etc/ssl/certs")))))
1467 (list (string-append "--with-shell="
1468 (assoc-ref %build-inputs "bash")
1471 (modify-phases %standard-phases
1472 (add-after 'configure 'configure-makeinfo
1473 (lambda* (#:key inputs #:allow-other-keys)
1474 (substitute* "libinterp/corefcn/help.h"
1477 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1479 (home-page "https://www.gnu.org/software/octave/")
1480 (synopsis "High-level language for numerical computation")
1481 (description "GNU Octave is a high-level interpreted language that is
1482 specialized for numerical computations. It can be used for both linear and
1483 non-linear applications and it provides great support for visualizing results.
1484 Work may be performed both at the interactive command-line as well as via
1486 (license license:gpl3+)))
1488 (define-public octave
1489 (package (inherit octave-cli)
1492 (inherit (package-source octave-cli))))
1494 `(("qscintilla" ,qscintilla)
1496 ,@(package-inputs octave-cli)))
1498 `(("qttools" , qttools) ;for lrelease
1499 ("texlive" ,texlive) ;for texi2dvi
1500 ,@(package-native-inputs octave-cli)))
1502 (substitute-keyword-arguments (package-arguments octave-cli)
1504 `(modify-phases ,phases
1505 (add-before 'configure 'patch-qscintilla-library-name
1506 (lambda* (#:key inputs #:allow-other-keys)
1507 ;; The QScintilla library that the Octave configure script tries
1508 ;; to link with should be named libqscintilla-qt5.so, but the
1509 ;; QScintilla input provides the shared library as
1510 ;; libqscintilla2_qt5.so.
1511 (substitute* "configure"
1512 (("qscintilla2-qt5")
1516 (define-public qtoctave
1517 (deprecated-package "qtoctave" octave))
1519 (define-public opencascade-oce
1521 (name "opencascade-oce")
1527 "https://github.com/tpaviot/oce/archive/OCE-"
1530 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1533 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1534 (build-system cmake-build-system)
1537 (list "-DOCE_TESTING:BOOL=ON"
1538 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1539 "-DOCE_DRAW:BOOL=ON"
1540 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1541 (assoc-ref %outputs "out"))
1542 "-UCMAKE_INSTALL_RPATH")))
1544 `(("freetype" ,freetype)
1551 `(("python" ,python-wrapper)))
1552 (home-page "https://github.com/tpaviot/oce")
1553 (synopsis "Libraries for 3D modeling and numerical simulation")
1555 "Open CASCADE is a set of libraries for the development of applications
1556 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1557 C++ class libraries providing services for 3D surface and solid modeling, CAD
1558 data exchange, and visualization. It is used for development of specialized
1559 software dealing with 3D models in design (CAD), manufacturing (CAM),
1560 numerical simulation (CAE), measurement equipment (CMM), and quality
1561 control (CAQ) domains.
1563 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1564 patches, improvements, and experiments contributed by users over the official
1565 Open CASCADE library.")
1566 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1567 ; use of header files; see
1568 ; OCCT_LGPL_EXCEPTION.txt
1569 license:public-domain; files
1570 ; src/Standard/Standard_StdAllocator.hxx and
1571 ; src/NCollection/NCollection_StdAllocator.hxx
1572 license:expat; file src/OpenGl/OpenGl_glext.h
1573 license:bsd-3)))); test framework gtest
1582 (uri (string-append "http://gmsh.info/src/gmsh-"
1583 version "-source.tgz"))
1585 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1586 (modules '((guix build utils)))
1588 ;; Remove non-free METIS code
1590 (delete-file-recursively "contrib/Metis")
1592 (build-system cmake-build-system)
1595 ("gfortran" ,gfortran)
1601 ("opencascade-oce" ,opencascade-oce)
1603 ("libxext" ,libxext)))
1605 `(("fontconfig" ,fontconfig)
1606 ("libxft" ,libxft)))
1608 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1609 "-DENABLE_BUILD_SHARED:BOOL=ON"
1610 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1611 (home-page "http://www.geuz.org/gmsh/")
1612 (synopsis "3D finite element grid generator")
1613 (description "Gmsh is a 3D finite element grid generator with a built-in
1614 CAD engine and post-processor. Its design goal is to provide a fast, light
1615 and user-friendly meshing tool with parametric input and advanced
1616 visualization capabilities. Gmsh is built around four modules: geometry,
1617 mesh, solver and post-processing. The specification of any input to these
1618 modules is done either interactively using the graphical user interface or in
1619 ASCII text files using Gmsh's own scripting language.")
1620 (license license:gpl2+)))
1622 (define-public maxflow
1629 (url "https://github.com/gerddie/maxflow.git")
1630 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1631 (file-name (string-append name "-" version "-checkout"))
1634 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1635 (build-system cmake-build-system)
1636 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1637 (synopsis "Library implementing Maxflow algorithm")
1638 (description "An implementation of the maxflow algorithm described in
1639 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1640 Energy Minimization in Computer Vision.\n
1641 Yuri Boykov and Vladimir Kolmogorov.\n
1642 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1644 (license license:gpl3+)))
1646 (define-public petsc
1653 ;; The *-lite-* tarball does not contain the *large* documentation
1654 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1655 "petsc-lite-" version ".tar.gz"))
1657 (base32 "0fk16944zh3473ra198kdkxdn08rq7b6ap838hxy1mh1i0hb488r"))))
1658 (outputs '("out" ; libraries and headers
1659 "examples")) ; ~30MiB of examples
1660 (build-system gnu-build-system)
1662 `(("python" ,python-2)))
1664 `(("gfortran" ,gfortran)
1666 ("superlu" ,superlu)
1667 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1668 ;; leaving out opengl, as configuration seems to only be for mac
1671 `(#:test-target "test"
1672 #:parallel-build? #f ; build is parallel by default
1678 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1679 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1680 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1682 (modify-phases %standard-phases
1684 ;; PETSc's configure script is actually a python script, so we can't
1685 ;; run it with bash.
1686 (lambda* (#:key outputs (configure-flags '())
1688 (let* ((prefix (assoc-ref outputs "out"))
1689 (flags `(,(string-append "--prefix=" prefix)
1690 ,@configure-flags)))
1691 (format #t "build directory: ~s~%" (getcwd))
1692 (format #t "configure flags: ~s~%" flags)
1693 (apply invoke "./configure" flags))))
1694 (add-after 'configure 'clean-local-references
1695 (lambda* (#:key outputs #:allow-other-keys)
1696 (let ((out (assoc-ref outputs "out")))
1697 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1698 ;; Prevent build directory from leaking into compiled code
1700 ;; Scrub timestamp for reproducibility
1701 ((".*Libraries compiled on.*") ""))
1702 (substitute* (find-files "." "petscvariables")
1703 ;; Do not expose build machine characteristics, set to defaults.
1704 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1705 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1707 (add-after 'install 'clean-install
1708 ;; Try to keep installed files from leaking build directory names.
1709 (lambda* (#:key inputs outputs #:allow-other-keys)
1710 (let ((out (assoc-ref outputs "out")))
1711 (substitute* (map (lambda (file)
1712 (string-append out "/lib/petsc/conf/" file))
1713 '("petscvariables"))
1715 ;; Make compiler references point to the store
1716 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1717 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1718 (string-append "= " (which compiler))))
1719 ;; PETSc installs some build logs, which aren't necessary.
1720 (for-each (lambda (file)
1721 (let ((f (string-append out "/lib/petsc/conf/" file)))
1722 (when (file-exists? f)
1724 '("configure.log" "make.log" "gmake.log"
1725 "test.log" "error.log" "RDict.db"
1726 "PETScBuildInternal.cmake"
1727 ;; Once installed, should uninstall with Guix
1730 (add-after 'install 'move-examples
1731 (lambda* (#:key outputs #:allow-other-keys)
1732 (let* ((out (assoc-ref outputs "out"))
1733 (examples (assoc-ref outputs "examples"))
1734 (exdir (string-append out "/share/petsc/examples"))
1735 (exdir' (string-append examples "/share/petsc/examples")))
1736 (copy-recursively exdir exdir')
1737 (delete-file-recursively exdir)
1739 (home-page "http://www.mcs.anl.gov/petsc")
1740 (synopsis "Library to solve PDEs")
1741 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1742 data structures and routines for the scalable (parallel) solution of
1743 scientific applications modeled by partial differential equations.")
1744 (license (license:non-copyleft
1745 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1747 (define-public petsc-complex
1748 (package (inherit petsc)
1749 (name "petsc-complex")
1751 (substitute-keyword-arguments (package-arguments petsc)
1752 ((#:configure-flags cf)
1753 `(cons "--with-scalar-type=complex" ,cf))))
1754 (synopsis "Library to solve PDEs (with complex scalars)")))
1756 (define-public petsc-openmpi
1757 (package (inherit petsc)
1758 (name "petsc-openmpi")
1760 `(("hdf5" ,hdf5-parallel-openmpi)
1761 ("hypre" ,hypre-openmpi)
1763 ("mumps" ,mumps-openmpi)
1764 ("openmpi" ,openmpi)
1765 ("scalapack" ,scalapack)
1766 ("scotch" ,pt-scotch32)
1767 ,@(package-inputs petsc)))
1769 (substitute-keyword-arguments (package-arguments petsc)
1770 ((#:configure-flags cf)
1772 "--with-mpiexec=mpirun"
1775 "--with-scalapack=1"
1777 ,(string-append "--with-mpi-dir="
1778 (assoc-ref %build-inputs "openmpi"))
1779 ,(string-append "--with-hdf5-include="
1780 (assoc-ref %build-inputs "hdf5") "/include")
1781 ,(string-append "--with-hdf5-lib="
1782 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1783 ,@(delete "--with-mpi=0" ,cf)))
1785 `(modify-phases ,phases
1786 (add-before 'configure 'mpi-setup
1787 ,%openmpi-setup)))))
1788 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1790 (define-public petsc-complex-openmpi
1791 (package (inherit petsc-complex)
1792 (name "petsc-complex-openmpi")
1794 `(("openmpi" ,openmpi)
1795 ,@(package-inputs petsc-complex)))
1797 (substitute-keyword-arguments (package-arguments petsc-complex)
1798 ((#:configure-flags cf)
1799 ``("--with-mpiexec=mpirun"
1800 ,(string-append "--with-mpi-dir="
1801 (assoc-ref %build-inputs "openmpi"))
1802 ,@(delete "--with-mpi=0" ,cf)))))
1803 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1805 (define-public python-petsc4py
1807 (name "python-petsc4py")
1812 (uri (pypi-uri "petsc4py" version))
1815 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1816 (build-system python-build-system)
1819 (modify-phases %standard-phases
1820 (add-before 'build 'pre-build
1822 ;; Define path to PETSc installation.
1823 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1825 (add-before 'check 'mpi-setup
1828 `(("petsc" ,petsc-openmpi)
1829 ("python-numpy" ,python-numpy)))
1830 (home-page "https://bitbucket.org/petsc/petsc4py/")
1831 (synopsis "Python bindings for PETSc")
1832 (description "PETSc, the Portable, Extensible Toolkit for
1833 Scientific Computation, is a suite of data structures and routines for
1834 the scalable (parallel) solution of scientific applications modeled by
1835 partial differential equations. It employs the MPI standard for all
1836 message-passing communication. @code{petsc4py} provides Python
1837 bindings to almost all functions of PETSc.")
1838 (license license:bsd-3)))
1840 (define-public python-kiwisolver
1842 (name "python-kiwisolver")
1846 (uri (pypi-uri "kiwisolver" version))
1849 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1850 (build-system python-build-system)
1851 (home-page "https://github.com/nucleic/kiwi")
1852 (synopsis "Fast implementation of the Cassowary constraint solver")
1854 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1855 solving algorithm. Kiwi has been designed from the ground up to be
1856 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1857 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1858 savings are consistently > 5x.")
1859 (license license:bsd-3)))
1861 (define-public python2-kiwisolver
1862 (package-with-python2 python-kiwisolver))
1864 (define-public slepc
1871 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1875 "188j1a133q91h8pivpnzwcf78kz8dvz2nzf6ndnjygdbqb48fizn"))))
1876 (build-system gnu-build-system)
1878 `(("python" ,python-2)))
1880 `(("arpack" ,arpack-ng)
1881 ("gfortran" ,gfortran)))
1883 `(("petsc" ,petsc)))
1885 `(#:parallel-build? #f ;build is parallel by default
1887 `(,(string-append "--with-arpack-dir="
1888 (assoc-ref %build-inputs "arpack") "/lib"))
1889 #:make-flags ;honor (parallel-job-count)
1890 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1892 (modify-phases %standard-phases
1894 ;; configure is a python script, so we can't run it with bash.
1895 (lambda* (#:key inputs outputs (configure-flags '())
1897 (let* ((prefix (assoc-ref outputs "out"))
1898 (flags `(,(string-append "--prefix=" prefix)
1899 ,@configure-flags)))
1900 (format #t "build directory: ~s~%" (getcwd))
1901 (format #t "configure flags: ~s~%" flags)
1902 (setenv "SLEPC_DIR" (getcwd))
1903 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1904 (apply invoke "./configure" flags))))
1905 (add-after 'install 'delete-doc
1906 ;; TODO: SLEPc installs HTML documentation alongside headers in
1907 ;; $out/include. We'd like to move them to share/doc, but delete
1908 ;; them for now, as they are incomplete and installing the complete
1909 ;; documentation is difficult.
1910 (lambda* (#:key outputs #:allow-other-keys)
1911 (let* ((out (assoc-ref outputs "out")))
1912 (for-each delete-file (find-files out "\\.html$"))
1914 (add-after 'install 'clean-install
1915 ;; Clean up unnecessary build logs from installation.
1916 (lambda* (#:key outputs #:allow-other-keys)
1917 (let ((out (assoc-ref outputs "out")))
1918 (for-each (lambda (file)
1919 (let ((f (string-append out "/lib/slepc/conf/" file)))
1920 (when (file-exists? f)
1922 '("configure.log" "make.log" "gmake.log"
1923 "test.log" "error.log" "RDict.db"
1926 (home-page "http://slepc.upv.es")
1927 (synopsis "Scalable library for eigenproblems")
1928 (description "SLEPc is a software library for the solution of large sparse
1929 eigenproblems on parallel computers. It can be used for the solution of
1930 linear eigenvalue problems formulated in either standard or generalized form,
1931 as well as other related problems such as the singular value decomposition.
1932 The emphasis of the software is on methods and techniques appropriate for
1933 problems in which the associated matrices are sparse, for example, those
1934 arising after the discretization of partial differential equations.")
1935 (license license:bsd-2)))
1937 (define-public slepc-complex
1938 (package (inherit slepc)
1939 (name "slepc-complex")
1941 `(("petsc" ,petsc-complex)
1942 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1943 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1945 (define-public slepc-openmpi
1946 (package (inherit slepc)
1947 (name "slepc-openmpi")
1949 (substitute-keyword-arguments (package-arguments slepc)
1950 ((#:phases phases '%standard-phases)
1951 `(modify-phases ,phases
1952 (add-before 'check 'mpi-setup
1953 ,%openmpi-setup)))))
1956 ("arpack" ,arpack-ng-openmpi)
1957 ,@(alist-delete "arpack" (package-inputs slepc))))
1959 `(("petsc" ,petsc-openmpi)
1960 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1961 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1963 (define-public slepc-complex-openmpi
1964 (package (inherit slepc-openmpi)
1965 (name "slepc-complex-openmpi")
1967 `(("petsc" ,petsc-complex-openmpi)
1968 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1969 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1971 (define-public python-slepc4py
1973 (name "python-slepc4py")
1978 (uri (pypi-uri "slepc4py" version))
1981 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
1982 (build-system python-build-system)
1985 (modify-phases %standard-phases
1986 (add-before 'build 'pre-build
1988 ;; Define path to PETSc installation.
1989 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1990 ;; Define path to SLEPc installation.
1991 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
1993 (add-before 'check 'mpi-setup
1996 `(("python-numpy" ,python-numpy)
1997 ("python-petsc4py" ,python-petsc4py)
1998 ("slepc" ,slepc-openmpi)))
1999 (home-page "https://bitbucket.org/slepc/slepc4py/")
2000 (synopsis "Python bindings for SLEPc")
2001 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2002 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2003 Scientific Computation. It employs the MPI standard for all
2004 message-passing communication. @code{slepc4py} provides Python
2005 bindings to almost all functions of SLEPc.")
2006 (license license:bsd-3)))
2008 (define-public mumps
2015 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2019 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2020 (patches (search-patches "mumps-build-parallelism.patch"))))
2021 (build-system gnu-build-system)
2023 `(("fortran" ,gfortran)
2024 ;; These are required for linking against mumps, but we let the user
2025 ;; declare the dependency.
2028 ("scotch" ,scotch)))
2030 `(#:modules ((ice-9 match)
2033 ,@%gnu-build-system-modules)
2035 (modify-phases %standard-phases
2037 (lambda* (#:key inputs #:allow-other-keys)
2038 (call-with-output-file "Makefile.inc"
2049 INCSEQ = -I$(topdir)/libseq
2050 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2051 LIBSEQNEEDED = libseqneeded~;
2055 AR = ar vr # rules require trailing space, ugh...
2057 LIBBLAS = -L~a -lopenblas~@[
2058 SCALAP = -L~a -lscalapack~]
2059 LIBOTHERS = -pthread
2062 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2066 LIBS = $(SCALAP) $(LIBSEQ)
2067 LPORDDIR = $(topdir)/PORD/lib
2068 IPORD = -I$(topdir)/PORD/include
2069 LPORD = -L$(LPORDDIR) -lpord
2070 ORDERINGSF = -Dpord~@[
2072 IMETIS = -I$(METISDIR)/include
2073 LMETIS = -L$(METISDIR)/lib -lmetis
2074 ORDERINGSF += -Dmetis~]~@[~:{
2076 ISCOTCH = -I$(SCOTCHDIR)/include
2077 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2078 ORDERINGSF += ~a~}~]
2079 ORDERINGSC = $(ORDERINGSF)
2080 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2081 IORDERINGSF = $(ISCOTCH)
2082 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2083 (assoc-ref inputs "mpi")
2084 (assoc-ref inputs "blas")
2085 (assoc-ref inputs "scalapack")
2086 (assoc-ref inputs "metis")
2087 (match (list (assoc-ref inputs "pt-scotch")
2088 (assoc-ref inputs "scotch"))
2092 `((,scotch "" "-Dscotch")))
2095 "-lptesmumps -lptscotch -lptscotcherr "
2096 "-Dptscotch")))))))))
2098 ;; By default only the d-precision library is built. Make with "all"
2099 ;; target so that all precision libraries and examples are built.
2101 (invoke "make" "all"
2102 (format #f "-j~a" (parallel-job-count)))))
2104 ;; Run the simple test drivers, which read test input from stdin:
2105 ;; from the "real" input for the single- and double-precision
2106 ;; testers, and from the "cmplx" input for complex-precision
2107 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2108 ;; package to prefix execution with "mpirun".
2109 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2110 (with-directory-excursion "examples"
2113 (let ((tester (apply open-pipe*
2116 ,(string-append "./" prec
2118 (input (open-input-file
2119 (string-append "input_simpletest_" type))))
2121 (dump-port input tester)
2123 (zero? (close-pipe tester)))))
2125 '("real" "real" "cmplx" "cmplx")))))
2127 (lambda* (#:key outputs #:allow-other-keys)
2128 (let* ((out (assoc-ref outputs "out"))
2129 (libdir (string-append out "/lib")))
2130 (copy-recursively "lib" libdir)
2131 (copy-recursively "include" (string-append out "/include"))
2132 (when (file-exists? "libseq/libmpiseq.a")
2133 (install-file "libseq/libmpiseq.a" libdir))
2135 (home-page "http://mumps.enseeiht.fr")
2136 (synopsis "Multifrontal sparse direct solver")
2138 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2139 sparse system of linear equations A x = b using Guassian elimination.")
2140 (license license:cecill-c)))
2142 (define-public mumps-metis
2143 (package (inherit mumps)
2144 (name "mumps-metis")
2146 (alist-delete "scotch" (package-inputs mumps)))))
2148 (define-public mumps-openmpi
2149 (package (inherit mumps)
2150 (name "mumps-openmpi")
2153 ("scalapack" ,scalapack)
2154 ("pt-scotch" ,pt-scotch)
2155 ,@(alist-delete "scotch" (package-inputs mumps))))
2157 (substitute-keyword-arguments (package-arguments mumps)
2159 `(modify-phases ,phases
2160 (add-before 'check 'mpi-setup
2164 ((assoc-ref ,phases 'check)
2165 #:exec-prefix '("mpirun" "-n" "2"))))))))
2166 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2168 (define-public mumps-metis-openmpi
2169 (package (inherit mumps-openmpi)
2170 (name "mumps-metis-openmpi")
2172 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2174 (define-public r-quadprog
2181 (uri (cran-uri "quadprog" version))
2184 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2185 (build-system r-build-system)
2187 `(("gfortran" ,gfortran)))
2188 (home-page "https://cran.r-project.org/web/packages/quadprog")
2189 (synopsis "Functions to solve quadratic programming problems")
2191 "This package contains routines and documentation for solving quadratic
2192 programming problems.")
2193 (license license:gpl3+)))
2195 (define-public r-pracma
2201 (uri (cran-uri "pracma" version))
2203 (base32 "18zhni05gwnxbphl6bmjjxmsgg5wwnnkwlb4g971cqyw3dsd83ki"))))
2204 (build-system r-build-system)
2205 (home-page "https://cran.r-project.org/web/packages/pracma/")
2206 (synopsis "Practical numerical math functions")
2207 (description "This package provides functions for numerical analysis and
2208 linear algebra, numerical optimization, differential equations, plus some
2209 special functions. It uses Matlab function names where appropriate to simplify
2211 (license license:gpl3+)))
2213 (define-public ruby-asciimath
2215 (name "ruby-asciimath")
2220 (uri (rubygems-uri "asciimath" version))
2223 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2224 (build-system ruby-build-system)
2227 (modify-phases %standard-phases
2229 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2230 (add-after 'unpack 'patch-remove-spurious-backslashes
2232 (substitute* "spec/parser_spec.rb"
2237 `(("bundler" ,bundler)
2238 ("ruby-rspec" ,ruby-rspec)))
2239 (synopsis "AsciiMath parsing and conversion library")
2241 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2242 easy-to-write markup language for mathematics.")
2243 (home-page "https://github.com/asciidoctor/asciimath")
2244 (license license:expat)))
2246 (define-public superlu
2253 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2254 "superlu_" version ".tar.gz"))
2256 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2257 (modules '((guix build utils)))
2259 ;; Replace the non-free implementation of MC64 with a stub adapted
2262 (use-modules (ice-9 regex)
2264 (call-with-output-file "SRC/mc64ad.c"
2269 void mc64id_(int *a) {
2270 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2273 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2274 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2275 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2278 ;; Remove the corresponding license verbiage. MC64 license follows
2279 ;; a "------" line separator.
2280 (with-atomic-file-replacement "License.txt"
2281 (let ((rx (make-regexp "-{8}")))
2284 (let ((line (read-line in 'concat)))
2285 (unless (regexp-exec rx line)
2289 (build-system cmake-build-system)
2293 `(("blas" ,openblas)
2294 ("gfortran" ,gfortran)))
2296 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2297 "-DTPL_BLAS_LIBRARIES=openblas"
2298 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2299 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2300 (synopsis "Supernodal direct solver for sparse linear systems")
2302 "SuperLU is a general purpose library for the direct solution of large,
2303 sparse, nonsymmetric systems of linear equations on high performance machines.
2304 The library is written in C and is callable from either C or Fortran. The
2305 library routines perform an LU decomposition with partial pivoting and
2306 triangular system solves through forward and back substitution. The library
2307 also provides threshold-based ILU factorization preconditioners.")
2308 (license (list license:bsd-3
2309 license:gpl2+ ;EXAMPLE/*fgmr.c
2310 (license:fsf-free "file://SRC/colamd.h")))))
2312 (define-public superlu-dist
2314 (name "superlu-dist")
2319 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2320 "superlu_dist_" version ".tar.gz"))
2322 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2323 (modules '((guix build utils)))
2325 ;; Replace the non-free implementation of MC64 with a stub
2327 (call-with-output-file "SRC/mc64ad_dist.c"
2332 void mc64id_dist(int *a) {
2333 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2336 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2337 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2338 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2341 (substitute* "SRC/util.c" ;adjust default algorithm
2342 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2343 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2344 ;; general (i.e. non-square) processor-grid support.
2345 "RowPerm = NOROWPERM;"))
2347 (patches (search-patches "superlu-dist-scotchmetis.patch"
2348 "superlu-dist-awpm-grid.patch"
2349 "superlu-dist-fix-mpi-deprecations.patch"))))
2350 (build-system cmake-build-system)
2354 `(("gfortran" ,gfortran)
2357 ("combblas" ,combinatorial-blas)))
2359 `(("mpi" ,openmpi) ;headers include MPI heades
2360 ("parmetis" ,pt-scotch32 "metis")
2361 ("pt-scotch" ,pt-scotch32)))
2363 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2364 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2365 "-DTPL_ENABLE_COMBBLASLIB=YES"
2366 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2367 "-DTPL_LAPACK_LIBRARIES=-llapack"
2368 (string-append "-DTPL_PARMETIS_LIBRARIES="
2370 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2371 "scotchmetis" "scotch" "scotcherr")
2373 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2374 (assoc-ref %build-inputs "parmetis")
2376 "-DTPL_ENABLE_COMBBLASLIB=ON"
2377 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2378 (assoc-ref %build-inputs "combblas")
2379 "/include/CombBLAS;"
2380 (assoc-ref %build-inputs "combblas")
2381 "/include/BipartiteMatchings")
2382 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2384 (modify-phases %standard-phases
2385 (add-before 'configure 'set-c++-standard
2387 (substitute* "CMakeLists.txt"
2388 ;; AWPM headers require C++14
2389 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2390 (add-before 'check 'mpi-setup
2392 (add-before 'check 'omp-setup
2393 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2394 (home-page (package-home-page superlu))
2395 (synopsis "Parallel supernodal direct solver")
2397 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2398 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2399 implemented in ANSI C, and MPI for communications.")
2400 (license license:bsd-3)))
2402 (define-public scotch
2409 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2410 "latestfile/298/scotch_" version ".tar.gz"))
2412 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2413 (patches (search-patches "scotch-build-parallelism.patch"
2414 "scotch-integer-declarations.patch"))))
2415 (build-system gnu-build-system)
2420 (outputs '("out" "metis"))
2422 `(#:make-flags (list (string-append "prefix=" %output))
2424 (modify-phases %standard-phases
2426 'unpack 'chdir-to-src
2427 (lambda _ (chdir "src") #t))
2431 (call-with-output-file "Makefile.inc"
2445 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2446 LDFLAGS = -lz -lm -lrt -lpthread
2448 LEX = flex -Pscotchyy -olex.yy.c
2453 YACC = bison -pscotchyy -y -b y
2455 '("COMMON_FILE_COMPRESS_GZ"
2457 "COMMON_RANDOM_FIXED_SEED"
2458 "INTSIZE64" ;use 'int64_t'
2459 ;; Prevents symbolc clashes with libesmumps
2461 ;; XXX: Causes invalid frees in superlu-dist tests
2463 ;; "SCOTCH_PTHREAD_NUMBER=2"
2464 "restrict=__restrict"))))
2466 (add-after 'build 'build-esmumps
2469 (format #f "-j~a" (parallel-job-count))
2471 (add-before 'install 'make-install-dirs
2472 (lambda* (#:key outputs #:allow-other-keys)
2473 (mkdir (assoc-ref outputs "out"))))
2474 (add-after 'install 'install-metis
2475 (lambda* (#:key outputs #:allow-other-keys)
2476 (let ((out (assoc-ref outputs "metis")))
2478 ;; metis files are not installed with 'make install'
2479 (for-each (lambda (f)
2480 (install-file f (string-append out "/include")))
2481 (find-files "../include/" ".*metis\\.h"))
2482 (for-each (lambda (f)
2483 (install-file f (string-append out "/lib")))
2484 (find-files "../lib/" ".*metis\\..*"))
2486 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2487 (synopsis "Programs and libraries for graph algorithms")
2488 (description "SCOTCH is a set of programs and libraries which implement
2489 the static mapping and sparse matrix reordering algorithms developed within
2490 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2491 conquer approach, to scientific computing problems such as graph and mesh
2492 partitioning, static mapping, and sparse matrix ordering, in application
2493 domains ranging from structural mechanics to operating systems or
2495 ;; See LICENSE_en.txt
2496 (license license:cecill-c)))
2498 (define-public scotch32
2499 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2500 ;; some applications.
2501 (package (inherit scotch)
2504 (substitute-keyword-arguments (package-arguments scotch)
2505 ((#:phases scotch-phases)
2506 `(modify-phases ,scotch-phases
2510 (call-with-output-file "Makefile.inc"
2524 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2525 LDFLAGS = -lz -lm -lrt -lpthread
2527 LEX = flex -Pscotchyy -olex.yy.c
2532 YACC = bison -pscotchyy -y -b y
2534 '("COMMON_FILE_COMPRESS_GZ"
2536 "COMMON_RANDOM_FIXED_SEED"
2537 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2538 ;; Prevents symbolc clashes with libesmumps
2540 ;; XXX: Causes invalid frees in superlu-dist tests
2542 ;; "SCOTCH_PTHREAD_NUMBER=2"
2543 "restrict=__restrict"))))))))))
2545 "Programs and libraries for graph algorithms (32-bit integers)")))
2547 (define-public pt-scotch
2548 (package (inherit scotch)
2551 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2553 (substitute-keyword-arguments (package-arguments scotch)
2554 ((#:phases scotch-phases)
2555 `(modify-phases ,scotch-phases
2559 (invoke "make" (format #f "-j~a" (parallel-job-count))
2560 "ptscotch" "ptesmumps")
2562 ;; Install the serial metis compatibility library
2563 (invoke "make" "-C" "libscotchmetis" "install")))
2564 (add-before 'check 'mpi-setup
2568 (invoke "make" "ptcheck")))))))
2569 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2571 (define-public pt-scotch32
2572 (package (inherit scotch32)
2573 (name "pt-scotch32")
2575 `(("openmpi" ,openmpi))) ;headers include MPI headers
2577 (substitute-keyword-arguments (package-arguments scotch32)
2578 ((#:phases scotch32-phases)
2579 `(modify-phases ,scotch32-phases
2582 (invoke "make" (format #f "-j~a" (parallel-job-count))
2583 "ptscotch" "ptesmumps")
2584 ;; Install the serial metis compatibility library
2585 (invoke "make" "-C" "libscotchmetis" "install")))
2586 (add-before 'check 'mpi-setup
2590 (invoke "make" "ptcheck")))))))
2592 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2594 (define-public metis
2601 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2602 "metis-" version ".tar.gz"))
2605 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2606 (build-system cmake-build-system)
2608 `(("blas" ,openblas)))
2610 `(#:tests? #f ;no tests
2611 #:configure-flags `("-DSHARED=ON"
2612 ,(string-append "-DGKLIB_PATH=" (getcwd)
2613 "/metis-" ,version "/GKlib"))))
2614 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2615 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2617 "METIS is a set of serial programs for partitioning graphs, partitioning
2618 finite element meshes, and producing fill-reducing orderings for sparse
2619 matrices. The algorithms implemented in METIS are based on the multilevel
2620 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2622 (license license:asl2.0))) ;As of version 5.0.3
2624 (define-public p4est
2631 (uri (string-append "http://p4est.github.io/release/p4est-"
2635 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2636 (build-system gnu-build-system)
2638 `(("fortran" ,gfortran)
2643 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2644 (assoc-ref %build-inputs "blas")
2646 ,(string-append "LAPACK_LIBS=-L"
2647 (assoc-ref %build-inputs "lapack")
2649 #:phases (modify-phases %standard-phases
2650 (add-before 'check 'mpi-setup
2652 (home-page "http://www.p4est.org")
2653 (synopsis "Adaptive mesh refinement on forests of octrees")
2655 "The p4est software library enables the dynamic management of a
2656 collection of adaptive octrees, conveniently called a forest of octrees.
2657 p4est is designed to work in parallel and scales to hundreds of thousands of
2659 (license license:gpl2+)))
2661 (define-public p4est-openmpi
2662 (package (inherit p4est)
2663 (name "p4est-openmpi")
2666 ,@(package-inputs p4est)))
2668 (substitute-keyword-arguments (package-arguments p4est)
2669 ((#:configure-flags cf)
2670 ``("--enable-mpi" ,@,cf))))
2671 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2673 (define-public gsegrafix
2680 (uri (string-append "mirror://gnu/" name "/" name "-"
2684 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2685 (build-system gnu-build-system)
2687 `(#:configure-flags '("LDFLAGS=-lm")))
2689 `(("libgnomecanvas" ,libgnomecanvas)
2690 ("libbonoboui" ,libbonoboui)
2691 ("libgnomeui" ,libgnomeui)
2692 ("libgnomeprintui" ,libgnomeprintui)
2695 `(("pkg-config" ,pkg-config)))
2696 (home-page "https://www.gnu.org/software/gsegrafix/")
2697 (synopsis "GNOME application to create scientific and engineering plots")
2698 (description "GSEGrafix is an application which produces high-quality graphical
2699 plots for science and engineering. Plots are specified via simple ASCII
2700 parameter files and data files and are presented in an anti-aliased GNOME
2701 canvas. The program supports rectangular two-dimensional plots, histograms,
2702 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2703 to BMP, JPEG or PNG image formats.")
2704 (license license:gpl3+)))
2706 (define-public maxima
2713 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2714 version "-source/" name "-" version ".tar.gz"))
2717 "0kdncy6137sg3rradirxzj10mkcvafxd892zlclwhr9sa7b12zhn"))
2718 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2719 (build-system gnu-build-system)
2722 ("gnuplot" ,gnuplot) ;for plots
2724 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2726 `(("texinfo" ,texinfo)
2728 ("python" ,python)))
2731 (list "--enable-gcl"
2732 (string-append "--with-posix-shell="
2733 (assoc-ref %build-inputs "bash")
2735 (string-append "--with-wish="
2736 (assoc-ref %build-inputs "tk")
2738 (let ((v ,(package-version tk)))
2739 (string-take v (string-index-right v #\.)))))
2740 ;; By default Maxima attempts to write temporary files to
2741 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2742 ;; Work around that.
2743 #:make-flags (list "TMPDIR=/tmp")
2745 (modify-phases %standard-phases
2746 (add-after 'unpack 'patch-paths
2747 (lambda* (#:key inputs #:allow-other-keys)
2748 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2749 (coreutils (assoc-ref inputs "coreutils"))
2750 (dirname (string-append coreutils "/bin/dirname"))
2751 (head (string-append coreutils "/bin/head")))
2752 (substitute* "src/maxima.in"
2753 (("sed ") (string-append sed " "))
2754 (("dirname") dirname)
2757 (add-before 'check 'pre-check
2759 (chmod "src/maxima" #o555)
2763 ;; This is derived from the testing code in the "debian/rules" file
2764 ;; of Debian's Maxima package.
2765 ;; If Maxima can successfully run this, the binary to be installed
2769 (string-append "./maxima-local "
2771 "--batch-string=\"run_testsuite();\" "
2772 "| grep -q \"No unexpected errors found\"")))))
2773 ;; Make sure the doc and emacs files are found in the
2774 ;; standard location. Also configure maxima to find gnuplot
2775 ;; without having it on the PATH.
2776 (add-after 'install 'post-install
2777 (lambda* (#:key outputs inputs #:allow-other-keys)
2778 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2779 (out (assoc-ref outputs "out"))
2780 (datadir (string-append out "/share/maxima/" ,version))
2781 (binutils (string-append (assoc-ref inputs "binutils")
2783 (with-directory-excursion out
2784 (mkdir-p "share/emacs")
2785 (mkdir-p "share/doc")
2787 (string-append datadir "/emacs/")
2788 (string-append out "/share/emacs/site-lisp"))
2790 (string-append datadir "/doc/")
2791 (string-append out "/share/doc/maxima"))
2792 (with-atomic-file-replacement
2793 (string-append datadir "/share/maxima-init.lisp")
2795 (format out "~a ~s~a~%"
2796 "(setf $gnuplot_command "
2797 (string-append gnuplot "/bin/gnuplot") ")")
2798 (dump-port in out))))
2799 ;; Ensure that Maxima will have access to the GNU binutils
2800 ;; components at runtime.
2801 (wrap-program (string-append out "/bin/maxima")
2802 `("PATH" prefix (,binutils))))
2804 (home-page "http://maxima.sourceforge.net")
2805 (synopsis "Numeric and symbolic expression manipulation")
2806 (description "Maxima is a system for the manipulation of symbolic and
2807 numerical expressions. It yields high precision numeric results by using
2808 exact fractions, arbitrary precision integers, and variable precision floating
2810 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2811 ;; Others simply say "GNU General Public License" without stating a
2812 ;; version (which implicitly means gpl1+).
2813 ;; At least one file (src/maxima.asd) says "version 2."
2814 ;; GPLv2 only is therefore the smallest subset.
2815 (license license:gpl2)))
2817 (define-public wxmaxima
2825 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2826 (commit (string-append "Version-" version))))
2827 (file-name (git-file-name name version))
2830 "1vwahx3zxkn3qlv4z0fm7v8wh0wspvs026alrh7ff7s0c2dcy95x"))))
2831 (build-system cmake-build-system)
2833 `(("gettext" ,gettext-minimal)))
2835 `(("wxwidgets" ,wxwidgets)
2838 ("adwaita-icon-theme" ,adwaita-icon-theme)
2840 ("shared-mime-info" ,shared-mime-info)))
2842 `(#:tests? #f ; no check target
2844 (modify-phases %standard-phases
2845 (add-after 'install 'wrap-program
2846 (lambda* (#:key inputs outputs #:allow-other-keys)
2847 (wrap-program (string-append (assoc-ref outputs "out")
2850 (,(string-append (assoc-ref inputs "maxima")
2852 ;; For GtkFileChooserDialog.
2853 `("GSETTINGS_SCHEMA_DIR" =
2854 (,(string-append (assoc-ref inputs "gtk+")
2855 "/share/glib-2.0/schemas")))
2856 `("XDG_DATA_DIRS" ":" prefix
2857 (;; Needed by gdk-pixbuf to know supported icon formats.
2859 (assoc-ref inputs "shared-mime-info") "/share")
2860 ;; The default icon theme of GTK+.
2862 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2864 (home-page "https://andrejv.github.io/wxmaxima/")
2865 (synopsis "Graphical user interface for the Maxima computer algebra system")
2867 "wxMaxima is a graphical user interface for the Maxima computer algebra
2868 system. It eases the use of Maxima by making most of its commands available
2869 through a menu system and by providing input dialogs for commands that require
2870 more than one argument. It also implements its own display engine that
2871 outputs mathematical symbols directly instead of depicting them with ASCII
2874 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2875 text and mathematical calculations to create documents, exporting of input and
2876 output to TeX, and a browser for Maxima's manual including command index and
2877 full text searching.")
2878 (license license:gpl2+)))
2880 (define-public armadillo
2886 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2890 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
2891 (build-system cmake-build-system)
2892 (arguments `(#:tests? #f)) ; no test target
2894 `(("openblas" ,openblas)
2896 ("arpack" ,arpack-ng)))
2897 (home-page "http://arma.sourceforge.net/")
2898 (synopsis "C++ linear algebra library")
2900 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2901 between speed and ease of use. It is useful for algorithm development
2902 directly in C++, or quick conversion of research code into production
2903 environments. It can be used for machine learning, pattern recognition,
2904 signal processing, bioinformatics, statistics, econometrics, etc. The library
2905 provides efficient classes for vectors, matrices and cubes, as well as 150+
2906 associated functions (eg. contiguous and non-contiguous submatrix views).")
2907 (license license:asl2.0)))
2909 (define-public muparser
2910 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2911 ;; different hash. In order to make `guix package --upgrade` work correctly,
2912 ;; we set a Guix packaging revision.
2913 ;; When the next version of muparser is released, we can remove
2914 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2915 (let ((upstream-version "2.2.5")
2919 (version (string-append upstream-version "-" revision))
2923 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2924 upstream-version ".tar.gz"))
2925 (file-name (string-append name "-" version ".tar.gz"))
2928 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2929 (build-system gnu-build-system)
2931 `(#:configure-flags '("--enable-samples=no")
2932 #:tests? #f)) ;no "check" target
2933 (home-page "http://muparser.beltoforion.de/")
2934 (synopsis "Fast parser library for mathematical expressions")
2936 "muParser is an extensible high performance math parser library. It is
2937 based on transforming an expression into a bytecode and precalculating constant
2939 (license license:expat))))
2941 (define-public openblas
2948 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
2949 version "%20version.tar.gz"))
2950 (file-name (string-append name "-" version ".tar.gz"))
2953 "1s56lgilyyw86dzmj3jkci9zsg24n60wq4d0zri1hrxlxb6ihimj"))))
2954 (build-system gnu-build-system)
2956 `(#:test-target "test"
2957 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2958 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2959 ;; we need to disable substitutions.
2961 ,(let ((system (or (%current-target-system) (%current-system))))
2962 (or (string-prefix? "x86_64" system)
2963 (string-prefix? "i686" system)
2964 (string-prefix? "mips" system)
2965 (string-prefix? "aarch64" system)))
2967 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2969 ;; Build the library for all supported CPUs. This allows
2970 ;; switching CPU targets at runtime with the environment variable
2971 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2972 ;; Unfortunately, this is not supported on non-x86 architectures,
2973 ;; where it leads to failed builds.
2974 ,@(let ((system (or (%current-target-system) (%current-system))))
2976 ((or (string-prefix? "x86_64" system)
2977 (string-prefix? "i686" system))
2978 '("DYNAMIC_ARCH=1"))
2979 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2980 ;; two available MIPS targets special extended instructions
2981 ;; for Loongson cores are used.
2982 ((string-prefix? "mips" system)
2983 '("TARGET=SICORTEX"))
2984 ;; On aarch64 force the generic 'armv8-a' target
2985 ((string-prefix? "aarch64" system)
2988 ;; no configure script
2990 (modify-phases %standard-phases
2992 (add-before 'build 'set-extralib
2993 (lambda* (#:key inputs #:allow-other-keys)
2994 ;; Get libgfortran found when building in utest.
2996 (string-append "-L" (assoc-ref inputs "fortran-lib")
3000 `(("fortran-lib" ,gfortran "lib")))
3003 ("fortran" ,gfortran)
3005 (home-page "http://www.openblas.net/")
3006 (synopsis "Optimized BLAS library based on GotoBLAS")
3008 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3009 (license license:bsd-3)))
3011 (define-public openblas-ilp64
3012 (package (inherit openblas)
3013 (name "openblas-ilp64")
3014 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3016 (substitute-keyword-arguments (package-arguments openblas)
3017 ((#:make-flags flags '())
3018 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3020 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3021 (license license:bsd-3)))
3023 (define* (make-blis implementation #:optional substitutable?)
3024 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3025 source tree for a list of implementations.)
3027 SUBSTITUTABLE? determines whether the package is made available as a
3030 Currently the specialization must be selected at configure-time, but work is
3031 underway to allow BLIS to select the right optimized kernels at run time:
3032 <https://github.com/flame/blis/issues/129>."
3034 (name (if (string=? implementation "reference")
3036 (string-append "blis-" implementation)))
3038 (home-page "https://github.com/flame/blis")
3041 (uri (git-reference (url home-page) (commit version)))
3044 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3045 (file-name (git-file-name "blis" version))))
3046 (build-system gnu-build-system)
3048 `(#:test-target "test"
3050 #:substitutable? ,substitutable?
3052 #:phases (modify-phases %standard-phases
3054 (lambda* (#:key outputs #:allow-other-keys)
3055 ;; This is a home-made 'configure' script.
3056 (let ((out (assoc-ref outputs "out")))
3057 (zero? (system* "./configure" "-p" out
3061 "--enable-threading=openmp"
3063 ,implementation)))))
3064 (add-before 'check 'show-test-output
3066 ;; By default "make check" is silent. Make it verbose.
3067 (system "tail -F output.testsuite &")
3069 (synopsis "High-performance basic linear algebra (BLAS) routines")
3071 "BLIS is a portable software framework for instantiating high-performance
3072 BLAS-like dense linear algebra libraries. The framework was designed to
3073 isolate essential kernels of computation that, when optimized, immediately
3074 enable optimized implementations of most of its commonly used and
3075 computationally intensive operations. While BLIS exports a new BLAS-like API,
3076 it also includes a BLAS compatibility layer which gives application developers
3077 access to BLIS implementations via traditional BLAS routine calls.")
3078 (license license:bsd-3)))
3081 ;; This is the "reference" implementation, which is the non-optimized but
3082 ;; portable variant (no assembly).
3083 (make-blis "reference" #t))
3085 (define ignorance blis)
3087 (define-syntax-rule (blis/x86_64 processor)
3088 "Expand to a package specialized for PROCESSOR."
3090 (inherit (make-blis processor))
3091 (supported-systems '("x86_64-linux"))))
3093 (define-public blis-sandybridge
3094 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3095 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3096 (blis/x86_64 "sandybridge"))
3098 (define-public blis-haswell
3099 ;; BLIS specialized for Haswell processors (launched 2013):
3100 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3101 (blis/x86_64 "haswell"))
3103 (define-public blis-knl
3104 ;; BLIS specialized for Knights Landing processor (launched 2016):
3105 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3106 (blis/x86_64 "knl"))
3109 (define-public openlibm
3116 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
3118 (file-name (string-append name "-" version ".tar.gz"))
3121 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
3122 (build-system gnu-build-system)
3125 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3127 ;; no configure script
3128 (modify-phases %standard-phases (delete 'configure))
3129 #:tests? #f)) ;the tests are part of the default target
3130 (home-page "http://openlibm.org/")
3131 (synopsis "Portable C mathematical library (libm)")
3133 "OpenLibm is an effort to have a high quality, portable, standalone C
3134 mathematical library (libm). It can be used standalone in applications and
3135 programming language implementations. The project was born out of a need to
3136 have a good libm for the Julia programming language that worked consistently
3137 across compilers and operating systems, and in 32-bit and 64-bit
3139 ;; Each architecture has its own make target, and there is none for mips.
3140 (supported-systems (delete "mips64el-linux" %supported-systems))
3141 ;; See LICENSE.md for details.
3142 (license (list license:expat
3145 license:public-domain
3146 license:lgpl2.1+))))
3148 (define-public openspecfun
3150 (name "openspecfun")
3155 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3157 (file-name (string-append name "-" version ".tar.gz"))
3160 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
3161 (build-system gnu-build-system)
3163 '(#:tests? #f ; no "check" target
3165 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3167 (modify-phases %standard-phases
3168 (delete 'configure)))) ; no configure script
3170 `(("fortran" ,gfortran)))
3171 (home-page "https://github.com/JuliaLang/openspecfun")
3172 (synopsis "Collection of special mathematical functions")
3174 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3175 portable package for Bessel Functions of a Complex Argument and Nonnegative
3176 Order; it contains subroutines for computing Bessel functions and Airy
3177 functions. Faddeeva allows computing the various error functions of arbitrary
3178 complex arguments (Faddeeva function, error function, complementary error
3179 function, scaled complementary error function, imaginary error function, and
3180 Dawson function); given these, one can also easily compute Voigt functions,
3181 Fresnel integrals, and similar related functions as well.")
3182 ;; Faddeeva is released under the Expat license; AMOS is included as
3183 ;; public domain software.
3184 (license (list license:expat license:public-domain))))
3186 (define-public suitesparse
3188 (name "suitesparse")
3194 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3198 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3199 (modules '((guix build utils)))
3201 ;; Remove bundled metis source
3203 (delete-file-recursively "metis-5.1.0")
3205 (build-system gnu-build-system)
3207 '(#:tests? #f ;no "check" target
3212 "MY_METIS_LIB=-lmetis"
3213 (string-append "INSTALL_LIB="
3214 (assoc-ref %outputs "out") "/lib")
3215 (string-append "INSTALL_INCLUDE="
3216 (assoc-ref %outputs "out") "/include")
3219 (modify-phases %standard-phases
3220 (delete 'configure)))) ;no configure script
3225 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3226 (synopsis "Suite of sparse matrix software")
3228 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3229 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3230 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3231 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3232 CXSparse, a concise sparse Cholesky factorization package; and many other
3235 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3237 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3238 (license (list license:gpl2+ license:lgpl2.1+))))
3240 (define-public atlas
3246 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3247 version "/atlas" version ".tar.bz2"))
3250 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3251 (build-system gnu-build-system)
3252 (home-page "http://math-atlas.sourceforge.net/")
3253 (inputs `(("gfortran" ,gfortran)
3254 ("lapack-tar" ,(package-source lapack))))
3255 (outputs '("out" "doc"))
3256 ;; For the moment we drop support for MIPS at it fails to compile. See
3257 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3258 (supported-systems (delete "mips64el-linux" %supported-systems))
3260 `(#:parallel-build? #f
3261 #:parallel-tests? #f
3263 ;; ATLAS tunes itself for the machine it is built on, as explained at
3264 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3265 ;; For this reason, we want users to build it locally instead of using
3269 #:modules ((srfi srfi-26)
3271 (guix build gnu-build-system)
3274 `(;; Generate position independent code suitable for dynamic libraries
3275 ;; and use WALL timer to get more accurate timing.
3276 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3279 ,,(if (string-match "64" (%current-system))
3282 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3283 ;; needed to compile C files before it is generated.
3284 "-Ss" "pmake" "make -j 1"
3285 ;; Probe is failing for MIPS. We therefore define the system
3286 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3287 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3288 ,,@(if (string-prefix? "mips" (%current-system))
3289 (list "-A" "49" "-V" "1")
3291 ;; Generate shared libraries.
3293 ;; Build a full LAPACK library.
3294 ,(string-append "--with-netlib-lapack-tarfile="
3295 (assoc-ref %build-inputs "lapack-tar")))
3297 (modify-phases %standard-phases
3298 (add-after 'install 'install-doc
3299 (lambda* (#:key outputs inputs #:allow-other-keys)
3300 (let ((doc (string-append (assoc-ref outputs "doc")
3301 "/share/doc/atlas")))
3303 (fold (lambda (file previous)
3304 (and previous (zero? (system* "cp" file doc))))
3305 #t (find-files "../ATLAS/doc" ".*")))))
3306 (add-after 'check 'check-pt
3307 (lambda _ (zero? (system* "make" "ptcheck"))))
3308 ;; Fix files required to run configure.
3309 (add-before 'configure 'fix-/bin/sh
3311 ;; Use `sh', not `/bin/sh'.
3312 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3315 ;; Fix /bin/sh in generated make files.
3316 (add-after 'configure 'fix-/bin/sh-in-generated-files
3318 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3321 ;; ATLAS configure program does not accepts the default flags
3322 ;; passed by the 'gnu-build-system'.
3324 (lambda* (#:key native-inputs inputs outputs
3325 (configure-flags '())
3326 #:allow-other-keys #:rest args)
3327 (let* ((prefix (assoc-ref outputs "out"))
3328 (bash (or (and=> (assoc-ref
3329 (or native-inputs inputs) "bash")
3330 (cut string-append <> "/bin/bash"))
3332 (flags `(,(string-append "--prefix=" prefix)
3334 (abs-srcdir (getcwd))
3335 (srcdir (string-append "../" (basename abs-srcdir))))
3336 (format #t "source directory: ~s (relative from build: ~s)~%"
3340 (format #t "build directory: ~s~%" (getcwd))
3341 (format #t "configure flags: ~s~%" flags)
3342 (zero? (apply system* bash
3343 (string-append srcdir "/configure")
3345 (synopsis "Automatically Tuned Linear Algebra Software")
3347 "ATLAS is an automatically tuned linear algebra software library
3348 providing C and Fortran77 interfaces to a portably efficient BLAS
3349 implementation, as well as a few routines from LAPACK.
3351 Optimization occurs at build time. For this reason, the library is built on
3352 the machine where it is installed, without resorting to pre-built substitutes.
3354 Before building the library, CPU throttling should be disabled. This can be
3355 done in the BIOS, or, on GNU/Linux, with the following command:
3358 # cpupower --governor performance
3361 Failure to do so will result in a library with poor performance.")
3362 (license license:bsd-3)))
3371 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3372 version "/glm-" version ".zip"))
3375 "17vxbqzy4pxciq5i39bgpxz54f7ifqqmcqwwq7m6xfgikwqqqawp"))))
3376 (build-system cmake-build-system)
3378 `(("unzip" ,unzip)))
3379 (home-page "https://glm.g-truc.net/")
3380 (synopsis "OpenGL Mathematics library")
3381 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3382 library for graphics software based on the OpenGL Shading Language (GLSL)
3384 (license license:expat)))
3386 (define-public lpsolve
3393 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3394 "/lp_solve_" version "_source.tar.gz"))
3397 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3398 (modules '((guix build utils)))
3401 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3403 ;; Pretend to be on a 64 bit platform to obtain a common directory
3404 ;; name for the build results on all architectures; nothing else
3405 ;; seems to depend on it.
3406 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3408 ;; The check for 'isnan' as it is written fails with
3409 ;; "non-floating-point argument in call to function
3410 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3411 ;; definition, which in turn leads to bad things. Fix the feature
3413 (("isnan\\(0\\)") "isnan(0.)"))
3415 (build-system gnu-build-system)
3417 `(#:tests? #f ; no check target
3419 (modify-phases %standard-phases
3420 (delete 'configure) ; no configure script
3423 (with-directory-excursion "lpsolve55"
3424 (invoke "bash" "ccc"))
3425 (with-directory-excursion "lp_solve"
3426 (invoke "bash" "ccc"))
3429 (lambda* (#:key outputs #:allow-other-keys)
3430 (let* ((out (assoc-ref outputs "out"))
3431 (bin (string-append out "/bin"))
3432 (lib (string-append out "/lib"))
3433 ;; This is where LibreOffice expects to find the header
3434 ;; files, and where they are installed by Debian.
3435 (include (string-append out "/include/lpsolve")))
3436 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3437 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3438 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3440 ;; Install a subset of the header files as on Debian
3441 ;; (plus lp_bit.h, which matches the regular expression).
3442 (for-each (lambda (name)
3443 (install-file name include))
3444 (find-files "." "lp_[HMSa-z].*\\.h$"))
3445 (with-directory-excursion "shared"
3446 (for-each (lambda (name)
3447 (install-file name include))
3448 (find-files "." "\\.h$")))
3450 (home-page "http://lpsolve.sourceforge.net/")
3451 (synopsis "Mixed integer linear programming (MILP) solver")
3453 "lp_solve is a mixed integer linear programming solver based on the
3454 revised simplex and the branch-and-bound methods.")
3455 (license license:lgpl2.1+)))
3457 (define-public dealii
3464 (uri (string-append "https://github.com/dealii/dealii/releases/"
3465 "download/v" version "/dealii-" version ".tar.gz"))
3468 "0r7f8rhl3xr94imd372plizdcbqk0a70w73lwc3vw912dxk0sbyz"))
3469 (patches (search-patches "dealii-mpi-deprecations.patch"))
3470 (modules '((guix build utils)))
3472 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3474 (delete-file-recursively "bundled")
3476 (build-system cmake-build-system)
3484 ("arpack" ,arpack-ng)
3485 ("muparser" ,muparser)
3486 ("gfortran" ,gfortran)
3487 ("suitesparse" ,suitesparse))) ;for UMFPACK
3489 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3491 ;; Work around a bug in libsuitesparseconfig linking
3492 ;; see https://github.com/dealii/dealii/issues/4745
3493 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3494 (home-page "https://www.dealii.org")
3495 (synopsis "Finite element library")
3497 "Deal.II is a C++ program library targeted at the computational solution
3498 of partial differential equations using adaptive finite elements. The main
3499 aim of deal.II is to enable rapid development of modern finite element codes,
3500 using among other aspects adaptive meshes and a wide array of tools often used
3501 in finite element programs.")
3502 (license license:lgpl2.1+)))
3504 (define-public dealii-openmpi
3505 (package (inherit dealii)
3506 (name "dealii-openmpi")
3509 ;;Supported only with MPI:
3510 ("p4est" ,p4est-openmpi)
3511 ("petsc" ,petsc-openmpi)
3512 ("slepc" ,slepc-openmpi)
3513 ("metis" ,metis) ;for MUMPS
3514 ("scalapack" ,scalapack) ;for MUMPS
3515 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3516 ("arpack" ,arpack-ng-openmpi)
3517 ,@(fold alist-delete (package-inputs dealii)
3518 '("p4est" "arpack"))))
3520 (substitute-keyword-arguments (package-arguments dealii)
3521 ((#:configure-flags cf)
3522 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3524 ((#:phases phases '%standard-phases)
3525 `(modify-phases ,phases
3526 (add-before 'check 'mpi-setup
3527 ,%openmpi-setup)))))
3528 (synopsis "Finite element library (with MPI support)")))
3530 (define-public flann
3539 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3540 version "-src.zip"))
3543 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3544 (patches (search-patches "flann-cmake-3.11.patch"))))
3545 (build-system cmake-build-system)
3547 "octave")) ;46 MiB .mex file that pulls Octave
3549 `(("unzip" ,unzip)))
3552 ("octave" ,octave-cli)
3553 ("python" ,python-2) ; print syntax
3554 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3557 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3558 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3559 #:strip-directories '("lib" "lib64" "libexec"
3560 "bin" "sbin" "share/flann/octave")
3562 ;; Save 12 MiB by not installing .a files. Passing
3563 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3564 #:phases (modify-phases %standard-phases
3565 (add-before 'configure 'set-octave-directory
3566 (lambda* (#:key outputs #:allow-other-keys)
3567 ;; Install the .mex file in the "octave" output.
3568 (let ((out (assoc-ref outputs "octave")))
3569 (substitute* "src/matlab/CMakeLists.txt"
3570 (("share/flann/octave")
3571 (string-append out "/share/flann/octave")))
3573 (add-after 'install 'remove-static-libraries
3574 (lambda* (#:key outputs #:allow-other-keys)
3575 (let* ((out (assoc-ref outputs "out"))
3576 (lib (string-append out "/lib")))
3577 (for-each delete-file
3578 (find-files lib "\\.a$"))
3581 #:tests? #f)) ; The test data are downloaded from the Internet.
3582 (home-page "http://www.cs.ubc.ca/research/flann/")
3583 (synopsis "Library for approximate nearest neighbors computation")
3584 (description "FLANN is a library for performing fast approximate
3585 nearest neighbor searches in high dimensional spaces. It implements a
3586 collection of algorithms and a system for automatically choosing the best
3587 algorithm and optimum parameters depending on the dataset.
3589 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3590 (license (license:non-copyleft "file://COPYING"
3591 "See COPYING in the distribution."))))
3593 (define-public wcalc
3600 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3601 "wcalc-" version ".tar.bz2"))
3604 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3605 (build-system gnu-build-system)
3608 ("readline" ,readline)))
3609 (home-page "http://w-calc.sourceforge.net/index.php")
3610 (synopsis "Flexible command-line scientific calculator")
3611 (description "Wcalc is a very capable calculator. It has standard functions
3612 (sin, asin, and sinh for example, in either radians or degrees), many
3613 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3614 variables, a command history, hex/octal/binary input and output, unit
3615 conversions, embedded comments, and an expandable expression entry field. It
3616 evaluates expressions using the standard order of operations.")
3617 (license license:gpl2+)))
3625 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3626 "/xaos-" version ".tar.gz"))
3629 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3630 (build-system gnu-build-system)
3631 (native-inputs `(("gettext" ,gettext-minimal)))
3632 (inputs `(("libx11" ,libx11)
3637 `(#:tests? #f ;no "check" target
3638 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3639 (synopsis "Real-time fractal zoomer")
3640 (description "GNU XaoS is a graphical program that generates fractal
3641 patterns and allows you to zoom in and out of them infinitely in a fluid,
3642 continuous manner. It also includes tutorials that help to explain how fractals
3643 are built. It can generate many different fractal types such as the Mandelbrot
3645 (home-page "https://www.gnu.org/software/xaos/")
3646 (license license:gpl2+)))
3648 (define-public hypre
3654 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3655 "v" version ".tar.gz"))
3656 (file-name (string-append name "-" version ".tar.gz"))
3659 "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh"))
3660 (modules '((guix build utils)))
3663 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3664 ;; substitute the tarball creation time.
3665 (substitute* "src/utilities/HYPRE_utilities.h"
3666 (("Date Compiled: .*$")
3667 "Date Compiled: Apr 11 2018 16:24:59 +0000\"\n"))
3669 (build-system gnu-build-system)
3670 (outputs '("out" ;6.1 MiB of headers and libraries
3671 "doc")) ;4.8 MiB of documentation
3675 ("perl" ,perl) ;needed to run 'ppmquant' during tests
3676 ("texlive" ,(texlive-union (list texlive-generic-xypic
3678 texlive-latex-hyperref
3680 ("ghostscript" ,ghostscript)))
3682 `(("blas" ,openblas)
3683 ("lapack" ,lapack)))
3685 `(#:modules ((srfi srfi-1)
3686 ,@%gnu-build-system-modules)
3687 #:configure-flags '("--enable-shared"
3695 (modify-phases %standard-phases
3696 (add-before 'build 'set-HOME
3698 ;; FIXME: texlive-union does not find the built
3699 ;; metafonts, so it tries to generate them in HOME.
3700 (setenv "HOME" "/tmp")
3702 (add-before 'configure 'chdir-src
3703 (lambda _ (chdir "src")))
3705 (lambda* (#:key build target configure-flags
3706 #:allow-other-keys #:rest args)
3707 (let* ((configure (assoc-ref %standard-phases 'configure)))
3710 (list #:configure-flags
3711 (cons (string-append
3712 "--host=" (or target build))
3713 configure-flags)))))))
3714 (add-after 'build 'build-docs
3716 (invoke "make" "-Cdocs" "pdf" "html")))
3719 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3720 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3721 (and (system* "make" "check" "CHECKRUN=")
3722 (fold (lambda (filename result)
3724 (let ((size (stat:size (stat filename))))
3725 (when (not (zero? size))
3726 (format #t "~a size ~d; error indication~%"
3730 (find-files "test" ".*\\.err$")))))
3731 (add-after 'install 'install-docs
3732 (lambda* (#:key outputs #:allow-other-keys)
3733 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3734 (let* ((doc (assoc-ref outputs "doc"))
3735 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3736 (with-directory-excursion "docs"
3737 (for-each (lambda (base)
3738 (install-file (string-append base ".pdf") docdir)
3739 (copy-recursively base docdir)) ;html docs
3740 '("HYPRE_usr_manual"
3741 "HYPRE_ref_manual")))
3743 (home-page "http://www.llnl.gov/casc/hypre/")
3744 (synopsis "Library of solvers and preconditioners for linear equations")
3746 "HYPRE is a software library of high performance preconditioners and
3747 solvers for the solution of large, sparse linear systems of equations. It
3748 features multigrid solvers for both structured and unstructured grid
3750 (license license:lgpl2.1)))
3752 (define-public hypre-openmpi
3753 (package (inherit hypre)
3754 (name "hypre-openmpi")
3757 ,@(package-inputs hypre)))
3759 (substitute-keyword-arguments (package-arguments hypre)
3760 ((#:configure-flags flags)
3762 ,@(delete "--without-MPI" ,flags)))
3764 `(modify-phases ,phases
3765 (add-before 'check 'mpi-setup
3766 ,%openmpi-setup)))))
3767 (synopsis "Parallel solvers and preconditioners for linear equations")
3769 "HYPRE is a software library of high performance preconditioners and
3770 solvers for the solution of large, sparse linear systems of equations on
3771 parallel computers. It features parallel multigrid solvers for both
3772 structured and unstructured grid problems.")))
3774 (define-public matio
3781 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3782 "matio-" version ".tar.gz"))
3785 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3786 (build-system gnu-build-system)
3790 (home-page "http://matio.sourceforge.net/")
3791 (synopsis "Library for reading and writing MAT files")
3792 (description "Matio is a library for reading and writing MAT files. It
3793 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3794 (license license:bsd-2)))
3801 (origin (method url-fetch)
3802 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3803 "download/" version "/Vc-" version ".tar.gz"))
3806 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3807 (build-system cmake-build-system)
3810 '("-DBUILD_TESTING=ON"
3811 ;; By default, Vc will optimize for the CPU of the build machine.
3812 ;; Setting this to "none" makes it create portable binaries. See
3813 ;; "cmake/OptimizeForArchitecture.cmake".
3814 "-DTARGET_ARCHITECTURE=none")))
3815 (synopsis "SIMD vector classes for C++")
3816 (description "Vc provides portable, zero-overhead C++ types for explicitly
3817 data-parallel programming. It is a library designed to ease explicit
3818 vectorization of C++ code. Its types enable explicitly stating data-parallel
3819 operations on multiple values. The parallelism is therefore added via the type
3820 system. Vc has an intuitive API and provides portability between different
3821 compilers and compiler versions as well as portability between different vector
3822 instruction sets. Thus, an application written with Vc can be compiled for:
3825 @item SSE2 up to SSE4.2 or SSE4a
3828 @item NEON (in development)
3829 @item NVIDIA GPUs / CUDA (in development)
3831 (home-page "https://github.com/VcDevel/Vc")
3832 ;; "No support_???.cpp file exists for this architecture."
3833 (supported-systems '("x86_64-linux" "i686-linux"))
3834 (license license:bsd-3)))
3836 (define-public reducelcs
3837 ;; This is the last commit which is available upstream, no
3838 ;; release happened since 2010.
3839 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3843 (version (string-append "1.0-" revision "." (string-take commit 7)))
3848 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3850 (file-name (string-append name "-" version "-checkout"))
3853 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3854 (build-system gnu-build-system)
3856 `(("openlibm" ,openlibm)))
3858 `(#:tests? #f ; no tests
3860 (modify-phases %standard-phases
3861 (delete 'configure) ; No configure script exists.
3862 (replace 'install ; No install phase exists.
3863 (lambda* (#:key outputs #:allow-other-keys)
3864 (let* ((out (assoc-ref outputs "out"))
3865 (bin (string-append out "/bin")))
3866 (install-file "Approximation" bin)
3867 (install-file "CollectResults" bin)
3868 (install-file "GenerateInstances" bin)
3870 (synopsis "Approximate Longest Commons Subsequence computation tool")
3872 "@code{reduceLCS} is an implementation of the Reduce-Expand
3873 algorithm for LCS. It is a fast program to compute the approximate
3874 Longest Commons Subsequence of a set of strings.")
3875 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3876 (license license:gpl3+))))
3878 (define-public jacal
3885 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3888 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3889 (patches (search-patches "jacal-fix-texinfo.patch"))))
3890 (build-system gnu-build-system)
3893 (modify-phases %standard-phases
3894 (add-before 'build 'pre-build
3895 ;; Don't use upstream's script - it really doesn't fit into
3896 ;; Guix's functional paradigm.
3897 (lambda* (#:key inputs outputs #:allow-other-keys)
3898 (substitute* "Makefile"
3899 (("^install: install-script") "install: "))))
3900 (add-after 'install 'post-install
3901 ;; Instead, we provide our own simplified script.
3902 (lambda* (#:key inputs outputs #:allow-other-keys)
3903 (let ((wrapper (string-append (assoc-ref outputs "out")
3905 (format (open wrapper (logior O_WRONLY O_CREAT))
3906 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3907 "-e '(slib:load \"~a/lib/jacal/math\") "
3910 (assoc-ref inputs "scm")
3911 (assoc-ref outputs "out"))
3912 (chmod wrapper #o555))))
3914 (lambda* (#:key inputs outputs #:allow-other-keys)
3915 (zero? (system* "./configure"
3916 (string-append "--prefix="
3917 (assoc-ref outputs "out")))))))))
3918 (inputs `(("scm" ,scm)))
3919 (native-inputs `(("unzip" ,unzip)
3920 ("texinfo" ,texinfo)))
3921 (synopsis "Symbolic mathematics system")
3922 (description "GNU JACAL is an interactive symbolic mathematics program based on
3923 Scheme. It manipulate and simplify a range of mathematical expressions such
3924 as equations, scalars, vectors, and matrices.")
3925 (home-page "https://www.gnu.org/software/jacal/")
3926 (license license:gpl3+)))
3932 (home-page "https://github.com/Z3Prover/z3")
3935 (uri (git-reference (url home-page)
3936 (commit (string-append "z3-" version))))
3937 (file-name (git-file-name name version))
3940 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
3941 (build-system gnu-build-system)
3944 (modify-phases %standard-phases
3945 (add-after 'unpack 'fix-compatability
3946 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
3948 (substitute* "src/util/mpz.cpp"
3949 (("#include <immintrin.h>") ""))
3951 (add-before 'configure 'bootstrap
3954 (system* "python" "scripts/mk_make.py"))))
3955 ;; work around gnu-build-system's setting --enable-fast-install
3956 ;; (z3's `configure' is a wrapper around the above python file,
3957 ;; which fails when passed --enable-fast-install)
3959 (lambda* (#:key inputs outputs #:allow-other-keys)
3960 (invoke "./configure"
3961 (string-append "--prefix=" (assoc-ref outputs "out")))))
3962 (add-after 'configure 'change-directory
3966 (add-before 'check 'make-test-z3
3968 ;; Build the test suite executable.
3969 (zero? (system* "make" "test-z3" "-j"
3970 (number->string (parallel-job-count))))))
3973 ;; Run all the tests that don't require arguments.
3974 (zero? (system* "./test-z3" "/a")))))))
3977 ("python" ,python-wrapper)))
3978 (synopsis "Theorem prover")
3979 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3980 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3981 (license license:expat)))
3986 (version "2018.11.001")
3989 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
3990 version "/elpa-" version ".tar.gz"))
3993 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
3994 (build-system gnu-build-system)
3996 `(("fortran" ,gfortran)
3997 ("perl" ,perl))) ;for configure and deps
3999 `(("blas" ,openblas)))
4004 ;; ELPA unfortunately does not support runtime dispatch, so we can
4005 ;; only enable the "generic" kernels. See the "Cross compilation"
4006 ;; section of INSTALL.md.
4008 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4009 "--disable-avx" "--disable-avx2" "--disable-avx512"
4010 ,(string-append "CFLAGS=-O3 "
4011 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4012 "-ftree-vect-loop-version -ftree-vectorize "
4013 ,(let ((system (or (%current-target-system)
4014 (%current-system))))
4016 ((or (string-prefix? "x86_64" system)
4017 (string-prefix? "i686" system))
4020 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4022 (modify-phases %standard-phases
4023 (add-before 'configure 'patch-header-generation
4025 (substitute* "configure"
4026 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4027 (string-append & " CPP=\"$CPP\"")))
4029 (add-before 'check 'setup-tests
4031 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4032 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4033 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4034 ;; for Fortran. This also causes several tests to pass that
4035 ;; otherwise would otherwise fail with matrix size 5000; possibly
4036 ;; due to floating point tolerances that are too tight.
4037 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4038 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4039 (substitute* "Makefile"
4040 ;; Test scripts are generated, patch the shebang
4041 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4043 (home-page "http://elpa.mpcdf.mpg.de")
4044 (synopsis "Eigenvalue solvers for symmetric matrices")
4046 "The ELPA library provides efficient and scalable direct eigensolvers for
4047 symmetric matrices.")
4048 (license license:lgpl3)))
4050 (define-public elpa-openmpi
4051 (package (inherit elpa)
4052 (name "elpa-openmpi")
4055 ("scalapack" ,scalapack)
4056 ,@(package-inputs elpa)))
4058 (substitute-keyword-arguments (package-arguments elpa)
4059 ((#:configure-flags cf '())
4060 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4061 ((#:phases phases '%standard-phases)
4062 `(modify-phases ,phases
4063 (add-before 'check 'mpi-setup
4065 ;; Tests use 2 mpi tasks by default, use our remaining build
4066 ;; cores as OpenMP threads.
4067 (setenv "OMP_NUM_THREADS" (number->string
4068 (max (quotient (parallel-job-count) 2)
4070 (,%openmpi-setup)))))))
4071 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4073 (define-public elemental
4080 (url "https://github.com/elemental/Elemental.git")
4081 (commit (string-append "v" version))))
4082 (file-name (git-file-name name version))
4085 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4086 (build-system cmake-build-system)
4087 (home-page "http://libelemental.org")
4089 `(("gfortran" ,gfortran)))
4091 `(("blas" ,openblas)
4092 ("gfortran:lib" ,gfortran "lib")
4101 `(#:build-type "Release" ;default RelWithDebInfo not supported
4102 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4103 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4104 "-DEL_CACHE_WARNINGS:BOOL=YES"
4105 "-DEL_TESTS:BOOL=YES"
4106 "-DCMAKE_INSTALL_LIBDIR=lib"
4107 "-DGFORTRAN_LIB=gfortran")
4108 #:phases (modify-phases %standard-phases
4109 (add-before 'check 'mpi-setup
4111 (add-before 'check 'setup-tests
4113 ;; Parallelism is done at the MPI layer.
4114 (setenv "OMP_NUM_THREADS" "1")
4116 (add-after 'install 'remove-tests
4117 (lambda* (#:key outputs #:allow-other-keys)
4118 ;; Tests are installed, with no easy configuration
4119 ;; switch to prevent this, so delete them.
4120 (delete-file-recursively
4121 (string-append (assoc-ref outputs "out") "/bin"))
4123 (synopsis "Dense and sparse-direct linear algebra and optimization")
4124 (description "Elemental is a modern C++ library for distributed-memory
4125 dense and sparse-direct linear algebra, conic optimization, and lattice
4127 (license license:bsd-2)))
4129 (define-public mcrl2
4132 (version "201707.1.15162")
4135 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4140 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4142 `(("subversion" ,subversion)))
4147 ("qtbase" ,qtbase)))
4148 (build-system cmake-build-system)
4149 (synopsis "Toolset for the mCRL2 formal specification language")
4151 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4152 specification language for describing concurrent discrete event systems. Its
4153 toolset supports analysis and automatic verification, linearisation, simulation,
4154 state-space exploration and generation, and tools to optimise and analyse
4155 specifications. Also, state spaces can be manipulated, visualised and
4157 (home-page "https://mcrl2.org")
4158 (license license:boost1.0)))
4160 (define-public r-subplex
4167 (uri (cran-uri "subplex" version))
4170 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4171 (build-system r-build-system)
4173 `(("gfortran" ,gfortran)))
4174 (home-page "https://cran.r-project.org/web/packages/subplex")
4175 (synopsis "Unconstrained optimization using the subplex algorithm")
4176 (description "This package implements the Subplex optimization algorithm.
4177 It solves unconstrained optimization problems using a simplex method on
4178 subspaces. The method is well suited for optimizing objective functions that
4179 are noisy or are discontinuous at the solution.")
4180 (license license:gpl3+)))
4182 (define-public r-desolve
4189 (uri (cran-uri "deSolve" version))
4192 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
4193 (properties `((upstream-name . "deSolve")))
4194 (build-system r-build-system)
4196 `(("gfortran" ,gfortran)))
4197 (home-page "https://desolve.r-forge.r-project.org/")
4198 (synopsis "Solvers for initial value problems of differential equations")
4199 (description "This package provides functions that solve initial
4200 value problems of a system of first-order ordinary differential equations (ODE),
4201 of partial differential equations (PDE), of differential algebraic equations
4202 (DAE), and of delay differential equations. The functions provide an interface
4203 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4204 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4205 the Runge-Kutta family with fixed or variable time steps. The package contains
4206 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4207 differential equations (PDE) that have been converted to ODEs by numerical
4209 (license license:gpl2+)))
4211 (define-public tcalc
4218 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4222 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4223 (build-system gnu-build-system)
4224 (synopsis "The terminal calculator")
4226 "The terminal calculator is a small program to help users of the GNU/Linux
4227 terminal do calculations simply and quickly. The formula to be calculated can
4228 be fed to @command{tcalc} through the command line.")
4229 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4230 (license license:gpl3+)))
4232 (define-public sundials
4239 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4240 "sundials-" version ".tar.gz"))
4243 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4244 (build-system cmake-build-system)
4246 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4248 `(("fortran" ,gfortran) ;for fcmix
4250 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4252 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4253 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4254 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4255 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4256 "-DEXAMPLES_INSTALL:BOOL=OFF"
4258 "-DFCMIX_ENABLE:BOOL=ON"
4260 "-DKLU_ENABLE:BOOL=ON"
4261 ,(string-append "-DKLU_INCLUDE_DIR="
4262 (assoc-ref %build-inputs "suitesparse")
4264 ,(string-append "-DKLU_LIBRARY_DIR="
4265 (assoc-ref %build-inputs "suitesparse")
4267 (home-page "https://computation.llnl.gov/projects/sundials")
4268 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4269 (description "SUNDIALS is a family of software packages implemented with
4270 the goal of providing robust time integrators and nonlinear solvers that can
4271 easily be incorporated into existing simulation codes.")
4272 (license license:bsd-3)))
4274 (define-public sundials-openmpi
4275 (package (inherit sundials)
4276 (name "sundials-openmpi")
4279 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4280 ,@(package-inputs sundials)))
4282 (substitute-keyword-arguments (package-arguments sundials)
4283 ((#:configure-flags flags '())
4284 `(cons* "-DMPI_ENABLE:BOOL=ON"
4285 "-DPETSC_ENABLE:BOOL=ON"
4286 (string-append "-DPETSC_INCLUDE_DIR="
4287 (assoc-ref %build-inputs "petsc")
4289 (string-append "-DPETSC_LIBRARY_DIR="
4290 (assoc-ref %build-inputs "petsc")
4293 ((#:phases phases '%standard-phases)
4294 `(modify-phases ,phases
4295 (add-before 'check 'mpi-setup
4296 ,%openmpi-setup)))))
4297 (synopsis "SUNDIALS with OpenMPI support")))
4299 (define-public combinatorial-blas
4301 (name "combinatorial-blas")
4306 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4308 (match (string-split version #\.)
4309 ((major minor patch)
4310 (string-append major minor "_" patch))) ;e.g. "16_2"
4314 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4315 (patches (search-patches "combinatorial-blas-awpm.patch"
4316 "combinatorial-blas-io-fix.patch"))))
4317 (build-system cmake-build-system)
4320 ("test-data" ,(origin
4322 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4323 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4326 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4328 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4329 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4330 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4332 (modify-phases %standard-phases
4333 (add-before 'check 'mpi-setup
4335 (add-before 'check 'test-setup
4336 (lambda* (#:key inputs #:allow-other-keys)
4337 (setenv "OMP_NUM_THREADS" "2")
4338 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4339 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4340 (synopsis "Linear algebra primitives for graph analytics")
4341 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4342 distributed-memory parallel graph library offering a small but powerful set of
4343 linear algebra primitives specifically targeting graph analytics.")
4345 license:gpl2+ ;include/psort/(funnel|sort)*.h
4346 license:x11 ;usort and psort
4347 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4349 (define-public dune-common
4351 (name "dune-common")
4356 (uri (string-append "https://dune-project.org/download/"
4357 version "/dune-common-" version ".tar.gz"))
4360 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4361 (build-system cmake-build-system)
4364 (modify-phases %standard-phases
4365 (add-after 'build 'build-tests
4366 (lambda* (#:key make-flags #:allow-other-keys)
4367 (apply invoke "make" "build_tests" make-flags)))
4368 ;; These tests fail because they require a fully functional MPI
4370 (add-after 'unpack 'disable-failing-tests
4373 (string-append "--exclude-regex '("
4377 "remoteindicestest-mpi-2"
4380 "variablesizecommunicatortest"
4381 "variablesizecommunicatortest-mpi-2"
4382 "arithmetictestsuitetest"
4383 "assertandreturntest"
4384 "assertandreturntest_ndebug"
4387 "mpicollectivecommunication"
4388 "mpicollectivecommunication-mpi-2"
4390 "mpiguardtest-mpi-2"
4392 "mpihelpertest-mpi-2"
4394 "mpihelpertest2-mpi-2")
4401 ("openmpi" ,openmpi)
4402 ("openblas" ,openblas)
4404 ("superlu" ,superlu)))
4406 `(("gfortran" ,gfortran)
4407 ("pkg-config" ,pkg-config)))
4408 (home-page "https://dune-project.org/")
4409 (synopsis "Distributed and Unified Numerics Environment")
4410 (description "DUNE, the Distributed and Unified Numerics Environment is a
4411 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4412 grid-based methods. It supports the easy implementation of methods like
4413 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4414 Differences} (FD).")
4415 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4416 (license license:gpl2)))
4418 (define-public dune-geometry
4420 (name "dune-geometry")
4425 (uri (string-append "https://dune-project.org/download/"
4426 version "/dune-geometry-" version ".tar.gz"))
4429 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4430 (build-system cmake-build-system)
4433 (modify-phases %standard-phases
4434 (add-after 'build 'build-tests
4435 (lambda* (#:key make-flags #:allow-other-keys)
4436 (apply invoke "make" "build_tests" make-flags))))))
4438 `(("dune-common" ,dune-common)
4439 ("openmpi" ,openmpi)
4441 ("openblas" ,openblas)
4443 ("python" ,python)))
4445 `(("gfortran" ,gfortran)
4446 ("pkg-config" ,pkg-config)))
4447 (home-page "https://dune-project.org/")
4448 (synopsis "Distributed and Unified Numerics Environment")
4449 (description "DUNE, the Distributed and Unified Numerics Environment is a
4450 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4451 grid-based methods. It supports the easy implementation of methods like
4452 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4455 This package contains the basic DUNE geometry classes.")
4456 ;; GPL version 2 with "runtime exception"
4457 (license license:gpl2)))
4459 (define-public dune-grid
4466 (uri (string-append "https://dune-project.org/download/"
4467 version "/dune-grid-" version ".tar.gz"))
4470 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4471 (build-system cmake-build-system)
4474 (modify-phases %standard-phases
4475 (add-after 'build 'build-tests
4476 (lambda* (#:key make-flags #:allow-other-keys)
4477 (apply invoke "make" "build_tests" make-flags)))
4478 ;; These tests fail because they require a fully functional MPI
4480 (add-after 'unpack 'disable-failing-tests
4483 (string-append "--exclude-regex '("
4487 "conformvolumevtktest"
4489 "nonconformboundaryvtktest"
4490 "subsamplingvtktest"
4496 "test-dgf-yasp-offset"
4498 "test-geogrid-yaspgrid"
4501 "testiteratorranges"
4502 "test-hierarchicsearch"
4503 "test-parallel-ug-mpi-2"
4504 "test-yaspgrid-backuprestore-equidistant"
4505 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4506 "test-yaspgrid-backuprestore-equidistantoffset"
4507 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4508 "test-yaspgrid-backuprestore-tensor"
4509 "test-yaspgrid-backuprestore-tensor-mpi-2"
4510 "test-yaspgrid-tensorgridfactory"
4511 "test-yaspgrid-tensorgridfactory-mpi-2"
4512 "test-yaspgrid-yaspfactory-1d"
4513 "test-yaspgrid-yaspfactory-1d-mpi-2"
4514 "test-yaspgrid-yaspfactory-2d"
4515 "test-yaspgrid-yaspfactory-2d-mpi-2"
4516 "test-yaspgrid-yaspfactory-3d"
4517 "test-yaspgrid-yaspfactory-3d-mpi-2"
4518 "globalindexsettest"
4519 "persistentcontainertest"
4520 "structuredgridfactorytest"
4521 "tensorgridfactorytest"
4527 `(("dune-common" ,dune-common)
4528 ("dune-geometry" ,dune-geometry)
4531 ("openblas" ,openblas)
4532 ("openmpi" ,openmpi)
4533 ("python" ,python)))
4535 `(("gfortran" ,gfortran)
4536 ("pkg-config" ,pkg-config)))
4537 (home-page "https://dune-project.org/")
4538 (synopsis "Distributed and Unified Numerics Environment")
4539 (description "DUNE, the Distributed and Unified Numerics Environment is a
4540 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4541 grid-based methods. It supports the easy implementation of methods like
4542 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4545 This package contains the basic DUNE grid classes.")
4546 ;; GPL version 2 with "runtime exception"
4547 (license license:gpl2)))
4549 (define-public dune-istl
4556 (uri (string-append "https://dune-project.org/download/"
4557 version "/dune-istl-" version ".tar.gz"))
4560 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4561 (build-system cmake-build-system)
4564 (modify-phases %standard-phases
4565 (add-after 'build 'build-tests
4566 (lambda* (#:key make-flags #:allow-other-keys)
4567 (apply invoke "make" "build_tests" make-flags)))
4568 ;; These tests fail because they require a fully functional MPI
4570 (add-after 'unpack 'disable-failing-tests
4573 (string-append "--exclude-regex '("
4579 "pamg_comm_repart_test"
4587 `(("dune-common" ,dune-common)
4588 ("openmpi" ,openmpi)
4591 ("superlu" ,superlu)
4592 ("openblas" ,openblas)
4594 ("python" ,python)))
4596 `(("gfortran" ,gfortran)
4597 ("pkg-config" ,pkg-config)))
4598 (home-page "https://dune-project.org/")
4599 (synopsis "Distributed and Unified Numerics Environment")
4600 (description "DUNE, the Distributed and Unified Numerics Environment is a
4601 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4604 This is the iterative solver template library which provides generic sparse
4605 matrix/vector classes and a variety of solvers based on these classes. A
4606 special feature is the use of templates to exploit the recursive block
4607 structure of finite element matrices at compile time. Available solvers
4608 include Krylov methods, (block-) incomplete decompositions and
4609 aggregation-based algebraic multigrid.")
4610 ;; GPL version 2 with "runtime exception"
4611 (license license:gpl2)))
4613 (define-public dune-localfunctions
4615 (name "dune-localfunctions")
4620 (uri (string-append "https://dune-project.org/download/"
4621 version "/dune-localfunctions-" version ".tar.gz"))
4624 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4625 (build-system cmake-build-system)
4628 (modify-phases %standard-phases
4629 (add-after 'build 'build-tests
4630 (lambda* (#:key make-flags #:allow-other-keys)
4631 (apply invoke "make" "build_tests" make-flags))))))
4633 `(("dune-common" ,dune-common)
4634 ("dune-geometry" ,dune-geometry)
4635 ("openmpi" ,openmpi)
4638 ("superlu" ,superlu)
4641 `(("gfortran" ,gfortran)
4642 ("pkg-config" ,pkg-config)))
4643 (home-page "https://dune-project.org/")
4644 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4645 (description "This DUNE module provides interface and implementation for
4646 shape functions defined on the DUNE reference elements. In addition to the
4647 shape function, interpolation operators and special keys are provided which
4648 can be used to assemble global function spaces on finite-element grids.
4650 This package provides an interface and implementation for shape functions
4651 defined on the DUNE reference elements. In addition to the shape function,
4652 interpolation operators and special keys are provided which can be used to
4653 assemble global function spaces on finite-element grids.")
4654 ;; GPL version 2 with "runtime exception"
4655 (license license:gpl2)))
4657 (define-public dune-alugrid
4659 (name "dune-alugrid")
4664 (uri (string-append "https://dune-project.org/download/"
4665 version "/dune-alugrid-" version ".tar.gz"))
4668 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4669 (build-system cmake-build-system)
4671 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4674 (modify-phases %standard-phases
4675 (add-after 'unpack 'patch-include
4677 (substitute* "dune/alugrid/test/test-alugrid.cc"
4678 (("doc/grids/gridfactory/testgrids")
4679 "doc/dune-grid/grids/gridfactory/testgrids"))
4681 (add-after 'build 'build-tests
4682 (lambda* (#:key inputs make-flags #:allow-other-keys)
4683 (setenv "CPLUS_INCLUDE_PATH"
4684 (string-append (assoc-ref inputs "dune-grid") "/share:"
4685 (getenv "CPLUS_INCLUDE_PATH")))
4686 (apply invoke "make" "build_tests" make-flags))))))
4688 `(("dune-common" ,dune-common)
4689 ("dune-geometry" ,dune-geometry)
4690 ("dune-grid" ,dune-grid)
4691 ("openmpi" ,openmpi)
4694 ("openblas" ,openblas)
4696 ("superlu" ,superlu)
4700 `(("gfortran" ,gfortran)
4701 ("pkg-config" ,pkg-config)))
4702 (home-page "https://dune-project.org/")
4703 (synopsis "Distributed and Unified Numerics Environment")
4704 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4705 implementation of the DUNE grid interface supporting either simplices or
4707 (license license:gpl2+)))
4709 (define-public dune-typetree
4711 (name "dune-typetree")
4717 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4718 (commit (string-append "v" version))))
4719 (file-name (git-file-name name version))
4722 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4723 (build-system cmake-build-system)
4726 (modify-phases %standard-phases
4727 (add-after 'build 'build-tests
4728 (lambda* (#:key make-flags #:allow-other-keys)
4729 (apply invoke "make" "build_tests" make-flags))))))
4731 `(("dune-common" ,dune-common)
4732 ("openmpi" ,openmpi)
4734 ("openblas" ,openblas)
4737 ("superlu" ,superlu)
4740 `(("gfortran" ,gfortran)
4741 ("pkg-config" ,pkg-config)))
4742 (home-page "https://dune-project.org/")
4743 (synopsis "Distributed and Unified Numerics Environment")
4744 (description "TypeTree is a template library for constructing and
4745 operating on statically typed trees of objects.")
4746 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4747 (license (list license:lgpl3+ license:gpl2))))
4749 (define-public dune-functions
4751 (name "dune-functions")
4757 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4758 (commit (string-append "v" version))))
4759 (file-name (git-file-name name version))
4762 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4763 (build-system cmake-build-system)
4764 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4766 `(("dune-common" ,dune-common)
4767 ("dune-istl" ,dune-istl)
4768 ("dune-localfunctions" ,dune-localfunctions)
4769 ("dune-grid" ,dune-grid)
4770 ("dune-geometry" ,dune-geometry)
4771 ("dune-typetree" ,dune-typetree)
4772 ("openmpi" ,openmpi)
4773 ("openblas" ,openblas)
4776 ("superlu" ,superlu)
4779 `(("gfortran" ,gfortran)
4780 ("pkg-config" ,pkg-config)))
4781 (home-page "https://dune-project.org/")
4782 (synopsis "Distributed and Unified Numerics Environment")
4783 (description "The dune-functions module provides an abstraction layer for
4784 global finite element functions. Its two main concepts are functions
4785 implemented as callable objects, and bases of finite element spaces.")
4786 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4787 (license (list license:lgpl3+ license:gpl2))))
4789 (define-public dune-pdelab
4791 (name "dune-pdelab")
4792 (version "2.6.0-rc1")
4797 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4798 (commit (string-append "v" version))))
4799 (file-name (git-file-name name version))
4802 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4803 (build-system cmake-build-system)
4804 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4806 `(("dune-common" ,dune-common)
4807 ("dune-istl" ,dune-istl)
4808 ("dune-localfunctions" ,dune-localfunctions)
4809 ("dune-geometry" ,dune-geometry)
4810 ("dune-grid" ,dune-grid)
4811 ("dune-typetree" ,dune-typetree)
4812 ("dune-functions" ,dune-functions)
4813 ("openmpi" ,openmpi)
4815 ("openblas" ,openblas)
4819 ("superlu" ,superlu)
4822 `(("gfortran" ,gfortran)
4823 ("pkg-config" ,pkg-config)))
4824 (home-page "https://dune-project.org/")
4825 (synopsis "Differential equations solver toolbox")
4826 (description "PDELab is a partial differential equations solver toolbox
4827 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4828 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4829 (license (list license:lgpl3+ license:gpl2))))