[llvm-branch-commits] [openmp] 96a26d9 - [openmp] [test] Fix prepending config.library_dir to LD_LIBRARY_PATH
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 2 21:34:32 PDT 2022
Author: Michał Górny
Date: 2022-08-02T21:29:50-07:00
New Revision: 96a26d96c7d468af4dde717827365e5eeb5e289d
URL: https://github.com/llvm/llvm-project/commit/96a26d96c7d468af4dde717827365e5eeb5e289d
DIFF: https://github.com/llvm/llvm-project/commit/96a26d96c7d468af4dde717827365e5eeb5e289d.diff
LOG: [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.
https://github.com/llvm/llvm-project/issues/56821
Differential Revision: https://reviews.llvm.org/D130825
(cherry picked from commit eb4612ca239bffbf1612e0bce442043e716bb9f5)
Added:
Modified:
openmp/runtime/test/lit.cfg
Removed:
################################################################################
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 76727f3ed5287..b000787409ef6 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -11,7 +11,7 @@ if 'PYLINT_IMPORT' in os.environ:
config = object()
lit_config = object()
-def append_dynamic_library_path(path):
+def prepend_dynamic_library_path(path):
if config.operating_system == 'Windows':
name = 'PATH'
sep = ';'
@@ -65,10 +65,13 @@ for feature in config.test_compiler_features:
config.available_features.add(feature)
# Setup environment to find dynamic library at runtime
-append_dynamic_library_path(config.library_dir)
if config.using_hwloc:
- append_dynamic_library_path(config.hwloc_library_dir)
+ prepend_dynamic_library_path(config.hwloc_library_dir)
config.available_features.add('hwloc')
+# Note: please keep config.library_dir *after* any potentially system
+# directories, as otherwise preinstalled openmp libraries will be used
+# over just-built
+prepend_dynamic_library_path(config.library_dir)
# Rpath modifications for Darwin
if config.operating_system == 'Darwin':
More information about the llvm-branch-commits
mailing list