Skip to content

runpath - OpenMP temp fix#371

Merged
kiritigowda merged 1 commit intoROCm:developfrom
kiritigowda:kg/openmp-temp-fix
Aug 20, 2025
Merged

runpath - OpenMP temp fix#371
kiritigowda merged 1 commit intoROCm:developfrom
kiritigowda:kg/openmp-temp-fix

Conversation

@kiritigowda
Copy link
Collaborator

Motivation

OpenMP link creates an unsafe runpath -- temp fix for mainline till the issue is resolved with OpenMP -- enable rocAL on RHEL 10

Technical Details

Linking AMD OpenMP to any downstream application creates a runpath which has relative path

Problem

Relative runpaths are deemed unsafe and fails packaging in RHEL 10 or newer

ERROR   0010: file '/opt/rocm/lib/librpp.so.2.0.0' contains an empty runpath in [:/opt/rocm-6.5.0/lib/llvm/bin/../lib]
ERROR   0020: file '/opt/rocm/lib/librpp.so.2.0.0' contains a runpath referencing '..' of an absolute path [:/opt/rocm-6.5.0/lib/llvm/bin/../lib]
error: Bad exit status from /var/tmp/rpm-tmp.LmQSKp (%install)
   Bad exit status from /var/tmp/rpm-tmp.LmQSKp (%install)

Fix for a similar issue in LLVM / AMD LLVM

llvm/llvm-project#143792

Reproduce issue using AMD OpenMP sample

https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/openmp.html#ompt-target-support

cd $ROCM_PATH/share/openmp-extras/examples/tools/ompt/veccopy-ompt-target-tracing
sudo make run
readelf -d veccopy-ompt-target-tracing

Output

readelf -d veccopy-ompt-target-tracing
 
Dynamic section at offset 0x5ae8 contains 27 entries:
  Tag        Type                         Name/Value
0x000000000000001d (RUNPATH)            Library runpath: [/opt/rocm-7.1.0/lib/llvm/bin/../lib:/opt/rocm-7.1.0/lib/llvm/bin/../../../lib]

Test Plan

Build in RHEL 10

Test Result

rocAL Package created using RPM

Submission Checklist

@kiritigowda kiritigowda self-assigned this Aug 19, 2025
@kiritigowda kiritigowda requested a review from rrawther as a code owner August 19, 2025 22:19
@kiritigowda kiritigowda changed the title runpath - Fix for mainline runpath - OpenMP temp fix Aug 19, 2025
@kiritigowda kiritigowda requested a review from Copilot August 19, 2025 22:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses an unsafe runpath issue created by AMD OpenMP linking that prevents packaging in RHEL 10. The fix involves modifying the CMake configuration to use OpenMP libraries directly instead of the OpenMP target, and setting an explicit RPATH to avoid relative path references.

  • Replaced OpenMP::OpenMP_CXX target with ${OpenMP_CXX_LIBRARIES} to avoid unsafe runpath generation
  • Added explicit RPATH configuration using $ORIGIN references
  • Commented out the OpenMP CXX flags setting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #371      +/-   ##
===========================================
- Coverage    80.82%   80.81%   -0.00%     
===========================================
  Files          272      272              
  Lines        20915    20915              
===========================================
- Hits         16903    16902       -1     
- Misses        4012     4013       +1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kiritigowda kiritigowda merged commit 974b49b into ROCm:develop Aug 20, 2025
10 checks passed
@kiritigowda kiritigowda deleted the kg/openmp-temp-fix branch August 20, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants