>From 67a59e734dd451d1e64d450dcebeb23d60996f3e Mon Sep 17 00:00:00 2001 From: Dave Love Date: Mon, 31 Jul 2017 14:58:39 +0100 Subject: [PATCH] gnu: hwloc: Replace "lib" output with "nogui", containing all but lstopo. A compute node typically wants the non-GUI programs available, which still have a small closure. * mpi.scm (hwloc)[outputs]: Replace lib with nogui. (hwloc)[arguments]: Change configure --prefix; use "nogui" output, not "lib"; populate "all" output. (openmpi)[inputs]: Use hwloc-nogui. --- gnu/packages/mpi.scm | 44 ++++++++++++++++++++++++++++++-------------- gnu/packages/parallel.scm | 2 +- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm index 385f9985a..66ffd7bdd 100644 --- a/gnu/packages/mpi.scm +++ b/gnu/packages/mpi.scm @@ -39,6 +39,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages valgrind)) +;; Fixme: Replace hwloc-dump-hwdata.service with shepherd equivalent (define-public hwloc (package (name "hwloc") @@ -53,7 +54,7 @@ "0acph1mf7588hfx8ds26ncr6nw5fd9x92adm11fwin7f93i10sdb")))) (build-system gnu-build-system) (outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc. - "lib" ;small closure + "nogui" ;small closure "debug")) (inputs `(("libx11" ,libx11) @@ -71,27 +72,42 @@ (native-inputs `(("pkg-config" ,pkg-config))) (arguments - `(#:configure-flags '("--localstatedir=/var") + `(#:configure-flags (list "--localstatedir=/var" + (string-append "--prefix=" + (assoc-ref %outputs "nogui"))) #:phases (modify-phases %standard-phases (add-after 'install 'refine-libnuma ;; Give -L arguments for libraries to avoid propagation (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "lib")) - (numa (assoc-ref inputs "numactl"))) - (substitute* (map (lambda (f) (string-append out "/" f)) + (let ((out (assoc-ref outputs "out")) + (numa (assoc-ref inputs "numactl")) + (nogui (assoc-ref outputs "nogui"))) + (substitute* (map (lambda (f) (string-append nogui "/" f)) '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la")) (("-lnuma" lib) (string-append "-L" numa "/lib " lib)))))) - (add-after 'install 'avoid-circular-references + (add-after 'install 'move-lstopo (lambda* (#:key outputs #:allow-other-keys) - (let ((lib (assoc-ref outputs "lib"))) - ;; Suppress the 'prefix=' and 'exec_prefix=' lines so that the - ;; "lib" output doesn't refer to "out". - (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc") - (("^.*prefix=.*$") - "")) - #t)))))) + (let* ((out (assoc-ref outputs "out")) + (nogui (assoc-ref outputs "nogui")) + (binout (string-append out "/bin")) + (appsout (string-append out "/share/applications")) + (man1out (string-append out "/share/man/man1"))) + (mkdir-p binout) + (mkdir-p appsout) + (mkdir-p man1out) + (and + (delete-file (string-append nogui "/share/man/man1/lstopo.1")) + (copy-file + (string-append nogui "/share/man/man1/lstopo-no-graphics.1") + (string-append man1out "/lstopo.1")) + (zero? + (system (format #f "mv ~a/bin/lstopo ~a" nogui binout))) + (zero? + (system + (format #f "mv ~a/share/applications/lstopo.desktop ~a" + nogui appsout)))))))))) (home-page "https://www.open-mpi.org/projects/hwloc/") (synopsis "Abstraction of hardware architectures") (description @@ -123,7 +139,7 @@ bind processes, and much more.") "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0")))) (build-system gnu-build-system) (inputs - `(("hwloc" ,hwloc "lib") + `(("hwloc" ,hwloc "nogui") ("gfortran" ,gfortran) ("valgrind" ,valgrind))) (native-inputs diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 179fa7ed3..c320dfa62 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -113,7 +113,7 @@ and they are executed on lists of files, hosts, users or other items.") ;; in particular mysql and gtk+. (inputs `(("expect" ,expect) ("freeipmi" ,freeipmi) - ("hwloc" ,hwloc "lib") + ("hwloc" ,hwloc "nogui") ("json-c" ,json-c) ("linux-pam" , linux-pam) ("munge" ,munge) -- 2.11.0