1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016, 2018 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
29 ;;; This file is part of GNU Guix.
31 ;;; GNU Guix is free software; you can redistribute it and/or modify it
32 ;;; under the terms of the GNU General Public License as published by
33 ;;; the Free Software Foundation; either version 3 of the License, or (at
34 ;;; your option) any later version.
36 ;;; GNU Guix is distributed in the hope that it will be useful, but
37 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 ;;; GNU General Public License for more details.
41 ;;; You should have received a copy of the GNU General Public License
42 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44 (define-module (gnu packages maths)
45 #:use-module (ice-9 regex)
46 #:use-module (gnu packages)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (guix packages)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module (guix utils)
52 #:use-module (guix build utils)
53 #:use-module (guix build-system cmake)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system ocaml)
56 #:use-module (guix build-system r)
57 #:use-module (guix build-system ruby)
58 #:use-module (gnu packages algebra)
59 #:use-module (gnu packages audio)
60 #:use-module (gnu packages autotools)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages check)
64 #:use-module (gnu packages cmake)
65 #:use-module (gnu packages compression)
66 #:use-module (gnu packages curl)
67 #:use-module (gnu packages cyrus-sasl)
68 #:use-module (gnu packages documentation)
69 #:use-module (gnu packages elf)
70 #:use-module (gnu packages flex)
71 #:use-module (gnu packages fltk)
72 #:use-module (gnu packages fontutils)
73 #:use-module (gnu packages gettext)
74 #:use-module (gnu packages gcc)
75 #:use-module (gnu packages gd)
76 #:use-module (gnu packages ghostscript)
77 #:use-module (gnu packages graphviz)
78 #:use-module (gnu packages gtk)
79 #:use-module (gnu packages image)
80 #:use-module (gnu packages java)
81 #:use-module (gnu packages less)
82 #:use-module (gnu packages lisp)
83 #:use-module (gnu packages linux)
84 #:use-module (gnu packages logging)
85 #:use-module (gnu packages lua)
86 #:use-module (gnu packages gnome)
87 #:use-module (gnu packages guile)
88 #:use-module (gnu packages xorg)
89 #:use-module (gnu packages gl)
90 #:use-module (gnu packages imagemagick)
91 #:use-module (gnu packages m4)
92 #:use-module (gnu packages mpi)
93 #:use-module (gnu packages multiprecision)
94 #:use-module (gnu packages netpbm)
95 #:use-module (gnu packages ocaml)
96 #:use-module (gnu packages pcre)
97 #:use-module (gnu packages popt)
98 #:use-module (gnu packages perl)
99 #:use-module (gnu packages pkg-config)
100 #:use-module (gnu packages pulseaudio)
101 #:use-module (gnu packages python)
102 #:use-module (gnu packages python-web)
103 #:use-module (gnu packages qt)
104 #:use-module (gnu packages readline)
105 #:use-module (gnu packages ruby)
106 #:use-module (gnu packages tbb)
107 #:use-module (gnu packages scheme)
108 #:use-module (gnu packages shells)
109 #:use-module (gnu packages tcl)
110 #:use-module (gnu packages texinfo)
111 #:use-module (gnu packages tex)
112 #:use-module (gnu packages tls)
113 #:use-module (gnu packages version-control)
114 #:use-module (gnu packages wxwidgets)
115 #:use-module (gnu packages xml)
116 #:use-module (srfi srfi-1))
124 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
126 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
127 (build-system gnu-build-system)
128 (inputs `(("gtk+" ,gtk+)
129 ("libxml2" ,libxml2)))
130 (native-inputs `(("pkg-config" ,pkg-config)))
131 (synopsis "Natural deduction first-order logic interface")
132 (description "Aris is a program for performing logical proofs. It supports
133 propositional and predicate logic, as well as Boolean algebra and
134 arithmetical logic. In addition to its predefined inference and equivalence
135 rules, Aris also supports references to older proofs. Its use of standard
136 logical symbols and its natural deduction interface make it easy to use for
138 (license license:gpl3+)
139 (home-page "https://www.gnu.org/software/aris/")))
141 (define-public c-graph
147 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
150 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
151 (build-system gnu-build-system)
153 `(("fortran" ,gfortran)))
154 (synopsis "Visualizing and demonstrating convolution")
156 "GNU C-Graph is a tool for demonstrating the theory of convolution.
157 Thus, it can serve as an excellent aid to students of signal and systems
158 theory in visualizing the convolution process. Rather than forcing the
159 student to write code, the program offers an intuitive interface with
160 interactive dialogs to guide them.")
161 (license license:gpl3+)
162 (home-page "https://www.gnu.org/software/c-graph/")))
171 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
172 version "/coda-" version ".tar.gz"))
174 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
175 (patches (search-patches "coda-use-system-libs.patch"))
176 (modules '((guix build utils)))
178 ;; Make sure we don't use the bundled software.
180 (for-each (lambda (d)
181 (delete-file-recursively (string-append "libcoda/" d)))
182 '("zlib" "pcre" "expat"))
185 `(("fortran" ,gfortran)
187 ("python-numpy" ,python-numpy)))
194 (build-system gnu-build-system)
196 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
197 "LIBS= -lz -lpcre -lexpat")))
198 (synopsis "A common interface to various earth observation data formats")
200 "The Common Data Access toolbox (CODA) provides a set of interfaces for
201 reading remote sensing data from earth observation data files. It consists of
202 command line applications and interfaces to the C, Fortran, Python, and Java
203 programming languages.")
204 (home-page "https://stcorp.nl/coda")
205 (license license:gpl2+)))
213 (uri (string-append "mirror://gnu/units/units-" version
216 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
217 (build-system gnu-build-system)
219 `(("readline" ,readline)
220 ("python" ,python-wrapper) ;for 'units_cur' script
221 ("python-requests" ,python-requests)))
223 `(#:phases (modify-phases %standard-phases
224 (add-after 'install 'wrap-units_cur
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (bin (string-append out "/bin")))
228 (wrap-program (string-append bin "/units_cur")
229 `("PYTHONPATH" ":" prefix
230 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
232 (synopsis "Conversion between thousands of scales")
234 "GNU Units converts numeric quantities between units of measure. It
235 can handle scale changes through adaptive usage of standard scale
236 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
237 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
238 enough to be used effectively as a scientific calculator.")
239 (license license:gpl3+)
240 (home-page "https://www.gnu.org/software/units/")))
242 (define-public double-conversion
244 (name "double-conversion")
249 "https://github.com/floitsch/double-conversion/archive/v"
251 (file-name (string-append name "-" version ".tar.gz"))
254 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
255 (build-system cmake-build-system)
257 '(#:test-target "test"
258 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
259 "-DBUILD_TESTING=ON")))
260 (home-page "https://github.com/floitsch/double-conversion")
261 (synopsis "Conversion routines for IEEE doubles")
263 "The double-conversion library provides binary-decimal and decimal-binary
264 routines for IEEE doubles. The library consists of efficient conversion
265 routines that have been extracted from the V8 JavaScript engine.")
266 (license license:bsd-3)))
268 (define-public dionysus
274 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
278 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
279 (build-system gnu-build-system)
280 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
281 (synopsis "Local search for universal constants and scientific values")
283 "GNU Dionysus is a convenient system for quickly retrieving the values of
284 mathematical constants used in science and engineering. Values can be
285 searched using a simple command-line tool, choosing from three databases:
286 universal constants, atomic numbers, and constants related to
288 (license license:gpl3+)
289 (home-page "https://www.gnu.org/software/dionysus/")))
297 (uri (string-append "mirror://gnu/gsl/gsl-"
301 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
302 (patches (search-patches "gsl-test-i686.patch"))))
303 (build-system gnu-build-system)
305 `(;; Currently there are numerous tests that fail on "exotic"
306 ;; architectures such as aarch64 and ppc64le.
307 ,@(if (string-prefix? "aarch64-linux"
308 (or (%current-target-system) (%current-system)))
311 (home-page "https://www.gnu.org/software/gsl/")
312 (synopsis "Numerical library for C and C++")
314 "The GNU Scientific Library is a library for numerical analysis in C
315 and C++. It includes a wide range of mathematical routines, with over 1000
316 functions in total. Subject areas covered by the library include:
317 differential equations, linear algebra, Fast Fourier Transforms and random
319 (license license:gpl3+)))
321 (define-public ocaml-gsl
330 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
331 version"/gsl-ocaml-" version ".tar.gz"))
334 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
335 (build-system ocaml-build-system)
338 (home-page "https://mmottl.github.io/gsl-ocaml")
339 (synopsis "Bindings to the GNU Scientific Library")
341 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
342 the OCaml language.")
343 (license license:gpl3+)))
345 (define-public ocaml4.01-gsl
346 (package-with-ocaml4.01 ocaml-gsl))
355 (uri (string-append "mirror://gnu/glpk/glpk-"
359 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
360 (build-system gnu-build-system)
364 `(#:configure-flags '("--with-gmp")))
365 (home-page "https://www.gnu.org/software/glpk/")
366 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
368 "GLPK is a C library for solving large-scale linear programming (LP),
369 mixed integer programming (MIP), and other related problems. It supports the
370 GNU MathProg modeling language, a subset of the AMPL language, and features a
371 translator for the language. In addition to the C library, a stand-alone
372 LP/MIP solver is included in the package.")
373 (license license:gpl3+)))
382 (uri (string-append "http://www.4ti2.de/version_" version
383 "/4ti2-" version ".tar.gz"))
386 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
387 (build-system gnu-build-system)
389 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
393 (home-page "http://www.4ti2.de/")
394 (synopsis "Mathematical tool suite for problems on linear spaces")
396 "4ti2 implements algorithms for solving algebraic, geometric and
397 combinatorial problems on linear spaces. Among others, it solves systems
398 of linear equations, computes extreme rays of polyhedral cones, solves
399 integer programming problems and computes Markov bases for statistics.")
400 (license license:gpl2+)))
402 (define-public cddlib
409 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
410 (string-delete #\. version) ".tar.gz"))
413 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
414 (build-system gnu-build-system)
417 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
418 (synopsis "Library for convex hulls and extreme rays of polyhedra")
420 "The C-library cddlib implements the Double Description Method of
421 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
422 rays of a general convex polyhedron given by a system of linear inequalities
423 in arbitrary dimension. It can also be used for the converse operation of
424 computing convex hulls.")
425 (license license:gpl2+)))
427 (define-public arpack-ng
431 (home-page "https://github.com/opencollab/arpack-ng")
435 (uri (string-append home-page "/archive/" version ".tar.gz"))
436 (file-name (string-append name "-" version ".tar.gz"))
439 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
440 (build-system gnu-build-system)
442 '(#:phases (modify-phases %standard-phases
443 (add-after 'unpack 'autoreconf
445 (invoke "autoreconf" "-vfi"))))))
447 `(("autoconf" ,autoconf)
448 ("automake" ,automake)
449 ("libtool" ,libtool)))
452 ("fortran" ,gfortran)))
453 (synopsis "Fortran subroutines for solving eigenvalue problems")
455 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
456 large scale eigenvalue problems.")
457 (license (license:non-copyleft "file://COPYING"
458 "See COPYING in the distribution."))))
460 (define-public arpack-ng-3.3.0
464 (name (package-name arpack-ng))
465 (home-page (package-home-page arpack-ng))
469 (uri (string-append home-page "/archive/" version ".tar.gz"))
470 (file-name (string-append name "-" version ".tar.gz"))
473 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
475 (define-public arpack-ng-openmpi
476 (package (inherit arpack-ng)
477 (name "arpack-ng-openmpi")
480 ,@(package-inputs arpack-ng)))
481 (arguments `(#:configure-flags '("--enable-mpi")))
482 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
484 (define-public lapack
491 (uri (string-append "http://www.netlib.org/lapack/lapack-"
495 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
496 (build-system cmake-build-system)
497 (home-page "http://www.netlib.org/lapack/")
498 (inputs `(("fortran" ,gfortran)
499 ("python" ,python-2)))
501 `(#:configure-flags (list
502 "-DBUILD_SHARED_LIBS:BOOL=YES"
505 ;; Build the 'LAPACKE_clatms' functions.
506 "-DLAPACKE_WITH_TMG=ON")
508 (modify-phases %standard-phases
509 (add-before 'check 'patch-python
510 (lambda* (#:key inputs #:allow-other-keys)
511 (let ((python (assoc-ref inputs "python")))
512 (substitute* "lapack_testing.py"
513 (("/usr/bin/env python") python)))
515 (synopsis "Library for numerical linear algebra")
517 "LAPACK is a Fortran 90 library for solving the most commonly occurring
518 problems in numerical linear algebra.")
519 (license (license:non-copyleft "file://LICENSE"
520 "See LICENSE in the distribution."))))
522 (define-public lapack-3.5
529 (uri (string-append "http://www.netlib.org/lapack/lapack-"
533 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
535 (define-public scalapack
542 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
546 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
547 (build-system cmake-build-system)
550 ("fortran" ,gfortran)
551 ("lapack" ,lapack))) ;for testing only
553 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
554 (home-page "http://www.netlib.org/scalapack/")
555 (synopsis "Library for scalable numerical linear algebra")
557 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
558 routines on parallel distributed memory machines. ScaLAPACK solves dense and
559 banded linear systems, least squares problems, eigenvalue problems, and
560 singular value problems.")
561 (license (license:bsd-style "file://LICENSE"
562 "See LICENSE in the distribution."))))
564 (define-public gnuplot
570 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
575 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
576 (build-system gnu-build-system)
577 (inputs `(("readline" ,readline)
583 `(("pkg-config" ,pkg-config)
584 ("texlive" ,texlive-tiny)))
585 (home-page "http://www.gnuplot.info")
586 (synopsis "Command-line driven graphing utility")
587 (description "Gnuplot is a portable command-line driven graphing
588 utility. It was originally created to allow scientists and students to
589 visualize mathematical functions and data interactively, but has grown to
590 support many non-interactive uses such as web scripting. It is also used as a
591 plotting engine by third-party applications like Octave.")
592 ;; X11 Style with the additional restriction that derived works may only be
593 ;; distributed as patches to the original.
594 (license (license:fsf-free
595 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
604 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
606 (file-name (string-append name "-" version ".tar.gz"))
609 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
611 `(("fortran" ,gfortran)))
612 (build-system gnu-build-system)
613 (synopsis "General Cartographic Transformation Package (GCTP)")
615 "The General Cartographic Transformation Package (GCTP) is a system of
616 software routines designed to permit the transformation of coordinate pairs
617 from one map projection to another. The GCTP is the standard computer
618 software used by the National Mapping Division for map projection
620 (home-page "https://github.com/OkoSanto/GCTP")
621 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
630 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
631 version "/src/hdf-" version ".tar.bz2"))
633 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
634 (patches (search-patches "hdf4-architectures.patch"
635 "hdf4-reproducibility.patch"
636 "hdf4-shared-fortran.patch"))))
637 (build-system gnu-build-system)
639 `(("gfortran" ,gfortran)
644 ("libjpeg" ,libjpeg)))
646 `(#:parallel-tests? #f
647 #:configure-flags '("--enable-shared")
649 (modify-phases %standard-phases
650 ;; This is inspired by two of Debian's patches.
651 (add-before 'configure 'add-more-aarch64-support
653 (substitute* '("mfhdf/ncgen/ncgen.l"
654 "mfhdf/ncgen/ncgenyy.c"
655 "mfhdf/libsrc/netcdf.h.in")
656 (("AIX5L64") "__aarch64__"))
658 (add-before 'configure 'patchbuild
661 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
663 (("/bin/mkdir") "mkdir"))
664 (substitute* (find-files "." "^Makefile\\.in$")
665 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
666 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
667 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
668 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
669 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
671 (add-after 'configure 'patch-settings
673 ;; libhdf4.settings contains the full path of the
674 ;; compilers used, and its contents are included in
675 ;; .so-files. We truncate the hashes to avoid
676 ;; unnecessary store references to those compilers:
677 (substitute* "libhdf4.settings"
678 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
679 (string-append prefix (string-take hash 10) "...")))
682 (home-page "https://www.hdfgroup.org/products/hdf4/")
684 "Library and multi-object file format for storing and managing data")
685 (description "HDF4 is a library and multi-object file format for storing
686 and managing data between machines. HDF4 is an older hierarchical data format,
687 incompatible with HDF5.")
689 (license:non-copyleft
690 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
692 (define-public hdf4-alt
697 (substitute-keyword-arguments (package-arguments hdf4)
698 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
700 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
709 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
710 "hdf5-" (version-major+minor version)
711 "/hdf5-" version "/src/hdf5-"
713 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
716 (take (string-split version #\.) 2))
717 "/src/hdf5-" version ".tar.bz2")))
719 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
720 (patches (list (search-patch "hdf5-config-date.patch")))))
721 (build-system gnu-build-system)
725 `(("gfortran" ,gfortran)))
726 (outputs '("out" ; core library
727 "fortran")) ; fortran interface
729 `(;; Some of the users, notably Flann, need the C++ interface.
730 #:configure-flags '("--enable-cxx"
732 "--enable-fortran2003")
733 ;; Use -fPIC to allow the R bindings to link with the static libraries
734 #:make-flags (list "CFLAGS=-fPIC"
737 (modify-phases %standard-phases
738 (add-before 'configure 'patch-configure
739 (lambda* (#:key outputs #:allow-other-keys)
740 (substitute* "configure"
742 (substitute* "fortran/src/Makefile.in"
743 (("libhdf5_fortran_la_LDFLAGS =")
744 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
745 (assoc-ref outputs "fortran") "/lib")))
746 (substitute* "hl/fortran/src/Makefile.in"
747 (("libhdf5hl_fortran_la_LDFLAGS =")
748 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
749 (assoc-ref outputs "fortran") "/lib")))
751 (add-after 'configure 'patch-settings
753 ;; libhdf5.settings contains the full path of the
754 ;; compilers used, and its contents are included in
755 ;; libhdf5.so. We truncate the hashes to avoid
756 ;; unnecessary store references to those compilers:
757 (substitute* "src/libhdf5.settings"
758 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
759 (string-append prefix (string-take hash 10) "..."))
760 ;; Don't record the build-time kernel version to make the
761 ;; settings file reproducible.
762 (("Uname information:.*")
763 "Uname information: Linux\n"))
765 (add-after 'install 'patch-references
766 (lambda* (#:key inputs outputs #:allow-other-keys)
767 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
768 (zlib (assoc-ref inputs "zlib")))
769 (substitute* (find-files bin "h5p?cc")
771 (string-append "-L" zlib "/lib " lib)))
773 (add-after 'install 'split
774 (lambda* (#:key inputs outputs #:allow-other-keys)
775 ;; Move all fortran-related files
776 (let* ((out (assoc-ref outputs "out"))
777 (bin (string-append out "/bin"))
778 (lib (string-append out "/lib"))
779 (inc (string-append out "/include"))
780 (ex (string-append out "/share/hdf5_examples/fortran"))
781 (fort (assoc-ref outputs "fortran"))
782 (fbin (string-append fort "/bin"))
783 (flib (string-append fort "/lib"))
784 (finc (string-append fort "/include"))
785 (fex (string-append fort "/share/hdf5_examples/fortran")))
790 (rename-file (string-append bin "/h5fc")
791 (string-append fbin "/h5fc"))
792 (for-each (lambda (file)
794 (string-append flib "/" (basename file))))
795 (find-files lib ".*fortran.*"))
796 (for-each (lambda (file)
798 (string-append finc "/" (basename file))))
799 (find-files inc ".*mod"))
800 (for-each (lambda (file)
802 (string-append fex "/" (basename file))))
803 (find-files ex ".*"))
804 (delete-file-recursively ex))
806 (home-page "http://www.hdfgroup.org")
807 (synopsis "Management suite for extremely large and complex data")
808 (description "HDF5 is a suite that makes possible the management of
809 extremely large and complex data collections.")
810 (license (license:x11-style
811 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
813 (define-public hdf-java
821 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
822 version "/src/CMake-hdfjava-" version ".tar.gz"))
824 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
825 (modules '((guix build utils)))
826 (snippet ; Make sure we don't use the bundled sources and binaries.
828 (for-each delete-file
829 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
830 "HDF4.tar.gz" "HDF5.tar.gz"))
831 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
833 (build-system gnu-build-system)
835 `(("jdk" ,icedtea "jdk")
836 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
838 ("hamcrest-core" ,java-hamcrest-core)
839 ("junit" ,java-junit)
840 ("slf4j-simple" ,java-slf4j-simple)))
846 ("slf4j-api" ,java-slf4j-api)))
849 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
850 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
851 (assoc-ref %build-inputs "jdk") "/lib" )
852 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
853 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
856 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
857 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
858 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
859 (string-append "JPEGLIB="
860 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
864 (modify-phases %standard-phases
865 (add-before 'configure 'chdir-to-source
866 (lambda _ (chdir ,(string-append "hdfjava-" version))))
867 (add-before 'configure 'patch-build
868 (lambda* (#:key inputs outputs #:allow-other-keys)
869 (substitute* "configure"
870 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
871 (("/bin/cat") (which "cat")))
872 ;; Set classpath for compilation
873 (substitute* '("hdf/hdf5lib/Makefile.in"
874 "hdf/hdf5lib/exceptions/Makefile.in"
875 "hdf/hdflib/Makefile.in")
876 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
877 (string-append (assoc-ref inputs "slf4j-api")
878 "/share/java/slf4j-api.jar")))
879 ;; Replace outdated config.sub and config.guess:
880 (with-directory-excursion "config"
881 (for-each (lambda (file)
883 (string-append (assoc-ref inputs "automake")
884 "/share/automake-1.15/" file) file))
885 '("config.sub" "config.guess")))
886 (mkdir-p (string-append (assoc-ref outputs "out")))
887 ;; Set classpath for tests
888 (let* ((build-dir (getcwd))
889 (lib (string-append build-dir "/lib"))
890 (jhdf (string-append lib "/jhdf.jar"))
891 (jhdf5 (string-append lib "/jhdf5.jar"))
894 (string-append (assoc-ref inputs i)
895 "/share/java/" i ".jar"))
896 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
898 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
900 (substitute* '("test/hdf5lib/Makefile.in"
901 "test/hdf5lib/junit.sh.in"
902 "examples/runExample.sh.in")
904 (string-append (assoc-ref inputs "coreutils")
907 (string-append (assoc-ref inputs "coreutils")
909 (("CLASSPATH=[^\n]*")
910 (string-append "CLASSPATH=" class-path)))
911 (setenv "CLASSPATH" class-path))
913 (add-before 'check 'build-examples
915 (zero? (apply system* `("javac"
916 ,@(find-files "examples" ".*\\.java")))))))
920 #:parallel-tests? #f ))
921 (home-page "https://support.hdfgroup.org/products/java")
922 (synopsis "Java interface for the HDF4 and HDF5 libraries")
923 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
924 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
927 ;; BSD-style license:
928 (license (license:x11-style
929 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
930 /current/src/unpacked/COPYING"))))
932 (define-public hdf-eos2
939 (uri "ftp://edhs1.gsfc.nasa.gov\
940 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
942 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
943 (patches (search-patches "hdf-eos2-remove-gctp.patch"
944 "hdf-eos2-build-shared.patch"
945 "hdf-eos2-fortrantests.patch"))))
946 (build-system gnu-build-system)
948 `(("gfortran" ,gfortran)))
950 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
955 `( #:configure-flags '("--enable-install-include" "--enable-shared"
956 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
957 #:parallel-tests? #f))
958 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
959 (synopsis "HDF4-based data format for NASA's Earth Observing System")
960 (description "HDF-EOS2 is a software library built on HDF4 which supports
961 the construction of data structures used in NASA's Earth Observing
962 System (Grid, Point and Swath).")
964 ;; Source files carry a permissive license header.
965 (license (license:non-copyleft home-page))))
967 (define-public hdf-eos5
973 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
974 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
977 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
978 (patches (search-patches "hdf-eos5-build-shared.patch"
979 "hdf-eos5-remove-gctp.patch"
980 "hdf-eos5-fix-szip.patch"
981 "hdf-eos5-fortrantests.patch"))))
983 `(("gfortran" ,gfortran)))
984 (build-system gnu-build-system)
990 `(#:configure-flags '("--enable-install-include" "--enable-shared"
991 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
992 #:parallel-tests? #f))
993 (synopsis "HDF5-based data format for NASA's Earth Observing System")
995 "HDF-EOS5 is a software library built on HDF5 to support the construction
996 of data structures used in NASA's Earth Observing System (Grid, Point and
998 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1000 ;; Source files carry a permissive license header.
1001 (license (license:non-copyleft home-page))))
1003 (define-public hdf5-parallel-openmpi
1004 (package (inherit hdf5)
1005 (name "hdf5-parallel-openmpi")
1008 ,@(package-inputs hdf5)))
1010 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1011 ,@(package-arguments hdf5))
1013 `(modify-phases ,phases
1014 (add-before 'check 'patch-tests
1016 ;; OpenMPI's mpirun will exit with non-zero status if it
1017 ;; detects an "abnormal termination", i.e. any process not
1018 ;; calling MPI_Finalize(). Since the test is explicitely
1019 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1020 ;; H5C_flush_cache from being called, mpirun will always
1021 ;; complain, so turn this test off.
1022 (substitute* "testpar/Makefile"
1023 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1024 (string-append front back "\n")))
1025 (substitute* "tools/h5diff/testph5diff.sh"
1026 (("/bin/sh") (which "sh")))
1028 (synopsis "Management suite for data with parallel IO support")))
1030 (define-public h5check
1037 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1038 "h5check/src/h5check-" version ".tar.gz"))
1041 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1042 (build-system gnu-build-system)
1043 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1044 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1045 (synopsis "HDF5 format checker")
1046 (description "@code{h5check} is a validation tool for verifying that an
1047 HDF5 file is encoded according to the HDF File Format Specification.")
1048 (license (license:x11-style "file://COPYING"))))
1056 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1061 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1062 (build-system cmake-build-system)
1063 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1064 (inputs `(("lapack" ,lapack)
1066 ;; FIXME: Even though the fonts are available dvips complains:
1067 ;; "Font cmmi10 not found; characters will be left blank."
1069 `(("texlive" ,texlive-tiny)
1070 ("ghostscript" ,ghostscript)
1071 ("doxygen" ,doxygen)))
1072 (home-page "http://itpp.sourceforge.net")
1073 (synopsis "C++ library of maths, signal processing and communication classes")
1074 (description "IT++ is a C++ library of mathematical, signal processing and
1075 communication classes and functions. Its main use is in simulation of
1076 communication systems and for performing research in the area of
1077 communications. The kernel of the library consists of generic vector and
1078 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1079 similar to MATLAB, GNU Octave or SciPy.")
1080 (license license:gpl3+)))
1082 (define-public netcdf
1089 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1090 "netcdf-" version ".tar.gz"))
1093 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1094 (patches (search-patches "netcdf-date-time.patch"
1095 "netcdf-tst_h_par.patch"))))
1096 (build-system gnu-build-system)
1099 ("doxygen" ,doxygen)
1100 ("graphviz" ,graphviz)))
1102 `(("hdf4" ,hdf4-alt)
1105 ("libjpeg" ,libjpeg)))
1107 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1109 #:phases (modify-phases %standard-phases
1110 (add-before 'configure 'fix-source-date
1112 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1113 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1114 ;; to '1st hour of the current day', and therefore makes the
1115 ;; package not reproducible.
1116 (substitute* "./configure"
1117 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1118 "date --date='@0'"))
1120 (add-after 'configure 'patch-settings
1122 ;; libnetcdf.settings contains the full filename of the compilers
1123 ;; used to build the library. We truncate the hashes of those
1124 ;; filenames to avoid unnecessary references to the corresponding
1126 (substitute* "libnetcdf.settings"
1127 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1128 (string-append prefix (string-take hash 10) "...")))
1131 #:parallel-tests? #f)) ;various race conditions
1132 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1133 (synopsis "Library for scientific data")
1134 (description "NetCDF is an interface for scientific data access and a
1135 software library that provides an implementation of the interface. The netCDF
1136 library defines a machine-independent format for representing scientific data.
1137 Together, the interface, library, and format support the creation, access, and
1138 sharing of scientific data.")
1139 (license (license:x11-style "file://COPYRIGHT"))))
1141 (define-public netcdf-parallel-openmpi
1142 (package (inherit netcdf)
1143 (name "netcdf-parallel-openmpi")
1146 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1147 (package-inputs netcdf))))
1148 ;; TODO: Replace pkg-config references in nc-config with absolute references
1150 (substitute-keyword-arguments (package-arguments netcdf)
1151 ((#:configure-flags flags)
1152 `(cons* "CC=mpicc" "CXX=mpicxx"
1153 "--enable-parallel-tests"
1154 ;; Shared libraries not supported with parallel IO.
1155 "--disable-shared" "--with-pic"
1158 (define-public netcdf-fortran
1160 (name "netcdf-fortran")
1165 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1169 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1170 (build-system gnu-build-system)
1172 `(#:parallel-tests? #f))
1174 `(("netcdf" ,netcdf)))
1176 `(("gfortran" ,gfortran)))
1177 (synopsis "Fortran interface for the netCDF library")
1178 (description (package-description netcdf))
1179 (home-page (package-home-page netcdf))
1180 (license (package-license netcdf))))
1182 (define-public nlopt
1188 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1191 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1192 (build-system gnu-build-system)
1194 `(;; Shared libraries are not built by default. They are required to
1195 ;; build the Guile, Octave, and Python bindings.
1196 #:configure-flags '("--enable-shared")
1199 (modify-phases %standard-phases
1200 (add-before 'configure 'set-libnlopt-file-name
1201 (lambda* (#:key outputs #:allow-other-keys)
1202 ;; Make sure the Scheme module refers to the library by its
1203 ;; absolute file name (we cannot do that from a snippet
1204 ;; because the expansion of @libdir@ contains
1206 (let ((out (assoc-ref outputs "out")))
1207 (substitute* "swig/nlopt.scm.in"
1209 (string-append out "/lib/libnlopt")))
1211 (inputs `(("guile" ,guile-2.0)))
1212 (native-inputs `(("pkg-config" ,pkg-config)))
1213 (home-page "http://ab-initio.mit.edu/wiki/")
1214 (synopsis "Library for nonlinear optimization")
1215 (description "NLopt is a library for nonlinear optimization, providing a
1216 common interface for a number of different free optimization routines available
1217 online as well as original implementations of various other algorithms.")
1218 (license license:lgpl2.1+)))
1220 (define-public ipopt
1227 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1231 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1232 (modules '((guix build utils)))
1234 ;; Make sure we don't use the bundled software.
1236 (delete-file-recursively "ThirdParty")
1238 (build-system gnu-build-system)
1240 '(#:phases (modify-phases %standard-phases
1241 (add-after 'install 'add--L-flags-in-ipopt.pc
1242 (lambda* (#:key inputs outputs #:allow-other-keys)
1243 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1244 ;; move it to "Libs.private" where it belongs, and add a
1245 ;; '-L' flag for LAPACK.
1246 (let ((out (assoc-ref outputs "out"))
1247 (lapack (assoc-ref inputs "lapack")))
1248 (substitute* (string-append out "/lib/pkgconfig/"
1250 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1251 (string-append "Libs: " before " " after "\n"
1252 "Libs.private: " before
1253 "-L" lapack "/lib -llapack -lblas "
1257 `(("gfortran" ,gfortran)))
1259 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1260 `(("lapack" ,lapack))) ;for both libblas and liblapack
1261 (home-page "http://www.coin-or.org")
1262 (synopsis "Large-scale nonlinear optimizer")
1264 "The Interior Point Optimizer (IPOPT) is a software package for
1265 large-scale nonlinear optimization. It provides C++, C, and Fortran
1267 (license license:epl1.0)))
1269 (define-public ceres
1271 (name "ceres-solver")
1273 (home-page "http://ceres-solver.org/")
1276 (uri (string-append home-page "ceres-solver-"
1280 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1281 (build-system cmake-build-system)
1283 ;; TODO: Build HTML user documentation and install separately.
1284 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1285 "-DBUILD_SHARED_LIBS=ON")
1287 #:phases (modify-phases %standard-phases
1288 (add-before 'configure 'set-library-directory
1290 ;; Install libraries to lib/, not lib64/.
1291 (substitute* "internal/ceres/CMakeLists.txt"
1292 (("set\\(LIB_SUFFIX \"64\"\\)")
1293 "set(LIB_SUFFIX \"\")"))
1296 `(("pkg-config" ,pkg-config)))
1298 `(("glog" ,glog))) ;for #include <glog/glog.h>
1303 ("suitesparse" ,suitesparse)
1304 ("gflags" ,gflags)))
1305 (synopsis "C++ library for solving large optimization problems")
1307 "Ceres Solver is a C++ library for modeling and solving large,
1308 complicated optimization problems. It is a feature rich, mature and
1309 performant library which has been used in production since 2010. Ceres Solver
1310 can solve two kinds of problems:
1312 @item non-linear least squares problems with bounds constraints;
1313 @item general unconstrained optimization problems.
1315 (license license:bsd-3)))
1317 ;; For a fully featured Octave, users are strongly recommended also to install
1318 ;; the following packages: less, ghostscript, gnuplot.
1319 (define-public octave
1326 (uri (string-append "mirror://gnu/octave/octave-"
1330 "0pkkz1vazsh7ipffb09q0nc2jgx6q27pkkngygjij6jrpcly5zsp"))))
1331 (build-system gnu-build-system)
1333 `(("lapack" ,lapack)
1334 ("readline" ,readline)
1339 ("arpack" ,arpack-ng)
1342 ("fontconfig" ,fontconfig)
1343 ("freetype" ,freetype)
1350 ("texinfo" ,texinfo)
1351 ("graphicsmagick" ,graphicsmagick)
1352 ("suitesparse" ,suitesparse)
1353 ("libsndfile" ,libsndfile)
1354 ("portaudio" ,portaudio)
1355 ("alsa-lib" ,alsa-lib)))
1358 ("gfortran" ,gfortran)
1359 ("pkg-config" ,pkg-config)
1361 ;; The following inputs are not actually used in the build process.
1362 ;; However, the ./configure gratuitously tests for their existence and
1363 ;; assumes that programs not present at build time are also not, and
1364 ;; can never be, available at run time! If these inputs are therefore
1365 ;; not present, support for them will be built out. However, Octave
1366 ;; will still run without them, albeit without the features they
1369 ("ghostscript" ,ghostscript)
1370 ("gnuplot" ,gnuplot)))
1373 (list (string-append "--with-shell="
1374 (assoc-ref %build-inputs "bash")
1377 (modify-phases %standard-phases
1378 (add-after 'configure 'configure-makeinfo
1379 (lambda* (#:key inputs #:allow-other-keys)
1380 (substitute* "libinterp/corefcn/help.cc"
1381 (("Vmakeinfo_program = \"makeinfo\"")
1382 (string-append "Vmakeinfo_program = \""
1383 (assoc-ref inputs "texinfo")
1384 "/bin/makeinfo\"")))
1386 (home-page "https://www.gnu.org/software/octave/")
1387 (synopsis "High-level language for numerical computation")
1388 (description "GNU Octave is a high-level interpreted language that is
1389 specialized for numerical computations. It can be used for both linear and
1390 non-linear applications and it provides great support for visualizing results.
1391 Work may be performed both at the interactive command-line as well as via
1393 (license license:gpl3+)))
1395 (define-public qtoctave
1396 (package (inherit octave)
1399 `(("qscintilla" ,qscintilla)
1401 ,@(package-inputs octave)))
1403 `(("qttools" , qttools) ;for lrelease
1404 ,@(package-native-inputs octave)))
1406 (substitute-keyword-arguments (package-arguments octave)
1408 `(modify-phases ,phases
1409 (add-before 'configure 'patch-qscintilla-library-name
1410 (lambda* (#:key inputs #:allow-other-keys)
1411 ;; The QScintilla library that the Octave configure script tries
1412 ;; to link with should be named libqscintilla-qt5.so, but the
1413 ;; QScintilla input provides the shared library as
1414 ;; libqscintilla2_qt5.so.
1415 (substitute* "configure"
1416 (("qscintilla2-qt5")
1420 (define-public opencascade-oce
1422 (name "opencascade-oce")
1428 "https://github.com/tpaviot/oce/archive/OCE-"
1431 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1434 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1435 (build-system cmake-build-system)
1438 (list "-DOCE_TESTING:BOOL=ON"
1439 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1440 "-DOCE_DRAW:BOOL=ON"
1441 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1442 (assoc-ref %outputs "out"))
1443 "-UCMAKE_INSTALL_RPATH")))
1445 `(("freetype" ,freetype)
1452 `(("python" ,python-wrapper)))
1453 (home-page "https://github.com/tpaviot/oce")
1454 (synopsis "Libraries for 3D modeling and numerical simulation")
1456 "Open CASCADE is a set of libraries for the development of applications
1457 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1458 C++ class libraries providing services for 3D surface and solid modeling, CAD
1459 data exchange, and visualization. It is used for development of specialized
1460 software dealing with 3D models in design (CAD), manufacturing (CAM),
1461 numerical simulation (CAE), measurement equipment (CMM), and quality
1462 control (CAQ) domains.
1464 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1465 patches, improvements, and experiments contributed by users over the official
1466 Open CASCADE library.")
1467 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1468 ; use of header files; see
1469 ; OCCT_LGPL_EXCEPTION.txt
1470 license:public-domain; files
1471 ; src/Standard/Standard_StdAllocator.hxx and
1472 ; src/NCollection/NCollection_StdAllocator.hxx
1473 license:expat; file src/OpenGl/OpenGl_glext.h
1474 license:bsd-3)))); test framework gtest
1483 (uri (string-append "http://gmsh.info/src/gmsh-"
1484 version "-source.tgz"))
1486 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1487 (modules '((guix build utils)))
1489 ;; Remove non-free METIS code
1491 (delete-file-recursively "contrib/Metis")
1493 (build-system cmake-build-system)
1496 ("gfortran" ,gfortran)
1502 ("opencascade-oce" ,opencascade-oce)
1504 ("libxext" ,libxext)))
1506 `(("fontconfig" ,fontconfig)
1507 ("libxft" ,libxft)))
1509 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1510 "-DENABLE_BUILD_SHARED:BOOL=ON"
1511 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1512 (home-page "http://www.geuz.org/gmsh/")
1513 (synopsis "3D finite element grid generator")
1514 (description "Gmsh is a 3D finite element grid generator with a built-in
1515 CAD engine and post-processor. Its design goal is to provide a fast, light
1516 and user-friendly meshing tool with parametric input and advanced
1517 visualization capabilities. Gmsh is built around four modules: geometry,
1518 mesh, solver and post-processing. The specification of any input to these
1519 modules is done either interactively using the graphical user interface or in
1520 ASCII text files using Gmsh's own scripting language.")
1521 (license license:gpl2+)))
1523 (define-public maxflow
1530 (url "https://github.com/gerddie/maxflow.git")
1531 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1532 (file-name (string-append name "-" version "-checkout"))
1535 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1536 (build-system cmake-build-system)
1537 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1538 (synopsis "Library implementing Maxflow algorithm")
1539 (description "An implementation of the maxflow algorithm described in
1540 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1541 Energy Minimization in Computer Vision.\n
1542 Yuri Boykov and Vladimir Kolmogorov.\n
1543 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1545 (license license:gpl3+)))
1547 (define-public petsc
1554 ;; The *-lite-* tarball does not contain the *large* documentation
1555 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1556 "petsc-lite-" version ".tar.gz"))
1558 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1559 (build-system gnu-build-system)
1561 `(("python" ,python-2)))
1563 `(("gfortran" ,gfortran)
1565 ("superlu" ,superlu)
1566 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1567 ;; leaving out opengl, as configuration seems to only be for mac
1570 `(#:test-target "test"
1571 #:parallel-build? #f ;build is parallel by default
1576 ,(string-append "--with-superlu-include="
1577 (assoc-ref %build-inputs "superlu") "/include")
1578 ,(string-append "--with-superlu-lib="
1579 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1581 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1582 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1583 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1585 (modify-phases %standard-phases
1587 ;; PETSc's configure script is actually a python script, so we can't
1588 ;; run it with bash.
1589 (lambda* (#:key outputs (configure-flags '())
1591 (let* ((prefix (assoc-ref outputs "out"))
1592 (flags `(,(string-append "--prefix=" prefix)
1593 ,@configure-flags)))
1594 (format #t "build directory: ~s~%" (getcwd))
1595 (format #t "configure flags: ~s~%" flags)
1596 (zero? (apply system* "./configure" flags)))))
1597 (add-after 'configure 'clean-local-references
1598 (lambda* (#:key outputs #:allow-other-keys)
1599 (let ((out (assoc-ref outputs "out")))
1600 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1601 ;; Prevent build directory from leaking into compiled code
1603 ;; Scrub timestamp for reproducibility
1604 ((".*Libraries compiled on.*") ""))
1605 (substitute* (find-files "." "petscvariables")
1606 ;; Do not expose build machine characteristics, set to defaults.
1607 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1608 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1610 (add-after 'install 'clean-install
1611 ;; Try to keep installed files from leaking build directory names.
1612 (lambda* (#:key inputs outputs #:allow-other-keys)
1613 (let ((out (assoc-ref outputs "out")))
1614 (substitute* (map (lambda (file)
1615 (string-append out "/lib/petsc/conf/" file))
1616 '("petscvariables"))
1618 ;; Make compiler references point to the store
1619 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1620 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1621 (string-append "= " (which compiler))))
1622 ;; PETSc installs some build logs, which aren't necessary.
1623 (for-each (lambda (file)
1624 (let ((f (string-append out "/lib/petsc/conf/" file)))
1625 (when (file-exists? f)
1627 '("configure.log" "make.log" "gmake.log"
1628 "test.log" "error.log" "RDict.db"
1629 "PETScBuildInternal.cmake"
1630 ;; Once installed, should uninstall with Guix
1633 (home-page "http://www.mcs.anl.gov/petsc")
1634 (synopsis "Library to solve PDEs")
1635 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1636 data structures and routines for the scalable (parallel) solution of
1637 scientific applications modeled by partial differential equations.")
1638 (license (license:non-copyleft
1639 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1641 (define-public petsc-complex
1642 (package (inherit petsc)
1643 (name "petsc-complex")
1645 (substitute-keyword-arguments (package-arguments petsc)
1646 ((#:configure-flags cf)
1647 `(cons "--with-scalar-type=complex" ,cf))))
1648 (synopsis "Library to solve PDEs (with complex scalars)")))
1650 (define-public petsc-openmpi
1651 (package (inherit petsc)
1652 (name "petsc-openmpi")
1654 `(("openmpi" ,openmpi)
1655 ,@(package-inputs petsc)))
1657 (substitute-keyword-arguments (package-arguments petsc)
1658 ((#:configure-flags cf)
1659 ``("--with-mpiexec=mpirun"
1660 ,(string-append "--with-mpi-dir="
1661 (assoc-ref %build-inputs "openmpi"))
1662 ,@(delete "--with-mpi=0" ,cf)))))
1663 (synopsis "Library to solve PDEs (with MPI support)")))
1665 (define-public petsc-complex-openmpi
1666 (package (inherit petsc-complex)
1667 (name "petsc-complex-openmpi")
1669 `(("openmpi" ,openmpi)
1670 ,@(package-inputs petsc-complex)))
1672 (substitute-keyword-arguments (package-arguments petsc-complex)
1673 ((#:configure-flags cf)
1674 ``("--with-mpiexec=mpirun"
1675 ,(string-append "--with-mpi-dir="
1676 (assoc-ref %build-inputs "openmpi"))
1677 ,@(delete "--with-mpi=0" ,cf)))))
1678 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1680 (define-public slepc
1687 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1691 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1692 (build-system gnu-build-system)
1694 `(("python" ,python-2)))
1696 `(("arpack" ,arpack-ng)
1697 ("gfortran" ,gfortran)))
1699 `(("petsc" ,petsc)))
1701 `(#:parallel-build? #f ;build is parallel by default
1703 `(,(string-append "--with-arpack-dir="
1704 (assoc-ref %build-inputs "arpack") "/lib"))
1705 #:make-flags ;honor (parallel-job-count)
1706 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1708 (modify-phases %standard-phases
1710 ;; configure is a python script, so we can't run it with bash.
1711 (lambda* (#:key inputs outputs (configure-flags '())
1713 (let* ((prefix (assoc-ref outputs "out"))
1714 (flags `(,(string-append "--prefix=" prefix)
1715 ,@configure-flags)))
1716 (format #t "build directory: ~s~%" (getcwd))
1717 (format #t "configure flags: ~s~%" flags)
1718 (setenv "SLEPC_DIR" (getcwd))
1719 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1720 (apply invoke "./configure" flags))))
1721 (add-after 'install 'delete-doc
1722 ;; TODO: SLEPc installs HTML documentation alongside headers in
1723 ;; $out/include. We'd like to move them to share/doc, but delete
1724 ;; them for now, as they are incomplete and installing the complete
1725 ;; documentation is difficult.
1726 (lambda* (#:key outputs #:allow-other-keys)
1727 (let* ((out (assoc-ref outputs "out")))
1728 (for-each delete-file (find-files out "\\.html$")))))
1729 (add-after 'install 'clean-install
1730 ;; Clean up unnecessary build logs from installation.
1731 (lambda* (#:key outputs #:allow-other-keys)
1732 (let ((out (assoc-ref outputs "out")))
1733 (for-each (lambda (file)
1734 (let ((f (string-append out "/lib/slepc/conf/" file)))
1735 (when (file-exists? f)
1737 '("configure.log" "make.log" "gmake.log"
1738 "test.log" "error.log" "RDict.db"
1739 "uninstall.py"))))))))
1740 (home-page "http://slepc.upv.es")
1741 (synopsis "Scalable library for eigenproblems")
1742 (description "SLEPc is a software library for the solution of large sparse
1743 eigenproblems on parallel computers. It can be used for the solution of
1744 linear eigenvalue problems formulated in either standard or generalized form,
1745 as well as other related problems such as the singular value decomposition.
1746 The emphasis of the software is on methods and techniques appropriate for
1747 problems in which the associated matrices are sparse, for example, those
1748 arising after the discretization of partial differential equations.")
1749 (license license:bsd-2)))
1751 (define-public slepc-complex
1752 (package (inherit slepc)
1753 (name "slepc-complex")
1755 `(("petsc" ,petsc-complex)
1756 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1757 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1759 (define-public slepc-openmpi
1760 (package (inherit slepc)
1761 (name "slepc-openmpi")
1764 ("arpack" ,arpack-ng-openmpi)
1765 ,@(alist-delete "arpack" (package-inputs slepc))))
1767 `(("petsc" ,petsc-openmpi)
1768 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1769 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1771 (define-public slepc-complex-openmpi
1772 (package (inherit slepc-openmpi)
1773 (name "slepc-complex-openmpi")
1775 `(("petsc" ,petsc-complex-openmpi)
1776 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1777 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1779 (define-public mumps
1786 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1790 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
1791 (patches (search-patches "mumps-build-parallelism.patch"))))
1792 (build-system gnu-build-system)
1794 `(("fortran" ,gfortran)
1795 ;; These are required for linking against mumps, but we let the user
1796 ;; declare the dependency.
1799 ("scotch" ,scotch)))
1801 `(#:modules ((ice-9 match)
1804 ,@%gnu-build-system-modules)
1806 (modify-phases %standard-phases
1808 (lambda* (#:key inputs #:allow-other-keys)
1809 (call-with-output-file "Makefile.inc"
1820 INCSEQ = -I$(topdir)/libseq
1821 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1822 LIBSEQNEEDED = libseqneeded~;
1826 AR = ar vr # rules require trailing space, ugh...
1828 LIBBLAS = -L~a -lopenblas~@[
1829 SCALAP = -L~a -lscalapack~]
1830 LIBOTHERS = -pthread
1833 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1837 LIBS = $(SCALAP) $(LIBSEQ)
1838 LPORDDIR = $(topdir)/PORD/lib
1839 IPORD = -I$(topdir)/PORD/include
1840 LPORD = -L$(LPORDDIR) -lpord
1841 ORDERINGSF = -Dpord~@[
1843 IMETIS = -I$(METISDIR)/include
1844 LMETIS = -L$(METISDIR)/lib -lmetis
1845 ORDERINGSF += -Dmetis~]~@[~:{
1847 ISCOTCH = -I$(SCOTCHDIR)/include
1848 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1849 ORDERINGSF += ~a~}~]
1850 ORDERINGSC = $(ORDERINGSF)
1851 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1852 IORDERINGSF = $(ISCOTCH)
1853 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1854 (assoc-ref inputs "mpi")
1855 (assoc-ref inputs "blas")
1856 (assoc-ref inputs "scalapack")
1857 (assoc-ref inputs "metis")
1858 (match (list (assoc-ref inputs "pt-scotch")
1859 (assoc-ref inputs "scotch"))
1863 `((,scotch "" "-Dscotch")))
1866 "-lptesmumps -lptscotch -lptscotcherr "
1867 "-Dptscotch")))))))))
1869 ;; By default only the d-precision library is built. Make with "all"
1870 ;; target so that all precision libraries and examples are built.
1872 (zero? (system* "make" "all"
1873 (format #f "-j~a" (parallel-job-count))))))
1875 ;; Run the simple test drivers, which read test input from stdin:
1876 ;; from the "real" input for the single- and double-precision
1877 ;; testers, and from the "cmplx" input for complex-precision
1878 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1879 ;; package to prefix execution with "mpirun".
1880 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1881 (with-directory-excursion "examples"
1884 (let ((tester (apply open-pipe*
1887 ,(string-append "./" prec
1889 (input (open-input-file
1890 (string-append "input_simpletest_" type))))
1892 (dump-port input tester)
1894 (zero? (close-pipe tester)))))
1896 '("real" "real" "cmplx" "cmplx")))))
1898 (lambda* (#:key outputs #:allow-other-keys)
1899 (let* ((out (assoc-ref outputs "out"))
1900 (libdir (string-append out "/lib")))
1901 (copy-recursively "lib" libdir)
1902 (copy-recursively "include" (string-append out "/include"))
1903 (when (file-exists? "libseq/libmpiseq.a")
1904 (install-file "libseq/libmpiseq.a" libdir))
1906 (home-page "http://mumps.enseeiht.fr")
1907 (synopsis "Multifrontal sparse direct solver")
1909 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1910 sparse system of linear equations A x = b using Guassian elimination.")
1911 (license license:cecill-c)))
1913 (define-public mumps-metis
1914 (package (inherit mumps)
1915 (name "mumps-metis")
1917 (alist-delete "scotch" (package-inputs mumps)))))
1919 (define-public mumps-openmpi
1920 (package (inherit mumps)
1921 (name "mumps-openmpi")
1924 ("scalapack" ,scalapack)
1925 ("pt-scotch" ,pt-scotch)
1926 ,@(alist-delete "scotch" (package-inputs mumps))))
1928 (substitute-keyword-arguments (package-arguments mumps)
1930 `(modify-phases ,phases
1934 ((assoc-ref ,phases 'check)
1935 #:exec-prefix '("mpirun" "-n" "2"))))))))
1936 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1938 (define-public mumps-metis-openmpi
1939 (package (inherit mumps-openmpi)
1940 (name "mumps-metis-openmpi")
1942 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1944 (define-public r-quadprog
1951 (uri (cran-uri "quadprog" version))
1954 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1955 (build-system r-build-system)
1957 `(("gfortran" ,gfortran)))
1958 (home-page "https://cran.r-project.org/web/packages/quadprog")
1959 (synopsis "Functions to solve quadratic programming problems")
1961 "This package contains routines and documentation for solving quadratic
1962 programming problems.")
1963 (license license:gpl3+)))
1965 (define-public r-pracma
1971 (uri (cran-uri "pracma" version))
1973 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
1974 (build-system r-build-system)
1976 `(("r-quadprog" ,r-quadprog)))
1977 (home-page "https://cran.r-project.org/web/packages/pracma")
1978 (synopsis "Practical numerical math functions")
1979 (description "This package provides functions for numerical analysis and
1980 linear algebra, numerical optimization, differential equations, plus some
1981 special functions. It uses Matlab function names where appropriate to simplify
1983 (license license:gpl3+)))
1985 (define-public ruby-asciimath
1987 (name "ruby-asciimath")
1992 (uri (rubygems-uri "asciimath" version))
1995 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
1996 (build-system ruby-build-system)
1999 (modify-phases %standard-phases
2001 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2002 (add-after 'unpack 'patch-remove-spurious-backslashes
2004 (substitute* "spec/parser_spec.rb"
2008 `(("bundler" ,bundler)
2009 ("ruby-rspec" ,ruby-rspec)))
2010 (synopsis "AsciiMath parsing and conversion library")
2012 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2013 easy-to-write markup language for mathematics.")
2014 (home-page "https://github.com/asciidoctor/asciimath")
2015 (license license:expat)))
2017 (define-public superlu
2024 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2025 "superlu_" version ".tar.gz"))
2027 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2028 (modules '((guix build utils)))
2030 ;; Replace the non-free implementation of MC64 with a stub adapted
2033 (use-modules (ice-9 regex)
2035 (call-with-output-file "SRC/mc64ad.c"
2040 void mc64id_(int *a) {
2041 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2044 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2045 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2046 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2049 ;; Remove the corresponding license verbiage. MC64 license follows
2050 ;; a "------" line separator.
2051 (with-atomic-file-replacement "License.txt"
2052 (let ((rx (make-regexp "-{8}")))
2055 (let ((line (read-line in 'concat)))
2056 (unless (regexp-exec rx line)
2060 (build-system cmake-build-system)
2064 `(("blas" ,openblas)
2065 ("gfortran" ,gfortran)))
2067 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2068 "-DTPL_BLAS_LIBRARIES=openblas"
2069 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2070 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2071 (synopsis "Supernodal direct solver for sparse linear systems")
2073 "SuperLU is a general purpose library for the direct solution of large,
2074 sparse, nonsymmetric systems of linear equations on high performance machines.
2075 The library is written in C and is callable from either C or Fortran. The
2076 library routines perform an LU decomposition with partial pivoting and
2077 triangular system solves through forward and back substitution. The library
2078 also provides threshold-based ILU factorization preconditioners.")
2079 (license (list license:bsd-3
2080 license:gpl2+ ;EXAMPLE/*fgmr.c
2081 (license:fsf-free "file://SRC/colamd.h")))))
2083 (define-public superlu-dist
2085 (name "superlu-dist")
2090 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2091 "superlu_dist_" version ".tar.gz"))
2093 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
2094 (modules '((guix build utils)))
2096 ;; Replace the non-free implementation of MC64 with a stub
2098 (use-modules (ice-9 regex)
2100 (call-with-output-file "SRC/mc64ad.c"
2105 void mc64id_(int *a) {
2106 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2109 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2110 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2111 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2114 (delete-file "SRC/mc64ad.f.bak")
2115 (substitute* "SRC/util.c" ;adjust default algorithm
2116 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2117 "RowPerm = NOROWPERM"))
2119 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2120 (build-system gnu-build-system)
2124 `(("gfortran" ,gfortran)))
2126 `(("openmpi" ,openmpi) ;headers include MPI heades
2127 ("lapack" ,lapack) ;required to link with output library
2128 ("pt-scotch" ,pt-scotch))) ;same
2130 `(#:parallel-build? #f ;race conditions using ar
2132 (modify-phases %standard-phases
2134 (lambda* (#:key inputs outputs #:allow-other-keys)
2135 (call-with-output-file "make.inc"
2140 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2141 BLASDEF = -DUSE_VENDOR_BLAS
2142 BLASLIB = -L~a/lib -lblas
2143 PARMETISLIB = -L~a/lib \
2144 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2145 -lscotch -lscotcherr -lscotcherrexit
2146 METISLIB = -L~:*~a/lib \
2147 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2148 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2154 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2155 NOOPTS = -O0 -g $(PIC)
2157 FFLAGS = -O2 -g $(PIC)
2161 (assoc-ref outputs "out")
2162 (assoc-ref inputs "lapack")
2163 (assoc-ref inputs "pt-scotch"))))
2165 (add-after 'unpack 'remove-broken-symlinks
2167 (for-each delete-file
2168 (find-files "MAKE_INC" "\\.#make\\..*"))
2170 (add-before 'build 'create-install-directories
2171 (lambda* (#:key outputs #:allow-other-keys)
2174 (mkdir-p (string-append (assoc-ref outputs "out")
2180 (with-directory-excursion "EXAMPLE"
2182 (zero? (system* "mpirun" "-n" "2"
2183 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2184 (zero? (system* "mpirun" "-n" "2"
2185 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2187 (lambda* (#:key outputs #:allow-other-keys)
2188 ;; Library is placed in lib during the build phase. Copy over
2189 ;; headers to include.
2190 (let* ((out (assoc-ref outputs "out"))
2191 (incdir (string-append out "/include")))
2192 (for-each (lambda (file)
2193 (let ((base (basename file)))
2194 (format #t "installing `~a' to `~a'~%"
2197 (string-append incdir "/" base))))
2198 (find-files "SRC" ".*\\.h$")))
2200 (home-page (package-home-page superlu))
2201 (synopsis "Parallel supernodal direct solver")
2203 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2204 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2205 implemented in ANSI C, and MPI for communications.")
2206 (license license:bsd-3)))
2208 (define-public scotch
2215 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2216 "latestfile/298/scotch_" version ".tar.gz"))
2218 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
2219 (patches (search-patches "scotch-test-threading.patch"
2220 "scotch-build-parallelism.patch"
2221 "scotch-graph-induce-type-64.patch"
2222 "scotch-graph-diam-64.patch"))))
2223 (build-system gnu-build-system)
2230 (modify-phases %standard-phases
2232 'unpack 'chdir-to-src
2233 (lambda _ (chdir "src")))
2237 (call-with-output-file "Makefile.inc"
2251 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2252 LDFLAGS = -lz -lm -lrt -lpthread
2254 LEX = flex -Pscotchyy -olex.yy.c
2259 YACC = bison -pscotchyy -y -b y
2261 '("COMMON_FILE_COMPRESS_GZ"
2263 "COMMON_RANDOM_FIXED_SEED"
2264 "INTSIZE64" ;use 'long' instead of 'int'
2265 ;; Prevents symbolc clashes with libesmumps
2267 ;; XXX: Causes invalid frees in superlu-dist tests
2269 ;; "SCOTCH_PTHREAD_NUMBER=2"
2270 "restrict=__restrict"))))))
2272 'build 'build-esmumps
2274 (zero? (system* "make"
2275 (format #f "-j~a" (parallel-job-count))
2279 (lambda* (#:key outputs #:allow-other-keys)
2280 (let ((out (assoc-ref outputs "out")))
2282 (zero? (system* "make"
2283 (string-append "prefix=" out)
2285 ;; esmumps files are not installed with the above
2286 (for-each (lambda (f)
2287 (copy-file f (string-append out "/include/" f)))
2288 (find-files "../include" ".*esmumps.h$"))
2289 (for-each (lambda (f)
2290 (copy-file f (string-append out "/lib/" f)))
2291 (find-files "../lib" "^lib.*esmumps.*"))))))))
2292 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2293 (synopsis "Programs and libraries for graph algorithms")
2294 (description "SCOTCH is a set of programs and libraries which implement
2295 the static mapping and sparse matrix reordering algorithms developed within
2296 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2297 conquer approach, to scientific computing problems such as graph and mesh
2298 partitioning, static mapping, and sparse matrix ordering, in application
2299 domains ranging from structural mechanics to operating systems or
2301 ;; See LICENSE_en.txt
2302 (license license:cecill-c)))
2304 (define-public scotch32
2305 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2306 ;; some applications.
2307 (package (inherit scotch)
2310 (substitute-keyword-arguments (package-arguments scotch)
2311 ((#:phases scotch-phases)
2312 `(modify-phases ,scotch-phases
2316 (call-with-output-file "Makefile.inc"
2330 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2331 LDFLAGS = -lz -lm -lrt -lpthread
2333 LEX = flex -Pscotchyy -olex.yy.c
2338 YACC = bison -pscotchyy -y -b y
2340 '("COMMON_FILE_COMPRESS_GZ"
2342 "COMMON_RANDOM_FIXED_SEED"
2343 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2344 ;; Prevents symbolc clashes with libesmumps
2346 ;; XXX: Causes invalid frees in superlu-dist tests
2348 ;; "SCOTCH_PTHREAD_NUMBER=2"
2349 "restrict=__restrict"))))))))))
2351 "Programs and libraries for graph algorithms (32-bit integers)")))
2353 (define-public pt-scotch
2354 (package (inherit scotch)
2357 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2359 (substitute-keyword-arguments (package-arguments scotch)
2360 ((#:phases scotch-phases)
2361 `(modify-phases ,scotch-phases
2366 (zero? (system* "make"
2367 (format #f "-j~a" (parallel-job-count))
2368 "ptscotch" "ptesmumps"))
2369 ;; Install the serial metis compatibility library
2370 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2373 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2374 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2376 (define-public pt-scotch32
2377 (package (inherit scotch32)
2378 (name "pt-scotch32")
2380 `(("openmpi" ,openmpi))) ;headers include MPI headers
2382 (substitute-keyword-arguments (package-arguments scotch32)
2383 ((#:phases scotch32-phases)
2384 `(modify-phases ,scotch32-phases
2388 (zero? (system* "make"
2389 (format #f "-j~a" (parallel-job-count))
2390 "ptscotch" "ptesmumps"))
2391 ;; Install the serial metis compatibility library
2392 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2395 (zero? (system* "make" "ptcheck"))))))))
2397 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2399 (define-public metis
2406 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2407 "metis-" version ".tar.gz"))
2410 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2411 (build-system cmake-build-system)
2413 `(("blas" ,openblas)))
2415 `(#:tests? #f ;no tests
2416 #:configure-flags `("-DSHARED=ON"
2417 ,(string-append "-DGKLIB_PATH=" (getcwd)
2418 "/metis-" ,version "/GKlib"))))
2419 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2420 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2422 "METIS is a set of serial programs for partitioning graphs, partitioning
2423 finite element meshes, and producing fill-reducing orderings for sparse
2424 matrices. The algorithms implemented in METIS are based on the multilevel
2425 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2427 (license license:asl2.0))) ;As of version 5.0.3
2429 (define-public p4est
2436 (uri (string-append "http://p4est.github.io/release/p4est-"
2440 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2441 (build-system gnu-build-system)
2443 `(("fortran" ,gfortran)
2448 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2449 (assoc-ref %build-inputs "blas")
2451 ,(string-append "LAPACK_LIBS=-L"
2452 (assoc-ref %build-inputs "lapack")
2454 (home-page "http://www.p4est.org")
2455 (synopsis "Adaptive mesh refinement on forests of octrees")
2457 "The p4est software library enables the dynamic management of a
2458 collection of adaptive octrees, conveniently called a forest of octrees.
2459 p4est is designed to work in parallel and scales to hundreds of thousands of
2461 (license license:gpl2+)))
2463 (define-public p4est-openmpi
2464 (package (inherit p4est)
2465 (name "p4est-openmpi")
2468 ,@(package-inputs p4est)))
2470 (substitute-keyword-arguments (package-arguments p4est)
2471 ((#:configure-flags cf)
2472 ``("--enable-mpi" ,@,cf))))
2473 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2475 (define-public gsegrafix
2482 (uri (string-append "mirror://gnu/" name "/" name "-"
2486 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2487 (build-system gnu-build-system)
2489 `(#:configure-flags '("LDFLAGS=-lm")))
2491 `(("libgnomecanvas" ,libgnomecanvas)
2492 ("libbonoboui" ,libbonoboui)
2493 ("libgnomeui" ,libgnomeui)
2494 ("libgnomeprintui" ,libgnomeprintui)
2497 `(("pkg-config" ,pkg-config)))
2498 (home-page "https://www.gnu.org/software/gsegrafix/")
2499 (synopsis "GNOME application to create scientific and engineering plots")
2500 (description "GSEGrafix is an application which produces high-quality graphical
2501 plots for science and engineering. Plots are specified via simple ASCII
2502 parameter files and data files and are presented in an anti-aliased GNOME
2503 canvas. The program supports rectangular two-dimensional plots, histograms,
2504 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2505 to BMP, JPEG or PNG image formats.")
2506 (license license:gpl3+)))
2508 (define-public maxima
2515 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2516 version "-source/" name "-" version ".tar.gz"))
2519 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2520 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2521 (build-system gnu-build-system)
2524 ("gnuplot" ,gnuplot) ;for plots
2525 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2527 `(("texinfo" ,texinfo)
2529 ("python" ,python)))
2532 (list "--enable-gcl"
2533 (string-append "--with-posix-shell="
2534 (assoc-ref %build-inputs "bash")
2536 (string-append "--with-wish="
2537 (assoc-ref %build-inputs "tk")
2539 (let ((v ,(package-version tk)))
2540 (string-take v (string-index-right v #\.)))))
2541 ;; By default Maxima attempts to write temporary files to
2542 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2543 ;; Work around that.
2544 #:make-flags (list "TMPDIR=/tmp")
2546 (modify-phases %standard-phases
2547 (add-before 'check 'pre-check
2549 (chmod "src/maxima" #o555)
2551 ;; Make sure the doc and emacs files are found in the
2552 ;; standard location. Also configure maxima to find gnuplot
2553 ;; without having it on the PATH.
2554 (add-after 'install 'post-install
2555 (lambda* (#:key outputs inputs #:allow-other-keys)
2556 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2557 (out (assoc-ref outputs "out"))
2558 (datadir (string-append out "/share/maxima/" ,version))
2559 (binutils (string-append (assoc-ref inputs "binutils")
2561 (with-directory-excursion out
2562 (mkdir-p "share/emacs")
2563 (mkdir-p "share/doc")
2565 (string-append datadir "/emacs/")
2566 (string-append out "/share/emacs/site-lisp"))
2568 (string-append datadir "/doc/")
2569 (string-append out "/share/doc/maxima"))
2570 (with-atomic-file-replacement
2571 (string-append datadir "/share/maxima-init.lisp")
2573 (format out "~a ~s~a~%"
2574 "(setf $gnuplot_command "
2575 (string-append gnuplot "/bin/gnuplot") ")")
2576 (dump-port in out))))
2577 ;; Ensure that Maxima will have access to the GNU binutils
2578 ;; components at runtime.
2579 (wrap-program (string-append out "/bin/maxima")
2580 `("PATH" prefix (,binutils))))
2582 (home-page "http://maxima.sourceforge.net")
2583 (synopsis "Numeric and symbolic expression manipulation")
2584 (description "Maxima is a system for the manipulation of symbolic and
2585 numerical expressions. It yields high precision numeric results by using
2586 exact fractions, arbitrary precision integers, and variable precision floating
2588 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2589 ;; Others simply say "GNU General Public License" without stating a
2590 ;; version (which implicitly means gpl1+).
2591 ;; At least one file (src/maxima.asd) says "version 2."
2592 ;; GPLv2 only is therefore the smallest subset.
2593 (license license:gpl2)))
2595 (define-public wxmaxima
2602 (uri (string-append "https://github.com/andrejv/" name "/archive"
2603 "/Version-" version ".tar.gz"))
2604 (file-name (string-append name "-" version ".tar.gz"))
2607 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2609 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2610 (build-system cmake-build-system)
2612 `(("gettext" ,gettext-minimal)))
2614 `(("wxwidgets" ,wxwidgets)
2617 ("adwaita-icon-theme" ,adwaita-icon-theme)
2619 ("shared-mime-info" ,shared-mime-info)))
2621 `(#:tests? #f ; no check target
2623 (modify-phases %standard-phases
2624 (add-after 'install 'wrap-program
2625 (lambda* (#:key inputs outputs #:allow-other-keys)
2626 (wrap-program (string-append (assoc-ref outputs "out")
2629 (,(string-append (assoc-ref inputs "maxima")
2631 ;; For GtkFileChooserDialog.
2632 `("GSETTINGS_SCHEMA_DIR" =
2633 (,(string-append (assoc-ref inputs "gtk+")
2634 "/share/glib-2.0/schemas")))
2635 `("XDG_DATA_DIRS" ":" prefix
2636 (;; Needed by gdk-pixbuf to know supported icon formats.
2638 (assoc-ref inputs "shared-mime-info") "/share")
2639 ;; The default icon theme of GTK+.
2641 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2643 (home-page "https://andrejv.github.io/wxmaxima/")
2644 (synopsis "Graphical user interface for the Maxima computer algebra system")
2646 "wxMaxima is a graphical user interface for the Maxima computer algebra
2647 system. It eases the use of Maxima by making most of its commands available
2648 through a menu system and by providing input dialogs for commands that require
2649 more than one argument. It also implements its own display engine that
2650 outputs mathematical symbols directly instead of depicting them with ASCII
2653 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2654 text and mathematical calculations to create documents, exporting of input and
2655 output to TeX, and a browser for Maxima's manual including command index and
2656 full text searching.")
2657 (license license:gpl2+)))
2659 (define-public armadillo
2665 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2669 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2670 (build-system cmake-build-system)
2671 (arguments `(#:tests? #f)) ;no test target
2673 `(("openblas" ,openblas)
2675 ("arpack" ,arpack-ng)))
2676 (home-page "http://arma.sourceforge.net/")
2677 (synopsis "C++ linear algebra library")
2679 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2680 between speed and ease of use. It is useful for algorithm development
2681 directly in C++, or quick conversion of research code into production
2682 environments. It can be used for machine learning, pattern recognition,
2683 signal processing, bioinformatics, statistics, econometrics, etc. The library
2684 provides efficient classes for vectors, matrices and cubes, as well as 150+
2685 associated functions (eg. contiguous and non-contiguous submatrix views).")
2686 (license license:asl2.0)))
2688 (define-public muparser
2689 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2690 ;; different hash. In order to make `guix package --upgrade` work correctly,
2691 ;; we set a Guix packaging revision.
2692 ;; When the next version of muparser is released, we can remove
2693 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2694 (let ((upstream-version "2.2.5")
2698 (version (string-append upstream-version "-" revision))
2702 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2703 upstream-version ".tar.gz"))
2704 (file-name (string-append name "-" version ".tar.gz"))
2707 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2708 (build-system gnu-build-system)
2710 `(#:configure-flags '("--enable-samples=no")
2711 #:tests? #f)) ;no "check" target
2712 (home-page "http://muparser.beltoforion.de/")
2713 (synopsis "Fast parser library for mathematical expressions")
2715 "muParser is an extensible high performance math parser library. It is
2716 based on transforming an expression into a bytecode and precalculating constant
2718 (license license:expat))))
2720 (define-public openblas
2727 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2729 (file-name (string-append name "-" version ".tar.gz"))
2732 "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a"))))
2733 (build-system gnu-build-system)
2735 `(#:test-target "test"
2736 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2737 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2738 ;; we need to disable substitutions.
2740 ,(let ((system (or (%current-target-system) (%current-system))))
2741 (or (string-prefix? "x86_64" system)
2742 (string-prefix? "i686" system)
2743 (string-prefix? "mips" system)
2744 (string-prefix? "aarch64" system)))
2746 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2748 ;; Build the library for all supported CPUs. This allows
2749 ;; switching CPU targets at runtime with the environment variable
2750 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2751 ;; Unfortunately, this is not supported on non-x86 architectures,
2752 ;; where it leads to failed builds.
2753 ,@(let ((system (or (%current-target-system) (%current-system))))
2755 ((or (string-prefix? "x86_64" system)
2756 (string-prefix? "i686" system))
2757 '("DYNAMIC_ARCH=1"))
2758 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2759 ;; two available MIPS targets special extended instructions
2760 ;; for Loongson cores are used.
2761 ((string-prefix? "mips" system)
2762 '("TARGET=SICORTEX"))
2763 ;; On aarch64 force the generic 'armv8-a' target
2764 ((string-prefix? "aarch64" system)
2767 ;; no configure script
2769 (modify-phases %standard-phases
2771 (add-before 'build 'set-extralib
2772 (lambda* (#:key inputs #:allow-other-keys)
2773 ;; Get libgfortran found when building in utest.
2775 (string-append "-L" (assoc-ref inputs "fortran-lib")
2779 `(("fortran-lib" ,gfortran "lib")))
2782 ("fortran" ,gfortran)
2784 (home-page "http://www.openblas.net/")
2785 (synopsis "Optimized BLAS library based on GotoBLAS")
2787 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2788 (license license:bsd-3)))
2790 (define* (make-blis implementation #:optional substitutable?)
2791 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2792 source tree for a list of implementations.)
2794 SUBSTITUTABLE? determines whether the package is made available as a
2797 Currently the specialization must be selected at configure-time, but work is
2798 underway to allow BLIS to select the right optimized kernels at run time:
2799 <https://github.com/flame/blis/issues/129>."
2801 (name (if (string=? implementation "reference")
2803 (string-append "blis-" implementation)))
2805 (home-page "https://github.com/flame/blis")
2808 (uri (git-reference (url home-page) (commit version)))
2811 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2812 (file-name (git-file-name "blis" version))))
2813 (build-system gnu-build-system)
2815 `(#:test-target "test"
2817 #:substitutable? ,substitutable?
2819 #:phases (modify-phases %standard-phases
2821 (lambda* (#:key outputs #:allow-other-keys)
2822 ;; This is a home-made 'configure' script.
2823 (let ((out (assoc-ref outputs "out")))
2824 (zero? (system* "./configure" "-p" out
2828 "--enable-threading=openmp"
2830 ,implementation)))))
2831 (add-before 'check 'show-test-output
2833 ;; By default "make check" is silent. Make it verbose.
2834 (system "tail -F output.testsuite &")
2836 (synopsis "High-performance basic linear algebra (BLAS) routines")
2838 "BLIS is a portable software framework for instantiating high-performance
2839 BLAS-like dense linear algebra libraries. The framework was designed to
2840 isolate essential kernels of computation that, when optimized, immediately
2841 enable optimized implementations of most of its commonly used and
2842 computationally intensive operations. While BLIS exports a new BLAS-like API,
2843 it also includes a BLAS compatibility layer which gives application developers
2844 access to BLIS implementations via traditional BLAS routine calls.")
2845 (license license:bsd-3)))
2848 ;; This is the "reference" implementation, which is the non-optimized but
2849 ;; portable variant (no assembly).
2850 (make-blis "reference" #t))
2852 (define ignorance blis)
2854 (define-syntax-rule (blis/x86_64 processor)
2855 "Expand to a package specialized for PROCESSOR."
2857 (inherit (make-blis processor))
2858 (supported-systems '("x86_64-linux"))))
2860 (define-public blis-sandybridge
2861 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2862 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2863 (blis/x86_64 "sandybridge"))
2865 (define-public blis-haswell
2866 ;; BLIS specialized for Haswell processors (launched 2013):
2867 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2868 (blis/x86_64 "haswell"))
2870 (define-public blis-knl
2871 ;; BLIS specialized for Knights Landing processor (launched 2016):
2872 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2873 (blis/x86_64 "knl"))
2876 (define-public openlibm
2883 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2885 (file-name (string-append name "-" version ".tar.gz"))
2888 "1z8cj5q8ca8kmrakwkpjxf8svi81waw0c568cx8v8pv9kvswbp07"))))
2889 (build-system gnu-build-system)
2892 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2894 ;; no configure script
2895 (modify-phases %standard-phases (delete 'configure))
2896 #:tests? #f)) ;the tests are part of the default target
2897 (home-page "http://openlibm.org/")
2898 (synopsis "Portable C mathematical library (libm)")
2900 "OpenLibm is an effort to have a high quality, portable, standalone C
2901 mathematical library (libm). It can be used standalone in applications and
2902 programming language implementations. The project was born out of a need to
2903 have a good libm for the Julia programming language that worked consistently
2904 across compilers and operating systems, and in 32-bit and 64-bit
2906 ;; Each architecture has its own make target, and there is none for mips.
2907 (supported-systems (delete "mips64el-linux" %supported-systems))
2908 ;; See LICENSE.md for details.
2909 (license (list license:expat
2912 license:public-domain
2913 license:lgpl2.1+))))
2915 (define-public openspecfun
2917 (name "openspecfun")
2922 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2924 (file-name (string-append name "-" version ".tar.gz"))
2927 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
2928 (build-system gnu-build-system)
2930 '(#:tests? #f ; no "check" target
2932 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2934 (modify-phases %standard-phases
2935 (delete 'configure)))) ; no configure script
2937 `(("fortran" ,gfortran)))
2938 (home-page "https://github.com/JuliaLang/openspecfun")
2939 (synopsis "Collection of special mathematical functions")
2941 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2942 portable package for Bessel Functions of a Complex Argument and Nonnegative
2943 Order; it contains subroutines for computing Bessel functions and Airy
2944 functions. Faddeeva allows computing the various error functions of arbitrary
2945 complex arguments (Faddeeva function, error function, complementary error
2946 function, scaled complementary error function, imaginary error function, and
2947 Dawson function); given these, one can also easily compute Voigt functions,
2948 Fresnel integrals, and similar related functions as well.")
2949 ;; Faddeeva is released under the Expat license; AMOS is included as
2950 ;; public domain software.
2951 (license (list license:expat license:public-domain))))
2953 (define-public suitesparse
2955 (name "suitesparse")
2961 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2965 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2966 (modules '((guix build utils)))
2968 ;; Remove bundled metis source
2970 (delete-file-recursively "metis-5.1.0")
2972 (build-system gnu-build-system)
2974 '(#:tests? #f ;no "check" target
2979 "MY_METIS_LIB=-lmetis"
2980 (string-append "INSTALL_LIB="
2981 (assoc-ref %outputs "out") "/lib")
2982 (string-append "INSTALL_INCLUDE="
2983 (assoc-ref %outputs "out") "/include")
2986 (modify-phases %standard-phases
2987 (delete 'configure)))) ;no configure script
2992 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2993 (synopsis "Suite of sparse matrix software")
2995 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2996 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2997 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2998 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2999 CXSparse, a concise sparse Cholesky factorization package; and many other
3002 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3004 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3005 (license (list license:gpl2+ license:lgpl2.1+))))
3007 (define-public atlas
3013 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3014 version "/atlas" version ".tar.bz2"))
3017 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3018 (build-system gnu-build-system)
3019 (home-page "http://math-atlas.sourceforge.net/")
3020 (inputs `(("gfortran" ,gfortran)
3021 ("lapack-tar" ,(package-source lapack))))
3022 (outputs '("out" "doc"))
3023 ;; For the moment we drop support for MIPS at it fails to compile. See
3024 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3025 (supported-systems (delete "mips64el-linux" %supported-systems))
3027 `(#:parallel-build? #f
3028 #:parallel-tests? #f
3030 ;; ATLAS tunes itself for the machine it is built on, as explained at
3031 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3032 ;; For this reason, we want users to build it locally instead of using
3036 #:modules ((srfi srfi-26)
3038 (guix build gnu-build-system)
3041 `(;; Generate position independent code suitable for dynamic libraries
3042 ;; and use WALL timer to get more accurate timing.
3043 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3046 ,,(if (string-match "64" (%current-system))
3049 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3050 ;; needed to compile C files before it is generated.
3051 "-Ss" "pmake" "make -j 1"
3052 ;; Probe is failing for MIPS. We therefore define the system
3053 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3054 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3055 ,,@(if (string-prefix? "mips" (%current-system))
3056 (list "-A" "49" "-V" "1")
3058 ;; Generate shared libraries.
3060 ;; Build a full LAPACK library.
3061 ,(string-append "--with-netlib-lapack-tarfile="
3062 (assoc-ref %build-inputs "lapack-tar")))
3064 (modify-phases %standard-phases
3065 (add-after 'install 'install-doc
3066 (lambda* (#:key outputs inputs #:allow-other-keys)
3067 (let ((doc (string-append (assoc-ref outputs "doc")
3068 "/share/doc/atlas")))
3070 (fold (lambda (file previous)
3071 (and previous (zero? (system* "cp" file doc))))
3072 #t (find-files "../ATLAS/doc" ".*")))))
3073 (add-after 'check 'check-pt
3074 (lambda _ (zero? (system* "make" "ptcheck"))))
3075 ;; Fix files required to run configure.
3076 (add-before 'configure 'fix-/bin/sh
3078 ;; Use `sh', not `/bin/sh'.
3079 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3082 ;; Fix /bin/sh in generated make files.
3083 (add-after 'configure 'fix-/bin/sh-in-generated-files
3085 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3088 ;; ATLAS configure program does not accepts the default flags
3089 ;; passed by the 'gnu-build-system'.
3091 (lambda* (#:key native-inputs inputs outputs
3092 (configure-flags '())
3093 #:allow-other-keys #:rest args)
3094 (let* ((prefix (assoc-ref outputs "out"))
3095 (bash (or (and=> (assoc-ref
3096 (or native-inputs inputs) "bash")
3097 (cut string-append <> "/bin/bash"))
3099 (flags `(,(string-append "--prefix=" prefix)
3101 (abs-srcdir (getcwd))
3102 (srcdir (string-append "../" (basename abs-srcdir))))
3103 (format #t "source directory: ~s (relative from build: ~s)~%"
3107 (format #t "build directory: ~s~%" (getcwd))
3108 (format #t "configure flags: ~s~%" flags)
3109 (zero? (apply system* bash
3110 (string-append srcdir "/configure")
3112 (synopsis "Automatically Tuned Linear Algebra Software")
3114 "ATLAS is an automatically tuned linear algebra software library
3115 providing C and Fortran77 interfaces to a portably efficient BLAS
3116 implementation, as well as a few routines from LAPACK.
3118 Optimization occurs at build time. For this reason, the library is built on
3119 the machine where it is installed, without resorting to pre-built substitutes.
3121 Before building the library, CPU throttling should be disabled. This can be
3122 done in the BIOS, or, on GNU/Linux, with the following command:
3125 # cpupower --governor performance
3128 Failure to do so will result in a library with poor performance.")
3129 (license license:bsd-3)))
3138 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3139 "/glm-" version ".zip"))
3142 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3143 (build-system cmake-build-system)
3145 `(("unzip" ,unzip)))
3146 (home-page "http://glm.g-truc.net")
3147 (synopsis "OpenGL Mathematics library")
3148 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3149 library for graphics software based on the OpenGL Shading Language (GLSL)
3151 (license license:expat)))
3153 (define-public lpsolve
3160 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3161 "/lp_solve_" version "_source.tar.gz"))
3164 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3165 (modules '((guix build utils)))
3168 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3170 ;; Pretend to be on a 64 bit platform to obtain a common directory
3171 ;; name for the build results on all architectures; nothing else
3172 ;; seems to depend on it.
3173 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3175 ;; The check for 'isnan' as it is written fails with
3176 ;; "non-floating-point argument in call to function
3177 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3178 ;; definition, which in turn leads to bad things. Fix the feature
3180 (("isnan\\(0\\)") "isnan(0.)"))
3182 (build-system gnu-build-system)
3184 `(#:tests? #f ; no check target
3186 (modify-phases %standard-phases
3187 (delete 'configure) ; no configure script
3190 (with-directory-excursion "lpsolve55"
3191 (invoke "bash" "ccc"))
3192 (with-directory-excursion "lp_solve"
3193 (invoke "bash" "ccc"))
3196 (lambda* (#:key outputs #:allow-other-keys)
3197 (let* ((out (assoc-ref outputs "out"))
3198 (bin (string-append out "/bin"))
3199 (lib (string-append out "/lib"))
3200 ;; This is where LibreOffice expects to find the header
3201 ;; files, and where they are installed by Debian.
3202 (include (string-append out "/include/lpsolve")))
3203 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3204 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3205 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3207 ;; Install a subset of the header files as on Debian
3208 ;; (plus lp_bit.h, which matches the regular expression).
3209 (for-each (lambda (name)
3210 (install-file name include))
3211 (find-files "." "lp_[HMSa-z].*\\.h$"))
3212 (with-directory-excursion "shared"
3213 (for-each (lambda (name)
3214 (install-file name include))
3215 (find-files "." "\\.h$")))
3217 (home-page "http://lpsolve.sourceforge.net/")
3218 (synopsis "Mixed integer linear programming (MILP) solver")
3220 "lp_solve is a mixed integer linear programming solver based on the
3221 revised simplex and the branch-and-bound methods.")
3222 (license license:lgpl2.1+)))
3224 (define-public dealii
3231 (uri (string-append "https://github.com/dealii/dealii/releases/"
3232 "download/v" version "/dealii-" version ".tar.gz"))
3235 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3236 (modules '((guix build utils)))
3238 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3240 (delete-file-recursively "bundled")
3242 (build-system cmake-build-system)
3250 ("arpack" ,arpack-ng)
3251 ("muparser" ,muparser)
3252 ("gfortran" ,gfortran)
3253 ("suitesparse" ,suitesparse))) ;for UMFPACK
3255 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3257 ;; Work around a bug in libsuitesparseconfig linking
3258 ;; see https://github.com/dealii/dealii/issues/4745
3259 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3260 (home-page "https://www.dealii.org")
3261 (synopsis "Finite element library")
3263 "Deal.II is a C++ program library targeted at the computational solution
3264 of partial differential equations using adaptive finite elements. The main
3265 aim of deal.II is to enable rapid development of modern finite element codes,
3266 using among other aspects adaptive meshes and a wide array of tools often used
3267 in finite element programs.")
3268 (license license:lgpl2.1+)))
3270 (define-public dealii-openmpi
3271 (package (inherit dealii)
3272 (name "dealii-openmpi")
3275 ;;Supported only with MPI:
3276 ("p4est" ,p4est-openmpi)
3277 ("petsc" ,petsc-openmpi)
3278 ("slepc" ,slepc-openmpi)
3279 ("metis" ,metis) ;for MUMPS
3280 ("scalapack" ,scalapack) ;for MUMPS
3281 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3282 ("arpack" ,arpack-ng-openmpi)
3283 ,@(fold alist-delete (package-inputs dealii)
3284 '("p4est" "arpack"))))
3286 (substitute-keyword-arguments (package-arguments dealii)
3287 ((#:configure-flags cf)
3288 ``("-DMPI_C_COMPILER=mpicc"
3289 "-DMPI_CXX_COMPILER=mpicxx"
3290 "-DMPI_Fortran_COMPILER=mpifort"
3292 (synopsis "Finite element library (with MPI support)")))
3294 (define-public flann
3303 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3304 version "-src.zip"))
3307 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3308 (build-system cmake-build-system)
3310 "octave")) ;46 MiB .mex file that pulls Octave
3312 `(("unzip" ,unzip)))
3316 ("python" ,python-2) ; print syntax
3317 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3320 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3321 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3322 #:strip-directories '("lib" "lib64" "libexec"
3323 "bin" "sbin" "share/flann/octave")
3325 ;; Save 12 MiB by not installing .a files. Passing
3326 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3327 #:phases (modify-phases %standard-phases
3328 (add-before 'configure 'set-octave-directory
3329 (lambda* (#:key outputs #:allow-other-keys)
3330 ;; Install the .mex file in the "octave" output.
3331 (let ((out (assoc-ref outputs "octave")))
3332 (substitute* "src/matlab/CMakeLists.txt"
3333 (("share/flann/octave")
3334 (string-append out "/share/flann/octave")))
3336 (add-after 'install 'remove-static-libraries
3337 (lambda* (#:key outputs #:allow-other-keys)
3338 (let* ((out (assoc-ref outputs "out"))
3339 (lib (string-append out "/lib")))
3340 (for-each delete-file
3341 (find-files lib "\\.a$"))
3344 #:tests? #f)) ; The test data are downloaded from the Internet.
3345 (home-page "http://www.cs.ubc.ca/research/flann/")
3346 (synopsis "Library for approximate nearest neighbors computation")
3347 (description "FLANN is a library for performing fast approximate
3348 nearest neighbor searches in high dimensional spaces. It implements a
3349 collection of algorithms and a system for automatically choosing the best
3350 algorithm and optimum parameters depending on the dataset.
3352 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3353 (license (license:non-copyleft "file://COPYING"
3354 "See COPYING in the distribution."))))
3356 (define-public wcalc
3363 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3364 "wcalc-" version ".tar.bz2"))
3367 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3368 (build-system gnu-build-system)
3371 ("readline" ,readline)))
3372 (home-page "http://w-calc.sourceforge.net/index.php")
3373 (synopsis "Flexible command-line scientific calculator")
3374 (description "Wcalc is a very capable calculator. It has standard functions
3375 (sin, asin, and sinh for example, in either radians or degrees), many
3376 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3377 variables, a command history, hex/octal/binary input and output, unit
3378 conversions, embedded comments, and an expandable expression entry field. It
3379 evaluates expressions using the standard order of operations.")
3380 (license license:gpl2+)))
3388 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3389 "/xaos-" version ".tar.gz"))
3392 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3393 (build-system gnu-build-system)
3394 (native-inputs `(("gettext" ,gettext-minimal)))
3395 (inputs `(("libx11" ,libx11)
3400 `(#:tests? #f ;no "check" target
3401 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3402 (synopsis "Real-time fractal zoomer")
3403 (description "GNU XaoS is a graphical program that generates fractal
3404 patterns and allows you to zoom in and out of them infinitely in a fluid,
3405 continuous manner. It also includes tutorials that help to explain how fractals
3406 are built. It can generate many different fractal types such as the Mandelbrot
3408 (home-page "https://www.gnu.org/software/xaos/")
3409 (license license:gpl2+)))
3411 (define-public hypre
3417 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3418 "v" version ".tar.gz"))
3419 (file-name (string-append name "-" version ".tar.gz"))
3422 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3423 (modules '((guix build utils)))
3426 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3427 ;; substitute the tarball creation time.
3428 (substitute* "src/utilities/HYPRE_utilities.h"
3429 (("Date Compiled: .*$")
3430 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3432 (build-system gnu-build-system)
3433 (outputs '("out" ;6.1 MiB of headers and libraries
3434 "doc")) ;4.8 MiB of documentation
3438 ("texlive" ,texlive) ;full package required for fonts
3439 ("ghostscript" ,ghostscript)))
3441 `(("blas" ,openblas)
3442 ("lapack" ,lapack)))
3444 `(#:modules ((srfi srfi-1)
3445 ,@%gnu-build-system-modules)
3446 #:configure-flags '("--enable-shared"
3454 (modify-phases %standard-phases
3455 (add-before 'configure 'chdir-src
3456 (lambda _ (chdir "src")))
3458 (lambda* (#:key build target configure-flags
3459 #:allow-other-keys #:rest args)
3460 (let* ((configure (assoc-ref %standard-phases 'configure)))
3463 (list #:configure-flags
3464 (cons (string-append
3465 "--host=" (or target build))
3466 configure-flags)))))))
3467 (add-after 'build 'build-docs
3469 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3472 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3473 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3474 (and (system* "make" "check" "CHECKRUN=")
3475 (fold (lambda (filename result)
3477 (let ((size (stat:size (stat filename))))
3478 (when (not (zero? size))
3479 (format #t "~a size ~d; error indication~%"
3483 (find-files "test" ".*\\.err$")))))
3484 (add-after 'install 'install-docs
3485 (lambda* (#:key outputs #:allow-other-keys)
3486 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3487 (let* ((doc (assoc-ref outputs "doc"))
3488 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3489 (with-directory-excursion "docs"
3490 (for-each (lambda (base)
3491 (install-file (string-append base ".pdf") docdir)
3492 (copy-recursively base docdir)) ;html docs
3493 '("HYPRE_usr_manual"
3494 "HYPRE_ref_manual")))
3496 (home-page "http://www.llnl.gov/casc/hypre/")
3497 (synopsis "Library of solvers and preconditioners for linear equations")
3499 "HYPRE is a software library of high performance preconditioners and
3500 solvers for the solution of large, sparse linear systems of equations. It
3501 features multigrid solvers for both structured and unstructured grid
3503 (license license:lgpl2.1)))
3505 (define-public hypre-openmpi
3506 (package (inherit hypre)
3507 (name "hypre-openmpi")
3510 ,@(package-inputs hypre)))
3512 (substitute-keyword-arguments (package-arguments hypre)
3513 ((#:configure-flags flags)
3515 ,@(delete "--without-MPI" ,flags)))))
3516 (synopsis "Parallel solvers and preconditioners for linear equations")
3518 "HYPRE is a software library of high performance preconditioners and
3519 solvers for the solution of large, sparse linear systems of equations on
3520 parallel computers. It features parallel multigrid solvers for both
3521 structured and unstructured grid problems.")))
3523 (define-public matio
3530 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3531 "matio-" version ".tar.gz"))
3534 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3535 (build-system gnu-build-system)
3539 (home-page "http://matio.sourceforge.net/")
3540 (synopsis "Library for reading and writing MAT files")
3541 (description "Matio is a library for reading and writing MAT files. It
3542 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3543 (license license:bsd-2)))
3550 (origin (method url-fetch)
3551 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3552 "download/" version "/Vc-" version ".tar.gz"))
3555 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3556 (build-system cmake-build-system)
3559 '("-DBUILD_TESTING=ON"
3560 ;; By default, Vc will optimize for the CPU of the build machine.
3561 ;; Setting this to "none" makes it create portable binaries. See
3562 ;; "cmake/OptimizeForArchitecture.cmake".
3563 "-DTARGET_ARCHITECTURE=none")))
3564 (synopsis "SIMD vector classes for C++")
3565 (description "Vc provides portable, zero-overhead C++ types for explicitly
3566 data-parallel programming. It is a library designed to ease explicit
3567 vectorization of C++ code. Its types enable explicitly stating data-parallel
3568 operations on multiple values. The parallelism is therefore added via the type
3569 system. Vc has an intuitive API and provides portability between different
3570 compilers and compiler versions as well as portability between different vector
3571 instruction sets. Thus, an application written with Vc can be compiled for:
3574 @item SSE2 up to SSE4.2 or SSE4a
3577 @item NEON (in development)
3578 @item NVIDIA GPUs / CUDA (in development)
3580 (home-page "https://github.com/VcDevel/Vc")
3581 ;; "No support_???.cpp file exists for this architecture."
3582 (supported-systems '("x86_64-linux" "i686-linux"))
3583 (license license:bsd-3)))
3585 (define-public reducelcs
3586 ;; This is the last commit which is available upstream, no
3587 ;; release happened since 2010.
3588 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3592 (version (string-append "1.0-" revision "." (string-take commit 7)))
3597 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3599 (file-name (string-append name "-" version "-checkout"))
3602 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3603 (build-system gnu-build-system)
3605 `(("openlibm" ,openlibm)))
3607 `(#:tests? #f ; no tests
3609 (modify-phases %standard-phases
3610 (delete 'configure) ; No configure script exists.
3611 (replace 'install ; No install phase exists.
3612 (lambda* (#:key outputs #:allow-other-keys)
3613 (let* ((out (assoc-ref outputs "out"))
3614 (bin (string-append out "/bin")))
3615 (install-file "Approximation" bin)
3616 (install-file "CollectResults" bin)
3617 (install-file "GenerateInstances" bin)
3619 (synopsis "Approximate Longest Commons Subsequence computation tool")
3621 "@code{reduceLCS} is an implementation of the Reduce-Expand
3622 algorithm for LCS. It is a fast program to compute the approximate
3623 Longest Commons Subsequence of a set of strings.")
3624 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3625 (license license:gpl3+))))
3627 (define-public jacal
3634 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3637 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3638 (patches (search-patches "jacal-fix-texinfo.patch"))))
3639 (build-system gnu-build-system)
3642 (modify-phases %standard-phases
3643 (add-before 'build 'pre-build
3644 ;; Don't use upstream's script - it really doesn't fit into
3645 ;; Guix's functional paradigm.
3646 (lambda* (#:key inputs outputs #:allow-other-keys)
3647 (substitute* "Makefile"
3648 (("^install: install-script") "install: "))))
3649 (add-after 'install 'post-install
3650 ;; Instead, we provide our own simplified script.
3651 (lambda* (#:key inputs outputs #:allow-other-keys)
3652 (let ((wrapper (string-append (assoc-ref outputs "out")
3654 (format (open wrapper (logior O_WRONLY O_CREAT))
3655 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3656 "-e '(slib:load \"~a/lib/jacal/math\") "
3659 (assoc-ref inputs "scm")
3660 (assoc-ref outputs "out"))
3661 (chmod wrapper #o555))))
3663 (lambda* (#:key inputs outputs #:allow-other-keys)
3664 (zero? (system* "./configure"
3665 (string-append "--prefix="
3666 (assoc-ref outputs "out")))))))))
3667 (inputs `(("scm" ,scm)))
3668 (native-inputs `(("unzip" ,unzip)
3669 ("texinfo" ,texinfo)))
3670 (synopsis "Symbolic mathematics system")
3671 (description "GNU JACAL is an interactive symbolic mathematics program based on
3672 Scheme. It manipulate and simplify a range of mathematical expressions such
3673 as equations, scalars, vectors, and matrices.")
3674 (home-page "https://www.gnu.org/software/jacal/")
3675 (license license:gpl3+)))
3684 "https://github.com/Z3Prover/z3/archive/z3-"
3688 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3689 (build-system cmake-build-system)
3692 (list "-DBUILD_PYTHON_BINDINGS=true"
3693 "-DINSTALL_PYTHON_BINDINGS=true"
3694 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3696 "/lib/python2.7/site-packages"))
3698 (modify-phases %standard-phases
3699 (add-before 'configure 'bootstrap
3702 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3703 (add-before 'check 'make-test-z3
3705 ;; Build the test suite executable.
3706 (zero? (system* "make" "test-z3" "-j"
3707 (number->string (parallel-job-count))))))
3710 ;; Run all the tests that don't require arguments.
3711 (zero? (system* "./test-z3" "/a")))))))
3713 `(("python" ,python-2)))
3714 (synopsis "Theorem prover")
3715 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3716 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3717 (home-page "https://github.com/Z3Prover/z3")
3718 (license license:expat)))
3720 (define-public cubicle
3726 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3730 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3731 (build-system gnu-build-system)
3734 ("which" ,(@@ (gnu packages base) which))))
3738 `(#:configure-flags (list "--with-z3")
3741 (modify-phases %standard-phases
3742 (add-before 'configure 'configure-for-release
3744 (substitute* "Makefile.in"
3745 (("SVNREV=") "#SVNREV="))))
3746 (add-before 'configure 'fix-/bin/sh
3748 (substitute* "configure"
3749 (("/bin/sh") (which "sh")))))
3750 (add-before 'configure 'fix-smt-z3wrapper.ml
3752 (substitute* "Makefile.in"
3753 (("\\\\n") "")))))))
3754 (home-page "http://cubicle.lri.fr/")
3755 (synopsis "Model checker for array-based systems")
3756 (description "Cubicle is a model checker for verifying safety properties
3757 of array-based systems. This is a syntactically restricted class of
3758 parametrized transition systems with states represented as arrays indexed by
3759 an arbitrary number of processes. Cache coherence protocols and mutual
3760 exclusion algorithms are typical examples of such systems.")
3761 (license license:asl2.0)))
3763 (define-public elemental
3769 (uri (string-append "https://github.com/elemental/Elemental/"
3770 "archive/v" version ".tar.gz"))
3771 (file-name (string-append name "-" version ".tar.gz"))
3774 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3775 (build-system cmake-build-system)
3776 (home-page "http://libelemental.org")
3778 `(("gfortran" ,gfortran)))
3780 `(("blas" ,openblas)
3781 ("gfortran:lib" ,gfortran "lib")
3790 `(#:build-type "Release" ;default RelWithDebInfo not supported
3791 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3792 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3793 "-DEL_CACHE_WARNINGS:BOOL=YES"
3794 "-DEL_TESTS:BOOL=YES"
3795 "-DCMAKE_INSTALL_LIBDIR=lib"
3796 "-DGFORTRAN_LIB=gfortran")
3797 #:phases (modify-phases %standard-phases
3798 (add-before 'check 'setup-tests
3800 ;; Parallelism is done at the MPI layer.
3801 (setenv "OMP_NUM_THREADS" "1")
3803 (add-after 'install 'remove-tests
3804 (lambda* (#:key outputs #:allow-other-keys)
3805 ;; Tests are installed, with no easy configuration
3806 ;; switch to prevent this, so delete them.
3807 (delete-file-recursively
3808 (string-append (assoc-ref outputs "out") "/bin"))
3810 (synopsis "Dense and sparse-direct linear algebra and optimization")
3811 (description "Elemental is a modern C++ library for distributed-memory
3812 dense and sparse-direct linear algebra, conic optimization, and lattice
3814 (license license:bsd-2)))
3816 (define-public mcrl2
3819 (version "201707.1.15162")
3822 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3827 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3829 `(("subversion" ,subversion)))
3835 (build-system cmake-build-system)
3836 (synopsis "Toolset for the mCRL2 formal specification language")
3838 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3839 specification language for describing concurrent discrete event systems. Its
3840 toolset supports analysis and automatic verification, linearisation, simulation,
3841 state-space exploration and generation, and tools to optimise and analyse
3842 specifications. Also, state spaces can be manipulated, visualised and
3844 (home-page "http://mcrl2.org")
3845 (license license:boost1.0)))
3847 (define-public r-subplex
3854 (uri (cran-uri "subplex" version))
3857 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
3858 (build-system r-build-system)
3860 `(("gfortran" ,gfortran)))
3861 (home-page "https://cran.r-project.org/web/packages/subplex")
3862 (synopsis "Unconstrained optimization using the subplex algorithm")
3863 (description "This package implements the Subplex optimization algorithm.
3864 It solves unconstrained optimization problems using a simplex method on
3865 subspaces. The method is well suited for optimizing objective functions that
3866 are noisy or are discontinuous at the solution.")
3867 (license license:gpl3+)))
3869 (define-public r-desolve
3876 (uri (cran-uri "deSolve" version))
3879 "18nx3maww979a8p8ly4hv63y65mnjx8vbj2fpipd6rhcbf1lbsan"))))
3880 (properties `((upstream-name . "deSolve")))
3881 (build-system r-build-system)
3883 `(("gfortran" ,gfortran)))
3884 (home-page "https://desolve.r-forge.r-project.org/")
3885 (synopsis "Solvers for initial value problems of differential equations")
3886 (description "This package provides functions that solve initial
3887 value problems of a system of first-order ordinary differential equations (ODE),
3888 of partial differential equations (PDE), of differential algebraic equations
3889 (DAE), and of delay differential equations. The functions provide an interface
3890 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
3891 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
3892 the Runge-Kutta family with fixed or variable time steps. The package contains
3893 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
3894 differential equations (PDE) that have been converted to ODEs by numerical
3896 (license license:gpl2+)))
3898 (define-public tcalc
3905 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
3909 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
3910 (build-system gnu-build-system)
3911 (synopsis "The terminal calculator")
3913 "The terminal calculator is a small program to help users of the GNU/Linux
3914 terminal do calculations simply and quickly. The formula to be calculated can
3915 be fed to @command{tcalc} through the command line.")
3916 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
3917 (license license:gpl3+)))