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