Currently, The user of an OpenMP application needs to set LD_LIBRARY_PATH to the directory
that contains the offload plugins. This change adds the rpath for OpenMP applications.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Using -rpath by default with OpenMP was removed after a long conversation in https://reviews.llvm.org/D143306. The way forward is most likely to have AOMP provide this in a resource file configuration. I think @ronlieb has a working version of that.
Sorry Greg, we can't have this back in trunk. It's now value add for the ROCm toolchain, and some llvm releases had this feature, but no longer.
The consensus in the OpenMP weekly meeting was to require users to hack around with linker flags or environment variables to get a working program. This makes Fedora's packaging scripts happy.
I do not like this but was comprehensively outvoted.
Its ugly, but to avoid requirement to set LD_LIBRARY_PATH for end-users who may need LD_LIBRARY_PATH for their own application, we will modify the compiler installation with these bash commands where _INSTALL_DIR is the installation directory.
echo "-Wl,-rpath=${_INSTALL_DIR}/lib" > ${_INSTALL_DIR}/bin/rpath.cfg echo "-L${_INSTALL_DIR}/lib" >> ${_INSTALL_DIR}/bin/rpath.cfg ln -sf rpath.cfg ${_INSTALL_DIR}/bin/clang++.cfg ln -sf rpath.cfg ${_INSTALL_DIR}/bin/clang.cfg ln -sf rpath.cfg ${_INSTALL_DIR}/bin/flang.cfg ln -sf rpath.cfg ${_INSTALL_DIR}/bin/flang-new.cfg
My apologies to linux distro packaging teams.
clang-format not found in user’s local PATH; not linting file.