1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 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, 2019 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>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
36 ;;; This file is part of GNU Guix.
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
51 (define-module (gnu packages maths)
52 #:use-module (ice-9 regex)
53 #:use-module (ice-9 match)
54 #:use-module (gnu packages)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix packages)
57 #:use-module (guix download)
58 #:use-module (guix git-download)
59 #:use-module (guix utils)
60 #:use-module ((guix build utils) #:select (alist-replace))
61 #:use-module (guix build-system cmake)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system r)
65 #:use-module (guix build-system ruby)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages bison)
71 #:use-module (gnu packages boost)
72 #:use-module (gnu packages check)
73 #:use-module (gnu packages cmake)
74 #:use-module (gnu packages compression)
75 #:use-module (gnu packages curl)
76 #:use-module (gnu packages cyrus-sasl)
77 #:use-module (gnu packages documentation)
78 #:use-module (gnu packages elf)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages fltk)
81 #:use-module (gnu packages fontutils)
82 #:use-module (gnu packages gettext)
83 #:use-module (gnu packages gcc)
84 #:use-module (gnu packages gd)
85 #:use-module (gnu packages ghostscript)
86 #:use-module (gnu packages graphviz)
87 #:use-module (gnu packages gtk)
88 #:use-module (gnu packages image)
89 #:use-module (gnu packages java)
90 #:use-module (gnu packages less)
91 #:use-module (gnu packages lisp)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages logging)
94 #:use-module (gnu packages lua)
95 #:use-module (gnu packages gnome)
96 #:use-module (gnu packages guile)
97 #:use-module (gnu packages xorg)
98 #:use-module (gnu packages gl)
99 #:use-module (gnu packages imagemagick)
100 #:use-module (gnu packages m4)
101 #:use-module (gnu packages mpi)
102 #:use-module (gnu packages multiprecision)
103 #:use-module (gnu packages netpbm)
104 #:use-module (gnu packages pcre)
105 #:use-module (gnu packages popt)
106 #:use-module (gnu packages perl)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages pulseaudio)
109 #:use-module (gnu packages python)
110 #:use-module (gnu packages python-web)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages qt)
113 #:use-module (gnu packages readline)
114 #:use-module (gnu packages ruby)
115 #:use-module (gnu packages tbb)
116 #:use-module (gnu packages scheme)
117 #:use-module (gnu packages shells)
118 #:use-module (gnu packages tcl)
119 #:use-module (gnu packages texinfo)
120 #:use-module (gnu packages tex)
121 #:use-module (gnu packages tls)
122 #:use-module (gnu packages version-control)
123 #:use-module (gnu packages wxwidgets)
124 #:use-module (gnu packages xml)
125 #:use-module (srfi srfi-1))
133 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
135 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
136 (build-system gnu-build-system)
137 (inputs `(("gtk+" ,gtk+)
138 ("libxml2" ,libxml2)))
139 (native-inputs `(("pkg-config" ,pkg-config)))
140 (synopsis "Natural deduction first-order logic interface")
141 (description "Aris is a program for performing logical proofs. It supports
142 propositional and predicate logic, as well as Boolean algebra and
143 arithmetical logic. In addition to its predefined inference and equivalence
144 rules, Aris also supports references to older proofs. Its use of standard
145 logical symbols and its natural deduction interface make it easy to use for
147 (license license:gpl3+)
148 (home-page "https://www.gnu.org/software/aris/")))
150 (define-public c-graph
156 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
159 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
160 (build-system gnu-build-system)
162 `(("fortran" ,gfortran)))
163 (synopsis "Visualizing and demonstrating convolution")
165 "GNU C-Graph is a tool for demonstrating the theory of convolution.
166 Thus, it can serve as an excellent aid to students of signal and systems
167 theory in visualizing the convolution process. Rather than forcing the
168 student to write code, the program offers an intuitive interface with
169 interactive dialogs to guide them.")
170 (license license:gpl3+)
171 (home-page "https://www.gnu.org/software/c-graph/")))
180 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
181 version "/coda-" version ".tar.gz"))
183 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
184 (patches (search-patches "coda-use-system-libs.patch"))
185 (modules '((guix build utils)))
187 ;; Make sure we don't use the bundled software.
189 (for-each (lambda (d)
190 (delete-file-recursively (string-append "libcoda/" d)))
191 '("zlib" "pcre" "expat"))
194 `(("fortran" ,gfortran)
196 ("python-numpy" ,python-numpy)))
203 (build-system gnu-build-system)
205 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
206 "LIBS= -lz -lpcre -lexpat")))
207 (synopsis "A common interface to various earth observation data formats")
209 "The Common Data Access toolbox (CODA) provides a set of interfaces for
210 reading remote sensing data from earth observation data files. It consists of
211 command line applications and interfaces to the C, Fortran, Python, and Java
212 programming languages.")
213 (home-page "https://stcorp.nl/coda")
214 (license license:gpl2+)))
222 (uri (string-append "http://www.qhull.org/download/qhull-"
223 (car (string-split version #\.))
227 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
228 (build-system cmake-build-system)
229 (synopsis "Calculate convex hulls and related structures")
231 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
232 diagram, halfspace intersection about a point, furthest-site Delaunay
233 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
234 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
235 algorithm for computing the convex hull. It handles roundoff errors from
236 floating point arithmetic. It computes volumes, surface areas, and
237 approximations to the convex hull.
239 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
240 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
241 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
243 (home-page "http://qhull.org")
244 (license (license:non-copyleft "file://COPYING.txt"
245 "See COPYING in the distribution."))))
247 (define-public python-cvxopt
249 (name "python-cvxopt")
254 (url "https://github.com/cvxopt/cvxopt.git")
256 (file-name (git-file-name name version))
259 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
260 (build-system python-build-system)
263 (modify-phases %standard-phases
264 (add-after 'unpack 'find-libraries
265 (lambda* (#:key inputs #:allow-other-keys)
266 (setenv "CVXOPT_BLAS_LIB" "openblas")
267 (setenv "CVXOPT_BUILD_FFTW" "1")
268 (setenv "CVXOPT_BUILD_GLPK" "1")
269 (setenv "CVXOPT_BUILD_GSL" "1")
276 ("openblas" ,openblas)
277 ("suitesparse" ,suitesparse)))
278 (home-page "https://www.cvxopt.org")
279 (synopsis "Python library for convex optimization")
281 "CVXOPT is a package for convex optimization based on the Python
282 programming language. Its main purpose is to make the development of software
283 for convex optimization applications straightforward by building on Python’s
284 extensive standard library and on the strengths of Python as a high-level
285 programming language.")
286 (license license:gpl3+)))
288 (define-public python2-cvxopt
289 (package-with-python2 python-cvxopt))
297 (uri (string-append "mirror://gnu/units/units-" version
300 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
301 (build-system gnu-build-system)
303 `(("readline" ,readline)
304 ("python" ,python-wrapper) ;for 'units_cur' script
305 ("python-requests" ,python-requests)))
307 `(#:phases (modify-phases %standard-phases
308 (add-after 'install 'wrap-units_cur
309 (lambda* (#:key outputs #:allow-other-keys)
310 (let* ((out (assoc-ref outputs "out"))
311 (bin (string-append out "/bin")))
312 (wrap-program (string-append bin "/units_cur")
313 `("PYTHONPATH" ":" prefix
314 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
316 (synopsis "Conversion between thousands of scales")
318 "GNU Units converts numeric quantities between units of measure. It
319 can handle scale changes through adaptive usage of standard scale
320 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
321 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
322 enough to be used effectively as a scientific calculator.")
323 (license license:gpl3+)
324 (home-page "https://www.gnu.org/software/units/")))
326 (define-public double-conversion
328 (name "double-conversion")
330 (home-page "https://github.com/google/double-conversion")
333 (uri (git-reference (url home-page)
334 (commit (string-append "v" version))))
335 (file-name (git-file-name name version))
338 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
339 (build-system cmake-build-system)
341 '(#:test-target "test"
342 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
343 "-DBUILD_TESTING=ON")))
344 (synopsis "Conversion routines for IEEE doubles")
346 "The double-conversion library provides binary-decimal and decimal-binary
347 routines for IEEE doubles. The library consists of efficient conversion
348 routines that have been extracted from the V8 JavaScript engine.")
349 (license license:bsd-3)))
351 (define-public dionysus
357 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
361 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
362 (build-system gnu-build-system)
363 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
364 (synopsis "Local search for universal constants and scientific values")
366 "GNU Dionysus is a convenient system for quickly retrieving the values of
367 mathematical constants used in science and engineering. Values can be
368 searched using a simple command-line tool, choosing from three databases:
369 universal constants, atomic numbers, and constants related to
371 (license license:gpl3+)
372 (home-page "https://www.gnu.org/software/dionysus/")))
380 (uri (string-append "mirror://gnu/gsl/gsl-"
384 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
385 (patches (search-patches "gsl-test-i686.patch"))))
386 (build-system gnu-build-system)
388 `(;; Currently there are numerous tests that fail on "exotic"
389 ;; architectures such as aarch64 and ppc64le.
390 ,@(if (string-prefix? "aarch64-linux"
391 (or (%current-target-system) (%current-system)))
394 (home-page "https://www.gnu.org/software/gsl/")
395 (synopsis "Numerical library for C and C++")
397 "The GNU Scientific Library is a library for numerical analysis in C
398 and C++. It includes a wide range of mathematical routines, with over 1000
399 functions in total. Subject areas covered by the library include:
400 differential equations, linear algebra, Fast Fourier Transforms and random
402 (license license:gpl3+)))
411 (uri (string-append "mirror://gnu/glpk/glpk-"
415 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
416 (build-system gnu-build-system)
420 `(#:configure-flags '("--with-gmp")))
421 (home-page "https://www.gnu.org/software/glpk/")
422 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
424 "GLPK is a C library for solving large-scale linear programming (LP),
425 mixed integer programming (MIP), and other related problems. It supports the
426 GNU MathProg modeling language, a subset of the AMPL language, and features a
427 translator for the language. In addition to the C library, a stand-alone
428 LP/MIP solver is included in the package.")
429 (license license:gpl3+)))
438 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
440 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
442 "/4ti2-" version ".tar.gz"))
444 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
445 (build-system gnu-build-system)
447 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
451 (home-page "http://www.4ti2.de/")
452 (synopsis "Mathematical tool suite for problems on linear spaces")
454 "4ti2 implements algorithms for solving algebraic, geometric and
455 combinatorial problems on linear spaces. Among others, it solves systems
456 of linear equations, computes extreme rays of polyhedral cones, solves
457 integer programming problems and computes Markov bases for statistics.")
458 (license license:gpl2+)))
460 (define-public cddlib
467 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
468 (string-delete #\. version) ".tar.gz"))
471 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
472 (build-system gnu-build-system)
475 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
476 (synopsis "Library for convex hulls and extreme rays of polyhedra")
478 "The C-library cddlib implements the Double Description Method of
479 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
480 rays of a general convex polyhedron given by a system of linear inequalities
481 in arbitrary dimension. It can also be used for the converse operation of
482 computing convex hulls.")
483 (license license:gpl2+)))
485 (define-public arpack-ng
489 (home-page "https://github.com/opencollab/arpack-ng")
492 (uri (git-reference (url home-page) (commit version)))
493 (file-name (git-file-name name version))
496 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
497 (build-system gnu-build-system)
499 `(("autoconf" ,autoconf)
500 ("automake" ,automake)
501 ("libtool" ,libtool)))
504 ("fortran" ,gfortran)))
505 (synopsis "Fortran subroutines for solving eigenvalue problems")
507 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
508 large scale eigenvalue problems.")
509 (license (license:non-copyleft "file://COPYING"
510 "See COPYING in the distribution."))))
512 (define-public arpack-ng-3.3.0
516 (name (package-name arpack-ng))
517 (home-page (package-home-page arpack-ng))
521 (uri (string-append home-page "/archive/" version ".tar.gz"))
522 (file-name (string-append name "-" version ".tar.gz"))
525 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
527 (define-public arpack-ng-openmpi
528 (package (inherit arpack-ng)
529 (name "arpack-ng-openmpi")
532 ,@(package-inputs arpack-ng)))
534 (substitute-keyword-arguments (package-arguments arpack-ng)
535 ((#:configure-flags _ '())
537 ((#:phases phases '%standard-phases)
538 `(modify-phases ,phases
539 (add-before 'check 'mpi-setup
541 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
543 (define-public lapack
550 (uri (string-append "http://www.netlib.org/lapack/lapack-"
554 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
555 (build-system cmake-build-system)
556 (home-page "http://www.netlib.org/lapack/")
557 (inputs `(("fortran" ,gfortran)
558 ("python" ,python-2)))
560 `(#:configure-flags (list
561 "-DBUILD_SHARED_LIBS:BOOL=YES"
564 ;; Build the 'LAPACKE_clatms' functions.
565 "-DLAPACKE_WITH_TMG=ON")
567 (modify-phases %standard-phases
568 (add-before 'check 'patch-python
569 (lambda* (#:key inputs #:allow-other-keys)
570 (let ((python (assoc-ref inputs "python")))
571 (substitute* "lapack_testing.py"
572 (("/usr/bin/env python") python)))
574 (synopsis "Library for numerical linear algebra")
576 "LAPACK is a Fortran 90 library for solving the most commonly occurring
577 problems in numerical linear algebra.")
578 (license (license:non-copyleft "file://LICENSE"
579 "See LICENSE in the distribution."))))
581 (define-public scalapack
588 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
592 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
593 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
594 (build-system cmake-build-system)
597 ("fortran" ,gfortran)
598 ("lapack" ,lapack))) ;for testing only
600 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
601 #:phases (modify-phases %standard-phases
602 (add-before 'check 'mpi-setup
604 (home-page "http://www.netlib.org/scalapack/")
605 (synopsis "Library for scalable numerical linear algebra")
607 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
608 routines on parallel distributed memory machines. ScaLAPACK solves dense and
609 banded linear systems, least squares problems, eigenvalue problems, and
610 singular value problems.")
611 (license (license:non-copyleft "file://LICENSE"
612 "See LICENSE in the distribution."))))
614 (define-public gnuplot
620 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
624 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
625 (build-system gnu-build-system)
626 (inputs `(("readline" ,readline)
632 `(("pkg-config" ,pkg-config)
633 ("texlive" ,texlive-tiny)))
634 (arguments `(#:configure-flags (list (string-append
635 "--with-texdir=" %output
636 "/texmf-local/tex/latex/gnuplot"))))
637 (home-page "http://www.gnuplot.info")
638 (synopsis "Command-line driven graphing utility")
639 (description "Gnuplot is a portable command-line driven graphing
640 utility. It was originally created to allow scientists and students to
641 visualize mathematical functions and data interactively, but has grown to
642 support many non-interactive uses such as web scripting. It is also used as a
643 plotting engine by third-party applications like Octave.")
644 ;; X11 Style with the additional restriction that derived works may only be
645 ;; distributed as patches to the original.
646 (license (license:fsf-free
647 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
657 (url "https://github.com/OkoSanto/GCTP.git")
658 (commit (string-append "v" version))))
659 (file-name (git-file-name name version))
661 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
663 `(("fortran" ,gfortran)))
664 (build-system gnu-build-system)
665 (synopsis "General Cartographic Transformation Package (GCTP)")
667 "The General Cartographic Transformation Package (GCTP) is a system of
668 software routines designed to permit the transformation of coordinate pairs
669 from one map projection to another. The GCTP is the standard computer
670 software used by the National Mapping Division for map projection
672 (home-page "https://github.com/OkoSanto/GCTP")
673 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
682 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
683 version "/src/hdf-" version ".tar.bz2"))
685 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
686 (patches (search-patches "hdf4-architectures.patch"
687 "hdf4-reproducibility.patch"
688 "hdf4-shared-fortran.patch"))))
689 (build-system gnu-build-system)
691 `(("gfortran" ,gfortran)
696 ("libjpeg" ,libjpeg)))
698 `(#:parallel-tests? #f
699 #:configure-flags '("--enable-shared")
701 (modify-phases %standard-phases
702 ;; This is inspired by two of Debian's patches.
703 (add-before 'configure 'add-more-aarch64-support
705 (substitute* '("mfhdf/ncgen/ncgen.l"
706 "mfhdf/ncgen/ncgenyy.c"
707 "mfhdf/libsrc/netcdf.h.in")
708 (("AIX5L64") "__aarch64__"))
710 (add-before 'configure 'patchbuild
713 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
715 (("/bin/mkdir") "mkdir"))
716 (substitute* (find-files "." "^Makefile\\.in$")
717 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
718 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
719 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
720 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
721 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
723 (add-after 'configure 'patch-settings
725 ;; libhdf4.settings contains the full path of the
726 ;; compilers used, and its contents are included in
727 ;; .so-files. We truncate the hashes to avoid
728 ;; unnecessary store references to those compilers:
729 (substitute* "libhdf4.settings"
730 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
731 (string-append prefix (string-take hash 10) "...")))
734 (home-page "https://www.hdfgroup.org/products/hdf4/")
736 "Library and multi-object file format for storing and managing data")
737 (description "HDF4 is a library and multi-object file format for storing
738 and managing data between machines. HDF4 is an older hierarchical data format,
739 incompatible with HDF5.")
741 (license:non-copyleft
742 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
744 (define-public hdf4-alt
749 (substitute-keyword-arguments (package-arguments hdf4)
750 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
752 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
761 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
762 "hdf5-" (version-major+minor version)
763 "/hdf5-" version "/src/hdf5-"
765 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
767 (match (string-split version #\.)
769 (string-append major minor)))
770 "/src/hdf5-" version ".tar.bz2")))
772 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
773 (patches (search-patches "hdf5-config-date.patch"
774 "hdf5-1.8-mpi-deprecations.patch"))))
775 (build-system gnu-build-system)
779 `(("gfortran" ,gfortran)
780 ("perl" ,perl))) ;part of the test machinery needs Perl
781 (outputs '("out" ; core library
782 "fortran")) ; fortran interface
784 `(;; Some of the users, notably Flann, need the C++ interface.
785 #:configure-flags '("--enable-cxx"
787 "--enable-fortran2003"
789 ;; Build a thread-safe library. Unfortunately,
790 ;; 'configure' invites you to either turn off C++,
791 ;; Fortran, and the high-level interface (HL), or
792 ;; to pass '--enable-unsupported'. Debian
793 ;; packagers chose to pass '--enable-unsupported'
794 ;; and we follow their lead here.
795 "--enable-threadsafe"
797 "--enable-unsupported")
798 ;; Use -fPIC to allow the R bindings to link with the static libraries
799 #:make-flags (list "CFLAGS=-fPIC"
802 (modify-phases %standard-phases
803 (add-before 'configure 'patch-configure
804 (lambda* (#:key outputs #:allow-other-keys)
805 (substitute* "configure"
807 (substitute* "fortran/src/Makefile.in"
808 (("libhdf5_fortran_la_LDFLAGS =")
809 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
810 (assoc-ref outputs "fortran") "/lib")))
811 (substitute* "hl/fortran/src/Makefile.in"
812 (("libhdf5hl_fortran_la_LDFLAGS =")
813 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
814 (assoc-ref outputs "fortran") "/lib")))
816 (add-after 'configure 'patch-settings
818 ;; libhdf5.settings contains the full path of the
819 ;; compilers used, and its contents are included in
820 ;; libhdf5.so. We truncate the hashes to avoid
821 ;; unnecessary store references to those compilers:
822 (substitute* "src/libhdf5.settings"
823 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
824 (string-append prefix (string-take hash 10) "..."))
825 ;; Don't record the build-time kernel version to make the
826 ;; settings file reproducible.
827 (("Uname information:.*")
828 "Uname information: Linux\n"))
830 (add-after 'install 'patch-references
831 (lambda* (#:key inputs outputs #:allow-other-keys)
832 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
833 (zlib (assoc-ref inputs "zlib")))
834 (substitute* (find-files bin "h5p?cc")
836 (string-append "-L" zlib "/lib " lib)))
838 (add-after 'install 'split
839 (lambda* (#:key inputs outputs #:allow-other-keys)
840 ;; Move all fortran-related files
841 (let* ((out (assoc-ref outputs "out"))
842 (bin (string-append out "/bin"))
843 (lib (string-append out "/lib"))
844 (inc (string-append out "/include"))
845 (ex (string-append out "/share/hdf5_examples/fortran"))
846 (fort (assoc-ref outputs "fortran"))
847 (fbin (string-append fort "/bin"))
848 (flib (string-append fort "/lib"))
849 (finc (string-append fort "/include"))
850 (fex (string-append fort "/share/hdf5_examples/fortran")))
855 ;; Note: When built with --enable-parallel, the 'h5fc' file
856 ;; doesn't exist, hence this condition.
857 (when (file-exists? (string-append bin "/h5fc"))
858 (rename-file (string-append bin "/h5fc")
859 (string-append fbin "/h5fc")))
860 (for-each (lambda (file)
862 (string-append flib "/" (basename file))))
863 (find-files lib ".*fortran.*"))
864 (for-each (lambda (file)
866 (string-append finc "/" (basename file))))
867 (find-files inc ".*mod"))
868 (for-each (lambda (file)
870 (string-append fex "/" (basename file))))
871 (find-files ex ".*"))
872 (delete-file-recursively ex))
874 (home-page "http://www.hdfgroup.org")
875 (synopsis "Management suite for extremely large and complex data")
876 (description "HDF5 is a suite that makes possible the management of
877 extremely large and complex data collections.")
878 (license (license:x11-style
879 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
881 (define-public hdf5-1.10
882 (package (inherit hdf5)
887 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
888 "hdf5-" (version-major+minor version)
889 "/hdf5-" version "/src/hdf5-"
891 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
894 (take (string-split version #\.) 2))
895 "/src/hdf5-" version ".tar.bz2")))
897 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
898 (patches (search-patches "hdf5-config-date.patch"
899 "hdf5-mpi-deprecations.patch"))))))
901 (define-public hdf-java
909 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
910 version "/src/CMake-hdfjava-" version ".tar.gz"))
912 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
913 (modules '((guix build utils)))
914 (snippet ; Make sure we don't use the bundled sources and binaries.
916 (for-each delete-file
917 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
918 "HDF4.tar.gz" "HDF5.tar.gz"))
919 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
921 (build-system gnu-build-system)
923 `(("jdk" ,icedtea "jdk")
924 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
926 ("hamcrest-core" ,java-hamcrest-core)
927 ("junit" ,java-junit)
928 ("slf4j-simple" ,java-slf4j-simple)))
934 ("slf4j-api" ,java-slf4j-api)))
937 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
938 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
939 (assoc-ref %build-inputs "jdk") "/lib" )
940 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
941 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
944 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
945 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
946 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
947 (string-append "JPEGLIB="
948 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
952 (modify-phases %standard-phases
953 (add-before 'configure 'chdir-to-source
954 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
955 (add-before 'configure 'patch-build
956 (lambda* (#:key inputs outputs #:allow-other-keys)
957 (substitute* "configure"
958 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
959 (("/bin/cat") (which "cat")))
960 ;; Set classpath for compilation
961 (substitute* '("hdf/hdf5lib/Makefile.in"
962 "hdf/hdf5lib/exceptions/Makefile.in"
963 "hdf/hdflib/Makefile.in")
964 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
965 (string-append (assoc-ref inputs "slf4j-api")
966 "/share/java/slf4j-api.jar")))
967 ;; Replace outdated config.sub and config.guess:
968 (with-directory-excursion "config"
969 (for-each (lambda (file)
971 (string-append (assoc-ref inputs "automake")
973 ,(version-major+minor (package-version automake))
975 '("config.sub" "config.guess")))
977 ;; Fix embedded version number
978 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
979 (substitute* "hdf/hdf5lib/H5.java"
981 (string-join hdf5version ", "))))
983 (mkdir-p (string-append (assoc-ref outputs "out")))
984 ;; Set classpath for tests
985 (let* ((build-dir (getcwd))
986 (lib (string-append build-dir "/lib"))
987 (jhdf (string-append lib "/jhdf.jar"))
988 (jhdf5 (string-append lib "/jhdf5.jar"))
991 (string-append (assoc-ref inputs i)
992 "/share/java/" i ".jar"))
993 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
995 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
997 (substitute* '("test/hdf5lib/Makefile.in"
998 "test/hdf5lib/junit.sh.in"
999 "examples/runExample.sh.in")
1001 (string-append (assoc-ref inputs "coreutils")
1004 (string-append (assoc-ref inputs "coreutils")
1006 (("CLASSPATH=[^\n]*")
1007 (string-append "CLASSPATH=" class-path)))
1008 (setenv "CLASSPATH" class-path))
1010 (add-before 'check 'build-examples
1012 (apply invoke `("javac"
1013 ,@(find-files "examples" ".*\\.java"))))))
1015 #:parallel-build? #f
1017 #:parallel-tests? #f ))
1018 (home-page "https://support.hdfgroup.org/products/java")
1019 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1020 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1021 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1024 ;; BSD-style license:
1025 (license (license:x11-style
1026 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1027 /current/src/unpacked/COPYING"))))
1029 (define-public hdf-eos2
1036 (uri "ftp://edhs1.gsfc.nasa.gov\
1037 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1039 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1040 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1041 "hdf-eos2-build-shared.patch"
1042 "hdf-eos2-fortrantests.patch"))))
1043 (build-system gnu-build-system)
1045 `(("gfortran" ,gfortran)))
1047 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1049 ("libjpeg" ,libjpeg)
1052 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1053 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1054 #:parallel-tests? #f))
1055 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1056 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1057 (description "HDF-EOS2 is a software library built on HDF4 which supports
1058 the construction of data structures used in NASA's Earth Observing
1059 System (Grid, Point and Swath).")
1061 ;; Source files carry a permissive license header.
1062 (license (license:non-copyleft home-page))))
1064 (define-public hdf-eos5
1070 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1071 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1074 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1075 (patches (search-patches "hdf-eos5-build-shared.patch"
1076 "hdf-eos5-remove-gctp.patch"
1077 "hdf-eos5-fix-szip.patch"
1078 "hdf-eos5-fortrantests.patch"))))
1080 `(("gfortran" ,gfortran)))
1081 (build-system gnu-build-system)
1087 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1088 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1089 #:parallel-tests? #f))
1090 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1092 "HDF-EOS5 is a software library built on HDF5 to support the construction
1093 of data structures used in NASA's Earth Observing System (Grid, Point and
1095 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1097 ;; Source files carry a permissive license header.
1098 (license (license:non-copyleft home-page))))
1100 (define-public hdf5-parallel-openmpi
1101 (package (inherit hdf5)
1102 (name "hdf5-parallel-openmpi")
1105 ,@(package-inputs hdf5)))
1107 (substitute-keyword-arguments (package-arguments hdf5)
1108 ((#:configure-flags flags)
1109 ``("--enable-parallel"
1110 ,@(delete "--enable-cxx"
1111 (delete "--enable-threadsafe" ,flags))))
1113 `(modify-phases ,phases
1114 (add-after 'build 'mpi-setup
1116 (add-before 'check 'patch-tests
1118 ;; OpenMPI's mpirun will exit with non-zero status if it
1119 ;; detects an "abnormal termination", i.e. any process not
1120 ;; calling MPI_Finalize(). Since the test is explicitly
1121 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1122 ;; H5C_flush_cache from being called, mpirun will always
1123 ;; complain, so turn this test off.
1124 (substitute* "testpar/Makefile"
1125 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1126 (string-append front back "\n")))
1127 (substitute* "tools/h5diff/testph5diff.sh"
1128 (("/bin/sh") (which "sh")))
1130 (synopsis "Management suite for data with parallel IO support")))
1132 (define-public h5check
1139 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1140 "h5check/src/h5check-" version ".tar.gz"))
1143 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1144 (build-system gnu-build-system)
1145 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1146 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1147 (synopsis "HDF5 format checker")
1148 (description "@code{h5check} is a validation tool for verifying that an
1149 HDF5 file is encoded according to the HDF File Format Specification.")
1150 (license (license:x11-style "file://COPYING"))))
1158 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1163 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1164 (build-system cmake-build-system)
1165 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1166 (inputs `(("lapack" ,lapack)
1168 ;; FIXME: Even though the fonts are available dvips complains:
1169 ;; "Font cmmi10 not found; characters will be left blank."
1171 `(("texlive" ,texlive-tiny)
1172 ("ghostscript" ,ghostscript)
1173 ("doxygen" ,doxygen)))
1174 (home-page "http://itpp.sourceforge.net")
1175 (synopsis "C++ library of maths, signal processing and communication classes")
1176 (description "IT++ is a C++ library of mathematical, signal processing and
1177 communication classes and functions. Its main use is in simulation of
1178 communication systems and for performing research in the area of
1179 communications. The kernel of the library consists of generic vector and
1180 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1181 similar to MATLAB, GNU Octave or SciPy.")
1182 (license license:gpl3+)))
1184 (define-public netcdf
1191 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1192 "netcdf-" version ".tar.gz"))
1195 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1196 (patches (search-patches "netcdf-date-time.patch"
1197 "netcdf-tst_h_par.patch"))))
1198 (build-system gnu-build-system)
1201 ("doxygen" ,doxygen)
1202 ("graphviz" ,graphviz)))
1204 `(("hdf4" ,hdf4-alt)
1207 ("libjpeg" ,libjpeg)))
1209 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1211 #:phases (modify-phases %standard-phases
1212 (add-before 'configure 'fix-source-date
1214 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1215 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1216 ;; to '1st hour of the current day', and therefore makes the
1217 ;; package not reproducible.
1218 (substitute* "./configure"
1219 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1220 "date --date='@0'"))
1222 (add-after 'configure 'patch-settings
1224 ;; libnetcdf.settings contains the full filename of the compilers
1225 ;; used to build the library. We truncate the hashes of those
1226 ;; filenames to avoid unnecessary references to the corresponding
1228 (substitute* "libnetcdf.settings"
1229 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1230 (string-append prefix (string-take hash 10) "...")))
1233 #:parallel-tests? #f)) ;various race conditions
1234 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1235 (synopsis "Library for scientific data")
1236 (description "NetCDF is an interface for scientific data access and a
1237 software library that provides an implementation of the interface. The netCDF
1238 library defines a machine-independent format for representing scientific data.
1239 Together, the interface, library, and format support the creation, access, and
1240 sharing of scientific data.")
1241 (license (license:x11-style "file://COPYRIGHT"))))
1243 (define-public netcdf-parallel-openmpi
1244 (package (inherit netcdf)
1245 (name "netcdf-parallel-openmpi")
1248 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1249 (package-inputs netcdf))))
1250 ;; TODO: Replace pkg-config references in nc-config with absolute references
1252 (substitute-keyword-arguments (package-arguments netcdf)
1253 ((#:configure-flags flags)
1254 `(cons* "CC=mpicc" "CXX=mpicxx"
1255 "--enable-parallel-tests"
1256 ;; Shared libraries not supported with parallel IO.
1257 "--disable-shared" "--with-pic"
1260 (define-public netcdf-fortran
1262 (name "netcdf-fortran")
1267 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1271 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1272 (build-system gnu-build-system)
1274 `(#:parallel-tests? #f))
1276 `(("netcdf" ,netcdf)))
1278 `(("gfortran" ,gfortran)))
1279 (synopsis "Fortran interface for the netCDF library")
1280 (description (package-description netcdf))
1281 (home-page (package-home-page netcdf))
1282 (license (package-license netcdf))))
1284 (define-public nlopt
1290 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1293 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1294 (build-system gnu-build-system)
1296 `(;; Shared libraries are not built by default. They are required to
1297 ;; build the Guile, Octave, and Python bindings.
1298 #:configure-flags '("--enable-shared")
1301 (modify-phases %standard-phases
1302 (add-before 'configure 'set-libnlopt-file-name
1303 (lambda* (#:key outputs #:allow-other-keys)
1304 ;; Make sure the Scheme module refers to the library by its
1305 ;; absolute file name (we cannot do that from a snippet
1306 ;; because the expansion of @libdir@ contains
1308 (let ((out (assoc-ref outputs "out")))
1309 (substitute* "swig/nlopt.scm.in"
1311 (string-append out "/lib/libnlopt")))
1313 (inputs `(("guile" ,guile-2.0)))
1314 (native-inputs `(("pkg-config" ,pkg-config)))
1315 (home-page "http://ab-initio.mit.edu/wiki/")
1316 (synopsis "Library for nonlinear optimization")
1317 (description "NLopt is a library for nonlinear optimization, providing a
1318 common interface for a number of different free optimization routines available
1319 online as well as original implementations of various other algorithms.")
1320 (license license:lgpl2.1+)))
1322 (define-public ipopt
1329 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1333 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1334 (modules '((guix build utils)))
1336 ;; Make sure we don't use the bundled software.
1338 (delete-file-recursively "ThirdParty")
1340 (build-system gnu-build-system)
1342 '(#:phases (modify-phases %standard-phases
1343 (add-after 'install 'add--L-flags-in-ipopt.pc
1344 (lambda* (#:key inputs outputs #:allow-other-keys)
1345 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1346 ;; move it to "Libs.private" where it belongs, and add a
1347 ;; '-L' flag for LAPACK.
1348 (let ((out (assoc-ref outputs "out"))
1349 (lapack (assoc-ref inputs "lapack")))
1350 (substitute* (string-append out "/lib/pkgconfig/"
1352 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1353 (string-append "Libs: " before " " after "\n"
1354 "Libs.private: " before
1355 "-L" lapack "/lib -llapack -lblas "
1359 `(("gfortran" ,gfortran)))
1361 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1362 `(("lapack" ,lapack))) ;for both libblas and liblapack
1363 (home-page "http://www.coin-or.org")
1364 (synopsis "Large-scale nonlinear optimizer")
1366 "The Interior Point Optimizer (IPOPT) is a software package for
1367 large-scale nonlinear optimization. It provides C++, C, and Fortran
1369 (license license:epl1.0)))
1377 (uri (string-append "https://www.coin-or.org/download/source/"
1378 "Clp/Clp-" version ".tgz"))
1381 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1382 (modules '((guix build utils)))
1384 ;; Make sure we don't use the bundled software.
1386 (delete-file-recursively "ThirdParty")
1388 (build-system gnu-build-system)
1390 `(("gfortran" ,gfortran)
1391 ("pkg-config" ,pkg-config)))
1393 `(("openblas" ,openblas)))
1394 (home-page "https://www.coin-or.org")
1395 (synopsis "Linear programming solver")
1397 "CLP is a high quality linear programming solver. Its main strengths are
1398 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1399 linear and quadratic objectives. There are limited facilities for nonlinear
1400 and quadratic objectives using the Simplex algorithm.")
1401 (license license:epl1.0)))
1403 (define-public ceres
1405 (name "ceres-solver")
1407 (home-page "http://ceres-solver.org/")
1410 (uri (string-append home-page "ceres-solver-"
1414 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1415 (build-system cmake-build-system)
1417 ;; TODO: Build HTML user documentation and install separately.
1418 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1419 "-DBUILD_SHARED_LIBS=ON")
1421 #:phases (modify-phases %standard-phases
1422 (add-before 'configure 'set-library-directory
1424 ;; Install libraries to lib/, not lib64/.
1425 (substitute* "internal/ceres/CMakeLists.txt"
1426 (("set\\(LIB_SUFFIX \"64\"\\)")
1427 "set(LIB_SUFFIX \"\")"))
1430 `(("pkg-config" ,pkg-config)))
1432 `(("glog" ,glog))) ;for #include <glog/glog.h>
1437 ("suitesparse" ,suitesparse)
1438 ("gflags" ,gflags)))
1439 (synopsis "C++ library for solving large optimization problems")
1441 "Ceres Solver is a C++ library for modeling and solving large,
1442 complicated optimization problems. It is a feature rich, mature and
1443 performant library which has been used in production since 2010. Ceres Solver
1444 can solve two kinds of problems:
1446 @item non-linear least squares problems with bounds constraints;
1447 @item general unconstrained optimization problems.
1449 (license license:bsd-3)))
1451 ;; For a fully featured Octave, users are strongly recommended also to install
1452 ;; the following packages: less, ghostscript, gnuplot.
1453 (define-public octave-cli
1460 (uri (string-append "mirror://gnu/octave/octave-"
1464 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1465 (build-system gnu-build-system)
1467 `(("alsa-lib" ,alsa-lib)
1468 ("arpack" ,arpack-ng)
1473 ("fontconfig" ,fontconfig)
1474 ("freetype" ,freetype)
1478 ("graphicsmagick" ,graphicsmagick)
1481 ("libsndfile" ,libsndfile)
1485 ("portaudio" ,portaudio)
1487 ("readline" ,readline)
1488 ("suitesparse" ,suitesparse)
1489 ("texinfo" ,texinfo)
1493 ("gfortran" ,gfortran)
1494 ("pkg-config" ,pkg-config)
1496 ;; The following inputs are not actually used in the build process.
1497 ;; However, the ./configure gratuitously tests for their existence and
1498 ;; assumes that programs not present at build time are also not, and
1499 ;; can never be, available at run time! If these inputs are therefore
1500 ;; not present, support for them will be built out. However, Octave
1501 ;; will still run without them, albeit without the features they
1504 ("ghostscript" ,ghostscript)
1505 ("gnuplot" ,gnuplot)))
1506 ;; Octave code uses this variable to detect directories holding multiple CA
1507 ;; certificates to verify peers with. This is required for the networking
1508 ;; functions that require encryption to work properly.
1509 (native-search-paths
1510 (list (search-path-specification
1511 (variable "CURLOPT_CAPATH")
1512 (files '("etc/ssl/certs")))))
1515 (list (string-append "--with-shell="
1516 (assoc-ref %build-inputs "bash")
1519 (modify-phases %standard-phases
1520 (add-after 'configure 'configure-makeinfo
1521 (lambda* (#:key inputs #:allow-other-keys)
1522 (substitute* "libinterp/corefcn/help.h"
1525 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1527 (home-page "https://www.gnu.org/software/octave/")
1528 (synopsis "High-level language for numerical computation")
1529 (description "GNU Octave is a high-level interpreted language that is
1530 specialized for numerical computations. It can be used for both linear and
1531 non-linear applications and it provides great support for visualizing results.
1532 Work may be performed both at the interactive command-line as well as via
1534 (license license:gpl3+)))
1536 (define-public octave
1537 (package (inherit octave-cli)
1540 (inherit (package-source octave-cli))))
1542 `(("qscintilla" ,qscintilla)
1544 ,@(package-inputs octave-cli)))
1546 `(("qttools" , qttools) ;for lrelease
1547 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1548 ,@(package-native-inputs octave-cli)))
1550 (substitute-keyword-arguments (package-arguments octave-cli)
1552 `(modify-phases ,phases
1553 (add-before 'configure 'patch-qscintilla-library-name
1554 (lambda* (#:key inputs #:allow-other-keys)
1555 ;; The QScintilla library that the Octave configure script tries
1556 ;; to link with should be named libqscintilla-qt5.so, but the
1557 ;; QScintilla input provides the shared library as
1558 ;; libqscintilla2_qt5.so.
1559 (substitute* "configure"
1560 (("qscintilla2-qt5")
1564 (define-public qtoctave
1565 (deprecated-package "qtoctave" octave))
1567 (define-public opencascade-oce
1569 (name "opencascade-oce")
1575 (url "https://github.com/tpaviot/oce.git")
1576 (commit (string-append "OCE-" version))))
1577 (file-name (git-file-name name version))
1578 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1580 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1581 (build-system cmake-build-system)
1584 (list "-DOCE_TESTING:BOOL=ON"
1585 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1586 "-DOCE_DRAW:BOOL=ON"
1587 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1588 (assoc-ref %outputs "out"))
1589 "-UCMAKE_INSTALL_RPATH")))
1591 `(("freetype" ,freetype)
1598 `(("python" ,python-wrapper)))
1599 (home-page "https://github.com/tpaviot/oce")
1600 (synopsis "Libraries for 3D modeling and numerical simulation")
1602 "Open CASCADE is a set of libraries for the development of applications
1603 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1604 C++ class libraries providing services for 3D surface and solid modeling, CAD
1605 data exchange, and visualization. It is used for development of specialized
1606 software dealing with 3D models in design (CAD), manufacturing (CAM),
1607 numerical simulation (CAE), measurement equipment (CMM), and quality
1608 control (CAQ) domains.
1610 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1611 patches, improvements, and experiments contributed by users over the official
1612 Open CASCADE library.")
1613 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1614 ; use of header files; see
1615 ; OCCT_LGPL_EXCEPTION.txt
1616 license:public-domain; files
1617 ; src/Standard/Standard_StdAllocator.hxx and
1618 ; src/NCollection/NCollection_StdAllocator.hxx
1619 license:expat; file src/OpenGl/OpenGl_glext.h
1620 license:bsd-3)))); test framework gtest
1622 (define-public opencascade-occt
1624 (name "opencascade-occt")
1630 (url "https://git.dev.opencascade.org/repos/occt.git")
1633 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1635 (file-name (git-file-name name version))
1637 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1638 (modules '((guix build utils)))
1641 ;; Remove files specific to non-free operating systems.
1642 (delete-file-recursively "samples/ios")
1643 (delete-file-recursively "samples/mfc")
1644 (delete-file-recursively "samples/qt/FuncDemo")
1645 (delete-file "genconf.bat")
1646 (delete-file "gendoc.bat")
1647 (delete-file "genproj.bat")
1648 (delete-file "upgrade.bat")
1649 ;; Remove references to deleted files.
1650 (substitute* "dox/FILES_HTML.txt"
1651 ((".*standard.*") "" )
1652 ((".*UIKitSample.*") ""))
1654 (build-system cmake-build-system)
1656 '(;; There is no test target for make. OCCT provides an
1657 ;; 'Automated Testing System', which may be accessed after
1658 ;; installation via the draw.sh script. draw.sh is located in
1659 ;; the bin directory. For details see:
1660 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1661 ;; occt_dev_guides__tests.html
1663 ;; Configure without freeimage: attempting to link against the
1664 ;; freeimage version 3.17 library leads to 'undefined
1665 ;; reference' errors.
1667 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1669 "-DUSE_VTK:BOOL=OFF"
1670 "-DBUILD_DOC_Overview:BOOL=OFF"
1671 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1672 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1673 "-UCMAKE_INSTALL_LIBDIR")))
1675 `(("doxygen" ,doxygen)
1676 ;("freeimage" ,freeimage)
1677 ("freetype" ,freetype)
1679 ("libxext" ,libxext)
1686 ;; TODO: build Overview documentation and add 'doc' output.
1687 (home-page "https://www.opencascade.com")
1688 (synopsis "Libraries for 3D modeling and numerical simulation")
1690 "Open CASCADE is a set of libraries for the development of applications
1691 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1692 C++ class libraries providing services for 3D surface and solid modeling, CAD
1693 data exchange, and visualization. It is used for development of specialized
1694 software dealing with 3D models in design (CAD), manufacturing (CAM),
1695 numerical simulation (CAE), measurement equipment (CMM), and quality
1696 control (CAQ) domains.
1698 This is the certified version of the Open Cascade Technology (OCCT) library.")
1699 (license (list ;; OCCT library:
1700 license:lgpl2.1; with an exception for the use of header
1701 ; files, see OCCT_LGPL_EXCEPTION.txt.
1702 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1703 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1705 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1706 ;; src/StepFile/step.tab.*:
1707 license:gpl3+ ; with Bison 2.2 exception.
1708 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1709 (license:non-copyleft
1710 "https://www.unicode.org/license.html")
1711 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1712 license:public-domain))))
1722 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1724 (string-append "gmsh_"
1725 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1727 (file-name (git-file-name name version))
1729 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1730 (modules '((guix build utils)))
1732 ;; Remove non-free METIS code
1734 (delete-file-recursively "contrib/Metis")
1736 (build-system cmake-build-system)
1739 ("gfortran" ,gfortran)
1745 ("opencascade-oce" ,opencascade-oce)
1747 ("libxext" ,libxext)))
1749 `(("fontconfig" ,fontconfig)
1750 ("libxft" ,libxft)))
1752 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1753 "-DENABLE_BUILD_SHARED:BOOL=ON"
1754 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1755 (home-page "http://gmsh.info/")
1756 (synopsis "3D finite element grid generator")
1757 (description "Gmsh is a 3D finite element grid generator with a built-in
1758 CAD engine and post-processor. Its design goal is to provide a fast, light
1759 and user-friendly meshing tool with parametric input and advanced
1760 visualization capabilities. Gmsh is built around four modules: geometry,
1761 mesh, solver and post-processing. The specification of any input to these
1762 modules is done either interactively using the graphical user interface or in
1763 ASCII text files using Gmsh's own scripting language.")
1764 (license license:gpl2+)))
1766 (define-public maxflow
1773 (url "https://github.com/gerddie/maxflow.git")
1774 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1775 (file-name (string-append name "-" version "-checkout"))
1778 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1779 (build-system cmake-build-system)
1780 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1781 (synopsis "Library implementing Maxflow algorithm")
1782 (description "An implementation of the maxflow algorithm described in
1783 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1784 Energy Minimization in Computer Vision.\n
1785 Yuri Boykov and Vladimir Kolmogorov.\n
1786 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1788 (license license:gpl3+)))
1790 (define-public petsc
1797 ;; The *-lite-* tarball does not contain the *large* documentation
1798 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1799 "petsc-lite-" version ".tar.gz"))
1801 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1802 (outputs '("out" ; libraries and headers
1803 "examples")) ; ~30MiB of examples
1804 (build-system gnu-build-system)
1806 `(("python" ,python-2)))
1808 `(("gfortran" ,gfortran)
1810 ("superlu" ,superlu)
1811 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1812 ;; leaving out opengl, as configuration seems to only be for mac
1815 `(#:test-target "test"
1816 #:parallel-build? #f ; build is parallel by default
1822 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1823 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1824 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1826 (modify-phases %standard-phases
1828 ;; PETSc's configure script is actually a python script, so we can't
1829 ;; run it with bash.
1830 (lambda* (#:key outputs (configure-flags '())
1832 (let* ((prefix (assoc-ref outputs "out"))
1833 (flags `(,(string-append "--prefix=" prefix)
1834 ,@configure-flags)))
1835 (format #t "build directory: ~s~%" (getcwd))
1836 (format #t "configure flags: ~s~%" flags)
1837 (apply invoke "./configure" flags))))
1838 (add-after 'configure 'clean-local-references
1839 (lambda* (#:key outputs #:allow-other-keys)
1840 (let ((out (assoc-ref outputs "out")))
1841 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1842 ;; Prevent build directory from leaking into compiled code
1844 ;; Scrub timestamp for reproducibility
1845 ((".*Libraries compiled on.*") ""))
1846 (substitute* (find-files "." "petscvariables")
1847 ;; Do not expose build machine characteristics, set to defaults.
1848 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1849 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1851 (add-after 'install 'clean-install
1852 ;; Try to keep installed files from leaking build directory names.
1853 (lambda* (#:key inputs outputs #:allow-other-keys)
1854 (let ((out (assoc-ref outputs "out")))
1855 (substitute* (map (lambda (file)
1856 (string-append out "/lib/petsc/conf/" file))
1857 '("petscvariables"))
1859 ;; Make compiler references point to the store
1860 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1861 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1862 (string-append "= " (which compiler))))
1863 ;; PETSc installs some build logs, which aren't necessary.
1864 (for-each (lambda (file)
1865 (let ((f (string-append out "/lib/petsc/conf/" file)))
1866 (when (file-exists? f)
1868 '("configure.log" "make.log" "gmake.log"
1869 "test.log" "error.log" "RDict.db"
1870 "PETScBuildInternal.cmake"
1871 ;; Once installed, should uninstall with Guix
1874 (add-after 'install 'move-examples
1875 (lambda* (#:key outputs #:allow-other-keys)
1876 (let* ((out (assoc-ref outputs "out"))
1877 (examples (assoc-ref outputs "examples"))
1878 (exdir (string-append out "/share/petsc/examples"))
1879 (exdir' (string-append examples "/share/petsc/examples")))
1880 (copy-recursively exdir exdir')
1881 (delete-file-recursively exdir)
1883 (home-page "http://www.mcs.anl.gov/petsc")
1884 (synopsis "Library to solve PDEs")
1885 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1886 data structures and routines for the scalable (parallel) solution of
1887 scientific applications modeled by partial differential equations.")
1888 (license (license:non-copyleft
1889 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1891 (define-public petsc-complex
1892 (package (inherit petsc)
1893 (name "petsc-complex")
1895 (substitute-keyword-arguments (package-arguments petsc)
1896 ((#:configure-flags cf)
1897 `(cons "--with-scalar-type=complex" ,cf))))
1898 (synopsis "Library to solve PDEs (with complex scalars)")))
1900 (define-public petsc-openmpi
1901 (package (inherit petsc)
1902 (name "petsc-openmpi")
1904 `(("hdf5" ,hdf5-parallel-openmpi)
1905 ("hypre" ,hypre-openmpi)
1907 ("mumps" ,mumps-openmpi)
1908 ("openmpi" ,openmpi)
1909 ("scalapack" ,scalapack)
1910 ("scotch" ,pt-scotch32)
1911 ,@(package-inputs petsc)))
1913 (substitute-keyword-arguments (package-arguments petsc)
1914 ((#:configure-flags cf)
1916 "--with-mpiexec=mpirun"
1919 "--with-scalapack=1"
1921 ,(string-append "--with-mpi-dir="
1922 (assoc-ref %build-inputs "openmpi"))
1923 ,(string-append "--with-hdf5-include="
1924 (assoc-ref %build-inputs "hdf5") "/include")
1925 ,(string-append "--with-hdf5-lib="
1926 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1927 ,@(delete "--with-mpi=0" ,cf)))
1929 `(modify-phases ,phases
1930 (add-before 'configure 'mpi-setup
1931 ,%openmpi-setup)))))
1932 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1934 (define-public petsc-complex-openmpi
1935 (package (inherit petsc-complex)
1936 (name "petsc-complex-openmpi")
1938 `(("openmpi" ,openmpi)
1939 ,@(package-inputs petsc-complex)))
1941 (substitute-keyword-arguments (package-arguments petsc-complex)
1942 ((#:configure-flags cf)
1943 ``("--with-mpiexec=mpirun"
1944 ,(string-append "--with-mpi-dir="
1945 (assoc-ref %build-inputs "openmpi"))
1946 ,@(delete "--with-mpi=0" ,cf)))
1948 `(modify-phases ,phases
1949 (add-before 'configure 'mpi-setup
1950 ,%openmpi-setup)))))
1951 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1953 (define-public python-petsc4py
1955 (name "python-petsc4py")
1960 (uri (pypi-uri "petsc4py" version))
1963 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1964 (build-system python-build-system)
1967 (modify-phases %standard-phases
1968 (add-before 'build 'pre-build
1970 ;; Define path to PETSc installation.
1971 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1973 (add-before 'check 'mpi-setup
1976 `(("petsc" ,petsc-openmpi)
1977 ("python-numpy" ,python-numpy)))
1978 (home-page "https://bitbucket.org/petsc/petsc4py/")
1979 (synopsis "Python bindings for PETSc")
1980 (description "PETSc, the Portable, Extensible Toolkit for
1981 Scientific Computation, is a suite of data structures and routines for
1982 the scalable (parallel) solution of scientific applications modeled by
1983 partial differential equations. It employs the MPI standard for all
1984 message-passing communication. @code{petsc4py} provides Python
1985 bindings to almost all functions of PETSc.")
1986 (license license:bsd-3)))
1988 (define-public python-kiwisolver
1990 (name "python-kiwisolver")
1994 (uri (pypi-uri "kiwisolver" version))
1997 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1998 (build-system python-build-system)
1999 (home-page "https://github.com/nucleic/kiwi")
2000 (synopsis "Fast implementation of the Cassowary constraint solver")
2002 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2003 solving algorithm. Kiwi has been designed from the ground up to be
2004 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2005 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2006 savings are consistently > 5x.")
2007 (license license:bsd-3)))
2009 (define-public python2-kiwisolver
2010 (package-with-python2 python-kiwisolver))
2012 (define-public slepc
2019 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2023 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2024 (build-system gnu-build-system)
2026 `(("python" ,python-2)
2027 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2029 `(("arpack" ,arpack-ng)
2030 ("gfortran" ,gfortran)))
2032 `(("petsc" ,petsc)))
2034 `(#:parallel-build? #f ;build is parallel by default
2036 `(,(string-append "--with-arpack-dir="
2037 (assoc-ref %build-inputs "arpack") "/lib"))
2038 #:make-flags ;honor (parallel-job-count)
2039 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2040 ,(string-append "PETSCCONFIGDIR="
2041 (assoc-ref %build-inputs "petsc:examples")
2042 "/share/petsc/examples/config"))
2044 (modify-phases %standard-phases
2046 ;; configure is a python script, so we can't run it with bash.
2047 (lambda* (#:key inputs outputs (configure-flags '())
2049 (let* ((prefix (assoc-ref outputs "out"))
2050 (flags `(,(string-append "--prefix=" prefix)
2051 ,@configure-flags)))
2052 (format #t "build directory: ~s~%" (getcwd))
2053 (format #t "configure flags: ~s~%" flags)
2054 (setenv "SLEPC_DIR" (getcwd))
2055 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2056 (apply invoke "./configure" flags))))
2057 (add-after 'install 'delete-doc
2058 ;; TODO: SLEPc installs HTML documentation alongside headers in
2059 ;; $out/include. We'd like to move them to share/doc, but delete
2060 ;; them for now, as they are incomplete and installing the complete
2061 ;; documentation is difficult.
2062 (lambda* (#:key outputs #:allow-other-keys)
2063 (let* ((out (assoc-ref outputs "out")))
2064 (for-each delete-file (find-files out "\\.html$"))
2066 (add-after 'install 'clean-install
2067 ;; Clean up unnecessary build logs from installation.
2068 (lambda* (#:key outputs #:allow-other-keys)
2069 (let ((out (assoc-ref outputs "out")))
2070 (for-each (lambda (file)
2071 (let ((f (string-append out "/lib/slepc/conf/" file)))
2072 (when (file-exists? f)
2074 '("configure.log" "make.log" "gmake.log"
2075 "test.log" "error.log" "RDict.db"
2078 (home-page "http://slepc.upv.es")
2079 (synopsis "Scalable library for eigenproblems")
2080 (description "SLEPc is a software library for the solution of large sparse
2081 eigenproblems on parallel computers. It can be used for the solution of
2082 linear eigenvalue problems formulated in either standard or generalized form,
2083 as well as other related problems such as the singular value decomposition.
2084 The emphasis of the software is on methods and techniques appropriate for
2085 problems in which the associated matrices are sparse, for example, those
2086 arising after the discretization of partial differential equations.")
2087 (license license:bsd-2)))
2089 (define-public slepc-complex
2090 (package (inherit slepc)
2091 (name "slepc-complex")
2093 `(("petsc" ,petsc-complex)
2094 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2095 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2097 (define-public slepc-openmpi
2098 (package (inherit slepc)
2099 (name "slepc-openmpi")
2101 (substitute-keyword-arguments (package-arguments slepc)
2102 ((#:phases phases '%standard-phases)
2103 `(modify-phases ,phases
2104 (add-before 'check 'mpi-setup
2105 ,%openmpi-setup)))))
2108 ("arpack" ,arpack-ng-openmpi)
2109 ,@(alist-delete "arpack" (package-inputs slepc))))
2111 `(("petsc" ,petsc-openmpi)
2112 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2113 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2115 (define-public slepc-complex-openmpi
2116 (package (inherit slepc-openmpi)
2117 (name "slepc-complex-openmpi")
2119 `(("petsc" ,petsc-complex-openmpi)
2120 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2121 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2123 (define-public python-slepc4py
2125 (name "python-slepc4py")
2130 (uri (pypi-uri "slepc4py" version))
2133 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2134 (build-system python-build-system)
2137 (modify-phases %standard-phases
2138 (add-before 'build 'pre-build
2140 ;; Define path to PETSc installation.
2141 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2142 ;; Define path to SLEPc installation.
2143 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2145 (add-before 'check 'mpi-setup
2148 `(("python-numpy" ,python-numpy)
2149 ("python-petsc4py" ,python-petsc4py)
2150 ("slepc" ,slepc-openmpi)))
2151 (home-page "https://bitbucket.org/slepc/slepc4py/")
2152 (synopsis "Python bindings for SLEPc")
2153 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2154 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2155 Scientific Computation. It employs the MPI standard for all
2156 message-passing communication. @code{slepc4py} provides Python
2157 bindings to almost all functions of SLEPc.")
2158 (license license:bsd-3)))
2160 (define-public mumps
2167 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2171 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2172 (patches (search-patches "mumps-build-parallelism.patch"))))
2173 (build-system gnu-build-system)
2175 `(("fortran" ,gfortran)
2176 ;; These are required for linking against mumps, but we let the user
2177 ;; declare the dependency.
2180 ("scotch" ,scotch)))
2182 `(#:modules ((ice-9 match)
2185 ,@%gnu-build-system-modules)
2187 (modify-phases %standard-phases
2189 (lambda* (#:key inputs #:allow-other-keys)
2190 (call-with-output-file "Makefile.inc"
2201 INCSEQ = -I$(topdir)/libseq
2202 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2203 LIBSEQNEEDED = libseqneeded~;
2207 AR = ar vr # rules require trailing space, ugh...
2209 LIBBLAS = -L~a -lopenblas~@[
2210 SCALAP = -L~a -lscalapack~]
2211 LIBOTHERS = -pthread
2214 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2218 LIBS = $(SCALAP) $(LIBSEQ)
2219 LPORDDIR = $(topdir)/PORD/lib
2220 IPORD = -I$(topdir)/PORD/include
2221 LPORD = -L$(LPORDDIR) -lpord
2222 ORDERINGSF = -Dpord~@[
2224 IMETIS = -I$(METISDIR)/include
2225 LMETIS = -L$(METISDIR)/lib -lmetis
2226 ORDERINGSF += -Dmetis~]~@[~:{
2228 ISCOTCH = -I$(SCOTCHDIR)/include
2229 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2230 ORDERINGSF += ~a~}~]
2231 ORDERINGSC = $(ORDERINGSF)
2232 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2233 IORDERINGSF = $(ISCOTCH)
2234 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2235 (assoc-ref inputs "mpi")
2236 (assoc-ref inputs "blas")
2237 (assoc-ref inputs "scalapack")
2238 (assoc-ref inputs "metis")
2239 (match (list (assoc-ref inputs "pt-scotch")
2240 (assoc-ref inputs "scotch"))
2244 `((,scotch "" "-Dscotch")))
2247 "-lptesmumps -lptscotch -lptscotcherr "
2248 "-Dptscotch")))))))))
2250 ;; By default only the d-precision library is built. Make with "all"
2251 ;; target so that all precision libraries and examples are built.
2253 (invoke "make" "all"
2254 (format #f "-j~a" (parallel-job-count)))))
2256 ;; Run the simple test drivers, which read test input from stdin:
2257 ;; from the "real" input for the single- and double-precision
2258 ;; testers, and from the "cmplx" input for complex-precision
2259 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2260 ;; package to prefix execution with "mpirun".
2261 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2262 (with-directory-excursion "examples"
2265 (let ((tester (apply open-pipe*
2268 ,(string-append "./" prec
2270 (input (open-input-file
2271 (string-append "input_simpletest_" type))))
2273 (dump-port input tester)
2275 (zero? (close-pipe tester)))))
2277 '("real" "real" "cmplx" "cmplx")))))
2279 (lambda* (#:key outputs #:allow-other-keys)
2280 (let* ((out (assoc-ref outputs "out"))
2281 (libdir (string-append out "/lib")))
2282 (copy-recursively "lib" libdir)
2283 (copy-recursively "include" (string-append out "/include"))
2284 (when (file-exists? "libseq/libmpiseq.a")
2285 (install-file "libseq/libmpiseq.a" libdir))
2287 (home-page "http://mumps.enseeiht.fr")
2288 (synopsis "Multifrontal sparse direct solver")
2290 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2291 sparse system of linear equations A x = b using Gaussian elimination.")
2292 (license license:cecill-c)))
2294 (define-public mumps-metis
2295 (package (inherit mumps)
2296 (name "mumps-metis")
2298 (alist-delete "scotch" (package-inputs mumps)))))
2300 (define-public mumps-openmpi
2301 (package (inherit mumps)
2302 (name "mumps-openmpi")
2305 ("scalapack" ,scalapack)
2306 ("pt-scotch" ,pt-scotch)
2307 ,@(alist-delete "scotch" (package-inputs mumps))))
2309 (substitute-keyword-arguments (package-arguments mumps)
2311 `(modify-phases ,phases
2312 (add-before 'check 'mpi-setup
2316 ((assoc-ref ,phases 'check)
2317 #:exec-prefix '("mpirun" "-n" "2"))))))))
2318 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2320 (define-public mumps-metis-openmpi
2321 (package (inherit mumps-openmpi)
2322 (name "mumps-metis-openmpi")
2324 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2326 (define-public r-quadprog
2333 (uri (cran-uri "quadprog" version))
2336 "0vg7i9p241bwvfdspjbydjrsvgipl6nsb8bjigp0hbbgvxbixx0s"))))
2337 (build-system r-build-system)
2339 `(("gfortran" ,gfortran)))
2340 (home-page "https://cran.r-project.org/web/packages/quadprog")
2341 (synopsis "Functions to solve quadratic programming problems")
2343 "This package contains routines and documentation for solving quadratic
2344 programming problems.")
2345 (license license:gpl3+)))
2347 (define-public r-pracma
2353 (uri (cran-uri "pracma" version))
2355 (base32 "0isd3s0i4mzmva8lkh0j76hwjy1w50q7d1n9lhxsnnkgalx3xs1g"))))
2356 (build-system r-build-system)
2357 (home-page "https://cran.r-project.org/web/packages/pracma/")
2358 (synopsis "Practical numerical math functions")
2359 (description "This package provides functions for numerical analysis and
2360 linear algebra, numerical optimization, differential equations, plus some
2361 special functions. It uses Matlab function names where appropriate to simplify
2363 (license license:gpl3+)))
2365 (define-public ruby-asciimath
2367 (name "ruby-asciimath")
2372 (uri (rubygems-uri "asciimath" version))
2375 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2376 (build-system ruby-build-system)
2379 (modify-phases %standard-phases
2381 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2382 (add-after 'unpack 'patch-remove-spurious-backslashes
2384 (substitute* "spec/parser_spec.rb"
2389 `(("bundler" ,bundler)
2390 ("ruby-rspec" ,ruby-rspec)))
2391 (synopsis "AsciiMath parsing and conversion library")
2393 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2394 easy-to-write markup language for mathematics.")
2395 (home-page "https://github.com/asciidoctor/asciimath")
2396 (license license:expat)))
2398 (define-public superlu
2405 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2406 "superlu_" version ".tar.gz"))
2408 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2409 (modules '((guix build utils)))
2411 ;; Replace the non-free implementation of MC64 with a stub adapted
2414 (use-modules (ice-9 regex)
2416 (call-with-output-file "SRC/mc64ad.c"
2421 void mc64id_(int *a) {
2422 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2425 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2426 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2427 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2430 ;; Remove the corresponding license verbiage. MC64 license follows
2431 ;; a "------" line separator.
2432 (with-atomic-file-replacement "License.txt"
2433 (let ((rx (make-regexp "-{8}")))
2436 (let ((line (read-line in 'concat)))
2437 (unless (regexp-exec rx line)
2441 (build-system cmake-build-system)
2445 `(("blas" ,openblas)
2446 ("gfortran" ,gfortran)))
2448 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2449 "-DTPL_BLAS_LIBRARIES=openblas"
2450 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2451 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2452 (synopsis "Supernodal direct solver for sparse linear systems")
2454 "SuperLU is a general purpose library for the direct solution of large,
2455 sparse, nonsymmetric systems of linear equations on high performance machines.
2456 The library is written in C and is callable from either C or Fortran. The
2457 library routines perform an LU decomposition with partial pivoting and
2458 triangular system solves through forward and back substitution. The library
2459 also provides threshold-based ILU factorization preconditioners.")
2460 (license (list license:bsd-3
2461 license:gpl2+ ;EXAMPLE/*fgmr.c
2462 (license:fsf-free "file://SRC/colamd.h")))))
2464 (define-public superlu-dist
2466 (name "superlu-dist")
2471 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2472 "superlu_dist_" version ".tar.gz"))
2474 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2475 (modules '((guix build utils)))
2477 ;; Replace the non-free implementation of MC64 with a stub
2479 (call-with-output-file "SRC/mc64ad_dist.c"
2484 void mc64id_dist(int *a) {
2485 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2488 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2489 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2490 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2493 (substitute* "SRC/util.c" ;adjust default algorithm
2494 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2495 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2496 ;; general (i.e. non-square) processor-grid support.
2497 "RowPerm = NOROWPERM;"))
2499 (patches (search-patches "superlu-dist-scotchmetis.patch"
2500 "superlu-dist-awpm-grid.patch"
2501 "superlu-dist-fix-mpi-deprecations.patch"))))
2502 (build-system cmake-build-system)
2506 `(("gfortran" ,gfortran)
2509 ("combblas" ,combinatorial-blas)))
2511 `(("mpi" ,openmpi) ;headers include MPI heades
2512 ("parmetis" ,pt-scotch32 "metis")
2513 ("pt-scotch" ,pt-scotch32)))
2515 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2516 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2517 "-DTPL_ENABLE_COMBBLASLIB=YES"
2518 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2519 "-DTPL_LAPACK_LIBRARIES=-llapack"
2520 (string-append "-DTPL_PARMETIS_LIBRARIES="
2522 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2523 "scotchmetis" "scotch" "scotcherr")
2525 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2526 (assoc-ref %build-inputs "parmetis")
2528 "-DTPL_ENABLE_COMBBLASLIB=ON"
2529 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2530 (assoc-ref %build-inputs "combblas")
2531 "/include/CombBLAS;"
2532 (assoc-ref %build-inputs "combblas")
2533 "/include/BipartiteMatchings")
2534 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2536 (modify-phases %standard-phases
2537 (add-before 'configure 'set-c++-standard
2539 (substitute* "CMakeLists.txt"
2540 ;; AWPM headers require C++14
2541 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2542 (add-before 'check 'mpi-setup
2544 (add-before 'check 'omp-setup
2545 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2546 (home-page (package-home-page superlu))
2547 (synopsis "Parallel supernodal direct solver")
2549 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2550 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2551 implemented in ANSI C, and MPI for communications.")
2552 (license license:bsd-3)))
2554 (define-public scotch
2561 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2562 "latestfile/298/scotch_" version ".tar.gz"))
2564 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2565 (patches (search-patches "scotch-build-parallelism.patch"
2566 "scotch-integer-declarations.patch"))))
2567 (build-system gnu-build-system)
2572 (outputs '("out" "metis"))
2574 `(#:make-flags (list (string-append "prefix=" %output))
2576 (modify-phases %standard-phases
2578 'unpack 'chdir-to-src
2579 (lambda _ (chdir "src") #t))
2583 (call-with-output-file "Makefile.inc"
2597 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2598 LDFLAGS = -lz -lm -lrt -lpthread
2600 LEX = flex -Pscotchyy -olex.yy.c
2605 YACC = bison -pscotchyy -y -b y
2607 '("COMMON_FILE_COMPRESS_GZ"
2609 "COMMON_RANDOM_FIXED_SEED"
2610 "INTSIZE64" ;use 'int64_t'
2611 ;; Prevents symbolc clashes with libesmumps
2613 ;; XXX: Causes invalid frees in superlu-dist tests
2615 ;; "SCOTCH_PTHREAD_NUMBER=2"
2616 "restrict=__restrict"))))
2618 (add-after 'build 'build-esmumps
2621 (format #f "-j~a" (parallel-job-count))
2623 (add-before 'install 'make-install-dirs
2624 (lambda* (#:key outputs #:allow-other-keys)
2625 (mkdir (assoc-ref outputs "out"))))
2626 (add-after 'install 'install-metis
2627 (lambda* (#:key outputs #:allow-other-keys)
2628 (let ((out (assoc-ref outputs "metis")))
2630 ;; metis files are not installed with 'make install'
2631 (for-each (lambda (f)
2632 (install-file f (string-append out "/include")))
2633 (find-files "../include/" ".*metis\\.h"))
2634 (for-each (lambda (f)
2635 (install-file f (string-append out "/lib")))
2636 (find-files "../lib/" ".*metis\\..*"))
2638 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2639 (synopsis "Programs and libraries for graph algorithms")
2640 (description "SCOTCH is a set of programs and libraries which implement
2641 the static mapping and sparse matrix reordering algorithms developed within
2642 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2643 conquer approach, to scientific computing problems such as graph and mesh
2644 partitioning, static mapping, and sparse matrix ordering, in application
2645 domains ranging from structural mechanics to operating systems or
2647 ;; See LICENSE_en.txt
2648 (license license:cecill-c)))
2650 (define-public scotch32
2651 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2652 ;; some applications.
2653 (package (inherit scotch)
2656 (substitute-keyword-arguments (package-arguments scotch)
2657 ((#:phases scotch-phases)
2658 `(modify-phases ,scotch-phases
2662 (call-with-output-file "Makefile.inc"
2676 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2677 LDFLAGS = -lz -lm -lrt -lpthread
2679 LEX = flex -Pscotchyy -olex.yy.c
2684 YACC = bison -pscotchyy -y -b y
2686 '("COMMON_FILE_COMPRESS_GZ"
2688 "COMMON_RANDOM_FIXED_SEED"
2689 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2690 ;; Prevents symbolc clashes with libesmumps
2692 ;; XXX: Causes invalid frees in superlu-dist tests
2694 ;; "SCOTCH_PTHREAD_NUMBER=2"
2695 "restrict=__restrict"))))))))))
2697 "Programs and libraries for graph algorithms (32-bit integers)")))
2699 (define-public pt-scotch
2700 (package (inherit scotch)
2703 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2705 (substitute-keyword-arguments (package-arguments scotch)
2706 ((#:phases scotch-phases)
2707 `(modify-phases ,scotch-phases
2711 (invoke "make" (format #f "-j~a" (parallel-job-count))
2712 "ptscotch" "ptesmumps")
2714 ;; Install the serial metis compatibility library
2715 (invoke "make" "-C" "libscotchmetis" "install")))
2716 (add-before 'check 'mpi-setup
2720 (invoke "make" "ptcheck")))))))
2721 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2723 (define-public pt-scotch32
2724 (package (inherit scotch32)
2725 (name "pt-scotch32")
2727 `(("openmpi" ,openmpi))) ;headers include MPI headers
2729 (substitute-keyword-arguments (package-arguments scotch32)
2730 ((#:phases scotch32-phases)
2731 `(modify-phases ,scotch32-phases
2734 (invoke "make" (format #f "-j~a" (parallel-job-count))
2735 "ptscotch" "ptesmumps")
2736 ;; Install the serial metis compatibility library
2737 (invoke "make" "-C" "libscotchmetis" "install")))
2738 (add-before 'check 'mpi-setup
2742 (invoke "make" "ptcheck")))))))
2744 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2746 (define-public metis
2753 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2754 "metis-" version ".tar.gz"))
2757 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2758 (build-system cmake-build-system)
2760 `(("blas" ,openblas)))
2762 `(#:tests? #f ;no tests
2763 #:configure-flags `("-DSHARED=ON"
2764 ,(string-append "-DGKLIB_PATH=" (getcwd)
2765 "/metis-" ,version "/GKlib"))))
2766 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2767 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2769 "METIS is a set of serial programs for partitioning graphs, partitioning
2770 finite element meshes, and producing fill-reducing orderings for sparse
2771 matrices. The algorithms implemented in METIS are based on the multilevel
2772 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2774 (license license:asl2.0))) ;As of version 5.0.3
2776 (define-public p4est
2783 (uri (string-append "http://p4est.github.io/release/p4est-"
2787 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2788 (build-system gnu-build-system)
2790 `(("fortran" ,gfortran)
2795 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2796 (assoc-ref %build-inputs "blas")
2798 ,(string-append "LAPACK_LIBS=-L"
2799 (assoc-ref %build-inputs "lapack")
2801 #:phases (modify-phases %standard-phases
2802 (add-before 'check 'mpi-setup
2804 (home-page "http://www.p4est.org")
2805 (synopsis "Adaptive mesh refinement on forests of octrees")
2807 "The p4est software library enables the dynamic management of a
2808 collection of adaptive octrees, conveniently called a forest of octrees.
2809 p4est is designed to work in parallel and scales to hundreds of thousands of
2811 (license license:gpl2+)))
2813 (define-public p4est-openmpi
2814 (package (inherit p4est)
2815 (name "p4est-openmpi")
2818 ,@(package-inputs p4est)))
2820 (substitute-keyword-arguments (package-arguments p4est)
2821 ((#:configure-flags cf)
2822 ``("--enable-mpi" ,@,cf))))
2823 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2825 (define-public gsegrafix
2832 (uri (string-append "mirror://gnu/" name "/" name "-"
2836 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2837 (build-system gnu-build-system)
2839 `(#:configure-flags '("LDFLAGS=-lm")))
2841 `(("libgnomecanvas" ,libgnomecanvas)
2842 ("libbonoboui" ,libbonoboui)
2843 ("libgnomeui" ,libgnomeui)
2844 ("libgnomeprintui" ,libgnomeprintui)
2847 `(("pkg-config" ,pkg-config)))
2848 (home-page "https://www.gnu.org/software/gsegrafix/")
2849 (synopsis "GNOME application to create scientific and engineering plots")
2850 (description "GSEGrafix is an application which produces high-quality graphical
2851 plots for science and engineering. Plots are specified via simple ASCII
2852 parameter files and data files and are presented in an anti-aliased GNOME
2853 canvas. The program supports rectangular two-dimensional plots, histograms,
2854 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2855 to BMP, JPEG or PNG image formats.")
2856 (license license:gpl3+)))
2858 (define-public maxima
2865 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2866 version "-source/" name "-" version ".tar.gz"))
2869 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2870 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2871 (build-system gnu-build-system)
2874 ("gnuplot" ,gnuplot) ;for plots
2876 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2878 `(("texinfo" ,texinfo)
2880 ("python" ,python)))
2883 (list "--enable-gcl"
2884 (string-append "--with-posix-shell="
2885 (assoc-ref %build-inputs "bash")
2887 (string-append "--with-wish="
2888 (assoc-ref %build-inputs "tk")
2890 (let ((v ,(package-version tk)))
2891 (string-take v (string-index-right v #\.)))))
2892 ;; By default Maxima attempts to write temporary files to
2893 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2894 ;; Work around that.
2895 #:make-flags (list "TMPDIR=/tmp")
2897 (modify-phases %standard-phases
2898 (add-after 'unpack 'patch-paths
2899 (lambda* (#:key inputs #:allow-other-keys)
2900 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2901 (coreutils (assoc-ref inputs "coreutils"))
2902 (dirname (string-append coreutils "/bin/dirname"))
2903 (head (string-append coreutils "/bin/head"))
2904 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2905 (python (string-append (assoc-ref inputs "python")
2907 (substitute* "src/maxima.in"
2908 (("sed ") (string-append sed " "))
2909 (("dirname") dirname)
2911 (substitute* "doc/info/Makefile.in"
2912 (("/usr/bin/env perl") perl))
2913 (substitute* "doc/info/build_html.sh.in"
2914 (("python") python))
2916 (add-before 'check 'pre-check
2918 (chmod "src/maxima" #o555)
2922 ;; This is derived from the testing code in the "debian/rules" file
2923 ;; of Debian's Maxima package.
2924 ;; If Maxima can successfully run this, the binary to be installed
2930 "--batch-string=\"run_testsuite();\" "
2931 "| grep -q \"No unexpected errors found\""))))
2932 ;; Make sure the doc and emacs files are found in the
2933 ;; standard location. Also configure maxima to find gnuplot
2934 ;; without having it on the PATH.
2935 (add-after 'install 'post-install
2936 (lambda* (#:key outputs inputs #:allow-other-keys)
2937 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2938 (out (assoc-ref outputs "out"))
2939 (datadir (string-append out "/share/maxima/" ,version))
2940 (binutils (string-append (assoc-ref inputs "binutils")
2942 (with-directory-excursion out
2943 (mkdir-p "share/emacs")
2944 (mkdir-p "share/doc")
2946 (string-append datadir "/doc/")
2947 (string-append out "/share/doc/maxima"))
2948 (with-atomic-file-replacement
2949 (string-append datadir "/share/maxima-init.lisp")
2951 (format out "~a ~s~a~%"
2952 "(setf $gnuplot_command "
2953 (string-append gnuplot "/bin/gnuplot") ")")
2954 (dump-port in out))))
2955 ;; Ensure that Maxima will have access to the GNU binutils
2956 ;; components at runtime.
2957 (wrap-program (string-append out "/bin/maxima")
2958 `("PATH" prefix (,binutils))))
2960 (home-page "http://maxima.sourceforge.net")
2961 (synopsis "Numeric and symbolic expression manipulation")
2962 (description "Maxima is a system for the manipulation of symbolic and
2963 numerical expressions. It yields high precision numeric results by using
2964 exact fractions, arbitrary precision integers, and variable precision floating
2966 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2967 ;; Others simply say "GNU General Public License" without stating a
2968 ;; version (which implicitly means gpl1+).
2969 ;; At least one file (src/maxima.asd) says "version 2."
2970 ;; GPLv2 only is therefore the smallest subset.
2971 (license license:gpl2)))
2973 (define-public wxmaxima
2981 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2982 (commit (string-append "Version-" version))))
2983 (file-name (git-file-name name version))
2985 (base32 "195j6j8z0jd6xg3a63ywbrbsc6dany795m3fb95nbx1vq0bqqvvn"))))
2986 (build-system cmake-build-system)
2988 `(("gettext" ,gettext-minimal)))
2990 `(("wxwidgets" ,wxwidgets)
2993 ("adwaita-icon-theme" ,adwaita-icon-theme)
2995 ("shared-mime-info" ,shared-mime-info)))
2997 `(#:tests? #f ; no check target
2999 (modify-phases %standard-phases
3000 (add-after 'install 'wrap-program
3001 (lambda* (#:key inputs outputs #:allow-other-keys)
3002 (wrap-program (string-append (assoc-ref outputs "out")
3005 (,(string-append (assoc-ref inputs "maxima")
3007 ;; For GtkFileChooserDialog.
3008 `("GSETTINGS_SCHEMA_DIR" =
3009 (,(string-append (assoc-ref inputs "gtk+")
3010 "/share/glib-2.0/schemas")))
3011 `("XDG_DATA_DIRS" ":" prefix
3012 (;; Needed by gdk-pixbuf to know supported icon formats.
3014 (assoc-ref inputs "shared-mime-info") "/share")
3015 ;; The default icon theme of GTK+.
3017 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3019 (home-page "https://andrejv.github.io/wxmaxima/")
3020 (synopsis "Graphical user interface for the Maxima computer algebra system")
3022 "wxMaxima is a graphical user interface for the Maxima computer algebra
3023 system. It eases the use of Maxima by making most of its commands available
3024 through a menu system and by providing input dialogs for commands that require
3025 more than one argument. It also implements its own display engine that
3026 outputs mathematical symbols directly instead of depicting them with ASCII
3029 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3030 text and mathematical calculations to create documents, exporting of input and
3031 output to TeX, and a browser for Maxima's manual including command index and
3032 full text searching.")
3033 (license license:gpl2+)))
3035 (define-public armadillo
3041 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3045 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3046 (build-system cmake-build-system)
3047 (arguments `(#:tests? #f)) ; no test target
3049 `(("openblas" ,openblas)
3051 ("arpack" ,arpack-ng)))
3052 (home-page "http://arma.sourceforge.net/")
3053 (synopsis "C++ linear algebra library")
3055 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3056 between speed and ease of use. It is useful for algorithm development
3057 directly in C++, or quick conversion of research code into production
3058 environments. It can be used for machine learning, pattern recognition,
3059 signal processing, bioinformatics, statistics, econometrics, etc. The library
3060 provides efficient classes for vectors, matrices and cubes, as well as 150+
3061 associated functions (eg. contiguous and non-contiguous submatrix views).")
3062 (license license:asl2.0)))
3064 (define-public muparser
3065 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3066 ;; different hash. In order to make `guix package --upgrade` work correctly,
3067 ;; we set a Guix packaging revision.
3068 ;; When the next version of muparser is released, we can remove
3069 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3070 (let ((upstream-version "2.2.5")
3074 (version (string-append upstream-version "-" revision))
3079 (url "https://github.com/beltoforion/muparser.git")
3080 (commit (string-append "v" upstream-version))))
3081 (file-name (git-file-name name version))
3083 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3084 (build-system gnu-build-system)
3086 `(#:configure-flags '("--enable-samples=no")
3087 #:tests? #f)) ;no "check" target
3088 (home-page "http://muparser.beltoforion.de/")
3089 (synopsis "Fast parser library for mathematical expressions")
3091 "muParser is an extensible high performance math parser library. It is
3092 based on transforming an expression into a bytecode and precalculating constant
3094 (license license:expat))))
3096 (define-public openblas
3098 ;; TODO: Incorporate 'openblas/fixed-num-threads' changes on the next
3100 (replacement openblas/fixed-num-threads)
3107 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3108 version "%20version.tar.gz"))
3109 (file-name (string-append name "-" version ".tar.gz"))
3112 "062kg4ny1ywz7k5grpb4pbf0hba0w6manbajwkmv4f477a31sxpl"))))
3113 (build-system gnu-build-system)
3115 `(#:test-target "test"
3116 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3117 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3118 ;; we need to disable substitutions.
3120 ,(let ((system (or (%current-target-system) (%current-system))))
3121 (or (string-prefix? "x86_64" system)
3122 (string-prefix? "i686" system)
3123 (string-prefix? "mips" system)
3124 (string-prefix? "aarch64" system)))
3126 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3128 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3129 ;; Build the library for all supported CPUs. This allows
3130 ;; switching CPU targets at runtime with the environment variable
3131 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3132 ;; Unfortunately, this is not supported on non-x86 architectures,
3133 ;; where it leads to failed builds.
3134 ,@(let ((system (or (%current-target-system) (%current-system))))
3136 ((or (string-prefix? "x86_64" system)
3137 (string-prefix? "i686" system))
3138 '("DYNAMIC_ARCH=1"))
3139 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3140 ;; two available MIPS targets special extended instructions
3141 ;; for Loongson cores are used.
3142 ((string-prefix? "mips" system)
3143 '("TARGET=SICORTEX"))
3144 ;; On aarch64 force the generic 'armv8-a' target
3145 ((string-prefix? "aarch64" system)
3148 ;; no configure script
3150 (modify-phases %standard-phases
3152 (add-before 'build 'set-extralib
3153 (lambda* (#:key inputs #:allow-other-keys)
3154 ;; Get libgfortran found when building in utest.
3156 (string-append "-L" (assoc-ref inputs "fortran-lib")
3160 `(("fortran-lib" ,gfortran "lib")))
3163 ("fortran" ,gfortran)
3165 (home-page "http://www.openblas.net/")
3166 (synopsis "Optimized BLAS library based on GotoBLAS")
3168 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3169 (license license:bsd-3)))
3171 (define-public openblas-ilp64
3172 (package/inherit openblas
3173 (name "openblas-ilp64")
3174 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3176 (substitute-keyword-arguments (package-arguments openblas)
3177 ((#:make-flags flags '())
3178 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3180 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3181 (license license:bsd-3)))
3183 (define openblas/fixed-num-threads
3184 ;; TODO: Move that to 'openblas' proper on the next rebuild cycle.
3187 (version (match (string-split (package-version openblas) #\.)
3188 ((numbers ... (= string-length len))
3189 (string-join (append numbers
3190 (list (make-string len #\a)))
3193 (substitute-keyword-arguments (package-arguments openblas)
3194 ((#:make-flags flags ''())
3195 ;; This is the maximum number of threads OpenBLAS will ever use (that
3196 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3197 ;; is used.) If we don't set it, the makefile sets it to the number
3198 ;; of cores of the build machine, which is obviously wrong.
3199 `(cons "NUM_THREADS=128" ,flags))))))
3201 (define* (make-blis implementation #:optional substitutable?)
3202 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3203 source tree for a list of implementations.)
3205 SUBSTITUTABLE? determines whether the package is made available as a
3208 Currently the specialization must be selected at configure-time, but work is
3209 underway to allow BLIS to select the right optimized kernels at run time:
3210 <https://github.com/flame/blis/issues/129>."
3212 (name (if (string=? implementation "reference")
3214 (string-append "blis-" implementation)))
3216 (home-page "https://github.com/flame/blis")
3219 (uri (git-reference (url home-page) (commit version)))
3222 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3223 (file-name (git-file-name "blis" version))))
3224 (build-system gnu-build-system)
3226 `(#:test-target "test"
3228 #:substitutable? ,substitutable?
3230 #:phases (modify-phases %standard-phases
3232 (lambda* (#:key outputs #:allow-other-keys)
3233 ;; This is a home-made 'configure' script.
3234 (let ((out (assoc-ref outputs "out")))
3235 (invoke "./configure" "-p" out
3239 "--enable-threading=openmp"
3242 (add-before 'check 'show-test-output
3244 ;; By default "make check" is silent. Make it verbose.
3245 (system "tail -F output.testsuite &")
3247 (synopsis "High-performance basic linear algebra (BLAS) routines")
3249 "BLIS is a portable software framework for instantiating high-performance
3250 BLAS-like dense linear algebra libraries. The framework was designed to
3251 isolate essential kernels of computation that, when optimized, immediately
3252 enable optimized implementations of most of its commonly used and
3253 computationally intensive operations. While BLIS exports a new BLAS-like API,
3254 it also includes a BLAS compatibility layer which gives application developers
3255 access to BLIS implementations via traditional BLAS routine calls.")
3256 (license license:bsd-3)))
3259 ;; This is the "reference" implementation, which is the non-optimized but
3260 ;; portable variant (no assembly).
3261 (make-blis "reference" #t))
3263 (define ignorance blis)
3265 (define-syntax-rule (blis/x86_64 processor)
3266 "Expand to a package specialized for PROCESSOR."
3268 (inherit (make-blis processor))
3269 (supported-systems '("x86_64-linux"))))
3271 (define-public blis-sandybridge
3272 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3273 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3274 (blis/x86_64 "sandybridge"))
3276 (define-public blis-haswell
3277 ;; BLIS specialized for Haswell processors (launched 2013):
3278 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3279 (blis/x86_64 "haswell"))
3281 (define-public blis-knl
3282 ;; BLIS specialized for Knights Landing processor (launched 2016):
3283 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3284 (blis/x86_64 "knl"))
3287 (define-public openlibm
3295 (url "https://github.com/JuliaLang/openlibm.git")
3296 (commit (string-append "v" version))))
3297 (file-name (git-file-name name version))
3299 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3300 (build-system gnu-build-system)
3303 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3305 ;; no configure script
3306 (modify-phases %standard-phases (delete 'configure))
3307 #:tests? #f)) ;the tests are part of the default target
3308 (home-page "http://openlibm.org/")
3309 (synopsis "Portable C mathematical library (libm)")
3311 "OpenLibm is an effort to have a high quality, portable, standalone C
3312 mathematical library (libm). It can be used standalone in applications and
3313 programming language implementations. The project was born out of a need to
3314 have a good libm for the Julia programming language that worked consistently
3315 across compilers and operating systems, and in 32-bit and 64-bit
3317 ;; Each architecture has its own make target, and there is none for mips.
3318 (supported-systems (delete "mips64el-linux" %supported-systems))
3319 ;; See LICENSE.md for details.
3320 (license (list license:expat
3323 license:public-domain
3324 license:lgpl2.1+))))
3326 (define-public openspecfun
3328 (name "openspecfun")
3334 (url "https://github.com/JuliaLang/openspecfun.git")
3335 (commit (string-append "v" version))))
3336 (file-name (git-file-name name version))
3338 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3339 (build-system gnu-build-system)
3341 '(#:tests? #f ; no "check" target
3343 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3345 (modify-phases %standard-phases
3346 (delete 'configure)))) ; no configure script
3348 `(("fortran" ,gfortran)))
3349 (home-page "https://github.com/JuliaLang/openspecfun")
3350 (synopsis "Collection of special mathematical functions")
3352 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3353 portable package for Bessel Functions of a Complex Argument and Nonnegative
3354 Order; it contains subroutines for computing Bessel functions and Airy
3355 functions. Faddeeva allows computing the various error functions of arbitrary
3356 complex arguments (Faddeeva function, error function, complementary error
3357 function, scaled complementary error function, imaginary error function, and
3358 Dawson function); given these, one can also easily compute Voigt functions,
3359 Fresnel integrals, and similar related functions as well.")
3360 ;; Faddeeva is released under the Expat license; AMOS is included as
3361 ;; public domain software.
3362 (license (list license:expat license:public-domain))))
3364 (define-public suitesparse
3366 (name "suitesparse")
3372 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3376 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3377 (modules '((guix build utils)))
3379 ;; Remove bundled metis source
3381 (delete-file-recursively "metis-5.1.0")
3383 (build-system gnu-build-system)
3385 '(#:tests? #f ;no "check" target
3390 "MY_METIS_LIB=-lmetis"
3391 (string-append "INSTALL_LIB="
3392 (assoc-ref %outputs "out") "/lib")
3393 (string-append "INSTALL_INCLUDE="
3394 (assoc-ref %outputs "out") "/include")
3397 (modify-phases %standard-phases
3398 (delete 'configure)))) ;no configure script
3403 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3404 (synopsis "Suite of sparse matrix software")
3406 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3407 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3408 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3409 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3410 CXSparse, a concise sparse Cholesky factorization package; and many other
3413 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3415 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3416 (license (list license:gpl2+ license:lgpl2.1+))))
3418 (define-public atlas
3424 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3425 version "/atlas" version ".tar.bz2"))
3428 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3429 (build-system gnu-build-system)
3430 (home-page "http://math-atlas.sourceforge.net/")
3431 (inputs `(("gfortran" ,gfortran)
3432 ("lapack-tar" ,(package-source lapack))))
3433 (outputs '("out" "doc"))
3434 ;; For the moment we drop support for MIPS at it fails to compile. See
3435 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3436 (supported-systems (delete "mips64el-linux" %supported-systems))
3438 `(#:parallel-build? #f
3439 #:parallel-tests? #f
3441 ;; ATLAS tunes itself for the machine it is built on, as explained at
3442 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3443 ;; For this reason, we want users to build it locally instead of using
3447 #:modules ((srfi srfi-26)
3448 (guix build gnu-build-system)
3451 `(;; Generate position independent code suitable for dynamic libraries
3452 ;; and use WALL timer to get more accurate timing.
3453 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3456 ,,(if (string-match "64" (%current-system))
3459 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3460 ;; needed to compile C files before it is generated.
3461 "-Ss" "pmake" "make -j 1"
3462 ;; Probe is failing for MIPS. We therefore define the system
3463 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3464 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3465 ,,@(if (string-prefix? "mips" (%current-system))
3466 (list "-A" "49" "-V" "1")
3468 ;; Generate shared libraries.
3470 ;; Build a full LAPACK library.
3471 ,(string-append "--with-netlib-lapack-tarfile="
3472 (assoc-ref %build-inputs "lapack-tar")))
3474 (modify-phases %standard-phases
3475 (add-after 'install 'install-doc
3476 (lambda* (#:key outputs inputs #:allow-other-keys)
3477 (let ((doc (string-append (assoc-ref outputs "doc")
3478 "/share/doc/atlas")))
3480 (for-each (cut install-file <> doc)
3481 (find-files "../ATLAS/doc" ".*"))
3483 (add-after 'check 'check-pt
3484 (lambda _ (invoke "make" "ptcheck")))
3485 ;; Fix files required to run configure.
3486 (add-before 'configure 'fix-/bin/sh
3488 ;; Use `sh', not `/bin/sh'.
3489 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3493 ;; Fix /bin/sh in generated make files.
3494 (add-after 'configure 'fix-/bin/sh-in-generated-files
3496 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3500 ;; ATLAS configure program does not accepts the default flags
3501 ;; passed by the 'gnu-build-system'.
3503 (lambda* (#:key native-inputs inputs outputs
3504 (configure-flags '())
3505 #:allow-other-keys #:rest args)
3506 (let* ((prefix (assoc-ref outputs "out"))
3507 (bash (or (and=> (assoc-ref
3508 (or native-inputs inputs) "bash")
3509 (cut string-append <> "/bin/bash"))
3511 (flags `(,(string-append "--prefix=" prefix)
3513 (abs-srcdir (getcwd))
3514 (srcdir (string-append "../" (basename abs-srcdir))))
3515 (format #t "source directory: ~s (relative from build: ~s)~%"
3519 (format #t "build directory: ~s~%" (getcwd))
3520 (format #t "configure flags: ~s~%" flags)
3522 (string-append srcdir "/configure")
3524 (synopsis "Automatically Tuned Linear Algebra Software")
3526 "ATLAS is an automatically tuned linear algebra software library
3527 providing C and Fortran77 interfaces to a portably efficient BLAS
3528 implementation, as well as a few routines from LAPACK.
3530 Optimization occurs at build time. For this reason, the library is built on
3531 the machine where it is installed, without resorting to pre-built substitutes.
3533 Before building the library, CPU throttling should be disabled. This can be
3534 done in the BIOS, or, on GNU/Linux, with the following command:
3537 # cpupower --governor performance
3540 Failure to do so will result in a library with poor performance.")
3541 (license license:bsd-3)))
3550 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3551 version "/glm-" version ".zip"))
3553 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3554 (patches (search-patches "glm-restore-install-target.patch"))))
3555 (build-system cmake-build-system)
3557 `(("unzip" ,unzip)))
3558 (home-page "https://glm.g-truc.net/")
3559 (synopsis "OpenGL Mathematics library")
3560 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3561 library for graphics software based on the OpenGL Shading Language (GLSL)
3563 (license license:expat)))
3565 (define-public lpsolve
3572 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3573 "/lp_solve_" version "_source.tar.gz"))
3576 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3577 (modules '((guix build utils)))
3580 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3582 ;; Pretend to be on a 64 bit platform to obtain a common directory
3583 ;; name for the build results on all architectures; nothing else
3584 ;; seems to depend on it.
3585 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3587 ;; The check for 'isnan' as it is written fails with
3588 ;; "non-floating-point argument in call to function
3589 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3590 ;; definition, which in turn leads to bad things. Fix the feature
3592 (("isnan\\(0\\)") "isnan(0.)"))
3594 (build-system gnu-build-system)
3596 `(#:tests? #f ; no check target
3598 (modify-phases %standard-phases
3599 (delete 'configure) ; no configure script
3602 (with-directory-excursion "lpsolve55"
3603 (invoke "bash" "ccc"))
3604 (with-directory-excursion "lp_solve"
3605 (invoke "bash" "ccc"))
3608 (lambda* (#:key outputs #:allow-other-keys)
3609 (let* ((out (assoc-ref outputs "out"))
3610 (bin (string-append out "/bin"))
3611 (lib (string-append out "/lib"))
3612 ;; This is where LibreOffice expects to find the header
3613 ;; files, and where they are installed by Debian.
3614 (include (string-append out "/include/lpsolve")))
3615 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3616 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3617 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3619 ;; Install a subset of the header files as on Debian
3620 ;; (plus lp_bit.h, which matches the regular expression).
3621 (for-each (lambda (name)
3622 (install-file name include))
3623 (find-files "." "lp_[HMSa-z].*\\.h$"))
3624 (with-directory-excursion "shared"
3625 (for-each (lambda (name)
3626 (install-file name include))
3627 (find-files "." "\\.h$")))
3629 (home-page "http://lpsolve.sourceforge.net/")
3630 (synopsis "Mixed integer linear programming (MILP) solver")
3632 "lp_solve is a mixed integer linear programming solver based on the
3633 revised simplex and the branch-and-bound methods.")
3634 (license license:lgpl2.1+)))
3636 (define-public dealii
3643 (uri (string-append "https://github.com/dealii/dealii/releases/"
3644 "download/v" version "/dealii-" version ".tar.gz"))
3647 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3648 (modules '((guix build utils)))
3650 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3652 (delete-file-recursively "bundled")
3654 (build-system cmake-build-system)
3662 ("arpack" ,arpack-ng)
3663 ("muparser" ,muparser)
3664 ("gfortran" ,gfortran)
3665 ("suitesparse" ,suitesparse))) ;for UMFPACK
3667 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3669 ;; Work around a bug in libsuitesparseconfig linking
3670 ;; see https://github.com/dealii/dealii/issues/4745
3671 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3672 (home-page "https://www.dealii.org")
3673 (synopsis "Finite element library")
3675 "Deal.II is a C++ program library targeted at the computational solution
3676 of partial differential equations using adaptive finite elements. The main
3677 aim of deal.II is to enable rapid development of modern finite element codes,
3678 using among other aspects adaptive meshes and a wide array of tools often used
3679 in finite element programs.")
3680 (license license:lgpl2.1+)))
3682 (define-public dealii-openmpi
3683 (package (inherit dealii)
3684 (name "dealii-openmpi")
3687 ;;Supported only with MPI:
3688 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3689 ("p4est" ,p4est-openmpi)
3690 ("petsc" ,petsc-openmpi)
3691 ("slepc" ,slepc-openmpi)
3692 ("metis" ,metis) ;for MUMPS
3693 ("scalapack" ,scalapack) ;for MUMPS
3694 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3695 ("arpack" ,arpack-ng-openmpi)
3696 ,@(fold alist-delete (package-inputs dealii)
3697 '("p4est" "arpack"))))
3699 (substitute-keyword-arguments (package-arguments dealii)
3700 ((#:configure-flags cf)
3701 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3703 ((#:phases phases '%standard-phases)
3704 `(modify-phases ,phases
3705 (add-before 'check 'mpi-setup
3706 ,%openmpi-setup)))))
3707 (synopsis "Finite element library (with MPI support)")))
3709 (define-public flann
3718 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3719 version "-src.zip"))
3722 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3723 (patches (search-patches "flann-cmake-3.11.patch"))))
3724 (build-system cmake-build-system)
3726 "octave")) ;46 MiB .mex file that pulls Octave
3728 `(("unzip" ,unzip)))
3731 ("octave" ,octave-cli)
3732 ("python" ,python-2) ; print syntax
3733 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3736 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3737 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3738 #:strip-directories '("lib" "lib64" "libexec"
3739 "bin" "sbin" "share/flann/octave")
3741 ;; Save 12 MiB by not installing .a files. Passing
3742 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3743 #:phases (modify-phases %standard-phases
3744 (add-before 'configure 'set-octave-directory
3745 (lambda* (#:key outputs #:allow-other-keys)
3746 ;; Install the .mex file in the "octave" output.
3747 (let ((out (assoc-ref outputs "octave")))
3748 (substitute* "src/matlab/CMakeLists.txt"
3749 (("share/flann/octave")
3750 (string-append out "/share/flann/octave")))
3752 (add-after 'install 'remove-static-libraries
3753 (lambda* (#:key outputs #:allow-other-keys)
3754 (let* ((out (assoc-ref outputs "out"))
3755 (lib (string-append out "/lib")))
3756 (for-each delete-file
3757 (find-files lib "\\.a$"))
3760 #:tests? #f)) ; The test data are downloaded from the Internet.
3761 (home-page "http://www.cs.ubc.ca/research/flann/")
3762 (synopsis "Library for approximate nearest neighbors computation")
3763 (description "FLANN is a library for performing fast approximate
3764 nearest neighbor searches in high dimensional spaces. It implements a
3765 collection of algorithms and a system for automatically choosing the best
3766 algorithm and optimum parameters depending on the dataset.
3768 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3769 (license (license:non-copyleft "file://COPYING"
3770 "See COPYING in the distribution."))))
3772 (define-public wcalc
3779 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3780 "wcalc-" version ".tar.bz2"))
3783 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3784 (build-system gnu-build-system)
3787 ("readline" ,readline)))
3788 (home-page "http://w-calc.sourceforge.net/index.php")
3789 (synopsis "Flexible command-line scientific calculator")
3790 (description "Wcalc is a very capable calculator. It has standard functions
3791 (sin, asin, and sinh for example, in either radians or degrees), many
3792 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3793 variables, a command history, hex/octal/binary input and output, unit
3794 conversions, embedded comments, and an expandable expression entry field. It
3795 evaluates expressions using the standard order of operations.")
3796 (license license:gpl2+)))
3804 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3805 "/xaos-" version ".tar.gz"))
3808 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3809 (build-system gnu-build-system)
3810 (native-inputs `(("gettext" ,gettext-minimal)))
3811 (inputs `(("libx11" ,libx11)
3816 `(#:tests? #f ;no "check" target
3817 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3818 (synopsis "Real-time fractal zoomer")
3819 (description "GNU XaoS is a graphical program that generates fractal
3820 patterns and allows you to zoom in and out of them infinitely in a fluid,
3821 continuous manner. It also includes tutorials that help to explain how fractals
3822 are built. It can generate many different fractal types such as the Mandelbrot
3824 (home-page "https://www.gnu.org/software/xaos/")
3825 (license license:gpl2+)))
3827 (define-public hypre
3835 (url "https://github.com/LLNL/hypre.git")
3836 (commit (string-append "v" version))))
3837 (file-name (git-file-name name version))
3839 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3840 (modules '((guix build utils)))
3843 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3844 ;; substitute the release date.
3845 (substitute* "src/utilities/HYPRE_utilities.h"
3846 (("Date Compiled: .*$")
3847 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3849 (build-system gnu-build-system)
3850 (outputs '("out" ; 6.1 MiB of headers and libraries
3851 "doc")) ; 4.8 MiB of documentation
3855 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3856 ("texlive" ,(texlive-union (list texlive-xypic
3858 texlive-latex-hyperref
3860 ("ghostscript" ,ghostscript)))
3862 `(("blas" ,openblas)
3863 ("lapack" ,lapack)))
3865 `(#:modules ((srfi srfi-1)
3866 ,@%gnu-build-system-modules)
3867 #:configure-flags '("--enable-shared"
3875 (modify-phases %standard-phases
3876 (add-before 'build 'set-HOME
3878 ;; FIXME: texlive-union does not find the built
3879 ;; metafonts, so it tries to generate them in HOME.
3880 (setenv "HOME" "/tmp")
3882 (add-before 'configure 'chdir-src
3883 (lambda _ (chdir "src")))
3885 (lambda* (#:key build target configure-flags
3886 #:allow-other-keys #:rest args)
3887 (let* ((configure (assoc-ref %standard-phases 'configure)))
3890 (list #:configure-flags
3891 (cons (string-append
3892 "--host=" (or target build))
3893 configure-flags)))))))
3894 (add-after 'build 'build-docs
3896 (invoke "make" "-Cdocs" "pdf" "html")))
3899 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3900 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3901 (invoke "make" "check" "CHECKRUN=")
3902 (for-each (lambda (filename)
3903 (let ((size (stat:size (stat filename))))
3904 (when (positive? size)
3905 (error (format #f "~a size ~d; error indication~%"
3907 (find-files "test" ".*\\.err$"))
3909 (add-after 'install 'install-docs
3910 (lambda* (#:key outputs #:allow-other-keys)
3911 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3912 (let* ((doc (assoc-ref outputs "doc"))
3913 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3914 (with-directory-excursion "docs"
3915 (for-each (lambda (base)
3916 (install-file (string-append base ".pdf") docdir)
3917 (copy-recursively base docdir)) ; html docs
3918 '("HYPRE_usr_manual"
3919 "HYPRE_ref_manual")))
3921 (home-page "http://www.llnl.gov/casc/hypre/")
3922 (synopsis "Library of solvers and preconditioners for linear equations")
3924 "HYPRE is a software library of high performance preconditioners and
3925 solvers for the solution of large, sparse linear systems of equations. It
3926 features multigrid solvers for both structured and unstructured grid
3928 (license license:lgpl2.1)))
3930 (define-public hypre-openmpi
3931 (package (inherit hypre)
3932 (name "hypre-openmpi")
3935 ,@(package-inputs hypre)))
3937 (substitute-keyword-arguments (package-arguments hypre)
3938 ((#:configure-flags flags)
3940 ,@(delete "--without-MPI" ,flags)))
3942 `(modify-phases ,phases
3943 (add-before 'check 'mpi-setup
3944 ,%openmpi-setup)))))
3945 (synopsis "Parallel solvers and preconditioners for linear equations")
3947 "HYPRE is a software library of high performance preconditioners and
3948 solvers for the solution of large, sparse linear systems of equations on
3949 parallel computers. It features parallel multigrid solvers for both
3950 structured and unstructured grid problems.")))
3952 (define-public matio
3959 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3960 "matio-" version ".tar.gz"))
3963 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3964 (build-system gnu-build-system)
3968 (home-page "http://matio.sourceforge.net/")
3969 (synopsis "Library for reading and writing MAT files")
3970 (description "Matio is a library for reading and writing MAT files. It
3971 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3972 (license license:bsd-2)))
3979 (origin (method url-fetch)
3980 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3981 "download/" version "/Vc-" version ".tar.gz"))
3984 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3985 (build-system cmake-build-system)
3988 '("-DBUILD_TESTING=ON"
3989 ;; By default, Vc will optimize for the CPU of the build machine.
3990 ;; Setting this to "none" makes it create portable binaries. See
3991 ;; "cmake/OptimizeForArchitecture.cmake".
3992 "-DTARGET_ARCHITECTURE=none")))
3993 (synopsis "SIMD vector classes for C++")
3994 (description "Vc provides portable, zero-overhead C++ types for explicitly
3995 data-parallel programming. It is a library designed to ease explicit
3996 vectorization of C++ code. Its types enable explicitly stating data-parallel
3997 operations on multiple values. The parallelism is therefore added via the type
3998 system. Vc has an intuitive API and provides portability between different
3999 compilers and compiler versions as well as portability between different vector
4000 instruction sets. Thus, an application written with Vc can be compiled for:
4003 @item SSE2 up to SSE4.2 or SSE4a
4006 @item NEON (in development)
4007 @item NVIDIA GPUs / CUDA (in development)
4009 (home-page "https://github.com/VcDevel/Vc")
4010 ;; "No support_???.cpp file exists for this architecture."
4011 (supported-systems '("x86_64-linux" "i686-linux"))
4012 (license license:bsd-3)))
4014 (define-public reducelcs
4015 ;; This is the last commit which is available upstream, no
4016 ;; release happened since 2010.
4017 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4021 (version (string-append "1.0-" revision "." (string-take commit 7)))
4026 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4028 (file-name (string-append name "-" version "-checkout"))
4031 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4032 (build-system gnu-build-system)
4034 `(("openlibm" ,openlibm)))
4036 `(#:tests? #f ; no tests
4038 (modify-phases %standard-phases
4039 (delete 'configure) ; No configure script exists.
4040 (replace 'install ; No install phase exists.
4041 (lambda* (#:key outputs #:allow-other-keys)
4042 (let* ((out (assoc-ref outputs "out"))
4043 (bin (string-append out "/bin")))
4044 (install-file "Approximation" bin)
4045 (install-file "CollectResults" bin)
4046 (install-file "GenerateInstances" bin)
4048 (synopsis "Approximate Longest Commons Subsequence computation tool")
4050 "@code{reduceLCS} is an implementation of the Reduce-Expand
4051 algorithm for LCS. It is a fast program to compute the approximate
4052 Longest Commons Subsequence of a set of strings.")
4053 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4054 (license license:gpl3+))))
4056 (define-public jacal
4063 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4066 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4067 (patches (search-patches "jacal-fix-texinfo.patch"))))
4068 (build-system gnu-build-system)
4071 (modify-phases %standard-phases
4072 (add-before 'build 'pre-build
4073 ;; Don't use upstream's script - it really doesn't fit into
4074 ;; Guix's functional paradigm.
4075 (lambda* (#:key inputs outputs #:allow-other-keys)
4076 (substitute* "Makefile"
4077 (("^install: install-script") "install: "))))
4078 (add-after 'install 'post-install
4079 ;; Instead, we provide our own simplified script.
4080 (lambda* (#:key inputs outputs #:allow-other-keys)
4081 (let ((wrapper (string-append (assoc-ref outputs "out")
4083 (format (open wrapper (logior O_WRONLY O_CREAT))
4084 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4085 "-e '(slib:load \"~a/lib/jacal/math\") "
4088 (assoc-ref inputs "scm")
4089 (assoc-ref outputs "out"))
4090 (chmod wrapper #o555))))
4092 (lambda* (#:key outputs #:allow-other-keys)
4093 (invoke "./configure"
4094 (string-append "--prefix="
4095 (assoc-ref outputs "out"))))))))
4096 (inputs `(("scm" ,scm)))
4097 (native-inputs `(("unzip" ,unzip)
4098 ("texinfo" ,texinfo)))
4099 (synopsis "Symbolic mathematics system")
4100 (description "GNU JACAL is an interactive symbolic mathematics program based on
4101 Scheme. It manipulate and simplify a range of mathematical expressions such
4102 as equations, scalars, vectors, and matrices.")
4103 (home-page "https://www.gnu.org/software/jacal/")
4104 (license license:gpl3+)))
4110 (home-page "https://github.com/Z3Prover/z3")
4113 (uri (git-reference (url home-page)
4114 (commit (string-append "z3-" version))))
4115 (file-name (git-file-name name version))
4118 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
4119 (build-system gnu-build-system)
4122 (modify-phases %standard-phases
4123 (add-after 'unpack 'fix-compatability
4124 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4126 (substitute* "src/util/mpz.cpp"
4127 (("#include <immintrin.h>") ""))
4129 (add-before 'configure 'bootstrap
4131 (invoke "python" "scripts/mk_make.py")))
4132 ;; work around gnu-build-system's setting --enable-fast-install
4133 ;; (z3's `configure' is a wrapper around the above python file,
4134 ;; which fails when passed --enable-fast-install)
4136 (lambda* (#:key inputs outputs #:allow-other-keys)
4137 (invoke "./configure"
4138 (string-append "--prefix=" (assoc-ref outputs "out")))))
4139 (add-after 'configure 'change-directory
4143 (add-before 'check 'make-test-z3
4145 ;; Build the test suite executable.
4146 (invoke "make" "test-z3" "-j"
4147 (number->string (parallel-job-count)))))
4150 ;; Run all the tests that don't require arguments.
4151 (invoke "./test-z3" "/a"))))))
4154 ("python" ,python-wrapper)))
4155 (synopsis "Theorem prover")
4156 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4157 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4158 (license license:expat)))
4163 (version "2018.11.001")
4166 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4167 version "/elpa-" version ".tar.gz"))
4170 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4171 (build-system gnu-build-system)
4173 `(("fortran" ,gfortran)
4174 ("perl" ,perl))) ;for configure and deps
4176 `(("blas" ,openblas)))
4181 ;; ELPA unfortunately does not support runtime dispatch, so we can
4182 ;; only enable the "generic" kernels. See the "Cross compilation"
4183 ;; section of INSTALL.md.
4185 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4186 "--disable-avx" "--disable-avx2" "--disable-avx512"
4187 ,(string-append "CFLAGS=-O3 "
4188 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4189 "-ftree-vect-loop-version -ftree-vectorize "
4190 ,(let ((system (or (%current-target-system)
4191 (%current-system))))
4193 ((or (string-prefix? "x86_64" system)
4194 (string-prefix? "i686" system))
4197 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4199 (modify-phases %standard-phases
4200 (add-before 'configure 'patch-header-generation
4202 (substitute* "configure"
4203 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4204 (string-append & " CPP=\"$CPP\"")))
4206 (add-before 'check 'setup-tests
4208 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4209 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4210 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4211 ;; for Fortran. This also causes several tests to pass that
4212 ;; otherwise would otherwise fail with matrix size 5000; possibly
4213 ;; due to floating point tolerances that are too tight.
4214 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4215 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4216 (substitute* "Makefile"
4217 ;; Test scripts are generated, patch the shebang
4218 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4220 (home-page "http://elpa.mpcdf.mpg.de")
4221 (synopsis "Eigenvalue solvers for symmetric matrices")
4223 "The ELPA library provides efficient and scalable direct eigensolvers for
4224 symmetric matrices.")
4225 (license license:lgpl3)))
4227 (define-public elpa-openmpi
4228 (package (inherit elpa)
4229 (name "elpa-openmpi")
4232 ("scalapack" ,scalapack)
4233 ,@(package-inputs elpa)))
4235 (substitute-keyword-arguments (package-arguments elpa)
4236 ((#:configure-flags cf '())
4237 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4238 ((#:phases phases '%standard-phases)
4239 `(modify-phases ,phases
4240 (add-before 'check 'mpi-setup
4242 ;; Tests use 2 mpi tasks by default, use our remaining build
4243 ;; cores as OpenMP threads.
4244 (setenv "OMP_NUM_THREADS" (number->string
4245 (max (quotient (parallel-job-count) 2)
4247 (,%openmpi-setup)))))))
4248 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4250 (define-public elemental
4257 (url "https://github.com/elemental/Elemental.git")
4258 (commit (string-append "v" version))))
4259 (file-name (git-file-name name version))
4262 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4263 (build-system cmake-build-system)
4264 (home-page "http://libelemental.org")
4266 `(("gfortran" ,gfortran)))
4268 `(("blas" ,openblas)
4269 ("gfortran:lib" ,gfortran "lib")
4278 `(#:build-type "Release" ;default RelWithDebInfo not supported
4279 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4280 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4281 "-DEL_CACHE_WARNINGS:BOOL=YES"
4282 "-DEL_TESTS:BOOL=YES"
4283 "-DCMAKE_INSTALL_LIBDIR=lib"
4284 "-DGFORTRAN_LIB=gfortran")
4285 #:phases (modify-phases %standard-phases
4286 (add-before 'check 'mpi-setup
4288 (add-before 'check 'setup-tests
4290 ;; Parallelism is done at the MPI layer.
4291 (setenv "OMP_NUM_THREADS" "1")
4293 (add-after 'install 'remove-tests
4294 (lambda* (#:key outputs #:allow-other-keys)
4295 ;; Tests are installed, with no easy configuration
4296 ;; switch to prevent this, so delete them.
4297 (delete-file-recursively
4298 (string-append (assoc-ref outputs "out") "/bin"))
4300 (synopsis "Dense and sparse-direct linear algebra and optimization")
4301 (description "Elemental is a modern C++ library for distributed-memory
4302 dense and sparse-direct linear algebra, conic optimization, and lattice
4304 (license license:bsd-2)))
4306 (define-public mcrl2
4309 (version "201707.1.15162")
4312 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4317 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4319 `(("subversion" ,subversion)))
4324 ("qtbase" ,qtbase)))
4325 (build-system cmake-build-system)
4326 (synopsis "Toolset for the mCRL2 formal specification language")
4328 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4329 specification language for describing concurrent discrete event systems. Its
4330 toolset supports analysis and automatic verification, linearisation, simulation,
4331 state-space exploration and generation, and tools to optimise and analyse
4332 specifications. Also, state spaces can be manipulated, visualised and
4334 (home-page "https://mcrl2.org")
4335 (license license:boost1.0)))
4337 (define-public r-subplex
4344 (uri (cran-uri "subplex" version))
4347 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4348 (build-system r-build-system)
4350 `(("gfortran" ,gfortran)))
4351 (home-page "https://cran.r-project.org/web/packages/subplex")
4352 (synopsis "Unconstrained optimization using the subplex algorithm")
4353 (description "This package implements the Subplex optimization algorithm.
4354 It solves unconstrained optimization problems using a simplex method on
4355 subspaces. The method is well suited for optimizing objective functions that
4356 are noisy or are discontinuous at the solution.")
4357 (license license:gpl3+)))
4359 (define-public r-desolve
4366 (uri (cran-uri "deSolve" version))
4369 "0hkvspq0fp8j64l9zayab2l2nazazhwfgfym0jllh0xv5a12r99s"))))
4370 (properties `((upstream-name . "deSolve")))
4371 (build-system r-build-system)
4373 `(("gfortran" ,gfortran)))
4374 (home-page "https://desolve.r-forge.r-project.org/")
4375 (synopsis "Solvers for initial value problems of differential equations")
4376 (description "This package provides functions that solve initial
4377 value problems of a system of first-order ordinary differential equations (ODE),
4378 of partial differential equations (PDE), of differential algebraic equations
4379 (DAE), and of delay differential equations. The functions provide an interface
4380 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4381 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4382 the Runge-Kutta family with fixed or variable time steps. The package contains
4383 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4384 differential equations (PDE) that have been converted to ODEs by numerical
4386 (license license:gpl2+)))
4388 (define-public tcalc
4395 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4399 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4400 (build-system gnu-build-system)
4401 (synopsis "The terminal calculator")
4403 "The terminal calculator is a small program to help users of the GNU/Linux
4404 terminal do calculations simply and quickly. The formula to be calculated can
4405 be fed to @command{tcalc} through the command line.")
4406 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4407 (license license:gpl3+)))
4409 (define-public sundials
4416 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4417 "sundials-" version ".tar.gz"))
4420 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4421 (build-system cmake-build-system)
4423 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4425 `(("fortran" ,gfortran) ;for fcmix
4427 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4429 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4430 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4431 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4432 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4433 "-DEXAMPLES_INSTALL:BOOL=OFF"
4435 "-DFCMIX_ENABLE:BOOL=ON"
4437 "-DKLU_ENABLE:BOOL=ON"
4438 ,(string-append "-DKLU_INCLUDE_DIR="
4439 (assoc-ref %build-inputs "suitesparse")
4441 ,(string-append "-DKLU_LIBRARY_DIR="
4442 (assoc-ref %build-inputs "suitesparse")
4444 (home-page "https://computation.llnl.gov/projects/sundials")
4445 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4446 (description "SUNDIALS is a family of software packages implemented with
4447 the goal of providing robust time integrators and nonlinear solvers that can
4448 easily be incorporated into existing simulation codes.")
4449 (license license:bsd-3)))
4451 (define-public sundials-openmpi
4452 (package (inherit sundials)
4453 (name "sundials-openmpi")
4456 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4457 ,@(package-inputs sundials)))
4459 (substitute-keyword-arguments (package-arguments sundials)
4460 ((#:configure-flags flags '())
4461 `(cons* "-DMPI_ENABLE:BOOL=ON"
4462 "-DPETSC_ENABLE:BOOL=ON"
4463 (string-append "-DPETSC_INCLUDE_DIR="
4464 (assoc-ref %build-inputs "petsc")
4466 (string-append "-DPETSC_LIBRARY_DIR="
4467 (assoc-ref %build-inputs "petsc")
4470 ((#:phases phases '%standard-phases)
4471 `(modify-phases ,phases
4472 (add-before 'check 'mpi-setup
4473 ,%openmpi-setup)))))
4474 (synopsis "SUNDIALS with OpenMPI support")))
4476 (define-public combinatorial-blas
4478 (name "combinatorial-blas")
4483 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4485 (match (string-split version #\.)
4486 ((major minor patch)
4487 (string-append major minor "_" patch))) ;e.g. "16_2"
4491 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4492 (patches (search-patches "combinatorial-blas-awpm.patch"
4493 "combinatorial-blas-io-fix.patch"))))
4494 (build-system cmake-build-system)
4497 ("test-data" ,(origin
4499 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4500 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4503 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4505 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4506 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4507 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4509 (modify-phases %standard-phases
4510 (add-before 'check 'mpi-setup
4512 (add-before 'check 'test-setup
4513 (lambda* (#:key inputs #:allow-other-keys)
4514 (setenv "OMP_NUM_THREADS" "2")
4515 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4516 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4517 (synopsis "Linear algebra primitives for graph analytics")
4518 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4519 distributed-memory parallel graph library offering a small but powerful set of
4520 linear algebra primitives specifically targeting graph analytics.")
4522 license:gpl2+ ;include/psort/(funnel|sort)*.h
4523 license:x11 ;usort and psort
4524 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4526 (define-public dune-common
4528 (name "dune-common")
4533 (uri (string-append "https://dune-project.org/download/"
4534 version "/dune-common-" version ".tar.gz"))
4537 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4538 (build-system cmake-build-system)
4541 (modify-phases %standard-phases
4542 (add-after 'build 'build-tests
4543 (lambda* (#:key make-flags #:allow-other-keys)
4544 (apply invoke "make" "build_tests" make-flags)))
4545 ;; These tests fail because they require a fully functional MPI
4547 (add-after 'unpack 'disable-failing-tests
4550 (string-append "--exclude-regex '("
4554 "remoteindicestest-mpi-2"
4557 "variablesizecommunicatortest"
4558 "variablesizecommunicatortest-mpi-2"
4559 "arithmetictestsuitetest"
4560 "assertandreturntest"
4561 "assertandreturntest_ndebug"
4564 "mpicollectivecommunication"
4565 "mpicollectivecommunication-mpi-2"
4567 "mpiguardtest-mpi-2"
4569 "mpihelpertest-mpi-2"
4571 "mpihelpertest2-mpi-2")
4578 ("openmpi" ,openmpi)
4579 ("openblas" ,openblas)
4581 ("superlu" ,superlu)))
4583 `(("gfortran" ,gfortran)
4584 ("pkg-config" ,pkg-config)))
4585 (home-page "https://dune-project.org/")
4586 (synopsis "Distributed and Unified Numerics Environment")
4587 (description "DUNE, the Distributed and Unified Numerics Environment is a
4588 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4589 grid-based methods. It supports the easy implementation of methods like
4590 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4591 Differences} (FD).")
4592 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4593 (license license:gpl2)))
4595 (define-public dune-geometry
4597 (name "dune-geometry")
4602 (uri (string-append "https://dune-project.org/download/"
4603 version "/dune-geometry-" version ".tar.gz"))
4606 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4607 (build-system cmake-build-system)
4610 (modify-phases %standard-phases
4611 (add-after 'build 'build-tests
4612 (lambda* (#:key make-flags #:allow-other-keys)
4613 (apply invoke "make" "build_tests" make-flags))))))
4615 `(("dune-common" ,dune-common)
4616 ("openmpi" ,openmpi)
4618 ("openblas" ,openblas)
4620 ("python" ,python)))
4622 `(("gfortran" ,gfortran)
4623 ("pkg-config" ,pkg-config)))
4624 (home-page "https://dune-project.org/")
4625 (synopsis "Distributed and Unified Numerics Environment")
4626 (description "DUNE, the Distributed and Unified Numerics Environment is a
4627 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4628 grid-based methods. It supports the easy implementation of methods like
4629 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4632 This package contains the basic DUNE geometry classes.")
4633 ;; GPL version 2 with "runtime exception"
4634 (license license:gpl2)))
4636 (define-public dune-grid
4643 (uri (string-append "https://dune-project.org/download/"
4644 version "/dune-grid-" version ".tar.gz"))
4647 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4648 (build-system cmake-build-system)
4651 (modify-phases %standard-phases
4652 (add-after 'build 'build-tests
4653 (lambda* (#:key make-flags #:allow-other-keys)
4654 (apply invoke "make" "build_tests" make-flags)))
4655 ;; These tests fail because they require a fully functional MPI
4657 (add-after 'unpack 'disable-failing-tests
4660 (string-append "--exclude-regex '("
4664 "conformvolumevtktest"
4666 "nonconformboundaryvtktest"
4667 "subsamplingvtktest"
4673 "test-dgf-yasp-offset"
4675 "test-geogrid-yaspgrid"
4678 "testiteratorranges"
4679 "test-hierarchicsearch"
4680 "test-parallel-ug-mpi-2"
4681 "test-yaspgrid-backuprestore-equidistant"
4682 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4683 "test-yaspgrid-backuprestore-equidistantoffset"
4684 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4685 "test-yaspgrid-backuprestore-tensor"
4686 "test-yaspgrid-backuprestore-tensor-mpi-2"
4687 "test-yaspgrid-tensorgridfactory"
4688 "test-yaspgrid-tensorgridfactory-mpi-2"
4689 "test-yaspgrid-yaspfactory-1d"
4690 "test-yaspgrid-yaspfactory-1d-mpi-2"
4691 "test-yaspgrid-yaspfactory-2d"
4692 "test-yaspgrid-yaspfactory-2d-mpi-2"
4693 "test-yaspgrid-yaspfactory-3d"
4694 "test-yaspgrid-yaspfactory-3d-mpi-2"
4695 "globalindexsettest"
4696 "persistentcontainertest"
4697 "structuredgridfactorytest"
4698 "tensorgridfactorytest"
4704 `(("dune-common" ,dune-common)
4705 ("dune-geometry" ,dune-geometry)
4708 ("openblas" ,openblas)
4709 ("openmpi" ,openmpi)
4710 ("python" ,python)))
4712 `(("gfortran" ,gfortran)
4713 ("pkg-config" ,pkg-config)))
4714 (home-page "https://dune-project.org/")
4715 (synopsis "Distributed and Unified Numerics Environment")
4716 (description "DUNE, the Distributed and Unified Numerics Environment is a
4717 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4718 grid-based methods. It supports the easy implementation of methods like
4719 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4722 This package contains the basic DUNE grid classes.")
4723 ;; GPL version 2 with "runtime exception"
4724 (license license:gpl2)))
4726 (define-public dune-istl
4733 (uri (string-append "https://dune-project.org/download/"
4734 version "/dune-istl-" version ".tar.gz"))
4737 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4738 (build-system cmake-build-system)
4741 (modify-phases %standard-phases
4742 (add-after 'build 'build-tests
4743 (lambda* (#:key make-flags #:allow-other-keys)
4744 (apply invoke "make" "build_tests" make-flags)))
4745 ;; These tests fail because they require a fully functional MPI
4747 (add-after 'unpack 'disable-failing-tests
4750 (string-append "--exclude-regex '("
4756 "pamg_comm_repart_test"
4764 `(("dune-common" ,dune-common)
4765 ("openmpi" ,openmpi)
4768 ("superlu" ,superlu)
4769 ("openblas" ,openblas)
4771 ("python" ,python)))
4773 `(("gfortran" ,gfortran)
4774 ("pkg-config" ,pkg-config)))
4775 (home-page "https://dune-project.org/")
4776 (synopsis "Distributed and Unified Numerics Environment")
4777 (description "DUNE, the Distributed and Unified Numerics Environment is a
4778 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4781 This is the iterative solver template library which provides generic sparse
4782 matrix/vector classes and a variety of solvers based on these classes. A
4783 special feature is the use of templates to exploit the recursive block
4784 structure of finite element matrices at compile time. Available solvers
4785 include Krylov methods, (block-) incomplete decompositions and
4786 aggregation-based algebraic multigrid.")
4787 ;; GPL version 2 with "runtime exception"
4788 (license license:gpl2)))
4790 (define-public dune-localfunctions
4792 (name "dune-localfunctions")
4797 (uri (string-append "https://dune-project.org/download/"
4798 version "/dune-localfunctions-" version ".tar.gz"))
4801 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4802 (build-system cmake-build-system)
4805 (modify-phases %standard-phases
4806 (add-after 'build 'build-tests
4807 (lambda* (#:key make-flags #:allow-other-keys)
4808 (apply invoke "make" "build_tests" make-flags))))))
4810 `(("dune-common" ,dune-common)
4811 ("dune-geometry" ,dune-geometry)
4812 ("openmpi" ,openmpi)
4815 ("superlu" ,superlu)
4818 `(("gfortran" ,gfortran)
4819 ("pkg-config" ,pkg-config)))
4820 (home-page "https://dune-project.org/")
4821 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4822 (description "This DUNE module provides interface and implementation for
4823 shape functions defined on the DUNE reference elements. In addition to the
4824 shape function, interpolation operators and special keys are provided which
4825 can be used to assemble global function spaces on finite-element grids.
4827 This package provides an interface and implementation for shape functions
4828 defined on the DUNE reference elements. In addition to the shape function,
4829 interpolation operators and special keys are provided which can be used to
4830 assemble global function spaces on finite-element grids.")
4831 ;; GPL version 2 with "runtime exception"
4832 (license license:gpl2)))
4834 (define-public dune-alugrid
4836 (name "dune-alugrid")
4841 (uri (string-append "https://dune-project.org/download/"
4842 version "/dune-alugrid-" version ".tar.gz"))
4845 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4846 (build-system cmake-build-system)
4848 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4851 (modify-phases %standard-phases
4852 (add-after 'unpack 'patch-include
4854 (substitute* "dune/alugrid/test/test-alugrid.cc"
4855 (("doc/grids/gridfactory/testgrids")
4856 "doc/dune-grid/grids/gridfactory/testgrids"))
4858 (add-after 'build 'build-tests
4859 (lambda* (#:key inputs make-flags #:allow-other-keys)
4860 (setenv "CPLUS_INCLUDE_PATH"
4861 (string-append (assoc-ref inputs "dune-grid") "/share:"
4862 (getenv "CPLUS_INCLUDE_PATH")))
4863 (apply invoke "make" "build_tests" make-flags))))))
4865 `(("dune-common" ,dune-common)
4866 ("dune-geometry" ,dune-geometry)
4867 ("dune-grid" ,dune-grid)
4868 ("openmpi" ,openmpi)
4871 ("openblas" ,openblas)
4873 ("superlu" ,superlu)
4877 `(("gfortran" ,gfortran)
4878 ("pkg-config" ,pkg-config)))
4879 (home-page "https://dune-project.org/")
4880 (synopsis "Distributed and Unified Numerics Environment")
4881 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4882 implementation of the DUNE grid interface supporting either simplices or
4884 (license license:gpl2+)))
4886 (define-public dune-typetree
4888 (name "dune-typetree")
4894 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4895 (commit (string-append "v" version))))
4896 (file-name (git-file-name name version))
4899 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4900 (build-system cmake-build-system)
4903 (modify-phases %standard-phases
4904 (add-after 'build 'build-tests
4905 (lambda* (#:key make-flags #:allow-other-keys)
4906 (apply invoke "make" "build_tests" make-flags))))))
4908 `(("dune-common" ,dune-common)
4909 ("openmpi" ,openmpi)
4911 ("openblas" ,openblas)
4914 ("superlu" ,superlu)
4917 `(("gfortran" ,gfortran)
4918 ("pkg-config" ,pkg-config)))
4919 (home-page "https://dune-project.org/")
4920 (synopsis "Distributed and Unified Numerics Environment")
4921 (description "TypeTree is a template library for constructing and
4922 operating on statically typed trees of objects.")
4923 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4924 (license (list license:lgpl3+ license:gpl2))))
4926 (define-public dune-functions
4928 (name "dune-functions")
4934 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4935 (commit (string-append "v" version))))
4936 (file-name (git-file-name name version))
4939 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4940 (build-system cmake-build-system)
4941 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4943 `(("dune-common" ,dune-common)
4944 ("dune-istl" ,dune-istl)
4945 ("dune-localfunctions" ,dune-localfunctions)
4946 ("dune-grid" ,dune-grid)
4947 ("dune-geometry" ,dune-geometry)
4948 ("dune-typetree" ,dune-typetree)
4949 ("openmpi" ,openmpi)
4950 ("openblas" ,openblas)
4953 ("superlu" ,superlu)
4956 `(("gfortran" ,gfortran)
4957 ("pkg-config" ,pkg-config)))
4958 (home-page "https://dune-project.org/")
4959 (synopsis "Distributed and Unified Numerics Environment")
4960 (description "The dune-functions module provides an abstraction layer for
4961 global finite element functions. Its two main concepts are functions
4962 implemented as callable objects, and bases of finite element spaces.")
4963 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4964 (license (list license:lgpl3+ license:gpl2))))
4966 (define-public dune-pdelab
4968 (name "dune-pdelab")
4969 (version "2.6.0-rc1")
4974 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4975 (commit (string-append "v" version))))
4976 (file-name (git-file-name name version))
4979 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4980 (build-system cmake-build-system)
4981 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4983 `(("dune-common" ,dune-common)
4984 ("dune-istl" ,dune-istl)
4985 ("dune-localfunctions" ,dune-localfunctions)
4986 ("dune-geometry" ,dune-geometry)
4987 ("dune-grid" ,dune-grid)
4988 ("dune-typetree" ,dune-typetree)
4989 ("dune-functions" ,dune-functions)
4990 ("openmpi" ,openmpi)
4992 ("openblas" ,openblas)
4996 ("superlu" ,superlu)
4999 `(("gfortran" ,gfortran)
5000 ("pkg-config" ,pkg-config)))
5001 (home-page "https://dune-project.org/")
5002 (synopsis "Differential equations solver toolbox")
5003 (description "PDELab is a partial differential equations solver toolbox
5004 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5005 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5006 (license (list license:lgpl3+ license:gpl2))))
5008 (define-public mlucas
5016 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5018 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5019 (build-system gnu-build-system)
5021 `(("python2" ,python-2)))
5023 `(#:tests? #f ; no tests
5025 (modify-phases %standard-phases
5029 (call-with-output-file "Makefile"
5031 (format port "CC = gcc
5032 CFLAGS = -O3 ~a -DUSE_THREADS
5033 LDLIBS = -lm -lpthread -lrt
5034 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5036 ,(let ((system (or (%current-target-system)
5037 (%current-system))))
5039 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5043 (lambda* (#:key outputs #:allow-other-keys)
5044 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5045 (install-file "Mlucas" bin)
5046 (install-file "primenet.py" bin))
5048 (home-page "https://www.mersenne.org")
5049 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5050 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5051 numbers in search of a world-record prime. You may use it to test any
5052 suitable number as you wish, but it is preferable that you do so in a
5053 coordinated fashion, as part of the Great Internet Mersenne Prime
5054 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5055 management via the GIMPS project's Primenet server.")
5056 (license license:gpl2+)))
5058 (define-public nauty
5065 "https://pallini.di.uniroma1.it/"
5066 "nauty" (string-join (string-split version #\.) "")
5070 "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"))))
5071 (build-system gnu-build-system)
5072 (outputs '("out" "lib"))
5074 `(#:test-target "checks"
5076 (modify-phases %standard-phases
5077 ;; Default make target does not build all available
5078 ;; executables. Create them now.
5079 (add-after 'build 'build-extra-programs
5081 (for-each (lambda (target) (invoke "make" target))
5082 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5084 ;; Upstream does not provide any install target.
5086 (lambda* (#:key outputs #:allow-other-keys)
5087 (let* ((out (assoc-ref outputs "out"))
5088 (lib-output (assoc-ref outputs "lib"))
5089 (bin (string-append out "/bin"))
5090 (doc (string-append out "/share/doc/nauty/"))
5091 (include (string-append lib-output "/include/nauty"))
5092 (lib (string-append lib-output "/lib/nauty")))
5093 (for-each (lambda (f) (install-file f bin))
5094 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5095 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5096 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5097 "delptg" "directg" "dretodot" "dretog" "genbg"
5098 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5099 "gentourng" "gentreeg" "hamheuristic" "labelg"
5100 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5101 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5102 "sumlines" "twohamg" "vcolg" "watercluster2"))
5103 (for-each (lambda (f) (install-file f include))
5104 (find-files "." "\\.h$"))
5105 (for-each (lambda (f) (install-file f lib))
5106 (find-files "." "\\.a$"))
5107 (for-each (lambda (f) (install-file f doc))
5108 (append '("formats.txt" "README" "schreier.txt")
5109 (find-files "." "\\.pdf$")))))))))
5111 `(("gmp" ,gmp))) ;for sumlines
5112 (home-page "https://pallini.di.uniroma1.it/")
5113 (synopsis "Library for graph automorphisms")
5114 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5115 procedures for computing automorphism groups of graphs and digraphs.
5117 @code{nauty} computes graph information in the form of a set of
5118 generators, the size of the group, and the orbits of the group; it can
5119 also produce a canonical label. The @code{nauty} suite is written in
5120 C and comes with a command-line interface, a collection of
5121 command-line tools, and an Application Programming Interface (API).
5123 This package provides the static libraries required to run programs
5124 compiled against the nauty library.")
5125 (license license:asl2.0)))
5134 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5135 "ftp/releases/" version
5136 "/ppl-" version ".tar.gz"))
5139 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5140 (build-system gnu-build-system)
5146 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5148 "Parma Polyhedra Library for computations with polyhedra")
5150 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5151 especially targeted at applications in the field of analysis and
5152 verification of complex systems. These abstractions include convex
5153 polyhedra, defined as the intersection of a finite number of (open or
5154 closed) halfspaces, each described by a linear inequality (strict or
5155 non-strict) with rational coefficients; some special classes of polyhedra
5156 shapes that offer interesting complexity/precision tradeoffs; and grids
5157 which represent regularly spaced points that satisfy a set of linear
5158 congruence relations. The library also supports finite powersets and
5159 products of (any kind of) polyhedra and grids, a mixed integer linear
5160 programming problem solver using an exact-arithmetic version of the simplex
5161 algorithm, a parametric integer programming solver, and primitives for
5162 termination analysis via the automatic synthesis of linear ranking
5164 (license license:gpl3+)))
5166 (define-public speedcrunch
5168 (name "speedcrunch")
5174 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5175 (commit (string-append "release-" version))))
5176 (file-name (git-file-name name version))
5179 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5180 (build-system cmake-build-system)
5181 (inputs `(("qtbase" ,qtbase)))
5182 (native-inputs `(("qttools" ,qttools)))
5185 (modify-phases %standard-phases
5186 (add-after 'unpack 'chdir-to-src
5187 (lambda _ (chdir "src") #t)))))
5188 (synopsis "High-precision scientific calculator")
5190 "SpeedCrunch is a high-precision scientific calculator. It features a
5191 syntax-highlighted scrollable display and is designed to be fully used via
5192 keyboard. Some distinctive features are auto-completion of functions and
5193 variables, a formula book, and quick insertion of constants from various
5194 fields of knowledge.")
5195 (home-page "http://speedcrunch.org/")
5196 (license license:gpl2+)))