Add LLVM_DEFAULT_TARGET_TRIPLE to find new location of -lomp#839
Add LLVM_DEFAULT_TARGET_TRIPLE to find new location of -lomp#839estewart08 wants to merge 4 commits into
Conversation
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.
| if(LLVM_DEFAULT_TARGET_TRIPLE) | ||
| list( APPEND COMMON_LINK_LIBS "-L\"${HIP_CLANG_ROOT}/lib/${LLVM_DEFAULT_TARGET_TRIPLE}\"") | ||
| endif() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
TorreZuk
left a comment
There was a problem hiding this comment.
Okay, it is getting messy but acceptable I guess
daineAMD
left a comment
There was a problem hiding this comment.
CI looks happy with it, so fine by me.
|
Closed in favor of: #1038 |
Summary of proposed changes:
An upstream llvm change enables
LLVM_ENABLE_PER_TARGET_RUNTIME_DIRby default for the openmpbuild. This installs the openmp libraries into
/opt/rocm-ver/llvm/lib/x86_64-unknown-linux-gnuinstead of/opt/rocm-ver/llvm/lib. Currenty, hipBLAS only looks in /lib. Prepend lib/x86_64-unknown-linux-gnu to-Land--rpathto avoid a linker error when the upstream change lands inamd-staging.