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 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 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 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 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017 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 ng0 <contact.ng0@cryptolab.net>
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 Tobias Geerinckx-Rice <me@tobias.gr>
25 ;;; This file is part of GNU Guix.
27 ;;; GNU Guix is free software; you can redistribute it and/or modify it
28 ;;; under the terms of the GNU General Public License as published by
29 ;;; the Free Software Foundation; either version 3 of the License, or (at
30 ;;; your option) any later version.
32 ;;; GNU Guix is distributed in the hope that it will be useful, but
33 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 ;;; GNU General Public License for more details.
37 ;;; You should have received a copy of the GNU General Public License
38 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40 (define-module (gnu packages maths)
41 #:use-module (ice-9 regex)
42 #:use-module (gnu packages)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix utils)
48 #:use-module (guix build utils)
49 #:use-module (guix build-system cmake)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix build-system ocaml)
52 #:use-module (guix build-system r)
53 #:use-module (gnu packages algebra)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages boost)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages cmake)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages cyrus-sasl)
62 #:use-module (gnu packages documentation)
63 #:use-module (gnu packages elf)
64 #:use-module (gnu packages flex)
65 #:use-module (gnu packages fltk)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages gd)
70 #:use-module (gnu packages ghostscript)
71 #:use-module (gnu packages graphviz)
72 #:use-module (gnu packages gtk)
73 #:use-module (gnu packages image)
74 #:use-module (gnu packages java)
75 #:use-module (gnu packages less)
76 #:use-module (gnu packages lisp)
77 #:use-module (gnu packages logging)
78 #:use-module (gnu packages lua)
79 #:use-module (gnu packages gnome)
80 #:use-module (gnu packages guile)
81 #:use-module (gnu packages xorg)
82 #:use-module (gnu packages gl)
83 #:use-module (gnu packages imagemagick)
84 #:use-module (gnu packages m4)
85 #:use-module (gnu packages mpi)
86 #:use-module (gnu packages multiprecision)
87 #:use-module (gnu packages netpbm)
88 #:use-module (gnu packages ocaml)
89 #:use-module (gnu packages pcre)
90 #:use-module (gnu packages popt)
91 #:use-module (gnu packages perl)
92 #:use-module (gnu packages pkg-config)
93 #:use-module (gnu packages python)
94 #:use-module (gnu packages python-web)
95 #:use-module (gnu packages readline)
96 #:use-module (gnu packages tbb)
97 #:use-module (gnu packages scheme)
98 #:use-module (gnu packages shells)
99 #:use-module (gnu packages tcl)
100 #:use-module (gnu packages texinfo)
101 #:use-module (gnu packages tex)
102 #:use-module (gnu packages tls)
103 #:use-module (gnu packages wxwidgets)
104 #:use-module (gnu packages xml)
105 #:use-module (srfi srfi-1))
113 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
115 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
116 (build-system gnu-build-system)
117 (inputs `(("gtk+" ,gtk+)
118 ("libxml2" ,libxml2)))
119 (native-inputs `(("pkg-config" ,pkg-config)))
120 (synopsis "Natural deduction first-order logic interface")
121 (description "Aris is a program for performing logical proofs. It supports
122 propositional and predicate logic, as well as Boolean algebra and
123 arithmetical logic. In addition to its predefined inference and equivalence
124 rules, Aris also supports references to older proofs. Its use of standard
125 logical symbols and its natural deduction interface make it easy to use for
127 (license license:gpl3+)
128 (home-page "https://www.gnu.org/software/aris/")))
130 (define-public c-graph
136 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
139 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
140 (build-system gnu-build-system)
142 `(("fortran" ,gfortran)))
143 (synopsis "Visualizing and demonstrating convolution")
145 "GNU C-Graph is a tool for demonstrating the theory of convolution.
146 Thus, it can serve as an excellent aid to students of signal and systems
147 theory in visualizing the convolution process. Rather than forcing the
148 student to write code, the program offers an intuitive interface with
149 interactive dialogs to guide them.")
150 (license license:gpl3+)
151 (home-page "https://www.gnu.org/software/c-graph/")))
160 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
161 version "/coda-" version ".tar.gz"))
163 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
164 (patches (search-patches "coda-use-system-libs.patch"))
165 (modules '((guix build utils)))
167 ;; Make sure we don't use the bundled software.
168 '(for-each (lambda (d)
169 (delete-file-recursively (string-append "libcoda/" d)))
170 '("zlib" "pcre" "expat")))))
172 `(("fortran" ,gfortran)
174 ("python-numpy" ,python-numpy)))
181 (build-system gnu-build-system)
183 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
184 "LIBS= -lz -lpcre -lexpat")))
185 (synopsis "A common interface to various earth observation data formats")
187 "The Common Data Access toolbox (CODA) provides a set of interfaces for
188 reading remote sensing data from earth observation data files. It consists of
189 command line applications and interfaces to the C, Fortran, Python, and Java
190 programming languages.")
191 (home-page "https://stcorp.nl/coda")
192 (license license:gpl2+)))
200 (uri (string-append "mirror://gnu/units/units-" version
203 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
204 (build-system gnu-build-system)
206 `(("readline" ,readline)
207 ("python" ,python-wrapper) ;for 'units_cur' script
208 ("python-requests" ,python-requests)))
210 `(#:phases (modify-phases %standard-phases
211 (add-after 'install 'wrap-units_cur
212 (lambda* (#:key outputs #:allow-other-keys)
213 (let* ((out (assoc-ref outputs "out"))
214 (bin (string-append out "/bin")))
215 (wrap-program (string-append bin "/units_cur")
216 `("PYTHONPATH" ":" prefix
217 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
219 (synopsis "Conversion between thousands of scales")
221 "GNU Units converts numeric quantities between units of measure. It
222 can handle scale changes through adaptive usage of standard scale
223 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
224 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
225 enough to be used effectively as a scientific calculator.")
226 (license license:gpl3+)
227 (home-page "https://www.gnu.org/software/units/")))
229 (define-public double-conversion
231 (name "double-conversion")
236 "https://github.com/floitsch/double-conversion/archive/v"
238 (file-name (string-append name "-" version ".tar.gz"))
241 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
242 (build-system cmake-build-system)
244 '(#:test-target "test"
245 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
246 "-DBUILD_TESTING=ON")))
247 (home-page "https://github.com/floitsch/double-conversion")
248 (synopsis "Conversion routines for IEEE doubles")
250 "The double-conversion library provides binary-decimal and decimal-binary
251 routines for IEEE doubles. The library consists of efficient conversion
252 routines that have been extracted from the V8 JavaScript engine.")
253 (license license:bsd-3)))
255 (define-public dionysus
261 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
265 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
266 (build-system gnu-build-system)
267 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
268 (synopsis "Local search for universal constants and scientific values")
270 "GNU Dionysus is a convenient system for quickly retrieving the values of
271 mathematical constants used in science and engineering. Values can be
272 searched using a simple command-line tool, choosing from three databases:
273 universal constants, atomic numbers, and constants related to
275 (license license:gpl3+)
276 (home-page "https://www.gnu.org/software/dionysus/")))
284 (uri (string-append "mirror://gnu/gsl/gsl-"
288 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
289 (patches (search-patches "gsl-test-i686.patch"))))
290 (build-system gnu-build-system)
292 `(;; Currently there are numerous tests that fail on "exotic"
293 ;; architectures such as aarch64 and ppc64le.
294 ,@(if (string-prefix? "aarch64-linux"
295 (or (%current-target-system) (%current-system)))
298 (home-page "https://www.gnu.org/software/gsl/")
299 (synopsis "Numerical library for C and C++")
301 "The GNU Scientific Library is a library for numerical analysis in C
302 and C++. It includes a wide range of mathematical routines, with over 1000
303 functions in total. Subject areas covered by the library include:
304 differential equations, linear algebra, Fast Fourier Transforms and random
306 (license license:gpl3+)))
308 (define-public ocaml-gsl
317 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
318 version"/gsl-ocaml-" version ".tar.gz"))
321 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
322 (build-system ocaml-build-system)
325 (home-page "https://mmottl.github.io/gsl-ocaml")
326 (synopsis "Bindings to the GNU Scientific Library")
328 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
329 the OCaml language.")
330 (license license:gpl3+)))
332 (define-public ocaml4.01-gsl
333 (package-with-ocaml4.01 ocaml-gsl))
342 (uri (string-append "mirror://gnu/glpk/glpk-"
346 "096cqgjc7vkq6wd8znhcxjbs1s2rym3qf753fqxrrq531vs6g4jk"))))
347 (build-system gnu-build-system)
351 `(#:configure-flags '("--with-gmp")))
352 (home-page "https://www.gnu.org/software/glpk/")
353 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
355 "GLPK is a C library for solving large-scale linear programming (LP),
356 mixed integer programming (MIP), and other related problems. It supports the
357 GNU MathProg modeling language, a subset of the AMPL language, and features a
358 translator for the language. In addition to the C library, a stand-alone
359 LP/MIP solver is included in the package.")
360 (license license:gpl3+)))
369 (uri (string-append "http://www.4ti2.de/version_" version
370 "/4ti2-" version ".tar.gz"))
373 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
374 (build-system gnu-build-system)
376 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
380 (home-page "http://www.4ti2.de/")
381 (synopsis "Mathematical tool suite for problems on linear spaces")
383 "4ti2 implements algorithms for solving algebraic, geometric and
384 combinatorial problems on linear spaces. Among others, it solves systems
385 of linear equations, computes extreme rays of polyhedral cones, solves
386 integer programming problems and computes Markov bases for statistics.")
387 (license license:gpl2+)))
389 (define-public cddlib
396 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
397 (string-delete #\. version) ".tar.gz"))
400 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
401 (build-system gnu-build-system)
404 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
405 (synopsis "Library for convex hulls and extreme rays of polyhedra")
407 "The C-library cddlib implements the Double Description Method of
408 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
409 rays of a general convex polyhedron given by a system of linear inequalities
410 in arbitrary dimension. It can also be used for the converse operation of
411 computing convex hulls.")
412 (license license:gpl2+)))
414 (define-public arpack-ng
421 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
423 (file-name (string-append name "-" version ".tar.gz"))
426 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
427 (build-system gnu-build-system)
428 (home-page "https://github.com/opencollab/arpack-ng")
431 ("fortran" ,gfortran)))
432 (synopsis "Fortran subroutines for solving eigenvalue problems")
434 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
435 large scale eigenvalue problems.")
436 (license (license:non-copyleft "file://COPYING"
437 "See COPYING in the distribution."))))
439 (define-public arpack-ng-openmpi
440 (package (inherit arpack-ng)
441 (name "arpack-ng-openmpi")
444 ,@(package-inputs arpack-ng)))
445 (arguments `(#:configure-flags '("--enable-mpi")))
446 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
448 (define-public lapack
455 (uri (string-append "http://www.netlib.org/lapack/lapack-"
459 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
460 (build-system cmake-build-system)
461 (home-page "http://www.netlib.org/lapack/")
462 (inputs `(("fortran" ,gfortran)
463 ("python" ,python-2)))
465 `(#:configure-flags (list
466 ;; Install to PREFIX/lib (the default is
468 (string-append "-DCMAKE_INSTALL_LIBDIR="
469 (assoc-ref %outputs "out")
472 "-DBUILD_SHARED_LIBS:BOOL=YES"
475 ;; Build the 'LAPACKE_clatms' functions.
476 "-DLAPACKE_WITH_TMG=ON")
478 (modify-phases %standard-phases
479 (add-before 'check 'patch-python
480 (lambda* (#:key inputs #:allow-other-keys)
481 (let ((python (assoc-ref inputs "python")))
482 (substitute* "lapack_testing.py"
483 (("/usr/bin/env python") python)))
485 (synopsis "Library for numerical linear algebra")
487 "LAPACK is a Fortran 90 library for solving the most commonly occurring
488 problems in numerical linear algebra.")
489 (license (license:non-copyleft "file://LICENSE"
490 "See LICENSE in the distribution."))))
492 (define-public lapack-3.5
499 (uri (string-append "http://www.netlib.org/lapack/lapack-"
503 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
505 (define-public scalapack
512 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
516 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
517 (build-system cmake-build-system)
520 ("fortran" ,gfortran)
521 ("lapack" ,lapack))) ;for testing only
523 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
524 (home-page "http://www.netlib.org/scalapack/")
525 (synopsis "Library for scalable numerical linear algebra")
527 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
528 routines on parallel distributed memory machines. ScaLAPACK solves dense and
529 banded linear systems, least squares problems, eigenvalue problems, and
530 singular value problems.")
531 (license (license:bsd-style "file://LICENSE"
532 "See LICENSE in the distribution."))))
534 (define-public gnuplot
540 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
545 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
546 (build-system gnu-build-system)
547 (inputs `(("readline" ,readline)
553 `(("pkg-config" ,pkg-config)
554 ("texlive" ,texlive-tiny)))
555 (home-page "http://www.gnuplot.info")
556 (synopsis "Command-line driven graphing utility")
557 (description "Gnuplot is a portable command-line driven graphing
558 utility. It was originally created to allow scientists and students to
559 visualize mathematical functions and data interactively, but has grown to
560 support many non-interactive uses such as web scripting. It is also used as a
561 plotting engine by third-party applications like Octave.")
562 ;; X11 Style with the additional restriction that derived works may only be
563 ;; distributed as patches to the original.
564 (license (license:fsf-free
565 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
574 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
576 (file-name (string-append name "-" version ".tar.gz"))
579 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
581 `(("fortran" ,gfortran)))
582 (build-system gnu-build-system)
583 (synopsis "General Cartographic Transformation Package (GCTP)")
585 "The General Cartographic Transformation Package (GCTP) is a system of
586 software routines designed to permit the transformation of coordinate pairs
587 from one map projection to another. The GCTP is the standard computer
588 software used by the National Mapping Division for map projection
590 (home-page "https://github.com/OkoSanto/GCTP")
591 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
600 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
601 version "/src/hdf-" version ".tar.bz2"))
603 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
604 (patches (search-patches "hdf4-architectures.patch"
605 "hdf4-reproducibility.patch"
606 "hdf4-shared-fortran.patch"))))
607 (build-system gnu-build-system)
609 `(("gfortran" ,gfortran)
614 ("libjpeg" ,libjpeg)))
616 `(#:parallel-tests? #f
617 #:configure-flags '("--enable-shared")
619 (modify-phases %standard-phases
620 ;; This is inspired by two of Debian's patches.
621 (add-before 'configure 'add-more-aarch64-support
623 (substitute* '("mfhdf/ncgen/ncgen.l"
624 "mfhdf/ncgen/ncgenyy.c"
625 "mfhdf/libsrc/netcdf.h.in")
626 (("AIX5L64") "__aarch64__"))
628 (add-before 'configure 'patchbuild
631 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
633 (("/bin/mkdir") "mkdir"))
634 (substitute* (find-files "." "^Makefile\\.in$")
635 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
636 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
637 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
638 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
639 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
641 (add-after 'configure 'patch-settings
643 ;; libhdf4.settings contains the full path of the
644 ;; compilers used, and its contents are included in
645 ;; .so-files. We truncate the hashes to avoid
646 ;; unnecessary store references to those compilers:
647 (substitute* "libhdf4.settings"
648 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
649 (string-append prefix (string-take hash 10) "...")))
652 (home-page "https://www.hdfgroup.org/products/hdf4/")
654 "Library and multi-object file format for storing and managing data")
655 (description "HDF4 is a library and multi-object file format for storing
656 and managing data between machines. HDF4 is an older hierarchical data format,
657 incompatible with HDF5.")
659 (license:non-copyleft
660 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
662 (define-public hdf4-alt
667 (substitute-keyword-arguments (package-arguments hdf4)
668 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
670 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
679 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
680 "hdf5-" (version-major+minor version)
681 "/hdf5-" version "/src/hdf5-"
683 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
686 (take (string-split version #\.) 2))
687 "/src/hdf5-" version ".tar.bz2")))
689 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
690 (patches (list (search-patch "hdf5-config-date.patch")))))
691 (build-system gnu-build-system)
695 `(("gfortran" ,gfortran)))
696 (outputs '("out" ; core library
697 "fortran")) ; fortran interface
699 `(;; Some of the users, notably Flann, need the C++ interface.
700 #:configure-flags '("--enable-cxx"
702 "--enable-fortran2003")
705 (modify-phases %standard-phases
706 (add-before 'configure 'patch-configure
707 (lambda* (#:key outputs #:allow-other-keys)
708 (substitute* "configure"
710 (substitute* "fortran/src/Makefile.in"
711 (("libhdf5_fortran_la_LDFLAGS =")
712 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
713 (assoc-ref outputs "fortran") "/lib")))
714 (substitute* "hl/fortran/src/Makefile.in"
715 (("libhdf5hl_fortran_la_LDFLAGS =")
716 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
717 (assoc-ref outputs "fortran") "/lib")))
719 (add-after 'configure 'patch-settings
721 ;; libhdf5.settings contains the full path of the
722 ;; compilers used, and its contents are included in
723 ;; libhdf5.so. We truncate the hashes to avoid
724 ;; unnecessary store references to those compilers:
725 (substitute* "src/libhdf5.settings"
726 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
727 (string-append prefix (string-take hash 10) "...")))
729 (add-after 'install 'patch-references
730 (lambda* (#:key inputs outputs #:allow-other-keys)
731 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
732 (zlib (assoc-ref inputs "zlib")))
733 (substitute* (find-files bin "h5p?cc")
735 (string-append "-L" zlib "/lib " lib)))
737 (add-after 'install 'split
738 (lambda* (#:key inputs outputs #:allow-other-keys)
739 ;; Move all fortran-related files
740 (let* ((out (assoc-ref outputs "out"))
741 (bin (string-append out "/bin"))
742 (lib (string-append out "/lib"))
743 (inc (string-append out "/include"))
744 (ex (string-append out "/share/hdf5_examples/fortran"))
745 (fort (assoc-ref outputs "fortran"))
746 (fbin (string-append fort "/bin"))
747 (flib (string-append fort "/lib"))
748 (finc (string-append fort "/include"))
749 (fex (string-append fort "/share/hdf5_examples/fortran")))
754 (rename-file (string-append bin "/h5fc")
755 (string-append fbin "/h5fc"))
756 (for-each (lambda (file)
758 (string-append flib "/" (basename file))))
759 (find-files lib ".*fortran.*"))
760 (for-each (lambda (file)
762 (string-append finc "/" (basename file))))
763 (find-files inc ".*mod"))
764 (for-each (lambda (file)
766 (string-append fex "/" (basename file))))
767 (find-files ex ".*"))
768 (delete-file-recursively ex))
770 (home-page "http://www.hdfgroup.org")
771 (synopsis "Management suite for extremely large and complex data")
772 (description "HDF5 is a suite that makes possible the management of
773 extremely large and complex data collections.")
774 (license (license:x11-style
775 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
777 (define-public hdf-java
785 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
786 version "/src/CMake-hdfjava-" version ".tar.gz"))
788 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
789 (modules '((guix build utils)))
790 (snippet ; Make sure we don't use the bundled sources and binaries.
792 (for-each delete-file
793 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
794 "HDF4.tar.gz" "HDF5.tar.gz"))
795 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))))))
796 (build-system gnu-build-system)
798 `(("jdk" ,icedtea "jdk")
799 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
801 ("hamcrest-core" ,java-hamcrest-core)
802 ("junit" ,java-junit)
803 ("slf4j-simple" ,java-slf4j-simple)))
809 ("slf4j-api" ,java-slf4j-api)))
812 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
813 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
814 (assoc-ref %build-inputs "jdk") "/lib" )
815 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
816 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
819 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
820 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
821 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
822 (string-append "JPEGLIB="
823 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
827 (modify-phases %standard-phases
828 (add-before 'configure 'chdir-to-source
829 (lambda _ (chdir ,(string-append "hdfjava-" version))))
830 (add-before 'configure 'patch-build
831 (lambda* (#:key inputs outputs #:allow-other-keys)
832 (substitute* "configure"
833 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
834 (("/bin/cat") (which "cat")))
835 ;; Set classpath for compilation
836 (substitute* '("hdf/hdf5lib/Makefile.in"
837 "hdf/hdf5lib/exceptions/Makefile.in"
838 "hdf/hdflib/Makefile.in")
839 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
840 (string-append (assoc-ref inputs "slf4j-api")
841 "/share/java/slf4j-api.jar")))
842 ;; Replace outdated config.sub and config.guess:
843 (with-directory-excursion "config"
844 (for-each (lambda (file)
846 (string-append (assoc-ref inputs "automake")
847 "/share/automake-1.15/" file) file))
848 '("config.sub" "config.guess")))
849 (mkdir-p (string-append (assoc-ref outputs "out")))
850 ;; Set classpath for tests
851 (let* ((build-dir (getcwd))
852 (lib (string-append build-dir "/lib"))
853 (jhdf (string-append lib "/jhdf.jar"))
854 (jhdf5 (string-append lib "/jhdf5.jar"))
857 (string-append (assoc-ref inputs i)
858 "/share/java/" i ".jar"))
859 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
861 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
863 (substitute* '("test/hdf5lib/Makefile.in"
864 "test/hdf5lib/junit.sh.in"
865 "examples/runExample.sh.in")
867 (string-append (assoc-ref inputs "coreutils")
870 (string-append (assoc-ref inputs "coreutils")
872 (("CLASSPATH=[^\n]*")
873 (string-append "CLASSPATH=" class-path)))
874 (setenv "CLASSPATH" class-path))
876 (add-before 'check 'build-examples
878 (zero? (apply system* `("javac"
879 ,@(find-files "examples" ".*\\.java")))))))
883 #:parallel-tests? #f ))
884 (home-page "https://support.hdfgroup.org/products/java")
885 (synopsis "Java interface for the HDF4 and HDF5 libraries")
886 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
887 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
890 ;; BSD-style license:
891 (license (license:x11-style
892 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
893 /current/src/unpacked/COPYING"))))
895 (define-public hdf-eos2
902 (uri "ftp://edhs1.gsfc.nasa.gov\
903 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
905 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
906 (patches (search-patches "hdf-eos2-remove-gctp.patch"
907 "hdf-eos2-build-shared.patch"
908 "hdf-eos2-fortrantests.patch"))))
909 (build-system gnu-build-system)
911 `(("gfortran" ,gfortran)))
913 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
918 `( #:configure-flags '("--enable-install-include" "--enable-shared"
919 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
920 #:parallel-tests? #f))
921 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
922 (synopsis "HDF4-based data format for NASA's Earth Observing System")
923 (description "HDF-EOS2 is a software library built on HDF4 which supports
924 the construction of data structures used in NASA's Earth Observing
925 System (Grid, Point and Swath).")
927 ;; Source files carry a permissive license header.
928 (license (license:non-copyleft home-page))))
930 (define-public hdf-eos5
936 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
937 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
940 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
941 (patches (search-patches "hdf-eos5-build-shared.patch"
942 "hdf-eos5-remove-gctp.patch"
943 "hdf-eos5-fix-szip.patch"
944 "hdf-eos5-fortrantests.patch"))))
946 `(("gfortran" ,gfortran)))
947 (build-system gnu-build-system)
953 `(#:configure-flags '("--enable-install-include" "--enable-shared"
954 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
955 #:parallel-tests? #f))
956 (synopsis "HDF5-based data format for NASA's Earth Observing System")
958 "HDF-EOS5 is a software library built on HDF5 to support the construction
959 of data structures used in NASA's Earth Observing System (Grid, Point and
961 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
963 ;; Source files carry a permissive license header.
964 (license (license:non-copyleft home-page))))
966 (define-public hdf5-parallel-openmpi
967 (package (inherit hdf5)
968 (name "hdf5-parallel-openmpi")
971 ,@(package-inputs hdf5)))
973 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
974 ,@(package-arguments hdf5))
976 `(modify-phases ,phases
977 (add-before 'check 'patch-tests
979 ;; OpenMPI's mpirun will exit with non-zero status if it
980 ;; detects an "abnormal termination", i.e. any process not
981 ;; calling MPI_Finalize(). Since the test is explicitely
982 ;; avoiding MPI_Finalize so as not to have at_exit and thus
983 ;; H5C_flush_cache from being called, mpirun will always
984 ;; complain, so turn this test off.
985 (substitute* "testpar/Makefile"
986 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
987 (string-append front back "\n")))
988 (substitute* "tools/h5diff/testph5diff.sh"
989 (("/bin/sh") (which "sh")))
991 (synopsis "Management suite for data with parallel IO support")))
993 (define-public h5check
1000 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1001 "h5check/src/h5check-" version ".tar.gz"))
1004 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1005 (build-system gnu-build-system)
1006 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1007 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1008 (synopsis "HDF5 format checker")
1009 (description "@code{h5check} is a validation tool for verifying that an
1010 HDF5 file is encoded according to the HDF File Format Specification.")
1011 (license (license:x11-style "file://COPYING"))))
1019 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1024 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1025 (build-system cmake-build-system)
1026 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1027 (inputs `(("lapack" ,lapack)
1029 ;; FIXME: Even though the fonts are available dvips complains:
1030 ;; "Font cmmi10 not found; characters will be left blank."
1032 `(("texlive" ,texlive-tiny)
1033 ("ghostscript" ,ghostscript)
1034 ("doxygen" ,doxygen)))
1035 (home-page "http://itpp.sourceforge.net")
1036 (synopsis "C++ library of maths, signal processing and communication classes")
1037 (description "IT++ is a C++ library of mathematical, signal processing and
1038 communication classes and functions. Its main use is in simulation of
1039 communication systems and for performing research in the area of
1040 communications. The kernel of the library consists of generic vector and
1041 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1042 similar to MATLAB, GNU Octave or SciPy.")
1043 (license license:gpl3+)))
1045 (define-public netcdf
1052 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1053 "netcdf-" version ".tar.gz"))
1056 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1057 (patches (search-patches "netcdf-date-time.patch"
1058 "netcdf-tst_h_par.patch"))))
1059 (build-system gnu-build-system)
1062 ("doxygen" ,doxygen)
1063 ("graphviz" ,graphviz)))
1065 `(("hdf4" ,hdf4-alt)
1068 ("libjpeg" ,libjpeg)))
1070 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1072 #:phases (modify-phases %standard-phases
1073 (add-before 'configure 'fix-source-date
1075 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1076 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1077 ;; to '1st hour of the current day', and therefore makes the
1078 ;; package not reproducible.
1079 (substitute* "./configure"
1080 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1081 "date --date='@0'"))
1083 (add-after 'configure 'patch-settings
1085 ;; libnetcdf.settings contains the full filename of the compilers
1086 ;; used to build the library. We truncate the hashes of those
1087 ;; filenames to avoid unnecessary references to the corresponding
1089 (substitute* "libnetcdf.settings"
1090 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1091 (string-append prefix (string-take hash 10) "...")))
1094 #:parallel-tests? #f)) ;various race conditions
1095 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1096 (synopsis "Library for scientific data")
1097 (description "NetCDF is an interface for scientific data access and a
1098 software library that provides an implementation of the interface. The netCDF
1099 library defines a machine-independent format for representing scientific data.
1100 Together, the interface, library, and format support the creation, access, and
1101 sharing of scientific data.")
1102 (license (license:x11-style "file://COPYRIGHT"))))
1104 (define-public netcdf-parallel-openmpi
1105 (package (inherit netcdf)
1106 (name "netcdf-parallel-openmpi")
1109 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1110 (package-inputs netcdf))))
1111 ;; TODO: Replace pkg-config references in nc-config with absolute references
1113 (substitute-keyword-arguments (package-arguments netcdf)
1114 ((#:configure-flags flags)
1115 `(cons* "CC=mpicc" "CXX=mpicxx"
1116 "--enable-parallel-tests"
1117 ;; Shared libraries not supported with parallel IO.
1118 "--disable-shared" "--with-pic"
1121 (define-public netcdf-fortran
1123 (name "netcdf-fortran")
1128 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1132 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1133 (build-system gnu-build-system)
1135 `(#:parallel-tests? #f))
1137 `(("netcdf" ,netcdf)))
1139 `(("gfortran" ,gfortran)))
1140 (synopsis "Fortran interface for the netCDF library")
1141 (description (package-description netcdf))
1142 (home-page (package-home-page netcdf))
1143 (license (package-license netcdf))))
1145 (define-public nlopt
1151 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1154 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1155 (build-system gnu-build-system)
1157 `(;; Shared libraries are not built by default. They are required to
1158 ;; build the Guile, Octave, and Python bindings.
1159 #:configure-flags '("--enable-shared")
1162 (modify-phases %standard-phases
1163 (add-before 'configure 'set-libnlopt-file-name
1164 (lambda* (#:key outputs #:allow-other-keys)
1165 ;; Make sure the Scheme module refers to the library by its
1166 ;; absolute file name (we cannot do that from a snippet
1167 ;; because the expansion of @libdir@ contains
1169 (let ((out (assoc-ref outputs "out")))
1170 (substitute* "swig/nlopt.scm.in"
1172 (string-append out "/lib/libnlopt")))
1174 (inputs `(("guile" ,guile-2.0)))
1175 (native-inputs `(("pkg-config" ,pkg-config)))
1176 (home-page "http://ab-initio.mit.edu/wiki/")
1177 (synopsis "Library for nonlinear optimization")
1178 (description "NLopt is a library for nonlinear optimization, providing a
1179 common interface for a number of different free optimization routines available
1180 online as well as original implementations of various other algorithms.")
1181 (license license:lgpl2.1+)))
1183 (define-public ipopt
1190 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1194 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1195 (modules '((guix build utils)))
1197 ;; Make sure we don't use the bundled software.
1198 '(delete-file-recursively "ThirdParty"))))
1199 (build-system gnu-build-system)
1201 '(#:phases (modify-phases %standard-phases
1202 (add-after 'install 'add--L-flags-in-ipopt.pc
1203 (lambda* (#:key inputs outputs #:allow-other-keys)
1204 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1205 ;; move it to "Libs.private" where it belongs, and add a
1206 ;; '-L' flag for LAPACK.
1207 (let ((out (assoc-ref outputs "out"))
1208 (lapack (assoc-ref inputs "lapack")))
1209 (substitute* (string-append out "/lib/pkgconfig/"
1211 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1212 (string-append "Libs: " before " " after "\n"
1213 "Libs.private: " before
1214 "-L" lapack "/lib -llapack -lblas "
1218 `(("gfortran" ,gfortran)))
1220 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1221 `(("lapack" ,lapack))) ;for both libblas and liblapack
1222 (home-page "http://www.coin-or.org")
1223 (synopsis "Large-scale nonlinear optimizer")
1225 "The Interior Point Optimizer (IPOPT) is a software package for
1226 large-scale nonlinear optimization. It provides C++, C, and Fortran
1228 (license license:epl1.0)))
1230 (define-public ceres
1232 (name "ceres-solver")
1234 (home-page "http://ceres-solver.org/")
1237 (uri (string-append home-page "ceres-solver-"
1241 "1kbxgab3q1vgyq7hjqasr1lji4b2sgn7ss351amklkb3jyhr1x0x"))))
1242 (build-system cmake-build-system)
1244 ;; TODO: Build HTML user documentation and install separately.
1245 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1246 "-DBUILD_SHARED_LIBS=ON")
1248 #:phases (modify-phases %standard-phases
1249 (add-before 'configure 'set-library-directory
1251 ;; Install libraries to lib/, not lib64/.
1252 (substitute* "internal/ceres/CMakeLists.txt"
1253 (("set\\(LIB_SUFFIX \"64\"\\)")
1254 "set(LIB_SUFFIX \"\")"))
1257 `(("pkg-config" ,pkg-config)))
1259 `(("glog" ,glog))) ;for #include <glog/glog.h>
1264 ("suitesparse" ,suitesparse)
1265 ("gflags" ,gflags)))
1266 (synopsis "C++ library for solving large optimization problems")
1268 "Ceres Solver is a C++ library for modeling and solving large,
1269 complicated optimization problems. It is a feature rich, mature and
1270 performant library which has been used in production since 2010. Ceres Solver
1271 can solve two kinds of problems:
1273 @item non-linear least squares problems with bounds constraints;
1274 @item general unconstrained optimization problems.
1276 (license license:bsd-3)))
1278 ;; For a fully featured Octave, users are strongly recommended also to install
1279 ;; the following packages: less, ghostscript, gnuplot.
1280 (define-public octave
1287 (uri (string-append "mirror://gnu/octave/octave-"
1291 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
1292 (build-system gnu-build-system)
1294 `(("lapack" ,lapack)
1295 ("readline" ,readline)
1300 ("arpack" ,arpack-ng)
1303 ("fontconfig" ,fontconfig)
1304 ("freetype" ,freetype)
1311 ("texinfo" ,texinfo)
1312 ("graphicsmagick" ,graphicsmagick)))
1315 ("gfortran" ,gfortran)
1316 ("pkg-config" ,pkg-config)
1318 ;; The following inputs are not actually used in the build process.
1319 ;; However, the ./configure gratuitously tests for their existence and
1320 ;; assumes that programs not present at build time are also not, and
1321 ;; can never be, available at run time! If these inputs are therefore
1322 ;; not present, support for them will be built out. However, Octave
1323 ;; will still run without them, albeit without the features they
1326 ("ghostscript" ,ghostscript)
1327 ("gnuplot" ,gnuplot)))
1330 (list (string-append "--with-shell="
1331 (assoc-ref %build-inputs "bash")
1334 (modify-phases %standard-phases
1335 (add-after 'configure 'configure-makeinfo
1336 (lambda* (#:key inputs #:allow-other-keys)
1337 (substitute* "libinterp/corefcn/help.cc"
1338 (("Vmakeinfo_program = \"makeinfo\"")
1339 (string-append "Vmakeinfo_program = \""
1340 (assoc-ref inputs "texinfo")
1341 "/bin/makeinfo\"")))
1343 (home-page "https://www.gnu.org/software/octave/")
1344 (synopsis "High-level language for numerical computation")
1345 (description "GNU Octave is a high-level interpreted language that is
1346 specialized for numerical computations. It can be used for both linear and
1347 non-linear applications and it provides great support for visualizing results.
1348 Work may be performed both at the interactive command-line as well as via
1350 (license license:gpl3+)))
1352 (define-public opencascade-oce
1354 (name "opencascade-oce")
1360 "https://github.com/tpaviot/oce/archive/OCE-"
1365 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1366 (build-system cmake-build-system)
1369 (list "-DOCE_TESTING:BOOL=ON"
1370 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1371 "-DOCE_DRAW:BOOL=ON"
1372 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1373 (assoc-ref %outputs "out"))
1374 "-UCMAKE_INSTALL_RPATH")))
1376 `(("freetype" ,freetype)
1383 `(("python" ,python-wrapper)))
1384 (home-page "https://github.com/tpaviot/oce")
1385 (synopsis "Libraries for 3D modeling and numerical simulation")
1387 "Open CASCADE is a set of libraries for the development of applications
1388 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1389 C++ class libraries providing services for 3D surface and solid modeling, CAD
1390 data exchange, and visualization. It is used for development of specialized
1391 software dealing with 3D models in design (CAD), manufacturing (CAM),
1392 numerical simulation (CAE), measurement equipment (CMM), and quality
1393 control (CAQ) domains.
1395 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1396 patches, improvements, and experiments contributed by users over the official
1397 Open CASCADE library.")
1398 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1399 ; use of header files; see
1400 ; OCCT_LGPL_EXCEPTION.txt
1401 license:public-domain; files
1402 ; src/Standard/Standard_StdAllocator.hxx and
1403 ; src/NCollection/NCollection_StdAllocator.hxx
1404 license:expat; file src/OpenGl/OpenGl_glext.h
1405 license:bsd-3)))); test framework gtest
1414 (uri (string-append "http://gmsh.info/src/gmsh-"
1415 version "-source.tgz"))
1417 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1418 (modules '((guix build utils)))
1420 ;; Remove non-free METIS code
1421 '(delete-file-recursively "contrib/Metis"))))
1422 (build-system cmake-build-system)
1425 ("gfortran" ,gfortran)
1431 ("opencascade-oce" ,opencascade-oce)
1433 ("libxext" ,libxext)))
1435 `(("fontconfig" ,fontconfig)
1436 ("libxft" ,libxft)))
1438 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1439 "-DENABLE_BUILD_SHARED:BOOL=ON"
1440 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1441 (home-page "http://www.geuz.org/gmsh/")
1442 (synopsis "3D finite element grid generator")
1443 (description "Gmsh is a 3D finite element grid generator with a built-in
1444 CAD engine and post-processor. Its design goal is to provide a fast, light
1445 and user-friendly meshing tool with parametric input and advanced
1446 visualization capabilities. Gmsh is built around four modules: geometry,
1447 mesh, solver and post-processing. The specification of any input to these
1448 modules is done either interactively using the graphical user interface or in
1449 ASCII text files using Gmsh's own scripting language.")
1450 (license license:gpl2+)))
1452 (define-public maxflow
1459 (url "https://github.com/gerddie/maxflow.git")
1460 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1461 (file-name (string-append name "-" version "-checkout"))
1464 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1465 (build-system cmake-build-system)
1466 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1467 (synopsis "Library implementing Maxflow algorithm")
1468 (description "An implementation of the maxflow algorithm described in
1469 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1470 Energy Minimization in Computer Vision.\n
1471 Yuri Boykov and Vladimir Kolmogorov.\n
1472 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1474 (license license:gpl3+)))
1476 (define-public petsc
1483 ;; The *-lite-* tarball does not contain the *large* documentation
1484 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1485 "petsc-lite-" version ".tar.gz"))
1487 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1488 (build-system gnu-build-system)
1490 `(("python" ,python-2)))
1492 `(("gfortran" ,gfortran)
1494 ("superlu" ,superlu)
1495 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1496 ;; leaving out opengl, as configuration seems to only be for mac
1499 `(#:test-target "test"
1500 #:parallel-build? #f ;build is parallel by default
1505 ,(string-append "--with-superlu-include="
1506 (assoc-ref %build-inputs "superlu") "/include")
1507 ,(string-append "--with-superlu-lib="
1508 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1510 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1511 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1512 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1514 (modify-phases %standard-phases
1516 ;; PETSc's configure script is actually a python script, so we can't
1517 ;; run it with bash.
1518 (lambda* (#:key outputs (configure-flags '())
1520 (let* ((prefix (assoc-ref outputs "out"))
1521 (flags `(,(string-append "--prefix=" prefix)
1522 ,@configure-flags)))
1523 (format #t "build directory: ~s~%" (getcwd))
1524 (format #t "configure flags: ~s~%" flags)
1525 (zero? (apply system* "./configure" flags)))))
1526 (add-after 'configure 'clean-local-references
1527 (lambda* (#:key outputs #:allow-other-keys)
1528 (let ((out (assoc-ref outputs "out")))
1529 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1530 ;; Prevent build directory from leaking into compiled code
1532 ;; Scrub timestamp for reproducibility
1533 ((".*Libraries compiled on.*") ""))
1534 (substitute* (find-files "." "petscvariables")
1535 ;; Do not expose build machine characteristics, set to defaults.
1536 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1537 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1539 (add-after 'install 'clean-install
1540 ;; Try to keep installed files from leaking build directory names.
1541 (lambda* (#:key inputs outputs #:allow-other-keys)
1542 (let ((out (assoc-ref outputs "out")))
1543 (substitute* (map (lambda (file)
1544 (string-append out "/lib/petsc/conf/" file))
1545 '("petscvariables"))
1547 ;; Make compiler references point to the store
1548 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1549 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1550 (string-append "= " (which compiler))))
1551 ;; PETSc installs some build logs, which aren't necessary.
1552 (for-each (lambda (file)
1553 (let ((f (string-append out "/lib/petsc/conf/" file)))
1554 (when (file-exists? f)
1556 '("configure.log" "make.log" "gmake.log"
1557 "test.log" "error.log" "RDict.db"
1558 "PETScBuildInternal.cmake"
1559 ;; Once installed, should uninstall with Guix
1562 (home-page "http://www.mcs.anl.gov/petsc")
1563 (synopsis "Library to solve PDEs")
1564 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1565 data structures and routines for the scalable (parallel) solution of
1566 scientific applications modeled by partial differential equations.")
1567 (license (license:non-copyleft
1568 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1570 (define-public petsc-complex
1571 (package (inherit petsc)
1572 (name "petsc-complex")
1574 (substitute-keyword-arguments (package-arguments petsc)
1575 ((#:configure-flags cf)
1576 `(cons "--with-scalar-type=complex" ,cf))))
1577 (synopsis "Library to solve PDEs (with complex scalars)")))
1579 (define-public petsc-openmpi
1580 (package (inherit petsc)
1581 (name "petsc-openmpi")
1583 `(("openmpi" ,openmpi)
1584 ,@(package-inputs petsc)))
1586 (substitute-keyword-arguments (package-arguments petsc)
1587 ((#:configure-flags cf)
1588 ``("--with-mpiexec=mpirun"
1589 ,(string-append "--with-mpi-dir="
1590 (assoc-ref %build-inputs "openmpi"))
1591 ,@(delete "--with-mpi=0" ,cf)))))
1592 (synopsis "Library to solve PDEs (with MPI support)")))
1594 (define-public petsc-complex-openmpi
1595 (package (inherit petsc-complex)
1596 (name "petsc-complex-openmpi")
1598 `(("openmpi" ,openmpi)
1599 ,@(package-inputs petsc-complex)))
1601 (substitute-keyword-arguments (package-arguments petsc-complex)
1602 ((#:configure-flags cf)
1603 ``("--with-mpiexec=mpirun"
1604 ,(string-append "--with-mpi-dir="
1605 (assoc-ref %build-inputs "openmpi"))
1606 ,@(delete "--with-mpi=0" ,cf)))))
1607 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1609 (define-public slepc
1616 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1620 "0qyrsdndfdw2g0jmj9iskxj3j20zlkplhv26288s079dhm7cr365"))))
1621 (build-system gnu-build-system)
1623 `(("python" ,python-2)))
1625 `(("arpack" ,arpack-ng)
1626 ("gfortran" ,gfortran)))
1628 `(("petsc" ,petsc)))
1630 `(#:parallel-build? #f ;build is parallel by default
1632 `(,(string-append "--with-arpack-dir="
1633 (assoc-ref %build-inputs "arpack") "/lib"))
1634 #:make-flags ;honor (parallel-job-count)
1635 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1637 (modify-phases %standard-phases
1639 ;; configure is a python script, so we can't run it with bash.
1640 (lambda* (#:key inputs outputs (configure-flags '())
1642 (let* ((prefix (assoc-ref outputs "out"))
1643 (flags `(,(string-append "--prefix=" prefix)
1644 ,@configure-flags)))
1645 (format #t "build directory: ~s~%" (getcwd))
1646 (format #t "configure flags: ~s~%" flags)
1647 (setenv "SLEPC_DIR" (getcwd))
1648 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1649 (zero? (apply system* "./configure" flags)))))
1650 (add-after 'install 'delete-doc
1651 ;; TODO: SLEPc installs HTML documentation alongside headers in
1652 ;; $out/include. We'd like to move them to share/doc, but delete
1653 ;; them for now, as they are incomplete and installing the complete
1654 ;; documentation is difficult.
1655 (lambda* (#:key outputs #:allow-other-keys)
1656 (let* ((out (assoc-ref outputs "out")))
1657 (for-each delete-file (find-files out "\\.html$")))))
1658 (add-after 'install 'clean-install
1659 ;; Clean up unnecessary build logs from installation.
1660 (lambda* (#:key outputs #:allow-other-keys)
1661 (let ((out (assoc-ref outputs "out")))
1662 (for-each (lambda (file)
1663 (let ((f (string-append out "/lib/slepc/conf/" file)))
1664 (when (file-exists? f)
1666 '("configure.log" "make.log" "gmake.log"
1667 "test.log" "error.log" "RDict.db"
1668 "uninstall.py"))))))))
1669 (home-page "http://slepc.upv.es")
1670 (synopsis "Scalable library for eigenproblems")
1671 (description "SLEPc is a software library for the solution of large sparse
1672 eigenproblems on parallel computers. It can be used for the solution of
1673 linear eigenvalue problems formulated in either standard or generalized form,
1674 as well as other related problems such as the singular value decomposition.
1675 The emphasis of the software is on methods and techniques appropriate for
1676 problems in which the associated matrices are sparse, for example, those
1677 arising after the discretization of partial differential equations.")
1678 (license license:lgpl3)))
1680 (define-public slepc-complex
1681 (package (inherit slepc)
1682 (name "slepc-complex")
1684 `(("petsc" ,petsc-complex)
1685 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1686 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1688 (define-public slepc-openmpi
1689 (package (inherit slepc)
1690 (name "slepc-openmpi")
1693 ("arpack" ,arpack-ng-openmpi)
1694 ,@(alist-delete "arpack" (package-inputs slepc))))
1696 `(("petsc" ,petsc-openmpi)
1697 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1698 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1700 (define-public slepc-complex-openmpi
1701 (package (inherit slepc-openmpi)
1702 (name "slepc-complex-openmpi")
1704 `(("petsc" ,petsc-complex-openmpi)
1705 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1706 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1708 (define-public mumps
1715 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1719 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1720 (patches (search-patches "mumps-build-parallelism.patch"))))
1721 (build-system gnu-build-system)
1723 `(("fortran" ,gfortran)
1724 ;; These are required for linking against mumps, but we let the user
1725 ;; declare the dependency.
1728 ("scotch" ,scotch)))
1730 `(#:modules ((ice-9 match)
1733 ,@%gnu-build-system-modules)
1735 (modify-phases %standard-phases
1737 (lambda* (#:key inputs #:allow-other-keys)
1738 (call-with-output-file "Makefile.inc"
1749 INCSEQ = -I$(topdir)/libseq
1750 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1751 LIBSEQNEEDED = libseqneeded~;
1755 AR = ar vr # rules require trailing space, ugh...
1757 LIBBLAS = -L~a -lopenblas~@[
1758 SCALAP = -L~a -lscalapack~]
1759 LIBOTHERS = -pthread
1762 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1766 LIBS = $(SCALAP) $(LIBSEQ)
1767 LPORDDIR = $(topdir)/PORD/lib
1768 IPORD = -I$(topdir)/PORD/include
1769 LPORD = -L$(LPORDDIR) -lpord
1770 ORDERINGSF = -Dpord~@[
1772 IMETIS = -I$(METISDIR)/include
1773 LMETIS = -L$(METISDIR)/lib -lmetis
1774 ORDERINGSF += -Dmetis~]~@[~:{
1776 ISCOTCH = -I$(SCOTCHDIR)/include
1777 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1778 ORDERINGSF += ~a~}~]
1779 ORDERINGSC = $(ORDERINGSF)
1780 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1781 IORDERINGSF = $(ISCOTCH)
1782 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1783 (assoc-ref inputs "mpi")
1784 (assoc-ref inputs "blas")
1785 (assoc-ref inputs "scalapack")
1786 (assoc-ref inputs "metis")
1787 (match (list (assoc-ref inputs "pt-scotch")
1788 (assoc-ref inputs "scotch"))
1792 `((,scotch "" "-Dscotch")))
1795 "-lptesmumps -lptscotch -lptscotcherr "
1796 "-Dptscotch")))))))))
1798 ;; By default only the d-precision library is built. Make with "all"
1799 ;; target so that all precision libraries and examples are built.
1801 (zero? (system* "make" "all"
1802 (format #f "-j~a" (parallel-job-count))))))
1804 ;; Run the simple test drivers, which read test input from stdin:
1805 ;; from the "real" input for the single- and double-precision
1806 ;; testers, and from the "cmplx" input for complex-precision
1807 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1808 ;; package to prefix execution with "mpirun".
1809 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1810 (with-directory-excursion "examples"
1813 (let ((tester (apply open-pipe*
1816 ,(string-append "./" prec
1818 (input (open-input-file
1819 (string-append "input_simpletest_" type))))
1821 (dump-port input tester)
1823 (zero? (close-pipe tester)))))
1825 '("real" "real" "cmplx" "cmplx")))))
1827 (lambda* (#:key outputs #:allow-other-keys)
1828 (let* ((out (assoc-ref outputs "out"))
1829 (libdir (string-append out "/lib")))
1830 (copy-recursively "lib" libdir)
1831 (copy-recursively "include" (string-append out "/include"))
1832 (when (file-exists? "libseq/libmpiseq.a")
1833 (install-file "libseq/libmpiseq.a" libdir))
1835 (home-page "http://mumps.enseeiht.fr")
1836 (synopsis "Multifrontal sparse direct solver")
1838 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1839 sparse system of linear equations A x = b using Guassian elimination.")
1840 (license license:cecill-c)))
1842 (define-public mumps-metis
1843 (package (inherit mumps)
1844 (name "mumps-metis")
1846 (alist-delete "scotch" (package-inputs mumps)))))
1848 (define-public mumps-openmpi
1849 (package (inherit mumps)
1850 (name "mumps-openmpi")
1853 ("scalapack" ,scalapack)
1854 ("pt-scotch" ,pt-scotch)
1855 ,@(alist-delete "scotch" (package-inputs mumps))))
1857 (substitute-keyword-arguments (package-arguments mumps)
1859 `(modify-phases ,phases
1863 ((assoc-ref ,phases 'check)
1864 #:exec-prefix '("mpirun" "-n" "2"))))))))
1865 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1867 (define-public mumps-metis-openmpi
1868 (package (inherit mumps-openmpi)
1869 (name "mumps-metis-openmpi")
1871 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1873 (define-public r-quadprog
1880 (uri (cran-uri "quadprog" version))
1883 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1884 (build-system r-build-system)
1886 `(("gfortran" ,gfortran)))
1887 (home-page "http://cran.r-project.org/web/packages/quadprog")
1888 (synopsis "Functions to solve quadratic programming problems")
1890 "This package contains routines and documentation for solving quadratic
1891 programming problems.")
1892 (license license:gpl3+)))
1894 (define-public r-pracma
1900 (uri (cran-uri "pracma" version))
1902 (base32 "1mylrrkyycaw9m01mmg6xkn5wgdlabs5l0qyws60r0n2ycblp897"))))
1903 (build-system r-build-system)
1905 `(("r-quadprog" ,r-quadprog)))
1906 (home-page "http://cran.r-project.org/web/packages/pracma")
1907 (synopsis "Practical numerical math functions")
1908 (description "This package provides functions for numerical analysis and
1909 linear algebra, numerical optimization, differential equations, plus some
1910 special functions. It uses Matlab function names where appropriate to simplify
1912 (license license:gpl3+)))
1914 (define-public superlu
1921 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1922 "superlu_" version ".tar.gz"))
1924 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1925 (modules '((guix build utils)))
1927 ;; Replace the non-free implementation of MC64 with a stub adapted
1930 (use-modules (ice-9 regex)
1932 (call-with-output-file "SRC/mc64ad.c"
1937 void mc64id_(int *a) {
1938 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1941 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1942 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1943 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1946 ;; Remove the corresponding license verbiage. MC64 license follows
1947 ;; a "------" line separator.
1948 (with-atomic-file-replacement "License.txt"
1949 (let ((rx (make-regexp "-{8}")))
1952 (let ((line (read-line in 'concat)))
1953 (unless (regexp-exec rx line)
1956 (build-system cmake-build-system)
1960 `(("blas" ,openblas)
1961 ("gfortran" ,gfortran)))
1963 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1964 "-DTPL_BLAS_LIBRARIES=openblas"
1965 "-DBUILD_SHARED_LIBS:BOOL=YES"
1966 "-DCMAKE_INSTALL_LIBDIR=lib")))
1967 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1968 (synopsis "Supernodal direct solver for sparse linear systems")
1970 "SuperLU is a general purpose library for the direct solution of large,
1971 sparse, nonsymmetric systems of linear equations on high performance machines.
1972 The library is written in C and is callable from either C or Fortran. The
1973 library routines perform an LU decomposition with partial pivoting and
1974 triangular system solves through forward and back substitution. The library
1975 also provides threshold-based ILU factorization preconditioners.")
1976 (license (list license:bsd-3
1977 license:gpl2+ ;EXAMPLE/*fgmr.c
1978 (license:fsf-free "file://SRC/colamd.h")))))
1980 (define-public superlu-dist
1982 (name "superlu-dist")
1987 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1988 "superlu_dist_" version ".tar.gz"))
1990 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
1991 (modules '((guix build utils)))
1993 ;; Replace the non-free implementation of MC64 with a stub
1995 (use-modules (ice-9 regex)
1997 (call-with-output-file "SRC/mc64ad.c"
2002 void mc64id_(int *a) {
2003 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2006 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2007 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2008 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2011 (delete-file "SRC/mc64ad.f.bak")
2012 (substitute* "SRC/util.c" ;adjust default algorithm
2013 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2014 "RowPerm = NOROWPERM"))))
2015 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2016 (build-system gnu-build-system)
2020 `(("gfortran" ,gfortran)))
2022 `(("openmpi" ,openmpi) ;headers include MPI heades
2023 ("lapack" ,lapack) ;required to link with output library
2024 ("pt-scotch" ,pt-scotch))) ;same
2026 `(#:parallel-build? #f ;race conditions using ar
2028 (modify-phases %standard-phases
2030 (lambda* (#:key inputs outputs #:allow-other-keys)
2031 (call-with-output-file "make.inc"
2036 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2037 BLASDEF = -DUSE_VENDOR_BLAS
2038 BLASLIB = -L~a/lib -lblas
2039 PARMETISLIB = -L~a/lib \
2040 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2041 -lscotch -lscotcherr -lscotcherrexit
2042 METISLIB = -L~:*~a/lib \
2043 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2044 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2050 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2051 NOOPTS = -O0 -g $(PIC)
2053 FFLAGS = -O2 -g $(PIC)
2057 (assoc-ref outputs "out")
2058 (assoc-ref inputs "lapack")
2059 (assoc-ref inputs "pt-scotch"))))
2061 (add-after 'unpack 'remove-broken-symlinks
2063 (for-each delete-file
2064 (find-files "MAKE_INC" "\\.#make\\..*"))
2066 (add-before 'build 'create-install-directories
2067 (lambda* (#:key outputs #:allow-other-keys)
2070 (mkdir-p (string-append (assoc-ref outputs "out")
2076 (with-directory-excursion "EXAMPLE"
2078 (zero? (system* "mpirun" "-n" "2"
2079 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2080 (zero? (system* "mpirun" "-n" "2"
2081 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2083 (lambda* (#:key outputs #:allow-other-keys)
2084 ;; Library is placed in lib during the build phase. Copy over
2085 ;; headers to include.
2086 (let* ((out (assoc-ref outputs "out"))
2087 (incdir (string-append out "/include")))
2088 (for-each (lambda (file)
2089 (let ((base (basename file)))
2090 (format #t "installing `~a' to `~a'~%"
2093 (string-append incdir "/" base))))
2094 (find-files "SRC" ".*\\.h$")))
2096 (home-page (package-home-page superlu))
2097 (synopsis "Parallel supernodal direct solver")
2099 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2100 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2101 implemented in ANSI C, and MPI for communications.")
2102 (license license:bsd-3)))
2104 (define-public scotch
2111 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
2112 "scotch_" version ".tar.gz"))
2114 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
2115 (patches (search-patches "scotch-test-threading.patch"
2116 "pt-scotch-build-parallelism.patch"))))
2117 (build-system gnu-build-system)
2124 (modify-phases %standard-phases
2126 'unpack 'chdir-to-src
2127 (lambda _ (chdir "src")))
2131 (call-with-output-file "Makefile.inc"
2145 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2146 LDFLAGS = -lz -lm -lrt -lpthread
2148 LEX = flex -Pscotchyy -olex.yy.c
2153 YACC = bison -pscotchyy -y -b y
2155 '("COMMON_FILE_COMPRESS_GZ"
2157 "COMMON_RANDOM_FIXED_SEED"
2158 "INTSIZE64" ;use 'long' instead of 'int'
2159 ;; Prevents symbolc clashes with libesmumps
2161 ;; XXX: Causes invalid frees in superlu-dist tests
2163 ;; "SCOTCH_PTHREAD_NUMBER=2"
2164 "restrict=__restrict"))))))
2166 'build 'build-esmumps
2168 (zero? (system* "make"
2169 (format #f "-j~a" (parallel-job-count))
2173 (lambda* (#:key outputs #:allow-other-keys)
2174 (let ((out (assoc-ref outputs "out")))
2176 (zero? (system* "make"
2177 (string-append "prefix=" out)
2179 ;; esmumps files are not installed with the above
2180 (for-each (lambda (f)
2181 (copy-file f (string-append out "/include/" f)))
2182 (find-files "../include" ".*esmumps.h$"))
2183 (for-each (lambda (f)
2184 (copy-file f (string-append out "/lib/" f)))
2185 (find-files "../lib" "^lib.*esmumps.*"))))))))
2186 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2187 (synopsis "Programs and libraries for graph algorithms")
2188 (description "SCOTCH is a set of programs and libraries which implement
2189 the static mapping and sparse matrix reordering algorithms developed within
2190 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2191 conquer approach, to scientific computing problems such as graph and mesh
2192 partitioning, static mapping, and sparse matrix ordering, in application
2193 domains ranging from structural mechanics to operating systems or
2195 ;; See LICENSE_en.txt
2196 (license license:cecill-c)))
2198 (define-public scotch32
2199 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2200 ;; some applications.
2201 (package (inherit scotch)
2204 (substitute-keyword-arguments (package-arguments scotch)
2205 ((#:phases scotch-phases)
2206 `(modify-phases ,scotch-phases
2210 (call-with-output-file "Makefile.inc"
2224 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2225 LDFLAGS = -lz -lm -lrt -lpthread
2227 LEX = flex -Pscotchyy -olex.yy.c
2232 YACC = bison -pscotchyy -y -b y
2234 '("COMMON_FILE_COMPRESS_GZ"
2236 "COMMON_RANDOM_FIXED_SEED"
2237 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2238 ;; Prevents symbolc clashes with libesmumps
2240 ;; XXX: Causes invalid frees in superlu-dist tests
2242 ;; "SCOTCH_PTHREAD_NUMBER=2"
2243 "restrict=__restrict"))))))))))
2245 "Programs and libraries for graph algorithms (32-bit integers)")))
2247 (define-public pt-scotch
2248 (package (inherit scotch)
2251 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2253 (substitute-keyword-arguments (package-arguments scotch)
2254 ((#:phases scotch-phases)
2255 `(modify-phases ,scotch-phases
2260 (zero? (system* "make"
2261 (format #f "-j~a" (parallel-job-count))
2262 "ptscotch" "ptesmumps"))
2263 ;; Install the serial metis compatibility library
2264 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2267 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2268 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2270 (define-public pt-scotch32
2271 (package (inherit scotch32)
2272 (name "pt-scotch32")
2274 `(("openmpi" ,openmpi))) ;headers include MPI headers
2276 (substitute-keyword-arguments (package-arguments scotch32)
2277 ((#:phases scotch32-phases)
2278 `(modify-phases ,scotch32-phases
2282 (zero? (system* "make"
2283 (format #f "-j~a" (parallel-job-count))
2284 "ptscotch" "ptesmumps"))
2285 ;; Install the serial metis compatibility library
2286 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2289 (zero? (system* "make" "ptcheck"))))))))
2291 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2293 (define-public metis
2300 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2301 "metis-" version ".tar.gz"))
2304 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2305 (build-system cmake-build-system)
2307 `(("blas" ,openblas)))
2309 `(#:tests? #f ;no tests
2310 #:configure-flags `("-DSHARED=ON"
2311 ,(string-append "-DGKLIB_PATH=" (getcwd)
2312 "/metis-" ,version "/GKlib"))))
2313 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2314 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2316 "METIS is a set of serial programs for partitioning graphs, partitioning
2317 finite element meshes, and producing fill-reducing orderings for sparse
2318 matrices. The algorithms implemented in METIS are based on the multilevel
2319 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2321 (license license:asl2.0))) ;As of version 5.0.3
2323 (define-public p4est
2330 (uri (string-append "http://p4est.github.io/release/p4est-"
2334 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2335 (build-system gnu-build-system)
2337 `(("fortran" ,gfortran)
2342 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2343 (assoc-ref %build-inputs "blas")
2345 ,(string-append "LAPACK_LIBS=-L"
2346 (assoc-ref %build-inputs "lapack")
2348 (home-page "http://www.p4est.org")
2349 (synopsis "Adaptive mesh refinement on forests of octrees")
2351 "The p4est software library enables the dynamic management of a
2352 collection of adaptive octrees, conveniently called a forest of octrees.
2353 p4est is designed to work in parallel and scales to hundreds of thousands of
2355 (license license:gpl2+)))
2357 (define-public p4est-openmpi
2358 (package (inherit p4est)
2359 (name "p4est-openmpi")
2362 ,@(package-inputs p4est)))
2364 (substitute-keyword-arguments (package-arguments p4est)
2365 ((#:configure-flags cf)
2366 ``("--enable-mpi" ,@,cf))))
2367 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2369 (define-public gsegrafix
2376 (uri (string-append "mirror://gnu/" name "/" name "-"
2380 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2381 (build-system gnu-build-system)
2383 `(#:configure-flags '("LDFLAGS=-lm")))
2385 `(("libgnomecanvas" ,libgnomecanvas)
2386 ("libbonoboui" ,libbonoboui)
2387 ("libgnomeui" ,libgnomeui)
2388 ("libgnomeprintui" ,libgnomeprintui)
2391 `(("pkg-config" ,pkg-config)))
2392 (home-page "https://www.gnu.org/software/gsegrafix/")
2393 (synopsis "GNOME application to create scientific and engineering plots")
2394 (description "GSEGrafix is an application which produces high-quality graphical
2395 plots for science and engineering. Plots are specified via simple ASCII
2396 parameter files and data files and are presented in an anti-aliased GNOME
2397 canvas. The program supports rectangular two-dimensional plots, histograms,
2398 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2399 to BMP, JPEG or PNG image formats.")
2400 (license license:gpl3+)))
2402 (define-public maxima
2409 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2410 version "-source/" name "-" version ".tar.gz"))
2413 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2414 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2415 (build-system gnu-build-system)
2418 ("gnuplot" ,gnuplot) ;for plots
2419 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2421 `(("texinfo" ,texinfo)
2423 ("python" ,python)))
2426 (list "--enable-gcl"
2427 (string-append "--with-posix-shell="
2428 (assoc-ref %build-inputs "bash")
2430 (string-append "--with-wish="
2431 (assoc-ref %build-inputs "tk")
2433 (let ((v ,(package-version tk)))
2434 (string-take v (string-index-right v #\.)))))
2435 ;; By default Maxima attempts to write temporary files to
2436 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2437 ;; Work around that.
2438 #:make-flags (list "TMPDIR=/tmp")
2440 (modify-phases %standard-phases
2441 (add-before 'check 'pre-check
2443 (chmod "src/maxima" #o555)
2445 ;; Make sure the doc and emacs files are found in the
2446 ;; standard location. Also configure maxima to find gnuplot
2447 ;; without having it on the PATH.
2448 (add-after 'install 'post-install
2449 (lambda* (#:key outputs inputs #:allow-other-keys)
2450 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2451 (out (assoc-ref outputs "out"))
2452 (datadir (string-append out "/share/maxima/" ,version))
2453 (binutils (string-append (assoc-ref inputs "binutils")
2455 (with-directory-excursion out
2456 (mkdir-p "share/emacs")
2457 (mkdir-p "share/doc")
2459 (string-append datadir "/emacs/")
2460 (string-append out "/share/emacs/site-lisp"))
2462 (string-append datadir "/doc/")
2463 (string-append out "/share/doc/maxima"))
2464 (with-atomic-file-replacement
2465 (string-append datadir "/share/maxima-init.lisp")
2467 (format out "~a ~s~a~%"
2468 "(setf $gnuplot_command "
2469 (string-append gnuplot "/bin/gnuplot") ")")
2470 (dump-port in out))))
2471 ;; Ensure that Maxima will have access to the GNU binutils
2472 ;; components at runtime.
2473 (wrap-program (string-append out "/bin/maxima")
2474 `("PATH" prefix (,binutils))))
2476 (home-page "http://maxima.sourceforge.net")
2477 (synopsis "Numeric and symbolic expression manipulation")
2478 (description "Maxima is a system for the manipulation of symbolic and
2479 numerical expressions. It yields high precision numeric results by using
2480 exact fractions, arbitrary precision integers, and variable precision floating
2482 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2483 ;; Others simply say "GNU General Public License" without stating a
2484 ;; version (which implicitly means gpl1+).
2485 ;; At least one file (src/maxima.asd) says "version 2."
2486 ;; GPLv2 only is therefore the smallest subset.
2487 (license license:gpl2)))
2489 (define-public wxmaxima
2496 (uri (string-append "https://github.com/andrejv/" name "/archive"
2497 "/Version-" version ".tar.gz"))
2498 (file-name (string-append name "-" version ".tar.gz"))
2501 "0dv0cy0cf46v0cbw32izscpkdmpxg1qhwq1f4cz46kkqd8k4yfbj"))))
2502 (build-system gnu-build-system)
2504 `(("autoconf" ,autoconf)
2505 ("automake" ,automake)
2506 ("gettext" ,gettext-minimal)))
2508 `(("wxwidgets" ,wxwidgets)
2511 ("adwaita-icon-theme" ,adwaita-icon-theme)
2513 ("shared-mime-info" ,shared-mime-info)))
2516 (modify-phases %standard-phases
2517 (add-after 'unpack 'autoconf
2519 (zero? (system* "sh" "bootstrap"))))
2520 (add-after 'install 'wrap-program
2521 (lambda* (#:key inputs outputs #:allow-other-keys)
2522 (wrap-program (string-append (assoc-ref outputs "out")
2525 (,(string-append (assoc-ref inputs "maxima")
2527 ;; For GtkFileChooserDialog.
2528 `("GSETTINGS_SCHEMA_DIR" =
2529 (,(string-append (assoc-ref inputs "gtk+")
2530 "/share/glib-2.0/schemas")))
2531 `("XDG_DATA_DIRS" ":" prefix
2532 (;; Needed by gdk-pixbuf to know supported icon formats.
2534 (assoc-ref inputs "shared-mime-info") "/share")
2535 ;; The default icon theme of GTK+.
2537 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2539 (home-page "https://andrejv.github.io/wxmaxima/")
2540 (synopsis "Graphical user interface for the Maxima computer algebra system")
2542 "wxMaxima is a graphical user interface for the Maxima computer algebra
2543 system. It eases the use of Maxima by making most of its commands available
2544 through a menu system and by providing input dialogs for commands that require
2545 more than one argument. It also implements its own display engine that
2546 outputs mathematical symbols directly instead of depicting them with ASCII
2549 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2550 text and mathematical calculations to create documents, exporting of input and
2551 output to TeX, and a browser for Maxima's manual including command index and
2552 full text searching.")
2553 (license license:gpl2+)))
2555 (define-public armadillo
2561 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2565 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2566 (build-system cmake-build-system)
2567 (arguments `(#:tests? #f)) ;no test target
2569 `(("openblas" ,openblas)
2571 ("arpack" ,arpack-ng)))
2572 (home-page "http://arma.sourceforge.net/")
2573 (synopsis "C++ linear algebra library")
2575 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2576 between speed and ease of use. It is useful for algorithm development
2577 directly in C++, or quick conversion of research code into production
2578 environments. It can be used for machine learning, pattern recognition,
2579 signal processing, bioinformatics, statistics, econometrics, etc. The library
2580 provides efficient classes for vectors, matrices and cubes, as well as 150+
2581 associated functions (eg. contiguous and non-contiguous submatrix views).")
2582 (license license:asl2.0)))
2584 (define-public muparser
2585 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2586 ;; different hash. In order to make `guix package --upgrade` work correctly,
2587 ;; we set a Guix packaging revision.
2588 ;; When the next version of muparser is released, we can remove
2589 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2590 (let ((upstream-version "2.2.5")
2594 (version (string-append upstream-version "-" revision))
2598 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2599 upstream-version ".tar.gz"))
2600 (file-name (string-append name "-" version ".tar.gz"))
2603 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2604 (build-system gnu-build-system)
2606 `(#:configure-flags '("--enable-samples=no")
2607 #:tests? #f)) ;no "check" target
2608 (home-page "http://muparser.beltoforion.de/")
2609 (synopsis "Fast parser library for mathematical expressions")
2611 "muParser is an extensible high performance math parser library. It is
2612 based on transforming an expression into a bytecode and precalculating constant
2614 (license license:expat))))
2616 (define-public openblas
2623 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2625 (file-name (string-append name "-" version ".tar.gz"))
2628 "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a"))))
2629 (build-system gnu-build-system)
2631 `(#:test-target "test"
2632 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2633 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2634 ;; we need to disable substitutions.
2636 ,(let ((system (or (%current-target-system) (%current-system))))
2637 (or (string-prefix? "x86_64" system)
2638 (string-prefix? "i686" system)
2639 (string-prefix? "mips" system)
2640 (string-prefix? "aarch64" system)))
2642 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2645 ;; Build the library for all supported CPUs. This allows
2646 ;; switching CPU targets at runtime with the environment variable
2647 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2648 ;; Unfortunately, this is not supported on non-x86 architectures,
2649 ;; where it leads to failed builds.
2650 ,@(let ((system (or (%current-target-system) (%current-system))))
2652 ((or (string-prefix? "x86_64" system)
2653 (string-prefix? "i686" system))
2654 '("DYNAMIC_ARCH=1"))
2655 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2656 ;; two available MIPS targets special extended instructions
2657 ;; for Loongson cores are used.
2658 ((string-prefix? "mips" system)
2659 '("TARGET=SICORTEX"))
2660 ;; On aarch64 force the generic 'armv8-a' target
2661 ((string-prefix? "aarch64" system)
2664 ;; no configure script
2665 #:phases (alist-delete 'configure %standard-phases)))
2667 `(("fortran" ,gfortran)))
2671 (home-page "http://www.openblas.net/")
2672 (synopsis "Optimized BLAS library based on GotoBLAS")
2674 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2675 (license license:bsd-3)))
2677 (define* (make-blis implementation #:optional substitutable?)
2678 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2679 source tree for a list of implementations.)
2681 SUBSTITUTABLE? determines whether the package is made available as a
2684 Currently the specialization must be selected at configure-time, but work is
2685 underway to allow BLIS to select the right optimized kernels at run time:
2686 <https://github.com/flame/blis/issues/129>."
2688 (name (if (string=? implementation "reference")
2690 (string-append "blis-" implementation)))
2692 (home-page "https://github.com/flame/blis")
2695 (uri (git-reference (url home-page) (commit version)))
2698 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2699 (file-name (git-file-name "blis" version))))
2700 (build-system gnu-build-system)
2702 `(#:test-target "test"
2704 #:substitutable? ,substitutable?
2706 #:phases (modify-phases %standard-phases
2708 (lambda* (#:key outputs #:allow-other-keys)
2709 ;; This is a home-made 'configure' script.
2710 (let ((out (assoc-ref outputs "out")))
2711 (zero? (system* "./configure" "-p" out
2715 "--enable-threading=openmp"
2717 ,implementation)))))
2718 (add-before 'check 'show-test-output
2720 ;; By default "make check" is silent. Make it verbose.
2721 (system "tail -F output.testsuite &")
2723 (synopsis "High-performance basic linear algebra (BLAS) routines")
2725 "BLIS is a portable software framework for instantiating high-performance
2726 BLAS-like dense linear algebra libraries. The framework was designed to
2727 isolate essential kernels of computation that, when optimized, immediately
2728 enable optimized implementations of most of its commonly used and
2729 computationally intensive operations. While BLIS exports a new BLAS-like API,
2730 it also includes a BLAS compatibility layer which gives application developers
2731 access to BLIS implementations via traditional BLAS routine calls.")
2732 (license license:bsd-3)))
2735 ;; This is the "reference" implementation, which is the non-optimized but
2736 ;; portable variant (no assembly).
2737 (make-blis "reference" #t))
2739 (define ignorance blis)
2741 (define-syntax-rule (blis/x86_64 processor)
2742 "Expand to a package specialized for PROCESSOR."
2744 (inherit (make-blis processor))
2745 (supported-systems '("x86_64-linux"))))
2747 (define-public blis-sandybridge
2748 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2749 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2750 (blis/x86_64 "sandybridge"))
2752 (define-public blis-haswell
2753 ;; BLIS specialized for Haswell processors (launched 2013):
2754 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2755 (blis/x86_64 "haswell"))
2757 (define-public blis-knl
2758 ;; BLIS specialized for Knights Landing processor (launched 2016):
2759 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2760 (blis/x86_64 "knl"))
2763 (define-public openlibm
2770 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2772 (file-name (string-append name "-" version ".tar.gz"))
2775 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2776 (build-system gnu-build-system)
2779 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2781 ;; no configure script
2782 (modify-phases %standard-phases (delete 'configure))
2783 #:tests? #f)) ;the tests are part of the default target
2784 (home-page "http://openlibm.org/")
2785 (synopsis "Portable C mathematical library (libm)")
2787 "OpenLibm is an effort to have a high quality, portable, standalone C
2788 mathematical library (libm). It can be used standalone in applications and
2789 programming language implementations. The project was born out of a need to
2790 have a good libm for the Julia programming language that worked consistently
2791 across compilers and operating systems, and in 32-bit and 64-bit
2793 ;; Each architecture has its own make target, and there is none for mips.
2794 (supported-systems (delete "mips64el-linux" %supported-systems))
2795 ;; See LICENSE.md for details.
2796 (license (list license:expat
2799 license:public-domain
2800 license:lgpl2.1+))))
2802 (define-public openspecfun
2804 (name "openspecfun")
2809 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2811 (file-name (string-append name "-" version ".tar.gz"))
2814 "1y5b2h6f2k72536kym3vzy3li3bhpd23x463g7hdmjdi3cncavz1"))))
2815 (build-system gnu-build-system)
2817 '(#:tests? #f ;no "check" target
2819 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2820 ;; no configure script
2821 #:phases (modify-phases %standard-phases (delete 'configure))))
2823 `(("fortran" ,gfortran)))
2824 (home-page "https://github.com/JuliaLang/openspecfun")
2825 (synopsis "Collection of special mathematical functions")
2827 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2828 portable package for Bessel Functions of a Complex Argument and Nonnegative
2829 Order; it contains subroutines for computing Bessel functions and Airy
2830 functions. Faddeeva allows computing the various error functions of arbitrary
2831 complex arguments (Faddeeva function, error function, complementary error
2832 function, scaled complementary error function, imaginary error function, and
2833 Dawson function); given these, one can also easily compute Voigt functions,
2834 Fresnel integrals, and similar related functions as well.")
2835 ;; Faddeeva is released under the Expat license; AMOS is included as
2836 ;; public domain software.
2837 (license (list license:expat license:public-domain))))
2839 (define-public suitesparse
2841 (name "suitesparse")
2847 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2851 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2852 (modules '((guix build utils)))
2854 ;; Remove bundled metis source
2855 '(delete-file-recursively "metis-5.1.0"))))
2856 (build-system gnu-build-system)
2858 '(#:tests? #f ;no "check" target
2863 "MY_METIS_LIB=-lmetis"
2864 (string-append "INSTALL_LIB="
2865 (assoc-ref %outputs "out") "/lib")
2866 (string-append "INSTALL_INCLUDE="
2867 (assoc-ref %outputs "out") "/include")
2870 (modify-phases %standard-phases
2871 (delete 'configure)))) ;no configure script
2876 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2877 (synopsis "Suite of sparse matrix software")
2879 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2880 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2881 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2882 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2883 CXSparse, a concise sparse Cholesky factorization package; and many other
2886 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2888 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2889 (license (list license:gpl2+ license:lgpl2.1+))))
2891 (define-public atlas
2897 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2898 version "/atlas" version ".tar.bz2"))
2901 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2902 (build-system gnu-build-system)
2903 (home-page "http://math-atlas.sourceforge.net/")
2904 (inputs `(("gfortran" ,gfortran)
2905 ("lapack-tar" ,(package-source lapack))))
2906 (outputs '("out" "doc"))
2907 ;; For the moment we drop support for MIPS at it fails to compile. See
2908 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2909 (supported-systems (delete "mips64el-linux" %supported-systems))
2911 `(#:parallel-build? #f
2912 #:parallel-tests? #f
2914 ;; ATLAS tunes itself for the machine it is built on, as explained at
2915 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2916 ;; For this reason, we want users to build it locally instead of using
2920 #:modules ((srfi srfi-26)
2922 (guix build gnu-build-system)
2925 `(;; Generate position independent code suitable for dynamic libraries
2926 ;; and use WALL timer to get more accurate timing.
2927 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2930 ,,(if (string-match "64" (%current-system))
2933 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2934 ;; needed to compile C files before it is generated.
2935 "-Ss" "pmake" "make -j 1"
2936 ;; Probe is failing for MIPS. We therefore define the system
2937 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2938 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2939 ,,@(if (string-prefix? "mips" (%current-system))
2940 (list "-A" "49" "-V" "1")
2942 ;; Generate shared libraries.
2944 ;; Build a full LAPACK library.
2945 ,(string-append "--with-netlib-lapack-tarfile="
2946 (assoc-ref %build-inputs "lapack-tar")))
2948 (modify-phases %standard-phases
2949 (add-after 'install 'install-doc
2950 (lambda* (#:key outputs inputs #:allow-other-keys)
2951 (let ((doc (string-append (assoc-ref outputs "doc")
2952 "/share/doc/atlas")))
2954 (fold (lambda (file previous)
2955 (and previous (zero? (system* "cp" file doc))))
2956 #t (find-files "../ATLAS/doc" ".*")))))
2957 (add-after 'check 'check-pt
2958 (lambda _ (zero? (system* "make" "ptcheck"))))
2959 ;; Fix files required to run configure.
2960 (add-before 'configure 'fix-/bin/sh
2962 ;; Use `sh', not `/bin/sh'.
2963 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2966 ;; Fix /bin/sh in generated make files.
2967 (add-after 'configure 'fix-/bin/sh-in-generated-files
2969 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2972 ;; ATLAS configure program does not accepts the default flags
2973 ;; passed by the 'gnu-build-system'.
2975 (lambda* (#:key native-inputs inputs outputs
2976 (configure-flags '())
2977 #:allow-other-keys #:rest args)
2978 (let* ((prefix (assoc-ref outputs "out"))
2979 (bash (or (and=> (assoc-ref
2980 (or native-inputs inputs) "bash")
2981 (cut string-append <> "/bin/bash"))
2983 (flags `(,(string-append "--prefix=" prefix)
2985 (abs-srcdir (getcwd))
2986 (srcdir (string-append "../" (basename abs-srcdir))))
2987 (format #t "source directory: ~s (relative from build: ~s)~%"
2991 (format #t "build directory: ~s~%" (getcwd))
2992 (format #t "configure flags: ~s~%" flags)
2993 (zero? (apply system* bash
2994 (string-append srcdir "/configure")
2996 (synopsis "Automatically Tuned Linear Algebra Software")
2998 "ATLAS is an automatically tuned linear algebra software library
2999 providing C and Fortran77 interfaces to a portably efficient BLAS
3000 implementation, as well as a few routines from LAPACK.
3002 Optimization occurs at build time. For this reason, the library is built on
3003 the machine where it is installed, without resorting to pre-built substitutes.
3005 Before building the library, CPU throttling should be disabled. This can be
3006 done in the BIOS, or, on GNU/Linux, with the following command:
3009 # cpupower --governor performance
3012 Failure to do so will result in a library with poor performance.")
3013 (license license:bsd-3)))
3022 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3023 "/glm-" version ".zip"))
3026 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3027 (build-system cmake-build-system)
3029 `(("unzip" ,unzip)))
3030 (home-page "http://glm.g-truc.net")
3031 (synopsis "OpenGL Mathematics library")
3032 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3033 library for graphics software based on the OpenGL Shading Language (GLSL)
3035 (license license:expat)))
3037 (define-public lpsolve
3044 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3045 "/lp_solve_" version "_source.tar.gz"))
3048 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
3049 (modules '((guix build utils)))
3051 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3053 ;; Pretend to be on a 64 bit platform to obtain a common directory
3054 ;; name for the build results on all architectures; nothing else
3055 ;; seems to depend on it.
3056 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3058 ;; The check for 'isnan' as it is written fails with
3059 ;; "non-floating-point argument in call to function
3060 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3061 ;; definition, which in turn leads to bad things. Fix the feature
3063 (("isnan\\(0\\)") "isnan(0.)")))))
3064 (build-system gnu-build-system)
3066 `(#:tests? #f ; no check target
3068 (modify-phases %standard-phases
3072 (and (with-directory-excursion "lpsolve55"
3073 (zero? (system* "bash" "ccc")))
3074 (with-directory-excursion "lp_solve"
3075 (zero? (system* "bash" "ccc"))))))
3077 (lambda* (#:key outputs #:allow-other-keys)
3078 (let* ((out (assoc-ref outputs "out"))
3079 (bin (string-append out "/bin"))
3080 (lib (string-append out "/lib"))
3081 ;; This is where LibreOffice expects to find the header
3082 ;; files, and where they are installed by Debian.
3083 (include (string-append out "/include/lpsolve")))
3085 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
3086 (string-append lib "/liblpsolve55.a"))
3087 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
3088 (string-append lib "/liblpsolve55.so"))
3089 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3091 ;; Install a subset of the header files as on Debian
3092 ;; (plus lp_bit.h, which matches the regular expression).
3093 (for-each (lambda (name)
3094 (install-file name include))
3095 (find-files "." "lp_[HMSa-z].*\\.h$"))
3096 (with-directory-excursion "shared"
3097 (for-each (lambda (name)
3098 (install-file name include))
3099 (find-files "." "\\.h$")))
3101 (home-page "http://lpsolve.sourceforge.net/")
3102 (synopsis "Mixed integer linear programming (MILP) solver")
3104 "lp_solve is a mixed integer linear programming solver based on the
3105 revised simplex and the branch-and-bound methods.")
3106 (license license:lgpl2.1+)))
3108 (define-public dealii
3115 (uri (string-append "https://github.com/dealii/dealii/releases/"
3116 "download/v" version "/dealii-" version ".tar.gz"))
3119 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3120 (modules '((guix build utils)))
3122 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3123 '(delete-file-recursively "bundled"))))
3124 (build-system cmake-build-system)
3132 ("arpack" ,arpack-ng)
3133 ("muparser" ,muparser)
3134 ("gfortran" ,gfortran)
3135 ("suitesparse" ,suitesparse))) ;for UMFPACK
3137 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3139 ;; Work around a bug in libsuitesparseconfig linking
3140 ;; see https://github.com/dealii/dealii/issues/4745
3141 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3142 (home-page "https://www.dealii.org")
3143 (synopsis "Finite element library")
3145 "Deal.II is a C++ program library targeted at the computational solution
3146 of partial differential equations using adaptive finite elements. The main
3147 aim of deal.II is to enable rapid development of modern finite element codes,
3148 using among other aspects adaptive meshes and a wide array of tools often used
3149 in finite element programs.")
3150 (license license:lgpl2.1+)))
3152 (define-public dealii-openmpi
3153 (package (inherit dealii)
3154 (name "dealii-openmpi")
3157 ;;Supported only with MPI:
3158 ("p4est" ,p4est-openmpi)
3159 ("petsc" ,petsc-openmpi)
3160 ("slepc" ,slepc-openmpi)
3161 ("metis" ,metis) ;for MUMPS
3162 ("scalapack" ,scalapack) ;for MUMPS
3163 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3164 ("arpack" ,arpack-ng-openmpi)
3165 ,@(fold alist-delete (package-inputs dealii)
3166 '("p4est" "arpack"))))
3168 (substitute-keyword-arguments (package-arguments dealii)
3169 ((#:configure-flags cf)
3170 ``("-DMPI_C_COMPILER=mpicc"
3171 "-DMPI_CXX_COMPILER=mpicxx"
3172 "-DMPI_Fortran_COMPILER=mpifort"
3174 (synopsis "Finite element library (with MPI support)")))
3176 (define-public flann
3185 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3186 version "-src.zip"))
3189 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3190 (build-system cmake-build-system)
3192 "octave")) ;46 MiB .mex file that pulls Octave
3194 `(("unzip" ,unzip)))
3198 ("python" ,python-2) ; print syntax
3199 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3202 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3203 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3204 #:strip-directories '("lib" "lib64" "libexec"
3205 "bin" "sbin" "share/flann/octave")
3207 ;; Save 12 MiB by not installing .a files. Passing
3208 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3209 #:phases (modify-phases %standard-phases
3210 (add-before 'configure 'set-octave-directory
3211 (lambda* (#:key outputs #:allow-other-keys)
3212 ;; Install the .mex file in the "octave" output.
3213 (let ((out (assoc-ref outputs "octave")))
3214 (substitute* "src/matlab/CMakeLists.txt"
3215 (("share/flann/octave")
3216 (string-append out "/share/flann/octave")))
3218 (add-after 'install 'remove-static-libraries
3219 (lambda* (#:key outputs #:allow-other-keys)
3220 (let* ((out (assoc-ref outputs "out"))
3221 (lib (string-append out "/lib")))
3222 (for-each delete-file
3223 (find-files lib "\\.a$"))
3226 #:tests? #f)) ; The test data are downloaded from the Internet.
3227 (home-page "http://www.cs.ubc.ca/research/flann/")
3228 (synopsis "Library for approximate nearest neighbors computation")
3229 (description "FLANN is a library for performing fast approximate
3230 nearest neighbor searches in high dimensional spaces. It implements a
3231 collection of algorithms and a system for automatically choosing the best
3232 algorithm and optimum parameters depending on the dataset.
3234 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3235 (license (license:non-copyleft "file://COPYING"
3236 "See COPYING in the distribution."))))
3238 (define-public wcalc
3245 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3246 "wcalc-" version ".tar.bz2"))
3249 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3250 (build-system gnu-build-system)
3253 ("readline" ,readline)))
3254 (home-page "http://w-calc.sourceforge.net/index.php")
3255 (synopsis "Flexible command-line scientific calculator")
3256 (description "Wcalc is a very capable calculator. It has standard functions
3257 (sin, asin, and sinh for example, in either radians or degrees), many
3258 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3259 variables, a command history, hex/octal/binary input and output, unit
3260 conversions, embedded comments, and an expandable expression entry field. It
3261 evaluates expressions using the standard order of operations.")
3262 (license license:gpl2+)))
3270 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3271 "/xaos-" version ".tar.gz"))
3274 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3275 (build-system gnu-build-system)
3276 (native-inputs `(("gettext" ,gettext-minimal)))
3277 (inputs `(("libx11" ,libx11)
3282 `(#:tests? #f ;no "check" target
3283 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3284 (synopsis "Real-time fractal zoomer")
3285 (description "GNU XaoS is a graphical program that generates fractal
3286 patterns and allows you to zoom in and out of them infinitely in a fluid,
3287 continuous manner. It also includes tutorials that help to explain how fractals
3288 are built. It can generate many different fractal types such as the Mandelbrot
3290 (home-page "https://www.gnu.org/software/xaos/")
3291 (license license:gpl2+)))
3293 (define-public hypre
3299 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3300 "v" version ".tar.gz"))
3301 (file-name (string-append name "-" version ".tar.gz"))
3304 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3305 (modules '((guix build utils)))
3308 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3309 ;; substitute the tarball creation time.
3310 (substitute* "src/utilities/HYPRE_utilities.h"
3311 (("Date Compiled: .*$")
3312 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3314 (build-system gnu-build-system)
3315 (outputs '("out" ;6.1 MiB of headers and libraries
3316 "doc")) ;4.8 MiB of documentation
3320 ("texlive" ,texlive) ;full package required for fonts
3321 ("ghostscript" ,ghostscript)))
3323 `(("blas" ,openblas)
3324 ("lapack" ,lapack)))
3326 `(#:modules ((srfi srfi-1)
3327 ,@%gnu-build-system-modules)
3328 #:configure-flags '("--enable-shared"
3336 (modify-phases %standard-phases
3337 (add-before 'configure 'chdir-src
3338 (lambda _ (chdir "src")))
3340 (lambda* (#:key build target configure-flags
3341 #:allow-other-keys #:rest args)
3342 (let* ((configure (assoc-ref %standard-phases 'configure)))
3345 (list #:configure-flags
3346 (cons (string-append
3347 "--host=" (or target build))
3348 configure-flags)))))))
3349 (add-after 'build 'build-docs
3351 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3354 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3355 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3356 (and (system* "make" "check" "CHECKRUN=")
3357 (fold (lambda (filename result)
3359 (let ((size (stat:size (stat filename))))
3360 (when (not (zero? size))
3361 (format #t "~a size ~d; error indication~%"
3365 (find-files "test" ".*\\.err$")))))
3366 (add-after 'install 'install-docs
3367 (lambda* (#:key outputs #:allow-other-keys)
3368 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3369 (let* ((doc (assoc-ref outputs "doc"))
3370 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3371 (with-directory-excursion "docs"
3372 (for-each (lambda (base)
3373 (install-file (string-append base ".pdf") docdir)
3374 (copy-recursively base docdir)) ;html docs
3375 '("HYPRE_usr_manual"
3376 "HYPRE_ref_manual")))
3378 (home-page "http://www.llnl.gov/casc/hypre/")
3379 (synopsis "Library of solvers and preconditioners for linear equations")
3381 "HYPRE is a software library of high performance preconditioners and
3382 solvers for the solution of large, sparse linear systems of equations. It
3383 features multigrid solvers for both structured and unstructured grid
3385 (license license:lgpl2.1)))
3387 (define-public hypre-openmpi
3388 (package (inherit hypre)
3389 (name "hypre-openmpi")
3392 ,@(package-inputs hypre)))
3394 (substitute-keyword-arguments (package-arguments hypre)
3395 ((#:configure-flags flags)
3397 ,@(delete "--without-MPI" ,flags)))))
3398 (synopsis "Parallel solvers and preconditioners for linear equations")
3400 "HYPRE is a software library of high performance preconditioners and
3401 solvers for the solution of large, sparse linear systems of equations on
3402 parallel computers. It features parallel multigrid solvers for both
3403 structured and unstructured grid problems.")))
3405 (define-public matio
3412 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3413 "matio-" version ".tar.gz"))
3416 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3417 (build-system gnu-build-system)
3421 (home-page "http://matio.sourceforge.net/")
3422 (synopsis "Library for reading and writing MAT files")
3423 (description "Matio is a library for reading and writing MAT files. It
3424 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3425 (license license:bsd-2)))
3432 (origin (method url-fetch)
3433 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3434 "download/" version "/Vc-" version ".tar.gz"))
3437 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
3438 (build-system cmake-build-system)
3441 '("-DBUILD_TESTING=ON")))
3442 (synopsis "SIMD vector classes for C++")
3443 (description "Vc provides portable, zero-overhead C++ types for explicitly
3444 data-parallel programming. It is a library designed to ease explicit
3445 vectorization of C++ code. Its types enable explicitly stating data-parallel
3446 operations on multiple values. The parallelism is therefore added via the type
3447 system. Vc has an intuitive API and provides portability between different
3448 compilers and compiler versions as well as portability between different vector
3449 instruction sets. Thus, an application written with Vc can be compiled for:
3452 @item SSE2 up to SSE4.2 or SSE4a
3455 @item NEON (in development)
3456 @item NVIDIA GPUs / CUDA (in development)
3458 (home-page "https://github.com/VcDevel/Vc")
3459 ;; "No support_???.cpp file exists for this architecture."
3460 (supported-systems '("x86_64-linux" "i686-linux"))
3461 (license license:bsd-3)))
3463 (define-public reducelcs
3464 ;; This is the last commit which is available upstream, no
3465 ;; release happened since 2010.
3466 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3470 (version (string-append "1.0-" revision "." (string-take commit 7)))
3475 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3477 (file-name (string-append name "-" version "-checkout"))
3480 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3481 (build-system gnu-build-system)
3483 `(("openlibm" ,openlibm)))
3485 `(#:tests? #f ; no tests
3487 (modify-phases %standard-phases
3488 (delete 'configure) ; No configure script exists.
3489 (replace 'install ; No install phase exists.
3490 (lambda* (#:key outputs #:allow-other-keys)
3491 (let* ((out (assoc-ref outputs "out"))
3492 (bin (string-append out "/bin")))
3493 (install-file "Approximation" bin)
3494 (install-file "CollectResults" bin)
3495 (install-file "GenerateInstances" bin)
3497 (synopsis "Approximate Longest Commons Subsequence computation tool")
3499 "@code{reduceLCS} is an implementation of the Reduce-Expand
3500 algorithm for LCS. It is a fast program to compute the approximate
3501 Longest Commons Subsequence of a set of strings.")
3502 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3503 (license license:gpl3+))))
3505 (define-public jacal
3512 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3515 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3516 (patches (search-patches "jacal-fix-texinfo.patch"))))
3517 (build-system gnu-build-system)
3520 (modify-phases %standard-phases
3521 (add-before 'build 'pre-build
3522 ;; Don't use upstream's script - it really doesn't fit into
3523 ;; Guix's functional paradigm.
3524 (lambda* (#:key inputs outputs #:allow-other-keys)
3525 (substitute* "Makefile"
3526 (("^install: install-script") "install: "))))
3527 (add-after 'install 'post-install
3528 ;; Instead, we provide our own simplified script.
3529 (lambda* (#:key inputs outputs #:allow-other-keys)
3530 (let ((wrapper (string-append (assoc-ref outputs "out")
3532 (format (open wrapper (logior O_WRONLY O_CREAT))
3533 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3534 "-e '(slib:load \"~a/lib/jacal/math\") "
3537 (assoc-ref inputs "scm")
3538 (assoc-ref outputs "out"))
3539 (chmod wrapper #o555))))
3541 (lambda* (#:key inputs outputs #:allow-other-keys)
3542 (zero? (system* "./configure"
3543 (string-append "--prefix="
3544 (assoc-ref outputs "out")))))))))
3545 (inputs `(("scm" ,scm)))
3546 (native-inputs `(("unzip" ,unzip)
3547 ("texinfo" ,texinfo)))
3548 (synopsis "Symbolic mathematics system")
3549 (description "GNU JACAL is an interactive symbolic mathematics program based on
3550 Scheme. It manipulate and simplify a range of mathematical expressions such
3551 as equations, scalars, vectors, and matrices.")
3552 (home-page "https://www.gnu.org/software/jacal/")
3553 (license license:gpl3+)))
3562 "https://github.com/Z3Prover/z3/archive/z3-"
3566 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3567 (build-system cmake-build-system)
3570 (list "-DBUILD_PYTHON_BINDINGS=true"
3571 "-DINSTALL_PYTHON_BINDINGS=true"
3572 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3574 "/lib/python2.7/site-packages")
3575 (string-append "-DCMAKE_INSTALL_LIBDIR="
3580 (modify-phases %standard-phases
3581 (add-before 'configure 'bootstrap
3584 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3585 (add-before 'check 'make-test-z3
3587 ;; Build the test suite executable.
3588 (zero? (system* "make" "test-z3" "-j"
3589 (number->string (parallel-job-count))))))
3592 ;; Run all the tests that don't require arguments.
3593 (zero? (system* "./test-z3" "/a")))))))
3595 `(("python" ,python-2)))
3596 (synopsis "Theorem prover")
3597 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3598 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3599 (home-page "https://github.com/Z3Prover/z3")
3600 (license license:expat)))
3602 (define-public cubicle
3608 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3612 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3613 (build-system gnu-build-system)
3616 ("which" ,(@@ (gnu packages base) which))))
3620 `(#:configure-flags (list "--with-z3")
3623 (modify-phases %standard-phases
3624 (add-before 'configure 'configure-for-release
3626 (substitute* "Makefile.in"
3627 (("SVNREV=") "#SVNREV="))))
3628 (add-before 'configure 'fix-/bin/sh
3630 (substitute* "configure"
3631 (("/bin/sh") (which "sh")))))
3632 (add-before 'configure 'fix-smt-z3wrapper.ml
3634 (substitute* "Makefile.in"
3635 (("\\\\n") "")))))))
3636 (home-page "http://cubicle.lri.fr/")
3637 (synopsis "Model checker for array-based systems")
3638 (description "Cubicle is a model checker for verifying safety properties
3639 of array-based systems. This is a syntactically restricted class of
3640 parametrized transition systems with states represented as arrays indexed by
3641 an arbitrary number of processes. Cache coherence protocols and mutual
3642 exclusion algorithms are typical examples of such systems.")
3643 (license license:asl2.0)))