mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: reimplement Foam::dlOpen() for macOS (#2801)
- The Apple SIP (System Integrity Protection) clears environment
variables, which affects the behaviour of dynamic library loading
(the DYLD_LIBRARY_PATH env variable).
OpenFOAM shadows this variable as FOAM_LD_LIBRARY_PATH, which has
been used to restore DYLD_LIBRARY_PATH (eg, in RunFunctions script).
However, this solution is not quite complete, as it
(a) requires sourcing of RunFunctions file,
(b) additional errors appear depending on a user workflow.
This changeset alleviates the problem by also iterating through
paths stored in the shadow variable when loading dynamic libraries
(if the DYLD_LIBRARY_PATH is empty).
This commit is contained in:
committed by
Mark Olesen
parent
83b1ebee6f
commit
f584ec97d0
@ -23,13 +23,6 @@
|
||||
# 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() {
|
||||
|
||||
Reference in New Issue
Block a user