diff options
| author | David Elsing <david.elsing@posteo.net> | 2026-02-03 21:33:21 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-02-10 23:46:33 +0100 |
| commit | dc52bfce99673366f06b633f8b677b2c15905366 (patch) | |
| tree | 11c89723889fef5eb4fcd488d5b6c8657bad3500 | |
| parent | 838a5a46ce5dd19359ff07c7275dfa74ab04fcdb (diff) | |
gnu: Add offload-rocm.
* gnu/packages/llvm.scm (offload-rocm): New variable.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | gnu/packages/llvm.scm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index e8fbbed4ed..b4b8e26f6f 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -2121,6 +2121,52 @@ existing compilers together.") (define-public clang-rocm-toolchain (make-clang-toolchain clang-rocm libomp-rocm)) +(define-public offload-rocm + (package + (name "offload-rocm") + (version (package-version llvm-rocm)) + (source (package-source llvm-rocm)) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list + "-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld" + "-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "offload"))) + (add-after 'chdir 'libffi-dynamic-link + (lambda _ + (substitute* "plugins-nextgen/host/CMakeLists.txt" + (("if\\(FFI_STATIC.*") "if(FALSE)\n")))) + (add-after 'install 'install-license + (lambda _ + (install-file "../LICENSE.TXT" + (string-append #$output "/share/doc/" + #$name "-" #$version))))) + ;; XXX: Tests cannot be built with ROCm version 7.1.1: + ;; https://github.com/ROCm/llvm-project/blob/27682a16360e33e37c4f3cc6adf9a620733f8fe1/offload/CMakeLists.txt#L443 + #:tests? #f)) + (native-inputs + (list clang-rocm-toolchain + lld-wrapper-rocm + python)) + (inputs + (list libffi + libomp-rocm + rocm-device-libs + rocr-runtime)) + (home-page "https://github.com/ROCm/llvm-project/") + (synopsis "LLVM offloading library") + (description "This LLVM component provides tooling, runtimes and APIs for +executing code on accelerators which may have a different architecture than +the host.") + ;; Apache license 2.0 with LLVM exception + (license license:asl2.0))) + (define-public include-what-you-use |
