Skip to content

Commit 0979ea9

Browse files
committed
[OpenMP][Docs] Add documentation for using configuration files
We recently reverted a patch that automatically set the rpath on OpenMP executables. This was used because the `libomptarget.so` library is only expected to work with the same version of compiler that will be using it. This patch adds some documentation for how to get similar behaviour as before using a clang configuration file. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D147943
1 parent 08c472f commit 0979ea9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

openmp/docs/SupportAndFAQ.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,18 @@ The compiled executable is dynamically linked against a host runtime, e.g.
168168
are found like any other dynamic library, by setting rpath or runpath on the
169169
executable, by setting ``LD_LIBRARY_PATH``, or by adding them to the system search.
170170

171-
``libomptarget.so`` has rpath or runpath (whichever the system default is) set to
172-
``$ORIGIN``, and the plugins are located next to it, so it will find the plugins
173-
without any environment variables set. If ``LD_LIBRARY_PATH`` is set, whether it
174-
overrides which plugin is found depends on whether your system treats ``-Wl,-rpath``
175-
as RPATH or RUNPATH.
171+
``libomptarget.so`` is only supported to work with the associated ``clang``
172+
compiler. On systems with globally installed ``libomptarget.so`` this can be
173+
problematic. For this reason it is recommended to use a `Clang configuration
174+
file <https://clang.llvm.org/docs/UsersManual.html#configuration-files>`__ to
175+
automatically configure the environment. For example, store the following file
176+
as ``openmp.cfg`` next to your ``clang`` executable.
177+
178+
.. code-block:: text
179+
180+
# Library paths for OpenMP offloading.
181+
-L '<CFGDIR>/../lib'
182+
-Wl,-rpath='<CFGDIR>/../lib'
176183
177184
The plugins will try to find their dependencies in plugin-dependent fashion.
178185

0 commit comments

Comments
 (0)