Commit | Line | Data |
---|---|---|
8f8b2451 | 1 | ;;; GNU Guix --- Functional package management for GNU |
b146763a | 2 | ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr> |
da95c817 | 3 | ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> |
a53d6719 | 4 | ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org> |
e01397b4 | 5 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org> |
df354a77 | 6 | ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch> |
182d6311 | 7 | ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org> |
4dba441c | 8 | ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net> |
32158110 | 9 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
9aafbc0c | 10 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
bd041e7f | 11 | ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
45147b0c | 12 | ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de> |
ec8c7e47 | 13 | ;;; Copyright © 2016 Roel Janssen <roel@gnu.org> |
ab5f3f21 | 14 | ;;; Copyright © 2016, 2018 Kei Kebreau <kkebreau@posteo.net> |
c0edb5b5 | 15 | ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> |
d7cff656 | 16 | ;;; Copyright © 2016 Leo Famulari <leo@famulari.name> |
2fd26d05 | 17 | ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be> |
71ca16b5 | 18 | ;;; Copyright © 2017, 2018 Paul Garlick <pgarlick@tourbillion-technology.com> |
4a78fd46 | 19 | ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is> |
ba1be533 | 20 | ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com> |
d109b1e8 | 21 | ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org> |
5ca4fe96 | 22 | ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> |
59cd0ba4 | 23 | ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
dc7d6d4e | 24 | ;;; Copyright © 2017 Dave Love <me@fx@gnu.org> |
5b05dce7 | 25 | ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org> |
41835f94 | 26 | ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> |
910deec6 | 27 | ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com> |
07254d8b | 28 | ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com> |
560acf25 | 29 | ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com> |
daa6036f | 30 | ;;; Copyright © 2018 Eric Brown <brown@fastmail.com> |
564cf93f | 31 | ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu> |
8f8b2451 AE |
32 | ;;; |
33 | ;;; This file is part of GNU Guix. | |
34 | ;;; | |
35 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
36 | ;;; under the terms of the GNU General Public License as published by | |
37 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
38 | ;;; your option) any later version. | |
39 | ;;; | |
40 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
41 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
42 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
43 | ;;; GNU General Public License for more details. | |
44 | ;;; | |
45 | ;;; You should have received a copy of the GNU General Public License | |
46 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
47 | ||
48 | (define-module (gnu packages maths) | |
ec322be2 | 49 | #:use-module (ice-9 regex) |
8f8b2451 | 50 | #:use-module (gnu packages) |
b5b73a82 | 51 | #:use-module ((guix licenses) #:prefix license:) |
8f8b2451 AE |
52 | #:use-module (guix packages) |
53 | #:use-module (guix download) | |
54052a54 | 54 | #:use-module (guix git-download) |
0e2672ae | 55 | #:use-module (guix utils) |
cec86422 | 56 | #:use-module (guix build utils) |
da95c817 | 57 | #:use-module (guix build-system cmake) |
c9dfa3c7 | 58 | #:use-module (guix build-system gnu) |
ba1be533 | 59 | #:use-module (guix build-system ocaml) |
560acf25 | 60 | #:use-module (guix build-system python) |
ec8c7e47 | 61 | #:use-module (guix build-system r) |
63e07468 | 62 | #:use-module (guix build-system ruby) |
3de01d3f | 63 | #:use-module (gnu packages algebra) |
ab5f3f21 | 64 | #:use-module (gnu packages audio) |
5143517c | 65 | #:use-module (gnu packages autotools) |
3de01d3f | 66 | #:use-module (gnu packages bison) |
a17d4564 | 67 | #:use-module (gnu packages boost) |
e73b49fb | 68 | #:use-module (gnu packages check) |
3de01d3f | 69 | #:use-module (gnu packages cmake) |
c9dfa3c7 | 70 | #:use-module (gnu packages compression) |
668c06ac | 71 | #:use-module (gnu packages curl) |
b7b27a8f | 72 | #:use-module (gnu packages cyrus-sasl) |
528bb464 | 73 | #:use-module (gnu packages documentation) |
57e544e8 | 74 | #:use-module (gnu packages elf) |
3de01d3f | 75 | #:use-module (gnu packages flex) |
668c06ac | 76 | #:use-module (gnu packages fltk) |
f3929800 | 77 | #:use-module (gnu packages fontutils) |
1dba6407 | 78 | #:use-module (gnu packages gettext) |
da95c817 | 79 | #:use-module (gnu packages gcc) |
73fed4f8 | 80 | #:use-module (gnu packages gd) |
668c06ac | 81 | #:use-module (gnu packages ghostscript) |
889187a4 | 82 | #:use-module (gnu packages graphviz) |
f3929800 | 83 | #:use-module (gnu packages gtk) |
45147b0c | 84 | #:use-module (gnu packages image) |
2fd26d05 | 85 | #:use-module (gnu packages java) |
668c06ac | 86 | #:use-module (gnu packages less) |
8731e527 | 87 | #:use-module (gnu packages lisp) |
ab5f3f21 | 88 | #:use-module (gnu packages linux) |
bc3a2e35 | 89 | #:use-module (gnu packages logging) |
6e64766a | 90 | #:use-module (gnu packages lua) |
5698b8b8 | 91 | #:use-module (gnu packages gnome) |
1b39a196 | 92 | #:use-module (gnu packages guile) |
668c06ac JD |
93 | #:use-module (gnu packages xorg) |
94 | #:use-module (gnu packages gl) | |
9f913401 | 95 | #:use-module (gnu packages imagemagick) |
8731e527 | 96 | #:use-module (gnu packages m4) |
d8c7eeb9 | 97 | #:use-module (gnu packages mpi) |
b92eee75 | 98 | #:use-module (gnu packages multiprecision) |
528bb464 | 99 | #:use-module (gnu packages netpbm) |
ba1be533 | 100 | #:use-module (gnu packages ocaml) |
668c06ac | 101 | #:use-module (gnu packages pcre) |
5698b8b8 | 102 | #:use-module (gnu packages popt) |
c9dfa3c7 AE |
103 | #:use-module (gnu packages perl) |
104 | #:use-module (gnu packages pkg-config) | |
ab5f3f21 | 105 | #:use-module (gnu packages pulseaudio) |
da95c817 | 106 | #:use-module (gnu packages python) |
589e3f4e | 107 | #:use-module (gnu packages python-web) |
5b05dce7 | 108 | #:use-module (gnu packages qt) |
c9dfa3c7 | 109 | #:use-module (gnu packages readline) |
63e07468 | 110 | #:use-module (gnu packages ruby) |
2742f87e | 111 | #:use-module (gnu packages tbb) |
479c4273 | 112 | #:use-module (gnu packages scheme) |
b7194849 | 113 | #:use-module (gnu packages shells) |
df354a77 | 114 | #:use-module (gnu packages tcl) |
668c06ac | 115 | #:use-module (gnu packages texinfo) |
8f9ac901 | 116 | #:use-module (gnu packages tex) |
b7b27a8f | 117 | #:use-module (gnu packages tls) |
5b05dce7 | 118 | #:use-module (gnu packages version-control) |
9aafbc0c | 119 | #:use-module (gnu packages wxwidgets) |
c12efc72 | 120 | #:use-module (gnu packages xml) |
a17d4564 | 121 | #:use-module (srfi srfi-1)) |
8f8b2451 | 122 | |
193abc82 JD |
123 | (define-public aris |
124 | (package | |
1f45f18a JD |
125 | (name "aris") |
126 | (version "2.2") | |
127 | (source (origin | |
128 | (method url-fetch) | |
129 | (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz")) | |
130 | (sha256 (base32 | |
131 | "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q")))) | |
132 | (build-system gnu-build-system) | |
133 | (inputs `(("gtk+" ,gtk+) | |
134 | ("libxml2" ,libxml2))) | |
135 | (native-inputs `(("pkg-config" ,pkg-config))) | |
136 | (synopsis "Natural deduction first-order logic interface") | |
137 | (description "Aris is a program for performing logical proofs. It supports | |
138 | propositional and predicate logic, as well as Boolean algebra and | |
139 | arithmetical logic. In addition to its predefined inference and equivalence | |
140 | rules, Aris also supports references to older proofs. Its use of standard | |
141 | logical symbols and its natural deduction interface make it easy to use for | |
142 | beginners.") | |
143 | (license license:gpl3+) | |
6fd52309 | 144 | (home-page "https://www.gnu.org/software/aris/"))) |
193abc82 | 145 | |
9c45c519 JD |
146 | (define-public c-graph |
147 | (package | |
148 | (name "c-graph") | |
149 | (version "2.0") | |
150 | (source (origin | |
151 | (method url-fetch) | |
152 | (uri (string-append "mirror://gnu/c-graph/c-graph-" version | |
153 | ".tar.gz")) | |
154 | (sha256 (base32 | |
155 | "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01")))) | |
156 | (build-system gnu-build-system) | |
157 | (inputs | |
158 | `(("fortran" ,gfortran))) | |
a3947cb1 | 159 | (synopsis "Visualizing and demonstrating convolution") |
9c45c519 | 160 | (description |
a3947cb1 LC |
161 | "GNU C-Graph is a tool for demonstrating the theory of convolution. |
162 | Thus, it can serve as an excellent aid to students of signal and systems | |
163 | theory in visualizing the convolution process. Rather than forcing the | |
164 | student to write code, the program offers an intuitive interface with | |
165 | interactive dialogs to guide them.") | |
9c45c519 | 166 | (license license:gpl3+) |
6fd52309 | 167 | (home-page "https://www.gnu.org/software/c-graph/"))) |
9c45c519 | 168 | |
d91025e3 TD |
169 | (define-public coda |
170 | (package | |
171 | (name "coda") | |
9285f8bb | 172 | (version "2.19") |
d91025e3 TD |
173 | (source |
174 | (origin | |
175 | (method url-fetch) | |
176 | (uri (string-append "https://github.com/stcorp/coda/releases/download/" | |
177 | version "/coda-" version ".tar.gz")) | |
178 | (sha256 | |
9285f8bb | 179 | (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245")) |
4b12fe5c TD |
180 | (patches (search-patches "coda-use-system-libs.patch")) |
181 | (modules '((guix build utils))) | |
182 | (snippet | |
183 | ;; Make sure we don't use the bundled software. | |
6cbee49d MW |
184 | '(begin |
185 | (for-each (lambda (d) | |
186 | (delete-file-recursively (string-append "libcoda/" d))) | |
187 | '("zlib" "pcre" "expat")) | |
188 | #t)))) | |
d91025e3 TD |
189 | (native-inputs |
190 | `(("fortran" ,gfortran) | |
191 | ("python" ,python) | |
192 | ("python-numpy" ,python-numpy))) | |
193 | (inputs | |
194 | `(("zlib" ,zlib) | |
4b12fe5c TD |
195 | ("pcre" ,pcre) |
196 | ("expat" ,expat) | |
d91025e3 TD |
197 | ("hdf4" ,hdf4-alt) |
198 | ("hdf5" ,hdf5))) | |
199 | (build-system gnu-build-system) | |
200 | (arguments | |
4b12fe5c TD |
201 | '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python" |
202 | "LIBS= -lz -lpcre -lexpat"))) | |
d91025e3 TD |
203 | (synopsis "A common interface to various earth observation data formats") |
204 | (description | |
205 | "The Common Data Access toolbox (CODA) provides a set of interfaces for | |
206 | reading remote sensing data from earth observation data files. It consists of | |
207 | command line applications and interfaces to the C, Fortran, Python, and Java | |
208 | programming languages.") | |
209 | (home-page "https://stcorp.nl/coda") | |
210 | (license license:gpl2+))) | |
211 | ||
d65f0661 KK |
212 | (define-public qhull |
213 | (package | |
214 | (name "qhull") | |
215 | (version "2015.2") | |
216 | (source (origin | |
217 | (method url-fetch) | |
218 | (uri (string-append "http://www.qhull.org/download/qhull-" | |
219 | (car (string-split version #\.)) | |
220 | "-src-7.2.0.tgz")) | |
221 | (sha256 | |
222 | (base32 | |
223 | "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q")))) | |
224 | (build-system cmake-build-system) | |
225 | (synopsis "Calculate convex hulls and related structures") | |
226 | (description | |
227 | "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi | |
228 | diagram, halfspace intersection about a point, furthest-site Delaunay | |
229 | triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d, | |
230 | 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull | |
231 | algorithm for computing the convex hull. It handles roundoff errors from | |
232 | floating point arithmetic. It computes volumes, surface areas, and | |
233 | approximations to the convex hull. | |
234 | ||
235 | @code{Qhull} does not support triangulation of non-convex surfaces, mesh | |
236 | generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha | |
237 | shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay | |
238 | triangulations.") | |
239 | (home-page "http://qhull.org") | |
240 | (license (license:non-copyleft "file://COPYING.txt" | |
241 | "See COPYING in the distribution.")))) | |
242 | ||
a8fa86c4 RW |
243 | (define-public python-cvxopt |
244 | (package | |
245 | (name "python-cvxopt") | |
246 | (version "1.2.1") | |
247 | (source (origin | |
248 | (method git-fetch) | |
249 | (uri (git-reference | |
250 | (url "https://github.com/cvxopt/cvxopt.git") | |
251 | (commit version))) | |
252 | (file-name (git-file-name name version)) | |
253 | (sha256 | |
254 | (base32 | |
255 | "05mnjil9palaa48xafdfh4f5pr4z7aqjr995rwl08qfyxs8y0crf")))) | |
256 | (build-system python-build-system) | |
257 | (arguments | |
258 | `(#:phases | |
259 | (modify-phases %standard-phases | |
260 | (add-after 'unpack 'find-libraries | |
261 | (lambda* (#:key inputs #:allow-other-keys) | |
262 | (setenv "CVXOPT_BLAS_LIB" "openblas") | |
263 | (setenv "CVXOPT_BUILD_FFTW" "1") | |
264 | (setenv "CVXOPT_BUILD_GLPK" "1") | |
265 | (setenv "CVXOPT_BUILD_GSL" "1") | |
266 | #t))))) | |
267 | (inputs | |
268 | `(("fftw" ,fftw) | |
269 | ("glpk" ,glpk) | |
270 | ("gsl" ,gsl) | |
271 | ("lapack" ,lapack) | |
272 | ("openblas" ,openblas) | |
273 | ("suitesparse" ,suitesparse))) | |
274 | (home-page "https://www.cvxopt.org") | |
275 | (synopsis "Python library for convex optimization") | |
276 | (description | |
277 | "CVXOPT is a package for convex optimization based on the Python | |
278 | programming language. Its main purpose is to make the development of software | |
279 | for convex optimization applications straightforward by building on Python’s | |
280 | extensive standard library and on the strengths of Python as a high-level | |
281 | programming language.") | |
282 | (license license:gpl3+))) | |
283 | ||
284 | (define-public python2-cvxopt | |
285 | (package-with-python2 python-cvxopt)) | |
286 | ||
8f8b2451 AE |
287 | (define-public units |
288 | (package | |
289 | (name "units") | |
4795e5e1 | 290 | (version "2.18") |
8f8b2451 AE |
291 | (source (origin |
292 | (method url-fetch) | |
293 | (uri (string-append "mirror://gnu/units/units-" version | |
294 | ".tar.gz")) | |
295 | (sha256 (base32 | |
4795e5e1 | 296 | "0y26kj349i048y4z3xrk90bvciw2j6ds3rka7r7yn3183hirr5b4")))) |
8f8b2451 | 297 | (build-system gnu-build-system) |
0498d248 | 298 | (inputs |
a2549713 EB |
299 | `(("readline" ,readline) |
300 | ("python" ,python-wrapper) ;for 'units_cur' script | |
0498d248 EB |
301 | ("python-requests" ,python-requests))) |
302 | (arguments | |
303 | `(#:phases (modify-phases %standard-phases | |
304 | (add-after 'install 'wrap-units_cur | |
305 | (lambda* (#:key outputs #:allow-other-keys) | |
306 | (let* ((out (assoc-ref outputs "out")) | |
307 | (bin (string-append out "/bin"))) | |
308 | (wrap-program (string-append bin "/units_cur") | |
309 | `("PYTHONPATH" ":" prefix | |
310 | ,(search-path-as-string->list (getenv "PYTHONPATH")))) | |
311 | #t)))))) | |
8f8b2451 AE |
312 | (synopsis "Conversion between thousands of scales") |
313 | (description | |
574e86f9 | 314 | "GNU Units converts numeric quantities between units of measure. It |
7c125ce0 AK |
315 | can handle scale changes through adaptive usage of standard scale |
316 | prefixes (micro-, kilo-, etc.). It can also handle nonlinear | |
317 | conversions such as Fahrenheit to Celsius. Its interpreter is powerful | |
318 | enough to be used effectively as a scientific calculator.") | |
8f8b2451 | 319 | (license license:gpl3+) |
6fd52309 | 320 | (home-page "https://www.gnu.org/software/units/"))) |
c9dfa3c7 | 321 | |
61a529b4 RW |
322 | (define-public double-conversion |
323 | (package | |
324 | (name "double-conversion") | |
02107081 | 325 | (version "3.1.0") |
b343850e | 326 | (home-page "https://github.com/google/double-conversion") |
61a529b4 | 327 | (source (origin |
2bdc73fb | 328 | (method git-fetch) |
02107081 | 329 | (uri (git-reference (url home-page) (commit version))) |
2bdc73fb | 330 | (file-name (git-file-name name version)) |
61a529b4 RW |
331 | (sha256 |
332 | (base32 | |
02107081 | 333 | "123rb2p4snqagrybw66vnapchqdwn2rfpr1wcq0ya9gwbyl7xccx")))) |
61a529b4 RW |
334 | (build-system cmake-build-system) |
335 | (arguments | |
336 | '(#:test-target "test" | |
337 | #:configure-flags '("-DBUILD_SHARED_LIBS=ON" | |
338 | "-DBUILD_TESTING=ON"))) | |
61a529b4 RW |
339 | (synopsis "Conversion routines for IEEE doubles") |
340 | (description | |
341 | "The double-conversion library provides binary-decimal and decimal-binary | |
342 | routines for IEEE doubles. The library consists of efficient conversion | |
343 | routines that have been extracted from the V8 JavaScript engine.") | |
344 | (license license:bsd-3))) | |
345 | ||
182d6311 ML |
346 | (define-public dionysus |
347 | (package | |
348 | (name "dionysus") | |
bd041e7f | 349 | (version "1.4.0") |
182d6311 ML |
350 | (source (origin |
351 | (method url-fetch) | |
352 | (uri (string-append "mirror://gnu/dionysus/dionysus-" version | |
bd041e7f | 353 | ".tar.xz")) |
182d6311 ML |
354 | (sha256 |
355 | (base32 | |
bd041e7f | 356 | "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk")))) |
182d6311 ML |
357 | (build-system gnu-build-system) |
358 | (inputs `(("tcl" ,tcl))) ;for 'tclsh' | |
359 | (synopsis "Local search for universal constants and scientific values") | |
360 | (description | |
361 | "GNU Dionysus is a convenient system for quickly retrieving the values of | |
362 | mathematical constants used in science and engineering. Values can be | |
363 | searched using a simple command-line tool, choosing from three databases: | |
364 | universal constants, atomic numbers, and constants related to | |
365 | semiconductors.") | |
366 | (license license:gpl3+) | |
6fd52309 | 367 | (home-page "https://www.gnu.org/software/dionysus/"))) |
182d6311 | 368 | |
88bd1804 AE |
369 | (define-public gsl |
370 | (package | |
371 | (name "gsl") | |
f3a34b9d | 372 | (version "2.5") |
ab2cc5cd LC |
373 | (source (origin |
374 | (method url-fetch) | |
375 | (uri (string-append "mirror://gnu/gsl/gsl-" | |
376 | version ".tar.gz")) | |
377 | (sha256 | |
378 | (base32 | |
f3a34b9d | 379 | "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04")) |
ab2cc5cd | 380 | (patches (search-patches "gsl-test-i686.patch")))) |
88bd1804 | 381 | (build-system gnu-build-system) |
71e0f288 | 382 | (arguments |
f885fc05 | 383 | `(;; Currently there are numerous tests that fail on "exotic" |
6f766069 EF |
384 | ;; architectures such as aarch64 and ppc64le. |
385 | ,@(if (string-prefix? "aarch64-linux" | |
386 | (or (%current-target-system) (%current-system))) | |
387 | '(#:tests? #f) | |
388 | '()))) | |
389 | (home-page "https://www.gnu.org/software/gsl/") | |
88bd1804 AE |
390 | (synopsis "Numerical library for C and C++") |
391 | (description | |
a22dc0c4 LC |
392 | "The GNU Scientific Library is a library for numerical analysis in C |
393 | and C++. It includes a wide range of mathematical routines, with over 1000 | |
394 | functions in total. Subject areas covered by the library include: | |
395 | differential equations, linear algebra, Fast Fourier Transforms and random | |
396 | numbers.") | |
88bd1804 AE |
397 | (license license:gpl3+))) |
398 | ||
ba1be533 BW |
399 | (define-public ocaml-gsl |
400 | (package | |
401 | (name "ocaml-gsl") | |
df1bc82b | 402 | (version "1.22.0") |
ba1be533 BW |
403 | (source |
404 | (origin | |
405 | (method url-fetch) | |
406 | (uri | |
407 | (string-append | |
df1bc82b KK |
408 | "https://github.com/mmottl/gsl-ocaml/releases/download/" |
409 | version "/gsl-" version ".tbz")) | |
ba1be533 BW |
410 | (sha256 |
411 | (base32 | |
df1bc82b | 412 | "17vcswipliq1b2idbzx1z95kskn1a4q4s5v04igilg0f7lnkaarb")))) |
ba1be533 BW |
413 | (build-system ocaml-build-system) |
414 | (inputs | |
415 | `(("gsl" ,gsl))) | |
416 | (home-page "https://mmottl.github.io/gsl-ocaml") | |
417 | (synopsis "Bindings to the GNU Scientific Library") | |
418 | (description | |
419 | "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for | |
420 | the OCaml language.") | |
421 | (license license:gpl3+))) | |
422 | ||
7adaab9f BW |
423 | (define-public ocaml4.01-gsl |
424 | (package-with-ocaml4.01 ocaml-gsl)) | |
425 | ||
b92eee75 AE |
426 | (define-public glpk |
427 | (package | |
428 | (name "glpk") | |
445929e0 | 429 | (version "4.65") |
b92eee75 AE |
430 | (source |
431 | (origin | |
432 | (method url-fetch) | |
433 | (uri (string-append "mirror://gnu/glpk/glpk-" | |
434 | version ".tar.gz")) | |
435 | (sha256 | |
436 | (base32 | |
445929e0 | 437 | "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2")))) |
b92eee75 AE |
438 | (build-system gnu-build-system) |
439 | (inputs | |
440 | `(("gmp" ,gmp))) | |
441 | (arguments | |
442 | `(#:configure-flags '("--with-gmp"))) | |
82110ef6 | 443 | (home-page "https://www.gnu.org/software/glpk/") |
79c311b8 | 444 | (synopsis "GNU Linear Programming Kit, supporting the MathProg language") |
b92eee75 AE |
445 | (description |
446 | "GLPK is a C library for solving large-scale linear programming (LP), | |
447 | mixed integer programming (MIP), and other related problems. It supports the | |
448 | GNU MathProg modeling language, a subset of the AMPL language, and features a | |
449 | translator for the language. In addition to the C library, a stand-alone | |
450 | LP/MIP solver is included in the package.") | |
451 | (license license:gpl3+))) | |
452 | ||
b146763a AE |
453 | (define-public 4ti2 |
454 | (package | |
455 | (name "4ti2") | |
456 | (version "1.6.7") | |
457 | (source | |
458 | (origin | |
459 | (method url-fetch) | |
460 | (uri (string-append "http://www.4ti2.de/version_" version | |
461 | "/4ti2-" version ".tar.gz")) | |
462 | (sha256 | |
463 | (base32 | |
464 | "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl")))) | |
465 | (build-system gnu-build-system) | |
466 | (native-inputs | |
467 | `(("which" ,(@ (gnu packages base) which)))) ; for the tests | |
468 | (inputs | |
469 | `(("glpk" ,glpk) | |
470 | ("gmp" ,gmp))) | |
471 | (home-page "http://www.4ti2.de/") | |
472 | (synopsis "Mathematical tool suite for problems on linear spaces") | |
473 | (description | |
474 | "4ti2 implements algorithms for solving algebraic, geometric and | |
475 | combinatorial problems on linear spaces. Among others, it solves systems | |
476 | of linear equations, computes extreme rays of polyhedral cones, solves | |
477 | integer programming problems and computes Markov bases for statistics.") | |
478 | (license license:gpl2+))) | |
479 | ||
53696f10 AE |
480 | (define-public cddlib |
481 | (package | |
482 | (name "cddlib") | |
7fe491fb | 483 | (version "0.94i") |
53696f10 AE |
484 | (source |
485 | (origin | |
486 | (method url-fetch) | |
182dde82 | 487 | (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-" |
53696f10 AE |
488 | (string-delete #\. version) ".tar.gz")) |
489 | (sha256 | |
490 | (base32 | |
7fe491fb | 491 | "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq")))) |
53696f10 AE |
492 | (build-system gnu-build-system) |
493 | (inputs | |
494 | `(("gmp" ,gmp))) | |
495 | (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html") | |
496 | (synopsis "Library for convex hulls and extreme rays of polyhedra") | |
497 | (description | |
498 | "The C-library cddlib implements the Double Description Method of | |
499 | Motzkin et al. for generating all vertices (i.e. extreme points) and extreme | |
500 | rays of a general convex polyhedron given by a system of linear inequalities | |
501 | in arbitrary dimension. It can also be used for the converse operation of | |
502 | computing convex hulls.") | |
503 | (license license:gpl2+))) | |
504 | ||
865a69dd RW |
505 | (define-public arpack-ng |
506 | (package | |
507 | (name "arpack-ng") | |
f03c4ec6 | 508 | (version "3.6.3") |
c0edb5b5 | 509 | (home-page "https://github.com/opencollab/arpack-ng") |
622ef2b9 MB |
510 | (source (origin |
511 | (method git-fetch) | |
512 | (uri (git-reference (url home-page) (commit version))) | |
513 | (file-name (git-file-name name version)) | |
514 | (sha256 | |
515 | (base32 | |
f03c4ec6 | 516 | "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y")))) |
865a69dd | 517 | (build-system gnu-build-system) |
c0edb5b5 LC |
518 | (native-inputs |
519 | `(("autoconf" ,autoconf) | |
520 | ("automake" ,automake) | |
521 | ("libtool" ,libtool))) | |
865a69dd RW |
522 | (inputs |
523 | `(("lapack" ,lapack) | |
19afbea1 | 524 | ("fortran" ,gfortran))) |
865a69dd RW |
525 | (synopsis "Fortran subroutines for solving eigenvalue problems") |
526 | (description | |
527 | "ARPACK-NG is a collection of Fortran77 subroutines designed to solve | |
528 | large scale eigenvalue problems.") | |
166191b3 | 529 | (license (license:non-copyleft "file://COPYING" |
865a69dd RW |
530 | "See COPYING in the distribution.")))) |
531 | ||
c0edb5b5 LC |
532 | (define-public arpack-ng-3.3.0 |
533 | (package | |
534 | (inherit arpack-ng) | |
535 | (version "3.3.0") | |
536 | (name (package-name arpack-ng)) | |
537 | (home-page (package-home-page arpack-ng)) | |
538 | (source | |
539 | (origin | |
540 | (method url-fetch) | |
541 | (uri (string-append home-page "/archive/" version ".tar.gz")) | |
542 | (file-name (string-append name "-" version ".tar.gz")) | |
543 | (sha256 | |
544 | (base32 | |
545 | "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd")))))) | |
546 | ||
8c94c886 EB |
547 | (define-public arpack-ng-openmpi |
548 | (package (inherit arpack-ng) | |
549 | (name "arpack-ng-openmpi") | |
550 | (inputs | |
551 | `(("mpi" ,openmpi) | |
552 | ,@(package-inputs arpack-ng))) | |
4f387541 LC |
553 | (arguments |
554 | (substitute-keyword-arguments (package-arguments arpack-ng) | |
555 | ((#:configure-flags _ '()) | |
aa82260b PG |
556 | ''("--enable-mpi")) |
557 | ((#:phases phases '%standard-phases) | |
558 | `(modify-phases ,phases | |
bbe46a4a EB |
559 | (add-before 'check 'mpi-setup |
560 | ,%openmpi-setup))))) | |
8c94c886 EB |
561 | (synopsis "Fortran subroutines for solving eigenvalue problems with MPI"))) |
562 | ||
da95c817 NK |
563 | (define-public lapack |
564 | (package | |
565 | (name "lapack") | |
ef39a177 | 566 | (version "3.7.1") |
da95c817 NK |
567 | (source |
568 | (origin | |
569 | (method url-fetch) | |
570 | (uri (string-append "http://www.netlib.org/lapack/lapack-" | |
571 | version ".tgz")) | |
572 | (sha256 | |
573 | (base32 | |
7c0d4c3a | 574 | "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign")))) |
da95c817 NK |
575 | (build-system cmake-build-system) |
576 | (home-page "http://www.netlib.org/lapack/") | |
19afbea1 | 577 | (inputs `(("fortran" ,gfortran) |
da95c817 NK |
578 | ("python" ,python-2))) |
579 | (arguments | |
3ab869b6 | 580 | `(#:configure-flags (list |
3ab869b6 LC |
581 | "-DBUILD_SHARED_LIBS:BOOL=YES" |
582 | "-DLAPACKE=ON" | |
583 | ||
584 | ;; Build the 'LAPACKE_clatms' functions. | |
585 | "-DLAPACKE_WITH_TMG=ON") | |
dc1d3cde KK |
586 | #:phases |
587 | (modify-phases %standard-phases | |
588 | (add-before 'check 'patch-python | |
589 | (lambda* (#:key inputs #:allow-other-keys) | |
590 | (let ((python (assoc-ref inputs "python"))) | |
591 | (substitute* "lapack_testing.py" | |
592 | (("/usr/bin/env python") python))) | |
593 | #t))))) | |
da95c817 NK |
594 | (synopsis "Library for numerical linear algebra") |
595 | (description | |
596 | "LAPACK is a Fortran 90 library for solving the most commonly occurring | |
597 | problems in numerical linear algebra.") | |
166191b3 | 598 | (license (license:non-copyleft "file://LICENSE" |
da95c817 | 599 | "See LICENSE in the distribution.")))) |
73fed4f8 | 600 | |
e1ff597a EB |
601 | (define-public scalapack |
602 | (package | |
603 | (name "scalapack") | |
604 | (version "2.0.2") | |
605 | (source | |
606 | (origin | |
607 | (method url-fetch) | |
608 | (uri (string-append "http://www.netlib.org/scalapack/scalapack-" | |
609 | version ".tgz")) | |
610 | (sha256 | |
611 | (base32 | |
612 | "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c")))) | |
613 | (build-system cmake-build-system) | |
614 | (inputs | |
615 | `(("mpi" ,openmpi) | |
616 | ("fortran" ,gfortran) | |
617 | ("lapack" ,lapack))) ;for testing only | |
618 | (arguments | |
6df2a50a LC |
619 | `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES") |
620 | #:phases (modify-phases %standard-phases | |
bbe46a4a EB |
621 | (add-before 'check 'mpi-setup |
622 | ,%openmpi-setup)))) | |
e1ff597a EB |
623 | (home-page "http://www.netlib.org/scalapack/") |
624 | (synopsis "Library for scalable numerical linear algebra") | |
625 | (description | |
626 | "ScaLAPACK is a Fortran 90 library of high-performance linear algebra | |
627 | routines on parallel distributed memory machines. ScaLAPACK solves dense and | |
628 | banded linear systems, least squares problems, eigenvalue problems, and | |
629 | singular value problems.") | |
630 | (license (license:bsd-style "file://LICENSE" | |
631 | "See LICENSE in the distribution.")))) | |
632 | ||
73fed4f8 | 633 | (define-public gnuplot |
5f800540 KK |
634 | (package |
635 | (name "gnuplot") | |
b13ba3f1 | 636 | (version "5.2.4") |
5f800540 KK |
637 | (source (origin |
638 | (method url-fetch) | |
639 | (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/" | |
640 | version "/gnuplot-" | |
641 | version ".tar.gz")) | |
642 | (sha256 | |
643 | (base32 | |
b13ba3f1 | 644 | "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m")))) |
5f800540 KK |
645 | (build-system gnu-build-system) |
646 | (inputs `(("readline" ,readline) | |
647 | ("cairo" ,cairo) | |
648 | ("pango" ,pango) | |
6e64766a DM |
649 | ("gd" ,gd) |
650 | ("lua" ,lua))) | |
612a387f RW |
651 | (native-inputs |
652 | `(("pkg-config" ,pkg-config) | |
653 | ("texlive" ,texlive-tiny))) | |
07254d8b AM |
654 | (arguments `(#:configure-flags (list (string-append |
655 | "--with-texdir=" %output | |
656 | "/texmf-local/tex/latex/gnuplot")))) | |
5f800540 KK |
657 | (home-page "http://www.gnuplot.info") |
658 | (synopsis "Command-line driven graphing utility") | |
659 | (description "Gnuplot is a portable command-line driven graphing | |
35b9e423 | 660 | utility. It was originally created to allow scientists and students to |
73fed4f8 | 661 | visualize mathematical functions and data interactively, but has grown to |
35b9e423 | 662 | support many non-interactive uses such as web scripting. It is also used as a |
73fed4f8 | 663 | plotting engine by third-party applications like Octave.") |
5f800540 KK |
664 | ;; X11 Style with the additional restriction that derived works may only be |
665 | ;; distributed as patches to the original. | |
666 | (license (license:fsf-free | |
667 | "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright")))) | |
668c06ac | 668 | |
32f70e1f TD |
669 | (define-public gctp |
670 | (package | |
671 | (name "gctp") | |
672 | (version "2.0.0") | |
673 | (source | |
674 | (origin | |
675 | (method url-fetch) | |
676 | (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v" | |
677 | version ".tar.gz")) | |
678 | (file-name (string-append name "-" version ".tar.gz")) | |
679 | (sha256 | |
680 | (base32 | |
681 | "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4")))) | |
682 | (native-inputs | |
683 | `(("fortran" ,gfortran))) | |
684 | (build-system gnu-build-system) | |
685 | (synopsis "General Cartographic Transformation Package (GCTP)") | |
686 | (description | |
687 | "The General Cartographic Transformation Package (GCTP) is a system of | |
688 | software routines designed to permit the transformation of coordinate pairs | |
689 | from one map projection to another. The GCTP is the standard computer | |
690 | software used by the National Mapping Division for map projection | |
691 | computations.") | |
692 | (home-page "https://github.com/OkoSanto/GCTP") | |
0f7cd95b | 693 | (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html |
32f70e1f | 694 | |
becbbefc TD |
695 | (define-public hdf4 |
696 | (package | |
697 | (name "hdf4") | |
0abf5264 | 698 | (version "4.2.13") |
becbbefc TD |
699 | (source |
700 | (origin | |
701 | (method url-fetch) | |
702 | (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF" | |
703 | version "/src/hdf-" version ".tar.bz2")) | |
704 | (sha256 | |
0abf5264 | 705 | (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm")) |
15ca49b2 AE |
706 | (patches (search-patches "hdf4-architectures.patch" |
707 | "hdf4-reproducibility.patch" | |
becbbefc | 708 | "hdf4-shared-fortran.patch")))) |
becbbefc TD |
709 | (build-system gnu-build-system) |
710 | (native-inputs | |
711 | `(("gfortran" ,gfortran) | |
712 | ("bison" ,bison) | |
713 | ("flex" ,flex))) | |
714 | (inputs | |
715 | `(("zlib" ,zlib) | |
716 | ("libjpeg" ,libjpeg))) | |
717 | (arguments | |
718 | `(#:parallel-tests? #f | |
719 | #:configure-flags '("--enable-shared") | |
720 | #:phases | |
721 | (modify-phases %standard-phases | |
953a12fa EF |
722 | ;; This is inspired by two of Debian's patches. |
723 | (add-before 'configure 'add-more-aarch64-support | |
724 | (lambda _ | |
725 | (substitute* '("mfhdf/ncgen/ncgen.l" | |
726 | "mfhdf/ncgen/ncgenyy.c" | |
727 | "mfhdf/libsrc/netcdf.h.in") | |
728 | (("AIX5L64") "__aarch64__")) | |
729 | #t)) | |
becbbefc TD |
730 | (add-before 'configure 'patchbuild |
731 | (lambda _ | |
732 | (substitute* | |
733 | '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in") | |
734 | (("/bin/rm") "rm") | |
735 | (("/bin/mkdir") "mkdir")) | |
736 | (substitute* (find-files "." "^Makefile\\.in$") | |
737 | (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \ | |
738 | -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "") | |
739 | (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \ | |
740 | -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \ | |
953a12fa | 741 | -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") "")) |
e464b455 TD |
742 | #t)) |
743 | (add-after 'configure 'patch-settings | |
744 | (lambda _ | |
745 | ;; libhdf4.settings contains the full path of the | |
746 | ;; compilers used, and its contents are included in | |
747 | ;; .so-files. We truncate the hashes to avoid | |
748 | ;; unnecessary store references to those compilers: | |
749 | (substitute* "libhdf4.settings" | |
750 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
751 | (string-append prefix (string-take hash 10) "..."))) | |
752 | #t)) | |
753 | ))) | |
becbbefc TD |
754 | (home-page "https://www.hdfgroup.org/products/hdf4/") |
755 | (synopsis | |
756 | "Library and multi-object file format for storing and managing data") | |
757 | (description "HDF4 is a library and multi-object file format for storing | |
758 | and managing data between machines. HDF4 is an older hierarchical data format, | |
759 | incompatible with HDF5.") | |
760 | (license | |
761 | (license:non-copyleft | |
762 | "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING")))) | |
763 | ||
764 | (define-public hdf4-alt | |
765 | (package | |
766 | (inherit hdf4) | |
767 | (name "hdf4-alt") | |
768 | (arguments | |
769 | (substitute-keyword-arguments (package-arguments hdf4) | |
770 | ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags)))) | |
771 | (synopsis | |
772 | "HDF4 without netCDF API, can be combined with the regular netCDF library"))) | |
773 | ||
7ee3f1a2 JD |
774 | (define-public hdf5 |
775 | (package | |
776 | (name "hdf5") | |
2da63064 | 777 | (version "1.8.19") |
7ee3f1a2 JD |
778 | (source |
779 | (origin | |
780 | (method url-fetch) | |
2da63064 TD |
781 | (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/" |
782 | "hdf5-" (version-major+minor version) | |
783 | "/hdf5-" version "/src/hdf5-" | |
dcd9d163 LF |
784 | version ".tar.bz2") |
785 | (string-append "https://support.hdfgroup.org/ftp/HDF5/" | |
786 | "current" | |
787 | (apply string-append | |
788 | (take (string-split version #\.) 2)) | |
789 | "/src/hdf5-" version ".tar.bz2"))) | |
7ee3f1a2 | 790 | (sha256 |
2da63064 | 791 | (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r")) |
b8d9c93b | 792 | (patches (list (search-patch "hdf5-config-date.patch"))))) |
7ee3f1a2 | 793 | (build-system gnu-build-system) |
12ed1216 AE |
794 | (inputs |
795 | `(("zlib" ,zlib))) | |
e3a1a1de TD |
796 | (native-inputs |
797 | `(("gfortran" ,gfortran))) | |
798 | (outputs '("out" ; core library | |
799 | "fortran")) ; fortran interface | |
7ee3f1a2 | 800 | (arguments |
62126576 | 801 | `(;; Some of the users, notably Flann, need the C++ interface. |
e3a1a1de TD |
802 | #:configure-flags '("--enable-cxx" |
803 | "--enable-fortran" | |
804 | "--enable-fortran2003") | |
4dba441c RW |
805 | ;; Use -fPIC to allow the R bindings to link with the static libraries |
806 | #:make-flags (list "CFLAGS=-fPIC" | |
807 | "CXXFLAGS=-fPIC") | |
62126576 | 808 | #:phases |
f622e212 EB |
809 | (modify-phases %standard-phases |
810 | (add-before 'configure 'patch-configure | |
e3a1a1de | 811 | (lambda* (#:key outputs #:allow-other-keys) |
f622e212 | 812 | (substitute* "configure" |
b8d9c93b | 813 | (("/bin/mv") "mv")) |
e3a1a1de TD |
814 | (substitute* "fortran/src/Makefile.in" |
815 | (("libhdf5_fortran_la_LDFLAGS =") | |
816 | (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath=" | |
817 | (assoc-ref outputs "fortran") "/lib"))) | |
818 | (substitute* "hl/fortran/src/Makefile.in" | |
819 | (("libhdf5hl_fortran_la_LDFLAGS =") | |
820 | (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath=" | |
821 | (assoc-ref outputs "fortran") "/lib"))) | |
b8d9c93b | 822 | #t)) |
fd0378a1 TD |
823 | (add-after 'configure 'patch-settings |
824 | (lambda _ | |
825 | ;; libhdf5.settings contains the full path of the | |
826 | ;; compilers used, and its contents are included in | |
827 | ;; libhdf5.so. We truncate the hashes to avoid | |
828 | ;; unnecessary store references to those compilers: | |
829 | (substitute* "src/libhdf5.settings" | |
830 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
d8f46d52 RW |
831 | (string-append prefix (string-take hash 10) "...")) |
832 | ;; Don't record the build-time kernel version to make the | |
833 | ;; settings file reproducible. | |
834 | (("Uname information:.*") | |
835 | "Uname information: Linux\n")) | |
b8d9c93b | 836 | #t)) |
f622e212 EB |
837 | (add-after 'install 'patch-references |
838 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
839 | (let ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
840 | (zlib (assoc-ref inputs "zlib"))) | |
841 | (substitute* (find-files bin "h5p?cc") | |
842 | (("-lz" lib) | |
843 | (string-append "-L" zlib "/lib " lib))) | |
e3a1a1de TD |
844 | #t))) |
845 | (add-after 'install 'split | |
846 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
847 | ;; Move all fortran-related files | |
848 | (let* ((out (assoc-ref outputs "out")) | |
849 | (bin (string-append out "/bin")) | |
850 | (lib (string-append out "/lib")) | |
851 | (inc (string-append out "/include")) | |
852 | (ex (string-append out "/share/hdf5_examples/fortran")) | |
853 | (fort (assoc-ref outputs "fortran")) | |
854 | (fbin (string-append fort "/bin")) | |
855 | (flib (string-append fort "/lib")) | |
856 | (finc (string-append fort "/include")) | |
857 | (fex (string-append fort "/share/hdf5_examples/fortran"))) | |
858 | (mkdir-p fbin) | |
859 | (mkdir-p flib) | |
860 | (mkdir-p finc) | |
861 | (mkdir-p fex) | |
b0d1e60f PG |
862 | ;; Note: When built with --enable-parallel, the 'h5fc' file |
863 | ;; doesn't exist, hence this condition. | |
864 | (when (file-exists? (string-append bin "/h5fc")) | |
865 | (rename-file (string-append bin "/h5fc") | |
866 | (string-append fbin "/h5fc"))) | |
e3a1a1de TD |
867 | (for-each (lambda (file) |
868 | (rename-file file | |
869 | (string-append flib "/" (basename file)))) | |
870 | (find-files lib ".*fortran.*")) | |
871 | (for-each (lambda (file) | |
872 | (rename-file file | |
873 | (string-append finc "/" (basename file)))) | |
874 | (find-files inc ".*mod")) | |
875 | (for-each (lambda (file) | |
876 | (rename-file file | |
877 | (string-append fex "/" (basename file)))) | |
878 | (find-files ex ".*")) | |
879 | (delete-file-recursively ex)) | |
880 | #t))))) | |
7ee3f1a2 | 881 | (home-page "http://www.hdfgroup.org") |
516e93f8 | 882 | (synopsis "Management suite for extremely large and complex data") |
7ee3f1a2 JD |
883 | (description "HDF5 is a suite that makes possible the management of |
884 | extremely large and complex data collections.") | |
d4bf49b1 EB |
885 | (license (license:x11-style |
886 | "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING")))) | |
7ee3f1a2 | 887 | |
bb47aca5 RW |
888 | (define-public hdf5-1.10 |
889 | (package (inherit hdf5) | |
890 | (version "1.10.4") | |
891 | (source | |
892 | (origin | |
893 | (method url-fetch) | |
894 | (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/" | |
895 | "hdf5-" (version-major+minor version) | |
896 | "/hdf5-" version "/src/hdf5-" | |
897 | version ".tar.bz2") | |
898 | (string-append "https://support.hdfgroup.org/ftp/HDF5/" | |
899 | "current" | |
900 | (apply string-append | |
901 | (take (string-split version #\.) 2)) | |
902 | "/src/hdf5-" version ".tar.bz2"))) | |
903 | (sha256 | |
904 | (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj")) | |
905 | (patches (list (search-patch "hdf5-config-date.patch"))))))) | |
906 | ||
2fd26d05 TD |
907 | (define-public hdf-java |
908 | (package | |
909 | (name "hdf-java") | |
910 | (version "3.3.2") | |
911 | (source | |
912 | (origin | |
913 | (method url-fetch) | |
914 | (uri (string-append | |
915 | "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-" | |
916 | version "/src/CMake-hdfjava-" version ".tar.gz")) | |
917 | (sha256 | |
918 | (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr")) | |
919 | (modules '((guix build utils))) | |
920 | (snippet ; Make sure we don't use the bundled sources and binaries. | |
921 | `(begin | |
922 | (for-each delete-file | |
923 | (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz" | |
924 | "HDF4.tar.gz" "HDF5.tar.gz")) | |
6cbee49d MW |
925 | (delete-file-recursively ,(string-append "hdfjava-" version "/lib")) |
926 | #t)))) | |
2fd26d05 TD |
927 | (build-system gnu-build-system) |
928 | (native-inputs | |
929 | `(("jdk" ,icedtea "jdk") | |
930 | ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'. | |
931 | ;; For tests: | |
932 | ("hamcrest-core" ,java-hamcrest-core) | |
933 | ("junit" ,java-junit) | |
934 | ("slf4j-simple" ,java-slf4j-simple))) | |
935 | (inputs | |
936 | `(("hdf4" ,hdf4) | |
937 | ("hdf5" ,hdf5) | |
938 | ("zlib" ,zlib) | |
939 | ("libjpeg" ,libjpeg) | |
940 | ("slf4j-api" ,java-slf4j-api))) | |
941 | (arguments | |
942 | `(#:configure-flags | |
943 | (list (string-append "--target=" ,(or (%current-target-system) (%current-system))) | |
944 | (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include," | |
945 | (assoc-ref %build-inputs "jdk") "/lib" ) | |
946 | (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib") | |
947 | (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib")) | |
948 | ||
949 | #:make-flags | |
950 | (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib") | |
951 | (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib") | |
952 | (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so") | |
953 | (string-append "JPEGLIB=" | |
954 | (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so") | |
955 | "LLEXT=so") | |
956 | ||
957 | #:phases | |
958 | (modify-phases %standard-phases | |
959 | (add-before 'configure 'chdir-to-source | |
960 | (lambda _ (chdir ,(string-append "hdfjava-" version)))) | |
961 | (add-before 'configure 'patch-build | |
962 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
963 | (substitute* "configure" | |
964 | (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles | |
965 | (("/bin/cat") (which "cat"))) | |
966 | ;; Set classpath for compilation | |
967 | (substitute* '("hdf/hdf5lib/Makefile.in" | |
968 | "hdf/hdf5lib/exceptions/Makefile.in" | |
969 | "hdf/hdflib/Makefile.in") | |
970 | (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar") | |
971 | (string-append (assoc-ref inputs "slf4j-api") | |
972 | "/share/java/slf4j-api.jar"))) | |
973 | ;; Replace outdated config.sub and config.guess: | |
974 | (with-directory-excursion "config" | |
975 | (for-each (lambda (file) | |
976 | (copy-file | |
977 | (string-append (assoc-ref inputs "automake") | |
978 | "/share/automake-1.15/" file) file)) | |
979 | '("config.sub" "config.guess"))) | |
980 | (mkdir-p (string-append (assoc-ref outputs "out"))) | |
981 | ;; Set classpath for tests | |
982 | (let* ((build-dir (getcwd)) | |
983 | (lib (string-append build-dir "/lib")) | |
984 | (jhdf (string-append lib "/jhdf.jar")) | |
985 | (jhdf5 (string-append lib "/jhdf5.jar")) | |
986 | (testjars | |
987 | (map (lambda (i) | |
988 | (string-append (assoc-ref inputs i) | |
989 | "/share/java/" i ".jar")) | |
990 | '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple"))) | |
991 | (class-path | |
992 | (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":"))) | |
993 | ||
994 | (substitute* '("test/hdf5lib/Makefile.in" | |
995 | "test/hdf5lib/junit.sh.in" | |
996 | "examples/runExample.sh.in") | |
997 | (("/usr/bin/test") | |
998 | (string-append (assoc-ref inputs "coreutils") | |
999 | "/bin/test")) | |
1000 | (("/usr/bin/uname") | |
1001 | (string-append (assoc-ref inputs "coreutils") | |
1002 | "/bin/uname")) | |
1003 | (("CLASSPATH=[^\n]*") | |
1004 | (string-append "CLASSPATH=" class-path))) | |
1005 | (setenv "CLASSPATH" class-path)) | |
1006 | #t)) | |
1007 | (add-before 'check 'build-examples | |
1008 | (lambda _ | |
1009 | (zero? (apply system* `("javac" | |
1010 | ,@(find-files "examples" ".*\\.java"))))))) | |
1011 | ||
1012 | #:parallel-build? #f | |
1013 | ||
1014 | #:parallel-tests? #f )) | |
1015 | (home-page "https://support.hdfgroup.org/products/java") | |
1016 | (synopsis "Java interface for the HDF4 and HDF5 libraries") | |
1017 | (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use | |
1018 | the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are | |
1019 | implemented in C.") | |
1020 | ||
1021 | ;; BSD-style license: | |
1022 | (license (license:x11-style | |
1023 | "https://support.hdfgroup.org/ftp/HDF5/hdf-java\ | |
1024 | /current/src/unpacked/COPYING")))) | |
1025 | ||
d3c4f3bb TD |
1026 | (define-public hdf-eos2 |
1027 | (package | |
1028 | (name "hdf-eos2") | |
1029 | (version "19.1.0") | |
1030 | (source | |
1031 | (origin | |
1032 | (method url-fetch) | |
1033 | (uri "ftp://edhs1.gsfc.nasa.gov\ | |
1034 | /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z") | |
1035 | (sha256 | |
1036 | (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz")) | |
1037 | (patches (search-patches "hdf-eos2-remove-gctp.patch" | |
1038 | "hdf-eos2-build-shared.patch" | |
1039 | "hdf-eos2-fortrantests.patch")))) | |
1040 | (build-system gnu-build-system) | |
1041 | (native-inputs | |
1042 | `(("gfortran" ,gfortran))) | |
1043 | (inputs | |
1044 | `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API | |
1045 | ("zlib" ,zlib) | |
1046 | ("libjpeg" ,libjpeg) | |
1047 | ("gctp" ,gctp))) | |
1048 | (arguments | |
1049 | `( #:configure-flags '("--enable-install-include" "--enable-shared" | |
1050 | "CC=h4cc -Df2cFortran" "LIBS=-lgctp") | |
1051 | #:parallel-tests? #f)) | |
1052 | (home-page "http://hdfeos.org/software/library.php#HDF-EOS2") | |
1053 | (synopsis "HDF4-based data format for NASA's Earth Observing System") | |
1054 | (description "HDF-EOS2 is a software library built on HDF4 which supports | |
1055 | the construction of data structures used in NASA's Earth Observing | |
1056 | System (Grid, Point and Swath).") | |
1057 | ||
1058 | ;; Source files carry a permissive license header. | |
1059 | (license (license:non-copyleft home-page)))) | |
1060 | ||
0f43f835 TD |
1061 | (define-public hdf-eos5 |
1062 | (package | |
1063 | (name "hdf-eos5") | |
1064 | (version "1.15") | |
1065 | (source (origin | |
1066 | (method url-fetch) | |
1067 | (uri (string-append "ftp://edhs1.gsfc.nasa.gov\ | |
1068 | /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z")) | |
1069 | (sha256 | |
1070 | (base32 | |
1071 | "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i")) | |
1072 | (patches (search-patches "hdf-eos5-build-shared.patch" | |
1073 | "hdf-eos5-remove-gctp.patch" | |
1074 | "hdf-eos5-fix-szip.patch" | |
1075 | "hdf-eos5-fortrantests.patch")))) | |
1076 | (native-inputs | |
1077 | `(("gfortran" ,gfortran))) | |
1078 | (build-system gnu-build-system) | |
1079 | (inputs | |
1080 | `(("hdf5" ,hdf5) | |
1081 | ("zlib" ,zlib) | |
1082 | ("gctp" ,gctp))) | |
1083 | (arguments | |
1084 | `(#:configure-flags '("--enable-install-include" "--enable-shared" | |
1085 | "CC=h5cc -Df2cFortran" "LIBS=-lgctp") | |
1086 | #:parallel-tests? #f)) | |
1087 | (synopsis "HDF5-based data format for NASA's Earth Observing System") | |
1088 | (description | |
1089 | "HDF-EOS5 is a software library built on HDF5 to support the construction | |
1090 | of data structures used in NASA's Earth Observing System (Grid, Point and | |
1091 | Swath).") | |
1092 | (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5") | |
1093 | ||
1094 | ;; Source files carry a permissive license header. | |
1095 | (license (license:non-copyleft home-page)))) | |
1096 | ||
c8378eea EB |
1097 | (define-public hdf5-parallel-openmpi |
1098 | (package (inherit hdf5) | |
1099 | (name "hdf5-parallel-openmpi") | |
1100 | (inputs | |
1101 | `(("mpi" ,openmpi) | |
1102 | ,@(package-inputs hdf5))) | |
1103 | (arguments | |
45201bf2 PG |
1104 | (substitute-keyword-arguments (package-arguments hdf5) |
1105 | ((#:configure-flags flags) | |
1106 | ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags))) | |
c8378eea EB |
1107 | ((#:phases phases) |
1108 | `(modify-phases ,phases | |
45201bf2 PG |
1109 | (add-after 'build 'mpi-setup |
1110 | ,%openmpi-setup) | |
c8378eea EB |
1111 | (add-before 'check 'patch-tests |
1112 | (lambda _ | |
1113 | ;; OpenMPI's mpirun will exit with non-zero status if it | |
1114 | ;; detects an "abnormal termination", i.e. any process not | |
1115 | ;; calling MPI_Finalize(). Since the test is explicitely | |
1116 | ;; avoiding MPI_Finalize so as not to have at_exit and thus | |
1117 | ;; H5C_flush_cache from being called, mpirun will always | |
1118 | ;; complain, so turn this test off. | |
1119 | (substitute* "testpar/Makefile" | |
1120 | (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back) | |
1121 | (string-append front back "\n"))) | |
1122 | (substitute* "tools/h5diff/testph5diff.sh" | |
1123 | (("/bin/sh") (which "sh"))) | |
1124 | #t)))))) | |
1125 | (synopsis "Management suite for data with parallel IO support"))) | |
1126 | ||
00775104 EB |
1127 | (define-public h5check |
1128 | (package | |
1129 | (name "h5check") | |
1130 | (version "2.0.1") | |
1131 | (source | |
1132 | (origin | |
1133 | (method url-fetch) | |
1134 | (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/" | |
1135 | "h5check/src/h5check-" version ".tar.gz")) | |
1136 | (sha256 | |
1137 | (base32 | |
1138 | "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj")))) | |
1139 | (build-system gnu-build-system) | |
1140 | (inputs `(("hdf5" ,hdf5))) ;h5cc for tests | |
1141 | (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html") | |
1142 | (synopsis "HDF5 format checker") | |
1143 | (description "@code{h5check} is a validation tool for verifying that an | |
1144 | HDF5 file is encoded according to the HDF File Format Specification.") | |
1145 | (license (license:x11-style "file://COPYING")))) | |
1146 | ||
a53d6719 JD |
1147 | (define-public itpp |
1148 | (package | |
1149 | (name "itpp") | |
1150 | (version "4.3.1") | |
1151 | (source (origin | |
1152 | (method url-fetch) | |
1153 | (uri (string-append "mirror://sourceforge/itpp/itpp/" | |
1154 | version "/itpp-" | |
1155 | version ".tar.gz")) | |
1156 | (sha256 | |
1157 | (base32 | |
1158 | "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm")))) | |
1159 | (build-system cmake-build-system) | |
1160 | (arguments `(#:tests? #f)) ; Tests require googletest *sources* | |
1161 | (inputs `(("lapack" ,lapack) | |
1162 | ("fftw" ,fftw))) | |
3a4d5df2 RW |
1163 | ;; FIXME: Even though the fonts are available dvips complains: |
1164 | ;; "Font cmmi10 not found; characters will be left blank." | |
1165 | (native-inputs | |
1166 | `(("texlive" ,texlive-tiny) | |
1167 | ("ghostscript" ,ghostscript) | |
1168 | ("doxygen" ,doxygen))) | |
a53d6719 JD |
1169 | (home-page "http://itpp.sourceforge.net") |
1170 | (synopsis "C++ library of maths, signal processing and communication classes") | |
1171 | (description "IT++ is a C++ library of mathematical, signal processing and | |
1172 | communication classes and functions. Its main use is in simulation of | |
1173 | communication systems and for performing research in the area of | |
1174 | communications. The kernel of the library consists of generic vector and | |
1175 | matrix classes, and a set of accompanying routines. Such a kernel makes IT++ | |
1176 | similar to MATLAB, GNU Octave or SciPy.") | |
1177 | (license license:gpl3+))) | |
1178 | ||
889187a4 EB |
1179 | (define-public netcdf |
1180 | (package | |
1181 | (name "netcdf") | |
a4b0bfb1 | 1182 | (version "4.4.1.1") |
889187a4 EB |
1183 | (source |
1184 | (origin | |
1185 | (method url-fetch) | |
1186 | (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/" | |
1187 | "netcdf-" version ".tar.gz")) | |
1188 | (sha256 | |
1189 | (base32 | |
a4b0bfb1 EB |
1190 | "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d")) |
1191 | (patches (search-patches "netcdf-date-time.patch" | |
1192 | "netcdf-tst_h_par.patch")))) | |
889187a4 EB |
1193 | (build-system gnu-build-system) |
1194 | (native-inputs | |
1195 | `(("m4" ,m4) | |
1196 | ("doxygen" ,doxygen) | |
1197 | ("graphviz" ,graphviz))) | |
1198 | (inputs | |
db825570 TD |
1199 | `(("hdf4" ,hdf4-alt) |
1200 | ("hdf5" ,hdf5) | |
1201 | ("zlib" ,zlib) | |
1202 | ("libjpeg" ,libjpeg))) | |
889187a4 | 1203 | (arguments |
db825570 | 1204 | `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4") |
43d01672 TD |
1205 | |
1206 | #:phases (modify-phases %standard-phases | |
1207 | (add-before 'configure 'fix-source-date | |
1208 | (lambda _ | |
1209 | ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build | |
1210 | ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate | |
1211 | ;; to '1st hour of the current day', and therefore makes the | |
1212 | ;; package not reproducible. | |
1213 | (substitute* "./configure" | |
1214 | (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"") | |
1215 | "date --date='@0'")) | |
1216 | #t)) | |
1217 | (add-after 'configure 'patch-settings | |
1218 | (lambda _ | |
1219 | ;; libnetcdf.settings contains the full filename of the compilers | |
1220 | ;; used to build the library. We truncate the hashes of those | |
1221 | ;; filenames to avoid unnecessary references to the corresponding | |
1222 | ;; store items. | |
1223 | (substitute* "libnetcdf.settings" | |
1224 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
1225 | (string-append prefix (string-take hash 10) "..."))) | |
1226 | #t))) | |
1227 | ||
889187a4 EB |
1228 | #:parallel-tests? #f)) ;various race conditions |
1229 | (home-page "http://www.unidata.ucar.edu/software/netcdf/") | |
1230 | (synopsis "Library for scientific data") | |
1231 | (description "NetCDF is an interface for scientific data access and a | |
1232 | software library that provides an implementation of the interface. The netCDF | |
1233 | library defines a machine-independent format for representing scientific data. | |
1234 | Together, the interface, library, and format support the creation, access, and | |
1235 | sharing of scientific data.") | |
1236 | (license (license:x11-style "file://COPYRIGHT")))) | |
1237 | ||
1238 | (define-public netcdf-parallel-openmpi | |
1239 | (package (inherit netcdf) | |
1240 | (name "netcdf-parallel-openmpi") | |
1241 | (inputs | |
1242 | `(("mpi" ,openmpi) | |
1243 | ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi) | |
1244 | (package-inputs netcdf)))) | |
1245 | ;; TODO: Replace pkg-config references in nc-config with absolute references | |
1246 | (arguments | |
1247 | (substitute-keyword-arguments (package-arguments netcdf) | |
1248 | ((#:configure-flags flags) | |
1249 | `(cons* "CC=mpicc" "CXX=mpicxx" | |
1250 | "--enable-parallel-tests" | |
1251 | ;; Shared libraries not supported with parallel IO. | |
1252 | "--disable-shared" "--with-pic" | |
1253 | ,flags)))))) | |
1254 | ||
300200b6 TD |
1255 | (define-public netcdf-fortran |
1256 | (package | |
1257 | (name "netcdf-fortran") | |
1258 | (version "4.4.4") | |
1259 | (source (origin | |
1260 | (method url-fetch) | |
1261 | (uri (string-append | |
1262 | "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-" | |
1263 | version ".tar.gz")) | |
1264 | (sha256 | |
1265 | (base32 | |
1266 | "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj")))) | |
1267 | (build-system gnu-build-system) | |
1268 | (arguments | |
1269 | `(#:parallel-tests? #f)) | |
1270 | (inputs | |
1271 | `(("netcdf" ,netcdf))) | |
1272 | (native-inputs | |
1273 | `(("gfortran" ,gfortran))) | |
1274 | (synopsis "Fortran interface for the netCDF library") | |
1275 | (description (package-description netcdf)) | |
1276 | (home-page (package-home-page netcdf)) | |
1277 | (license (package-license netcdf)))) | |
1278 | ||
1b39a196 RJ |
1279 | (define-public nlopt |
1280 | (package | |
1281 | (name "nlopt") | |
1282 | (version "2.4.2") | |
1283 | (source (origin | |
1284 | (method url-fetch) | |
1285 | (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-" | |
1286 | version ".tar.gz")) | |
1287 | (sha256 | |
1288 | (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0")))) | |
1289 | (build-system gnu-build-system) | |
1290 | (arguments | |
1291 | `(;; Shared libraries are not built by default. They are required to | |
1292 | ;; build the Guile, Octave, and Python bindings. | |
1293 | #:configure-flags '("--enable-shared") | |
1294 | ||
1295 | #:phases | |
1296 | (modify-phases %standard-phases | |
1297 | (add-before 'configure 'set-libnlopt-file-name | |
1298 | (lambda* (#:key outputs #:allow-other-keys) | |
1299 | ;; Make sure the Scheme module refers to the library by its | |
1300 | ;; absolute file name (we cannot do that from a snippet | |
1301 | ;; because the expansion of @libdir@ contains | |
1302 | ;; ${exec_prefix}.) | |
1303 | (let ((out (assoc-ref outputs "out"))) | |
1304 | (substitute* "swig/nlopt.scm.in" | |
1305 | (("libnlopt") | |
1306 | (string-append out "/lib/libnlopt"))) | |
1307 | #t)))))) | |
1308 | (inputs `(("guile" ,guile-2.0))) | |
1309 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1310 | (home-page "http://ab-initio.mit.edu/wiki/") | |
1311 | (synopsis "Library for nonlinear optimization") | |
1312 | (description "NLopt is a library for nonlinear optimization, providing a | |
1313 | common interface for a number of different free optimization routines available | |
1314 | online as well as original implementations of various other algorithms.") | |
1315 | (license license:lgpl2.1+))) | |
1316 | ||
005c787d LC |
1317 | (define-public ipopt |
1318 | (package | |
1319 | (name "ipopt") | |
1320 | (version "3.12.5") | |
1321 | (source (origin | |
1322 | (method url-fetch) | |
1323 | (uri (string-append | |
1324 | "http://www.coin-or.org/download/source/Ipopt/Ipopt-" | |
1325 | version".tgz")) | |
1326 | (sha256 | |
1327 | (base32 | |
1328 | "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk")) | |
1329 | (modules '((guix build utils))) | |
1330 | (snippet | |
1331 | ;; Make sure we don't use the bundled software. | |
6cbee49d MW |
1332 | '(begin |
1333 | (delete-file-recursively "ThirdParty") | |
1334 | #t)))) | |
005c787d | 1335 | (build-system gnu-build-system) |
ad1c4537 LC |
1336 | (arguments |
1337 | '(#:phases (modify-phases %standard-phases | |
1338 | (add-after 'install 'add--L-flags-in-ipopt.pc | |
1339 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1340 | ;; The '.pc' file lists '-llapack -lblas' in "Libs"; | |
1341 | ;; move it to "Libs.private" where it belongs, and add a | |
1342 | ;; '-L' flag for LAPACK. | |
1343 | (let ((out (assoc-ref outputs "out")) | |
1344 | (lapack (assoc-ref inputs "lapack"))) | |
1345 | (substitute* (string-append out "/lib/pkgconfig/" | |
1346 | "ipopt.pc") | |
1347 | (("Libs: (.*)-llapack -lblas(.*)$" _ before after) | |
1348 | (string-append "Libs: " before " " after "\n" | |
1349 | "Libs.private: " before | |
1350 | "-L" lapack "/lib -llapack -lblas " | |
1351 | after "\n"))) | |
1352 | #t)))))) | |
005c787d LC |
1353 | (native-inputs |
1354 | `(("gfortran" ,gfortran))) | |
1355 | (inputs | |
1356 | ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL. | |
ad1c4537 | 1357 | `(("lapack" ,lapack))) ;for both libblas and liblapack |
005c787d LC |
1358 | (home-page "http://www.coin-or.org") |
1359 | (synopsis "Large-scale nonlinear optimizer") | |
1360 | (description | |
1361 | "The Interior Point Optimizer (IPOPT) is a software package for | |
1362 | large-scale nonlinear optimization. It provides C++, C, and Fortran | |
1363 | interfaces.") | |
1364 | (license license:epl1.0))) | |
1365 | ||
f9940ef1 LC |
1366 | (define-public ceres |
1367 | (package | |
1368 | (name "ceres-solver") | |
e0bee0de | 1369 | (version "1.14.0") |
f9940ef1 LC |
1370 | (home-page "http://ceres-solver.org/") |
1371 | (source (origin | |
1372 | (method url-fetch) | |
1373 | (uri (string-append home-page "ceres-solver-" | |
1374 | version ".tar.gz")) | |
1375 | (sha256 | |
1376 | (base32 | |
e0bee0de | 1377 | "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27")))) |
f9940ef1 LC |
1378 | (build-system cmake-build-system) |
1379 | (arguments | |
1380 | ;; TODO: Build HTML user documentation and install separately. | |
bc3a2e35 | 1381 | '(#:configure-flags '("-DBUILD_EXAMPLES=OFF" |
f9940ef1 LC |
1382 | "-DBUILD_SHARED_LIBS=ON") |
1383 | ||
1384 | #:phases (modify-phases %standard-phases | |
1385 | (add-before 'configure 'set-library-directory | |
1386 | (lambda _ | |
1387 | ;; Install libraries to lib/, not lib64/. | |
1388 | (substitute* "internal/ceres/CMakeLists.txt" | |
1389 | (("set\\(LIB_SUFFIX \"64\"\\)") | |
1390 | "set(LIB_SUFFIX \"\")")) | |
1391 | #t))))) | |
1392 | (native-inputs | |
1393 | `(("pkg-config" ,pkg-config))) | |
468e0b18 LC |
1394 | (propagated-inputs |
1395 | `(("glog" ,glog))) ;for #include <glog/glog.h> | |
f9940ef1 LC |
1396 | (inputs |
1397 | `(("eigen" ,eigen) | |
1398 | ("blas" ,openblas) | |
1399 | ("lapack" ,lapack) | |
1400 | ("suitesparse" ,suitesparse) | |
1401 | ("gflags" ,gflags))) | |
1402 | (synopsis "C++ library for solving large optimization problems") | |
1403 | (description | |
1404 | "Ceres Solver is a C++ library for modeling and solving large, | |
1405 | complicated optimization problems. It is a feature rich, mature and | |
1406 | performant library which has been used in production since 2010. Ceres Solver | |
1407 | can solve two kinds of problems: | |
1408 | @enumerate | |
1409 | @item non-linear least squares problems with bounds constraints; | |
1410 | @item general unconstrained optimization problems. | |
1411 | @end enumerate\n") | |
1412 | (license license:bsd-3))) | |
1413 | ||
b66741ed | 1414 | ;; For a fully featured Octave, users are strongly recommended also to install |
5ca4fe96 | 1415 | ;; the following packages: less, ghostscript, gnuplot. |
5537603f | 1416 | (define-public octave-cli |
668c06ac | 1417 | (package |
5537603f | 1418 | (name "octave-cli") |
b66741ed | 1419 | (version "4.4.1") |
668c06ac JD |
1420 | (source |
1421 | (origin | |
1422 | (method url-fetch) | |
1423 | (uri (string-append "mirror://gnu/octave/octave-" | |
f5a077b1 | 1424 | version ".tar.lz")) |
668c06ac JD |
1425 | (sha256 |
1426 | (base32 | |
b66741ed | 1427 | "0jsdgizlv02an2ppfjwk5qf209zpwi3317yb7jvlsjzxnir3lvhy")))) |
668c06ac JD |
1428 | (build-system gnu-build-system) |
1429 | (inputs | |
1430 | `(("lapack" ,lapack) | |
c215fa21 | 1431 | ("qhull" ,qhull) |
668c06ac | 1432 | ("readline" ,readline) |
181170c6 | 1433 | ("gl2ps" ,gl2ps) |
668c06ac | 1434 | ("glpk" ,glpk) |
1ec78e9d EB |
1435 | ("fftw" ,fftw) |
1436 | ("fftwf" ,fftwf) | |
1437 | ("arpack" ,arpack-ng) | |
668c06ac JD |
1438 | ("pcre" ,pcre) |
1439 | ("fltk" ,fltk) | |
1440 | ("fontconfig" ,fontconfig) | |
1441 | ("freetype" ,freetype) | |
40029cbe | 1442 | ("hdf5" ,hdf5) |
668c06ac JD |
1443 | ("libxft" ,libxft) |
1444 | ("mesa" ,mesa) | |
1ec78e9d | 1445 | ("glu" ,glu) |
9f913401 AI |
1446 | ("zlib" ,zlib) |
1447 | ("curl" ,curl) | |
5ca4fe96 | 1448 | ("texinfo" ,texinfo) |
ab5f3f21 KK |
1449 | ("graphicsmagick" ,graphicsmagick) |
1450 | ("suitesparse" ,suitesparse) | |
1451 | ("libsndfile" ,libsndfile) | |
1452 | ("portaudio" ,portaudio) | |
1453 | ("alsa-lib" ,alsa-lib))) | |
668c06ac | 1454 | (native-inputs |
f5a077b1 EF |
1455 | `(("lzip" ,lzip) |
1456 | ("gfortran" ,gfortran) | |
668c06ac JD |
1457 | ("pkg-config" ,pkg-config) |
1458 | ("perl" ,perl) | |
1ec78e9d EB |
1459 | ;; The following inputs are not actually used in the build process. |
1460 | ;; However, the ./configure gratuitously tests for their existence and | |
1461 | ;; assumes that programs not present at build time are also not, and | |
1462 | ;; can never be, available at run time! If these inputs are therefore | |
1463 | ;; not present, support for them will be built out. However, Octave | |
1464 | ;; will still run without them, albeit without the features they | |
668c06ac JD |
1465 | ;; provide. |
1466 | ("less" ,less) | |
668c06ac JD |
1467 | ("ghostscript" ,ghostscript) |
1468 | ("gnuplot" ,gnuplot))) | |
116af86f KK |
1469 | ;; Octave code uses this variable to detect directories holding multiple CA |
1470 | ;; certificates to verify peers with. This is required for the networking | |
1471 | ;; functions that require encryption to work properly. | |
1472 | (native-search-paths | |
1473 | (list (search-path-specification | |
1474 | (variable "CURLOPT_CAPATH") | |
1475 | (files '("etc/ssl/certs"))))) | |
668c06ac | 1476 | (arguments |
b7b27a8f KY |
1477 | `(#:configure-flags |
1478 | (list (string-append "--with-shell=" | |
1479 | (assoc-ref %build-inputs "bash") | |
5ca4fe96 AI |
1480 | "/bin/sh")) |
1481 | #:phases | |
1482 | (modify-phases %standard-phases | |
1483 | (add-after 'configure 'configure-makeinfo | |
1484 | (lambda* (#:key inputs #:allow-other-keys) | |
1485 | (substitute* "libinterp/corefcn/help.cc" | |
1486 | (("Vmakeinfo_program = \"makeinfo\"") | |
1487 | (string-append "Vmakeinfo_program = \"" | |
1488 | (assoc-ref inputs "texinfo") | |
1489 | "/bin/makeinfo\""))) | |
1490 | #t))))) | |
f5a077b1 | 1491 | (home-page "https://www.gnu.org/software/octave/") |
668c06ac | 1492 | (synopsis "High-level language for numerical computation") |
1ec78e9d EB |
1493 | (description "GNU Octave is a high-level interpreted language that is |
1494 | specialized for numerical computations. It can be used for both linear and | |
1495 | non-linear applications and it provides great support for visualizing results. | |
1496 | Work may be performed both at the interactive command-line as well as via | |
1497 | script files.") | |
668c06ac | 1498 | (license license:gpl3+))) |
3de01d3f | 1499 | |
e0ae7e73 | 1500 | (define-public octave |
5537603f | 1501 | (package (inherit octave-cli) |
e0ae7e73 | 1502 | (name "octave") |
7a3772b3 | 1503 | (source (origin |
5537603f | 1504 | (inherit (package-source octave-cli)))) |
36ce25f0 KK |
1505 | (inputs |
1506 | `(("qscintilla" ,qscintilla) | |
1507 | ("qt" ,qtbase) | |
5537603f | 1508 | ,@(package-inputs octave-cli))) |
36ce25f0 KK |
1509 | (native-inputs |
1510 | `(("qttools" , qttools) ;for lrelease | |
7a3772b3 | 1511 | ("texlive" ,texlive) ;for texi2dvi |
5537603f | 1512 | ,@(package-native-inputs octave-cli))) |
36ce25f0 | 1513 | (arguments |
5537603f | 1514 | (substitute-keyword-arguments (package-arguments octave-cli) |
36ce25f0 KK |
1515 | ((#:phases phases) |
1516 | `(modify-phases ,phases | |
1517 | (add-before 'configure 'patch-qscintilla-library-name | |
1518 | (lambda* (#:key inputs #:allow-other-keys) | |
1519 | ;; The QScintilla library that the Octave configure script tries | |
1520 | ;; to link with should be named libqscintilla-qt5.so, but the | |
1521 | ;; QScintilla input provides the shared library as | |
1522 | ;; libqscintilla2_qt5.so. | |
1523 | (substitute* "configure" | |
1524 | (("qscintilla2-qt5") | |
1525 | "qscintilla2_qt5")) | |
1526 | #t)))))))) | |
1527 | ||
e0ae7e73 KK |
1528 | (define-public qtoctave |
1529 | (deprecated-package "qtoctave" octave)) | |
1530 | ||
5d4bd4cc PG |
1531 | (define-public opencascade-oce |
1532 | (package | |
1533 | (name "opencascade-oce") | |
1534 | (version "0.17.2") | |
1535 | (source | |
1536 | (origin | |
1537 | (method url-fetch) | |
1538 | (uri (string-append | |
1539 | "https://github.com/tpaviot/oce/archive/OCE-" | |
1540 | version | |
1541 | ".tar.gz")) | |
a4f393b7 | 1542 | (patches (search-patches "opencascade-oce-glibc-2.26.patch")) |
5d4bd4cc PG |
1543 | (sha256 |
1544 | (base32 | |
1545 | "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd")))) | |
1546 | (build-system cmake-build-system) | |
1547 | (arguments | |
1548 | '(#:configure-flags | |
1549 | (list "-DOCE_TESTING:BOOL=ON" | |
1550 | "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON" | |
1551 | "-DOCE_DRAW:BOOL=ON" | |
1552 | (string-append "-DOCE_INSTALL_PREFIX:PATH=" | |
1553 | (assoc-ref %outputs "out")) | |
1554 | "-UCMAKE_INSTALL_RPATH"))) | |
1555 | (inputs | |
1556 | `(("freetype" ,freetype) | |
1557 | ("glu" ,glu) | |
1558 | ("libxmu" ,libxmu) | |
1559 | ("mesa" ,mesa) | |
1560 | ("tcl" ,tcl) | |
1561 | ("tk" ,tk))) | |
1562 | (native-inputs | |
1563 | `(("python" ,python-wrapper))) | |
1564 | (home-page "https://github.com/tpaviot/oce") | |
1565 | (synopsis "Libraries for 3D modeling and numerical simulation") | |
1566 | (description | |
1567 | "Open CASCADE is a set of libraries for the development of applications | |
1568 | dealing with 3D CAD data or requiring industrial 3D capabilities. It includes | |
1569 | C++ class libraries providing services for 3D surface and solid modeling, CAD | |
1570 | data exchange, and visualization. It is used for development of specialized | |
1571 | software dealing with 3D models in design (CAD), manufacturing (CAM), | |
1572 | numerical simulation (CAE), measurement equipment (CMM), and quality | |
1573 | control (CAQ) domains. | |
1574 | ||
1575 | This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers | |
1576 | patches, improvements, and experiments contributed by users over the official | |
1577 | Open CASCADE library.") | |
1578 | (license (list license:lgpl2.1; OCE libraries, with an exception for the | |
1579 | ; use of header files; see | |
1580 | ; OCCT_LGPL_EXCEPTION.txt | |
1581 | license:public-domain; files | |
1582 | ; src/Standard/Standard_StdAllocator.hxx and | |
1583 | ; src/NCollection/NCollection_StdAllocator.hxx | |
1584 | license:expat; file src/OpenGl/OpenGl_glext.h | |
1585 | license:bsd-3)))); test framework gtest | |
1586 | ||
3de01d3f EB |
1587 | (define-public gmsh |
1588 | (package | |
1589 | (name "gmsh") | |
8a4d14fa | 1590 | (version "2.16.0") |
3de01d3f EB |
1591 | (source |
1592 | (origin | |
1593 | (method url-fetch) | |
1c79e086 | 1594 | (uri (string-append "http://gmsh.info/src/gmsh-" |
3de01d3f EB |
1595 | version "-source.tgz")) |
1596 | (sha256 | |
8a4d14fa | 1597 | (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8")) |
3de01d3f EB |
1598 | (modules '((guix build utils))) |
1599 | (snippet | |
1600 | ;; Remove non-free METIS code | |
6cbee49d MW |
1601 | '(begin |
1602 | (delete-file-recursively "contrib/Metis") | |
1603 | #t)))) | |
3de01d3f | 1604 | (build-system cmake-build-system) |
3de01d3f EB |
1605 | (propagated-inputs |
1606 | `(("fltk" ,fltk) | |
19afbea1 | 1607 | ("gfortran" ,gfortran) |
3de01d3f | 1608 | ("gmp" ,gmp) |
40029cbe | 1609 | ("hdf5" ,hdf5) |
3de01d3f EB |
1610 | ("lapack" ,lapack) |
1611 | ("mesa" ,mesa) | |
85f41902 | 1612 | ("glu" ,glu) |
45548139 | 1613 | ("opencascade-oce" ,opencascade-oce) |
3de01d3f EB |
1614 | ("libx11" ,libx11) |
1615 | ("libxext" ,libxext))) | |
66395a61 EF |
1616 | (inputs |
1617 | `(("fontconfig" ,fontconfig) | |
1618 | ("libxft" ,libxft))) | |
3de01d3f EB |
1619 | (arguments |
1620 | `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF" | |
1621 | "-DENABLE_BUILD_SHARED:BOOL=ON" | |
45548139 | 1622 | "-DENABLE_BUILD_DYNAMIC:BOOL=ON"))) |
3de01d3f EB |
1623 | (home-page "http://www.geuz.org/gmsh/") |
1624 | (synopsis "3D finite element grid generator") | |
edf684ef EB |
1625 | (description "Gmsh is a 3D finite element grid generator with a built-in |
1626 | CAD engine and post-processor. Its design goal is to provide a fast, light | |
1627 | and user-friendly meshing tool with parametric input and advanced | |
1628 | visualization capabilities. Gmsh is built around four modules: geometry, | |
1629 | mesh, solver and post-processing. The specification of any input to these | |
1630 | modules is done either interactively using the graphical user interface or in | |
1631 | ASCII text files using Gmsh's own scripting language.") | |
3de01d3f | 1632 | (license license:gpl2+))) |
b9100e2f | 1633 | |
6d5f63b6 JD |
1634 | (define-public maxflow |
1635 | (package | |
1636 | (name "maxflow") | |
1637 | (version "3.04") | |
1638 | (source (origin | |
1639 | (method git-fetch) | |
1640 | (uri (git-reference | |
1641 | (url "https://github.com/gerddie/maxflow.git") | |
1642 | (commit "42401fa54823d16b9da47716f04e5d9ef1605875"))) | |
1643 | (file-name (string-append name "-" version "-checkout")) | |
1644 | (sha256 | |
1645 | (base32 | |
1646 | "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb")))) | |
1647 | (build-system cmake-build-system) | |
1648 | (home-page "http://pub.ist.ac.at/~vnk/software.html") | |
1649 | (synopsis "Library implementing Maxflow algorithm") | |
1650 | (description "An implementation of the maxflow algorithm described in | |
1651 | @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for | |
1652 | Energy Minimization in Computer Vision.\n | |
1653 | Yuri Boykov and Vladimir Kolmogorov.\n | |
1654 | In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n | |
1655 | September 2004}") | |
1656 | (license license:gpl3+))) | |
1657 | ||
b9100e2f EB |
1658 | (define-public petsc |
1659 | (package | |
1660 | (name "petsc") | |
e6951e4e | 1661 | (version "3.10.2") |
b9100e2f EB |
1662 | (source |
1663 | (origin | |
1664 | (method url-fetch) | |
1665 | ;; The *-lite-* tarball does not contain the *large* documentation | |
1666 | (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/" | |
1667 | "petsc-lite-" version ".tar.gz")) | |
1668 | (sha256 | |
e6951e4e | 1669 | (base32 "0bl64pydak3rblnjffi482r8bin4xim9sb37ksl2jkcxf0i0irsi")))) |
a3a99e27 | 1670 | (outputs '("out" ;libraries and headers |
c15be128 | 1671 | "examples")) ;~30MiB of examples |
b9100e2f EB |
1672 | (build-system gnu-build-system) |
1673 | (native-inputs | |
6fec298d | 1674 | `(("python" ,python-2))) |
b9100e2f | 1675 | (inputs |
19afbea1 | 1676 | `(("gfortran" ,gfortran) |
b9100e2f | 1677 | ("lapack" ,lapack) |
f258212d | 1678 | ("superlu" ,superlu) |
b9100e2f EB |
1679 | ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi |
1680 | ;; leaving out opengl, as configuration seems to only be for mac | |
1681 | )) | |
1682 | (arguments | |
1683 | `(#:test-target "test" | |
9a899cce | 1684 | #:parallel-build? #f ;build is parallel by default |
b9100e2f EB |
1685 | #:configure-flags |
1686 | `("--with-mpi=0" | |
f258212d | 1687 | "--with-openmp=1" |
c15be128 | 1688 | "--with-superlu=1") |
9731c412 EB |
1689 | #:make-flags |
1690 | ;; Honor (parallel-job-count) for build. Do not use --with-make-np, | |
1691 | ;; whose value is dumped to $out/lib/petsc/conf/petscvariables. | |
1692 | (list (format #f "MAKE_NP=~a" (parallel-job-count))) | |
b9100e2f | 1693 | #:phases |
64dcc289 EB |
1694 | (modify-phases %standard-phases |
1695 | (replace 'configure | |
1696 | ;; PETSc's configure script is actually a python script, so we can't | |
1697 | ;; run it with bash. | |
1698 | (lambda* (#:key outputs (configure-flags '()) | |
1699 | #:allow-other-keys) | |
1700 | (let* ((prefix (assoc-ref outputs "out")) | |
1701 | (flags `(,(string-append "--prefix=" prefix) | |
1702 | ,@configure-flags))) | |
1703 | (format #t "build directory: ~s~%" (getcwd)) | |
1704 | (format #t "configure flags: ~s~%" flags) | |
49fdd357 | 1705 | (apply invoke "./configure" flags)))) |
64dcc289 | 1706 | (add-after 'configure 'clean-local-references |
9731c412 | 1707 | (lambda* (#:key outputs #:allow-other-keys) |
64dcc289 EB |
1708 | (let ((out (assoc-ref outputs "out"))) |
1709 | (substitute* (find-files "." "^petsc(conf|machineinfo).h$") | |
b730b437 EB |
1710 | ;; Prevent build directory from leaking into compiled code |
1711 | (((getcwd)) out) | |
1712 | ;; Scrub timestamp for reproducibility | |
fafd623e | 1713 | ((".*Libraries compiled on.*") "")) |
9731c412 EB |
1714 | (substitute* (find-files "." "petscvariables") |
1715 | ;; Do not expose build machine characteristics, set to defaults. | |
1716 | (("MAKE_NP = [:digit:]+") "MAKE_NP = 2") | |
1717 | (("NPMAX = [:digit:]+") "NPMAX = 2")) | |
fafd623e | 1718 | #t))) |
64dcc289 | 1719 | (add-after 'install 'clean-install |
10b11968 EB |
1720 | ;; Try to keep installed files from leaking build directory names. |
1721 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
64dcc289 | 1722 | (let ((out (assoc-ref outputs "out"))) |
10b11968 | 1723 | (substitute* (map (lambda (file) |
9a899cce | 1724 | (string-append out "/lib/petsc/conf/" file)) |
fafd623e | 1725 | '("petscvariables")) |
10b11968 EB |
1726 | (((getcwd)) out)) |
1727 | ;; Make compiler references point to the store | |
9a899cce | 1728 | (substitute* (string-append out "/lib/petsc/conf/petscvariables") |
dfdf5716 EB |
1729 | (("= (gcc|g\\+\\+|gfortran)" _ compiler) |
1730 | (string-append "= " (which compiler)))) | |
10b11968 EB |
1731 | ;; PETSc installs some build logs, which aren't necessary. |
1732 | (for-each (lambda (file) | |
9a899cce | 1733 | (let ((f (string-append out "/lib/petsc/conf/" file))) |
10b11968 EB |
1734 | (when (file-exists? f) |
1735 | (delete-file f)))) | |
9a899cce EB |
1736 | '("configure.log" "make.log" "gmake.log" |
1737 | "test.log" "error.log" "RDict.db" | |
fafd623e | 1738 | "PETScBuildInternal.cmake" |
10b11968 | 1739 | ;; Once installed, should uninstall with Guix |
fafd623e | 1740 | "uninstall.py")) |
a3a99e27 EB |
1741 | #t))) |
1742 | (add-after 'install 'move-examples | |
1743 | (lambda* (#:key outputs #:allow-other-keys) | |
1744 | (let* ((out (assoc-ref outputs "out")) | |
1745 | (examples (assoc-ref outputs "examples")) | |
1746 | (exdir (string-append out "/share/petsc/examples")) | |
1747 | (exdir' (string-append examples "/share/petsc/examples"))) | |
1748 | (copy-recursively exdir exdir') | |
1749 | (delete-file-recursively exdir) | |
fafd623e | 1750 | #t)))))) |
b9100e2f | 1751 | (home-page "http://www.mcs.anl.gov/petsc") |
16ecf3ff | 1752 | (synopsis "Library to solve PDEs") |
b9100e2f EB |
1753 | (description "PETSc, pronounced PET-see (the S is silent), is a suite of |
1754 | data structures and routines for the scalable (parallel) solution of | |
1755 | scientific applications modeled by partial differential equations.") | |
166191b3 | 1756 | (license (license:non-copyleft |
b9100e2f EB |
1757 | "http://www.mcs.anl.gov/petsc/documentation/copyright.html")))) |
1758 | ||
1759 | (define-public petsc-complex | |
1760 | (package (inherit petsc) | |
1761 | (name "petsc-complex") | |
1762 | (arguments | |
1763 | (substitute-keyword-arguments (package-arguments petsc) | |
1764 | ((#:configure-flags cf) | |
1765 | `(cons "--with-scalar-type=complex" ,cf)))) | |
16ecf3ff | 1766 | (synopsis "Library to solve PDEs (with complex scalars)"))) |
183e44ae | 1767 | |
d8c7eeb9 EB |
1768 | (define-public petsc-openmpi |
1769 | (package (inherit petsc) | |
1770 | (name "petsc-openmpi") | |
1771 | (inputs | |
9e2aa70b | 1772 | `(("hdf5" ,hdf5-parallel-openmpi) |
af523673 | 1773 | ("hypre" ,hypre-openmpi) |
9e2aa70b PG |
1774 | ("metis" ,metis) |
1775 | ("mumps" ,mumps-openmpi) | |
1776 | ("openmpi" ,openmpi) | |
1777 | ("scalapack" ,scalapack) | |
72f95783 | 1778 | ("scotch" ,pt-scotch32) |
d8c7eeb9 EB |
1779 | ,@(package-inputs petsc))) |
1780 | (arguments | |
1781 | (substitute-keyword-arguments (package-arguments petsc) | |
1782 | ((#:configure-flags cf) | |
af523673 PG |
1783 | ``("--with-hypre=1" |
1784 | "--with-mpiexec=mpirun" | |
9e2aa70b PG |
1785 | "--with-metis=1" |
1786 | "--with-mumps=1" | |
1787 | "--with-scalapack=1" | |
1788 | "--with-ptscotch=1" | |
d8c7eeb9 EB |
1789 | ,(string-append "--with-mpi-dir=" |
1790 | (assoc-ref %build-inputs "openmpi")) | |
71ca16b5 PG |
1791 | ,(string-append "--with-hdf5-include=" |
1792 | (assoc-ref %build-inputs "hdf5") "/include") | |
1793 | ,(string-append "--with-hdf5-lib=" | |
1794 | (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a") | |
1795 | ,@(delete "--with-mpi=0" ,cf))) | |
1796 | ((#:phases phases) | |
1797 | `(modify-phases ,phases | |
9e2aa70b | 1798 | (add-before 'configure 'mpi-setup |
bbe46a4a | 1799 | ,%openmpi-setup))))) |
9e2aa70b | 1800 | (synopsis "Library to solve PDEs (with MUMPS and MPI support)"))) |
d8c7eeb9 EB |
1801 | |
1802 | (define-public petsc-complex-openmpi | |
1803 | (package (inherit petsc-complex) | |
1804 | (name "petsc-complex-openmpi") | |
1805 | (inputs | |
1806 | `(("openmpi" ,openmpi) | |
1807 | ,@(package-inputs petsc-complex))) | |
1808 | (arguments | |
1809 | (substitute-keyword-arguments (package-arguments petsc-complex) | |
1810 | ((#:configure-flags cf) | |
1811 | ``("--with-mpiexec=mpirun" | |
1812 | ,(string-append "--with-mpi-dir=" | |
1813 | (assoc-ref %build-inputs "openmpi")) | |
1814 | ,@(delete "--with-mpi=0" ,cf))))) | |
16ecf3ff | 1815 | (synopsis "Library to solve PDEs (with complex scalars and MPI support)"))) |
d8c7eeb9 | 1816 | |
90ff2874 PG |
1817 | (define-public python-petsc4py |
1818 | (package | |
1819 | (name "python-petsc4py") | |
cd3681a2 | 1820 | (version "3.10.0") |
90ff2874 PG |
1821 | (source |
1822 | (origin | |
1823 | (method url-fetch) | |
1824 | (uri (pypi-uri "petsc4py" version)) | |
1825 | (sha256 | |
1826 | (base32 | |
cd3681a2 | 1827 | "0ch3g6dsvxl7qi984fcssv7cxfbif4bw04gkvxl2l1b8wrmvrm25")))) |
90ff2874 PG |
1828 | (build-system python-build-system) |
1829 | (arguments | |
1830 | `(#:phases | |
1831 | (modify-phases %standard-phases | |
1832 | (add-before 'build 'pre-build | |
1833 | (lambda _ | |
1834 | ;; Define path to PETSc installation. | |
1835 | (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc")) | |
1836 | #t)) | |
1837 | (add-before 'check 'mpi-setup | |
1838 | ,%openmpi-setup)))) | |
1839 | (inputs | |
1840 | `(("petsc" ,petsc-openmpi) | |
1841 | ("python-numpy" ,python-numpy))) | |
1842 | (home-page "https://bitbucket.org/petsc/petsc4py/") | |
1843 | (synopsis "Python bindings for PETSc") | |
1844 | (description "PETSc, the Portable, Extensible Toolkit for | |
1845 | Scientific Computation, is a suite of data structures and routines for | |
1846 | the scalable (parallel) solution of scientific applications modeled by | |
1847 | partial differential equations. It employs the MPI standard for all | |
1848 | message-passing communication. @code{petsc4py} provides Python | |
1849 | bindings to almost all functions of PETSc.") | |
1850 | (license license:bsd-3))) | |
1851 | ||
560acf25 MB |
1852 | (define-public python-kiwisolver |
1853 | (package | |
1854 | (name "python-kiwisolver") | |
1855 | (version "1.0.1") | |
1856 | (source (origin | |
1857 | (method url-fetch) | |
1858 | (uri (pypi-uri "kiwisolver" version)) | |
1859 | (sha256 | |
1860 | (base32 | |
1861 | "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf")))) | |
1862 | (build-system python-build-system) | |
1863 | (home-page "https://github.com/nucleic/kiwi") | |
1864 | (synopsis "Fast implementation of the Cassowary constraint solver") | |
1865 | (description | |
1866 | "Kiwi is an efficient C++ implementation of the Cassowary constraint | |
1867 | solving algorithm. Kiwi has been designed from the ground up to be | |
1868 | lightweight and fast. Kiwi ranges from 10x to 500x faster than the original | |
1869 | Cassowary solver with typical use cases gaining a 40x improvement. Memory | |
1870 | savings are consistently > 5x.") | |
1871 | (license license:bsd-3))) | |
1872 | ||
1873 | (define-public python2-kiwisolver | |
1874 | (package-with-python2 python-kiwisolver)) | |
1875 | ||
a7f01414 EB |
1876 | (define-public slepc |
1877 | (package | |
1878 | (name "slepc") | |
e93da160 | 1879 | (version "3.10.1") |
a7f01414 EB |
1880 | (source |
1881 | (origin | |
1882 | (method url-fetch) | |
baeaf882 EB |
1883 | (uri (string-append "http://slepc.upv.es/download/distrib/slepc-" |
1884 | version ".tar.gz")) | |
a7f01414 EB |
1885 | (sha256 |
1886 | (base32 | |
e93da160 | 1887 | "188j1a133q91h8pivpnzwcf78kz8dvz2nzf6ndnjygdbqb48fizn")))) |
a7f01414 EB |
1888 | (build-system gnu-build-system) |
1889 | (native-inputs | |
1890 | `(("python" ,python-2))) | |
1891 | (inputs | |
1892 | `(("arpack" ,arpack-ng) | |
1893 | ("gfortran" ,gfortran))) | |
1894 | (propagated-inputs | |
1895 | `(("petsc" ,petsc))) | |
1896 | (arguments | |
1897 | `(#:parallel-build? #f ;build is parallel by default | |
1898 | #:configure-flags | |
1899 | `(,(string-append "--with-arpack-dir=" | |
9cf52454 | 1900 | (assoc-ref %build-inputs "arpack") "/lib")) |
9731c412 EB |
1901 | #:make-flags ;honor (parallel-job-count) |
1902 | `(,(format #f "MAKE_NP=~a" (parallel-job-count))) | |
a7f01414 EB |
1903 | #:phases |
1904 | (modify-phases %standard-phases | |
8787c555 | 1905 | (replace 'configure |
a7f01414 EB |
1906 | ;; configure is a python script, so we can't run it with bash. |
1907 | (lambda* (#:key inputs outputs (configure-flags '()) | |
1908 | #:allow-other-keys) | |
1909 | (let* ((prefix (assoc-ref outputs "out")) | |
1910 | (flags `(,(string-append "--prefix=" prefix) | |
1911 | ,@configure-flags))) | |
1912 | (format #t "build directory: ~s~%" (getcwd)) | |
1913 | (format #t "configure flags: ~s~%" flags) | |
1914 | (setenv "SLEPC_DIR" (getcwd)) | |
9cf52454 | 1915 | (setenv "PETSC_DIR" (assoc-ref inputs "petsc")) |
c6840089 | 1916 | (apply invoke "./configure" flags)))) |
8787c555 | 1917 | (add-after 'install 'delete-doc |
a7f01414 EB |
1918 | ;; TODO: SLEPc installs HTML documentation alongside headers in |
1919 | ;; $out/include. We'd like to move them to share/doc, but delete | |
1920 | ;; them for now, as they are incomplete and installing the complete | |
1921 | ;; documentation is difficult. | |
1922 | (lambda* (#:key outputs #:allow-other-keys) | |
1923 | (let* ((out (assoc-ref outputs "out"))) | |
0f6dc120 TGR |
1924 | (for-each delete-file (find-files out "\\.html$")) |
1925 | #t))) | |
8787c555 | 1926 | (add-after 'install 'clean-install |
a7f01414 EB |
1927 | ;; Clean up unnecessary build logs from installation. |
1928 | (lambda* (#:key outputs #:allow-other-keys) | |
1929 | (let ((out (assoc-ref outputs "out"))) | |
1930 | (for-each (lambda (file) | |
1931 | (let ((f (string-append out "/lib/slepc/conf/" file))) | |
1932 | (when (file-exists? f) | |
1933 | (delete-file f)))) | |
1934 | '("configure.log" "make.log" "gmake.log" | |
1935 | "test.log" "error.log" "RDict.db" | |
0f6dc120 TGR |
1936 | "uninstall.py")) |
1937 | #t)))))) | |
a7f01414 EB |
1938 | (home-page "http://slepc.upv.es") |
1939 | (synopsis "Scalable library for eigenproblems") | |
1940 | (description "SLEPc is a software library for the solution of large sparse | |
1941 | eigenproblems on parallel computers. It can be used for the solution of | |
1942 | linear eigenvalue problems formulated in either standard or generalized form, | |
1943 | as well as other related problems such as the singular value decomposition. | |
1944 | The emphasis of the software is on methods and techniques appropriate for | |
1945 | problems in which the associated matrices are sparse, for example, those | |
1946 | arising after the discretization of partial differential equations.") | |
3c524f21 | 1947 | (license license:bsd-2))) |
a7f01414 EB |
1948 | |
1949 | (define-public slepc-complex | |
1950 | (package (inherit slepc) | |
1951 | (name "slepc-complex") | |
1952 | (propagated-inputs | |
1953 | `(("petsc" ,petsc-complex) | |
1954 | ,@(alist-delete "petsc" (package-propagated-inputs slepc)))) | |
1955 | (synopsis "Scalable library for eigenproblems (with complex scalars)"))) | |
1956 | ||
1957 | (define-public slepc-openmpi | |
1958 | (package (inherit slepc) | |
1959 | (name "slepc-openmpi") | |
6df2a50a LC |
1960 | (arguments |
1961 | (substitute-keyword-arguments (package-arguments slepc) | |
1962 | ((#:phases phases '%standard-phases) | |
1963 | `(modify-phases ,phases | |
bbe46a4a EB |
1964 | (add-before 'check 'mpi-setup |
1965 | ,%openmpi-setup))))) | |
a7f01414 EB |
1966 | (inputs |
1967 | `(("mpi" ,openmpi) | |
1968 | ("arpack" ,arpack-ng-openmpi) | |
1969 | ,@(alist-delete "arpack" (package-inputs slepc)))) | |
1970 | (propagated-inputs | |
1971 | `(("petsc" ,petsc-openmpi) | |
1972 | ,@(alist-delete "petsc" (package-propagated-inputs slepc)))) | |
1973 | (synopsis "Scalable library for eigenproblems (with MPI support)"))) | |
1974 | ||
1975 | (define-public slepc-complex-openmpi | |
1976 | (package (inherit slepc-openmpi) | |
1977 | (name "slepc-complex-openmpi") | |
1978 | (propagated-inputs | |
1979 | `(("petsc" ,petsc-complex-openmpi) | |
1980 | ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi)))) | |
1981 | (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)"))) | |
1982 | ||
6b5687d0 PG |
1983 | (define-public python-slepc4py |
1984 | (package | |
1985 | (name "python-slepc4py") | |
57d30004 | 1986 | (version "3.10.0") |
6b5687d0 PG |
1987 | (source |
1988 | (origin | |
1989 | (method url-fetch) | |
1990 | (uri (pypi-uri "slepc4py" version)) | |
1991 | (sha256 | |
1992 | (base32 | |
57d30004 | 1993 | "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j")))) |
6b5687d0 PG |
1994 | (build-system python-build-system) |
1995 | (arguments | |
1996 | `(#:phases | |
1997 | (modify-phases %standard-phases | |
1998 | (add-before 'build 'pre-build | |
1999 | (lambda _ | |
2000 | ;; Define path to PETSc installation. | |
2001 | (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc")) | |
2002 | ;; Define path to SLEPc installation. | |
2003 | (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc")) | |
2004 | #t)) | |
2005 | (add-before 'check 'mpi-setup | |
2006 | ,%openmpi-setup)))) | |
2007 | (inputs | |
2008 | `(("python-numpy" ,python-numpy) | |
2009 | ("python-petsc4py" ,python-petsc4py) | |
2010 | ("slepc" ,slepc-openmpi))) | |
2011 | (home-page "https://bitbucket.org/slepc/slepc4py/") | |
2012 | (synopsis "Python bindings for SLEPc") | |
2013 | (description "SLEPc, the Scalable Library for Eigenvalue Problem | |
2014 | Computations, is based on PETSc, the Portable, Extensible Toolkit for | |
2015 | Scientific Computation. It employs the MPI standard for all | |
2016 | message-passing communication. @code{slepc4py} provides Python | |
2017 | bindings to almost all functions of SLEPc.") | |
2018 | (license license:bsd-3))) | |
2019 | ||
cec86422 EB |
2020 | (define-public mumps |
2021 | (package | |
2022 | (name "mumps") | |
e7323f4c | 2023 | (version "5.1.2") |
cec86422 EB |
2024 | (source |
2025 | (origin | |
2026 | (method url-fetch) | |
2027 | (uri (string-append "http://mumps.enseeiht.fr/MUMPS_" | |
2028 | version ".tar.gz")) | |
2029 | (sha256 | |
2030 | (base32 | |
e7323f4c | 2031 | "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b")) |
fc1adab1 | 2032 | (patches (search-patches "mumps-build-parallelism.patch")))) |
cec86422 EB |
2033 | (build-system gnu-build-system) |
2034 | (inputs | |
2035 | `(("fortran" ,gfortran) | |
2036 | ;; These are required for linking against mumps, but we let the user | |
2037 | ;; declare the dependency. | |
2038 | ("blas" ,openblas) | |
2039 | ("metis" ,metis) | |
2040 | ("scotch" ,scotch))) | |
2041 | (arguments | |
2042 | `(#:modules ((ice-9 match) | |
2043 | (ice-9 popen) | |
2044 | (srfi srfi-1) | |
2045 | ,@%gnu-build-system-modules) | |
2046 | #:phases | |
2047 | (modify-phases %standard-phases | |
fba78d18 | 2048 | (replace 'configure |
cec86422 EB |
2049 | (lambda* (#:key inputs #:allow-other-keys) |
2050 | (call-with-output-file "Makefile.inc" | |
2051 | (lambda (port) | |
2052 | (format port " | |
2053 | PLAT = | |
2054 | LIBEXT = .a | |
2055 | OUTC = -o | |
2056 | OUTF = -o | |
2057 | RM = rm -f~:[ | |
2058 | CC = gcc | |
2059 | FC = gfortran | |
2060 | FL = gfortran | |
2061 | INCSEQ = -I$(topdir)/libseq | |
2062 | LIBSEQ = -L$(topdir)/libseq -lmpiseq | |
2063 | LIBSEQNEEDED = libseqneeded~; | |
2064 | CC = mpicc | |
2065 | FC = mpifort | |
2066 | FL = mpifort~] | |
2067 | AR = ar vr # rules require trailing space, ugh... | |
2068 | RANLIB = ranlib | |
2069 | LIBBLAS = -L~a -lopenblas~@[ | |
2070 | SCALAP = -L~a -lscalapack~] | |
2071 | LIBOTHERS = -pthread | |
2072 | CDEFS = -DAdd_ | |
2073 | PIC = -fPIC | |
2074 | OPTF = -O2 -DALLOW_NON_INIT $(PIC) | |
2075 | OPTL = -O2 $(PIC) | |
2076 | OPTC = -O2 $(PIC) | |
2077 | INCS = $(INCSEQ) | |
2078 | LIBS = $(SCALAP) $(LIBSEQ) | |
2079 | LPORDDIR = $(topdir)/PORD/lib | |
2080 | IPORD = -I$(topdir)/PORD/include | |
2081 | LPORD = -L$(LPORDDIR) -lpord | |
2082 | ORDERINGSF = -Dpord~@[ | |
2083 | METISDIR = ~a | |
2084 | IMETIS = -I$(METISDIR)/include | |
2085 | LMETIS = -L$(METISDIR)/lib -lmetis | |
2086 | ORDERINGSF += -Dmetis~]~@[~:{ | |
2087 | SCOTCHDIR = ~a | |
2088 | ISCOTCH = -I$(SCOTCHDIR)/include | |
2089 | LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr | |
2090 | ORDERINGSF += ~a~}~] | |
2091 | ORDERINGSC = $(ORDERINGSF) | |
2092 | LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) | |
2093 | IORDERINGSF = $(ISCOTCH) | |
2094 | IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)" | |
2095 | (assoc-ref inputs "mpi") | |
2096 | (assoc-ref inputs "blas") | |
2097 | (assoc-ref inputs "scalapack") | |
2098 | (assoc-ref inputs "metis") | |
2099 | (match (list (assoc-ref inputs "pt-scotch") | |
2100 | (assoc-ref inputs "scotch")) | |
2101 | ((#f #f) | |
2102 | #f) | |
2103 | ((#f scotch) | |
2104 | `((,scotch "" "-Dscotch"))) | |
2105 | ((ptscotch _) | |
2106 | `((,ptscotch | |
2107 | "-lptesmumps -lptscotch -lptscotcherr " | |
2108 | "-Dptscotch"))))))))) | |
fba78d18 | 2109 | (replace 'build |
cec86422 EB |
2110 | ;; By default only the d-precision library is built. Make with "all" |
2111 | ;; target so that all precision libraries and examples are built. | |
2112 | (lambda _ | |
b414cf52 TGR |
2113 | (invoke "make" "all" |
2114 | (format #f "-j~a" (parallel-job-count))))) | |
fba78d18 | 2115 | (replace 'check |
cec86422 EB |
2116 | ;; Run the simple test drivers, which read test input from stdin: |
2117 | ;; from the "real" input for the single- and double-precision | |
2118 | ;; testers, and from the "cmplx" input for complex-precision | |
2119 | ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi | |
2120 | ;; package to prefix execution with "mpirun". | |
2121 | (lambda* (#:key (exec-prefix '()) #:allow-other-keys) | |
2122 | (with-directory-excursion "examples" | |
2123 | (every | |
2124 | (lambda (prec type) | |
2125 | (let ((tester (apply open-pipe* | |
2126 | `(,OPEN_WRITE | |
2127 | ,@exec-prefix | |
2128 | ,(string-append "./" prec | |
2129 | "simpletest")))) | |
2130 | (input (open-input-file | |
2131 | (string-append "input_simpletest_" type)))) | |
2132 | (begin | |
2133 | (dump-port input tester) | |
2134 | (close-port input) | |
2135 | (zero? (close-pipe tester))))) | |
2136 | '("s" "d" "c" "z") | |
2137 | '("real" "real" "cmplx" "cmplx"))))) | |
fba78d18 EB |
2138 | (replace 'install |
2139 | (lambda* (#:key outputs #:allow-other-keys) | |
2140 | (let* ((out (assoc-ref outputs "out")) | |
2141 | (libdir (string-append out "/lib"))) | |
2142 | (copy-recursively "lib" libdir) | |
2143 | (copy-recursively "include" (string-append out "/include")) | |
2144 | (when (file-exists? "libseq/libmpiseq.a") | |
2145 | (install-file "libseq/libmpiseq.a" libdir)) | |
2146 | #t)))))) | |
cec86422 EB |
2147 | (home-page "http://mumps.enseeiht.fr") |
2148 | (synopsis "Multifrontal sparse direct solver") | |
2149 | (description | |
2150 | "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a | |
2151 | sparse system of linear equations A x = b using Guassian elimination.") | |
2152 | (license license:cecill-c))) | |
2153 | ||
2154 | (define-public mumps-metis | |
2155 | (package (inherit mumps) | |
2156 | (name "mumps-metis") | |
2157 | (inputs | |
2158 | (alist-delete "scotch" (package-inputs mumps))))) | |
2159 | ||
2160 | (define-public mumps-openmpi | |
2161 | (package (inherit mumps) | |
2162 | (name "mumps-openmpi") | |
2163 | (inputs | |
2164 | `(("mpi" ,openmpi) | |
2165 | ("scalapack" ,scalapack) | |
2166 | ("pt-scotch" ,pt-scotch) | |
2167 | ,@(alist-delete "scotch" (package-inputs mumps)))) | |
2168 | (arguments | |
2169 | (substitute-keyword-arguments (package-arguments mumps) | |
2170 | ((#:phases phases) | |
2171 | `(modify-phases ,phases | |
bbe46a4a EB |
2172 | (add-before 'check 'mpi-setup |
2173 | ,%openmpi-setup) | |
6df2a50a LC |
2174 | (replace 'check |
2175 | (lambda _ | |
2176 | ((assoc-ref ,phases 'check) | |
2177 | #:exec-prefix '("mpirun" "-n" "2")))))))) | |
cec86422 EB |
2178 | (synopsis "Multifrontal sparse direct solver (with MPI)"))) |
2179 | ||
2180 | (define-public mumps-metis-openmpi | |
2181 | (package (inherit mumps-openmpi) | |
2182 | (name "mumps-metis-openmpi") | |
2183 | (inputs | |
2184 | (alist-delete "pt-scotch" (package-inputs mumps-openmpi))))) | |
2185 | ||
2d047896 RW |
2186 | (define-public r-quadprog |
2187 | (package | |
2188 | (name "r-quadprog") | |
2189 | (version "1.5-5") | |
2190 | (source | |
2191 | (origin | |
2192 | (method url-fetch) | |
2193 | (uri (cran-uri "quadprog" version)) | |
2194 | (sha256 | |
2195 | (base32 | |
2196 | "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr")))) | |
2197 | (build-system r-build-system) | |
2198 | (native-inputs | |
2199 | `(("gfortran" ,gfortran))) | |
e9960d8c | 2200 | (home-page "https://cran.r-project.org/web/packages/quadprog") |
2d047896 RW |
2201 | (synopsis "Functions to solve quadratic programming problems") |
2202 | (description | |
2203 | "This package contains routines and documentation for solving quadratic | |
2204 | programming problems.") | |
2205 | (license license:gpl3+))) | |
2206 | ||
ec8c7e47 RJ |
2207 | (define-public r-pracma |
2208 | (package | |
2209 | (name "r-pracma") | |
39528a5e | 2210 | (version "2.1.8") |
ec8c7e47 RJ |
2211 | (source (origin |
2212 | (method url-fetch) | |
2213 | (uri (cran-uri "pracma" version)) | |
2214 | (sha256 | |
39528a5e | 2215 | (base32 "0m8ladhrfyxwybblkcdgg4xv1mk5kibmwarpj2k0c2y34zzcix4z")))) |
ec8c7e47 | 2216 | (build-system r-build-system) |
39528a5e | 2217 | (home-page "https://cran.r-project.org/web/packages/pracma/") |
ec8c7e47 RJ |
2218 | (synopsis "Practical numerical math functions") |
2219 | (description "This package provides functions for numerical analysis and | |
2220 | linear algebra, numerical optimization, differential equations, plus some | |
2221 | special functions. It uses Matlab function names where appropriate to simplify | |
2222 | porting.") | |
2223 | (license license:gpl3+))) | |
2224 | ||
63e07468 BW |
2225 | (define-public ruby-asciimath |
2226 | (package | |
2227 | (name "ruby-asciimath") | |
2228 | (version "1.0.4") | |
2229 | (source | |
2230 | (origin | |
2231 | (method url-fetch) | |
2232 | (uri (rubygems-uri "asciimath" version)) | |
2233 | (sha256 | |
2234 | (base32 | |
2235 | "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc")))) | |
2236 | (build-system ruby-build-system) | |
2237 | (arguments | |
2238 | '(#:phases | |
2239 | (modify-phases %standard-phases | |
2240 | ;; Apply this patch | |
2241 | ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948 | |
2242 | (add-after 'unpack 'patch-remove-spurious-backslashes | |
2243 | (lambda _ | |
2244 | (substitute* "spec/parser_spec.rb" | |
2245 | (("\\\\\"") | |
9923d5a4 TGR |
2246 | "\"")) |
2247 | #t))))) | |
63e07468 BW |
2248 | (native-inputs |
2249 | `(("bundler" ,bundler) | |
2250 | ("ruby-rspec" ,ruby-rspec))) | |
2251 | (synopsis "AsciiMath parsing and conversion library") | |
2252 | (description | |
2253 | "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an | |
2254 | easy-to-write markup language for mathematics.") | |
2255 | (home-page "https://github.com/asciidoctor/asciimath") | |
2256 | (license license:expat))) | |
2257 | ||
183e44ae EB |
2258 | (define-public superlu |
2259 | (package | |
2260 | (name "superlu") | |
995a09e0 | 2261 | (version "5.2.1") |
183e44ae EB |
2262 | (source |
2263 | (origin | |
2264 | (method url-fetch) | |
2265 | (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" | |
2266 | "superlu_" version ".tar.gz")) | |
2267 | (sha256 | |
995a09e0 EB |
2268 | (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8")) |
2269 | (modules '((guix build utils))) | |
2270 | (snippet | |
2271 | ;; Replace the non-free implementation of MC64 with a stub adapted | |
2272 | ;; from Debian | |
2273 | '(begin | |
2274 | (use-modules (ice-9 regex) | |
2275 | (ice-9 rdelim)) | |
2276 | (call-with-output-file "SRC/mc64ad.c" | |
2277 | (lambda (port) | |
2278 | (display " | |
2279 | #include <stdio.h> | |
2280 | #include <stdlib.h> | |
2281 | void mc64id_(int *a) { | |
2282 | fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\"); | |
2283 | abort (); | |
2284 | } | |
2285 | void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g, | |
2286 | int *h, int *i, int *j, int *k, double *l, int *m, int *n) { | |
2287 | fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\"); | |
2288 | abort (); | |
2289 | }\n" port))) | |
2290 | ;; Remove the corresponding license verbiage. MC64 license follows | |
2291 | ;; a "------" line separator. | |
2292 | (with-atomic-file-replacement "License.txt" | |
2293 | (let ((rx (make-regexp "-{8}"))) | |
2294 | (lambda (in out) | |
2295 | (let loop () | |
2296 | (let ((line (read-line in 'concat))) | |
2297 | (unless (regexp-exec rx line) | |
2298 | (display line out) | |
6cbee49d MW |
2299 | (loop)))) |
2300 | #t))))))) | |
995a09e0 | 2301 | (build-system cmake-build-system) |
183e44ae EB |
2302 | (native-inputs |
2303 | `(("tcsh" ,tcsh))) | |
2304 | (inputs | |
995a09e0 | 2305 | `(("blas" ,openblas) |
19afbea1 | 2306 | ("gfortran" ,gfortran))) |
183e44ae | 2307 | (arguments |
995a09e0 EB |
2308 | `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas |
2309 | "-DTPL_BLAS_LIBRARIES=openblas" | |
677bc34d | 2310 | "-DBUILD_SHARED_LIBS:BOOL=YES"))) |
183e44ae EB |
2311 | (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/") |
2312 | (synopsis "Supernodal direct solver for sparse linear systems") | |
2313 | (description | |
2314 | "SuperLU is a general purpose library for the direct solution of large, | |
2315 | sparse, nonsymmetric systems of linear equations on high performance machines. | |
2316 | The library is written in C and is callable from either C or Fortran. The | |
2317 | library routines perform an LU decomposition with partial pivoting and | |
2318 | triangular system solves through forward and back substitution. The library | |
2319 | also provides threshold-based ILU factorization preconditioners.") | |
995a09e0 EB |
2320 | (license (list license:bsd-3 |
2321 | license:gpl2+ ;EXAMPLE/*fgmr.c | |
2322 | (license:fsf-free "file://SRC/colamd.h"))))) | |
f8ed036a | 2323 | |
a54aefea EB |
2324 | (define-public superlu-dist |
2325 | (package | |
2326 | (name "superlu-dist") | |
0921eff2 | 2327 | (version "5.3.0") |
a54aefea EB |
2328 | (source |
2329 | (origin | |
2330 | (method url-fetch) | |
2331 | (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" | |
2332 | "superlu_dist_" version ".tar.gz")) | |
2333 | (sha256 | |
0921eff2 LC |
2334 | (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y")) |
2335 | (modules '((guix build utils))) | |
29080870 EB |
2336 | (snippet |
2337 | ;; Replace the non-free implementation of MC64 with a stub | |
2338 | '(begin | |
2339 | (use-modules (ice-9 regex) | |
2340 | (ice-9 rdelim)) | |
0921eff2 | 2341 | (call-with-output-file "SRC/mc64ad_dist.c" |
29080870 EB |
2342 | (lambda (port) |
2343 | (display " | |
2344 | #include <stdio.h> | |
2345 | #include <stdlib.h> | |
0921eff2 | 2346 | void mc64id_dist(int *a) { |
29080870 EB |
2347 | fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\"); |
2348 | abort (); | |
2349 | } | |
0921eff2 | 2350 | void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g, |
29080870 EB |
2351 | int *h, int *i, int *j, int *k, double *l, int *m, int *n) { |
2352 | fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\"); | |
2353 | abort (); | |
2354 | }\n" port))) | |
29080870 EB |
2355 | (substitute* "SRC/util.c" ;adjust default algorithm |
2356 | (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag") | |
6cbee49d MW |
2357 | "RowPerm = NOROWPERM")) |
2358 | #t)) | |
fc1adab1 | 2359 | (patches (search-patches "superlu-dist-scotchmetis.patch")))) |
a54aefea EB |
2360 | (build-system gnu-build-system) |
2361 | (native-inputs | |
2362 | `(("tcsh" ,tcsh))) | |
2363 | (inputs | |
19afbea1 | 2364 | `(("gfortran" ,gfortran))) |
a54aefea EB |
2365 | (propagated-inputs |
2366 | `(("openmpi" ,openmpi) ;headers include MPI heades | |
2367 | ("lapack" ,lapack) ;required to link with output library | |
2368 | ("pt-scotch" ,pt-scotch))) ;same | |
2369 | (arguments | |
2370 | `(#:parallel-build? #f ;race conditions using ar | |
2371 | #:phases | |
dc1d3cde KK |
2372 | (modify-phases %standard-phases |
2373 | (replace 'configure | |
2374 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2375 | (call-with-output-file "make.inc" | |
2376 | (lambda (port) | |
2377 | (format port " | |
a54aefea EB |
2378 | PLAT = |
2379 | DSuperLUroot = ~a | |
2380 | DSUPERLULIB = ~a/lib/libsuperlu_dist.a | |
2381 | BLASDEF = -DUSE_VENDOR_BLAS | |
2382 | BLASLIB = -L~a/lib -lblas | |
2383 | PARMETISLIB = -L~a/lib \ | |
2384 | -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \ | |
2385 | -lscotch -lscotcherr -lscotcherrexit | |
2386 | METISLIB = -L~:*~a/lib \ | |
2387 | -lscotchmetis -lscotch -lscotcherr -lscotcherrexit | |
2388 | LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB) | |
2389 | ARCH = ar | |
2390 | ARCHFLAGS = cr | |
2391 | RANLIB = ranlib | |
2392 | CC = mpicc | |
2393 | PIC = -fPIC | |
2394 | CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC) | |
2395 | NOOPTS = -O0 -g $(PIC) | |
2396 | FORTRAN = mpifort | |
2397 | FFLAGS = -O2 -g $(PIC) | |
2398 | LOADER = $(CC) | |
2399 | CDEFS = -DAdd_" | |
dc1d3cde KK |
2400 | (getcwd) |
2401 | (assoc-ref outputs "out") | |
2402 | (assoc-ref inputs "lapack") | |
2403 | (assoc-ref inputs "pt-scotch")))) | |
2404 | #t)) | |
2405 | (add-after 'unpack 'remove-broken-symlinks | |
2406 | (lambda _ | |
2407 | (for-each delete-file | |
2408 | (find-files "MAKE_INC" "\\.#make\\..*")) | |
2409 | #t)) | |
2410 | (add-before 'build 'create-install-directories | |
2411 | (lambda* (#:key outputs #:allow-other-keys) | |
2412 | (for-each | |
2413 | (lambda (dir) | |
2414 | (mkdir-p (string-append (assoc-ref outputs "out") | |
2415 | "/" dir))) | |
2416 | '("lib" "include")) | |
2417 | #t)) | |
bbe46a4a EB |
2418 | (add-before 'check 'mpi-setup |
2419 | ,%openmpi-setup) | |
dc1d3cde | 2420 | (replace 'check |
a54aefea EB |
2421 | (lambda _ |
2422 | (with-directory-excursion "EXAMPLE" | |
e02a9975 TGR |
2423 | (invoke "mpirun" "-n" "2" |
2424 | "./pddrive" "-r" "1" "-c" "2" "g20.rua") | |
2425 | (invoke "mpirun" "-n" "2" | |
2426 | "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")) | |
2427 | #t)) | |
dc1d3cde KK |
2428 | (replace 'install |
2429 | (lambda* (#:key outputs #:allow-other-keys) | |
2430 | ;; Library is placed in lib during the build phase. Copy over | |
2431 | ;; headers to include. | |
2432 | (let* ((out (assoc-ref outputs "out")) | |
2433 | (incdir (string-append out "/include"))) | |
2434 | (for-each (lambda (file) | |
2435 | (let ((base (basename file))) | |
2436 | (format #t "installing `~a' to `~a'~%" | |
2437 | base incdir) | |
2438 | (copy-file file | |
2439 | (string-append incdir "/" base)))) | |
2440 | (find-files "SRC" ".*\\.h$"))) | |
2441 | #t))))) | |
a54aefea EB |
2442 | (home-page (package-home-page superlu)) |
2443 | (synopsis "Parallel supernodal direct solver") | |
2444 | (description | |
2445 | "SuperLU_DIST is a parallel extension to the serial SuperLU library. | |
2446 | It is targeted for distributed memory parallel machines. SuperLU_DIST is | |
2447 | implemented in ANSI C, and MPI for communications.") | |
2448 | (license license:bsd-3))) | |
2449 | ||
f8ed036a EB |
2450 | (define-public scotch |
2451 | (package | |
2452 | (name "scotch") | |
d98e9009 | 2453 | (version "6.0.5a") |
f8ed036a EB |
2454 | (source |
2455 | (origin | |
2456 | (method url-fetch) | |
1dc31097 TGR |
2457 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" |
2458 | "latestfile/298/scotch_" version ".tar.gz")) | |
f8ed036a | 2459 | (sha256 |
d98e9009 | 2460 | (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av")) |
fc1adab1 | 2461 | (patches (search-patches "scotch-test-threading.patch" |
d98e9009 EB |
2462 | "scotch-build-parallelism.patch" |
2463 | "scotch-graph-induce-type-64.patch" | |
2464 | "scotch-graph-diam-64.patch")))) | |
f8ed036a EB |
2465 | (build-system gnu-build-system) |
2466 | (inputs | |
2467 | `(("zlib" ,zlib) | |
5e54f4ad | 2468 | ("flex" ,flex) |
f8ed036a EB |
2469 | ("bison" ,bison))) |
2470 | (arguments | |
2471 | `(#:phases | |
d6602ee9 EB |
2472 | (modify-phases %standard-phases |
2473 | (add-after | |
2474 | 'unpack 'chdir-to-src | |
d67a7e9e | 2475 | (lambda _ (chdir "src") #t)) |
d6602ee9 EB |
2476 | (replace |
2477 | 'configure | |
2478 | (lambda _ | |
2479 | (call-with-output-file "Makefile.inc" | |
2480 | (lambda (port) | |
2481 | (format port " | |
f8ed036a EB |
2482 | EXE = |
2483 | LIB = .a | |
2484 | OBJ = .o | |
2485 | MAKE = make | |
2486 | AR = ar | |
2487 | ARFLAGS = -ruv | |
cf0ec6c4 | 2488 | CAT = cat |
f8ed036a EB |
2489 | CCS = gcc |
2490 | CCP = mpicc | |
2491 | CCD = gcc | |
2492 | CPPFLAGS =~{ -D~a~} | |
6c798540 | 2493 | CFLAGS = -O2 -g -fPIC $(CPPFLAGS) |
f8ed036a EB |
2494 | LDFLAGS = -lz -lm -lrt -lpthread |
2495 | CP = cp | |
2496 | LEX = flex -Pscotchyy -olex.yy.c | |
2497 | LN = ln | |
2498 | MKDIR = mkdir | |
2499 | MV = mv | |
2500 | RANLIB = ranlib | |
2501 | YACC = bison -pscotchyy -y -b y | |
2502 | " | |
d6602ee9 EB |
2503 | '("COMMON_FILE_COMPRESS_GZ" |
2504 | "COMMON_PTHREAD" | |
2505 | "COMMON_RANDOM_FIXED_SEED" | |
26599d69 | 2506 | "INTSIZE64" ;use 'long' instead of 'int' |
cf0ec6c4 EB |
2507 | ;; Prevents symbolc clashes with libesmumps |
2508 | "SCOTCH_RENAME" | |
d6602ee9 EB |
2509 | ;; XXX: Causes invalid frees in superlu-dist tests |
2510 | ;; "SCOTCH_PTHREAD" | |
2511 | ;; "SCOTCH_PTHREAD_NUMBER=2" | |
d67a7e9e TGR |
2512 | "restrict=__restrict")))) |
2513 | #t)) | |
bbe46a4a | 2514 | (add-after 'build 'build-esmumps |
cf0ec6c4 | 2515 | (lambda _ |
d67a7e9e TGR |
2516 | (invoke "make" |
2517 | (format #f "-j~a" (parallel-job-count)) | |
2518 | "esmumps"))) | |
d6602ee9 | 2519 | (replace |
f8ed036a EB |
2520 | 'install |
2521 | (lambda* (#:key outputs #:allow-other-keys) | |
2522 | (let ((out (assoc-ref outputs "out"))) | |
2523 | (mkdir out) | |
d67a7e9e TGR |
2524 | (invoke "make" |
2525 | (string-append "prefix=" out) | |
2526 | "install") | |
cf0ec6c4 EB |
2527 | ;; esmumps files are not installed with the above |
2528 | (for-each (lambda (f) | |
2529 | (copy-file f (string-append out "/include/" f))) | |
2530 | (find-files "../include" ".*esmumps.h$")) | |
2531 | (for-each (lambda (f) | |
2532 | (copy-file f (string-append out "/lib/" f))) | |
d67a7e9e TGR |
2533 | (find-files "../lib" "^lib.*esmumps.*")) |
2534 | #t)))))) | |
f8ed036a EB |
2535 | (home-page "http://www.labri.fr/perso/pelegrin/scotch/") |
2536 | (synopsis "Programs and libraries for graph algorithms") | |
2537 | (description "SCOTCH is a set of programs and libraries which implement | |
2538 | the static mapping and sparse matrix reordering algorithms developed within | |
2539 | the SCOTCH project. Its purpose is to apply graph theory, with a divide and | |
2540 | conquer approach, to scientific computing problems such as graph and mesh | |
2541 | partitioning, static mapping, and sparse matrix ordering, in application | |
2542 | domains ranging from structural mechanics to operating systems or | |
2543 | bio-chemistry.") | |
2544 | ;; See LICENSE_en.txt | |
2545 | (license license:cecill-c))) | |
6acb4adb | 2546 | |
1c39f3b8 PG |
2547 | (define-public scotch32 |
2548 | ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by | |
2549 | ;; some applications. | |
2550 | (package (inherit scotch) | |
2551 | (name "scotch32") | |
2552 | (arguments | |
2553 | (substitute-keyword-arguments (package-arguments scotch) | |
2554 | ((#:phases scotch-phases) | |
2555 | `(modify-phases ,scotch-phases | |
2556 | (replace | |
2557 | 'configure | |
2558 | (lambda _ | |
2559 | (call-with-output-file "Makefile.inc" | |
2560 | (lambda (port) | |
2561 | (format port " | |
2562 | EXE = | |
2563 | LIB = .a | |
2564 | OBJ = .o | |
2565 | MAKE = make | |
2566 | AR = ar | |
2567 | ARFLAGS = -ruv | |
2568 | CAT = cat | |
2569 | CCS = gcc | |
2570 | CCP = mpicc | |
2571 | CCD = gcc | |
2572 | CPPFLAGS =~{ -D~a~} | |
2573 | CFLAGS = -O2 -g -fPIC $(CPPFLAGS) | |
2574 | LDFLAGS = -lz -lm -lrt -lpthread | |
2575 | CP = cp | |
2576 | LEX = flex -Pscotchyy -olex.yy.c | |
2577 | LN = ln | |
2578 | MKDIR = mkdir | |
2579 | MV = mv | |
2580 | RANLIB = ranlib | |
2581 | YACC = bison -pscotchyy -y -b y | |
2582 | " | |
2583 | '("COMMON_FILE_COMPRESS_GZ" | |
2584 | "COMMON_PTHREAD" | |
2585 | "COMMON_RANDOM_FIXED_SEED" | |
2586 | "INTSIZE32" ;use 32-bit integers. See INSTALL.txt | |
2587 | ;; Prevents symbolc clashes with libesmumps | |
2588 | "SCOTCH_RENAME" | |
2589 | ;; XXX: Causes invalid frees in superlu-dist tests | |
2590 | ;; "SCOTCH_PTHREAD" | |
2591 | ;; "SCOTCH_PTHREAD_NUMBER=2" | |
2592 | "restrict=__restrict")))))))))) | |
2593 | (synopsis | |
2594 | "Programs and libraries for graph algorithms (32-bit integers)"))) | |
2595 | ||
6acb4adb EB |
2596 | (define-public pt-scotch |
2597 | (package (inherit scotch) | |
2598 | (name "pt-scotch") | |
2599 | (propagated-inputs | |
2600 | `(("openmpi" ,openmpi))) ;Headers include MPI headers | |
2601 | (arguments | |
2602 | (substitute-keyword-arguments (package-arguments scotch) | |
2603 | ((#:phases scotch-phases) | |
d6602ee9 EB |
2604 | `(modify-phases ,scotch-phases |
2605 | (replace | |
2606 | 'build | |
d6602ee9 | 2607 | (lambda _ |
c491f7f8 LC |
2608 | (invoke "make" (format #f "-j~a" (parallel-job-count)) |
2609 | "ptscotch" "ptesmumps") | |
2610 | ||
2611 | ;; Install the serial metis compatibility library | |
2612 | (invoke "make" "-C" "libscotchmetis" "install"))) | |
2613 | (add-before 'check 'mpi-setup | |
2614 | ,%openmpi-setup) | |
2615 | (replace 'check | |
2616 | (lambda _ | |
2617 | (invoke "make" "ptcheck"))))))) | |
6acb4adb | 2618 | (synopsis "Programs and libraries for graph algorithms (with MPI)"))) |
5698b8b8 | 2619 | |
1c25a52c PG |
2620 | (define-public pt-scotch32 |
2621 | (package (inherit scotch32) | |
2622 | (name "pt-scotch32") | |
2623 | (propagated-inputs | |
2624 | `(("openmpi" ,openmpi))) ;headers include MPI headers | |
2625 | (arguments | |
c4d4a779 PG |
2626 | (substitute-keyword-arguments (package-arguments scotch32) |
2627 | ((#:phases scotch32-phases) | |
2628 | `(modify-phases ,scotch32-phases | |
1c25a52c PG |
2629 | (replace 'build |
2630 | (lambda _ | |
c491f7f8 LC |
2631 | (invoke "make" (format #f "-j~a" (parallel-job-count)) |
2632 | "ptscotch" "ptesmumps") | |
2633 | ;; Install the serial metis compatibility library | |
2634 | (invoke "make" "-C" "libscotchmetis" "install"))) | |
2635 | (add-before 'check 'mpi-setup | |
2636 | ,%openmpi-setup) | |
1c25a52c PG |
2637 | (replace 'check |
2638 | (lambda _ | |
c491f7f8 | 2639 | (invoke "make" "ptcheck"))))))) |
1c25a52c PG |
2640 | (synopsis |
2641 | "Programs and libraries for graph algorithms (with MPI and 32-bit integers)"))) | |
2642 | ||
aa75ad00 EB |
2643 | (define-public metis |
2644 | (package | |
2645 | (name "metis") | |
2646 | (version "5.1.0") | |
2647 | (source | |
2648 | (origin | |
2649 | (method url-fetch) | |
2650 | (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/" | |
2651 | "metis-" version ".tar.gz")) | |
2652 | (sha256 | |
2653 | (base32 | |
2654 | "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn")))) | |
2655 | (build-system cmake-build-system) | |
2656 | (inputs | |
2657 | `(("blas" ,openblas))) | |
2658 | (arguments | |
2659 | `(#:tests? #f ;no tests | |
2660 | #:configure-flags `("-DSHARED=ON" | |
2661 | ,(string-append "-DGKLIB_PATH=" (getcwd) | |
2662 | "/metis-" ,version "/GKlib")))) | |
2663 | (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") | |
2664 | (synopsis "Graph partitioning and fill-reducing matrix ordering library") | |
2665 | (description | |
2666 | "METIS is a set of serial programs for partitioning graphs, partitioning | |
2667 | finite element meshes, and producing fill-reducing orderings for sparse | |
2668 | matrices. The algorithms implemented in METIS are based on the multilevel | |
2669 | recursive-bisection, multilevel k-way, and multi-constraint partitioning | |
2670 | schemes.") | |
2671 | (license license:asl2.0))) ;As of version 5.0.3 | |
2672 | ||
700ff222 EB |
2673 | (define-public p4est |
2674 | (package | |
2675 | (name "p4est") | |
4150da63 | 2676 | (version "2.0") |
700ff222 EB |
2677 | (source |
2678 | (origin | |
2679 | (method url-fetch) | |
2680 | (uri (string-append "http://p4est.github.io/release/p4est-" | |
2681 | version ".tar.gz")) | |
2682 | (sha256 | |
2683 | (base32 | |
4150da63 | 2684 | "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5")))) |
700ff222 EB |
2685 | (build-system gnu-build-system) |
2686 | (inputs | |
2687 | `(("fortran" ,gfortran) | |
2688 | ("blas" ,openblas) | |
2689 | ("lapack" ,lapack) | |
2690 | ("zlib" ,zlib))) | |
2691 | (arguments | |
2692 | `(#:configure-flags `(,(string-append "BLAS_LIBS=-L" | |
2693 | (assoc-ref %build-inputs "blas") | |
2694 | " -lopenblas") | |
2695 | ,(string-append "LAPACK_LIBS=-L" | |
2696 | (assoc-ref %build-inputs "lapack") | |
6df2a50a LC |
2697 | " -llapack")) |
2698 | #:phases (modify-phases %standard-phases | |
bbe46a4a EB |
2699 | (add-before 'check 'mpi-setup |
2700 | ,%openmpi-setup)))) | |
700ff222 EB |
2701 | (home-page "http://www.p4est.org") |
2702 | (synopsis "Adaptive mesh refinement on forests of octrees") | |
2703 | (description | |
2704 | "The p4est software library enables the dynamic management of a | |
2705 | collection of adaptive octrees, conveniently called a forest of octrees. | |
2706 | p4est is designed to work in parallel and scales to hundreds of thousands of | |
2707 | processor cores.") | |
2708 | (license license:gpl2+))) | |
2709 | ||
2710 | (define-public p4est-openmpi | |
2711 | (package (inherit p4est) | |
2712 | (name "p4est-openmpi") | |
2713 | (inputs | |
2714 | `(("mpi" ,openmpi) | |
2715 | ,@(package-inputs p4est))) | |
2716 | (arguments | |
2717 | (substitute-keyword-arguments (package-arguments p4est) | |
2718 | ((#:configure-flags cf) | |
2719 | ``("--enable-mpi" ,@,cf)))) | |
2720 | (synopsis "Parallel adaptive mesh refinement on forests of octrees"))) | |
2721 | ||
5698b8b8 JD |
2722 | (define-public gsegrafix |
2723 | (package | |
2724 | (name "gsegrafix") | |
2725 | (version "1.0.6") | |
2726 | (source | |
2727 | (origin | |
2728 | (method url-fetch) | |
2729 | (uri (string-append "mirror://gnu/" name "/" name "-" | |
2730 | version ".tar.gz")) | |
2731 | (sha256 | |
2732 | (base32 | |
2733 | "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda")))) | |
2734 | (build-system gnu-build-system) | |
2735 | (arguments | |
2736 | `(#:configure-flags '("LDFLAGS=-lm"))) | |
2737 | (inputs | |
2738 | `(("libgnomecanvas" ,libgnomecanvas) | |
2739 | ("libbonoboui" ,libbonoboui) | |
2740 | ("libgnomeui" ,libgnomeui) | |
2741 | ("libgnomeprintui" ,libgnomeprintui) | |
2742 | ("popt" ,popt))) | |
2743 | (native-inputs | |
2744 | `(("pkg-config" ,pkg-config))) | |
6fd52309 | 2745 | (home-page "https://www.gnu.org/software/gsegrafix/") |
5698b8b8 JD |
2746 | (synopsis "GNOME application to create scientific and engineering plots") |
2747 | (description "GSEGrafix is an application which produces high-quality graphical | |
2748 | plots for science and engineering. Plots are specified via simple ASCII | |
2749 | parameter files and data files and are presented in an anti-aliased GNOME | |
2750 | canvas. The program supports rectangular two-dimensional plots, histograms, | |
2751 | polar-axis plots and three-dimensional plots. Plots can be printed or saved | |
2752 | to BMP, JPEG or PNG image formats.") | |
2753 | (license license:gpl3+))) | |
8731e527 JD |
2754 | |
2755 | (define-public maxima | |
2756 | (package | |
2757 | (name "maxima") | |
a5d474d7 | 2758 | (version "5.42.1") |
8731e527 JD |
2759 | (source |
2760 | (origin | |
2761 | (method url-fetch) | |
2762 | (uri (string-append "mirror://sourceforge/maxima/Maxima-source/" | |
2763 | version "-source/" name "-" version ".tar.gz")) | |
2764 | (sha256 | |
2765 | (base32 | |
a5d474d7 | 2766 | "1ka0xf70a55ndgmyrq7p5xxbd78pq7bfkqhgxsivaqdw6gn5lmcg")) |
fc1adab1 | 2767 | (patches (search-patches "maxima-defsystem-mkdir.patch")))) |
8731e527 | 2768 | (build-system gnu-build-system) |
df354a77 | 2769 | (inputs |
6b2eafaa | 2770 | `(("gcl" ,gcl) |
df354a77 | 2771 | ("gnuplot" ,gnuplot) ;for plots |
f36afe4d | 2772 | ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima' |
df354a77 FB |
2773 | (native-inputs |
2774 | `(("texinfo" ,texinfo) | |
ccbc5758 KK |
2775 | ("perl" ,perl) |
2776 | ("python" ,python))) | |
8731e527 | 2777 | (arguments |
df354a77 FB |
2778 | `(#:configure-flags |
2779 | (list "--enable-gcl" | |
2780 | (string-append "--with-posix-shell=" | |
2781 | (assoc-ref %build-inputs "bash") | |
2782 | "/bin/sh") | |
2783 | (string-append "--with-wish=" | |
2784 | (assoc-ref %build-inputs "tk") | |
2785 | "/bin/wish" | |
2786 | (let ((v ,(package-version tk))) | |
2787 | (string-take v (string-index-right v #\.))))) | |
df354a77 | 2788 | ;; By default Maxima attempts to write temporary files to |
77af7b24 MW |
2789 | ;; '/tmp/nix-build-maxima-*', which won't exist at run time. |
2790 | ;; Work around that. | |
df354a77 | 2791 | #:make-flags (list "TMPDIR=/tmp") |
0093b126 KK |
2792 | #:phases |
2793 | (modify-phases %standard-phases | |
2794 | (add-before 'check 'pre-check | |
2795 | (lambda _ | |
2796 | (chmod "src/maxima" #o555) | |
2797 | #t)) | |
1472d19a KK |
2798 | (replace 'check |
2799 | (lambda _ | |
2800 | ;; This is derived from the testing code in the "debian/rules" file | |
2801 | ;; of Debian's Maxima package. | |
2802 | ;; If Maxima can successfully run this, the binary to be installed | |
2803 | ;; should be fine. | |
2804 | (zero? | |
2805 | (system | |
2806 | (string-append "./maxima-local " | |
2807 | "--lisp=gcl " | |
2808 | "--batch-string=\"run_testsuite();\" " | |
2809 | "| grep -q \"No unexpected errors found\""))))) | |
0093b126 KK |
2810 | ;; Make sure the doc and emacs files are found in the |
2811 | ;; standard location. Also configure maxima to find gnuplot | |
2812 | ;; without having it on the PATH. | |
2813 | (add-after 'install 'post-install | |
2814 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
2815 | (let* ((gnuplot (assoc-ref inputs "gnuplot")) | |
2816 | (out (assoc-ref outputs "out")) | |
2817 | (datadir (string-append out "/share/maxima/" ,version)) | |
2818 | (binutils (string-append (assoc-ref inputs "binutils") | |
2819 | "/bin"))) | |
2820 | (with-directory-excursion out | |
2821 | (mkdir-p "share/emacs") | |
2822 | (mkdir-p "share/doc") | |
2823 | (symlink | |
2824 | (string-append datadir "/emacs/") | |
2825 | (string-append out "/share/emacs/site-lisp")) | |
2826 | (symlink | |
2827 | (string-append datadir "/doc/") | |
2828 | (string-append out "/share/doc/maxima")) | |
2829 | (with-atomic-file-replacement | |
2830 | (string-append datadir "/share/maxima-init.lisp") | |
2831 | (lambda (in out) | |
2832 | (format out "~a ~s~a~%" | |
2833 | "(setf $gnuplot_command " | |
2834 | (string-append gnuplot "/bin/gnuplot") ")") | |
2835 | (dump-port in out)))) | |
2836 | ;; Ensure that Maxima will have access to the GNU binutils | |
2837 | ;; components at runtime. | |
2838 | (wrap-program (string-append out "/bin/maxima") | |
2839 | `("PATH" prefix (,binutils)))) | |
2840 | #t))))) | |
8731e527 JD |
2841 | (home-page "http://maxima.sourceforge.net") |
2842 | (synopsis "Numeric and symbolic expression manipulation") | |
2843 | (description "Maxima is a system for the manipulation of symbolic and | |
2844 | numerical expressions. It yields high precision numeric results by using | |
2845 | exact fractions, arbitrary precision integers, and variable precision floating | |
e881752c | 2846 | point numbers.") |
8731e527 JD |
2847 | ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+. |
2848 | ;; Others simply say "GNU General Public License" without stating a | |
2849 | ;; version (which implicitly means gpl1+). | |
2850 | ;; At least one file (src/maxima.asd) says "version 2." | |
2851 | ;; GPLv2 only is therefore the smallest subset. | |
f36afe4d | 2852 | (license license:gpl2))) |
ec322be2 | 2853 | |
9aafbc0c MW |
2854 | (define-public wxmaxima |
2855 | (package | |
2856 | (name "wxmaxima") | |
c93b77ad | 2857 | (version "18.11.4") |
9aafbc0c MW |
2858 | (source |
2859 | (origin | |
c93b77ad KK |
2860 | (method git-fetch) |
2861 | (uri (git-reference | |
2862 | (url "https://github.com/wxMaxima-developers/wxmaxima.git") | |
2863 | (commit (string-append "Version-" version)))) | |
2864 | (file-name (git-file-name name version)) | |
9aafbc0c MW |
2865 | (sha256 |
2866 | (base32 | |
c93b77ad | 2867 | "1sz8n9v23q442l7yjj67pjh0dk78rl4cbcc3j8m1bm88anlfxl9r")))) |
0181df53 | 2868 | (build-system cmake-build-system) |
5143517c | 2869 | (native-inputs |
0181df53 | 2870 | `(("gettext" ,gettext-minimal))) |
9aafbc0c MW |
2871 | (inputs |
2872 | `(("wxwidgets" ,wxwidgets) | |
de477809 SB |
2873 | ("maxima" ,maxima) |
2874 | ;; Runtime support. | |
2875 | ("adwaita-icon-theme" ,adwaita-icon-theme) | |
2876 | ("gtk+" ,gtk+) | |
2877 | ("shared-mime-info" ,shared-mime-info))) | |
9aafbc0c | 2878 | (arguments |
0181df53 KK |
2879 | `(#:tests? #f ; no check target |
2880 | #:phases | |
ac2ddcc6 | 2881 | (modify-phases %standard-phases |
ac2ddcc6 KK |
2882 | (add-after 'install 'wrap-program |
2883 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2884 | (wrap-program (string-append (assoc-ref outputs "out") | |
2885 | "/bin/wxmaxima") | |
2886 | `("PATH" ":" prefix | |
2887 | (,(string-append (assoc-ref inputs "maxima") | |
2888 | "/bin"))) | |
2889 | ;; For GtkFileChooserDialog. | |
2890 | `("GSETTINGS_SCHEMA_DIR" = | |
2891 | (,(string-append (assoc-ref inputs "gtk+") | |
2892 | "/share/glib-2.0/schemas"))) | |
2893 | `("XDG_DATA_DIRS" ":" prefix | |
2894 | (;; Needed by gdk-pixbuf to know supported icon formats. | |
2895 | ,(string-append | |
2896 | (assoc-ref inputs "shared-mime-info") "/share") | |
2897 | ;; The default icon theme of GTK+. | |
2898 | ,(string-append | |
2899 | (assoc-ref inputs "adwaita-icon-theme") "/share")))) | |
2900 | #t))))) | |
9aafbc0c MW |
2901 | (home-page "https://andrejv.github.io/wxmaxima/") |
2902 | (synopsis "Graphical user interface for the Maxima computer algebra system") | |
2903 | (description | |
2904 | "wxMaxima is a graphical user interface for the Maxima computer algebra | |
2905 | system. It eases the use of Maxima by making most of its commands available | |
2906 | through a menu system and by providing input dialogs for commands that require | |
2907 | more than one argument. It also implements its own display engine that | |
2908 | outputs mathematical symbols directly instead of depicting them with ASCII | |
2909 | characters. | |
2910 | ||
2911 | wxMaxima also features 2D and 3D inline plots, simple animations, mixing of | |
2912 | text and mathematical calculations to create documents, exporting of input and | |
2913 | output to TeX, and a browser for Maxima's manual including command index and | |
2914 | full text searching.") | |
2915 | (license license:gpl2+))) | |
2916 | ||
b15e47f9 RW |
2917 | (define-public armadillo |
2918 | (package | |
2919 | (name "armadillo") | |
f133e244 | 2920 | (version "9.100.5") |
b15e47f9 RW |
2921 | (source (origin |
2922 | (method url-fetch) | |
2923 | (uri (string-append "mirror://sourceforge/arma/armadillo-" | |
7397cd9e | 2924 | version ".tar.xz")) |
b15e47f9 RW |
2925 | (sha256 |
2926 | (base32 | |
f133e244 | 2927 | "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby")))) |
b15e47f9 | 2928 | (build-system cmake-build-system) |
e405c0bc | 2929 | (arguments `(#:tests? #f)) ; no test target |
b15e47f9 RW |
2930 | (inputs |
2931 | `(("openblas" ,openblas) | |
2932 | ("lapack" ,lapack) | |
2933 | ("arpack" ,arpack-ng))) | |
2934 | (home-page "http://arma.sourceforge.net/") | |
2935 | (synopsis "C++ linear algebra library") | |
2936 | (description | |
2937 | "Armadillo is a C++ linear algebra library, aiming towards a good balance | |
2938 | between speed and ease of use. It is useful for algorithm development | |
2939 | directly in C++, or quick conversion of research code into production | |
2940 | environments. It can be used for machine learning, pattern recognition, | |
2941 | signal processing, bioinformatics, statistics, econometrics, etc. The library | |
2942 | provides efficient classes for vectors, matrices and cubes, as well as 150+ | |
2943 | associated functions (eg. contiguous and non-contiguous submatrix views).") | |
fe418cc5 | 2944 | (license license:asl2.0))) |
b15e47f9 | 2945 | |
279663ef | 2946 | (define-public muparser |
d7cff656 LF |
2947 | ;; When switching download sites, muparser re-issued a 2.2.5 release with a |
2948 | ;; different hash. In order to make `guix package --upgrade` work correctly, | |
2949 | ;; we set a Guix packaging revision. | |
2950 | ;; When the next version of muparser is released, we can remove | |
2951 | ;; UPSTREAM-VERSION and REVISION and use the plain VERSION. | |
2952 | (let ((upstream-version "2.2.5") | |
2953 | (revision "2")) | |
2954 | (package | |
2955 | (name "muparser") | |
2956 | (version (string-append upstream-version "-" revision)) | |
2957 | (source | |
2958 | (origin | |
2959 | (method url-fetch) | |
2960 | (uri (string-append "https://github.com/beltoforion/muparser/archive/v" | |
2961 | upstream-version ".tar.gz")) | |
2962 | (file-name (string-append name "-" version ".tar.gz")) | |
2963 | (sha256 | |
2964 | (base32 | |
2965 | "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6")))) | |
2966 | (build-system gnu-build-system) | |
2967 | (arguments | |
2968 | `(#:configure-flags '("--enable-samples=no") | |
2969 | #:tests? #f)) ;no "check" target | |
2970 | (home-page "http://muparser.beltoforion.de/") | |
2971 | (synopsis "Fast parser library for mathematical expressions") | |
2972 | (description | |
2973 | "muParser is an extensible high performance math parser library. It is | |
2974 | based on transforming an expression into a bytecode and precalculating constant | |
2975 | parts of it.") | |
2976 | (license license:expat)))) | |
279663ef | 2977 | |
e73b49fb RW |
2978 | (define-public openblas |
2979 | (package | |
2980 | (name "openblas") | |
9adaf1f4 | 2981 | (version "0.3.3") |
e73b49fb RW |
2982 | (source |
2983 | (origin | |
2984 | (method url-fetch) | |
a617fd55 MB |
2985 | (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20" |
2986 | version "%20version.tar.gz")) | |
e73b49fb RW |
2987 | (file-name (string-append name "-" version ".tar.gz")) |
2988 | (sha256 | |
2989 | (base32 | |
9adaf1f4 | 2990 | "0cvlixnpc3cdvvn3f30phfvsgnqljqix6wn72ps9rj7xdhvw06jg")))) |
e73b49fb RW |
2991 | (build-system gnu-build-system) |
2992 | (arguments | |
5789566a | 2993 | `(#:test-target "test" |
bd0b4379 RW |
2994 | ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no |
2995 | ;; TARGET is specified, OpenBLAS will tune itself to the build host, so | |
2996 | ;; we need to disable substitutions. | |
71923a91 AE |
2997 | #:substitutable? |
2998 | ,(let ((system (or (%current-target-system) (%current-system)))) | |
2999 | (or (string-prefix? "x86_64" system) | |
bd0b4379 | 3000 | (string-prefix? "i686" system) |
83a34647 EF |
3001 | (string-prefix? "mips" system) |
3002 | (string-prefix? "aarch64" system))) | |
e73b49fb RW |
3003 | #:make-flags |
3004 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
3005 | "SHELL=bash" | |
af5b817e RW |
3006 | ;; Build the library for all supported CPUs. This allows |
3007 | ;; switching CPU targets at runtime with the environment variable | |
3008 | ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type. | |
71923a91 AE |
3009 | ;; Unfortunately, this is not supported on non-x86 architectures, |
3010 | ;; where it leads to failed builds. | |
3011 | ,@(let ((system (or (%current-target-system) (%current-system)))) | |
8a637e79 RW |
3012 | (cond |
3013 | ((or (string-prefix? "x86_64" system) | |
71923a91 | 3014 | (string-prefix? "i686" system)) |
8a637e79 RW |
3015 | '("DYNAMIC_ARCH=1")) |
3016 | ;; On MIPS we force the "SICORTEX" TARGET, as for the other | |
3017 | ;; two available MIPS targets special extended instructions | |
3018 | ;; for Loongson cores are used. | |
3019 | ((string-prefix? "mips" system) | |
3020 | '("TARGET=SICORTEX")) | |
83a34647 EF |
3021 | ;; On aarch64 force the generic 'armv8-a' target |
3022 | ((string-prefix? "aarch64" system) | |
3023 | '("TARGET=ARMV8")) | |
8a637e79 | 3024 | (else '())))) |
e73b49fb | 3025 | ;; no configure script |
493937ae DL |
3026 | #:phases |
3027 | (modify-phases %standard-phases | |
3028 | (delete 'configure) | |
3029 | (add-before 'build 'set-extralib | |
3030 | (lambda* (#:key inputs #:allow-other-keys) | |
3031 | ;; Get libgfortran found when building in utest. | |
3032 | (setenv "FEXTRALIB" | |
3033 | (string-append "-L" (assoc-ref inputs "fortran-lib") | |
3034 | "/lib")) | |
3035 | #t))))) | |
e73b49fb | 3036 | (inputs |
493937ae | 3037 | `(("fortran-lib" ,gfortran "lib"))) |
e73b49fb RW |
3038 | (native-inputs |
3039 | `(("cunit" ,cunit) | |
493937ae | 3040 | ("fortran" ,gfortran) |
e73b49fb RW |
3041 | ("perl" ,perl))) |
3042 | (home-page "http://www.openblas.net/") | |
3043 | (synopsis "Optimized BLAS library based on GotoBLAS") | |
3044 | (description | |
3045 | "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.") | |
3046 | (license license:bsd-3))) | |
3047 | ||
daa6036f EB |
3048 | (define-public openblas-ilp64 |
3049 | (package (inherit openblas) | |
3050 | (name "openblas-ilp64") | |
3051 | (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux")) | |
3052 | (arguments | |
3053 | (substitute-keyword-arguments (package-arguments openblas) | |
3054 | ((#:make-flags flags '()) | |
3055 | `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64") | |
3056 | ,flags)))) | |
3057 | (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") | |
3058 | (license license:bsd-3))) | |
3059 | ||
5a7deb11 LC |
3060 | (define* (make-blis implementation #:optional substitutable?) |
3061 | "Return a BLIS package with the given IMPLEMENTATION (see config/ in the | |
3062 | source tree for a list of implementations.) | |
3063 | ||
3064 | SUBSTITUTABLE? determines whether the package is made available as a | |
3065 | substitute. | |
3066 | ||
3067 | Currently the specialization must be selected at configure-time, but work is | |
3068 | underway to allow BLIS to select the right optimized kernels at run time: | |
3069 | <https://github.com/flame/blis/issues/129>." | |
3070 | (package | |
3071 | (name (if (string=? implementation "reference") | |
3072 | "blis" | |
3073 | (string-append "blis-" implementation))) | |
3074 | (version "0.2.2") | |
3075 | (home-page "https://github.com/flame/blis") | |
3076 | (source (origin | |
3077 | (method git-fetch) | |
3078 | (uri (git-reference (url home-page) (commit version))) | |
3079 | (sha256 | |
3080 | (base32 | |
3081 | "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh")) | |
3082 | (file-name (git-file-name "blis" version)))) | |
3083 | (build-system gnu-build-system) | |
3084 | (arguments | |
3085 | `(#:test-target "test" | |
3086 | ||
3087 | #:substitutable? ,substitutable? | |
3088 | ||
3089 | #:phases (modify-phases %standard-phases | |
3090 | (replace 'configure | |
3091 | (lambda* (#:key outputs #:allow-other-keys) | |
3092 | ;; This is a home-made 'configure' script. | |
3093 | (let ((out (assoc-ref outputs "out"))) | |
3094 | (zero? (system* "./configure" "-p" out | |
3095 | "-d" "opt" | |
3096 | "--disable-static" | |
3097 | "--enable-shared" | |
3098 | "--enable-threading=openmp" | |
3099 | ||
3100 | ,implementation))))) | |
3101 | (add-before 'check 'show-test-output | |
3102 | (lambda _ | |
3103 | ;; By default "make check" is silent. Make it verbose. | |
3104 | (system "tail -F output.testsuite &") | |
3105 | #t))))) | |
3106 | (synopsis "High-performance basic linear algebra (BLAS) routines") | |
3107 | (description | |
3108 | "BLIS is a portable software framework for instantiating high-performance | |
3109 | BLAS-like dense linear algebra libraries. The framework was designed to | |
3110 | isolate essential kernels of computation that, when optimized, immediately | |
3111 | enable optimized implementations of most of its commonly used and | |
3112 | computationally intensive operations. While BLIS exports a new BLAS-like API, | |
3113 | it also includes a BLAS compatibility layer which gives application developers | |
3114 | access to BLIS implementations via traditional BLAS routine calls.") | |
3115 | (license license:bsd-3))) | |
3116 | ||
3117 | (define-public blis | |
3118 | ;; This is the "reference" implementation, which is the non-optimized but | |
3119 | ;; portable variant (no assembly). | |
3120 | (make-blis "reference" #t)) | |
3121 | ||
3122 | (define ignorance blis) | |
3123 | ||
3124 | (define-syntax-rule (blis/x86_64 processor) | |
3125 | "Expand to a package specialized for PROCESSOR." | |
3126 | (package | |
3127 | (inherit (make-blis processor)) | |
3128 | (supported-systems '("x86_64-linux")))) | |
3129 | ||
3130 | (define-public blis-sandybridge | |
3131 | ;; BLIS specialized for Sandy Bridge processors (launched 2011): | |
3132 | ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>. | |
3133 | (blis/x86_64 "sandybridge")) | |
3134 | ||
3135 | (define-public blis-haswell | |
3136 | ;; BLIS specialized for Haswell processors (launched 2013): | |
3137 | ;; <http://ark.intel.com/products/codename/42174/Haswell>. | |
3138 | (blis/x86_64 "haswell")) | |
3139 | ||
3140 | (define-public blis-knl | |
3141 | ;; BLIS specialized for Knights Landing processor (launched 2016): | |
3142 | ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>. | |
3143 | (blis/x86_64 "knl")) | |
3144 | ||
3145 | ||
e1605e36 RW |
3146 | (define-public openlibm |
3147 | (package | |
3148 | (name "openlibm") | |
48d7ac17 | 3149 | (version "0.6.0") |
e1605e36 RW |
3150 | (source |
3151 | (origin | |
3152 | (method url-fetch) | |
3153 | (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v" | |
3154 | version ".tar.gz")) | |
3155 | (file-name (string-append name "-" version ".tar.gz")) | |
3156 | (sha256 | |
3157 | (base32 | |
48d7ac17 | 3158 | "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l")))) |
e1605e36 RW |
3159 | (build-system gnu-build-system) |
3160 | (arguments | |
3161 | `(#:make-flags | |
3162 | (list (string-append "prefix=" (assoc-ref %outputs "out"))) | |
3163 | #:phases | |
3164 | ;; no configure script | |
dc1d3cde | 3165 | (modify-phases %standard-phases (delete 'configure)) |
e1605e36 RW |
3166 | #:tests? #f)) ;the tests are part of the default target |
3167 | (home-page "http://openlibm.org/") | |
3168 | (synopsis "Portable C mathematical library (libm)") | |
3169 | (description | |
3170 | "OpenLibm is an effort to have a high quality, portable, standalone C | |
3171 | mathematical library (libm). It can be used standalone in applications and | |
3172 | programming language implementations. The project was born out of a need to | |
e881752c | 3173 | have a good libm for the Julia programming language that worked consistently |
e1605e36 RW |
3174 | across compilers and operating systems, and in 32-bit and 64-bit |
3175 | environments.") | |
538c0e3b EF |
3176 | ;; Each architecture has its own make target, and there is none for mips. |
3177 | (supported-systems (delete "mips64el-linux" %supported-systems)) | |
e1605e36 RW |
3178 | ;; See LICENSE.md for details. |
3179 | (license (list license:expat | |
3180 | license:isc | |
3181 | license:bsd-2 | |
3182 | license:public-domain | |
3183 | license:lgpl2.1+)))) | |
3184 | ||
e62be58f RW |
3185 | (define-public openspecfun |
3186 | (package | |
3187 | (name "openspecfun") | |
59cd0ba4 | 3188 | (version "0.5.3") |
e62be58f RW |
3189 | (source |
3190 | (origin | |
3191 | (method url-fetch) | |
3192 | (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v" | |
3193 | version ".tar.gz")) | |
3194 | (file-name (string-append name "-" version ".tar.gz")) | |
3195 | (sha256 | |
3196 | (base32 | |
59cd0ba4 | 3197 | "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m")))) |
e62be58f RW |
3198 | (build-system gnu-build-system) |
3199 | (arguments | |
59cd0ba4 | 3200 | '(#:tests? #f ; no "check" target |
e62be58f RW |
3201 | #:make-flags |
3202 | (list (string-append "prefix=" (assoc-ref %outputs "out"))) | |
59cd0ba4 TGR |
3203 | #:phases |
3204 | (modify-phases %standard-phases | |
3205 | (delete 'configure)))) ; no configure script | |
e62be58f | 3206 | (inputs |
19afbea1 | 3207 | `(("fortran" ,gfortran))) |
e62be58f RW |
3208 | (home-page "https://github.com/JuliaLang/openspecfun") |
3209 | (synopsis "Collection of special mathematical functions") | |
3210 | (description | |
3211 | "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a | |
3212 | portable package for Bessel Functions of a Complex Argument and Nonnegative | |
3213 | Order; it contains subroutines for computing Bessel functions and Airy | |
3214 | functions. Faddeeva allows computing the various error functions of arbitrary | |
3215 | complex arguments (Faddeeva function, error function, complementary error | |
3216 | function, scaled complementary error function, imaginary error function, and | |
3217 | Dawson function); given these, one can also easily compute Voigt functions, | |
3218 | Fresnel integrals, and similar related functions as well.") | |
3219 | ;; Faddeeva is released under the Expat license; AMOS is included as | |
3220 | ;; public domain software. | |
3221 | (license (list license:expat license:public-domain)))) | |
3222 | ||
2742f87e RW |
3223 | (define-public suitesparse |
3224 | (package | |
3225 | (name "suitesparse") | |
bd5b5ac0 | 3226 | (version "4.5.5") |
2742f87e RW |
3227 | (source |
3228 | (origin | |
3229 | (method url-fetch) | |
3230 | (uri (string-append | |
3231 | "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-" | |
3232 | version ".tar.gz")) | |
3233 | (sha256 | |
3234 | (base32 | |
bd5b5ac0 EB |
3235 | "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr")) |
3236 | (modules '((guix build utils))) | |
3237 | (snippet | |
3238 | ;; Remove bundled metis source | |
6cbee49d MW |
3239 | '(begin |
3240 | (delete-file-recursively "metis-5.1.0") | |
3241 | #t)))) | |
2742f87e RW |
3242 | (build-system gnu-build-system) |
3243 | (arguments | |
bd5b5ac0 | 3244 | '(#:tests? #f ;no "check" target |
2742f87e RW |
3245 | #:make-flags |
3246 | (list "CC=gcc" | |
3247 | "BLAS=-lblas" | |
3248 | "TBB=-ltbb" | |
bd5b5ac0 | 3249 | "MY_METIS_LIB=-lmetis" |
2742f87e RW |
3250 | (string-append "INSTALL_LIB=" |
3251 | (assoc-ref %outputs "out") "/lib") | |
3252 | (string-append "INSTALL_INCLUDE=" | |
bd5b5ac0 EB |
3253 | (assoc-ref %outputs "out") "/include") |
3254 | "library") | |
2742f87e | 3255 | #:phases |
2509522c | 3256 | (modify-phases %standard-phases |
bd5b5ac0 | 3257 | (delete 'configure)))) ;no configure script |
2742f87e RW |
3258 | (inputs |
3259 | `(("tbb" ,tbb) | |
bd5b5ac0 EB |
3260 | ("lapack" ,lapack) |
3261 | ("metis" ,metis))) | |
2742f87e RW |
3262 | (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html") |
3263 | (synopsis "Suite of sparse matrix software") | |
3264 | (description | |
3265 | "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK, | |
3266 | multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR, | |
3267 | multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit | |
3268 | simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and | |
3269 | CXSparse, a concise sparse Cholesky factorization package; and many other | |
3270 | packages.") | |
3271 | ;; LGPLv2.1+: | |
3272 | ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL | |
3273 | ;; GPLv2+: | |
3274 | ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK | |
3275 | (license (list license:gpl2+ license:lgpl2.1+)))) | |
3276 | ||
ec322be2 FB |
3277 | (define-public atlas |
3278 | (package | |
3279 | (name "atlas") | |
3c98ac02 | 3280 | (version "3.10.3") |
ec322be2 FB |
3281 | (source (origin |
3282 | (method url-fetch) | |
de67e922 LF |
3283 | (uri (string-append "mirror://sourceforge/math-atlas/Stable/" |
3284 | version "/atlas" version ".tar.bz2")) | |
ec322be2 FB |
3285 | (sha256 |
3286 | (base32 | |
3c98ac02 | 3287 | "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216")))) |
ec322be2 FB |
3288 | (build-system gnu-build-system) |
3289 | (home-page "http://math-atlas.sourceforge.net/") | |
19afbea1 | 3290 | (inputs `(("gfortran" ,gfortran) |
ec322be2 FB |
3291 | ("lapack-tar" ,(package-source lapack)))) |
3292 | (outputs '("out" "doc")) | |
01480b9e FB |
3293 | ;; For the moment we drop support for MIPS at it fails to compile. See |
3294 | ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html | |
3295 | (supported-systems (delete "mips64el-linux" %supported-systems)) | |
ec322be2 FB |
3296 | (arguments |
3297 | `(#:parallel-build? #f | |
3298 | #:parallel-tests? #f | |
f15615b1 LC |
3299 | |
3300 | ;; ATLAS tunes itself for the machine it is built on, as explained at | |
3301 | ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>. | |
3302 | ;; For this reason, we want users to build it locally instead of using | |
3303 | ;; substitutes. | |
3304 | #:substitutable? #f | |
3305 | ||
ec322be2 FB |
3306 | #:modules ((srfi srfi-26) |
3307 | (srfi srfi-1) | |
3308 | (guix build gnu-build-system) | |
3309 | (guix build utils)) | |
40029cbe | 3310 | #:configure-flags |
ec322be2 FB |
3311 | `(;; Generate position independent code suitable for dynamic libraries |
3312 | ;; and use WALL timer to get more accurate timing. | |
3313 | "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL" | |
3314 | ;; Set word width. | |
3315 | "-b" | |
3316 | ,,(if (string-match "64" (%current-system)) | |
3317 | "64" | |
3318 | "32") | |
3319 | ;; Disable parallel build as it gives errors: atlas_pthread.h is | |
3320 | ;; needed to compile C files before it is generated. | |
3321 | "-Ss" "pmake" "make -j 1" | |
af89a667 FB |
3322 | ;; Probe is failing for MIPS. We therefore define the system |
3323 | ;; architecture explicitly by setting (-A) MACHINETYPE = 49 | |
3324 | ;; 'MIPSR1xK' and (-V) ISA = 1 'none'. | |
3325 | ,,@(if (string-prefix? "mips" (%current-system)) | |
3326 | (list "-A" "49" "-V" "1") | |
3327 | (list)) | |
ec322be2 FB |
3328 | ;; Generate shared libraries. |
3329 | "--shared" | |
3330 | ;; Build a full LAPACK library. | |
3331 | ,(string-append "--with-netlib-lapack-tarfile=" | |
3332 | (assoc-ref %build-inputs "lapack-tar"))) | |
3333 | #:phases | |
e5b4b96b EF |
3334 | (modify-phases %standard-phases |
3335 | (add-after 'install 'install-doc | |
3336 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
3337 | (let ((doc (string-append (assoc-ref outputs "doc") | |
3338 | "/share/doc/atlas"))) | |
3339 | (mkdir-p doc) | |
3340 | (fold (lambda (file previous) | |
3341 | (and previous (zero? (system* "cp" file doc)))) | |
3342 | #t (find-files "../ATLAS/doc" ".*"))))) | |
3343 | (add-after 'check 'check-pt | |
3344 | (lambda _ (zero? (system* "make" "ptcheck")))) | |
3345 | ;; Fix files required to run configure. | |
3346 | (add-before 'configure 'fix-/bin/sh | |
ec322be2 FB |
3347 | (lambda _ |
3348 | ;; Use `sh', not `/bin/sh'. | |
3349 | (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c") | |
3350 | (("/bin/sh") | |
e5b4b96b EF |
3351 | "sh")))) |
3352 | ;; Fix /bin/sh in generated make files. | |
3353 | (add-after 'configure 'fix-/bin/sh-in-generated-files | |
3354 | (lambda _ | |
3355 | (substitute* (find-files "." "^[Mm]ake\\.inc.*") | |
3356 | (("/bin/sh") | |
3357 | "sh")))) | |
3358 | ;; ATLAS configure program does not accepts the default flags | |
3359 | ;; passed by the 'gnu-build-system'. | |
3360 | (replace 'configure | |
3361 | (lambda* (#:key native-inputs inputs outputs | |
3362 | (configure-flags '()) | |
3363 | #:allow-other-keys #:rest args) | |
3364 | (let* ((prefix (assoc-ref outputs "out")) | |
3365 | (bash (or (and=> (assoc-ref | |
3366 | (or native-inputs inputs) "bash") | |
3367 | (cut string-append <> "/bin/bash")) | |
3368 | "/bin/sh")) | |
3369 | (flags `(,(string-append "--prefix=" prefix) | |
3370 | ,@configure-flags)) | |
3371 | (abs-srcdir (getcwd)) | |
3372 | (srcdir (string-append "../" (basename abs-srcdir)))) | |
3373 | (format #t "source directory: ~s (relative from build: ~s)~%" | |
3374 | abs-srcdir srcdir) | |
3375 | (mkdir "../build") | |
3376 | (chdir "../build") | |
3377 | (format #t "build directory: ~s~%" (getcwd)) | |
3378 | (format #t "configure flags: ~s~%" flags) | |
3379 | (zero? (apply system* bash | |
3380 | (string-append srcdir "/configure") | |
3381 | flags)))))))) | |
ec322be2 FB |
3382 | (synopsis "Automatically Tuned Linear Algebra Software") |
3383 | (description | |
3384 | "ATLAS is an automatically tuned linear algebra software library | |
3385 | providing C and Fortran77 interfaces to a portably efficient BLAS | |
3386 | implementation, as well as a few routines from LAPACK. | |
3387 | ||
f15615b1 LC |
3388 | Optimization occurs at build time. For this reason, the library is built on |
3389 | the machine where it is installed, without resorting to pre-built substitutes. | |
ec322be2 | 3390 | |
f15615b1 | 3391 | Before building the library, CPU throttling should be disabled. This can be |
d97c429a | 3392 | done in the BIOS, or, on GNU/Linux, with the following command: |
ec322be2 | 3393 | |
8e9ba611 | 3394 | @example |
d97c429a | 3395 | # cpupower --governor performance |
8e9ba611 | 3396 | @end example |
ec322be2 | 3397 | |
d97c429a | 3398 | Failure to do so will result in a library with poor performance.") |
ec322be2 | 3399 | (license license:bsd-3))) |
c12efc72 AE |
3400 | |
3401 | (define-public glm | |
3402 | (package | |
3403 | (name "glm") | |
66044a36 | 3404 | (version "0.9.9.3") |
c12efc72 AE |
3405 | (source |
3406 | (origin | |
3407 | (method url-fetch) | |
5ea4b594 MB |
3408 | (uri (string-append "https://github.com/g-truc/glm/releases/download/" |
3409 | version "/glm-" version ".zip")) | |
c12efc72 AE |
3410 | (sha256 |
3411 | (base32 | |
66044a36 | 3412 | "0yqk5r3qh60d4r2iab5q7wq0fryn8p3pz6s28y1i7amqj1aqavj9")))) |
c12efc72 AE |
3413 | (build-system cmake-build-system) |
3414 | (native-inputs | |
3415 | `(("unzip" ,unzip))) | |
46bda5eb | 3416 | (home-page "https://glm.g-truc.net/") |
c12efc72 AE |
3417 | (synopsis "OpenGL Mathematics library") |
3418 | (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics | |
3419 | library for graphics software based on the OpenGL Shading Language (GLSL) | |
3420 | specifications.") | |
3421 | (license license:expat))) | |
7f18257b AE |
3422 | |
3423 | (define-public lpsolve | |
3424 | (package | |
3425 | (name "lpsolve") | |
a89e0cf5 | 3426 | (version "5.5.2.5") |
7f18257b AE |
3427 | (source |
3428 | (origin | |
3429 | (method url-fetch) | |
3430 | (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version | |
3431 | "/lp_solve_" version "_source.tar.gz")) | |
3432 | (sha256 | |
3433 | (base32 | |
a89e0cf5 | 3434 | "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0")) |
7f18257b AE |
3435 | (modules '((guix build utils))) |
3436 | (snippet | |
6cbee49d MW |
3437 | '(begin |
3438 | (substitute* (list "lp_solve/ccc" "lpsolve55/ccc") | |
3439 | (("^c=cc") "c=gcc") | |
3440 | ;; Pretend to be on a 64 bit platform to obtain a common directory | |
3441 | ;; name for the build results on all architectures; nothing else | |
3442 | ;; seems to depend on it. | |
3443 | (("^PLATFORM=.*$") "PLATFORM=ux64\n") | |
3444 | ||
3445 | ;; The check for 'isnan' as it is written fails with | |
3446 | ;; "non-floating-point argument in call to function | |
3447 | ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro | |
3448 | ;; definition, which in turn leads to bad things. Fix the feature | |
3449 | ;; test. | |
3450 | (("isnan\\(0\\)") "isnan(0.)")) | |
3451 | #t)))) | |
7f18257b AE |
3452 | (build-system gnu-build-system) |
3453 | (arguments | |
6c96b545 | 3454 | `(#:tests? #f ; no check target |
7f18257b AE |
3455 | #:phases |
3456 | (modify-phases %standard-phases | |
6c96b545 | 3457 | (delete 'configure) ; no configure script |
7f18257b AE |
3458 | (replace 'build |
3459 | (lambda _ | |
6c96b545 TGR |
3460 | (with-directory-excursion "lpsolve55" |
3461 | (invoke "bash" "ccc")) | |
3462 | (with-directory-excursion "lp_solve" | |
3463 | (invoke "bash" "ccc")) | |
3464 | #t)) | |
7f18257b AE |
3465 | (replace 'install |
3466 | (lambda* (#:key outputs #:allow-other-keys) | |
3467 | (let* ((out (assoc-ref outputs "out")) | |
3468 | (bin (string-append out "/bin")) | |
3469 | (lib (string-append out "/lib")) | |
3470 | ;; This is where LibreOffice expects to find the header | |
3471 | ;; files, and where they are installed by Debian. | |
3472 | (include (string-append out "/include/lpsolve"))) | |
6c96b545 TGR |
3473 | (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib) |
3474 | (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib) | |
96c46210 LC |
3475 | (install-file "lp_solve/bin/ux64/lp_solve" bin) |
3476 | ||
7f18257b AE |
3477 | ;; Install a subset of the header files as on Debian |
3478 | ;; (plus lp_bit.h, which matches the regular expression). | |
96c46210 LC |
3479 | (for-each (lambda (name) |
3480 | (install-file name include)) | |
3481 | (find-files "." "lp_[HMSa-z].*\\.h$")) | |
7f18257b | 3482 | (with-directory-excursion "shared" |
96c46210 LC |
3483 | (for-each (lambda (name) |
3484 | (install-file name include)) | |
3485 | (find-files "." "\\.h$"))) | |
7f18257b AE |
3486 | #t)))))) |
3487 | (home-page "http://lpsolve.sourceforge.net/") | |
3488 | (synopsis "Mixed integer linear programming (MILP) solver") | |
3489 | (description | |
3490 | "lp_solve is a mixed integer linear programming solver based on the | |
3491 | revised simplex and the branch-and-bound methods.") | |
3492 | (license license:lgpl2.1+))) | |
a17d4564 EB |
3493 | |
3494 | (define-public dealii | |
3495 | (package | |
3496 | (name "dealii") | |
24404eaf | 3497 | (version "8.5.1") |
a17d4564 EB |
3498 | (source |
3499 | (origin | |
3500 | (method url-fetch) | |
3501 | (uri (string-append "https://github.com/dealii/dealii/releases/" | |
3502 | "download/v" version "/dealii-" version ".tar.gz")) | |
3503 | (sha256 | |
3504 | (base32 | |
24404eaf | 3505 | "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk")) |
a17d4564 EB |
3506 | (modules '((guix build utils))) |
3507 | (snippet | |
3508 | ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost | |
6cbee49d MW |
3509 | '(begin |
3510 | (delete-file-recursively "bundled") | |
3511 | #t)))) | |
a17d4564 EB |
3512 | (build-system cmake-build-system) |
3513 | (inputs | |
3514 | `(("tbb" ,tbb) | |
3515 | ("zlib" ,zlib) | |
3516 | ("boost" ,boost) | |
3517 | ("p4est" ,p4est) | |
3518 | ("blas" ,openblas) | |
3519 | ("lapack" ,lapack) | |
3520 | ("arpack" ,arpack-ng) | |
3521 | ("muparser" ,muparser) | |
3522 | ("gfortran" ,gfortran) | |
3523 | ("suitesparse" ,suitesparse))) ;for UMFPACK | |
3524 | (arguments | |
3525 | `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease | |
d84b09e9 EB |
3526 | #:configure-flags |
3527 | ;; Work around a bug in libsuitesparseconfig linking | |
3528 | ;; see https://github.com/dealii/dealii/issues/4745 | |
3529 | '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"))) | |
a17d4564 EB |
3530 | (home-page "https://www.dealii.org") |
3531 | (synopsis "Finite element library") | |
3532 | (description | |
3533 | "Deal.II is a C++ program library targeted at the computational solution | |
3534 | of partial differential equations using adaptive finite elements. The main | |
3535 | aim of deal.II is to enable rapid development of modern finite element codes, | |
3536 | using among other aspects adaptive meshes and a wide array of tools often used | |
3537 | in finite element programs.") | |
3538 | (license license:lgpl2.1+))) | |
3539 | ||
3540 | (define-public dealii-openmpi | |
3541 | (package (inherit dealii) | |
3542 | (name "dealii-openmpi") | |
3543 | (inputs | |
3544 | `(("mpi" ,openmpi) | |
3545 | ;;Supported only with MPI: | |
3546 | ("p4est" ,p4est-openmpi) | |
3547 | ("petsc" ,petsc-openmpi) | |
3548 | ("slepc" ,slepc-openmpi) | |
3549 | ("metis" ,metis) ;for MUMPS | |
3550 | ("scalapack" ,scalapack) ;for MUMPS | |
3551 | ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings | |
3552 | ("arpack" ,arpack-ng-openmpi) | |
3553 | ,@(fold alist-delete (package-inputs dealii) | |
3554 | '("p4est" "arpack")))) | |
3555 | (arguments | |
3556 | (substitute-keyword-arguments (package-arguments dealii) | |
3557 | ((#:configure-flags cf) | |
3558 | ``("-DMPI_C_COMPILER=mpicc" | |
3559 | "-DMPI_CXX_COMPILER=mpicxx" | |
3560 | "-DMPI_Fortran_COMPILER=mpifort" | |
3561 | ,@,cf)))) | |
3562 | (synopsis "Finite element library (with MPI support)"))) | |
194c7f95 AE |
3563 | |
3564 | (define-public flann | |
3565 | (package | |
3566 | (name "flann") | |
3567 | (version "1.8.4") | |
3568 | (source | |
3569 | (origin | |
3570 | (method url-fetch) | |
3571 | (uri | |
3572 | (string-append | |
3573 | "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-" | |
3574 | version "-src.zip")) | |
3575 | (sha256 | |
3576 | (base32 | |
b5edc479 LC |
3577 | "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz")) |
3578 | (patches (search-patches "flann-cmake-3.11.patch")))) | |
194c7f95 | 3579 | (build-system cmake-build-system) |
6b6aca9b LC |
3580 | (outputs '("out" |
3581 | "octave")) ;46 MiB .mex file that pulls Octave | |
194c7f95 AE |
3582 | (native-inputs |
3583 | `(("unzip" ,unzip))) | |
3584 | (inputs | |
3585 | `(("hdf5" ,hdf5) | |
5537603f | 3586 | ("octave" ,octave-cli) |
194c7f95 AE |
3587 | ("python" ,python-2) ; print syntax |
3588 | ;; ("python2-numpy" ,python2-numpy) ; only required for the tests | |
3589 | ("zlib" ,zlib))) | |
3590 | (arguments | |
39b30337 LC |
3591 | `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file |
3592 | ;; taken 46 MiB unstripped, and 6 MiB stripped. | |
3593 | #:strip-directories '("lib" "lib64" "libexec" | |
3594 | "bin" "sbin" "share/flann/octave") | |
3595 | ||
9684e30b LC |
3596 | ;; Save 12 MiB by not installing .a files. Passing |
3597 | ;; '-DBUILD_STATIC_LIBS=OFF' has no effect. | |
3598 | #:phases (modify-phases %standard-phases | |
6b6aca9b LC |
3599 | (add-before 'configure 'set-octave-directory |
3600 | (lambda* (#:key outputs #:allow-other-keys) | |
3601 | ;; Install the .mex file in the "octave" output. | |
3602 | (let ((out (assoc-ref outputs "octave"))) | |
3603 | (substitute* "src/matlab/CMakeLists.txt" | |
3604 | (("share/flann/octave") | |
3605 | (string-append out "/share/flann/octave"))) | |
3606 | #t))) | |
9684e30b LC |
3607 | (add-after 'install 'remove-static-libraries |
3608 | (lambda* (#:key outputs #:allow-other-keys) | |
3609 | (let* ((out (assoc-ref outputs "out")) | |
3610 | (lib (string-append out "/lib"))) | |
3611 | (for-each delete-file | |
3612 | (find-files lib "\\.a$")) | |
3613 | #t)))) | |
3614 | ||
39b30337 | 3615 | #:tests? #f)) ; The test data are downloaded from the Internet. |
194c7f95 AE |
3616 | (home-page "http://www.cs.ubc.ca/research/flann/") |
3617 | (synopsis "Library for approximate nearest neighbors computation") | |
3618 | (description "FLANN is a library for performing fast approximate | |
3619 | nearest neighbor searches in high dimensional spaces. It implements a | |
3620 | collection of algorithms and a system for automatically choosing the best | |
3621 | algorithm and optimum parameters depending on the dataset. | |
3622 | ||
3623 | FLANN is written in C++ and contains bindings for C, Octave and Python.") | |
3624 | (license (license:non-copyleft "file://COPYING" | |
3625 | "See COPYING in the distribution.")))) | |
d8c97beb EF |
3626 | |
3627 | (define-public wcalc | |
3628 | (package | |
3629 | (name "wcalc") | |
3630 | (version "2.5") | |
3631 | (source | |
3632 | (origin | |
3633 | (method url-fetch) | |
de67e922 LF |
3634 | (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/" |
3635 | "wcalc-" version ".tar.bz2")) | |
d8c97beb EF |
3636 | (sha256 |
3637 | (base32 | |
3638 | "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f")))) | |
3639 | (build-system gnu-build-system) | |
3640 | (inputs | |
3641 | `(("mpfr" ,mpfr) | |
3642 | ("readline" ,readline))) | |
3643 | (home-page "http://w-calc.sourceforge.net/index.php") | |
3644 | (synopsis "Flexible command-line scientific calculator") | |
3645 | (description "Wcalc is a very capable calculator. It has standard functions | |
3646 | (sin, asin, and sinh for example, in either radians or degrees), many | |
3647 | pre-defined constants (pi, e, c, etc.), support for using variables, \"active\" | |
3648 | variables, a command history, hex/octal/binary input and output, unit | |
3649 | conversions, embedded comments, and an expandable expression entry field. It | |
3650 | evaluates expressions using the standard order of operations.") | |
3651 | (license license:gpl2+))) | |
45147b0c FH |
3652 | |
3653 | (define-public xaos | |
3654 | (package | |
3655 | (name "xaos") | |
3656 | (version "3.6") | |
3657 | (source (origin | |
3658 | (method url-fetch) | |
de67e922 LF |
3659 | (uri (string-append "mirror://sourceforge/xaos/XaoS/" version |
3660 | "/xaos-" version ".tar.gz")) | |
45147b0c FH |
3661 | (sha256 |
3662 | (base32 | |
3663 | "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq")))) | |
3664 | (build-system gnu-build-system) | |
b94a6ca0 | 3665 | (native-inputs `(("gettext" ,gettext-minimal))) |
45147b0c FH |
3666 | (inputs `(("libx11" ,libx11) |
3667 | ("zlib" ,zlib) | |
3668 | ("libpng" ,libpng) | |
3669 | ("gsl" ,gsl))) | |
3670 | (arguments | |
3671 | `(#:tests? #f ;no "check" target | |
3672 | #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale"))) | |
3673 | (synopsis "Real-time fractal zoomer") | |
3674 | (description "GNU XaoS is a graphical program that generates fractal | |
3675 | patterns and allows you to zoom in and out of them infinitely in a fluid, | |
3676 | continuous manner. It also includes tutorials that help to explain how fractals | |
3677 | are built. It can generate many different fractal types such as the Mandelbrot | |
3678 | set.") | |
6fd52309 | 3679 | (home-page "https://www.gnu.org/software/xaos/") |
45147b0c | 3680 | (license license:gpl2+))) |
528bb464 EB |
3681 | |
3682 | (define-public hypre | |
3683 | (package | |
3684 | (name "hypre") | |
220458b0 | 3685 | (version "2.14.0") |
528bb464 EB |
3686 | (source (origin |
3687 | (method url-fetch) | |
3688 | (uri (string-append "https://github.com/LLNL/hypre/archive/" | |
3689 | "v" version ".tar.gz")) | |
3690 | (file-name (string-append name "-" version ".tar.gz")) | |
3691 | (sha256 | |
3692 | (base32 | |
220458b0 | 3693 | "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh")) |
528bb464 EB |
3694 | (modules '((guix build utils))) |
3695 | (snippet | |
3696 | '(begin | |
3697 | ;; Remove use of __DATE__ and __TIME__ for reproducibility; | |
3698 | ;; substitute the tarball creation time. | |
3699 | (substitute* "src/utilities/HYPRE_utilities.h" | |
3700 | (("Date Compiled: .*$") | |
220458b0 | 3701 | "Date Compiled: Apr 11 2018 16:24:59 +0000\"\n")) |
528bb464 EB |
3702 | #t)))) |
3703 | (build-system gnu-build-system) | |
3704 | (outputs '("out" ;6.1 MiB of headers and libraries | |
3705 | "doc")) ;4.8 MiB of documentation | |
3706 | (native-inputs | |
3707 | `(("doc++" ,doc++) | |
3708 | ("netpbm" ,netpbm) | |
e18e7cb9 | 3709 | ("perl" ,perl) ;needed to run 'ppmquant' during tests |
9b405aea PN |
3710 | ("texlive" ,(texlive-union (list texlive-generic-xypic |
3711 | texlive-fonts-xypic | |
3712 | texlive-latex-hyperref | |
3713 | texlive-latex-oberdiek | |
3714 | texlive-generic-ifxetex | |
3715 | texlive-latex-url | |
3716 | texlive-bibtex))) | |
528bb464 EB |
3717 | ("ghostscript" ,ghostscript))) |
3718 | (inputs | |
3719 | `(("blas" ,openblas) | |
3720 | ("lapack" ,lapack))) | |
3721 | (arguments | |
3722 | `(#:modules ((srfi srfi-1) | |
3723 | ,@%gnu-build-system-modules) | |
3724 | #:configure-flags '("--enable-shared" | |
3725 | "--disable-fortran" | |
3726 | "--without-MPI" | |
3727 | "--with-openmp" | |
3728 | "--with-fei" | |
3729 | "--with-lapack" | |
3730 | "--with-blas") | |
3731 | #:phases | |
3732 | (modify-phases %standard-phases | |
9b405aea PN |
3733 | (add-before 'build 'set-HOME |
3734 | (lambda _ | |
3735 | ;; FIXME: texlive-union does not find the built | |
3736 | ;; metafonts, so it tries to generate them in HOME. | |
3737 | (setenv "HOME" "/tmp") | |
3738 | #t)) | |
528bb464 EB |
3739 | (add-before 'configure 'chdir-src |
3740 | (lambda _ (chdir "src"))) | |
3741 | (replace 'configure | |
3742 | (lambda* (#:key build target configure-flags | |
3743 | #:allow-other-keys #:rest args) | |
3744 | (let* ((configure (assoc-ref %standard-phases 'configure))) | |
3745 | (apply configure | |
3746 | (append args | |
3747 | (list #:configure-flags | |
3748 | (cons (string-append | |
3749 | "--host=" (or target build)) | |
3750 | configure-flags))))))) | |
3751 | (add-after 'build 'build-docs | |
3752 | (lambda _ | |
9b405aea | 3753 | (invoke "make" "-Cdocs" "pdf" "html"))) |
528bb464 EB |
3754 | (replace 'check |
3755 | (lambda _ | |
3756 | (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib")) | |
3757 | (setenv "PATH" (string-append "." ":" (getenv "PATH"))) | |
3758 | (and (system* "make" "check" "CHECKRUN=") | |
3759 | (fold (lambda (filename result) | |
3760 | (and result | |
3761 | (let ((size (stat:size (stat filename)))) | |
3762 | (when (not (zero? size)) | |
3763 | (format #t "~a size ~d; error indication~%" | |
3764 | filename size)) | |
3765 | (zero? size)))) | |
3766 | #t | |
3767 | (find-files "test" ".*\\.err$"))))) | |
3768 | (add-after 'install 'install-docs | |
3769 | (lambda* (#:key outputs #:allow-other-keys) | |
3770 | ;; Custom install because docs/Makefile doesn't honor ${docdir}. | |
3771 | (let* ((doc (assoc-ref outputs "doc")) | |
3772 | (docdir (string-append doc "/share/doc/hypre-" ,version))) | |
528bb464 EB |
3773 | (with-directory-excursion "docs" |
3774 | (for-each (lambda (base) | |
3775 | (install-file (string-append base ".pdf") docdir) | |
3776 | (copy-recursively base docdir)) ;html docs | |
3777 | '("HYPRE_usr_manual" | |
3778 | "HYPRE_ref_manual"))) | |
3779 | #t)))))) | |
3780 | (home-page "http://www.llnl.gov/casc/hypre/") | |
3781 | (synopsis "Library of solvers and preconditioners for linear equations") | |
3782 | (description | |
3783 | "HYPRE is a software library of high performance preconditioners and | |
3784 | solvers for the solution of large, sparse linear systems of equations. It | |
3785 | features multigrid solvers for both structured and unstructured grid | |
3786 | problems.") | |
3787 | (license license:lgpl2.1))) | |
3788 | ||
3789 | (define-public hypre-openmpi | |
3790 | (package (inherit hypre) | |
3791 | (name "hypre-openmpi") | |
3792 | (inputs | |
3793 | `(("mpi" ,openmpi) | |
3794 | ,@(package-inputs hypre))) | |
3795 | (arguments | |
3796 | (substitute-keyword-arguments (package-arguments hypre) | |
3797 | ((#:configure-flags flags) | |
3798 | ``("--with-MPI" | |
6df2a50a LC |
3799 | ,@(delete "--without-MPI" ,flags))) |
3800 | ((#:phases phases) | |
3801 | `(modify-phases ,phases | |
bbe46a4a EB |
3802 | (add-before 'check 'mpi-setup |
3803 | ,%openmpi-setup))))) | |
528bb464 EB |
3804 | (synopsis "Parallel solvers and preconditioners for linear equations") |
3805 | (description | |
3806 | "HYPRE is a software library of high performance preconditioners and | |
3807 | solvers for the solution of large, sparse linear systems of equations on | |
3808 | parallel computers. It features parallel multigrid solvers for both | |
3809 | structured and unstructured grid problems."))) | |
6c90e183 EB |
3810 | |
3811 | (define-public matio | |
3812 | (package | |
3813 | (name "matio") | |
3814 | (version "1.5.6") | |
3815 | (source | |
3816 | (origin | |
3817 | (method url-fetch) | |
de67e922 | 3818 | (uri (string-append "mirror://sourceforge/matio/matio/" version "/" |
6c90e183 EB |
3819 | "matio-" version ".tar.gz")) |
3820 | (sha256 | |
3821 | (base32 | |
3822 | "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir")))) | |
3823 | (build-system gnu-build-system) | |
3824 | (inputs | |
3825 | `(("zlib" ,zlib) | |
3826 | ("hdf5" ,hdf5))) | |
3827 | (home-page "http://matio.sourceforge.net/") | |
3828 | (synopsis "Library for reading and writing MAT files") | |
3829 | (description "Matio is a library for reading and writing MAT files. It | |
3830 | supports compressed MAT files, as well as newer (version 7.3) MAT files.") | |
3831 | (license license:bsd-2))) | |
d721c83a | 3832 | |
517318ad LF |
3833 | (define-public vc |
3834 | (package | |
3835 | (name "vc") | |
853b0292 | 3836 | (version "1.3.3") |
517318ad LF |
3837 | (source |
3838 | (origin (method url-fetch) | |
3839 | (uri (string-append "https://github.com/VcDevel/Vc/releases/" | |
3840 | "download/" version "/Vc-" version ".tar.gz")) | |
3841 | (sha256 | |
3842 | (base32 | |
853b0292 | 3843 | "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8")))) |
517318ad LF |
3844 | (build-system cmake-build-system) |
3845 | (arguments | |
3846 | '(#:configure-flags | |
33d82486 MB |
3847 | '("-DBUILD_TESTING=ON" |
3848 | ;; By default, Vc will optimize for the CPU of the build machine. | |
3849 | ;; Setting this to "none" makes it create portable binaries. See | |
3850 | ;; "cmake/OptimizeForArchitecture.cmake". | |
3851 | "-DTARGET_ARCHITECTURE=none"))) | |
517318ad LF |
3852 | (synopsis "SIMD vector classes for C++") |
3853 | (description "Vc provides portable, zero-overhead C++ types for explicitly | |
3854 | data-parallel programming. It is a library designed to ease explicit | |
3855 | vectorization of C++ code. Its types enable explicitly stating data-parallel | |
3856 | operations on multiple values. The parallelism is therefore added via the type | |
3857 | system. Vc has an intuitive API and provides portability between different | |
3858 | compilers and compiler versions as well as portability between different vector | |
3859 | instruction sets. Thus, an application written with Vc can be compiled for: | |
3860 | @enumerate | |
3861 | @item AVX and AVX2 | |
d1e4ad1b | 3862 | @item SSE2 up to SSE4.2 or SSE4a |
517318ad LF |
3863 | @item Scalar |
3864 | @item MIC | |
3865 | @item NEON (in development) | |
3866 | @item NVIDIA GPUs / CUDA (in development) | |
3867 | @end enumerate\n") | |
3868 | (home-page "https://github.com/VcDevel/Vc") | |
a8ead6f9 EF |
3869 | ;; "No support_???.cpp file exists for this architecture." |
3870 | (supported-systems '("x86_64-linux" "i686-linux")) | |
517318ad | 3871 | (license license:bsd-3))) |
54052a54 | 3872 | |
3873 | (define-public reducelcs | |
3874 | ;; This is the last commit which is available upstream, no | |
3875 | ;; release happened since 2010. | |
3876 | (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0") | |
3877 | (revision "1")) | |
3878 | (package | |
3879 | (name "reducelcs") | |
3880 | (version (string-append "1.0-" revision "." (string-take commit 7))) | |
3881 | (source | |
3882 | (origin | |
3883 | (method git-fetch) | |
3884 | (uri (git-reference | |
3885 | (url "https://github.com/gdv/Reduce-Expand-for-LCS") | |
3886 | (commit commit))) | |
3887 | (file-name (string-append name "-" version "-checkout")) | |
3888 | (sha256 | |
3889 | (base32 | |
3890 | "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm")))) | |
3891 | (build-system gnu-build-system) | |
3892 | (inputs | |
3893 | `(("openlibm" ,openlibm))) | |
3894 | (arguments | |
3895 | `(#:tests? #f ; no tests | |
3896 | #:phases | |
3897 | (modify-phases %standard-phases | |
3898 | (delete 'configure) ; No configure script exists. | |
3899 | (replace 'install ; No install phase exists. | |
3900 | (lambda* (#:key outputs #:allow-other-keys) | |
3901 | (let* ((out (assoc-ref outputs "out")) | |
3902 | (bin (string-append out "/bin"))) | |
3903 | (install-file "Approximation" bin) | |
3904 | (install-file "CollectResults" bin) | |
3905 | (install-file "GenerateInstances" bin) | |
3906 | #t)))))) | |
3907 | (synopsis "Approximate Longest Commons Subsequence computation tool") | |
3908 | (description | |
3909 | "@code{reduceLCS} is an implementation of the Reduce-Expand | |
3910 | algorithm for LCS. It is a fast program to compute the approximate | |
3911 | Longest Commons Subsequence of a set of strings.") | |
3912 | (home-page "https://github.com/gdv/Reduce-Expand-for-LCS") | |
c000b6b1 | 3913 | (license license:gpl3+)))) |
479c4273 JD |
3914 | |
3915 | (define-public jacal | |
3916 | (package | |
3917 | (name "jacal") | |
3918 | (version "1c4") | |
3919 | (source (origin | |
3920 | (method url-fetch) | |
3921 | (uri (string-append | |
3922 | "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-" | |
3923 | version ".zip")) | |
3924 | (sha256 (base32 | |
3925 | "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q")) | |
3926 | (patches (search-patches "jacal-fix-texinfo.patch")))) | |
3927 | (build-system gnu-build-system) | |
3928 | (arguments | |
3929 | `(#:phases | |
3930 | (modify-phases %standard-phases | |
3931 | (add-before 'build 'pre-build | |
3932 | ;; Don't use upstream's script - it really doesn't fit into | |
3933 | ;; Guix's functional paradigm. | |
3934 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3935 | (substitute* "Makefile" | |
3936 | (("^install: install-script") "install: ")))) | |
3937 | (add-after 'install 'post-install | |
3938 | ;; Instead, we provide our own simplified script. | |
3939 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3940 | (let ((wrapper (string-append (assoc-ref outputs "out") | |
3941 | "/bin/jacal"))) | |
3942 | (format (open wrapper (logior O_WRONLY O_CREAT)) | |
3943 | (string-append "#!~a\nexec ~a/bin/scm -ip1 " | |
3944 | "-e '(slib:load \"~a/lib/jacal/math\") " | |
3945 | "(math)' \"$@\"\n") | |
3946 | (which "bash") | |
3947 | (assoc-ref inputs "scm") | |
3948 | (assoc-ref outputs "out")) | |
3949 | (chmod wrapper #o555)))) | |
3950 | (replace 'configure | |
3951 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3952 | (zero? (system* "./configure" | |
3953 | (string-append "--prefix=" | |
3954 | (assoc-ref outputs "out"))))))))) | |
3955 | (inputs `(("scm" ,scm))) | |
3956 | (native-inputs `(("unzip" ,unzip) | |
3957 | ("texinfo" ,texinfo))) | |
3958 | (synopsis "Symbolic mathematics system") | |
3959 | (description "GNU JACAL is an interactive symbolic mathematics program based on | |
3960 | Scheme. It manipulate and simplify a range of mathematical expressions such | |
3961 | as equations, scalars, vectors, and matrices.") | |
6fd52309 | 3962 | (home-page "https://www.gnu.org/software/jacal/") |
479c4273 JD |
3963 | (license license:gpl3+))) |
3964 | ||
313844d9 TF |
3965 | (define-public z3 |
3966 | (package | |
3967 | (name "z3") | |
4a4f3e77 | 3968 | (version "4.8.1") |
fb525bfd | 3969 | (home-page "https://github.com/Z3Prover/z3") |
313844d9 | 3970 | (source (origin |
fb525bfd MB |
3971 | (method git-fetch) |
3972 | (uri (git-reference (url home-page) | |
3973 | (commit (string-append "z3-" version)))) | |
2d7b99b3 | 3974 | (file-name (git-file-name name version)) |
313844d9 TF |
3975 | (sha256 |
3976 | (base32 | |
4a4f3e77 | 3977 | "1vr57bwx40sd5riijyrhy70i2wnv9xrdihf6y5zdz56yq88rl48f")))) |
cf684d87 | 3978 | (build-system cmake-build-system) |
313844d9 | 3979 | (arguments |
cf684d87 TF |
3980 | `(#:configure-flags |
3981 | (list "-DBUILD_PYTHON_BINDINGS=true" | |
3982 | "-DINSTALL_PYTHON_BINDINGS=true" | |
3983 | (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR=" | |
3984 | %output | |
677bc34d | 3985 | "/lib/python2.7/site-packages")) |
313844d9 TF |
3986 | #:phases |
3987 | (modify-phases %standard-phases | |
ad6c6a5b EF |
3988 | (add-after 'unpack 'fix-compatability |
3989 | ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only. | |
3990 | (lambda _ | |
3991 | (substitute* "src/util/mpz.cpp" | |
3992 | (("#include <immintrin.h>") "")) | |
3993 | #t)) | |
cf684d87 TF |
3994 | (add-before 'configure 'bootstrap |
3995 | (lambda _ | |
313844d9 | 3996 | (zero? |
cf684d87 TF |
3997 | (system* "python" "contrib/cmake/bootstrap.py" "create")))) |
3998 | (add-before 'check 'make-test-z3 | |
313844d9 | 3999 | (lambda _ |
cf684d87 TF |
4000 | ;; Build the test suite executable. |
4001 | (zero? (system* "make" "test-z3" "-j" | |
4002 | (number->string (parallel-job-count)))))) | |
4003 | (replace 'check | |
4004 | (lambda _ | |
4005 | ;; Run all the tests that don't require arguments. | |
4006 | (zero? (system* "./test-z3" "/a"))))))) | |
313844d9 TF |
4007 | (native-inputs |
4008 | `(("python" ,python-2))) | |
4009 | (synopsis "Theorem prover") | |
4010 | (description "Z3 is a theorem prover and @dfn{satisfiability modulo | |
cf684d87 | 4011 | theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.") |
313844d9 | 4012 | (license license:expat))) |
3d5d87a3 JL |
4013 | |
4014 | (define-public cubicle | |
4015 | (package | |
4016 | (name "cubicle") | |
564cf93f | 4017 | (version "1.1.2") |
3d5d87a3 JL |
4018 | (source (origin |
4019 | (method url-fetch) | |
4020 | (uri (string-append "http://cubicle.lri.fr/cubicle-" | |
4021 | version ".tar.gz")) | |
4022 | (sha256 | |
4023 | (base32 | |
564cf93f | 4024 | "10kk80jdmpdvql88sdjsh7vqzlpaphd8vip2lp47aarxjkwjlz1q")))) |
3d5d87a3 JL |
4025 | (build-system gnu-build-system) |
4026 | (native-inputs | |
564cf93f JL |
4027 | `(("automake" ,automake) |
4028 | ("ocaml" ,ocaml) | |
83fef82b | 4029 | ("which" ,(@@ (gnu packages base) which)))) |
3d5d87a3 | 4030 | (propagated-inputs |
564cf93f JL |
4031 | `(("ocaml-num" ,ocaml-num) |
4032 | ("z3" ,z3))) | |
3d5d87a3 JL |
4033 | (arguments |
4034 | `(#:configure-flags (list "--with-z3") | |
564cf93f | 4035 | #:make-flags (list "QUIET=") |
3d5d87a3 JL |
4036 | #:tests? #f |
4037 | #:phases | |
4038 | (modify-phases %standard-phases | |
4039 | (add-before 'configure 'configure-for-release | |
4040 | (lambda _ | |
4041 | (substitute* "Makefile.in" | |
564cf93f JL |
4042 | (("SVNREV=") "#SVNREV=")) |
4043 | #t)) | |
3d5d87a3 JL |
4044 | (add-before 'configure 'fix-/bin/sh |
4045 | (lambda _ | |
4046 | (substitute* "configure" | |
564cf93f JL |
4047 | (("-/bin/sh") (string-append "-" (which "sh")))) |
4048 | #t)) | |
3d5d87a3 JL |
4049 | (add-before 'configure 'fix-smt-z3wrapper.ml |
4050 | (lambda _ | |
4051 | (substitute* "Makefile.in" | |
564cf93f JL |
4052 | (("\\\\n") "")) |
4053 | #t)) | |
4054 | (add-before 'configure 'fix-ocaml-num | |
4055 | (lambda* (#:key inputs #:allow-other-keys) | |
4056 | (substitute* "Makefile.in" | |
4057 | (("= \\$\\(FUNCTORYLIB\\)") | |
4058 | (string-append "= -I " | |
4059 | (assoc-ref inputs "ocaml-num") | |
4060 | "/lib/ocaml/site-lib" | |
4061 | " $(FUNCTORYLIB)"))) | |
4062 | #t))))) | |
3d5d87a3 JL |
4063 | (home-page "http://cubicle.lri.fr/") |
4064 | (synopsis "Model checker for array-based systems") | |
5a80c15c RW |
4065 | (description "Cubicle is a model checker for verifying safety properties |
4066 | of array-based systems. This is a syntactically restricted class of | |
4067 | parametrized transition systems with states represented as arrays indexed by | |
4068 | an arbitrary number of processes. Cache coherence protocols and mutual | |
4069 | exclusion algorithms are typical examples of such systems.") | |
3d5d87a3 | 4070 | (license license:asl2.0))) |
e01397b4 EB |
4071 | |
4072 | (define-public elemental | |
4073 | (package | |
4074 | (name "elemental") | |
4075 | (version "0.87.7") | |
4076 | (source (origin | |
5c0b6d1b EF |
4077 | (method git-fetch) |
4078 | (uri (git-reference | |
4079 | (url "https://github.com/elemental/Elemental.git") | |
4080 | (commit (string-append "v" version)))) | |
4081 | (file-name (git-file-name name version)) | |
e01397b4 EB |
4082 | (sha256 |
4083 | (base32 | |
5c0b6d1b | 4084 | "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc")))) |
e01397b4 EB |
4085 | (build-system cmake-build-system) |
4086 | (home-page "http://libelemental.org") | |
4087 | (native-inputs | |
4088 | `(("gfortran" ,gfortran))) | |
4089 | (inputs | |
4090 | `(("blas" ,openblas) | |
4091 | ("gfortran:lib" ,gfortran "lib") | |
4092 | ("gmp" ,gmp) | |
4093 | ("lapack" ,lapack) | |
4094 | ("metis" ,metis) | |
4095 | ("mpc" ,mpc) | |
4096 | ("mpfr" ,mpfr) | |
4097 | ("mpi" ,openmpi) | |
4098 | ("qd" ,qd))) | |
4099 | (arguments | |
4100 | `(#:build-type "Release" ;default RelWithDebInfo not supported | |
4101 | #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES" | |
4102 | "-DEL_AVOID_COMPLEX_MPI:BOOL=NO" | |
4103 | "-DEL_CACHE_WARNINGS:BOOL=YES" | |
4104 | "-DEL_TESTS:BOOL=YES" | |
4105 | "-DCMAKE_INSTALL_LIBDIR=lib" | |
4106 | "-DGFORTRAN_LIB=gfortran") | |
4107 | #:phases (modify-phases %standard-phases | |
3b42e2be EF |
4108 | (add-before 'check 'mpi-setup |
4109 | ,%openmpi-setup) | |
e01397b4 EB |
4110 | (add-before 'check 'setup-tests |
4111 | (lambda _ | |
4112 | ;; Parallelism is done at the MPI layer. | |
4113 | (setenv "OMP_NUM_THREADS" "1") | |
4114 | #t)) | |
4115 | (add-after 'install 'remove-tests | |
4116 | (lambda* (#:key outputs #:allow-other-keys) | |
4117 | ;; Tests are installed, with no easy configuration | |
4118 | ;; switch to prevent this, so delete them. | |
4119 | (delete-file-recursively | |
3b42e2be | 4120 | (string-append (assoc-ref outputs "out") "/bin")) |
e01397b4 EB |
4121 | #t))))) |
4122 | (synopsis "Dense and sparse-direct linear algebra and optimization") | |
4123 | (description "Elemental is a modern C++ library for distributed-memory | |
4124 | dense and sparse-direct linear algebra, conic optimization, and lattice | |
4125 | reduction.") | |
4126 | (license license:bsd-2))) | |
5b05dce7 JN |
4127 | |
4128 | (define-public mcrl2 | |
4129 | (package | |
4130 | (name "mcrl2") | |
4131 | (version "201707.1.15162") | |
4132 | (source (origin | |
4133 | (method url-fetch) | |
4134 | (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-" | |
4135 | version | |
4136 | ".tar.gz")) | |
4137 | (sha256 | |
4138 | (base32 | |
4139 | "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f")))) | |
4140 | (native-inputs | |
4141 | `(("subversion" ,subversion))) | |
4142 | (inputs | |
4143 | `(("boost" ,boost) | |
4144 | ("glu" ,glu) | |
4145 | ("mesa" ,mesa) | |
077d66ed | 4146 | ("qtbase" ,qtbase))) |
5b05dce7 | 4147 | (build-system cmake-build-system) |
ed0c5d3c | 4148 | (synopsis "Toolset for the mCRL2 formal specification language") |
5b05dce7 | 4149 | (description |
ed0c5d3c TGR |
4150 | "@dfn{mCRL2} (micro Common Representation Language 2) is a formal |
4151 | specification language for describing concurrent discrete event systems. Its | |
4152 | toolset supports analysis and automatic verification, linearisation, simulation, | |
4153 | state-space exploration and generation, and tools to optimise and analyse | |
5b05dce7 JN |
4154 | specifications. Also, state spaces can be manipulated, visualised and |
4155 | analysed.") | |
b3882709 | 4156 | (home-page "https://mcrl2.org") |
5b05dce7 | 4157 | (license license:boost1.0))) |
41835f94 LF |
4158 | |
4159 | (define-public r-subplex | |
4160 | (package | |
4161 | (name "r-subplex") | |
2bcf5fd3 | 4162 | (version "1.5-4") |
41835f94 LF |
4163 | (source |
4164 | (origin | |
4165 | (method url-fetch) | |
4166 | (uri (cran-uri "subplex" version)) | |
4167 | (sha256 | |
4168 | (base32 | |
2bcf5fd3 | 4169 | "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z")))) |
41835f94 LF |
4170 | (build-system r-build-system) |
4171 | (native-inputs | |
4172 | `(("gfortran" ,gfortran))) | |
4173 | (home-page "https://cran.r-project.org/web/packages/subplex") | |
4174 | (synopsis "Unconstrained optimization using the subplex algorithm") | |
4175 | (description "This package implements the Subplex optimization algorithm. | |
4176 | It solves unconstrained optimization problems using a simplex method on | |
4177 | subspaces. The method is well suited for optimizing objective functions that | |
4178 | are noisy or are discontinuous at the solution.") | |
4179 | (license license:gpl3+))) | |
799ad71b LF |
4180 | |
4181 | (define-public r-desolve | |
4182 | (package | |
4183 | (name "r-desolve") | |
9a2ac95d | 4184 | (version "1.21") |
799ad71b LF |
4185 | (source |
4186 | (origin | |
4187 | (method url-fetch) | |
4188 | (uri (cran-uri "deSolve" version)) | |
4189 | (sha256 | |
4190 | (base32 | |
9a2ac95d | 4191 | "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5")))) |
799ad71b LF |
4192 | (properties `((upstream-name . "deSolve"))) |
4193 | (build-system r-build-system) | |
4194 | (native-inputs | |
4195 | `(("gfortran" ,gfortran))) | |
4196 | (home-page "https://desolve.r-forge.r-project.org/") | |
4197 | (synopsis "Solvers for initial value problems of differential equations") | |
4198 | (description "This package provides functions that solve initial | |
4199 | value problems of a system of first-order ordinary differential equations (ODE), | |
4200 | of partial differential equations (PDE), of differential algebraic equations | |
4201 | (DAE), and of delay differential equations. The functions provide an interface | |
4202 | to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection, | |
4203 | to the FORTRAN functions dvode and daspk and a C-implementation of solvers of | |
4204 | the Runge-Kutta family with fixed or variable time steps. The package contains | |
4205 | routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial | |
4206 | differential equations (PDE) that have been converted to ODEs by numerical | |
4207 | differencing.") | |
4208 | (license license:gpl2+))) | |
910deec6 NV |
4209 | |
4210 | (define-public tcalc | |
4211 | (package | |
4212 | (name "tcalc") | |
4213 | (version "2.0") | |
4214 | (source | |
4215 | (origin | |
4216 | (method url-fetch) | |
4217 | (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-" | |
4218 | version ".tar.gz")) | |
4219 | (sha256 | |
4220 | (base32 | |
4221 | "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m")))) | |
4222 | (build-system gnu-build-system) | |
4223 | (synopsis "The terminal calculator") | |
4224 | (description | |
4225 | "The terminal calculator is a small program to help users of the GNU/Linux | |
4226 | terminal do calculations simply and quickly. The formula to be calculated can | |
4227 | be fed to @command{tcalc} through the command line.") | |
4228 | (home-page "https://sites.google.com/site/mohammedisam2000/tcalc") | |
4229 | (license license:gpl3+))) | |
b26e4f26 EB |
4230 | |
4231 | (define-public sundials | |
4232 | (package | |
4233 | (name "sundials") | |
4234 | (version "3.1.1") | |
4235 | (source | |
4236 | (origin | |
4237 | (method url-fetch) | |
4238 | (uri (string-append "https://computation.llnl.gov/projects/sundials/download/" | |
4239 | "sundials-" version ".tar.gz")) | |
4240 | (sha256 | |
4241 | (base32 | |
4242 | "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2")))) | |
4243 | (build-system cmake-build-system) | |
4244 | (native-inputs | |
4245 | `(("python" ,python-2))) ;for tests; syntax incompatible with python 3 | |
4246 | (inputs | |
4247 | `(("fortran" ,gfortran) ;for fcmix | |
4248 | ("blas" ,openblas) | |
4249 | ("suitesparse" ,suitesparse))) ;TODO: Add hypre | |
4250 | (arguments | |
4251 | `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON" | |
4252 | "-DEXAMPLES_ENABLE_CXX:BOOL=ON" | |
4253 | "-DEXAMPLES_ENABLE_F77:BOOL=ON" | |
4254 | "-DEXAMPLES_ENABLE_F90:BOOL=ON" | |
4255 | "-DEXAMPLES_INSTALL:BOOL=OFF" | |
4256 | ||
4257 | "-DFCMIX_ENABLE:BOOL=ON" | |
4258 | ||
4259 | "-DKLU_ENABLE:BOOL=ON" | |
4260 | ,(string-append "-DKLU_INCLUDE_DIR=" | |
4261 | (assoc-ref %build-inputs "suitesparse") | |
4262 | "/include") | |
4263 | ,(string-append "-DKLU_LIBRARY_DIR=" | |
4264 | (assoc-ref %build-inputs "suitesparse") | |
4265 | "/lib")))) | |
4266 | (home-page "https://computation.llnl.gov/projects/sundials") | |
4267 | (synopsis "Suite of nonlinear and differential/algebraic equation solvers") | |
4268 | (description "SUNDIALS is a family of software packages implemented with | |
4269 | the goal of providing robust time integrators and nonlinear solvers that can | |
4270 | easily be incorporated into existing simulation codes.") | |
4271 | (license license:bsd-3))) | |
4272 | ||
4273 | (define-public sundials-openmpi | |
4274 | (package (inherit sundials) | |
4275 | (name "sundials-openmpi") | |
4276 | (inputs | |
4277 | `(("mpi" ,openmpi) | |
4278 | ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI | |
4279 | ,@(package-inputs sundials))) | |
4280 | (arguments | |
4281 | (substitute-keyword-arguments (package-arguments sundials) | |
4282 | ((#:configure-flags flags '()) | |
4283 | `(cons* "-DMPI_ENABLE:BOOL=ON" | |
4284 | "-DPETSC_ENABLE:BOOL=ON" | |
4285 | (string-append "-DPETSC_INCLUDE_DIR=" | |
4286 | (assoc-ref %build-inputs "petsc") | |
4287 | "/include") | |
4288 | (string-append "-DPETSC_LIBRARY_DIR=" | |
4289 | (assoc-ref %build-inputs "petsc") | |
4290 | "/lib") | |
4291 | ,flags)) | |
4292 | ((#:phases phases '%standard-phases) | |
4293 | `(modify-phases ,phases | |
bbe46a4a EB |
4294 | (add-before 'check 'mpi-setup |
4295 | ,%openmpi-setup))))) | |
b26e4f26 | 4296 | (synopsis "SUNDIALS with OpenMPI support"))) |