Skip to content

Commit eb4612c

Browse files
committed
[openmp] [test] Fix prepending config.library_dir to LD_LIBRARY_PATH
Fix the LD_LIBRARY_PATH prepending order to make sure that config.library_path ends up before any potentially-system directories (e.g. config.hwloc_library_dir). This makes sure that we are testing against the just-built openmp libraries rather than the version that is already installed. Also rename the function to `prepend_*` to make it clearer what it actually does. llvm/llvm-project#56821 Differential Revision: https://reviews.llvm.org/D130825
1 parent 37047a2 commit eb4612c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

openmp/runtime/test/lit.cfg

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if 'PYLINT_IMPORT' in os.environ:
1111
config = object()
1212
lit_config = object()
1313

14-
def append_dynamic_library_path(path):
14+
def prepend_dynamic_library_path(path):
1515
if config.operating_system == 'Windows':
1616
name = 'PATH'
1717
sep = ';'
@@ -65,10 +65,13 @@ for feature in config.test_compiler_features:
6565
config.available_features.add(feature)
6666

6767
# Setup environment to find dynamic library at runtime
68-
append_dynamic_library_path(config.library_dir)
6968
if config.using_hwloc:
70-
append_dynamic_library_path(config.hwloc_library_dir)
69+
prepend_dynamic_library_path(config.hwloc_library_dir)
7170
config.available_features.add('hwloc')
71+
# Note: please keep config.library_dir *after* any potentially system
72+
# directories, as otherwise preinstalled openmp libraries will be used
73+
# over just-built
74+
prepend_dynamic_library_path(config.library_dir)
7275

7376
# Rpath modifications for Darwin
7477
if config.operating_system == 'Darwin':

0 commit comments

Comments
 (0)