1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
28 ;;; This file is part of GNU Guix.
30 ;;; GNU Guix is free software; you can redistribute it and/or modify it
31 ;;; under the terms of the GNU General Public License as published by
32 ;;; the Free Software Foundation; either version 3 of the License, or (at
33 ;;; your option) any later version.
35 ;;; GNU Guix is distributed in the hope that it will be useful, but
36 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 ;;; GNU General Public License for more details.
40 ;;; You should have received a copy of the GNU General Public License
41 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43 (define-module (gnu packages maths)
44 #:use-module (ice-9 regex)
45 #:use-module (gnu packages)
46 #:use-module ((guix licenses) #:prefix license:)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix utils)
51 #:use-module (guix build utils)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system ocaml)
55 #:use-module (guix build-system r)
56 #:use-module (guix build-system ruby)
57 #:use-module (gnu packages algebra)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages bison)
60 #:use-module (gnu packages boost)
61 #:use-module (gnu packages check)
62 #:use-module (gnu packages cmake)
63 #:use-module (gnu packages compression)
64 #:use-module (gnu packages curl)
65 #:use-module (gnu packages cyrus-sasl)
66 #:use-module (gnu packages documentation)
67 #:use-module (gnu packages elf)
68 #:use-module (gnu packages flex)
69 #:use-module (gnu packages fltk)
70 #:use-module (gnu packages fontutils)
71 #:use-module (gnu packages gettext)
72 #:use-module (gnu packages gcc)
73 #:use-module (gnu packages gd)
74 #:use-module (gnu packages ghostscript)
75 #:use-module (gnu packages graphviz)
76 #:use-module (gnu packages gtk)
77 #:use-module (gnu packages image)
78 #:use-module (gnu packages java)
79 #:use-module (gnu packages less)
80 #:use-module (gnu packages lisp)
81 #:use-module (gnu packages logging)
82 #:use-module (gnu packages lua)
83 #:use-module (gnu packages gnome)
84 #:use-module (gnu packages guile)
85 #:use-module (gnu packages xorg)
86 #:use-module (gnu packages gl)
87 #:use-module (gnu packages imagemagick)
88 #:use-module (gnu packages m4)
89 #:use-module (gnu packages mpi)
90 #:use-module (gnu packages multiprecision)
91 #:use-module (gnu packages netpbm)
92 #:use-module (gnu packages ocaml)
93 #:use-module (gnu packages pcre)
94 #:use-module (gnu packages popt)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages pkg-config)
97 #:use-module (gnu packages python)
98 #:use-module (gnu packages python-web)
99 #:use-module (gnu packages qt)
100 #:use-module (gnu packages readline)
101 #:use-module (gnu packages ruby)
102 #:use-module (gnu packages tbb)
103 #:use-module (gnu packages scheme)
104 #:use-module (gnu packages shells)
105 #:use-module (gnu packages tcl)
106 #:use-module (gnu packages texinfo)
107 #:use-module (gnu packages tex)
108 #:use-module (gnu packages tls)
109 #:use-module (gnu packages version-control)
110 #:use-module (gnu packages wxwidgets)
111 #:use-module (gnu packages xml)
112 #:use-module (srfi srfi-1))
120 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
122 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
123 (build-system gnu-build-system)
124 (inputs `(("gtk+" ,gtk+)
125 ("libxml2" ,libxml2)))
126 (native-inputs `(("pkg-config" ,pkg-config)))
127 (synopsis "Natural deduction first-order logic interface")
128 (description "Aris is a program for performing logical proofs. It supports
129 propositional and predicate logic, as well as Boolean algebra and
130 arithmetical logic. In addition to its predefined inference and equivalence
131 rules, Aris also supports references to older proofs. Its use of standard
132 logical symbols and its natural deduction interface make it easy to use for
134 (license license:gpl3+)
135 (home-page "https://www.gnu.org/software/aris/")))
137 (define-public c-graph
143 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
146 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
147 (build-system gnu-build-system)
149 `(("fortran" ,gfortran)))
150 (synopsis "Visualizing and demonstrating convolution")
152 "GNU C-Graph is a tool for demonstrating the theory of convolution.
153 Thus, it can serve as an excellent aid to students of signal and systems
154 theory in visualizing the convolution process. Rather than forcing the
155 student to write code, the program offers an intuitive interface with
156 interactive dialogs to guide them.")
157 (license license:gpl3+)
158 (home-page "https://www.gnu.org/software/c-graph/")))
167 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
168 version "/coda-" version ".tar.gz"))
170 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
171 (patches (search-patches "coda-use-system-libs.patch"))
172 (modules '((guix build utils)))
174 ;; Make sure we don't use the bundled software.
175 '(for-each (lambda (d)
176 (delete-file-recursively (string-append "libcoda/" d)))
177 '("zlib" "pcre" "expat")))))
179 `(("fortran" ,gfortran)
181 ("python-numpy" ,python-numpy)))
188 (build-system gnu-build-system)
190 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
191 "LIBS= -lz -lpcre -lexpat")))
192 (synopsis "A common interface to various earth observation data formats")
194 "The Common Data Access toolbox (CODA) provides a set of interfaces for
195 reading remote sensing data from earth observation data files. It consists of
196 command line applications and interfaces to the C, Fortran, Python, and Java
197 programming languages.")
198 (home-page "https://stcorp.nl/coda")
199 (license license:gpl2+)))
207 (uri (string-append "mirror://gnu/units/units-" version
210 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
211 (build-system gnu-build-system)
213 `(("readline" ,readline)
214 ("python" ,python-wrapper) ;for 'units_cur' script
215 ("python-requests" ,python-requests)))
217 `(#:phases (modify-phases %standard-phases
218 (add-after 'install 'wrap-units_cur
219 (lambda* (#:key outputs #:allow-other-keys)
220 (let* ((out (assoc-ref outputs "out"))
221 (bin (string-append out "/bin")))
222 (wrap-program (string-append bin "/units_cur")
223 `("PYTHONPATH" ":" prefix
224 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
226 (synopsis "Conversion between thousands of scales")
228 "GNU Units converts numeric quantities between units of measure. It
229 can handle scale changes through adaptive usage of standard scale
230 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
231 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
232 enough to be used effectively as a scientific calculator.")
233 (license license:gpl3+)
234 (home-page "https://www.gnu.org/software/units/")))
236 (define-public double-conversion
238 (name "double-conversion")
243 "https://github.com/floitsch/double-conversion/archive/v"
245 (file-name (string-append name "-" version ".tar.gz"))
248 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
249 (build-system cmake-build-system)
251 '(#:test-target "test"
252 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
253 "-DBUILD_TESTING=ON")))
254 (home-page "https://github.com/floitsch/double-conversion")
255 (synopsis "Conversion routines for IEEE doubles")
257 "The double-conversion library provides binary-decimal and decimal-binary
258 routines for IEEE doubles. The library consists of efficient conversion
259 routines that have been extracted from the V8 JavaScript engine.")
260 (license license:bsd-3)))
262 (define-public dionysus
268 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
272 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
273 (build-system gnu-build-system)
274 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
275 (synopsis "Local search for universal constants and scientific values")
277 "GNU Dionysus is a convenient system for quickly retrieving the values of
278 mathematical constants used in science and engineering. Values can be
279 searched using a simple command-line tool, choosing from three databases:
280 universal constants, atomic numbers, and constants related to
282 (license license:gpl3+)
283 (home-page "https://www.gnu.org/software/dionysus/")))
291 (uri (string-append "mirror://gnu/gsl/gsl-"
295 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
296 (patches (search-patches "gsl-test-i686.patch"))))
297 (build-system gnu-build-system)
299 `(;; Currently there are numerous tests that fail on "exotic"
300 ;; architectures such as aarch64 and ppc64le.
301 ,@(if (string-prefix? "aarch64-linux"
302 (or (%current-target-system) (%current-system)))
305 (home-page "https://www.gnu.org/software/gsl/")
306 (synopsis "Numerical library for C and C++")
308 "The GNU Scientific Library is a library for numerical analysis in C
309 and C++. It includes a wide range of mathematical routines, with over 1000
310 functions in total. Subject areas covered by the library include:
311 differential equations, linear algebra, Fast Fourier Transforms and random
313 (license license:gpl3+)))
315 (define-public ocaml-gsl
324 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
325 version"/gsl-ocaml-" version ".tar.gz"))
328 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
329 (build-system ocaml-build-system)
332 (home-page "https://mmottl.github.io/gsl-ocaml")
333 (synopsis "Bindings to the GNU Scientific Library")
335 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
336 the OCaml language.")
337 (license license:gpl3+)))
339 (define-public ocaml4.01-gsl
340 (package-with-ocaml4.01 ocaml-gsl))
349 (uri (string-append "mirror://gnu/glpk/glpk-"
353 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
354 (build-system gnu-build-system)
358 `(#:configure-flags '("--with-gmp")))
359 (home-page "https://www.gnu.org/software/glpk/")
360 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
362 "GLPK is a C library for solving large-scale linear programming (LP),
363 mixed integer programming (MIP), and other related problems. It supports the
364 GNU MathProg modeling language, a subset of the AMPL language, and features a
365 translator for the language. In addition to the C library, a stand-alone
366 LP/MIP solver is included in the package.")
367 (license license:gpl3+)))
376 (uri (string-append "http://www.4ti2.de/version_" version
377 "/4ti2-" version ".tar.gz"))
380 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
381 (build-system gnu-build-system)
383 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
387 (home-page "http://www.4ti2.de/")
388 (synopsis "Mathematical tool suite for problems on linear spaces")
390 "4ti2 implements algorithms for solving algebraic, geometric and
391 combinatorial problems on linear spaces. Among others, it solves systems
392 of linear equations, computes extreme rays of polyhedral cones, solves
393 integer programming problems and computes Markov bases for statistics.")
394 (license license:gpl2+)))
396 (define-public cddlib
403 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
404 (string-delete #\. version) ".tar.gz"))
407 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
408 (build-system gnu-build-system)
411 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
412 (synopsis "Library for convex hulls and extreme rays of polyhedra")
414 "The C-library cddlib implements the Double Description Method of
415 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
416 rays of a general convex polyhedron given by a system of linear inequalities
417 in arbitrary dimension. It can also be used for the converse operation of
418 computing convex hulls.")
419 (license license:gpl2+)))
421 (define-public arpack-ng
425 (home-page "https://github.com/opencollab/arpack-ng")
429 (uri (string-append home-page "/archive/" version ".tar.gz"))
430 (file-name (string-append name "-" version ".tar.gz"))
433 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
434 (build-system gnu-build-system)
436 '(#:phases (modify-phases %standard-phases
437 (add-after 'unpack 'autoreconf
439 (invoke "autoreconf" "-vfi"))))))
441 `(("autoconf" ,autoconf)
442 ("automake" ,automake)
443 ("libtool" ,libtool)))
446 ("fortran" ,gfortran)))
447 (synopsis "Fortran subroutines for solving eigenvalue problems")
449 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
450 large scale eigenvalue problems.")
451 (license (license:non-copyleft "file://COPYING"
452 "See COPYING in the distribution."))))
454 (define-public arpack-ng-3.3.0
458 (name (package-name arpack-ng))
459 (home-page (package-home-page arpack-ng))
463 (uri (string-append home-page "/archive/" version ".tar.gz"))
464 (file-name (string-append name "-" version ".tar.gz"))
467 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
469 (define-public arpack-ng-openmpi
470 (package (inherit arpack-ng)
471 (name "arpack-ng-openmpi")
474 ,@(package-inputs arpack-ng)))
475 (arguments `(#:configure-flags '("--enable-mpi")))
476 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
478 (define-public lapack
485 (uri (string-append "http://www.netlib.org/lapack/lapack-"
489 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
490 (build-system cmake-build-system)
491 (home-page "http://www.netlib.org/lapack/")
492 (inputs `(("fortran" ,gfortran)
493 ("python" ,python-2)))
495 `(#:configure-flags (list
496 "-DBUILD_SHARED_LIBS:BOOL=YES"
499 ;; Build the 'LAPACKE_clatms' functions.
500 "-DLAPACKE_WITH_TMG=ON")
502 (modify-phases %standard-phases
503 (add-before 'check 'patch-python
504 (lambda* (#:key inputs #:allow-other-keys)
505 (let ((python (assoc-ref inputs "python")))
506 (substitute* "lapack_testing.py"
507 (("/usr/bin/env python") python)))
509 (synopsis "Library for numerical linear algebra")
511 "LAPACK is a Fortran 90 library for solving the most commonly occurring
512 problems in numerical linear algebra.")
513 (license (license:non-copyleft "file://LICENSE"
514 "See LICENSE in the distribution."))))
516 (define-public lapack-3.5
523 (uri (string-append "http://www.netlib.org/lapack/lapack-"
527 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
529 (define-public scalapack
536 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
540 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
541 (build-system cmake-build-system)
544 ("fortran" ,gfortran)
545 ("lapack" ,lapack))) ;for testing only
547 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
548 (home-page "http://www.netlib.org/scalapack/")
549 (synopsis "Library for scalable numerical linear algebra")
551 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
552 routines on parallel distributed memory machines. ScaLAPACK solves dense and
553 banded linear systems, least squares problems, eigenvalue problems, and
554 singular value problems.")
555 (license (license:bsd-style "file://LICENSE"
556 "See LICENSE in the distribution."))))
558 (define-public gnuplot
564 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
569 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
570 (build-system gnu-build-system)
571 (inputs `(("readline" ,readline)
577 `(("pkg-config" ,pkg-config)
578 ("texlive" ,texlive-tiny)))
579 (home-page "http://www.gnuplot.info")
580 (synopsis "Command-line driven graphing utility")
581 (description "Gnuplot is a portable command-line driven graphing
582 utility. It was originally created to allow scientists and students to
583 visualize mathematical functions and data interactively, but has grown to
584 support many non-interactive uses such as web scripting. It is also used as a
585 plotting engine by third-party applications like Octave.")
586 ;; X11 Style with the additional restriction that derived works may only be
587 ;; distributed as patches to the original.
588 (license (license:fsf-free
589 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
598 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
600 (file-name (string-append name "-" version ".tar.gz"))
603 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
605 `(("fortran" ,gfortran)))
606 (build-system gnu-build-system)
607 (synopsis "General Cartographic Transformation Package (GCTP)")
609 "The General Cartographic Transformation Package (GCTP) is a system of
610 software routines designed to permit the transformation of coordinate pairs
611 from one map projection to another. The GCTP is the standard computer
612 software used by the National Mapping Division for map projection
614 (home-page "https://github.com/OkoSanto/GCTP")
615 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
624 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
625 version "/src/hdf-" version ".tar.bz2"))
627 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
628 (patches (search-patches "hdf4-architectures.patch"
629 "hdf4-reproducibility.patch"
630 "hdf4-shared-fortran.patch"))))
631 (build-system gnu-build-system)
633 `(("gfortran" ,gfortran)
638 ("libjpeg" ,libjpeg)))
640 `(#:parallel-tests? #f
641 #:configure-flags '("--enable-shared")
643 (modify-phases %standard-phases
644 ;; This is inspired by two of Debian's patches.
645 (add-before 'configure 'add-more-aarch64-support
647 (substitute* '("mfhdf/ncgen/ncgen.l"
648 "mfhdf/ncgen/ncgenyy.c"
649 "mfhdf/libsrc/netcdf.h.in")
650 (("AIX5L64") "__aarch64__"))
652 (add-before 'configure 'patchbuild
655 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
657 (("/bin/mkdir") "mkdir"))
658 (substitute* (find-files "." "^Makefile\\.in$")
659 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
660 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
661 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
662 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
663 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
665 (add-after 'configure 'patch-settings
667 ;; libhdf4.settings contains the full path of the
668 ;; compilers used, and its contents are included in
669 ;; .so-files. We truncate the hashes to avoid
670 ;; unnecessary store references to those compilers:
671 (substitute* "libhdf4.settings"
672 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
673 (string-append prefix (string-take hash 10) "...")))
676 (home-page "https://www.hdfgroup.org/products/hdf4/")
678 "Library and multi-object file format for storing and managing data")
679 (description "HDF4 is a library and multi-object file format for storing
680 and managing data between machines. HDF4 is an older hierarchical data format,
681 incompatible with HDF5.")
683 (license:non-copyleft
684 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
686 (define-public hdf4-alt
691 (substitute-keyword-arguments (package-arguments hdf4)
692 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
694 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
703 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
704 "hdf5-" (version-major+minor version)
705 "/hdf5-" version "/src/hdf5-"
707 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
710 (take (string-split version #\.) 2))
711 "/src/hdf5-" version ".tar.bz2")))
713 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
714 (patches (list (search-patch "hdf5-config-date.patch")))))
715 (build-system gnu-build-system)
719 `(("gfortran" ,gfortran)))
720 (outputs '("out" ; core library
721 "fortran")) ; fortran interface
723 `(;; Some of the users, notably Flann, need the C++ interface.
724 #:configure-flags '("--enable-cxx"
726 "--enable-fortran2003")
727 ;; Use -fPIC to allow the R bindings to link with the static libraries
728 #:make-flags (list "CFLAGS=-fPIC"
731 (modify-phases %standard-phases
732 (add-before 'configure 'patch-configure
733 (lambda* (#:key outputs #:allow-other-keys)
734 (substitute* "configure"
736 (substitute* "fortran/src/Makefile.in"
737 (("libhdf5_fortran_la_LDFLAGS =")
738 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
739 (assoc-ref outputs "fortran") "/lib")))
740 (substitute* "hl/fortran/src/Makefile.in"
741 (("libhdf5hl_fortran_la_LDFLAGS =")
742 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
743 (assoc-ref outputs "fortran") "/lib")))
745 (add-after 'configure 'patch-settings
747 ;; libhdf5.settings contains the full path of the
748 ;; compilers used, and its contents are included in
749 ;; libhdf5.so. We truncate the hashes to avoid
750 ;; unnecessary store references to those compilers:
751 (substitute* "src/libhdf5.settings"
752 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
753 (string-append prefix (string-take hash 10) "..."))
754 ;; Don't record the build-time kernel version to make the
755 ;; settings file reproducible.
756 (("Uname information:.*")
757 "Uname information: Linux\n"))
759 (add-after 'install 'patch-references
760 (lambda* (#:key inputs outputs #:allow-other-keys)
761 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
762 (zlib (assoc-ref inputs "zlib")))
763 (substitute* (find-files bin "h5p?cc")
765 (string-append "-L" zlib "/lib " lib)))
767 (add-after 'install 'split
768 (lambda* (#:key inputs outputs #:allow-other-keys)
769 ;; Move all fortran-related files
770 (let* ((out (assoc-ref outputs "out"))
771 (bin (string-append out "/bin"))
772 (lib (string-append out "/lib"))
773 (inc (string-append out "/include"))
774 (ex (string-append out "/share/hdf5_examples/fortran"))
775 (fort (assoc-ref outputs "fortran"))
776 (fbin (string-append fort "/bin"))
777 (flib (string-append fort "/lib"))
778 (finc (string-append fort "/include"))
779 (fex (string-append fort "/share/hdf5_examples/fortran")))
784 (rename-file (string-append bin "/h5fc")
785 (string-append fbin "/h5fc"))
786 (for-each (lambda (file)
788 (string-append flib "/" (basename file))))
789 (find-files lib ".*fortran.*"))
790 (for-each (lambda (file)
792 (string-append finc "/" (basename file))))
793 (find-files inc ".*mod"))
794 (for-each (lambda (file)
796 (string-append fex "/" (basename file))))
797 (find-files ex ".*"))
798 (delete-file-recursively ex))
800 (home-page "http://www.hdfgroup.org")
801 (synopsis "Management suite for extremely large and complex data")
802 (description "HDF5 is a suite that makes possible the management of
803 extremely large and complex data collections.")
804 (license (license:x11-style
805 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
807 (define-public hdf-java
815 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
816 version "/src/CMake-hdfjava-" version ".tar.gz"))
818 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
819 (modules '((guix build utils)))
820 (snippet ; Make sure we don't use the bundled sources and binaries.
822 (for-each delete-file
823 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
824 "HDF4.tar.gz" "HDF5.tar.gz"))
825 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))))))
826 (build-system gnu-build-system)
828 `(("jdk" ,icedtea "jdk")
829 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
831 ("hamcrest-core" ,java-hamcrest-core)
832 ("junit" ,java-junit)
833 ("slf4j-simple" ,java-slf4j-simple)))
839 ("slf4j-api" ,java-slf4j-api)))
842 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
843 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
844 (assoc-ref %build-inputs "jdk") "/lib" )
845 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
846 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
849 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
850 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
851 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
852 (string-append "JPEGLIB="
853 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
857 (modify-phases %standard-phases
858 (add-before 'configure 'chdir-to-source
859 (lambda _ (chdir ,(string-append "hdfjava-" version))))
860 (add-before 'configure 'patch-build
861 (lambda* (#:key inputs outputs #:allow-other-keys)
862 (substitute* "configure"
863 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
864 (("/bin/cat") (which "cat")))
865 ;; Set classpath for compilation
866 (substitute* '("hdf/hdf5lib/Makefile.in"
867 "hdf/hdf5lib/exceptions/Makefile.in"
868 "hdf/hdflib/Makefile.in")
869 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
870 (string-append (assoc-ref inputs "slf4j-api")
871 "/share/java/slf4j-api.jar")))
872 ;; Replace outdated config.sub and config.guess:
873 (with-directory-excursion "config"
874 (for-each (lambda (file)
876 (string-append (assoc-ref inputs "automake")
877 "/share/automake-1.15/" file) file))
878 '("config.sub" "config.guess")))
879 (mkdir-p (string-append (assoc-ref outputs "out")))
880 ;; Set classpath for tests
881 (let* ((build-dir (getcwd))
882 (lib (string-append build-dir "/lib"))
883 (jhdf (string-append lib "/jhdf.jar"))
884 (jhdf5 (string-append lib "/jhdf5.jar"))
887 (string-append (assoc-ref inputs i)
888 "/share/java/" i ".jar"))
889 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
891 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
893 (substitute* '("test/hdf5lib/Makefile.in"
894 "test/hdf5lib/junit.sh.in"
895 "examples/runExample.sh.in")
897 (string-append (assoc-ref inputs "coreutils")
900 (string-append (assoc-ref inputs "coreutils")
902 (("CLASSPATH=[^\n]*")
903 (string-append "CLASSPATH=" class-path)))
904 (setenv "CLASSPATH" class-path))
906 (add-before 'check 'build-examples
908 (zero? (apply system* `("javac"
909 ,@(find-files "examples" ".*\\.java")))))))
913 #:parallel-tests? #f ))
914 (home-page "https://support.hdfgroup.org/products/java")
915 (synopsis "Java interface for the HDF4 and HDF5 libraries")
916 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
917 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
920 ;; BSD-style license:
921 (license (license:x11-style
922 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
923 /current/src/unpacked/COPYING"))))
925 (define-public hdf-eos2
932 (uri "ftp://edhs1.gsfc.nasa.gov\
933 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
935 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
936 (patches (search-patches "hdf-eos2-remove-gctp.patch"
937 "hdf-eos2-build-shared.patch"
938 "hdf-eos2-fortrantests.patch"))))
939 (build-system gnu-build-system)
941 `(("gfortran" ,gfortran)))
943 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
948 `( #:configure-flags '("--enable-install-include" "--enable-shared"
949 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
950 #:parallel-tests? #f))
951 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
952 (synopsis "HDF4-based data format for NASA's Earth Observing System")
953 (description "HDF-EOS2 is a software library built on HDF4 which supports
954 the construction of data structures used in NASA's Earth Observing
955 System (Grid, Point and Swath).")
957 ;; Source files carry a permissive license header.
958 (license (license:non-copyleft home-page))))
960 (define-public hdf-eos5
966 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
967 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
970 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
971 (patches (search-patches "hdf-eos5-build-shared.patch"
972 "hdf-eos5-remove-gctp.patch"
973 "hdf-eos5-fix-szip.patch"
974 "hdf-eos5-fortrantests.patch"))))
976 `(("gfortran" ,gfortran)))
977 (build-system gnu-build-system)
983 `(#:configure-flags '("--enable-install-include" "--enable-shared"
984 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
985 #:parallel-tests? #f))
986 (synopsis "HDF5-based data format for NASA's Earth Observing System")
988 "HDF-EOS5 is a software library built on HDF5 to support the construction
989 of data structures used in NASA's Earth Observing System (Grid, Point and
991 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
993 ;; Source files carry a permissive license header.
994 (license (license:non-copyleft home-page))))
996 (define-public hdf5-parallel-openmpi
997 (package (inherit hdf5)
998 (name "hdf5-parallel-openmpi")
1001 ,@(package-inputs hdf5)))
1003 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1004 ,@(package-arguments hdf5))
1006 `(modify-phases ,phases
1007 (add-before 'check 'patch-tests
1009 ;; OpenMPI's mpirun will exit with non-zero status if it
1010 ;; detects an "abnormal termination", i.e. any process not
1011 ;; calling MPI_Finalize(). Since the test is explicitely
1012 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1013 ;; H5C_flush_cache from being called, mpirun will always
1014 ;; complain, so turn this test off.
1015 (substitute* "testpar/Makefile"
1016 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1017 (string-append front back "\n")))
1018 (substitute* "tools/h5diff/testph5diff.sh"
1019 (("/bin/sh") (which "sh")))
1021 (synopsis "Management suite for data with parallel IO support")))
1023 (define-public h5check
1030 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1031 "h5check/src/h5check-" version ".tar.gz"))
1034 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1035 (build-system gnu-build-system)
1036 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1037 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1038 (synopsis "HDF5 format checker")
1039 (description "@code{h5check} is a validation tool for verifying that an
1040 HDF5 file is encoded according to the HDF File Format Specification.")
1041 (license (license:x11-style "file://COPYING"))))
1049 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1054 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1055 (build-system cmake-build-system)
1056 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1057 (inputs `(("lapack" ,lapack)
1059 ;; FIXME: Even though the fonts are available dvips complains:
1060 ;; "Font cmmi10 not found; characters will be left blank."
1062 `(("texlive" ,texlive-tiny)
1063 ("ghostscript" ,ghostscript)
1064 ("doxygen" ,doxygen)))
1065 (home-page "http://itpp.sourceforge.net")
1066 (synopsis "C++ library of maths, signal processing and communication classes")
1067 (description "IT++ is a C++ library of mathematical, signal processing and
1068 communication classes and functions. Its main use is in simulation of
1069 communication systems and for performing research in the area of
1070 communications. The kernel of the library consists of generic vector and
1071 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1072 similar to MATLAB, GNU Octave or SciPy.")
1073 (license license:gpl3+)))
1075 (define-public netcdf
1082 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1083 "netcdf-" version ".tar.gz"))
1086 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1087 (patches (search-patches "netcdf-date-time.patch"
1088 "netcdf-tst_h_par.patch"))))
1089 (build-system gnu-build-system)
1092 ("doxygen" ,doxygen)
1093 ("graphviz" ,graphviz)))
1095 `(("hdf4" ,hdf4-alt)
1098 ("libjpeg" ,libjpeg)))
1100 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1102 #:phases (modify-phases %standard-phases
1103 (add-before 'configure 'fix-source-date
1105 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1106 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1107 ;; to '1st hour of the current day', and therefore makes the
1108 ;; package not reproducible.
1109 (substitute* "./configure"
1110 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1111 "date --date='@0'"))
1113 (add-after 'configure 'patch-settings
1115 ;; libnetcdf.settings contains the full filename of the compilers
1116 ;; used to build the library. We truncate the hashes of those
1117 ;; filenames to avoid unnecessary references to the corresponding
1119 (substitute* "libnetcdf.settings"
1120 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1121 (string-append prefix (string-take hash 10) "...")))
1124 #:parallel-tests? #f)) ;various race conditions
1125 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1126 (synopsis "Library for scientific data")
1127 (description "NetCDF is an interface for scientific data access and a
1128 software library that provides an implementation of the interface. The netCDF
1129 library defines a machine-independent format for representing scientific data.
1130 Together, the interface, library, and format support the creation, access, and
1131 sharing of scientific data.")
1132 (license (license:x11-style "file://COPYRIGHT"))))
1134 (define-public netcdf-parallel-openmpi
1135 (package (inherit netcdf)
1136 (name "netcdf-parallel-openmpi")
1139 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1140 (package-inputs netcdf))))
1141 ;; TODO: Replace pkg-config references in nc-config with absolute references
1143 (substitute-keyword-arguments (package-arguments netcdf)
1144 ((#:configure-flags flags)
1145 `(cons* "CC=mpicc" "CXX=mpicxx"
1146 "--enable-parallel-tests"
1147 ;; Shared libraries not supported with parallel IO.
1148 "--disable-shared" "--with-pic"
1151 (define-public netcdf-fortran
1153 (name "netcdf-fortran")
1158 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1162 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1163 (build-system gnu-build-system)
1165 `(#:parallel-tests? #f))
1167 `(("netcdf" ,netcdf)))
1169 `(("gfortran" ,gfortran)))
1170 (synopsis "Fortran interface for the netCDF library")
1171 (description (package-description netcdf))
1172 (home-page (package-home-page netcdf))
1173 (license (package-license netcdf))))
1175 (define-public nlopt
1181 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1184 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1185 (build-system gnu-build-system)
1187 `(;; Shared libraries are not built by default. They are required to
1188 ;; build the Guile, Octave, and Python bindings.
1189 #:configure-flags '("--enable-shared")
1192 (modify-phases %standard-phases
1193 (add-before 'configure 'set-libnlopt-file-name
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 ;; Make sure the Scheme module refers to the library by its
1196 ;; absolute file name (we cannot do that from a snippet
1197 ;; because the expansion of @libdir@ contains
1199 (let ((out (assoc-ref outputs "out")))
1200 (substitute* "swig/nlopt.scm.in"
1202 (string-append out "/lib/libnlopt")))
1204 (inputs `(("guile" ,guile-2.0)))
1205 (native-inputs `(("pkg-config" ,pkg-config)))
1206 (home-page "http://ab-initio.mit.edu/wiki/")
1207 (synopsis "Library for nonlinear optimization")
1208 (description "NLopt is a library for nonlinear optimization, providing a
1209 common interface for a number of different free optimization routines available
1210 online as well as original implementations of various other algorithms.")
1211 (license license:lgpl2.1+)))
1213 (define-public ipopt
1220 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1224 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1225 (modules '((guix build utils)))
1227 ;; Make sure we don't use the bundled software.
1228 '(delete-file-recursively "ThirdParty"))))
1229 (build-system gnu-build-system)
1231 '(#:phases (modify-phases %standard-phases
1232 (add-after 'install 'add--L-flags-in-ipopt.pc
1233 (lambda* (#:key inputs outputs #:allow-other-keys)
1234 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1235 ;; move it to "Libs.private" where it belongs, and add a
1236 ;; '-L' flag for LAPACK.
1237 (let ((out (assoc-ref outputs "out"))
1238 (lapack (assoc-ref inputs "lapack")))
1239 (substitute* (string-append out "/lib/pkgconfig/"
1241 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1242 (string-append "Libs: " before " " after "\n"
1243 "Libs.private: " before
1244 "-L" lapack "/lib -llapack -lblas "
1248 `(("gfortran" ,gfortran)))
1250 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1251 `(("lapack" ,lapack))) ;for both libblas and liblapack
1252 (home-page "http://www.coin-or.org")
1253 (synopsis "Large-scale nonlinear optimizer")
1255 "The Interior Point Optimizer (IPOPT) is a software package for
1256 large-scale nonlinear optimization. It provides C++, C, and Fortran
1258 (license license:epl1.0)))
1260 (define-public ceres
1262 (name "ceres-solver")
1264 (home-page "http://ceres-solver.org/")
1267 (uri (string-append home-page "ceres-solver-"
1271 "1kbxgab3q1vgyq7hjqasr1lji4b2sgn7ss351amklkb3jyhr1x0x"))))
1272 (build-system cmake-build-system)
1274 ;; TODO: Build HTML user documentation and install separately.
1275 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1276 "-DBUILD_SHARED_LIBS=ON")
1278 #:phases (modify-phases %standard-phases
1279 (add-before 'configure 'set-library-directory
1281 ;; Install libraries to lib/, not lib64/.
1282 (substitute* "internal/ceres/CMakeLists.txt"
1283 (("set\\(LIB_SUFFIX \"64\"\\)")
1284 "set(LIB_SUFFIX \"\")"))
1287 `(("pkg-config" ,pkg-config)))
1289 `(("glog" ,glog))) ;for #include <glog/glog.h>
1294 ("suitesparse" ,suitesparse)
1295 ("gflags" ,gflags)))
1296 (synopsis "C++ library for solving large optimization problems")
1298 "Ceres Solver is a C++ library for modeling and solving large,
1299 complicated optimization problems. It is a feature rich, mature and
1300 performant library which has been used in production since 2010. Ceres Solver
1301 can solve two kinds of problems:
1303 @item non-linear least squares problems with bounds constraints;
1304 @item general unconstrained optimization problems.
1306 (license license:bsd-3)))
1308 ;; For a fully featured Octave, users are strongly recommended also to install
1309 ;; the following packages: less, ghostscript, gnuplot.
1310 (define-public octave
1317 (uri (string-append "mirror://gnu/octave/octave-"
1321 "0pkkz1vazsh7ipffb09q0nc2jgx6q27pkkngygjij6jrpcly5zsp"))))
1322 (build-system gnu-build-system)
1324 `(("lapack" ,lapack)
1325 ("readline" ,readline)
1330 ("arpack" ,arpack-ng)
1333 ("fontconfig" ,fontconfig)
1334 ("freetype" ,freetype)
1341 ("texinfo" ,texinfo)
1342 ("graphicsmagick" ,graphicsmagick)))
1345 ("gfortran" ,gfortran)
1346 ("pkg-config" ,pkg-config)
1348 ;; The following inputs are not actually used in the build process.
1349 ;; However, the ./configure gratuitously tests for their existence and
1350 ;; assumes that programs not present at build time are also not, and
1351 ;; can never be, available at run time! If these inputs are therefore
1352 ;; not present, support for them will be built out. However, Octave
1353 ;; will still run without them, albeit without the features they
1356 ("ghostscript" ,ghostscript)
1357 ("gnuplot" ,gnuplot)))
1360 (list (string-append "--with-shell="
1361 (assoc-ref %build-inputs "bash")
1364 (modify-phases %standard-phases
1365 (add-after 'configure 'configure-makeinfo
1366 (lambda* (#:key inputs #:allow-other-keys)
1367 (substitute* "libinterp/corefcn/help.cc"
1368 (("Vmakeinfo_program = \"makeinfo\"")
1369 (string-append "Vmakeinfo_program = \""
1370 (assoc-ref inputs "texinfo")
1371 "/bin/makeinfo\"")))
1373 (home-page "https://www.gnu.org/software/octave/")
1374 (synopsis "High-level language for numerical computation")
1375 (description "GNU Octave is a high-level interpreted language that is
1376 specialized for numerical computations. It can be used for both linear and
1377 non-linear applications and it provides great support for visualizing results.
1378 Work may be performed both at the interactive command-line as well as via
1380 (license license:gpl3+)))
1382 (define-public opencascade-oce
1384 (name "opencascade-oce")
1390 "https://github.com/tpaviot/oce/archive/OCE-"
1393 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1396 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1397 (build-system cmake-build-system)
1400 (list "-DOCE_TESTING:BOOL=ON"
1401 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1402 "-DOCE_DRAW:BOOL=ON"
1403 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1404 (assoc-ref %outputs "out"))
1405 "-UCMAKE_INSTALL_RPATH")))
1407 `(("freetype" ,freetype)
1414 `(("python" ,python-wrapper)))
1415 (home-page "https://github.com/tpaviot/oce")
1416 (synopsis "Libraries for 3D modeling and numerical simulation")
1418 "Open CASCADE is a set of libraries for the development of applications
1419 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1420 C++ class libraries providing services for 3D surface and solid modeling, CAD
1421 data exchange, and visualization. It is used for development of specialized
1422 software dealing with 3D models in design (CAD), manufacturing (CAM),
1423 numerical simulation (CAE), measurement equipment (CMM), and quality
1424 control (CAQ) domains.
1426 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1427 patches, improvements, and experiments contributed by users over the official
1428 Open CASCADE library.")
1429 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1430 ; use of header files; see
1431 ; OCCT_LGPL_EXCEPTION.txt
1432 license:public-domain; files
1433 ; src/Standard/Standard_StdAllocator.hxx and
1434 ; src/NCollection/NCollection_StdAllocator.hxx
1435 license:expat; file src/OpenGl/OpenGl_glext.h
1436 license:bsd-3)))); test framework gtest
1445 (uri (string-append "http://gmsh.info/src/gmsh-"
1446 version "-source.tgz"))
1448 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1449 (modules '((guix build utils)))
1451 ;; Remove non-free METIS code
1452 '(delete-file-recursively "contrib/Metis"))))
1453 (build-system cmake-build-system)
1456 ("gfortran" ,gfortran)
1462 ("opencascade-oce" ,opencascade-oce)
1464 ("libxext" ,libxext)))
1466 `(("fontconfig" ,fontconfig)
1467 ("libxft" ,libxft)))
1469 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1470 "-DENABLE_BUILD_SHARED:BOOL=ON"
1471 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1472 (home-page "http://www.geuz.org/gmsh/")
1473 (synopsis "3D finite element grid generator")
1474 (description "Gmsh is a 3D finite element grid generator with a built-in
1475 CAD engine and post-processor. Its design goal is to provide a fast, light
1476 and user-friendly meshing tool with parametric input and advanced
1477 visualization capabilities. Gmsh is built around four modules: geometry,
1478 mesh, solver and post-processing. The specification of any input to these
1479 modules is done either interactively using the graphical user interface or in
1480 ASCII text files using Gmsh's own scripting language.")
1481 (license license:gpl2+)))
1483 (define-public maxflow
1490 (url "https://github.com/gerddie/maxflow.git")
1491 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1492 (file-name (string-append name "-" version "-checkout"))
1495 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1496 (build-system cmake-build-system)
1497 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1498 (synopsis "Library implementing Maxflow algorithm")
1499 (description "An implementation of the maxflow algorithm described in
1500 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1501 Energy Minimization in Computer Vision.\n
1502 Yuri Boykov and Vladimir Kolmogorov.\n
1503 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1505 (license license:gpl3+)))
1507 (define-public petsc
1514 ;; The *-lite-* tarball does not contain the *large* documentation
1515 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1516 "petsc-lite-" version ".tar.gz"))
1518 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1519 (build-system gnu-build-system)
1521 `(("python" ,python-2)))
1523 `(("gfortran" ,gfortran)
1525 ("superlu" ,superlu)
1526 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1527 ;; leaving out opengl, as configuration seems to only be for mac
1530 `(#:test-target "test"
1531 #:parallel-build? #f ;build is parallel by default
1536 ,(string-append "--with-superlu-include="
1537 (assoc-ref %build-inputs "superlu") "/include")
1538 ,(string-append "--with-superlu-lib="
1539 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1541 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1542 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1543 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1545 (modify-phases %standard-phases
1547 ;; PETSc's configure script is actually a python script, so we can't
1548 ;; run it with bash.
1549 (lambda* (#:key outputs (configure-flags '())
1551 (let* ((prefix (assoc-ref outputs "out"))
1552 (flags `(,(string-append "--prefix=" prefix)
1553 ,@configure-flags)))
1554 (format #t "build directory: ~s~%" (getcwd))
1555 (format #t "configure flags: ~s~%" flags)
1556 (zero? (apply system* "./configure" flags)))))
1557 (add-after 'configure 'clean-local-references
1558 (lambda* (#:key outputs #:allow-other-keys)
1559 (let ((out (assoc-ref outputs "out")))
1560 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1561 ;; Prevent build directory from leaking into compiled code
1563 ;; Scrub timestamp for reproducibility
1564 ((".*Libraries compiled on.*") ""))
1565 (substitute* (find-files "." "petscvariables")
1566 ;; Do not expose build machine characteristics, set to defaults.
1567 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1568 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1570 (add-after 'install 'clean-install
1571 ;; Try to keep installed files from leaking build directory names.
1572 (lambda* (#:key inputs outputs #:allow-other-keys)
1573 (let ((out (assoc-ref outputs "out")))
1574 (substitute* (map (lambda (file)
1575 (string-append out "/lib/petsc/conf/" file))
1576 '("petscvariables"))
1578 ;; Make compiler references point to the store
1579 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1580 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1581 (string-append "= " (which compiler))))
1582 ;; PETSc installs some build logs, which aren't necessary.
1583 (for-each (lambda (file)
1584 (let ((f (string-append out "/lib/petsc/conf/" file)))
1585 (when (file-exists? f)
1587 '("configure.log" "make.log" "gmake.log"
1588 "test.log" "error.log" "RDict.db"
1589 "PETScBuildInternal.cmake"
1590 ;; Once installed, should uninstall with Guix
1593 (home-page "http://www.mcs.anl.gov/petsc")
1594 (synopsis "Library to solve PDEs")
1595 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1596 data structures and routines for the scalable (parallel) solution of
1597 scientific applications modeled by partial differential equations.")
1598 (license (license:non-copyleft
1599 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1601 (define-public petsc-complex
1602 (package (inherit petsc)
1603 (name "petsc-complex")
1605 (substitute-keyword-arguments (package-arguments petsc)
1606 ((#:configure-flags cf)
1607 `(cons "--with-scalar-type=complex" ,cf))))
1608 (synopsis "Library to solve PDEs (with complex scalars)")))
1610 (define-public petsc-openmpi
1611 (package (inherit petsc)
1612 (name "petsc-openmpi")
1614 `(("openmpi" ,openmpi)
1615 ,@(package-inputs petsc)))
1617 (substitute-keyword-arguments (package-arguments petsc)
1618 ((#:configure-flags cf)
1619 ``("--with-mpiexec=mpirun"
1620 ,(string-append "--with-mpi-dir="
1621 (assoc-ref %build-inputs "openmpi"))
1622 ,@(delete "--with-mpi=0" ,cf)))))
1623 (synopsis "Library to solve PDEs (with MPI support)")))
1625 (define-public petsc-complex-openmpi
1626 (package (inherit petsc-complex)
1627 (name "petsc-complex-openmpi")
1629 `(("openmpi" ,openmpi)
1630 ,@(package-inputs petsc-complex)))
1632 (substitute-keyword-arguments (package-arguments petsc-complex)
1633 ((#:configure-flags cf)
1634 ``("--with-mpiexec=mpirun"
1635 ,(string-append "--with-mpi-dir="
1636 (assoc-ref %build-inputs "openmpi"))
1637 ,@(delete "--with-mpi=0" ,cf)))))
1638 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1640 (define-public slepc
1647 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1651 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1652 (build-system gnu-build-system)
1654 `(("python" ,python-2)))
1656 `(("arpack" ,arpack-ng)
1657 ("gfortran" ,gfortran)))
1659 `(("petsc" ,petsc)))
1661 `(#:parallel-build? #f ;build is parallel by default
1663 `(,(string-append "--with-arpack-dir="
1664 (assoc-ref %build-inputs "arpack") "/lib"))
1665 #:make-flags ;honor (parallel-job-count)
1666 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1668 (modify-phases %standard-phases
1670 ;; configure is a python script, so we can't run it with bash.
1671 (lambda* (#:key inputs outputs (configure-flags '())
1673 (let* ((prefix (assoc-ref outputs "out"))
1674 (flags `(,(string-append "--prefix=" prefix)
1675 ,@configure-flags)))
1676 (format #t "build directory: ~s~%" (getcwd))
1677 (format #t "configure flags: ~s~%" flags)
1678 (setenv "SLEPC_DIR" (getcwd))
1679 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1680 (apply invoke "./configure" flags))))
1681 (add-after 'install 'delete-doc
1682 ;; TODO: SLEPc installs HTML documentation alongside headers in
1683 ;; $out/include. We'd like to move them to share/doc, but delete
1684 ;; them for now, as they are incomplete and installing the complete
1685 ;; documentation is difficult.
1686 (lambda* (#:key outputs #:allow-other-keys)
1687 (let* ((out (assoc-ref outputs "out")))
1688 (for-each delete-file (find-files out "\\.html$")))))
1689 (add-after 'install 'clean-install
1690 ;; Clean up unnecessary build logs from installation.
1691 (lambda* (#:key outputs #:allow-other-keys)
1692 (let ((out (assoc-ref outputs "out")))
1693 (for-each (lambda (file)
1694 (let ((f (string-append out "/lib/slepc/conf/" file)))
1695 (when (file-exists? f)
1697 '("configure.log" "make.log" "gmake.log"
1698 "test.log" "error.log" "RDict.db"
1699 "uninstall.py"))))))))
1700 (home-page "http://slepc.upv.es")
1701 (synopsis "Scalable library for eigenproblems")
1702 (description "SLEPc is a software library for the solution of large sparse
1703 eigenproblems on parallel computers. It can be used for the solution of
1704 linear eigenvalue problems formulated in either standard or generalized form,
1705 as well as other related problems such as the singular value decomposition.
1706 The emphasis of the software is on methods and techniques appropriate for
1707 problems in which the associated matrices are sparse, for example, those
1708 arising after the discretization of partial differential equations.")
1709 (license license:bsd-2)))
1711 (define-public slepc-complex
1712 (package (inherit slepc)
1713 (name "slepc-complex")
1715 `(("petsc" ,petsc-complex)
1716 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1717 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1719 (define-public slepc-openmpi
1720 (package (inherit slepc)
1721 (name "slepc-openmpi")
1724 ("arpack" ,arpack-ng-openmpi)
1725 ,@(alist-delete "arpack" (package-inputs slepc))))
1727 `(("petsc" ,petsc-openmpi)
1728 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1729 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1731 (define-public slepc-complex-openmpi
1732 (package (inherit slepc-openmpi)
1733 (name "slepc-complex-openmpi")
1735 `(("petsc" ,petsc-complex-openmpi)
1736 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1737 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1739 (define-public mumps
1746 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1750 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1751 (patches (search-patches "mumps-build-parallelism.patch"))))
1752 (build-system gnu-build-system)
1754 `(("fortran" ,gfortran)
1755 ;; These are required for linking against mumps, but we let the user
1756 ;; declare the dependency.
1759 ("scotch" ,scotch)))
1761 `(#:modules ((ice-9 match)
1764 ,@%gnu-build-system-modules)
1766 (modify-phases %standard-phases
1768 (lambda* (#:key inputs #:allow-other-keys)
1769 (call-with-output-file "Makefile.inc"
1780 INCSEQ = -I$(topdir)/libseq
1781 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1782 LIBSEQNEEDED = libseqneeded~;
1786 AR = ar vr # rules require trailing space, ugh...
1788 LIBBLAS = -L~a -lopenblas~@[
1789 SCALAP = -L~a -lscalapack~]
1790 LIBOTHERS = -pthread
1793 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1797 LIBS = $(SCALAP) $(LIBSEQ)
1798 LPORDDIR = $(topdir)/PORD/lib
1799 IPORD = -I$(topdir)/PORD/include
1800 LPORD = -L$(LPORDDIR) -lpord
1801 ORDERINGSF = -Dpord~@[
1803 IMETIS = -I$(METISDIR)/include
1804 LMETIS = -L$(METISDIR)/lib -lmetis
1805 ORDERINGSF += -Dmetis~]~@[~:{
1807 ISCOTCH = -I$(SCOTCHDIR)/include
1808 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1809 ORDERINGSF += ~a~}~]
1810 ORDERINGSC = $(ORDERINGSF)
1811 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1812 IORDERINGSF = $(ISCOTCH)
1813 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1814 (assoc-ref inputs "mpi")
1815 (assoc-ref inputs "blas")
1816 (assoc-ref inputs "scalapack")
1817 (assoc-ref inputs "metis")
1818 (match (list (assoc-ref inputs "pt-scotch")
1819 (assoc-ref inputs "scotch"))
1823 `((,scotch "" "-Dscotch")))
1826 "-lptesmumps -lptscotch -lptscotcherr "
1827 "-Dptscotch")))))))))
1829 ;; By default only the d-precision library is built. Make with "all"
1830 ;; target so that all precision libraries and examples are built.
1832 (zero? (system* "make" "all"
1833 (format #f "-j~a" (parallel-job-count))))))
1835 ;; Run the simple test drivers, which read test input from stdin:
1836 ;; from the "real" input for the single- and double-precision
1837 ;; testers, and from the "cmplx" input for complex-precision
1838 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1839 ;; package to prefix execution with "mpirun".
1840 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1841 (with-directory-excursion "examples"
1844 (let ((tester (apply open-pipe*
1847 ,(string-append "./" prec
1849 (input (open-input-file
1850 (string-append "input_simpletest_" type))))
1852 (dump-port input tester)
1854 (zero? (close-pipe tester)))))
1856 '("real" "real" "cmplx" "cmplx")))))
1858 (lambda* (#:key outputs #:allow-other-keys)
1859 (let* ((out (assoc-ref outputs "out"))
1860 (libdir (string-append out "/lib")))
1861 (copy-recursively "lib" libdir)
1862 (copy-recursively "include" (string-append out "/include"))
1863 (when (file-exists? "libseq/libmpiseq.a")
1864 (install-file "libseq/libmpiseq.a" libdir))
1866 (home-page "http://mumps.enseeiht.fr")
1867 (synopsis "Multifrontal sparse direct solver")
1869 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1870 sparse system of linear equations A x = b using Guassian elimination.")
1871 (license license:cecill-c)))
1873 (define-public mumps-metis
1874 (package (inherit mumps)
1875 (name "mumps-metis")
1877 (alist-delete "scotch" (package-inputs mumps)))))
1879 (define-public mumps-openmpi
1880 (package (inherit mumps)
1881 (name "mumps-openmpi")
1884 ("scalapack" ,scalapack)
1885 ("pt-scotch" ,pt-scotch)
1886 ,@(alist-delete "scotch" (package-inputs mumps))))
1888 (substitute-keyword-arguments (package-arguments mumps)
1890 `(modify-phases ,phases
1894 ((assoc-ref ,phases 'check)
1895 #:exec-prefix '("mpirun" "-n" "2"))))))))
1896 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1898 (define-public mumps-metis-openmpi
1899 (package (inherit mumps-openmpi)
1900 (name "mumps-metis-openmpi")
1902 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1904 (define-public r-quadprog
1911 (uri (cran-uri "quadprog" version))
1914 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1915 (build-system r-build-system)
1917 `(("gfortran" ,gfortran)))
1918 (home-page "https://cran.r-project.org/web/packages/quadprog")
1919 (synopsis "Functions to solve quadratic programming problems")
1921 "This package contains routines and documentation for solving quadratic
1922 programming problems.")
1923 (license license:gpl3+)))
1925 (define-public r-pracma
1931 (uri (cran-uri "pracma" version))
1933 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
1934 (build-system r-build-system)
1936 `(("r-quadprog" ,r-quadprog)))
1937 (home-page "https://cran.r-project.org/web/packages/pracma")
1938 (synopsis "Practical numerical math functions")
1939 (description "This package provides functions for numerical analysis and
1940 linear algebra, numerical optimization, differential equations, plus some
1941 special functions. It uses Matlab function names where appropriate to simplify
1943 (license license:gpl3+)))
1945 (define-public ruby-asciimath
1947 (name "ruby-asciimath")
1952 (uri (rubygems-uri "asciimath" version))
1955 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
1956 (build-system ruby-build-system)
1959 (modify-phases %standard-phases
1961 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
1962 (add-after 'unpack 'patch-remove-spurious-backslashes
1964 (substitute* "spec/parser_spec.rb"
1968 `(("bundler" ,bundler)
1969 ("ruby-rspec" ,ruby-rspec)))
1970 (synopsis "AsciiMath parsing and conversion library")
1972 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
1973 easy-to-write markup language for mathematics.")
1974 (home-page "https://github.com/asciidoctor/asciimath")
1975 (license license:expat)))
1977 (define-public superlu
1984 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1985 "superlu_" version ".tar.gz"))
1987 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1988 (modules '((guix build utils)))
1990 ;; Replace the non-free implementation of MC64 with a stub adapted
1993 (use-modules (ice-9 regex)
1995 (call-with-output-file "SRC/mc64ad.c"
2000 void mc64id_(int *a) {
2001 fprintf (stderr, \"SuperLU: 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: non-free MC64 not available. Aborting.\\n\");
2009 ;; Remove the corresponding license verbiage. MC64 license follows
2010 ;; a "------" line separator.
2011 (with-atomic-file-replacement "License.txt"
2012 (let ((rx (make-regexp "-{8}")))
2015 (let ((line (read-line in 'concat)))
2016 (unless (regexp-exec rx line)
2019 (build-system cmake-build-system)
2023 `(("blas" ,openblas)
2024 ("gfortran" ,gfortran)))
2026 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2027 "-DTPL_BLAS_LIBRARIES=openblas"
2028 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2029 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2030 (synopsis "Supernodal direct solver for sparse linear systems")
2032 "SuperLU is a general purpose library for the direct solution of large,
2033 sparse, nonsymmetric systems of linear equations on high performance machines.
2034 The library is written in C and is callable from either C or Fortran. The
2035 library routines perform an LU decomposition with partial pivoting and
2036 triangular system solves through forward and back substitution. The library
2037 also provides threshold-based ILU factorization preconditioners.")
2038 (license (list license:bsd-3
2039 license:gpl2+ ;EXAMPLE/*fgmr.c
2040 (license:fsf-free "file://SRC/colamd.h")))))
2042 (define-public superlu-dist
2044 (name "superlu-dist")
2049 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2050 "superlu_dist_" version ".tar.gz"))
2052 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
2053 (modules '((guix build utils)))
2055 ;; Replace the non-free implementation of MC64 with a stub
2057 (use-modules (ice-9 regex)
2059 (call-with-output-file "SRC/mc64ad.c"
2064 void mc64id_(int *a) {
2065 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2068 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2069 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2070 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2073 (delete-file "SRC/mc64ad.f.bak")
2074 (substitute* "SRC/util.c" ;adjust default algorithm
2075 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2076 "RowPerm = NOROWPERM"))))
2077 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2078 (build-system gnu-build-system)
2082 `(("gfortran" ,gfortran)))
2084 `(("openmpi" ,openmpi) ;headers include MPI heades
2085 ("lapack" ,lapack) ;required to link with output library
2086 ("pt-scotch" ,pt-scotch))) ;same
2088 `(#:parallel-build? #f ;race conditions using ar
2090 (modify-phases %standard-phases
2092 (lambda* (#:key inputs outputs #:allow-other-keys)
2093 (call-with-output-file "make.inc"
2098 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2099 BLASDEF = -DUSE_VENDOR_BLAS
2100 BLASLIB = -L~a/lib -lblas
2101 PARMETISLIB = -L~a/lib \
2102 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2103 -lscotch -lscotcherr -lscotcherrexit
2104 METISLIB = -L~:*~a/lib \
2105 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2106 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2112 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2113 NOOPTS = -O0 -g $(PIC)
2115 FFLAGS = -O2 -g $(PIC)
2119 (assoc-ref outputs "out")
2120 (assoc-ref inputs "lapack")
2121 (assoc-ref inputs "pt-scotch"))))
2123 (add-after 'unpack 'remove-broken-symlinks
2125 (for-each delete-file
2126 (find-files "MAKE_INC" "\\.#make\\..*"))
2128 (add-before 'build 'create-install-directories
2129 (lambda* (#:key outputs #:allow-other-keys)
2132 (mkdir-p (string-append (assoc-ref outputs "out")
2138 (with-directory-excursion "EXAMPLE"
2140 (zero? (system* "mpirun" "-n" "2"
2141 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2142 (zero? (system* "mpirun" "-n" "2"
2143 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2145 (lambda* (#:key outputs #:allow-other-keys)
2146 ;; Library is placed in lib during the build phase. Copy over
2147 ;; headers to include.
2148 (let* ((out (assoc-ref outputs "out"))
2149 (incdir (string-append out "/include")))
2150 (for-each (lambda (file)
2151 (let ((base (basename file)))
2152 (format #t "installing `~a' to `~a'~%"
2155 (string-append incdir "/" base))))
2156 (find-files "SRC" ".*\\.h$")))
2158 (home-page (package-home-page superlu))
2159 (synopsis "Parallel supernodal direct solver")
2161 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2162 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2163 implemented in ANSI C, and MPI for communications.")
2164 (license license:bsd-3)))
2166 (define-public scotch
2173 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
2174 "scotch_" version ".tar.gz"))
2176 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
2177 (patches (search-patches "scotch-test-threading.patch"
2178 "pt-scotch-build-parallelism.patch"))))
2179 (build-system gnu-build-system)
2186 (modify-phases %standard-phases
2188 'unpack 'chdir-to-src
2189 (lambda _ (chdir "src")))
2193 (call-with-output-file "Makefile.inc"
2207 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2208 LDFLAGS = -lz -lm -lrt -lpthread
2210 LEX = flex -Pscotchyy -olex.yy.c
2215 YACC = bison -pscotchyy -y -b y
2217 '("COMMON_FILE_COMPRESS_GZ"
2219 "COMMON_RANDOM_FIXED_SEED"
2220 "INTSIZE64" ;use 'long' instead of 'int'
2221 ;; Prevents symbolc clashes with libesmumps
2223 ;; XXX: Causes invalid frees in superlu-dist tests
2225 ;; "SCOTCH_PTHREAD_NUMBER=2"
2226 "restrict=__restrict"))))))
2228 'build 'build-esmumps
2230 (zero? (system* "make"
2231 (format #f "-j~a" (parallel-job-count))
2235 (lambda* (#:key outputs #:allow-other-keys)
2236 (let ((out (assoc-ref outputs "out")))
2238 (zero? (system* "make"
2239 (string-append "prefix=" out)
2241 ;; esmumps files are not installed with the above
2242 (for-each (lambda (f)
2243 (copy-file f (string-append out "/include/" f)))
2244 (find-files "../include" ".*esmumps.h$"))
2245 (for-each (lambda (f)
2246 (copy-file f (string-append out "/lib/" f)))
2247 (find-files "../lib" "^lib.*esmumps.*"))))))))
2248 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2249 (synopsis "Programs and libraries for graph algorithms")
2250 (description "SCOTCH is a set of programs and libraries which implement
2251 the static mapping and sparse matrix reordering algorithms developed within
2252 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2253 conquer approach, to scientific computing problems such as graph and mesh
2254 partitioning, static mapping, and sparse matrix ordering, in application
2255 domains ranging from structural mechanics to operating systems or
2257 ;; See LICENSE_en.txt
2258 (license license:cecill-c)))
2260 (define-public scotch32
2261 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2262 ;; some applications.
2263 (package (inherit scotch)
2266 (substitute-keyword-arguments (package-arguments scotch)
2267 ((#:phases scotch-phases)
2268 `(modify-phases ,scotch-phases
2272 (call-with-output-file "Makefile.inc"
2286 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2287 LDFLAGS = -lz -lm -lrt -lpthread
2289 LEX = flex -Pscotchyy -olex.yy.c
2294 YACC = bison -pscotchyy -y -b y
2296 '("COMMON_FILE_COMPRESS_GZ"
2298 "COMMON_RANDOM_FIXED_SEED"
2299 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2300 ;; Prevents symbolc clashes with libesmumps
2302 ;; XXX: Causes invalid frees in superlu-dist tests
2304 ;; "SCOTCH_PTHREAD_NUMBER=2"
2305 "restrict=__restrict"))))))))))
2307 "Programs and libraries for graph algorithms (32-bit integers)")))
2309 (define-public pt-scotch
2310 (package (inherit scotch)
2313 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2315 (substitute-keyword-arguments (package-arguments scotch)
2316 ((#:phases scotch-phases)
2317 `(modify-phases ,scotch-phases
2322 (zero? (system* "make"
2323 (format #f "-j~a" (parallel-job-count))
2324 "ptscotch" "ptesmumps"))
2325 ;; Install the serial metis compatibility library
2326 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2329 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2330 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2332 (define-public pt-scotch32
2333 (package (inherit scotch32)
2334 (name "pt-scotch32")
2336 `(("openmpi" ,openmpi))) ;headers include MPI headers
2338 (substitute-keyword-arguments (package-arguments scotch32)
2339 ((#:phases scotch32-phases)
2340 `(modify-phases ,scotch32-phases
2344 (zero? (system* "make"
2345 (format #f "-j~a" (parallel-job-count))
2346 "ptscotch" "ptesmumps"))
2347 ;; Install the serial metis compatibility library
2348 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2351 (zero? (system* "make" "ptcheck"))))))))
2353 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2355 (define-public metis
2362 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2363 "metis-" version ".tar.gz"))
2366 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2367 (build-system cmake-build-system)
2369 `(("blas" ,openblas)))
2371 `(#:tests? #f ;no tests
2372 #:configure-flags `("-DSHARED=ON"
2373 ,(string-append "-DGKLIB_PATH=" (getcwd)
2374 "/metis-" ,version "/GKlib"))))
2375 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2376 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2378 "METIS is a set of serial programs for partitioning graphs, partitioning
2379 finite element meshes, and producing fill-reducing orderings for sparse
2380 matrices. The algorithms implemented in METIS are based on the multilevel
2381 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2383 (license license:asl2.0))) ;As of version 5.0.3
2385 (define-public p4est
2392 (uri (string-append "http://p4est.github.io/release/p4est-"
2396 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2397 (build-system gnu-build-system)
2399 `(("fortran" ,gfortran)
2404 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2405 (assoc-ref %build-inputs "blas")
2407 ,(string-append "LAPACK_LIBS=-L"
2408 (assoc-ref %build-inputs "lapack")
2410 (home-page "http://www.p4est.org")
2411 (synopsis "Adaptive mesh refinement on forests of octrees")
2413 "The p4est software library enables the dynamic management of a
2414 collection of adaptive octrees, conveniently called a forest of octrees.
2415 p4est is designed to work in parallel and scales to hundreds of thousands of
2417 (license license:gpl2+)))
2419 (define-public p4est-openmpi
2420 (package (inherit p4est)
2421 (name "p4est-openmpi")
2424 ,@(package-inputs p4est)))
2426 (substitute-keyword-arguments (package-arguments p4est)
2427 ((#:configure-flags cf)
2428 ``("--enable-mpi" ,@,cf))))
2429 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2431 (define-public gsegrafix
2438 (uri (string-append "mirror://gnu/" name "/" name "-"
2442 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2443 (build-system gnu-build-system)
2445 `(#:configure-flags '("LDFLAGS=-lm")))
2447 `(("libgnomecanvas" ,libgnomecanvas)
2448 ("libbonoboui" ,libbonoboui)
2449 ("libgnomeui" ,libgnomeui)
2450 ("libgnomeprintui" ,libgnomeprintui)
2453 `(("pkg-config" ,pkg-config)))
2454 (home-page "https://www.gnu.org/software/gsegrafix/")
2455 (synopsis "GNOME application to create scientific and engineering plots")
2456 (description "GSEGrafix is an application which produces high-quality graphical
2457 plots for science and engineering. Plots are specified via simple ASCII
2458 parameter files and data files and are presented in an anti-aliased GNOME
2459 canvas. The program supports rectangular two-dimensional plots, histograms,
2460 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2461 to BMP, JPEG or PNG image formats.")
2462 (license license:gpl3+)))
2464 (define-public maxima
2471 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2472 version "-source/" name "-" version ".tar.gz"))
2475 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2476 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2477 (build-system gnu-build-system)
2480 ("gnuplot" ,gnuplot) ;for plots
2481 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2483 `(("texinfo" ,texinfo)
2485 ("python" ,python)))
2488 (list "--enable-gcl"
2489 (string-append "--with-posix-shell="
2490 (assoc-ref %build-inputs "bash")
2492 (string-append "--with-wish="
2493 (assoc-ref %build-inputs "tk")
2495 (let ((v ,(package-version tk)))
2496 (string-take v (string-index-right v #\.)))))
2497 ;; By default Maxima attempts to write temporary files to
2498 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2499 ;; Work around that.
2500 #:make-flags (list "TMPDIR=/tmp")
2502 (modify-phases %standard-phases
2503 (add-before 'check 'pre-check
2505 (chmod "src/maxima" #o555)
2507 ;; Make sure the doc and emacs files are found in the
2508 ;; standard location. Also configure maxima to find gnuplot
2509 ;; without having it on the PATH.
2510 (add-after 'install 'post-install
2511 (lambda* (#:key outputs inputs #:allow-other-keys)
2512 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2513 (out (assoc-ref outputs "out"))
2514 (datadir (string-append out "/share/maxima/" ,version))
2515 (binutils (string-append (assoc-ref inputs "binutils")
2517 (with-directory-excursion out
2518 (mkdir-p "share/emacs")
2519 (mkdir-p "share/doc")
2521 (string-append datadir "/emacs/")
2522 (string-append out "/share/emacs/site-lisp"))
2524 (string-append datadir "/doc/")
2525 (string-append out "/share/doc/maxima"))
2526 (with-atomic-file-replacement
2527 (string-append datadir "/share/maxima-init.lisp")
2529 (format out "~a ~s~a~%"
2530 "(setf $gnuplot_command "
2531 (string-append gnuplot "/bin/gnuplot") ")")
2532 (dump-port in out))))
2533 ;; Ensure that Maxima will have access to the GNU binutils
2534 ;; components at runtime.
2535 (wrap-program (string-append out "/bin/maxima")
2536 `("PATH" prefix (,binutils))))
2538 (home-page "http://maxima.sourceforge.net")
2539 (synopsis "Numeric and symbolic expression manipulation")
2540 (description "Maxima is a system for the manipulation of symbolic and
2541 numerical expressions. It yields high precision numeric results by using
2542 exact fractions, arbitrary precision integers, and variable precision floating
2544 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2545 ;; Others simply say "GNU General Public License" without stating a
2546 ;; version (which implicitly means gpl1+).
2547 ;; At least one file (src/maxima.asd) says "version 2."
2548 ;; GPLv2 only is therefore the smallest subset.
2549 (license license:gpl2)))
2551 (define-public wxmaxima
2558 (uri (string-append "https://github.com/andrejv/" name "/archive"
2559 "/Version-" version ".tar.gz"))
2560 (file-name (string-append name "-" version ".tar.gz"))
2563 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2565 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2566 (build-system cmake-build-system)
2568 `(("gettext" ,gettext-minimal)))
2570 `(("wxwidgets" ,wxwidgets)
2573 ("adwaita-icon-theme" ,adwaita-icon-theme)
2575 ("shared-mime-info" ,shared-mime-info)))
2577 `(#:tests? #f ; no check target
2579 (modify-phases %standard-phases
2580 (add-after 'install 'wrap-program
2581 (lambda* (#:key inputs outputs #:allow-other-keys)
2582 (wrap-program (string-append (assoc-ref outputs "out")
2585 (,(string-append (assoc-ref inputs "maxima")
2587 ;; For GtkFileChooserDialog.
2588 `("GSETTINGS_SCHEMA_DIR" =
2589 (,(string-append (assoc-ref inputs "gtk+")
2590 "/share/glib-2.0/schemas")))
2591 `("XDG_DATA_DIRS" ":" prefix
2592 (;; Needed by gdk-pixbuf to know supported icon formats.
2594 (assoc-ref inputs "shared-mime-info") "/share")
2595 ;; The default icon theme of GTK+.
2597 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2599 (home-page "https://andrejv.github.io/wxmaxima/")
2600 (synopsis "Graphical user interface for the Maxima computer algebra system")
2602 "wxMaxima is a graphical user interface for the Maxima computer algebra
2603 system. It eases the use of Maxima by making most of its commands available
2604 through a menu system and by providing input dialogs for commands that require
2605 more than one argument. It also implements its own display engine that
2606 outputs mathematical symbols directly instead of depicting them with ASCII
2609 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2610 text and mathematical calculations to create documents, exporting of input and
2611 output to TeX, and a browser for Maxima's manual including command index and
2612 full text searching.")
2613 (license license:gpl2+)))
2615 (define-public armadillo
2621 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2625 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2626 (build-system cmake-build-system)
2627 (arguments `(#:tests? #f)) ;no test target
2629 `(("openblas" ,openblas)
2631 ("arpack" ,arpack-ng)))
2632 (home-page "http://arma.sourceforge.net/")
2633 (synopsis "C++ linear algebra library")
2635 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2636 between speed and ease of use. It is useful for algorithm development
2637 directly in C++, or quick conversion of research code into production
2638 environments. It can be used for machine learning, pattern recognition,
2639 signal processing, bioinformatics, statistics, econometrics, etc. The library
2640 provides efficient classes for vectors, matrices and cubes, as well as 150+
2641 associated functions (eg. contiguous and non-contiguous submatrix views).")
2642 (license license:asl2.0)))
2644 (define-public muparser
2645 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2646 ;; different hash. In order to make `guix package --upgrade` work correctly,
2647 ;; we set a Guix packaging revision.
2648 ;; When the next version of muparser is released, we can remove
2649 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2650 (let ((upstream-version "2.2.5")
2654 (version (string-append upstream-version "-" revision))
2658 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2659 upstream-version ".tar.gz"))
2660 (file-name (string-append name "-" version ".tar.gz"))
2663 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2664 (build-system gnu-build-system)
2666 `(#:configure-flags '("--enable-samples=no")
2667 #:tests? #f)) ;no "check" target
2668 (home-page "http://muparser.beltoforion.de/")
2669 (synopsis "Fast parser library for mathematical expressions")
2671 "muParser is an extensible high performance math parser library. It is
2672 based on transforming an expression into a bytecode and precalculating constant
2674 (license license:expat))))
2676 (define-public openblas
2683 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2685 (file-name (string-append name "-" version ".tar.gz"))
2688 "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a"))))
2689 (build-system gnu-build-system)
2691 `(#:test-target "test"
2692 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2693 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2694 ;; we need to disable substitutions.
2696 ,(let ((system (or (%current-target-system) (%current-system))))
2697 (or (string-prefix? "x86_64" system)
2698 (string-prefix? "i686" system)
2699 (string-prefix? "mips" system)
2700 (string-prefix? "aarch64" system)))
2702 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2704 ;; Build the library for all supported CPUs. This allows
2705 ;; switching CPU targets at runtime with the environment variable
2706 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2707 ;; Unfortunately, this is not supported on non-x86 architectures,
2708 ;; where it leads to failed builds.
2709 ,@(let ((system (or (%current-target-system) (%current-system))))
2711 ((or (string-prefix? "x86_64" system)
2712 (string-prefix? "i686" system))
2713 '("DYNAMIC_ARCH=1"))
2714 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2715 ;; two available MIPS targets special extended instructions
2716 ;; for Loongson cores are used.
2717 ((string-prefix? "mips" system)
2718 '("TARGET=SICORTEX"))
2719 ;; On aarch64 force the generic 'armv8-a' target
2720 ((string-prefix? "aarch64" system)
2723 ;; no configure script
2725 (modify-phases %standard-phases
2727 (add-before 'build 'set-extralib
2728 (lambda* (#:key inputs #:allow-other-keys)
2729 ;; Get libgfortran found when building in utest.
2731 (string-append "-L" (assoc-ref inputs "fortran-lib")
2735 `(("fortran-lib" ,gfortran "lib")))
2738 ("fortran" ,gfortran)
2740 (home-page "http://www.openblas.net/")
2741 (synopsis "Optimized BLAS library based on GotoBLAS")
2743 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2744 (license license:bsd-3)))
2746 (define* (make-blis implementation #:optional substitutable?)
2747 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2748 source tree for a list of implementations.)
2750 SUBSTITUTABLE? determines whether the package is made available as a
2753 Currently the specialization must be selected at configure-time, but work is
2754 underway to allow BLIS to select the right optimized kernels at run time:
2755 <https://github.com/flame/blis/issues/129>."
2757 (name (if (string=? implementation "reference")
2759 (string-append "blis-" implementation)))
2761 (home-page "https://github.com/flame/blis")
2764 (uri (git-reference (url home-page) (commit version)))
2767 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2768 (file-name (git-file-name "blis" version))))
2769 (build-system gnu-build-system)
2771 `(#:test-target "test"
2773 #:substitutable? ,substitutable?
2775 #:phases (modify-phases %standard-phases
2777 (lambda* (#:key outputs #:allow-other-keys)
2778 ;; This is a home-made 'configure' script.
2779 (let ((out (assoc-ref outputs "out")))
2780 (zero? (system* "./configure" "-p" out
2784 "--enable-threading=openmp"
2786 ,implementation)))))
2787 (add-before 'check 'show-test-output
2789 ;; By default "make check" is silent. Make it verbose.
2790 (system "tail -F output.testsuite &")
2792 (synopsis "High-performance basic linear algebra (BLAS) routines")
2794 "BLIS is a portable software framework for instantiating high-performance
2795 BLAS-like dense linear algebra libraries. The framework was designed to
2796 isolate essential kernels of computation that, when optimized, immediately
2797 enable optimized implementations of most of its commonly used and
2798 computationally intensive operations. While BLIS exports a new BLAS-like API,
2799 it also includes a BLAS compatibility layer which gives application developers
2800 access to BLIS implementations via traditional BLAS routine calls.")
2801 (license license:bsd-3)))
2804 ;; This is the "reference" implementation, which is the non-optimized but
2805 ;; portable variant (no assembly).
2806 (make-blis "reference" #t))
2808 (define ignorance blis)
2810 (define-syntax-rule (blis/x86_64 processor)
2811 "Expand to a package specialized for PROCESSOR."
2813 (inherit (make-blis processor))
2814 (supported-systems '("x86_64-linux"))))
2816 (define-public blis-sandybridge
2817 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2818 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2819 (blis/x86_64 "sandybridge"))
2821 (define-public blis-haswell
2822 ;; BLIS specialized for Haswell processors (launched 2013):
2823 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2824 (blis/x86_64 "haswell"))
2826 (define-public blis-knl
2827 ;; BLIS specialized for Knights Landing processor (launched 2016):
2828 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2829 (blis/x86_64 "knl"))
2832 (define-public openlibm
2839 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2841 (file-name (string-append name "-" version ".tar.gz"))
2844 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2845 (build-system gnu-build-system)
2848 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2850 ;; no configure script
2851 (modify-phases %standard-phases (delete 'configure))
2852 #:tests? #f)) ;the tests are part of the default target
2853 (home-page "http://openlibm.org/")
2854 (synopsis "Portable C mathematical library (libm)")
2856 "OpenLibm is an effort to have a high quality, portable, standalone C
2857 mathematical library (libm). It can be used standalone in applications and
2858 programming language implementations. The project was born out of a need to
2859 have a good libm for the Julia programming language that worked consistently
2860 across compilers and operating systems, and in 32-bit and 64-bit
2862 ;; Each architecture has its own make target, and there is none for mips.
2863 (supported-systems (delete "mips64el-linux" %supported-systems))
2864 ;; See LICENSE.md for details.
2865 (license (list license:expat
2868 license:public-domain
2869 license:lgpl2.1+))))
2871 (define-public openspecfun
2873 (name "openspecfun")
2878 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2880 (file-name (string-append name "-" version ".tar.gz"))
2883 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
2884 (build-system gnu-build-system)
2886 '(#:tests? #f ; no "check" target
2888 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2890 (modify-phases %standard-phases
2891 (delete 'configure)))) ; no configure script
2893 `(("fortran" ,gfortran)))
2894 (home-page "https://github.com/JuliaLang/openspecfun")
2895 (synopsis "Collection of special mathematical functions")
2897 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2898 portable package for Bessel Functions of a Complex Argument and Nonnegative
2899 Order; it contains subroutines for computing Bessel functions and Airy
2900 functions. Faddeeva allows computing the various error functions of arbitrary
2901 complex arguments (Faddeeva function, error function, complementary error
2902 function, scaled complementary error function, imaginary error function, and
2903 Dawson function); given these, one can also easily compute Voigt functions,
2904 Fresnel integrals, and similar related functions as well.")
2905 ;; Faddeeva is released under the Expat license; AMOS is included as
2906 ;; public domain software.
2907 (license (list license:expat license:public-domain))))
2909 (define-public suitesparse
2911 (name "suitesparse")
2917 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2921 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2922 (modules '((guix build utils)))
2924 ;; Remove bundled metis source
2925 '(delete-file-recursively "metis-5.1.0"))))
2926 (build-system gnu-build-system)
2928 '(#:tests? #f ;no "check" target
2933 "MY_METIS_LIB=-lmetis"
2934 (string-append "INSTALL_LIB="
2935 (assoc-ref %outputs "out") "/lib")
2936 (string-append "INSTALL_INCLUDE="
2937 (assoc-ref %outputs "out") "/include")
2940 (modify-phases %standard-phases
2941 (delete 'configure)))) ;no configure script
2946 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2947 (synopsis "Suite of sparse matrix software")
2949 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2950 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2951 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2952 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2953 CXSparse, a concise sparse Cholesky factorization package; and many other
2956 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2958 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2959 (license (list license:gpl2+ license:lgpl2.1+))))
2961 (define-public atlas
2967 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2968 version "/atlas" version ".tar.bz2"))
2971 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2972 (build-system gnu-build-system)
2973 (home-page "http://math-atlas.sourceforge.net/")
2974 (inputs `(("gfortran" ,gfortran)
2975 ("lapack-tar" ,(package-source lapack))))
2976 (outputs '("out" "doc"))
2977 ;; For the moment we drop support for MIPS at it fails to compile. See
2978 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2979 (supported-systems (delete "mips64el-linux" %supported-systems))
2981 `(#:parallel-build? #f
2982 #:parallel-tests? #f
2984 ;; ATLAS tunes itself for the machine it is built on, as explained at
2985 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2986 ;; For this reason, we want users to build it locally instead of using
2990 #:modules ((srfi srfi-26)
2992 (guix build gnu-build-system)
2995 `(;; Generate position independent code suitable for dynamic libraries
2996 ;; and use WALL timer to get more accurate timing.
2997 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3000 ,,(if (string-match "64" (%current-system))
3003 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3004 ;; needed to compile C files before it is generated.
3005 "-Ss" "pmake" "make -j 1"
3006 ;; Probe is failing for MIPS. We therefore define the system
3007 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3008 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3009 ,,@(if (string-prefix? "mips" (%current-system))
3010 (list "-A" "49" "-V" "1")
3012 ;; Generate shared libraries.
3014 ;; Build a full LAPACK library.
3015 ,(string-append "--with-netlib-lapack-tarfile="
3016 (assoc-ref %build-inputs "lapack-tar")))
3018 (modify-phases %standard-phases
3019 (add-after 'install 'install-doc
3020 (lambda* (#:key outputs inputs #:allow-other-keys)
3021 (let ((doc (string-append (assoc-ref outputs "doc")
3022 "/share/doc/atlas")))
3024 (fold (lambda (file previous)
3025 (and previous (zero? (system* "cp" file doc))))
3026 #t (find-files "../ATLAS/doc" ".*")))))
3027 (add-after 'check 'check-pt
3028 (lambda _ (zero? (system* "make" "ptcheck"))))
3029 ;; Fix files required to run configure.
3030 (add-before 'configure 'fix-/bin/sh
3032 ;; Use `sh', not `/bin/sh'.
3033 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3036 ;; Fix /bin/sh in generated make files.
3037 (add-after 'configure 'fix-/bin/sh-in-generated-files
3039 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3042 ;; ATLAS configure program does not accepts the default flags
3043 ;; passed by the 'gnu-build-system'.
3045 (lambda* (#:key native-inputs inputs outputs
3046 (configure-flags '())
3047 #:allow-other-keys #:rest args)
3048 (let* ((prefix (assoc-ref outputs "out"))
3049 (bash (or (and=> (assoc-ref
3050 (or native-inputs inputs) "bash")
3051 (cut string-append <> "/bin/bash"))
3053 (flags `(,(string-append "--prefix=" prefix)
3055 (abs-srcdir (getcwd))
3056 (srcdir (string-append "../" (basename abs-srcdir))))
3057 (format #t "source directory: ~s (relative from build: ~s)~%"
3061 (format #t "build directory: ~s~%" (getcwd))
3062 (format #t "configure flags: ~s~%" flags)
3063 (zero? (apply system* bash
3064 (string-append srcdir "/configure")
3066 (synopsis "Automatically Tuned Linear Algebra Software")
3068 "ATLAS is an automatically tuned linear algebra software library
3069 providing C and Fortran77 interfaces to a portably efficient BLAS
3070 implementation, as well as a few routines from LAPACK.
3072 Optimization occurs at build time. For this reason, the library is built on
3073 the machine where it is installed, without resorting to pre-built substitutes.
3075 Before building the library, CPU throttling should be disabled. This can be
3076 done in the BIOS, or, on GNU/Linux, with the following command:
3079 # cpupower --governor performance
3082 Failure to do so will result in a library with poor performance.")
3083 (license license:bsd-3)))
3092 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3093 "/glm-" version ".zip"))
3096 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3097 (build-system cmake-build-system)
3099 `(("unzip" ,unzip)))
3100 (home-page "http://glm.g-truc.net")
3101 (synopsis "OpenGL Mathematics library")
3102 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3103 library for graphics software based on the OpenGL Shading Language (GLSL)
3105 (license license:expat)))
3107 (define-public lpsolve
3114 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3115 "/lp_solve_" version "_source.tar.gz"))
3118 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3119 (modules '((guix build utils)))
3121 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3123 ;; Pretend to be on a 64 bit platform to obtain a common directory
3124 ;; name for the build results on all architectures; nothing else
3125 ;; seems to depend on it.
3126 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3128 ;; The check for 'isnan' as it is written fails with
3129 ;; "non-floating-point argument in call to function
3130 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3131 ;; definition, which in turn leads to bad things. Fix the feature
3133 (("isnan\\(0\\)") "isnan(0.)")))))
3134 (build-system gnu-build-system)
3136 `(#:tests? #f ; no check target
3138 (modify-phases %standard-phases
3139 (delete 'configure) ; no configure script
3142 (with-directory-excursion "lpsolve55"
3143 (invoke "bash" "ccc"))
3144 (with-directory-excursion "lp_solve"
3145 (invoke "bash" "ccc"))
3148 (lambda* (#:key outputs #:allow-other-keys)
3149 (let* ((out (assoc-ref outputs "out"))
3150 (bin (string-append out "/bin"))
3151 (lib (string-append out "/lib"))
3152 ;; This is where LibreOffice expects to find the header
3153 ;; files, and where they are installed by Debian.
3154 (include (string-append out "/include/lpsolve")))
3155 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3156 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3157 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3159 ;; Install a subset of the header files as on Debian
3160 ;; (plus lp_bit.h, which matches the regular expression).
3161 (for-each (lambda (name)
3162 (install-file name include))
3163 (find-files "." "lp_[HMSa-z].*\\.h$"))
3164 (with-directory-excursion "shared"
3165 (for-each (lambda (name)
3166 (install-file name include))
3167 (find-files "." "\\.h$")))
3169 (home-page "http://lpsolve.sourceforge.net/")
3170 (synopsis "Mixed integer linear programming (MILP) solver")
3172 "lp_solve is a mixed integer linear programming solver based on the
3173 revised simplex and the branch-and-bound methods.")
3174 (license license:lgpl2.1+)))
3176 (define-public dealii
3183 (uri (string-append "https://github.com/dealii/dealii/releases/"
3184 "download/v" version "/dealii-" version ".tar.gz"))
3187 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3188 (modules '((guix build utils)))
3190 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3191 '(delete-file-recursively "bundled"))))
3192 (build-system cmake-build-system)
3200 ("arpack" ,arpack-ng)
3201 ("muparser" ,muparser)
3202 ("gfortran" ,gfortran)
3203 ("suitesparse" ,suitesparse))) ;for UMFPACK
3205 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3207 ;; Work around a bug in libsuitesparseconfig linking
3208 ;; see https://github.com/dealii/dealii/issues/4745
3209 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3210 (home-page "https://www.dealii.org")
3211 (synopsis "Finite element library")
3213 "Deal.II is a C++ program library targeted at the computational solution
3214 of partial differential equations using adaptive finite elements. The main
3215 aim of deal.II is to enable rapid development of modern finite element codes,
3216 using among other aspects adaptive meshes and a wide array of tools often used
3217 in finite element programs.")
3218 (license license:lgpl2.1+)))
3220 (define-public dealii-openmpi
3221 (package (inherit dealii)
3222 (name "dealii-openmpi")
3225 ;;Supported only with MPI:
3226 ("p4est" ,p4est-openmpi)
3227 ("petsc" ,petsc-openmpi)
3228 ("slepc" ,slepc-openmpi)
3229 ("metis" ,metis) ;for MUMPS
3230 ("scalapack" ,scalapack) ;for MUMPS
3231 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3232 ("arpack" ,arpack-ng-openmpi)
3233 ,@(fold alist-delete (package-inputs dealii)
3234 '("p4est" "arpack"))))
3236 (substitute-keyword-arguments (package-arguments dealii)
3237 ((#:configure-flags cf)
3238 ``("-DMPI_C_COMPILER=mpicc"
3239 "-DMPI_CXX_COMPILER=mpicxx"
3240 "-DMPI_Fortran_COMPILER=mpifort"
3242 (synopsis "Finite element library (with MPI support)")))
3244 (define-public flann
3253 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3254 version "-src.zip"))
3257 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3258 (build-system cmake-build-system)
3260 "octave")) ;46 MiB .mex file that pulls Octave
3262 `(("unzip" ,unzip)))
3266 ("python" ,python-2) ; print syntax
3267 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3270 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3271 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3272 #:strip-directories '("lib" "lib64" "libexec"
3273 "bin" "sbin" "share/flann/octave")
3275 ;; Save 12 MiB by not installing .a files. Passing
3276 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3277 #:phases (modify-phases %standard-phases
3278 (add-before 'configure 'set-octave-directory
3279 (lambda* (#:key outputs #:allow-other-keys)
3280 ;; Install the .mex file in the "octave" output.
3281 (let ((out (assoc-ref outputs "octave")))
3282 (substitute* "src/matlab/CMakeLists.txt"
3283 (("share/flann/octave")
3284 (string-append out "/share/flann/octave")))
3286 (add-after 'install 'remove-static-libraries
3287 (lambda* (#:key outputs #:allow-other-keys)
3288 (let* ((out (assoc-ref outputs "out"))
3289 (lib (string-append out "/lib")))
3290 (for-each delete-file
3291 (find-files lib "\\.a$"))
3294 #:tests? #f)) ; The test data are downloaded from the Internet.
3295 (home-page "http://www.cs.ubc.ca/research/flann/")
3296 (synopsis "Library for approximate nearest neighbors computation")
3297 (description "FLANN is a library for performing fast approximate
3298 nearest neighbor searches in high dimensional spaces. It implements a
3299 collection of algorithms and a system for automatically choosing the best
3300 algorithm and optimum parameters depending on the dataset.
3302 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3303 (license (license:non-copyleft "file://COPYING"
3304 "See COPYING in the distribution."))))
3306 (define-public wcalc
3313 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3314 "wcalc-" version ".tar.bz2"))
3317 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3318 (build-system gnu-build-system)
3321 ("readline" ,readline)))
3322 (home-page "http://w-calc.sourceforge.net/index.php")
3323 (synopsis "Flexible command-line scientific calculator")
3324 (description "Wcalc is a very capable calculator. It has standard functions
3325 (sin, asin, and sinh for example, in either radians or degrees), many
3326 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3327 variables, a command history, hex/octal/binary input and output, unit
3328 conversions, embedded comments, and an expandable expression entry field. It
3329 evaluates expressions using the standard order of operations.")
3330 (license license:gpl2+)))
3338 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3339 "/xaos-" version ".tar.gz"))
3342 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3343 (build-system gnu-build-system)
3344 (native-inputs `(("gettext" ,gettext-minimal)))
3345 (inputs `(("libx11" ,libx11)
3350 `(#:tests? #f ;no "check" target
3351 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3352 (synopsis "Real-time fractal zoomer")
3353 (description "GNU XaoS is a graphical program that generates fractal
3354 patterns and allows you to zoom in and out of them infinitely in a fluid,
3355 continuous manner. It also includes tutorials that help to explain how fractals
3356 are built. It can generate many different fractal types such as the Mandelbrot
3358 (home-page "https://www.gnu.org/software/xaos/")
3359 (license license:gpl2+)))
3361 (define-public hypre
3367 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3368 "v" version ".tar.gz"))
3369 (file-name (string-append name "-" version ".tar.gz"))
3372 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3373 (modules '((guix build utils)))
3376 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3377 ;; substitute the tarball creation time.
3378 (substitute* "src/utilities/HYPRE_utilities.h"
3379 (("Date Compiled: .*$")
3380 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3382 (build-system gnu-build-system)
3383 (outputs '("out" ;6.1 MiB of headers and libraries
3384 "doc")) ;4.8 MiB of documentation
3388 ("texlive" ,texlive) ;full package required for fonts
3389 ("ghostscript" ,ghostscript)))
3391 `(("blas" ,openblas)
3392 ("lapack" ,lapack)))
3394 `(#:modules ((srfi srfi-1)
3395 ,@%gnu-build-system-modules)
3396 #:configure-flags '("--enable-shared"
3404 (modify-phases %standard-phases
3405 (add-before 'configure 'chdir-src
3406 (lambda _ (chdir "src")))
3408 (lambda* (#:key build target configure-flags
3409 #:allow-other-keys #:rest args)
3410 (let* ((configure (assoc-ref %standard-phases 'configure)))
3413 (list #:configure-flags
3414 (cons (string-append
3415 "--host=" (or target build))
3416 configure-flags)))))))
3417 (add-after 'build 'build-docs
3419 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3422 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3423 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3424 (and (system* "make" "check" "CHECKRUN=")
3425 (fold (lambda (filename result)
3427 (let ((size (stat:size (stat filename))))
3428 (when (not (zero? size))
3429 (format #t "~a size ~d; error indication~%"
3433 (find-files "test" ".*\\.err$")))))
3434 (add-after 'install 'install-docs
3435 (lambda* (#:key outputs #:allow-other-keys)
3436 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3437 (let* ((doc (assoc-ref outputs "doc"))
3438 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3439 (with-directory-excursion "docs"
3440 (for-each (lambda (base)
3441 (install-file (string-append base ".pdf") docdir)
3442 (copy-recursively base docdir)) ;html docs
3443 '("HYPRE_usr_manual"
3444 "HYPRE_ref_manual")))
3446 (home-page "http://www.llnl.gov/casc/hypre/")
3447 (synopsis "Library of solvers and preconditioners for linear equations")
3449 "HYPRE is a software library of high performance preconditioners and
3450 solvers for the solution of large, sparse linear systems of equations. It
3451 features multigrid solvers for both structured and unstructured grid
3453 (license license:lgpl2.1)))
3455 (define-public hypre-openmpi
3456 (package (inherit hypre)
3457 (name "hypre-openmpi")
3460 ,@(package-inputs hypre)))
3462 (substitute-keyword-arguments (package-arguments hypre)
3463 ((#:configure-flags flags)
3465 ,@(delete "--without-MPI" ,flags)))))
3466 (synopsis "Parallel solvers and preconditioners for linear equations")
3468 "HYPRE is a software library of high performance preconditioners and
3469 solvers for the solution of large, sparse linear systems of equations on
3470 parallel computers. It features parallel multigrid solvers for both
3471 structured and unstructured grid problems.")))
3473 (define-public matio
3480 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3481 "matio-" version ".tar.gz"))
3484 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3485 (build-system gnu-build-system)
3489 (home-page "http://matio.sourceforge.net/")
3490 (synopsis "Library for reading and writing MAT files")
3491 (description "Matio is a library for reading and writing MAT files. It
3492 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3493 (license license:bsd-2)))
3500 (origin (method url-fetch)
3501 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3502 "download/" version "/Vc-" version ".tar.gz"))
3505 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3506 (build-system cmake-build-system)
3509 '("-DBUILD_TESTING=ON")))
3510 (synopsis "SIMD vector classes for C++")
3511 (description "Vc provides portable, zero-overhead C++ types for explicitly
3512 data-parallel programming. It is a library designed to ease explicit
3513 vectorization of C++ code. Its types enable explicitly stating data-parallel
3514 operations on multiple values. The parallelism is therefore added via the type
3515 system. Vc has an intuitive API and provides portability between different
3516 compilers and compiler versions as well as portability between different vector
3517 instruction sets. Thus, an application written with Vc can be compiled for:
3520 @item SSE2 up to SSE4.2 or SSE4a
3523 @item NEON (in development)
3524 @item NVIDIA GPUs / CUDA (in development)
3526 (home-page "https://github.com/VcDevel/Vc")
3527 ;; "No support_???.cpp file exists for this architecture."
3528 (supported-systems '("x86_64-linux" "i686-linux"))
3529 (license license:bsd-3)))
3531 (define-public reducelcs
3532 ;; This is the last commit which is available upstream, no
3533 ;; release happened since 2010.
3534 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3538 (version (string-append "1.0-" revision "." (string-take commit 7)))
3543 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3545 (file-name (string-append name "-" version "-checkout"))
3548 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3549 (build-system gnu-build-system)
3551 `(("openlibm" ,openlibm)))
3553 `(#:tests? #f ; no tests
3555 (modify-phases %standard-phases
3556 (delete 'configure) ; No configure script exists.
3557 (replace 'install ; No install phase exists.
3558 (lambda* (#:key outputs #:allow-other-keys)
3559 (let* ((out (assoc-ref outputs "out"))
3560 (bin (string-append out "/bin")))
3561 (install-file "Approximation" bin)
3562 (install-file "CollectResults" bin)
3563 (install-file "GenerateInstances" bin)
3565 (synopsis "Approximate Longest Commons Subsequence computation tool")
3567 "@code{reduceLCS} is an implementation of the Reduce-Expand
3568 algorithm for LCS. It is a fast program to compute the approximate
3569 Longest Commons Subsequence of a set of strings.")
3570 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3571 (license license:gpl3+))))
3573 (define-public jacal
3580 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3583 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3584 (patches (search-patches "jacal-fix-texinfo.patch"))))
3585 (build-system gnu-build-system)
3588 (modify-phases %standard-phases
3589 (add-before 'build 'pre-build
3590 ;; Don't use upstream's script - it really doesn't fit into
3591 ;; Guix's functional paradigm.
3592 (lambda* (#:key inputs outputs #:allow-other-keys)
3593 (substitute* "Makefile"
3594 (("^install: install-script") "install: "))))
3595 (add-after 'install 'post-install
3596 ;; Instead, we provide our own simplified script.
3597 (lambda* (#:key inputs outputs #:allow-other-keys)
3598 (let ((wrapper (string-append (assoc-ref outputs "out")
3600 (format (open wrapper (logior O_WRONLY O_CREAT))
3601 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3602 "-e '(slib:load \"~a/lib/jacal/math\") "
3605 (assoc-ref inputs "scm")
3606 (assoc-ref outputs "out"))
3607 (chmod wrapper #o555))))
3609 (lambda* (#:key inputs outputs #:allow-other-keys)
3610 (zero? (system* "./configure"
3611 (string-append "--prefix="
3612 (assoc-ref outputs "out")))))))))
3613 (inputs `(("scm" ,scm)))
3614 (native-inputs `(("unzip" ,unzip)
3615 ("texinfo" ,texinfo)))
3616 (synopsis "Symbolic mathematics system")
3617 (description "GNU JACAL is an interactive symbolic mathematics program based on
3618 Scheme. It manipulate and simplify a range of mathematical expressions such
3619 as equations, scalars, vectors, and matrices.")
3620 (home-page "https://www.gnu.org/software/jacal/")
3621 (license license:gpl3+)))
3630 "https://github.com/Z3Prover/z3/archive/z3-"
3634 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3635 (build-system cmake-build-system)
3638 (list "-DBUILD_PYTHON_BINDINGS=true"
3639 "-DINSTALL_PYTHON_BINDINGS=true"
3640 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3642 "/lib/python2.7/site-packages"))
3644 (modify-phases %standard-phases
3645 (add-before 'configure 'bootstrap
3648 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3649 (add-before 'check 'make-test-z3
3651 ;; Build the test suite executable.
3652 (zero? (system* "make" "test-z3" "-j"
3653 (number->string (parallel-job-count))))))
3656 ;; Run all the tests that don't require arguments.
3657 (zero? (system* "./test-z3" "/a")))))))
3659 `(("python" ,python-2)))
3660 (synopsis "Theorem prover")
3661 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3662 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3663 (home-page "https://github.com/Z3Prover/z3")
3664 (license license:expat)))
3666 (define-public cubicle
3672 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3676 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3677 (build-system gnu-build-system)
3680 ("which" ,(@@ (gnu packages base) which))))
3684 `(#:configure-flags (list "--with-z3")
3687 (modify-phases %standard-phases
3688 (add-before 'configure 'configure-for-release
3690 (substitute* "Makefile.in"
3691 (("SVNREV=") "#SVNREV="))))
3692 (add-before 'configure 'fix-/bin/sh
3694 (substitute* "configure"
3695 (("/bin/sh") (which "sh")))))
3696 (add-before 'configure 'fix-smt-z3wrapper.ml
3698 (substitute* "Makefile.in"
3699 (("\\\\n") "")))))))
3700 (home-page "http://cubicle.lri.fr/")
3701 (synopsis "Model checker for array-based systems")
3702 (description "Cubicle is a model checker for verifying safety properties
3703 of array-based systems. This is a syntactically restricted class of
3704 parametrized transition systems with states represented as arrays indexed by
3705 an arbitrary number of processes. Cache coherence protocols and mutual
3706 exclusion algorithms are typical examples of such systems.")
3707 (license license:asl2.0)))
3709 (define-public elemental
3715 (uri (string-append "https://github.com/elemental/Elemental/"
3716 "archive/v" version ".tar.gz"))
3717 (file-name (string-append name "-" version ".tar.gz"))
3720 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3721 (build-system cmake-build-system)
3722 (home-page "http://libelemental.org")
3724 `(("gfortran" ,gfortran)))
3726 `(("blas" ,openblas)
3727 ("gfortran:lib" ,gfortran "lib")
3736 `(#:build-type "Release" ;default RelWithDebInfo not supported
3737 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3738 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3739 "-DEL_CACHE_WARNINGS:BOOL=YES"
3740 "-DEL_TESTS:BOOL=YES"
3741 "-DCMAKE_INSTALL_LIBDIR=lib"
3742 "-DGFORTRAN_LIB=gfortran")
3743 #:phases (modify-phases %standard-phases
3744 (add-before 'check 'setup-tests
3746 ;; Parallelism is done at the MPI layer.
3747 (setenv "OMP_NUM_THREADS" "1")
3749 (add-after 'install 'remove-tests
3750 (lambda* (#:key outputs #:allow-other-keys)
3751 ;; Tests are installed, with no easy configuration
3752 ;; switch to prevent this, so delete them.
3753 (delete-file-recursively
3754 (string-append (assoc-ref outputs "out") "/bin"))
3756 (synopsis "Dense and sparse-direct linear algebra and optimization")
3757 (description "Elemental is a modern C++ library for distributed-memory
3758 dense and sparse-direct linear algebra, conic optimization, and lattice
3760 (license license:bsd-2)))
3762 (define-public mcrl2
3765 (version "201707.1.15162")
3768 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3773 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3775 `(("subversion" ,subversion)))
3781 (build-system cmake-build-system)
3782 (synopsis "Toolset for the mCRL2 formal specification language")
3784 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3785 specification language for describing concurrent discrete event systems. Its
3786 toolset supports analysis and automatic verification, linearisation, simulation,
3787 state-space exploration and generation, and tools to optimise and analyse
3788 specifications. Also, state spaces can be manipulated, visualised and
3790 (home-page "http://mcrl2.org")
3791 (license license:boost1.0)))
3793 (define-public r-subplex
3800 (uri (cran-uri "subplex" version))
3803 "1v9xrnkapnq7v1jbhlg32ignklzf2vn8rqpayc8pzk8wvz53r33g"))))
3804 (build-system r-build-system)
3806 `(("gfortran" ,gfortran)))
3807 (home-page "https://cran.r-project.org/web/packages/subplex")
3808 (synopsis "Unconstrained optimization using the subplex algorithm")
3809 (description "This package implements the Subplex optimization algorithm.
3810 It solves unconstrained optimization problems using a simplex method on
3811 subspaces. The method is well suited for optimizing objective functions that
3812 are noisy or are discontinuous at the solution.")
3813 (license license:gpl3+)))
3815 (define-public r-desolve
3822 (uri (cran-uri "deSolve" version))
3825 "18nx3maww979a8p8ly4hv63y65mnjx8vbj2fpipd6rhcbf1lbsan"))))
3826 (properties `((upstream-name . "deSolve")))
3827 (build-system r-build-system)
3829 `(("gfortran" ,gfortran)))
3830 (home-page "https://desolve.r-forge.r-project.org/")
3831 (synopsis "Solvers for initial value problems of differential equations")
3832 (description "This package provides functions that solve initial
3833 value problems of a system of first-order ordinary differential equations (ODE),
3834 of partial differential equations (PDE), of differential algebraic equations
3835 (DAE), and of delay differential equations. The functions provide an interface
3836 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
3837 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
3838 the Runge-Kutta family with fixed or variable time steps. The package contains
3839 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
3840 differential equations (PDE) that have been converted to ODEs by numerical
3842 (license license:gpl2+)))