projects/guix·blob ruby-team · refs

11754 lines · 479.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2023, 2024, 2025 Andreas Enge <[email protected]>
3;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
4;;; Copyright © 2014, 2016, 2017 John Darrington <[email protected]>
5;;; Copyright © 2014-2022 Eric Bavier <[email protected]>
6;;; Copyright © 2014 Federico Beffa <[email protected]>
7;;; Copyright © 2014 Mathieu Lirzin <[email protected]>
8;;; Copyright © 2015–2025 Ricardo Wurmus <[email protected]>
9;;; Copyright © 2015 Sou Bunnbu <[email protected]>
10;;; Copyright © 2015, 2018 Mark H Weaver <[email protected]>
11;;; Copyright © 2015-2024 Efraim Flashner <[email protected]>
12;;; Copyright © 2015 Fabian Harfert <[email protected]>
13;;; Copyright © 2016 Roel Janssen <[email protected]>
14;;; Copyright © 2016, 2018, 2020, 2021 Kei Kebreau <[email protected]>
15;;; Copyright © 2016-2026 Ludovic Courtès <[email protected]>
16;;; Copyright © 2016 Leo Famulari <[email protected]>
17;;; Copyright © 2016, 2017 Thomas Danckaert <[email protected]>
18;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <[email protected]>
19;;; Copyright © 2017 Nikita <[email protected]>
20;;; Copyright © 2017 Ben Woodcroft <[email protected]>
21;;; Copyright © 2017 Theodoros Foradis <[email protected]>
22;;; Copyright © 2017, 2019, 2022 Arun Isaac <[email protected]>
23;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <[email protected]>
24;;; Copyright © 2017 Dave Love <me@[email protected]>
25;;; Copyright © 2018-2022, 2024-2026 Janneke Nieuwenhuizen <[email protected]>
26;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
27;;; Copyright © 2018 Nadya Voronova <[email protected]>
28;;; Copyright © 2018 Adam Massmann <[email protected]>
29;;; Copyright © 2018, 2020-2022 Marius Bakke <[email protected]>
30;;; Copyright © 2018 Eric Brown <[email protected]>
31;;; Copyright © 2018, 2021, 2024 Julien Lepiller <[email protected]>
32;;; Copyright © 2018 Amin Bandali <[email protected]>
33;;; Copyright © 2019, 2021-2026 Nicolas Goaziou <[email protected]>
34;;; Copyright © 2019 Steve Sprang <[email protected]>
35;;; Copyright © 2019 Robert Smith <[email protected]>
36;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
37;;; Copyright © 2020–2023 Felix Gruber <[email protected]>
38;;; Copyright © 2020 R Veera Kumar <[email protected]>
39;;; Copyright © 2020 Vincent Legoll <[email protected]>
40;;; Copyright © 2020 Nicolò Balzarotti <[email protected]>
41;;; Copyright © 2020 B. Wilson <[email protected]>
42;;; Copyright © 2020, 2021, 2025 Vinicius Monego <[email protected]>
43;;; Copyright © 2020 Simon Tournier <[email protected]>
44;;; Copyright © 2020 Martin Becze <[email protected]>
45;;; Copyright © 2021 Gerd Heber <[email protected]>
46;;; Copyright © 2021 Franck Pérignon <[email protected]>
47;;; Copyright © 2021 Philip McGrath <[email protected]>
48;;; Copyright © 2021, 2022 Paul A. Patience <[email protected]>
49;;; Copyright © 2021 Ivan Gankevich <[email protected]>
50;;; Copyright © 2021 Jean-Baptiste Volatier <[email protected]>
51;;; Copyright © 2021, 2023, 2024 Guillaume Le Vaillant <[email protected]>
52;;; Copyright © 2021 Pierre-Antoine Bouttier <[email protected]>
53;;; Copyright © 2022 Zhu Zihao <[email protected]>
54;;; Copyright © 2022-2025 Sharlatan Hellseher <[email protected]>
55;;; Copyright © 2022 Philip McGrath <[email protected]>
56;;; Copyright © 2022 Marek Felšöci <[email protected]>
57;;; Copyright © 2022 vicvbcun <[email protected]>
58;;; Copyright © 2022, 2023 Liliana Marie Prikler <[email protected]>
59;;; Copyright © 2022 Maximilian Heisinger <[email protected]>
60;;; Copyright © 2022 Akira Kyle <[email protected]>
61;;; Copyright © 2022, 2023 Nicolas Graves <[email protected]>
62;;; Copyright © 2022 Roman Scherer <[email protected]>
63;;; Copyright © 2023 Jake Leporte <[email protected]>
64;;; Copyright © 2023, 2025 Camilo Q.S. (Distopico) <[email protected]>
65;;; Copyright © 2023, 2025 David Elsing <[email protected]>
66;;; Copyright © 2024 Herman Rimm <[email protected]>
67;;; Copyright © 2024 Foundation Devices, Inc. <[email protected]>
68;;; Copyright © 2024, 2025 Artyom V. Poptsov <[email protected]>
69;;; Copyright © 2024 Zheng Junjie <[email protected]>
70;;; Copyright © 2025 Luca Cirrottola <[email protected]>
71;;; Copyright © 2025 Maxim Cournoyer <[email protected]>
72;;; Copyright © 2025 Sören Tempel <[email protected]>
73;;; Copyright © 2025 nomike Postmann <[email protected]>
74;;; Copyright © 2025 Reza Housseini <[email protected]>
75;;; Copyright © 2026 Cayetano Santos <[email protected]>
76;;; Copyright © 2026 Peter Polidoro <[email protected]>
77;;; Copyright © 2026 Luca Alloatti <[email protected]>
78;;; Copyright © 2026 Akiyoshi Suda <[email protected]>
79;;; Copyright © 2026 Orahcio Felício de Sousa <[email protected]>
80;;;
81;;; This file is part of GNU Guix.
82;;;
83;;; GNU Guix is free software; you can redistribute it and/or modify it
84;;; under the terms of the GNU General Public License as published by
85;;; the Free Software Foundation; either version 3 of the License, or (at
86;;; your option) any later version.
87;;;
88;;; GNU Guix is distributed in the hope that it will be useful, but
89;;; WITHOUT ANY WARRANTY; without even the implied warranty of
90;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91;;; GNU General Public License for more details.
92;;;
93;;; You should have received a copy of the GNU General Public License
94;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
95
96(define-module (gnu packages maths)
97 #:use-module (ice-9 regex)
98 #:use-module (ice-9 match)
99 #:use-module (gnu packages)
100 #:use-module ((guix licenses) #:prefix license:)
101 #:use-module (guix packages)
102 #:use-module (guix download)
103 #:use-module (guix git-download)
104 #:use-module (guix gexp)
105 #:use-module (guix utils)
106 #:use-module ((guix build utils) #:select (alist-replace))
107 #:use-module (guix build-system ant)
108 #:use-module (guix build-system cmake)
109 #:use-module (guix build-system copy)
110 #:use-module (guix build-system dune)
111 #:use-module (guix build-system glib-or-gtk)
112 #:use-module (guix build-system go)
113 #:use-module (guix build-system gnu)
114 #:use-module (guix build-system meson)
115 #:use-module (guix build-system ocaml)
116 #:use-module (guix build-system perl)
117 #:use-module (guix build-system pyproject)
118 #:use-module (guix build-system qt)
119 #:use-module (guix build-system ruby)
120 #:use-module (gnu packages algebra)
121 #:use-module (gnu packages astronomy)
122 #:use-module (gnu packages audio)
123 #:use-module (gnu packages autotools)
124 #:use-module (gnu packages backup)
125 #:use-module (gnu packages base)
126 #:use-module (gnu packages bash)
127 #:use-module (gnu packages benchmark)
128 #:use-module (gnu packages bison)
129 #:use-module (gnu packages boost)
130 #:use-module (gnu packages build-tools)
131 #:use-module (gnu packages calendar)
132 #:use-module (gnu packages check)
133 #:use-module (gnu packages cmake)
134 #:use-module (gnu packages compression)
135 #:use-module (gnu packages coq)
136 #:use-module (gnu packages curl)
137 #:use-module (gnu packages cyrus-sasl)
138 #:use-module (gnu packages cpp)
139 #:use-module (gnu packages datamash)
140 #:use-module (gnu packages dbm)
141 #:use-module (gnu packages documentation)
142 #:use-module (gnu packages django)
143 #:use-module (gnu packages elf)
144 #:use-module (gnu packages emacs)
145 #:use-module (gnu packages file)
146 #:use-module (gnu packages compiler-tools)
147 #:use-module (gnu packages fltk)
148 #:use-module (gnu packages fontutils)
149 #:use-module (gnu packages freedesktop)
150 #:use-module (gnu packages gettext)
151 #:use-module (gnu packages gcc)
152 #:use-module (gnu packages gd)
153 #:use-module (gnu packages geo)
154 #:use-module (gnu packages ghostscript)
155 #:use-module (gnu packages glib)
156 #:use-module (gnu packages gperf)
157 #:use-module (gnu packages graphviz)
158 #:use-module (gnu packages groff)
159 #:use-module (gnu packages gtk)
160 #:use-module (gnu packages icu4c)
161 #:use-module (gnu packages image)
162 #:use-module (gnu packages image-processing)
163 #:use-module (gnu packages java)
164 #:use-module (gnu packages less)
165 #:use-module (gnu packages libedit)
166 #:use-module (gnu packages lisp)
167 #:use-module (gnu packages linux)
168 #:use-module (gnu packages llvm)
169 #:use-module (gnu packages logging)
170 #:use-module (gnu packages lua)
171 #:use-module (gnu packages gnome)
172 #:use-module (gnu packages guile)
173 #:use-module (gnu packages xorg)
174 #:use-module (gnu packages gl)
175 #:use-module (gnu packages imagemagick)
176 #:use-module (gnu packages m4)
177 #:use-module (gnu packages man)
178 #:use-module (gnu packages mpi)
179 #:use-module (gnu packages multiprecision)
180 #:use-module (gnu packages ncurses)
181 #:use-module (gnu packages netpbm)
182 #:use-module (gnu packages ocaml)
183 #:use-module (gnu packages onc-rpc)
184 #:use-module (gnu packages oneapi)
185 #:use-module (gnu packages opencl)
186 #:use-module (gnu packages parallel)
187 #:use-module (gnu packages pcre)
188 #:use-module (gnu packages popt)
189 #:use-module (gnu packages perl)
190 #:use-module (gnu packages prolog)
191 #:use-module (gnu packages pkg-config)
192 #:use-module (gnu packages protobuf)
193 #:use-module (gnu packages pulseaudio)
194 #:use-module (gnu packages python)
195 #:use-module (gnu packages python-build)
196 #:use-module (gnu packages python-science)
197 #:use-module (gnu packages python-web)
198 #:use-module (gnu packages python-xyz)
199 #:use-module (gnu packages qt)
200 #:use-module (gnu packages regex)
201 #:use-module (gnu packages readline)
202 #:use-module (gnu packages ruby-check)
203 #:use-module (gnu packages ruby-xyz)
204 #:use-module (gnu packages tbb)
205 #:use-module (gnu packages scheme)
206 #:use-module (gnu packages serialization)
207 #:use-module (gnu packages shells)
208 #:use-module (gnu packages simulation)
209 #:use-module (gnu packages sphinx)
210 #:use-module (gnu packages sqlite)
211 #:use-module (gnu packages swig)
212 #:use-module (gnu packages tcl)
213 #:use-module (gnu packages texinfo)
214 #:use-module (gnu packages tex)
215 #:use-module (gnu packages time)
216 #:use-module (gnu packages tls)
217 #:use-module (gnu packages version-control)
218 #:use-module (gnu packages web)
219 #:use-module (gnu packages wxwidgets)
220 #:use-module (gnu packages xdisorg)
221 #:use-module (gnu packages xml)
222 #:use-module (srfi srfi-1)
223 #:use-module (srfi srfi-26))
224
225(define-public aris
226 (package
227 (name "aris")
228 (version "2.2")
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
232 (sha256 (base32
233 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
234 (build-system gnu-build-system)
235 (inputs (list gtk+ libxml2))
236 (native-inputs (list pkg-config))
237 (arguments
238 `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
239 (synopsis "Natural deduction first-order logic interface")
240 (description "Aris is a program for performing logical proofs. It supports
241propositional and predicate logic, as well as Boolean algebra and
242arithmetical logic. In addition to its predefined inference and equivalence
243rules, Aris also supports references to older proofs. Its use of standard
244logical symbols and its natural deduction interface make it easy to use for
245beginners.")
246 (license license:gpl3+)
247 (home-page "https://www.gnu.org/software/aris/")))
248
249(define-public bitwise
250 (package
251 (name "bitwise")
252 (version "0.50")
253 (source (origin
254 (method url-fetch)
255 (uri (string-append "https://github.com/mellowcandle/bitwise"
256 "/releases/download/v" version
257 "/bitwise-v" version ".tar.gz"))
258 (sha256
259 (base32 "0zp9rb0qv1m9hk593sc08jajkxd80h075s0m0dhf07gkbgx72ql0"))))
260 (build-system gnu-build-system)
261 (inputs
262 (list ncurses readline))
263 (native-inputs
264 (list cunit pkg-config))
265 (synopsis "Terminal based bit manipulator in ncurses")
266 (description "Bitwise is a multi base interactive calculator supporting
267dynamic base conversion and bit manipulation. It's a handy tool for low level
268hackers, kernel developers and device drivers developers.
269
270Some of the features include:
271@itemize
272@item Interactive ncurses interface.
273@item Command line calculator supporting all bitwise operations.
274@item Individual bit manipulator.
275@item Bitwise operations such as NOT, OR, AND, XOR, and shifts.
276@end itemize")
277 (license license:gpl3+)
278 (home-page "https://github.com/mellowcandle/bitwise/")))
279
280(define-public c-graph
281 (package
282 (name "c-graph")
283 (version "2.0.1")
284 (source (origin
285 (method url-fetch)
286 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
287 ".tar.gz"))
288 (sha256 (base32
289 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
290 (build-system gnu-build-system)
291 (inputs
292 (list gfortran))
293 (synopsis "Visualizing and demonstrating convolution")
294 (description
295 "GNU C-Graph is a tool for demonstrating the theory of convolution.
296Thus, it can serve as an excellent aid to students of signal and systems
297theory in visualizing the convolution process. Rather than forcing the
298student to write code, the program offers an intuitive interface with
299interactive dialogs to guide them.")
300 (license license:gpl3+)
301 (home-page "https://www.gnu.org/software/c-graph/")))
302
303(define-public calc
304 (package
305 (name "calc")
306 (version "2.16.1.2")
307 (source
308 (origin
309 (method git-fetch)
310 (uri (git-reference
311 (url "https://github.com/lcn2/calc")
312 (commit (string-append "v" version))))
313 (file-name (git-file-name name version))
314 (sha256
315 (base32 "18vb5gi9mf4c8vmhvimxqdzja8b56glyk23bpb2igwm903x3ciav"))))
316 (build-system gnu-build-system)
317 (inputs (list readline))
318 (native-inputs (list man-db util-linux)) ;for col
319 (arguments
320 (list
321 #:phases
322 #~(modify-phases %standard-phases
323 (delete 'configure)
324 (add-before 'build 'patch-makefile
325 (lambda _
326 (substitute* "Makefile.config"
327 (("^PREFIX= /usr/local")
328 (string-append "PREFIX="
329 #$output))
330 (("=\\s?/usr")
331 "= ${PREFIX}"))
332 (substitute* "Makefile.target"
333 (("LIBCALC_SHLIB=")
334 "LIBCALC_SHLIB= -Wl,-rpath='$$ORIGIN'")
335 (("LIBCUSTCALC_SHLIB=")
336 "LIBCUSTCALC_SHLIB= -Wl,-rpath='$$ORIGIN'")))))))
337 (synopsis "Arbitrary precision console calculator")
338 (description
339 "Calc is an arbitrary precision arithmetic system that uses a C-like
340language. It can be used as a calculator, an algorithm prototyper and as
341a mathematical research tool, and it comes with built in mathematical and
342programmatic functions.")
343 (home-page "http://www.isthe.com/chongo/tech/comp/calc/")
344 (license license:lgpl2.1)))
345
346(define-public chuffed
347 (package
348 (name "chuffed")
349 (version "0.13.2")
350 (source
351 (origin
352 (method git-fetch)
353 (uri (git-reference
354 (url "https://github.com/chuffed/chuffed")
355 (commit version)))
356 (file-name (git-file-name name version))
357 (sha256
358 (base32 "164brmwn71p9gb2441kh7b1gzmy2sg7bjv5z00wjs9nw41qc908g"))))
359 (build-system cmake-build-system)
360 (arguments
361 (list #:tests? #f ;no 'test' target
362 #:phases
363 #~(modify-phases %standard-phases
364 (add-before 'build 'patch-msc
365 (lambda* (#:key outputs #:allow-other-keys)
366 (let ((out (assoc-ref outputs "out")))
367 (substitute* "chuffed.msc"
368 (("\\.\\./../..") out)
369 (("\\.\\.")
370 (string-append out "/share/minizinc")))))))))
371 (synopsis "Lazy clause generation solver")
372 (description
373 "Chuffed is a state of the art lazy clause solver designed from the
374ground up with lazy clause generation in mind. Lazy clause generation
375is a hybrid approach to constraint solving that combines features of
376finite domain propagation and Boolean satisfiability.")
377 (home-page "https://github.com/chuffed/chuffed")
378 (license license:expat)))
379
380(define-public clblast
381 (package
382 (name "clblast")
383 (version "1.6.3")
384 (source
385 (origin
386 (method git-fetch)
387 (uri (git-reference
388 (url "https://github.com/CNugteren/CLBlast")
389 (commit version)))
390 (file-name (git-file-name name version))
391 (sha256
392 (base32 "1zp8rfkscnh4l9x71kp39hsg5zxfhkkf88886mv40hw0a1hafdvz"))))
393 (build-system cmake-build-system)
394 (arguments (list #:tests? #f)) ;no device available during tests
395 (inputs
396 (list opencl-icd-loader opencl-headers))
397 (native-inputs
398 (list python-minimal-wrapper))
399 (home-page "https://cnugteren.github.io/clblast/")
400 (synopsis "Tunable OpenCL BLAS library")
401 (description
402 "CLBlast is a lightweight, performant and tunable OpenCL BLAS library
403written in C++11. It is designed to leverage the full performance potential
404of a wide variety of OpenCL devices from different vendors, including desktop
405and laptop GPUs, embedded GPUs, and other accelerators. CLBlast implements
406BLAS routines: basic linear algebra subprograms operating on vectors and
407matrices.")
408 (license license:asl2.0)))
409
410(define-public coda
411 (package
412 (name "coda")
413 (version "2.25.6")
414 (source
415 (origin
416 (method git-fetch)
417 (uri (git-reference
418 (url "https://github.com/stcorp/coda")
419 (commit version)))
420 (file-name (git-file-name name version))
421 (sha256
422 (base32 "1876bx0cpxb6di5r08wxwjrxl50zhh5f8d740xgjsfmw9s7kk4j5"))
423 (modules '((guix build utils)))
424 (snippet
425 ;; Make sure we don't use the bundled software.
426 #~(begin
427 (substitute* "Makefile.am"
428 (("libexpat_internal\\.la libpcre2_internal\\.la libz_internal\\.la")
429 ""))
430 (with-directory-excursion "libcoda"
431 (for-each delete-file-recursively '("zlib" "pcre2" "expat")))))))
432 (build-system gnu-build-system)
433 (arguments
434 (list #:configure-flags #~(list "--with-hdf5" "--enable-python"
435 "LIBS= -lz -lpcre2-posix -lexpat")))
436 (native-inputs
437 (list autoconf
438 automake
439 bison
440 flex
441 gfortran
442 libtool
443 python
444 python-numpy))
445 (inputs
446 (list zlib
447 pcre
448 pcre2
449 expat
450 hdf5))
451 (synopsis "Common interface to various earth observation data formats")
452 (description
453 "The Common Data Access toolbox (CODA) provides a set of interfaces for
454reading remote sensing data from earth observation data files. It consists of
455command line applications and interfaces to the C, Fortran, Python, and Java
456programming languages.")
457 (home-page "https://stcorp.nl/coda")
458 (license license:gpl2+)))
459
460(define-public cvc5
461 (package
462 (name "cvc5")
463 (version "1.3.4")
464 (source
465 (origin
466 (method git-fetch)
467 (uri (git-reference
468 (url "https://github.com/cvc5/cvc5/")
469 (commit (string-append "cvc5-" version))))
470 (file-name (git-file-name name version))
471 (sha256
472 (base32 "1xix197pyd45jakk10apam3bhl38nk14zjk0fzr9rj4knh10x5rx"))
473 (patches
474 (search-patches "cvc5-symfpu-1.2.0.patch"))))
475 (build-system cmake-build-system)
476 (arguments
477 (list
478 #:build-type "Production"
479 #:configure-flags
480 ;; Keep the flags in sync with the options set by `./configure --best`.
481 ;; See <https://github.com/cvc5/cvc5/blob/cvc5-1.3.3/configure.sh#L216-L222>.
482 #~(list "-DBUILD_SHARED_LIBS=1"
483 "-DENABLE_GPL=ON"
484 "-DUSE_EDITLINE=ON"
485 "-DUSE_CLN=ON"
486 "-DUSE_POLY=ON"
487 "-DENABLE_IPO=ON"
488 "-DUSE_CRYPTOMINISAT=ON")
489 ;; TODO: The reduce_constant_dup test fails, needs investigation.
490 #:test-exclude "reduce_constants_dup\\.smt2"
491 #:phases
492 #~(modify-phases %standard-phases
493 ;; Guix's libedit package does not require -ltinfo.
494 (add-after 'unpack 'remove-tinfo
495 (lambda _
496 (substitute* "cmake/FindEditline.cmake"
497 ((" tinfo")
498 ""))))
499 ;; The 'check phase requires test programs build using 'build-tests'.
500 (add-before 'check 'build-tests
501 (lambda* (#:key tests? #:allow-other-keys)
502 (when tests?
503 (invoke "cmake" "--build" "." "--target" "build-tests")))))))
504 (inputs (list cadical-2.1
505 cln
506 cryptominisat
507 gmp
508 libedit
509 libpoly
510 symfpu))
511 (native-inputs (list pkg-config
512 python-minimal
513 python-tomli
514 python-pyparsing
515 python-pexpect))
516 (home-page "https://cvc5.github.io/")
517 (synopsis "Satisfiability modulo theories solver")
518 (description
519 "cvc5 is a solver for @acronym{SMT, satisfiability modulo theories}
520problems. It processes input in the standard SMT-LIB format.")
521 (license (list license:expat license:bsd-3))))
522
523(define-public go-github-com-cpmech-gosl
524 (package
525 (name "go-github-com-cpmech-gosl")
526 (version "1.2.12")
527 (source
528 (origin
529 (method git-fetch)
530 (uri (git-reference
531 (url "https://github.com/cpmech/gosl")
532 (commit (string-append "v" version))))
533 (file-name (git-file-name name version))
534 (sha256
535 (base32 "1gfx8wqfrxsssprdf3ccgm60nv65dgsygwrx0a1ajga3lzp6iw2d"))))
536 (build-system go-build-system)
537 (arguments
538 (list
539 #:skip-build? #t
540 #:import-path "github.com/cpmech/gosl"
541 #:test-flags #~(list "-vet=off")
542 #:phases
543 #~(modify-phases %standard-phases
544 ;; Adapt la flags for Guix libraries.
545 (add-after 'unpack 'patch-la-flags
546 (lambda* (#:key import-path #:allow-other-keys)
547 (substitute* (string-append "src/" import-path "/la/flags.go")
548 (("_seq") "")))))))
549 (propagated-inputs
550 (list fftw
551 gfortran
552 (list gfortran "lib")
553 lapack
554 metis
555 mumps
556 openblas
557 suitesparse))
558 (home-page "https://github.com/cpmech/gosl")
559 (synopsis "Go Scientific Library")
560 (description
561 "Gosl is a set of tools for developing scientific simulations using the
562Go programing language. It provides numerical methods and solvers for
563differential equations but also present some functions for @acronym{Fast
564Fourier Transforms, FFT}, the generation of random numbers, probability
565distributions, and computational geometry.
566
567Gosl includes the following Go packages:
568
569@itemize
570@item @code{chk} - to check numerical results and for unit testing
571@item @code{fun} - special functions, DFT, FFT, Bessel, elliptical integrals,
572orthogonal polynomials, interpolators
573@item @code{gm} - geometry algorithms and structures
574@item @code{hb} - pseudo hierarchical binary (hb) data file format
575@item @code{io} - input/output, including printing to the terminal and
576handling files
577@item @code{la} - linear algebra: vector, matrix, efficient sparse solvers,
578eigenvalues, decompositions
579@item @code{num} - fundamental numerical methods such as root solvers,
580non-linear solvers, numerical derivatives, and quadrature
581@item @code{ode} - solvers for ordinary differential equations
582@item @code{opt} - numerical optimization: Interior Point, Conjugate
583Gradients, Powell, Grad Descent
584@item @code{pde} - solvers for partial differential equations (FDM, Spectral,
585FEM)
586@item @code{rnd} - random numbers and probability distributions
587@item @code{utl} - to generate series (e.g., linspace) and other functions as
588in pylab/matlab/octave
589@end itemize")
590 (license license:bsd-3)))
591
592(define-public qdldl
593 (package
594 (name "qdldl")
595 (version "0.1.9")
596 (source
597 (origin
598 (method git-fetch)
599 (uri (git-reference
600 (url "https://github.com/osqp/qdldl")
601 (commit (string-append "v" version))))
602 (file-name (git-file-name name version))
603 (sha256
604 (base32 "0vm9a51ar5kz4lmz01ydkk757ppzjnxy49rjbm56rwj65smp26d5"))))
605 (build-system cmake-build-system)
606 (arguments
607 (list #:configure-flags #~(list "-DQDLDL_UNITTESTS=ON")))
608 (home-page "https://github.com/osqp/qdldl")
609 (synopsis "LDL factorisation routine")
610 (description
611 "This package provides a free
612@url{https://en.wikipedia.org/wiki/Cholesky_decomposition#LDL_decomposition,
613@acronym{LDL, Lower-Diagonal-Lower}} factorisation routine for quasi-definite
614linear systems: @code{Ax=b}.")
615 (license license:asl2.0)))
616
617(define-public qhull
618 (package
619 (name "qhull")
620 (version "2020.2")
621 (source (origin
622 (method url-fetch)
623 (uri (string-append "http://www.qhull.org/download/qhull-"
624 (car (string-split version #\.))
625 "-src-8.0.2.tgz"))
626 (sha256
627 (base32
628 "0zlbhg0lb6j60188c2xhcrvviskr079552icjldqhy1jhgmxghmm"))))
629 (build-system cmake-build-system)
630 (arguments
631 `(#:configure-flags '("-DLINK_APPS_SHARED=ON"
632 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
633 (synopsis "Calculate convex hulls and related structures")
634 (description
635 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
636diagram, halfspace intersection about a point, furthest-site Delaunay
637triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
6383-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
639algorithm for computing the convex hull. It handles roundoff errors from
640floating point arithmetic. It computes volumes, surface areas, and
641approximations to the convex hull.
642
643@code{Qhull} does not support triangulation of non-convex surfaces, mesh
644generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
645shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
646triangulations.")
647 (home-page "http://qhull.org")
648 (license (license:non-copyleft "file://COPYING.txt"
649 "See COPYING in the distribution."))))
650
651(define-public units
652 (package
653 (name "units")
654 (version "2.27")
655 (source (origin
656 (method url-fetch)
657 (uri (string-append "mirror://gnu/units/units-" version
658 ".tar.gz"))
659 (sha256 (base32
660 "045ymd24906ng4m5l7zlpnk89sr92rx9wx46x7p0hz1fcw4xpfz1"))))
661 (build-system gnu-build-system)
662 (inputs
663 (list bash-minimal ;for wrap-program
664 readline
665 python-wrapper ;for 'units_cur' script
666 python-requests))
667 (arguments
668 `(#:phases (modify-phases %standard-phases
669 (add-after 'install 'wrap-units_cur
670 (lambda* (#:key outputs #:allow-other-keys)
671 (let* ((out (assoc-ref outputs "out"))
672 (bin (string-append out "/bin")))
673 (wrap-program (string-append bin "/units_cur")
674 `("GUIX_PYTHONPATH" ":" prefix
675 ,(search-path-as-string->list
676 (getenv "GUIX_PYTHONPATH"))))))))))
677 (synopsis "Conversion between thousands of scales")
678 (description
679 "GNU Units converts numeric quantities between units of measure. It
680can handle scale changes through adaptive usage of standard scale
681prefixes (micro-, kilo-, etc.). It can also handle nonlinear
682conversions such as Fahrenheit to Celsius. Its interpreter is powerful
683enough to be used effectively as a scientific calculator.")
684 (license license:gpl3+)
685 (home-page "https://www.gnu.org/software/units/")))
686
687(define-public double-conversion
688 (package
689 (name "double-conversion")
690 (version "3.1.5")
691 (home-page "https://github.com/google/double-conversion")
692 (source (origin
693 (method git-fetch)
694 (uri (git-reference (url home-page)
695 (commit (string-append "v" version))))
696 (file-name (git-file-name name version))
697 (sha256
698 (base32
699 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
700 (build-system cmake-build-system)
701 (arguments
702 '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
703 (synopsis "Conversion routines for IEEE doubles")
704 (description
705 "The double-conversion library provides binary-decimal and decimal-binary
706routines for IEEE doubles. The library consists of efficient conversion
707routines that have been extracted from the V8 JavaScript engine.")
708 (license license:bsd-3)))
709
710(define-public dionysus
711 (package
712 (name "dionysus")
713 (version "1.4.0")
714 (source (origin
715 (method url-fetch)
716 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
717 ".tar.xz"))
718 (sha256
719 (base32
720 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
721 (build-system gnu-build-system)
722 (inputs (list tcl)) ;for 'tclsh'
723 (synopsis "Local search for universal constants and scientific values")
724 (description
725 "GNU Dionysus is a convenient system for quickly retrieving the values of
726mathematical constants used in science and engineering. Values can be
727searched using a simple command-line tool, choosing from three databases:
728universal constants, atomic numbers, and constants related to
729semiconductors.")
730 (license license:gpl3+)
731 (home-page "https://www.gnu.org/software/dionysus/")))
732
733(define-public dozenal
734 ;; There is no recent release, so use the latest commit.
735 (let ((revision "1")
736 (commit "328bc03ad544179f2cccda36763358c4216f188e"))
737 (package
738 (name "dozenal")
739 (version (git-version "12010904-3" revision commit))
740 (source
741 (origin
742 (method git-fetch)
743 (uri (git-reference
744 (url "https://codeberg.org/dgoodmaniii/dozenal")
745 (commit commit)))
746 (file-name (git-file-name name version))
747 (sha256
748 (base32
749 "0knwfwjqdv854l5ny7csdpvp7r0md6a2k43a1l2lkyw9k3cglpph"))))
750 (build-system gnu-build-system)
751 (arguments
752 (list
753 ;; Some test scripts are included, but no makefile-driven
754 ;; tests, and they are all quite manual to run and check.
755 #:tests? #f
756 ;; Running with `make -j' causes the build to fail. This is likely
757 ;; because this project uses the "recursive make" structure, where
758 ;; each subdirectory contains its own make file, which is called by
759 ;; the top-level makefile.
760 #:parallel-build? #f
761 #:make-flags
762 #~(list (string-append "prefix=" #$output))
763 #:phases
764 #~(modify-phases %standard-phases
765 (add-after 'unpack 'chdir
766 (lambda _
767 (chdir "dozenal")))
768 (add-after 'chdir 'patch-lua-references
769 (lambda _
770 (let ((lua-name (strip-store-file-name
771 #$(this-package-input "lua"))))
772 (substitute* '("dozcal/Makefile"
773 "dozlua/Makefile")
774 (("lua52")
775 (string-take lua-name
776 (string-rindex lua-name #\.)))))))
777 (delete 'configure)
778 (add-before 'install 'make-bin-dir
779 (lambda _
780 (mkdir-p (string-append #$output "/bin"))))
781 (add-after 'install 'install-html-docs
782 (lambda _
783 (invoke "make"
784 (string-append "prefix=" #$output)
785 "installhtml")))
786 (add-after 'install-html-docs 'split-outputs
787 (lambda* (#:key inputs outputs #:allow-other-keys)
788 (for-each
789 (lambda (prog)
790 (let ((orig (string-append #$output "/bin/" prog))
791 (dst (string-append #$output:gui "/bin/" prog))
792 (man-orig (string-append #$output
793 "/share/man/man1/"
794 prog ".1"))
795 (man-dst (string-append #$output:gui
796 "/share/man/man1/"
797 prog ".1")))
798 (mkdir-p (dirname dst))
799 (rename-file orig dst)
800 (mkdir-p (dirname man-dst))
801 (rename-file man-orig man-dst)))
802 '("xdozdc" "gdozdc"))
803 (wrap-program (string-append #$output:gui "/bin/" "gdozdc")
804 `("PATH" = (,(string-append #$output "/bin")))
805 `("PERL5LIB" = (,(getenv "PERL5LIB")))))))))
806 (outputs '("out" "gui"))
807 (native-inputs (list groff pkg-config))
808 (inputs (list bash-minimal ;for wrap-program
809 libhdate
810 lua
811 ncurses
812 perl
813 perl-tk
814 perl-par
815 xforms))
816 (synopsis "Suite of dozenal programs")
817 (description
818 "The dozenal suite is a set of programs designed to assist with working
819in the dozenal (also called \"duodecimal\" or \"base twelve\") system. It
820includes number converters (dozenal-to-decimal and decimal-to-dozenal), an RPN
821calculator, a graphical calculator, a metric system converter (works with
822imperial, U.S. customary, SI metric, and the dozenal TGM), a pretty-printer
823for dozenal numbers, a date-and-time program, and a dozenal calendar programs,
824complete with events and to-dos.")
825 (home-page "https://codeberg.org/dgoodmaniii/dozenal")
826 (license license:gpl3+))))
827
828(define-public drat-trim
829 (package
830 (name "drat-trim")
831 (version "05.22.2023")
832 (source
833 (origin
834 (method git-fetch)
835 (uri (git-reference
836 (url "https://github.com/marijnheule/drat-trim")
837 (commit (string-append "v" version))))
838 (file-name (git-file-name name version))
839 (sha256
840 (base32 "084miqj57xr7c74y649acm5xjkddpjn4ybfh469jcbakzp8w0pdi"))))
841 (build-system gnu-build-system)
842 (arguments
843 (list
844 #:tests? #f ;no tests
845 #:make-flags
846 #~(list (string-join
847 (list "FLAGS=-DLONGTYPE"
848 ;; _POSIX_C_SOURCE required for getc_unlocked(3).
849 "-D_POSIX_C_SOURCE=200809")
850 " "))
851 #:phases
852 #~(modify-phases %standard-phases
853 (add-after 'unpack 'always-pass-flags
854 (lambda _
855 (substitute* "Makefile"
856 ;; Ensure that drat-trim and gapless target also respect FLAGS.
857 (("-std=c99 -O2")
858 "-std=c99 $(FLAGS) -O2"))))
859 (delete 'configure) ;no configure script
860 (replace 'install
861 (lambda* (#:key outputs #:allow-other-keys)
862 (let* ((bin (string-append #$output "/bin")))
863 (for-each (lambda (exec)
864 (install-file exec bin))
865 '("drat-trim"
866 "lrat-check"))))))))
867 (synopsis "Proof checker for unsatisfiability of propositional formulas")
868 (description
869 "The proof checker DRAT-trim can be used to check whether a propositional
870formula in the DIMACS format is unsatisfiable. Given a propositional formula and
871a clausal proof, DRAT-trim validates that the proof is a certificate of
872unsatisfiability of the formula.")
873 (home-page "https://www.cs.utexas.edu/~marijn/drat-trim/")
874 (license license:expat)))
875
876(define-public dsfmt
877 (package
878 (name "dsfmt")
879 (version "2.2.3")
880 (source
881 (origin
882 (method url-fetch)
883 (uri
884 (string-append
885 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
886 "dSFMT-src-" version ".tar.gz"))
887 (sha256
888 (base32
889 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
890 (modules '((guix build utils)))
891 ;; Don't distribute html documentation with bundled jquery.
892 (snippet
893 '(begin
894 (delete-file-recursively "html") #t))
895 ;; Add patches borrowed from Julia.
896 (patches
897 (list
898 (origin
899 (method url-fetch)
900 (uri (string-append
901 "https://raw.githubusercontent.com/JuliaLang/julia/"
902 "v1.3.0/deps/patches/dSFMT.c.patch"))
903 (sha256 (base32
904 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
905 (file-name "dSFMT.c.patch"))
906 (origin
907 (method url-fetch)
908 (uri (string-append
909 "https://raw.githubusercontent.com/JuliaLang/julia/"
910 "v1.3.0/deps/patches/dSFMT.h.patch"))
911 (sha256 (base32
912 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
913 (file-name "dSFMT.h.patch"))))))
914 (build-system gnu-build-system)
915 (arguments
916 `(#:phases
917 (modify-phases %standard-phases
918 (delete 'configure) ; no configure script
919 (replace 'build
920 ;; Upstream Makefile does not build a shared library. Borrow from Julia
921 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
922 (lambda _
923 (invoke
924 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
925 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
926 "-O3" "-finline-functions" "-fomit-frame-pointer"
927 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
928 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
929 "-o" "libdSFMT.so")))
930 (replace 'install ; no "install" target
931 (lambda* (#:key outputs #:allow-other-keys)
932 (let* ((out (assoc-ref outputs "out"))
933 (lib (string-append out "/lib"))
934 (inc (string-append out "/include"))
935 (doc (string-append out "/share/doc/" ,name "-" ,version)))
936 (install-file "libdSFMT.so" lib)
937 (install-file "dSFMT.h" inc)
938 (install-file "LICENSE.txt" doc)
939 #t))))))
940 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
941 (description
942 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
943the expensive conversion of integer to double (floating point). dSFMT directly
944generates double precision floating point pseudorandom numbers which have the
945IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
946format. dSFMT is only available on the CPUs which use IEEE 754 format double
947precision floating point numbers.")
948 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
949 (license license:bsd-3)))
950
951(define-public gsl
952 (package
953 (name "gsl")
954 (version "2.8")
955 (source (origin
956 (method url-fetch)
957 (uri (string-append "mirror://gnu/gsl/gsl-"
958 version ".tar.gz"))
959 (sha256
960 (base32
961 "141i8ag2qazyqqk17bfr2l7mr1asxm1da7avi5a66b332pnyx6ba"))))
962 (outputs '("out" "static" "debug"))
963 (build-system gnu-build-system)
964 (arguments
965 (list #:phases
966 #~(modify-phases %standard-phases
967 #$@(cond
968 ((and (target-riscv64?)
969 (%current-target-system))
970 #~((add-after 'unpack 'force-bootstrap
971 (lambda _
972 ;; gsl ships with an old configure script that does not
973 ;; support riscv64. Regenerate it.
974 (delete-file "configure")))))
975
976 ((or (string-prefix? "aarch64" (%current-system))
977 (string-prefix? "powerpc" (%current-system)))
978 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
979 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
980 #~((add-before 'check 'disable-failing-tests
981 (lambda _
982 (substitute* "spmatrix/test.c"
983 ((".*test_complex.*")
984 "\n"))))))
985
986 ((string-prefix? "i686" (%current-system))
987 ;; There are rounding issues with these tests on i686:
988 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
989 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
990 ;; https://codeberg.org/guix/guix/issues/1234#issuecomment-5874172
991 #~((add-before 'check 'disable-failing-tests
992 (lambda _
993 (substitute* "spmatrix/test.c"
994 ((".*test_all.*") "\n")
995 ((".*test_float.*") "\n")
996 ((".*test_complex.*") "\n"))
997
998 (substitute* "specfunc/test_legendre.c"
999 ((".*= test_legendre_schmidt.*") "\n"))
1000
1001 ;; XXX: These tests abort with:
1002 ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
1003 (substitute* '("multifit_nlinear/test.c"
1004 "multilarge_nlinear/test.c")
1005 (("gsl_ieee_env_setup.*" all)
1006 (string-append "exit (77);\n" all)))))))
1007
1008 (else #~()))
1009 (add-after 'install 'move-static-library
1010 (lambda* (#:key outputs #:allow-other-keys)
1011 (let ((static (string-append (assoc-ref outputs
1012 "static")
1013 "/lib/"))
1014 (out (string-append (assoc-ref outputs "out")
1015 "/lib/")))
1016 (mkdir-p static)
1017 (rename-file (string-append out "libgsl.a")
1018 (string-append static "libgsl.a"))
1019 (rename-file (string-append out "libgslcblas.a")
1020 (string-append static "libgslcblas.a"))))))))
1021 (native-inputs
1022 (if (and (target-riscv64?)
1023 (%current-target-system))
1024 (list autoconf automake libtool)
1025 '()))
1026 (home-page "https://www.gnu.org/software/gsl/")
1027 (synopsis "Numerical library for C and C++")
1028 (description
1029 "The GNU Scientific Library is a library for numerical analysis in C
1030and C++. It includes a wide range of mathematical routines, with over 1000
1031functions in total. Subject areas covered by the library include:
1032differential equations, linear algebra, Fast Fourier Transforms and random
1033numbers.")
1034
1035 ;; Linear algebra routines should benefit from SIMD optimizations.
1036 (properties `((tunable? . #t)))
1037
1038 (license license:gpl3+)))
1039
1040(define-public sleef
1041 (package
1042 (name "sleef")
1043 (version "3.6.1")
1044 (source
1045 (origin
1046 (method git-fetch)
1047 (uri (git-reference
1048 (url "https://github.com/shibatch/sleef")
1049 (commit version)))
1050 (file-name (git-file-name name version))
1051 (sha256
1052 (base32 "14y1zf621zp0333vs29pc7pcc31gsrrs3q49b6qmd1kz6c7a7fp2"))))
1053 (build-system cmake-build-system)
1054 (arguments
1055 (list
1056 #:build-type "Release"
1057 #:configure-flags
1058 #~(list "-DSLEEF_BUILD_SHARED_LIBS=ON")))
1059 (inputs
1060 (list fftw gmp mpfr openssl))
1061 (home-page "https://sleef.org/")
1062 (synopsis "SIMD library for evaluating elementary functions and DFT")
1063 (description
1064 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
1065implements vectorized versions of all C99 real floating point math functions.
1066It can utilize SIMD instructions that are available on modern processors.")
1067 (license (list license:boost1.0 ;sleef
1068 license:cc-by4.0)))) ;simplex algorithm
1069
1070(define-public glpk
1071 (package
1072 (name "glpk")
1073 (version "5.0")
1074 (source
1075 (origin
1076 (method url-fetch)
1077 (uri (string-append "mirror://gnu/glpk/glpk-"
1078 version ".tar.gz"))
1079 (sha256
1080 (base32
1081 "05bgxidxj8d9xdp82niy7cy36w181cxq7p8vc3y2ixshpgp1642a"))))
1082 (build-system gnu-build-system)
1083 (inputs
1084 (list gmp))
1085 (arguments
1086 `(#:configure-flags '("--with-gmp"
1087 "--disable-static")))
1088 (home-page "https://www.gnu.org/software/glpk/")
1089 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
1090 (description
1091 "GLPK is a C library for solving large-scale linear programming (LP),
1092mixed integer programming (MIP), and other related problems. It supports the
1093GNU MathProg modeling language, a subset of the AMPL language, and features a
1094translator for the language. In addition to the C library, a stand-alone
1095LP/MIP solver is included in the package.")
1096 (license license:gpl3+)))
1097
1098(define-public linasm
1099 (package
1100 (name "linasm")
1101 (version "1.13")
1102 (source (origin
1103 (method git-fetch)
1104 (uri (git-reference
1105 (url "https://git.code.sf.net/p/linasm/linasm")
1106 (commit (string-append "v" version "(stable)"))))
1107 (file-name (git-file-name name version))
1108 (sha256
1109 (base32
1110 "11095bxjxsq3a9apvyi1kpddwkg9b2hc5ga65qhrdxzvdsrjhaaq"))))
1111 (build-system gnu-build-system)
1112 (arguments
1113 (list
1114 #:tests? #false ;there are none
1115 #:make-flags
1116 #~(list (string-append "prefix=" #$output))
1117 #:phases
1118 '(modify-phases %standard-phases
1119 (delete 'configure))))
1120 (supported-systems '("x86_64-linux"))
1121 (home-page "https://sourceforge.net/projects/linasm/")
1122 (synopsis "Collection of fast and optimized assembly libraries for x86-64")
1123 (description
1124 "LinAsm is collection of very fast and SIMD optimized assembly written
1125libraries for x86-64.
1126
1127It implements many common and widely used algorithms for array manipulations:
1128searching, sorting, arithmetic and vector operations, unit conversions; fast
1129mathematical and statistic functions; numbers and time converting algorithms;
1130@dfn{finite impulse response} (FIR) digital filters; spectrum analysis
1131algorithms, Fast Hartley transformation; CPU cache friendly functions and
1132extremely fast @dfn{abstract data types} (ADT) such as hash tables b-trees,
1133and much more.")
1134 (license license:lgpl3+)))
1135
1136(define-public gfan
1137 (package
1138 (name "gfan")
1139 (version "0.7")
1140 (source
1141 (origin
1142 (method url-fetch)
1143 (uri (string-append "https://users-math.au.dk/jensen/software"
1144 "/gfan/gfan" version ".tar.gz"))
1145 (sha256
1146 (base32 "17lqripnsdb5hn7nnhgn4siajgh1jh9nkaplca3akm74w5bkg0xb"))))
1147 (build-system gnu-build-system)
1148 (arguments
1149 (list
1150 #:make-flags #~(list (string-append "PREFIX=" #$output)
1151 (string-append "CC=" #$(cc-for-target))
1152 (string-append "CXX=" #$(cxx-for-target)))
1153 #:phases #~(modify-phases %standard-phases
1154 (delete 'configure)
1155 ;; cddlib is distributed with the 'cddlib' header name,
1156 ;; but gfan expects it to be named 'cdd'. Substitute
1157 ;; the include headers to make gfan find it.
1158 (add-after 'unpack 'fix-cdd-reference
1159 (lambda _
1160 (substitute* '("src/lp_cdd.cpp"
1161 "src/gfanlib_zcone.cpp"
1162 "src/app_librarytest.cpp")
1163 (("#include \"cdd") "#include \"cddlib")))))))
1164 (inputs (list cddlib gmp))
1165 (home-page "https://users-math.au.dk/jensen/software/gfan/gfan.html")
1166 (synopsis "Compute Gröbner fans and tropical varieties")
1167 (description "Gfan is a software package for computing Gröbner fans and
1168tropical varieties.")
1169 ;; homepage/gfan.html: "Gfan is distributed under the terms of the GPL
1170 ;; license version 2 or 3 as desired"
1171 (license license:gpl2)))
1172
1173(define-public 4ti2
1174 (package
1175 (name "4ti2")
1176 (version "1.6.12")
1177 (source
1178 (origin
1179 (method url-fetch)
1180 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
1181 "Release_"
1182 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
1183 version)
1184 "/4ti2-" version ".tar.gz"))
1185 (sha256
1186 (base32 "1p82sjwsbyg418jfb1wzff1x10h4yhxgnqnsvz33k3x121k2cwjw"))))
1187 (build-system gnu-build-system)
1188 (native-inputs
1189 (list (@ (gnu packages base) which))) ; for the tests
1190 (inputs
1191 (list glpk gmp))
1192 (home-page "https://4ti2.github.io")
1193 (synopsis "Mathematical tool suite for problems on linear spaces")
1194 (description
1195 "4ti2 implements algorithms for solving algebraic, geometric and
1196combinatorial problems on linear spaces. Among others, it solves systems
1197of linear equations, computes extreme rays of polyhedral cones, solves
1198integer programming problems and computes Markov bases for statistics.")
1199 (license license:gpl2+)))
1200
1201(define-public sympow
1202 (package
1203 (name "sympow")
1204 (version "2.023.7")
1205 (source
1206 (origin
1207 (method git-fetch)
1208 (uri (git-reference
1209 (url "https://gitlab.com/rezozer/forks/sympow")
1210 (commit (string-append "v" version))))
1211 (file-name (git-file-name name version))
1212 (sha256
1213 (base32
1214 "0ilnxygkj4g5arjiyd16k00cvnjlqs0cpc8hk64kbqhl877mm5i9"))))
1215 (build-system gnu-build-system)
1216 (arguments
1217 (list #:tests? #f ; no tests
1218 #:phases #~(modify-phases %standard-phases
1219 (replace 'configure
1220 (lambda* (#:key inputs #:allow-other-keys)
1221 (substitute* "Configure"
1222 (("/bin/sh") (search-input-file inputs "/bin/bash")))
1223 (setenv "PREFIX" #$output)
1224 (setenv "VARPREFIX" #$output)
1225 (invoke "bash" "./Configure"))))))
1226 (native-inputs (list bash-minimal coreutils help2man pari-gp which))
1227 (home-page "https://gitlab.com/rezozer/forks/sympow")
1228 (synopsis "Symmetric power elliptic curve L-functions")
1229 (description "SYMPOW is a mathematical program to compute special values
1230of symmetric power elliptic curve L-functions; it can compute up to about 64
1231digits of precision.")
1232 ;; bsd-2 with extra stipulation that users be informed of sympow's
1233 ;; "less restrictive license" if it's included in a program with a more
1234 ;; restrictive license. However, since sympow includes fpu.c which is
1235 ;; gpl2+ the whole package can only be distributed via GPL anyway.
1236 ;; See also <https://gitlab.com/rezozer/forks/sympow/-/issues/7>.
1237 (license (license:non-copyleft "file:///COPYING"
1238 "See COPYING in the distribution."))))
1239
1240(define-public cddlib
1241 (package
1242 (name "cddlib")
1243 (version "0.94m")
1244 (source
1245 (origin
1246 (method git-fetch)
1247 (uri (git-reference
1248 (url "https://github.com/cddlib/cddlib")
1249 (commit version)))
1250 (file-name (git-file-name name version))
1251 (sha256
1252 (base32
1253 "09s8323h5w9j6mpl1yc6lm770dkskfxd2ayyafkcjllmnncxzfa0"))))
1254 (build-system gnu-build-system)
1255 (inputs
1256 (list gmp))
1257 (native-inputs
1258 (list autoconf
1259 automake
1260 libtool
1261 (texlive-local-tree
1262 (list texlive-amsfonts
1263 texlive-graphics
1264 texlive-l3backend
1265 texlive-l3backend))))
1266 (arguments
1267 (list #:configure-flags
1268 #~(list (string-append "--docdir=" #$output
1269 "/share/doc/" #$name "-" #$version))))
1270 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
1271 (synopsis "Library for convex hulls and extreme rays of polyhedra")
1272 (description
1273 "The C-library cddlib implements the Double Description Method of
1274Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
1275rays of a general convex polyhedron given by a system of linear inequalities
1276in arbitrary dimension. It can also be used for the converse operation of
1277computing convex hulls.")
1278 (license license:gpl2+)))
1279
1280(define-public lrslib
1281 (package
1282 (name "lrslib")
1283 (version "7.2")
1284 (source
1285 (origin
1286 (method url-fetch)
1287 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
1288 "lrslib-0"
1289 (string-delete #\. version) ".tar.gz"))
1290 (sha256
1291 (base32
1292 "1w1jsnfgny8cihndr5gfm99pvwp48qsvxkqfsi2q87gd3m57aj7w"))))
1293 (build-system gnu-build-system)
1294 (inputs
1295 (list gmp))
1296 (arguments
1297 `(#:tests? #f ; no check phase
1298 #:make-flags `("CC=gcc"
1299 ,(string-append "prefix=" (assoc-ref %outputs "out"))
1300 "all-shared")
1301 #:phases
1302 (modify-phases %standard-phases
1303 (replace 'configure
1304 (lambda _
1305 (substitute* "makefile"
1306 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
1307 #t)))))
1308 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
1309 (synopsis "Convex hulls of polyhedra with exact arithmetic")
1310 (description
1311 "The C code of lrslib implements the reverse search algorithm for
1312vertex enumeration and convex hull problems. Its input file format is
1313compatible with cddlib. All computations are done exactly in either
1314multiple precision or fixed integer arithmetic. Output is not stored
1315in memory, so even problems with very large output sizes can sometimes
1316be solved.")
1317 (license license:gpl2+)))
1318
1319(define-public libcerf
1320 (package
1321 (name "libcerf")
1322 (version "1.14")
1323 (source
1324 (origin
1325 (method git-fetch)
1326 (uri (git-reference
1327 (url "https://jugit.fz-juelich.de/mlz/libcerf")
1328 (commit (string-append "v" version))))
1329 (file-name (git-file-name name version))
1330 (sha256
1331 (base32 "1ic2q7kvxpqmgxlishygvx8d00i4wn51vkq4fyac44ahhf6c3kwd"))))
1332 (build-system cmake-build-system)
1333 (native-inputs
1334 (list perl))
1335 (home-page "https://jugit.fz-juelich.de/mlz/libcerf")
1336 (synopsis "Library for complex error functions")
1337 (description
1338 "@code{libcerf} is a self-contained numeric library that provides an
1339efficient and accurate implementation of complex error functions, along with
1340Dawson, Faddeeva, and Voigt functions.")
1341 (license license:expat)))
1342
1343(define-public vinci
1344 (package
1345 (name "vinci")
1346 (version "1.0.5")
1347 (source
1348 (origin
1349 (method url-fetch)
1350 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
1351 "vinci/vinci-" version ".tar.gz"))
1352 (sha256
1353 (base32
1354 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
1355 (build-system gnu-build-system)
1356 (inputs
1357 (list lrslib))
1358 (arguments
1359 `(#:tests? #f ; no check phase
1360 #:phases
1361 (modify-phases %standard-phases
1362 (replace 'configure
1363 ;; register the lrs location in the config file
1364 (lambda* (#:key inputs #:allow-other-keys)
1365 (let* ((lrs (assoc-ref inputs "lrslib"))
1366 (lrsexec (string-append lrs "/bin/lrs")))
1367 (substitute* "vinci.h"
1368 (("#define LRS_EXEC \"lrs\"")
1369 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
1370 #t))
1371 (replace 'install
1372 (lambda* (#:key outputs #:allow-other-keys)
1373 (let* ((out (assoc-ref outputs "out"))
1374 (bin (string-append out "/bin")))
1375 (install-file "vinci" bin))
1376 #t)))))
1377 (home-page
1378 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
1379 (synopsis "Volume computation for polytopes")
1380 (description
1381 "Vinci implements a number of volume computation algorithms for convex
1382polytopes in arbitrary dimension. The polytopes can be given by their
1383V-representation (as the convex hull of a finite number of vertices), by
1384their H-representation (as the bounded intersection of a finite number of
1385halfspaces) or by their double description with both representations.")
1386 (license license:gpl2+)))
1387
1388(define-public arpack-ng
1389 (package
1390 (name "arpack-ng")
1391 (version "3.9.1")
1392 (home-page "https://github.com/opencollab/arpack-ng")
1393 (source (origin
1394 (method git-fetch)
1395 (uri (git-reference (url home-page) (commit version)))
1396 (file-name (git-file-name name version))
1397 (sha256
1398 (base32
1399 "0bbw6a48py9fjlif2n4x75skyjskq2hghffjqzm85wnsnsjdlaqw"))))
1400 (build-system cmake-build-system)
1401 (arguments
1402 '(#:configure-flags '("-DICB=ON")))
1403 (native-inputs
1404 (list pkg-config))
1405 (inputs
1406 (list eigen openblas gfortran))
1407 (synopsis "Fortran subroutines for solving eigenvalue problems")
1408 (description
1409 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
1410large scale eigenvalue problems.")
1411 (license (license:non-copyleft "file://COPYING"
1412 "See COPYING in the distribution."))))
1413
1414(define-public arpack-ng-openmpi
1415 (package (inherit arpack-ng)
1416 (name "arpack-ng-openmpi")
1417 (inputs
1418 (modify-inputs inputs
1419 (prepend openmpi)))
1420 (arguments
1421 (substitute-keyword-arguments arguments
1422 ((#:configure-flags _ #~())
1423 #~'("-DMPI=ON"))
1424 ((#:phases phases #~%standard-phases)
1425 #~(modify-phases #$phases
1426 (add-before 'check 'mpi-setup
1427 #$%openmpi-setup)))))
1428 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
1429
1430(define-public lapack
1431 (package
1432 (name "lapack")
1433 (version "3.12.1")
1434 (source
1435 (origin
1436 (method git-fetch)
1437 (uri (git-reference
1438 (url "https://github.com/Reference-LAPACK/lapack/")
1439 (commit (string-append "v" version))))
1440 (file-name (git-file-name name version))
1441 (sha256
1442 (base32
1443 "19387ifv5kplnggw5fgz4nzspmqi11wnwzap2knwxgrvknysrwj9"))))
1444 (build-system cmake-build-system)
1445 (home-page "https://www.netlib.org/lapack/")
1446 (inputs (list gfortran python-wrapper))
1447 (arguments
1448 `(#:configure-flags (list
1449 "-DBUILD_SHARED_LIBS:BOOL=YES"
1450 "-DCBLAS=ON"
1451 "-DLAPACKE=ON"
1452 ;; Build the 'LAPACKE_clatms' functions.
1453 "-DLAPACKE_WITH_TMG=ON")))
1454 (synopsis "Library for numerical linear algebra")
1455 (description
1456 "LAPACK is a Fortran 90 library for solving the most commonly occurring
1457problems in numerical linear algebra.")
1458 (license (license:non-copyleft "file://LICENSE"
1459 "See LICENSE in the distribution."))
1460 (properties '((tunable? . #t)))))
1461
1462(define-public lis
1463 (package
1464 (name "lis")
1465 (version "2.1.8")
1466 (source (origin
1467 (method url-fetch)
1468 (uri (string-append "https://www.ssisc.org/lis/dl/lis-"
1469 version ".zip"))
1470 (sha256
1471 (base32 "0nh2593xkcdv1c3gmj7i64ca393nn0ngqfl522yiwbidh9dvd1nl"))))
1472 (build-system gnu-build-system)
1473 (arguments
1474 (list
1475 #:configure-flags #~(list "--enable-fortran"
1476 "--enable-f90"
1477 "--enable-openmp"
1478 "--enable-complex"
1479 "--disable-sse2" ;; XXX: tuning
1480 "--enable-shared")
1481 #:phases
1482 #~(modify-phases %standard-phases
1483 (add-after 'install 'install-doc
1484 (lambda _
1485 (let* ((share (string-append #$output "/share"))
1486 (docdir (string-append share "/doc/lis-" #$version))
1487 (mandir (string-append share "/man")))
1488 (copy-recursively "doc/man" mandir)
1489 ;; TODO: Build the manuals ourselves
1490 (install-file "doc/lis-ug-en.pdf" docdir)
1491 (install-file "doc/lis-ug-ja.pdf" docdir)))))))
1492 (inputs (list openmpi))
1493 (native-inputs (list gfortran unzip))
1494 (home-page "https://www.ssisc.org/lis")
1495 (synopsis "Solve discretized linear equations and eigenvalue problems")
1496 (description "Lis is a parallel software library for solving discretized
1497linear equations and eigenvalue problems that arise in the numerical solution
1498of partial differential equations using iterative methods.")
1499 (license license:bsd-3)))
1500
1501(define-public clapack
1502 (package
1503 (name "clapack")
1504 (version "3.2.1")
1505 (source
1506 (origin
1507 (method url-fetch)
1508 (uri (string-append "http://www.netlib.org/clapack/clapack-"
1509 version "-CMAKE.tgz"))
1510 (sha256
1511 (base32
1512 "0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
1513 (build-system cmake-build-system)
1514 (arguments
1515 (list
1516 #:configure-flags
1517 #~(list (string-append "-DCMAKE_C_FLAGS=-fcommon -O2"
1518 " -Wno-error=implicit-function-declaration"))
1519 #:phases
1520 #~(modify-phases %standard-phases
1521 ;; These tests use a lot of stack variables and segfault without
1522 ;; lifting resource limits.
1523 (add-after 'unpack 'disable-broken-tests
1524 (lambda _
1525 (substitute* "TESTING/CMakeLists.txt"
1526 (("add_lapack_test.* xeigtstz\\)") ""))))
1527 (replace 'install
1528 (lambda _
1529 (let ((libdir (string-append #$output "/lib"))
1530 (f2cinc (string-append #$output "/include/libf2c")))
1531 (mkdir-p f2cinc)
1532 (display (getcwd))
1533 (for-each (lambda (file)
1534 (install-file file libdir))
1535 '("SRC/liblapack.a"
1536 "F2CLIBS/libf2c/libf2c.a"
1537 "TESTING/MATGEN/libtmglib.a"
1538 "BLAS/SRC/libblas.a"))
1539 (for-each (lambda (file)
1540 (install-file file f2cinc))
1541 (cons "F2CLIBS/libf2c/arith.h"
1542 (find-files (string-append
1543 "../clapack-"
1544 #$version "-CMAKE/F2CLIBS/libf2c")
1545 "\\.h$")))
1546 (copy-recursively (string-append "../clapack-"
1547 #$version "-CMAKE/INCLUDE")
1548 (string-append #$output "/include"))))))))
1549 (home-page "https://www.netlib.org/clapack/")
1550 (synopsis "Numerical linear algebra library for C")
1551 (description
1552 "The CLAPACK library was built using a Fortran to C conversion utility
1553called f2c. The entire Fortran 77 LAPACK library is run through f2c to obtain
1554C code, and then modified to improve readability. CLAPACK's goal is to
1555provide LAPACK for someone who does not have access to a Fortran compiler.")
1556 (license (license:non-copyleft "file://LICENSE"
1557 "See LICENSE in the distribution."))))
1558
1559(define-public scalapack
1560 (package
1561 (name "scalapack")
1562 (version "2.2.2")
1563 (source
1564 (origin
1565 (method git-fetch)
1566 (uri (git-reference
1567 (url "https://github.com/Reference-ScaLAPACK/scalapack")
1568 (commit (string-append "v" version))))
1569 (file-name (git-file-name name version))
1570 (sha256
1571 (base32
1572 "0abs4j9iknd3qiyaj06gh00iyki71c2lzpmyv21ncv7f7vy1ccr8"))))
1573 (build-system cmake-build-system)
1574 (inputs
1575 `(("mpi" ,openmpi)
1576 ("fortran" ,gfortran)
1577 ("lapack" ,openblas))) ;for testing only
1578 (arguments
1579 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
1580 #:phases (modify-phases %standard-phases
1581 (add-before 'check 'mpi-setup
1582 ,%openmpi-setup)
1583 (add-after 'unpack 'skip-faulty-tests
1584 (lambda _
1585 ;; FIXME: Skip two tests that fail to complete. See
1586 ;; <https://github.com/amd/scalapack/commit/d3b6248b26f615b118ff4d72a00b3028f59a47f6>.
1587 (substitute* "TESTING/CMakeLists.txt"
1588 (("^add_test\\(x[cz]heevr.*" all)
1589 (string-append "# " all "\n")))))
1590 (add-before 'configure 'fix-gcc14-errors
1591 (lambda _
1592 (setenv "CFLAGS"
1593 (string-append
1594 "-g -O2 -DNDEBUG"
1595 " -Wno-error=implicit-function-declaration")))))))
1596 (home-page "https://www.netlib.org/scalapack/")
1597 (synopsis "Library for scalable numerical linear algebra")
1598 (description
1599 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
1600routines on parallel distributed memory machines. ScaLAPACK solves dense and
1601banded linear systems, least squares problems, eigenvalue problems, and
1602singular value problems.")
1603 (license (license:non-copyleft "file://LICENSE"
1604 "See LICENSE in the distribution."))))
1605
1606(define-public feedgnuplot
1607 (package
1608 (name "feedgnuplot")
1609 (version "1.60")
1610 (home-page "https://github.com/dkogan/feedgnuplot")
1611 (source (origin
1612 (method git-fetch)
1613 (uri (git-reference
1614 (url home-page)
1615 (commit (string-append "v" version))))
1616 (file-name (git-file-name name version))
1617 (sha256
1618 (base32
1619 "0403hwlian2s431m36qdzcczhvfjvh7128m64hmmwbbrgh0n7md7"))))
1620 (build-system perl-build-system)
1621 (arguments
1622 `(#:phases
1623 (modify-phases %standard-phases
1624 (add-before 'check 'adjust-tests
1625 (lambda _
1626 (substitute* "t/plots.t"
1627 ;; XXX: The vnlog tests uses 'echo' with escaped strings,
1628 ;; but does not enable escape interpretation.
1629 (("echo -n ")
1630 "echo -ne "))))
1631 (add-after 'install 'install-documentation
1632 (lambda* (#:key outputs #:allow-other-keys)
1633 (let* ((out (assoc-ref outputs "out"))
1634 (doc (string-append out "/share/doc/feedgnuplot")))
1635 (mkdir-p doc)
1636 (invoke "pod2html" "--title=feedgnuplot" "bin/feedgnuplot"
1637 "--outfile" (string-append doc "/feedgnuplot.html")))))
1638 (add-after 'install 'wrap
1639 (lambda* (#:key inputs outputs #:allow-other-keys)
1640 (let* ((out (assoc-ref outputs "out"))
1641 (gnuplot (search-input-file inputs "/bin/gnuplot"))
1642 ;; XXX: We need List::MoreUtils as well as its supporting
1643 ;; (propagated) modules; for now just refer to labels.
1644 (modules '("perl-list-moreutils" "perl-exporter-tiny"))
1645 (PERL5LIB (string-join
1646 (map (lambda (input)
1647 (string-append (assoc-ref inputs input)
1648 "/lib/perl5/site_perl"))
1649 modules)
1650 ":")))
1651 (wrap-program (string-append out "/bin/feedgnuplot")
1652 `("PERL5LIB" ":" suffix (,PERL5LIB))
1653 `("PATH" ":" suffix (,(dirname gnuplot))))))))))
1654 (inputs
1655 (list bash-minimal gnuplot perl-list-moreutils vnlog))
1656 (native-inputs
1657 ;; For tests.
1658 (list perl-ipc-run perl-string-shellquote))
1659 (synopsis "Pipe-oriented plotting tool")
1660 (description
1661 "@command{feedgnuplot} is a tool to plot realtime and stored data
1662from the command line, using @command{gnuplot}. It can read data from
1663a pipe or file, make a variety of transformations, and render the result
1664in the terminal or with an external viewer.")
1665 (license license:gpl1+))) ;any version
1666
1667(define-public giza
1668 (package
1669 (name "giza")
1670 (version "1.5.0")
1671 (source
1672 (origin
1673 (method git-fetch)
1674 (uri (git-reference
1675 (url "https://github.com/danieljprice/giza")
1676 (commit (string-append "v" version))))
1677 (file-name (git-file-name name version))
1678 (sha256
1679 (base32 "1qair5j6rq17hwvyxl6k2n4hkvgjw5wczmfzn7qh7kcv3qpg9p5l"))))
1680 (build-system gnu-build-system)
1681 (arguments
1682 (list
1683 #:phases
1684 #~(modify-phases %standard-phases
1685 (add-before 'check 'start-xorg-server
1686 (lambda* (#:key inputs #:allow-other-keys)
1687 (system "Xvfb :99 -screen 0 1920x1080x24 &")
1688 (setenv "DISPLAY" ":99")))
1689 ;; Tests are interactive, see
1690 ;; <https://github.com/danieljprice/giza/blob/v1.5.0/.github/workflows/build.yml#L52>.
1691 (replace 'check
1692 (lambda* (#:key tests? #:allow-other-keys)
1693 (when tests?
1694 (invoke "sh" "-c" "yes '' | make check")))))))
1695 (native-inputs
1696 (list perl
1697 pkg-config
1698 xorg-server-for-tests))
1699 (inputs
1700 (list cairo
1701 freetype
1702 gfortran))
1703 (home-page "https://danieljprice.github.io/giza/")
1704 (synopsis "Scientific plotting library for C/Fortran")
1705 (description
1706 "Giza is a lightweight scientific plotting library built on top of
1707@code{cairo} that provides uniform output to multiple devices.")
1708 (license license:gpl2+)))
1709
1710(define-public gnuplot
1711 (package
1712 (name "gnuplot")
1713 (version "6.0.1")
1714 (source (origin
1715 (method url-fetch)
1716 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
1717 version "/gnuplot-"
1718 version ".tar.gz"))
1719 (sha256
1720 (base32 "16ipf7m2c2v1cldp3kwxbjj6db6bzy0rkrpp4kzhh61a3866cnp8"))))
1721 (build-system gnu-build-system)
1722 (native-inputs
1723 (list pkg-config (texlive-local-tree)))
1724 (inputs
1725 (list cairo gd libcerf lua pango readline))
1726 (arguments
1727 (list #:configure-flags
1728 #~(list "--with-qt=no"
1729 (string-append "--with-texdir=" #$output
1730 "/texmf-local/tex/latex/gnuplot"))
1731 ;; Plot on a dumb terminal during tests.
1732 #:make-flags #~'("GNUTERM=dumb")))
1733 (home-page "http://www.gnuplot.info")
1734 (synopsis "Command-line driven graphing utility")
1735 (description "Gnuplot is a portable command-line driven graphing
1736utility. It was originally created to allow scientists and students to
1737visualize mathematical functions and data interactively, but has grown to
1738support many non-interactive uses such as web scripting. It is also used as a
1739plotting engine by third-party applications like Octave.")
1740 ;; X11 Style with the additional restriction that derived works may only be
1741 ;; distributed as patches to the original.
1742 (license (license:fsf-free
1743 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
1744
1745(define-public hmat
1746 (package
1747 (name "hmat")
1748 (version "1.10.0")
1749 (source (origin
1750 (method git-fetch)
1751 (uri (git-reference
1752 (url "https://github.com/jeromerobert/hmat-oss")
1753 (commit version)))
1754 (file-name (git-file-name name version))
1755 (sha256
1756 (base32
1757 "1cdaq5j2gknar7hcycll1ra9f0pqvri1bqsj0nf21kc4j2ynaw8s"))))
1758 (build-system cmake-build-system)
1759 (arguments
1760 ;; Examples are the tests.
1761 (list #:configure-flags #~(list "-DBUILD_EXAMPLES=ON")))
1762 (inputs (list openblas))
1763 (home-page "https://github.com/jeromerobert/hmat-oss")
1764 (synopsis "Hierarchical matrix library")
1765 (description "@code{hmat-oss} is hierarchical matrix library written in
1766C++ with a C API. It contains a LU and LLt solver, and a few other things.")
1767 (license license:gpl2+)))
1768
1769(define-public cminpack
1770 (package
1771 (name "cminpack")
1772 (version "1.3.13")
1773 (source (origin
1774 (method git-fetch)
1775 (uri (git-reference
1776 (url "https://github.com/devernay/cminpack")
1777 (commit (string-append "v" version))))
1778 (file-name (git-file-name name version))
1779 (sha256
1780 (base32
1781 "0apnph1j9hbr6vx3idcc6lhm19gwmqw4xi435g7dwnj9rgnyydlx"))))
1782 (build-system cmake-build-system)
1783 (arguments
1784 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
1785 (home-page "https://github.com/devernay/cminpack")
1786 (synopsis "C/C++ rewrite of the MINPACK software")
1787 (description
1788 "This is a C version of the minpack minimization package. It has been
1789derived from the fortran code using f2c and some limited manual editing.
1790Extern C linkage permits the package routines to be called from C++.")
1791 (license (license:non-copyleft ; original minpack license
1792 "https://github.com/certik/minpack/blob/master/LICENSE"))))
1793
1794(define-public bonmin
1795 (package
1796 (name "bonmin")
1797 (version "1.8.9")
1798 (source (origin
1799 (method git-fetch)
1800 (uri (git-reference
1801 (url "https://github.com/coin-or/Bonmin")
1802 (commit (string-append "releases/" version))))
1803 (file-name (git-file-name name version))
1804 (sha256
1805 (base32
1806 "153kj4wx386609g21hw3cv5yxps62qqrc64zwb9ryd2xad1w1a4y"))))
1807 (build-system gnu-build-system)
1808 (native-inputs (list gfortran pkg-config))
1809 (inputs (list cbc ipopt openblas))
1810 (home-page "https://coin-or.github.io/Bonmin/")
1811 (synopsis "Basic Open-source Nonlinear Mixed INteger programming")
1812 (description "Bonmin is a code for solving general MINLP (Mixed Integer
1813NonLinear Programming) problems. It builds on top of Cbc and Ipopt.")
1814 (license license:epl1.0)))
1815
1816(define-public pagmo
1817 (package
1818 (name "pagmo")
1819 (version "2.19.1")
1820 (source (origin
1821 (method git-fetch)
1822 (uri (git-reference
1823 (url "https://github.com/esa/pagmo2")
1824 (commit (string-append "v" version))))
1825 (file-name (git-file-name name version))
1826 (sha256
1827 (base32
1828 "1xx7f06idfhkh4qijh5rcxnldyac2pqb29j09w7k2b2h91xkgnl9"))))
1829 (build-system cmake-build-system)
1830 (arguments
1831 (list #:configure-flags #~(list "-DPAGMO_BUILD_TESTS=ON"
1832 "-DPAGMO_WITH_EIGEN3=ON")))
1833 ;; Eigen is optional, enables some extra features.
1834 (inputs (list boost eigen onetbb))
1835 (home-page "https://esa.github.io/pagmo2/")
1836 (synopsis
1837 "Platform to perform parallel computations of optimisation tasks")
1838 (description "@code{pagmo} is a C++ scientific library for massively
1839parallel optimization. It is built around the idea of providing a unified
1840interface to optimization algorithms and to optimization problems and to make
1841their deployment in massively parallel environments easy.")
1842 ;; Pagmo only supports 64-bit x86, ARM and PowerPC:
1843 ;; https://esa.github.io/pagmo2/install.html
1844 (supported-systems '("x86_64-linux" "aarch64-linux" "armhf-linux"
1845 "powerpc64le-linux"))
1846 ;; Dual licensed, user choice.
1847 (license (list license:lgpl3+ license:gpl3+))))
1848
1849(define-public arccon
1850 (package
1851 (name "arccon")
1852 (version "1.2.0")
1853 (source
1854 (origin
1855 (method git-fetch)
1856 (uri (git-reference
1857 (url "https://github.com/arcaneframework/framework")
1858 (commit (string-append "arccon-v" version))))
1859 (file-name (git-file-name name version))
1860 (sha256
1861 (base32 "0zvj863plifp4rs3wzq5z18vh7z3bh7zy90cvn12b6n0jbpfdpg3"))))
1862 (build-system cmake-build-system)
1863 (arguments
1864 (list
1865 #:tests? #f
1866 #:phases
1867 #~(modify-phases %standard-phases
1868 (add-before 'configure 'chdir-arccon
1869 (lambda _
1870 (chdir "arccon"))))))
1871 (home-page "https://github.com/arcaneframework/framework")
1872 (synopsis "Arcane Framework's CMake build libraries")
1873 (description "Arccon is part of the Arcane framework, providing core
1874functionality for the Arcane development platform.")
1875 (license license:asl2.0)))
1876
1877(define-public arccore
1878 (package
1879 (name "arccore")
1880 (version "2.5.0.0")
1881 (source
1882 (origin
1883 (method git-fetch)
1884 (uri (git-reference
1885 (url "https://github.com/arcaneframework/framework")
1886 (commit (string-append "arccore-v" version))))
1887 (file-name (git-file-name name version))
1888 (sha256
1889 (base32 "0cxqwhhs3zafiqnrjs28y60xg14jifg2xdycpr7l2291hyh6r7ra"))))
1890 (build-system cmake-build-system)
1891 (native-inputs (list arccon pkg-config googletest))
1892 (inputs (list glib openmpi))
1893 (arguments
1894 (list
1895 #:configure-flags
1896 #~(list "-DBUILD_SHARED_LIBS=TRUE" "-DARCCORE_USE_MPI=TRUE"
1897 "-DARCCORE_WANT_TEST=TRUE")
1898 #:phases
1899 #~(modify-phases %standard-phases
1900 (add-before 'configure 'chdir-arccore
1901 (lambda _
1902 (chdir "arccore"))))))
1903 (home-page "https://github.com/arcaneframework/framework")
1904 (synopsis "Arcane Framework's base functionalities for simulation code")
1905 (description
1906 "Arcane is a development environment for parallel numerical calculation
1907code. It supports the architectural aspects of a calculation code, such as data
1908structures for meshing and parallelism, as well as more environment-related aspects
1909such as dataset configuration.")
1910 (license license:asl2.0)))
1911
1912(define-public hdf5-1.8
1913 (package
1914 (name "hdf5")
1915 (version "1.8.23")
1916 (source
1917 (origin
1918 (method url-fetch)
1919 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1920 "hdf5-" (version-major+minor version)
1921 "/hdf5-" version "/src/hdf5-"
1922 version ".tar.bz2")
1923 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1924 "current"
1925 (match (string-split version #\.)
1926 ((major minor _ ...)
1927 (string-append major minor)))
1928 "/src/hdf5-" version ".tar.bz2")))
1929 (sha256
1930 (base32 "0km65mr6dgk4ia2dqr1b9dzw9qg15j5z35ymbys9cnny51z1zb39"))
1931 (patches (search-patches "hdf5-config-date.patch"))))
1932 (build-system gnu-build-system)
1933 (inputs
1934 (list zlib))
1935 (native-inputs
1936 (list gfortran perl)) ;part of the test machinery needs Perl
1937 (outputs '("out" ; core library
1938 "fortran")) ; fortran interface
1939 (arguments
1940 `(;; Some of the users, notably Flann, need the C++ interface.
1941 #:configure-flags '("--enable-cxx"
1942 "--enable-fortran"
1943 "--enable-fortran2003"
1944
1945 ;; Build a thread-safe library. Unfortunately,
1946 ;; 'configure' invites you to either turn off C++,
1947 ;; Fortran, and the high-level interface (HL), or
1948 ;; to pass '--enable-unsupported'. Debian
1949 ;; packagers chose to pass '--enable-unsupported'
1950 ;; and we follow their lead here.
1951 "--enable-threadsafe"
1952 "--with-pthread"
1953 "--enable-unsupported")
1954 ;; Use -fPIC to allow the R bindings to link with the static libraries.
1955 ;; Declare warnings as non-errors to fix build with gcc@14
1956 #:make-flags
1957 (list "CFLAGS=-g -O2 -fPIC -Wno-error=incompatible-pointer-types"
1958 "CXXFLAGS=-g -O2 -fPIC")
1959 #:phases
1960 (modify-phases %standard-phases
1961 (add-before 'configure 'patch-configure
1962 (lambda* (#:key outputs #:allow-other-keys)
1963 (substitute* "configure"
1964 (("/bin/mv") "mv"))
1965 (substitute* "fortran/src/Makefile.in"
1966 (("libhdf5_fortran_la_LDFLAGS =")
1967 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl,-rpath="
1968 (assoc-ref outputs "fortran") "/lib")))
1969 (substitute* "hl/fortran/src/Makefile.in"
1970 (("libhdf5hl_fortran_la_LDFLAGS =")
1971 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1972 (assoc-ref outputs "fortran") "/lib")))))
1973 (add-after 'configure 'patch-settings
1974 (lambda _
1975 ;; libhdf5.settings contains the full path of the
1976 ;; compilers used, and its contents are included in
1977 ;; libhdf5.so. We truncate the hashes to avoid
1978 ;; unnecessary store references to those compilers:
1979 (substitute* "src/libhdf5.settings"
1980 (("(/gnu/store/)([a-zA-Z0-9]*)" all prefix hash)
1981 (string-append prefix (string-take hash 10) "..."))
1982 ;; Don't record the build-time kernel version to make the
1983 ;; settings file reproducible.
1984 (("Uname information:.*")
1985 "Uname information: Linux\n"))))
1986 (add-after 'install 'patch-references
1987 (lambda* (#:key inputs outputs #:allow-other-keys)
1988 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1989 (zlib (assoc-ref inputs "zlib")))
1990 (substitute* (find-files bin "h5p?cc")
1991 (("-lz" lib)
1992 (string-append "-L" zlib "/lib " lib))))))
1993 (add-after 'install 'split
1994 (lambda* (#:key inputs outputs #:allow-other-keys)
1995 ;; Move all fortran-related files
1996 (let* ((out (assoc-ref outputs "out"))
1997 (bin (string-append out "/bin"))
1998 (lib (string-append out "/lib"))
1999 (inc (string-append out "/include"))
2000 (ex (string-append out "/share/hdf5_examples/fortran"))
2001 (fort (assoc-ref outputs "fortran"))
2002 (fbin (string-append fort "/bin"))
2003 (flib (string-append fort "/lib"))
2004 (finc (string-append fort "/include"))
2005 (fex (string-append fort "/share/hdf5_examples/fortran")))
2006 (mkdir-p fbin)
2007 (mkdir-p flib)
2008 (mkdir-p finc)
2009 (mkdir-p fex)
2010 ;; Note: When built with --enable-parallel, the 'h5fc' file
2011 ;; doesn't exist, hence this condition.
2012 (when (file-exists? (string-append bin "/h5fc"))
2013 (rename-file (string-append bin "/h5fc")
2014 (string-append fbin "/h5fc")))
2015 (for-each (lambda (file)
2016 (rename-file file
2017 (string-append flib "/" (basename file))))
2018 (find-files lib ".*fortran.*"))
2019 (for-each (lambda (file)
2020 (rename-file file
2021 (string-append finc "/" (basename file))))
2022 (find-files inc ".*mod"))
2023 (for-each (lambda (file)
2024 (rename-file file
2025 (string-append fex "/" (basename file))))
2026 (find-files ex ".*"))
2027 (delete-file-recursively ex)))))))
2028 (home-page "https://www.hdfgroup.org")
2029 (synopsis "Management suite for extremely large and complex data")
2030 (description "HDF5 is a suite that makes possible the management of
2031extremely large and complex data collections.")
2032 (license (license:x11-style
2033 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
2034
2035(define-public hdf5-1.10
2036 (package
2037 (inherit hdf5-1.8)
2038 (version "1.10.9")
2039 (source
2040 (origin
2041 (method url-fetch)
2042 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
2043 "hdf5-" (version-major+minor version)
2044 "/hdf5-" version "/src/hdf5-"
2045 version ".tar.bz2")
2046 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
2047 "current"
2048 (apply string-append
2049 (take (string-split version #\.) 2))
2050 "/src/hdf5-" version ".tar.bz2")))
2051 (sha256
2052 (base32 "14gih7kmjx4h3lc7pg4fwcl28hf1qqkf2x7rljpxqvzkjrqbxi00"))
2053 (patches (search-patches "hdf5-config-date.patch"))))))
2054
2055(define-public hdf5
2056 (package
2057 (name "hdf5")
2058 (version "1.14.6")
2059 (outputs '("out" "doc"))
2060 (source
2061 (origin
2062 (method git-fetch)
2063 (uri (git-reference
2064 (url "https://github.com/HDFGroup/hdf5")
2065 (commit (string-append "hdf5_" version))))
2066 (file-name (git-file-name name version))
2067 (sha256
2068 (base32
2069 "1f7yv0xra465c3qy8c79fzddib653wzj5dsakb0bs02nwp3xm54q"))
2070 (modules '((guix build utils)))
2071 (snippet
2072 '(for-each
2073 delete-file
2074 (append
2075 (find-files "." "Makefile\\.in$")
2076 (find-files "java/lib" "\\.jar$")
2077 (list "aclocal.m4"
2078 "bin/compile"
2079 "bin/config.guess"
2080 "bin/config.sub"
2081 "bin/depcomp"
2082 "bin/install-sh"
2083 "bin/ltmain.sh"
2084 "bin/missing"
2085 "bin/test-driver"
2086 "configure"
2087 "HDF5Examples/aclocal.m4"
2088 "HDF5Examples/compile"
2089 "HDF5Examples/configure"
2090 "HDF5Examples/depcomp"
2091 "HDF5Examples/missing"
2092 "HDF5Examples/test-driver"
2093 "hl/src/H5LTanalyze.c"
2094 "hl/src/H5LTparse.c"
2095 "hl/src/H5LTparse.h"
2096 "hl/tools/gif2h5/testfiles/ex_image2.h5"
2097 "hl/tools/gif2h5/testfiles/h52giftst.h5"
2098 "m4/ax_prog_doxygen.m4"
2099 "m4/libtool.m4"
2100 "m4/lt~obsolete.m4"
2101 "m4/ltoptions.m4"
2102 "m4/ltsugar.m4"
2103 "m4/ltversion.m4"
2104 "src/H5config.h.in"
2105 "src/H5Edefin.h"
2106 "src/H5Einit.h"
2107 "src/H5Epubgen.h"
2108 "src/H5Eterm.h"
2109 "src/H5overflow.h"
2110 "src/H5version.h"))))))
2111 (build-system cmake-build-system)
2112 (arguments
2113 (list
2114 ;; Some of the users, notably Flann, need the C++ interface.
2115 #:configure-flags
2116 #~(list
2117 "-DBUILD_STATIC_LIBS=OFF"
2118 "-DHDF5_INSTALL_CMAKE_DIR=lib/cmake"
2119 "-DHDF5_BUILD_CPP_LIB=ON"
2120 "-DHDF5_BUILD_FORTRAN=ON"
2121 ;; Build a thread-safe library. Unfortunately, CMakeLists.txt
2122 ;; invites you to either turn off C++, Fortran, and the high-level
2123 ;; interface (HL), or to enable 'ALLOW_UNSUPPORTED'. Debian
2124 ;; packagers chose to pass '--enable-unsupported' to the 'configure'
2125 ;; script and we follow their lead here.
2126 "-DHDF5_ENABLE_THREADSAFE=ON"
2127 "-DALLOW_UNSUPPORTED=ON"
2128 "-DHDF5_BUILD_DOC=ON")
2129 #:phases
2130 #~(modify-phases %standard-phases
2131 ;; XXX: src/H5private.h includes <fenv.h> and fails to find the
2132 ;; stdlib types when the gfortran header is used. Remove gfortran
2133 ;; from CPLUS_INCLUDE_PATH as a workaround.
2134 (add-after 'set-paths 'hide-gfortran
2135 (lambda _
2136 (let ((gfortran #$(this-package-native-input "gfortran")))
2137 (setenv "CPLUS_INCLUDE_PATH"
2138 (string-join
2139 (delete (string-append gfortran "/include/c++")
2140 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
2141 ":")))))
2142 (add-after 'unpack 'make-gen-deterministic
2143 (lambda _
2144 (substitute* "bin/make_err"
2145 (("keys %major" all)
2146 (string-append "sort " all))
2147 (("while.*each \\(%section\\).*")
2148 (string-append
2149 "foreach $sect_name (sort keys %section) {\n"
2150 " $sect_desc = $section{$sect_name};\n")))))
2151 (add-after 'unpack 'generate-flexbison
2152 (lambda _
2153 (invoke "bash" "bin/genparser" "hl/src")))
2154 (add-after 'unpack 'patch-trace-shebang
2155 (lambda _
2156 (for-each patch-shebang
2157 (find-files "bin" (lambda (file stat)
2158 (executable-file? file))))))
2159 ;; This is a known issue on i686, see
2160 ;; https://github.com/HDFGroup/hdf5/issues/4926
2161 (add-after 'unpack 'fix-fortran-i686-test
2162 (lambda _
2163 (substitute* "fortran/test/tH5R.F90"
2164 (((string-append
2165 "CALL h5rget_obj_name_f\\(C_LOC\\(ref_ptr\\(2\\)\\),"
2166 " \"\", error, name_len=buf_size \\)"))
2167 (string-append
2168 "CALL h5rget_obj_name_f(C_LOC(ref_ptr(2)),"
2169 " \"xxxxxxxxxxxxxx\", error, name_len=buf_size)")))))
2170 (add-after 'unpack 'generate-headers
2171 (lambda _
2172 (invoke "perl" "bin/make_err" "src/H5err.txt")
2173 (invoke "perl" "bin/make_vers" "src/H5vers.txt")
2174 (invoke "perl" "bin/make_overflow" "src/H5overflow.txt")))
2175 ;; Remove references to GCC/GFortran/binutils in order to decrease
2176 ;; package size.
2177 (add-before 'generate-headers 'remove-referencess
2178 (lambda _
2179 (substitute* '("src/libhdf5.settings.cmake.in"
2180 "src/H5build_settings.cmake.c.in")
2181 (("@CMAKE_AR@") "ar")
2182 (("@CMAKE_RANLIB@") "ranlib")
2183 (("@CMAKE_C_COMPILER@") "gcc")
2184 (("@CMAKE_CXX_COMPILER") "g++")
2185 (("@CMAKE_Fortran_COMPILER@") "gfortran"))
2186 (substitute* '("src/libhdf5.settings.autotools.in"
2187 "src/H5build_settings.autotools.c.in")
2188 (("@AR@") "ar")
2189 (("@RANLIB@") "ranlib")
2190 (("@CXX_VERSION@") "g++")
2191 (("@@CC_VERSION@") "gcc")
2192 (("@FC_VERSION@") "gfortran"))))
2193 (add-after 'install 'remove-gcc-references
2194 (lambda _
2195 (substitute* (map (lambda (f)
2196 (string-append #$output "/" f))
2197 '("bin/h5hlcc"
2198 "bin/h5hlc++"
2199 "bin/h5cc"
2200 "bin/h5c++"))
2201 (("/gnu/store/[a-z0-9]*-gcc-[0-9.]*/bin/")
2202 ""))))
2203 (add-after 'install 'remove-gfortran-references
2204 (lambda _
2205 (substitute* (map (lambda (f)
2206 (string-append #$output "/" f))
2207 '("bin/h5hlfc"
2208 "bin/h5fc"))
2209 (("/gnu/store/[a-z0-9]*-gfortran-[0-9.]*/bin/")
2210 ""))))
2211 (add-after 'install 'move-html-documentation
2212 (lambda _
2213 (mkdir-p (string-append #$output:doc "/share"))
2214 (rename-file (string-append #$output "/share/html")
2215 (string-append #$output:doc "/share/html")))))))
2216 (inputs (list libaec zlib))
2217 (native-inputs
2218 (list bison
2219 doxygen
2220 flex
2221 gfortran
2222 graphviz
2223 ;; Needed to generate some headers and for tests
2224 perl
2225 which))
2226 (home-page "https://www.hdfgroup.org")
2227 (synopsis "Management suite for extremely large and complex data")
2228 (description "HDF5 is a suite that makes possible the management of
2229extremely large and complex data collections.")
2230 (license (license:x11-style
2231 "https://support.hdfgroup.org/ftp/HDF5/releases/COPYING.html"))))
2232
2233(define-public hdf5-java
2234 (package
2235 (name "hdf5-java")
2236 (version (package-version hdf5))
2237 (source (package-source hdf5))
2238 (build-system cmake-build-system)
2239 (arguments
2240 (list
2241 #:configure-flags
2242 #~(list "-DHDF5_BUILD_JAVA=ON"
2243 "-DHDF5_BUILD_TOOLS=OFF")
2244 #:modules
2245 '((guix build cmake-build-system)
2246 ((guix build ant-build-system) #:prefix ant:)
2247 (guix build utils))
2248 #:imported-modules
2249 `((guix build ant-build-system)
2250 ,@%cmake-build-system-modules)
2251 #:phases
2252 #~(modify-phases %standard-phases
2253 (add-after 'unpack 'unbundle
2254 (lambda* (#:key inputs #:allow-other-keys)
2255 (let ((simple
2256 (search-input-file
2257 inputs "/lib/m2/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar"))
2258 (api
2259 (search-input-file
2260 inputs "/lib/m2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"))
2261 (nop
2262 (search-input-file
2263 inputs "/lib/m2/org/slf4j/slf4j-nop/1.7.25/slf4j-nop-1.7.25.jar"))
2264 (junit
2265 (search-input-file
2266 inputs "/lib/m2/junit/junit/4.12/junit-4.12.jar"))
2267 (hamcrest
2268 (search-input-file
2269 inputs "/lib/m2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar")))
2270 (substitute* "CMakeLists.txt"
2271 (("(set *\\(HDF5_JAVA_LOGGING_JAR ).*" _ orig)
2272 (string-append orig api ")\n"))
2273 (("(set *\\(HDF5_JAVA_LOGGING_NOP_JAR ).*" _ orig)
2274 (string-append orig nop ")\n"))
2275 (("(set *\\(HDF5_JAVA_LOGGING_SIMPLE_JAR ).*" _ orig)
2276 (string-append orig simple ")\n")))
2277 ;; Do not install copies of external libraries
2278 (substitute* "java/CMakeLists.txt"
2279 ((".*HDF5_JAVA_LOGGING.*_JAR.*") ""))
2280 (substitute* "java/test/CMakeLists.txt"
2281 (("\\$\\{HDF5_JAVA_LIB_DIR\\}/junit\\.jar")
2282 junit)
2283 (("\\$\\{HDF5_JAVA_LIB_DIR\\}/hamcrest-core\\.jar")
2284 hamcrest))
2285 (substitute* '("java/test/junit.sh.in"
2286 "HDF5Examples/JAVA/H5D/JavaDatasetExample.sh.in"
2287 "HDF5Examples/JAVA/H5G/JavaGroupExample.sh.in"
2288 "HDF5Examples/JAVA/H5T/JavaDatatypeExample.sh.in"
2289 "HDF5Examples/JAVA/TUTR/runExample.sh.in")
2290 (("^LIST_JAR_TESTFILES=\"" m)
2291 (string-append m hamcrest "\n"
2292 junit "\n"
2293 api "\n"
2294 simple "\n"))
2295 (("^\\$HDFLIB_HOME/.*") "")
2296 (("\"\\$BLDLIBDIR\"/junit.jar")
2297 junit)
2298 (("\"\\$BLDLIBDIR\"/hamcrest-core.jar")
2299 hamcrest)
2300 (("\"\\$BLDLIBDIR\"/slf4j-api-2.0.6.jar")
2301 api)
2302 (("\"\\$BLDLIBDIR\"/slf4j-simple-2.0.6.jar")
2303 simple)
2304 (("/usr/bin/test")
2305 (search-input-file inputs "/bin/test"))
2306 (("/usr/bin/uname")
2307 (search-input-file inputs "/bin/uname")))
2308 (substitute* (find-files "java/test/testfiles/" ".*\\.txt$")
2309 (("JUnit version 4.13.2")
2310 "JUnit version 4.12-SNAPSHOT")))))
2311 (add-after 'unpack 'patch-trace-shebang
2312 (lambda _
2313 (for-each patch-shebang
2314 (find-files "bin" (lambda (file stat)
2315 (executable-file? file))))))
2316 (add-after 'unpack 'generate-flexbison
2317 (lambda _
2318 (invoke "bash" "bin/genparser" "hl/src")))
2319 (add-after 'unpack 'generate-headers
2320 (lambda _
2321 (invoke "perl" "bin/make_err" "src/H5err.txt")
2322 (invoke "perl" "bin/make_vers" "src/H5vers.txt")
2323 (invoke "perl" "bin/make_overflow" "src/H5overflow.txt")))
2324 (add-after 'install 'strip-jar-timestamps
2325 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))
2326 (native-inputs
2327 (modify-inputs (package-native-inputs hdf5)
2328 (prepend `(,icedtea "jdk"))
2329 (prepend java-hamcrest-core)
2330 (prepend java-junit)
2331 (prepend java-slf4j-nop)
2332 (prepend java-slf4j-simple)
2333 (prepend (@ (gnu packages compression) zip))
2334 (delete "gfortran")))
2335 (inputs
2336 (list java-slf4j-api
2337 libjpeg-turbo
2338 zlib))
2339 (home-page "https://www.hdfgroup.org")
2340 (synopsis "Java interface for the HDF5 library")
2341 (description "The Java HDF5 Interface (JHI5) uses the Java Native
2342Interface to wrap the HDF5 library, which is implemented in C.")
2343 (license (package-license hdf5))))
2344
2345(define-public hdf5-parallel-openmpi
2346 (package/inherit hdf5
2347 (name "hdf5-parallel-openmpi")
2348 (inputs (modify-inputs inputs
2349 (prepend openmpi)))
2350 (arguments
2351 (substitute-keyword-arguments arguments
2352 ((#:configure-flags flags '())
2353 #~(append (filter (lambda (flag)
2354 (not
2355 (or (string-prefix? "-DHDF5_ENABLE_THREADSAFE" flag)
2356 (string-prefix? "-DHDF5_BUILD_CPP_LIB" flag)
2357 (string-prefix? "-DALLOW_UNSUPPORTED" flag))))
2358 #$flags)
2359 (list "-DBUILD_SHARED_LIBS=ON"
2360 "-DHDF5_BUILD_CPP_LIB=OFF"
2361 "-DHDF5_ENABLE_PARALLEL=ON"
2362 "-DHDF5_ENABLE_THREADSAFE=OFF")))
2363 ((#:phases phases)
2364 #~(modify-phases #$phases
2365 (add-after 'build 'mpi-setup
2366 #$%openmpi-setup)
2367 (add-after 'unpack 'skip-sloppy-tests
2368 (lambda _
2369 ;; XXX: The three tests below often fail for no clear reason
2370 ;; (timeout or actual failure). Comment them out (there's one
2371 ;; test per line in this file).
2372 (substitute* "testpar/CMakeLists.txt"
2373 (("(t_pmulti_dset|t_shapesame|t_filters_parallel)" _ test)
2374 (string-append "# " test "\n")))))
2375 (replace 'remove-gcc-references
2376 (lambda _
2377 (substitute* (map (lambda (f)
2378 (string-append #$output "/" f))
2379 '("bin/h5hlcc"
2380 "bin/h5cc"))
2381 (("/gnu/store/[a-z0-9]*-gcc-[0-9.]*/bin/")
2382 ""))))))))
2383 (propagated-inputs
2384 (list openmpi))
2385 (synopsis "Management suite for data with parallel IO support")))
2386
2387(define-public hdf5-blosc
2388 (package
2389 (name "hdf5-blosc")
2390 (version "1.0.1")
2391 (source
2392 (origin
2393 (method git-fetch)
2394 (uri (git-reference
2395 (url "https://github.com/Blosc/hdf5-blosc")
2396 (commit (string-append "v" version))))
2397 (file-name (git-file-name name version))
2398 (sha256
2399 (base32 "0kq09w2mz8i735p3zfnsdqdvay0086ls0cb621ckfxq42pr3gkm4"))))
2400 (build-system cmake-build-system)
2401 (arguments
2402 `(#:configure-flags
2403 (list (string-append "-DBLOSC_INSTALL_DIR="
2404 (assoc-ref %build-inputs "c-blosc"))
2405 (string-append "-DPLUGIN_INSTALL_PATH="
2406 (assoc-ref %outputs "out")
2407 "/hdf5/lib/plugin"))
2408 #:phases
2409 (modify-phases %standard-phases
2410 (add-after 'unpack 'do-not-build-blosc
2411 (lambda _
2412 (substitute* "CMakeLists.txt"
2413 (("set\\(BLOSC_INSTALL_DIR.*") "")
2414 (("ExternalProject_Add\\(project_blosc") "message("))
2415 #t)))))
2416 (inputs
2417 (list c-blosc hdf5))
2418 (home-page "https://github.com/Blosc/hdf5-blosc")
2419 (synopsis "Filter for HDF5 using the Blosc compressor")
2420 (description "This is a filter for HDF5 that uses the Blosc compressor; by
2421installing this filter, you can read and write HDF5 files with
2422Blosc-compressed datasets.")
2423 (license license:expat)))
2424
2425(define-public hdf5-blosc-parallel-openmpi
2426 (package/inherit hdf5-blosc
2427 (name "hdf5-blosc-parallel-openmpi")
2428 (inputs
2429 (list c-blosc hdf5-parallel-openmpi))
2430 (synopsis "HDF5-Blosc with parallel IO support")))
2431
2432(define-public highfive
2433 (package
2434 (name "highfive")
2435 (version "2.10.1")
2436 (source
2437 (origin
2438 (method git-fetch)
2439 (uri (git-reference
2440 (url "https://github.com/BlueBrain/HighFive")
2441 (commit (string-append "v" version))))
2442 (file-name (git-file-name name version))
2443 (sha256
2444 (base32 "1yp9bah6prhy31p2xbj4yv7p0p1k0ifjhb0z9i36ki3zx5nsgzrn"))))
2445 (build-system cmake-build-system)
2446 (arguments
2447 (list
2448 #:configure-flags
2449 #~(list "-DHIGHFIVE_EXAMPLES=OFF"
2450 ;; TODO: maybe build with hdf5-parallel-openmpi
2451 ;; "-DHIGHFIVE_PARALLEL_HDF5=ON"
2452 "-DHIGHFIVE_UNIT_TESTS=ON"
2453 "-GNinja")))
2454 (native-inputs
2455 (list boost-1.83
2456 catch2
2457 ninja))
2458 (inputs
2459 (list hdf5))
2460 (home-page "https://bluebrain.github.io/HighFive/")
2461 (synopsis "Header-only C++ HDF5 interface")
2462 (description
2463 "HighFive is a header-only C++11 friendly interface for @code{libhdf5}.
2464 It supports STL vector/string, @code{Boost::UBLAS}, @code{Boost::Multi-array}
2465and Xtensor; and handles C++ from/to HDF5 with automatic type
2466mapping. HighFive does not require additional libraries.")
2467 ;; Boost Software License (BSL) - Version 1.0 - August 17th, 2003
2468 (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
2469 "Some components have other similar licences."))))
2470
2471(define-public itex2mml
2472 (package
2473 (name "itex2mml")
2474 (version "1.6.1")
2475 (source (origin
2476 (method url-fetch)
2477 (uri (string-append "https://golem.ph.utexas.edu"
2478 "/~distler/blog/files/itexToMML-"
2479 version
2480 ".tar.gz"))
2481 (sha256
2482 (base32
2483 "0pz51c0hfh2mg8xli0wj7hf92s3b7yf5r4114g8z8722lcm5gwiy"))
2484 (snippet
2485 #~(begin
2486 (use-modules (guix build utils))
2487 (delete-file-recursively "itex-binaries")))))
2488 (build-system gnu-build-system)
2489 (native-inputs
2490 (list bison
2491 flex))
2492 (arguments
2493 (list
2494 #:make-flags #~(list (string-append "BINDIR=" #$output "/bin/")
2495 (string-append "CC=" #$(cc-for-target)))
2496 #:tests? #f ;; there are none
2497 #:phases
2498 #~(modify-phases %standard-phases
2499 (delete 'configure)
2500 (add-before 'build 'chdir
2501 (lambda args
2502 (chdir "itex-src")))
2503 (add-before 'install 'make-bindir
2504 (lambda args
2505 (mkdir-p (string-append #$output "/bin"))))
2506 (add-after 'install 'install-doc
2507 (lambda* (#:key outputs #:allow-other-keys)
2508 (let* ((doc-prefix (or (assoc-ref outputs "doc")
2509 #$output))
2510 (itex2mml+version (strip-store-file-name #$output))
2511 (doc-dir (string-append doc-prefix
2512 "/share/doc/"
2513 itex2mml+version)))
2514 (install-file "../README" doc-dir)))))))
2515 (home-page "https://golem.ph.utexas.edu/~distler/blog/itex2MML.html")
2516 (synopsis "LaTeX to XHTML/MathML converter")
2517 (description
2518 "The @command{itex2MML} utility is a stream filter. It takes text with
2519embedded itex equations, converts the itex equations to MathML, and outputs
2520the resulting text.")
2521 (license (list license:lgpl2.0+ license:gpl2+ license:mpl1.1))))
2522
2523(define-public itpp
2524 (package
2525 (name "itpp")
2526 (version "4.3.1")
2527 (source (origin
2528 (method url-fetch)
2529 (uri (string-append "mirror://sourceforge/itpp/itpp/"
2530 version "/itpp-"
2531 version ".tar.gz"))
2532 (sha256
2533 (base32
2534 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
2535 (build-system cmake-build-system)
2536 (arguments
2537 (list
2538 #:tests? #f ; Tests require googletest *sources*
2539 #:phases
2540 #~(modify-phases %standard-phases
2541 (add-after 'install 'delete-formulas-log
2542 ;; Contains date and timing information which is unreproducible,
2543 ;; and should not be needed when using the package
2544 (lambda _
2545 (delete-file
2546 (string-append #$output "/share/doc/itpp/html/_formulas.log"))))
2547 (add-after 'unpack 'set-man-page-date
2548 (lambda _
2549 (substitute* "itpp-config.1.cmake.in"
2550 ((".PACKAGE_DATE.") "2012-04-18"))))
2551 (add-before 'build 'set-force-source-date
2552 ;; for reproducible dates, texlive needs this to respect respect
2553 ;; SOURCE_DATE_EPOCH
2554 (lambda _
2555 (setenv "FORCE_SOURCE_DATE" "1"))))))
2556 (inputs (list fftw lapack openblas))
2557 ;; FIXME: Even though the fonts are available dvips complains:
2558 ;; "Font cmmi10 not found; characters will be left blank."
2559 (native-inputs (list (texlive-local-tree) ghostscript doxygen))
2560 (home-page "https://itpp.sourceforge.net")
2561 (synopsis "C++ library of maths, signal processing and communication classes")
2562 (description "IT++ is a C++ library of mathematical, signal processing and
2563communication classes and functions. Its main use is in simulation of
2564communication systems and for performing research in the area of
2565communications. The kernel of the library consists of generic vector and
2566matrix classes, and a set of accompanying routines. Such a kernel makes IT++
2567similar to MATLAB, GNU Octave or SciPy.")
2568 (license license:gpl3+)))
2569
2570(define-public netcdf
2571 (package
2572 (name "netcdf")
2573 (version "4.9.2")
2574 (source
2575 (origin
2576 (method url-fetch)
2577 (uri (string-append
2578 "https://downloads.unidata.ucar.edu/netcdf-c/" version
2579 "/netcdf-c-" version ".tar.gz"))
2580 (sha256
2581 (base32
2582 "0j3c3amzvsd8bd52dqgqa8gkgl7n36qf0yahyl4kz5mrpnxvl4fg"))
2583 (modules '((guix build utils)))
2584 (snippet
2585 ;; Make sure this variable is defined only once. Failing to do so
2586 ;; would break builds of 'netcdf-parallel-openmpi' with a
2587 ;; multiple-definition link error with GCC 10.
2588 '(substitute* "ncdump/ocprint.c"
2589 (("^int ocdebug") "static int ocdebug")))
2590 (patches (search-patches "netcdf-date-time.patch"))))
2591 (build-system gnu-build-system)
2592 (native-inputs
2593 (list doxygen
2594 graphviz
2595 m4
2596 unzip))
2597 (inputs
2598 (list curl
2599 bzip2
2600 hdf5
2601 libaec
2602 libjpeg-turbo
2603 libxml2
2604 zlib
2605 zstd))
2606 (arguments
2607 (list #:configure-flags
2608 #~(list "--disable-dap-remote-tests"
2609 ;; XXX: ... docs/internal.md' does not exist
2610 ;; "--enable-doxygen"
2611 "--enable-dot"
2612 "--enable-netcdf-4"
2613 #$@(if (or (target-x86-32?) (target-arm32?))
2614 '("CFLAGS=-Wno-error=incompatible-pointer-types")
2615 '())
2616 (string-append "--with-plugin-dir=" #$output "/lib/hdf5-plugins"))
2617 #:phases
2618 #~(modify-phases %standard-phases
2619 (add-after 'unpack 'fix-tests
2620 (lambda* (#:key inputs #:allow-other-keys)
2621 ;; Network access is required for these tests.
2622 (substitute* (list "ncdap_test/Makefile.am"
2623 "ncdap_test/Makefile.in")
2624 (("testurl.sh") ""))
2625 (substitute* "nczarr_test/Makefile.in"
2626 (("/bin/bash")
2627 (search-input-file inputs "bin/bash")))
2628 ;; This test fails on 32 bit platforms.
2629 #$@(if (or (target-x86-32?) (target-arm32?))
2630 '((substitute* '("ncdump/tst_netcdf4_4.sh"
2631 "ncdump/tst_nccopy4.sh")
2632 (("#!/bin/sh" m) (string-append m "\nexit 0\n")))
2633 (substitute* "ncdump/Makefile.in"
2634 (("tst_netcdf4_4.log") "")))
2635 '())))
2636 (add-before 'configure 'fix-source-date
2637 (lambda _
2638 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
2639 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
2640 ;; to '1st hour of the current day', and therefore makes the
2641 ;; package not reproducible.
2642 (substitute* "./configure"
2643 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
2644 "date --date='@0'"))))
2645 (add-after 'configure 'patch-settings
2646 (lambda _
2647 ;; libnetcdf.settings contains the full filename of the compilers
2648 ;; used to build the library. We truncate the hashes of those
2649 ;; filenames to avoid unnecessary references to the corresponding
2650 ;; store items.
2651 (substitute* "libnetcdf.settings"
2652 (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
2653 (string-append prefix
2654 (string-take hash 10) "...")))))
2655 (add-before 'check 'fix-test-rcmerge
2656 (lambda _
2657 ;; Set HOME, to fix the test-rcmerge test.
2658 (setenv "HOME" "/tmp"))))
2659
2660 #:parallel-tests? #f)) ;various race conditions
2661 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
2662 (synopsis "Library for scientific data")
2663 (description "NetCDF is an interface for scientific data access and a
2664software library that provides an implementation of the interface. The netCDF
2665library defines a machine-independent format for representing scientific data.
2666Together, the interface, library, and format support the creation, access, and
2667sharing of scientific data.")
2668 (license (license:x11-style "file://COPYRIGHT"))))
2669
2670(define-public netcdf-parallel-openmpi
2671 (package/inherit netcdf
2672 (name "netcdf-parallel-openmpi")
2673 (inputs (modify-inputs inputs
2674 (append openmpi pnetcdf)
2675 (replace "hdf5" hdf5-parallel-openmpi)))
2676 ;; TODO: Replace pkg-config references in nc-config with absolute references
2677 (arguments
2678 (substitute-keyword-arguments arguments
2679 ((#:configure-flags flags)
2680 #~(cons* "CC=mpicc"
2681 "CXX=mpicxx"
2682 "--enable-parallel-tests"
2683 ;; Enable support of CDF-1, 2 and 5 formats.
2684 "--enable-pnetcdf"
2685 ;; NetCDF supports both parallel and shared library building
2686 ;; See https://docs.unidata.ucar.edu/nug/current/getting_and_building_netcdf.html#build_parallel
2687 "--enable-shared"
2688 "--with-pic"
2689 #$flags))
2690 ((#:phases phases #~%standard-phases)
2691 #~(modify-phases #$phases
2692 (add-after 'build 'mpi-setup
2693 #$%openmpi-setup)))))))
2694
2695(define-public netcdf-fortran
2696 (package
2697 (name "netcdf-fortran")
2698 (version "4.5.3")
2699 (source (origin
2700 (method url-fetch)
2701 (uri (string-append
2702 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
2703 version ".tar.gz"))
2704 (sha256
2705 (base32
2706 "0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
2707 (build-system gnu-build-system)
2708 (arguments
2709 `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
2710 "FFLAGS=-fallow-argument-mismatch")
2711 #:parallel-tests? #f))
2712 (inputs
2713 (list libaec hdf5 netcdf))
2714 (native-inputs
2715 (list gfortran))
2716 (synopsis "Fortran interface for the netCDF library")
2717 (description (package-description netcdf))
2718 (home-page (package-home-page netcdf))
2719 (license (package-license netcdf))))
2720
2721(define-public netcdf-cxx4
2722 (package
2723 (name "netcdf-cxx4")
2724 (version "4.3.1")
2725 (source
2726 (origin
2727 (method git-fetch)
2728 (uri (git-reference
2729 (url "https://github.com/Unidata/netcdf-cxx4")
2730 (commit (string-append "v" version))))
2731 (file-name (git-file-name name version))
2732 (sha256
2733 (base32 "05kydd5z9iil5iv4fp7l11cicda5n5lsg5sdmsmc55xpspnsg7hr"))))
2734 (build-system cmake-build-system)
2735 (arguments
2736 `(#:phases (modify-phases %standard-phases
2737 (add-before 'configure 'patch-configure
2738 (lambda _
2739 (substitute* "libnetcdf-cxx.settings.in"
2740 ;; Don't record the build-time host, time and gcc path to make the
2741 ;; settings file reproducible.
2742 (("@CONFIG_DATE@")
2743 "Not set (Guix build)")
2744 (("@host_cpu@-@host_vendor@-@host_os@")
2745 "Linux")
2746 (("@CC_VERSION@")
2747 "gcc"))
2748 ;; The filter tests fail with 'Caught unexpected exception'.
2749 (substitute* "cxx4/CMakeLists.txt"
2750 (("add_bin_test\\(cxx4 test_filter\\)")
2751 ""))
2752 (substitute* "examples/CMakeLists.txt"
2753 (("add_sh_test\\(examples tst_filter\\)")
2754 ""))))
2755 (add-after 'install 'clear-reference-to-compiler
2756 (lambda* (#:key inputs outputs #:allow-other-keys)
2757 ;; Do not retain a reference to GCC and other build only inputs.
2758 (let ((out (assoc-ref outputs "out")))
2759 (substitute* (string-append out "/bin/ncxx4-config")
2760 (("cc=([[:graph:]]+)/bin/gcc")
2761 "cc=\"gcc")
2762 (("cxx=([[:graph:]]+)/bin/c\\+\\+")
2763 "cxx=\"c++"))))))
2764 #:configure-flags (list (string-append "-DHDF5_C_LIBRARY_hdf5="
2765 (search-input-file
2766 %build-inputs
2767 "/lib/libhdf5.so")))))
2768 (inputs (list hdf5))
2769 (propagated-inputs (list netcdf)) ;include/netcdf includes netcdf.h
2770 (home-page "https://github.com/Unidata/netcdf-cxx4")
2771 (synopsis "NetCDF C++ interface")
2772 (description
2773 "This package provides a C++ interface to the NetCDF library for
2774scientific data storage.")
2775 (license license:bsd-3)))
2776
2777(define-public netcdf-cxx4-parallel-openmpi
2778 (package
2779 (inherit netcdf-cxx4)
2780 (name "netcdf-cxx4-parallel-openmpi")
2781 (synopsis "NetCDF C++ interface (with MPI support)")
2782 (inputs (modify-inputs inputs
2783 (replace "hdf5" hdf5-parallel-openmpi)))
2784 (propagated-inputs (modify-inputs propagated-inputs
2785 (replace "netcdf" netcdf-parallel-openmpi)))))
2786
2787(define-public n2p2
2788 (package
2789 (name "n2p2")
2790 (version "2.3.0")
2791 (source (origin
2792 (method git-fetch)
2793 (uri (git-reference
2794 (url "https://github.com/CompPhysVienna/n2p2")
2795 (commit (string-append "v" version))))
2796 (file-name (git-file-name name version))
2797 (sha256
2798 (base32
2799 "01090j477gh9zk7wj416fvv1hxdnnxwhzy67bn96a04zhnayzkkj"))))
2800 (build-system gnu-build-system)
2801 (arguments
2802 `(#:make-flags '("MODE=shared" "-C" "src")
2803 #:phases
2804 (modify-phases %standard-phases
2805 (add-after 'unpack 'post-unpack
2806 (lambda* (#:key inputs #:allow-other-keys)
2807 (substitute* "src/makefile"
2808 (("shell") "bash"))
2809 (substitute* "src/makefile.gnu"
2810 (("PROJECT_EIGEN=/usr/include/eigen3")
2811 (string-append "PROJECT_EIGEN="
2812 (assoc-ref inputs "eigen") "/include/eigen3")))
2813 (substitute* "src/makefile.gnu"
2814 (("-lblas")
2815 (string-append "-L" (assoc-ref inputs "openblas")
2816 "/lib -lopenblas"))
2817 (("-march=native")
2818 ""))
2819 (substitute* "src/application/makefile"
2820 (("LDFLAGS=")
2821 "LDFLAGS=-Wl,-rpath='$$ORIGIN/../lib' "))))
2822 (delete 'configure)
2823 (delete 'check)
2824 (replace 'install
2825 (lambda* (#:key outputs #:allow-other-keys)
2826 (let* ((out (assoc-ref outputs "out"))
2827 (bindir (string-append out "/bin"))
2828 (libdir (string-append out "/lib"))
2829 (incdir (string-append out "/include")))
2830 (for-each (lambda (f) (install-file f bindir))
2831 (find-files "bin" "^nnp-"))
2832 (for-each (lambda (f) (install-file f libdir))
2833 (find-files "lib" "."))
2834 (for-each (lambda (f) (install-file f incdir))
2835 (find-files "include" "\\.h$"))))))))
2836 (inputs
2837 (list openmpi gsl openblas eigen))
2838 (synopsis "Neural network potentials for chemistry and physics")
2839 (description "This package contains software that will allow you to use
2840existing neural network potential parameterizations to predict energies and
2841forces (with standalone tools but also in conjunction with the MD software
2842LAMMPS). In addition it is possible to train new neural network potentials
2843with the provided training tools.")
2844 (home-page "https://compphysvienna.github.io/n2p2/")
2845 (properties '((tunable? . #t))) ;to benefit from SIMD code in Eigen
2846 (license license:gpl3+)))
2847
2848(define-public nlopt
2849 (package
2850 (name "nlopt")
2851 (version "2.10.0")
2852 (source (origin
2853 (method git-fetch)
2854 (uri (git-reference
2855 (url "https://github.com/stevengj/nlopt/")
2856 (commit (string-append "v" version))))
2857 (file-name (git-file-name name version))
2858 (sha256
2859 (base32 "04257r7a1bjmm6hznf9v6fimz2p93dk745sf89wmxzhg3rh0ak44"))
2860 (patches
2861 (search-patches "nlopt_CMake-Assume-working-c-compiler-597.patch"))))
2862 (build-system cmake-build-system)
2863 (arguments
2864 `(#:configure-flags
2865 (list "-DNLOPT_TESTS=ON")
2866 #:phases
2867 (modify-phases %standard-phases
2868 (add-before 'configure 'set-libnlopt-file-name
2869 (lambda* (#:key outputs #:allow-other-keys)
2870 ;; Make sure the Scheme module refers to the library by its
2871 ;; absolute file name.
2872 (let ((out (assoc-ref outputs "out")))
2873 (substitute* "src/swig/nlopt-guile.i"
2874 (("\"nlopt_guile\"")
2875 (format #f "~s"
2876 `(format #f "~anlopt_guile"
2877 (if (getenv "NLOPT_UNINSTALLED")
2878 ""
2879 ,(format #f "~a/lib/guile/3.0/extensions/" out))))))
2880 (setenv "NLOPT_UNINSTALLED" "1")))))))
2881 (inputs (list guile-3.0 octave-cli))
2882 (native-inputs (list pkg-config python python-numpy swig-4.0))
2883 (home-page "http://ab-initio.mit.edu/wiki/")
2884 (synopsis "Library for nonlinear optimization")
2885 (description "NLopt is a library for nonlinear optimization, providing a
2886common interface for a number of different free optimization routines available
2887online as well as original implementations of various other algorithms.")
2888 (license license:lgpl2.1+)))
2889
2890(define-public ipopt
2891 (package
2892 (name "ipopt")
2893 (version "3.13.4")
2894 (source (origin
2895 (method git-fetch)
2896 (uri (git-reference
2897 (url "https://github.com/coin-or/Ipopt")
2898 (commit (string-append "releases/" version))))
2899 (file-name (git-file-name name version))
2900 (sha256
2901 (base32
2902 "08gznhwhqv1x4baksz350ih8q16r5rd0k8vals6078m3h94khr4b"))))
2903 (build-system gnu-build-system)
2904 (arguments
2905 '(#:configure-flags (list "--with-lapack=-lopenblas")
2906 #:phases (modify-phases %standard-phases
2907 (add-after 'install 'add--L-flags-in-ipopt.pc
2908 (lambda* (#:key inputs outputs #:allow-other-keys)
2909 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
2910 ;; move it to "Libs.private" where it belongs, and add a
2911 ;; '-L' flag for LAPACK.
2912 (let ((out (assoc-ref outputs "out"))
2913 (lapack (assoc-ref inputs "lapack")))
2914 (substitute* (string-append out "/lib/pkgconfig/"
2915 "ipopt.pc")
2916 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
2917 (string-append "Libs: " before " " after "\n"
2918 "Libs.private: " before
2919 "-L" openblas "/lib -lopenblas"
2920 after "\n")))
2921 #t))))))
2922 (native-inputs
2923 (list gfortran pkg-config))
2924 (inputs
2925 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
2926 (list openblas)) ;for both libblas and liblapack
2927 (home-page "https://www.coin-or.org")
2928 (synopsis "Large-scale nonlinear optimizer")
2929 (description
2930 "The Interior Point Optimizer (IPOPT) is a software package for
2931large-scale nonlinear optimization. It provides C++, C, and Fortran
2932interfaces.")
2933 (license license:epl2.0)))
2934
2935(define-public nomad-optimizer
2936 (package
2937 (name "nomad-optimizer")
2938 (version "4.3.1")
2939 (source
2940 (origin
2941 (method git-fetch)
2942 (uri (git-reference
2943 (url "https://github.com/bbopt/nomad/")
2944 (commit (string-append "v." version))))
2945 (file-name (git-file-name name version))
2946 (sha256
2947 (base32 "08bxdvx8p5qzdw331xa5irc1896as4q5hajsid7f3qcxjm4nq4v3"))))
2948 (build-system cmake-build-system)
2949 (native-inputs
2950 (list openmpi))
2951 (arguments
2952 (list
2953 ;; Cannot build Python interface because it is incompatible with OpenMP
2954 ;; support, which is enabled by default.
2955 #:configure-flags
2956 #~(list "-DBUILD_TESTS=ON"
2957 "-DBUILD_INTERFACE_C=ON")
2958 #:phases
2959 #~(modify-phases %standard-phases
2960 (add-after 'unpack 'fix-tests
2961 (lambda _
2962 (substitute* "examples/CMakeLists.txt"
2963 ;; This test passes only sometimes.
2964 ;; See https://github.com/bbopt/nomad/issues/72.
2965 (("^ +add_subdirectory\\(\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/advanced/library/PSDMads\\)\n")
2966 ""))
2967 (make-file-writable
2968 "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")
2969 ;; Fix the tests so they run in out-of-source builds.
2970 (substitute*
2971 '("examples/basic/library/COCO/CMakeLists.txt"
2972 "examples/basic/library/example1/CMakeLists.txt"
2973 "examples/basic/library/example2/CMakeLists.txt"
2974 "examples/basic/library/example3/CMakeLists.txt"
2975 "examples/basic/library/example4/CMakeLists.txt"
2976 "examples/basic/library/single_obj_parallel/CMakeLists.txt"
2977 "examples/advanced/library/FixedVariable/CMakeLists.txt"
2978 "examples/advanced/library/NMonly/CMakeLists.txt"
2979 "examples/advanced/library/PSDMads/CMakeLists.txt"
2980 "examples/advanced/library/Restart/CMakeLists.txt"
2981 "examples/advanced/library/Restart_VNS/CMakeLists.txt"
2982 "examples/advanced/library/c_api/example1/CMakeLists.txt"
2983 "examples/advanced/library/c_api/example2/CMakeLists.txt"
2984 "examples/advanced/library/exampleSuggestAndObserve/CMakeLists.txt")
2985 ;; The runExampleTest.sh script is run with WORKING_DIRECTORY
2986 ;; set to CMAKE_CURRENT_SOURCE_DIR.
2987 ;; Other scripts invoked by that script (for example
2988 ;; examples/advanced/batch/SuggestAndObserve/loopSuggestAndObserve.sh)
2989 ;; are in that same directory, but compiled examples are
2990 ;; located in CMAKE_CURRENT_BINARY_DIR.
2991 (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
2992 _ command test)
2993 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
2994 (let ((builddir (string-append (getcwd) "/../build")))
2995 (let ((dir "examples/advanced/library/FixedVariable"))
2996 (substitute* (string-append dir "/fixedVariable.cpp")
2997 (("^( +std::string sExe = ).*" _ prefix)
2998 (string-append prefix "\"" builddir "/" dir "/ufl.exe" "\";\n"))))
2999 ;; The BB_EXE and SURROGATE_EXE paths are interpreted relative
3000 ;; to the configuration file provided to NOMAD.
3001 ;; However, the configuration files are all in the source tree
3002 ;; rather than in the build tree (unlike the compiled
3003 ;; executables).
3004 (let ((fix-exe-path (lambda* (dir #:optional
3005 (file "param.txt")
3006 (exe-opt "BB_EXE"))
3007 (substitute* (string-append dir "/" file)
3008 (((string-append "^" exe-opt " +"))
3009 ;; The $ prevents NOMAD from prefixing
3010 ;; the executable with the path of the
3011 ;; parent directory of the configuration
3012 ;; file NOMAD was provided with as
3013 ;; argument (param.txt or some such).
3014 (string-append exe-opt " $"
3015 builddir "/" dir "/"))))))
3016 (for-each
3017 (lambda (dir)
3018 (substitute* (string-append dir "/CMakeLists.txt")
3019 ;; The install phase has not yet run.
3020 (("(COMMAND.*)\\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad\\b"
3021 _ prefix)
3022 (string-append prefix "${CMAKE_BINARY_DIR}/src/nomad")))
3023 (if (equal? dir "examples/basic/batch/single_obj_MPIparallel")
3024 (substitute* (string-append dir "/param.txt")
3025 (("^BB_EXE +'\\$.*mpirun \\$-np \\$4 ")
3026 (string-append "BB_EXE '$" (which "mpirun") " $"
3027 builddir "/" dir "/")))
3028 (fix-exe-path dir))
3029 (when (equal? dir "examples/basic/batch/surrogate_sort")
3030 (fix-exe-path dir "param.txt" "SURROGATE_EXE"))
3031 (when (equal? dir "examples/advanced/batch/FixedVariable")
3032 (fix-exe-path dir "param1.txt")
3033 (fix-exe-path dir "param2.txt")
3034 (fix-exe-path dir "param3.txt")
3035 (fix-exe-path dir "param10.txt")))
3036 '("examples/basic/batch/coco_bbob-constrained"
3037 "examples/basic/batch/example1"
3038 "examples/basic/batch/example2"
3039 "examples/basic/batch/example3"
3040 "examples/basic/batch/multi_obj"
3041 "examples/basic/batch/multi_obj2"
3042 "examples/basic/batch/single_obj"
3043 "examples/basic/batch/single_obj_MPIparallel"
3044 "examples/basic/batch/single_obj_parallel"
3045 "examples/basic/batch/surrogate_sort"
3046 "examples/advanced/batch/FixedVariable"
3047 "examples/advanced/batch/LHonly"))))))
3048 (add-before 'configure 'mpi-setup
3049 #$%openmpi-setup))))
3050 (home-page "https://www.gerad.ca/nomad/")
3051 (synopsis "Nonlinear optimization by mesh-adaptive direct search")
3052 (description
3053 "NOMAD is a C++ implementation of the mesh-adaptive direct search (MADS)
3054algorithm, designed for difficult blackbox optimization problems. These
3055problems occur when the functions defining the objective and constraints are
3056the result of costly computer simulations.")
3057 (license license:lgpl3+)))
3058
3059(define-public cbc
3060 (package
3061 (name "cbc")
3062 (version "2.10.5")
3063 (source (origin
3064 (method url-fetch)
3065 (uri (string-append "https://www.coin-or.org/download/source/"
3066 "Cbc/Cbc-" version ".tgz"))
3067 (sha256
3068 (base32
3069 "0wk9vr6zc62gw71v7gnra5wxqlcljcgbhm5lasx236v791b986ns"))
3070 (modules '((guix build utils)))
3071 (snippet
3072 ;; Make sure we don't use the bundled software.
3073 '(delete-file-recursively "ThirdParty"))))
3074 (build-system gnu-build-system)
3075 (native-inputs
3076 (list gfortran pkg-config))
3077 (inputs
3078 (list openblas))
3079 (home-page "https://www.coin-or.org")
3080 (synopsis "Branch-and-cut solver")
3081 (description
3082 "Cbc (Coin-or branch and cut) is a mixed integer linear programming
3083solver written in C++. It can be used as a library or as a standalone
3084executable.")
3085 (license license:epl1.0)))
3086
3087(define-public clp
3088 (package
3089 (name "clp")
3090 (version "1.17.6")
3091 (source (origin
3092 (method url-fetch)
3093 (uri (string-append "https://www.coin-or.org/download/source/"
3094 "Clp/Clp-" version ".tgz"))
3095 (sha256
3096 (base32
3097 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
3098 (modules '((guix build utils)))
3099 (snippet
3100 ;; Make sure we don't use the bundled software.
3101 '(begin
3102 (delete-file-recursively "ThirdParty")
3103 #t))))
3104 (build-system gnu-build-system)
3105 (native-inputs
3106 (list gfortran pkg-config))
3107 (inputs
3108 (list openblas))
3109 (home-page "https://www.coin-or.org")
3110 (synopsis "Linear programming solver")
3111 (description
3112 "CLP is a high quality linear programming solver. Its main strengths are
3113its dual and primal Simplex algorithms. It also has a barrier algorithm for
3114linear and quadratic objectives. There are limited facilities for nonlinear
3115and quadratic objectives using the Simplex algorithm.")
3116 (license license:epl1.0)))
3117
3118(define-public python-cylp
3119 (package
3120 (name "python-cylp")
3121 (version "0.94.0")
3122 (source
3123 (origin
3124 (method git-fetch)
3125 (uri (git-reference
3126 (url "https://github.com/coin-or/cylp")
3127 (commit (string-append "v" version))))
3128 (file-name (git-file-name name version))
3129 (sha256
3130 (base32 "0rgqmwvmpdzl6ygwy3nm33vpphl2ldzpqj0xakh9hg1ccaa3fs6l"))))
3131 (build-system pyproject-build-system)
3132 (arguments
3133 (list
3134 ;; tests: 52 passed, 55 warnings
3135 #:test-flags
3136 ;; XXX: All tests in this file are SEGFAULT, see:
3137 ;; <https://codeberg.org/guix/guix/issues/2912>.
3138 #~(list "--ignore=cylp/py/test_PySolve.py"
3139 "--ignore=cylp/tests/test_CyClpSimplex.py"
3140 "--ignore=cylp/tests/test_QP.py"
3141 ;; All tests are failed.
3142 "--ignore=cylp/tests/test_MIP.py")
3143 #:phases
3144 #~(modify-phases %standard-phases
3145 (add-after 'unpack 'numpy-compatibility
3146 ;; XXX: See: <https://github.com/coin-or/CyLP/issues/227>.
3147 ;;
3148 ;; AttributeError: module 'numpy' has no attribute
3149 ;; 'float'. `np.float` was a deprecated alias for the builtin
3150 ;; `float`. To avoid this error in existing code, use `float` by
3151 ;; itself. Doing this will not modify any behavior and is safe. If
3152 ;; you specifically wanted the numpy scalar type, use `np.float64`
3153 ;; here. The aliases was originally deprecated in NumPy 1.20; for
3154 ;; more details and guidance see the original release note at:
3155 ;; https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
3156 (lambda _
3157 (substitute* '("cylp/py/utils/sparseUtil.py"
3158 "cylp/tests/test_sparseUtil.py")
3159 (("np.float") "float"))))
3160 ;; XXX: Adding "--pyargs" option, changing test directory, and
3161 ;; removing local source did not work; rebuilding extensions takes
3162 ;; some time but it's only thing which worked to enable tests.
3163 (add-before 'check 'pre-check
3164 (lambda* (#:key tests? #:allow-other-keys)
3165 (if tests?
3166 (invoke "python" "setup.py" "build_ext" "--inplace")))))))
3167 (native-inputs
3168 (list pkg-config
3169 python-cython
3170 python-pytest
3171 python-setuptools))
3172 (inputs
3173 (list cbc))
3174 (propagated-inputs
3175 (list python-numpy
3176 python-scipy))
3177 (home-page "https://github.com/coin-or/cylp")
3178 (synopsis "Python interface for CLP, CBC, and CGL")
3179 (description
3180 "CyLP is a Python interface to COIN-OR’s Linear and mixed-integer program
3181solvers (CLP, CBC, and CGL). CyLP’s unique feature is that you can use it to
3182alter the solution process of the solvers from within Python. For example,
3183you may define cut generators, branch-and-bound strategies, and primal/dual
3184Simplex pivot rules completely in Python.")
3185 (license license:epl2.0)))
3186
3187(define-public gecode
3188 (let* ((commit "f7f0d7c273d6844698f01cec8229ebe0b66a016a")
3189 (version (git-version "6.2.0" "1" commit)))
3190 (package
3191 (name "gecode")
3192 (version version)
3193 (source
3194 (origin
3195 (method git-fetch)
3196 (uri (git-reference
3197 (url "https://github.com/Gecode/gecode")
3198 (commit commit)))
3199 (file-name (git-file-name name version))
3200 (sha256
3201 (base32
3202 "16gzwa64w90vifaflmii515rsrqclf2y7nziq621m4ad9cjgcixj"))
3203 (modules '((guix build utils)))
3204 ;; delete generated sources
3205 (snippet '(for-each delete-file
3206 '("gecode/kernel/var-imp.hpp"
3207 "gecode/kernel/var-type.hpp")))))
3208 (outputs '("out" "examples"))
3209 (build-system gnu-build-system)
3210 (arguments
3211 (list
3212 #:configure-flags #~(list (string-append "GLDFLAGS=-Wl,-rpath="
3213 #$output "/lib")
3214 "--enable-examples=no")
3215 #:modules '((guix build gnu-build-system)
3216 (guix build utils)
3217 (ice-9 rdelim)
3218 (ice-9 popen))
3219 #:phases
3220 #~(modify-phases %standard-phases
3221 (add-before 'configure 'patch-msc-and-version
3222 (lambda* (#:key outputs #:allow-other-keys)
3223 (let ((out (assoc-ref outputs "out")))
3224 (substitute* "tools/flatzinc/gecode.msc.in"
3225 (("\\.\\./../..") out)
3226 (("\\.\\.")
3227 (string-append out "/share/minizinc")))
3228 (substitute* "configure"
3229 (("(PACKAGE_[^0-9]*)[0-9\\.]+" all match)
3230 (string-append match #$version))))))
3231 (add-after 'build 'build-examples
3232 (lambda _
3233 (invoke "make" "compileexamples")))
3234 ;; The Makefile disrespects GLDFLAGS for some reason,
3235 ;; so we have to patch it ourselves.
3236 (add-after 'install 'fix-rpath
3237 (lambda _
3238 (let ((libdir (string-append #$output "/lib")))
3239 (for-each
3240 (lambda (file)
3241 (let* ((pipe (open-pipe* OPEN_READ "patchelf"
3242 "--print-rpath" file))
3243 (line (read-line pipe)))
3244 (and (zero? (close-pipe pipe))
3245 (invoke "patchelf" "--set-rpath"
3246 (string-append libdir ":" line)
3247 file))))
3248 (find-files libdir ".*\\.so$")))))
3249 (add-after 'install 'install-examples
3250 (lambda* (#:key outputs #:allow-other-keys)
3251 (let* ((examples (assoc-ref outputs "examples"))
3252 (bindir (format #f "bindir=~a/bin" examples)))
3253 (invoke "make" "installexamples" bindir)))))))
3254 (native-inputs (list patchelf perl sed))
3255 (home-page "https://www.gecode.org")
3256 (synopsis "Toolkit for developing constraint-based systems")
3257 (description
3258 "Gecode is a C++ toolkit for developing constraint-based systems
3259and applications. It provides a modular and extensible solver.")
3260 (license license:expat))))
3261
3262(define-public libfixmath
3263 (let ((commit "1416c9979635c69f344d3c1de84b3246001a6540")
3264 (revision "1"))
3265 (package
3266 (name "libfixmath")
3267 (version (git-version "0" revision commit))
3268 (source (origin
3269 (method git-fetch)
3270 (uri (git-reference
3271 (url "https://github.com/PetteriAimonen/libfixmath")
3272 (commit commit)))
3273 (file-name (git-file-name name version))
3274 (sha256
3275 (base32
3276 "1vnpycw30rq3xwqyvj20l7pnw74dc4f27304i0918igsrdsjw501"))))
3277 (build-system cmake-build-system)
3278 (arguments
3279 (list
3280 #:phases
3281 #~(modify-phases %standard-phases
3282 (replace 'install
3283 (lambda _
3284 (let ((includes (string-append #$output "/include/libfixmath"))
3285 (lib (string-append #$output "/lib")))
3286 (mkdir-p includes)
3287 (for-each (lambda (file)
3288 (install-file file includes))
3289 (find-files "../source" "\\.h(pp)?$"))
3290 (for-each (lambda (file)
3291 (install-file file lib))
3292 (find-files "." "\\.a$"))))))))
3293 (home-page "https://code.google.com/archive/p/libfixmath/")
3294 (synopsis "Cross platform fixed point maths library")
3295 (description "This library implements the @file{math.h} functions in
3296fixed point (16.16) format.")
3297 (license license:expat))))
3298
3299(define-public glucose
3300 (package
3301 (name "glucose")
3302 (version "4.2.1")
3303 (source
3304 (origin
3305 (method git-fetch)
3306 (uri (git-reference
3307 (url "https://github.com/audemard/glucose")
3308 (commit version)))
3309 (file-name (git-file-name name version))
3310 (sha256
3311 (base32 "0zrn4hnkf8k95dc3s3acydl1bqkr8a0axw56g7n562lx7zj7sd62"))
3312 (modules '((guix build utils)))
3313 (snippet
3314 ;; Remove code related to the parallel version as non-free;
3315 ;; from parallel/Main.cc:
3316 ;; "The parallel version of Glucose (all files modified
3317 ;; since Glucose 3.0 releases, 2013) cannot be used in any
3318 ;; competitive event"
3319 '(begin
3320 (delete-file-recursively "parallel")
3321 (substitute* "CMakeLists.txt"
3322 (("^add_library\\(glucosep.*$")
3323 "")
3324 (("^add_executable\\(glucose-syrup.*$")
3325 "")
3326 (("^target_link_libraries\\(glucose-syrup.*$")
3327 ""))))))
3328 (build-system cmake-build-system)
3329 (arguments
3330 (list
3331 #:tests? #f ;there are no tests
3332 #:configure-flags
3333 #~(list "-DBUILD_SHARED_LIBS=ON"
3334 (string-append "-DCMAKE_BUILD_RPATH=" #$output "/lib"))
3335 #:phases
3336 #~(modify-phases %standard-phases
3337 (replace 'install
3338 (lambda _
3339 (install-file "libglucose.so"
3340 (string-append #$output "/lib"))
3341 (install-file "glucose-simp"
3342 (string-append #$output "/bin"))
3343 ;; Add a symbolic link with the customary name used until
3344 ;; the parallel version was written, and which is expected
3345 ;; by Sage.
3346 (symlink "glucose-simp"
3347 (string-append #$output "/bin/glucose")))))))
3348 (inputs (list zlib))
3349 (home-page "https://www.labri.fr/perso/lsimon/research/glucose/")
3350 (synopsis "SAT Solver")
3351 (description
3352 "Glucose is a SAT solver based on a scoring scheme introduced
3353in 2009 for the clause learning mechanism of so called “Modern” SAT solvers.
3354It is designed to be parallel.")
3355 (license license:expat)))
3356
3357(define-public libflame
3358 ;; The latest release (5.2.0) dates back to 2019. Use a newer one, which
3359 ;; among other things provides extra LAPACK symbols, such as 'dgemlq_'
3360 ;; (needed by LAPACKe).
3361 (let ((commit "70c19e770ead0ae846c59b59216deb16d236b40c")
3362 (revision "0"))
3363 (package
3364 (name "libflame")
3365 (version (git-version "5.2.0" revision commit))
3366 (outputs '("out" "static"))
3367 (home-page "https://github.com/flame/libflame")
3368 (source (origin
3369 (method git-fetch)
3370 (uri (git-reference (url home-page) (commit commit)))
3371 (file-name (git-file-name name version))
3372 (sha256
3373 (base32
3374 "0rk8ln5p4yybsws6p60w0vkxbqp53jddv90brlgf60mk6lv51sxl"))))
3375 (build-system gnu-build-system)
3376 (arguments
3377 (list #:configure-flags
3378 ;; Sensible defaults: https://github.com/flame/libflame/issues/28
3379 #~(list "--enable-dynamic-build"
3380 "--enable-max-arg-list-hack"
3381 "--enable-lapack2flame"
3382 "--enable-verbose-make-output"
3383 "--enable-multithreading=pthreads" ; Openblas isn't built with openmp.
3384 #$@(if (target-x86?)
3385 #~("--enable-vector-intrinsics=sse")
3386 #~())
3387 "--enable-supermatrix"
3388 "--enable-memory-alignment=16"
3389 "--enable-ldim-alignment")
3390 #:make-flags #~(list "FC=gfortran -fPIC")
3391 #:phases
3392 #~(modify-phases %standard-phases
3393 (add-after 'unpack 'patch-/usr/bin/env-bash
3394 (lambda _
3395 (substitute* "build/config.mk.in"
3396 (("/usr/bin/env bash")
3397 (which "bash")))))
3398 (replace 'check
3399 (lambda* (#:key tests? #:allow-other-keys)
3400 (substitute* "test/Makefile"
3401 (("LIBBLAS .*")
3402 "LIBBLAS = -lopenblas\n")
3403 (("LIBLAPACK .*")
3404 "LIBLAPACK = -lopenblas\n"))
3405 (when tests?
3406 (with-directory-excursion "test"
3407 (mkdir "obj")
3408 (invoke "make")
3409 (invoke "./test_libflame.x")))))
3410 (add-after 'install 'install-static
3411 (lambda* (#:key outputs #:allow-other-keys)
3412 (let ((out (assoc-ref outputs "out"))
3413 (static (assoc-ref outputs "static")))
3414 (mkdir-p (string-append static "/lib"))
3415 (rename-file (string-append out
3416 "/lib/libflame.a")
3417 (string-append static
3418 "/lib/libflame.a"))
3419 (install-file (string-append out
3420 "/include/FLAME.h")
3421 (string-append static "/include"))))))))
3422 (inputs (list gfortran))
3423 (native-inputs (list openblas perl python-wrapper))
3424 (synopsis "High-performance library for @acronym{DLA, dense linear algebra} computations")
3425 (description "@code{libflame} is a portable library for dense matrix
3426computations, providing much of the functionality present in LAPACK, developed
3427by current and former members of the @acronym{SHPC, Science of High-Performance
3428Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
3429Computational Engineering and Sciences} at The University of Texas at Austin.
3430@code{libflame} includes a compatibility layer, @code{lapack2flame}, which
3431includes a complete LAPACK implementation.")
3432 (license license:bsd-3))))
3433
3434(define-public hpcombi
3435 (package
3436 (name "hpcombi")
3437 (version "1.1.0")
3438 (source (origin
3439 (method git-fetch)
3440 (uri (git-reference
3441 (url "https://github.com/libsemigroups/hpcombi")
3442 (commit (string-append "v" version))))
3443 (file-name (git-file-name name version))
3444 (sha256
3445 (base32
3446 "0xxqjz4lba57vn65m2k5jxrz0v7y6jwnhxwg6njd4vrafv5w17yv"))))
3447 (native-inputs
3448 (list catch2))
3449 (build-system cmake-build-system)
3450 (home-page "https://libsemigroups.github.io/HPCombi/")
3451 (synopsis "Fast combinatorics in C++ using SSE/AVX instruction sets")
3452 (description "HPCombi is a C++17 header-only library using the SSE and AVX
3453instruction sets, and some equivalents, for very fast manipulation of
3454combinatorial objects such as transformations, permutations, and boolean
3455matrices of small size.")
3456 (license license:gpl3+)))
3457
3458(define-public scasp
3459 (package
3460 (name "scasp")
3461 (version "1.1.4")
3462 (source (origin
3463 (method git-fetch)
3464 (uri (git-reference
3465 (url "https://github.com/SWI-Prolog/sCASP")
3466 (commit (string-append "V" version))))
3467 (file-name (git-file-name name version))
3468 (sha256
3469 (base32
3470 "1m4fs1ywich9cwj55miqp5zxs7c1fw9wvy7lcj5rkrgcanks5qk4"))))
3471 (build-system copy-build-system)
3472 (arguments
3473 (list
3474 #:install-plan #~`(("scasp" "bin/")
3475 ("prolog" "lib/swipl/library"))
3476 #:modules `((guix build copy-build-system)
3477 ((guix build gnu-build-system) #:prefix gnu:)
3478 (guix build utils)
3479 (ice-9 regex))
3480 #:phases
3481 #~(modify-phases %standard-phases
3482 (add-before 'install 'build (assoc-ref gnu:%standard-phases 'build))
3483 (add-after 'build 'check (assoc-ref gnu:%standard-phases 'check)))))
3484 (native-inputs (list swi-prolog))
3485 (home-page "https://github.com/SWI-Prolog/sCASP")
3486 (synopsis "Interpreter for ASP programs with constraints")
3487 (description "@code{s(CASP)} is a top-down interpreter for ASP programs
3488with constraints.")
3489 (license license:asl2.0)))
3490
3491(define-public scs
3492 (package
3493 (name "scs")
3494 (version "3.2.10")
3495 (source
3496 (origin
3497 (method git-fetch)
3498 (uri (git-reference
3499 (url "https://github.com/cvxgrp/scs")
3500 (commit version)))
3501 (file-name (git-file-name name version))
3502 (sha256
3503 (base32 "00csacax6gh3cj39044iijsy6gkz0d1ac805z13qkllfs6bsvchy"))))
3504 (build-system cmake-build-system)
3505 (inputs
3506 (list lapack
3507 openblas))
3508 (home-page "https://osqp.org/")
3509 (synopsis "Splitting Conic Solver")
3510 (description
3511 "SCS (splitting conic solver) is a numerical optimization package for
3512solving large-scale convex cone problems.")
3513 (license license:expat)))
3514
3515(define-public ceres
3516 (package
3517 (name "ceres-solver")
3518 (version "2.0.0")
3519 (home-page "http://ceres-solver.org/")
3520 (source (origin
3521 (method url-fetch)
3522 (uri (string-append home-page "ceres-solver-"
3523 version ".tar.gz"))
3524 (sha256
3525 (base32
3526 "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h"))))
3527 (build-system cmake-build-system)
3528 (arguments
3529 ;; TODO: Build HTML user documentation and install separately.
3530 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
3531 "-DBUILD_SHARED_LIBS=ON")
3532
3533 #:phases (modify-phases %standard-phases
3534 (add-before 'configure 'set-library-directory
3535 (lambda _
3536 ;; Install libraries to lib/, not lib64/.
3537 (substitute* "CMakeLists.txt"
3538 (("set\\(LIB_SUFFIX \"64\"\\)")
3539 "set(LIB_SUFFIX \"\")")))))))
3540 (native-inputs (list pkg-config))
3541 ;; These inputs need to be propagated to satisfy dependent packages.
3542 (propagated-inputs (list eigen gflags glog))
3543 (inputs (list openblas suitesparse))
3544 (synopsis "C++ library for solving large optimization problems")
3545 (description
3546 "Ceres Solver is a C++ library for modeling and solving large,
3547complicated optimization problems. It is a feature rich, mature and
3548performant library which has been used in production since 2010. Ceres Solver
3549can solve two kinds of problems:
3550@enumerate
3551@item non-linear least squares problems with bounds constraints;
3552@item general unconstrained optimization problems.
3553@end enumerate\n")
3554 (license license:bsd-3)
3555
3556 ;; Mark as tunable to take advantage of SIMD code in Eigen.
3557 (properties `((tunable? . #t)))))
3558
3559(define-public ceres-solver-benchmarks
3560 (package
3561 (inherit ceres)
3562 (name "ceres-solver-benchmarks")
3563 (arguments
3564 '(#:modules ((ice-9 popen)
3565 (ice-9 rdelim)
3566 (guix build utils)
3567 (guix build cmake-build-system))
3568
3569 #:phases (modify-phases %standard-phases
3570 (delete 'configure)
3571 (replace 'build
3572 (lambda* (#:key outputs #:allow-other-keys)
3573 (let* ((out (assoc-ref outputs "out"))
3574 (bin (string-append out "/bin")))
3575 (define flags
3576 (string-tokenize
3577 (read-line (open-pipe* OPEN_READ
3578 "pkg-config" "eigen3"
3579 "--cflags"))))
3580
3581 (define (compile-file top-dir)
3582 (lambda (file)
3583 (let ((source (string-append file ".cc")))
3584 (format #t "building '~a'...~%" file)
3585 (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG"
3586 source "-lceres" "-lbenchmark" "-lglog"
3587 "-pthread"
3588 "-o" (string-append bin "/" file)
3589 "-I" top-dir flags))))
3590
3591 (mkdir-p bin)
3592 (with-directory-excursion "internal/ceres"
3593 (for-each (compile-file "..")
3594 '("schur_eliminator_benchmark"
3595 "small_blas_gemm_benchmark"
3596 "small_blas_gemv_benchmark"))
3597 (with-directory-excursion "autodiff_benchmarks"
3598 ((compile-file "../..") "autodiff_benchmarks"))))))
3599 (delete 'check)
3600 (delete 'install))))
3601 (inputs (modify-inputs inputs
3602 (prepend googlebenchmark ceres)))
3603 (synopsis "Benchmarks of the Ceres optimization problem solver")))
3604
3605;; For a fully featured Octave, users are strongly recommended also to install
3606;; the following packages: less, ghostscript, gnuplot.
3607(define-public octave-cli
3608 (package
3609 (name "octave-cli")
3610 (version "11.1.0")
3611 (source
3612 (origin
3613 (method url-fetch)
3614 (uri (string-append "mirror://gnu/octave/octave-"
3615 version ".tar.xz"))
3616 (sha256
3617 (base32
3618 "0snbwck636nj76rx3ahcki36msxn2j87gphixlmqm7l0q472sglb"))))
3619 (build-system gnu-build-system)
3620 (inputs
3621 (list alsa-lib
3622 arpack-ng
3623 bdb
3624 curl
3625 fftw
3626 fftwf
3627 fltk
3628 fontconfig
3629 freetype
3630 gl2ps
3631 glpk
3632 glu
3633 graphicsmagick
3634
3635 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
3636 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
3637 ;; libtiff.la instead of having to provide it here.
3638 libjpeg-turbo
3639
3640 hdf5
3641 libsndfile
3642 libxft
3643 mesa
3644 openblas
3645 pcre
3646 portaudio
3647 qhull
3648 readline
3649 suitesparse
3650 zlib))
3651 (native-inputs
3652 (list gfortran
3653 pkg-config
3654 perl
3655 ;; The following inputs are not actually used in the build process.
3656 ;; However, the ./configure gratuitously tests for their existence and
3657 ;; assumes that programs not present at build time are also not, and
3658 ;; can never be, available at run time! If these inputs are therefore
3659 ;; not present, support for them will be built out. However, Octave
3660 ;; will still run without them, albeit without the features they
3661 ;; provide.
3662 less
3663 ghostscript
3664 gnuplot
3665 texinfo))
3666 ;; Octave code uses this variable to detect directories holding multiple CA
3667 ;; certificates to verify peers with. This is required for the networking
3668 ;; functions that require encryption to work properly.
3669 (native-search-paths
3670 (list (search-path-specification
3671 (variable "CURLOPT_CAPATH")
3672 (files '("etc/ssl/certs")))))
3673 (arguments
3674 (list
3675 #:configure-flags
3676 #~(list (string-append "--with-shell="
3677 (assoc-ref %build-inputs "bash")
3678 "/bin/sh")
3679
3680 ;; XXX: Without this flag, linking octave-cli fails with
3681 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
3682 ;; not pulling in liboctinterp.la for -lstdc++.
3683 "--enable-link-all-dependencies")
3684 #:phases
3685 #~(modify-phases %standard-phases
3686 (add-after 'configure 'configure-makeinfo
3687 (lambda* (#:key inputs #:allow-other-keys)
3688 (substitute* "libinterp/corefcn/help.h"
3689 (("\"makeinfo\"")
3690 (format #f "~s"
3691 (search-input-file inputs "bin/makeinfo")))))))))
3692 (home-page "https://www.gnu.org/software/octave/")
3693 (synopsis "High-level language for numerical computation (no GUI)")
3694 (description "GNU Octave is a high-level interpreted language that is
3695specialized for numerical computations. It can be used for both linear and
3696non-linear applications and it provides great support for visualizing results.
3697Work may be performed both at the interactive command-line as well as via
3698script files.")
3699 (license license:gpl3+)))
3700
3701(define-public octave
3702 (package (inherit octave-cli)
3703 (name "octave")
3704 (arguments
3705 (substitute-keyword-arguments arguments
3706 ((#:modules modules %default-gnu-modules)
3707 `((guix build qt-utils) ,@modules))
3708 ((#:imported-modules imported-modules %default-gnu-imported-modules)
3709 `((guix build qt-utils) ,@imported-modules))
3710 ((#:phases phases)
3711 #~(modify-phases #$phases
3712 (add-before 'configure 'patch-qscintilla-library-name
3713 (lambda* (#:key inputs #:allow-other-keys)
3714 ;; The QScintilla library that the Octave configure script
3715 ;; tries to link with should be named libqscintilla-qt5.so,
3716 ;; but the QScintilla input provides the shared library
3717 ;; as libqscintilla2_qt5.so.
3718 (substitute* "configure"
3719 (("qscintilla2-qt5") "qscintilla2_qt5"))))
3720 (add-after 'install 'wrap-qt
3721 (lambda* (#:key inputs #:allow-other-keys)
3722 (for-each (lambda (path)
3723 (wrap-qt-program
3724 (string-append "../" path) ;relative to bin
3725 #:output #$output #:inputs inputs))
3726 (with-directory-excursion #$output
3727 (find-files "libexec" "^octave-gui$")))))))))
3728 (native-inputs
3729 (modify-inputs native-inputs
3730 (prepend qttools-5 ;for lrelease
3731 (texlive-local-tree (list texlive-epsf))))) ;for texi2dvi
3732 (inputs
3733 (modify-inputs inputs
3734 (prepend qscintilla-qt5 qtbase-5 qtwayland-5)))
3735 (synopsis "High-level language for numerical computation (with GUI)")))
3736
3737(define-public opencascade-occt
3738 (package
3739 (name "opencascade-occt")
3740 (version "7.9.3")
3741 (properties
3742 '((release-tag-prefix . "^V")
3743 (release-tag-version-delimiter . "_")))
3744 (source
3745 (origin
3746 (method git-fetch)
3747 (uri (git-reference
3748 (url "https://git.dev.opencascade.org/repos/occt.git")
3749 (commit
3750 (string-append "V"
3751 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
3752 version)))))
3753 (file-name (git-file-name name version))
3754 (sha256
3755 (base32 "1wmrbr5yar3iz1c80h6diyqigd8hv05j7wral2kkrbvhzpwjd7k6"))
3756 (snippet
3757 #~(begin
3758 (use-modules (guix build utils))
3759 ;; Remove files specific to non-free operating systems.
3760 (delete-file-recursively "samples/ios")
3761 (delete-file-recursively "samples/mfc")
3762 (delete-file-recursively "samples/qt/FuncDemo")
3763 ;; Remove references to deleted files.
3764 (substitute* "dox/FILES_HTML.txt"
3765 ((".*standard.*") "" )
3766 ((".*UIKitSample.*") ""))))))
3767 (build-system cmake-build-system)
3768 (arguments
3769 (list
3770 ;; There is no test target for make. OCCT provides an
3771 ;; 'Automated Testing System', which may be accessed after
3772 ;; installation via the draw.sh script. draw.sh is located in
3773 ;; the bin directory. For details see:
3774 ;; https://dev.opencascade.org/doc/occt-7.3.0/overview/html/\
3775 ;; occt_dev_guides__tests.html
3776 #:tests? #f
3777 #:configure-flags
3778 #~(list "-DCMAKE_CXX_FLAGS=-fpermissive" ;from unsigned char* to char*
3779 "-DUSE_DRACO:BOOL=ON"
3780 "-DUSE_FREEIMAGE:BOOL=ON"
3781 "-DUSE_RAPIDJSON:BOOL=ON"
3782 "-DUSE_TBB:BOOL=ON"
3783 "-DUSE_VTK:BOOL=ON"
3784 "-DBUILD_DOC_Overview:BOOL=OFF"
3785 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
3786 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
3787 "-UCMAKE_INSTALL_LIBDIR")))
3788 (native-inputs (list doxygen fontconfig))
3789 (inputs
3790 (list draco
3791 freetype
3792 freeimage
3793 glu
3794 libxext
3795 libxi
3796 libxmu
3797 mesa
3798 onetbb
3799 rapidjson
3800 tcl
3801 tk
3802 vtk))
3803 ;; TODO: build Overview documentation and add 'doc' output.
3804 (home-page "https://dev.opencascade.org")
3805 (synopsis "Libraries for 3D modeling and numerical simulation")
3806 (description
3807 "Open CASCADE is a set of libraries for the development of applications
3808dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
3809C++ class libraries providing services for 3D surface and solid modeling, CAD
3810data exchange, and visualization. It is used for development of specialized
3811software dealing with 3D models in design (CAD), manufacturing (CAM),
3812numerical simulation (CAE), measurement equipment (CMM), and quality
3813control (CAQ) domains.
3814
3815This is the certified version of the Open Cascade Technology (OCCT) library.")
3816 (license (list ;; OCCT library:
3817 license:lgpl2.1; with an exception for the use of header
3818 ; files, see OCCT_LGPL_EXCEPTION.txt.
3819 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
3820 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
3821 license:expat
3822 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
3823 ;; src/StepFile/step.tab.*:
3824 license:gpl3+ ; with Bison 2.2 exception.
3825 ;; File src/NCollection/NCollection_UtfIterator.lxx:
3826 (license:non-copyleft
3827 "https://www.unicode.org/license.html")
3828 ;; File src/NCollection/NCollection_StdAllocator.hxx:
3829 license:public-domain))))
3830
3831(define-public fast-downward
3832 (package
3833 (name "fast-downward")
3834 (version "23.06.0")
3835 (source (origin
3836 (method git-fetch)
3837 (uri (git-reference
3838 (url "https://github.com/aibasel/downward")
3839 (commit (string-append "release-" version))))
3840 (file-name (git-file-name name version))
3841 (sha256
3842 (base32 "1xrgnvbkzkdf6srbrlsnf4qrgp0f1lkk7yxf34ynna0w49l468d4"))))
3843 (build-system cmake-build-system)
3844 (arguments
3845 (list
3846 #:tests? #f ; no tests
3847 #:phases
3848 #~(modify-phases %standard-phases
3849 (add-after 'unpack 'fix-driver
3850 (lambda* (#:key outputs #:allow-other-keys)
3851 (substitute* "driver/run_components.py"
3852 ;; strip gratuitous "bin"
3853 (("os\\.path\\.join\\((.*), \"bin\"\\)" all keep)
3854 (string-append "os.path.join(" keep ")")))))
3855 (add-before 'configure 'chdir
3856 (lambda _ (chdir "src")))
3857 (replace 'install
3858 (lambda* (#:key outputs #:allow-other-keys)
3859 (let* ((out (assoc-ref outputs "out"))
3860 (dest (string-append out "/libexec/fast-downward"
3861 "/builds/release")))
3862 (mkdir-p dest)
3863 (with-directory-excursion "bin"
3864 (install-file "downward" dest)
3865 (copy-recursively "translate"
3866 (string-append dest "/translate"))))))
3867 (add-after 'install 'install-driver
3868 (lambda* (#:key outputs #:allow-other-keys)
3869 (with-directory-excursion ".."
3870 (let* ((out (assoc-ref outputs "out"))
3871 (bin (string-append out "/bin/fast-downward"))
3872 (dest (string-append out "/libexec/fast-downward")))
3873 (copy-recursively "driver"
3874 (string-append dest "/driver"))
3875 (mkdir-p (dirname bin))
3876 (copy-file "fast-downward.py" bin)
3877 (wrap-program bin
3878 `("PYTHONPATH" prefix (,dest))))))))))
3879 (inputs (list bash-minimal python))
3880 (home-page "https://www.fast-downward.org/")
3881 (synopsis "Domain-independent classical planning system")
3882 (description "Fast Downward is a portfolio-based planning system that
3883supports the propositional fragment of PDDL2.2.")
3884 (license license:gpl3+)))
3885
3886(define-public gmsh
3887 (package
3888 (name "gmsh")
3889 (version "4.15.2")
3890 (source
3891 (origin
3892 (method git-fetch)
3893 (uri (git-reference
3894 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
3895 (commit
3896 (string-append "gmsh_"
3897 (string-replace-substring version "." "_")))))
3898 (file-name (git-file-name name version))
3899 (sha256
3900 (base32 "1z5fl1im7mss5w8c8ngbhj5wbx0b8knmwg5hfdg036yb0x5pdc4j"))
3901 (modules '((guix build utils)))
3902 (snippet
3903 '(delete-file-recursively "contrib/metis"))))
3904 (build-system cmake-build-system)
3905 (arguments
3906 (list
3907 #:configure-flags
3908 #~(list "-DENABLE_SYSTEM_CONTRIB:BOOL=ON"
3909 "-DENABLE_BUILD_SHARED:BOOL=ON"
3910 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
3911 #:imported-modules (append %cmake-build-system-modules
3912 %pyproject-build-system-modules)
3913 #:modules '(((guix build pyproject-build-system) #:select (site-packages))
3914 (guix build cmake-build-system)
3915 (guix build utils))
3916 #:phases
3917 #~(modify-phases %standard-phases
3918 (add-after 'unpack 'patch-paths
3919 (lambda* (#:key inputs outputs #:allow-other-keys)
3920 ;; Use the standard Guix site-package path for
3921 ;; installation of the Python API.
3922 (substitute* "CMakeLists.txt"
3923 (("include\\(GNUInstallDirs\\)\n")
3924 (string-append "include(GNUInstallDirs)\n"
3925 " set(GMSH_PY_LIB "
3926 (site-packages inputs outputs) ")\n"))
3927 (("\\$\\{GMSH\\_PY\\} DESTINATION \\$\\{GMSH\\_LIB\\}")
3928 "${GMSH_PY} DESTINATION ${GMSH_PY_LIB}"))
3929 ;; Find the shared library.
3930 (let ((libgmsh (string-append #$output
3931 "/lib/libgmsh.so")))
3932 (substitute* "api/gmsh.py"
3933 (("find_library\\(\"gmsh\"\\)")
3934 (simple-format #f "\"~a\"" libgmsh)))))))))
3935 (inputs
3936 (list fltk
3937 fontconfig
3938 glu
3939 gmp
3940 hdf5
3941 libx11
3942 libxext
3943 libxft
3944 mesa
3945 metis
3946 openblas
3947 opencascade-occt))
3948 (native-inputs
3949 (list python-wrapper))
3950 (home-page "https://gmsh.info/")
3951 (synopsis "3D finite element grid generator")
3952 (description "Gmsh is a 3D finite element grid generator with a built-in
3953CAD engine and post-processor. Its design goal is to provide a fast, light
3954and user-friendly meshing tool with parametric input and advanced
3955visualization capabilities. Gmsh is built around four modules: geometry,
3956mesh, solver and post-processing. The specification of any input to these
3957modules is done either interactively using the graphical user interface or in
3958ASCII text files using Gmsh's own scripting language.")
3959 (license license:gpl2+)))
3960
3961(define-public veusz
3962 ;; TODO: Maybe move to (gnu packages plotutils)
3963 (package
3964 (name "veusz")
3965 (version "4.2.1")
3966 (source
3967 (origin
3968 (method git-fetch)
3969 (uri (git-reference
3970 (url "https://github.com/veusz/veusz")
3971 (commit (string-append "veusz-" version))))
3972 (file-name (git-file-name name version))
3973 (sha256
3974 (base32 "1wcqrzcp1h95qca25w0mrzrvq6sifvndmn2223ak0b4p1dssq1l1"))))
3975 (build-system pyproject-build-system)
3976 (arguments
3977 (list
3978 ;; TODO: When run with custom test backend "tests/runselftest.py":
3979 ;; <...>
3980 ;; qt.qpa.plugin: Could not load the Qt platform plugin
3981 ;; "xcb" in "" even though it was found. This application failed to
3982 ;; start because no Qt platform plugin could be
3983 ;; initialized. Reinstalling the application may fix this problem.
3984 #:tests? #f
3985 #:phases
3986 #~(modify-phases %standard-phases
3987 ;; Veusz uses python's site-packages to look for pyqt6_include_dir.
3988 (add-after 'unpack 'fix-pyqt6-include-dir
3989 (lambda _
3990 (substitute* "pyqt_setuptools.py"
3991 (("get_path\\('platlib'\\)")
3992 (format #f "~s"
3993 (string-append
3994 #$(this-package-input "python-pyqt")
3995 "/lib/python"
3996 #$(version-major+minor
3997 (package-version python-wrapper))
3998 "/site-packages"))))))
3999 ;; Ensure that icons are found at runtime.
4000 (add-after 'wrap 'wrap-executable
4001 (lambda* (#:key inputs #:allow-other-keys)
4002 (wrap-program (string-append #$output "/bin/veusz")
4003 `("QT_PLUGIN_PATH" prefix
4004 ,(list (string-append
4005 (string-join
4006 (list #$(this-package-input "qtbase")
4007 #$(this-package-input "qtsvg")
4008 #$(this-package-input "qtwayland"))
4009 "/lib/qt6/plugins:")
4010 "/lib/qt6/plugins")))))))))
4011 (native-inputs
4012 (list pkg-config
4013 python-setuptools
4014 qttools))
4015 (inputs
4016 (list bash-minimal
4017 ghostscript ;optional, for EPS/PS output
4018 python-dbus
4019 python-numpy
4020 python-pyqt-6
4021 qtbase
4022 qtsvg
4023 qtwayland
4024 ;;
4025 ;; These are extra requirements which are listed for the reference,
4026 ;; try not to include them directly and install on demand to reduce
4027 ;; closure size and relax module cycles (maths<-->astronomy,
4028 ;; maths<-->python-science).
4029 ;;
4030 ;; [optional]
4031 ;; python-astropy
4032 ;; python-pyemf3 ;not packaged
4033 ;; python-iminuit
4034 python-h5py)) ;for HDF5 data
4035 (home-page "https://veusz.github.io/")
4036 (synopsis "Scientific plotting package")
4037 (description
4038 "Veusz is a scientific plotting and graphing program with a graphical
4039user interface, designed to produce publication-ready 2D and 3D plots. In
4040addition it can be used as a module in Python for plotting. It supports
4041vector and bitmap output, including PDF, Postscript, SVG and EMF.")
4042 (license license:gpl2+)))
4043
4044(define-public voro++
4045 (package
4046 (name "voro++")
4047 (version "0.4.6")
4048 (source
4049 (origin
4050 (method git-fetch)
4051 (uri (git-reference
4052 (url "https://github.com/chr1shr/voro")
4053 (commit (string-append "v" version))))
4054 (file-name (git-file-name name version))
4055 (sha256
4056 (base32 "0rxyb662w9y3xadyxz2x7gvc7mafbhl13szdc55fsk5sygpdlkv5"))))
4057 (build-system gnu-build-system)
4058 (arguments
4059 (list
4060 #:make-flags #~(list (string-append "PREFIX=" #$output))
4061 #:phases
4062 #~(modify-phases %standard-phases
4063 (delete 'configure) ;no configure
4064 (replace 'check
4065 ;; There is no test suite but the project provides a verity of
4066 ;; examples to check performance, target "all" build each example
4067 ;; (basic, walls, custom, extra, degenerate, and interface), see
4068 ;; detailed description in "examples/README".
4069 ;;
4070 ;; Running timing example only:
4071 ;; These codes and scripts can be used to test the code's
4072 ;; performance. The program timing_test.cc creates a container
4073 ;; with 100000 particles, and then times the computation of all
4074 ;; the cells in the container, using the dummy function
4075 ;; compute_all_cells().
4076 (lambda* (#:key tests? #:allow-other-keys)
4077 (when tests?
4078 (with-directory-excursion "examples/timing"
4079 (invoke "perl" "timing_test.pl"))))))))
4080 (native-inputs
4081 (list perl))
4082 (home-page "https://math.lbl.gov/voro++/")
4083 (synopsis "C++ library for the computation of the Voronoi diagram")
4084 (description
4085 "Voro++ is a software library for carrying out three-dimensional
4086computations of the Voronoi tessellation. A distinguishing feature of the
4087Voro++ library is that it carries out cell-based calculations, computing the
4088Voronoi cell for each particle individually. It is particularly well-suited
4089for applications that rely on cell-based statistics, where features of Voronoi
4090cells (eg. volume, centroid, number of faces) can be used to analyze a system
4091of particles.
4092
4093Voro++ comprises of several C++ classes that can be built as a static library.
4094A command-line utility is also provided that can use most features of the
4095code. The direct cell-by-cell construction makes the library particularly
4096well-suited to handling special boundary conditions and walls. It employs
4097algorithms that are tolerant for numerical precision errors, it exhibits high
4098performance, and it has been successfully employed on very large particle
4099systems.")
4100 (license license:bsd-3)))
4101
4102(define-public maxflow
4103 (package
4104 (name "maxflow")
4105 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
4106 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
4107 (version "3.0.5")
4108 (source (origin
4109 (method git-fetch)
4110 (uri (git-reference
4111 (url "https://github.com/gerddie/maxflow")
4112 (commit version)))
4113 (file-name (git-file-name name version))
4114 (sha256
4115 (base32
4116 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
4117 (build-system cmake-build-system)
4118 (home-page "https://pub.ist.ac.at/~vnk/software.html")
4119 (synopsis "Library implementing Maxflow algorithm")
4120 (description "An implementation of the maxflow algorithm described in
4121@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
4122Energy Minimization in Computer Vision.\n
4123Yuri Boykov and Vladimir Kolmogorov.\n
4124In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
4125September 2004}")
4126 (license license:gpl3+)))
4127
4128(define-public petsc
4129 (package
4130 (name "petsc")
4131 (version "3.24.0")
4132 (source
4133 (origin
4134 (method url-fetch)
4135 ;; The *-lite-* tarball does not contain the *large* documentation
4136 (uri (string-append "https://web.cels.anl.gov/projects/petsc/download/release-snapshots/"
4137 "petsc-lite-" version ".tar.gz"))
4138 (sha256
4139 (base32 "10q9bnf7j6nr3fn9x7b8l0c3hqa9mhmsk1j5sdyshg5f1kc6746c"))))
4140 (outputs '("out" ; libraries and headers
4141 "examples")) ; ~30MiB of examples
4142 (build-system gnu-build-system)
4143 (native-inputs
4144 (list python which))
4145 (inputs
4146 (list gfortran openblas superlu
4147 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
4148 ;; leaving out opengl, as configuration seems to only be for mac
4149 ))
4150 (arguments
4151 (list
4152 #:test-target "test"
4153 #:parallel-build? #f ; build is parallel by default
4154 #:configure-flags
4155 #~(list "COPTFLAGS=-g -O3"
4156 "CXXOPTFLAGS=-g -O3"
4157 "FOPTFLAGS=-g -O3"
4158 "--with-mpi=0"
4159 "--with-openmp=1"
4160 "--with-openblas=1"
4161 (string-append "--with-openblas-dir="
4162 #$(this-package-input "openblas"))
4163 "--with-superlu=1"
4164 "--with-debugging=0")
4165 #:make-flags
4166 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
4167 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
4168 #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
4169 #:phases
4170 #~(modify-phases %standard-phases
4171 (replace 'configure
4172 ;; PETSc's configure script is actually a python script, so we can't
4173 ;; run it with bash.
4174 (lambda* (#:key outputs (configure-flags '())
4175 #:allow-other-keys)
4176 (let* ((prefix (assoc-ref outputs "out"))
4177 (flags `(,(string-append "--prefix=" prefix)
4178 ,@configure-flags)))
4179 ;; Sort source files in configure (for reproducibility).
4180 (substitute* "config/gmakegen.py"
4181 (("join\\(srcs\\[lang\\]\\)")
4182 "join(sorted(srcs[lang]))"))
4183
4184 (format #t "build directory: ~s~%" (getcwd))
4185 (format #t "configure flags: ~s~%" flags)
4186 (apply invoke "./configure" flags)
4187
4188 ;; Generate test scripts with the right shebang.
4189 (substitute* "config/example_template.py"
4190 (("#!/usr/bin/env bash")
4191 (string-append "#!" (which "bash")))))))
4192 (add-after 'configure 'clean-local-references
4193 (lambda* (#:key outputs #:allow-other-keys)
4194 (let ((out (assoc-ref outputs "out")))
4195 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
4196 ;; Prevent build directory from leaking into compiled code
4197 (((getcwd)) out)
4198 (("Machine characteristics: Linux-[0-9]+\\.[0-9]+\\.[0-9]+-arch[0-9]+-[0-9]+")
4199 "Machine characteristics: Linux-x.x.x-archx-x")
4200 (("([[:graph:]]+)/bin/make") "\"make"))
4201 (substitute* (find-files "." "petscvariables")
4202 ;; Do not expose build machine characteristics, set to defaults.
4203 (("MAKE_NP = [[:digit:]]+") "MAKE_NP = 2")
4204 (("MAKE_TEST_NP = [[:digit:]]+") "MAKE_TEST_NP = 2")
4205 (("MAKE_LOAD = .*") "MAKE_LOAD = 256.0\n")
4206 (("NPMAX = [[:digit:]]+") "NPMAX = 2")))))
4207 (add-after 'install 'clean-install
4208 ;; Try to keep installed files from leaking build directory names.
4209 (lambda* (#:key inputs outputs #:allow-other-keys)
4210 (let ((out (assoc-ref outputs "out")))
4211 (substitute* (map (lambda (file)
4212 (string-append out "/lib/petsc/conf/" file))
4213 '("petscvariables"))
4214 (((getcwd)) out))
4215 ;; Make compiler references point to the store
4216 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
4217 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
4218 (string-append "= " (which compiler))))
4219 ;; PETSc installs some build logs, which aren't necessary.
4220 (for-each (lambda (file)
4221 (let ((f (string-append out "/lib/petsc/conf/" file)))
4222 (when (file-exists? f)
4223 (delete-file f))))
4224 '("configure.log" "make.log" "gmake.log"
4225 "test.log" "error.log" "RDict.db"
4226 "PETScBuildInternal.cmake"
4227 "configure-hash"
4228 ;; Once installed, should uninstall with Guix
4229 "uninstall.py")))))
4230 (add-after 'clean-install 'clear-reference-to-compiler
4231 (lambda* (#:key inputs outputs #:allow-other-keys)
4232 ;; Do not retain a reference to GCC and other build only inputs.
4233 (let ((out (assoc-ref outputs "out")))
4234 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
4235 (("([[:graph:]]+)/bin/gcc") "gcc")
4236 (("([[:graph:]]+)/bin/g\\+\\+") "g++")
4237 (("([[:graph:]]+)/bin/make") "make")
4238 (("([[:graph:]]+)/bin/diff") "diff")
4239 (("([[:graph:]]+)/bin/sed") "sed")
4240 (("([[:graph:]]+)/bin/gfortran") "gfortran")
4241 (("([[:graph:]]+)/bin/gcov") "gcov")))))
4242
4243 ;; Some of the tests get linked with '-L$prefix/lib -lpetsc' (even
4244 ;; though that's unnecessary because they also explicitly link
4245 ;; against 'libpetsc.so' from the build directory). To work around
4246 ;; it, run tests after installation. See
4247 ;; <https://gitlab.com/petsc/petsc/-/issues/1634>.
4248 (delete 'check)
4249 (add-after 'install 'check
4250 (assoc-ref %standard-phases 'check))
4251
4252 (add-after 'install 'move-examples
4253 (lambda* (#:key outputs #:allow-other-keys)
4254 (let* ((out (assoc-ref outputs "out"))
4255 (examples (assoc-ref outputs "examples"))
4256 (exdir (string-append out "/share/petsc/examples"))
4257 (exdir' (string-append examples "/share/petsc/examples")))
4258 (copy-recursively exdir exdir')
4259 (delete-file-recursively exdir)))))))
4260 (home-page "https://petsc.org")
4261 (synopsis "Library to solve PDEs")
4262 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
4263data structures and routines for the scalable (parallel) solution of
4264scientific applications modeled by partial differential equations.")
4265 (license (license:non-copyleft
4266 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))
4267 (properties '((tunable? . #t)))))
4268
4269(define-public petsc-complex
4270 (package
4271 (inherit petsc)
4272 (name "petsc-complex")
4273 (arguments
4274 (substitute-keyword-arguments arguments
4275 ((#:configure-flags cf)
4276 #~(cons "--with-scalar-type=complex" #$cf))))
4277 (synopsis "Library to solve PDEs (with complex scalars)")))
4278
4279(define-public petsc-openmpi
4280 (package
4281 (inherit petsc)
4282 (name "petsc-openmpi")
4283 (inputs
4284 (modify-inputs inputs
4285 (prepend hdf5-parallel-openmpi
4286 hypre-openmpi
4287 metis
4288 mumps-openmpi
4289 openmpi
4290 pt-scotch32
4291 scalapack
4292 `(,pt-scotch32 "metis"))))
4293 (arguments
4294 (substitute-keyword-arguments arguments
4295 ((#:configure-flags cf)
4296 #~`("--with-hypre=1"
4297 "--with-mpiexec=mpirun"
4298 "--with-metis=1"
4299 "--with-mumps=1"
4300 "--with-scalapack=1"
4301 "--with-ptscotch=1"
4302 ,(string-append "--with-mpi-dir="
4303 #$(this-package-input "openmpi"))
4304 ,(string-append "--with-hdf5-include="
4305 #$(this-package-input "hdf5-parallel-openmpi")
4306 "/include")
4307 ,(string-append "--with-hdf5-lib="
4308 #$(this-package-input "hdf5-parallel-openmpi")
4309 "/lib/libhdf5.a")
4310 ,@(delete "--with-mpi=0" #$cf)))
4311 ((#:phases phases)
4312 #~(modify-phases #$phases
4313 (add-before 'configure 'mpi-setup
4314 #$%openmpi-setup)
4315 (add-after 'install 'patch-header-inclusions
4316 ;; TODO: Replace with ‘patch-header-inclusions’ when (some form
4317 ;; of) https://issues.guix.gnu.org/54780#19 is merged.
4318 (lambda _
4319 (substitute* (string-append #$output "/include/petsclayouthdf5.h")
4320 (("<(H5Ipublic.h)>" _ header)
4321 (format #f "<~a/include/~a>"
4322 #$(this-package-input "hdf5-parallel-openmpi")
4323 header)))))))))
4324 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
4325
4326(define-public petsc-complex-openmpi
4327 (package
4328 (inherit petsc-complex)
4329 (name "petsc-complex-openmpi")
4330 (inputs
4331 (modify-inputs inputs
4332 (prepend openmpi)))
4333 (arguments
4334 (substitute-keyword-arguments arguments
4335 ((#:configure-flags cf)
4336 #~`("--with-mpiexec=mpirun"
4337 ,(string-append "--with-mpi-dir="
4338 #$(this-package-input "openmpi"))
4339 ,@(delete "--with-mpi=0" #$cf)))
4340 ((#:phases phases)
4341 #~(modify-phases #$phases
4342 (add-before 'configure 'mpi-setup
4343 #$%openmpi-setup)))))
4344 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
4345
4346(define-public pnetcdf
4347 (package
4348 (name "pnetcdf")
4349 (version "1.13.0")
4350 (source
4351 (origin
4352 (method url-fetch)
4353 (uri (string-append
4354 "https://parallel-netcdf.github.io/Release/pnetcdf-"
4355 version ".tar.gz"))
4356 (sha256
4357 (base32
4358 "14f4nbcnw80y59cl0kjpxqqfaxzzd62kixnhb6ihp6aigb3z385b"))))
4359 (build-system gnu-build-system)
4360 (arguments
4361 (list #:configure-flags
4362 #~(list "--enable-shared"
4363 (string-append "--with-mpi=" #$(this-package-input "openmpi")))
4364 #:phases
4365 #~(modify-phases %standard-phases
4366 (add-after 'build 'mpi-setup
4367 #$%openmpi-setup))))
4368 (inputs (list openmpi zlib))
4369 (native-inputs (list m4))
4370 (home-page "https://parallel-netcdf.github.io/")
4371 (synopsis "Parallel I/O Library for NetCDF File Access")
4372 (description "PnetCDF is a high-performance parallel I/O library for accessing
4373Unidata's NetCDF, files in classic formats, specifically the formats of CDF-1, 2, and
43745.")
4375 (license (license:x11-style "file://COPYRIGHT"))))
4376
4377(define-public popf
4378 (package
4379 (name "popf")
4380 (version "0.0.15")
4381 (source (origin
4382 (method git-fetch)
4383 (uri (git-reference
4384 (url "https://github.com/fmrico/popf")
4385 (commit version)))
4386 (file-name (git-file-name name version))
4387 (sha256
4388 (base32
4389 "1i1am3h6japn8fgapi5s5mnyrm31a05jkjhzgk48cd2n42c5060v"))))
4390 (build-system cmake-build-system)
4391 (arguments
4392 (list
4393 #:tests? #f ; no tests
4394 #:phases
4395 #~(modify-phases %standard-phases
4396 (add-after 'unpack 'fix-cmake
4397 (lambda* (#:key inputs #:allow-other-keys)
4398 (substitute* (find-files "." "CMakeLists\\.txt")
4399 (("/usr/local/opt/flex/include")
4400 (dirname (search-input-file inputs "include/FlexLexer.h"))))
4401 (substitute* "CMakeLists.txt"
4402 (("find_package\\(ament_cmake REQUIRED\\)") "")
4403 (("ament_.*") "")
4404 (("(RUNTIME DESTINATION) .*" all dst)
4405 (string-append dst " libexec/${PROJECT_NAME}")))))
4406 (add-after 'install 'symlink
4407 (lambda* (#:key outputs #:allow-other-keys)
4408 (let ((out (assoc-ref outputs "out")))
4409 (mkdir-p (string-append out "/bin"))
4410 (for-each (lambda (link)
4411 (symlink
4412 (string-append out "/libexec/popf/" (cdr link))
4413 (string-append out "/bin/" (car link))))
4414 '(("popf" . "popf") ("VAL" . "validate")))))))))
4415 (inputs (list cbc flex))
4416 (native-inputs (list flex bison perl))
4417 (home-page "https://github.com/fmrico/popf")
4418 (synopsis "Forward-chaining temporal planner")
4419 (description "This package contains an implementation of the @acronym{POPF,
4420Partial Order Planning Forwards} planner described in @cite{Forward-Chaining
4421Partial Order Planning}, that has been updated to compile with newer C++
4422compilers.")
4423 (license license:gpl2+)))
4424
4425(define-public ppl
4426 (package
4427 (name "ppl")
4428 (version "1.2")
4429 (source
4430 (origin
4431 (method url-fetch)
4432 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
4433 "ftp/releases/" version
4434 "/ppl-" version ".tar.gz"))
4435 (sha256
4436 (base32
4437 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
4438 (build-system gnu-build-system)
4439 (native-inputs
4440 (list m4))
4441 (inputs
4442 (list glpk gmp))
4443 (home-page "https://www.bugseng.com/parma-polyhedra-library")
4444 (synopsis
4445 "Parma Polyhedra Library for computations with polyhedra")
4446 (description
4447 "The Parma Polyhedra Library (PPL) provides numerical abstractions
4448especially targeted at applications in the field of analysis and
4449verification of complex systems. These abstractions include convex
4450polyhedra, defined as the intersection of a finite number of (open or
4451closed) halfspaces, each described by a linear inequality (strict or
4452non-strict) with rational coefficients; some special classes of polyhedra
4453shapes that offer interesting complexity/precision tradeoffs; and grids
4454which represent regularly spaced points that satisfy a set of linear
4455congruence relations. The library also supports finite powersets and
4456products of (any kind of) polyhedra and grids, a mixed integer linear
4457programming problem solver using an exact-arithmetic version of the simplex
4458algorithm, a parametric integer programming solver, and primitives for
4459termination analysis via the automatic synthesis of linear ranking
4460functions.")
4461 (license license:gpl3+)))
4462
4463(define-public primecount
4464 (package
4465 (name "primecount")
4466 (version "8.6")
4467 (source
4468 (origin
4469 (method git-fetch)
4470 (uri (git-reference
4471 (url "https://github.com/kimwalisch/primecount")
4472 (commit (string-append "v" version))))
4473 (file-name (git-file-name name version))
4474 (sha256
4475 (base32
4476 "0xm0dzdjnm877gndh7r0mj0pgqx42f0v5vnhjx6ig7gv5g0c2s92"))))
4477 (build-system cmake-build-system)
4478 (arguments
4479 (list
4480 #:configure-flags
4481 #~(list "-DBUILD_LIBPRIMESIEVE=OFF"
4482 "-DBUILD_MANPAGE=ON"
4483 "-DBUILD_SHARED_LIBS=ON"
4484 "-DBUILD_STATIC_LIBS=OFF"
4485 "-DBUILD_TESTS=ON")))
4486 (native-inputs
4487 (list asciidoc))
4488 (inputs
4489 (list primesieve))
4490 (synopsis "Fast prime counting function implementations")
4491 (description
4492 "@code{primecount} is a command-line program and C/C++ library that
4493counts the number of primes no greater than x (maximum 1031) using highly
4494optimized implementations of the combinatorial prime counting algorithms.")
4495 (home-page "https://github.com/kimwalisch/primecount")
4496 (license license:bsd-2)))
4497
4498(define-public primesieve
4499 (package
4500 (name "primesieve")
4501 (version "12.10")
4502 (source
4503 (origin
4504 (method git-fetch)
4505 (uri (git-reference
4506 (url "https://github.com/kimwalisch/primesieve")
4507 (commit (string-append "v" version))))
4508 (file-name (git-file-name name version))
4509 (sha256
4510 (base32
4511 "0vlhhrylv63dmcf9kgsg15596pj06iflfnvjph3w8zlfaajwv9gd"))))
4512 (build-system cmake-build-system)
4513 (arguments
4514 (list
4515 #:configure-flags
4516 #~(list "-DBUILD_STATIC_LIBS=OFF"
4517 "-DBUILD_TESTS=ON")))
4518 (synopsis "Prime number generator")
4519 (description
4520 "@code{primesieve} is a command-line program and C/C++ library for
4521quickly generating prime numbers. It is very cache efficient, it detects your
4522CPU's L1 & L2 cache sizes and allocates its main data structures accordingly.
4523It is also multi-threaded by default, it uses all available CPU cores whenever
4524possible i.e. if sequential ordering is not required. primesieve can generate
4525primes and prime k-tuplets up to 264.")
4526 (home-page "https://github.com/kimwalisch/primesieve")
4527 (license license:bsd-2)))
4528
4529;; It is unfortunate that we cannot just link with the existing blis package.
4530(define-public python-blis
4531 (package
4532 (name "python-blis")
4533 (version "1.3.3")
4534 (source
4535 (origin
4536 (method git-fetch)
4537 (uri (git-reference
4538 (url "https://github.com/explosion/cython-blis")
4539 (commit (string-append "release-v" version))))
4540 (file-name (git-file-name name version))
4541 (sha256
4542 (base32 "0ncr47054iy16wapb5yndr6rf3mh8wvi54ljgs791qp3i2yvjb08"))))
4543 (build-system pyproject-build-system)
4544 (arguments
4545 (list
4546 #:phases
4547 #~(modify-phases %standard-phases
4548 (add-before 'check 'remove-local-blis
4549 (lambda _
4550 (copy-recursively "blis/tests" "tests")
4551 ;; This would otherwise interfere with finding the installed
4552 ;; blis when running tests.
4553 (delete-file-recursively "blis"))))))
4554 (native-inputs
4555 (list python-cython
4556 python-numpy
4557 python-pytest
4558 python-setuptools))
4559 (home-page "https://github.com/explosion/cython-blis")
4560 (synopsis "Blis as a self-contained C-extension for Python")
4561 (description
4562 "This package provides the Blis BLAS-like linear algebra library, as a
4563self-contained C-extension for Python.")
4564 (license license:bsd-3)))
4565
4566(define-public python-constraint2
4567 (package
4568 (name "python-constraint2")
4569 (version "2.5.0")
4570 (source
4571 (origin
4572 (method git-fetch)
4573 (uri (git-reference
4574 (url "https://github.com/python-constraint/python-constraint")
4575 (commit version)))
4576 (file-name (git-file-name name version))
4577 (sha256
4578 (base32 "1y62jvgb5dm91abgfs3cy260y1lxiwpvirs378a3lj4mrlmrqdsm"))))
4579 (build-system pyproject-build-system)
4580 (arguments
4581 (list
4582 #:test-flags
4583 #~(list "--ignore=tests/test_toml_file.py" ;release information tests
4584 "--ignore=tests/test_util_benchmark.py")
4585 #:phases
4586 #~(modify-phases %standard-phases
4587 (add-after 'unpack 'fix-pytest-config
4588 (lambda _
4589 ;; Drop test coverage requirements
4590 (substitute* "pyproject.toml"
4591 (("--cov(-[^ ]*)?([ =][^ \"]*)?") "")))))))
4592 (native-inputs
4593 (list python-cython
4594 python-poetry-core ;actual build backend
4595 python-pytest
4596 python-setuptools)) ;required for cythonization
4597 (home-page "https://python-constraint.github.io/python-constraint")
4598 (synopsis "Constraint satisfaction problem resolver for Python")
4599 (description
4600 "The @code{python-constraint} module offers efficient solvers for
4601@url{https://en.wikipedia.org/wiki/Constraint_satisfaction_problem, constraint
4602satisfaction problems} over finite domains in an accessible Python package.")
4603 (license license:bsd-3)))
4604
4605(define-public python-cvxopt
4606 (package
4607 (name "python-cvxopt")
4608 (version "1.3.3")
4609 (source
4610 (origin
4611 (method git-fetch)
4612 (uri (git-reference
4613 (url "https://github.com/cvxopt/cvxopt")
4614 (commit version)))
4615 (file-name (git-file-name name version))
4616 (sha256
4617 (base32 "0g2lddikgmvi838b5vgfy7kbdvqsvzxrvw3i8pxq1q378dwsyp0d"))))
4618 (build-system pyproject-build-system)
4619 (arguments
4620 (list
4621 #:phases
4622 #~(modify-phases %standard-phases
4623 (add-after 'unpack 'find-libraries
4624 (lambda* (#:key inputs #:allow-other-keys)
4625 (setenv "CVXOPT_BLAS_LIB" "openblas")
4626 (setenv "CVXOPT_LAPACK_LIB" "openblas")
4627 (setenv "CVXOPT_BUILD_FFTW" "1")
4628 (setenv "CVXOPT_BUILD_GLPK" "1")
4629 (setenv "CVXOPT_BUILD_GSL" "1"))))))
4630 (native-inputs (list python-pytest python-setuptools))
4631 (inputs (list fftw glpk gsl openblas suitesparse))
4632 (home-page "https://www.cvxopt.org")
4633 (synopsis "Python library for convex optimization")
4634 (description
4635 "CVXOPT is a package for convex optimization based on the Python
4636programming language. Its main purpose is to make the development of software
4637for convex optimization applications straightforward by building on Python’s
4638extensive standard library and on the strengths of Python as a high-level
4639programming language.")
4640 (license license:gpl3+)))
4641
4642(define-public python-ducc0
4643 (package
4644 (name "python-ducc0")
4645 (version "0.37.1")
4646 (source
4647 (origin
4648 (method git-fetch)
4649 (uri (git-reference
4650 (url "https://gitlab.mpcdf.mpg.de/mtr/ducc")
4651 (commit (string-append
4652 "ducc0_" (string-replace-substring version "." "_")))))
4653 (file-name (git-file-name name version))
4654 (sha256
4655 (base32 "0pckbip2ffmiwm73wrpvif3gy0a09v9b9kbyallp520l6l69n4k8"))))
4656 (build-system pyproject-build-system)
4657 (arguments
4658 (list
4659 #:test-flags
4660 #~(list "--numprocesses" (number->string (parallel-job-count))
4661 "python/test")
4662 #:phases
4663 #~(modify-phases %standard-phases
4664 (add-before 'build 'set-env
4665 (lambda _
4666 (setenv "DUCC0_OPTIMIZATION" "portable-strip"))))))
4667 (native-inputs
4668 (list cmake-minimal
4669 pybind11-2
4670 python-nanobind
4671 python-pytest
4672 python-pytest-xdist
4673 python-scikit-build-core
4674 python-setuptools))
4675 (propagated-inputs
4676 (list python-numpy))
4677 (home-page "https://gitlab.mpcdf.mpg.de/mtr/ducc")
4678 (synopsis "Distinctly Useful Code Collection")
4679 (description
4680 "This package provides a collection of basic programming tools for
4681numerical computation, including Fast Fourier Transforms, Spherical Harmonic
4682Transforms, non-equispaced Fourier transforms, as well as some concrete
4683applications like 4pi convolution on the sphere and gridding/degridding of
4684radio interferometry data.")
4685 (license license:gpl2+)))
4686
4687(define-public python-kiwisolver
4688 (package
4689 (name "python-kiwisolver")
4690 (version "1.5.0")
4691 (source
4692 (origin
4693 (method git-fetch)
4694 (uri (git-reference
4695 (url "https://github.com/nucleic/kiwi")
4696 (commit version)))
4697 (file-name (git-file-name name version))
4698 (sha256
4699 (base32 "18fxn3nvc6917mkm0as7088m794fqdp8rlk4qgypva9fir1br1r6"))))
4700 (build-system pyproject-build-system)
4701 (native-inputs
4702 (list python-cppy
4703 python-pytest
4704 python-setuptools
4705 python-setuptools-scm))
4706 (home-page "https://github.com/nucleic/kiwi")
4707 (synopsis "Fast implementation of the Cassowary constraint solver")
4708 (description
4709 "Kiwi is an efficient C++ implementation of the Cassowary constraint
4710solving algorithm. Kiwi has been designed from the ground up to be
4711lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
4712Cassowary solver with typical use cases gaining a 40x improvement. Memory
4713savings are consistently > 5x.")
4714 (license license:bsd-3)))
4715
4716(define-public python-libensemble
4717 (package
4718 (name "python-libensemble")
4719 (version "1.6.0")
4720 (source
4721 (origin
4722 (method git-fetch)
4723 (uri (git-reference
4724 (url "https://github.com/Libensemble/libensemble")
4725 (commit (string-append "v" version))))
4726 (file-name (git-file-name name version))
4727 (sha256
4728 (base32 "1381xnhf8mrpbkhzaibqf0k8rmvb0bsjjfv0wjrf052yv1jzjimx"))))
4729 (build-system pyproject-build-system)
4730 (arguments
4731 (list
4732 ;; tests: 180 passed, 13 skipped
4733 #:phases
4734 #~(modify-phases %standard-phases
4735 (replace 'check
4736 (lambda* (#:key tests? #:allow-other-keys)
4737 (when tests?
4738 (substitute* '("libensemble/tests/unit_tests/test_executor.py"
4739 "libensemble/tests/unit_tests/test_resources.py")
4740 (((string-join
4741 ;; Tests expecting running MPI.
4742 (list "(test_finish_and_kill"
4743 "test_futures_interface"
4744 "test_futures_interface_cancel"
4745 "test_get_local_nodelist_.*_not_in_list"
4746 "test_get_local_resources_dedicated_mode"
4747 "test_kill_on_file"
4748 "test_kill_on_timeout"
4749 "test_kill_on_timeout_polling_loop_method"
4750 "test_launch_and_poll"
4751 "test_launch_and_poll_multitasks"
4752 "test_launch_and_wait"
4753 "test_launch_and_wait_no_platform"
4754 "test_launch_and_wait_timeout"
4755 "test_launch_as_gen"
4756 "test_launch_wait_on_start"
4757 "test_machinefile_from_resources"
4758 "test_procs_and_machinefile_logic"
4759 "test_wresources_set_gpus"
4760 "test_wresources_set_gpus_by_platform"
4761 "test_wresources_set_gpus_by_platform_gpu_tiles"
4762 "test_wresources_set_gpus_x2"
4763 "test_wresources_set_limit_gpus"
4764 "test_wresources_set_no_gpus)")
4765 "|") all)
4766 (string-append "__off_" all)))
4767 (invoke "python" "libensemble/tests/run_tests.py" "-u")))))))
4768 (native-inputs
4769 (list openmpi
4770 python-mock
4771 python-mpi4py
4772 python-pytest
4773 python-pytest-cov ;custom test config
4774 python-pytest-timeout
4775 python-rich
4776 python-setuptools))
4777 (propagated-inputs
4778 (list python-gest-api
4779 python-mpmath
4780 python-numpy
4781 python-psutil
4782 python-pydantic
4783 python-pyyaml
4784 python-tomli))
4785 (home-page "https://github.com/Libensemble/libensemble")
4786 (synopsis "Toolkit for dynamic ensembles of calculations")
4787 (description "@code{libensemble} is a complete toolkit for dynamic
4788ensembles of calculations. It connects @code{deciders} to experiments or
4789simulations.")
4790 (license license:bsd-3)))
4791
4792(define-public python-ndim
4793 (package
4794 (name "python-ndim")
4795 (version "0.1.6")
4796 (source
4797 (origin
4798 (method git-fetch)
4799 (uri (git-reference
4800 (url "https://github.com/diego-hayashi/ndim")
4801 (commit (string-append "v" version))))
4802 (file-name (git-file-name name version))
4803 (sha256
4804 (base32 "1hri82k7pcpw9dns8l1f2asa3dm7hjv71wnxi3752258ia2qa44v"))))
4805 (build-system pyproject-build-system)
4806 (propagated-inputs (list python-sympy))
4807 (native-inputs (list python-flit-core python-pytest))
4808 (home-page "https://github.com/diego-hayashi/ndim")
4809 (synopsis "Multidimensional volumes and monomial integrals")
4810 (description
4811 "@code{ndim} computes all kinds of volumes and integrals of
4812monomials over such volumes in a fast, numerically stable way, using
4813recurrence relations.")
4814 (license license:gpl3+)))
4815
4816(define-public python-petsc4py
4817 (package
4818 (name "python-petsc4py")
4819 (version "3.24.0")
4820 (source
4821 (origin
4822 (method url-fetch)
4823 (uri (pypi-uri "petsc4py" version))
4824 (sha256
4825 (base32 "06wi2r43drlfj3hml5392pckn2n99rjfb1p1hz75n3d84z5jrj9x"))))
4826 (build-system pyproject-build-system)
4827 (arguments
4828 (list
4829 #:phases
4830 #~(modify-phases %standard-phases
4831 (add-before 'build 'set-PETSC_DIR
4832 (lambda* (#:key inputs #:allow-other-keys)
4833 ;; Define path to PETSc installation.
4834 (setenv "PETSC_DIR"
4835 (assoc-ref inputs "petsc-openmpi"))))
4836 (add-before 'check 'mpi-setup #$%openmpi-setup)
4837 (replace 'check
4838 (lambda* (#:key tests? #:allow-other-keys)
4839 (when tests?
4840 (invoke "python" "test/runtests.py")))))))
4841 (native-inputs (list python-cython python-setuptools))
4842 (inputs (list petsc-openmpi python-numpy))
4843 (home-page "https://bitbucket.org/petsc/petsc4py/")
4844 (synopsis "Python bindings for PETSc")
4845 (description "PETSc, the Portable, Extensible Toolkit for
4846Scientific Computation, is a suite of data structures and routines for
4847the scalable (parallel) solution of scientific applications modeled by
4848partial differential equations. It employs the MPI standard for all
4849message-passing communication. @code{petsc4py} provides Python
4850bindings to almost all functions of PETSc.")
4851 (license license:bsd-3)))
4852
4853(define-public python-primecountpy
4854 (package
4855 (name "python-primecountpy")
4856 (version "0.2.1")
4857 (source
4858 (origin
4859 (method git-fetch) ; Fetch from GitHub to avoid precompiled files
4860 (uri (git-reference
4861 (url "https://github.com/dimpase/primecountpy")
4862 (commit (string-append "v" version))))
4863 (file-name (git-file-name name version))
4864 (sha256
4865 (base32 "0ddv2r6mwn2p2xgi6pa50mjirxb0zj10ngimfpak36yaj8bp0as1"))))
4866 (build-system pyproject-build-system)
4867 (arguments
4868 (list #:tests? #f)) ; there are no tests
4869 (native-inputs
4870 (list pkg-config
4871 python-cysignals
4872 python-cython
4873 python-meson))
4874 (inputs
4875 (list pari-gp
4876 primecount
4877 primesieve))
4878 (home-page "https://github.com/dimpase/primecountpy")
4879 (synopsis "Cython interface for C++ primecount library")
4880 (description "This package provides a Cython interface to the C++ library
4881@code{primecount}.")
4882 ;; pyproject.toml says gpl3 but file headers say gpl2+, see
4883 ;; <https://github.com/dimpase/primecountpy/issues/16>.
4884 (license license:gpl2+)))
4885
4886(define-public python-py-bobyqa
4887 (package
4888 (name "python-py-bobyqa")
4889 (version "1.5.0")
4890 (source
4891 (origin
4892 (method git-fetch) ;no tests in PyPI release
4893 (uri (git-reference
4894 (url "https://github.com/numericalalgorithmsgroup/pybobyqa")
4895 (commit (string-append "v" version))))
4896 (file-name (git-file-name name version))
4897 (sha256
4898 (base32 "0k9iapdlbp1k2ck1550ckw0y75f71gxzqkv4clz89ym4fwqwszv2"))))
4899 (build-system pyproject-build-system)
4900 (native-inputs
4901 (list python-pytest
4902 python-setuptools
4903 python-wheel))
4904 (propagated-inputs
4905 (list python-numpy
4906 python-pandas
4907 python-scipy
4908 python-setuptools))
4909 (home-page "https://github.com/numericalalgorithmsgroup/pybobyqa")
4910 (synopsis "Derivative-free solver for general objective minimization")
4911 (description
4912 "Py-BOBYQA is a flexible package for solving bound-constrained general
4913objective minimization, without requiring derivatives of the objective. At
4914its core, it is a Python implementation of the BOBYQA algorithm by Powell,but
4915Py-BOBYQA has extra features improving its performance on some problems.
4916Py-BOBYQA is particularly useful when evaluations of the objective function
4917are expensive and/or noisy.")
4918 (license license:gpl3)))
4919
4920(define-public python-pyglm
4921 (package
4922 (name "python-pyglm")
4923 (version "2.8.1")
4924 (source
4925 (origin
4926 ;; Test files are not included in the archive in pypi.
4927 (method git-fetch)
4928 (uri (git-reference
4929 (url "https://github.com/Zuzu-Typ/PyGLM")
4930 (commit version)
4931 ;; XXX: Attempt to use Guix's [email protected] failed, try to figure out
4932 ;; how to fix it.
4933 (recursive? #t)))
4934 (file-name (git-file-name name version))
4935 (sha256
4936 (base32
4937 "1ra54m0pb5aca7q6ymappjsyxdzdy17yz8rrhlql04k0p9lnf1v8"))))
4938 (build-system pyproject-build-system)
4939 (native-inputs
4940 (list python-pytest
4941 python-setuptools
4942 python-wheel))
4943 (home-page "https://github.com/Zuzu-Typ/PyGLM")
4944 (synopsis "OpenGL Mathematics library for Python")
4945 (description "PyGLM is a Python extension library which brings the OpenGL
4946Mathematics (GLM) library to Python.")
4947 (license license:zlib)))
4948
4949(define-public python-simplesat
4950 (package
4951 (name "python-simplesat")
4952 (version "0.9.2")
4953 (source
4954 (origin
4955 (method git-fetch)
4956 (uri (git-reference
4957 (url "https://github.com/enthought/sat-solver")
4958 (commit (string-append "v" version))))
4959 (file-name (git-file-name name version))
4960 (sha256
4961 (base32 "0z44pi8yb6pvc9bisl3qnn3glj7ir0ad2j4gd4jfg2kxvwvi0w0b"))))
4962 (build-system pyproject-build-system)
4963 (arguments
4964 (list
4965 #:test-flags #~(list "--ignore=old")))
4966 (native-inputs
4967 (list python-mock
4968 python-pytest
4969 python-pyyaml
4970 python-setuptools))
4971 (propagated-inputs
4972 (list python-attrs
4973 python-okonomiyaki
4974 python-six))
4975 (home-page "https://github.com/enthought/sat-solver")
4976 (synopsis
4977 "@acronym{SAT, Boolean Satisfiability Problem} dependency handling")
4978 (description
4979 "This package provides a prototype Python implementation for SAT-based
4980problems.")
4981 (license license:bsd-3)))
4982
4983(define-public slepc
4984 (package
4985 (name "slepc")
4986 (version "3.24.0")
4987 (source
4988 (origin
4989 (method url-fetch)
4990 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
4991 version ".tar.gz"))
4992 (sha256
4993 (base32
4994 "1sdl9hv34pckwkxjq2spiyc6k5czd9y4m852k338l4x9ib4i8bbf"))))
4995 (build-system gnu-build-system)
4996 (native-inputs
4997 `(("python" ,python)
4998 ("which" ,which)
4999 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
5000 (inputs
5001 `(("arpack" ,arpack-ng)
5002 ("gfortran" ,gfortran)))
5003 (propagated-inputs
5004 (list petsc))
5005 (arguments
5006 `(#:parallel-build? #f ;build is parallel by default
5007 #:configure-flags
5008 `(,(string-append "--with-arpack-dir="
5009 (assoc-ref %build-inputs "arpack") "/lib"))
5010 #:make-flags ;honor (parallel-job-count)
5011 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
5012 ,(string-append "PETSCCONFIGDIR="
5013 (assoc-ref %build-inputs "petsc:examples")
5014 "/share/petsc/examples/config"))
5015 #:phases
5016 (modify-phases %standard-phases
5017 (replace 'configure
5018 ;; configure is a python script, so we can't run it with bash.
5019 (lambda* (#:key inputs outputs (configure-flags '())
5020 #:allow-other-keys)
5021 (let* ((prefix (assoc-ref outputs "out"))
5022 (flags `(,(string-append "--prefix=" prefix)
5023 ,@configure-flags)))
5024 (format #t "build directory: ~s~%" (getcwd))
5025 (format #t "configure flags: ~s~%" flags)
5026 (setenv "SLEPC_DIR" (getcwd))
5027 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
5028 (apply invoke "./configure" flags))))
5029 (add-after 'install 'delete-doc
5030 ;; TODO: SLEPc installs HTML documentation alongside headers in
5031 ;; $out/include. We'd like to move them to share/doc, but delete
5032 ;; them for now, as they are incomplete and installing the complete
5033 ;; documentation is difficult.
5034 (lambda* (#:key outputs #:allow-other-keys)
5035 (let* ((out (assoc-ref outputs "out")))
5036 (for-each delete-file (find-files out "\\.html$"))
5037 #t)))
5038 (add-after 'install 'clean-install
5039 ;; Clean up unnecessary build logs from installation.
5040 (lambda* (#:key outputs #:allow-other-keys)
5041 (let ((out (assoc-ref outputs "out")))
5042 (for-each (lambda (file)
5043 (let ((f (string-append out "/lib/slepc/conf/" file)))
5044 (when (file-exists? f)
5045 (delete-file f))))
5046 '("configure.log" "make.log" "gmake.log"
5047 "test.log" "error.log" "RDict.db"
5048 "uninstall.py"))
5049 #t))))))
5050 (home-page "https://slepc.upv.es")
5051 (synopsis "Scalable library for eigenproblems")
5052 (description "SLEPc is a software library for the solution of large sparse
5053eigenproblems on parallel computers. It can be used for the solution of
5054linear eigenvalue problems formulated in either standard or generalized form,
5055as well as other related problems such as the singular value decomposition.
5056The emphasis of the software is on methods and techniques appropriate for
5057problems in which the associated matrices are sparse, for example, those
5058arising after the discretization of partial differential equations.")
5059 (license license:bsd-2)
5060 (properties
5061 `((release-monitoring-url . "http://slepc.upv.es/download/")))))
5062
5063(define-public slepc-complex
5064 (package (inherit slepc)
5065 (name "slepc-complex")
5066 (propagated-inputs
5067 `(("petsc" ,petsc-complex)
5068 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
5069 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
5070
5071(define-public slepc-openmpi
5072 (package (inherit slepc)
5073 (name "slepc-openmpi")
5074 (arguments
5075 (substitute-keyword-arguments arguments
5076 ((#:phases phases '%standard-phases)
5077 `(modify-phases ,phases
5078 (add-before 'check 'mpi-setup
5079 ,%openmpi-setup)))))
5080 (inputs
5081 `(("mpi" ,openmpi)
5082 ,@(alist-delete "arpack" (package-inputs slepc))))
5083 (propagated-inputs
5084 `(("petsc" ,petsc-openmpi)
5085 ("arpack" ,arpack-ng-openmpi)
5086 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
5087 (synopsis "Scalable library for eigenproblems (with MPI support)")))
5088
5089(define-public slepc-complex-openmpi
5090 (package (inherit slepc-openmpi)
5091 (name "slepc-complex-openmpi")
5092 (propagated-inputs
5093 `(("petsc" ,petsc-complex-openmpi)
5094 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
5095 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
5096
5097(define-public python-slepc4py
5098 (package
5099 (name "python-slepc4py")
5100 (version "3.24.0")
5101 (source
5102 (origin
5103 (method url-fetch)
5104 (uri (pypi-uri "slepc4py" version))
5105 (sha256
5106 (base32 "1wiqcwgr9mq81dd68glsnwn57gqmgahcvcchqqqq3ns7bykvdjah"))))
5107 (build-system pyproject-build-system)
5108 (arguments
5109 (list
5110 #:phases
5111 #~(modify-phases %standard-phases
5112 (add-before 'build 'pre-build
5113 (lambda* (#:key inputs #:allow-other-keys)
5114 ;; Define path to PETSc installation.
5115 (setenv "PETSC_DIR"
5116 (assoc-ref inputs "petsc-openmpi"))
5117 ;; Define path to SLEPc installation.
5118 (setenv "SLEPC_DIR"
5119 (assoc-ref inputs "slepc-openmpi"))))
5120 (add-before 'check 'mpi-setup
5121 #$%openmpi-setup)
5122 (replace 'check
5123 (lambda* (#:key tests? #:allow-other-keys)
5124 (when tests?
5125 (invoke "python" "test/runtests.py")))))))
5126 (native-inputs (list python-cython python-setuptools))
5127 (inputs (list python-numpy python-petsc4py petsc-openmpi slepc-openmpi))
5128 (home-page "https://bitbucket.org/slepc/slepc4py/")
5129 (synopsis "Python bindings for SLEPc")
5130 (description
5131 "SLEPc, the Scalable Library for Eigenvalue Problem Computations, is
5132based on PETSc, the Portable, Extensible Toolkit for Scientific Computation.
5133It employs the MPI standard for all message-passing communication.
5134@code{slepc4py} provides Python bindings to almost all functions of SLEPc.")
5135 (license license:bsd-3)))
5136
5137(define-public metamath
5138 (package
5139 (name "metamath")
5140 (version "0.193")
5141 (source
5142 (origin
5143 (method git-fetch)
5144 (uri (git-reference
5145 (url "https://github.com/metamath/metamath-exe")
5146 (commit (string-append "v" version))))
5147 (file-name (git-file-name name version))
5148 (sha256
5149 (base32 "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b"))))
5150 (build-system gnu-build-system)
5151 (native-inputs
5152 (list autoconf automake))
5153 (home-page "https://us.metamath.org/")
5154 (synopsis "Proof verifier based on a minimalistic formalism")
5155 (description
5156 "Metamath is a tiny formal language and that can express theorems in
5157abstract mathematics, with an accompyaning @command{metamath} executable that
5158verifies databases of these proofs. There is a public database,
5159@url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
5160logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
5161associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
5162the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
5163book.")
5164 (license license:gpl2+)))
5165
5166(define-public minizinc
5167 (package
5168 (name "minizinc")
5169 (version "2.8.4")
5170 (source (origin
5171 (method git-fetch)
5172 (uri (git-reference
5173 (url "https://github.com/MiniZinc/libminizinc")
5174 (commit version)))
5175 (file-name (git-file-name name version))
5176 (sha256
5177 (base32
5178 "03iliizyadd0wvx6a63rg22lb6p4m6krhlpfm2hfzwj66y3a76j6"))
5179 (modules '((guix build utils)
5180 (ice-9 ftw)
5181 (srfi srfi-1)))
5182 (snippet
5183 '(begin
5184 ;; Do not advertise proprietary solvers
5185 (with-directory-excursion "cmake/targets"
5186 (let ((targets '("libminizinc_fzn.cmake"
5187 "libminizinc_gecode.cmake"
5188 "libminizinc_mip.cmake"
5189 "libminizinc_nl.cmake"
5190 "libminizinc_osicbc.cmake"
5191 "libminizinc_parser.cmake"
5192 "libmzn.cmake"
5193 "minizinc.cmake"
5194 "mzn2doc.cmake")))
5195 (for-each delete-file
5196 (remove
5197 (lambda (file)
5198 (member file (cons* "." ".." targets)))
5199 (scandir ".")))
5200 (substitute* "libmzn.cmake"
5201 (("include\\(cmake/targets/(.*)\\)" all target)
5202 (if (member target targets) all "")))))
5203 (with-directory-excursion "include/minizinc/solvers/MIP"
5204 (for-each delete-file
5205 (remove
5206 (lambda (file)
5207 (member file '("." ".."
5208 "MIP_osicbc_solverfactory.hh"
5209 "MIP_osicbc_wrap.hh"
5210 "MIP_solverinstance.hh"
5211 "MIP_solverinstance.hpp"
5212 "MIP_wrap.hh")))
5213 (scandir "."))))
5214 (with-directory-excursion "solvers/MIP"
5215 (for-each delete-file
5216 (remove
5217 (lambda (file)
5218 (member file '("." ".."
5219 "MIP_osicbc_solverfactory.cpp"
5220 "MIP_osicbc_wrap.cpp"
5221 "MIP_solverinstance.cpp"
5222 "MIP_wrap.cpp")))
5223 (scandir "."))))
5224 (substitute* "CMakeLists.txt"
5225 (("find_package\\(([^ ]*).*\\)" all pkg)
5226 (if (member pkg '("Gecode" "OsiCBC" "Threads"))
5227 all
5228 "")))
5229 ;; TODO: swap out miniz for zlib
5230 #t))))
5231 (build-system cmake-build-system)
5232 (arguments
5233 (list
5234 #:tests? #f ; no ‘check’ target
5235 #:modules '((guix build cmake-build-system)
5236 (guix build utils)
5237 (srfi srfi-1))
5238 #:phases
5239 #~(modify-phases %standard-phases
5240 (add-after 'install 'install-solver-configs
5241 (lambda _
5242 (let ((chuffed #$(this-package-input "chuffed"))
5243 (gecode #$(this-package-input "gecode"))
5244 (or-tools #$(this-package-input "or-tools"))
5245 (pkgdatadir (string-append #$output
5246 "/share/minizinc")))
5247 (call-with-output-file (string-append pkgdatadir
5248 "/Preferences.json")
5249 (lambda (port)
5250 (display "\
5251{
5252 \"tagDefaults\": [
5253 [\"\", \"org.gecode.gecode\"],
5254 [\"gecode\", \"org.gecode.gecode\"]
5255 ],
5256 \"solverDefaults\": []
5257}"
5258 port)
5259 (newline port)))
5260 (for-each
5261 (lambda (solver)
5262 (copy-recursively
5263 (string-append solver "/share/minizinc/solvers")
5264 (string-append pkgdatadir "/solvers")))
5265 (list chuffed gecode or-tools))))))))
5266 (native-inputs
5267 (list bison flex))
5268 (inputs
5269 (list cbc chuffed gecode or-tools zlib))
5270 (home-page "https://www.minizinc.org")
5271 (synopsis "High-level constraint modeling language")
5272 (description "MiniZinc is a high-level modeling language for constraint
5273satisfaction and optimization problems. Models are compiled to FlatZinc, a
5274language understood by many solvers.")
5275 (license license:mpl2.0)))
5276
5277(define-public mumps
5278 (package
5279 (name "mumps")
5280 (version "5.8.0")
5281 (source
5282 (origin
5283 (method url-fetch)
5284 (uri (string-append "https://mumps-solver.org/MUMPS_" version
5285 ".tar.gz"))
5286 (sha256
5287 (base32
5288 "18208d3klhv08p4kgbbp332wf11x0iyi7z4c7fcs0hwq3n5ynqnp"))))
5289 (build-system gnu-build-system)
5290 (inputs
5291 (list gfortran
5292 ;; These are required for linking against mumps, but we let the user
5293 ;; declare the dependency.
5294 openblas
5295 metis
5296 scotch))
5297 (arguments
5298 `(#:modules ((ice-9 match)
5299 (ice-9 popen)
5300 (srfi srfi-1)
5301 ,@%default-gnu-modules)
5302 #:phases
5303 (modify-phases %standard-phases
5304 (replace 'configure
5305 (lambda* (#:key inputs outputs #:allow-other-keys)
5306 (call-with-output-file "Makefile.inc"
5307 (lambda (port)
5308 (format port "
5309PLAT =
5310LIBEXT = .a
5311LIBEXT_SHARED = .so
5312OUTC = -o
5313OUTF = -o
5314BLASDIR = ~a
5315LIBBLAS = -Wl,-rpath=$(BLASDIR)/lib -Wl,-rpath='$$ORIGIN'
5316LIBBLAS += -L$(BLASDIR)/lib
5317LIBBLAS += -lopenblas~@[
5318SCALAPDIR = ~a
5319SCALAP = -Wl,-rpath=$(SCALAPDIR)/lib -Wl,-rpath='$$ORIGIN'
5320SCALAP += -L$(SCALAPDIR)/lib -lscalapack~]
5321RM = rm -f~:[
5322CC = gcc
5323FC = gfortran
5324FL = gfortran
5325INCSEQ = -I$(topdir)/libseq
5326LIBSEQ = $(LAPACK) -L$(topdir)/libseq -lmpiseq
5327LIBSEQNEEDED = libseqneeded
5328INCS = $(INCSEQ)
5329LIBS = $(LIBSEQ)~;
5330CC = mpicc
5331FC = mpifort
5332FL = mpifort
5333INCPAR =
5334LIBPAR = $(SCALAP) $(LAPACK)
5335LIBSEQNEEDED =
5336INCS = $(INCPAR)
5337LIBS = $(LIBPAR)~]
5338AR = ar vr # rules require trailing space, ugh...
5339RANLIB = ranlib
5340LIBOTHERS = -pthread
5341CDEFS = -DAdd_
5342PIC = -fPIC
5343FPIC_OPT = $(PIC)
5344RPATH_OPT = -Wl,-rpath,~a/lib
5345OPTF = -O2 -fopenmp -DALLOW_NON_INIT -DBLR_MT
5346OPTF += -fallow-argument-mismatch $(PIC)
5347OPTL = -O2 -fopenmp $(PIC)
5348OPTC = -O2 -fopenmp $(PIC)
5349LPORDDIR = $(topdir)/PORD/lib
5350IPORD = -I$(topdir)/PORD/include
5351LPORD = -L$(LPORDDIR) -lpord
5352SONAME = -soname
5353SHARED_OPT = -shared
5354ORDERINGSF = -Dpord~@[
5355METISDIR = ~a
5356IMETIS = -I$(METISDIR)/include
5357LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
5358ORDERINGSF += -Dmetis~]~@[~:{
5359SCOTCHDIR = ~a
5360ISCOTCH = -I$(SCOTCHDIR)/include
5361LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a -lesmumps
5362LSCOTCH += -lscotch -lscotcherr
5363ORDERINGSF += ~a~}~]
5364ORDERINGSC = $(ORDERINGSF)
5365LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
5366IORDERINGSF = $(ISCOTCH)
5367IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
5368 (assoc-ref inputs "openblas")
5369 (assoc-ref inputs "scalapack")
5370 (->bool (which "mpicc")) ;; MPI support enabled?
5371 (assoc-ref outputs "out")
5372 (assoc-ref inputs "metis")
5373 (match (list (assoc-ref inputs "pt-scotch")
5374 (assoc-ref inputs "scotch"))
5375 ((#f #f)
5376 #f)
5377 ((#f scotch)
5378 `((,scotch "" "-Dscotch")))
5379 ((ptscotch _)
5380 `((,ptscotch
5381 "-lesmumps -lptscotch -lptscotcherr "
5382 "-Dptscotch")))))))))
5383 (replace 'build
5384 ;; By default only the d-precision library is built. Make with "all"
5385 ;; target so that all precision libraries and examples are built.
5386 ;; Then, "make allshared" builts equivalent shared libraries as well.
5387 (lambda _
5388 (invoke "make" "all"
5389 (format #f "-j~a" (parallel-job-count)))
5390 (invoke "make" "allshared"
5391 (format #f "-j~a" (parallel-job-count)))))
5392 (replace 'check
5393 ;; Run the simple test drivers, which read test input from stdin:
5394 ;; from the "real" input for the single- and double-precision
5395 ;; testers, and from the "cmplx" input for complex-precision
5396 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
5397 ;; package to prefix execution with "mpirun".
5398 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
5399 (with-directory-excursion "examples"
5400 (every
5401 (lambda (prec type)
5402 (let ((tester (apply open-pipe*
5403 `(,OPEN_WRITE
5404 ,@exec-prefix
5405 ,(string-append "./" prec
5406 "simpletest"))))
5407 (input (open-input-file
5408 (string-append "input_simpletest_" type))))
5409 (begin
5410 (dump-port input tester)
5411 (close-port input)
5412 (zero? (close-pipe tester)))))
5413 '("s" "d" "c" "z")
5414 '("real" "real" "cmplx" "cmplx")))))
5415 (replace 'install
5416 (lambda* (#:key outputs #:allow-other-keys)
5417 (let* ((out (assoc-ref outputs "out"))
5418 (libdir (string-append out "/lib")))
5419 (copy-recursively "lib" libdir)
5420 (copy-recursively "include" (string-append out "/include"))
5421 (when (file-exists? "libseq/libmpiseq.a")
5422 (install-file "libseq/libmpiseq.a" libdir))
5423 (when (file-exists? "libseq/libmpiseq.so")
5424 (install-file "libseq/libmpiseq.so" libdir))
5425 #t))))))
5426 (home-page "https://mumps-solver.org")
5427 (synopsis "Multifrontal sparse direct solver")
5428 (description
5429 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
5430sparse system of linear equations A x = b using Gaussian elimination.")
5431 (license license:cecill-c)))
5432
5433(define-public mumps-metis
5434 (package
5435 (inherit mumps)
5436 (name "mumps-metis")
5437 (inputs (modify-inputs inputs
5438 (delete "scotch")))))
5439
5440(define-public mumps-openmpi
5441 (package
5442 (inherit mumps)
5443 (name "mumps-openmpi")
5444 (inputs
5445 (modify-inputs inputs
5446 (delete "scotch")
5447 (prepend openmpi scalapack pt-scotch)))
5448 (arguments
5449 (substitute-keyword-arguments arguments
5450 ((#:phases phases)
5451 `(modify-phases ,phases
5452 (add-before 'check 'mpi-setup
5453 ,%openmpi-setup)
5454 (replace 'check
5455 (lambda _
5456 ((assoc-ref ,phases 'check)
5457 #:exec-prefix '("mpirun" "-n" "2"))))))))
5458 (synopsis "Multifrontal sparse direct solver (with MPI)")))
5459
5460(define-public mumps-metis-openmpi
5461 (package
5462 (inherit mumps-openmpi)
5463 (name "mumps-metis-openmpi")
5464 (inputs (modify-inputs inputs
5465 (delete "pt-scotch")))))
5466
5467(define-public ruby-asciimath
5468 (package
5469 (name "ruby-asciimath")
5470 (version "2.0.6")
5471 (source
5472 (origin
5473 (method url-fetch)
5474 (uri (rubygems-uri "asciimath" version))
5475 (sha256
5476 (base32
5477 "0b5h65vas9fj4k85gw18cf6pgqbdxfjzj63632rdkngabar67zlq"))))
5478 (build-system ruby-build-system)
5479 (native-inputs
5480 (list ruby-nokogiri ruby-rspec))
5481 (synopsis "AsciiMath parsing and conversion library")
5482 (description
5483 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
5484easy-to-write markup language for mathematics.")
5485 (home-page "https://github.com/asciidoctor/asciimath")
5486 (license license:expat)))
5487
5488(define-public superlu
5489 (package
5490 (name "superlu")
5491 (version "5.3.0")
5492 (source
5493 (origin
5494 (method url-fetch)
5495 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
5496 "superlu-" version ".tar.gz"))
5497 (sha256
5498 (base32 "0xvib7nk2rlbsiv1iwkwl9kxppkalkciv628bsyiiv0pv754n48q"))
5499 (modules '((guix build utils)))
5500 (snippet
5501 ;; Replace the non-free implementation of MC64 with a stub adapted
5502 ;; from Debian
5503 '(begin
5504 (use-modules (ice-9 regex)
5505 (ice-9 rdelim))
5506 (call-with-output-file "SRC/mc64ad.c"
5507 (lambda (port)
5508 (display "
5509#include <stdio.h>
5510#include <stdlib.h>
5511void mc64id_(int *a) {
5512 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
5513 abort ();
5514}
5515void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
5516 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
5517 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
5518 abort ();
5519}\n" port)))
5520 ;; Remove the corresponding license verbiage. MC64 license follows
5521 ;; a "------" line separator.
5522 (with-atomic-file-replacement "License.txt"
5523 (let ((rx (make-regexp "-{8}")))
5524 (lambda (in out)
5525 (let loop ()
5526 (let ((line (read-line in 'concat)))
5527 (unless (regexp-exec rx line)
5528 (display line out)
5529 (loop))))
5530 #t)))))))
5531 (build-system cmake-build-system)
5532 (native-inputs
5533 (list tcsh))
5534 (inputs
5535 `(("blas" ,openblas)
5536 ("gfortran" ,gfortran)))
5537 (arguments
5538 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
5539 "-DTPL_BLAS_LIBRARIES=openblas"
5540 "-DBUILD_SHARED_LIBS:BOOL=YES")))
5541 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
5542 (synopsis "Supernodal direct solver for sparse linear systems")
5543 (description
5544 "SuperLU is a general purpose library for the direct solution of large,
5545sparse, nonsymmetric systems of linear equations on high performance machines.
5546The library is written in C and is callable from either C or Fortran. The
5547library routines perform an LU decomposition with partial pivoting and
5548triangular system solves through forward and back substitution. The library
5549also provides threshold-based ILU factorization preconditioners.")
5550 (license (list license:bsd-3
5551 license:gpl2+ ;EXAMPLE/*fgmr.c
5552 (license:fsf-free "file://SRC/colamd.h")))))
5553
5554(define-public superlu-dist
5555 (package
5556 (name "superlu-dist")
5557 (version "6.4.0")
5558 (source
5559 (origin
5560 (method git-fetch)
5561 (uri (git-reference
5562 (url "https://github.com/xiaoyeli/superlu_dist")
5563 (commit (string-append "v" version))))
5564 (file-name (git-file-name name version))
5565 (sha256
5566 (base32 "0fa29yr72p4yq5ln4rgfsawmi5935n4qcr5niz6864bjladz4lql"))
5567 (modules '((guix build utils)))
5568 (snippet
5569 ;; Replace the non-free implementation of MC64 with a stub
5570 '(begin
5571 (make-file-writable "SRC/mc64ad_dist.c")
5572 (call-with-output-file "SRC/mc64ad_dist.c"
5573 (lambda (port)
5574 (display "
5575#include <stdio.h>
5576#include <stdlib.h>
5577void mc64id_dist(int *a) {
5578 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
5579 abort ();
5580}
5581void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
5582 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
5583 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
5584 abort ();
5585}\n" port)))
5586 (substitute* "SRC/util.c" ;adjust default algorithm
5587 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
5588 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
5589 ;; general (i.e. non-square) processor-grid support.
5590 "RowPerm = NOROWPERM;"))
5591 #t))
5592 (patches (search-patches "superlu-dist-scotchmetis.patch"
5593 "superlu-dist-awpm-grid.patch"))))
5594 (build-system cmake-build-system)
5595 (native-inputs
5596 (list tcsh))
5597 (inputs
5598 `(("gfortran" ,gfortran)
5599 ("blas" ,openblas)
5600 ("combblas" ,combinatorial-blas)))
5601 (propagated-inputs
5602 `(("mpi" ,openmpi) ;headers include MPI heades
5603 ("parmetis" ,pt-scotch32 "metis")
5604 ("pt-scotch" ,pt-scotch32)))
5605 (arguments
5606 `(#:parallel-tests? #f ;tests use MPI and OpenMP
5607 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
5608 "-DTPL_ENABLE_COMBBLASLIB=YES"
5609 "-DTPL_BLAS_LIBRARIES=-lopenblas"
5610 "-DTPL_LAPACK_LIBRARIES=-lopenblas"
5611 (string-append "-DTPL_PARMETIS_LIBRARIES="
5612 (string-join
5613 '("ptscotchparmetisv3" "ptscotcherr"
5614 "scotchmetisv3" "scotcherr")
5615 ";"))
5616 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
5617 (assoc-ref %build-inputs "parmetis")
5618 "/include")
5619 "-DTPL_ENABLE_COMBBLASLIB=ON"
5620 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
5621 (assoc-ref %build-inputs "combblas")
5622 "/include/CombBLAS;"
5623 (assoc-ref %build-inputs "combblas")
5624 "/include/BipartiteMatchings")
5625 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
5626 #:phases
5627 (modify-phases %standard-phases
5628 (add-before 'configure 'set-c++-standard
5629 (lambda _
5630 (substitute* "CMakeLists.txt"
5631 ;; AWPM headers require C++14
5632 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
5633 (add-before 'check 'mpi-setup
5634 ,%openmpi-setup)
5635 (add-before 'check 'omp-setup
5636 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
5637 (home-page (package-home-page superlu))
5638 (synopsis "Parallel supernodal direct solver")
5639 (description
5640 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
5641It is targeted for distributed memory parallel machines. SuperLU_DIST is
5642implemented in ANSI C, and MPI for communications.")
5643 (license license:bsd-3)))
5644
5645(define-public scotch
5646 (package
5647 (name "scotch")
5648 (version "7.0.7")
5649 (source
5650 (origin
5651 (method git-fetch)
5652 (uri (git-reference
5653 (url "https://gitlab.inria.fr/scotch/scotch")
5654 (commit (string-append "v" version))))
5655 (file-name (git-file-name name version))
5656 (sha256
5657 (base32 "0r46bmnz9xjlgcb3vvlx3sg2qh4gfgga89vs4vlbzz3s4lj48g46"))
5658 (patches (search-patches "scotch-cmake-remove-metis.patch"))
5659 (modules '((guix build utils)))
5660 (snippet
5661 #~(substitute* "src/libscotchmetis/library_parmetis.h"
5662 (("typedef DUMMYINT SCOTCH_Num" all)
5663 ;; 'DUMMYINT' is typically replaced by 'int32_t'. Include
5664 ;; <stdint.h> to get that type definition.
5665 (string-append "#include <stdint.h>\n" all "\n"))))))
5666 (build-system cmake-build-system)
5667 (inputs
5668 (list zlib))
5669 (native-inputs
5670 (list flex bison gfortran))
5671 (outputs '("out" "metis"))
5672 (arguments
5673 (list #:parallel-tests? #f
5674 #:configure-flags #~'("-DBUILD_SHARED_LIBS=YES" "-DINTSIZE=64"
5675 "-DBUILD_PTSCOTCH=OFF")
5676 #:phases
5677 #~(modify-phases %standard-phases
5678 (add-after 'install 'install-metis
5679 (lambda* (#:key outputs #:allow-other-keys)
5680 ;; Move the METIS compatibility library to a separate output to
5681 ;; avoid a name clash on <metis.h>.
5682 (let* ((out (assoc-ref outputs "out"))
5683 (metis (assoc-ref outputs "metis"))
5684 (prefix (string-length out)))
5685 (for-each (lambda (file)
5686 (let ((target
5687 (string-append metis
5688 (string-drop file
5689 prefix))))
5690 (mkdir-p (dirname target))
5691 (rename-file file target)))
5692 (find-files out "metis"))))))))
5693 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
5694 (properties
5695 `((release-monitoring-url
5696 . "https://gitlab.inria.fr/scotch/scotch/-/releases")))
5697 (synopsis "Programs and libraries for graph algorithms")
5698 (description "SCOTCH is a set of programs and libraries which implement
5699the static mapping and sparse matrix reordering algorithms developed within
5700the SCOTCH project. Its purpose is to apply graph theory, with a divide and
5701conquer approach, to scientific computing problems such as graph and mesh
5702partitioning, static mapping, and sparse matrix ordering, in application
5703domains ranging from structural mechanics to operating systems or
5704bio-chemistry.")
5705 ;; See LICENSE_en.txt
5706 (license license:cecill-c)))
5707
5708(define-public scotch32
5709 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
5710 ;; some applications.
5711 (package
5712 (inherit scotch)
5713 (name "scotch32")
5714 (arguments
5715 (substitute-keyword-arguments arguments
5716 ((#:configure-flags flags #~'())
5717 #~'("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=OFF" "-DINTSIZE=32"))))
5718 (synopsis
5719 "Programs and libraries for graph algorithms (32-bit integers)")))
5720
5721(define-public pt-scotch
5722 (package
5723 (inherit scotch)
5724 (name "pt-scotch")
5725 (propagated-inputs
5726 (list openmpi)) ;headers include MPI headers
5727 (arguments
5728 (substitute-keyword-arguments arguments
5729 ((#:configure-flags flags #~'())
5730 #~'("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON" "-DINTSIZE=64"))
5731 ((#:phases phases #~%standard-phases)
5732 #~(modify-phases #$phases
5733 (add-before 'check 'mpi-setup
5734 #$%openmpi-setup)))))
5735 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5736
5737(define-public pt-scotch32
5738 (package
5739 (inherit pt-scotch)
5740 (name "pt-scotch32")
5741 (propagated-inputs
5742 (list openmpi)) ;headers include MPI headers
5743 (arguments
5744 (substitute-keyword-arguments arguments
5745 ((#:configure-flags flags #~'())
5746 #~'("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON" "-DINTSIZE=32"))))
5747 (synopsis
5748 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
5749
5750(define-public gklib
5751 (let ((commit "8bd6bad750b2b0d90800c632cf18e8ee93ad72d7")
5752 (revision "1"))
5753 (package
5754 (name "gklib")
5755 (version (git-version "5.1.1" revision commit))
5756 (source
5757 (origin
5758 (method git-fetch)
5759 (uri (git-reference
5760 (url "https://github.com/KarypisLab/GKlib")
5761 (commit commit)))
5762 (file-name (git-file-name name version))
5763 (sha256
5764 (base32
5765 "08k4zzyd7zsisdhfmnwz7zb9w3pzpgagyjq52mwk8i6sqajdxsdn"))))
5766 (build-system cmake-build-system)
5767 (arguments
5768 (list
5769 #:tests? #f
5770 #:configure-flags
5771 #~(list "-DBUILD_SHARED_LIBS=ON"
5772 #$@(if (target-x86?)
5773 '()
5774 '("-DNO_X86=1")))
5775 #:phases
5776 #~(modify-phases %standard-phases
5777 (add-after 'unpack 'remove-march=native
5778 (lambda _
5779 (substitute* "GKlibSystem.cmake"
5780 (("-march=native") "")))))))
5781 (home-page "https://github.com/KarypisLab/GKlib")
5782 (synopsis "Helper library for METIS")
5783 (description
5784 "GKlib is a library of various helper routines and frameworks used by
5785software from KarypisLab, such as METIS.")
5786 (license license:asl2.0))))
5787
5788;; XXX: Remove once the full SuiteSparse package is replaced.
5789(define-public metis
5790 (package
5791 (name "metis")
5792 (version "5.1.0")
5793 (source
5794 (origin
5795 (method url-fetch)
5796 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
5797 "metis-" version ".tar.gz"))
5798 (sha256
5799 (base32
5800 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
5801 (properties
5802 `((release-monitoring-url
5803 . "http://glaros.dtc.umn.edu/gkhome/metis/metis/download")))
5804 (build-system cmake-build-system)
5805 (arguments
5806 (list
5807 #:tests? #f ;no tests
5808 #:configure-flags
5809 #~(list "-DSHARED=ON"
5810 (string-append "-DGKLIB_PATH="
5811 (getcwd) "/metis-" #$version "/GKlib"))))
5812 (inputs (list openblas))
5813 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
5814 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
5815 (description
5816 "METIS is a set of serial programs for partitioning graphs, partitioning
5817finite element meshes, and producing fill-reducing orderings for sparse
5818matrices. The algorithms implemented in METIS are based on the multilevel
5819recursive-bisection, multilevel k-way, and multi-constraint partitioning
5820schemes.")
5821 (license license:asl2.0))) ;As of version 5.0.3
5822
5823(define-public metis-5.2
5824 (package
5825 (name "metis")
5826 (version "5.2.1")
5827 (source
5828 (origin
5829 (method git-fetch)
5830 (uri (git-reference
5831 (url "https://github.com/KarypisLab/METIS")
5832 (commit (string-append "v" version))))
5833 (file-name (git-file-name name version))
5834 (sha256
5835 (base32
5836 "19vi1wsi2gp2m5vb715yfnzd2g7brm4r40qxg65ysrzgl13lpmvr"))
5837 (snippet
5838 #~(delete-file "manual/manual.pdf"))))
5839 (build-system cmake-build-system)
5840 (inputs (list gklib openblas))
5841 (arguments
5842 (list
5843 #:tests? #f ; Tests are not automatic
5844 #:configure-flags
5845 #~(list "-DSHARED=ON"
5846 (string-append "-DGKLIB_PATH=" #$gklib))
5847 #:phases
5848 #~(modify-phases %standard-phases
5849 ;; The original Makefile copies some files and invokes CMake.
5850 (add-before 'configure 'prepare-cmake
5851 (lambda _
5852 (substitute* "Makefile"
5853 (("config: distclean") "config:")
5854 (("BUILDDIR =.*")
5855 "BUILDDIR = .\n")
5856 ((".*cmake.*") ""))
5857 (substitute* "CMakeLists.txt"
5858 (("build/") "../source/"))
5859 (invoke "make" "config"))))))
5860 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
5861 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
5862 (description
5863 "METIS is a set of serial programs for partitioning graphs, partitioning
5864finite element meshes, and producing fill-reducing orderings for sparse
5865matrices. The algorithms implemented in METIS are based on the multilevel
5866recursive-bisection, multilevel k-way, and multi-constraint partitioning
5867schemes.")
5868 (license license:asl2.0)))
5869
5870(define-public gsegrafix
5871 ;; This is an old and equally dead "experimental fork" of the longer-dead
5872 ;; original. At least it no longer requires the even-deader libgnomeprint{,ui}
5873 ;; libraries, instead rendering plots with Pango.
5874 (package
5875 (name "gsegrafix")
5876 (version "1.0.7.2")
5877 (source
5878 (origin
5879 (method url-fetch)
5880 (uri (string-append "mirror://savannah/gsegrafix-experimental/"
5881 "gsegrafix-experimental-" version ".tar.gz"))
5882 (sha256
5883 (base32 "0fwh6719xy2zasmqlp0vdx6kzm45hn37ga88xmw5cz0yx7xw4j6f"))))
5884 (build-system gnu-build-system)
5885 (arguments
5886 `(#:configure-flags
5887 (list "--disable-static")))
5888 (inputs
5889 (list glib gtk+))
5890 (native-inputs
5891 (list pkg-config))
5892 (home-page "https://www.gnu.org/software/gsegrafix/")
5893 (synopsis "GNOME application to create scientific and engineering plots")
5894 (description
5895 "GSEGrafix is an application which produces high-quality graphical
5896plots for science and engineering. Plots are specified via simple ASCII
5897parameter files and data files and are presented in an anti-aliased GNOME
5898canvas. The program supports rectangular two-dimensional plots, histograms,
5899polar-axis plots and three-dimensional plots. Plots can be printed or saved
5900to BMP, JPEG or PNG image formats.")
5901 (license license:gpl3+)))
5902
5903(define-public maxima
5904 (package
5905 (name "maxima")
5906 (version "5.47.0")
5907 (source
5908 (origin
5909 (method url-fetch)
5910 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
5911 version "-source/" name "-" version ".tar.gz"))
5912 (sha256
5913 (base32 "0yhgsi7s22bpblrmrj60x0jsjdz98b5hjdcq7b0fhlzx4hdh414i"))
5914 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
5915 (build-system gnu-build-system)
5916 (inputs
5917 (list bash-minimal
5918 gnuplot ;for plots
5919 sbcl
5920 sed
5921 tk)) ;Tcl/Tk is used by 'xmaxima'
5922 (native-inputs
5923 (list texinfo perl python))
5924 (arguments
5925 (list
5926 #:configure-flags
5927 #~(list "--enable-sbcl"
5928 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
5929 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
5930 (string-append "--with-wish=" #$tk "/bin/wish"
5931 #$(version-major+minor (package-version tk))))
5932 ;; By default Maxima attempts to write temporary files to
5933 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
5934 ;; Work around that.
5935 #:make-flags #~(list "TMPDIR=/tmp")
5936 #:phases
5937 #~(modify-phases %standard-phases
5938 (add-after 'unpack 'patch-paths
5939 (lambda* (#:key inputs #:allow-other-keys)
5940 (let* ((sed (search-input-file inputs "/bin/sed"))
5941 (coreutils (assoc-ref inputs "coreutils"))
5942 (dirname (string-append coreutils "/bin/dirname"))
5943 (head (string-append coreutils "/bin/head"))
5944 (perl (search-input-file inputs "/bin/perl"))
5945 (python (search-input-file inputs "/bin/python3")))
5946 (substitute* "src/maxima.in"
5947 (("sed ") (string-append sed " "))
5948 (("dirname") dirname)
5949 (("head") head))
5950 (substitute* "doc/info/Makefile.in"
5951 (("/usr/bin/env perl") perl))
5952 (substitute* "doc/info/build_html.sh.in"
5953 (("python") python)))))
5954 (add-before 'check 'pre-check
5955 (lambda _
5956 (chmod "src/maxima" #o555)))
5957 (replace 'check
5958 (lambda _
5959 ;; This is derived from the testing code in the "debian/rules" file
5960 ;; of Debian's Maxima package.
5961 ;; If Maxima can successfully run this, the binary to be installed
5962 ;; should be fine.
5963 (invoke "sh" "-c"
5964 (string-append
5965 "./maxima-local "
5966 "--lisp=sbcl "
5967 "--batch-string=\"run_testsuite();\" "
5968 "| grep -q \"No unexpected errors found\""))))
5969 ;; Make sure the doc and emacs files are found in the
5970 ;; standard location. Also configure maxima to find gnuplot
5971 ;; without having it on the PATH.
5972 (add-after 'install 'post-install
5973 (lambda* (#:key outputs inputs #:allow-other-keys)
5974 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
5975 (out (assoc-ref outputs "out"))
5976 (datadir (string-append out "/share/maxima/" #$version))
5977 (binutils (dirname (search-input-file inputs "/bin/as"))))
5978 (with-directory-excursion out
5979 (mkdir-p "share/emacs")
5980 (mkdir-p "share/doc")
5981 (symlink
5982 (string-append datadir "/doc/")
5983 (string-append out "/share/doc/maxima"))
5984 (with-atomic-file-replacement
5985 (string-append datadir "/share/maxima-init.lisp")
5986 (lambda (in out)
5987 (format out "~a ~s~a~%"
5988 "(setf $gnuplot_command "
5989 (string-append gnuplot "/bin/gnuplot") ")")
5990 (dump-port in out))))
5991 ;; Ensure that Maxima will have access to the GNU binutils
5992 ;; components at runtime.
5993 (wrap-program (string-append out "/bin/maxima")
5994 `("PATH" prefix (#$binutils))))))
5995 ;; The Maxima command ‘describe’ allows picking the relevant portions
5996 ;; from Maxima’s Texinfo docs. However it does not support reading
5997 ;; gzipped info files.
5998 (delete 'compress-documentation))))
5999 (home-page "https://maxima.sourceforge.io")
6000 (synopsis "Numeric and symbolic expression manipulation")
6001 (description "Maxima is a system for the manipulation of symbolic and
6002numerical expressions. It yields high precision numeric results by using
6003exact fractions, arbitrary precision integers, and variable precision floating
6004point numbers.")
6005 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
6006 ;; Others simply say "GNU General Public License" without stating a
6007 ;; version (which implicitly means gpl1+).
6008 ;; At least one file (src/maxima.asd) says "version 2."
6009 ;; GPLv2 only is therefore the smallest subset.
6010 (license license:gpl2)))
6011
6012(define-public maxima-ecl
6013 (package/inherit maxima
6014 (name "maxima-ecl")
6015 (properties '((hidden? . #t)))
6016 (inputs
6017 (modify-inputs inputs
6018 (delete "sbcl")
6019 (prepend ecl)))
6020 (arguments
6021 (substitute-keyword-arguments arguments
6022 ((#:configure-flags flags)
6023 #~(list "--enable-ecl"))
6024 ((#:phases phases)
6025 #~(modify-phases #$phases
6026 (add-after 'install 'install-lib
6027 (lambda _
6028 (let ((lib (string-append
6029 #$output "/lib/maxima/"
6030 #$(package-version this-package)
6031 "/binary-ecl")))
6032 (install-file "src/binary-ecl/maxima.fas" lib))))
6033 (replace 'check
6034 (lambda _
6035 (invoke "sh" "-c"
6036 (string-append
6037 "./maxima-local "
6038 "--lisp=ecl "
6039 "--batch-string=\"run_testsuite();\" "
6040 "| grep -q \"No unexpected errors found\""))))))))
6041 (description
6042 (string-append
6043 (package-description maxima)
6044 " This package variant uses ECL as the underlying Lisp
6045implementation."))))
6046
6047(define-public wxmaxima
6048 (package
6049 (name "wxmaxima")
6050 (version "25.04.0")
6051 (source (origin
6052 (method git-fetch)
6053 (uri (git-reference
6054 (url "https://github.com/wxMaxima-developers/wxmaxima")
6055 (commit (string-append "Version-" version))))
6056 (file-name (git-file-name name version))
6057 (sha256
6058 (base32
6059 "0m8sk02cmiqxqlcw8rcljyinwajn5hvj5ldf3xr5v1asq1mvck00"))))
6060 (build-system cmake-build-system)
6061 (native-inputs (list gettext-minimal))
6062 (inputs (list bash-minimal
6063 wxwidgets
6064 maxima
6065 ;; Runtime support.
6066 adwaita-icon-theme
6067 gtk+
6068 shared-mime-info))
6069 (arguments
6070 `(#:tests? #f ; tests fail non-deterministically
6071 #:phases
6072 (modify-phases %standard-phases
6073 (add-after 'unpack 'patch-doc-path
6074 (lambda _
6075 ;; Don't look in share/doc/wxmaxima-xx.xx.x for the
6076 ;; documentation. Only licensing information is placed there by
6077 ;; Guix.
6078 (substitute* "src/Dirstructure.cpp"
6079 (("/doc/wxmaxima-\\%s")
6080 "/doc/wxmaxima"))))
6081 (add-after 'install 'wrap-program
6082 (lambda* (#:key inputs outputs #:allow-other-keys)
6083 (wrap-program (string-append (assoc-ref outputs "out")
6084 "/bin/wxmaxima")
6085 `("PATH" ":" prefix
6086 (,(string-append (assoc-ref inputs "maxima")
6087 "/bin")))
6088 ;; For GtkFileChooserDialog.
6089 `("GSETTINGS_SCHEMA_DIR" =
6090 (,(string-append (assoc-ref inputs "gtk+")
6091 "/share/glib-2.0/schemas")))
6092 `("XDG_DATA_DIRS" ":" prefix
6093 ( ;; Needed by gdk-pixbuf to know supported icon formats.
6094 ,(string-append (assoc-ref inputs "shared-mime-info")
6095 "/share")
6096 ;; The default icon theme of GTK+.
6097 ,(string-append (assoc-ref inputs "adwaita-icon-theme")
6098 "/share")))))))))
6099 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
6100 (synopsis
6101 "Graphical user interface for the Maxima computer algebra system")
6102 (description
6103 "wxMaxima is a graphical user interface for the Maxima computer algebra
6104system. It eases the use of Maxima by making most of its commands available
6105through a menu system and by providing input dialogs for commands that require
6106more than one argument. It also implements its own display engine that
6107outputs mathematical symbols directly instead of depicting them with ASCII
6108characters.
6109
6110wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
6111text and mathematical calculations to create documents, exporting of input and
6112output to TeX, and a browser for Maxima's manual including command index and
6113full text searching.")
6114 (license license:gpl2+)))
6115
6116(define-public armadillo
6117 (package
6118 (name "armadillo")
6119 (version "12.4.2")
6120 (source (origin
6121 (method url-fetch)
6122 (uri (string-append "mirror://sourceforge/arma/armadillo-"
6123 version ".tar.xz"))
6124 (sha256
6125 (base32
6126 "150fcl2cca3ks91ahgr32jw0ww8lc8ng84mczfab7clvigqpdnpv"))))
6127 (build-system cmake-build-system)
6128 (arguments
6129 `(#:tests? #f ; no test target
6130 #:configure-flags '("-DOPENBLAS_PROVIDES_LAPACK=ON")))
6131 (inputs
6132 (list openblas arpack-ng))
6133 (home-page "https://arma.sourceforge.net/")
6134 (synopsis "C++ linear algebra library")
6135 (description
6136 "Armadillo is a C++ linear algebra library, aiming towards a good balance
6137between speed and ease of use. It is useful for algorithm development
6138directly in C++, or quick conversion of research code into production
6139environments. It can be used for machine learning, pattern recognition,
6140signal processing, bioinformatics, statistics, econometrics, etc. The library
6141provides efficient classes for vectors, matrices and cubes, as well as 150+
6142associated functions (e.g., contiguous and non-contiguous submatrix views).")
6143 (license license:asl2.0)))
6144
6145(define-public muparser
6146 (package
6147 (name "muparser")
6148 (version "2.3.5")
6149 (source
6150 (origin
6151 (method git-fetch)
6152 (uri (git-reference
6153 (url "https://github.com/beltoforion/muparser")
6154 (commit (string-append "v" version))))
6155 (file-name (git-file-name name version))
6156 (sha256
6157 (base32 "0zazg6awbfimjlf7352frps47ykpn7z0kz5q686xni7nka0g2k88"))))
6158 (build-system cmake-build-system)
6159 (home-page "https://beltoforion.de/en/muparser")
6160 (synopsis "Fast parser library for mathematical expressions")
6161 (description
6162 "muParser is an extensible high performance math parser library. It is
6163based on transforming an expression into a bytecode and precalculating constant
6164parts of it.")
6165 (license license:expat)))
6166
6167(define-public openblas
6168 (package
6169 (name "openblas")
6170 (version "0.3.31")
6171 (source
6172 (origin
6173 (method git-fetch)
6174 (uri (git-reference
6175 (url "https://github.com/OpenMathLib/OpenBLAS")
6176 (commit (string-append "v" version))))
6177 (file-name (git-file-name name version))
6178 (sha256
6179 (base32
6180 "1ifbbk4mg4ykm92i9b09wwbcwpyzlfzn8lhds8f3p7cbcga7q530"))))
6181 ;; To build the package, we can either rely on a preset Makefile, or
6182 ;; generate a new one through a CMake configuration.
6183 ;; We choose the first option, so we delete the configure phase and we set
6184 ;; the build system to gnu-build-system to build the package through the
6185 ;; 'make' command.
6186 (build-system gnu-build-system)
6187 (arguments
6188 (list
6189 ;; Set the test target (but tests are indeed already run in the build
6190 ;; phase, which calls 'make -C test all').
6191 #:test-target "test"
6192 ;; No default baseline is supplied for powerpc-linux.
6193 #:substitutable? (not (target-ppc32?))
6194 #:make-flags
6195 #~(list (string-append "PREFIX=" #$output)
6196 "CFLAGS=-O3" ; optimization flags
6197 "FFLAGS=-O3" ; optimization flags
6198 "SHELL=bash"
6199 "DEBUG=1" ; enable debug symbols -g
6200 "MAKE_NB_JOBS=0" ; use jobserver for submakes
6201 "NO_STATIC=1" ; avoid a 67 MiB static archive
6202
6203 ;; This is the maximum number of threads OpenBLAS will ever use
6204 ;; (that is, if $OPENBLAS_NUM_THREADS is greater than that, then
6205 ;; NUM_THREADS is used.) If we don't set it, the makefile sets
6206 ;; it to the number of cores of the build machine, which is
6207 ;; obviously wrong.
6208 "NUM_THREADS=128"
6209
6210 ;; OpenMP support prevents deadlocks when multithreaded Openblas
6211 ;; is called from an OpenMP parallel region and takes care of
6212 ;; deactivating threads when necessary. See
6213 ;; http://www.openmathlib.org/OpenBLAS/docs/faq/#using-openblas-with-openmp
6214 ;; for more details.
6215 "USE_OPENMP=1"
6216
6217 ;; DYNAMIC_ARCH is only supported on some architectures.
6218 ;; DYNAMIC_ARCH combined with TARGET=GENERIC provides a library
6219 ;; which uses the optimizations for the detected CPU. This can
6220 ;; be overridden at runtime with the environment variable
6221 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU
6222 ;; type. On other architectures we target only the baseline CPU
6223 ;; supported by Guix.
6224 #$@(cond
6225 ((or (target-x86-64?)
6226 (target-x86-32?)
6227 (target-ppc64le?)
6228 (target-aarch64?))
6229 ;; Dynamic older enables a few extra CPU architectures
6230 ;; on x86_64 that were released before 2010.
6231 '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
6232 ;; On some of these architectures the CPU type can't be detected.
6233 ;; We list the oldest CPU core we want to have support for.
6234 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
6235 ;; two available MIPS targets special extended instructions
6236 ;; for Loongson cores are used.
6237 ((target-mips64el?)
6238 '("TARGET=SICORTEX"))
6239 ((target-arm32?)
6240 '("TARGET=ARMV7"))
6241 ((target-riscv64?)
6242 '("TARGET=RISCV64_GENERIC"))
6243 (else '())))
6244 #:phases
6245 #~(modify-phases %standard-phases
6246 ;; Skip configure phase since we rely on a preset Makefile.
6247 (delete 'configure)
6248 ;; Get libgfortran found when building in utest.
6249 (add-before 'build 'set-extralib
6250 (lambda* (#:key inputs #:allow-other-keys)
6251 (setenv "FEXTRALIB"
6252 (string-append
6253 "-L"
6254 (dirname
6255 (search-input-file inputs
6256 "/lib/libgfortran.so")))))))))
6257 (inputs
6258 (list `(,gfortran "lib")))
6259 (native-inputs
6260 (list cunit gfortran perl))
6261 (outputs '("out" "debug"))
6262 (home-page "https://www.openblas.net/")
6263 (synopsis "Optimized BLAS library based on GotoBLAS")
6264 (description
6265 "OpenBLAS is a Basic Linear Algebra Subprograms (BLAS) library forked
6266from the GotoBLAS2-1.13 BSD version.")
6267 (license license:bsd-3)))
6268
6269(define-public openblas-ilp64
6270 (package/inherit openblas
6271 (name "openblas-ilp64")
6272 (supported-systems %64bit-supported-systems)
6273 (arguments
6274 (substitute-keyword-arguments arguments
6275 ((#:make-flags flags #~'())
6276 ;; These should be '64' but julia hardcodes '64_'.
6277 #~(append (list "INTERFACE64=1"
6278 "SYMBOLSUFFIX=64_"
6279 "LIBPREFIX=libopenblas64_")
6280 #$flags))))
6281 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
6282 (license license:bsd-3)))
6283
6284(define-public libblastrampoline
6285 (package
6286 (name "libblastrampoline")
6287 (version "5.1.1")
6288 (source
6289 (origin
6290 (method git-fetch)
6291 (uri (git-reference
6292 (url "https://github.com/JuliaLinearAlgebra/libblastrampoline")
6293 (commit (string-append "v" version))))
6294 (file-name (git-file-name name version))
6295 (sha256
6296 (base32
6297 "0mf79zw11kxyil72y2ly5x8bbz3ng3nsqmp0zcps16b69wvfs19c"))))
6298 (build-system gnu-build-system)
6299 (arguments
6300 `(#:make-flags (list "-C" "src"
6301 (string-append "prefix=" (assoc-ref %outputs "out"))
6302 (string-append "CC=" ,(cc-for-target)))
6303 #:tests? #f ; No check target.
6304 #:phases
6305 (modify-phases %standard-phases
6306 (delete 'configure))))
6307 (home-page "https://github.com/JuliaLinearAlgebra/libblastrampoline")
6308 (synopsis "PLT trampolines to provide a BLAS and LAPACK demuxing library")
6309 (description
6310 "This package uses PLT trampolines to provide a BLAS and LAPACK demuxing
6311library.")
6312 (license license:expat)))
6313
6314(define-public palp
6315 (package
6316 (name "palp")
6317 (version "2.21")
6318 (source (origin
6319 (method url-fetch)
6320 (uri (string-append
6321 "http://hep.itp.tuwien.ac.at/~kreuzer/CY/palp/palp-"
6322 version ".tar.gz"))
6323 (sha256
6324 (base32
6325 "1myxjv0jxgr9acchwnjh9g5l61wxwiva3q6c1d6892lr37r7njky"))))
6326 (build-system gnu-build-system)
6327 (arguments
6328 (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
6329 #:tests? #f ; no tests
6330 #:phases #~(modify-phases %standard-phases
6331 (delete 'configure)
6332 (replace 'install
6333 (lambda _
6334 (for-each
6335 (lambda (name)
6336 (install-file name (string-append #$output "/bin")))
6337 '("class.x" "cws.x" "mori.x" "nef.x" "poly.x")))))))
6338 (home-page "http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html")
6339 (synopsis "Package for Analyzing Lattice Polytopes")
6340 (description
6341 "PALP is a set of programs for calculations with lattice polytopes and
6342applications to toric geometry.")
6343 (license license:gpl3)))
6344
6345(define-public blis
6346 (package
6347 (name "blis")
6348 (version "0.9.0")
6349 (home-page "https://github.com/flame/blis")
6350 (source (origin
6351 (method git-fetch)
6352 (uri (git-reference (url home-page) (commit version)))
6353 (sha256
6354 (base32
6355 "14v2awhxma6nzas42hq97702672f2njrskqhsv9kl23hvrvci8fm"))
6356 (file-name (git-file-name "blis" version))))
6357 (native-inputs
6358 (list python perl))
6359 (build-system gnu-build-system)
6360 (arguments
6361 (list
6362 #:configure-flags #~'("--enable-cblas")
6363 #:modules
6364 '((guix build gnu-build-system)
6365 (guix build utils)
6366 (srfi srfi-1))
6367 #:test-target "test"
6368 #:phases
6369 #~(modify-phases %standard-phases
6370 (replace 'configure
6371 (lambda* (#:key outputs target system (configure-flags '())
6372 #:allow-other-keys)
6373 ;; This is a home-made 'configure' script.
6374 (let* (;; Guix-specific support for choosing the configuration
6375 ;; via #:configure-flags: see below for details.
6376 (config-flag-prefix "--blis-config=")
6377 (maybe-config-flag (find
6378 (lambda (s)
6379 (string-prefix? config-flag-prefix s))
6380 configure-flags))
6381 (configure-flags (if maybe-config-flag
6382 (delete maybe-config-flag
6383 configure-flags)
6384 configure-flags))
6385 ;; Select the "configuration" to build.
6386 ;; The "generic" configuration is non-optimized but
6387 ;; portable (no assembly).
6388 ;; The "x86_64" configuration family includes
6389 ;; sub-configurations for all supported
6390 ;; x86_64 microarchitectures.
6391 ;; BLIS currently lacks runtime hardware detection
6392 ;; for other architectures: see
6393 ;; <https://github.com/flame/blis/commit/c534da6>.
6394 ;; Conservatively, we stick to "generic" on armhf,
6395 ;; aarch64, and ppc64le for now. (But perhaps
6396 ;; "power9", "cortexa9", and "cortexa57" might be
6397 ;; general enough to use?)
6398 ;; Another approach would be to use the "auto"
6399 ;; configuration and make this package
6400 ;; non-substitutable.
6401 ;; The build is fairly intensive, though.
6402 (blis-config
6403 (cond
6404 (maybe-config-flag
6405 (substring maybe-config-flag
6406 (string-length config-flag-prefix)))
6407 ((string-prefix? "x86_64" (or target system))
6408 "x86_64")
6409 (else
6410 "generic")))
6411 (configure-args
6412 `("-p" ,#$output
6413 "-d" "opt"
6414 "--disable-static"
6415 "--enable-shared"
6416 "--enable-threading=openmp"
6417 "--enable-verbose-make"
6418 ,@configure-flags
6419 ,blis-config)))
6420 (format #t "configure args: ~s~%" configure-args)
6421 (apply invoke
6422 "./configure"
6423 configure-args))))
6424 (add-before 'check 'show-test-output
6425 (lambda _
6426 ;; By default "make check" is silent. Make it verbose.
6427 (system "tail -F output.testsuite &"))))))
6428 (synopsis "High-performance basic linear algebra (BLAS) routines")
6429 (description
6430 "BLIS is a portable software framework for instantiating high-performance
6431BLAS-like dense linear algebra libraries. The framework was designed to
6432isolate essential kernels of computation that, when optimized, immediately
6433enable optimized implementations of most of its commonly used and
6434computationally intensive operations. While BLIS exports a new BLAS-like API,
6435it also includes a BLAS compatibility layer which gives application developers
6436access to BLIS implementations via traditional BLAS routine calls.")
6437 (license license:bsd-3)))
6438
6439(define ignorance blis)
6440
6441(define-public openlibm
6442 (package
6443 (name "openlibm")
6444 (version "0.8.7")
6445 (source
6446 (origin
6447 (method git-fetch)
6448 (uri (git-reference
6449 (url "https://github.com/JuliaLang/openlibm")
6450 (commit (string-append "v" version))))
6451 (file-name (git-file-name name version))
6452 (sha256
6453 (base32 "0lgylmspyhsndfxzya9bymyz7vnah3197jylr497jgbm4b62q8bx"))))
6454 (build-system gnu-build-system)
6455 (arguments
6456 `(#:make-flags
6457 (list (string-append "prefix=" (assoc-ref %outputs "out"))
6458 ,(string-append "CC=" (cc-for-target)))
6459 #:phases
6460 ;; no configure script
6461 (modify-phases %standard-phases (delete 'configure))
6462 #:tests? #f)) ;the tests are part of the default target
6463 (home-page "https://openlibm.org/")
6464 (synopsis "Portable C mathematical library (libm)")
6465 (description
6466 "OpenLibm is an effort to have a high quality, portable, standalone C
6467mathematical library (libm). It can be used standalone in applications and
6468programming language implementations. The project was born out of a need to
6469have a good libm for the Julia programming language that worked consistently
6470across compilers and operating systems, and in 32-bit and 64-bit
6471environments.")
6472 ;; Each architecture has its own make target, and there is none for mips.
6473 (supported-systems (delete "mips64el-linux" %supported-systems))
6474 ;; See LICENSE.md for details.
6475 (license (list license:expat
6476 license:isc
6477 license:bsd-2
6478 license:public-domain
6479 license:lgpl2.1+))))
6480
6481(define-public openspecfun
6482 (package
6483 (name "openspecfun")
6484 (version "0.5.3")
6485 (source
6486 (origin
6487 (method git-fetch)
6488 (uri (git-reference
6489 (url "https://github.com/JuliaLang/openspecfun")
6490 (commit (string-append "v" version))))
6491 (file-name (git-file-name name version))
6492 (sha256
6493 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
6494 (build-system gnu-build-system)
6495 (arguments
6496 '(#:tests? #f ; no "check" target
6497 #:make-flags
6498 (list (string-append "prefix=" (assoc-ref %outputs "out")))
6499 #:phases
6500 (modify-phases %standard-phases
6501 (delete 'configure)))) ; no configure script
6502 (inputs
6503 `(("fortran" ,gfortran)))
6504 (home-page "https://github.com/JuliaLang/openspecfun")
6505 (synopsis "Collection of special mathematical functions")
6506 (description
6507 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
6508portable package for Bessel Functions of a Complex Argument and Nonnegative
6509Order; it contains subroutines for computing Bessel functions and Airy
6510functions. Faddeeva allows computing the various error functions of arbitrary
6511complex arguments (Faddeeva function, error function, complementary error
6512function, scaled complementary error function, imaginary error function, and
6513Dawson function); given these, one can also easily compute Voigt functions,
6514Fresnel integrals, and similar related functions as well.")
6515 ;; Faddeeva is released under the Expat license; AMOS is included as
6516 ;; public domain software.
6517 (license (list license:expat license:public-domain))))
6518
6519(define-public osqp
6520 (package
6521 (name "osqp")
6522 (version "1.0.0")
6523 (source
6524 (origin
6525 (method git-fetch)
6526 (uri (git-reference
6527 (url "https://github.com/osqp/osqp")
6528 (commit (string-append "v" version))))
6529 (file-name (git-file-name name version))
6530 (sha256
6531 (base32 "15n86mc232m04w8n38fx3pqam4y0swx7hcy4klhch7bk6avk5q04"))))
6532 (build-system cmake-build-system)
6533 (arguments
6534 (list
6535 #:configure-flags
6536 #~(list "-DOSQP_BUILD_UNITTESTS=ON"
6537 "-DOSQP_BUILD_SHARED_LIB=ON")
6538 #:phases
6539 #~(modify-phases %standard-phases
6540 (add-after 'unpack 'fix-qdldl-source-location
6541 (lambda _
6542 (substitute* "algebra/_common/lin_sys/qdldl/qdldl.cmake"
6543 (("Fetching/configuring QDLDL solver")
6544 (format #f "Adding/configuring QDLDL solver from: ~a"
6545 #$(package-source
6546 (this-package-native-input "qdldl"))))
6547 (("GIT_REPOSITORY https://github.com/osqp/qdldl\\.git")
6548 (format #f "SOURCE_DIR ~a"
6549 #$(package-source
6550 (this-package-native-input "qdldl"))))
6551 (("GIT_TAG v0.1.8")
6552 ""))))
6553 (add-after 'unpack 'fix-catch2-source-location
6554 (lambda _
6555 (substitute* "tests/CMakeLists.txt"
6556 (("GIT_REPOSITORY https://github.com/catchorg/Catch2\\.git")
6557 (format #f "SOURCE_DIR ~a"
6558 #$(package-source
6559 (this-package-native-input "catch2"))))
6560 (("GIT_TAG v2.13.6")
6561 "")))))))
6562 (native-inputs
6563 (list catch2-2
6564 python-wrapper ;You need python installed to generate unittests.
6565 python-numpy ;You need numpy ...
6566 python-scipy ;You need scipy ...
6567 qdldl))
6568 (home-page "https://osqp.org/")
6569 (synopsis "Operator Splitting QP Solver")
6570 (description
6571 "The OSQP (Operator Splitting Quadratic Program) solver is a numerical
6572optimization package for solving convex quadratic programs.
6573
6574It uses a custom ADMM-based first-order method requiring only a single matrix
6575factorization in the setup phase. All the other operations are extremely
6576cheap. It also implements custom sparse linear algebra routines exploiting
6577structures in the problem data.")
6578 (license license:asl2.0)))
6579
6580(define %suitesparse-package-versions
6581 '(("AMD" . "3.3.3")
6582 ("BTF" . "2.3.2")
6583 ("CAMD" . "3.3.3")
6584 ("CCOLAMD" . "3.3.4")
6585 ("CHOLMOD" . "5.3.2")
6586 ("COLAMD" . "3.3.4")
6587 ("CXSparse" . "4.4.1")
6588 ("KLU" . "2.3.5")
6589 ("LDL" . "3.3.2")
6590 ("SuiteSparse_Mongoose" . "3.3.4")
6591 ("RBio" . "4.3.4")
6592 ("SPEX" . "3.2.3")
6593 ("SPQR" . "4.3.4")
6594 ("UMFPACK" . "6.3.5")))
6595
6596;; Source for the modular SuiteSparse packages. When updating, also update the
6597;; (different) versions of the subpackages.
6598(define suitesparse-version "7.10.2")
6599(define suitesparse-source
6600 (origin
6601 (method git-fetch)
6602 (uri (git-reference
6603 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
6604 (commit (string-append "v" suitesparse-version))))
6605 (file-name (git-file-name "suitesparse" suitesparse-version))
6606 (sha256
6607 (base32
6608 "1ndwx2cp5zxrikq4xdrzjrxk1b5ps7lyi6qw34m8jpfpa0ba01ln"))
6609 (modules '((guix build utils)))
6610 (snippet
6611 #~(begin
6612 ;; Empty except for a .gitignore.
6613 (delete-file-recursively "build")
6614 ;; Delete autogenerated and bundled files
6615 (for-each delete-file (find-files "." "\\.pdf$"))
6616 ;; ssget
6617 (delete-file-recursively "ssget")
6618 ;; SuiteSparse_config
6619 (delete-file "SuiteSparse_config/SuiteSparse_config.h")
6620 ;; CHOLMOD
6621 (delete-file-recursively "CHOLMOD/SuiteSparse_metis")
6622 ; GraphBLAS
6623 (delete-file "GraphBLAS/README.md")
6624 (delete-file "GraphBLAS/Config/GB_prejit.c")
6625 (delete-file-recursively "GraphBLAS/cpu_features")
6626 (delete-file-recursively "GraphBLAS/lz4/lz4.c")
6627 (delete-file-recursively "GraphBLAS/lz4/lz4.h")
6628 (delete-file-recursively "GraphBLAS/lz4/lz4hc.c")
6629 (delete-file-recursively "GraphBLAS/lz4/lz4hc.h")
6630 (delete-file "GraphBLAS/Tcov/PreJIT/GB_prejit.c")
6631 (delete-file "GraphBLAS/xxHash/xxhash.h")
6632 (delete-file-recursively "GraphBLAS/zstd/zstd_subset")
6633 ;; KLU
6634 (delete-file "KLU/Include/klu.h")
6635 (delete-file "KLU/Doc/klu_version.tex")
6636 ;; LDL
6637 (delete-file "LDL/Include/ldl.h")
6638 (delete-file "LDL/Doc/ldl_version.tex")
6639 ;; RBio
6640 (delete-file "RBio/Include/RBio.h")
6641 ;; SPEX
6642 (delete-file "SPEX/Include/SPEX.h")
6643 (delete-file "SPEX/Doc/SPEX_version.tex")
6644 ;; SPQR
6645 (delete-file "SPQR/Include/SuiteSparseQR_definitions.h")
6646 (delete-file "SPQR/Doc/spqr_version.tex")
6647 ;; UMFPACK
6648 (delete-file "UMFPACK/Include/umfpack.h")
6649 (delete-file "UMFPACK/Doc/umfpack_version.tex")))))
6650
6651(define-public suitesparse-config
6652 (package
6653 (name "suitesparse-config")
6654 (version suitesparse-version)
6655 (source suitesparse-source)
6656 (build-system cmake-build-system)
6657 (arguments
6658 (list
6659 #:tests? #f
6660 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6661 #:phases
6662 #~(modify-phases %standard-phases
6663 (add-after 'unpack 'chdir
6664 (lambda _
6665 (chdir "SuiteSparse_config"))))))
6666 (inputs (list openblas))
6667 (native-inputs (list pkg-config))
6668 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6669 (synopsis "Configuration for all SuiteSparse packages")
6670 (description "SuiteSparse is a suite of sparse matrix algorithms. This
6671package contains a library with common configuration options.")
6672 (license license:bsd-3)))
6673
6674(define-public suitesparse-amd
6675 (package
6676 (name "suitesparse-amd")
6677 (version (assoc-ref %suitesparse-package-versions "AMD"))
6678 (source suitesparse-source)
6679 (build-system cmake-build-system)
6680 (arguments
6681 (list
6682 #:tests? #f
6683 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6684 #:phases
6685 #~(modify-phases %standard-phases
6686 (add-after 'unpack 'chdir
6687 (lambda _
6688 (chdir "AMD")))
6689 (add-after 'chdir 'set-cmake-module-path
6690 (lambda _
6691 (substitute* "CMakeLists.txt"
6692 (("set.*CMAKE_MODULE_PATH.*")
6693 (string-append "set(CMAKE_MODULE_PATH "
6694 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
6695 "set(DUMMY\n")))))
6696 (add-after 'build 'build-doc
6697 (lambda _
6698 ;; Generating font shapes require a writable TEXMFVAR directory.
6699 (setenv "TEXMFVAR" "/tmp")
6700 (with-directory-excursion "../AMD/Doc"
6701 (invoke "make"))))
6702 ;; Required for suitesparse-umfpack
6703 (add-after 'install 'install-internal-header
6704 (lambda _
6705 (install-file "../AMD/Include/amd_internal.h"
6706 (string-append #$output "/include"))))
6707 (add-after 'install-internal-header 'install-doc
6708 (lambda _
6709 (install-file "../AMD/Doc/AMD_UserGuide.pdf"
6710 (string-append #$output "/share/doc/"
6711 #$name "-" #$version))))
6712 (replace 'install-license-files
6713 (lambda _
6714 (install-file "../AMD/Doc/License.txt"
6715 (string-append #$output "/share/doc/"
6716 #$name "-" #$version)))))))
6717 (propagated-inputs (list suitesparse-config))
6718 (native-inputs (list gfortran (texlive-local-tree '())))
6719 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6720 (synopsis "Sparse matrix ordering for Cholesky factorization")
6721 (description "AMD is a set of routines for ordering a sparse matrix prior
6722to Cholesky factorization (or for LU factorization with diagonal pivoting).")
6723 (license license:bsd-3)))
6724
6725(define-public suitesparse-btf
6726 (package
6727 (name "suitesparse-btf")
6728 (version (assoc-ref %suitesparse-package-versions "BTF"))
6729 (source suitesparse-source)
6730 (build-system cmake-build-system)
6731 (arguments
6732 (list
6733 #:tests? #f
6734 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6735 #:phases
6736 #~(modify-phases %standard-phases
6737 (add-after 'unpack 'chdir
6738 (lambda _
6739 (chdir "BTF")))
6740 (add-after 'chdir 'set-cmake-module-path
6741 (lambda _
6742 (substitute* "CMakeLists.txt"
6743 (("set.*CMAKE_MODULE_PATH.*")
6744 (string-append "set(CMAKE_MODULE_PATH "
6745 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
6746 "set(DUMMY\n")))))
6747 (replace 'install-license-files
6748 (lambda _
6749 (install-file "../BTF/Doc/License.txt"
6750 (string-append #$output "/share/doc/"
6751 #$name "-" #$version)))))))
6752 (propagated-inputs (list suitesparse-config))
6753 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6754 (synopsis "Library for permuting matrices into block upper triangular form")
6755 (description "BTF (Block Triangular Form) is a C library for permuting a
6756matrix into block upper triangular form.")
6757 (license license:lgpl2.1+)))
6758
6759(define-public suitesparse-camd
6760 (package
6761 (name "suitesparse-camd")
6762 (version (assoc-ref %suitesparse-package-versions "CAMD"))
6763 (source suitesparse-source)
6764 (build-system cmake-build-system)
6765 (arguments
6766 (list
6767 #:tests? #f
6768 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6769 #:phases
6770 #~(modify-phases %standard-phases
6771 (add-after 'unpack 'chdir
6772 (lambda _
6773 (chdir "CAMD")))
6774 (add-after 'chdir 'set-cmake-module-path
6775 (lambda _
6776 (substitute* "CMakeLists.txt"
6777 (("set.*CMAKE_MODULE_PATH.*")
6778 (string-append "set(CMAKE_MODULE_PATH "
6779 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
6780 "set(DUMMY\n")))))
6781 (add-after 'build 'build-doc
6782 (lambda _
6783 ;; Generating font shapes require a writable TEXMFVAR directory.
6784 (setenv "TEXMFVAR" "/tmp")
6785 (with-directory-excursion "../CAMD/Doc"
6786 (invoke "make"))))
6787 (add-after 'install 'install-doc
6788 (lambda _
6789 (install-file "../CAMD/Doc/CAMD_UserGuide.pdf"
6790 (string-append #$output "/share/doc/"
6791 #$name "-" #$version))))
6792 (replace 'install-license-files
6793 (lambda _
6794 (install-file "../CAMD/Doc/License.txt"
6795 (string-append #$output "/share/doc/"
6796 #$name "-" #$version)))))))
6797 (propagated-inputs (list suitesparse-config))
6798 (native-inputs (list (texlive-local-tree '())))
6799 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6800 (synopsis "Sparse matrix ordering for Cholesky factorization with constraints")
6801 (description "CAMD is a set of routines for ordering a sparse matrix prior
6802to Cholesky factorization (or for LU factorization with diagonal pivoting).
6803It is a variant of AMD which has the the option to apply constraints to the
6804ordering.")
6805 (license license:bsd-3)))
6806
6807(define-public suitesparse-colamd
6808 (package
6809 (name "suitesparse-colamd")
6810 (version (assoc-ref %suitesparse-package-versions "COLAMD"))
6811 (source suitesparse-source)
6812 (build-system cmake-build-system)
6813 (arguments
6814 (list
6815 #:tests? #f
6816 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6817 #:phases
6818 #~(modify-phases %standard-phases
6819 (add-after 'unpack 'chdir
6820 (lambda _
6821 (chdir "COLAMD")))
6822 (add-after 'chdir 'set-cmake-module-path
6823 (lambda _
6824 (substitute* "CMakeLists.txt"
6825 (("set.*CMAKE_MODULE_PATH.*")
6826 (string-append "set(CMAKE_MODULE_PATH "
6827 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
6828 "set(DUMMY\n")))))
6829 (replace 'install-license-files
6830 (lambda _
6831 (install-file "../COLAMD/Doc/License.txt"
6832 (string-append #$output "/share/doc/"
6833 #$name "-" #$version)))))))
6834 (propagated-inputs (list suitesparse-config))
6835 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6836 (synopsis "Column Approximate Minimum Degree Ordering")
6837 (description "COLAMD is library for computing a permutation vector for a
6838matrix with which the LU factorization becomes sparser.")
6839 (license license:bsd-3)))
6840
6841(define-public suitesparse-ccolamd
6842 (package
6843 (name "suitesparse-ccolamd")
6844 (version (assoc-ref %suitesparse-package-versions "CCOLAMD"))
6845 (source suitesparse-source)
6846 (build-system cmake-build-system)
6847 (arguments
6848 (list
6849 #:tests? #f
6850 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6851 #:phases
6852 #~(modify-phases %standard-phases
6853 (add-after 'unpack 'chdir
6854 (lambda _
6855 (chdir "CCOLAMD")))
6856 (add-after 'chdir 'set-cmake-module-path
6857 (lambda _
6858 (substitute* "CMakeLists.txt"
6859 (("set.*CMAKE_MODULE_PATH.*")
6860 (string-append "set(CMAKE_MODULE_PATH "
6861 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
6862 "set(DUMMY\n")))))
6863 (replace 'install-license-files
6864 (lambda _
6865 (install-file "../CCOLAMD/Doc/License.txt"
6866 (string-append #$output "/share/doc/"
6867 #$name "-" #$version)))))))
6868 (propagated-inputs (list suitesparse-config))
6869 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
6870 (synopsis "Column Approximate Minimum Degree Ordering with constraints")
6871 (description "CCOLAMD is library for computing a permutation vector for a
6872matrix with which the LU factorization becomes sparser. It is a variant of
6873COLAMD which has the the option to apply constraints to the ordering.")
6874 (license license:bsd-3)))
6875
6876(define-public gklib-suitesparse
6877 (package/inherit gklib
6878 (name "gklib-suitesparse")
6879 (source (origin
6880 (inherit (package-source gklib))
6881 (patches (cons
6882 (search-patch
6883 "gklib-suitesparse.patch")
6884 (origin-patches (package-source gklib))))))
6885 (arguments
6886 (substitute-keyword-arguments arguments
6887 ((#:phases phases #~%standard-phases)
6888 #~(modify-phases #$phases
6889 (add-after 'unpack 'patch-cmake
6890 (lambda _
6891 (substitute* "CMakeLists.txt"
6892 (("add_library\\(GKlib.*" all)
6893 (string-append
6894 all
6895 "target_link_libraries(GKlib PUBLIC"
6896 " ${SUITESPARSE_CONFIG_LIBRARIES} m)\n")))))))))
6897 (propagated-inputs (list suitesparse-config))))
6898
6899(define-public metis-suitesparse
6900 (package/inherit metis-5.2
6901 (name "metis-suitesparse")
6902 (arguments
6903 (substitute-keyword-arguments (package-arguments metis-5.2)
6904 ((#:phases phases)
6905 #~(modify-phases #$phases
6906 (add-before 'prepare-cmake 'set-idxwidth
6907 (lambda _
6908 (substitute* "Makefile"
6909 (("IDXWIDTH.*=.*")
6910 "IDXWIDTH = \"\\#define IDXTYPEWIDTH 64\"\n"))))
6911 (add-before 'prepare-cmake 'link-suitesparse-config
6912 (lambda _
6913 (substitute* "programs/CMakeLists.txt"
6914 (("include_directories.*" all)
6915 (string-append
6916 all "find_package(SuiteSparse_config REQUIRED)\n"))
6917 (("(target_link_libraries.*)GKlib(.*)" _ start end)
6918 (string-append
6919 start "GKlib ${SUITESPARSE_CONFIG_LIBRARIES}" end)))))))
6920 ((#:configure-flags _)
6921 #~(list "-DSHARED=ON"
6922 (string-append "-DGKLIB_PATH=" #$gklib-suitesparse)))))
6923 (inputs (list suitesparse-config gklib-suitesparse))))
6924
6925(define-public suitesparse-cholmod
6926 (package
6927 (name "suitesparse-cholmod")
6928 (version (assoc-ref %suitesparse-package-versions "CHOLMOD"))
6929 (source suitesparse-source)
6930 (build-system cmake-build-system)
6931 (arguments
6932 (list
6933 #:tests? #f
6934 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
6935 #:phases
6936 #~(modify-phases %standard-phases
6937 (add-after 'unpack 'chdir
6938 (lambda _
6939 (chdir "CHOLMOD")))
6940 (add-after 'chdir 'set-cmake-module-path
6941 (lambda _
6942 (substitute* "CMakeLists.txt"
6943 (("set.*CMAKE_MODULE_PATH.*")
6944 (string-append
6945 "set(CMAKE_MODULE_PATH "
6946 (string-join
6947 (map (lambda (path)
6948 (string-append path "/lib/cmake/SuiteSparse"))
6949 (list #$suitesparse-amd
6950 #$suitesparse-camd
6951 #$suitesparse-ccolamd
6952 #$suitesparse-colamd
6953 #$suitesparse-config)))
6954 ")\nset(DUMMY\n"))
6955 (("add_subdirectory.*GPU.*") "\n")
6956 ((".*cmake_modules/FindCHOLMOD_CUDA.cmake.*") "\n"))))
6957 (add-after 'chdir 'use-external-metis
6958 (lambda _
6959 (let ((port (open-file "CMakeLists.txt" "a")))
6960 (display
6961 (string-append
6962 "find_library(METIS_LIBRARY NAME metis PATHS ENV LIBRARY_PATH)
6963get_filename_component(METIS_LIBRARY ${METIS_LIBRARY} REALPATH)
6964find_library(GKLIB_LIBRARY NAME GKlib PATHS ENV LIBRARY_PATH)
6965get_filename_component(GKLIB_LIBRARY ${GKLIB_LIBRARY} REALPATH)
6966target_link_libraries(CHOLMOD PRIVATE ${METIS_LIBRARY} ${GKLIB_LIBRARY})
6967target_link_libraries(CHOLMOD_static PRIVATE ${METIS_LIBRARY} ${GKLIB_LIBRARY})")
6968 port)
6969 (close-port port))
6970 (delete-file "Partition/cholmod_metis_wrapper.c")
6971 (delete-file "Partition/cholmod_metis_wrapper.h")
6972 (substitute* "Partition/cholmod_metis.c"
6973 (("#include \"cholmod_metis_wrapper\\.h\"") "")
6974 (("#include \"SuiteSparse_metis/include/metis.h\"")
6975 "#include <metis.h>")
6976 (("SuiteSparse_metis_METIS") "METIS"))))
6977 (add-after 'build 'build-doc
6978 (lambda _
6979 (setenv "TEXMFVAR" "/tmp") ;for font shapes generation
6980 (with-directory-excursion "../CHOLMOD/Doc"
6981 (invoke "make"))))
6982 (add-after 'install 'install-doc
6983 (lambda _
6984 (install-file "../CHOLMOD/Doc/CHOLMOD_UserGuide.pdf"
6985 (string-append #$output "/share/doc/"
6986 #$name "-" #$version))))
6987 (replace 'install-license-files
6988 (lambda _
6989 (let ((out (string-append #$output
6990 "/share/doc/" #$name "-" #$version)))
6991 (install-file "../CHOLMOD/Doc/License.txt" out)
6992 (install-file "../CHOLMOD/Check/lesser.txt" out)
6993 (install-file "../CHOLMOD/MatrixOps/gpl.txt" out)))))))
6994 (inputs
6995 (list gklib-suitesparse
6996 metis-suitesparse
6997 openblas
6998 suitesparse-amd
6999 suitesparse-camd
7000 suitesparse-ccolamd
7001 suitesparse-colamd))
7002 (propagated-inputs (list suitesparse-config))
7003 (native-inputs (list (texlive-local-tree '())))
7004 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7005 (synopsis "Library for solving sparse symmetric positive definite linear
7006equations")
7007 (description "CHOLMOD is a set of routines for factorizing sparse symmetrix
7008positive definite matrices, updating/downdating sparse Cholesky factorizations
7009and other related operations.")
7010 (license (list license:gpl2+ license:lgpl2.1+))))
7011
7012(define-public suitesparse-cxsparse
7013 (package
7014 (name "suitesparse-cxsparse")
7015 (version (assoc-ref %suitesparse-package-versions "CXSparse"))
7016 (source suitesparse-source)
7017 (build-system cmake-build-system)
7018 (arguments
7019 (list
7020 #:tests? #f
7021 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7022 #:phases
7023 #~(modify-phases %standard-phases
7024 (add-after 'unpack 'chdir
7025 (lambda _
7026 (chdir "CXSparse")))
7027 (add-after 'chdir 'set-cmake-module-path
7028 (lambda _
7029 (substitute* "CMakeLists.txt"
7030 (("set.*CMAKE_MODULE_PATH.*")
7031 (string-append "set(CMAKE_MODULE_PATH "
7032 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
7033 "set(DUMMY\n")))))
7034 (replace 'install-license-files
7035 (lambda _
7036 (let ((out (string-append #$output
7037 "/share/doc/" #$name "-" #$version)))
7038 (install-file "../CXSparse/Doc/License.txt" out)
7039 (install-file "../CXSparse/Doc/lesser.txt" out)))))))
7040 (propagated-inputs (list suitesparse-config))
7041 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7042 (synopsis "Concise eXtended Sparse Matrix Package")
7043 (description "CXSparse is a collection of sparse matrix algorithms for
7044direct methods on both real and complex matrices.")
7045 (license license:lgpl2.1+)))
7046
7047(define-public suitesparse-klu
7048 (package
7049 (name "suitesparse-klu")
7050 (version (assoc-ref %suitesparse-package-versions "KLU"))
7051 (source suitesparse-source)
7052 (build-system cmake-build-system)
7053 (arguments
7054 (list
7055 #:tests? #f
7056 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7057 #:phases
7058 #~(modify-phases %standard-phases
7059 (add-after 'unpack 'chdir
7060 (lambda _
7061 (chdir "KLU")))
7062 (add-after 'chdir 'set-cmake-module-path
7063 (lambda _
7064 (substitute* "CMakeLists.txt"
7065 (("set.*CMAKE_MODULE_PATH.*")
7066 (string-append
7067 "set(CMAKE_MODULE_PATH "
7068 (string-join
7069 (map (lambda (path)
7070 (string-append path "/lib/cmake/SuiteSparse"))
7071 (list #$suitesparse-amd
7072 #$suitesparse-btf
7073 #$suitesparse-camd
7074 #$suitesparse-ccolamd
7075 #$suitesparse-cholmod
7076 #$suitesparse-colamd
7077 #$suitesparse-config)))
7078 ")\nset(DUMMY\n")))))
7079 (add-after 'build 'build-doc
7080 (lambda _
7081 (substitute* "../KLU/Doc/Makefile"
7082 (("\\.\\./\\.\\./BTF/Include/btf.h")
7083 (string-append #$suitesparse-btf "/include/btf.h")))
7084 (setenv "TEXMFVAR" "/tmp") ;for generating font shapes
7085 (with-directory-excursion "../KLU/Doc"
7086 (invoke "make"))))
7087 (add-after 'install 'install-doc
7088 (lambda _
7089 (install-file "../KLU/Doc/KLU_UserGuide.pdf"
7090 (string-append #$output "/share/doc/"
7091 #$name "-" #$version))))
7092 (replace 'install-license-files
7093 (lambda _
7094 (install-file "../KLU/Doc/License.txt"
7095 (string-append #$output "/share/doc/"
7096 #$name "-" #$version)))))))
7097 (inputs
7098 (list suitesparse-camd
7099 suitesparse-ccolamd
7100 suitesparse-colamd
7101 suitesparse-config))
7102 (propagated-inputs
7103 (list suitesparse-amd
7104 suitesparse-btf
7105 suitesparse-cholmod))
7106 (native-inputs (list (texlive-local-tree '())))
7107 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7108 (synopsis "Routines for solving sparse linear problems with a LU factorization")
7109 (description "KLU is a method for computing the LU factorization of sparse
7110for real and complex matrices.")
7111 (license license:lgpl2.1+)))
7112
7113(define-public suitesparse-ldl
7114 (package
7115 (name "suitesparse-ldl")
7116 (version (assoc-ref %suitesparse-package-versions "LDL"))
7117 (source suitesparse-source)
7118 (build-system cmake-build-system)
7119 (arguments
7120 (list
7121 #:tests? #f
7122 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7123 #:phases
7124 #~(modify-phases %standard-phases
7125 (add-after 'unpack 'chdir
7126 (lambda _
7127 (chdir "LDL")))
7128 (add-after 'chdir 'set-cmake-module-path
7129 (lambda _
7130 (substitute* "CMakeLists.txt"
7131 (("set.*CMAKE_MODULE_PATH.*")
7132 (string-append
7133 "set(CMAKE_MODULE_PATH "
7134 (string-join
7135 (map (lambda (path)
7136 (string-append path "/lib/cmake/SuiteSparse"))
7137 (list #$suitesparse-amd
7138 #$suitesparse-config)))
7139 ")\nset(DUMMY\n")))))
7140 (add-after 'build 'build-doc
7141 (lambda _
7142 (substitute* "../LDL/Doc/Makefile"
7143 (("\\.\\./\\.\\./BTF/Include/btf.h")
7144 (string-append #$suitesparse-btf "/include/btf.h")))
7145 (setenv "TEXMFVAR" "/tmp") ;for font shape generation
7146 (with-directory-excursion "../LDL/Doc"
7147 (invoke "make"))))
7148 (add-after 'install 'install-doc
7149 (lambda _
7150 (install-file "../LDL/Doc/ldl_userguide.pdf"
7151 (string-append #$output "/share/doc/"
7152 #$name "-" #$version))))
7153 (replace 'install-license-files
7154 (lambda _
7155 (install-file "../LDL/Doc/License.txt"
7156 (string-append #$output "/share/doc/"
7157 #$name "-" #$version)))))))
7158 (inputs (list suitesparse-amd))
7159 (propagated-inputs (list suitesparse-config))
7160 (native-inputs (list (texlive-local-tree '())))
7161 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7162 (synopsis "LDL' factorization method for sparse, symmetric matrices")
7163 (description "This package contains a set of routines for computing the
7164LDL' factorization of sparse, symmetric matrices. Its focus lies on concise
7165code.")
7166 (license license:lgpl2.1+)))
7167
7168(define-public suitesparse-rbio
7169 (package
7170 (name "suitesparse-rbio")
7171 (version (assoc-ref %suitesparse-package-versions "RBio"))
7172 (source suitesparse-source)
7173 (build-system cmake-build-system)
7174 (arguments
7175 (list
7176 #:tests? #f
7177 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7178 #:phases
7179 #~(modify-phases %standard-phases
7180 (add-after 'unpack 'chdir
7181 (lambda _
7182 (chdir "RBio")))
7183 (add-after 'chdir 'set-cmake-module-path
7184 (lambda _
7185 (substitute* "CMakeLists.txt"
7186 (("set.*CMAKE_MODULE_PATH.*")
7187 (string-append
7188 "set(CMAKE_MODULE_PATH "
7189 (string-join
7190 (map (lambda (path)
7191 (string-append path "/lib/cmake/SuiteSparse"))
7192 (list #$suitesparse-config)))
7193 ")\nset(DUMMY\n")))))
7194 (replace 'install-license-files
7195 (lambda _
7196 (let ((out (string-append #$output
7197 "/share/doc/" #$name "-" #$version)))
7198 (install-file "../RBio/Doc/License.txt" out)
7199 (install-file "../RBio/Doc/gpl.txt" out)))))))
7200 (propagated-inputs (list suitesparse-config))
7201 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7202 (synopsis "Library for the Rutherford/Boeing sparse matrix format")
7203 (description "This package provides the C library of RBio. It can be used
7204for reading and writing sparse matrices in the Rutherford/Boeing format.")
7205 (license license:gpl2+)))
7206
7207(define-public suitesparse-mongoose
7208 (package
7209 (name "suitesparse-mongoose")
7210 (version (assoc-ref %suitesparse-package-versions "SuiteSparse_Mongoose"))
7211 (source suitesparse-source)
7212 (build-system cmake-build-system)
7213 (arguments
7214 (list
7215 #:tests? #f
7216 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7217 #:phases
7218 #~(modify-phases %standard-phases
7219 (add-after 'unpack 'chdir
7220 (lambda _
7221 (chdir "Mongoose")))
7222 (add-after 'chdir 'set-cmake-module-path
7223 (lambda _
7224 (substitute* "CMakeLists.txt"
7225 (("set.*CMAKE_MODULE_PATH.*")
7226 (string-append "set(CMAKE_MODULE_PATH "
7227 #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
7228 "set(DUMMY\n")))))
7229 (add-after 'build 'build-doc
7230 (lambda _
7231 ;; A writable TEXMFVAR is required for building font shapes.
7232 (setenv "TEXMFVAR" "/tmp")
7233 ;; XeLaTeX fails with .eps graphics
7234 (with-directory-excursion "../Mongoose/Doc"
7235 (for-each
7236 (lambda (name)
7237 (invoke "epstopdf" name))
7238 (find-files "Figures" "\\.eps$"))
7239 (substitute* "Mongoose_UserGuide.tex"
7240 (("\\.eps") ".pdf"))
7241 (invoke "make"))))
7242 (add-after 'install 'install-doc
7243 (lambda _
7244 (install-file "../Mongoose/Doc/Mongoose_UserGuide.pdf"
7245 (string-append #$output "/share/doc/"
7246 #$name "-" #$version))))
7247 (replace 'install-license-files
7248 (lambda _
7249 (install-file "../Mongoose/Doc/License.txt"
7250 (string-append #$output "/share/doc/"
7251 #$name "-" #$version)))))))
7252 (propagated-inputs (list suitesparse-config))
7253 (native-inputs
7254 (list texlive-epstopdf
7255 (texlive-local-tree
7256 (list texlive-algorithmicx
7257 texlive-booktabs
7258 texlive-lastpage
7259 texlive-multirow
7260 texlive-pgf
7261 texlive-caption
7262 texlive-etoolbox
7263 texlive-csquotes
7264 texlive-fancybox
7265 texlive-enumitem
7266 texlive-microtype
7267 texlive-cancel
7268 texlive-sourcecodepro
7269 texlive-xkeyval
7270 texlive-fontspec
7271 texlive-wasy
7272 texlive-wasysym
7273 texlive-float
7274 texlive-tcolorbox
7275 texlive-environ
7276 texlive-xcolor
7277 texlive-xetex
7278 texlive-listings))))
7279 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7280 (synopsis "Graph partitioning library")
7281 (description "Mongoose is a library for graph partitioning by computing
7282edge cuts using a coarsening and refinement framework.")
7283 (license license:gpl3)))
7284
7285(define-public suitesparse-spex
7286 (package
7287 (name "suitesparse-spex")
7288 (version (assoc-ref %suitesparse-package-versions "SPEX"))
7289 (source suitesparse-source)
7290 (build-system cmake-build-system)
7291 (arguments
7292 (list
7293 #:tests? #f
7294 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7295 #:phases
7296 #~(modify-phases %standard-phases
7297 (add-after 'unpack 'chdir
7298 (lambda _
7299 (chdir "SPEX")))
7300 (add-after 'chdir 'set-cmake-module-path
7301 (lambda _
7302 (substitute* "CMakeLists.txt"
7303 (("set.*CMAKE_MODULE_PATH.*")
7304 (string-append
7305 "set(CMAKE_MODULE_PATH "
7306 (string-join
7307 (map (lambda (path)
7308 (string-append path "/lib/cmake/SuiteSparse"))
7309 (list #$suitesparse-amd
7310 #$suitesparse-colamd
7311 #$suitesparse-config)))
7312 ")\nset(DUMMY\n")))))
7313 (add-after 'build 'build-doc
7314 (lambda _
7315 (setenv "TEXMFVAR" "/tmp") ;for font shapes generation
7316 (with-directory-excursion "../SPEX/Doc"
7317 (invoke "make"))))
7318 (add-after 'install 'install-doc
7319 (lambda _
7320 (install-file "../SPEX/Doc/SPEX_UserGuide.pdf"
7321 (string-append #$output "/share/doc/"
7322 #$name "-" #$version)))))))
7323 (inputs (list suitesparse-amd suitesparse-colamd))
7324 (propagated-inputs (list gmp mpfr suitesparse-config))
7325 (native-inputs
7326 (list (texlive-local-tree
7327 (list texlive-paralist
7328 texlive-comment
7329 texlive-psfrag
7330 texlive-soul
7331 texlive-multirow
7332 texlive-algorithms
7333 texlive-fncychap
7334 texlive-float
7335 texlive-algorithmicx
7336 texlive-cprotect
7337 texlive-bigfoot
7338 texlive-caption
7339 texlive-listings
7340 texlive-xcolor
7341 texlive-framed
7342 texlive-mdframed
7343 texlive-etoolbox
7344 texlive-zref
7345 texlive-needspace))))
7346 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7347 (synopsis "Package for SParse EXact algebra")
7348 (description "SPEX is a set of routines for sparse exact linear algebra.
7349It contains the SPEX Left LU library for computing a sparse exact left-looking
7350LU factorization for solving unsymmetric sparse linear systems.")
7351 ;; Dual licensed.
7352 (license (list license:lgpl3+ license:gpl2+))))
7353
7354(define-public suitesparse-spqr
7355 (package
7356 (name "suitesparse-spqr")
7357 (version (assoc-ref %suitesparse-package-versions "SPQR"))
7358 (source suitesparse-source)
7359 (build-system cmake-build-system)
7360 (arguments
7361 (list
7362 #:tests? #f
7363 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7364 #:phases
7365 #~(modify-phases %standard-phases
7366 (add-after 'unpack 'chdir
7367 (lambda _
7368 (chdir "SPQR")))
7369 (add-after 'chdir 'set-cmake-module-path
7370 (lambda _
7371 (substitute* "CMakeLists.txt"
7372 (("set.*CMAKE_MODULE_PATH.*")
7373 (string-append
7374 "set(CMAKE_MODULE_PATH "
7375 (string-join
7376 (map (lambda (path)
7377 (string-append path "/lib/cmake/SuiteSparse"))
7378 (list #$suitesparse-amd
7379 #$suitesparse-camd
7380 #$suitesparse-ccolamd
7381 #$suitesparse-cholmod
7382 #$suitesparse-colamd
7383 #$suitesparse-config)))
7384 ")\nset(DUMMY\n")))))
7385 (add-after 'build 'build-doc
7386 (lambda _
7387 (setenv "TEXMFVAR" "/tmp") ;for generating font shapes
7388 (with-directory-excursion "../SPQR/Doc"
7389 (invoke "make"))))
7390 (add-after 'install 'install-doc
7391 (lambda _
7392 (install-file "../SPQR/Doc/spqr_user_guide.pdf"
7393 (string-append #$output "/share/doc/"
7394 #$name "-" #$version))))
7395 (replace 'install-license-files
7396 (lambda _
7397 (install-file "../SPQR/Doc/License.txt"
7398 (string-append #$output "/share/doc/"
7399 #$name "-" #$version)))))))
7400 (inputs (list openblas
7401 suitesparse-amd
7402 suitesparse-camd
7403 suitesparse-ccolamd
7404 suitesparse-colamd
7405 suitesparse-config))
7406 (propagated-inputs (list suitesparse-cholmod))
7407 (native-inputs
7408 (list (texlive-local-tree
7409 (list texlive-epsf
7410 texlive-etoolbox))))
7411 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7412 (synopsis "Sparse QR factorization method")
7413 (description "The SPQR (SuiteSparseQR) package provides sparse QR
7414factorization based on the multifrontal method, using BLAS for the frontal
7415matrices.")
7416 (license license:gpl2+)))
7417
7418(define-public suitesparse-umfpack
7419 (package
7420 (name "suitesparse-umfpack")
7421 (version (assoc-ref %suitesparse-package-versions "UMFPACK"))
7422 (source suitesparse-source)
7423 (build-system cmake-build-system)
7424 (arguments
7425 (list
7426 #:tests? #f
7427 #:configure-flags #~(list "-DSUITESPARSE_INCLUDEDIR_POSTFIX=")
7428 #:phases
7429 #~(modify-phases %standard-phases
7430 (add-after 'unpack 'chdir
7431 (lambda _
7432 (chdir "UMFPACK")))
7433 (add-after 'chdir 'set-cmake-module-path
7434 (lambda _
7435 (substitute* "CMakeLists.txt"
7436 (("set.*CMAKE_MODULE_PATH.*")
7437 (string-append
7438 "set(CMAKE_MODULE_PATH "
7439 (string-join
7440 (map (lambda (path)
7441 (string-append path "/lib/cmake/SuiteSparse"))
7442 (list #$suitesparse-amd
7443 #$suitesparse-camd
7444 #$suitesparse-ccolamd
7445 #$suitesparse-cholmod
7446 #$suitesparse-colamd
7447 #$suitesparse-config)))
7448 ")\nset(DUMMY\n")))))
7449 (add-after 'build 'build-doc
7450 (lambda _
7451 (setenv "TEXMFVAR" "/tmp") ;for generating font shapes
7452 (with-directory-excursion "../UMFPACK/Doc"
7453 (invoke "make"))))
7454 (add-after 'install 'install-doc
7455 (lambda _
7456 (let ((outdir
7457 (string-append #$output "/share/doc/"
7458 #$name "-" #$version)))
7459 (install-file "../UMFPACK/Doc/UMFPACK_UserGuide.pdf" outdir)
7460 (install-file "../UMFPACK/Doc/UMFPACK_QuickStart.pdf" outdir))))
7461 (replace 'install-license-files
7462 (lambda _
7463 (let ((outdir
7464 (string-append #$output "/share/doc/"
7465 #$name "-" #$version)))
7466 (install-file "../UMFPACK/Doc/License.txt" outdir)
7467 (install-file "../UMFPACK/Doc/gpl.txt" outdir)))))))
7468 (inputs (list openblas
7469 suitesparse-camd
7470 suitesparse-ccolamd
7471 suitesparse-cholmod
7472 suitesparse-colamd))
7473 (propagated-inputs
7474 (list suitesparse-amd
7475 suitesparse-config))
7476 (native-inputs
7477 (list (texlive-local-tree
7478 (list texlive-etoolbox
7479 texlive-framed
7480 texlive-mdframed
7481 texlive-needspace
7482 texlive-xcolor
7483 texlive-zref))))
7484 (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
7485 (synopsis "Routines for solving sparse linear problems via LU factorization")
7486 (description "UMFPACK is a set of routines for solving unsymmetric sparse
7487linear systems using the Unsymmetric MultiFrontal method and direct sparse LU
7488factorization.")
7489 (license license:gpl2+)))
7490
7491(define-public suitesparse
7492 (package
7493 (name "suitesparse")
7494 (version "5.13.0")
7495 (source
7496 (origin
7497 (method git-fetch)
7498 (uri (git-reference
7499 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
7500 (commit (string-append "v" version))))
7501 (file-name (git-file-name name version))
7502 (sha256
7503 (base32
7504 "1zwri246yr39p9ymjp18dzv36ch0dn107sf0jghj7capigasfxq2"))
7505 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
7506 (modules '((guix build utils)))
7507 (snippet
7508 ;; Remove bundled metis source
7509 '(begin
7510 (delete-file-recursively "metis-5.1.0")
7511 #t))))
7512 (build-system gnu-build-system)
7513 (arguments
7514 (list
7515 #:tests? #f ;no "check" target
7516 #:make-flags
7517 #~(list (string-append "CC=" #$(cc-for-target))
7518 "TBB=-ltbb"
7519 "MY_METIS_LIB=-lmetis"
7520
7521 ;; The default is to link against netlib lapack. Use OpenBLAS
7522 ;; instead.
7523 "BLAS=-lopenblas"
7524 "LAPACK=-lopenblas"
7525
7526 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
7527 (string-append
7528 "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=" #$output
7529 " -DCMAKE_VERBOSE_MAKEFILE=ON"
7530 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
7531 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
7532 " -DCMAKE_SKIP_RPATH=TRUE"
7533 " -DCMAKE_BUILD_TYPE=Release"
7534 " -DCMAKE_INSTALL_LIBDIR=lib")
7535 (string-append "INSTALL_LIB=" #$output "/lib")
7536 (string-append "INSTALL_INCLUDE=" #$output "/include")
7537 "library")
7538 #:phases
7539 #~(modify-phases %standard-phases
7540 #$@(if (target-riscv64?)
7541 ;; GraphBLAS FTBFS on riscv64-linux
7542 #~((add-after 'unpack 'skip-graphblas
7543 (lambda _
7544 (substitute* "Makefile"
7545 ((".*cd GraphBLAS.*")
7546 "")
7547 (("metisinstall gbinstall moninstall")
7548 "metisinstall moninstall")))))
7549 #~())
7550 (delete 'configure)))) ;no configure script
7551 (inputs
7552 (list tbb openblas gmp mpfr metis))
7553 (native-inputs
7554 (list cmake-minimal m4))
7555 (home-page "https://faculty.cse.tamu.edu/davis/suitesparse.html")
7556 (synopsis "Suite of sparse matrix software")
7557 (description
7558 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
7559multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
7560multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
7561simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
7562CXSparse, a concise sparse Cholesky factorization package; and many other
7563packages.
7564
7565This package contains all of the above-mentioned parts.
7566")
7567 ;; LGPLv2.1+:
7568 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
7569 ;; GPLv2+:
7570 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
7571 (license (list license:gpl2+ license:lgpl2.1+))))
7572
7573(define-public cglm
7574 (package
7575 (name "cglm")
7576 (version "0.9.6")
7577 (source
7578 (origin
7579 (method git-fetch)
7580 (uri (git-reference
7581 (url "https://github.com/recp/cglm")
7582 (commit (string-append "v" version))))
7583 (file-name (git-file-name name version))
7584 (sha256
7585 (base32 "1b04zdypa8clhpzg95h8m8xjylk8y5pw9kfn4jv19qlz5bsz183i"))))
7586 (build-system meson-build-system)
7587 (arguments
7588 `(#:configure-flags '("-Dbuild_tests=true")))
7589 (home-page "https://github.com/recp/cglm")
7590 (synopsis "Mathematics C library for graphics programming")
7591 (description
7592 "@acronym{CGLM, C OpenGL Mathematics} is an optimised 3D maths library
7593for graphics software based on the @acronym{GLSL, OpenGL Shading Language}
7594specifications.
7595
7596It's similar to the original C++ GLM library but written in C99 and compatible
7597with C89.")
7598 (license license:expat)))
7599
7600(define-public glm
7601 (package
7602 (name "glm")
7603 (version "1.0.1")
7604 (source
7605 (origin
7606 (method git-fetch)
7607 (uri (git-reference
7608 (url "https://github.com/g-truc/glm")
7609 (commit version)))
7610 (file-name (git-file-name name version))
7611 (sha256
7612 (base32 "0890rvv3czi3nqj11dc2m3wcdfv0dm0nr63wfcpfikk9sk6b4w8s"))))
7613 (build-system cmake-build-system)
7614 (arguments
7615 (list
7616 #:phases
7617 #~(modify-phases %standard-phases
7618 (add-after 'install 'post-install
7619 (lambda _
7620 (let* ((doc (string-append #$output "/share/doc/glm"))
7621 (pkgconfig (string-append #$output "/lib/pkgconfig")))
7622 (mkdir-p doc)
7623 (mkdir-p pkgconfig)
7624 (copy-recursively "../source/doc/api" (string-append doc "/html"))
7625 (install-file "../source/doc/manual.pdf" doc)
7626 (call-with-output-file (string-append pkgconfig "/glm.pc")
7627 (lambda (port)
7628 (format port
7629 "prefix=~a
7630includedir=${prefix}/include
7631
7632Name: GLM
7633Description: OpenGL Mathematics
7634Version: ~a
7635Cflags: -I${includedir}~%" #$output #$version)))))))))
7636 (native-inputs
7637 (list unzip))
7638 (home-page "https://glm.g-truc.net/")
7639 (synopsis "OpenGL Mathematics library")
7640 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
7641library for graphics software based on the OpenGL Shading Language (GLSL)
7642specifications.")
7643 (license license:expat)))
7644
7645(define-public lpsolve
7646 (package
7647 (name "lpsolve")
7648 (version "5.5.2.5")
7649 (source
7650 (origin
7651 (method url-fetch)
7652 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
7653 "/lp_solve_" version "_source.tar.gz"))
7654 (sha256
7655 (base32
7656 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7657 (modules '((guix build utils)))
7658 (snippet
7659 '(begin
7660 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
7661 (("^c=cc") "c=gcc")
7662 ;; Pretend to be on a 64 bit platform to obtain a common directory
7663 ;; name for the build results on all architectures; nothing else
7664 ;; seems to depend on it.
7665 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
7666
7667 ;; The check for 'isnan' as it is written fails with
7668 ;; "non-floating-point argument in call to function
7669 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
7670 ;; definition, which in turn leads to bad things. Fix the feature
7671 ;; test.
7672 (("isnan\\(0\\)") "isnan(0.)"))
7673 #t))))
7674 (build-system gnu-build-system)
7675 (arguments
7676 `(#:tests? #f ; no check target
7677 #:phases
7678 (modify-phases %standard-phases
7679 (delete 'configure) ; no configure script
7680 (add-after 'unpack 'apply-gcc-14-patch
7681 (lambda _
7682 (substitute* '("lpsolve55/ccc"
7683 "lp_solve/ccc")
7684 (("^c=gcc") "c=\"gcc -Wno-error=implicit-int\""))))
7685 (replace 'build
7686 (lambda _
7687 (with-directory-excursion "lpsolve55"
7688 (invoke "bash" "ccc"))
7689 (with-directory-excursion "lp_solve"
7690 (invoke "bash" "ccc"))
7691 #t))
7692 (replace 'install
7693 (lambda* (#:key outputs #:allow-other-keys)
7694 (let* ((out (assoc-ref outputs "out"))
7695 (bin (string-append out "/bin"))
7696 (lib (string-append out "/lib"))
7697 ;; This is where LibreOffice expects to find the header
7698 ;; files, and where they are installed by Debian.
7699 (include (string-append out "/include/lpsolve")))
7700 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
7701 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
7702 (install-file "lp_solve/bin/ux64/lp_solve" bin)
7703
7704 ;; Install a subset of the header files as on Debian
7705 ;; (plus lp_bit.h, which matches the regular expression).
7706 (for-each (lambda (name)
7707 (install-file name include))
7708 (find-files "." "lp_[HMSa-z].*\\.h$"))
7709 (with-directory-excursion "shared"
7710 (for-each (lambda (name)
7711 (install-file name include))
7712 (find-files "." "\\.h$")))
7713 #t))))))
7714 (home-page "https://lpsolve.sourceforge.net/")
7715 (synopsis "Mixed integer linear programming (MILP) solver")
7716 (description
7717 "lp_solve is a mixed integer linear programming solver based on the
7718revised simplex and the branch-and-bound methods.")
7719 (license license:lgpl2.1+)))
7720
7721(define-public dealii
7722 (package
7723 (name "dealii")
7724 (version "9.7.1")
7725 (source
7726 (origin
7727 (method url-fetch)
7728 (uri (string-append "https://github.com/dealii/dealii/releases/"
7729 "download/v" version "/dealii-" version ".tar.gz"))
7730 (sha256
7731 (base32 "0hyyly71ljnb7fsl2yan7wf3zxhkly7i8gczpv7gsm6vhgprc80g"))
7732 (modules '((guix build utils)))
7733 (snippet
7734 ;; Remove bundled boost, Kokkos, muparser, TBB and UMFPACK.
7735 #~(delete-file-recursively "bundled"))))
7736 (build-system cmake-build-system)
7737 (outputs '("out" "doc"))
7738 (native-inputs
7739 ;; Required to build the documentation.
7740 (list graphviz doxygen perl))
7741 (inputs
7742 (list arpack-ng
7743 openblas
7744 gfortran
7745 muparser
7746 taskflow
7747 zlib))
7748 (propagated-inputs
7749 ;; Some scripts are installed into share/deal.II/scripts that require
7750 ;; perl and python, but they are not executable (and some are missing the
7751 ;; shebang line) and therefore must be explicitly passed to the
7752 ;; interpreter.
7753 ;; Anyway, they are meant to be used at build time, so rather than adding
7754 ;; the interpreters here, any package depending on them should just add
7755 ;; the requisite interpreter to its native inputs.
7756 (list boost
7757 hdf5
7758 kokkos
7759 onetbb
7760 suitesparse ; For UMFPACK.
7761 sundials))
7762 (arguments
7763 (list #:build-type "DebugRelease" ; Only Debug, Release or DebugRelease.
7764 ;; The tests take too long and must be explicitly enabled with
7765 ;; "make setup_tests".
7766 ;; See https://www.dealii.org/developer/developers/testsuite.html.
7767 ;; (They can also be run for an already installed deal.II.)
7768 #:tests? #f
7769 #:configure-flags
7770 #~(let ((doc (string-append #$output:doc "/share/doc/"
7771 #$name "-" #$version)))
7772 (list "-DDEAL_II_COMPONENT_DOCUMENTATION=ON"
7773 (string-append "-DDEAL_II_DOCREADME_RELDIR=" doc)
7774 (string-append "-DDEAL_II_DOCHTML_RELDIR=" doc "/html")
7775 ;; Don't compile the examples because the source and
7776 ;; CMakeLists.txt are installed anyway, allowing users to
7777 ;; do so for themselves.
7778 "-DDEAL_II_COMPILE_EXAMPLES=OFF"
7779 (string-append "-DDEAL_II_EXAMPLES_RELDIR=" doc
7780 "/examples")))
7781 #:phases
7782 #~(modify-phases %standard-phases
7783 ;; Without unsetting CPATH, the build fails with the following
7784 ;; error (similar to <https://bugs.gnu.org/30756>):
7785 ;;
7786 ;; /gnu/store/…-gcc-11.3.0/include/c++/math.h:30:16: fatal error: math.h: No such file or directory
7787 ;; 30 | # include_next <math.h>
7788 ;; | ^~~~~~~~
7789 ;;
7790 ;; Why does unsetting CPATH magically fix the error?
7791 ;; TODO: Properly fix this issue.
7792 (add-after 'set-paths 'unset-cpath
7793 (lambda _
7794 (unsetenv "CPATH")))
7795 (add-after 'install 'remove-build-logs
7796 ;; These build logs leak the name of the build directory by
7797 ;; storing the values of CMAKE_SOURCE_DIR and
7798 ;; CMAKE_BINARY_DIR.
7799 (lambda _
7800 (let ((doc (string-append #$output:doc "/share/doc/"
7801 #$name "-" #$version)))
7802 (for-each delete-file
7803 (map (lambda (f) (string-append doc "/" f))
7804 '("detailed.log" "summary.log")))))))))
7805 (home-page "https://www.dealii.org/")
7806 (synopsis "Finite element library")
7807 (description
7808 "Deal.II is a C++ program library targeted at the computational solution
7809of partial differential equations using adaptive finite elements. The main
7810aim of deal.II is to enable rapid development of modern finite element codes,
7811using among other aspects adaptive meshes and a wide array of tools often used
7812in finite element programs.")
7813 (license license:lgpl2.1+)))
7814
7815(define-public flann
7816 (package
7817 (name "flann")
7818 (version "1.9.2")
7819 (home-page "https://github.com/mariusmuja/flann/")
7820 (source
7821 (origin
7822 (method git-fetch)
7823 (uri (git-reference (url home-page) (commit version)))
7824 (file-name (git-file-name name version))
7825 (sha256
7826 (base32
7827 "1954azd78qx1dkcs47cyyhb34845zdg0qrhs9z649sfc5mf2gbhp"))
7828 (patches (search-patches "flann-pc-file.patch"))))
7829 (build-system cmake-build-system)
7830 (outputs '("out"))
7831 (native-inputs
7832 (list pkg-config unzip))
7833 (propagated-inputs (list lz4))
7834 ;; utils/serialization.h includes lz.4
7835 (inputs
7836 (list
7837 hdf5
7838 ;; FIXME: 'mkoctfile' fails with a linker error:
7839 ;; ld: cannot find -loctinterp
7840 ;; ld: cannot find -loctave
7841 ;; Disable it for now.
7842 ;; octave-cli
7843 python))
7844 (arguments
7845 (list
7846 #:tests? #f ; The test data are downloaded from the Internet.
7847 ;; The 'share/flann/octave' contains a .mex file, which is an ELF file
7848 ;; taken 46 MiB unstripped, and 6 MiB stripped.
7849 #:strip-directories #~(list "lib" "lib64" "libexec"
7850 "bin" "sbin" "share/flann/octave")
7851 ;; Save 10 MiB by not installing .a files. Passing
7852 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
7853 #:phases
7854 #~(modify-phases %standard-phases
7855 (add-after 'install 'remove-static-libraries
7856 (lambda _
7857 (let ((lib (string-append #$output "/lib")))
7858 (for-each delete-file
7859 (find-files lib "\\.a$"))))))))
7860 (synopsis "Library for approximate nearest neighbors computation")
7861 (description "FLANN is a library for performing fast approximate
7862nearest neighbor searches in high dimensional spaces. It implements a
7863collection of algorithms and a system for automatically choosing the best
7864algorithm and optimum parameters depending on the dataset.
7865
7866FLANN is written in C++ and contains bindings for C, Octave and Python.")
7867 (license (license:non-copyleft "file://COPYING"
7868 "See COPYING in the distribution."))))
7869
7870(define-public nanoflann
7871 (package
7872 (name "nanoflann")
7873 (version "1.9.0")
7874 (source
7875 (origin
7876 (method git-fetch)
7877 (uri (git-reference
7878 (url "https://github.com/jlblancoc/nanoflann")
7879 (commit (string-append "v" version))))
7880 (file-name (git-file-name name version))
7881 (sha256
7882 (base32 "1cizyl30ad5ljxy0dvj4hw85222rzhsw7lsdgjp5rl6kpqqrxmqw"))))
7883 (build-system cmake-build-system)
7884 (arguments
7885 (list
7886 #:configure-flags
7887 #~(list "-DNANOFLANN_BUILD_EXAMPLES=OFF" "-DNANOFLANN_BUILD_TESTS=ON")))
7888 (native-inputs (list googletest))
7889 (home-page "https://github.com/jlblancoc/nanoflann")
7890 (synopsis
7891 "C++11 header-only library for nearest neighbor search with KD-trees")
7892 (description
7893 "nanoflann is a C++11 header-only library for building KD-trees of datasets
7894with different topologies: R2, R3 (point clouds), SO(2) and SO(3) (2D and 3D
7895rotation groups). It is a fork of the FLANN library that replaces virtual
7896methods inlined templates for improved runtime and memory efficiency.")
7897 (license license:bsd-2)))
7898
7899(define-public wcalc
7900 (package
7901 (name "wcalc")
7902 (version "2.5")
7903 (source
7904 (origin
7905 (method url-fetch)
7906 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
7907 "wcalc-" version ".tar.bz2"))
7908 (sha256
7909 (base32
7910 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))
7911 (snippet
7912 #~(begin
7913 (for-each delete-file
7914 (list "src/common/scanner.c"
7915 "src/common/parser.c"
7916 "src/common/parser.h"))))))
7917 (build-system gnu-build-system)
7918 (inputs
7919 (list mpfr readline))
7920 (native-inputs
7921 (list bison flex))
7922 (home-page "https://w-calc.sourceforge.net/index.php")
7923 (synopsis "Flexible command-line scientific calculator")
7924 (description "Wcalc is a very capable calculator. It has standard functions
7925(sin, asin, and sinh for example, in either radians or degrees), many
7926pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
7927variables, a command history, hex/octal/binary input and output, unit
7928conversions, embedded comments, and an expandable expression entry field. It
7929evaluates expressions using the standard order of operations.")
7930 (license license:gpl2+)))
7931
7932(define-public xaos
7933 (package
7934 (name "xaos")
7935 (version "4.3.3")
7936 (source (origin
7937 (method git-fetch)
7938 (uri (git-reference
7939 (url "https://github.com/xaos-project/XaoS")
7940 (commit (string-append "release-" version))))
7941 (file-name (git-file-name name version))
7942 (sha256
7943 (base32
7944 "0imq6rvvjwjgmrfr25yr5lmhmqr4s6a5174jhah90mhf7pb62j0i"))))
7945 (build-system gnu-build-system)
7946 (native-inputs `(("gettext" ,gettext-minimal)
7947 ("qtbase" ,qtbase)
7948 ("qttools" ,qttools)))
7949 (inputs (list libx11 zlib libpng gsl))
7950 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
7951 ;; not enough for this package to install properly. These phases fix that.
7952 (arguments
7953 (list #:tests? #f ;no "check" target
7954 #:phases
7955 #~(modify-phases %standard-phases
7956 (add-before 'configure 'make-qt-deterministic
7957 (lambda _
7958 ;; Make Qt deterministic.
7959 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")))
7960 (replace 'configure
7961 (lambda* (#:key outputs #:allow-other-keys)
7962 (let ((out (assoc-ref outputs "out")))
7963 (substitute* "XaoS.pro"
7964 ;; The DESTDIR is originally set to install the xaos binary to
7965 ;; the "bin" folder inside the build directory. Setting make
7966 ;; flags doesn't seem to change this.
7967 (("DESTDIR.*$")
7968 (string-append "DESTDIR=" out "/bin"))
7969 (("/usr/local")
7970 out)
7971 ;; Set the correct path to the lrelease binary.
7972 (("lrelease-qt6") "lrelease"))
7973 (substitute* "src/include/config.h"
7974 (("/usr/share/XaoS")
7975 (string-append out "/share/XaoS")))
7976 (invoke "qmake"))))
7977 (add-after 'install 'install-data
7978 (lambda* (#:key outputs #:allow-other-keys)
7979 (let* ((out (assoc-ref outputs "out"))
7980 (share (string-append out "/share")))
7981 (mkdir-p share)
7982 (for-each
7983 (lambda (folder)
7984 (copy-recursively folder
7985 (string-append share "/XaoS/" folder)))
7986 '("catalogs" "examples" "tutorial"))
7987 (install-file "xdg/xaos.png"
7988 (string-append share "/pixmaps"))
7989 (install-file "xdg/io.github.xaos_project.XaoS.desktop"
7990 (string-append share "/applications"))))))))
7991 (synopsis "Real-time fractal zoomer")
7992 (description "GNU XaoS is a graphical program that generates fractal
7993patterns and allows you to zoom in and out of them infinitely in a fluid,
7994continuous manner. It also includes tutorials that help to explain how fractals
7995are built. It can generate many different fractal types such as the Mandelbrot
7996set.")
7997 (home-page "https://xaos-project.github.io/")
7998 (license license:gpl2+)))
7999
8000(define-public hypre
8001 (package
8002 (name "hypre")
8003 (version "2.32.0")
8004 (source
8005 (origin
8006 (method git-fetch)
8007 (uri (git-reference
8008 (url "https://github.com/hypre-space/hypre")
8009 (commit (string-append "v" version))))
8010 (file-name (git-file-name name version))
8011 (sha256
8012 (base32 "1hlydh15wz0yv5bgry7yyx4pvrl656mifhqjgifzf6dyksfvwpl7"))))
8013 (build-system gnu-build-system)
8014 (outputs '("out" ;5.3 MiB of headers and libraries
8015 "doc")) ;12 MiB of documentation
8016 (native-inputs
8017 (list doc++
8018 doxygen-1.16
8019 ghostscript
8020 python
8021 python-breathe
8022 python-sphinx
8023 python-sphinx-rtd-theme
8024 (texlive-local-tree
8025 (list texlive-adjustbox
8026 texlive-alphalph
8027 texlive-booktabs
8028 texlive-capt-of
8029 texlive-caption
8030 texlive-changepage
8031 texlive-cmap
8032 texlive-courier
8033 texlive-enumitem
8034 texlive-etoc
8035 texlive-fancyvrb
8036 texlive-float
8037 texlive-fncychap
8038 texlive-framed
8039 texlive-hanging
8040 texlive-helvetic
8041 texlive-jknapltx
8042 texlive-latexmk
8043 texlive-listofitems
8044 texlive-ltablex
8045 texlive-multirow
8046 texlive-natbib
8047 texlive-needspace
8048 texlive-newunicodechar
8049 texlive-ninecolors
8050 texlive-parskip
8051 texlive-sectsty
8052 texlive-stackengine
8053 texlive-tabularray
8054 texlive-tabulary
8055 texlive-tex-gyre
8056 texlive-titlesec
8057 texlive-tocloft
8058 texlive-ulem
8059 texlive-upquote
8060 texlive-varwidth
8061 texlive-wasy
8062 texlive-wasysym
8063 texlive-wrapfig
8064 texlive-xcolor
8065 texlive-xltabular
8066 texlive-xypic))))
8067 (inputs
8068 (list openblas))
8069 (arguments
8070 (list #:modules `((srfi srfi-1)
8071 ,@%default-gnu-modules)
8072 #:configure-flags #~'("--enable-shared"
8073 "--disable-fortran"
8074 "--without-MPI"
8075 "--with-openmp"
8076 "--with-fei"
8077 "--with-lapack"
8078 "--with-blas")
8079 #:phases
8080 #~(modify-phases %standard-phases
8081 (add-before 'configure 'chdir-src
8082 (lambda _
8083 (chdir "src")))
8084 (replace 'configure
8085 (lambda* (#:key build target configure-flags
8086 #:allow-other-keys #:rest args)
8087 (let* ((configure (assoc-ref %standard-phases 'configure)))
8088 (apply configure
8089 (append args
8090 (list #:configure-flags
8091 (cons (string-append "--host="
8092 (or target build))
8093 configure-flags)))))))
8094 (add-after 'build 'build-docs
8095 (lambda _
8096 (setenv "TEXMFVAR" "/tmp")
8097 (invoke "make" "-C" "docs")))
8098 (replace 'check
8099 (lambda* (#:key tests? #:allow-other-keys)
8100 (when tests?
8101 (setenv "LD_LIBRARY_PATH"
8102 (string-append (getcwd) "/hypre/lib"))
8103 (setenv "PATH"
8104 (string-append "." ":" (getenv "PATH")))
8105 (invoke "make" "check" "CHECKRUN=")
8106 (for-each (lambda (filename)
8107 (let ((size (stat:size (stat filename))))
8108 (when (positive? size)
8109 (error (format #f
8110 "~a size ~d; error indication~%"
8111 filename size)))))
8112 (find-files "test" ".*\\.err$")))))
8113 (add-after 'install 'install-docs
8114 (lambda* (#:key outputs #:allow-other-keys)
8115 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
8116 (let* ((doc (assoc-ref outputs "doc"))
8117 (docdir (string-append doc "/share/doc/hypre-"
8118 #$version)))
8119 (with-directory-excursion "docs"
8120 (for-each (lambda (base)
8121 (install-file (string-append base
8122 ".pdf") docdir)
8123 (copy-recursively (string-append base
8124 "-html")
8125 (string-append docdir
8126 "/" base)))
8127 '("usr-manual" "ref-manual")))))))))
8128 (home-page "https://computing.llnl.gov/projects\
8129/hypre-scalable-linear-solvers-multigrid-methods")
8130 (synopsis "Library of solvers and preconditioners for linear equations")
8131 (description
8132 "HYPRE is a software library of high performance preconditioners and
8133solvers for the solution of large, sparse linear systems of equations. It
8134features multigrid solvers for both structured and unstructured grid
8135problems.")
8136 (properties '((tunable? . #t)))
8137 (license license:lgpl2.1)))
8138
8139(define-public hypre-openmpi
8140 (package
8141 (inherit hypre)
8142 (name "hypre-openmpi")
8143 (inputs (modify-inputs inputs
8144 (prepend openmpi)))
8145 (arguments
8146 (substitute-keyword-arguments arguments
8147 ((#:configure-flags flags)
8148 #~`("--with-MPI" ,@(delete "--without-MPI"
8149 #$flags)))
8150 ((#:phases phases)
8151 #~(modify-phases #$phases
8152 (add-before 'check 'mpi-setup
8153 #$%openmpi-setup)))))
8154 (synopsis "Parallel solvers and preconditioners for linear equations")
8155 (description
8156 "HYPRE is a software library of high performance preconditioners and
8157solvers for the solution of large, sparse linear systems of equations on
8158parallel computers. It features parallel multigrid solvers for both
8159structured and unstructured grid problems.")))
8160
8161(define-public matio
8162 (package
8163 (name "matio")
8164 (version "1.5.23")
8165 (source
8166 (origin
8167 (method url-fetch)
8168 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
8169 "matio-" version ".tar.gz"))
8170 (sha256
8171 (base32
8172 "0vjdkxn402gwrgbi5ii3n2ai01bjzzfb588iqd9ylinzc7kfm4cz"))))
8173 (build-system gnu-build-system)
8174 (arguments
8175 (list
8176 #:phases
8177 #~(modify-phases %standard-phases
8178 (add-before 'install 'install-matioConfig.h
8179 (lambda _
8180 (install-file "src/matioConfig.h"
8181 (string-append #$output "/include")))))))
8182 (inputs
8183 (list zlib hdf5))
8184 (home-page "http://matio.sourceforge.net/")
8185 (synopsis "Library for reading and writing MAT files")
8186 (description "Matio is a library for reading and writing MAT files. It
8187supports compressed MAT files, as well as newer (version 7.3) MAT files.")
8188 (license license:bsd-2)))
8189
8190(define-public vc
8191 (package
8192 (name "vc")
8193 (version "1.4.3")
8194 (source
8195 (origin
8196 (method url-fetch)
8197 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
8198 "download/" version "/Vc-" version ".tar.gz"))
8199 (sha256
8200 (base32 "0zq37r8yisd4dwlb024l10wk2yq9kisa4xm79ia1ggrz7w2s13lq"))))
8201 (build-system cmake-build-system)
8202 (arguments
8203 (list
8204 #:configure-flags
8205 #~(list ;; By default, Vc will optimize for the CPU of the build machine.
8206 ;; Setting this to "none" makes it create portable binaries. See
8207 ;; "cmake/OptimizeForArchitecture.cmake".
8208 "-DTARGET_ARCHITECTURE=none")
8209 #:phases
8210 #~(modify-phases %standard-phases
8211 (add-after 'unpack 'copy-testdata
8212 (lambda _
8213 (copy-recursively #$(this-package-native-input "testdata")
8214 "tests/testdata"))))))
8215 (native-inputs
8216 `(("virtest" ,virtest)
8217
8218 ;; This is a submodule in the git project, but not part of the
8219 ;; released sources. See the git branch for the commit to take.
8220 ("testdata"
8221 ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
8222 (origin
8223 (method git-fetch)
8224 (uri (git-reference
8225 (url "https://github.com/VcDevel/vc-testdata")
8226 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
8227 (file-name (git-file-name "vc-testdata" (string-take commit 7)))
8228 (sha256
8229 (base32
8230 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
8231 (synopsis "SIMD vector classes for C++")
8232 (description "Vc provides portable, zero-overhead C++ types for explicitly
8233data-parallel programming. It is a library designed to ease explicit
8234vectorization of C++ code. Its types enable explicitly stating data-parallel
8235operations on multiple values. The parallelism is therefore added via the type
8236system. Vc has an intuitive API and provides portability between different
8237compilers and compiler versions as well as portability between different vector
8238instruction sets. Thus, an application written with Vc can be compiled for:
8239@enumerate
8240@item AVX and AVX2
8241@item SSE2 up to SSE4.2 or SSE4a
8242@item Scalar
8243@item MIC
8244@item NEON (in development)
8245@item NVIDIA GPUs / CUDA (in development)
8246@end enumerate\n")
8247 (home-page "https://github.com/VcDevel/Vc")
8248 ;; "No support_???.cpp file exists for this architecture."
8249 (supported-systems '("x86_64-linux" "i686-linux"))
8250 (license license:bsd-3)))
8251
8252(define-public reducelcs
8253 ;; This is the last commit which is available upstream, no
8254 ;; release happened since 2010.
8255 (let ((commit "963f74f7279ba6fc0ea7d8ddfd361ea190c80313")
8256 (revision "2"))
8257 (package
8258 (name "reducelcs")
8259 (version (git-version "1.0" revision commit))
8260 (source
8261 (origin
8262 (method git-fetch)
8263 (uri (git-reference
8264 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
8265 (commit commit)))
8266 (file-name (git-file-name name version))
8267 (sha256
8268 (base32
8269 "03chvd9wb2z08r7ka2npr49dbimjvzn2gfm7cnp5l079vbw1dfny"))))
8270 (build-system gnu-build-system)
8271 (inputs (list openlibm))
8272 (arguments
8273 (list
8274 #:tests? #f ; no tests
8275 #:phases
8276 #~(modify-phases %standard-phases
8277 (delete 'configure) ; No configure script exists.
8278 (replace 'install ; No install phase exists.
8279 (lambda* (#:key outputs #:allow-other-keys)
8280 (let* ((out (assoc-ref outputs "out"))
8281 (bin (string-append out "/bin")))
8282 (install-file "Approximation" bin)
8283 (install-file "CollectResults" bin)
8284 (install-file "GenerateInstances" bin)))))))
8285 (synopsis "Approximate Longest Commons Subsequence computation tool")
8286 (description
8287 "@code{reduceLCS} is an implementation of the Reduce-Expand
8288algorithm for LCS. It is a fast program to compute the approximate
8289Longest Commons Subsequence of a set of strings.")
8290 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
8291 (license license:gpl3+))))
8292
8293(define-public java-smtinterpol
8294 (package
8295 (name "java-smtinterpol")
8296 (version "2.5")
8297 (source (origin
8298 (method git-fetch)
8299 (uri (git-reference
8300 (url "https://github.com/ultimate-pa/smtinterpol")
8301 (commit version)))
8302 (file-name (git-file-name name version))
8303 (modules '((guix build utils)))
8304 (snippet #~(begin
8305 (delete-file-recursively "jacoco")
8306 (delete-file-recursively "libs")
8307 (delete-file-recursively "sonar")))
8308 (sha256
8309 (base32
8310 "0bq5l7g830a8hxw1xyyfp2ph6jqk8ak0ichlymdglpnpngf6322f"))))
8311 (build-system ant-build-system)
8312 (arguments
8313 (list #:build-target "dist"
8314 #:test-target "runtests"
8315 #:phases
8316 #~(modify-phases %standard-phases
8317 (add-after 'unpack 'fix-build.xml
8318 (lambda _
8319 (substitute* "build.xml"
8320 (("<tstamp>") "<!--")
8321 (("</tstamp>") "-->")
8322 (("executable=\"git\"")
8323 (string-append "executable=\""
8324 (which "sh")
8325 "\""))
8326 (("<property file=.*/>" all)
8327 (string-append all
8328 "<property environment=\"env\" />"))
8329 (("<classpath>" all)
8330 (string-append
8331 all
8332 "<pathelement path=\"${env.CLASSPATH}\" />"))
8333 (("<fileset file=\".*/libs/.*/>") "")
8334 (("<junit")
8335 "<junit haltonfailure=\"yes\""))
8336 (call-with-output-file "describe"
8337 (lambda (port)
8338 (format port "echo ~a" #$version)))))
8339 (add-before 'check 'delete-failing-tests
8340 (lambda _
8341 (delete-file
8342 (string-append "SMTInterpolTest/src/de/uni_freiburg"
8343 "/informatik/ultimate/smtinterpol/convert/"
8344 "EqualityDestructorTest.java"))))
8345 (replace 'install
8346 (lambda* (#:key outputs #:allow-other-keys)
8347 (let* ((out (assoc-ref outputs "out"))
8348 (java (string-append out "/share/java")))
8349 (for-each (lambda (f) (install-file f java))
8350 (find-files "dist" "\\.jar$"))))))))
8351 (native-inputs (list java-junit))
8352 (home-page "http://ultimate.informatik.uni-freiburg.de/smtinterpol/")
8353 (synopsis "Interpolating SMT solver")
8354 (description "SMTInterpol is an @acronym{SMT, Satisfiability Modulo Theories}
8355solver, that can compute Craig interpolants for various theories.")
8356 (license license:lgpl3+)))
8357
8358(define-public yices
8359 (package
8360 (name "yices")
8361 (version "2.7.0")
8362 (source (origin
8363 (method git-fetch)
8364 (uri (git-reference
8365 (url "https://github.com/SRI-CSL/yices2/")
8366 (commit (string-append "yices-" version))))
8367 (sha256
8368 (base32 "1jikmka2bi2as08lsvpf43r7s4lscpg0g4lg7dr68aba1jk9wb5j"))
8369 (file-name (git-file-name name version))))
8370 (build-system gnu-build-system)
8371 (arguments
8372 (list #:configure-flags
8373 #~(list #$@(if (%current-target-system)
8374 '()
8375 (list (string-append "--build="
8376 (%current-system))))
8377 "--enable-mcsat"
8378 ;; XXX: Ewww, static linkage
8379 (string-append
8380 "--with-static-libpoly="
8381 (search-input-file %build-inputs "lib/libpoly.a"))
8382 (string-append
8383 "--with-static-gmp="
8384 (search-input-file %build-inputs "lib/libgmp.a"))
8385 (string-append
8386 "--with-pic-libpoly="
8387 (search-input-file %build-inputs "lib/libpicpoly.a")))
8388 #:phases
8389 #~(modify-phases %standard-phases
8390 (add-after 'unpack 'fix-build-files
8391 (lambda _
8392 (substitute* "Makefile.build"
8393 (("SHELL=.*") "")
8394 (("/sbin/ldconfig") (which "ldconfig")))
8395 (substitute* (find-files "etc" "install-yices.*")
8396 (("/usr/bin/install") (which "install"))
8397 (("/bin/ln") (which "ln"))
8398 (("/sbin/ldconfig") (which "ldconfig"))
8399 (("install_dir=.*")
8400 (string-append "install_dir=" #$output))))))))
8401 (inputs (list cudd gmp gperf libpoly))
8402 (native-inputs (list autoconf automake bash-minimal python-minimal-wrapper))
8403 (home-page "https://yices.csl.sri.com/")
8404 (synopsis "Satisfiability modulo theories solver")
8405 (description "Yices is a solver for @acronym{SMT, satisfiability modulo
8406theories} problems. It can process input in SMT-LIB format or its own
8407s-expression-based format.")
8408 (license license:gpl3+)))
8409
8410(define-public symfpu
8411 (package
8412 (name "symfpu")
8413 (version "1.2.0")
8414 (source
8415 (origin
8416 (method git-fetch)
8417 (uri (git-reference
8418 (url "https://github.com/martin-cs/symfpu")
8419 (commit (string-append "symfpu-" version "-dual-license"))))
8420 (file-name (git-file-name name version))
8421 (sha256
8422 (base32 "13a9y0spyi6pggbhjgwi9g2qy822h1zakzhhwvm8qgk5c4njv3c6"))
8423 (patches (search-patches "symfpu-fix-rounding-test-case.patch"))))
8424 (build-system copy-build-system)
8425 (arguments
8426 (list
8427 #:install-plan
8428 #~`(("symfpu.pc" "lib/pkgconfig/symfpu.pc")
8429 ("core" "include/symfpu/core" #:exclude ("Makefile"))
8430 ("utils" "include/symfpu/utils" #:exclude ("Makefile")))
8431 #:phases
8432 #~(modify-phases %standard-phases
8433 ;; Make sure that the tests exit with a zero exit status by default.
8434 ;; Generated tests have assert(3) statements which exit with a
8435 ;; non-zero exit status on test failure.
8436 (add-after 'unpack 'fix-tests
8437 (lambda _
8438 (substitute* "applications/test.cpp"
8439 (("return 1") "return 0"))))
8440 (add-before 'install 'check
8441 (lambda* (#:key tests? #:allow-other-keys)
8442 (when tests?
8443 ;; To ensure the test application builds prior to 'install,
8444 ;; set up a symlink and modify CXXFLAGS to find the headers.
8445 (symlink #$source "symfpu")
8446 (invoke "make" "CXXFLAGS=-I." "test")
8447
8448 ;; Run tests in their breadth (i.e., --allTests) but on a very
8449 ;; small value range as otherwise the tests run for a long time.
8450 (invoke "./test"
8451 "--allTests"
8452 "--printC"
8453 "--start=0"
8454 "--end=125"
8455 "--verbose")
8456
8457 ;; Test script generates C code which we then compile & execute.
8458 (for-each
8459 (lambda (file)
8460 (let ((case (string-drop-right file (string-length ".c"))))
8461 (format #t "Running test case ~a~%" case)
8462 (invoke "g++" "-std=gnu++11" "-o" case file)
8463 (invoke (string-append "./" case))))
8464 (find-files "." "^testC..*\\.c$")))))
8465 (add-before 'install 'build-pkgconfig
8466 (lambda* (#:key outputs #:allow-other-keys)
8467 (with-output-to-file "symfpu.pc"
8468 (lambda _
8469 (format #t
8470 "prefix=~a~@
8471 exec_prefix=${prefix}~@
8472 includedir=${prefix}/include~@
8473 ~@
8474 ~@
8475 Name: symfpu~@
8476 Version: ~a~@
8477 Description: library for IEEE-754 floats~@
8478 Cflags: -I${includedir}~%"
8479 (assoc-ref outputs "out")
8480 #$version))))))))
8481 (synopsis
8482 "Concrete and symbolic implementation of IEEE-754 floating-point numbers")
8483 (description
8484 "SoftFPU is a C++ library implementing concrete and symbolic
8485mantics for floating point numbers as defined in the IEEE-754 Standard
8486r Floating-Point Arithmetic. It is templated in terms of the
8487t-vectors, propositions, floating-point formats and rounding mode types
8488ed. This allow the same code to be executed as an arbitrary precision
8489brary or to be used to build symbolic representations of floating-point
8490erations.")
8491 (home-page "https://github.com/martin-cs/symfpu")
8492 (license (list license:bsd-3 license:gpl3+))))
8493
8494(define-public bitwuzla
8495 (package
8496 (name "bitwuzla")
8497 (version "0.9.1")
8498 (source
8499 (origin
8500 (method git-fetch)
8501 (uri (git-reference
8502 (url "https://github.com/bitwuzla/bitwuzla")
8503 (commit version)))
8504 (file-name (git-file-name name version))
8505 (sha256
8506 (base32 "085cph4vdr8j64wmia88bmrd84vgs51rkpismdh7b1f5s0nsvr6y"))))
8507 (build-system meson-build-system)
8508 (arguments
8509 `(#:configure-flags '("-Dtesting=enabled" "-Ddefault_library=shared"
8510 "-Dkissat=true")))
8511 (native-inputs (list googletest pkg-config))
8512 (inputs (list cadical-2.1
8513 gmp
8514 kissat
8515 mpfr
8516 symfpu))
8517 (synopsis "SMT solver optimized for the theory of bit-vectors")
8518 (description
8519 "Bitwuzla is a @acronym{SMT, Satisfiability Modulo Theories} solver
8520for the theories of fixed-size bit-vectors, floating-point arithmetic,
8521arrays, uninterpreted functions and their combinations.")
8522 (home-page "https://bitwuzla.github.io/")
8523 (license license:expat)))
8524
8525(define-public z3
8526 (package
8527 (name "z3")
8528 (version "4.13.0")
8529 (home-page "https://github.com/Z3Prover/z3")
8530 (source (origin
8531 (method git-fetch)
8532 (uri (git-reference (url home-page)
8533 (commit (string-append "z3-" version))))
8534 (file-name (git-file-name name version))
8535 (sha256
8536 (base32
8537 "0j46lckf3zgx2xjay7z6nvlgh47gisbbl4s3m5zn280a13fwz1ih"))))
8538 (build-system cmake-build-system)
8539 (arguments
8540 (list
8541 #:imported-modules (append %cmake-build-system-modules
8542 %pyproject-build-system-modules)
8543 #:modules '((guix build cmake-build-system)
8544 (guix build utils)
8545 ((guix build pyproject-build-system) #:prefix py:))
8546 #:configure-flags
8547 #~(list "-DZ3_BUILD_PYTHON_BINDINGS=ON"
8548 "-DZ3_LINK_TIME_OPTIMIZATION=ON"
8549 (string-append
8550 "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
8551 #$output "/lib/python"
8552 #$(version-major+minor (package-version python-wrapper))
8553 "/site-packages"))
8554 #:phases
8555 #~(modify-phases %standard-phases
8556 (replace 'check
8557 (lambda* (#:key parallel-build? tests? #:allow-other-keys)
8558 (when tests?
8559 (invoke "make" "test-z3"
8560 (format #f "-j~a"
8561 (if parallel-build?
8562 (parallel-job-count)
8563 1)))
8564 (invoke "./test-z3" "/a"))))
8565 (add-after 'install 'compile-python-modules
8566 (assoc-ref py:%standard-phases 'compile-bytecode))
8567 ;; This step is missing in the CMake build system, do it here.
8568 (add-after 'compile-python-modules 'fix-z3-library-path
8569 (lambda* (#:key inputs outputs #:allow-other-keys)
8570 (let* ((dest (string-append (py:site-packages inputs outputs)
8571 "/z3/lib/libz3.so"))
8572 (z3-lib (string-append #$output "/lib/libz3.so")))
8573 (mkdir-p (dirname dest))
8574 (symlink z3-lib dest)))))))
8575 (native-inputs
8576 (list which python-wrapper))
8577 (synopsis "Theorem prover")
8578 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
8579theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
8580 (license license:expat)))
8581
8582(define-public ocaml-z3
8583 (package
8584 (inherit z3)
8585 (name "ocaml-z3")
8586 (build-system gnu-build-system)
8587 (arguments
8588 `(#:tests? #f; no ml tests
8589 #:phases
8590 (modify-phases %standard-phases
8591 (add-before 'configure 'bootstrap
8592 (lambda* (#:key outputs #:allow-other-keys)
8593 (let ((out (assoc-ref outputs "out")))
8594 (setenv "OCAMLFIND_LDCONF" "ignore")
8595 (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
8596 (mkdir-p (string-append out "/lib/ocaml/site-lib"))
8597 (substitute* "scripts/mk_util.py"
8598 (("LIBZ3 = LIBZ3")
8599 (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'"))
8600 ;; Do not build z3 again, use the library passed as input
8601 ;; instead
8602 (("z3linkdep,") "\"\",")
8603 (("z3linkdep)") "\"\")"))
8604 (invoke "python" "scripts/mk_make.py"))))
8605 (replace 'configure
8606 (lambda* (#:key inputs outputs #:allow-other-keys)
8607 (invoke "./configure"
8608 "--ml"
8609 (string-append "--prefix=" (assoc-ref outputs "out")))))
8610 (add-after 'configure 'change-directory
8611 (lambda _
8612 (chdir "build")
8613 #t))
8614 (replace 'build
8615 (lambda _
8616 (invoke "make" "ml")))
8617 (replace 'install
8618 (lambda* (#:key outputs #:allow-other-keys)
8619 (invoke "ocamlfind" "install" "-destdir"
8620 (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")
8621 "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi"
8622 "api/ml/z3enums.cmx" "api/ml/z3native.mli"
8623 "api/ml/z3native.cmi" "api/ml/z3native.cmx"
8624 "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx"
8625 "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma"
8626 "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so"))))))
8627 (native-inputs
8628 `(("which" ,which)
8629 ("python" ,python-wrapper)
8630 ("ocaml" ,ocaml)
8631 ("ocaml-findlib" ,ocaml-findlib)))
8632 (propagated-inputs
8633 (list ocaml-zarith))
8634 (inputs
8635 (list z3))))
8636
8637(define-public elpa
8638 (package
8639 (name "elpa")
8640 (version "2025.06.001")
8641 (source
8642 (origin
8643 (method git-fetch)
8644 (uri (git-reference
8645 (url "https://gitlab.mpcdf.mpg.de/elpa/elpa")
8646 (commit (string-append "new_release_" version))))
8647 (file-name (git-file-name name version))
8648 (sha256
8649 (base32 "1j2mqa8g76z6xmwji99320v6q98p823glvxjsdcdpaji59wgvdql"))))
8650 (build-system gnu-build-system)
8651 (arguments
8652 (list #:configure-flags
8653 #~`("--enable-openmp" "--with-mpi=no"
8654 ;; ELPA unfortunately does not support runtime dispatch, so we
8655 ;; can only enable the "generic" kernels. See the "Cross
8656 ;; compilation" section of INSTALL.md.
8657 "--enable-generic-kernels"
8658 "--disable-sse"
8659 "--disable-sse-assembly" ;Require SSE3
8660 "--disable-avx"
8661 "--disable-avx2"
8662 "--disable-avx512"
8663 #$(string-append "CFLAGS=-O3 -funsafe-loop-optimizations "
8664 "-funsafe-math-optimizations "
8665 "-ftree-vect-loop-version -ftree-vectorize "
8666 (let ((system (or (%current-target-system)
8667 (%current-system))))
8668 (cond
8669 ((or (string-prefix? "x86_64" system)
8670 (string-prefix? "i686" system))
8671 "-msse2")
8672 (else "")))))
8673 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
8674 #:phases
8675 #~(modify-phases %standard-phases
8676 (add-before 'bootstrap 'patch-shebangs-early
8677 (lambda _
8678 (patch-shebang "generate_automake_test_programs.py")))
8679 (add-before 'configure 'patch-header-generation
8680 (lambda _
8681 (substitute* "configure"
8682 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
8683 (string-append & " CPP=\"$CPP\""))) #t))
8684 (add-before 'check 'setup-tests
8685 (lambda _
8686 ;; Decrease test time and RAM use by computing fewer
8687 ;; eigenvalues. The flags are (MATRIX-SIZE, EIGENVALUES,
8688 ;; BLOCK-SIZE), where the default is (500, 250, 16) for C
8689 ;; tests and (5000, 150, 16) for Fortran. This also causes
8690 ;; several tests to pass that otherwise would otherwise
8691 ;; fail with matrix size 5000; possibly due to floating
8692 ;; point tolerances that are too tight.
8693 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
8694 (setenv "OMP_NUM_THREADS"
8695 (number->string (parallel-job-count)))
8696 (substitute* "Makefile"
8697 ;; Test scripts are generated, patch the shebang
8698 (("#!/bin/bash")
8699 (string-append "#!" (which "sh")))))))))
8700 (native-inputs
8701 (list autoconf-2.71
8702 automake
8703 libtool
8704 gfortran
8705 perl
8706 python))
8707 (inputs (list openblas))
8708 (home-page "https://elpa.mpcdf.mpg.de")
8709 (synopsis "Eigenvalue solvers for symmetric matrices")
8710 (description
8711 "The ELPA library provides efficient and scalable direct eigensolvers for
8712symmetric matrices.")
8713 (license license:lgpl3)
8714 (properties '((tunable? . #t)))))
8715
8716(define-public elpa-openmpi
8717 (package/inherit elpa
8718 (name "elpa-openmpi")
8719 (inputs
8720 (modify-inputs inputs
8721 (prepend openmpi scalapack zlib)))
8722 (arguments
8723 (substitute-keyword-arguments arguments
8724 ((#:configure-flags cf #~())
8725 #~(cons "--with-mpi=yes"
8726 (delete "--with-mpi=no" #$cf)))
8727 ((#:phases phases #~%standard-phases)
8728 #~(modify-phases #$phases
8729 (add-before 'check 'mpi-setup
8730 (lambda _
8731 ;; Tests use 2 mpi tasks by default, use our remaining build
8732 ;; cores as OpenMP threads.
8733 (setenv "OMP_NUM_THREADS"
8734 (number->string (max (quotient (parallel-job-count) 2)
8735 1)))
8736 (#$%openmpi-setup)))))))
8737 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
8738
8739(define-public elemental
8740 ;; The build of 0.87.7 is failed for a long time due to new version of GCC. The
8741 ;; latest commit has fixes.
8742 ;; See https://github.com/elemental/Elemental/issues/254
8743 (let ((commit "6eb15a0da2a4998bf1cf971ae231b78e06d989d9")
8744 (revision "0"))
8745 (package
8746 (name "elemental")
8747 (version (git-version "0.87.7" revision commit))
8748 (source (origin
8749 (method git-fetch)
8750 (uri (git-reference
8751 (url "https://github.com/elemental/Elemental")
8752 (commit commit)))
8753 (file-name (git-file-name name version))
8754 (sha256
8755 (base32
8756 "06xcs4ic60ndcf2hq19gr8yjwdsnphpcyhapab41rkw726z4lm7p"))))
8757 (build-system cmake-build-system)
8758 (arguments
8759 (list
8760 #:build-type "Release" ;default RelWithDebInfo not supported
8761 #:configure-flags
8762 #~(list "-DEL_DISABLE_PARMETIS:BOOL=YES"
8763 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
8764 "-DEL_CACHE_WARNINGS:BOOL=YES"
8765 "-DEL_TESTS:BOOL=YES"
8766 "-DCMAKE_INSTALL_LIBDIR=lib"
8767 "-DGFORTRAN_LIB=gfortran")
8768 #:phases
8769 #~(modify-phases %standard-phases
8770 (add-before 'check 'mpi-setup
8771 #$%openmpi-setup)
8772 (add-before 'check 'setup-tests
8773 (lambda _ ;; Parallelism is done at the MPI layer.
8774 (setenv "OMP_NUM_THREADS" "1")))
8775 (add-after 'install 'remove-tests
8776 (lambda _
8777 ;; Tests are installed, with no easy configuration
8778 ;; switch to prevent this, so delete them.
8779 (delete-file-recursively
8780 (string-append #$output "/bin/test")))))))
8781 (native-inputs
8782 (list gfortran))
8783 (inputs
8784 (list `(,gfortran "lib")
8785 gmp
8786 metis
8787 mpc
8788 mpfr
8789 openmpi
8790 qd
8791 openblas))
8792 (home-page "https://github.com/elemental/Elemental")
8793 (synopsis "Dense and sparse-direct linear algebra and optimization")
8794 (description "Elemental is a modern C++ library for distributed-memory
8795dense and sparse-direct linear algebra, conic optimization, and lattice
8796reduction.")
8797 (license license:bsd-2))))
8798
8799(define-public mcrl2
8800 (package
8801 (name "mcrl2")
8802 (version "202507.0")
8803 (source (origin
8804 (method url-fetch)
8805 (uri (string-append
8806 "https://www.mcrl2.org/download/release/mcrl2-"
8807 version ".tar.gz"))
8808 (sha256
8809 (base32
8810 "08w7v2dx1s164q3vc5lzf864nlxrf8s0kgsa26mmkgfqfqcwdgjj"))))
8811 (inputs
8812 (list boost glu mesa qtbase))
8813 (build-system cmake-build-system)
8814 (arguments (list #:tests? #f))
8815 (synopsis "Toolset for the mCRL2 formal specification language")
8816 (description
8817 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
8818specification language for describing concurrent discrete event systems. Its
8819toolset supports analysis and automatic verification, linearisation, simulation,
8820state-space exploration and generation, and tools to optimise and analyse
8821specifications. Also, state spaces can be manipulated, visualised and
8822analysed.")
8823 (home-page "https://mcrl2.org")
8824 (license license:boost1.0)))
8825
8826(define-public mcrl2-minimal
8827 (package
8828 (inherit mcrl2)
8829 (name "mcrl2-minimal")
8830 (inputs
8831 (list boost))
8832 (arguments
8833 (list #:tests? #f
8834 #:configure-flags #~(list "-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
8835
8836(define-public tcalc
8837 (package
8838 (name "tcalc")
8839 (version "2.0")
8840 (source
8841 (origin
8842 (method url-fetch)
8843 (uri (string-append
8844 "https://drive.usercontent.google.com/download"
8845 "?id=1gICzFCnJEQk10n5ioqOVrSjHd4R_u0Eq"))
8846 (file-name (string-append "tcalc-" version ".tar.gz"))
8847 (sha256
8848 (base32
8849 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
8850 (build-system gnu-build-system)
8851 (arguments
8852 (list
8853 #:configure-flags #~(list "CFLAGS=-fcommon")))
8854 (synopsis "The terminal calculator")
8855 (description
8856 "The terminal calculator is a small program to help users of the GNU/Linux
8857terminal do calculations simply and quickly. The formula to be calculated can
8858be fed to @command{tcalc} through the command line.")
8859 (home-page
8860 "https://sites.google.com/site/mohammedisam2000/tcalc-the-gnulinux-terminal-calculator")
8861 (license license:gpl3+)))
8862
8863(define-public tiny-bignum
8864 (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
8865 (package
8866 (name "tiny-bignum")
8867 (version (git-version "0" "0" commit))
8868 (source
8869 (origin
8870 (method git-fetch)
8871 (uri (git-reference
8872 (url "https://github.com/kokke/tiny-bignum-c")
8873 (commit commit)))
8874 (file-name (git-file-name "tiny-bignum" commit))
8875 (sha256
8876 (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
8877 (build-system gnu-build-system)
8878 (arguments
8879 `(#:phases
8880 (modify-phases %standard-phases
8881 (delete 'configure)
8882 (add-after 'unpack 'patch-tests
8883 (lambda _
8884 (substitute* "scripts/test_rand.py"
8885 (("\t") " ")
8886 (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol ")")))
8887 #t))
8888 (replace 'check
8889 (lambda* (#:key tests? #:allow-other-keys)
8890 (when tests?
8891 (invoke "make" "test"))
8892 #t))
8893 (replace 'install
8894 (lambda* (#:key outputs #:allow-other-keys)
8895 (let ((share (string-append (assoc-ref outputs "out") "/share"))
8896 (doc (string-append (assoc-ref outputs "out") "/doc")))
8897 (mkdir-p share)
8898 (install-file "bn.c" share)
8899 (install-file "bn.h" share)
8900 (mkdir-p doc)
8901 (install-file "LICENSE" doc)
8902 (install-file "README.md" doc))
8903 #t)))))
8904 (native-inputs
8905 `(("python" ,python-wrapper)))
8906 (home-page "https://github.com/kokke/tiny-bignum-c")
8907 (synopsis "Small portable multiple-precision unsigned integer arithmetic in C")
8908 (description
8909 "This library provides portable Arbitrary-precision unsigned integer
8910arithmetic in C, for calculating with large numbers. Basic arithmetic (+, -,
8911*, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
8912and comparisons are supported.")
8913 (license license:unlicense))))
8914
8915(define-public sundials
8916 (package
8917 (name "sundials")
8918 (version "7.1.1")
8919 (source
8920 (origin
8921 (method url-fetch)
8922 (uri (string-append "https://github.com/LLNL/sundials/releases/download/v"
8923 version "/sundials-" version ".tar.gz"))
8924 (sha256
8925 (base32
8926 "1fwlgbcdxz30dzsqw3y1b6ic1rhzfadghj7cq7yxsj14npgnwzga"))))
8927 (build-system cmake-build-system)
8928 (native-inputs
8929 (list pkg-config python-minimal-wrapper))
8930 (inputs
8931 (list openblas suitesparse))
8932 (arguments
8933 (list #:configure-flags
8934 #~(list "-DCMAKE_C_FLAGS=-O2 -g -fcommon"
8935
8936 "-DSUNDIALS_INDEX_SIZE=32"
8937 ;; Incompatible with 32-bit indices.
8938 ;;"-DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON"
8939
8940 "-DEXAMPLES_ENABLE_C:BOOL=ON"
8941 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
8942 ;; Requires -DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=ON.
8943 ;;"-DEXAMPLES_ENABLE_F2003:BOOL=ON"
8944 "-DEXAMPLES_INSTALL:BOOL=OFF"
8945
8946 "-DENABLE_KLU:BOOL=ON"
8947 (string-append "-DKLU_INCLUDE_DIR="
8948 (dirname
8949 (search-input-file %build-inputs
8950 "include/klu.h")))
8951 (string-append "-DKLU_LIBRARY_DIR="
8952 (dirname
8953 (search-input-file %build-inputs
8954 "lib/libklu.so"))))))
8955 (home-page "https://computation.llnl.gov/projects/sundials")
8956 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
8957 (description "SUNDIALS is a family of software packages implemented with
8958the goal of providing robust time integrators and nonlinear solvers that can
8959easily be incorporated into existing simulation codes.")
8960 (properties
8961 '((release-monitoring-url
8962 . "https://computing.llnl.gov/projects/sundials/sundials-software")))
8963 (license license:bsd-3)))
8964
8965(define-public sundials-openmpi
8966 (package/inherit sundials
8967 (name "sundials-openmpi")
8968 (propagated-inputs
8969 (list openmpi
8970 ;; Support for the below requires MPI.
8971 hypre-openmpi
8972 petsc-openmpi))
8973 (arguments
8974 (substitute-keyword-arguments arguments
8975 ((#:configure-flags flags #~())
8976 #~(cons* "-DENABLE_MPI:BOOL=ON"
8977 "-DENABLE_HYPRE:BOOL=ON"
8978 (string-append "-DHYPRE_INCLUDE_DIR="
8979 (dirname
8980 (search-input-file %build-inputs
8981 "include/HYPRE.h")))
8982 (string-append "-DHYPRE_LIBRARY_DIR="
8983 (dirname
8984 (search-input-file %build-inputs
8985 "lib/libHYPRE.so")))
8986 "-DENABLE_PETSC:BOOL=ON"
8987 (string-append "-DPETSC_INCLUDE_DIRS="
8988 (dirname
8989 (search-input-file %build-inputs
8990 "include/petsc.h")))
8991 #$flags))
8992 ((#:phases phases #~%standard-phases)
8993 #~(modify-phases #$phases
8994 (add-before 'check 'mpi-setup
8995 #$%openmpi-setup)))))
8996 (synopsis "SUNDIALS with MPI support")))
8997
8998(define-public sundials-julia
8999 (package
9000 (inherit sundials)
9001 (name "sundials-julia")
9002 (version "5.2.0")
9003 (source
9004 (origin
9005 (method git-fetch)
9006 (uri (git-reference
9007 (url "https://github.com/LLNL/sundials")
9008 (commit (string-append "v" version))))
9009 (file-name (git-file-name name version))
9010 (sha256
9011 (base32
9012 "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv"))))
9013 (inputs
9014 (modify-inputs inputs
9015 (prepend gfortran openblas)))
9016 (arguments
9017 '(#:configure-flags `("-DCMAKE_C_FLAGS=-O2 -g -fcommon"
9018 "-DSUNDIALS_INDEX_SIZE=32"
9019 "-DKLU_ENABLE:BOOL=ON"
9020 ,(string-append "-DKLU_INCLUDE_DIR="
9021 (assoc-ref %build-inputs "suitesparse")
9022 "/include")
9023 ,(string-append "-DKLU_LIBRARY_DIR="
9024 (assoc-ref %build-inputs "suitesparse")
9025 "/lib")
9026 "-DLAPACK_ENABLE:BOOL=ON")))
9027 (synopsis "SUNDIALS with LAPACK support as required by julia-sundials-jll")))
9028
9029(define-public combinatorial-blas
9030 (package
9031 (name "combinatorial-blas")
9032 (version "1.6.2")
9033 (source
9034 (origin
9035 (method url-fetch)
9036 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
9037 "CombBLAS_beta_"
9038 (match (string-split version #\.)
9039 ((major minor patch)
9040 (string-append major minor "_" patch))) ;e.g. "16_2"
9041 ".tgz"))
9042 (sha256
9043 (base32
9044 "0gzxgd2ybnh49h57rh47vrqnsyk11jn206j5kf9y7p5vksc79ffz"))
9045 (patches (search-patches "combinatorial-blas-awpm.patch"
9046 "combinatorial-blas-io-fix.patch"))))
9047 (build-system cmake-build-system)
9048 (inputs
9049 `(("mpi" ,openmpi)
9050 ("test-data" ,(origin
9051 (method url-fetch)
9052 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
9053 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
9054 (sha256
9055 (base32
9056 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
9057 (arguments
9058 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
9059 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
9060 #:parallel-tests? #f ;tests use 'mpiexec -n4'
9061 #:phases
9062 (modify-phases %standard-phases
9063 (add-after 'unpack 'fix-tests
9064 (lambda _
9065 ;; Skip failing tests (SIGFPE and SIGSEGV).
9066 (substitute* "ReleaseTests/CMakeLists.txt"
9067 (("^.*SpAsgnTest.*$") "")
9068 (("^.*IndexingTest.*$") ""))))
9069 (add-before 'check 'mpi-setup
9070 ,%openmpi-setup)
9071 (add-before 'check 'test-setup
9072 (lambda* (#:key inputs #:allow-other-keys)
9073 (setenv "OMP_NUM_THREADS" "2")
9074 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
9075 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
9076 (synopsis "Linear algebra primitives for graph analytics")
9077 (description "The Combinatorial BLAS (CombBLAS) is an extensible
9078distributed-memory parallel graph library offering a small but powerful set of
9079linear algebra primitives specifically targeting graph analytics.")
9080 (license (list
9081 license:gpl2+ ;include/psort/(funnel|sort)*.h
9082 license:x11 ;usort and psort
9083 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
9084
9085(define-public dune-common
9086 (package
9087 (name "dune-common")
9088 (version "2.10.0")
9089 (source
9090 (origin
9091 (method url-fetch)
9092 (uri (string-append "https://dune-project.org/download/"
9093 version "/dune-common-" version ".tar.gz"))
9094 (sha256
9095 (base32
9096 "1pdgxlxb570fm7smk1zv9b3iq1wzjg6g0s4361xs2w5qrf6drh4l"))
9097 (patches (search-patches "dune-common-skip-failing-tests.patch"))))
9098 (build-system cmake-build-system)
9099 (arguments
9100 `(#:phases
9101 (modify-phases %standard-phases
9102 (add-after 'build 'build-tests
9103 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9104 (apply invoke "make" "build_tests"
9105 `(,@(if parallel-build?
9106 `("-j" ,(number->string (parallel-job-count)))
9107 '())
9108 ,@make-flags)))))))
9109 (inputs
9110 (list gmp metis openblas python superlu))
9111 (native-inputs
9112 (list gfortran pkg-config))
9113 (home-page "https://dune-project.org/")
9114 (synopsis "Distributed and Unified Numerics Environment")
9115 (description "DUNE, the Distributed and Unified Numerics Environment is a
9116modular toolbox for solving @dfn{partial differential equations} (PDEs) with
9117grid-based methods. It supports the easy implementation of methods like
9118@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
9119Differences} (FD).")
9120 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
9121 (license license:gpl2)))
9122
9123(define-public dune-geometry
9124 (package
9125 (name "dune-geometry")
9126 (version "2.10.0")
9127 (source
9128 (origin
9129 (method url-fetch)
9130 (uri (string-append "https://dune-project.org/download/"
9131 version "/dune-geometry-" version ".tar.gz"))
9132 (sha256
9133 (base32
9134 "00vkidb931zvpq3nmw8ikyg8pr3jqisfq2qxwj9hqzj7634qms98"))))
9135 (build-system cmake-build-system)
9136 (arguments
9137 `(#:phases
9138 (modify-phases %standard-phases
9139 (add-after 'build 'build-tests
9140 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9141 (apply invoke "make" "build_tests"
9142 `(,@(if parallel-build?
9143 `("-j" ,(number->string (parallel-job-count)))
9144 '())
9145 ,@make-flags)))))))
9146 (inputs
9147 (list dune-common
9148 ;; Optional
9149 openblas gmp python))
9150 (native-inputs
9151 (list gfortran pkg-config))
9152 (home-page "https://dune-project.org/")
9153 (synopsis "Distributed and Unified Numerics Environment")
9154 (description "DUNE, the Distributed and Unified Numerics Environment is a
9155modular toolbox for solving @dfn{partial differential equations} (PDEs) with
9156grid-based methods. It supports the easy implementation of methods like
9157@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
9158Differences} (FD).
9159
9160This package contains the basic DUNE geometry classes.")
9161 ;; GPL version 2 with "runtime exception"
9162 (license license:gpl2)))
9163
9164(define-public dune-uggrid
9165 (package
9166 (name "dune-uggrid")
9167 (version "2.10.0")
9168 (source
9169 (origin
9170 (method url-fetch)
9171 (uri (string-append "https://dune-project.org/download/"
9172 version "/dune-uggrid-" version ".tar.gz"))
9173 (sha256
9174 (base32
9175 "1wm1jy8ssfzpskhk7z34ahmw0q0iyna0dgph8kskv6j2i8v7skip"))))
9176 (build-system cmake-build-system)
9177 (arguments
9178 `(#:phases
9179 (modify-phases %standard-phases
9180 (add-after 'build 'build-tests
9181 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9182 (apply invoke "make" "build_tests"
9183 `(,@(if parallel-build?
9184 `("-j" ,(number->string (parallel-job-count)))
9185 '())
9186 ,@make-flags)))))))
9187 (inputs
9188 (list dune-common))
9189 (native-inputs
9190 (list gfortran pkg-config))
9191 (home-page "https://dune-project.org/")
9192 (synopsis "Distributed and Unified Numerics Environment")
9193 (description "DUNE, the Distributed and Unified Numerics Environment is a
9194modular toolbox for solving @dfn{partial differential equations} (PDEs) with
9195grid-based methods. It supports the easy implementation of methods like
9196@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
9197Differences} (FD).
9198
9199This package contains the DUNE UG grid classes.")
9200 (license license:lgpl2.1)))
9201
9202(define-public dune-grid
9203 (package
9204 (name "dune-grid")
9205 (version "2.10.0")
9206 (source
9207 (origin
9208 (method url-fetch)
9209 (uri (string-append "https://dune-project.org/download/"
9210 version "/dune-grid-" version ".tar.gz"))
9211 (sha256
9212 (base32
9213 "0mh06g3sryx3s0d7zgzsz6j18vbzb0f46wq7aw6ahj2hswb7rsrg"))))
9214 (build-system cmake-build-system)
9215 (arguments
9216 `(#:phases
9217 (modify-phases %standard-phases
9218 (add-after 'build 'build-tests
9219 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9220 (apply invoke "make" "build_tests"
9221 `(,@(if parallel-build?
9222 `("-j" ,(number->string (parallel-job-count)))
9223 '())
9224 ,@make-flags)))))))
9225 (inputs
9226 (list dune-common
9227 dune-geometry
9228 gmp
9229 metis
9230 openblas
9231 python))
9232 (propagated-inputs
9233 (list dune-uggrid))
9234 (native-inputs
9235 (list gfortran pkg-config))
9236 (home-page "https://dune-project.org/")
9237 (synopsis "Distributed and Unified Numerics Environment")
9238 (description "DUNE, the Distributed and Unified Numerics Environment is a
9239modular toolbox for solving @dfn{partial differential equations} (PDEs) with
9240grid-based methods. It supports the easy implementation of methods like
9241@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
9242Differences} (FD).
9243
9244This package contains the basic DUNE grid classes.")
9245 ;; GPL version 2 with "runtime exception"
9246 (license license:gpl2)))
9247
9248(define-public dune-istl
9249 (package
9250 (name "dune-istl")
9251 (version "2.10.0")
9252 (source
9253 (origin
9254 (method url-fetch)
9255 (uri (string-append "https://dune-project.org/download/"
9256 version "/dune-istl-" version ".tar.gz"))
9257 (sha256
9258 (base32
9259 "0rk95rkj87gpb3gn40jl532rybs2lxkhn7g6b30m9kbzz7yfjfbc"))))
9260 (build-system cmake-build-system)
9261 (arguments
9262 `(#:phases
9263 (modify-phases %standard-phases
9264 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
9265 ;; the stdlib types when the gfortran header is used. Remove gfortran
9266 ;; from CPLUS_INCLUDE_PATH as a workaround.
9267 (add-after 'set-paths 'hide-gfortran
9268 (lambda* (#:key inputs #:allow-other-keys)
9269 (let ((gfortran (assoc-ref inputs "gfortran")))
9270 (setenv "CPLUS_INCLUDE_PATH"
9271 (string-join
9272 (delete (string-append gfortran "/include/c++")
9273 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
9274 ":"))
9275 #t)))
9276 (add-after 'build 'build-tests
9277 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9278 (apply invoke "make" "build_tests"
9279 `(,@(if parallel-build?
9280 `("-j" ,(number->string (parallel-job-count)))
9281 '())
9282 ,@make-flags)))))))
9283 (inputs
9284 (list dune-common
9285 ;; Optional
9286 metis
9287 suitesparse
9288 superlu
9289 openblas
9290 gmp
9291 python))
9292 (native-inputs
9293 (list gfortran pkg-config))
9294 (home-page "https://dune-project.org/")
9295 (synopsis "Distributed and Unified Numerics Environment")
9296 (description "DUNE, the Distributed and Unified Numerics Environment is a
9297modular toolbox for solving @dfn{partial differential equations} (PDEs) with
9298grid-based methods.
9299
9300This is the iterative solver template library which provides generic sparse
9301matrix/vector classes and a variety of solvers based on these classes. A
9302special feature is the use of templates to exploit the recursive block
9303structure of finite element matrices at compile time. Available solvers
9304include Krylov methods, (block-) incomplete decompositions and
9305aggregation-based algebraic multigrid.")
9306 ;; GPL version 2 with "runtime exception"
9307 (license license:gpl2)))
9308
9309(define-public dune-localfunctions
9310 (package
9311 (name "dune-localfunctions")
9312 (version "2.10.0")
9313 (source
9314 (origin
9315 (method url-fetch)
9316 (uri (string-append "https://dune-project.org/download/"
9317 version "/dune-localfunctions-" version ".tar.gz"))
9318 (sha256
9319 (base32
9320 "0a5hyd7fps18178dq41nxa21h0i9ah6sw7di8qkc4i1rh052rzc1"))))
9321 (build-system cmake-build-system)
9322 (arguments
9323 `(#:phases
9324 (modify-phases %standard-phases
9325 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
9326 ;; and fails to find the stdlib types when the gfortran header is used.
9327 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
9328 (add-after 'set-paths 'hide-gfortran
9329 (lambda* (#:key inputs #:allow-other-keys)
9330 (let ((gfortran (assoc-ref inputs "gfortran")))
9331 (setenv "CPLUS_INCLUDE_PATH"
9332 (string-join
9333 (delete (string-append gfortran "/include/c++")
9334 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
9335 ":"))
9336 #t)))
9337 (add-after 'build 'build-tests
9338 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9339 (apply invoke "make" "build_tests"
9340 `(,@(if parallel-build?
9341 `("-j" ,(number->string (parallel-job-count)))
9342 '())
9343 ,@make-flags)))))))
9344 (inputs
9345 (list dune-common
9346 dune-geometry
9347 ;; Optional
9348 metis
9349 superlu
9350 gmp))
9351 (native-inputs
9352 (list gfortran pkg-config))
9353 (home-page "https://dune-project.org/")
9354 (synopsis "Distributed and Unified Numerics Environment") ; TODO
9355 (description "This DUNE module provides interface and implementation for
9356shape functions defined on the DUNE reference elements. In addition to the
9357shape function, interpolation operators and special keys are provided which
9358can be used to assemble global function spaces on finite-element grids.
9359
9360This package provides an interface and implementation for shape functions
9361defined on the DUNE reference elements. In addition to the shape function,
9362interpolation operators and special keys are provided which can be used to
9363assemble global function spaces on finite-element grids.")
9364 ;; GPL version 2 with "runtime exception"
9365 (license license:gpl2)))
9366
9367(define-public dune-alugrid
9368 (package
9369 (name "dune-alugrid")
9370 (version "2.10.0")
9371 (source
9372 (origin
9373 (method git-fetch)
9374 (uri (git-reference
9375 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
9376 (commit (string-append "v" version))))
9377 (file-name (git-file-name name version))
9378 (sha256
9379 (base32
9380 "0289vqf9azhgqda04qa5prn201xnsd9i0r8gy6jn0g6wfy9bcpav"))))
9381 (build-system cmake-build-system)
9382 (arguments
9383 `(#:phases
9384 (modify-phases %standard-phases
9385 (add-after 'unpack 'patch-include
9386 (lambda _
9387 (substitute* "dune/alugrid/test/test-alugrid.cc"
9388 (("doc/grids/gridfactory/testgrids")
9389 "doc/dune-grid/grids/gridfactory/testgrids"))
9390 #t))
9391 (add-after 'build 'build-tests
9392 (lambda* (#:key inputs make-flags parallel-build? #:allow-other-keys)
9393 (setenv "CPLUS_INCLUDE_PATH"
9394 (string-append (assoc-ref inputs "dune-grid") "/share"))
9395 (apply invoke "make" "build_tests"
9396 `(,@(if parallel-build?
9397 `("-j" ,(number->string (parallel-job-count)))
9398 '())
9399 ,@make-flags)))))))
9400 (inputs
9401 (list dune-common
9402 dune-geometry
9403 dune-grid
9404 ;; Optional
9405 metis
9406 openblas
9407 python
9408 superlu
9409 gmp
9410 zlib))
9411 (native-inputs
9412 (list gfortran pkg-config))
9413 (home-page "https://dune-project.org/")
9414 (synopsis "Distributed and Unified Numerics Environment")
9415 (description "ALUGrid is an adaptive, loadbalancing, unstructured
9416implementation of the DUNE grid interface supporting either simplices or
9417cubes.")
9418 (license license:gpl2+)))
9419
9420(define-public dune-subgrid
9421 ; dune-subgrid does not tag its releases.
9422 ; The following commit is the last commit on the releases/2.10 branch
9423 ; as of 2024-11-14.
9424 (let ((commit "e71cc9c2514356c7cd989f0c13661f10c37c58df"))
9425 (package
9426 (name "dune-subgrid")
9427 (version (git-version "2.10.0" "1" commit))
9428 (source
9429 (origin
9430 (method git-fetch)
9431 (uri (git-reference
9432 (url "https://gitlab.dune-project.org/extensions/dune-subgrid")
9433 (commit commit)))
9434 (file-name (git-file-name name version))
9435 (sha256
9436 (base32
9437 "1vahmj2r9r684n8rgnqqb8zhi3wibkxjsv1kql804azx71dslx0d"))))
9438 (build-system cmake-build-system)
9439 (arguments
9440 `(#:phases
9441 (modify-phases %standard-phases
9442 (add-after 'build 'build-tests
9443 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9444 (apply invoke "make" "build_tests"
9445 `(,@(if parallel-build?
9446 `("-j" ,(number->string (parallel-job-count)))
9447 '())
9448 ,@make-flags)))))))
9449 (inputs
9450 (list dune-common
9451 dune-geometry
9452 dune-grid
9453 ;; Optional
9454 metis
9455 openblas
9456 gmp))
9457 (native-inputs
9458 (list gfortran pkg-config))
9459 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
9460 (synopsis "Distributed and Unified Numerics Environment")
9461 (description "The dune-subgrid module marks elements of
9462another hierarchical dune grid. The set of marked elements can then be
9463accessed as a hierarchical dune grid in its own right. Dune-Subgrid
9464provides the full grid interface including adaptive mesh refinement.")
9465 (license license:gpl2+))))
9466
9467(define-public dune-typetree
9468 (package
9469 (name "dune-typetree")
9470 (version "2.10.0")
9471 (source
9472 (origin
9473 (method url-fetch)
9474 (uri (string-append "https://dune-project.org/download/"
9475 version "/dune-typetree-" version ".tar.gz"))
9476 (sha256
9477 (base32
9478 "0k756c543r79jz51jfnvi6knnxv7y19xg69yb15b0hrv4gq015pf"))))
9479 (build-system cmake-build-system)
9480 (arguments
9481 `(#:phases
9482 (modify-phases %standard-phases
9483 (add-after 'build 'build-tests
9484 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9485 (apply invoke "make" "build_tests"
9486 `(,@(if parallel-build?
9487 `("-j" ,(number->string (parallel-job-count)))
9488 '())
9489 ,@make-flags)))))))
9490 (inputs
9491 (list dune-common
9492 ;; Optional
9493 openblas
9494 python
9495 metis
9496 superlu
9497 gmp))
9498 (native-inputs
9499 (list gfortran pkg-config))
9500 (home-page "https://dune-project.org/")
9501 (synopsis "Distributed and Unified Numerics Environment")
9502 (description "TypeTree is a template library for constructing and
9503operating on statically typed trees of objects.")
9504 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
9505 (license (list license:lgpl3+ license:gpl2))))
9506
9507(define-public dune-functions
9508 (package
9509 (name "dune-functions")
9510 (version "2.10.0")
9511 (source
9512 (origin
9513 (method url-fetch)
9514 (uri (string-append "https://dune-project.org/download/"
9515 version "/dune-functions-" version ".tar.gz"))
9516 (sha256
9517 (base32
9518 "1v2yyiqacspa7fkz5pbhd9hcz8rk5bhyhlhwvr3jjgmniiy0x2hp"))))
9519 (build-system cmake-build-system)
9520 (arguments
9521 `(#:phases
9522 (modify-phases %standard-phases
9523 (add-after 'unpack 'disable-failing-tests
9524 (lambda _
9525 (setenv "ARGS"
9526 ;; unable to load GMSH file in this test
9527 "--exclude-regex gridviewfunctionspacebasistest")
9528 #t))
9529 (add-after 'build 'build-tests
9530 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
9531 (apply invoke "make" "build_tests"
9532 `(,@(if parallel-build?
9533 `("-j" ,(number->string (parallel-job-count)))
9534 '())
9535 ,@make-flags)))))))
9536 (inputs
9537 (list dune-common
9538 dune-istl
9539 dune-localfunctions
9540 dune-grid
9541 dune-geometry
9542 dune-typetree
9543 openblas
9544 metis
9545 python
9546 superlu
9547 gmp))
9548 (native-inputs
9549 (list gfortran pkg-config))
9550 (home-page "https://dune-project.org/")
9551 (synopsis "Distributed and Unified Numerics Environment")
9552 (description "The dune-functions module provides an abstraction layer for
9553global finite element functions. Its two main concepts are functions
9554implemented as callable objects, and bases of finite element spaces.")
9555 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
9556 (license (list license:lgpl3+ license:gpl2))))
9557
9558(define-public dune-pdelab
9559 ;; This was the last commit on the releases/2.8 branch as of 2023-04-12,
9560 ;; unfortunately there was no tag for any 2.8 release.
9561 (let ((commit "d5dddb6b1c21b95e867ff53cca159ad676689f5c"))
9562 (package
9563 (name "dune-pdelab")
9564 (version (git-version "2.8.0" "0" commit))
9565 (source
9566 (origin
9567 (method git-fetch)
9568 (uri (git-reference
9569 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
9570 (commit commit)))
9571 (file-name (git-file-name name version))
9572 (sha256
9573 (base32
9574 "0l2idjp59a6x46vdd30xhhsnv7chql0z7msdsyra2h6pqm6xiqxk"))))
9575 (build-system cmake-build-system)
9576 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
9577 (inputs
9578 (list dune-common
9579 dune-istl
9580 dune-localfunctions
9581 dune-geometry
9582 dune-grid
9583 dune-typetree
9584 dune-functions
9585 ;; Optional
9586 openblas
9587 eigen
9588 metis
9589 python
9590 superlu
9591 gmp))
9592 (native-inputs
9593 (list gfortran pkg-config))
9594 (home-page "https://dune-project.org/")
9595 (synopsis "Differential equations solver toolbox")
9596 (description "PDELab is a partial differential equations solver toolbox
9597built on top of DUNE, the Distributed and Unified Numerics Environment.")
9598 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
9599 (license (list license:lgpl3+ license:gpl2)))))
9600
9601(define add-openmpi-to-dune-package
9602 (let ((dune-package?
9603 (lambda (p) (string-prefix? "dune-" (package-name p)))))
9604 (package-mapping
9605 (lambda (p)
9606 (if (dune-package? p)
9607 (package (inherit p)
9608 (name (string-append (package-name p) "-openmpi"))
9609 (inputs (modify-inputs inputs
9610 (append openmpi)))
9611 (arguments
9612 (substitute-keyword-arguments arguments
9613 ((#:phases phases '%standard-phases)
9614 `(modify-phases ,phases
9615 (add-before 'check 'mpi-setup
9616 ,%openmpi-setup)))))
9617 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
9618 p))
9619 (negate dune-package?))))
9620
9621(define-public dune-common-openmpi
9622 (add-openmpi-to-dune-package dune-common))
9623
9624(define-public dune-geometry-openmpi
9625 (add-openmpi-to-dune-package dune-geometry))
9626
9627(define-public dune-istl-openmpi
9628 (add-openmpi-to-dune-package dune-istl))
9629
9630(define-public dune-typetree-openmpi
9631 (add-openmpi-to-dune-package dune-typetree))
9632
9633(define-public dune-uggrid-openmpi
9634 (add-openmpi-to-dune-package dune-uggrid))
9635
9636(define-public dune-grid-openmpi
9637 (add-openmpi-to-dune-package dune-grid))
9638
9639(define-public dune-alugrid-openmpi
9640 (add-openmpi-to-dune-package dune-alugrid))
9641
9642(define-public dune-subgrid-openmpi
9643 (add-openmpi-to-dune-package dune-subgrid))
9644
9645(define-public dune-localfunctions-openmpi
9646 (add-openmpi-to-dune-package dune-localfunctions))
9647
9648(define-public dune-functions-openmpi
9649 (add-openmpi-to-dune-package dune-functions))
9650
9651(define-public dune-pdelab-openmpi
9652 (add-openmpi-to-dune-package dune-pdelab))
9653
9654(define-public nauty
9655 (package
9656 (name "nauty")
9657 (version "2.9.3")
9658 (source
9659 (origin
9660 (method url-fetch)
9661 (uri (string-append
9662 "https://pallini.di.uniroma1.it/"
9663 "nauty" (string-join (string-split version #\.) "_") ".tar.gz"))
9664 (sha256
9665 (base32 "0nqvri1jfi95xswrcvn9dkyriy7pkjry6nwqhdc0z2pq0jpfvi4z"))))
9666 (build-system gnu-build-system)
9667 (outputs '("out" "lib"))
9668 (arguments
9669 (list
9670 #:test-target "checks"
9671 #:configure-flags #~(list "--enable-generic") ;prevent -march-native
9672 #:phases
9673 #~(modify-phases %standard-phases
9674 (add-after 'unpack 'normalize-pkgconfig-files-location
9675 (lambda _
9676 (substitute* "makefile.in"
9677 (("^(pkgconfigexecdir=).*" _ prefix)
9678 (string-append prefix "${libdir}/pkgconfig\n"))))))))
9679 (inputs (list gmp)) ;for sumlines
9680 (home-page "https://pallini.di.uniroma1.it/")
9681 (synopsis "Library for graph automorphisms")
9682 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
9683procedures for computing automorphism groups of graphs and digraphs.
9684
9685@code{nauty} computes graph information in the form of a set of
9686generators, the size of the group, and the orbits of the group; it can
9687also produce a canonical label. The @code{nauty} suite is written in
9688C and comes with a command-line interface, a collection of
9689command-line tools, and an Application Programming Interface (API).
9690
9691This package provides the static libraries required to run programs
9692compiled against the nauty library.")
9693 (license license:asl2.0)))
9694
9695(define-public nodesoup
9696 (package
9697 (name "nodesoup")
9698 ;; Package has no release, using the latest commit.
9699 (properties '((commit . "3158ad082bb0cd1abee75418b12b35522dbca74f")
9700 (revision . "0")))
9701 (version (git-version "0.1.0" ;CMakeLists.txt shows this version.
9702 (assoc-ref properties 'revision)
9703 (assoc-ref properties 'commit)))
9704 (source
9705 (origin
9706 (method git-fetch)
9707 (uri (git-reference
9708 (url "https://github.com/olvb/nodesoup")
9709 (commit (assoc-ref properties 'commit))))
9710 (file-name (git-file-name name version))
9711 (sha256
9712 (base32 "0ahx04jh4743v84ckn670yc1qz62nqf7bb75fappnlxp03lyllml"))))
9713 (build-system cmake-build-system)
9714 (arguments
9715 (list #:tests? #f ;No tests provided by package.
9716 #:configure-flags
9717 #~(list "-DBUILD_DEMO=OFF"
9718 "-DBUILD_SHARED_LIBS=ON")))
9719 (native-inputs (list pkg-config))
9720 (inputs (list cairo))
9721 (home-page "https://github.com/olvb/nodesoup")
9722 (synopsis "C++ implementation of Fruchterman-Reingold and Kamada Kawai algorithms")
9723 (description "This library implements the Fruchterman-Reingold force-directed
9724graph layout algorithm. It applies repulsion between all vertex pairs (to avoid overlap)
9725and attraction between connected vertices (to pull them together). Forces decay with
9726distance, and a global temperature limits maximum displacement per iteration, causing the
9727layout to sta0bilize gradually.")
9728 (license license:unlicense)))
9729
9730(define-public speedcrunch
9731 (package
9732 (name "speedcrunch")
9733 (version "0.12.0")
9734 (source
9735 (origin
9736 (method git-fetch)
9737 (uri (git-reference
9738 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
9739 (commit (string-append "release-" version))))
9740 (file-name (git-file-name name version))
9741 (sha256
9742 (base32
9743 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
9744 (build-system qt-build-system)
9745 (inputs (list qtbase-5 qtwayland-5))
9746 (native-inputs (list qttools-5))
9747 (arguments
9748 `(#:phases
9749 (modify-phases %standard-phases
9750 (add-after 'unpack 'chdir-to-src
9751 (lambda _ (chdir "src") #t)))))
9752 (synopsis "High-precision scientific calculator")
9753 (description
9754 "SpeedCrunch is a high-precision scientific calculator. It features a
9755syntax-highlighted scrollable display and is designed to be fully used via
9756keyboard. Some distinctive features are auto-completion of functions and
9757variables, a formula book, and quick insertion of constants from various
9758fields of knowledge.")
9759 (home-page "https://speedcrunch.org/")
9760 (license license:gpl2+)))
9761
9762(define-public minisat
9763 ;; This is the last commit which is available upstream, no
9764 ;; release happened since 2010.
9765 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
9766 (revision "1"))
9767 (package
9768 (name "minisat")
9769 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
9770 (source
9771 (origin
9772 (method git-fetch)
9773 (uri (git-reference
9774 (url "https://github.com/niklasso/minisat")
9775 (commit commit)))
9776 (file-name (string-append name "-" version "-checkout"))
9777 (sha256
9778 (base32
9779 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
9780 (patches
9781 (search-patches "minisat-friend-declaration.patch"
9782 "minisat-install.patch"))))
9783 (build-system gnu-build-system)
9784 (arguments
9785 '(#:make-flags (list (string-append "prefix=" %output))
9786 #:tests? #f ;no check target
9787 #:phases
9788 (modify-phases %standard-phases
9789 (delete 'configure))))
9790 (inputs
9791 `(("zlib:static" ,zlib "static")
9792 ("zlib" ,zlib)))
9793 (synopsis
9794 "Small, yet efficient, SAT solver")
9795 (description
9796 "MiniSat is a minimalistic, open-source SAT solver, developed to help
9797researchers and developers alike to get started on SAT.")
9798 (home-page
9799 "http://minisat.se/MiniSat.html")
9800 (license license:expat))))
9801
9802(define-public kissat
9803 (package
9804 (name "kissat")
9805 (version "4.0.4")
9806 (source
9807 (origin
9808 (method git-fetch)
9809 (uri (git-reference
9810 (url "https://github.com/arminbiere/kissat")
9811 (commit (string-append "rel-" version))))
9812 (file-name (git-file-name name version))
9813 (sha256
9814 (base32
9815 "1snimig4cp97p570nin2i38my72zvwypldyhr125i1z6cd9pa046"))))
9816 (build-system gnu-build-system)
9817 (inputs (list xz gzip lzip bzip2 p7zip))
9818 (native-inputs (list drat-trim))
9819 (arguments
9820 (list
9821 #:test-target "test"
9822 #:configure-flags #~(list "-shared")
9823 #:phases
9824 #~(modify-phases %standard-phases
9825 (add-after 'unpack 'patch-source
9826 (lambda* (#:key inputs #:allow-other-keys)
9827 (substitute* "test/testfile.c"
9828 ;; Don't check if /etc/passwd isn't writable.
9829 ;; When building in a container/chroot, this fails spuriously.
9830 ((".*/etc/passwd.*") ""))
9831 (substitute* "scripts/generate-build-header.sh"
9832 ;; by default BUILD includes the build date which
9833 ;; makes the build not reproducible.
9834 (("^BUILD=.*$")
9835 "BUILD=guix\n"))
9836 (substitute* "src/file.c"
9837 (("(bzip2|gzip|lzma|xz) -c" all cmd)
9838 (string-append (search-input-file inputs
9839 (string-append "bin/" cmd))
9840 " -c"))
9841 (("7z ([ax])" all mode)
9842 (string-append (search-input-file inputs "bin/7z")
9843 " " mode))
9844 ;; Since we hard-coded the paths, we no longer need to find
9845 ;; them.
9846 (("bool found = kissat_find_executable \\(name\\);")
9847 "bool found = true;"))
9848 (substitute* "test/testmain.c"
9849 ;; SIGINT is ignored inside invoke.
9850 (("^[ \t]*SIGNAL[ \t]*\\(SIGINT\\)") ""))))
9851 (replace 'configure
9852 (lambda* (#:key configure-flags #:allow-other-keys)
9853 ;; The configure script does not support standard GNU options.
9854 (apply invoke "./configure" configure-flags)))
9855 (replace 'install
9856 (lambda* (#:key inputs outputs #:allow-other-keys)
9857 (let ((out (assoc-ref outputs "out")))
9858 (install-file "build/kissat" (string-append out "/bin"))
9859 (install-file "build/libkissat.so" (string-append out "/lib"))
9860 (install-file "src/kissat.h"
9861 (string-append out "/include"))))))))
9862 (home-page "https://github.com/arminbiere/kissat")
9863 (synopsis "Bare-metal SAT solver")
9864 (description
9865 "Kissat is a bare-metal SAT-solver written in C. It is a port of CaDiCaL
9866back to C with improved data structures, better scheduling of inprocessing and
9867optimized algorithms and implementation.")
9868 (license license:expat)))
9869
9870(define-public aiger
9871 (package
9872 (name "aiger")
9873 (version "1.9.20")
9874 (source (origin
9875 (method git-fetch)
9876 (uri (git-reference
9877 (url "https://github.com/arminbiere/aiger")
9878 (commit (string-append "rel-" version))))
9879 (file-name (git-file-name name version))
9880 (sha256
9881 (base32
9882 "1bjm3362l6qskmfi0gyz2h30cr157xkv8yjivmm9iwl37chk22c2"))))
9883 (outputs (list "out" "static"))
9884 (build-system gnu-build-system)
9885 (arguments
9886 (list #:make-flags #~(list (string-append "CFLAGS=-g -O2"))
9887 #:phases
9888 #~(modify-phases %standard-phases
9889 (add-after 'unpack 'patch-source
9890 (lambda* (#:key inputs #:allow-other-keys)
9891 (substitute* "aiger.c"
9892 (("\"(gzip|xz)" all cmd)
9893 (string-append
9894 "\""
9895 (search-input-file inputs (string-append "bin/" cmd)))))))
9896 (add-after 'unpack 'patch-build-files
9897 (lambda _
9898 (substitute* "makefile.in"
9899 (("test -d .*") "true")
9900 (("/usr/local") #$output))))
9901 (replace 'configure
9902 (lambda* (#:key configure-flags #:allow-other-keys)
9903 (apply invoke "./configure.sh" configure-flags)))
9904 (add-after 'install 'install-static
9905 (lambda _
9906 (apply invoke #$(ar-for-target) "rcs" "libaiger.a"
9907 (find-files "." "\\.o$"))
9908 (let* ((lib (string-append #$output:static "/lib"))
9909 (incl (string-append #$output:static "/include/aiger")))
9910 (mkdir-p lib)
9911 (mkdir-p incl)
9912 (install-file "libaiger.a" lib)
9913 (for-each (lambda (f) (install-file f incl))
9914 (find-files "." "\\.h$")))))
9915 (replace 'check
9916 (lambda* (#:key tests? #:allow-other-keys)
9917 (when tests?
9918 (setenv "CC" #$(cc-for-target))
9919 (invoke "make" "-f" "test.mk")))))))
9920 (inputs (list gzip xz))
9921 (home-page "https://fmv.jku.at/aiger")
9922 (synopsis "Utilities for And-Inverter Graphs")
9923 (description "AIGER is a format, library and set of utilities for
9924@acronym{AIG, And-Inverter Graphs}s. The focus is on conversion utilities and a
9925generic reader and writer API.")
9926 (license (list license:expat
9927 license:bsd-3)))) ; bliftoaig
9928
9929(define-public cudd
9930 (package
9931 (name "cudd")
9932 (version "3.0.0")
9933 (source (origin
9934 (method git-fetch)
9935 (uri (git-reference
9936 (url "https://github.com/cuddorg/cudd")
9937 (commit (string-append "cudd-" version))))
9938 (file-name (git-file-name name version))
9939 (sha256
9940 (base32
9941 "0hyw9q42ir92vcaa7bwv6f631n85rfsxp463rnmklniq1wf6dyn9"))))
9942 (build-system gnu-build-system)
9943 (arguments (list #:configure-flags #~(list "--enable-shared")))
9944 (native-inputs
9945 (list gcc-13)) ;XXX: 1 test fails with gcc@14.
9946 ;; The original home-page was lost to time, so we reference the "unofficial"
9947 ;; Github mirror. For what it's worth, the author of the library appears to
9948 ;; have been involved with this mirror at some point in time.
9949 (home-page "https://github.com/cuddorg/cudd")
9950 (synopsis "Manipulate decision diagrams")
9951 (description "@acronym{CUDD, Colorado University Decision Diagrams} is a
9952library for manipulating decision diagrams. It supports binary decision
9953diagrams, algebraic decision diagrams, and zero-suppressed binary decision
9954diagrams.")
9955 (license license:bsd-3)))
9956
9957(define-public libpoly
9958 (package
9959 (name "libpoly")
9960 (version "0.2.1")
9961 (source (origin
9962 (method git-fetch)
9963 (uri (git-reference
9964 (url "https://github.com/SRI-CSL/libpoly")
9965 (commit (string-append "v" version))))
9966 (file-name (git-file-name name version))
9967 (sha256
9968 (base32
9969 "1nyiddvxzziagz7zrl2in8k1mypaj8z7vmm633h9mk4iiy586ddq"))))
9970 (build-system cmake-build-system)
9971 (inputs (list gmp))
9972 (native-inputs
9973 (list python-minimal-wrapper))
9974 (home-page "https://github.com/SRI-CSL/libpoly")
9975 (synopsis "Manipulate polynomials")
9976 (description "LibPoly is a C library for manipulating polynomials to support
9977symbolic reasoning engines that need to reason about polynomial constraints.")
9978 (license license:lgpl3+)))
9979
9980(define-public libtaylor
9981 ;; Project proves no release or tagged versions, use the latest commit.
9982 (let ((commit "88709f03efda5b81ff460ccef67d4fd0e7d050cc")
9983 (revision "0"))
9984 (package
9985 (name "libtaylor")
9986 (version (git-version "0" revision commit))
9987 (source
9988 (origin
9989 (method git-fetch)
9990 (uri (git-reference
9991 (url "https://github.com/uekstrom/libtaylor")
9992 (commit commit)))
9993 (file-name (git-file-name name commit))
9994 (sha256
9995 (base32 "17gp97vqlpmigf1rf1f5s8lavcswfvpyvqnxxjpdrz5dw9f51y6f"))))
9996 (build-system cmake-build-system)
9997 (arguments
9998 '(#:phases
9999 (modify-phases %standard-phases
10000 (delete 'check)
10001 (add-after 'install 'check
10002 (lambda* (#:key tests? #:allow-other-keys #:rest args)
10003 (when tests?
10004 (apply (assoc-ref %standard-phases 'check) args)))))))
10005 (home-page "https://github.com/uekstrom/libtaylor")
10006 (synopsis "C++ library for automatic differentiation")
10007 (description
10008 "This is a header-only C++ library for calculating analytical
10009derivatives and taylor expansions of composite functions.")
10010 (license license:expat))))
10011
10012(define-public lingeling
10013 (package
10014 (name "lingeling")
10015 (version "1.0.0")
10016 (source (origin
10017 (method git-fetch)
10018 (uri (git-reference
10019 (url "https://github.com/arminbiere/lingeling")
10020 (commit (string-append "rel-" version))))
10021 (file-name (git-file-name name version))
10022 (sha256
10023 (base32
10024 "0hszkhyni7jcw580f41rrrnwz42x56sqvd8zpcjdagvdiag76lc1"))))
10025 (build-system gnu-build-system)
10026 (arguments
10027 (list #:test-target "test"
10028 #:modules `((ice-9 match)
10029 ,@%default-gnu-modules)
10030 #:configure-flags #~(list "--aiger=.")
10031 #:phases
10032 #~(modify-phases %standard-phases
10033 (add-after 'unpack 'unpack-aiger
10034 (lambda* (#:key inputs #:allow-other-keys)
10035 (invoke #$(ar-for-target) "x"
10036 (search-input-file inputs "lib/libaiger.a")
10037 "aiger.o")
10038 (copy-file
10039 (search-input-file inputs "include/aiger/aiger.h")
10040 "aiger.h")))
10041 (add-after 'unpack 'hard-code-commit
10042 (lambda _
10043 (substitute* "mkconfig.sh"
10044 (("`\\./getgitid`") ""))))
10045 (add-after 'unpack 'patch-source
10046 (lambda* (#:key inputs #:allow-other-keys)
10047 (substitute* (list "treengeling.c" "lgldimacs.c")
10048 (("\"(gunzip|xz|bzcat|7z)" all cmd)
10049 (string-append
10050 "\""
10051 (search-input-file inputs (string-append "bin/" cmd)))))))
10052 (replace 'configure
10053 (lambda* (#:key configure-flags #:allow-other-keys)
10054 (apply invoke "./configure.sh" configure-flags)))
10055 (replace 'install
10056 (lambda* (#:key outputs #:allow-other-keys)
10057 (let ((bin (string-append (assoc-ref outputs "out")
10058 "/bin")))
10059 (mkdir-p bin)
10060 (for-each
10061 (lambda (file)
10062 (install-file file bin))
10063 '("blimc" "ilingeling" "lglddtrace" "lglmbt"
10064 "lgluntrace" "lingeling" "plingeling"
10065 "treengeling")))))
10066 (add-after 'install 'wrap-path
10067 (lambda* (#:key outputs #:allow-other-keys)
10068 (with-directory-excursion (string-append
10069 (assoc-ref outputs "out")
10070 "/bin")
10071 (for-each
10072 (lambda (file)
10073 (wrap-program
10074 file
10075 '("PATH" suffix
10076 #$(map (lambda (input)
10077 (file-append (this-package-input input) "/bin"))
10078 '("gzip" "bzip2" "xz" "p7zip")))))
10079 ;; These programs use sprintf on buffers with magic
10080 ;; values to construct commands (yes, eww), so we
10081 ;; can't easily substitute* them.
10082 '("lglddtrace" "lgluntrace" "lingeling" "plingeling"))))))))
10083 (inputs (list `(,aiger "static") bash-minimal gzip bzip2 xz p7zip))
10084 (home-page "http://fmv.jku.at/lingeling")
10085 (synopsis "SAT solver")
10086 (description "This package provides a range of SAT solvers, including
10087the sequential @command{lingeling} and its parallel variants
10088@command{plingeling} and @command{treengeling}. A bounded model checker is
10089also included.")
10090 (license license:expat)))
10091
10092(define-public cadical
10093 (package
10094 (name "cadical")
10095 (version "2.2.1")
10096 (source (origin
10097 (method git-fetch)
10098 (uri (git-reference
10099 (url "https://github.com/arminbiere/cadical")
10100 (commit (string-append "rel-" version))))
10101 (file-name (git-file-name name version))
10102 (sha256
10103 (base32 "09p4nm8jyvhnsgpmbawzlk8b932k33s922a2rxm77sy8s31mm13m"))))
10104 (build-system gnu-build-system)
10105 (arguments
10106 (list #:test-target "test"
10107 #:configure-flags #~(list "-shared")
10108 #:modules `(((guix build copy-build-system) #:prefix copy:)
10109 (guix build gnu-build-system)
10110 (guix build utils)
10111 (ice-9 regex))
10112 #:imported-modules %copy-build-system-modules
10113 #:phases
10114 #~(modify-phases %standard-phases
10115 ;; By default, cadical defines the DATE macro to have a $(date)
10116 ;; value. This makes the build not reproducible. If the macro
10117 ;; is not defined it uses __DATE__ and __TIME__, which we patch
10118 ;; to return a fixed date. Thus, achieving a reproducible build.
10119 ;;
10120 ;; An upstream patch for respecting SOURCE_DATE_EPOCH is pending.
10121 ;; See also <https://github.com/arminbiere/cadical/pull/164>.
10122 (add-after 'unpack 'no-build-date
10123 (lambda _
10124 (substitute* "scripts/make-build-header.sh"
10125 (("\\[ x\"\\$DATE\" = x\" \" \\]") "true"))))
10126 (replace 'configure
10127 (lambda* (#:key configure-flags #:allow-other-keys)
10128 (apply invoke "./configure" configure-flags)))
10129 (replace 'install
10130 (lambda args
10131 (apply
10132 (assoc-ref copy:%standard-phases 'install)
10133 #:install-plan
10134 `(("build" "bin" #:include ("cadical" "mobical"))
10135 ("build" "lib" #:include-regexp ("libcadical\\.(a|so)$"))
10136 ("src" "include" #:include ("cadical.h" "cadical.hpp"))
10137 ;; Internal headers used by cadiback.
10138 ("src" "include/cadical" #:include-regexp ("\\.hpp$")))
10139 args))))))
10140 (home-page "https://github.com/arminbiere/cadical")
10141 (synopsis "SAT solver")
10142 (description "This package provides a SAT solver based on conflict-driven
10143clause learning.")
10144 (license license:expat)))
10145
10146(define-public cadical-2.1
10147 (package
10148 (inherit cadical)
10149 (name "cadical")
10150 (version "2.1.3")
10151 (source (origin
10152 (method git-fetch)
10153 (uri (git-reference
10154 (url "https://github.com/arminbiere/cadical")
10155 (commit (string-append "rel-" version))))
10156 (file-name (git-file-name name version))
10157 (patches (search-patches "cadical-add-shared-library.patch"))
10158 (sha256 (base32
10159 "1gl0xd6zyxb127w8k0mps9m2izaqb7im7j91by4lkknmm7xhwyav"))))
10160 (arguments (substitute-keyword-arguments (package-arguments cadical)
10161 ((#:configure-flags _)
10162 #~(list))
10163 ((#:phases phases)
10164 #~(modify-phases #$phases
10165 (add-before 'configure 'set-shared-flags
10166 (lambda _
10167 (setenv "CXXFLAGS" "-DPIC -fPIC")))
10168 (replace 'check
10169 (lambda args
10170 ;; Tests are incorrectly linked upstream.
10171 ;; Since we don't install them, just work around this in the
10172 ;; check phase.
10173 (setenv "LD_LIBRARY_PATH"
10174 (string-append (getcwd) "/build"))
10175 (apply (assoc-ref %standard-phases
10176 'check) args)
10177 (unsetenv "LD_LIBRARY_PATH")))))))))
10178
10179(define-public cadiback
10180 (let ((commit "789329d8fcda851085ed72f1b07d8c3f46243b8a")
10181 (revision "1"))
10182 (package
10183 (name "cadiback")
10184 ;; Note: version taken from VERSION file
10185 (version (git-version "0.2.1" revision commit))
10186 (source (origin
10187 (method git-fetch)
10188 (uri (git-reference
10189 (url "https://github.com/arminbiere/cadiback")
10190 (commit commit)))
10191 (file-name (git-file-name name version))
10192 (sha256
10193 (base32 "137jxf9g7c1979pcgcqgfff1mqk5hs41a84780px8gpcrh469cks"))))
10194 (build-system gnu-build-system)
10195 (arguments
10196 (list #:test-target "test"
10197 #:modules `(((guix build copy-build-system) #:prefix copy:)
10198 (guix build gnu-build-system)
10199 (guix build utils)
10200 (ice-9 regex))
10201 #:imported-modules %copy-build-system-modules
10202 #:phases
10203 #~(modify-phases %standard-phases
10204 (add-after 'unpack 'patch-build-files
10205 (lambda* (#:key inputs #:allow-other-keys)
10206 (substitute* "configure"
10207 (("\\$CADICAL/src") "$CADICAL/include/cadical")
10208 (("\\$CADICAL/build") "$CADICAL/lib"))
10209 (substitute* "generate"
10210 (("\\[ -d .git \\]" all) (string-append ": " all))
10211 (("GITID=.*") (string-append "GITID=\"" #$commit "\"")))
10212 (substitute* "makefile.in"
10213 (("\\.\\./cadical/build")
10214 (dirname
10215 (search-input-file inputs "lib/libcadical.a")))
10216 (("\\.\\./cadical/src")
10217 (search-input-directory inputs "include/cadical")))))
10218 (replace 'configure
10219 (lambda* (#:key configure-flags #:allow-other-keys)
10220 (setenv "CADICAL" #$(this-package-input "cadical"))
10221 (apply invoke "./configure" configure-flags)))
10222 (replace 'install
10223 (lambda args
10224 (apply
10225 (assoc-ref copy:%standard-phases 'install)
10226 #:install-plan
10227 `(("." "bin" #:include ("cadiback")))
10228 args))))))
10229 (inputs (list cadical))
10230 (home-page "https://github.com/arminbiere/cadiback")
10231 (synopsis "Backbone extractor for cadical")
10232 (description "This package provides a tool to determine the backbone of
10233a satisfiable formula. The backbone is the set of literals that are set to
10234true in all models.")
10235 (license license:expat))))
10236
10237(define cadiback-for-cryptominisat
10238 (let ((commit "ea65a9442fc2604ee5f4ffd0f0fdd0bf481d5b42")
10239 (revision "1"))
10240 (package
10241 (inherit cadiback)
10242 (name "cadiback-for-cryptominisat")
10243 (version (git-version "0.2.1" revision commit))
10244 (source (origin
10245 (method git-fetch)
10246 (uri (git-reference
10247 (url "https://github.com/meelgroup/cadiback")
10248 (commit commit)))
10249 (file-name (git-file-name name version))
10250 (sha256
10251 (base32 "1zznrlj4zp1mc7s4pfw11aq773q2lr9yl6pph630zg5mqijaim5g"))))
10252 (arguments
10253 (substitute-keyword-arguments arguments
10254 ((#:phases phases)
10255 #~(modify-phases #$phases
10256 (add-after 'patch-build-files 'fix-prefix
10257 (lambda _
10258 (substitute* "makefile.in"
10259 (("/usr") #$output))))
10260 (replace 'install
10261 (lambda args
10262 (mkdir-p (string-append #$output "/include"))
10263 (mkdir-p (string-append #$output "/lib"))
10264 (apply (assoc-ref %standard-phases 'install) args))))))))))
10265
10266(define-public louvain-community
10267 (let ((commit "681a711a530ded0b25af72ee4881d453a80ac8ac")
10268 (revision "2"))
10269 (package
10270 (name "louvain-community")
10271 (version (git-version "1.0.0" revision commit))
10272 (source (origin
10273 (method git-fetch)
10274 (uri (git-reference
10275 (url "https://github.com/meelgroup/louvain-community")
10276 (commit commit)))
10277 (file-name (git-file-name name version))
10278 (sha256
10279 (base32
10280 "1ria6s5p7iw86mq1arbrhlbadll1k79j9y5c1bdg76zdwjfs17cs"))))
10281 (build-system cmake-build-system)
10282 (arguments
10283 (list #:tests? #f ; tests appear to require missing files
10284 #:phases
10285 #~(modify-phases %standard-phases
10286 (add-after 'unpack 'encode-git-hash
10287 (lambda _
10288 (substitute* "CMakeLists.txt"
10289 (("GIT-hash-notfound") #$commit))))
10290 (add-after 'unpack 'no-tune-native
10291 (lambda _
10292 (substitute* "CMakeLists.txt"
10293 (("-mtune=native") ""))))
10294 ;; Refer to the library in ${LOUVAIN_COMMUNITIES_LIBRARIES} by
10295 ;; full path. This ensures that we find references to it in
10296 ;; software using this library via CMake.
10297 ;;
10298 ;; CMake expects module to set this variable to a full path.
10299 ;; See <https://cmake.org/cmake/help/v4.3/module/SelectLibraryConfigurations.html#command:select_library_configurations>.
10300 (add-after 'unpack 'cmake-lib-full-path
10301 (lambda* (#:key outputs #:allow-other-keys)
10302 (substitute* "louvain_communitiesConfig.cmake.in"
10303 (("louvain_communities")
10304 (string-append
10305 (assoc-ref outputs "out")
10306 "/lib/liblouvain_communities.so"))))))))
10307 (native-inputs (list python))
10308 (home-page "https://github.com/meelgroup/louvain-community")
10309 (synopsis "Multi-criteria community detection")
10310 (description "This package provides a C++ implementation of the Louvain
10311community detection algorithm.")
10312 (properties '((tunable? . #t)))
10313 (license license:lgpl3+))))
10314
10315(define-public cryptominisat
10316 (package
10317 (name "cryptominisat")
10318 (version "5.11.22")
10319 (source
10320 (origin
10321 (method git-fetch)
10322 (uri (git-reference
10323 (url "https://github.com/msoos/cryptominisat")
10324 (commit version)))
10325 (file-name (git-file-name name version))
10326 (sha256
10327 (base32
10328 "1c85gfqvy90yhh9jwmiiz2bz4i86prgpfyx1gbzl42hn2ixkcjgm"))
10329 (modules '((guix build utils)))
10330 (snippet
10331 #~(begin
10332 (substitute* "src/backbone.cpp"
10333 (("\"\\.\\./cadiback/cadiback\\.h\"") "<cadiback.h>"))))))
10334 (build-system cmake-build-system)
10335 (arguments
10336 (list
10337 #:build-type "Release"
10338 #:configure-flags #~(list "-DENABLE_TESTING=ON" "-DSTATS=ON")
10339 #:phases
10340 #~(modify-phases %standard-phases
10341 (add-after 'unpack 'patch-source
10342 (lambda* (#:key inputs #:allow-other-keys)
10343 (substitute* "CMakeLists.txt"
10344 (("add_subdirectory\\(utils/lingeling-ala\\)") ""))
10345 ;; Transitively included in vendored gtest.h. Fixed in
10346 ;; upstream:
10347 ;; https://github.com/msoos/cryptominisat/pull/686
10348 (substitute* "tests/assump_test.cpp"
10349 (("#include <vector>")
10350 "#include <vector>\n#include <algorithm>"))
10351 (substitute* "tests/CMakeLists.txt"
10352 (("add_subdirectory\\(\\$\\{GTEST_PREFIX\\} gtest\\)")
10353 "find_package(GTest REQUIRED)")
10354 (("add_subdirectory\\(\\$\\{PROJECT_SOURCE_DIR\\}/utils/.*\\)")
10355 "")))))))
10356 (inputs (list boost
10357 cadical
10358 cadiback-for-cryptominisat
10359 gmp
10360 louvain-community
10361 python
10362 python-numpy
10363 sqlite
10364 zlib))
10365 (native-inputs (list googletest lingeling python python-wrapper python-lit))
10366 (synopsis "Incremental SAT solver")
10367 (description
10368 "CryptoMiniSat is an incremental SAT solver with both command line and
10369library (C++, C, Python) interfaces. The command-line interface takes a
10370@acronym{CNF, Conjunctive Normal Form} as an input in the DIMACS format with
10371the extension of XOR clauses. The library interfaces mimic this and also
10372allow incremental solving, including assumptions.")
10373 (home-page "https://github.com/msoos/cryptominisat")
10374 (license license:expat)))
10375
10376(define-public libqalculate
10377 (package
10378 (name "libqalculate")
10379 (version "5.11.0")
10380 (source
10381 (origin
10382 (method git-fetch)
10383 (uri (git-reference
10384 (url "https://github.com/Qalculate/libqalculate/")
10385 (commit (string-append "v" version))))
10386 (file-name (git-file-name name version))
10387 (sha256
10388 (base32 "0kmjgssrwm9djn8pb44vyajzrzxsmxzkjrdz2hvbslfql9ykc04p"))))
10389 (build-system gnu-build-system)
10390 (native-inputs
10391 (list autoconf
10392 automake
10393 doxygen
10394 gettext-minimal
10395 libtool
10396 pkg-config))
10397 (inputs
10398 (list gmp
10399 mpfr
10400 libxml2
10401 curl
10402 icu4c
10403 gnuplot
10404 libiconv
10405 readline))
10406 (home-page "https://qalculate.github.io/")
10407 (synopsis "Multi-purpose calculator CLI and library")
10408 (description
10409 "Qalculate! is a multi-purpose calculator; this package contains its
10410command line interface @code{qalc} and library @code{libqalculate}. Features
10411include:
10412@itemize
10413@item arbitrary precision and interval arithmetic
10414@item currency conversion
10415@item physical constants
10416@item plotting via gnuplot
10417@item symbolic calculations (including integrals and equations)
10418@item uncertainty propagation
10419@item unit calculations and conversions
10420@item user-defined functions
10421@end itemize")
10422 (license license:gpl2+)))
10423
10424(define-public qalculate-gtk
10425 (package
10426 (name "qalculate-gtk")
10427 (version "5.11.0")
10428 (source
10429 (origin
10430 (method git-fetch)
10431 (uri (git-reference
10432 (url "https://github.com/Qalculate/qalculate-gtk/")
10433 (commit (string-append "v" version))))
10434 (file-name (git-file-name name version))
10435 (sha256
10436 (base32 "03ppnhkzbvr8xzl2b6lsxd3i0lrhvch3blzp5g54pr6k9yjdnl0i"))))
10437 (build-system glib-or-gtk-build-system)
10438 (native-inputs
10439 (list pkg-config
10440 intltool
10441 automake
10442 autoconf
10443 libtool
10444 file))
10445 (inputs
10446 (list gmp
10447 mpfr
10448 libqalculate
10449 libxml2
10450 glib
10451 gtk+))
10452 (home-page "https://qalculate.github.io/")
10453 (synopsis "Qalculate! desktop calculator (GTK interface)")
10454 (description "@code{qalculate-gtk} is the GTK frontend for the Qalculate!
10455multi-purpose calculator.")
10456 (license license:gpl2+)))
10457
10458(define-public qalculate-qt
10459 (package
10460 (name "qalculate-qt")
10461 (version "5.11.0")
10462 (source
10463 (origin
10464 (method git-fetch)
10465 (uri (git-reference
10466 (url "https://github.com/Qalculate/qalculate-qt")
10467 (commit (string-append "v" version))))
10468 (file-name (git-file-name name version))
10469 (sha256
10470 (base32 "1gy344widrbmvfk9v8yx349afiqqyfmm12cajhf99v74kw1xivz6"))))
10471 (build-system gnu-build-system)
10472 (arguments
10473 (list #:tests? #f ; There are no tests.
10474 #:imported-modules
10475 `(,@%default-gnu-imported-modules ,@%qt-build-system-modules)
10476 #:phases
10477 #~(modify-phases %standard-phases
10478 (replace 'configure
10479 (lambda* (#:key inputs #:allow-other-keys)
10480 (substitute* "qalculate-qt.pro"
10481 (("/usr/local") #$output)
10482 (("\\$\\$LRELEASE")
10483 (string-append
10484 (search-input-file inputs "bin/lrelease"))))
10485 (invoke "qmake")))
10486 (add-after 'install 'qt-wrap
10487 (lambda args
10488 (apply (assoc-ref
10489 (@ (guix build qt-build-system) %standard-phases)
10490 'qt-wrap)
10491 #:qtbase #$(this-package-input "qtbase") args))))))
10492 (native-inputs (list pkg-config qttools))
10493 (inputs (list gmp
10494 libqalculate
10495 mpfr
10496 qtbase))
10497 (home-page "https://qalculate.github.io")
10498 (synopsis "Qalculate! desktop calculator (Qt interface)")
10499 (description "@code{qalculate-qt} is the Qt frontend for the Qalculate!
10500multi-purpose calculator.")
10501 (license license:gpl2+)))
10502
10503(define-public numdiff
10504 (package
10505 (name "numdiff")
10506 (version "5.9.0")
10507 (source
10508 (origin
10509 (method url-fetch)
10510 (uri (string-append "mirror://savannah/numdiff/numdiff-"
10511 version ".tar.gz"))
10512 (sha256
10513 (base32
10514 "1vzmjh8mhwwysn4x4m2vif7q2k8i19x8azq7pzmkwwj4g48lla47"))))
10515 (build-system gnu-build-system)
10516 (arguments
10517 '(#:tests? #f ; There are no tests.
10518 #:phases
10519 (modify-phases %standard-phases
10520 (add-before 'compress-documentation 'delete-precompressed-info-file
10521 (lambda _
10522 (delete-file (string-append (assoc-ref %outputs "out")
10523 "/share/info/numdiff.info.gz"))
10524 #t)))))
10525 (home-page "https://nongnu.org/numdiff/")
10526 (synopsis "Compare files with numeric fields")
10527 (description
10528 "Numdiff compares files line by line and field by field, ignoring small
10529numeric differences and differences in numeric formats.")
10530 (license license:gpl3+)))
10531
10532(define-public why3
10533 (package
10534 (name "why3")
10535 (version "1.7.2")
10536 (source (origin
10537 (method git-fetch)
10538 (uri (git-reference
10539 (url "https://gitlab.inria.fr/why3/why3")
10540 (commit version)))
10541 (file-name (git-file-name name version))
10542 (sha256
10543 (base32
10544 "0fq8wg8ji2v2ssz1d681glmk8glps1irnmdlhqfklaggx01hlf4p"))))
10545 (build-system ocaml-build-system)
10546 (arguments
10547 (list #:phases
10548 #~(modify-phases %standard-phases
10549 (add-before 'configure 'bootstrap
10550 (lambda _
10551 (invoke "./autogen.sh")
10552 (setenv "CONFIG_SHELL" (which "sh"))
10553 (substitute* "configure"
10554 (("#! /bin/sh") (string-append "#!" (which "sh")))
10555 ;; find ocaml-num in the correct directory
10556 (("\\$DIR/nums.cma") "$DIR/num.cma")
10557 (("\\$DIR/num.cmi") "$DIR/core/num.cmi"))))
10558 (add-after 'configure 'fix-makefile
10559 (lambda _
10560 (substitute* "Makefile"
10561 ;; find ocaml-num in the correct directory
10562 (("site-lib/num") "site-lib"))))
10563 (add-after 'install 'install-lib
10564 (lambda _
10565 (invoke "make" "byte")
10566 (invoke "make" "install-lib"))))))
10567 (native-inputs (list autoconf
10568 automake
10569 coq
10570 ocaml
10571 ocaml-findlib
10572 which))
10573 (propagated-inputs (list camlzip
10574 lablgtk3
10575 ocaml-graph
10576 ocaml-lablgtk3-sourceview3
10577 ocaml-menhir
10578 ocaml-ppx-deriving
10579 ocaml-ppx-sexp-conv
10580 ocaml-num
10581 ocaml-re
10582 ocaml-sexplib
10583 ocaml-zarith))
10584 (inputs (list coq-flocq
10585 emacs-minimal
10586 zlib))
10587 (home-page "https://why3.lri.fr")
10588 (synopsis "Deductive program verification")
10589 (description "Why3 provides a language for specification and programming,
10590called WhyML, and relies on external theorem provers, both automated and
10591interactive, to discharge verification conditions. Why3 comes with a standard
10592library of logical theories (integer and real arithmetic, Boolean operations,
10593sets and maps, etc.) and basic programming data structures (arrays, queues,
10594hash tables, etc.). A user can write WhyML programs directly and get
10595correct-by-construction OCaml programs through an automated extraction
10596mechanism. WhyML is also used as an intermediate language for the verification
10597of C, Java, or Ada programs.")
10598 (license license:lgpl2.1)))
10599
10600(define-public frama-c
10601 (package
10602 (name "frama-c")
10603 (version "29.0")
10604 (source (origin
10605 (method url-fetch)
10606 (uri (string-append "https://frama-c.com/download/frama-c-"
10607 version "-Copper.tar.gz"))
10608 (sha256
10609 (base32
10610 "14vlvynp3yfmnkixm676c1ip0jlkiqjzmrp9f9c990zzs2wb7yyj"))))
10611 (build-system dune-build-system)
10612 (arguments
10613 (list #:phases
10614 #~(modify-phases %standard-phases
10615 (add-before 'build 'set-env
10616 (lambda _
10617 (setenv "CC" "gcc")))
10618 (add-after 'install 'wrap-programs
10619 (lambda _
10620 (let ((ocamlpath
10621 `(,(string-append #$output "/lib/ocaml/site-lib")
10622 ,@(search-path-as-string->list
10623 (getenv "OCAMLPATH")))))
10624 (for-each
10625 (lambda (program)
10626 (wrap-program (string-append #$output "/bin/" program)
10627 `("OCAMLPATH" ":" prefix ,ocamlpath)))
10628 '("frama-c" "frama-c-gui"))))))))
10629 (inputs
10630 (list bash-minimal gmp zlib))
10631 (propagated-inputs (list
10632 graphviz
10633 lablgtk3
10634 ocaml-graph
10635 ocaml-odoc
10636 ocaml-lablgtk3-sourceview3
10637 ocaml-yaml
10638 ocaml-yojson
10639 ocaml-zarith
10640 ocaml-ppx-deriving
10641 ocaml-ppx-deriving-yojson
10642 ocaml-ppx-deriving-yaml
10643 ocaml-ppx-import
10644 ocaml-unionfind
10645 why3))
10646 (native-inputs (list dune-site time ocaml-menhir ocaml-graph))
10647 (native-search-paths
10648 (list (search-path-specification
10649 (variable "FRAMAC_SHARE")
10650 (files '("share/frama-c"))
10651 (separator #f))
10652 (search-path-specification
10653 (variable "FRAMAC_LIB")
10654 (files '("lib/frama-c"))
10655 (separator #f))))
10656 (home-page "https://frama-c.com")
10657 (synopsis "C source code analysis platform")
10658 (description "Frama-C is an extensible and collaborative platform dedicated
10659to source-code analysis of C software. The Frama-C analyzers assist you in
10660various source-code-related activities, from the navigation through unfamiliar
10661projects up to the certification of critical software.")
10662 (license license:lgpl2.1+)))
10663
10664(define-public blitz
10665 (package
10666 (name "blitz")
10667 (version "1.0.2")
10668 (source
10669 (origin
10670 (method git-fetch)
10671 (uri (git-reference
10672 (url "https://github.com/blitzpp/blitz")
10673 (commit version)))
10674 (file-name (git-file-name name version))
10675 (sha256
10676 (base32 "0c88gc72j3zggyk4yrrip6i0v7xkx97l140vpy3xhxs2i7xy1461"))))
10677 (build-system cmake-build-system)
10678 (arguments
10679 (list
10680 #:configure-flags #~(list "-DBUILD_DOC=ON")
10681 #:modules '((guix build cmake-build-system)
10682 ((guix build gnu-build-system) #:prefix gnu:)
10683 (guix build utils))
10684 #:phases
10685 #~(modify-phases %standard-phases
10686 (add-after 'build 'build-doc
10687 (lambda _
10688 (invoke "make" "-j" (number->string (parallel-job-count))
10689 "blitz-doc")))
10690 (replace 'check
10691 (lambda* (#:rest args)
10692 (apply (assoc-ref gnu:%standard-phases 'check)
10693 ;; The default "check" target also includes examples and
10694 ;; benchmarks.
10695 #:test-target "check-testsuite" args))))))
10696 (native-inputs
10697 (list python texinfo))
10698 (synopsis "C++ template class library for multidimensional arrays")
10699 (description "Blitz++ is a C++ template class library that provides
10700high-performance multidimensional array containers for scientific computing.")
10701 (home-page "https://github.com/blitzpp/blitz")
10702 (license (list license:artistic2.0
10703 license:bsd-3
10704 license:lgpl3+))))
10705
10706(define-public fxdiv
10707 ;; There is currently no tag in this repo.
10708 (let ((commit "63058eff77e11aa15bf531df5dd34395ec3017c8")
10709 (version "0.0")
10710 (revision "1"))
10711 (package
10712 (name "fxdiv")
10713 (version (git-version version revision commit))
10714 (home-page "https://github.com/Maratyszcza/FXdiv")
10715 (source (origin
10716 (method git-fetch)
10717 (uri (git-reference (url home-page) (commit commit)))
10718 (file-name (git-file-name name version))
10719 (sha256
10720 (base32
10721 "0zwzh8gmbx4m6b18s5nf13b0dk5yjkd1fs8f421bl7fz5f9gjd9f"))
10722 (patches (search-patches "fxdiv-system-libraries.patch"))))
10723 (build-system cmake-build-system)
10724 (inputs
10725 (list googletest-1.8 googlebenchmark))
10726 (synopsis
10727 "C++ library for division via fixed-point multiplication by inverse")
10728 (description
10729 "On modern CPUs and GPUs, integer division is several times slower than
10730multiplication. FXdiv implements an algorithm to replace an integer division
10731with a multiplication and two shifts. This algorithm improves performance
10732when an application performs repeated divisions by the same divisor.")
10733 (license license:expat))))
10734
10735(define-public fp16
10736 ;; There is currently no tag in this repo.
10737 (let ((commit "0a92994d729ff76a58f692d3028ca1b64b145d91")
10738 (version "0.0")
10739 (revision "1"))
10740 (package
10741 (name "fp16")
10742 (version (git-version version revision commit))
10743 (home-page "https://github.com/Maratyszcza/FP16")
10744 (source (origin
10745 (method git-fetch)
10746 (uri (git-reference (url home-page) (commit commit)))
10747 (file-name (git-file-name name version))
10748 (sha256
10749 (base32
10750 "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
10751 (patches (search-patches "fp16-implicit-double.patch"
10752 "fp16-system-libraries.patch"))))
10753 (build-system cmake-build-system)
10754 (arguments
10755 (list
10756 #:imported-modules
10757 (append %cmake-build-system-modules
10758 %pyproject-build-system-modules)
10759 #:modules
10760 `(((guix build pyproject-build-system) #:select (site-packages))
10761 (guix build cmake-build-system)
10762 (guix build utils))
10763 #:phases
10764 #~(modify-phases %standard-phases
10765 (add-after 'install 'move-python-files
10766 (lambda* (#:key inputs outputs #:allow-other-keys)
10767 ;; Python files get installed to $includedir (!).
10768 ;; Move them to the usual Python site directory.
10769 (let* ((include (string-append #$output "/include"))
10770 (site (site-packages inputs outputs))
10771 (target (string-append site "/fp16")))
10772 (mkdir-p target)
10773 (for-each (lambda (file)
10774 (rename-file file
10775 (string-append target "/"
10776 (basename file))))
10777 (find-files include "\\.py$"))))))))
10778 (native-inputs (list python-wrapper))
10779 (inputs (list psimd googletest-1.8 googlebenchmark))
10780 (synopsis "C++ library for half-precision floating point formats")
10781 (description
10782 "This header-only C++ library implements conversion to and from
10783half-precision floating point formats.")
10784 (license license:expat))))
10785
10786(define-public fparser
10787 (package
10788 (name "fparser")
10789 (version "4.5.1")
10790 (source
10791 (origin
10792 (method git-fetch)
10793 (uri (git-reference
10794 (url "https://github.com/thliebig/fparser")
10795 (commit "e625e262620036a52d1dc9abc122d2bf67397e40")))
10796 (file-name (git-file-name name version))
10797 (sha256
10798 (base32 "11gkdqcbk26bwrn5si6vmbd0gsni5kg56j32jhmp2j4h1jrww54k"))))
10799 (arguments
10800 (list
10801 #:tests? #f)) ;No tests
10802 (build-system cmake-build-system)
10803 (home-page "http://warp.povusers.org/FunctionParser/")
10804 (synopsis "Function parser library for C++")
10805 (description
10806 "FunctionParser is a C++ library for parsing and evaluating mathematical expressions.
10807This package is based on a maintained fork of
10808@url{http://warp.povusers.org/FunctionParser/, the original project}.")
10809 (license license:lgpl3)))
10810
10811(define-public soplex
10812 (package
10813 (name "soplex")
10814 (version "8.0.1")
10815 (source
10816 (origin
10817 (method git-fetch)
10818 (uri (git-reference
10819 (url "https://github.com/scipopt/soplex")
10820 (commit (string-append "v" version))))
10821 (file-name (git-file-name name version))
10822 (sha256
10823 (base32 "1j0xqm99pdvj6l52q4wk96aj0vnq3xgm2gdyli4g8gfb1g1m9p9l"))))
10824 (build-system cmake-build-system)
10825 (arguments
10826 (list
10827 #:configure-flags
10828 #~(list "-DPAPILO=OFF")))
10829 (inputs (list boost gmp mpfr zlib))
10830 (home-page "https://soplex.zib.de/")
10831 (synopsis "Sequential object-oriented simPlex linear programming solver")
10832 (description
10833 "SoPlex is an optimization package for solving linear
10834programming problems (LPs) based on an advanced implementation of the primal
10835and dual revised simplex algorithm. It provides special support for the exact
10836solution of LPs with rational input data. It can be used as a standalone
10837solver reading MPS or LP format files via a command line interface as well as
10838embedded into other programs via a C++ class library.")
10839 (license license:asl2.0)))
10840
10841(define-public scip
10842 (package
10843 (name "scip")
10844 (version "10.0.1")
10845 (source
10846 (origin
10847 (method git-fetch)
10848 (uri (git-reference
10849 (url "https://github.com/scipopt/scip")
10850 (commit (string-append "v" version))))
10851 (file-name (git-file-name name version))
10852 (sha256
10853 (base32 "01j0m7fzr8xcwpsd3zfqrbqw8rw2169rlp0qb6srdx5ablkcdcv1"))))
10854 (build-system cmake-build-system)
10855 (arguments
10856 (list
10857 #:build-type "Release"
10858 #:parallel-tests? #f
10859 #:configure-flags
10860 #~(list "-DPAPILO=OFF"
10861 "-DZIMPL=OFF"
10862 "-DAMPL=ON"
10863 "-DLAPACK=ON"
10864 "-DIPOPT=OFF"
10865 (string-append
10866 "-DSOPLEX_DIR=" #$(this-package-input "soplex")))))
10867 (inputs (list boost
10868 gmp
10869 lapack
10870 mpfr
10871 readline
10872 soplex
10873 zlib))
10874 (native-inputs (list perl python-minimal-wrapper))
10875 (home-page "https://www.scipopt.org/")
10876 (synopsis "Solving constraint integer programs")
10877 (description
10878 "SCIP is a solver for mixed integer programming (MIP) and mixed
10879integer nonlinear programming (MINLP). It is a framework for constraint
10880integer programming and branch-cut-and-price, allowing total control
10881of the solution process and access to detailed information down to the
10882internals of the solver.")
10883 (license license:asl2.0)))
10884
10885(define-public or-tools
10886 (package
10887 (name "or-tools")
10888 (version "9.15")
10889 (source
10890 (origin
10891 (method git-fetch)
10892 (uri (git-reference
10893 (url "https://github.com/google/or-tools")
10894 (commit (string-append "v" version))))
10895 (file-name (git-file-name name version))
10896 (sha256
10897 (base32 "0hb608s6c7aiyr8vaj0gi0jf45z39wvwvrgfq8x5dzgyzy06zszp"))))
10898 (build-system cmake-build-system)
10899 (arguments
10900 (list
10901 #:tests? #f ;TODO: requires protobuf-matchers
10902 #:configure-flags
10903 #~(list "-DBUILD_CXX=ON"
10904 "-DBUILD_DEPS=OFF"
10905 "-DBUILD_DOTNET=OFF"
10906 "-DBUILD_EXAMPLES=OFF"
10907 "-DBUILD_JAVA=OFF"
10908 "-DBUILD_PYTHON=OFF"
10909 "-DBUILD_SAMPLES=OFF"
10910 "-DBUILD_SHARED_LIBS=ON"
10911 "-DUSE_COINOR=OFF"
10912 "-DUSE_CPLEX=OFF"
10913 "-DUSE_GLPK=ON"
10914 "-DUSE_HIGHS=OFF"
10915 "-DUSE_SCIP=ON"
10916 (string-append "-DSCIP_DIR=" #$(this-package-input "scip")))))
10917 (native-inputs
10918 (list benchmark
10919 googletest
10920 pkg-config
10921 python-minimal-wrapper))
10922 (inputs
10923 (list abseil-cpp
10924 eigen
10925 glpk
10926 gmp
10927 mpfr
10928 protobuf-6
10929 re2-next
10930 scip
10931 zlib))
10932 (home-page "https://developers.google.com/optimization")
10933 (synopsis "Software suite for combinatorial optimization")
10934 (description
10935 "OR-Tools is a C++ portable software suite, tuned for solving
10936combinatorial optimization problems in vehicle routing, flows, integer, linear
10937and constraint programming.")
10938 (license license:asl2.0)))
10939
10940(define-public scilab
10941 (package
10942 (name "scilab")
10943 (version "2025.1.0")
10944 (source
10945 (origin
10946 (method git-fetch)
10947 (uri (git-reference
10948 (url "https://gitlab.com/scilab/scilab")
10949 (commit version)))
10950 (file-name (git-file-name name version))
10951 (sha256
10952 (base32
10953 "1db23hla27lfrf1qvk3p4465qqizxb1a6qkjh4k6rzdxgvxdbxng"))
10954 (patches (search-patches "scilab-better-compiler-detection.patch"
10955 "scilab-tbx_build_help.patch"))
10956 (modules '((guix build utils)
10957 (ice-9 ftw)))
10958 (snippet
10959 #~(begin
10960 ;; Delete everything except for scilab itself:
10961 (for-each (lambda (file)
10962 (unless (member file '("." ".." "scilab"))
10963 (delete-file-recursively file)))
10964 (scandir "."))
10965 (for-each (lambda (file)
10966 (unless (member file '("." ".."))
10967 (rename-file (string-append "scilab/" file) file)))
10968 (scandir "scilab"))
10969
10970 ;; Some clean-up in scilab:
10971 (for-each delete-file-recursively
10972 '("scilab"
10973 "config"
10974 "libs/GetWindowsVersion"
10975 "Visual-Studio-settings"))
10976 (for-each delete-file
10977 (append
10978 (list "aclocal.m4"
10979 "configure"
10980 "m4/ax_cxx_compile_stdcxx.m4"
10981 "m4/lib-ld.m4"
10982 "m4/libtool.m4"
10983 "m4/ltoptions.m4"
10984 "m4/ltsugar.m4"
10985 "m4/ltversion.m4"
10986 "m4/lt~obsolete.m4"
10987 "m4/pkg.m4"
10988 "Scilab.sln")
10989 (find-files "." "^Makefile\\.in$")
10990 (find-files "." "\\.bat$")))
10991
10992 ;; And finally some files in the modules directory:
10993 (for-each
10994 (lambda (file)
10995 (delete-file
10996 (string-append "modules/dynamic_link/src/scripts/" file)))
10997 '("aclocal.m4"
10998 "configure"
10999 "compile"
11000 "config.guess"
11001 "config.sub"
11002 "depcomp"
11003 "install-sh"
11004 "ltmain.sh"
11005 "missing"))
11006 (delete-file-recursively "modules/dynamic_link/src/scripts/m4")
11007 (for-each delete-file
11008 '("modules/ast/src/cpp/parse/scanscilab.cpp"
11009 "modules/ast/src/cpp/parse/bison/parsescilab.output"
11010 "modules/ast/includes/parse/parsescilab.hxx"
11011 "modules/ast/src/cpp/parse/parsescilab.cpp"))))))
11012 (build-system gnu-build-system)
11013 (native-inputs
11014 (list autoconf-2.71
11015 autoconf-archive
11016 automake
11017 bison
11018 coreutils-minimal
11019 eigen
11020 flex
11021 gfortran
11022 libtool
11023 ocaml
11024 ocaml-findlib
11025 pkg-config))
11026 (inputs (list `(,pcre "bin")
11027 `(,pcre "out")
11028 arpack-ng
11029 bash-minimal
11030 curl
11031 fftw
11032 gettext-minimal
11033 hdf5
11034 libarchive
11035 libx11
11036 libxml2
11037 matio
11038 ocaml-num
11039 openblas
11040 rapidjson
11041 readline
11042 suitesparse
11043 tcl
11044 tk))
11045 (arguments
11046 (let* ((tcl (this-package-input "tcl"))
11047 (tk (this-package-input "tk")))
11048 (list
11049 #:configure-flags
11050 #~(list
11051 "--enable-relocatable"
11052 "--disable-static-system-lib"
11053 "--enable-build-parser"
11054 ;; Disable all java code.
11055 "--without-gui"
11056 "--without-javasci"
11057 "--disable-build-help"
11058 "--with-external-scirenderer"
11059 ;; Tcl and Tk library locations.
11060 (string-append "--with-tcl-include=" #$tcl "/include")
11061 (string-append "--with-tcl-library=" #$tcl "/lib")
11062 (string-append "--with-tk-include=" #$tk "/include")
11063 (string-append "--with-tk-library=" #$tk "/lib")
11064 (string-append "--with-eigen-include="
11065 (search-input-directory %build-inputs "include/eigen3"))
11066 ;; Find and link to the OCaml Num package
11067 "OCAMLC=ocamlfind ocamlc -package num"
11068 "OCAMLOPT=ocamlfind ocamlopt -package num -linkpkg")
11069 #:phases
11070 #~(modify-phases %standard-phases
11071 ;; The Num library is specified with the OCAMLC and
11072 ;; OCAMLOPT variables above.
11073 (add-after 'unpack 'fix-ocaml-num
11074 (lambda _
11075 (substitute*
11076 '("modules/scicos/Makefile.modelica.am"
11077 "modules/scicos/src/translator/makefile.mak"
11078 "modules/scicos/src/modelica_compiler/makefile.mak")
11079 (("nums\\.cmx?a") ""))))
11080 ;; See https://gitlab.com/scilab/scilab/-/issues/17462
11081 (add-after 'unpack 'fix-call-scilab-examples
11082 (lambda _
11083 (substitute*
11084 (find-files "modules/call_scilab/examples" "\\.c$")
11085 (("StartScilab\\((.*), NULL\\)" all args)
11086 (string-append "StartScilab(" args ", 0)")))))
11087 (add-after 'unpack 'fix-linking
11088 (lambda _
11089 (substitute* "modules/Makefile.am"
11090 (("libscilab_cli_la_LDFLAGS = .*\\)" all)
11091 (string-append all " -lcurl")))))
11092 (add-after 'unpack 'set-version
11093 (lambda _
11094 (substitute* "modules/core/includes/version.h.in"
11095 (("branch-[a-z0-9\\.]*") ; version
11096 #$(version-major+minor (package-version this-package))))))
11097 (add-after 'unpack 'restrain-to-scilab-cli
11098 (lambda _
11099 ;; Install only scilab-cli.desktop
11100 (substitute* "desktop/Makefile.am"
11101 (("desktop_DATA =")
11102 "desktop_DATA = scilab-cli.desktop\nDUMMY ="))
11103 ;; Replace scilab with scilab-cli for tests.
11104 (substitute* "Makefile.incl.am"
11105 (("scilab-bin") "scilab-cli-bin")
11106 (("scilab -nwni") "scilab-cli")
11107 ;; Do not install tests, demos and examples.
11108 ;; This saves up to 140 Mo in the final output.
11109 (("(TESTS|DEMOS|EXAMPLES)_DIR=.*" all kind)
11110 (string-append kind "_DIR=")))))
11111 (add-before 'check 'disable-failing-tests
11112 (lambda _
11113 (substitute* "Makefile"
11114 (("TESTS = .*")
11115 "TESTS =\n"))
11116 (substitute* "modules/functions_manager/Makefile"
11117 (("check:.*")
11118 "check:\n"))
11119 (substitute* "modules/types/Makefile"
11120 (("\\$\\(MAKE\\) \\$\\(AM_MAKEFLAGS\\) check-am")
11121 ""))))
11122 ;; These generated files are assumed to be present during
11123 ;; the build.
11124 (add-after 'bootstrap 'bootstrap-dynamic_link-scripts
11125 (lambda _
11126 (with-directory-excursion "modules/dynamic_link/src/scripts"
11127 ((assoc-ref %standard-phases 'bootstrap))
11128 (substitute* "compilerDetection.sh"
11129 (("PATHTOCONFIGURE=.*")
11130 "PATHTOCONFIGURE=${BASH_SOURCE[0]%/*}/\n")
11131 (("PROGNAME.*") "\n")))))
11132 (add-before 'build 'pre-build
11133 (lambda* (#:key inputs #:allow-other-keys)
11134 ;; Fix scilab script.
11135 (substitute* "bin/scilab"
11136 (("/bin/ls")
11137 (search-input-file inputs "bin/ls")))
11138 ;; Fix core.start.
11139 (substitute* "modules/core/etc/core.start"
11140 (("'SCI/modules")
11141 "SCI+'/modules"))))
11142 ;; Prevent race condition
11143 (add-after 'pre-build 'build-parsers
11144 (lambda* (#:key (make-flags #~'()) #:allow-other-keys)
11145 (with-directory-excursion "modules/ast"
11146 (apply invoke "make"
11147 "src/cpp/parse/parsescilab.cpp"
11148 "src/cpp/parse/scanscilab.cpp"
11149 make-flags))))
11150 ;; The startup script is mostly there to define the following env
11151 ;; variables properly. We can do this with guix directly.
11152 (add-after 'install 'rewrap-scilab-cli
11153 (lambda _
11154 (define (bin path) (string-append #$output "/bin/" path))
11155 (delete-file (bin "scilab-cli"))
11156 (wrap-program (bin "scilab-cli-bin")
11157 `("SCI" = (,(string-append #$output "/share/scilab")))
11158 `("LD_LIBRARY_PATH" ":" prefix
11159 (,(string-append #$output "/lib/scilab")))
11160 `("TCL_LIBRARY" = (,(string-append #$tcl "/lib")))
11161 `("TK_LIBRARY" = (,(string-append #$tk "/lib"))))
11162 (copy-file (bin "scilab-cli-bin") (bin "scilab-cli"))
11163 (copy-file (bin ".scilab-cli-bin-real") (bin "scilab-cli-bin"))
11164 (delete-file (bin ".scilab-cli-bin-real"))
11165 (substitute* (bin "scilab-cli")
11166 ;; Also set SCIHOME to sensible XDG base dirs value.
11167 (("\\.scilab-cli-bin-real\"")
11168 (string-append
11169 "scilab-cli-bin\" -scihome "
11170 "\"${XDG_STATE_HOME:-$HOME/.local/state}/scilab/"
11171 #$(package-version this-package) "\""))
11172 (("export SCI=")
11173 "unset LANGUAGE\nexport SCI="))))
11174 (add-after 'rewrap-scilab-cli 'sanity-check
11175 (lambda _
11176 (setenv "HOME" (getcwd))
11177 (invoke (string-append #$output "/bin/scilab-cli")
11178 "-e" "\"quit;\"")))))))
11179 (home-page "https://www.scilab.org/")
11180 (synopsis "Software for engineers and scientists")
11181 (description "This package provides the non-graphical version of the Scilab
11182software for engineers and scientists. Scilab is used for signal processing,
11183statistical analysis, image enhancement, fluid dynamics simulations, numerical
11184optimization, and modeling, simulation of explicit and implicit dynamical
11185systems and symbolic manipulations.")
11186 (license (list license:gpl2 license:bsd-3))))
11187
11188(define-public ruy
11189 (let ((commit "caa244343de289f913c505100e6a463d46c174de")
11190 (version "0")
11191 (revision "1"))
11192 (package
11193 (name "ruy")
11194 (version (git-version version revision commit))
11195 (source (origin
11196 (method git-fetch)
11197 (uri (git-reference
11198 (url "https://github.com/google/ruy")
11199 (commit commit)))
11200 (file-name (git-file-name name version))
11201 (sha256
11202 (base32
11203 "0j2g90nzam4h52zwx2vpanj8m17068cfb1zi4hcy0pyk52kb11dy"))))
11204 (build-system cmake-build-system)
11205 (arguments
11206 (list
11207 #:configure-flags
11208 #~(list "-DRUY_FIND_CPUINFO=ON"
11209 ;; Needed to make sure code is relocatable for use in
11210 ;; tensorflow.
11211 "-DCMAKE_CXX_FLAGS=-fPIC ")))
11212 (inputs (list cpuinfo))
11213 (native-inputs (list googletest-1.12))
11214 (home-page "https://github.com/google/ruy")
11215 (synopsis "Matrix multiplication library")
11216 (description
11217 "Ruy is a matrix multiplication library. Its focus is to cover the
11218matrix multiplication needs of neural network inference engines. Its initial
11219user has been TensorFlow Lite, where it is used by default on the ARM CPU
11220architecture.")
11221 (license license:asl2.0))))
11222
11223(define-public bliss
11224 (package
11225 (name "bliss")
11226 (version "0.77")
11227 (source (origin
11228 (method url-fetch)
11229 (uri (string-append
11230 "https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-"
11231 version ".zip"))
11232 (sha256
11233 (base32
11234 "193jb63kdwfas2cf61xj3fgkvhb6v2mnbwwpr0jas3zk6j0bkj5c"))))
11235 (build-system cmake-build-system)
11236 (arguments
11237 (list
11238 ;; There are no tests
11239 #:tests? #f
11240 #:configure-flags #~(list "-DUSE_GMP=ON") ; Used by igraph
11241 #:phases
11242 #~(modify-phases %standard-phases
11243 ;; Ensure that GMP is used, otherwise the BigNum type changes.
11244 (add-after 'unpack 'define-use-gmp
11245 (lambda _
11246 (substitute* "src/bignum.hh"
11247 (("#pragma once.*" all)
11248 (string-append all "#define BLISS_USE_GMP")))))
11249 ;; Move headers under the bliss/ prefix. This is a Guix choice,
11250 ;; since there are no upstream installation instructions and the
11251 ;; header names are sufficiently generic to cause confusions with
11252 ;; other packages (e.g. "heap.hh").
11253 (add-after 'define-use-gmp 'move-headers
11254 (lambda _
11255 (substitute* (find-files "src")
11256 (("#include \"(.*)\"" _ path)
11257 (string-append "#include <bliss/" path ">")))
11258 (mkdir-p "include/bliss")
11259 (for-each
11260 (lambda (file)
11261 (rename-file file
11262 (string-append "include/bliss/" (basename file))))
11263 (find-files "src" "\\.(h|hh)$"))
11264 (substitute* "Doxyfile"
11265 (("INPUT *=.*") "INPUT = bliss"))))
11266 (add-after 'move-headers 'patch-cmake
11267 (lambda _
11268 (let ((port (open-file "CMakeLists.txt" "a")))
11269 (display
11270 (apply
11271 string-append
11272 ;; Install the executable and the shared library.
11273 "install(TARGETS bliss)\n"
11274 "install(TARGETS bliss-executable)\n"
11275 "install(DIRECTORY include/bliss DESTINATION include)\n"
11276 "target_link_libraries(bliss PUBLIC ${GMP_LIBRARIES})\n"
11277 ;; Missing include directories.
11278 (map
11279 (lambda (name)
11280 (string-append
11281 "target_include_directories(" name " PUBLIC\n"
11282 "${CMAKE_CURRENT_SOURCE_DIR}/include"
11283 " ${GMP_INCLUDE_DIR})\n"))
11284 '("bliss" "bliss_static" "bliss-executable")))
11285 port)
11286 (close-port port))))
11287 (add-after 'build 'build-doc
11288 (lambda _
11289 (mkdir "doc")
11290 (with-directory-excursion "doc"
11291 (let ((srcdir (string-append "../../bliss-" #$version)))
11292 (copy-recursively (string-append srcdir "/include/bliss")
11293 "bliss")
11294 (invoke "doxygen" (string-append srcdir "/Doxyfile"))))))
11295 (add-after 'install 'install-doc
11296 (lambda _
11297 (copy-recursively
11298 "doc/html" (string-append #$output "/share/doc/"
11299 #$name "-" #$version "/html")))))))
11300 (native-inputs (list doxygen graphviz unzip))
11301 (propagated-inputs (list gmp))
11302 (home-page "https://users.aalto.fi/~tjunttil/bliss/index.html")
11303 (synopsis "Tool for computing automorphism groups and canonical labelings of graphs")
11304 (description "@code{bliss} is a library for computing automorphism groups
11305+and canonical forms of graphs. It has both a command line user interface as
11306+well as C++ and C programming language APIs.")
11307 (license license:lgpl3)))
11308
11309(define-public python-mathics-scanner
11310 (package
11311 (name "python-mathics-scanner")
11312 (version "2.0.0")
11313 (source
11314 (origin
11315 (method git-fetch)
11316 (uri (git-reference
11317 (url "https://github.com/Mathics3/mathics-scanner.git")
11318 (commit version)))
11319 (file-name (git-file-name name version))
11320 (sha256
11321 (base32
11322 "1illmj40rynrhqwr5sfh2mkj2wnpvaqrmvlh56h7za3d823pf5jz"))))
11323 (build-system pyproject-build-system)
11324 (arguments
11325 (list
11326 #:phases
11327 #~(modify-phases %standard-phases
11328 (add-after 'unpack 'prepare
11329 (lambda _
11330 ;; They forgot to update the version number.
11331 (substitute* "mathics_scanner/version.py"
11332 (("__version__=\"[^\"]*\"")
11333 (string-append "__version__=\"" #$version "\"")))
11334 ;; Generate JSON character/operator tables (character-tables.json,
11335 ;; operators.json) which are pre-generated in the PyPI tarball
11336 ;; but not in git. The Makefile runs this script before
11337 ;; 'make dist'. Unlike in mathics-core, running the script here
11338 ;; works because it writes to its own source tree being built;
11339 ;; in mathics-core, the script tries to write to the installed
11340 ;; python-mathics-scanner package which is not allowed.
11341 (invoke "bash" "./admin-tools/make-JSON-tables.sh")
11342 ;; Missing installation of "operators.yml".
11343 (substitute* "pyproject.toml"
11344 (("\"data/named-characters.yml\",")
11345 "\"data/named-characters.yml\", \"data/operators.yml\",")))))))
11346 (propagated-inputs (list python-chardet python-click python-pyyaml))
11347 (native-inputs (list python-pytest python-setuptools python-wheel))
11348 (home-page "https://mathics.org/")
11349 (synopsis
11350 "Character tables and tokenizer for Mathics and the Wolfram language")
11351 (description
11352 "This package provides character tables and a tokenizer for Mathics and
11353the Wolfram language.")
11354 (license license:gpl3+)))
11355
11356(define-public python-mathics-pygments
11357 (package
11358 (name "python-mathics-pygments")
11359 (version "1.0.4")
11360 (source
11361 (origin
11362 (method url-fetch)
11363 (uri (pypi-uri "mathics_pygments" version))
11364 (sha256
11365 (base32 "1iagdic8f0yjx01kdds40jfcxcpdbrd3i0ywydl01dhyyvd2yjk9"))))
11366 (build-system pyproject-build-system)
11367 (native-inputs
11368 (list python-pytest
11369 python-setuptools))
11370 (propagated-inputs
11371 (list python-mathics-scanner
11372 python-pygments))
11373 (home-page "http://github.com/Mathics3/mathics-pygments/")
11374 (synopsis "Wolfram language lexer for Pygments")
11375 (description "This package provides a Wolfram language lexer for Pygments.")
11376 (license license:expat)))
11377
11378(define-public python-mathics-core
11379 (package
11380 (name "python-mathics-core")
11381 (version "9.0.0")
11382 (source (origin
11383 (method git-fetch)
11384 (uri (git-reference
11385 (url "https://github.com/Mathics3/mathics-core.git")
11386 (commit version)))
11387 (file-name (git-file-name name version))
11388 (sha256
11389 (base32
11390 "19232vs3sxg1nq32cas8hwsiwvp6nzpnz4jzjjahpvrv1bl62prs"))))
11391 (arguments
11392 `(;; <https://github.com/pytest-dev/pytest/pull/10173> is missing .closed
11393 #:test-flags '("-s")
11394 #:phases
11395 (modify-phases %standard-phases
11396 (add-after 'unpack 'patch-bugs
11397 (lambda _
11398 (substitute* "pyproject.toml"
11399 (("\"autoload/\\*.m\",")
11400 ;; They forgot to install autoload/rules/*.m
11401 "\"autoload/*.m\", \"autoload/rules/*.m\","))
11402 ;; Prevent internet access by tests.
11403 (substitute* "mathics/builtin/files_io/files.py"
11404 (("https://raw.githubusercontent.com/Mathics3/mathics-core/master/README.rst")
11405 (string-append (getcwd) "/README.rst")))
11406 ;; llvmlite 0.45+ auto-initializes LLVM; calling initialize()
11407 ;; now raises RuntimeError.
11408 ;; <https://llvmlite.readthedocs.io/en/v0.45.0/user-guide/binding/initialization-finalization.html>
11409 (substitute* "mathics/compile/compile.py"
11410 (("llvm\\.initialize\\(\\)") "pass"))
11411 ;; The JSON operator tables (op-tables.json, operator-tables.json)
11412 ;; are pre-generated in the PyPI tarball but not in git.
11413 ;; The Makefile runs admin-tools/make-JSON-tables.sh before
11414 ;; 'make dist', but that script also writes to the scanner's
11415 ;; default location which is read-only in the store. Run the
11416 ;; needed commands directly. setup.py has fallback generation
11417 ;; code but it's buggy: it writes operator-tables.json to the
11418 ;; wrong path and op-tables.json is missing
11419 ;; --field=operator-to-amslatex. Creating the files first
11420 ;; makes setup.py's 'if not os.path.exists' checks pass and
11421 ;; the buggy code is skipped.
11422 (with-directory-excursion "mathics/data"
11423 (invoke "mathics3-generate-json-table"
11424 "--field=ascii-operator-to-symbol"
11425 "--field=ascii-operator-to-unicode"
11426 "--field=ascii-operator-to-wl-unicode"
11427 "--field=operator-to-ascii"
11428 "--field=operator-to-amslatex"
11429 "--field=operator-to-unicode"
11430 "-o" "op-tables.json")
11431 (invoke "mathics3-generate-operator-json-table"
11432 "-o" "operator-tables.json"))))
11433 (add-before 'build 'set-home
11434 (lambda _
11435 ;; The sanity check imports mathics which tries to create a
11436 ;; config directory in HOME. Set HOME to a writable location.
11437 (setenv "HOME" "/tmp")))
11438 (add-before 'check 'prepare-check
11439 (lambda* (#:key inputs outputs #:allow-other-keys)
11440 ;(copy-file "operator-tables.json" "mathics/data/operator-tables.json")
11441 ; Doesn't work: (add-installed-pythonpath inputs outputs)
11442 (setenv "PYTHONPATH" (getcwd))))
11443 (add-before 'check 'prepare-locales
11444 (lambda _
11445 ;; Otherwise 210 tests fail because the real output would use
11446 ;; unicode arrow characters. With this, only 18 (symbolic) tests fail.
11447 (setenv "MATHICS_CHARACTER_ENCODING" "ASCII"))))))
11448 (build-system pyproject-build-system)
11449 (native-inputs (list python-pytest python-setuptools python-wheel))
11450 (inputs (list llvm))
11451 (propagated-inputs (list python-mpmath
11452 python-pint
11453 python-palettable
11454 python-pympler
11455 python-stopit
11456 python-sympy
11457 python-numpy
11458 python-mathics-scanner
11459 python-pillow
11460 python-dateutil
11461 python-requests
11462 python-llvmlite
11463 python-scipy))
11464 (synopsis "Computer algebra system")
11465 (description "This package provides a computer algebra system--an alternative
11466to Wolfram.")
11467 (home-page "https://mathics.org/")
11468 (license license:gpl3)))
11469
11470(define-public python-mathicsscript
11471 (package
11472 (name "python-mathicsscript")
11473 (version "9.0.0")
11474 (source
11475 (origin
11476 (method url-fetch)
11477 (uri (pypi-uri "mathicsscript" version))
11478 (sha256
11479 (base32 "0pamvbmm8ichxapblfck913frdmr82vmb0s2jbiiy7iil5bzn59i"))))
11480 (build-system pyproject-build-system)
11481 (arguments
11482 `(#:phases
11483 (modify-phases %standard-phases
11484 (add-before 'build 'set-home-env
11485 (lambda _
11486 (setenv "HOME" "/tmp"))))))
11487 (propagated-inputs (list python-click
11488 python-colorama
11489 python-columnize
11490 python-mathics-pygments
11491 python-mathics-scanner
11492 python-mathics-core
11493 python-networkx
11494 python-prompt-toolkit
11495 python-pygments
11496 python-term-background))
11497 (native-inputs (list python-pytest python-setuptools python-wheel))
11498 (home-page "https://mathics.org/")
11499 (synopsis "Command-line interface to Mathics3")
11500 (description "This package provides a command-line interface to
11501Mathics3.")
11502 (license license:gpl3)))
11503
11504(define-public python-mathics-django
11505 (package
11506 (name "python-mathics-django")
11507 (version "9.0.0")
11508 (source
11509 (origin
11510 (method url-fetch)
11511 (uri (pypi-uri "mathics_django" version))
11512 (sha256
11513 (base32 "1lnqqi3ssr2xdss66asvd02b13igy75264yir0w1v6d1gznn93j5"))))
11514 (build-system pyproject-build-system)
11515 (arguments
11516 `(#:phases
11517 (modify-phases %standard-phases
11518 (delete 'check)
11519 (add-after 'build 'check
11520 (lambda _
11521 (setenv "PYTHONPATH" (getcwd))
11522 (setenv "DJANGO_SETTINGS_MODULE" "mathics_django.settings")
11523 (invoke "django-admin" "test"))))))
11524 (propagated-inputs (list python-django
11525 python-mathics-scanner
11526 python-mathics-core
11527 python-matplotlib
11528 python-networkx
11529 python-pygments
11530 python-requests))
11531 (native-inputs (list python-pytest python-setuptools python-wheel))
11532 (home-page "https://mathics.org/")
11533 (synopsis "A Django front end for Mathics3.")
11534 (description "This package provides a Django front end for Mathics3.")
11535 (license license:gpl3)))
11536
11537(define-public python-mathics3-notebook-frontends
11538 (let ((commit "63b90a07704acab5b04acc7a9335a8a88916c402") ; no releases
11539 (revision "0"))
11540 (package
11541 (name "python-mathics3-notebook-frontends")
11542 (version (git-version "0.0.0" revision commit))
11543 (source
11544 (origin
11545 (method git-fetch)
11546 (uri (git-reference
11547 (url "https://github.com/Mathics3/Mathics3-notebook-frontends")
11548 (commit commit)))
11549 (file-name (git-file-name name version))
11550 (sha256
11551 (base32 "02smq8w0m3kj1xssbyd7kl17b34mk1jzy9ds7fsqb54qa5pba78q"))))
11552 (build-system pyproject-build-system)
11553 (propagated-inputs (list python-mathics-core))
11554 (arguments
11555 (list #:tests? #f)) ; no tests
11556 (native-inputs
11557 (list python-setuptools
11558 python-wheel))
11559 (home-page "https://mathics.org/")
11560 (synopsis "Mathics frontend for Jupyter Notebook")
11561 (description
11562 "This package provides a Mathics3 frontend for
11563@url{https://jupyter.org/, Jupyter Notebook} and @url{https://marimo.io/,
11564Marimo}.")
11565 (license license:gpl3+))))
11566
11567(define-public lie
11568 (package
11569 (name "lie")
11570 (version "2.2.2")
11571 ;; Original: <http://www-math.univ-poitiers.fr/~maavl/LiE/conLiE.tar.gz>
11572 ;; This source has the license file added as allowed on
11573 ;; <http://www-math.univ-poitiers.fr/~maavl/LiE/>.
11574 (source
11575 (origin
11576 (method git-fetch)
11577 (uri (git-reference
11578 (url "https://github.com/daym/LiE")
11579 (commit (string-append "v" version))))
11580 (file-name (git-file-name name version))
11581 (sha256
11582 (base32 "0qb9y08mdl2wr77lf61wv4xks429sw99xacb9gh91w242z0nbcqn"))))
11583 (build-system gnu-build-system)
11584 (arguments
11585 `(#:parallel-build? #f
11586 ;; There are test input files under progs/--but no expected results.
11587 #:tests? #f
11588 #:phases
11589 (modify-phases %standard-phases
11590 (replace 'configure
11591 (lambda* (#:key outputs #:allow-other-keys)
11592 (substitute* "make_lie"
11593 (("`/bin/pwd`")
11594 (string-append (assoc-ref outputs "out")
11595 "/bin")))))
11596 (add-after 'install 'install-lie-program
11597 (lambda* (#:key outputs #:allow-other-keys)
11598 (for-each
11599 (lambda (name)
11600 (install-file name
11601 (string-append (assoc-ref outputs "out")
11602 "/bin")))
11603 '("lie" "Lie.exe")))))))
11604 (native-inputs
11605 (list bison))
11606 (inputs
11607 (list readline))
11608 (synopsis "Lie group computer algebra module")
11609 (description "This package provides a computer algebra module for Lie
11610groups. Documentation is available on
11611@url{http://www-math.univ-poitiers.fr/~maavl/pdf/LiE-manual.pdf}.")
11612 (home-page "http://www-math.univ-poitiers.fr/~maavl/LiE/")
11613 ;; <http://www-math.univ-poitiers.fr/~maavl/LiE/> says LGPL.
11614 (license license:lgpl3+)))
11615
11616(define-public exprtk
11617 (package
11618 (name "exprtk")
11619 (version "0.0.3")
11620 (source
11621 (origin
11622 (method git-fetch)
11623 (uri (git-reference
11624 (url "https://github.com/ArashPartow/exprtk")
11625 (commit version)))
11626 (file-name (git-file-name name version))
11627 (sha256
11628 (base32 "0pszh11w29nc256qhil51g3635n06ncf0ihg7g4h86jrhqsk7183"))))
11629 (build-system copy-build-system)
11630 (arguments
11631 '(#:install-plan '(("exprtk.hpp" "include/"))))
11632 (synopsis "C++ Mathematical Expression Parsing And Evaluation Library")
11633 (description "ExprTk is a C++ headers only library for mathematical
11634expression parsing and evaluation.")
11635 (home-page "https://www.partow.net/programming/exprtk/index.html")
11636 (license license:expat)))
11637
11638(define-public highs
11639 (package
11640 (name "highs")
11641 (version "1.15.1")
11642 (source
11643 (origin
11644 (method git-fetch)
11645 (uri (git-reference
11646 (url "https://github.com/ERGO-Code/HiGHS")
11647 (commit (string-append "v" version))))
11648 (file-name (git-file-name name version))
11649 (sha256
11650 (base32 "11hh958jvfqrc7rm3xcwx2p71i49cb4cyafajlmkr8xzyb00y851"))))
11651 (build-system cmake-build-system)
11652 (home-page "https://highs.dev")
11653 (synopsis "High performance software for linear optimization")
11654 (description
11655 "HiGHS provides serial and parallel solvers for large-scale sparse
11656linear programming (LP), mixed-integer programming (MIP), and quadratic
11657programming (QP) models.")
11658 (license license:expat)))
11659
11660(define-public trilinos-zoltan
11661 (package
11662 (name "trilinos-zoltan")
11663 (version "16.1.0")
11664 (source
11665 (origin
11666 (method git-fetch)
11667 (uri (git-reference (url "https://github.com/trilinos/Trilinos")
11668 (commit (string-append "trilinos-release-"
11669 (string-replace-substring
11670 version "." "-")))))
11671 (file-name (git-file-name "trilinos" version))
11672 (sha256 (base32 "1snn8vzxwrk9qsvv9wsv4zf99cvcja4shgjpsavp893v9gvgp2gm"))))
11673 (build-system cmake-build-system)
11674 (inputs (list openmpi
11675 perl
11676 python
11677 python-wrapper
11678 tcsh
11679 pt-scotch
11680 zlib))
11681 (arguments
11682 (list
11683 #:configure-flags
11684 #~(list "-DTrilinos_ENABLE_Zoltan=ON"
11685 "-DBUILD_SHARED_LIBS=ON"
11686 "-DTPL_ENABLE_MPI=ON"
11687 "-DTPL_ENABLE_METIS=OFF"
11688 "-DTPL_ENABLE_Scotch=ON"
11689 "-DTPL_ENABLE_Zlib=ON"
11690 "-DTrilinos_ENABLE_Fortran=OFF"
11691 "-DZoltan_ENABLE_TESTS=ON"
11692 ;; disable failing tests
11693 "-DZoltan_ch_brack2_3_zoltan_parallel_DISABLE=ON"
11694 "-DZoltan_ch_grid20x19_zoltan_parallel_DISABLE=ON"
11695 "-DZoltan_hg_felix_zoltan_parallel_DISABLE=ON"
11696 "-DZoltan_hg_ibm03_zoltan_parallel_DISABLE=ON"
11697 "-DZoltan_ch_degenerate_zoltan_parallel_DISABLE=ON"
11698 "-DZoltan_ch_degenerateAA_zoltan_parallel_DISABLE=ON"
11699 "-DZoltan_ch_ewgt_scotch_parallel_DISABLE=ON"
11700 "-DZoltan_ch_hammond_zoltan_parallel_DISABLE=ON"
11701 "-DZoltan_ch_hammond_scotch_parallel_DISABLE=ON"
11702 "-DZoltan_ch_hammond2_zoltan_parallel_DISABLE=ON"
11703 "-DZoltan_ch_hughes_zoltan_parallel_DISABLE=ON"
11704 "-DZoltan_ch_simple_scotch_parallel_DISABLE=ON"
11705 "-DZoltan_hg_cage10_zoltan_parallel_DISABLE=ON"
11706 "-DZoltan_ch_vwgt_scotch_parallel_DISABLE=ON")))
11707 (home-page "https://trilinos.github.io/")
11708 (synopsis
11709 "Parallel partitioning, load balancing and data-management services")
11710 (description
11711 "The Zoltan library is a collection of data management services for parallel,
11712unstructured, adaptive, and dynamic applications. It simplifies the
11713load-balancing, data movement, unstructured communication, and memory usage
11714difficulties that arise in dynamic applications such as adaptive
11715finite-element methods, particle methods, and crash simulations. Zoltan's
11716data-structure neutral design also lets a wide range of applications use it
11717without imposing restrictions on application data structures. Its object-based
11718interface provides a simple and inexpensive way for application developers to
11719use the library and researchers to make new capabilities available under a
11720common interface.
11721")
11722 (license license:bsd-3)))
11723
11724(define-public xdmf
11725 (package
11726 (name "xdmf")
11727 ;; Project does not publish releases / tags
11728 (properties '((commit . "04a84bab0eb1568e0f1a27c8fb60c6931efda003")
11729 (revision . "0")))
11730 (version (git-version "3.0.0"
11731 (assoc-ref properties 'revision)
11732 (assoc-ref properties 'commit)))
11733 (source
11734 (origin
11735 (method git-fetch)
11736 (uri (git-reference
11737 (url "https://gitlab.kitware.com/xdmf/xdmf")
11738 (commit (assoc-ref properties 'commit))))
11739 (file-name (git-file-name name version))
11740 (patches
11741 (search-patches "xdmf-3.0.0-hdf5.patch"))
11742 (sha256
11743 (base32 "06k4vibkvgxlzkn06x470aq5q18p7yhql8awrpdz3czys3z8i288"))))
11744 (build-system cmake-build-system)
11745 (arguments
11746 (list #:tests? #f)) ;has no tests
11747 (inputs
11748 (list boost hdf5 libxml2))
11749 (home-page "https://www.xdmf.org/index.html")
11750 (synopsis "XDMF library")
11751 (description
11752 "This package provides the eXtensible Data Model and Format (XDMF) C++
11753library.")
11754 (license license:bsd-4)))