Skip to content

Commit 970ea81

Browse files
Lutz Grossclaude
andcommitted
Also rpath <prefix>/lib so configure tests find libomp/libgomp
The previous commit baked <prefix>/lib/esys as the only RPATH, but scons configure tests (e.g. "working complex std::acos") execute small test programs that need to dlopen libomp.dylib / libgomp.so. Those libs live in <prefix>/lib (not <prefix>/lib/esys), so the probes crashed with "Library not loaded: @rpath/libomp.dylib" on osx and silently fell back to the boost std::acos implementation. Add <prefix>/lib as a second -rpath entry so the configure tests work, and so the runtime keeps working even if conda-forge ever ships an llvm-openmp with an @rpath install_name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 59f63f8 commit 970ea81

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

SConstruct

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,14 @@ if not env['IS_WINDOWS']:
621621
# having to set LD_LIBRARY_PATH or DYLD_LIBRARY_PATH. conda-build's
622622
# post-processing rewrites the absolute prefix to a relative
623623
# $ORIGIN / @loader_path expression at install time.
624+
# Also keep <prefix>/lib on the search path so scons configure tests
625+
# (which exec() small @rpath-style test programs) can dlopen
626+
# libomp / libgomp / boost / etc.
624627
_libesys = os.path.join(env['prefix'], 'lib', 'esys')
625-
env.AppendUnique(SHLINKFLAGS = ["-Wl,-rpath," + _libesys])
626-
env.AppendUnique(LINKFLAGS = ["-Wl,-rpath," + _libesys])
628+
_libdir = os.path.join(env['prefix'], 'lib')
629+
_rpaths = ["-Wl,-rpath," + _libesys, "-Wl,-rpath," + _libdir]
630+
env.AppendUnique(SHLINKFLAGS = _rpaths)
631+
env.AppendUnique(LINKFLAGS = _rpaths)
627632

628633
if env['build_trilinos'] != 'never':
629634
if not os.path.isdir(env['trilinos_build']): # create a build folder if the user deleted it

0 commit comments

Comments
 (0)