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>
24 ;;; This file is part of GNU Guix.
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39 (define-module (gnu packages maths)
40 #:use-module (ice-9 regex)
41 #:use-module (gnu packages)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix utils)
47 #:use-module (guix build utils)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system ocaml)
51 #:use-module (guix build-system r)
52 #:use-module (gnu packages algebra)
53 #:use-module (gnu packages autotools)
54 #:use-module (gnu packages bison)
55 #:use-module (gnu packages boost)
56 #:use-module (gnu packages check)
57 #:use-module (gnu packages cmake)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages cyrus-sasl)
61 #:use-module (gnu packages documentation)
62 #:use-module (gnu packages elf)
63 #:use-module (gnu packages flex)
64 #:use-module (gnu packages fltk)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages gettext)
67 #:use-module (gnu packages gcc)
68 #:use-module (gnu packages gd)
69 #:use-module (gnu packages ghostscript)
70 #:use-module (gnu packages graphviz)
71 #:use-module (gnu packages gtk)
72 #:use-module (gnu packages image)
73 #:use-module (gnu packages java)
74 #:use-module (gnu packages less)
75 #:use-module (gnu packages lisp)
76 #:use-module (gnu packages logging)
77 #:use-module (gnu packages lua)
78 #:use-module (gnu packages gnome)
79 #:use-module (gnu packages guile)
80 #:use-module (gnu packages xorg)
81 #:use-module (gnu packages gl)
82 #:use-module (gnu packages imagemagick)
83 #:use-module (gnu packages m4)
84 #:use-module (gnu packages mpi)
85 #:use-module (gnu packages multiprecision)
86 #:use-module (gnu packages netpbm)
87 #:use-module (gnu packages ocaml)
88 #:use-module (gnu packages pcre)
89 #:use-module (gnu packages popt)
90 #:use-module (gnu packages perl)
91 #:use-module (gnu packages pkg-config)
92 #:use-module (gnu packages python)
93 #:use-module (gnu packages readline)
94 #:use-module (gnu packages tbb)
95 #:use-module (gnu packages scheme)
96 #:use-module (gnu packages shells)
97 #:use-module (gnu packages tcl)
98 #:use-module (gnu packages texinfo)
99 #:use-module (gnu packages tex)
100 #:use-module (gnu packages tls)
101 #:use-module (gnu packages wxwidgets)
102 #:use-module (gnu packages xml)
103 #:use-module (srfi srfi-1))
111 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
113 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
114 (build-system gnu-build-system)
115 (inputs `(("gtk+" ,gtk+)
116 ("libxml2" ,libxml2)))
117 (native-inputs `(("pkg-config" ,pkg-config)))
118 (synopsis "Natural deduction first-order logic interface")
119 (description "Aris is a program for performing logical proofs. It supports
120 propositional and predicate logic, as well as Boolean algebra and
121 arithmetical logic. In addition to its predefined inference and equivalence
122 rules, Aris also supports references to older proofs. Its use of standard
123 logical symbols and its natural deduction interface make it easy to use for
125 (license license:gpl3+)
126 (home-page "https://www.gnu.org/software/aris/")))
128 (define-public c-graph
134 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
137 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
138 (build-system gnu-build-system)
140 `(("fortran" ,gfortran)))
141 (synopsis "Visualizing and demonstrating convolution")
143 "GNU C-Graph is a tool for demonstrating the theory of convolution.
144 Thus, it can serve as an excellent aid to students of signal and systems
145 theory in visualizing the convolution process. Rather than forcing the
146 student to write code, the program offers an intuitive interface with
147 interactive dialogs to guide them.")
148 (license license:gpl3+)
149 (home-page "https://www.gnu.org/software/c-graph/")))
158 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
159 version "/coda-" version ".tar.gz"))
161 (base32 "01fnqcby9jijvf3jxr1fk4bny059lvvq5wbqm7ns60ilykfdnm6a"))
162 (patches (search-patches "coda-use-system-libs.patch"))
163 (modules '((guix build utils)))
165 ;; Make sure we don't use the bundled software.
166 '(for-each (lambda (d)
167 (delete-file-recursively (string-append "libcoda/" d)))
168 '("zlib" "pcre" "expat")))))
170 `(("fortran" ,gfortran)
172 ("python-numpy" ,python-numpy)))
179 (build-system gnu-build-system)
181 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
182 "LIBS= -lz -lpcre -lexpat")))
183 (synopsis "A common interface to various earth observation data formats")
185 "The Common Data Access toolbox (CODA) provides a set of interfaces for
186 reading remote sensing data from earth observation data files. It consists of
187 command line applications and interfaces to the C, Fortran, Python, and Java
188 programming languages.")
189 (home-page "https://stcorp.nl/coda")
190 (license license:gpl2+)))
198 (uri (string-append "mirror://gnu/units/units-" version
201 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
202 (build-system gnu-build-system)
204 `(("readline" ,readline)
205 ("python" ,python-wrapper) ;for 'units_cur' script
206 ("python-requests" ,python-requests)))
208 `(#:phases (modify-phases %standard-phases
209 (add-after 'install 'wrap-units_cur
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let* ((out (assoc-ref outputs "out"))
212 (bin (string-append out "/bin")))
213 (wrap-program (string-append bin "/units_cur")
214 `("PYTHONPATH" ":" prefix
215 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
217 (synopsis "Conversion between thousands of scales")
219 "GNU Units converts numeric quantities between units of measure. It
220 can handle scale changes through adaptive usage of standard scale
221 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
222 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
223 enough to be used effectively as a scientific calculator.")
224 (license license:gpl3+)
225 (home-page "https://www.gnu.org/software/units/")))
227 (define-public double-conversion
229 (name "double-conversion")
234 "https://github.com/floitsch/double-conversion/archive/v"
236 (file-name (string-append name "-" version ".tar.gz"))
239 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
240 (build-system cmake-build-system)
242 '(#:test-target "test"
243 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
244 "-DBUILD_TESTING=ON")))
245 (home-page "https://github.com/floitsch/double-conversion")
246 (synopsis "Conversion routines for IEEE doubles")
248 "The double-conversion library provides binary-decimal and decimal-binary
249 routines for IEEE doubles. The library consists of efficient conversion
250 routines that have been extracted from the V8 JavaScript engine.")
251 (license license:bsd-3)))
253 (define-public dionysus
259 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
263 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
264 (build-system gnu-build-system)
265 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
266 (synopsis "Local search for universal constants and scientific values")
268 "GNU Dionysus is a convenient system for quickly retrieving the values of
269 mathematical constants used in science and engineering. Values can be
270 searched using a simple command-line tool, choosing from three databases:
271 universal constants, atomic numbers, and constants related to
273 (license license:gpl3+)
274 (home-page "https://www.gnu.org/software/dionysus/")))
282 (uri (string-append "mirror://gnu/gsl/gsl-"
286 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
287 (patches (search-patches "gsl-test-i686.patch"))))
288 (build-system gnu-build-system)
290 `(;; Currently there are numerous tests that fail on "exotic"
291 ;; architectures such as aarch64 and ppc64le.
292 ,@(if (string-prefix? "aarch64-linux"
293 (or (%current-target-system) (%current-system)))
296 (home-page "https://www.gnu.org/software/gsl/")
297 (synopsis "Numerical library for C and C++")
299 "The GNU Scientific Library is a library for numerical analysis in C
300 and C++. It includes a wide range of mathematical routines, with over 1000
301 functions in total. Subject areas covered by the library include:
302 differential equations, linear algebra, Fast Fourier Transforms and random
304 (license license:gpl3+)))
306 (define-public ocaml-gsl
315 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
316 version"/gsl-ocaml-" version ".tar.gz"))
319 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
320 (build-system ocaml-build-system)
323 (home-page "https://mmottl.github.io/gsl-ocaml")
324 (synopsis "Bindings to the GNU Scientific Library")
326 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
327 the OCaml language.")
328 (license license:gpl3+)))
330 (define-public ocaml4.01-gsl
331 (package-with-ocaml4.01 ocaml-gsl))
340 (uri (string-append "mirror://gnu/glpk/glpk-"
344 "1xp7nclmp8inp20968bvvfcwmz3mz03sbm0v3yjz8aqwlpqjfkci"))))
345 (build-system gnu-build-system)
349 `(#:configure-flags '("--with-gmp")))
350 (home-page "https://www.gnu.org/software/glpk/")
351 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
353 "GLPK is a C library for solving large-scale linear programming (LP),
354 mixed integer programming (MIP), and other related problems. It supports the
355 GNU MathProg modeling language, a subset of the AMPL language, and features a
356 translator for the language. In addition to the C library, a stand-alone
357 LP/MIP solver is included in the package.")
358 (license license:gpl3+)))
367 (uri (string-append "http://www.4ti2.de/version_" version
368 "/4ti2-" version ".tar.gz"))
371 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
372 (build-system gnu-build-system)
374 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
378 (home-page "http://www.4ti2.de/")
379 (synopsis "Mathematical tool suite for problems on linear spaces")
381 "4ti2 implements algorithms for solving algebraic, geometric and
382 combinatorial problems on linear spaces. Among others, it solves systems
383 of linear equations, computes extreme rays of polyhedral cones, solves
384 integer programming problems and computes Markov bases for statistics.")
385 (license license:gpl2+)))
387 (define-public cddlib
394 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
395 (string-delete #\. version) ".tar.gz"))
398 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
399 (build-system gnu-build-system)
402 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
403 (synopsis "Library for convex hulls and extreme rays of polyhedra")
405 "The C-library cddlib implements the Double Description Method of
406 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
407 rays of a general convex polyhedron given by a system of linear inequalities
408 in arbitrary dimension. It can also be used for the converse operation of
409 computing convex hulls.")
410 (license license:gpl2+)))
412 (define-public arpack-ng
419 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
421 (file-name (string-append name "-" version ".tar.gz"))
424 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
425 (build-system gnu-build-system)
426 (home-page "https://github.com/opencollab/arpack-ng")
429 ("fortran" ,gfortran)))
430 (synopsis "Fortran subroutines for solving eigenvalue problems")
432 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
433 large scale eigenvalue problems.")
434 (license (license:non-copyleft "file://COPYING"
435 "See COPYING in the distribution."))))
437 (define-public arpack-ng-openmpi
438 (package (inherit arpack-ng)
439 (name "arpack-ng-openmpi")
442 ,@(package-inputs arpack-ng)))
443 (arguments `(#:configure-flags '("--enable-mpi")))
444 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
446 (define-public lapack
453 (uri (string-append "http://www.netlib.org/lapack/lapack-"
457 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
458 (build-system cmake-build-system)
459 (home-page "http://www.netlib.org/lapack/")
460 (inputs `(("fortran" ,gfortran)
461 ("python" ,python-2)))
463 `(#:configure-flags (list
464 ;; Install to PREFIX/lib (the default is
466 (string-append "-DCMAKE_INSTALL_LIBDIR="
467 (assoc-ref %outputs "out")
470 "-DBUILD_SHARED_LIBS:BOOL=YES"
473 ;; Build the 'LAPACKE_clatms' functions.
474 "-DLAPACKE_WITH_TMG=ON")
476 (modify-phases %standard-phases
477 (add-before 'check 'patch-python
478 (lambda* (#:key inputs #:allow-other-keys)
479 (let ((python (assoc-ref inputs "python")))
480 (substitute* "lapack_testing.py"
481 (("/usr/bin/env python") python)))
483 (synopsis "Library for numerical linear algebra")
485 "LAPACK is a Fortran 90 library for solving the most commonly occurring
486 problems in numerical linear algebra.")
487 (license (license:non-copyleft "file://LICENSE"
488 "See LICENSE in the distribution."))))
490 (define-public lapack-3.5
497 (uri (string-append "http://www.netlib.org/lapack/lapack-"
501 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
503 (define-public scalapack
510 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
514 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
515 (build-system cmake-build-system)
518 ("fortran" ,gfortran)
519 ("lapack" ,lapack))) ;for testing only
521 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
522 (home-page "http://www.netlib.org/scalapack/")
523 (synopsis "Library for scalable numerical linear algebra")
525 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
526 routines on parallel distributed memory machines. ScaLAPACK solves dense and
527 banded linear systems, least squares problems, eigenvalue problems, and
528 singular value problems.")
529 (license (license:bsd-style "file://LICENSE"
530 "See LICENSE in the distribution."))))
532 (define-public gnuplot
538 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
543 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
544 (build-system gnu-build-system)
545 (inputs `(("readline" ,readline)
551 `(("pkg-config" ,pkg-config)
552 ("texlive" ,texlive-tiny)))
553 (home-page "http://www.gnuplot.info")
554 (synopsis "Command-line driven graphing utility")
555 (description "Gnuplot is a portable command-line driven graphing
556 utility. It was originally created to allow scientists and students to
557 visualize mathematical functions and data interactively, but has grown to
558 support many non-interactive uses such as web scripting. It is also used as a
559 plotting engine by third-party applications like Octave.")
560 ;; X11 Style with the additional restriction that derived works may only be
561 ;; distributed as patches to the original.
562 (license (license:fsf-free
563 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
572 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
574 (file-name (string-append name "-" version ".tar.gz"))
577 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
579 `(("fortran" ,gfortran)))
580 (build-system gnu-build-system)
581 (synopsis "General Cartographic Transformation Package (GCTP)")
583 "The General Cartographic Transformation Package (GCTP) is a system of
584 software routines designed to permit the transformation of coordinate pairs
585 from one map projection to another. The GCTP is the standard computer
586 software used by the National Mapping Division for map projection
588 (home-page "https://github.com/OkoSanto/GCTP")
589 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
598 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
599 version "/src/hdf-" version ".tar.bz2"))
601 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
602 (patches (search-patches "hdf4-architectures.patch"
603 "hdf4-reproducibility.patch"
604 "hdf4-shared-fortran.patch"))))
605 (build-system gnu-build-system)
607 `(("gfortran" ,gfortran)
612 ("libjpeg" ,libjpeg)))
614 `(#:parallel-tests? #f
615 #:configure-flags '("--enable-shared")
617 (modify-phases %standard-phases
618 ;; This is inspired by two of Debian's patches.
619 (add-before 'configure 'add-more-aarch64-support
621 (substitute* '("mfhdf/ncgen/ncgen.l"
622 "mfhdf/ncgen/ncgenyy.c"
623 "mfhdf/libsrc/netcdf.h.in")
624 (("AIX5L64") "__aarch64__"))
626 (add-before 'configure 'patchbuild
629 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
631 (("/bin/mkdir") "mkdir"))
632 (substitute* (find-files "." "^Makefile\\.in$")
633 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
634 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
635 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
636 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
637 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
639 (add-after 'configure 'patch-settings
641 ;; libhdf4.settings contains the full path of the
642 ;; compilers used, and its contents are included in
643 ;; .so-files. We truncate the hashes to avoid
644 ;; unnecessary store references to those compilers:
645 (substitute* "libhdf4.settings"
646 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
647 (string-append prefix (string-take hash 10) "...")))
650 (home-page "https://www.hdfgroup.org/products/hdf4/")
652 "Library and multi-object file format for storing and managing data")
653 (description "HDF4 is a library and multi-object file format for storing
654 and managing data between machines. HDF4 is an older hierarchical data format,
655 incompatible with HDF5.")
657 (license:non-copyleft
658 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
660 (define-public hdf4-alt
665 (substitute-keyword-arguments (package-arguments hdf4)
666 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
668 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
677 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
678 "hdf5-" (version-major+minor version)
679 "/hdf5-" version "/src/hdf5-"
681 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
684 (take (string-split version #\.) 2))
685 "/src/hdf5-" version ".tar.bz2")))
687 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
688 (patches (list (search-patch "hdf5-config-date.patch")))))
689 (build-system gnu-build-system)
693 `(("gfortran" ,gfortran)))
694 (outputs '("out" ; core library
695 "fortran")) ; fortran interface
697 `(;; Some of the users, notably Flann, need the C++ interface.
698 #:configure-flags '("--enable-cxx"
700 "--enable-fortran2003")
703 (modify-phases %standard-phases
704 (add-before 'configure 'patch-configure
705 (lambda* (#:key outputs #:allow-other-keys)
706 (substitute* "configure"
708 (substitute* "fortran/src/Makefile.in"
709 (("libhdf5_fortran_la_LDFLAGS =")
710 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
711 (assoc-ref outputs "fortran") "/lib")))
712 (substitute* "hl/fortran/src/Makefile.in"
713 (("libhdf5hl_fortran_la_LDFLAGS =")
714 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
715 (assoc-ref outputs "fortran") "/lib")))
717 (add-after 'configure 'patch-settings
719 ;; libhdf5.settings contains the full path of the
720 ;; compilers used, and its contents are included in
721 ;; libhdf5.so. We truncate the hashes to avoid
722 ;; unnecessary store references to those compilers:
723 (substitute* "src/libhdf5.settings"
724 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
725 (string-append prefix (string-take hash 10) "...")))
727 (add-after 'install 'patch-references
728 (lambda* (#:key inputs outputs #:allow-other-keys)
729 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
730 (zlib (assoc-ref inputs "zlib")))
731 (substitute* (find-files bin "h5p?cc")
733 (string-append "-L" zlib "/lib " lib)))
735 (add-after 'install 'split
736 (lambda* (#:key inputs outputs #:allow-other-keys)
737 ;; Move all fortran-related files
738 (let* ((out (assoc-ref outputs "out"))
739 (bin (string-append out "/bin"))
740 (lib (string-append out "/lib"))
741 (inc (string-append out "/include"))
742 (ex (string-append out "/share/hdf5_examples/fortran"))
743 (fort (assoc-ref outputs "fortran"))
744 (fbin (string-append fort "/bin"))
745 (flib (string-append fort "/lib"))
746 (finc (string-append fort "/include"))
747 (fex (string-append fort "/share/hdf5_examples/fortran")))
752 (rename-file (string-append bin "/h5fc")
753 (string-append fbin "/h5fc"))
754 (for-each (lambda (file)
756 (string-append flib "/" (basename file))))
757 (find-files lib ".*fortran.*"))
758 (for-each (lambda (file)
760 (string-append finc "/" (basename file))))
761 (find-files inc ".*mod"))
762 (for-each (lambda (file)
764 (string-append fex "/" (basename file))))
765 (find-files ex ".*"))
766 (delete-file-recursively ex))
768 (home-page "http://www.hdfgroup.org")
769 (synopsis "Management suite for extremely large and complex data")
770 (description "HDF5 is a suite that makes possible the management of
771 extremely large and complex data collections.")
772 (license (license:x11-style
773 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
775 (define-public hdf-java
783 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
784 version "/src/CMake-hdfjava-" version ".tar.gz"))
786 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
787 (modules '((guix build utils)))
788 (snippet ; Make sure we don't use the bundled sources and binaries.
790 (for-each delete-file
791 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
792 "HDF4.tar.gz" "HDF5.tar.gz"))
793 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))))))
794 (build-system gnu-build-system)
796 `(("jdk" ,icedtea "jdk")
797 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
799 ("hamcrest-core" ,java-hamcrest-core)
800 ("junit" ,java-junit)
801 ("slf4j-simple" ,java-slf4j-simple)))
807 ("slf4j-api" ,java-slf4j-api)))
810 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
811 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
812 (assoc-ref %build-inputs "jdk") "/lib" )
813 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
814 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
817 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
818 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
819 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
820 (string-append "JPEGLIB="
821 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
825 (modify-phases %standard-phases
826 (add-before 'configure 'chdir-to-source
827 (lambda _ (chdir ,(string-append "hdfjava-" version))))
828 (add-before 'configure 'patch-build
829 (lambda* (#:key inputs outputs #:allow-other-keys)
830 (substitute* "configure"
831 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
832 (("/bin/cat") (which "cat")))
833 ;; Set classpath for compilation
834 (substitute* '("hdf/hdf5lib/Makefile.in"
835 "hdf/hdf5lib/exceptions/Makefile.in"
836 "hdf/hdflib/Makefile.in")
837 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
838 (string-append (assoc-ref inputs "slf4j-api")
839 "/share/java/slf4j-api.jar")))
840 ;; Replace outdated config.sub and config.guess:
841 (with-directory-excursion "config"
842 (for-each (lambda (file)
844 (string-append (assoc-ref inputs "automake")
845 "/share/automake-1.15/" file) file))
846 '("config.sub" "config.guess")))
847 (mkdir-p (string-append (assoc-ref outputs "out")))
848 ;; Set classpath for tests
849 (let* ((build-dir (getcwd))
850 (lib (string-append build-dir "/lib"))
851 (jhdf (string-append lib "/jhdf.jar"))
852 (jhdf5 (string-append lib "/jhdf5.jar"))
855 (string-append (assoc-ref inputs i)
856 "/share/java/" i ".jar"))
857 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
859 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
861 (substitute* '("test/hdf5lib/Makefile.in"
862 "test/hdf5lib/junit.sh.in"
863 "examples/runExample.sh.in")
865 (string-append (assoc-ref inputs "coreutils")
868 (string-append (assoc-ref inputs "coreutils")
870 (("CLASSPATH=[^\n]*")
871 (string-append "CLASSPATH=" class-path)))
872 (setenv "CLASSPATH" class-path))
874 (add-before 'check 'build-examples
876 (zero? (apply system* `("javac"
877 ,@(find-files "examples" ".*\\.java")))))))
881 #:parallel-tests? #f ))
882 (home-page "https://support.hdfgroup.org/products/java")
883 (synopsis "Java interface for the HDF4 and HDF5 libraries")
884 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
885 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
888 ;; BSD-style license:
889 (license (license:x11-style
890 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
891 /current/src/unpacked/COPYING"))))
893 (define-public hdf-eos2
900 (uri "ftp://edhs1.gsfc.nasa.gov\
901 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
903 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
904 (patches (search-patches "hdf-eos2-remove-gctp.patch"
905 "hdf-eos2-build-shared.patch"
906 "hdf-eos2-fortrantests.patch"))))
907 (build-system gnu-build-system)
909 `(("gfortran" ,gfortran)))
911 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
916 `( #:configure-flags '("--enable-install-include" "--enable-shared"
917 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
918 #:parallel-tests? #f))
919 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
920 (synopsis "HDF4-based data format for NASA's Earth Observing System")
921 (description "HDF-EOS2 is a software library built on HDF4 which supports
922 the construction of data structures used in NASA's Earth Observing
923 System (Grid, Point and Swath).")
925 ;; Source files carry a permissive license header.
926 (license (license:non-copyleft home-page))))
928 (define-public hdf-eos5
934 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
935 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
938 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
939 (patches (search-patches "hdf-eos5-build-shared.patch"
940 "hdf-eos5-remove-gctp.patch"
941 "hdf-eos5-fix-szip.patch"
942 "hdf-eos5-fortrantests.patch"))))
944 `(("gfortran" ,gfortran)))
945 (build-system gnu-build-system)
951 `(#:configure-flags '("--enable-install-include" "--enable-shared"
952 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
953 #:parallel-tests? #f))
954 (synopsis "HDF5-based data format for NASA's Earth Observing System")
956 "HDF-EOS5 is a software library built on HDF5 to support the construction
957 of data structures used in NASA's Earth Observing System (Grid, Point and
959 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
961 ;; Source files carry a permissive license header.
962 (license (license:non-copyleft home-page))))
964 (define-public hdf5-parallel-openmpi
965 (package (inherit hdf5)
966 (name "hdf5-parallel-openmpi")
969 ,@(package-inputs hdf5)))
971 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
972 ,@(package-arguments hdf5))
974 `(modify-phases ,phases
975 (add-before 'check 'patch-tests
977 ;; OpenMPI's mpirun will exit with non-zero status if it
978 ;; detects an "abnormal termination", i.e. any process not
979 ;; calling MPI_Finalize(). Since the test is explicitely
980 ;; avoiding MPI_Finalize so as not to have at_exit and thus
981 ;; H5C_flush_cache from being called, mpirun will always
982 ;; complain, so turn this test off.
983 (substitute* "testpar/Makefile"
984 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
985 (string-append front back "\n")))
986 (substitute* "tools/h5diff/testph5diff.sh"
987 (("/bin/sh") (which "sh")))
989 (synopsis "Management suite for data with parallel IO support")))
991 (define-public h5check
998 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
999 "h5check/src/h5check-" version ".tar.gz"))
1002 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1003 (build-system gnu-build-system)
1004 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1005 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1006 (synopsis "HDF5 format checker")
1007 (description "@code{h5check} is a validation tool for verifying that an
1008 HDF5 file is encoded according to the HDF File Format Specification.")
1009 (license (license:x11-style "file://COPYING"))))
1017 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1022 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1023 (build-system cmake-build-system)
1024 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1025 (inputs `(("lapack" ,lapack)
1027 ;; FIXME: Even though the fonts are available dvips complains:
1028 ;; "Font cmmi10 not found; characters will be left blank."
1030 `(("texlive" ,texlive-tiny)
1031 ("ghostscript" ,ghostscript)
1032 ("doxygen" ,doxygen)))
1033 (home-page "http://itpp.sourceforge.net")
1034 (synopsis "C++ library of maths, signal processing and communication classes")
1035 (description "IT++ is a C++ library of mathematical, signal processing and
1036 communication classes and functions. Its main use is in simulation of
1037 communication systems and for performing research in the area of
1038 communications. The kernel of the library consists of generic vector and
1039 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1040 similar to MATLAB, GNU Octave or SciPy.")
1041 (license license:gpl3+)))
1043 (define-public netcdf
1050 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1051 "netcdf-" version ".tar.gz"))
1054 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1055 (patches (search-patches "netcdf-date-time.patch"
1056 "netcdf-tst_h_par.patch"))))
1057 (build-system gnu-build-system)
1060 ("doxygen" ,doxygen)
1061 ("graphviz" ,graphviz)))
1063 `(("hdf4" ,hdf4-alt)
1066 ("libjpeg" ,libjpeg)))
1068 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1070 #:phases (modify-phases %standard-phases
1071 (add-before 'configure 'fix-source-date
1073 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1074 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1075 ;; to '1st hour of the current day', and therefore makes the
1076 ;; package not reproducible.
1077 (substitute* "./configure"
1078 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1079 "date --date='@0'"))
1081 (add-after 'configure 'patch-settings
1083 ;; libnetcdf.settings contains the full filename of the compilers
1084 ;; used to build the library. We truncate the hashes of those
1085 ;; filenames to avoid unnecessary references to the corresponding
1087 (substitute* "libnetcdf.settings"
1088 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1089 (string-append prefix (string-take hash 10) "...")))
1092 #:parallel-tests? #f)) ;various race conditions
1093 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1094 (synopsis "Library for scientific data")
1095 (description "NetCDF is an interface for scientific data access and a
1096 software library that provides an implementation of the interface. The netCDF
1097 library defines a machine-independent format for representing scientific data.
1098 Together, the interface, library, and format support the creation, access, and
1099 sharing of scientific data.")
1100 (license (license:x11-style "file://COPYRIGHT"))))
1102 (define-public netcdf-parallel-openmpi
1103 (package (inherit netcdf)
1104 (name "netcdf-parallel-openmpi")
1107 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1108 (package-inputs netcdf))))
1109 ;; TODO: Replace pkg-config references in nc-config with absolute references
1111 (substitute-keyword-arguments (package-arguments netcdf)
1112 ((#:configure-flags flags)
1113 `(cons* "CC=mpicc" "CXX=mpicxx"
1114 "--enable-parallel-tests"
1115 ;; Shared libraries not supported with parallel IO.
1116 "--disable-shared" "--with-pic"
1119 (define-public netcdf-fortran
1121 (name "netcdf-fortran")
1126 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1130 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1131 (build-system gnu-build-system)
1133 `(#:parallel-tests? #f))
1135 `(("netcdf" ,netcdf)))
1137 `(("gfortran" ,gfortran)))
1138 (synopsis "Fortran interface for the netCDF library")
1139 (description (package-description netcdf))
1140 (home-page (package-home-page netcdf))
1141 (license (package-license netcdf))))
1143 (define-public nlopt
1149 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1152 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1153 (build-system gnu-build-system)
1155 `(;; Shared libraries are not built by default. They are required to
1156 ;; build the Guile, Octave, and Python bindings.
1157 #:configure-flags '("--enable-shared")
1160 (modify-phases %standard-phases
1161 (add-before 'configure 'set-libnlopt-file-name
1162 (lambda* (#:key outputs #:allow-other-keys)
1163 ;; Make sure the Scheme module refers to the library by its
1164 ;; absolute file name (we cannot do that from a snippet
1165 ;; because the expansion of @libdir@ contains
1167 (let ((out (assoc-ref outputs "out")))
1168 (substitute* "swig/nlopt.scm.in"
1170 (string-append out "/lib/libnlopt")))
1172 (inputs `(("guile" ,guile-2.0)))
1173 (native-inputs `(("pkg-config" ,pkg-config)))
1174 (home-page "http://ab-initio.mit.edu/wiki/")
1175 (synopsis "Library for nonlinear optimization")
1176 (description "NLopt is a library for nonlinear optimization, providing a
1177 common interface for a number of different free optimization routines available
1178 online as well as original implementations of various other algorithms.")
1179 (license license:lgpl2.1+)))
1181 (define-public ipopt
1188 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1192 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1193 (modules '((guix build utils)))
1195 ;; Make sure we don't use the bundled software.
1196 '(delete-file-recursively "ThirdParty"))))
1197 (build-system gnu-build-system)
1199 '(#:phases (modify-phases %standard-phases
1200 (add-after 'install 'add--L-flags-in-ipopt.pc
1201 (lambda* (#:key inputs outputs #:allow-other-keys)
1202 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1203 ;; move it to "Libs.private" where it belongs, and add a
1204 ;; '-L' flag for LAPACK.
1205 (let ((out (assoc-ref outputs "out"))
1206 (lapack (assoc-ref inputs "lapack")))
1207 (substitute* (string-append out "/lib/pkgconfig/"
1209 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1210 (string-append "Libs: " before " " after "\n"
1211 "Libs.private: " before
1212 "-L" lapack "/lib -llapack -lblas "
1216 `(("gfortran" ,gfortran)))
1218 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1219 `(("lapack" ,lapack))) ;for both libblas and liblapack
1220 (home-page "http://www.coin-or.org")
1221 (synopsis "Large-scale nonlinear optimizer")
1223 "The Interior Point Optimizer (IPOPT) is a software package for
1224 large-scale nonlinear optimization. It provides C++, C, and Fortran
1226 (license license:epl1.0)))
1228 (define-public ceres
1230 (name "ceres-solver")
1232 (home-page "http://ceres-solver.org/")
1235 (uri (string-append home-page "ceres-solver-"
1239 "0i7qkbf8g6pd8arxzldppga26ckv93y8zldsfz6wbd4n6b1nqrjd"))))
1240 (build-system cmake-build-system)
1242 ;; TODO: Build HTML user documentation and install separately.
1243 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1244 "-DBUILD_SHARED_LIBS=ON")
1246 #:phases (modify-phases %standard-phases
1247 (add-before 'configure 'set-library-directory
1249 ;; Install libraries to lib/, not lib64/.
1250 (substitute* "internal/ceres/CMakeLists.txt"
1251 (("set\\(LIB_SUFFIX \"64\"\\)")
1252 "set(LIB_SUFFIX \"\")"))
1255 `(("pkg-config" ,pkg-config)))
1257 `(("glog" ,glog))) ;for #include <glog/glog.h>
1262 ("suitesparse" ,suitesparse)
1263 ("gflags" ,gflags)))
1264 (synopsis "C++ library for solving large optimization problems")
1266 "Ceres Solver is a C++ library for modeling and solving large,
1267 complicated optimization problems. It is a feature rich, mature and
1268 performant library which has been used in production since 2010. Ceres Solver
1269 can solve two kinds of problems:
1271 @item non-linear least squares problems with bounds constraints;
1272 @item general unconstrained optimization problems.
1274 (license license:bsd-3)))
1276 ;; For a fully featured Octave, users are strongly recommended also to install
1277 ;; the following packages: less, ghostscript, gnuplot.
1278 (define-public octave
1285 (uri (string-append "mirror://gnu/octave/octave-"
1289 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
1290 (build-system gnu-build-system)
1292 `(("lapack" ,lapack)
1293 ("readline" ,readline)
1298 ("arpack" ,arpack-ng)
1301 ("fontconfig" ,fontconfig)
1302 ("freetype" ,freetype)
1309 ("texinfo" ,texinfo)
1310 ("graphicsmagick" ,graphicsmagick)))
1313 ("gfortran" ,gfortran)
1314 ("pkg-config" ,pkg-config)
1316 ;; The following inputs are not actually used in the build process.
1317 ;; However, the ./configure gratuitously tests for their existence and
1318 ;; assumes that programs not present at build time are also not, and
1319 ;; can never be, available at run time! If these inputs are therefore
1320 ;; not present, support for them will be built out. However, Octave
1321 ;; will still run without them, albeit without the features they
1324 ("ghostscript" ,ghostscript)
1325 ("gnuplot" ,gnuplot)))
1328 (list (string-append "--with-shell="
1329 (assoc-ref %build-inputs "bash")
1332 (modify-phases %standard-phases
1333 (add-after 'configure 'configure-makeinfo
1334 (lambda* (#:key inputs #:allow-other-keys)
1335 (substitute* "libinterp/corefcn/help.cc"
1336 (("Vmakeinfo_program = \"makeinfo\"")
1337 (string-append "Vmakeinfo_program = \""
1338 (assoc-ref inputs "texinfo")
1339 "/bin/makeinfo\"")))
1341 (home-page "https://www.gnu.org/software/octave/")
1342 (synopsis "High-level language for numerical computation")
1343 (description "GNU Octave is a high-level interpreted language that is
1344 specialized for numerical computations. It can be used for both linear and
1345 non-linear applications and it provides great support for visualizing results.
1346 Work may be performed both at the interactive command-line as well as via
1348 (license license:gpl3+)))
1350 (define-public opencascade-oce
1352 (name "opencascade-oce")
1358 "https://github.com/tpaviot/oce/archive/OCE-"
1363 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1364 (build-system cmake-build-system)
1367 (list "-DOCE_TESTING:BOOL=ON"
1368 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1369 "-DOCE_DRAW:BOOL=ON"
1370 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1371 (assoc-ref %outputs "out"))
1372 "-UCMAKE_INSTALL_RPATH")))
1374 `(("freetype" ,freetype)
1381 `(("python" ,python-wrapper)))
1382 (home-page "https://github.com/tpaviot/oce")
1383 (synopsis "Libraries for 3D modeling and numerical simulation")
1385 "Open CASCADE is a set of libraries for the development of applications
1386 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1387 C++ class libraries providing services for 3D surface and solid modeling, CAD
1388 data exchange, and visualization. It is used for development of specialized
1389 software dealing with 3D models in design (CAD), manufacturing (CAM),
1390 numerical simulation (CAE), measurement equipment (CMM), and quality
1391 control (CAQ) domains.
1393 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1394 patches, improvements, and experiments contributed by users over the official
1395 Open CASCADE library.")
1396 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1397 ; use of header files; see
1398 ; OCCT_LGPL_EXCEPTION.txt
1399 license:public-domain; files
1400 ; src/Standard/Standard_StdAllocator.hxx and
1401 ; src/NCollection/NCollection_StdAllocator.hxx
1402 license:expat; file src/OpenGl/OpenGl_glext.h
1403 license:bsd-3)))); test framework gtest
1412 (uri (string-append "http://gmsh.info/src/gmsh-"
1413 version "-source.tgz"))
1415 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1416 (modules '((guix build utils)))
1418 ;; Remove non-free METIS code
1419 '(delete-file-recursively "contrib/Metis"))))
1420 (build-system cmake-build-system)
1423 ("gfortran" ,gfortran)
1429 ("opencascade-oce" ,opencascade-oce)
1431 ("libxext" ,libxext)))
1433 `(("fontconfig" ,fontconfig)
1434 ("libxft" ,libxft)))
1436 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1437 "-DENABLE_BUILD_SHARED:BOOL=ON"
1438 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1439 (home-page "http://www.geuz.org/gmsh/")
1440 (synopsis "3D finite element grid generator")
1441 (description "Gmsh is a 3D finite element grid generator with a built-in
1442 CAD engine and post-processor. Its design goal is to provide a fast, light
1443 and user-friendly meshing tool with parametric input and advanced
1444 visualization capabilities. Gmsh is built around four modules: geometry,
1445 mesh, solver and post-processing. The specification of any input to these
1446 modules is done either interactively using the graphical user interface or in
1447 ASCII text files using Gmsh's own scripting language.")
1448 (license license:gpl2+)))
1450 (define-public maxflow
1457 (url "https://github.com/gerddie/maxflow.git")
1458 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1459 (file-name (string-append name "-" version "-checkout"))
1462 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1463 (build-system cmake-build-system)
1464 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1465 (synopsis "Library implementing Maxflow algorithm")
1466 (description "An implementation of the maxflow algorithm described in
1467 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1468 Energy Minimization in Computer Vision.\n
1469 Yuri Boykov and Vladimir Kolmogorov.\n
1470 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1472 (license license:gpl3+)))
1474 (define-public petsc
1481 ;; The *-lite-* tarball does not contain the *large* documentation
1482 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1483 "petsc-lite-" version ".tar.gz"))
1485 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1486 (build-system gnu-build-system)
1488 `(("python" ,python-2)))
1490 `(("gfortran" ,gfortran)
1492 ("superlu" ,superlu)
1493 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1494 ;; leaving out opengl, as configuration seems to only be for mac
1497 `(#:test-target "test"
1498 #:parallel-build? #f ;build is parallel by default
1503 ,(string-append "--with-superlu-include="
1504 (assoc-ref %build-inputs "superlu") "/include")
1505 ,(string-append "--with-superlu-lib="
1506 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1508 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1509 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1510 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1512 (modify-phases %standard-phases
1514 ;; PETSc's configure script is actually a python script, so we can't
1515 ;; run it with bash.
1516 (lambda* (#:key outputs (configure-flags '())
1518 (let* ((prefix (assoc-ref outputs "out"))
1519 (flags `(,(string-append "--prefix=" prefix)
1520 ,@configure-flags)))
1521 (format #t "build directory: ~s~%" (getcwd))
1522 (format #t "configure flags: ~s~%" flags)
1523 (zero? (apply system* "./configure" flags)))))
1524 (add-after 'configure 'clean-local-references
1525 (lambda* (#:key outputs #:allow-other-keys)
1526 (let ((out (assoc-ref outputs "out")))
1527 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1528 ;; Prevent build directory from leaking into compiled code
1530 ;; Scrub timestamp for reproducibility
1531 ((".*Libraries compiled on.*") ""))
1532 (substitute* (find-files "." "petscvariables")
1533 ;; Do not expose build machine characteristics, set to defaults.
1534 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1535 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1537 (add-after 'install 'clean-install
1538 ;; Try to keep installed files from leaking build directory names.
1539 (lambda* (#:key inputs outputs #:allow-other-keys)
1540 (let ((out (assoc-ref outputs "out")))
1541 (substitute* (map (lambda (file)
1542 (string-append out "/lib/petsc/conf/" file))
1543 '("petscvariables"))
1545 ;; Make compiler references point to the store
1546 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1547 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1548 (string-append "= " (which compiler))))
1549 ;; PETSc installs some build logs, which aren't necessary.
1550 (for-each (lambda (file)
1551 (let ((f (string-append out "/lib/petsc/conf/" file)))
1552 (when (file-exists? f)
1554 '("configure.log" "make.log" "gmake.log"
1555 "test.log" "error.log" "RDict.db"
1556 "PETScBuildInternal.cmake"
1557 ;; Once installed, should uninstall with Guix
1560 (home-page "http://www.mcs.anl.gov/petsc")
1561 (synopsis "Library to solve PDEs")
1562 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1563 data structures and routines for the scalable (parallel) solution of
1564 scientific applications modeled by partial differential equations.")
1565 (license (license:non-copyleft
1566 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1568 (define-public petsc-complex
1569 (package (inherit petsc)
1570 (name "petsc-complex")
1572 (substitute-keyword-arguments (package-arguments petsc)
1573 ((#:configure-flags cf)
1574 `(cons "--with-scalar-type=complex" ,cf))))
1575 (synopsis "Library to solve PDEs (with complex scalars)")))
1577 (define-public petsc-openmpi
1578 (package (inherit petsc)
1579 (name "petsc-openmpi")
1581 `(("openmpi" ,openmpi)
1582 ,@(package-inputs petsc)))
1584 (substitute-keyword-arguments (package-arguments petsc)
1585 ((#:configure-flags cf)
1586 ``("--with-mpiexec=mpirun"
1587 ,(string-append "--with-mpi-dir="
1588 (assoc-ref %build-inputs "openmpi"))
1589 ,@(delete "--with-mpi=0" ,cf)))))
1590 (synopsis "Library to solve PDEs (with MPI support)")))
1592 (define-public petsc-complex-openmpi
1593 (package (inherit petsc-complex)
1594 (name "petsc-complex-openmpi")
1596 `(("openmpi" ,openmpi)
1597 ,@(package-inputs petsc-complex)))
1599 (substitute-keyword-arguments (package-arguments petsc-complex)
1600 ((#:configure-flags cf)
1601 ``("--with-mpiexec=mpirun"
1602 ,(string-append "--with-mpi-dir="
1603 (assoc-ref %build-inputs "openmpi"))
1604 ,@(delete "--with-mpi=0" ,cf)))))
1605 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1607 (define-public slepc
1614 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1618 "0qyrsdndfdw2g0jmj9iskxj3j20zlkplhv26288s079dhm7cr365"))))
1619 (build-system gnu-build-system)
1621 `(("python" ,python-2)))
1623 `(("arpack" ,arpack-ng)
1624 ("gfortran" ,gfortran)))
1626 `(("petsc" ,petsc)))
1628 `(#:parallel-build? #f ;build is parallel by default
1630 `(,(string-append "--with-arpack-dir="
1631 (assoc-ref %build-inputs "arpack") "/lib"))
1632 #:make-flags ;honor (parallel-job-count)
1633 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1635 (modify-phases %standard-phases
1637 ;; configure is a python script, so we can't run it with bash.
1638 (lambda* (#:key inputs outputs (configure-flags '())
1640 (let* ((prefix (assoc-ref outputs "out"))
1641 (flags `(,(string-append "--prefix=" prefix)
1642 ,@configure-flags)))
1643 (format #t "build directory: ~s~%" (getcwd))
1644 (format #t "configure flags: ~s~%" flags)
1645 (setenv "SLEPC_DIR" (getcwd))
1646 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1647 (zero? (apply system* "./configure" flags)))))
1648 (add-after 'install 'delete-doc
1649 ;; TODO: SLEPc installs HTML documentation alongside headers in
1650 ;; $out/include. We'd like to move them to share/doc, but delete
1651 ;; them for now, as they are incomplete and installing the complete
1652 ;; documentation is difficult.
1653 (lambda* (#:key outputs #:allow-other-keys)
1654 (let* ((out (assoc-ref outputs "out")))
1655 (for-each delete-file (find-files out "\\.html$")))))
1656 (add-after 'install 'clean-install
1657 ;; Clean up unnecessary build logs from installation.
1658 (lambda* (#:key outputs #:allow-other-keys)
1659 (let ((out (assoc-ref outputs "out")))
1660 (for-each (lambda (file)
1661 (let ((f (string-append out "/lib/slepc/conf/" file)))
1662 (when (file-exists? f)
1664 '("configure.log" "make.log" "gmake.log"
1665 "test.log" "error.log" "RDict.db"
1666 "uninstall.py"))))))))
1667 (home-page "http://slepc.upv.es")
1668 (synopsis "Scalable library for eigenproblems")
1669 (description "SLEPc is a software library for the solution of large sparse
1670 eigenproblems on parallel computers. It can be used for the solution of
1671 linear eigenvalue problems formulated in either standard or generalized form,
1672 as well as other related problems such as the singular value decomposition.
1673 The emphasis of the software is on methods and techniques appropriate for
1674 problems in which the associated matrices are sparse, for example, those
1675 arising after the discretization of partial differential equations.")
1676 (license license:lgpl3)))
1678 (define-public slepc-complex
1679 (package (inherit slepc)
1680 (name "slepc-complex")
1682 `(("petsc" ,petsc-complex)
1683 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1684 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1686 (define-public slepc-openmpi
1687 (package (inherit slepc)
1688 (name "slepc-openmpi")
1691 ("arpack" ,arpack-ng-openmpi)
1692 ,@(alist-delete "arpack" (package-inputs slepc))))
1694 `(("petsc" ,petsc-openmpi)
1695 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1696 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1698 (define-public slepc-complex-openmpi
1699 (package (inherit slepc-openmpi)
1700 (name "slepc-complex-openmpi")
1702 `(("petsc" ,petsc-complex-openmpi)
1703 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1704 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1706 (define-public mumps
1713 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1717 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1718 (patches (search-patches "mumps-build-parallelism.patch"))))
1719 (build-system gnu-build-system)
1721 `(("fortran" ,gfortran)
1722 ;; These are required for linking against mumps, but we let the user
1723 ;; declare the dependency.
1726 ("scotch" ,scotch)))
1728 `(#:modules ((ice-9 match)
1731 ,@%gnu-build-system-modules)
1733 (modify-phases %standard-phases
1735 (lambda* (#:key inputs #:allow-other-keys)
1736 (call-with-output-file "Makefile.inc"
1747 INCSEQ = -I$(topdir)/libseq
1748 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1749 LIBSEQNEEDED = libseqneeded~;
1753 AR = ar vr # rules require trailing space, ugh...
1755 LIBBLAS = -L~a -lopenblas~@[
1756 SCALAP = -L~a -lscalapack~]
1757 LIBOTHERS = -pthread
1760 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1764 LIBS = $(SCALAP) $(LIBSEQ)
1765 LPORDDIR = $(topdir)/PORD/lib
1766 IPORD = -I$(topdir)/PORD/include
1767 LPORD = -L$(LPORDDIR) -lpord
1768 ORDERINGSF = -Dpord~@[
1770 IMETIS = -I$(METISDIR)/include
1771 LMETIS = -L$(METISDIR)/lib -lmetis
1772 ORDERINGSF += -Dmetis~]~@[~:{
1774 ISCOTCH = -I$(SCOTCHDIR)/include
1775 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1776 ORDERINGSF += ~a~}~]
1777 ORDERINGSC = $(ORDERINGSF)
1778 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1779 IORDERINGSF = $(ISCOTCH)
1780 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1781 (assoc-ref inputs "mpi")
1782 (assoc-ref inputs "blas")
1783 (assoc-ref inputs "scalapack")
1784 (assoc-ref inputs "metis")
1785 (match (list (assoc-ref inputs "pt-scotch")
1786 (assoc-ref inputs "scotch"))
1790 `((,scotch "" "-Dscotch")))
1793 "-lptesmumps -lptscotch -lptscotcherr "
1794 "-Dptscotch")))))))))
1796 ;; By default only the d-precision library is built. Make with "all"
1797 ;; target so that all precision libraries and examples are built.
1799 (zero? (system* "make" "all"
1800 (format #f "-j~a" (parallel-job-count))))))
1802 ;; Run the simple test drivers, which read test input from stdin:
1803 ;; from the "real" input for the single- and double-precision
1804 ;; testers, and from the "cmplx" input for complex-precision
1805 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1806 ;; package to prefix execution with "mpirun".
1807 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1808 (with-directory-excursion "examples"
1811 (let ((tester (apply open-pipe*
1814 ,(string-append "./" prec
1816 (input (open-input-file
1817 (string-append "input_simpletest_" type))))
1819 (dump-port input tester)
1821 (zero? (close-pipe tester)))))
1823 '("real" "real" "cmplx" "cmplx")))))
1825 (lambda* (#:key outputs #:allow-other-keys)
1826 (let* ((out (assoc-ref outputs "out"))
1827 (libdir (string-append out "/lib")))
1828 (copy-recursively "lib" libdir)
1829 (copy-recursively "include" (string-append out "/include"))
1830 (when (file-exists? "libseq/libmpiseq.a")
1831 (install-file "libseq/libmpiseq.a" libdir))
1833 (home-page "http://mumps.enseeiht.fr")
1834 (synopsis "Multifrontal sparse direct solver")
1836 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1837 sparse system of linear equations A x = b using Guassian elimination.")
1838 (license license:cecill-c)))
1840 (define-public mumps-metis
1841 (package (inherit mumps)
1842 (name "mumps-metis")
1844 (alist-delete "scotch" (package-inputs mumps)))))
1846 (define-public mumps-openmpi
1847 (package (inherit mumps)
1848 (name "mumps-openmpi")
1851 ("scalapack" ,scalapack)
1852 ("pt-scotch" ,pt-scotch)
1853 ,@(alist-delete "scotch" (package-inputs mumps))))
1855 (substitute-keyword-arguments (package-arguments mumps)
1857 `(modify-phases ,phases
1861 ((assoc-ref ,phases 'check)
1862 #:exec-prefix '("mpirun" "-n" "2"))))))))
1863 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1865 (define-public mumps-metis-openmpi
1866 (package (inherit mumps-openmpi)
1867 (name "mumps-metis-openmpi")
1869 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1871 (define-public r-quadprog
1878 (uri (cran-uri "quadprog" version))
1881 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1882 (build-system r-build-system)
1884 `(("gfortran" ,gfortran)))
1885 (home-page "http://cran.r-project.org/web/packages/quadprog")
1886 (synopsis "Functions to solve quadratic programming problems")
1888 "This package contains routines and documentation for solving quadratic
1889 programming problems.")
1890 (license license:gpl3+)))
1892 (define-public r-pracma
1898 (uri (cran-uri "pracma" version))
1900 (base32 "0hxa0rbbp54j0c05qj7vfwhqfdmiz5ax8vhqxd09g33x7c0hqbc5"))))
1901 (build-system r-build-system)
1903 `(("r-quadprog" ,r-quadprog)))
1904 (home-page "http://cran.r-project.org/web/packages/pracma")
1905 (synopsis "Practical numerical math functions")
1906 (description "This package provides functions for numerical analysis and
1907 linear algebra, numerical optimization, differential equations, plus some
1908 special functions. It uses Matlab function names where appropriate to simplify
1910 (license license:gpl3+)))
1912 (define-public superlu
1919 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1920 "superlu_" version ".tar.gz"))
1922 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1923 (modules '((guix build utils)))
1925 ;; Replace the non-free implementation of MC64 with a stub adapted
1928 (use-modules (ice-9 regex)
1930 (call-with-output-file "SRC/mc64ad.c"
1935 void mc64id_(int *a) {
1936 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1939 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1940 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1941 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1944 ;; Remove the corresponding license verbiage. MC64 license follows
1945 ;; a "------" line separator.
1946 (with-atomic-file-replacement "License.txt"
1947 (let ((rx (make-regexp "-{8}")))
1950 (let ((line (read-line in 'concat)))
1951 (unless (regexp-exec rx line)
1954 (build-system cmake-build-system)
1958 `(("blas" ,openblas)
1959 ("gfortran" ,gfortran)))
1961 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1962 "-DTPL_BLAS_LIBRARIES=openblas"
1963 "-DBUILD_SHARED_LIBS:BOOL=YES"
1964 "-DCMAKE_INSTALL_LIBDIR=lib")))
1965 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1966 (synopsis "Supernodal direct solver for sparse linear systems")
1968 "SuperLU is a general purpose library for the direct solution of large,
1969 sparse, nonsymmetric systems of linear equations on high performance machines.
1970 The library is written in C and is callable from either C or Fortran. The
1971 library routines perform an LU decomposition with partial pivoting and
1972 triangular system solves through forward and back substitution. The library
1973 also provides threshold-based ILU factorization preconditioners.")
1974 (license (list license:bsd-3
1975 license:gpl2+ ;EXAMPLE/*fgmr.c
1976 (license:fsf-free "file://SRC/colamd.h")))))
1978 (define-public superlu-dist
1980 (name "superlu-dist")
1985 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1986 "superlu_dist_" version ".tar.gz"))
1988 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
1989 (modules '((guix build utils)))
1991 ;; Replace the non-free implementation of MC64 with a stub
1993 (use-modules (ice-9 regex)
1995 (call-with-output-file "SRC/mc64ad.c"
2000 void mc64id_(int *a) {
2001 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2004 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2005 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2006 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2009 (delete-file "SRC/mc64ad.f.bak")
2010 (substitute* "SRC/util.c" ;adjust default algorithm
2011 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2012 "RowPerm = NOROWPERM"))))
2013 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2014 (build-system gnu-build-system)
2018 `(("gfortran" ,gfortran)))
2020 `(("openmpi" ,openmpi) ;headers include MPI heades
2021 ("lapack" ,lapack) ;required to link with output library
2022 ("pt-scotch" ,pt-scotch))) ;same
2024 `(#:parallel-build? #f ;race conditions using ar
2026 (modify-phases %standard-phases
2028 (lambda* (#:key inputs outputs #:allow-other-keys)
2029 (call-with-output-file "make.inc"
2034 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2035 BLASDEF = -DUSE_VENDOR_BLAS
2036 BLASLIB = -L~a/lib -lblas
2037 PARMETISLIB = -L~a/lib \
2038 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2039 -lscotch -lscotcherr -lscotcherrexit
2040 METISLIB = -L~:*~a/lib \
2041 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2042 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2048 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2049 NOOPTS = -O0 -g $(PIC)
2051 FFLAGS = -O2 -g $(PIC)
2055 (assoc-ref outputs "out")
2056 (assoc-ref inputs "lapack")
2057 (assoc-ref inputs "pt-scotch"))))
2059 (add-after 'unpack 'remove-broken-symlinks
2061 (for-each delete-file
2062 (find-files "MAKE_INC" "\\.#make\\..*"))
2064 (add-before 'build 'create-install-directories
2065 (lambda* (#:key outputs #:allow-other-keys)
2068 (mkdir-p (string-append (assoc-ref outputs "out")
2074 (with-directory-excursion "EXAMPLE"
2076 (zero? (system* "mpirun" "-n" "2"
2077 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2078 (zero? (system* "mpirun" "-n" "2"
2079 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2081 (lambda* (#:key outputs #:allow-other-keys)
2082 ;; Library is placed in lib during the build phase. Copy over
2083 ;; headers to include.
2084 (let* ((out (assoc-ref outputs "out"))
2085 (incdir (string-append out "/include")))
2086 (for-each (lambda (file)
2087 (let ((base (basename file)))
2088 (format #t "installing `~a' to `~a'~%"
2091 (string-append incdir "/" base))))
2092 (find-files "SRC" ".*\\.h$")))
2094 (home-page (package-home-page superlu))
2095 (synopsis "Parallel supernodal direct solver")
2097 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2098 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2099 implemented in ANSI C, and MPI for communications.")
2100 (license license:bsd-3)))
2102 (define-public scotch
2109 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
2110 "scotch_" version ".tar.gz"))
2112 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
2113 (patches (search-patches "scotch-test-threading.patch"
2114 "pt-scotch-build-parallelism.patch"))))
2115 (build-system gnu-build-system)
2122 (modify-phases %standard-phases
2124 'unpack 'chdir-to-src
2125 (lambda _ (chdir "src")))
2129 (call-with-output-file "Makefile.inc"
2143 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2144 LDFLAGS = -lz -lm -lrt -lpthread
2146 LEX = flex -Pscotchyy -olex.yy.c
2151 YACC = bison -pscotchyy -y -b y
2153 '("COMMON_FILE_COMPRESS_GZ"
2155 "COMMON_RANDOM_FIXED_SEED"
2156 "INTSIZE64" ;use 'long' instead of 'int'
2157 ;; Prevents symbolc clashes with libesmumps
2159 ;; XXX: Causes invalid frees in superlu-dist tests
2161 ;; "SCOTCH_PTHREAD_NUMBER=2"
2162 "restrict=__restrict"))))))
2164 'build 'build-esmumps
2166 (zero? (system* "make"
2167 (format #f "-j~a" (parallel-job-count))
2171 (lambda* (#:key outputs #:allow-other-keys)
2172 (let ((out (assoc-ref outputs "out")))
2174 (zero? (system* "make"
2175 (string-append "prefix=" out)
2177 ;; esmumps files are not installed with the above
2178 (for-each (lambda (f)
2179 (copy-file f (string-append out "/include/" f)))
2180 (find-files "../include" ".*esmumps.h$"))
2181 (for-each (lambda (f)
2182 (copy-file f (string-append out "/lib/" f)))
2183 (find-files "../lib" "^lib.*esmumps.*"))))))))
2184 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2185 (synopsis "Programs and libraries for graph algorithms")
2186 (description "SCOTCH is a set of programs and libraries which implement
2187 the static mapping and sparse matrix reordering algorithms developed within
2188 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2189 conquer approach, to scientific computing problems such as graph and mesh
2190 partitioning, static mapping, and sparse matrix ordering, in application
2191 domains ranging from structural mechanics to operating systems or
2193 ;; See LICENSE_en.txt
2194 (license license:cecill-c)))
2196 (define-public scotch32
2197 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2198 ;; some applications.
2199 (package (inherit scotch)
2202 (substitute-keyword-arguments (package-arguments scotch)
2203 ((#:phases scotch-phases)
2204 `(modify-phases ,scotch-phases
2208 (call-with-output-file "Makefile.inc"
2222 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2223 LDFLAGS = -lz -lm -lrt -lpthread
2225 LEX = flex -Pscotchyy -olex.yy.c
2230 YACC = bison -pscotchyy -y -b y
2232 '("COMMON_FILE_COMPRESS_GZ"
2234 "COMMON_RANDOM_FIXED_SEED"
2235 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2236 ;; Prevents symbolc clashes with libesmumps
2238 ;; XXX: Causes invalid frees in superlu-dist tests
2240 ;; "SCOTCH_PTHREAD_NUMBER=2"
2241 "restrict=__restrict"))))))))))
2243 "Programs and libraries for graph algorithms (32-bit integers)")))
2245 (define-public pt-scotch
2246 (package (inherit scotch)
2249 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2251 (substitute-keyword-arguments (package-arguments scotch)
2252 ((#:phases scotch-phases)
2253 `(modify-phases ,scotch-phases
2258 (zero? (system* "make"
2259 (format #f "-j~a" (parallel-job-count))
2260 "ptscotch" "ptesmumps"))
2261 ;; Install the serial metis compatibility library
2262 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2265 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2266 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2268 (define-public pt-scotch32
2269 (package (inherit scotch32)
2270 (name "pt-scotch32")
2272 `(("openmpi" ,openmpi))) ;headers include MPI headers
2274 (substitute-keyword-arguments (package-arguments scotch32)
2275 ((#:phases scotch32-phases)
2276 `(modify-phases ,scotch32-phases
2280 (zero? (system* "make"
2281 (format #f "-j~a" (parallel-job-count))
2282 "ptscotch" "ptesmumps"))
2283 ;; Install the serial metis compatibility library
2284 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2287 (zero? (system* "make" "ptcheck"))))))))
2289 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2291 (define-public metis
2298 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2299 "metis-" version ".tar.gz"))
2302 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2303 (build-system cmake-build-system)
2305 `(("blas" ,openblas)))
2307 `(#:tests? #f ;no tests
2308 #:configure-flags `("-DSHARED=ON"
2309 ,(string-append "-DGKLIB_PATH=" (getcwd)
2310 "/metis-" ,version "/GKlib"))))
2311 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2312 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2314 "METIS is a set of serial programs for partitioning graphs, partitioning
2315 finite element meshes, and producing fill-reducing orderings for sparse
2316 matrices. The algorithms implemented in METIS are based on the multilevel
2317 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2319 (license license:asl2.0))) ;As of version 5.0.3
2321 (define-public p4est
2328 (uri (string-append "http://p4est.github.io/release/p4est-"
2332 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2333 (build-system gnu-build-system)
2335 `(("fortran" ,gfortran)
2340 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2341 (assoc-ref %build-inputs "blas")
2343 ,(string-append "LAPACK_LIBS=-L"
2344 (assoc-ref %build-inputs "lapack")
2346 (home-page "http://www.p4est.org")
2347 (synopsis "Adaptive mesh refinement on forests of octrees")
2349 "The p4est software library enables the dynamic management of a
2350 collection of adaptive octrees, conveniently called a forest of octrees.
2351 p4est is designed to work in parallel and scales to hundreds of thousands of
2353 (license license:gpl2+)))
2355 (define-public p4est-openmpi
2356 (package (inherit p4est)
2357 (name "p4est-openmpi")
2360 ,@(package-inputs p4est)))
2362 (substitute-keyword-arguments (package-arguments p4est)
2363 ((#:configure-flags cf)
2364 ``("--enable-mpi" ,@,cf))))
2365 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2367 (define-public gsegrafix
2374 (uri (string-append "mirror://gnu/" name "/" name "-"
2378 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2379 (build-system gnu-build-system)
2381 `(#:configure-flags '("LDFLAGS=-lm")))
2383 `(("libgnomecanvas" ,libgnomecanvas)
2384 ("libbonoboui" ,libbonoboui)
2385 ("libgnomeui" ,libgnomeui)
2386 ("libgnomeprintui" ,libgnomeprintui)
2389 `(("pkg-config" ,pkg-config)))
2390 (home-page "https://www.gnu.org/software/gsegrafix/")
2391 (synopsis "GNOME application to create scientific and engineering plots")
2392 (description "GSEGrafix is an application which produces high-quality graphical
2393 plots for science and engineering. Plots are specified via simple ASCII
2394 parameter files and data files and are presented in an anti-aliased GNOME
2395 canvas. The program supports rectangular two-dimensional plots, histograms,
2396 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2397 to BMP, JPEG or PNG image formats.")
2398 (license license:gpl3+)))
2400 (define-public maxima
2407 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2408 version "-source/" name "-" version ".tar.gz"))
2411 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2412 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2413 (build-system gnu-build-system)
2416 ("gnuplot" ,gnuplot) ;for plots
2417 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2419 `(("texinfo" ,texinfo)
2421 ("python" ,python)))
2424 (list "--enable-gcl"
2425 (string-append "--with-posix-shell="
2426 (assoc-ref %build-inputs "bash")
2428 (string-append "--with-wish="
2429 (assoc-ref %build-inputs "tk")
2431 (let ((v ,(package-version tk)))
2432 (string-take v (string-index-right v #\.)))))
2433 ;; By default Maxima attempts to write temporary files to
2434 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2435 ;; Work around that.
2436 #:make-flags (list "TMPDIR=/tmp")
2438 (modify-phases %standard-phases
2439 (add-before 'check 'pre-check
2441 (chmod "src/maxima" #o555)
2443 ;; Make sure the doc and emacs files are found in the
2444 ;; standard location. Also configure maxima to find gnuplot
2445 ;; without having it on the PATH.
2446 (add-after 'install 'post-install
2447 (lambda* (#:key outputs inputs #:allow-other-keys)
2448 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2449 (out (assoc-ref outputs "out"))
2450 (datadir (string-append out "/share/maxima/" ,version))
2451 (binutils (string-append (assoc-ref inputs "binutils")
2453 (with-directory-excursion out
2454 (mkdir-p "share/emacs")
2455 (mkdir-p "share/doc")
2457 (string-append datadir "/emacs/")
2458 (string-append out "/share/emacs/site-lisp"))
2460 (string-append datadir "/doc/")
2461 (string-append out "/share/doc/maxima"))
2462 (with-atomic-file-replacement
2463 (string-append datadir "/share/maxima-init.lisp")
2465 (format out "~a ~s~a~%"
2466 "(setf $gnuplot_command "
2467 (string-append gnuplot "/bin/gnuplot") ")")
2468 (dump-port in out))))
2469 ;; Ensure that Maxima will have access to the GNU binutils
2470 ;; components at runtime.
2471 (wrap-program (string-append out "/bin/maxima")
2472 `("PATH" prefix (,binutils))))
2474 (home-page "http://maxima.sourceforge.net")
2475 (synopsis "Numeric and symbolic expression manipulation")
2476 (description "Maxima is a system for the manipulation of symbolic and
2477 numerical expressions. It yields high precision numeric results by using
2478 exact fractions, arbitrary precision integers, and variable precision floating
2480 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2481 ;; Others simply say "GNU General Public License" without stating a
2482 ;; version (which implicitly means gpl1+).
2483 ;; At least one file (src/maxima.asd) says "version 2."
2484 ;; GPLv2 only is therefore the smallest subset.
2485 (license license:gpl2)))
2487 (define-public wxmaxima
2494 (uri (string-append "https://github.com/andrejv/" name "/archive"
2495 "/Version-" version ".tar.gz"))
2496 (file-name (string-append name "-" version ".tar.gz"))
2499 "0dv0cy0cf46v0cbw32izscpkdmpxg1qhwq1f4cz46kkqd8k4yfbj"))))
2500 (build-system gnu-build-system)
2502 `(("autoconf" ,autoconf)
2503 ("automake" ,automake)
2504 ("gettext" ,gettext-minimal)))
2506 `(("wxwidgets" ,wxwidgets)
2509 ("adwaita-icon-theme" ,adwaita-icon-theme)
2511 ("shared-mime-info" ,shared-mime-info)))
2514 (modify-phases %standard-phases
2515 (add-after 'unpack 'autoconf
2517 (zero? (system* "sh" "bootstrap"))))
2518 (add-after 'install 'wrap-program
2519 (lambda* (#:key inputs outputs #:allow-other-keys)
2520 (wrap-program (string-append (assoc-ref outputs "out")
2523 (,(string-append (assoc-ref inputs "maxima")
2525 ;; For GtkFileChooserDialog.
2526 `("GSETTINGS_SCHEMA_DIR" =
2527 (,(string-append (assoc-ref inputs "gtk+")
2528 "/share/glib-2.0/schemas")))
2529 `("XDG_DATA_DIRS" ":" prefix
2530 (;; Needed by gdk-pixbuf to know supported icon formats.
2532 (assoc-ref inputs "shared-mime-info") "/share")
2533 ;; The default icon theme of GTK+.
2535 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2537 (home-page "https://andrejv.github.io/wxmaxima/")
2538 (synopsis "Graphical user interface for the Maxima computer algebra system")
2540 "wxMaxima is a graphical user interface for the Maxima computer algebra
2541 system. It eases the use of Maxima by making most of its commands available
2542 through a menu system and by providing input dialogs for commands that require
2543 more than one argument. It also implements its own display engine that
2544 outputs mathematical symbols directly instead of depicting them with ASCII
2547 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2548 text and mathematical calculations to create documents, exporting of input and
2549 output to TeX, and a browser for Maxima's manual including command index and
2550 full text searching.")
2551 (license license:gpl2+)))
2553 (define-public armadillo
2559 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2563 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2564 (build-system cmake-build-system)
2565 (arguments `(#:tests? #f)) ;no test target
2567 `(("openblas" ,openblas)
2569 ("arpack" ,arpack-ng)))
2570 (home-page "http://arma.sourceforge.net/")
2571 (synopsis "C++ linear algebra library")
2573 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2574 between speed and ease of use. It is useful for algorithm development
2575 directly in C++, or quick conversion of research code into production
2576 environments. It can be used for machine learning, pattern recognition,
2577 signal processing, bioinformatics, statistics, econometrics, etc. The library
2578 provides efficient classes for vectors, matrices and cubes, as well as 150+
2579 associated functions (eg. contiguous and non-contiguous submatrix views).")
2580 (license license:asl2.0)))
2582 (define-public muparser
2583 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2584 ;; different hash. In order to make `guix package --upgrade` work correctly,
2585 ;; we set a Guix packaging revision.
2586 ;; When the next version of muparser is released, we can remove
2587 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2588 (let ((upstream-version "2.2.5")
2592 (version (string-append upstream-version "-" revision))
2596 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2597 upstream-version ".tar.gz"))
2598 (file-name (string-append name "-" version ".tar.gz"))
2601 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2602 (build-system gnu-build-system)
2604 `(#:configure-flags '("--enable-samples=no")
2605 #:tests? #f)) ;no "check" target
2606 (home-page "http://muparser.beltoforion.de/")
2607 (synopsis "Fast parser library for mathematical expressions")
2609 "muParser is an extensible high performance math parser library. It is
2610 based on transforming an expression into a bytecode and precalculating constant
2612 (license license:expat))))
2614 (define-public openblas
2621 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2623 (file-name (string-append name "-" version ".tar.gz"))
2626 "071zqnmnxhh0c9phzyn3f198yxa0hjxda7016azdbq2056sm70w7"))))
2627 (build-system gnu-build-system)
2629 `(#:tests? #f ;no "check" target
2630 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2631 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2632 ;; we need to disable substitutions.
2634 ,(let ((system (or (%current-target-system) (%current-system))))
2635 (or (string-prefix? "x86_64" system)
2636 (string-prefix? "i686" system)
2637 (string-prefix? "mips" system)
2638 (string-prefix? "aarch64" system)))
2640 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2643 ;; Build the library for all supported CPUs. This allows
2644 ;; switching CPU targets at runtime with the environment variable
2645 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2646 ;; Unfortunately, this is not supported on non-x86 architectures,
2647 ;; where it leads to failed builds.
2648 ,@(let ((system (or (%current-target-system) (%current-system))))
2650 ((or (string-prefix? "x86_64" system)
2651 (string-prefix? "i686" system))
2652 '("DYNAMIC_ARCH=1"))
2653 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2654 ;; two available MIPS targets special extended instructions
2655 ;; for Loongson cores are used.
2656 ((string-prefix? "mips" system)
2657 '("TARGET=SICORTEX"))
2658 ;; On aarch64 force the generic 'armv8-a' target
2659 ((string-prefix? "aarch64" system)
2662 ;; no configure script
2663 #:phases (alist-delete 'configure %standard-phases)))
2665 `(("fortran" ,gfortran)))
2669 (home-page "http://www.openblas.net/")
2670 (synopsis "Optimized BLAS library based on GotoBLAS")
2672 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2673 (license license:bsd-3)))
2675 (define* (make-blis implementation #:optional substitutable?)
2676 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2677 source tree for a list of implementations.)
2679 SUBSTITUTABLE? determines whether the package is made available as a
2682 Currently the specialization must be selected at configure-time, but work is
2683 underway to allow BLIS to select the right optimized kernels at run time:
2684 <https://github.com/flame/blis/issues/129>."
2686 (name (if (string=? implementation "reference")
2688 (string-append "blis-" implementation)))
2690 (home-page "https://github.com/flame/blis")
2693 (uri (git-reference (url home-page) (commit version)))
2696 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2697 (file-name (git-file-name "blis" version))))
2698 (build-system gnu-build-system)
2700 `(#:test-target "test"
2702 #:substitutable? ,substitutable?
2704 #:phases (modify-phases %standard-phases
2706 (lambda* (#:key outputs #:allow-other-keys)
2707 ;; This is a home-made 'configure' script.
2708 (let ((out (assoc-ref outputs "out")))
2709 (zero? (system* "./configure" "-p" out
2713 "--enable-threading=openmp"
2715 ,implementation)))))
2716 (add-before 'check 'show-test-output
2718 ;; By default "make check" is silent. Make it verbose.
2719 (system "tail -F output.testsuite &")
2721 (synopsis "High-performance basic linear algebra (BLAS) routines")
2723 "BLIS is a portable software framework for instantiating high-performance
2724 BLAS-like dense linear algebra libraries. The framework was designed to
2725 isolate essential kernels of computation that, when optimized, immediately
2726 enable optimized implementations of most of its commonly used and
2727 computationally intensive operations. While BLIS exports a new BLAS-like API,
2728 it also includes a BLAS compatibility layer which gives application developers
2729 access to BLIS implementations via traditional BLAS routine calls.")
2730 (license license:bsd-3)))
2733 ;; This is the "reference" implementation, which is the non-optimized but
2734 ;; portable variant (no assembly).
2735 (make-blis "reference" #t))
2737 (define ignorance blis)
2739 (define-syntax-rule (blis/x86_64 processor)
2740 "Expand to a package specialized for PROCESSOR."
2742 (inherit (make-blis processor))
2743 (supported-systems '("x86_64-linux"))))
2745 (define-public blis-sandybridge
2746 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2747 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2748 (blis/x86_64 "sandybridge"))
2750 (define-public blis-haswell
2751 ;; BLIS specialized for Haswell processors (launched 2013):
2752 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2753 (blis/x86_64 "haswell"))
2755 (define-public blis-knl
2756 ;; BLIS specialized for Knights Landing processor (launched 2016):
2757 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2758 (blis/x86_64 "knl"))
2761 (define-public openlibm
2768 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2770 (file-name (string-append name "-" version ".tar.gz"))
2773 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2774 (build-system gnu-build-system)
2777 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2779 ;; no configure script
2780 (modify-phases %standard-phases (delete 'configure))
2781 #:tests? #f)) ;the tests are part of the default target
2782 (home-page "http://openlibm.org/")
2783 (synopsis "Portable C mathematical library (libm)")
2785 "OpenLibm is an effort to have a high quality, portable, standalone C
2786 mathematical library (libm). It can be used standalone in applications and
2787 programming language implementations. The project was born out of a need to
2788 have a good libm for the Julia programming language that worked consistently
2789 across compilers and operating systems, and in 32-bit and 64-bit
2791 ;; Each architecture has its own make target, and there is none for mips.
2792 (supported-systems (delete "mips64el-linux" %supported-systems))
2793 ;; See LICENSE.md for details.
2794 (license (list license:expat
2797 license:public-domain
2798 license:lgpl2.1+))))
2800 (define-public openspecfun
2802 (name "openspecfun")
2807 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2809 (file-name (string-append name "-" version ".tar.gz"))
2812 "1y5b2h6f2k72536kym3vzy3li3bhpd23x463g7hdmjdi3cncavz1"))))
2813 (build-system gnu-build-system)
2815 '(#:tests? #f ;no "check" target
2817 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2818 ;; no configure script
2819 #:phases (modify-phases %standard-phases (delete 'configure))))
2821 `(("fortran" ,gfortran)))
2822 (home-page "https://github.com/JuliaLang/openspecfun")
2823 (synopsis "Collection of special mathematical functions")
2825 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2826 portable package for Bessel Functions of a Complex Argument and Nonnegative
2827 Order; it contains subroutines for computing Bessel functions and Airy
2828 functions. Faddeeva allows computing the various error functions of arbitrary
2829 complex arguments (Faddeeva function, error function, complementary error
2830 function, scaled complementary error function, imaginary error function, and
2831 Dawson function); given these, one can also easily compute Voigt functions,
2832 Fresnel integrals, and similar related functions as well.")
2833 ;; Faddeeva is released under the Expat license; AMOS is included as
2834 ;; public domain software.
2835 (license (list license:expat license:public-domain))))
2837 (define-public suitesparse
2839 (name "suitesparse")
2845 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2849 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2850 (modules '((guix build utils)))
2852 ;; Remove bundled metis source
2853 '(delete-file-recursively "metis-5.1.0"))))
2854 (build-system gnu-build-system)
2856 '(#:tests? #f ;no "check" target
2861 "MY_METIS_LIB=-lmetis"
2862 (string-append "INSTALL_LIB="
2863 (assoc-ref %outputs "out") "/lib")
2864 (string-append "INSTALL_INCLUDE="
2865 (assoc-ref %outputs "out") "/include")
2868 (modify-phases %standard-phases
2869 (delete 'configure)))) ;no configure script
2874 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2875 (synopsis "Suite of sparse matrix software")
2877 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2878 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2879 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2880 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2881 CXSparse, a concise sparse Cholesky factorization package; and many other
2884 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2886 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2887 (license (list license:gpl2+ license:lgpl2.1+))))
2889 (define-public atlas
2895 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2896 version "/atlas" version ".tar.bz2"))
2899 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2900 (build-system gnu-build-system)
2901 (home-page "http://math-atlas.sourceforge.net/")
2902 (inputs `(("gfortran" ,gfortran)
2903 ("lapack-tar" ,(package-source lapack))))
2904 (outputs '("out" "doc"))
2905 ;; For the moment we drop support for MIPS at it fails to compile. See
2906 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2907 (supported-systems (delete "mips64el-linux" %supported-systems))
2909 `(#:parallel-build? #f
2910 #:parallel-tests? #f
2912 ;; ATLAS tunes itself for the machine it is built on, as explained at
2913 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2914 ;; For this reason, we want users to build it locally instead of using
2918 #:modules ((srfi srfi-26)
2920 (guix build gnu-build-system)
2923 `(;; Generate position independent code suitable for dynamic libraries
2924 ;; and use WALL timer to get more accurate timing.
2925 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2928 ,,(if (string-match "64" (%current-system))
2931 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2932 ;; needed to compile C files before it is generated.
2933 "-Ss" "pmake" "make -j 1"
2934 ;; Probe is failing for MIPS. We therefore define the system
2935 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2936 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2937 ,,@(if (string-prefix? "mips" (%current-system))
2938 (list "-A" "49" "-V" "1")
2940 ;; Generate shared libraries.
2942 ;; Build a full LAPACK library.
2943 ,(string-append "--with-netlib-lapack-tarfile="
2944 (assoc-ref %build-inputs "lapack-tar")))
2946 (modify-phases %standard-phases
2947 (add-after 'install 'install-doc
2948 (lambda* (#:key outputs inputs #:allow-other-keys)
2949 (let ((doc (string-append (assoc-ref outputs "doc")
2950 "/share/doc/atlas")))
2952 (fold (lambda (file previous)
2953 (and previous (zero? (system* "cp" file doc))))
2954 #t (find-files "../ATLAS/doc" ".*")))))
2955 (add-after 'check 'check-pt
2956 (lambda _ (zero? (system* "make" "ptcheck"))))
2957 ;; Fix files required to run configure.
2958 (add-before 'configure 'fix-/bin/sh
2960 ;; Use `sh', not `/bin/sh'.
2961 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2964 ;; Fix /bin/sh in generated make files.
2965 (add-after 'configure 'fix-/bin/sh-in-generated-files
2967 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2970 ;; ATLAS configure program does not accepts the default flags
2971 ;; passed by the 'gnu-build-system'.
2973 (lambda* (#:key native-inputs inputs outputs
2974 (configure-flags '())
2975 #:allow-other-keys #:rest args)
2976 (let* ((prefix (assoc-ref outputs "out"))
2977 (bash (or (and=> (assoc-ref
2978 (or native-inputs inputs) "bash")
2979 (cut string-append <> "/bin/bash"))
2981 (flags `(,(string-append "--prefix=" prefix)
2983 (abs-srcdir (getcwd))
2984 (srcdir (string-append "../" (basename abs-srcdir))))
2985 (format #t "source directory: ~s (relative from build: ~s)~%"
2989 (format #t "build directory: ~s~%" (getcwd))
2990 (format #t "configure flags: ~s~%" flags)
2991 (zero? (apply system* bash
2992 (string-append srcdir "/configure")
2994 (synopsis "Automatically Tuned Linear Algebra Software")
2996 "ATLAS is an automatically tuned linear algebra software library
2997 providing C and Fortran77 interfaces to a portably efficient BLAS
2998 implementation, as well as a few routines from LAPACK.
3000 Optimization occurs at build time. For this reason, the library is built on
3001 the machine where it is installed, without resorting to pre-built substitutes.
3003 Before building the library, CPU throttling should be disabled. This can be
3004 done in the BIOS, or, on GNU/Linux, with the following command:
3007 # cpupower --governor performance
3010 Failure to do so will result in a library with poor performance.")
3011 (license license:bsd-3)))
3020 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3021 "/glm-" version ".zip"))
3024 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3025 (build-system cmake-build-system)
3027 `(("unzip" ,unzip)))
3028 (home-page "http://glm.g-truc.net")
3029 (synopsis "OpenGL Mathematics library")
3030 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3031 library for graphics software based on the OpenGL Shading Language (GLSL)
3033 (license license:expat)))
3035 (define-public lpsolve
3042 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3043 "/lp_solve_" version "_source.tar.gz"))
3046 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
3047 (modules '((guix build utils)))
3049 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3051 ;; Pretend to be on a 64 bit platform to obtain a common directory
3052 ;; name for the build results on all architectures; nothing else
3053 ;; seems to depend on it.
3054 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3056 ;; The check for 'isnan' as it is written fails with
3057 ;; "non-floating-point argument in call to function
3058 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3059 ;; definition, which in turn leads to bad things. Fix the feature
3061 (("isnan\\(0\\)") "isnan(0.)")))))
3062 (build-system gnu-build-system)
3064 `(#:tests? #f ; no check target
3066 (modify-phases %standard-phases
3070 (and (with-directory-excursion "lpsolve55"
3071 (zero? (system* "bash" "ccc")))
3072 (with-directory-excursion "lp_solve"
3073 (zero? (system* "bash" "ccc"))))))
3075 (lambda* (#:key outputs #:allow-other-keys)
3076 (let* ((out (assoc-ref outputs "out"))
3077 (bin (string-append out "/bin"))
3078 (lib (string-append out "/lib"))
3079 ;; This is where LibreOffice expects to find the header
3080 ;; files, and where they are installed by Debian.
3081 (include (string-append out "/include/lpsolve")))
3083 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
3084 (string-append lib "/liblpsolve55.a"))
3085 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
3086 (string-append lib "/liblpsolve55.so"))
3087 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3089 ;; Install a subset of the header files as on Debian
3090 ;; (plus lp_bit.h, which matches the regular expression).
3091 (for-each (lambda (name)
3092 (install-file name include))
3093 (find-files "." "lp_[HMSa-z].*\\.h$"))
3094 (with-directory-excursion "shared"
3095 (for-each (lambda (name)
3096 (install-file name include))
3097 (find-files "." "\\.h$")))
3099 (home-page "http://lpsolve.sourceforge.net/")
3100 (synopsis "Mixed integer linear programming (MILP) solver")
3102 "lp_solve is a mixed integer linear programming solver based on the
3103 revised simplex and the branch-and-bound methods.")
3104 (license license:lgpl2.1+)))
3106 (define-public dealii
3113 (uri (string-append "https://github.com/dealii/dealii/releases/"
3114 "download/v" version "/dealii-" version ".tar.gz"))
3117 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3118 (modules '((guix build utils)))
3120 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3121 '(delete-file-recursively "bundled"))))
3122 (build-system cmake-build-system)
3130 ("arpack" ,arpack-ng)
3131 ("muparser" ,muparser)
3132 ("gfortran" ,gfortran)
3133 ("suitesparse" ,suitesparse))) ;for UMFPACK
3135 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3137 ;; Work around a bug in libsuitesparseconfig linking
3138 ;; see https://github.com/dealii/dealii/issues/4745
3139 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3140 (home-page "https://www.dealii.org")
3141 (synopsis "Finite element library")
3143 "Deal.II is a C++ program library targeted at the computational solution
3144 of partial differential equations using adaptive finite elements. The main
3145 aim of deal.II is to enable rapid development of modern finite element codes,
3146 using among other aspects adaptive meshes and a wide array of tools often used
3147 in finite element programs.")
3148 (license license:lgpl2.1+)))
3150 (define-public dealii-openmpi
3151 (package (inherit dealii)
3152 (name "dealii-openmpi")
3155 ;;Supported only with MPI:
3156 ("p4est" ,p4est-openmpi)
3157 ("petsc" ,petsc-openmpi)
3158 ("slepc" ,slepc-openmpi)
3159 ("metis" ,metis) ;for MUMPS
3160 ("scalapack" ,scalapack) ;for MUMPS
3161 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3162 ("arpack" ,arpack-ng-openmpi)
3163 ,@(fold alist-delete (package-inputs dealii)
3164 '("p4est" "arpack"))))
3166 (substitute-keyword-arguments (package-arguments dealii)
3167 ((#:configure-flags cf)
3168 ``("-DMPI_C_COMPILER=mpicc"
3169 "-DMPI_CXX_COMPILER=mpicxx"
3170 "-DMPI_Fortran_COMPILER=mpifort"
3172 (synopsis "Finite element library (with MPI support)")))
3174 (define-public flann
3183 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3184 version "-src.zip"))
3187 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3188 (build-system cmake-build-system)
3190 "octave")) ;46 MiB .mex file that pulls Octave
3192 `(("unzip" ,unzip)))
3196 ("python" ,python-2) ; print syntax
3197 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3200 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3201 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3202 #:strip-directories '("lib" "lib64" "libexec"
3203 "bin" "sbin" "share/flann/octave")
3205 ;; Save 12 MiB by not installing .a files. Passing
3206 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3207 #:phases (modify-phases %standard-phases
3208 (add-before 'configure 'set-octave-directory
3209 (lambda* (#:key outputs #:allow-other-keys)
3210 ;; Install the .mex file in the "octave" output.
3211 (let ((out (assoc-ref outputs "octave")))
3212 (substitute* "src/matlab/CMakeLists.txt"
3213 (("share/flann/octave")
3214 (string-append out "/share/flann/octave")))
3216 (add-after 'install 'remove-static-libraries
3217 (lambda* (#:key outputs #:allow-other-keys)
3218 (let* ((out (assoc-ref outputs "out"))
3219 (lib (string-append out "/lib")))
3220 (for-each delete-file
3221 (find-files lib "\\.a$"))
3224 #:tests? #f)) ; The test data are downloaded from the Internet.
3225 (home-page "http://www.cs.ubc.ca/research/flann/")
3226 (synopsis "Library for approximate nearest neighbors computation")
3227 (description "FLANN is a library for performing fast approximate
3228 nearest neighbor searches in high dimensional spaces. It implements a
3229 collection of algorithms and a system for automatically choosing the best
3230 algorithm and optimum parameters depending on the dataset.
3232 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3233 (license (license:non-copyleft "file://COPYING"
3234 "See COPYING in the distribution."))))
3236 (define-public wcalc
3243 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3244 "wcalc-" version ".tar.bz2"))
3247 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3248 (build-system gnu-build-system)
3251 ("readline" ,readline)))
3252 (home-page "http://w-calc.sourceforge.net/index.php")
3253 (synopsis "Flexible command-line scientific calculator")
3254 (description "Wcalc is a very capable calculator. It has standard functions
3255 (sin, asin, and sinh for example, in either radians or degrees), many
3256 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3257 variables, a command history, hex/octal/binary input and output, unit
3258 conversions, embedded comments, and an expandable expression entry field. It
3259 evaluates expressions using the standard order of operations.")
3260 (license license:gpl2+)))
3268 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3269 "/xaos-" version ".tar.gz"))
3272 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3273 (build-system gnu-build-system)
3274 (native-inputs `(("gettext" ,gettext-minimal)))
3275 (inputs `(("libx11" ,libx11)
3280 `(#:tests? #f ;no "check" target
3281 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3282 (synopsis "Real-time fractal zoomer")
3283 (description "GNU XaoS is a graphical program that generates fractal
3284 patterns and allows you to zoom in and out of them infinitely in a fluid,
3285 continuous manner. It also includes tutorials that help to explain how fractals
3286 are built. It can generate many different fractal types such as the Mandelbrot
3288 (home-page "https://www.gnu.org/software/xaos/")
3289 (license license:gpl2+)))
3291 (define-public hypre
3297 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3298 "v" version ".tar.gz"))
3299 (file-name (string-append name "-" version ".tar.gz"))
3302 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3303 (modules '((guix build utils)))
3306 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3307 ;; substitute the tarball creation time.
3308 (substitute* "src/utilities/HYPRE_utilities.h"
3309 (("Date Compiled: .*$")
3310 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3312 (build-system gnu-build-system)
3313 (outputs '("out" ;6.1 MiB of headers and libraries
3314 "doc")) ;4.8 MiB of documentation
3318 ("texlive" ,texlive) ;full package required for fonts
3319 ("ghostscript" ,ghostscript)))
3321 `(("blas" ,openblas)
3322 ("lapack" ,lapack)))
3324 `(#:modules ((srfi srfi-1)
3325 ,@%gnu-build-system-modules)
3326 #:configure-flags '("--enable-shared"
3334 (modify-phases %standard-phases
3335 (add-before 'configure 'chdir-src
3336 (lambda _ (chdir "src")))
3338 (lambda* (#:key build target configure-flags
3339 #:allow-other-keys #:rest args)
3340 (let* ((configure (assoc-ref %standard-phases 'configure)))
3343 (list #:configure-flags
3344 (cons (string-append
3345 "--host=" (or target build))
3346 configure-flags)))))))
3347 (add-after 'build 'build-docs
3349 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3352 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3353 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3354 (and (system* "make" "check" "CHECKRUN=")
3355 (fold (lambda (filename result)
3357 (let ((size (stat:size (stat filename))))
3358 (when (not (zero? size))
3359 (format #t "~a size ~d; error indication~%"
3363 (find-files "test" ".*\\.err$")))))
3364 (add-after 'install 'install-docs
3365 (lambda* (#:key outputs #:allow-other-keys)
3366 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3367 (let* ((doc (assoc-ref outputs "doc"))
3368 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3369 (with-directory-excursion "docs"
3370 (for-each (lambda (base)
3371 (install-file (string-append base ".pdf") docdir)
3372 (copy-recursively base docdir)) ;html docs
3373 '("HYPRE_usr_manual"
3374 "HYPRE_ref_manual")))
3376 (home-page "http://www.llnl.gov/casc/hypre/")
3377 (synopsis "Library of solvers and preconditioners for linear equations")
3379 "HYPRE is a software library of high performance preconditioners and
3380 solvers for the solution of large, sparse linear systems of equations. It
3381 features multigrid solvers for both structured and unstructured grid
3383 (license license:lgpl2.1)))
3385 (define-public hypre-openmpi
3386 (package (inherit hypre)
3387 (name "hypre-openmpi")
3390 ,@(package-inputs hypre)))
3392 (substitute-keyword-arguments (package-arguments hypre)
3393 ((#:configure-flags flags)
3395 ,@(delete "--without-MPI" ,flags)))))
3396 (synopsis "Parallel solvers and preconditioners for linear equations")
3398 "HYPRE is a software library of high performance preconditioners and
3399 solvers for the solution of large, sparse linear systems of equations on
3400 parallel computers. It features parallel multigrid solvers for both
3401 structured and unstructured grid problems.")))
3403 (define-public matio
3410 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3411 "matio-" version ".tar.gz"))
3414 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3415 (build-system gnu-build-system)
3419 (home-page "http://matio.sourceforge.net/")
3420 (synopsis "Library for reading and writing MAT files")
3421 (description "Matio is a library for reading and writing MAT files. It
3422 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3423 (license license:bsd-2)))
3430 (origin (method url-fetch)
3431 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3432 "download/" version "/Vc-" version ".tar.gz"))
3435 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
3436 (build-system cmake-build-system)
3439 '("-DBUILD_TESTING=ON")))
3440 (synopsis "SIMD vector classes for C++")
3441 (description "Vc provides portable, zero-overhead C++ types for explicitly
3442 data-parallel programming. It is a library designed to ease explicit
3443 vectorization of C++ code. Its types enable explicitly stating data-parallel
3444 operations on multiple values. The parallelism is therefore added via the type
3445 system. Vc has an intuitive API and provides portability between different
3446 compilers and compiler versions as well as portability between different vector
3447 instruction sets. Thus, an application written with Vc can be compiled for:
3450 @item SSE2 up to SSE4.2 or SSE4a
3453 @item NEON (in development)
3454 @item NVIDIA GPUs / CUDA (in development)
3456 (home-page "https://github.com/VcDevel/Vc")
3457 ;; "No support_???.cpp file exists for this architecture."
3458 (supported-systems '("x86_64-linux" "i686-linux"))
3459 (license license:bsd-3)))
3461 (define-public reducelcs
3462 ;; This is the last commit which is available upstream, no
3463 ;; release happened since 2010.
3464 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3468 (version (string-append "1.0-" revision "." (string-take commit 7)))
3473 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3475 (file-name (string-append name "-" version "-checkout"))
3478 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3479 (build-system gnu-build-system)
3481 `(("openlibm" ,openlibm)))
3483 `(#:tests? #f ; no tests
3485 (modify-phases %standard-phases
3486 (delete 'configure) ; No configure script exists.
3487 (replace 'install ; No install phase exists.
3488 (lambda* (#:key outputs #:allow-other-keys)
3489 (let* ((out (assoc-ref outputs "out"))
3490 (bin (string-append out "/bin")))
3491 (install-file "Approximation" bin)
3492 (install-file "CollectResults" bin)
3493 (install-file "GenerateInstances" bin)
3495 (synopsis "Approximate Longest Commons Subsequence computation tool")
3497 "@code{reduceLCS} is an implementation of the Reduce-Expand
3498 algorithm for LCS. It is a fast program to compute the approximate
3499 Longest Commons Subsequence of a set of strings.")
3500 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3501 (license license:gpl3+))))
3503 (define-public jacal
3510 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3513 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3514 (patches (search-patches "jacal-fix-texinfo.patch"))))
3515 (build-system gnu-build-system)
3518 (modify-phases %standard-phases
3519 (add-before 'build 'pre-build
3520 ;; Don't use upstream's script - it really doesn't fit into
3521 ;; Guix's functional paradigm.
3522 (lambda* (#:key inputs outputs #:allow-other-keys)
3523 (substitute* "Makefile"
3524 (("^install: install-script") "install: "))))
3525 (add-after 'install 'post-install
3526 ;; Instead, we provide our own simplified script.
3527 (lambda* (#:key inputs outputs #:allow-other-keys)
3528 (let ((wrapper (string-append (assoc-ref outputs "out")
3530 (format (open wrapper (logior O_WRONLY O_CREAT))
3531 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3532 "-e '(slib:load \"~a/lib/jacal/math\") "
3535 (assoc-ref inputs "scm")
3536 (assoc-ref outputs "out"))
3537 (chmod wrapper #o555))))
3539 (lambda* (#:key inputs outputs #:allow-other-keys)
3540 (zero? (system* "./configure"
3541 (string-append "--prefix="
3542 (assoc-ref outputs "out")))))))))
3543 (inputs `(("scm" ,scm)))
3544 (native-inputs `(("unzip" ,unzip)
3545 ("texinfo" ,texinfo)))
3546 (synopsis "Symbolic mathematics system")
3547 (description "GNU JACAL is an interactive symbolic mathematics program based on
3548 Scheme. It manipulate and simplify a range of mathematical expressions such
3549 as equations, scalars, vectors, and matrices.")
3550 (home-page "https://www.gnu.org/software/jacal/")
3551 (license license:gpl3+)))
3560 "https://github.com/Z3Prover/z3/archive/z3-"
3564 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3565 (build-system cmake-build-system)
3568 (list "-DBUILD_PYTHON_BINDINGS=true"
3569 "-DINSTALL_PYTHON_BINDINGS=true"
3570 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3572 "/lib/python2.7/site-packages")
3573 (string-append "-DCMAKE_INSTALL_LIBDIR="
3578 (modify-phases %standard-phases
3579 (add-before 'configure 'bootstrap
3582 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3583 (add-before 'check 'make-test-z3
3585 ;; Build the test suite executable.
3586 (zero? (system* "make" "test-z3" "-j"
3587 (number->string (parallel-job-count))))))
3590 ;; Run all the tests that don't require arguments.
3591 (zero? (system* "./test-z3" "/a")))))))
3593 `(("python" ,python-2)))
3594 (synopsis "Theorem prover")
3595 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3596 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3597 (home-page "https://github.com/Z3Prover/z3")
3598 (license license:expat)))
3600 (define-public cubicle
3606 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3610 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3611 (build-system gnu-build-system)
3614 ("which" ,(@@ (gnu packages base) which))))
3618 `(#:configure-flags (list "--with-z3")
3621 (modify-phases %standard-phases
3622 (add-before 'configure 'configure-for-release
3624 (substitute* "Makefile.in"
3625 (("SVNREV=") "#SVNREV="))))
3626 (add-before 'configure 'fix-/bin/sh
3628 (substitute* "configure"
3629 (("/bin/sh") (which "sh")))))
3630 (add-before 'configure 'fix-smt-z3wrapper.ml
3632 (substitute* "Makefile.in"
3633 (("\\\\n") "")))))))
3634 (home-page "http://cubicle.lri.fr/")
3635 (synopsis "Model checker for array-based systems")
3636 (description "Cubicle is a model checker for verifying safety properties
3637 of array-based systems. This is a syntactically restricted class of
3638 parametrized transition systems with states represented as arrays indexed by
3639 an arbitrary number of processes. Cache coherence protocols and mutual
3640 exclusion algorithms are typical examples of such systems.")
3641 (license license:asl2.0)))