Archived
1
0
Fork 0

gnu: slurm: Use gexps and remove input labels.

* gnu/packages/parallel.scm (slurm)[source]: Remove trailing #t.
[native-inputs]: Remove labels.
[arguments]: Rewrite as gexps.  Use 'this-package-input' instead of
'%build-inputs'.
(slurm-20.02)[arguments]: Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2022-03-08 18:11:31 +01:00
parent d3a7cd7acf
commit d80c722034
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -38,6 +38,7 @@
#:use-module ((guix utils) #:select (target-64bit?)) #:use-module ((guix utils) #:select (target-64bit?))
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
@ -164,93 +165,88 @@ when jobs finish.")
(define-public slurm (define-public slurm
(package (package
(name "slurm") (name "slurm")
(version "20.11.7") (version "20.11.7")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"https://download.schedmd.com/slurm/slurm-" "https://download.schedmd.com/slurm/slurm-"
version ".tar.bz2")) version ".tar.bz2"))
(sha256 (sha256
(base32 (base32
"1fdjihg1x7ks5l77yjv14a4mg6r0v8c3zk1dcxkhrhq3n4dc9nbs")) "1fdjihg1x7ks5l77yjv14a4mg6r0v8c3zk1dcxkhrhq3n4dc9nbs"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
;; According to ;; According to
;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html> ;; <https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00534.html>
;; there are non-free bits under contribs/, though it's not ;; there are non-free bits under contribs/, though it's not
;; clear which ones. libpmi is clearly free (it used to be ;; clear which ones. libpmi is clearly free (it used to be
;; under src/api/), so remove all of contribs/ except ;; under src/api/), so remove all of contribs/ except
;; contribs/pmi/. ;; contribs/pmi/.
(substitute* "configure.ac" (substitute* "configure.ac"
(("^[[:space:]]+contribs/(.*)$" all directory) (("^[[:space:]]+contribs/(.*)$" all directory)
(if (and (string-prefix? "pmi" directory) (if (and (string-prefix? "pmi" directory)
(not (string-prefix? "pmi2" directory))) (not (string-prefix? "pmi2" directory)))
all all
""))) "")))
(rename-file "contribs/pmi" "tmp-pmi") (rename-file "contribs/pmi" "tmp-pmi")
(delete-file-recursively "contribs") (delete-file-recursively "contribs")
(mkdir "contribs") (mkdir "contribs")
(rename-file "tmp-pmi" "contribs/pmi") (rename-file "tmp-pmi" "contribs/pmi")))))
#t)))) ;; FIXME: More optional inputs could be added,
;; FIXME: More optional inputs could be added, ;; in particular mysql and gtk+.
;; in particular mysql and gtk+. (inputs (list freeipmi
(inputs (list freeipmi `(,hwloc-2 "lib")
`(,hwloc-2 "lib") json-c
json-c linux-pam
linux-pam munge
munge numactl
numactl readline))
readline)) (native-inputs
(native-inputs (list autoconf expect perl pkg-config python-wrapper))
`(("autoconf" ,autoconf) (build-system gnu-build-system)
("expect" ,expect) (arguments
("perl" ,perl) (list #:configure-flags
("pkg-config" ,pkg-config) #~(list "--enable-pam" "--sysconfdir=/etc/slurm"
("python" ,python-wrapper))) "--disable-static"
(build-system gnu-build-system) (string-append "--with-freeipmi=" #$(this-package-input "freeipmi"))
(arguments (string-append "--with-hwloc=" #$(this-package-input "hwloc"))
`(#:configure-flags (string-append "--with-json=" #$(this-package-input "json-c"))
(list "--enable-pam" "--sysconfdir=/etc/slurm" (string-append "--with-munge=" #$(this-package-input "munge"))
"--disable-static"
(string-append "--with-freeipmi=" (assoc-ref %build-inputs "freeipmi"))
(string-append "--with-hwloc=" (assoc-ref %build-inputs "hwloc"))
(string-append "--with-json=" (assoc-ref %build-inputs "json-c"))
(string-append "--with-munge=" (assoc-ref %build-inputs "munge"))
;; 32-bit support is marked as deprecated and needs to be ;; 32-bit support is marked as deprecated and needs to be
;; explicitly enabled. ;; explicitly enabled.
,@(if (target-64bit?) '() '("--enable-deprecated"))) #$@(if (target-64bit?) '() '("--enable-deprecated")))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-plugin-linker-flags (add-after 'unpack 'patch-plugin-linker-flags
(lambda _ (lambda _
(substitute* (find-files "src/plugins/" "Makefile.in") (substitute* (find-files "src/plugins/" "Makefile.in")
(("_la_LDFLAGS = ") (("_la_LDFLAGS = ")
"_la_LDFLAGS = ../../../api/libslurm.la ")))) "_la_LDFLAGS = ../../../api/libslurm.la "))))
(add-after 'patch-plugin-linker-flags 'autoconf (add-after 'patch-plugin-linker-flags 'autoconf
(lambda _ (invoke "autoconf"))) ;configure.ac was patched (lambda _ (invoke "autoconf"))) ;configure.ac was patched
(add-after 'install 'install-libpmi (add-after 'install 'install-libpmi
(lambda _ (lambda _
;; Open MPI expects libpmi to be provided by Slurm so install it. ;; Open MPI expects libpmi to be provided by Slurm so install it.
(invoke "make" "install" "-C" "contribs/pmi")))))) (invoke "make" "install" "-C" "contribs/pmi"))))))
(home-page "https://slurm.schedmd.com/") (home-page "https://slurm.schedmd.com/")
(synopsis "Workload manager for cluster computing") (synopsis "Workload manager for cluster computing")
(description (description
"SLURM is a fault-tolerant and highly scalable cluster management and job "SLURM is a fault-tolerant and highly scalable cluster management and job
scheduling system for large and small clusters. It allocates access to scheduling system for large and small clusters. It allocates access to
resources (computer nodes) to users for some duration of time, provides a resources (computer nodes) to users for some duration of time, provides a
framework for starting, executing, and monitoring work (typically a parallel framework for starting, executing, and monitoring work (typically a parallel
job) on a set of allocated nodes, and arbitrates contention for resources job) on a set of allocated nodes, and arbitrates contention for resources
by managing a queue of pending work.") by managing a queue of pending work.")
(license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash (license (list license:bsd-2 ; src/common/log.[ch], src/common/uthash
license:expat ; slurm/pmi.h license:expat ; slurm/pmi.h
license:isc ; src/common/strlcpy.c license:isc ; src/common/strlcpy.c
license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h license:lgpl2.1+ ; hilbert.[ch], src/common/slurm_time.h
license:zlib ; src/common/strnatcmp.c license:zlib ; src/common/strnatcmp.c
license:gpl2+)))) ; the rest, often with OpenSSL exception license:gpl2+)))) ; the rest, often with OpenSSL exception
;; The SLURM client/daemon protocol and file format changes from time to time ;; The SLURM client/daemon protocol and file format changes from time to time
;; in incompatible ways, as noted in ;; in incompatible ways, as noted in
@ -275,8 +271,8 @@ by managing a queue of pending work.")
(arguments (arguments
(substitute-keyword-arguments (package-arguments slurm) (substitute-keyword-arguments (package-arguments slurm)
((#:configure-flags flags ''()) ((#:configure-flags flags ''())
`(append '("CFLAGS=-O2 -g -fcommon" "LDFLAGS=-fcommon") #~(append '("CFLAGS=-O2 -g -fcommon" "LDFLAGS=-fcommon")
,flags)))))) #$flags))))))
(define-public slurm-19.05 (define-public slurm-19.05
(package (package