From 2c9f5ce1ee8d9decffcb7e5f95e0d3a5087becf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= Date: Mon, 27 Apr 2026 15:14:08 +0200 Subject: [PATCH] gnu: rocm-smi-lib: Move Python modules to separate 'bin' output. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/rocm.scm (rocm-smi-lib): Move Python modules to separate 'bin' output. [phases]: Replace 'chdir' phase with 'setup' phase. [configure-flags]: Adjust CMAKE variables to split package output. * gnu/packages/rocm-libs.scm (hipblaslt): [inputs]: Add both outputs of `rocm-smi-lib'. Fixes: #7285 Change-Id: Id5ce15454cf239dd7c6836b172224ae309df81d4 Signed-off-by: Ludovic Courtès Merges: #8185 --- gnu/packages/rocm-libs.scm | 1 + gnu/packages/rocm.scm | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gnu/packages/rocm-libs.scm b/gnu/packages/rocm-libs.scm index e4f04ef1645..da8b406762f 100644 --- a/gnu/packages/rocm-libs.scm +++ b/gnu/packages/rocm-libs.scm @@ -430,6 +430,7 @@ troubleshooting issues impacting AMD GPUS in HPC environments.") msgpack-cxx rocm-hip-runtime rocm-smi-lib + `(,rocm-smi-lib "bin") rocm-toolchain roctracer)) (native-inputs diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index 99d930c67d0..fc519c6c6d3 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -809,14 +809,29 @@ scatter operations.") (list #:tests? #f ; requires GPU #:build-type "Release" + #:configure-flags + #~(list (string-append "-DCMAKE_INSTALL_LIBEXECDIR=" + #$output:bin "/lib") + (string-append "-DCMAKE_INSTALL_BINDIR=" + #$output:bin "/bin")) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'chdir + (add-after 'unpack 'setup (lambda _ - (chdir "projects/rocm-smi-lib")))))) + (chdir "projects/rocm-smi-lib") + ;; Remove relative prefix so 'CMAKE_INSTALL_LIBEXECDIR' can be + ;; an absolute path, that allows pointing it to a different + ;; output in the store, such as `#$output:bin'. + (substitute* "rocm_smi/CMakeLists.txt" + (("../(\\$\\{CMAKE_INSTALL_LIBEXECDIR\\}/\\$\\{ROCM_SMI\\}/rocm_smi.py)" _ suffix) + suffix))))))) (native-inputs (list pkg-config)) (inputs (list libdrm python)) (propagated-inputs (list grep coreutils)) + ;; The 'bin' output will store Python utilities in order to reduce the + ;; closure size size of the package. That way the 'out' output will not + ;; depend on Python. + (outputs '("out" "bin")) (home-page %rocm-systems-url) (synopsis "The ROCm System Management Interface (ROCm SMI) Library") (description "The ROCm System Management Interface Library, or