mrklein / openfoam-os-x

Patches for OpenFOAM(R) to build it on OS X
93 stars 33 forks source link

El Capitan's SIP & foamJob #5

Closed mrklein closed 9 years ago

mrklein commented 9 years ago

Since (DY)LD_LIBRARY_PATH variables are suppressed from environment of protected executables (in this case protected executable is bash), cases, which load additional libraries, fail when started with foamJob.

Possible solutions:

  1. Reimplement foamJob in C/C++, for binary these environment variables won't be suppressed
  2. Export (DY)LD_LIBRARY_PATH before execution of the application (or just use foamExec in all cases)
mrklein commented 9 years ago

foamExec seems to resolve the issue:

    if [ "$screenOpt" = true ]
    then
        echo "Executing: $APPLICATION $(echoArgs "$@") | tee log &"
        foamExec $APPLICATION "$@" | tee log &
        wait $!
    else
        echo "Executing: $APPLICATION $(echoArgs "$@") > log 2>&1 &"
        foamExec $APPLICATION "$@" > log 2>&1 &
    fi