Skip to content

Update cmake and scripts in preparation for LLVM_ENABLE_PER_TARGET_RU… - #1301

Merged
estewart08 merged 7 commits into
masterfrom
users/estewart/llvm-per-target-runtime-prep
Sep 2, 2026
Merged

estewart08 merged 7 commits into
masterfrom
users/estewart/llvm-per-target-runtime-prep

Conversation

@estewart08

@estewart08 estewart08 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

…NTIME_DIR

This will move libraries like libomp.so/libomptarget.so down one level into a clang target specific directory. For example: lib/llvm/lib/x86_64-unknown-linux-gnu.

  • Add RVS_LLVM_HOST_RUNTIME_DIR to INSTALL_RPATH
  • Add RVS_LLVM_HOST_RUNTIME_CORE_DIR to INSTALL_RPATH
  • Update LD_LIBRARY_PATH to include llvm host triple subdirectory for rvs_nightly_test.sh
  • Reorganize INSTALL_RPATH for readability.

Motivation

Prepare for LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON.

JIRA ID: ROCM-28648

Assisted by AI.

@estewart08
estewart08 force-pushed the users/estewart/llvm-per-target-runtime-prep branch 3 times, most recently from c03ad37 to 78969c3 Compare August 26, 2026 21:47
@estewart08

Copy link
Copy Markdown
Contributor Author

@estewart08
estewart08 force-pushed the users/estewart/llvm-per-target-runtime-prep branch from 5d3da95 to f9f34af Compare August 28, 2026 15:56
Comment thread CMakeLists.txt Resolved
@estewart08
estewart08 requested a review from frepaul August 28, 2026 18:05
estewart08 added a commit to ROCm/TheRock that referenced this pull request Aug 28, 2026
## Motivation
Add support to use LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON. This option is
currently disabled by default in ROCm. There is talk upstream of keeping
this ON by default and removing the option entirely. This also is a
prequel step to using multilib build variants for debug/asan libraries
for openmp/offload.

The layout change has broad ripple effects:

- Host runtimes such as libomp.so move from lib/llvm/lib/ into
lib/llvm/lib/\<host-triple\>/.
- Clang sanitizer runtimes may report a per-target directory that
contains only flang_rt, while compiler-rt remains under lib/linux.
- CI scripts, test harnesses, and Python wheel RPATH logic that assumed
the flat layout need updating.
- Downstream consumers (hipBLASLt, rocprofiler sidecars, RPP tests,
etc.) must resolve libomp.so from the new location.

Summary of areas changed:
- Compiler build: LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON; amd-llvm
provides openmp package
- Sanitizer / ASAN CI: Runtime dir derived dynamically from clang;
hard fail on unresolvable launcher
- Test harnesses: rocprofiler-systems, rocprofiler-sdk, and RPP
tests updated for host-triple runtime paths 
- Build deps / graph: mxDataGenerator wired to amd-llvm in
BUILD_DEPS and consumer graph
- Python wheels: Host-triple dir included in wheel RPATH

## Test Plan

Inspect current CI tests with my PR's modifications, which should not
show any issues loading libraries found in
lib/llvm/lib/x86_64-unknown-linux-gnu or
lib/clang/23/lib/x86_64-unknown-linux-gnu. This needs to include asan
builds.

ROCmValidationSuite (RVS) needs updated as well as the rvs binary uses
libomp.so:
ROCm/ROCmValidationSuite#1301

Fixes:
ISSUE ID: [#6801](#6801)

Partially AI Assisted

---------

Co-authored-by: Joao P. L. de Carvalho <joao.carvalho@amd.com>
Comment thread CMakeLists.txt Resolved
…NTIME_DIR

This will move libraries like libomp.so/libomptarget.so down one level
into a clang target specific directory. For example:
lib/llvm/lib/x86_64-unknown-linux-gnu.

- Add rvs_llvm_host_runtime_dir function to rvs_nightly_test.sh. This
verifies if the llvm runtimes are installed in the triple subdirectory.
- Add RVS_LLVM_HOST_RUNTIME_DIR to INSTALL_RPATH
- Add RVS_LLVM_HOST_RUNTIME_CORE_DIR to INSTALL_RPATH
- Update LD_LIBRARY_PATH to include llvm host triple subdirectory for rvs_nightly_test.sh
- Reorganize INSTALL_RPATH for readability.

JIRA ID: ROCM-28648
The script was checking on the orchestrator runner instead of the ssh
runner. This caused clang not to be found because the ROCm we are
interested in is on the ssh runner.
This was a bad conflict resolution and should not be a part of this patch.
@estewart08
estewart08 force-pushed the users/estewart/llvm-per-target-runtime-prep branch from 824f51c to 80b4a56 Compare September 1, 2026 16:28
@estewart08
estewart08 requested a review from frepaul September 1, 2026 18:30
@estewart08
estewart08 merged commit 72a59c4 into master Sep 2, 2026
8 of 9 checks passed
@estewart08
estewart08 deleted the users/estewart/llvm-per-target-runtime-prep branch September 2, 2026 14:53
frepaul pushed a commit that referenced this pull request Sep 11, 2026
#1301)

* Update cmake and scripts in preparation for LLVM_ENABLE_PER_TARGET_RUNTIME_DIR

This will move libraries like libomp.so/libomptarget.so down one level
into a clang target specific directory. For example:
lib/llvm/lib/x86_64-unknown-linux-gnu.

- Add rvs_llvm_host_runtime_dir function to rvs_nightly_test.sh. This
verifies if the llvm runtimes are installed in the triple subdirectory.
- Add RVS_LLVM_HOST_RUNTIME_DIR to INSTALL_RPATH
- Add RVS_LLVM_HOST_RUNTIME_CORE_DIR to INSTALL_RPATH
- Update LD_LIBRARY_PATH to include llvm host triple subdirectory for rvs_nightly_test.sh, rvs_pr_test.sh, rvs_release_test.sh
- Reorganize INSTALL_RPATH for readability.

JIRA ID: ROCM-28648

* Fix rvs_nightly_test.sh clang query for host triple

The script was checking on the orchestrator runner instead of the ssh
runner. This caused clang not to be found because the ROCm we are
interested in is on the ssh runner.

* Fix LLVM_HOST_RUNTIME_DIR detection

* Update rvs_pr_test.sh LD_LIBRARY_PATH with llvm host triple

* Update rvs_release_test.sh LD_LIBRARY_PATH with llvm host triple

* Restore sles/rpm changes to CMakeLists.txt

This was a bad conflict resolution and should not be a part of this patch.

* Reinstate /opt/rocm, /opt/rocm/core for RPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants