projects/guix·blob mpd-fix-groups · refs

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