CONFIG: reinstate FOAM_LD_LIBRARY_PATH adjustments (#2801)

- the special MacOS dlopen handling (commit f584ec97d0)
  did not fully solve the problem with SIP clearing.

  Eg, sourcing the RunFunctions (for runParallel) triggers SIP and
  clears DYLD_LIBRARY_PATH. With the cleared path it finds the dummy
  libraries: the dummy Pstream::init() fails.
This commit is contained in:
Mark Olesen 2023-06-26 09:16:09 +02:00
parent c3660b4123
commit b264d2e913
4 changed files with 18 additions and 4 deletions

View File

@ -23,6 +23,13 @@
# If dispatching via foamExec
foamExec="$WM_PROJECT_DIR/bin/tools/foamExec"
# Darwin workaround - SIP clearing DYLD_LIBRARY_PATH variable
if [ -n "$FOAM_LD_LIBRARY_PATH" ] && [ -z "$DYLD_LIBRARY_PATH" ]
then
export DYLD_LIBRARY_PATH="$FOAM_LD_LIBRARY_PATH"
fi
#------------------------------------------------------------------------------
usage() {

View File

@ -25,6 +25,13 @@
# Basic sanity checks
[ -d "$FOAM_TUTORIALS" ] || echo "No OpenFOAM tutorials? : $FOAM_TUTORIALS" 1>&2
# Darwin workaround - SIP clearing DYLD_LIBRARY_PATH variable
if [ -n "$FOAM_LD_LIBRARY_PATH" ] && [ -z "$DYLD_LIBRARY_PATH" ]
then
export DYLD_LIBRARY_PATH="$FOAM_LD_LIBRARY_PATH"
fi
#------------------------------------------------------------------------------
#

View File

@ -189,8 +189,8 @@ if ($?DYLD_LIBRARY_PATH) then
if ("${DYLD_LIBRARY_PATH}" == "") unsetenv DYLD_LIBRARY_PATH
endif
# Remove any shadow env variables
unsetenv FOAM_DYLD_LIBRARY_PATH FOAM_LD_LIBRARY_PATH
# Remove shadow env variables
unsetenv FOAM_LD_LIBRARY_PATH
#------------------------------------------------------------------------------
# Cleanup aliases

View File

@ -173,8 +173,8 @@ fi
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
[ -n "$DYLD_LIBRARY_PATH" ] || unset DYLD_LIBRARY_PATH
# Remove any shadow env variables
unset FOAM_DYLD_LIBRARY_PATH FOAM_LD_LIBRARY_PATH
# Remove shadow env variables
unset FOAM_LD_LIBRARY_PATH
#------------------------------------------------------------------------------
# Cleanup aliases and functions