Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LLVM_DEFAULT_TARGET_TRIPLE to find new location of -lomp #839

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

estewart08
Copy link
Contributor

Summary of proposed changes:
An upstream llvm change enables LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default for the openmp
build. This installs the openmp libraries into /opt/rocm-ver/llvm/lib/x86_64-unknown-linux-gnu instead of
/opt/rocm-ver/llvm/lib. Currenty, hipBLAS only looks in /lib. Prepend lib/x86_64-unknown-linux-gnu to -L and --rpath to avoid a linker error when the upstream change lands in amd-staging.

An upstream llvm change enables
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default for the openmp
build. This installs the openmp libraries into
/opt/rocm-ver/llvm/lib/x86_64-unknown-linux-gnu instead of
/opt/rocm-ver/llvm/lib. Currenty, hipBLAS only looks in /lib.
Prepend lib/x86_64-unknown-linux-gnu to -L and --rpath to avoid
linker error.
Comment on lines +128 to +130
if(LLVM_DEFAULT_TARGET_TRIPLE)
list( APPEND COMMON_LINK_LIBS "-L\"${HIP_CLANG_ROOT}/lib/${LLVM_DEFAULT_TARGET_TRIPLE}\"")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume you have no way to add this into OpenMP::OpenMP_CXX as that would be cleaner approach. I thought we were moving to use /bin/amdclang as well. Otherwise appears fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The find_package(OpenMP) is actually using FindOpenMP.cmake from the cmake install itself. From what I have seen, it is finding libgomp.so from a system package and not ROCm. Passing a custom CMAKE_PREFIX_PATH will not work either for this as they turn off these search paths in FindOpenMP.cmake. This is probably why the -L /lib had to be added in the first place. The openmp install does not have a config file to query either.

As far as using amdclang, I can make that change.

Copy link
Contributor

@TorreZuk TorreZuk left a comment

Choose a reason for hiding this comment

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

Okay, it is getting messy but acceptable I guess

@estewart08 estewart08 closed this Apr 9, 2024
@estewart08 estewart08 deleted the llvm-enable-per-target-runtime-dir branch April 9, 2024 22:19
@estewart08 estewart08 restored the llvm-enable-per-target-runtime-dir branch April 23, 2024 16:42
@estewart08 estewart08 reopened this Apr 23, 2024
Copy link
Contributor

@daineAMD daineAMD left a comment

Choose a reason for hiding this comment

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

CI looks happy with it, so fine by me.

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.

3 participants