projects/guix·blob ruby-team · refs

917 lines · 37.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2020 Eric Bavier <[email protected]>
3;;; Copyright © 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2015-2025 Efraim Flashner <[email protected]>
5;;; Copyright © 2016 Pjotr Prins <[email protected]>
6;;; Copyright © 2016 Andreas Enge <[email protected]>
7;;; Copyright © 2016, 2020, 2021, 2022, 2023, 2025 Ricardo Wurmus <[email protected]>
8;;; Copyright © 2016 Ben Woodcroft <[email protected]>
9;;; Copyright © 2017, 2018 Rutger Helling <[email protected]>
10;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018 Clément Lassieur <[email protected]>
12;;; Copyright © 2019-2026 Ludovic Courtès <[email protected]>
13;;; Copyright © 2019 Mădălin Ionel Patrașcu <[email protected]>
14;;; Copyright © 2020 Roel Janssen <[email protected]>
15;;; Copyright © 2021, 2024 Maxim Cournoyer <[email protected]>
16;;; Copyright © 2021 Stefan Reichör <[email protected]>
17;;; Copyright © 2024 Zheng Junjie <[email protected]>
18;;; Copyright © 2024, 2025 David Elsing <[email protected]>
19;;; Copyright © 2024 Romain Garbage <[email protected]>
20;;; Copyright © 2024 Arun Isaac <[email protected]>
21;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
22;;; Copyright © 2025 Reza Housseini <[email protected]>
23;;;
24;;; This file is part of GNU Guix.
25;;;
26;;; GNU Guix is free software; you can redistribute it and/or modify it
27;;; under the terms of the GNU General Public License as published by
28;;; the Free Software Foundation; either version 3 of the License, or (at
29;;; your option) any later version.
30;;;
31;;; GNU Guix is distributed in the hope that it will be useful, but
32;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34;;; GNU General Public License for more details.
35;;;
36;;; You should have received a copy of the GNU General Public License
37;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38
39(define-module (gnu packages parallel)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system pyproject)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module ((guix utils) #:select (target-32bit?))
47 #:use-module (guix packages)
48 #:use-module (guix utils)
49 #:use-module (guix gexp)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages admin)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages databases)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages compiler-tools)
60 #:use-module (gnu packages freeipmi)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages libevent)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages mpi)
67 #:use-module (gnu packages networking)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-build)
72 #:use-module (gnu packages python-science)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages serialization)
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages tcl)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages web))
80
81(define-public parallel
82 (package
83 (name "parallel")
84 (version "20260722")
85 (outputs '("out" "doc"))
86 (source
87 (origin
88 (method url-fetch)
89 (uri (string-append "mirror://gnu/parallel/parallel-"
90 version ".tar.bz2"))
91 (sha256
92 (base32 "1mhsiz8jf9s1fwzd0nbn9nw017r433b0l21a00xaqjiklirbbr5g"))
93 (snippet
94 '(begin
95 (use-modules (guix build utils))
96 ;; Delete pre-generated manpages and documents.
97 ;; TODO: generate rst files.
98 ;; parallel_cheat_bw.pdf uses libreoffice to be generated.
99 (rename-file "src/parallel_cheat_bw.pdf"
100 "src/parallel_cheat_bw.pdf-keep")
101 (for-each delete-file (find-files "src" "\\.(1|7|html|pdf)$"))
102 (rename-file "src/parallel_cheat_bw.pdf-keep"
103 "src/parallel_cheat_bw.pdf")))))
104 (build-system gnu-build-system)
105 (arguments
106 (list
107 #:configure-flags
108 #~(list (string-append "--docdir=" #$output:doc "/share/doc/parallel"))
109 #:phases
110 #~(modify-phases %standard-phases
111 (add-after 'unpack 'patch-bin-sh
112 (lambda _
113 (for-each
114 (lambda (file)
115 (substitute* file
116 ;; Patch hard coded '/bin/sh' in the line ending in:
117 ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
118 ;; parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
119 (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
120 (list "src/parallel" "src/sem"))))
121 (add-before 'install 'add-install-to-path
122 (lambda _
123 (setenv "PATH"
124 (string-append (getenv "PATH") ":" #$output "/bin"))))
125 (add-after 'install 'wrap-program
126 (lambda* (#:key inputs #:allow-other-keys)
127 (wrap-program (string-append #$output "/bin/parallel")
128 `("PATH" ":" prefix
129 ,(map (lambda (input)
130 (string-append (assoc-ref inputs input) "/bin"))
131 '("perl" "procps"))))))
132 (add-after 'wrap-program 'post-install-test
133 (lambda* (#:key tests? #:allow-other-keys)
134 (when tests?
135 (invoke (string-append #$output "/bin/parallel")
136 "echo"
137 ":::" "1" "2" "3"))))
138 (add-after 'post-install-test 'replace-texi-files
139 (lambda _
140 ;; Build info files.
141 (for-each
142 (lambda (file)
143 (let ((info-file
144 (string-append (car (string-split file #\.)) ".info")))
145 (invoke "makeinfo" "--no-split" "-o" info-file file)
146 (install-file info-file
147 (string-append #$output:doc "/share/info"))))
148 (find-files "src" "\\.texi$"))
149 ;; Remove texi files.
150 (for-each
151 delete-file
152 (find-files (string-append #$output:doc "/share/doc/parallel")
153 "\\.texi$")))))))
154 (native-inputs
155 (list perl pod2pdf texinfo))
156 (inputs
157 (list bash-minimal perl procps))
158 (home-page "https://www.gnu.org/software/parallel/")
159 (synopsis "Build and execute command lines in parallel")
160 (description
161 "GNU Parallel is a tool for executing shell jobs in parallel using one
162or more computers. Jobs can consist of single commands or of scripts
163and they are executed on lists of files, hosts, users or other items.")
164 (license license:gpl3+)))
165
166(define-public xe
167 (package
168 (name "xe")
169 (version "1.0")
170 (source
171 (origin
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/leahneukirchen/xe")
175 (commit (string-append "v" version))))
176 (file-name (git-file-name name version))
177 (sha256
178 (base32 "1ijvf7q5pxk4rlj7p9q6fmpdqiwmc28gffkk6yg390k1a1z3msf9"))))
179 (build-system gnu-build-system)
180 (arguments
181 (list #:tests? #f
182 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
183 (string-append "PREFIX=" #$output))
184 #:phases #~(modify-phases %standard-phases
185 (delete 'configure))))
186 (synopsis "Execute a command for every argument")
187 (description
188 "The xe utility constructs command lines from specified arguments,
189combining some of the best features of xargs(1) and apply(1). Parallel
190execution is also possible.")
191 (home-page "https://github.com/leahneukirchen/xe")
192 (license license:public-domain)))
193
194(define-public xjobs
195 (package
196 (name "xjobs")
197 (version "20250529")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append
201 "http://www.maier-komor.de/xjobs/xjobs-"
202 version ".tgz"))
203 (sha256
204 (base32
205 "13hkaipl3cgr9cvama34b442n35ckr42p1f24kygkrad3ymy87hx"))))
206 (build-system gnu-build-system)
207 (arguments `(#:tests? #f)) ;; No tests
208 (native-inputs
209 (list flex))
210 (home-page "https://www.maier-komor.de/xjobs.html")
211 (properties `((release-monitoring-url . ,home-page)))
212 (synopsis
213 "Parallel execution of jobs with several useful options")
214 (description
215 "xjobs reads job descriptions line by line and executes them in
216parallel. It limits the number of parallel executing jobs and starts new jobs
217when jobs finish.")
218 (license license:gpl2+)))
219
220(define-public slurm-minimal
221 (package
222 (name "slurm-minimal")
223 (version "23.11.10")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append
227 "https://download.schedmd.com/slurm/slurm-"
228 version ".tar.bz2"))
229 (sha256
230 (base32
231 "0gf7x85bzpkrx87mb16wyiyvkjxqq01sbajsjxwrspyi2v675hgr"))
232 (modules '((guix build utils)))
233 (snippet
234 '(begin
235 ;; According to
236 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html>
237 ;; there are non-free bits under contribs/, though it's not
238 ;; clear which ones. libpmi is clearly free (it used to be
239 ;; under src/api/) and so is pmi2 (lax non-copyleft
240 ;; license), so remove all of contribs/ except pmi and pmi2.
241 (substitute* "configure.ac"
242 (("^[[:space:]]+contribs/(.*)$" all directory)
243 (if (string-prefix? "pmi" directory)
244 all
245 "")))
246
247 (rename-file "contribs/pmi" "tmp-pmi")
248 (rename-file "contribs/pmi2" "tmp-pmi2")
249 (delete-file-recursively "contribs")
250 (mkdir "contribs")
251 (rename-file "tmp-pmi" "contribs/pmi")
252 (rename-file "tmp-pmi2" "contribs/pmi2")))))
253 (inputs
254 (append
255 (list freeipmi
256 `(,hwloc "lib")
257 json-c
258 linux-pam)
259 (if (supported-package? openpmix-5)
260 (list openpmix-5)
261 '())
262 (list munge
263 numactl
264 readline)))
265 (native-inputs
266 (list autoconf expect perl pkg-config python-wrapper))
267 (build-system gnu-build-system)
268 (arguments
269 (list #:configure-flags
270 #~(list "--enable-pam" "--sysconfdir=/etc/slurm"
271 "--disable-static"
272 (string-append "--with-freeipmi=" #$(this-package-input "freeipmi"))
273 (string-append "--with-hwloc="
274 (ungexp (this-package-input "hwloc") "lib"))
275 (string-append "--with-json=" #$(this-package-input "json-c"))
276 (string-append "--with-munge=" #$(this-package-input "munge"))
277
278 ;; Use PMIx bundled with Open MPI (this is required for Open MPI 5.x).
279 ;; Note: Older versions that inherit from this package lack the
280 ;; 'openpmix' dependency.
281 #$(let ((openmpix (this-package-input "openpmix")))
282 (if openmpix
283 #~(string-append "--with-pmix=" #$openmpix)
284 "--without-pmix"))
285
286 ;; 32-bit support is marked as deprecated and needs to be
287 ;; explicitly enabled.
288 #$@(if (target-32bit?) '("--enable-deprecated") '()))
289 #:phases
290 #~(modify-phases %standard-phases
291 (add-after 'unpack 'patch-plugin-linker-flags
292 (lambda _
293 (substitute* (find-files "src/plugins/" "Makefile.in")
294 (("_la_LDFLAGS = ")
295 "_la_LDFLAGS = ../../../api/libslurm.la "))))
296 (add-after 'patch-plugin-linker-flags 'autoconf
297 (lambda _ (invoke "autoconf"))) ;configure.ac was patched
298 (add-after 'install 'install-libpmi
299 (lambda _
300 ;; Open MPI expects libpmi to be provided by Slurm so install it.
301 (invoke "make" "install" "-C" "contribs/pmi")
302
303 ;; Others expect pmi2.
304 (invoke "make" "install" "-C" "contribs/pmi2"))))))
305 (home-page "https://slurm.schedmd.com/")
306 (synopsis "Workload manager for cluster computing")
307 (description
308 "SLURM is a fault-tolerant and highly scalable cluster management and job
309scheduling system for large and small clusters. It allocates access to
310resources (computer nodes) to users for some duration of time, provides a
311framework for starting, executing, and monitoring work (typically a parallel
312job) on a set of allocated nodes, and arbitrates contention for resources
313by managing a queue of pending work.")
314 (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
315 license:expat ; slurm/pmi.h
316 license:isc ; src/common/strlcpy.c
317 license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
318 license:zlib ; src/common/strnatcmp.c
319 (license:non-copyleft ;contribs/pmi2, Argonne Natl. Lab.
320 "https://github.com/SchedMD/slurm/blob/master/contribs/pmi2/COPYRIGHT")
321 license:gpl2+)))) ; the rest, often with OpenSSL exception
322
323(define (make-slurm base-slurm)
324 "Make a slurm package with all optional features enabled. Base it off of the
325minimal slurm package BASE-SLURM."
326 (package
327 (inherit base-slurm)
328 (name "slurm")
329 (arguments
330 (substitute-keyword-arguments arguments
331 ((#:configure-flags flags #~'())
332 #~(cons* "--enable-slurmrestd"
333 (string-append "--with-bpf="
334 (dirname
335 (dirname (search-input-directory
336 %build-inputs "include/linux"))))
337 (string-append "--with-http-parser="
338 #$(this-package-input "http-parser"))
339 (string-append "--with-rdkafka="
340 #$(this-package-input "librdkafka"))
341 (string-append "--with-yaml="
342 #$(this-package-input "libyaml"))
343 #$flags))))
344 ;; FIXME: More optional inputs could be added.
345 (inputs
346 (modify-inputs inputs
347 ;; Add dependencies required by the slurm REST API.
348 (prepend dbus freeipmi http-parser
349 libjwt librdkafka libyaml (list mariadb "dev"))))))
350
351(define-public slurm (make-slurm slurm-minimal))
352
353;; The SLURM client/daemon protocol and file format changes from time to time
354;; in incompatible ways, as noted in
355;; <https://slurm.schedmd.com/troubleshoot.html#network>. Thus, keep older
356;; releases here. See also <https://issues.guix.gnu.org/44387>.
357;; As noted in the link, YY.MM is the release scheme, and the 'maintenance'
358;; digit does not introduce incompatibilities.
359
360(define-public slurm-minimal-25.05
361 (package
362 (inherit slurm-minimal)
363 (version "25.05.4")
364 (source (origin
365 (inherit (package-source slurm))
366 (method url-fetch)
367 (uri (string-append
368 "https://download.schedmd.com/slurm/slurm-"
369 version ".tar.bz2"))
370 (sha256
371 (base32
372 "130pjygqk794dchknjqdsinciv2b7c7r5agqsgca7m804xp09wnl"))))
373 (inputs (modify-inputs inputs
374 (replace "openpmix" openpmix))))) ;use version 6.0.0
375
376(define-public slurm-25.05 (make-slurm slurm-minimal-25.05))
377
378(define-public slurm-minimal-24.05
379 (package
380 (inherit slurm-minimal)
381 (version "24.05.5")
382 (source (origin
383 (inherit (package-source slurm))
384 (method url-fetch)
385 (uri (string-append
386 "https://download.schedmd.com/slurm/slurm-"
387 version ".tar.bz2"))
388 (sha256
389 (base32
390 "0vxiymp40lgcb1z76cyqdpqpy7w14r483v54dk4aq84v0aw0mixl"))))))
391
392(define-public slurm-24.05 (make-slurm slurm-minimal-24.05))
393
394(define-public slurm-minimal-23.11
395 (package
396 (inherit slurm-minimal)
397 (version "23.11.11")
398 (source (origin
399 (inherit (package-source slurm))
400 (method url-fetch)
401 (uri (string-append
402 "https://download.schedmd.com/slurm/slurm-"
403 version ".tar.bz2"))
404 (patches
405 (search-patches "slurm-23-salloc-fallback-shell.patch"))
406 (sha256
407 (base32
408 "0pg4liysbppfgynwsj3i1lzr60rnybnvzja37x6xgyjvxgf165sa"))))))
409
410(define-public slurm-23.11 (make-slurm slurm-minimal-23.11))
411
412(define-public slurm-minimal-22.05
413 (package
414 (inherit slurm-minimal-23.11)
415 (version "22.05.1")
416 (source (origin
417 (inherit (package-source slurm-minimal-23.11))
418 (method url-fetch)
419 (uri (string-append
420 "https://download.schedmd.com/slurm/slurm-"
421 version ".tar.bz2"))
422 (patches '()) ;drop 'salloc' patch
423 (sha256
424 (base32
425 "0f3hhlki8g7slllsnyj1qikbsvr62i0hig85lcdcfnmsagzlhbyi"))))))
426
427(define-public slurm-22.05 (make-slurm slurm-minimal-22.05))
428
429(define-public slurm-drmaa
430 (package
431 (name "slurm-drmaa")
432 (version "1.1.5")
433 (source (origin
434 (method url-fetch)
435 (uri (string-append
436 "https://github.com/natefoo/slurm-drmaa/releases/download/"
437 version "/slurm-drmaa-" version ".tar.gz"))
438 (sha256
439 (base32
440 "1vydd44wp1xns7dd6zh7yin7i5p0ia3x2bk7ql56wfzhi22yf9sd"))
441 (patches (search-patches "slurm-drmaa-25.patch"))
442 (modules '((guix build utils)))
443 (snippet
444 ;; This is a typo fixed in upstream commit
445 ;; d4a43450a42b25c491217ed8b8e0af79a538c6e3
446 '(substitute* "slurm_drmaa/util.h"
447 (("slurmdrmaa__init") "slurmdrmaa_init")))))
448 (build-system gnu-build-system)
449 (arguments `(#:tests? #f)) ; The tests require "bats".
450 (inputs
451 (list slurm))
452 (native-inputs
453 (list which))
454 (home-page "https://github.com/natefoo/slurm-drmaa")
455 (synopsis "Distributed resource management application API for SLURM")
456 (description
457 "PSNC DRMAA for Simple Linux Utility for Resource Management (SLURM) is
458an implementation of Open Grid Forum DRMAA 1.0 (Distributed Resource
459Management Application API) specification for submission and control of jobs
460to SLURM. Using DRMAA, grid applications builders, portal developers and ISVs
461can use the same high-level API to link their software with different
462cluster/resource management systems.")
463 (license license:gpl3+)))
464
465(define-public python-pathos
466 (package
467 (name "python-pathos")
468 (version "0.3.4")
469 (source
470 (origin
471 (method url-fetch)
472 (uri (pypi-uri "pathos" version))
473 (sha256
474 (base32 "0m077iw5fml4r7csgi4j7ngvdmg1y9jxly64gi56argq1qnr3m5s"))))
475 (build-system pyproject-build-system)
476 (arguments
477 (list
478 #:phases
479 #~(modify-phases %standard-phases
480 (replace 'check
481 ;; XXX: Tests freeze when invoked with Pytest directly, this step
482 ;; is taken from project's tox.ini.
483 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
484 (when tests?
485 (invoke "python" "./pathos/tests/__main__.py")))))))
486 (native-inputs
487 (list python-setuptools))
488 (propagated-inputs
489 (list python-dill
490 python-multiprocess
491 python-pox
492 python-ppft))
493 (home-page "https://pypi.org/project/pathos/")
494 (synopsis
495 "Parallel graph management and execution in heterogeneous computing")
496 (description
497 "Python-pathos is a framework for heterogeneous computing. It provides a
498consistent high-level interface for configuring and launching parallel
499computations across heterogeneous resources. Python-pathos provides
500configurable launchers for parallel and distributed computing, where each
501launcher contains the syntactic logic to configure and launch jobs in an
502execution environment.")
503 (license license:bsd-3)))
504
505(define-public python-ppft
506 (package
507 (name "python-ppft")
508 (version "1.7.7")
509 (source
510 (origin
511 (method url-fetch)
512 (uri (pypi-uri "ppft" version))
513 (sha256
514 (base32
515 "15hvw39m2r3chm8zbqgkld0m1cl049rxidln4a6jnk72rx479xzk"))))
516 (build-system pyproject-build-system)
517 (arguments
518 (list
519 #:phases
520 #~(modify-phases %standard-phases
521 (replace 'check
522 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
523 (when tests?
524 (invoke "python" "./ppft/tests/__main__.py")))))))
525 (native-inputs
526 (list python-setuptools))
527 (home-page "https://pypi.org/project/ppft/")
528 (synopsis "Fork of Parallel Python")
529 (description
530 "This package is a fork of Parallel Python. The Parallel Python
531module (@code{pp}) provides an easy and efficient way to create
532parallel-enabled applications for @dfn{symmetric multiprocessing} (SMP)
533computers and clusters. It features cross-platform portability and dynamic
534load balancing.")
535 (license license:bsd-3)))
536
537(define-public python-schwimmbad
538 (package
539 (name "python-schwimmbad")
540 (version "0.4.2")
541 (source
542 (origin
543 (method url-fetch)
544 (uri (pypi-uri "schwimmbad" version))
545 (sha256
546 (base32 "1aac1rswb0r0vzbxvjj2jyx5j0vqyjj7mygc71n9zbkpmr8m1rpg"))))
547 (build-system pyproject-build-system)
548 (propagated-inputs
549 (list python-dill
550 python-joblib
551 python-mpi4py
552 python-multiprocess))
553 (native-inputs
554 (list python-hatch-vcs python-hatchling python-pytest))
555 (home-page "https://github.com/adrn/schwimmbad")
556 (synopsis "Common interface for parallel processing pools")
557 (description
558 "@code{schwimmbad} provides a uniform interface to parallel processing
559pools and enables switching easily between local development (e.g., serial
560processing or with @code{multiprocessing}) and deployment on a cluster or
561supercomputer (via, e.g., MPI or JobLib).")
562 (license license:expat)))
563
564(define-public pthreadpool
565 ;; This repository has only one tag, 0.1, which is older than what users
566 ;; such as XNNPACK expect.
567 (let ((commit "560c60d342a76076f0557a3946924c6478470044")
568 (version "0.1")
569 (revision "3"))
570 (package
571 (name "pthreadpool")
572 (version (git-version version revision commit))
573 (home-page "https://github.com/Maratyszcza/pthreadpool")
574 (source (origin
575 (method git-fetch)
576 (uri (git-reference (url home-page) (commit commit)))
577 (file-name (git-file-name name version))
578 (sha256
579 (base32
580 "0l82ix1h8pmjikf15bvmlap355gmyfjpahmgz4lbd6g40ab3ls5c"))
581 (patches (search-patches "pthreadpool-system-libraries.patch"))))
582 (build-system cmake-build-system)
583 (arguments '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
584 (inputs
585 (list googletest-1.12 googlebenchmark fxdiv))
586 (synopsis "Efficient thread pool implementation")
587 (description
588 "The pthreadpool library implements an efficient and portable thread
589pool, similar to those implemented by OpenMP run-time support libraries for
590constructs such as @code{#pragma omp parallel for}, with additional
591features.")
592 (license license:bsd-2))))
593
594(define-public cpuinfo
595 ;; There's currently no tag on this repo.
596 (let ((revision "8")
597 (commit "84818a41e074779dbb00521a4731d3e14160ff15"))
598 (package
599 (name "cpuinfo")
600 (version (git-version "0.0" revision commit))
601 (home-page "https://github.com/pytorch/cpuinfo")
602 (source (origin
603 (method git-fetch)
604 (uri (git-reference (url home-page) (commit commit)))
605 (file-name (git-file-name name version))
606 (sha256
607 (base32
608 "16mjs2ii45vzjm5fd98698gjfx7fmx2brgwcca03405la9wdyykr"))))
609 (build-system cmake-build-system)
610 (arguments
611 (list
612 ;; cpuinfo does not work in the build container for aarch64:
613 ;; https://github.com/pytorch/cpuinfo/issues/143
614 #:tests? (not (or (target-aarch64?)
615 (target-riscv64?)))
616 #:configure-flags
617 #~(list "-DBUILD_SHARED_LIBS=ON"
618 "-DUSE_SYSTEM_LIBS=ON")))
619 (inputs
620 (list googletest googlebenchmark))
621 (native-inputs
622 (list python-setuptools python-wrapper))
623 (synopsis "C/C++ library to obtain information about the CPU")
624 (description
625 "The cpuinfo library provides a C/C++ and a command-line interface to
626obtain information about the CPU being used: supported instruction set,
627processor name, cache information, and topology information.")
628 (license license:bsd-2))))
629
630(define-public clog
631 (package
632 (inherit cpuinfo) ;distributed with cpuinfo but not built by it
633 (name "clog")
634 (source (origin
635 (inherit (package-source cpuinfo))
636 (patches (search-patches "clog-fix-shared-build.patch"))))
637 (arguments
638 (list
639 #:configure-flags
640 ''("-DBUILD_SHARED_LIBS=ON"
641 "-DUSE_SYSTEM_LIBS=ON")
642 #:phases #~(modify-phases %standard-phases
643 (add-after 'unpack 'chdir
644 (lambda _
645 (chdir "deps/clog"))))))
646 (native-inputs (list googletest-1.8))
647 (inputs '())
648 (synopsis "C-style logging library based on printf")
649 (description
650 "This package provides a C-style library for logging errors,
651warnings, information notes, and debug information. Its features are:
652@itemize
653@item printf-style interface for formatting variadic parameters.
654@item Separate functions for logging errors, warnings, information notes, and
655debug information.
656@item Independent logging settings for different modules.
657@item Logging to logcat on Android and stderr/stdout on other platforms.
658@item Compatible with C99 and C++.
659@item Covered with unit tests.
660@end itemize")))
661
662(define-public psimd
663 ;; There is currently no tag in this repo.
664 (let ((commit "072586a71b55b7f8c584153d223e95687148a900")
665 (version "0.0")
666 (revision "1"))
667 (package
668 (name "psimd")
669 (version (git-version version revision commit))
670 (home-page "https://github.com/Maratyszcza/Psimd")
671 (source (origin
672 (method git-fetch)
673 (uri (git-reference (url home-page) (commit commit)))
674 (file-name (git-file-name name version))
675 (sha256
676 (base32
677 "16mslhvqs0gpqbg7kkq566a8gkn58cgjpqca8ljj9qcv5mk9apwm"))))
678 (build-system cmake-build-system)
679 (arguments '(#:tests? #f)) ;there are no tests
680 (synopsis "Portable 128-bit SIMD intrinsics")
681 (description
682 "This header-only C++ library provides a portable interface to
683single-instruction multiple-data (SIMD) intrinsics.")
684 (license license:expat))))
685
686(define-public openpmix
687 (package
688 (name "openpmix")
689 (version "6.1.0")
690 (source (origin
691 (method git-fetch)
692 (uri (git-reference
693 (url "https://github.com/openpmix/openpmix")
694 (commit (string-append "v" version))
695 (recursive? #t))) ;for the M4 macros in 'config/oac'
696 (file-name (git-file-name name version))
697 (sha256
698 (base32
699 "1sj4hqnbis0a8466qv47fp9ii6akvbl6n9scha0hg9cpljk6kif0"))))
700 (build-system gnu-build-system)
701 (arguments
702 (list
703 #:configure-flags
704 #~(list "--enable-python-bindings") ;disabled by default
705
706 ;; Don't keep a reference to GCC.
707 #:disallowed-references (and (not (%current-target-system))
708 (list (canonical-package gcc)))
709 #:phases
710 #~(modify-phases %standard-phases
711 (replace 'bootstrap
712 (lambda _
713 (for-each patch-shebang
714 (cons "autogen.pl" (find-files "config")))
715 (invoke "./autogen.pl")))
716 (add-after 'unpack 'set-LDFLAGS
717 (lambda _
718 ;; The Cython-compiled shared library would fail the
719 ;; validate-runpath phase otherwise.
720 (setenv "LDFLAGS"
721 (string-append "-Wl,-rpath=" #$output "/lib"))))
722 (add-before 'configure 'strip-pmix-cc-absolute
723 (lambda _
724 ;; The 'pmix_info' program prints the 'configure' command line,
725 ;; compiler absolute file name, etc., which causes it to keep
726 ;; references to many build-time packages. Scrub these.
727 (substitute* "configure"
728 (("PMIX_CC_ABSOLUTE=\"(.*)\"" _ cc)
729 (string-append "PMIX_CC_ABSOLUTE=\"$(basename \""
730 cc "\")\"\n")))))
731 (add-after 'configure 'strip-pmix-config-header
732 (lambda _
733 (substitute* "src/include/pmix_config.h"
734 (("#define PMIX_CONFIGURE_CLI .*")
735 "#define PMIX_CONFIGURE_CLI \"[scrubbed]\"\n")))))))
736 (inputs (list libevent `(,hwloc "lib") munge zlib))
737 (native-inputs
738 (list autoconf
739 automake
740 libtool
741 perl
742 flex
743 python
744 python-cython
745 python-setuptools))
746 (synopsis "PMIx library")
747 (description
748 "PMIx is an application programming interface standard that provides
749libraries and programming models with portable and well-defined access to
750commonly needed services in distributed and parallel computing systems.")
751 (home-page "https://openpmix.org/")
752 ;; configure: WARNING: PMIx does not support 32 bit builds.
753 (supported-systems %64bit-supported-systems)
754 ;; The provided license is kind of BSD-style but specific.
755 (license (license:fsf-free "https://github.com/openpmix/openpmix?tab=License-1-ov-file#License-1-ov-file"))))
756
757(define-public openpmix-5
758 (package
759 (inherit openpmix)
760 (name "openpmix")
761 (version "5.0.10")
762 (source (origin
763 (method git-fetch)
764 (uri (git-reference
765 (url "https://github.com/openpmix/openpmix")
766 (commit (string-append "v" version))
767 (recursive? #t))) ;for the M4 macros in 'config/oac'
768 (file-name (git-file-name name version))
769 (sha256
770 (base32
771 "0m1zg6bgrbchpfvcvhiznpb5bk98lm0vfxrac08kghldjw4dkc4b"))))
772 (arguments
773 (substitute-keyword-arguments arguments
774 ((#:configure-flags flags #~'())
775 #~(list (string-append "--with-hwloc="
776 (ungexp (this-package-input "hwloc") "lib"))
777 "--enable-python-bindings"))))))
778
779;; 2026-06-25
780(define-deprecated-package openpmix-4 openpmix-5)
781
782(define-public prrte
783 (package
784 (name "prrte")
785 (version "4.1.0")
786 (source (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/openpmix/prrte")
790 (commit (string-append "v" version))
791 (recursive? #t))) ;for the M4 macros in 'config/oac'
792 (file-name (git-file-name name version))
793 (sha256
794 (base32
795 "0f40hpppvfcc2ckryb1v6wckjqw6j0480dmixrf0ip69mcb9vv8l"))
796 (modules '((guix build utils)))
797 (snippet
798 ;; Prevent 'autogen.pl' from running 'git submodule'.
799 #~(substitute* "autogen.pl"
800 (("-f \".gitmodules\"")
801 "0")))))
802 (build-system gnu-build-system)
803 (arguments
804 (list #:configure-flags
805 #~(list "--disable-static")
806
807 #:phases
808 #~(modify-phases %standard-phases
809 (add-after 'unpack 'remove-absolute-references
810 (lambda _
811 ;; Remove references to GCC, the shell, etc. (shown by
812 ;; 'prte_info') to reduce the closure size.
813 (substitute* "config/prte_setup_cc.m4"
814 (("AC_SUBST\\(PRTE_CC_ABSOLUTE\\)")
815 (string-append
816 "PRTE_CC_ABSOLUTE=\"$(basename $PRTE_CC_ABSOLUTE)\"\n"
817 "AC_SUBST([PRTE_CC_ABSOLUTE])\n")))
818 (substitute* "configure.ac"
819 (("PRTE_CAPTURE_CONFIGURE_CLI\\(\\[PRTE_CONFIGURE_CLI\\]\\)"
820 all)
821 (string-append
822 "dnl " all "\n"
823 "PRTE_CONFIGURE_CLI=\"[elided to reduce closure]\"\n"
824 "AC_SUBST([PRTE_CONFIGURE_CLI])\n"
825 "AC_DEFINE_UNQUOTED([PRTE_CONFIGURE_CLI],"
826 " [\"$PRTE_CONFIGURE_CLI\"],"
827 " [Capture the configure cmd line])\n")))))
828 (replace 'bootstrap
829 (lambda _
830 (for-each patch-shebang
831 (cons "autogen.pl" (find-files "config")))
832 (invoke "./autogen.pl")))
833 (add-after 'unpack 'patch-prted-reference
834 (lambda _
835 ;; Record the absolute file name of 'prted' instead of
836 ;; assuming it will be found in $PATH at run time.
837 (substitute* "src/runtime/prte_mca_params.c"
838 (("prte_launch_agent =.*")
839 (string-append "prte_launch_agent = \""
840 #$output "/bin/prted\";\n")))))
841 (add-after 'install 'adjust-pcc-link
842 (lambda* (#:key inputs #:allow-other-keys)
843 ;; Adjust the 'pcc' symlink to its points to 'pmixcc' using
844 ;; its absolute file name instead of just 'pmixcc'.
845 (let* ((pcc (string-append #$output "/bin/pcc"))
846 (target (string-append "/bin/" (readlink pcc))))
847 (delete-file pcc)
848 (symlink (search-input-file inputs target)
849 pcc)))))
850
851 #:disallowed-references (list (canonical-package gcc))))
852 (inputs (list libevent
853 `(,hwloc "lib")
854 openpmix
855 libnl))
856 (native-inputs
857 (list autoconf
858 automake
859 flex
860 libtool
861 perl
862 pkg-config
863 python)) ;for 'prte-convert-help.py'
864 (synopsis "PMIx Reference RunTime Environment (PRRTE)")
865 (description
866 "The PMIx Reference RunTime Environment is a runtime environment
867containing the reference implementation and capable of operating
868within a host SMS. The reference RTE therefore provides an easy way of
869exploring PMIx capabilities and testing PMIx-based applications
870outside of a PMIx-enabled environment.")
871 (home-page "https://openpmix.github.io/")
872 ;; The provided license is kind of BSD-style but specific.
873 (license (license:fsf-free "https://github.com/openpmix/prrte?tab=License-1-ov-file#License-1-ov-file"))))
874
875(define-public python-simple-slurm
876 (package
877 (name "python-simple-slurm")
878 (version "0.3.6")
879 (source (origin
880 (method git-fetch)
881 (uri (git-reference
882 (url "https://github.com/amq92/simple_slurm")
883 (commit (string-append "v" version))))
884 (file-name (git-file-name name version))
885 (sha256
886 (base32
887 "1vfbd8rp4qd9375f2v26dm99c53jc3x3dpcllz812ly964qi7rnd"))))
888 (build-system pyproject-build-system)
889 (arguments
890 (list
891 #:test-flags
892 #~(list
893 ;; these tests need slurm installed
894 "--deselect=test/test_cli.py::Testing::test_01_using_equal"
895 "--deselect=test/test_cli.py::Testing::test_02_using_spaces"
896 "--deselect=test/test_cli.py::Testing::test_03_using_equal_and_spaces"
897 "--deselect=test/test_core.py::Testing::test_14_srun_returncode"
898 "--deselect=test/test_core.py::Testing::test_15_sbatch_execution"
899 "--deselect=test/test_core.py::Testing::test_19_sbatch_execution_with_job_file"
900 "--deselect=test/test_core.py::Testing::test_22_parsable_sbatch_execution")
901 #:phases
902 #~(modify-phases %standard-phases
903 (add-after 'unpack 'hardcode-sbatch-and-srun-command
904 (lambda* (#:key inputs #:allow-other-keys)
905 (substitute* "simple_slurm/core.py"
906 (("\"sbatch\"")
907 (string-append "\"" (search-input-file inputs "/bin/sbatch") "\""))
908 (("\"srun\"")
909 (string-append "\"" (search-input-file inputs "/bin/srun") "\""))))))))
910 (native-inputs (list python-setuptools python-pytest))
911 (inputs (list slurm))
912 (home-page "https://github.com/amq92/simple_slurm")
913 (synopsis "Simple Python wrapper for Slurm with flexibility in mind")
914 (description
915 "This package provides a simple Python wrapper for Slurm with flexibility in
916mind.")
917 (license license:agpl3)))