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, 2018 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)
332 (commit (string-append "v" version))))
333 (file-name (git-file-name name version))
336 "13xwcqk2c0q8c1siw566clxcpvp0xrxvb72mra42wa3nvq9wlsv6"))))
337 (build-system cmake-build-system)
339 '(#:test-target "test"
340 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
341 "-DBUILD_TESTING=ON")))
342 (synopsis "Conversion routines for IEEE doubles")
344 "The double-conversion library provides binary-decimal and decimal-binary
345 routines for IEEE doubles. The library consists of efficient conversion
346 routines that have been extracted from the V8 JavaScript engine.")
347 (license license:bsd-3)))
349 (define-public dionysus
355 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
359 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
360 (build-system gnu-build-system)
361 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
362 (synopsis "Local search for universal constants and scientific values")
364 "GNU Dionysus is a convenient system for quickly retrieving the values of
365 mathematical constants used in science and engineering. Values can be
366 searched using a simple command-line tool, choosing from three databases:
367 universal constants, atomic numbers, and constants related to
369 (license license:gpl3+)
370 (home-page "https://www.gnu.org/software/dionysus/")))
378 (uri (string-append "mirror://gnu/gsl/gsl-"
382 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
383 (patches (search-patches "gsl-test-i686.patch"))))
384 (build-system gnu-build-system)
386 `(;; Currently there are numerous tests that fail on "exotic"
387 ;; architectures such as aarch64 and ppc64le.
388 ,@(if (string-prefix? "aarch64-linux"
389 (or (%current-target-system) (%current-system)))
392 (home-page "https://www.gnu.org/software/gsl/")
393 (synopsis "Numerical library for C and C++")
395 "The GNU Scientific Library is a library for numerical analysis in C
396 and C++. It includes a wide range of mathematical routines, with over 1000
397 functions in total. Subject areas covered by the library include:
398 differential equations, linear algebra, Fast Fourier Transforms and random
400 (license license:gpl3+)))
409 (uri (string-append "mirror://gnu/glpk/glpk-"
413 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
414 (build-system gnu-build-system)
418 `(#:configure-flags '("--with-gmp")))
419 (home-page "https://www.gnu.org/software/glpk/")
420 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
422 "GLPK is a C library for solving large-scale linear programming (LP),
423 mixed integer programming (MIP), and other related problems. It supports the
424 GNU MathProg modeling language, a subset of the AMPL language, and features a
425 translator for the language. In addition to the C library, a stand-alone
426 LP/MIP solver is included in the package.")
427 (license license:gpl3+)))
436 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
438 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
440 "/4ti2-" version ".tar.gz"))
442 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
443 (build-system gnu-build-system)
445 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
449 (home-page "http://www.4ti2.de/")
450 (synopsis "Mathematical tool suite for problems on linear spaces")
452 "4ti2 implements algorithms for solving algebraic, geometric and
453 combinatorial problems on linear spaces. Among others, it solves systems
454 of linear equations, computes extreme rays of polyhedral cones, solves
455 integer programming problems and computes Markov bases for statistics.")
456 (license license:gpl2+)))
458 (define-public cddlib
465 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
466 (string-delete #\. version) ".tar.gz"))
469 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
470 (build-system gnu-build-system)
473 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
474 (synopsis "Library for convex hulls and extreme rays of polyhedra")
476 "The C-library cddlib implements the Double Description Method of
477 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
478 rays of a general convex polyhedron given by a system of linear inequalities
479 in arbitrary dimension. It can also be used for the converse operation of
480 computing convex hulls.")
481 (license license:gpl2+)))
483 (define-public arpack-ng
487 (home-page "https://github.com/opencollab/arpack-ng")
490 (uri (git-reference (url home-page) (commit version)))
491 (file-name (git-file-name name version))
494 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
495 (build-system gnu-build-system)
497 `(("autoconf" ,autoconf)
498 ("automake" ,automake)
499 ("libtool" ,libtool)))
502 ("fortran" ,gfortran)))
503 (synopsis "Fortran subroutines for solving eigenvalue problems")
505 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
506 large scale eigenvalue problems.")
507 (license (license:non-copyleft "file://COPYING"
508 "See COPYING in the distribution."))))
510 (define-public arpack-ng-3.3.0
514 (name (package-name arpack-ng))
515 (home-page (package-home-page arpack-ng))
519 (uri (string-append home-page "/archive/" version ".tar.gz"))
520 (file-name (string-append name "-" version ".tar.gz"))
523 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
525 (define-public arpack-ng-openmpi
526 (package (inherit arpack-ng)
527 (name "arpack-ng-openmpi")
530 ,@(package-inputs arpack-ng)))
532 (substitute-keyword-arguments (package-arguments arpack-ng)
533 ((#:configure-flags _ '())
535 ((#:phases phases '%standard-phases)
536 `(modify-phases ,phases
537 (add-before 'check 'mpi-setup
539 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
541 (define-public lapack
548 (uri (string-append "http://www.netlib.org/lapack/lapack-"
552 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
553 (build-system cmake-build-system)
554 (home-page "http://www.netlib.org/lapack/")
555 (inputs `(("fortran" ,gfortran)
556 ("python" ,python-2)))
558 `(#:configure-flags (list
559 "-DBUILD_SHARED_LIBS:BOOL=YES"
562 ;; Build the 'LAPACKE_clatms' functions.
563 "-DLAPACKE_WITH_TMG=ON")
565 (modify-phases %standard-phases
566 (add-before 'check 'patch-python
567 (lambda* (#:key inputs #:allow-other-keys)
568 (let ((python (assoc-ref inputs "python")))
569 (substitute* "lapack_testing.py"
570 (("/usr/bin/env python") python)))
572 (synopsis "Library for numerical linear algebra")
574 "LAPACK is a Fortran 90 library for solving the most commonly occurring
575 problems in numerical linear algebra.")
576 (license (license:non-copyleft "file://LICENSE"
577 "See LICENSE in the distribution."))))
579 (define-public scalapack
586 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
590 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
591 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
592 (build-system cmake-build-system)
595 ("fortran" ,gfortran)
596 ("lapack" ,lapack))) ;for testing only
598 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
599 #:phases (modify-phases %standard-phases
600 (add-before 'check 'mpi-setup
602 (home-page "http://www.netlib.org/scalapack/")
603 (synopsis "Library for scalable numerical linear algebra")
605 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
606 routines on parallel distributed memory machines. ScaLAPACK solves dense and
607 banded linear systems, least squares problems, eigenvalue problems, and
608 singular value problems.")
609 (license (license:non-copyleft "file://LICENSE"
610 "See LICENSE in the distribution."))))
612 (define-public gnuplot
618 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
622 (base32 "1vllgap08nhvdmc03idmkdnk9cfl2bp81hps50q1pqrr640qzp9m"))))
623 (build-system gnu-build-system)
624 (inputs `(("readline" ,readline)
630 `(("pkg-config" ,pkg-config)
631 ("texlive" ,texlive-tiny)))
632 (arguments `(#:configure-flags (list (string-append
633 "--with-texdir=" %output
634 "/texmf-local/tex/latex/gnuplot"))))
635 (home-page "http://www.gnuplot.info")
636 (synopsis "Command-line driven graphing utility")
637 (description "Gnuplot is a portable command-line driven graphing
638 utility. It was originally created to allow scientists and students to
639 visualize mathematical functions and data interactively, but has grown to
640 support many non-interactive uses such as web scripting. It is also used as a
641 plotting engine by third-party applications like Octave.")
642 ;; X11 Style with the additional restriction that derived works may only be
643 ;; distributed as patches to the original.
644 (license (license:fsf-free
645 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
655 (url "https://github.com/OkoSanto/GCTP.git")
656 (commit (string-append "v" version))))
657 (file-name (git-file-name name version))
659 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
661 `(("fortran" ,gfortran)))
662 (build-system gnu-build-system)
663 (synopsis "General Cartographic Transformation Package (GCTP)")
665 "The General Cartographic Transformation Package (GCTP) is a system of
666 software routines designed to permit the transformation of coordinate pairs
667 from one map projection to another. The GCTP is the standard computer
668 software used by the National Mapping Division for map projection
670 (home-page "https://github.com/OkoSanto/GCTP")
671 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
680 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
681 version "/src/hdf-" version ".tar.bz2"))
683 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
684 (patches (search-patches "hdf4-architectures.patch"
685 "hdf4-reproducibility.patch"
686 "hdf4-shared-fortran.patch"))))
687 (build-system gnu-build-system)
689 `(("gfortran" ,gfortran)
694 ("libjpeg" ,libjpeg)))
696 `(#:parallel-tests? #f
697 #:configure-flags '("--enable-shared")
699 (modify-phases %standard-phases
700 ;; This is inspired by two of Debian's patches.
701 (add-before 'configure 'add-more-aarch64-support
703 (substitute* '("mfhdf/ncgen/ncgen.l"
704 "mfhdf/ncgen/ncgenyy.c"
705 "mfhdf/libsrc/netcdf.h.in")
706 (("AIX5L64") "__aarch64__"))
708 (add-before 'configure 'patchbuild
711 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
713 (("/bin/mkdir") "mkdir"))
714 (substitute* (find-files "." "^Makefile\\.in$")
715 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
716 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
717 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
718 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
719 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
721 (add-after 'configure 'patch-settings
723 ;; libhdf4.settings contains the full path of the
724 ;; compilers used, and its contents are included in
725 ;; .so-files. We truncate the hashes to avoid
726 ;; unnecessary store references to those compilers:
727 (substitute* "libhdf4.settings"
728 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
729 (string-append prefix (string-take hash 10) "...")))
732 (home-page "https://www.hdfgroup.org/products/hdf4/")
734 "Library and multi-object file format for storing and managing data")
735 (description "HDF4 is a library and multi-object file format for storing
736 and managing data between machines. HDF4 is an older hierarchical data format,
737 incompatible with HDF5.")
739 (license:non-copyleft
740 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
742 (define-public hdf4-alt
747 (substitute-keyword-arguments (package-arguments hdf4)
748 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
750 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
759 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
760 "hdf5-" (version-major+minor version)
761 "/hdf5-" version "/src/hdf5-"
763 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
765 (match (string-split version #\.)
767 (string-append major minor)))
768 "/src/hdf5-" version ".tar.bz2")))
770 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
771 (patches (search-patches "hdf5-config-date.patch"
772 "hdf5-1.8-mpi-deprecations.patch"))))
773 (build-system gnu-build-system)
777 `(("gfortran" ,gfortran)))
778 (outputs '("out" ; core library
779 "fortran")) ; fortran interface
781 `(;; Some of the users, notably Flann, need the C++ interface.
782 #:configure-flags '("--enable-cxx"
784 "--enable-fortran2003")
785 ;; Use -fPIC to allow the R bindings to link with the static libraries
786 #:make-flags (list "CFLAGS=-fPIC"
789 (modify-phases %standard-phases
790 (add-before 'configure 'patch-configure
791 (lambda* (#:key outputs #:allow-other-keys)
792 (substitute* "configure"
794 (substitute* "fortran/src/Makefile.in"
795 (("libhdf5_fortran_la_LDFLAGS =")
796 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
797 (assoc-ref outputs "fortran") "/lib")))
798 (substitute* "hl/fortran/src/Makefile.in"
799 (("libhdf5hl_fortran_la_LDFLAGS =")
800 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
801 (assoc-ref outputs "fortran") "/lib")))
803 (add-after 'configure 'patch-settings
805 ;; libhdf5.settings contains the full path of the
806 ;; compilers used, and its contents are included in
807 ;; libhdf5.so. We truncate the hashes to avoid
808 ;; unnecessary store references to those compilers:
809 (substitute* "src/libhdf5.settings"
810 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
811 (string-append prefix (string-take hash 10) "..."))
812 ;; Don't record the build-time kernel version to make the
813 ;; settings file reproducible.
814 (("Uname information:.*")
815 "Uname information: Linux\n"))
817 (add-after 'install 'patch-references
818 (lambda* (#:key inputs outputs #:allow-other-keys)
819 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
820 (zlib (assoc-ref inputs "zlib")))
821 (substitute* (find-files bin "h5p?cc")
823 (string-append "-L" zlib "/lib " lib)))
825 (add-after 'install 'split
826 (lambda* (#:key inputs outputs #:allow-other-keys)
827 ;; Move all fortran-related files
828 (let* ((out (assoc-ref outputs "out"))
829 (bin (string-append out "/bin"))
830 (lib (string-append out "/lib"))
831 (inc (string-append out "/include"))
832 (ex (string-append out "/share/hdf5_examples/fortran"))
833 (fort (assoc-ref outputs "fortran"))
834 (fbin (string-append fort "/bin"))
835 (flib (string-append fort "/lib"))
836 (finc (string-append fort "/include"))
837 (fex (string-append fort "/share/hdf5_examples/fortran")))
842 ;; Note: When built with --enable-parallel, the 'h5fc' file
843 ;; doesn't exist, hence this condition.
844 (when (file-exists? (string-append bin "/h5fc"))
845 (rename-file (string-append bin "/h5fc")
846 (string-append fbin "/h5fc")))
847 (for-each (lambda (file)
849 (string-append flib "/" (basename file))))
850 (find-files lib ".*fortran.*"))
851 (for-each (lambda (file)
853 (string-append finc "/" (basename file))))
854 (find-files inc ".*mod"))
855 (for-each (lambda (file)
857 (string-append fex "/" (basename file))))
858 (find-files ex ".*"))
859 (delete-file-recursively ex))
861 (home-page "http://www.hdfgroup.org")
862 (synopsis "Management suite for extremely large and complex data")
863 (description "HDF5 is a suite that makes possible the management of
864 extremely large and complex data collections.")
865 (license (license:x11-style
866 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
868 (define-public hdf5-1.10
869 (package (inherit hdf5)
874 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
875 "hdf5-" (version-major+minor version)
876 "/hdf5-" version "/src/hdf5-"
878 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
881 (take (string-split version #\.) 2))
882 "/src/hdf5-" version ".tar.bz2")))
884 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
885 (patches (search-patches "hdf5-config-date.patch"
886 "hdf5-mpi-deprecations.patch"))))))
888 (define-public hdf-java
896 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
897 version "/src/CMake-hdfjava-" version ".tar.gz"))
899 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
900 (modules '((guix build utils)))
901 (snippet ; Make sure we don't use the bundled sources and binaries.
903 (for-each delete-file
904 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
905 "HDF4.tar.gz" "HDF5.tar.gz"))
906 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
908 (build-system gnu-build-system)
910 `(("jdk" ,icedtea "jdk")
911 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
913 ("hamcrest-core" ,java-hamcrest-core)
914 ("junit" ,java-junit)
915 ("slf4j-simple" ,java-slf4j-simple)))
921 ("slf4j-api" ,java-slf4j-api)))
924 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
925 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
926 (assoc-ref %build-inputs "jdk") "/lib" )
927 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
928 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
931 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
932 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
933 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
934 (string-append "JPEGLIB="
935 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
939 (modify-phases %standard-phases
940 (add-before 'configure 'chdir-to-source
941 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
942 (add-before 'configure 'patch-build
943 (lambda* (#:key inputs outputs #:allow-other-keys)
944 (substitute* "configure"
945 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
946 (("/bin/cat") (which "cat")))
947 ;; Set classpath for compilation
948 (substitute* '("hdf/hdf5lib/Makefile.in"
949 "hdf/hdf5lib/exceptions/Makefile.in"
950 "hdf/hdflib/Makefile.in")
951 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
952 (string-append (assoc-ref inputs "slf4j-api")
953 "/share/java/slf4j-api.jar")))
954 ;; Replace outdated config.sub and config.guess:
955 (with-directory-excursion "config"
956 (for-each (lambda (file)
958 (string-append (assoc-ref inputs "automake")
960 ,(version-major+minor (package-version automake))
962 '("config.sub" "config.guess")))
964 ;; Fix embedded version number
965 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
966 (substitute* "hdf/hdf5lib/H5.java"
968 (string-join hdf5version ", "))))
970 (mkdir-p (string-append (assoc-ref outputs "out")))
971 ;; Set classpath for tests
972 (let* ((build-dir (getcwd))
973 (lib (string-append build-dir "/lib"))
974 (jhdf (string-append lib "/jhdf.jar"))
975 (jhdf5 (string-append lib "/jhdf5.jar"))
978 (string-append (assoc-ref inputs i)
979 "/share/java/" i ".jar"))
980 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
982 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
984 (substitute* '("test/hdf5lib/Makefile.in"
985 "test/hdf5lib/junit.sh.in"
986 "examples/runExample.sh.in")
988 (string-append (assoc-ref inputs "coreutils")
991 (string-append (assoc-ref inputs "coreutils")
993 (("CLASSPATH=[^\n]*")
994 (string-append "CLASSPATH=" class-path)))
995 (setenv "CLASSPATH" class-path))
997 (add-before 'check 'build-examples
999 (apply invoke `("javac"
1000 ,@(find-files "examples" ".*\\.java"))))))
1002 #:parallel-build? #f
1004 #:parallel-tests? #f ))
1005 (home-page "https://support.hdfgroup.org/products/java")
1006 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1007 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1008 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1011 ;; BSD-style license:
1012 (license (license:x11-style
1013 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1014 /current/src/unpacked/COPYING"))))
1016 (define-public hdf-eos2
1023 (uri "ftp://edhs1.gsfc.nasa.gov\
1024 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1026 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1027 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1028 "hdf-eos2-build-shared.patch"
1029 "hdf-eos2-fortrantests.patch"))))
1030 (build-system gnu-build-system)
1032 `(("gfortran" ,gfortran)))
1034 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1036 ("libjpeg" ,libjpeg)
1039 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1040 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1041 #:parallel-tests? #f))
1042 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1043 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1044 (description "HDF-EOS2 is a software library built on HDF4 which supports
1045 the construction of data structures used in NASA's Earth Observing
1046 System (Grid, Point and Swath).")
1048 ;; Source files carry a permissive license header.
1049 (license (license:non-copyleft home-page))))
1051 (define-public hdf-eos5
1057 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1058 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1061 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1062 (patches (search-patches "hdf-eos5-build-shared.patch"
1063 "hdf-eos5-remove-gctp.patch"
1064 "hdf-eos5-fix-szip.patch"
1065 "hdf-eos5-fortrantests.patch"))))
1067 `(("gfortran" ,gfortran)))
1068 (build-system gnu-build-system)
1074 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1075 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1076 #:parallel-tests? #f))
1077 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1079 "HDF-EOS5 is a software library built on HDF5 to support the construction
1080 of data structures used in NASA's Earth Observing System (Grid, Point and
1082 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1084 ;; Source files carry a permissive license header.
1085 (license (license:non-copyleft home-page))))
1087 (define-public hdf5-parallel-openmpi
1088 (package (inherit hdf5)
1089 (name "hdf5-parallel-openmpi")
1092 ,@(package-inputs hdf5)))
1094 (substitute-keyword-arguments (package-arguments hdf5)
1095 ((#:configure-flags flags)
1096 ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags)))
1098 `(modify-phases ,phases
1099 (add-after 'build 'mpi-setup
1101 (add-before 'check 'patch-tests
1103 ;; OpenMPI's mpirun will exit with non-zero status if it
1104 ;; detects an "abnormal termination", i.e. any process not
1105 ;; calling MPI_Finalize(). Since the test is explicitely
1106 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1107 ;; H5C_flush_cache from being called, mpirun will always
1108 ;; complain, so turn this test off.
1109 (substitute* "testpar/Makefile"
1110 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1111 (string-append front back "\n")))
1112 (substitute* "tools/h5diff/testph5diff.sh"
1113 (("/bin/sh") (which "sh")))
1115 (synopsis "Management suite for data with parallel IO support")))
1117 (define-public h5check
1124 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1125 "h5check/src/h5check-" version ".tar.gz"))
1128 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1129 (build-system gnu-build-system)
1130 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1131 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1132 (synopsis "HDF5 format checker")
1133 (description "@code{h5check} is a validation tool for verifying that an
1134 HDF5 file is encoded according to the HDF File Format Specification.")
1135 (license (license:x11-style "file://COPYING"))))
1143 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1148 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1149 (build-system cmake-build-system)
1150 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1151 (inputs `(("lapack" ,lapack)
1153 ;; FIXME: Even though the fonts are available dvips complains:
1154 ;; "Font cmmi10 not found; characters will be left blank."
1156 `(("texlive" ,texlive-tiny)
1157 ("ghostscript" ,ghostscript)
1158 ("doxygen" ,doxygen)))
1159 (home-page "http://itpp.sourceforge.net")
1160 (synopsis "C++ library of maths, signal processing and communication classes")
1161 (description "IT++ is a C++ library of mathematical, signal processing and
1162 communication classes and functions. Its main use is in simulation of
1163 communication systems and for performing research in the area of
1164 communications. The kernel of the library consists of generic vector and
1165 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1166 similar to MATLAB, GNU Octave or SciPy.")
1167 (license license:gpl3+)))
1169 (define-public netcdf
1176 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1177 "netcdf-" version ".tar.gz"))
1180 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1181 (patches (search-patches "netcdf-date-time.patch"
1182 "netcdf-tst_h_par.patch"))))
1183 (build-system gnu-build-system)
1186 ("doxygen" ,doxygen)
1187 ("graphviz" ,graphviz)))
1189 `(("hdf4" ,hdf4-alt)
1192 ("libjpeg" ,libjpeg)))
1194 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1196 #:phases (modify-phases %standard-phases
1197 (add-before 'configure 'fix-source-date
1199 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1200 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1201 ;; to '1st hour of the current day', and therefore makes the
1202 ;; package not reproducible.
1203 (substitute* "./configure"
1204 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1205 "date --date='@0'"))
1207 (add-after 'configure 'patch-settings
1209 ;; libnetcdf.settings contains the full filename of the compilers
1210 ;; used to build the library. We truncate the hashes of those
1211 ;; filenames to avoid unnecessary references to the corresponding
1213 (substitute* "libnetcdf.settings"
1214 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1215 (string-append prefix (string-take hash 10) "...")))
1218 #:parallel-tests? #f)) ;various race conditions
1219 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1220 (synopsis "Library for scientific data")
1221 (description "NetCDF is an interface for scientific data access and a
1222 software library that provides an implementation of the interface. The netCDF
1223 library defines a machine-independent format for representing scientific data.
1224 Together, the interface, library, and format support the creation, access, and
1225 sharing of scientific data.")
1226 (license (license:x11-style "file://COPYRIGHT"))))
1228 (define-public netcdf-parallel-openmpi
1229 (package (inherit netcdf)
1230 (name "netcdf-parallel-openmpi")
1233 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1234 (package-inputs netcdf))))
1235 ;; TODO: Replace pkg-config references in nc-config with absolute references
1237 (substitute-keyword-arguments (package-arguments netcdf)
1238 ((#:configure-flags flags)
1239 `(cons* "CC=mpicc" "CXX=mpicxx"
1240 "--enable-parallel-tests"
1241 ;; Shared libraries not supported with parallel IO.
1242 "--disable-shared" "--with-pic"
1245 (define-public netcdf-fortran
1247 (name "netcdf-fortran")
1252 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1256 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1257 (build-system gnu-build-system)
1259 `(#:parallel-tests? #f))
1261 `(("netcdf" ,netcdf)))
1263 `(("gfortran" ,gfortran)))
1264 (synopsis "Fortran interface for the netCDF library")
1265 (description (package-description netcdf))
1266 (home-page (package-home-page netcdf))
1267 (license (package-license netcdf))))
1269 (define-public nlopt
1275 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1278 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1279 (build-system gnu-build-system)
1281 `(;; Shared libraries are not built by default. They are required to
1282 ;; build the Guile, Octave, and Python bindings.
1283 #:configure-flags '("--enable-shared")
1286 (modify-phases %standard-phases
1287 (add-before 'configure 'set-libnlopt-file-name
1288 (lambda* (#:key outputs #:allow-other-keys)
1289 ;; Make sure the Scheme module refers to the library by its
1290 ;; absolute file name (we cannot do that from a snippet
1291 ;; because the expansion of @libdir@ contains
1293 (let ((out (assoc-ref outputs "out")))
1294 (substitute* "swig/nlopt.scm.in"
1296 (string-append out "/lib/libnlopt")))
1298 (inputs `(("guile" ,guile-2.0)))
1299 (native-inputs `(("pkg-config" ,pkg-config)))
1300 (home-page "http://ab-initio.mit.edu/wiki/")
1301 (synopsis "Library for nonlinear optimization")
1302 (description "NLopt is a library for nonlinear optimization, providing a
1303 common interface for a number of different free optimization routines available
1304 online as well as original implementations of various other algorithms.")
1305 (license license:lgpl2.1+)))
1307 (define-public ipopt
1314 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1318 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1319 (modules '((guix build utils)))
1321 ;; Make sure we don't use the bundled software.
1323 (delete-file-recursively "ThirdParty")
1325 (build-system gnu-build-system)
1327 '(#:phases (modify-phases %standard-phases
1328 (add-after 'install 'add--L-flags-in-ipopt.pc
1329 (lambda* (#:key inputs outputs #:allow-other-keys)
1330 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1331 ;; move it to "Libs.private" where it belongs, and add a
1332 ;; '-L' flag for LAPACK.
1333 (let ((out (assoc-ref outputs "out"))
1334 (lapack (assoc-ref inputs "lapack")))
1335 (substitute* (string-append out "/lib/pkgconfig/"
1337 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1338 (string-append "Libs: " before " " after "\n"
1339 "Libs.private: " before
1340 "-L" lapack "/lib -llapack -lblas "
1344 `(("gfortran" ,gfortran)))
1346 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1347 `(("lapack" ,lapack))) ;for both libblas and liblapack
1348 (home-page "http://www.coin-or.org")
1349 (synopsis "Large-scale nonlinear optimizer")
1351 "The Interior Point Optimizer (IPOPT) is a software package for
1352 large-scale nonlinear optimization. It provides C++, C, and Fortran
1354 (license license:epl1.0)))
1362 (uri (string-append "https://www.coin-or.org/download/source/"
1363 "Clp/Clp-" version ".tgz"))
1366 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1367 (modules '((guix build utils)))
1369 ;; Make sure we don't use the bundled software.
1371 (delete-file-recursively "ThirdParty")
1373 (build-system gnu-build-system)
1375 `(("gfortran" ,gfortran)
1376 ("pkg-config" ,pkg-config)))
1378 `(("openblas" ,openblas)))
1379 (home-page "https://www.coin-or.org")
1380 (synopsis "Linear programming solver")
1382 "CLP is a high quality linear programming solver. Its main strengths are
1383 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1384 linear and quadratic objectives. There are limited facilities for nonlinear
1385 and quadratic objectives using the Simplex algorithm.")
1386 (license license:epl1.0)))
1388 (define-public ceres
1390 (name "ceres-solver")
1392 (home-page "http://ceres-solver.org/")
1395 (uri (string-append home-page "ceres-solver-"
1399 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1400 (build-system cmake-build-system)
1402 ;; TODO: Build HTML user documentation and install separately.
1403 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1404 "-DBUILD_SHARED_LIBS=ON")
1406 #:phases (modify-phases %standard-phases
1407 (add-before 'configure 'set-library-directory
1409 ;; Install libraries to lib/, not lib64/.
1410 (substitute* "internal/ceres/CMakeLists.txt"
1411 (("set\\(LIB_SUFFIX \"64\"\\)")
1412 "set(LIB_SUFFIX \"\")"))
1415 `(("pkg-config" ,pkg-config)))
1417 `(("glog" ,glog))) ;for #include <glog/glog.h>
1422 ("suitesparse" ,suitesparse)
1423 ("gflags" ,gflags)))
1424 (synopsis "C++ library for solving large optimization problems")
1426 "Ceres Solver is a C++ library for modeling and solving large,
1427 complicated optimization problems. It is a feature rich, mature and
1428 performant library which has been used in production since 2010. Ceres Solver
1429 can solve two kinds of problems:
1431 @item non-linear least squares problems with bounds constraints;
1432 @item general unconstrained optimization problems.
1434 (license license:bsd-3)))
1436 ;; For a fully featured Octave, users are strongly recommended also to install
1437 ;; the following packages: less, ghostscript, gnuplot.
1438 (define-public octave-cli
1445 (uri (string-append "mirror://gnu/octave/octave-"
1449 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1450 (build-system gnu-build-system)
1452 `(("lapack" ,lapack)
1454 ("readline" ,readline)
1459 ("arpack" ,arpack-ng)
1462 ("fontconfig" ,fontconfig)
1463 ("freetype" ,freetype)
1470 ("texinfo" ,texinfo)
1471 ("graphicsmagick" ,graphicsmagick)
1472 ("suitesparse" ,suitesparse)
1473 ("libsndfile" ,libsndfile)
1474 ("portaudio" ,portaudio)
1475 ("alsa-lib" ,alsa-lib)))
1478 ("gfortran" ,gfortran)
1479 ("pkg-config" ,pkg-config)
1481 ;; The following inputs are not actually used in the build process.
1482 ;; However, the ./configure gratuitously tests for their existence and
1483 ;; assumes that programs not present at build time are also not, and
1484 ;; can never be, available at run time! If these inputs are therefore
1485 ;; not present, support for them will be built out. However, Octave
1486 ;; will still run without them, albeit without the features they
1489 ("ghostscript" ,ghostscript)
1490 ("gnuplot" ,gnuplot)))
1491 ;; Octave code uses this variable to detect directories holding multiple CA
1492 ;; certificates to verify peers with. This is required for the networking
1493 ;; functions that require encryption to work properly.
1494 (native-search-paths
1495 (list (search-path-specification
1496 (variable "CURLOPT_CAPATH")
1497 (files '("etc/ssl/certs")))))
1500 (list (string-append "--with-shell="
1501 (assoc-ref %build-inputs "bash")
1504 (modify-phases %standard-phases
1505 (add-after 'configure 'configure-makeinfo
1506 (lambda* (#:key inputs #:allow-other-keys)
1507 (substitute* "libinterp/corefcn/help.h"
1510 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1512 (home-page "https://www.gnu.org/software/octave/")
1513 (synopsis "High-level language for numerical computation")
1514 (description "GNU Octave is a high-level interpreted language that is
1515 specialized for numerical computations. It can be used for both linear and
1516 non-linear applications and it provides great support for visualizing results.
1517 Work may be performed both at the interactive command-line as well as via
1519 (license license:gpl3+)))
1521 (define-public octave
1522 (package (inherit octave-cli)
1525 (inherit (package-source octave-cli))))
1527 `(("qscintilla" ,qscintilla)
1529 ,@(package-inputs octave-cli)))
1531 `(("qttools" , qttools) ;for lrelease
1532 ("texlive" ,texlive) ;for texi2dvi
1533 ,@(package-native-inputs octave-cli)))
1535 (substitute-keyword-arguments (package-arguments octave-cli)
1537 `(modify-phases ,phases
1538 (add-before 'configure 'patch-qscintilla-library-name
1539 (lambda* (#:key inputs #:allow-other-keys)
1540 ;; The QScintilla library that the Octave configure script tries
1541 ;; to link with should be named libqscintilla-qt5.so, but the
1542 ;; QScintilla input provides the shared library as
1543 ;; libqscintilla2_qt5.so.
1544 (substitute* "configure"
1545 (("qscintilla2-qt5")
1549 (define-public qtoctave
1550 (deprecated-package "qtoctave" octave))
1552 (define-public opencascade-oce
1554 (name "opencascade-oce")
1560 (url "https://github.com/tpaviot/oce.git")
1561 (commit (string-append "OCE-" version))))
1562 (file-name (git-file-name name version))
1563 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1565 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1566 (build-system cmake-build-system)
1569 (list "-DOCE_TESTING:BOOL=ON"
1570 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1571 "-DOCE_DRAW:BOOL=ON"
1572 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1573 (assoc-ref %outputs "out"))
1574 "-UCMAKE_INSTALL_RPATH")))
1576 `(("freetype" ,freetype)
1583 `(("python" ,python-wrapper)))
1584 (home-page "https://github.com/tpaviot/oce")
1585 (synopsis "Libraries for 3D modeling and numerical simulation")
1587 "Open CASCADE is a set of libraries for the development of applications
1588 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1589 C++ class libraries providing services for 3D surface and solid modeling, CAD
1590 data exchange, and visualization. It is used for development of specialized
1591 software dealing with 3D models in design (CAD), manufacturing (CAM),
1592 numerical simulation (CAE), measurement equipment (CMM), and quality
1593 control (CAQ) domains.
1595 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1596 patches, improvements, and experiments contributed by users over the official
1597 Open CASCADE library.")
1598 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1599 ; use of header files; see
1600 ; OCCT_LGPL_EXCEPTION.txt
1601 license:public-domain; files
1602 ; src/Standard/Standard_StdAllocator.hxx and
1603 ; src/NCollection/NCollection_StdAllocator.hxx
1604 license:expat; file src/OpenGl/OpenGl_glext.h
1605 license:bsd-3)))); test framework gtest
1614 (uri (string-append "http://gmsh.info/src/gmsh-"
1615 version "-source.tgz"))
1617 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1618 (modules '((guix build utils)))
1620 ;; Remove non-free METIS code
1622 (delete-file-recursively "contrib/Metis")
1624 (build-system cmake-build-system)
1627 ("gfortran" ,gfortran)
1633 ("opencascade-oce" ,opencascade-oce)
1635 ("libxext" ,libxext)))
1637 `(("fontconfig" ,fontconfig)
1638 ("libxft" ,libxft)))
1640 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1641 "-DENABLE_BUILD_SHARED:BOOL=ON"
1642 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1643 (home-page "http://www.geuz.org/gmsh/")
1644 (synopsis "3D finite element grid generator")
1645 (description "Gmsh is a 3D finite element grid generator with a built-in
1646 CAD engine and post-processor. Its design goal is to provide a fast, light
1647 and user-friendly meshing tool with parametric input and advanced
1648 visualization capabilities. Gmsh is built around four modules: geometry,
1649 mesh, solver and post-processing. The specification of any input to these
1650 modules is done either interactively using the graphical user interface or in
1651 ASCII text files using Gmsh's own scripting language.")
1652 (license license:gpl2+)))
1654 (define-public maxflow
1661 (url "https://github.com/gerddie/maxflow.git")
1662 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1663 (file-name (string-append name "-" version "-checkout"))
1666 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1667 (build-system cmake-build-system)
1668 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1669 (synopsis "Library implementing Maxflow algorithm")
1670 (description "An implementation of the maxflow algorithm described in
1671 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1672 Energy Minimization in Computer Vision.\n
1673 Yuri Boykov and Vladimir Kolmogorov.\n
1674 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1676 (license license:gpl3+)))
1678 (define-public petsc
1685 ;; The *-lite-* tarball does not contain the *large* documentation
1686 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1687 "petsc-lite-" version ".tar.gz"))
1689 (base32 "0fk16944zh3473ra198kdkxdn08rq7b6ap838hxy1mh1i0hb488r"))))
1690 (outputs '("out" ; libraries and headers
1691 "examples")) ; ~30MiB of examples
1692 (build-system gnu-build-system)
1694 `(("python" ,python-2)))
1696 `(("gfortran" ,gfortran)
1698 ("superlu" ,superlu)
1699 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1700 ;; leaving out opengl, as configuration seems to only be for mac
1703 `(#:test-target "test"
1704 #:parallel-build? #f ; build is parallel by default
1710 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1711 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1712 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1714 (modify-phases %standard-phases
1716 ;; PETSc's configure script is actually a python script, so we can't
1717 ;; run it with bash.
1718 (lambda* (#:key outputs (configure-flags '())
1720 (let* ((prefix (assoc-ref outputs "out"))
1721 (flags `(,(string-append "--prefix=" prefix)
1722 ,@configure-flags)))
1723 (format #t "build directory: ~s~%" (getcwd))
1724 (format #t "configure flags: ~s~%" flags)
1725 (apply invoke "./configure" flags))))
1726 (add-after 'configure 'clean-local-references
1727 (lambda* (#:key outputs #:allow-other-keys)
1728 (let ((out (assoc-ref outputs "out")))
1729 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1730 ;; Prevent build directory from leaking into compiled code
1732 ;; Scrub timestamp for reproducibility
1733 ((".*Libraries compiled on.*") ""))
1734 (substitute* (find-files "." "petscvariables")
1735 ;; Do not expose build machine characteristics, set to defaults.
1736 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1737 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1739 (add-after 'install 'clean-install
1740 ;; Try to keep installed files from leaking build directory names.
1741 (lambda* (#:key inputs outputs #:allow-other-keys)
1742 (let ((out (assoc-ref outputs "out")))
1743 (substitute* (map (lambda (file)
1744 (string-append out "/lib/petsc/conf/" file))
1745 '("petscvariables"))
1747 ;; Make compiler references point to the store
1748 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1749 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1750 (string-append "= " (which compiler))))
1751 ;; PETSc installs some build logs, which aren't necessary.
1752 (for-each (lambda (file)
1753 (let ((f (string-append out "/lib/petsc/conf/" file)))
1754 (when (file-exists? f)
1756 '("configure.log" "make.log" "gmake.log"
1757 "test.log" "error.log" "RDict.db"
1758 "PETScBuildInternal.cmake"
1759 ;; Once installed, should uninstall with Guix
1762 (add-after 'install 'move-examples
1763 (lambda* (#:key outputs #:allow-other-keys)
1764 (let* ((out (assoc-ref outputs "out"))
1765 (examples (assoc-ref outputs "examples"))
1766 (exdir (string-append out "/share/petsc/examples"))
1767 (exdir' (string-append examples "/share/petsc/examples")))
1768 (copy-recursively exdir exdir')
1769 (delete-file-recursively exdir)
1771 (home-page "http://www.mcs.anl.gov/petsc")
1772 (synopsis "Library to solve PDEs")
1773 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1774 data structures and routines for the scalable (parallel) solution of
1775 scientific applications modeled by partial differential equations.")
1776 (license (license:non-copyleft
1777 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1779 (define-public petsc-complex
1780 (package (inherit petsc)
1781 (name "petsc-complex")
1783 (substitute-keyword-arguments (package-arguments petsc)
1784 ((#:configure-flags cf)
1785 `(cons "--with-scalar-type=complex" ,cf))))
1786 (synopsis "Library to solve PDEs (with complex scalars)")))
1788 (define-public petsc-openmpi
1789 (package (inherit petsc)
1790 (name "petsc-openmpi")
1792 `(("hdf5" ,hdf5-parallel-openmpi)
1793 ("hypre" ,hypre-openmpi)
1795 ("mumps" ,mumps-openmpi)
1796 ("openmpi" ,openmpi)
1797 ("scalapack" ,scalapack)
1798 ("scotch" ,pt-scotch32)
1799 ,@(package-inputs petsc)))
1801 (substitute-keyword-arguments (package-arguments petsc)
1802 ((#:configure-flags cf)
1804 "--with-mpiexec=mpirun"
1807 "--with-scalapack=1"
1809 ,(string-append "--with-mpi-dir="
1810 (assoc-ref %build-inputs "openmpi"))
1811 ,(string-append "--with-hdf5-include="
1812 (assoc-ref %build-inputs "hdf5") "/include")
1813 ,(string-append "--with-hdf5-lib="
1814 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1815 ,@(delete "--with-mpi=0" ,cf)))
1817 `(modify-phases ,phases
1818 (add-before 'configure 'mpi-setup
1819 ,%openmpi-setup)))))
1820 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1822 (define-public petsc-complex-openmpi
1823 (package (inherit petsc-complex)
1824 (name "petsc-complex-openmpi")
1826 `(("openmpi" ,openmpi)
1827 ,@(package-inputs petsc-complex)))
1829 (substitute-keyword-arguments (package-arguments petsc-complex)
1830 ((#:configure-flags cf)
1831 ``("--with-mpiexec=mpirun"
1832 ,(string-append "--with-mpi-dir="
1833 (assoc-ref %build-inputs "openmpi"))
1834 ,@(delete "--with-mpi=0" ,cf)))))
1835 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1837 (define-public python-petsc4py
1839 (name "python-petsc4py")
1844 (uri (pypi-uri "petsc4py" version))
1847 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1848 (build-system python-build-system)
1851 (modify-phases %standard-phases
1852 (add-before 'build 'pre-build
1854 ;; Define path to PETSc installation.
1855 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1857 (add-before 'check 'mpi-setup
1860 `(("petsc" ,petsc-openmpi)
1861 ("python-numpy" ,python-numpy)))
1862 (home-page "https://bitbucket.org/petsc/petsc4py/")
1863 (synopsis "Python bindings for PETSc")
1864 (description "PETSc, the Portable, Extensible Toolkit for
1865 Scientific Computation, is a suite of data structures and routines for
1866 the scalable (parallel) solution of scientific applications modeled by
1867 partial differential equations. It employs the MPI standard for all
1868 message-passing communication. @code{petsc4py} provides Python
1869 bindings to almost all functions of PETSc.")
1870 (license license:bsd-3)))
1872 (define-public python-kiwisolver
1874 (name "python-kiwisolver")
1878 (uri (pypi-uri "kiwisolver" version))
1881 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1882 (build-system python-build-system)
1883 (home-page "https://github.com/nucleic/kiwi")
1884 (synopsis "Fast implementation of the Cassowary constraint solver")
1886 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1887 solving algorithm. Kiwi has been designed from the ground up to be
1888 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1889 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1890 savings are consistently > 5x.")
1891 (license license:bsd-3)))
1893 (define-public python2-kiwisolver
1894 (package-with-python2 python-kiwisolver))
1896 (define-public slepc
1903 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1907 "188j1a133q91h8pivpnzwcf78kz8dvz2nzf6ndnjygdbqb48fizn"))))
1908 (build-system gnu-build-system)
1910 `(("python" ,python-2)))
1912 `(("arpack" ,arpack-ng)
1913 ("gfortran" ,gfortran)))
1915 `(("petsc" ,petsc)))
1917 `(#:parallel-build? #f ;build is parallel by default
1919 `(,(string-append "--with-arpack-dir="
1920 (assoc-ref %build-inputs "arpack") "/lib"))
1921 #:make-flags ;honor (parallel-job-count)
1922 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1924 (modify-phases %standard-phases
1926 ;; configure is a python script, so we can't run it with bash.
1927 (lambda* (#:key inputs outputs (configure-flags '())
1929 (let* ((prefix (assoc-ref outputs "out"))
1930 (flags `(,(string-append "--prefix=" prefix)
1931 ,@configure-flags)))
1932 (format #t "build directory: ~s~%" (getcwd))
1933 (format #t "configure flags: ~s~%" flags)
1934 (setenv "SLEPC_DIR" (getcwd))
1935 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1936 (apply invoke "./configure" flags))))
1937 (add-after 'install 'delete-doc
1938 ;; TODO: SLEPc installs HTML documentation alongside headers in
1939 ;; $out/include. We'd like to move them to share/doc, but delete
1940 ;; them for now, as they are incomplete and installing the complete
1941 ;; documentation is difficult.
1942 (lambda* (#:key outputs #:allow-other-keys)
1943 (let* ((out (assoc-ref outputs "out")))
1944 (for-each delete-file (find-files out "\\.html$"))
1946 (add-after 'install 'clean-install
1947 ;; Clean up unnecessary build logs from installation.
1948 (lambda* (#:key outputs #:allow-other-keys)
1949 (let ((out (assoc-ref outputs "out")))
1950 (for-each (lambda (file)
1951 (let ((f (string-append out "/lib/slepc/conf/" file)))
1952 (when (file-exists? f)
1954 '("configure.log" "make.log" "gmake.log"
1955 "test.log" "error.log" "RDict.db"
1958 (home-page "http://slepc.upv.es")
1959 (synopsis "Scalable library for eigenproblems")
1960 (description "SLEPc is a software library for the solution of large sparse
1961 eigenproblems on parallel computers. It can be used for the solution of
1962 linear eigenvalue problems formulated in either standard or generalized form,
1963 as well as other related problems such as the singular value decomposition.
1964 The emphasis of the software is on methods and techniques appropriate for
1965 problems in which the associated matrices are sparse, for example, those
1966 arising after the discretization of partial differential equations.")
1967 (license license:bsd-2)))
1969 (define-public slepc-complex
1970 (package (inherit slepc)
1971 (name "slepc-complex")
1973 `(("petsc" ,petsc-complex)
1974 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1975 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1977 (define-public slepc-openmpi
1978 (package (inherit slepc)
1979 (name "slepc-openmpi")
1981 (substitute-keyword-arguments (package-arguments slepc)
1982 ((#:phases phases '%standard-phases)
1983 `(modify-phases ,phases
1984 (add-before 'check 'mpi-setup
1985 ,%openmpi-setup)))))
1988 ("arpack" ,arpack-ng-openmpi)
1989 ,@(alist-delete "arpack" (package-inputs slepc))))
1991 `(("petsc" ,petsc-openmpi)
1992 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1993 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1995 (define-public slepc-complex-openmpi
1996 (package (inherit slepc-openmpi)
1997 (name "slepc-complex-openmpi")
1999 `(("petsc" ,petsc-complex-openmpi)
2000 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2001 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2003 (define-public python-slepc4py
2005 (name "python-slepc4py")
2010 (uri (pypi-uri "slepc4py" version))
2013 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2014 (build-system python-build-system)
2017 (modify-phases %standard-phases
2018 (add-before 'build 'pre-build
2020 ;; Define path to PETSc installation.
2021 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2022 ;; Define path to SLEPc installation.
2023 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2025 (add-before 'check 'mpi-setup
2028 `(("python-numpy" ,python-numpy)
2029 ("python-petsc4py" ,python-petsc4py)
2030 ("slepc" ,slepc-openmpi)))
2031 (home-page "https://bitbucket.org/slepc/slepc4py/")
2032 (synopsis "Python bindings for SLEPc")
2033 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2034 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2035 Scientific Computation. It employs the MPI standard for all
2036 message-passing communication. @code{slepc4py} provides Python
2037 bindings to almost all functions of SLEPc.")
2038 (license license:bsd-3)))
2040 (define-public mumps
2047 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2051 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2052 (patches (search-patches "mumps-build-parallelism.patch"))))
2053 (build-system gnu-build-system)
2055 `(("fortran" ,gfortran)
2056 ;; These are required for linking against mumps, but we let the user
2057 ;; declare the dependency.
2060 ("scotch" ,scotch)))
2062 `(#:modules ((ice-9 match)
2065 ,@%gnu-build-system-modules)
2067 (modify-phases %standard-phases
2069 (lambda* (#:key inputs #:allow-other-keys)
2070 (call-with-output-file "Makefile.inc"
2081 INCSEQ = -I$(topdir)/libseq
2082 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2083 LIBSEQNEEDED = libseqneeded~;
2087 AR = ar vr # rules require trailing space, ugh...
2089 LIBBLAS = -L~a -lopenblas~@[
2090 SCALAP = -L~a -lscalapack~]
2091 LIBOTHERS = -pthread
2094 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2098 LIBS = $(SCALAP) $(LIBSEQ)
2099 LPORDDIR = $(topdir)/PORD/lib
2100 IPORD = -I$(topdir)/PORD/include
2101 LPORD = -L$(LPORDDIR) -lpord
2102 ORDERINGSF = -Dpord~@[
2104 IMETIS = -I$(METISDIR)/include
2105 LMETIS = -L$(METISDIR)/lib -lmetis
2106 ORDERINGSF += -Dmetis~]~@[~:{
2108 ISCOTCH = -I$(SCOTCHDIR)/include
2109 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2110 ORDERINGSF += ~a~}~]
2111 ORDERINGSC = $(ORDERINGSF)
2112 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2113 IORDERINGSF = $(ISCOTCH)
2114 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2115 (assoc-ref inputs "mpi")
2116 (assoc-ref inputs "blas")
2117 (assoc-ref inputs "scalapack")
2118 (assoc-ref inputs "metis")
2119 (match (list (assoc-ref inputs "pt-scotch")
2120 (assoc-ref inputs "scotch"))
2124 `((,scotch "" "-Dscotch")))
2127 "-lptesmumps -lptscotch -lptscotcherr "
2128 "-Dptscotch")))))))))
2130 ;; By default only the d-precision library is built. Make with "all"
2131 ;; target so that all precision libraries and examples are built.
2133 (invoke "make" "all"
2134 (format #f "-j~a" (parallel-job-count)))))
2136 ;; Run the simple test drivers, which read test input from stdin:
2137 ;; from the "real" input for the single- and double-precision
2138 ;; testers, and from the "cmplx" input for complex-precision
2139 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2140 ;; package to prefix execution with "mpirun".
2141 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2142 (with-directory-excursion "examples"
2145 (let ((tester (apply open-pipe*
2148 ,(string-append "./" prec
2150 (input (open-input-file
2151 (string-append "input_simpletest_" type))))
2153 (dump-port input tester)
2155 (zero? (close-pipe tester)))))
2157 '("real" "real" "cmplx" "cmplx")))))
2159 (lambda* (#:key outputs #:allow-other-keys)
2160 (let* ((out (assoc-ref outputs "out"))
2161 (libdir (string-append out "/lib")))
2162 (copy-recursively "lib" libdir)
2163 (copy-recursively "include" (string-append out "/include"))
2164 (when (file-exists? "libseq/libmpiseq.a")
2165 (install-file "libseq/libmpiseq.a" libdir))
2167 (home-page "http://mumps.enseeiht.fr")
2168 (synopsis "Multifrontal sparse direct solver")
2170 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2171 sparse system of linear equations A x = b using Guassian elimination.")
2172 (license license:cecill-c)))
2174 (define-public mumps-metis
2175 (package (inherit mumps)
2176 (name "mumps-metis")
2178 (alist-delete "scotch" (package-inputs mumps)))))
2180 (define-public mumps-openmpi
2181 (package (inherit mumps)
2182 (name "mumps-openmpi")
2185 ("scalapack" ,scalapack)
2186 ("pt-scotch" ,pt-scotch)
2187 ,@(alist-delete "scotch" (package-inputs mumps))))
2189 (substitute-keyword-arguments (package-arguments mumps)
2191 `(modify-phases ,phases
2192 (add-before 'check 'mpi-setup
2196 ((assoc-ref ,phases 'check)
2197 #:exec-prefix '("mpirun" "-n" "2"))))))))
2198 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2200 (define-public mumps-metis-openmpi
2201 (package (inherit mumps-openmpi)
2202 (name "mumps-metis-openmpi")
2204 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2206 (define-public r-quadprog
2213 (uri (cran-uri "quadprog" version))
2216 "1fnwaz70dhiq4av8apc4wr3yrrpwc2i6lksf8pfi6jw8vzzyahql"))))
2217 (build-system r-build-system)
2219 `(("gfortran" ,gfortran)))
2220 (home-page "https://cran.r-project.org/web/packages/quadprog")
2221 (synopsis "Functions to solve quadratic programming problems")
2223 "This package contains routines and documentation for solving quadratic
2224 programming problems.")
2225 (license license:gpl3+)))
2227 (define-public r-pracma
2233 (uri (cran-uri "pracma" version))
2235 (base32 "0isd3s0i4mzmva8lkh0j76hwjy1w50q7d1n9lhxsnnkgalx3xs1g"))))
2236 (build-system r-build-system)
2237 (home-page "https://cran.r-project.org/web/packages/pracma/")
2238 (synopsis "Practical numerical math functions")
2239 (description "This package provides functions for numerical analysis and
2240 linear algebra, numerical optimization, differential equations, plus some
2241 special functions. It uses Matlab function names where appropriate to simplify
2243 (license license:gpl3+)))
2245 (define-public ruby-asciimath
2247 (name "ruby-asciimath")
2252 (uri (rubygems-uri "asciimath" version))
2255 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2256 (build-system ruby-build-system)
2259 (modify-phases %standard-phases
2261 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2262 (add-after 'unpack 'patch-remove-spurious-backslashes
2264 (substitute* "spec/parser_spec.rb"
2269 `(("bundler" ,bundler)
2270 ("ruby-rspec" ,ruby-rspec)))
2271 (synopsis "AsciiMath parsing and conversion library")
2273 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2274 easy-to-write markup language for mathematics.")
2275 (home-page "https://github.com/asciidoctor/asciimath")
2276 (license license:expat)))
2278 (define-public superlu
2285 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2286 "superlu_" version ".tar.gz"))
2288 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2289 (modules '((guix build utils)))
2291 ;; Replace the non-free implementation of MC64 with a stub adapted
2294 (use-modules (ice-9 regex)
2296 (call-with-output-file "SRC/mc64ad.c"
2301 void mc64id_(int *a) {
2302 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2305 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2306 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2307 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2310 ;; Remove the corresponding license verbiage. MC64 license follows
2311 ;; a "------" line separator.
2312 (with-atomic-file-replacement "License.txt"
2313 (let ((rx (make-regexp "-{8}")))
2316 (let ((line (read-line in 'concat)))
2317 (unless (regexp-exec rx line)
2321 (build-system cmake-build-system)
2325 `(("blas" ,openblas)
2326 ("gfortran" ,gfortran)))
2328 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2329 "-DTPL_BLAS_LIBRARIES=openblas"
2330 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2331 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2332 (synopsis "Supernodal direct solver for sparse linear systems")
2334 "SuperLU is a general purpose library for the direct solution of large,
2335 sparse, nonsymmetric systems of linear equations on high performance machines.
2336 The library is written in C and is callable from either C or Fortran. The
2337 library routines perform an LU decomposition with partial pivoting and
2338 triangular system solves through forward and back substitution. The library
2339 also provides threshold-based ILU factorization preconditioners.")
2340 (license (list license:bsd-3
2341 license:gpl2+ ;EXAMPLE/*fgmr.c
2342 (license:fsf-free "file://SRC/colamd.h")))))
2344 (define-public superlu-dist
2346 (name "superlu-dist")
2351 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2352 "superlu_dist_" version ".tar.gz"))
2354 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2355 (modules '((guix build utils)))
2357 ;; Replace the non-free implementation of MC64 with a stub
2359 (call-with-output-file "SRC/mc64ad_dist.c"
2364 void mc64id_dist(int *a) {
2365 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2368 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2369 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2370 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2373 (substitute* "SRC/util.c" ;adjust default algorithm
2374 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2375 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2376 ;; general (i.e. non-square) processor-grid support.
2377 "RowPerm = NOROWPERM;"))
2379 (patches (search-patches "superlu-dist-scotchmetis.patch"
2380 "superlu-dist-awpm-grid.patch"
2381 "superlu-dist-fix-mpi-deprecations.patch"))))
2382 (build-system cmake-build-system)
2386 `(("gfortran" ,gfortran)
2389 ("combblas" ,combinatorial-blas)))
2391 `(("mpi" ,openmpi) ;headers include MPI heades
2392 ("parmetis" ,pt-scotch32 "metis")
2393 ("pt-scotch" ,pt-scotch32)))
2395 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2396 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2397 "-DTPL_ENABLE_COMBBLASLIB=YES"
2398 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2399 "-DTPL_LAPACK_LIBRARIES=-llapack"
2400 (string-append "-DTPL_PARMETIS_LIBRARIES="
2402 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2403 "scotchmetis" "scotch" "scotcherr")
2405 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2406 (assoc-ref %build-inputs "parmetis")
2408 "-DTPL_ENABLE_COMBBLASLIB=ON"
2409 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2410 (assoc-ref %build-inputs "combblas")
2411 "/include/CombBLAS;"
2412 (assoc-ref %build-inputs "combblas")
2413 "/include/BipartiteMatchings")
2414 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2416 (modify-phases %standard-phases
2417 (add-before 'configure 'set-c++-standard
2419 (substitute* "CMakeLists.txt"
2420 ;; AWPM headers require C++14
2421 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2422 (add-before 'check 'mpi-setup
2424 (add-before 'check 'omp-setup
2425 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2426 (home-page (package-home-page superlu))
2427 (synopsis "Parallel supernodal direct solver")
2429 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2430 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2431 implemented in ANSI C, and MPI for communications.")
2432 (license license:bsd-3)))
2434 (define-public scotch
2441 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2442 "latestfile/298/scotch_" version ".tar.gz"))
2444 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2445 (patches (search-patches "scotch-build-parallelism.patch"
2446 "scotch-integer-declarations.patch"))))
2447 (build-system gnu-build-system)
2452 (outputs '("out" "metis"))
2454 `(#:make-flags (list (string-append "prefix=" %output))
2456 (modify-phases %standard-phases
2458 'unpack 'chdir-to-src
2459 (lambda _ (chdir "src") #t))
2463 (call-with-output-file "Makefile.inc"
2477 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2478 LDFLAGS = -lz -lm -lrt -lpthread
2480 LEX = flex -Pscotchyy -olex.yy.c
2485 YACC = bison -pscotchyy -y -b y
2487 '("COMMON_FILE_COMPRESS_GZ"
2489 "COMMON_RANDOM_FIXED_SEED"
2490 "INTSIZE64" ;use 'int64_t'
2491 ;; Prevents symbolc clashes with libesmumps
2493 ;; XXX: Causes invalid frees in superlu-dist tests
2495 ;; "SCOTCH_PTHREAD_NUMBER=2"
2496 "restrict=__restrict"))))
2498 (add-after 'build 'build-esmumps
2501 (format #f "-j~a" (parallel-job-count))
2503 (add-before 'install 'make-install-dirs
2504 (lambda* (#:key outputs #:allow-other-keys)
2505 (mkdir (assoc-ref outputs "out"))))
2506 (add-after 'install 'install-metis
2507 (lambda* (#:key outputs #:allow-other-keys)
2508 (let ((out (assoc-ref outputs "metis")))
2510 ;; metis files are not installed with 'make install'
2511 (for-each (lambda (f)
2512 (install-file f (string-append out "/include")))
2513 (find-files "../include/" ".*metis\\.h"))
2514 (for-each (lambda (f)
2515 (install-file f (string-append out "/lib")))
2516 (find-files "../lib/" ".*metis\\..*"))
2518 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2519 (synopsis "Programs and libraries for graph algorithms")
2520 (description "SCOTCH is a set of programs and libraries which implement
2521 the static mapping and sparse matrix reordering algorithms developed within
2522 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2523 conquer approach, to scientific computing problems such as graph and mesh
2524 partitioning, static mapping, and sparse matrix ordering, in application
2525 domains ranging from structural mechanics to operating systems or
2527 ;; See LICENSE_en.txt
2528 (license license:cecill-c)))
2530 (define-public scotch32
2531 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2532 ;; some applications.
2533 (package (inherit scotch)
2536 (substitute-keyword-arguments (package-arguments scotch)
2537 ((#:phases scotch-phases)
2538 `(modify-phases ,scotch-phases
2542 (call-with-output-file "Makefile.inc"
2556 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2557 LDFLAGS = -lz -lm -lrt -lpthread
2559 LEX = flex -Pscotchyy -olex.yy.c
2564 YACC = bison -pscotchyy -y -b y
2566 '("COMMON_FILE_COMPRESS_GZ"
2568 "COMMON_RANDOM_FIXED_SEED"
2569 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2570 ;; Prevents symbolc clashes with libesmumps
2572 ;; XXX: Causes invalid frees in superlu-dist tests
2574 ;; "SCOTCH_PTHREAD_NUMBER=2"
2575 "restrict=__restrict"))))))))))
2577 "Programs and libraries for graph algorithms (32-bit integers)")))
2579 (define-public pt-scotch
2580 (package (inherit scotch)
2583 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2585 (substitute-keyword-arguments (package-arguments scotch)
2586 ((#:phases scotch-phases)
2587 `(modify-phases ,scotch-phases
2591 (invoke "make" (format #f "-j~a" (parallel-job-count))
2592 "ptscotch" "ptesmumps")
2594 ;; Install the serial metis compatibility library
2595 (invoke "make" "-C" "libscotchmetis" "install")))
2596 (add-before 'check 'mpi-setup
2600 (invoke "make" "ptcheck")))))))
2601 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2603 (define-public pt-scotch32
2604 (package (inherit scotch32)
2605 (name "pt-scotch32")
2607 `(("openmpi" ,openmpi))) ;headers include MPI headers
2609 (substitute-keyword-arguments (package-arguments scotch32)
2610 ((#:phases scotch32-phases)
2611 `(modify-phases ,scotch32-phases
2614 (invoke "make" (format #f "-j~a" (parallel-job-count))
2615 "ptscotch" "ptesmumps")
2616 ;; Install the serial metis compatibility library
2617 (invoke "make" "-C" "libscotchmetis" "install")))
2618 (add-before 'check 'mpi-setup
2622 (invoke "make" "ptcheck")))))))
2624 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2626 (define-public metis
2633 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2634 "metis-" version ".tar.gz"))
2637 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2638 (build-system cmake-build-system)
2640 `(("blas" ,openblas)))
2642 `(#:tests? #f ;no tests
2643 #:configure-flags `("-DSHARED=ON"
2644 ,(string-append "-DGKLIB_PATH=" (getcwd)
2645 "/metis-" ,version "/GKlib"))))
2646 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2647 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2649 "METIS is a set of serial programs for partitioning graphs, partitioning
2650 finite element meshes, and producing fill-reducing orderings for sparse
2651 matrices. The algorithms implemented in METIS are based on the multilevel
2652 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2654 (license license:asl2.0))) ;As of version 5.0.3
2656 (define-public p4est
2663 (uri (string-append "http://p4est.github.io/release/p4est-"
2667 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2668 (build-system gnu-build-system)
2670 `(("fortran" ,gfortran)
2675 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2676 (assoc-ref %build-inputs "blas")
2678 ,(string-append "LAPACK_LIBS=-L"
2679 (assoc-ref %build-inputs "lapack")
2681 #:phases (modify-phases %standard-phases
2682 (add-before 'check 'mpi-setup
2684 (home-page "http://www.p4est.org")
2685 (synopsis "Adaptive mesh refinement on forests of octrees")
2687 "The p4est software library enables the dynamic management of a
2688 collection of adaptive octrees, conveniently called a forest of octrees.
2689 p4est is designed to work in parallel and scales to hundreds of thousands of
2691 (license license:gpl2+)))
2693 (define-public p4est-openmpi
2694 (package (inherit p4est)
2695 (name "p4est-openmpi")
2698 ,@(package-inputs p4est)))
2700 (substitute-keyword-arguments (package-arguments p4est)
2701 ((#:configure-flags cf)
2702 ``("--enable-mpi" ,@,cf))))
2703 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2705 (define-public gsegrafix
2712 (uri (string-append "mirror://gnu/" name "/" name "-"
2716 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2717 (build-system gnu-build-system)
2719 `(#:configure-flags '("LDFLAGS=-lm")))
2721 `(("libgnomecanvas" ,libgnomecanvas)
2722 ("libbonoboui" ,libbonoboui)
2723 ("libgnomeui" ,libgnomeui)
2724 ("libgnomeprintui" ,libgnomeprintui)
2727 `(("pkg-config" ,pkg-config)))
2728 (home-page "https://www.gnu.org/software/gsegrafix/")
2729 (synopsis "GNOME application to create scientific and engineering plots")
2730 (description "GSEGrafix is an application which produces high-quality graphical
2731 plots for science and engineering. Plots are specified via simple ASCII
2732 parameter files and data files and are presented in an anti-aliased GNOME
2733 canvas. The program supports rectangular two-dimensional plots, histograms,
2734 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2735 to BMP, JPEG or PNG image formats.")
2736 (license license:gpl3+)))
2738 (define-public maxima
2745 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2746 version "-source/" name "-" version ".tar.gz"))
2749 "0kdncy6137sg3rradirxzj10mkcvafxd892zlclwhr9sa7b12zhn"))
2750 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2751 (build-system gnu-build-system)
2754 ("gnuplot" ,gnuplot) ;for plots
2756 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2758 `(("texinfo" ,texinfo)
2760 ("python" ,python)))
2763 (list "--enable-gcl"
2764 (string-append "--with-posix-shell="
2765 (assoc-ref %build-inputs "bash")
2767 (string-append "--with-wish="
2768 (assoc-ref %build-inputs "tk")
2770 (let ((v ,(package-version tk)))
2771 (string-take v (string-index-right v #\.)))))
2772 ;; By default Maxima attempts to write temporary files to
2773 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2774 ;; Work around that.
2775 #:make-flags (list "TMPDIR=/tmp")
2777 (modify-phases %standard-phases
2778 (add-after 'unpack 'patch-paths
2779 (lambda* (#:key inputs #:allow-other-keys)
2780 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2781 (coreutils (assoc-ref inputs "coreutils"))
2782 (dirname (string-append coreutils "/bin/dirname"))
2783 (head (string-append coreutils "/bin/head")))
2784 (substitute* "src/maxima.in"
2785 (("sed ") (string-append sed " "))
2786 (("dirname") dirname)
2789 (add-before 'check 'pre-check
2791 (chmod "src/maxima" #o555)
2795 ;; This is derived from the testing code in the "debian/rules" file
2796 ;; of Debian's Maxima package.
2797 ;; If Maxima can successfully run this, the binary to be installed
2803 "--batch-string=\"run_testsuite();\" "
2804 "| grep -q \"No unexpected errors found\""))))
2805 ;; Make sure the doc and emacs files are found in the
2806 ;; standard location. Also configure maxima to find gnuplot
2807 ;; without having it on the PATH.
2808 (add-after 'install 'post-install
2809 (lambda* (#:key outputs inputs #:allow-other-keys)
2810 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2811 (out (assoc-ref outputs "out"))
2812 (datadir (string-append out "/share/maxima/" ,version))
2813 (binutils (string-append (assoc-ref inputs "binutils")
2815 (with-directory-excursion out
2816 (mkdir-p "share/emacs")
2817 (mkdir-p "share/doc")
2819 (string-append datadir "/emacs/")
2820 (string-append out "/share/emacs/site-lisp"))
2822 (string-append datadir "/doc/")
2823 (string-append out "/share/doc/maxima"))
2824 (with-atomic-file-replacement
2825 (string-append datadir "/share/maxima-init.lisp")
2827 (format out "~a ~s~a~%"
2828 "(setf $gnuplot_command "
2829 (string-append gnuplot "/bin/gnuplot") ")")
2830 (dump-port in out))))
2831 ;; Ensure that Maxima will have access to the GNU binutils
2832 ;; components at runtime.
2833 (wrap-program (string-append out "/bin/maxima")
2834 `("PATH" prefix (,binutils))))
2836 (home-page "http://maxima.sourceforge.net")
2837 (synopsis "Numeric and symbolic expression manipulation")
2838 (description "Maxima is a system for the manipulation of symbolic and
2839 numerical expressions. It yields high precision numeric results by using
2840 exact fractions, arbitrary precision integers, and variable precision floating
2842 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2843 ;; Others simply say "GNU General Public License" without stating a
2844 ;; version (which implicitly means gpl1+).
2845 ;; At least one file (src/maxima.asd) says "version 2."
2846 ;; GPLv2 only is therefore the smallest subset.
2847 (license license:gpl2)))
2849 (define-public wxmaxima
2857 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2858 (commit (string-append "Version-" version))))
2859 (file-name (git-file-name name version))
2862 "1qkf4jg86xnn3wk3782ffmfz12axb92dkjagcz3ffzw2wi1rclml"))))
2863 (build-system cmake-build-system)
2865 `(("gettext" ,gettext-minimal)))
2867 `(("wxwidgets" ,wxwidgets)
2870 ("adwaita-icon-theme" ,adwaita-icon-theme)
2872 ("shared-mime-info" ,shared-mime-info)))
2874 `(#:tests? #f ; no check target
2876 (modify-phases %standard-phases
2877 (add-after 'install 'wrap-program
2878 (lambda* (#:key inputs outputs #:allow-other-keys)
2879 (wrap-program (string-append (assoc-ref outputs "out")
2882 (,(string-append (assoc-ref inputs "maxima")
2884 ;; For GtkFileChooserDialog.
2885 `("GSETTINGS_SCHEMA_DIR" =
2886 (,(string-append (assoc-ref inputs "gtk+")
2887 "/share/glib-2.0/schemas")))
2888 `("XDG_DATA_DIRS" ":" prefix
2889 (;; Needed by gdk-pixbuf to know supported icon formats.
2891 (assoc-ref inputs "shared-mime-info") "/share")
2892 ;; The default icon theme of GTK+.
2894 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2896 (home-page "https://andrejv.github.io/wxmaxima/")
2897 (synopsis "Graphical user interface for the Maxima computer algebra system")
2899 "wxMaxima is a graphical user interface for the Maxima computer algebra
2900 system. It eases the use of Maxima by making most of its commands available
2901 through a menu system and by providing input dialogs for commands that require
2902 more than one argument. It also implements its own display engine that
2903 outputs mathematical symbols directly instead of depicting them with ASCII
2906 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2907 text and mathematical calculations to create documents, exporting of input and
2908 output to TeX, and a browser for Maxima's manual including command index and
2909 full text searching.")
2910 (license license:gpl2+)))
2912 (define-public armadillo
2918 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2922 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
2923 (build-system cmake-build-system)
2924 (arguments `(#:tests? #f)) ; no test target
2926 `(("openblas" ,openblas)
2928 ("arpack" ,arpack-ng)))
2929 (home-page "http://arma.sourceforge.net/")
2930 (synopsis "C++ linear algebra library")
2932 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2933 between speed and ease of use. It is useful for algorithm development
2934 directly in C++, or quick conversion of research code into production
2935 environments. It can be used for machine learning, pattern recognition,
2936 signal processing, bioinformatics, statistics, econometrics, etc. The library
2937 provides efficient classes for vectors, matrices and cubes, as well as 150+
2938 associated functions (eg. contiguous and non-contiguous submatrix views).")
2939 (license license:asl2.0)))
2941 (define-public muparser
2942 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2943 ;; different hash. In order to make `guix package --upgrade` work correctly,
2944 ;; we set a Guix packaging revision.
2945 ;; When the next version of muparser is released, we can remove
2946 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2947 (let ((upstream-version "2.2.5")
2951 (version (string-append upstream-version "-" revision))
2956 (url "https://github.com/beltoforion/muparser.git")
2957 (commit (string-append "v" upstream-version))))
2958 (file-name (git-file-name name version))
2960 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
2961 (build-system gnu-build-system)
2963 `(#:configure-flags '("--enable-samples=no")
2964 #:tests? #f)) ;no "check" target
2965 (home-page "http://muparser.beltoforion.de/")
2966 (synopsis "Fast parser library for mathematical expressions")
2968 "muParser is an extensible high performance math parser library. It is
2969 based on transforming an expression into a bytecode and precalculating constant
2971 (license license:expat))))
2973 (define-public openblas
2980 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
2981 version "%20version.tar.gz"))
2982 (file-name (string-append name "-" version ".tar.gz"))
2985 "062kg4ny1ywz7k5grpb4pbf0hba0w6manbajwkmv4f477a31sxpl"))))
2986 (build-system gnu-build-system)
2988 `(#:test-target "test"
2989 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2990 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2991 ;; we need to disable substitutions.
2993 ,(let ((system (or (%current-target-system) (%current-system))))
2994 (or (string-prefix? "x86_64" system)
2995 (string-prefix? "i686" system)
2996 (string-prefix? "mips" system)
2997 (string-prefix? "aarch64" system)))
2999 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3001 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3002 ;; Build the library for all supported CPUs. This allows
3003 ;; switching CPU targets at runtime with the environment variable
3004 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3005 ;; Unfortunately, this is not supported on non-x86 architectures,
3006 ;; where it leads to failed builds.
3007 ,@(let ((system (or (%current-target-system) (%current-system))))
3009 ((or (string-prefix? "x86_64" system)
3010 (string-prefix? "i686" system))
3011 '("DYNAMIC_ARCH=1"))
3012 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3013 ;; two available MIPS targets special extended instructions
3014 ;; for Loongson cores are used.
3015 ((string-prefix? "mips" system)
3016 '("TARGET=SICORTEX"))
3017 ;; On aarch64 force the generic 'armv8-a' target
3018 ((string-prefix? "aarch64" system)
3021 ;; no configure script
3023 (modify-phases %standard-phases
3025 (add-before 'build 'set-extralib
3026 (lambda* (#:key inputs #:allow-other-keys)
3027 ;; Get libgfortran found when building in utest.
3029 (string-append "-L" (assoc-ref inputs "fortran-lib")
3033 `(("fortran-lib" ,gfortran "lib")))
3036 ("fortran" ,gfortran)
3038 (home-page "http://www.openblas.net/")
3039 (synopsis "Optimized BLAS library based on GotoBLAS")
3041 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3042 (license license:bsd-3)))
3044 (define-public openblas-ilp64
3045 (package (inherit openblas)
3046 (name "openblas-ilp64")
3047 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3049 (substitute-keyword-arguments (package-arguments openblas)
3050 ((#:make-flags flags '())
3051 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3053 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3054 (license license:bsd-3)))
3056 (define* (make-blis implementation #:optional substitutable?)
3057 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3058 source tree for a list of implementations.)
3060 SUBSTITUTABLE? determines whether the package is made available as a
3063 Currently the specialization must be selected at configure-time, but work is
3064 underway to allow BLIS to select the right optimized kernels at run time:
3065 <https://github.com/flame/blis/issues/129>."
3067 (name (if (string=? implementation "reference")
3069 (string-append "blis-" implementation)))
3071 (home-page "https://github.com/flame/blis")
3074 (uri (git-reference (url home-page) (commit version)))
3077 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3078 (file-name (git-file-name "blis" version))))
3079 (build-system gnu-build-system)
3081 `(#:test-target "test"
3083 #:substitutable? ,substitutable?
3085 #:phases (modify-phases %standard-phases
3087 (lambda* (#:key outputs #:allow-other-keys)
3088 ;; This is a home-made 'configure' script.
3089 (let ((out (assoc-ref outputs "out")))
3090 (invoke "./configure" "-p" out
3094 "--enable-threading=openmp"
3097 (add-before 'check 'show-test-output
3099 ;; By default "make check" is silent. Make it verbose.
3100 (system "tail -F output.testsuite &")
3102 (synopsis "High-performance basic linear algebra (BLAS) routines")
3104 "BLIS is a portable software framework for instantiating high-performance
3105 BLAS-like dense linear algebra libraries. The framework was designed to
3106 isolate essential kernels of computation that, when optimized, immediately
3107 enable optimized implementations of most of its commonly used and
3108 computationally intensive operations. While BLIS exports a new BLAS-like API,
3109 it also includes a BLAS compatibility layer which gives application developers
3110 access to BLIS implementations via traditional BLAS routine calls.")
3111 (license license:bsd-3)))
3114 ;; This is the "reference" implementation, which is the non-optimized but
3115 ;; portable variant (no assembly).
3116 (make-blis "reference" #t))
3118 (define ignorance blis)
3120 (define-syntax-rule (blis/x86_64 processor)
3121 "Expand to a package specialized for PROCESSOR."
3123 (inherit (make-blis processor))
3124 (supported-systems '("x86_64-linux"))))
3126 (define-public blis-sandybridge
3127 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3128 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3129 (blis/x86_64 "sandybridge"))
3131 (define-public blis-haswell
3132 ;; BLIS specialized for Haswell processors (launched 2013):
3133 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3134 (blis/x86_64 "haswell"))
3136 (define-public blis-knl
3137 ;; BLIS specialized for Knights Landing processor (launched 2016):
3138 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3139 (blis/x86_64 "knl"))
3142 (define-public openlibm
3150 (url "https://github.com/JuliaLang/openlibm.git")
3151 (commit (string-append "v" version))))
3152 (file-name (git-file-name name version))
3154 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3155 (build-system gnu-build-system)
3158 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3160 ;; no configure script
3161 (modify-phases %standard-phases (delete 'configure))
3162 #:tests? #f)) ;the tests are part of the default target
3163 (home-page "http://openlibm.org/")
3164 (synopsis "Portable C mathematical library (libm)")
3166 "OpenLibm is an effort to have a high quality, portable, standalone C
3167 mathematical library (libm). It can be used standalone in applications and
3168 programming language implementations. The project was born out of a need to
3169 have a good libm for the Julia programming language that worked consistently
3170 across compilers and operating systems, and in 32-bit and 64-bit
3172 ;; Each architecture has its own make target, and there is none for mips.
3173 (supported-systems (delete "mips64el-linux" %supported-systems))
3174 ;; See LICENSE.md for details.
3175 (license (list license:expat
3178 license:public-domain
3179 license:lgpl2.1+))))
3181 (define-public openspecfun
3183 (name "openspecfun")
3189 (url "https://github.com/JuliaLang/openspecfun.git")
3190 (commit (string-append "v" version))))
3191 (file-name (git-file-name name version))
3193 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3194 (build-system gnu-build-system)
3196 '(#:tests? #f ; no "check" target
3198 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3200 (modify-phases %standard-phases
3201 (delete 'configure)))) ; no configure script
3203 `(("fortran" ,gfortran)))
3204 (home-page "https://github.com/JuliaLang/openspecfun")
3205 (synopsis "Collection of special mathematical functions")
3207 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3208 portable package for Bessel Functions of a Complex Argument and Nonnegative
3209 Order; it contains subroutines for computing Bessel functions and Airy
3210 functions. Faddeeva allows computing the various error functions of arbitrary
3211 complex arguments (Faddeeva function, error function, complementary error
3212 function, scaled complementary error function, imaginary error function, and
3213 Dawson function); given these, one can also easily compute Voigt functions,
3214 Fresnel integrals, and similar related functions as well.")
3215 ;; Faddeeva is released under the Expat license; AMOS is included as
3216 ;; public domain software.
3217 (license (list license:expat license:public-domain))))
3219 (define-public suitesparse
3221 (name "suitesparse")
3227 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3231 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3232 (modules '((guix build utils)))
3234 ;; Remove bundled metis source
3236 (delete-file-recursively "metis-5.1.0")
3238 (build-system gnu-build-system)
3240 '(#:tests? #f ;no "check" target
3245 "MY_METIS_LIB=-lmetis"
3246 (string-append "INSTALL_LIB="
3247 (assoc-ref %outputs "out") "/lib")
3248 (string-append "INSTALL_INCLUDE="
3249 (assoc-ref %outputs "out") "/include")
3252 (modify-phases %standard-phases
3253 (delete 'configure)))) ;no configure script
3258 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3259 (synopsis "Suite of sparse matrix software")
3261 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3262 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3263 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3264 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3265 CXSparse, a concise sparse Cholesky factorization package; and many other
3268 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3270 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3271 (license (list license:gpl2+ license:lgpl2.1+))))
3273 (define-public atlas
3279 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3280 version "/atlas" version ".tar.bz2"))
3283 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3284 (build-system gnu-build-system)
3285 (home-page "http://math-atlas.sourceforge.net/")
3286 (inputs `(("gfortran" ,gfortran)
3287 ("lapack-tar" ,(package-source lapack))))
3288 (outputs '("out" "doc"))
3289 ;; For the moment we drop support for MIPS at it fails to compile. See
3290 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3291 (supported-systems (delete "mips64el-linux" %supported-systems))
3293 `(#:parallel-build? #f
3294 #:parallel-tests? #f
3296 ;; ATLAS tunes itself for the machine it is built on, as explained at
3297 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3298 ;; For this reason, we want users to build it locally instead of using
3302 #:modules ((srfi srfi-26)
3304 (guix build gnu-build-system)
3307 `(;; Generate position independent code suitable for dynamic libraries
3308 ;; and use WALL timer to get more accurate timing.
3309 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3312 ,,(if (string-match "64" (%current-system))
3315 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3316 ;; needed to compile C files before it is generated.
3317 "-Ss" "pmake" "make -j 1"
3318 ;; Probe is failing for MIPS. We therefore define the system
3319 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3320 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3321 ,,@(if (string-prefix? "mips" (%current-system))
3322 (list "-A" "49" "-V" "1")
3324 ;; Generate shared libraries.
3326 ;; Build a full LAPACK library.
3327 ,(string-append "--with-netlib-lapack-tarfile="
3328 (assoc-ref %build-inputs "lapack-tar")))
3330 (modify-phases %standard-phases
3331 (add-after 'install 'install-doc
3332 (lambda* (#:key outputs inputs #:allow-other-keys)
3333 (let ((doc (string-append (assoc-ref outputs "doc")
3334 "/share/doc/atlas")))
3336 (fold (lambda (file previous)
3337 (and previous (zero? (system* "cp" file doc))))
3338 #t (find-files "../ATLAS/doc" ".*")))))
3339 (add-after 'check 'check-pt
3340 (lambda _ (zero? (system* "make" "ptcheck"))))
3341 ;; Fix files required to run configure.
3342 (add-before 'configure 'fix-/bin/sh
3344 ;; Use `sh', not `/bin/sh'.
3345 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3348 ;; Fix /bin/sh in generated make files.
3349 (add-after 'configure 'fix-/bin/sh-in-generated-files
3351 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3354 ;; ATLAS configure program does not accepts the default flags
3355 ;; passed by the 'gnu-build-system'.
3357 (lambda* (#:key native-inputs inputs outputs
3358 (configure-flags '())
3359 #:allow-other-keys #:rest args)
3360 (let* ((prefix (assoc-ref outputs "out"))
3361 (bash (or (and=> (assoc-ref
3362 (or native-inputs inputs) "bash")
3363 (cut string-append <> "/bin/bash"))
3365 (flags `(,(string-append "--prefix=" prefix)
3367 (abs-srcdir (getcwd))
3368 (srcdir (string-append "../" (basename abs-srcdir))))
3369 (format #t "source directory: ~s (relative from build: ~s)~%"
3373 (format #t "build directory: ~s~%" (getcwd))
3374 (format #t "configure flags: ~s~%" flags)
3375 (zero? (apply system* bash
3376 (string-append srcdir "/configure")
3378 (synopsis "Automatically Tuned Linear Algebra Software")
3380 "ATLAS is an automatically tuned linear algebra software library
3381 providing C and Fortran77 interfaces to a portably efficient BLAS
3382 implementation, as well as a few routines from LAPACK.
3384 Optimization occurs at build time. For this reason, the library is built on
3385 the machine where it is installed, without resorting to pre-built substitutes.
3387 Before building the library, CPU throttling should be disabled. This can be
3388 done in the BIOS, or, on GNU/Linux, with the following command:
3391 # cpupower --governor performance
3394 Failure to do so will result in a library with poor performance.")
3395 (license license:bsd-3)))
3404 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3405 version "/glm-" version ".zip"))
3408 "1vmg7hb4xvsa77zpbwiw6lqc7pyaj56dihx6xriny5b9rrh4iqsg"))))
3409 (build-system cmake-build-system)
3411 `(("unzip" ,unzip)))
3412 (home-page "https://glm.g-truc.net/")
3413 (synopsis "OpenGL Mathematics library")
3414 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3415 library for graphics software based on the OpenGL Shading Language (GLSL)
3417 (license license:expat)))
3419 (define-public lpsolve
3426 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3427 "/lp_solve_" version "_source.tar.gz"))
3430 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3431 (modules '((guix build utils)))
3434 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3436 ;; Pretend to be on a 64 bit platform to obtain a common directory
3437 ;; name for the build results on all architectures; nothing else
3438 ;; seems to depend on it.
3439 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3441 ;; The check for 'isnan' as it is written fails with
3442 ;; "non-floating-point argument in call to function
3443 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3444 ;; definition, which in turn leads to bad things. Fix the feature
3446 (("isnan\\(0\\)") "isnan(0.)"))
3448 (build-system gnu-build-system)
3450 `(#:tests? #f ; no check target
3452 (modify-phases %standard-phases
3453 (delete 'configure) ; no configure script
3456 (with-directory-excursion "lpsolve55"
3457 (invoke "bash" "ccc"))
3458 (with-directory-excursion "lp_solve"
3459 (invoke "bash" "ccc"))
3462 (lambda* (#:key outputs #:allow-other-keys)
3463 (let* ((out (assoc-ref outputs "out"))
3464 (bin (string-append out "/bin"))
3465 (lib (string-append out "/lib"))
3466 ;; This is where LibreOffice expects to find the header
3467 ;; files, and where they are installed by Debian.
3468 (include (string-append out "/include/lpsolve")))
3469 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3470 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3471 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3473 ;; Install a subset of the header files as on Debian
3474 ;; (plus lp_bit.h, which matches the regular expression).
3475 (for-each (lambda (name)
3476 (install-file name include))
3477 (find-files "." "lp_[HMSa-z].*\\.h$"))
3478 (with-directory-excursion "shared"
3479 (for-each (lambda (name)
3480 (install-file name include))
3481 (find-files "." "\\.h$")))
3483 (home-page "http://lpsolve.sourceforge.net/")
3484 (synopsis "Mixed integer linear programming (MILP) solver")
3486 "lp_solve is a mixed integer linear programming solver based on the
3487 revised simplex and the branch-and-bound methods.")
3488 (license license:lgpl2.1+)))
3490 (define-public dealii
3497 (uri (string-append "https://github.com/dealii/dealii/releases/"
3498 "download/v" version "/dealii-" version ".tar.gz"))
3501 "0r7f8rhl3xr94imd372plizdcbqk0a70w73lwc3vw912dxk0sbyz"))
3502 (patches (search-patches "dealii-mpi-deprecations.patch"))
3503 (modules '((guix build utils)))
3505 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3507 (delete-file-recursively "bundled")
3509 (build-system cmake-build-system)
3517 ("arpack" ,arpack-ng)
3518 ("muparser" ,muparser)
3519 ("gfortran" ,gfortran)
3520 ("suitesparse" ,suitesparse))) ;for UMFPACK
3522 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3524 ;; Work around a bug in libsuitesparseconfig linking
3525 ;; see https://github.com/dealii/dealii/issues/4745
3526 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3527 (home-page "https://www.dealii.org")
3528 (synopsis "Finite element library")
3530 "Deal.II is a C++ program library targeted at the computational solution
3531 of partial differential equations using adaptive finite elements. The main
3532 aim of deal.II is to enable rapid development of modern finite element codes,
3533 using among other aspects adaptive meshes and a wide array of tools often used
3534 in finite element programs.")
3535 (license license:lgpl2.1+)))
3537 (define-public dealii-openmpi
3538 (package (inherit dealii)
3539 (name "dealii-openmpi")
3542 ;;Supported only with MPI:
3543 ("p4est" ,p4est-openmpi)
3544 ("petsc" ,petsc-openmpi)
3545 ("slepc" ,slepc-openmpi)
3546 ("metis" ,metis) ;for MUMPS
3547 ("scalapack" ,scalapack) ;for MUMPS
3548 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3549 ("arpack" ,arpack-ng-openmpi)
3550 ,@(fold alist-delete (package-inputs dealii)
3551 '("p4est" "arpack"))))
3553 (substitute-keyword-arguments (package-arguments dealii)
3554 ((#:configure-flags cf)
3555 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3557 ((#:phases phases '%standard-phases)
3558 `(modify-phases ,phases
3559 (add-before 'check 'mpi-setup
3560 ,%openmpi-setup)))))
3561 (synopsis "Finite element library (with MPI support)")))
3563 (define-public flann
3572 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3573 version "-src.zip"))
3576 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3577 (patches (search-patches "flann-cmake-3.11.patch"))))
3578 (build-system cmake-build-system)
3580 "octave")) ;46 MiB .mex file that pulls Octave
3582 `(("unzip" ,unzip)))
3585 ("octave" ,octave-cli)
3586 ("python" ,python-2) ; print syntax
3587 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3590 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3591 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3592 #:strip-directories '("lib" "lib64" "libexec"
3593 "bin" "sbin" "share/flann/octave")
3595 ;; Save 12 MiB by not installing .a files. Passing
3596 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3597 #:phases (modify-phases %standard-phases
3598 (add-before 'configure 'set-octave-directory
3599 (lambda* (#:key outputs #:allow-other-keys)
3600 ;; Install the .mex file in the "octave" output.
3601 (let ((out (assoc-ref outputs "octave")))
3602 (substitute* "src/matlab/CMakeLists.txt"
3603 (("share/flann/octave")
3604 (string-append out "/share/flann/octave")))
3606 (add-after 'install 'remove-static-libraries
3607 (lambda* (#:key outputs #:allow-other-keys)
3608 (let* ((out (assoc-ref outputs "out"))
3609 (lib (string-append out "/lib")))
3610 (for-each delete-file
3611 (find-files lib "\\.a$"))
3614 #:tests? #f)) ; The test data are downloaded from the Internet.
3615 (home-page "http://www.cs.ubc.ca/research/flann/")
3616 (synopsis "Library for approximate nearest neighbors computation")
3617 (description "FLANN is a library for performing fast approximate
3618 nearest neighbor searches in high dimensional spaces. It implements a
3619 collection of algorithms and a system for automatically choosing the best
3620 algorithm and optimum parameters depending on the dataset.
3622 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3623 (license (license:non-copyleft "file://COPYING"
3624 "See COPYING in the distribution."))))
3626 (define-public wcalc
3633 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3634 "wcalc-" version ".tar.bz2"))
3637 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3638 (build-system gnu-build-system)
3641 ("readline" ,readline)))
3642 (home-page "http://w-calc.sourceforge.net/index.php")
3643 (synopsis "Flexible command-line scientific calculator")
3644 (description "Wcalc is a very capable calculator. It has standard functions
3645 (sin, asin, and sinh for example, in either radians or degrees), many
3646 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3647 variables, a command history, hex/octal/binary input and output, unit
3648 conversions, embedded comments, and an expandable expression entry field. It
3649 evaluates expressions using the standard order of operations.")
3650 (license license:gpl2+)))
3658 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3659 "/xaos-" version ".tar.gz"))
3662 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3663 (build-system gnu-build-system)
3664 (native-inputs `(("gettext" ,gettext-minimal)))
3665 (inputs `(("libx11" ,libx11)
3670 `(#:tests? #f ;no "check" target
3671 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3672 (synopsis "Real-time fractal zoomer")
3673 (description "GNU XaoS is a graphical program that generates fractal
3674 patterns and allows you to zoom in and out of them infinitely in a fluid,
3675 continuous manner. It also includes tutorials that help to explain how fractals
3676 are built. It can generate many different fractal types such as the Mandelbrot
3678 (home-page "https://www.gnu.org/software/xaos/")
3679 (license license:gpl2+)))
3681 (define-public hypre
3689 (url "https://github.com/LLNL/hypre.git")
3690 (commit (string-append "v" version))))
3691 (file-name (git-file-name name version))
3693 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3694 (modules '((guix build utils)))
3697 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3698 ;; substitute the release date.
3699 (substitute* "src/utilities/HYPRE_utilities.h"
3700 (("Date Compiled: .*$")
3701 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3703 (build-system gnu-build-system)
3704 (outputs '("out" ; 6.1 MiB of headers and libraries
3705 "doc")) ; 4.8 MiB of documentation
3709 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3710 ("texlive" ,(texlive-union (list texlive-generic-xypic
3712 texlive-latex-hyperref
3714 ("ghostscript" ,ghostscript)))
3716 `(("blas" ,openblas)
3717 ("lapack" ,lapack)))
3719 `(#:modules ((srfi srfi-1)
3720 ,@%gnu-build-system-modules)
3721 #:configure-flags '("--enable-shared"
3729 (modify-phases %standard-phases
3730 (add-before 'build 'set-HOME
3732 ;; FIXME: texlive-union does not find the built
3733 ;; metafonts, so it tries to generate them in HOME.
3734 (setenv "HOME" "/tmp")
3736 (add-before 'configure 'chdir-src
3737 (lambda _ (chdir "src")))
3739 (lambda* (#:key build target configure-flags
3740 #:allow-other-keys #:rest args)
3741 (let* ((configure (assoc-ref %standard-phases 'configure)))
3744 (list #:configure-flags
3745 (cons (string-append
3746 "--host=" (or target build))
3747 configure-flags)))))))
3748 (add-after 'build 'build-docs
3750 (invoke "make" "-Cdocs" "pdf" "html")))
3753 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3754 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3755 (and (system* "make" "check" "CHECKRUN=")
3756 (fold (lambda (filename result)
3758 (let ((size (stat:size (stat filename))))
3759 (when (not (zero? size))
3760 (format #t "~a size ~d; error indication~%"
3764 (find-files "test" ".*\\.err$")))))
3765 (add-after 'install 'install-docs
3766 (lambda* (#:key outputs #:allow-other-keys)
3767 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3768 (let* ((doc (assoc-ref outputs "doc"))
3769 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3770 (with-directory-excursion "docs"
3771 (for-each (lambda (base)
3772 (install-file (string-append base ".pdf") docdir)
3773 (copy-recursively base docdir)) ; html docs
3774 '("HYPRE_usr_manual"
3775 "HYPRE_ref_manual")))
3777 (home-page "http://www.llnl.gov/casc/hypre/")
3778 (synopsis "Library of solvers and preconditioners for linear equations")
3780 "HYPRE is a software library of high performance preconditioners and
3781 solvers for the solution of large, sparse linear systems of equations. It
3782 features multigrid solvers for both structured and unstructured grid
3784 (license license:lgpl2.1)))
3786 (define-public hypre-openmpi
3787 (package (inherit hypre)
3788 (name "hypre-openmpi")
3791 ,@(package-inputs hypre)))
3793 (substitute-keyword-arguments (package-arguments hypre)
3794 ((#:configure-flags flags)
3796 ,@(delete "--without-MPI" ,flags)))
3798 `(modify-phases ,phases
3799 (add-before 'check 'mpi-setup
3800 ,%openmpi-setup)))))
3801 (synopsis "Parallel solvers and preconditioners for linear equations")
3803 "HYPRE is a software library of high performance preconditioners and
3804 solvers for the solution of large, sparse linear systems of equations on
3805 parallel computers. It features parallel multigrid solvers for both
3806 structured and unstructured grid problems.")))
3808 (define-public matio
3815 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3816 "matio-" version ".tar.gz"))
3819 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3820 (build-system gnu-build-system)
3824 (home-page "http://matio.sourceforge.net/")
3825 (synopsis "Library for reading and writing MAT files")
3826 (description "Matio is a library for reading and writing MAT files. It
3827 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3828 (license license:bsd-2)))
3835 (origin (method url-fetch)
3836 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3837 "download/" version "/Vc-" version ".tar.gz"))
3840 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3841 (build-system cmake-build-system)
3844 '("-DBUILD_TESTING=ON"
3845 ;; By default, Vc will optimize for the CPU of the build machine.
3846 ;; Setting this to "none" makes it create portable binaries. See
3847 ;; "cmake/OptimizeForArchitecture.cmake".
3848 "-DTARGET_ARCHITECTURE=none")))
3849 (synopsis "SIMD vector classes for C++")
3850 (description "Vc provides portable, zero-overhead C++ types for explicitly
3851 data-parallel programming. It is a library designed to ease explicit
3852 vectorization of C++ code. Its types enable explicitly stating data-parallel
3853 operations on multiple values. The parallelism is therefore added via the type
3854 system. Vc has an intuitive API and provides portability between different
3855 compilers and compiler versions as well as portability between different vector
3856 instruction sets. Thus, an application written with Vc can be compiled for:
3859 @item SSE2 up to SSE4.2 or SSE4a
3862 @item NEON (in development)
3863 @item NVIDIA GPUs / CUDA (in development)
3865 (home-page "https://github.com/VcDevel/Vc")
3866 ;; "No support_???.cpp file exists for this architecture."
3867 (supported-systems '("x86_64-linux" "i686-linux"))
3868 (license license:bsd-3)))
3870 (define-public reducelcs
3871 ;; This is the last commit which is available upstream, no
3872 ;; release happened since 2010.
3873 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3877 (version (string-append "1.0-" revision "." (string-take commit 7)))
3882 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3884 (file-name (string-append name "-" version "-checkout"))
3887 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3888 (build-system gnu-build-system)
3890 `(("openlibm" ,openlibm)))
3892 `(#:tests? #f ; no tests
3894 (modify-phases %standard-phases
3895 (delete 'configure) ; No configure script exists.
3896 (replace 'install ; No install phase exists.
3897 (lambda* (#:key outputs #:allow-other-keys)
3898 (let* ((out (assoc-ref outputs "out"))
3899 (bin (string-append out "/bin")))
3900 (install-file "Approximation" bin)
3901 (install-file "CollectResults" bin)
3902 (install-file "GenerateInstances" bin)
3904 (synopsis "Approximate Longest Commons Subsequence computation tool")
3906 "@code{reduceLCS} is an implementation of the Reduce-Expand
3907 algorithm for LCS. It is a fast program to compute the approximate
3908 Longest Commons Subsequence of a set of strings.")
3909 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3910 (license license:gpl3+))))
3912 (define-public jacal
3919 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3922 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3923 (patches (search-patches "jacal-fix-texinfo.patch"))))
3924 (build-system gnu-build-system)
3927 (modify-phases %standard-phases
3928 (add-before 'build 'pre-build
3929 ;; Don't use upstream's script - it really doesn't fit into
3930 ;; Guix's functional paradigm.
3931 (lambda* (#:key inputs outputs #:allow-other-keys)
3932 (substitute* "Makefile"
3933 (("^install: install-script") "install: "))))
3934 (add-after 'install 'post-install
3935 ;; Instead, we provide our own simplified script.
3936 (lambda* (#:key inputs outputs #:allow-other-keys)
3937 (let ((wrapper (string-append (assoc-ref outputs "out")
3939 (format (open wrapper (logior O_WRONLY O_CREAT))
3940 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3941 "-e '(slib:load \"~a/lib/jacal/math\") "
3944 (assoc-ref inputs "scm")
3945 (assoc-ref outputs "out"))
3946 (chmod wrapper #o555))))
3948 (lambda* (#:key inputs outputs #:allow-other-keys)
3949 (zero? (system* "./configure"
3950 (string-append "--prefix="
3951 (assoc-ref outputs "out")))))))))
3952 (inputs `(("scm" ,scm)))
3953 (native-inputs `(("unzip" ,unzip)
3954 ("texinfo" ,texinfo)))
3955 (synopsis "Symbolic mathematics system")
3956 (description "GNU JACAL is an interactive symbolic mathematics program based on
3957 Scheme. It manipulate and simplify a range of mathematical expressions such
3958 as equations, scalars, vectors, and matrices.")
3959 (home-page "https://www.gnu.org/software/jacal/")
3960 (license license:gpl3+)))
3966 (home-page "https://github.com/Z3Prover/z3")
3969 (uri (git-reference (url home-page)
3970 (commit (string-append "z3-" version))))
3971 (file-name (git-file-name name version))
3974 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
3975 (build-system gnu-build-system)
3978 (modify-phases %standard-phases
3979 (add-after 'unpack 'fix-compatability
3980 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
3982 (substitute* "src/util/mpz.cpp"
3983 (("#include <immintrin.h>") ""))
3985 (add-before 'configure 'bootstrap
3988 (system* "python" "scripts/mk_make.py"))))
3989 ;; work around gnu-build-system's setting --enable-fast-install
3990 ;; (z3's `configure' is a wrapper around the above python file,
3991 ;; which fails when passed --enable-fast-install)
3993 (lambda* (#:key inputs outputs #:allow-other-keys)
3994 (invoke "./configure"
3995 (string-append "--prefix=" (assoc-ref outputs "out")))))
3996 (add-after 'configure 'change-directory
4000 (add-before 'check 'make-test-z3
4002 ;; Build the test suite executable.
4003 (zero? (system* "make" "test-z3" "-j"
4004 (number->string (parallel-job-count))))))
4007 ;; Run all the tests that don't require arguments.
4008 (zero? (system* "./test-z3" "/a")))))))
4011 ("python" ,python-wrapper)))
4012 (synopsis "Theorem prover")
4013 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4014 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4015 (license license:expat)))
4020 (version "2018.11.001")
4023 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4024 version "/elpa-" version ".tar.gz"))
4027 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4028 (build-system gnu-build-system)
4030 `(("fortran" ,gfortran)
4031 ("perl" ,perl))) ;for configure and deps
4033 `(("blas" ,openblas)))
4038 ;; ELPA unfortunately does not support runtime dispatch, so we can
4039 ;; only enable the "generic" kernels. See the "Cross compilation"
4040 ;; section of INSTALL.md.
4042 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4043 "--disable-avx" "--disable-avx2" "--disable-avx512"
4044 ,(string-append "CFLAGS=-O3 "
4045 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4046 "-ftree-vect-loop-version -ftree-vectorize "
4047 ,(let ((system (or (%current-target-system)
4048 (%current-system))))
4050 ((or (string-prefix? "x86_64" system)
4051 (string-prefix? "i686" system))
4054 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4056 (modify-phases %standard-phases
4057 (add-before 'configure 'patch-header-generation
4059 (substitute* "configure"
4060 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4061 (string-append & " CPP=\"$CPP\"")))
4063 (add-before 'check 'setup-tests
4065 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4066 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4067 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4068 ;; for Fortran. This also causes several tests to pass that
4069 ;; otherwise would otherwise fail with matrix size 5000; possibly
4070 ;; due to floating point tolerances that are too tight.
4071 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4072 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4073 (substitute* "Makefile"
4074 ;; Test scripts are generated, patch the shebang
4075 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4077 (home-page "http://elpa.mpcdf.mpg.de")
4078 (synopsis "Eigenvalue solvers for symmetric matrices")
4080 "The ELPA library provides efficient and scalable direct eigensolvers for
4081 symmetric matrices.")
4082 (license license:lgpl3)))
4084 (define-public elpa-openmpi
4085 (package (inherit elpa)
4086 (name "elpa-openmpi")
4089 ("scalapack" ,scalapack)
4090 ,@(package-inputs elpa)))
4092 (substitute-keyword-arguments (package-arguments elpa)
4093 ((#:configure-flags cf '())
4094 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4095 ((#:phases phases '%standard-phases)
4096 `(modify-phases ,phases
4097 (add-before 'check 'mpi-setup
4099 ;; Tests use 2 mpi tasks by default, use our remaining build
4100 ;; cores as OpenMP threads.
4101 (setenv "OMP_NUM_THREADS" (number->string
4102 (max (quotient (parallel-job-count) 2)
4104 (,%openmpi-setup)))))))
4105 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4107 (define-public elemental
4114 (url "https://github.com/elemental/Elemental.git")
4115 (commit (string-append "v" version))))
4116 (file-name (git-file-name name version))
4119 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4120 (build-system cmake-build-system)
4121 (home-page "http://libelemental.org")
4123 `(("gfortran" ,gfortran)))
4125 `(("blas" ,openblas)
4126 ("gfortran:lib" ,gfortran "lib")
4135 `(#:build-type "Release" ;default RelWithDebInfo not supported
4136 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4137 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4138 "-DEL_CACHE_WARNINGS:BOOL=YES"
4139 "-DEL_TESTS:BOOL=YES"
4140 "-DCMAKE_INSTALL_LIBDIR=lib"
4141 "-DGFORTRAN_LIB=gfortran")
4142 #:phases (modify-phases %standard-phases
4143 (add-before 'check 'mpi-setup
4145 (add-before 'check 'setup-tests
4147 ;; Parallelism is done at the MPI layer.
4148 (setenv "OMP_NUM_THREADS" "1")
4150 (add-after 'install 'remove-tests
4151 (lambda* (#:key outputs #:allow-other-keys)
4152 ;; Tests are installed, with no easy configuration
4153 ;; switch to prevent this, so delete them.
4154 (delete-file-recursively
4155 (string-append (assoc-ref outputs "out") "/bin"))
4157 (synopsis "Dense and sparse-direct linear algebra and optimization")
4158 (description "Elemental is a modern C++ library for distributed-memory
4159 dense and sparse-direct linear algebra, conic optimization, and lattice
4161 (license license:bsd-2)))
4163 (define-public mcrl2
4166 (version "201707.1.15162")
4169 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4174 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4176 `(("subversion" ,subversion)))
4181 ("qtbase" ,qtbase)))
4182 (build-system cmake-build-system)
4183 (synopsis "Toolset for the mCRL2 formal specification language")
4185 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4186 specification language for describing concurrent discrete event systems. Its
4187 toolset supports analysis and automatic verification, linearisation, simulation,
4188 state-space exploration and generation, and tools to optimise and analyse
4189 specifications. Also, state spaces can be manipulated, visualised and
4191 (home-page "https://mcrl2.org")
4192 (license license:boost1.0)))
4194 (define-public r-subplex
4201 (uri (cran-uri "subplex" version))
4204 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4205 (build-system r-build-system)
4207 `(("gfortran" ,gfortran)))
4208 (home-page "https://cran.r-project.org/web/packages/subplex")
4209 (synopsis "Unconstrained optimization using the subplex algorithm")
4210 (description "This package implements the Subplex optimization algorithm.
4211 It solves unconstrained optimization problems using a simplex method on
4212 subspaces. The method is well suited for optimizing objective functions that
4213 are noisy or are discontinuous at the solution.")
4214 (license license:gpl3+)))
4216 (define-public r-desolve
4223 (uri (cran-uri "deSolve" version))
4226 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
4227 (properties `((upstream-name . "deSolve")))
4228 (build-system r-build-system)
4230 `(("gfortran" ,gfortran)))
4231 (home-page "https://desolve.r-forge.r-project.org/")
4232 (synopsis "Solvers for initial value problems of differential equations")
4233 (description "This package provides functions that solve initial
4234 value problems of a system of first-order ordinary differential equations (ODE),
4235 of partial differential equations (PDE), of differential algebraic equations
4236 (DAE), and of delay differential equations. The functions provide an interface
4237 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4238 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4239 the Runge-Kutta family with fixed or variable time steps. The package contains
4240 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4241 differential equations (PDE) that have been converted to ODEs by numerical
4243 (license license:gpl2+)))
4245 (define-public tcalc
4252 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4256 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4257 (build-system gnu-build-system)
4258 (synopsis "The terminal calculator")
4260 "The terminal calculator is a small program to help users of the GNU/Linux
4261 terminal do calculations simply and quickly. The formula to be calculated can
4262 be fed to @command{tcalc} through the command line.")
4263 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4264 (license license:gpl3+)))
4266 (define-public sundials
4273 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4274 "sundials-" version ".tar.gz"))
4277 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4278 (build-system cmake-build-system)
4280 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4282 `(("fortran" ,gfortran) ;for fcmix
4284 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4286 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4287 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4288 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4289 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4290 "-DEXAMPLES_INSTALL:BOOL=OFF"
4292 "-DFCMIX_ENABLE:BOOL=ON"
4294 "-DKLU_ENABLE:BOOL=ON"
4295 ,(string-append "-DKLU_INCLUDE_DIR="
4296 (assoc-ref %build-inputs "suitesparse")
4298 ,(string-append "-DKLU_LIBRARY_DIR="
4299 (assoc-ref %build-inputs "suitesparse")
4301 (home-page "https://computation.llnl.gov/projects/sundials")
4302 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4303 (description "SUNDIALS is a family of software packages implemented with
4304 the goal of providing robust time integrators and nonlinear solvers that can
4305 easily be incorporated into existing simulation codes.")
4306 (license license:bsd-3)))
4308 (define-public sundials-openmpi
4309 (package (inherit sundials)
4310 (name "sundials-openmpi")
4313 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4314 ,@(package-inputs sundials)))
4316 (substitute-keyword-arguments (package-arguments sundials)
4317 ((#:configure-flags flags '())
4318 `(cons* "-DMPI_ENABLE:BOOL=ON"
4319 "-DPETSC_ENABLE:BOOL=ON"
4320 (string-append "-DPETSC_INCLUDE_DIR="
4321 (assoc-ref %build-inputs "petsc")
4323 (string-append "-DPETSC_LIBRARY_DIR="
4324 (assoc-ref %build-inputs "petsc")
4327 ((#:phases phases '%standard-phases)
4328 `(modify-phases ,phases
4329 (add-before 'check 'mpi-setup
4330 ,%openmpi-setup)))))
4331 (synopsis "SUNDIALS with OpenMPI support")))
4333 (define-public combinatorial-blas
4335 (name "combinatorial-blas")
4340 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4342 (match (string-split version #\.)
4343 ((major minor patch)
4344 (string-append major minor "_" patch))) ;e.g. "16_2"
4348 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4349 (patches (search-patches "combinatorial-blas-awpm.patch"
4350 "combinatorial-blas-io-fix.patch"))))
4351 (build-system cmake-build-system)
4354 ("test-data" ,(origin
4356 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4357 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4360 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4362 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4363 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4364 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4366 (modify-phases %standard-phases
4367 (add-before 'check 'mpi-setup
4369 (add-before 'check 'test-setup
4370 (lambda* (#:key inputs #:allow-other-keys)
4371 (setenv "OMP_NUM_THREADS" "2")
4372 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4373 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4374 (synopsis "Linear algebra primitives for graph analytics")
4375 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4376 distributed-memory parallel graph library offering a small but powerful set of
4377 linear algebra primitives specifically targeting graph analytics.")
4379 license:gpl2+ ;include/psort/(funnel|sort)*.h
4380 license:x11 ;usort and psort
4381 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4383 (define-public dune-common
4385 (name "dune-common")
4390 (uri (string-append "https://dune-project.org/download/"
4391 version "/dune-common-" version ".tar.gz"))
4394 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4395 (build-system cmake-build-system)
4398 (modify-phases %standard-phases
4399 (add-after 'build 'build-tests
4400 (lambda* (#:key make-flags #:allow-other-keys)
4401 (apply invoke "make" "build_tests" make-flags)))
4402 ;; These tests fail because they require a fully functional MPI
4404 (add-after 'unpack 'disable-failing-tests
4407 (string-append "--exclude-regex '("
4411 "remoteindicestest-mpi-2"
4414 "variablesizecommunicatortest"
4415 "variablesizecommunicatortest-mpi-2"
4416 "arithmetictestsuitetest"
4417 "assertandreturntest"
4418 "assertandreturntest_ndebug"
4421 "mpicollectivecommunication"
4422 "mpicollectivecommunication-mpi-2"
4424 "mpiguardtest-mpi-2"
4426 "mpihelpertest-mpi-2"
4428 "mpihelpertest2-mpi-2")
4435 ("openmpi" ,openmpi)
4436 ("openblas" ,openblas)
4438 ("superlu" ,superlu)))
4440 `(("gfortran" ,gfortran)
4441 ("pkg-config" ,pkg-config)))
4442 (home-page "https://dune-project.org/")
4443 (synopsis "Distributed and Unified Numerics Environment")
4444 (description "DUNE, the Distributed and Unified Numerics Environment is a
4445 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4446 grid-based methods. It supports the easy implementation of methods like
4447 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4448 Differences} (FD).")
4449 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4450 (license license:gpl2)))
4452 (define-public dune-geometry
4454 (name "dune-geometry")
4459 (uri (string-append "https://dune-project.org/download/"
4460 version "/dune-geometry-" version ".tar.gz"))
4463 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4464 (build-system cmake-build-system)
4467 (modify-phases %standard-phases
4468 (add-after 'build 'build-tests
4469 (lambda* (#:key make-flags #:allow-other-keys)
4470 (apply invoke "make" "build_tests" make-flags))))))
4472 `(("dune-common" ,dune-common)
4473 ("openmpi" ,openmpi)
4475 ("openblas" ,openblas)
4477 ("python" ,python)))
4479 `(("gfortran" ,gfortran)
4480 ("pkg-config" ,pkg-config)))
4481 (home-page "https://dune-project.org/")
4482 (synopsis "Distributed and Unified Numerics Environment")
4483 (description "DUNE, the Distributed and Unified Numerics Environment is a
4484 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4485 grid-based methods. It supports the easy implementation of methods like
4486 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4489 This package contains the basic DUNE geometry classes.")
4490 ;; GPL version 2 with "runtime exception"
4491 (license license:gpl2)))
4493 (define-public dune-grid
4500 (uri (string-append "https://dune-project.org/download/"
4501 version "/dune-grid-" version ".tar.gz"))
4504 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4505 (build-system cmake-build-system)
4508 (modify-phases %standard-phases
4509 (add-after 'build 'build-tests
4510 (lambda* (#:key make-flags #:allow-other-keys)
4511 (apply invoke "make" "build_tests" make-flags)))
4512 ;; These tests fail because they require a fully functional MPI
4514 (add-after 'unpack 'disable-failing-tests
4517 (string-append "--exclude-regex '("
4521 "conformvolumevtktest"
4523 "nonconformboundaryvtktest"
4524 "subsamplingvtktest"
4530 "test-dgf-yasp-offset"
4532 "test-geogrid-yaspgrid"
4535 "testiteratorranges"
4536 "test-hierarchicsearch"
4537 "test-parallel-ug-mpi-2"
4538 "test-yaspgrid-backuprestore-equidistant"
4539 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4540 "test-yaspgrid-backuprestore-equidistantoffset"
4541 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4542 "test-yaspgrid-backuprestore-tensor"
4543 "test-yaspgrid-backuprestore-tensor-mpi-2"
4544 "test-yaspgrid-tensorgridfactory"
4545 "test-yaspgrid-tensorgridfactory-mpi-2"
4546 "test-yaspgrid-yaspfactory-1d"
4547 "test-yaspgrid-yaspfactory-1d-mpi-2"
4548 "test-yaspgrid-yaspfactory-2d"
4549 "test-yaspgrid-yaspfactory-2d-mpi-2"
4550 "test-yaspgrid-yaspfactory-3d"
4551 "test-yaspgrid-yaspfactory-3d-mpi-2"
4552 "globalindexsettest"
4553 "persistentcontainertest"
4554 "structuredgridfactorytest"
4555 "tensorgridfactorytest"
4561 `(("dune-common" ,dune-common)
4562 ("dune-geometry" ,dune-geometry)
4565 ("openblas" ,openblas)
4566 ("openmpi" ,openmpi)
4567 ("python" ,python)))
4569 `(("gfortran" ,gfortran)
4570 ("pkg-config" ,pkg-config)))
4571 (home-page "https://dune-project.org/")
4572 (synopsis "Distributed and Unified Numerics Environment")
4573 (description "DUNE, the Distributed and Unified Numerics Environment is a
4574 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4575 grid-based methods. It supports the easy implementation of methods like
4576 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4579 This package contains the basic DUNE grid classes.")
4580 ;; GPL version 2 with "runtime exception"
4581 (license license:gpl2)))
4583 (define-public dune-istl
4590 (uri (string-append "https://dune-project.org/download/"
4591 version "/dune-istl-" version ".tar.gz"))
4594 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4595 (build-system cmake-build-system)
4598 (modify-phases %standard-phases
4599 (add-after 'build 'build-tests
4600 (lambda* (#:key make-flags #:allow-other-keys)
4601 (apply invoke "make" "build_tests" make-flags)))
4602 ;; These tests fail because they require a fully functional MPI
4604 (add-after 'unpack 'disable-failing-tests
4607 (string-append "--exclude-regex '("
4613 "pamg_comm_repart_test"
4621 `(("dune-common" ,dune-common)
4622 ("openmpi" ,openmpi)
4625 ("superlu" ,superlu)
4626 ("openblas" ,openblas)
4628 ("python" ,python)))
4630 `(("gfortran" ,gfortran)
4631 ("pkg-config" ,pkg-config)))
4632 (home-page "https://dune-project.org/")
4633 (synopsis "Distributed and Unified Numerics Environment")
4634 (description "DUNE, the Distributed and Unified Numerics Environment is a
4635 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4638 This is the iterative solver template library which provides generic sparse
4639 matrix/vector classes and a variety of solvers based on these classes. A
4640 special feature is the use of templates to exploit the recursive block
4641 structure of finite element matrices at compile time. Available solvers
4642 include Krylov methods, (block-) incomplete decompositions and
4643 aggregation-based algebraic multigrid.")
4644 ;; GPL version 2 with "runtime exception"
4645 (license license:gpl2)))
4647 (define-public dune-localfunctions
4649 (name "dune-localfunctions")
4654 (uri (string-append "https://dune-project.org/download/"
4655 version "/dune-localfunctions-" version ".tar.gz"))
4658 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4659 (build-system cmake-build-system)
4662 (modify-phases %standard-phases
4663 (add-after 'build 'build-tests
4664 (lambda* (#:key make-flags #:allow-other-keys)
4665 (apply invoke "make" "build_tests" make-flags))))))
4667 `(("dune-common" ,dune-common)
4668 ("dune-geometry" ,dune-geometry)
4669 ("openmpi" ,openmpi)
4672 ("superlu" ,superlu)
4675 `(("gfortran" ,gfortran)
4676 ("pkg-config" ,pkg-config)))
4677 (home-page "https://dune-project.org/")
4678 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4679 (description "This DUNE module provides interface and implementation for
4680 shape functions defined on the DUNE reference elements. In addition to the
4681 shape function, interpolation operators and special keys are provided which
4682 can be used to assemble global function spaces on finite-element grids.
4684 This package provides an interface and implementation for shape functions
4685 defined on the DUNE reference elements. In addition to the shape function,
4686 interpolation operators and special keys are provided which can be used to
4687 assemble global function spaces on finite-element grids.")
4688 ;; GPL version 2 with "runtime exception"
4689 (license license:gpl2)))
4691 (define-public dune-alugrid
4693 (name "dune-alugrid")
4698 (uri (string-append "https://dune-project.org/download/"
4699 version "/dune-alugrid-" version ".tar.gz"))
4702 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4703 (build-system cmake-build-system)
4705 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4708 (modify-phases %standard-phases
4709 (add-after 'unpack 'patch-include
4711 (substitute* "dune/alugrid/test/test-alugrid.cc"
4712 (("doc/grids/gridfactory/testgrids")
4713 "doc/dune-grid/grids/gridfactory/testgrids"))
4715 (add-after 'build 'build-tests
4716 (lambda* (#:key inputs make-flags #:allow-other-keys)
4717 (setenv "CPLUS_INCLUDE_PATH"
4718 (string-append (assoc-ref inputs "dune-grid") "/share:"
4719 (getenv "CPLUS_INCLUDE_PATH")))
4720 (apply invoke "make" "build_tests" make-flags))))))
4722 `(("dune-common" ,dune-common)
4723 ("dune-geometry" ,dune-geometry)
4724 ("dune-grid" ,dune-grid)
4725 ("openmpi" ,openmpi)
4728 ("openblas" ,openblas)
4730 ("superlu" ,superlu)
4734 `(("gfortran" ,gfortran)
4735 ("pkg-config" ,pkg-config)))
4736 (home-page "https://dune-project.org/")
4737 (synopsis "Distributed and Unified Numerics Environment")
4738 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4739 implementation of the DUNE grid interface supporting either simplices or
4741 (license license:gpl2+)))
4743 (define-public dune-typetree
4745 (name "dune-typetree")
4751 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4752 (commit (string-append "v" version))))
4753 (file-name (git-file-name name version))
4756 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4757 (build-system cmake-build-system)
4760 (modify-phases %standard-phases
4761 (add-after 'build 'build-tests
4762 (lambda* (#:key make-flags #:allow-other-keys)
4763 (apply invoke "make" "build_tests" make-flags))))))
4765 `(("dune-common" ,dune-common)
4766 ("openmpi" ,openmpi)
4768 ("openblas" ,openblas)
4771 ("superlu" ,superlu)
4774 `(("gfortran" ,gfortran)
4775 ("pkg-config" ,pkg-config)))
4776 (home-page "https://dune-project.org/")
4777 (synopsis "Distributed and Unified Numerics Environment")
4778 (description "TypeTree is a template library for constructing and
4779 operating on statically typed trees of objects.")
4780 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4781 (license (list license:lgpl3+ license:gpl2))))
4783 (define-public dune-functions
4785 (name "dune-functions")
4791 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4792 (commit (string-append "v" version))))
4793 (file-name (git-file-name name version))
4796 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4797 (build-system cmake-build-system)
4798 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4800 `(("dune-common" ,dune-common)
4801 ("dune-istl" ,dune-istl)
4802 ("dune-localfunctions" ,dune-localfunctions)
4803 ("dune-grid" ,dune-grid)
4804 ("dune-geometry" ,dune-geometry)
4805 ("dune-typetree" ,dune-typetree)
4806 ("openmpi" ,openmpi)
4807 ("openblas" ,openblas)
4810 ("superlu" ,superlu)
4813 `(("gfortran" ,gfortran)
4814 ("pkg-config" ,pkg-config)))
4815 (home-page "https://dune-project.org/")
4816 (synopsis "Distributed and Unified Numerics Environment")
4817 (description "The dune-functions module provides an abstraction layer for
4818 global finite element functions. Its two main concepts are functions
4819 implemented as callable objects, and bases of finite element spaces.")
4820 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4821 (license (list license:lgpl3+ license:gpl2))))
4823 (define-public dune-pdelab
4825 (name "dune-pdelab")
4826 (version "2.6.0-rc1")
4831 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4832 (commit (string-append "v" version))))
4833 (file-name (git-file-name name version))
4836 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4837 (build-system cmake-build-system)
4838 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4840 `(("dune-common" ,dune-common)
4841 ("dune-istl" ,dune-istl)
4842 ("dune-localfunctions" ,dune-localfunctions)
4843 ("dune-geometry" ,dune-geometry)
4844 ("dune-grid" ,dune-grid)
4845 ("dune-typetree" ,dune-typetree)
4846 ("dune-functions" ,dune-functions)
4847 ("openmpi" ,openmpi)
4849 ("openblas" ,openblas)
4853 ("superlu" ,superlu)
4856 `(("gfortran" ,gfortran)
4857 ("pkg-config" ,pkg-config)))
4858 (home-page "https://dune-project.org/")
4859 (synopsis "Differential equations solver toolbox")
4860 (description "PDELab is a partial differential equations solver toolbox
4861 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4862 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4863 (license (list license:lgpl3+ license:gpl2))))
4865 (define-public mlucas
4873 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4876 "1ax12qj9lyvnx4vs3gx7l8r3wx5gjbsdswp5f00ik9z0wz7xf297"))))
4877 (build-system gnu-build-system)
4879 `(("python2" ,python-2)))
4881 `(#:tests? #f ; no tests
4883 (modify-phases %standard-phases
4887 (call-with-output-file "Makefile"
4889 (format port "CC = gcc
4890 CFLAGS = -O3 ~a -DUSE_THREADS
4891 LDLIBS = -lm -lpthread -lrt
4892 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
4894 ,(let ((system (or (%current-target-system)
4895 (%current-system))))
4897 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
4901 (lambda* (#:key outputs #:allow-other-keys)
4902 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
4903 (install-file "Mlucas" bin)
4904 (install-file "primenet.py" bin))
4906 (home-page "https://www.mersenne.org")
4907 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
4908 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
4909 numbers in search of a world-record prime. You may use it to test any
4910 suitable number as you wish, but it is preferable that you do so in a
4911 coordinated fashion, as part of the Great Internet Mersenne Prime
4912 Search (GIMPS). Mlucas also includes a simple Python script for assignment
4913 management via the GIMPS project's Primenet server.")
4914 (license license:gpl2+)))