[petsc-dev] Mac OS X El Capitan does not propagate DYLD_LIBRARY_PATH from parent process

Andrs, David david.andrs at inl.gov
Wed Oct 7 15:50:56 CDT 2015


On Wed, Oct 7, 2015 at 2:32 PM, Jed Brown <jed at jedbrown.org> wrote:

> "Andrs, David" <david.andrs at inl.gov> writes:
> > ​It looks like it​ when the compiler is invoked from an interpreter (like
> > bash or python). If we run clang from the command line directly, it works
> > fine.
>
> From the documentation page, it sounds like
>
> DYLD_LIBRARY_PATH=x ./foo.py
>
> will not propagate the variable, but
>
> DYLD_LIBRARY_PATH=x /usr/bin/python foo.py
>
> will propagate it because /usr/bin/python is not a script (starting with
> #!).  Is this true?
>
>
> How are you invoking the compiler from Python?  (In particular, is
> Python calling execve directly or is it passing a command line to a
> shell to expand and execute?)
>

​Our binary links against libomp.dylib, but it is not linked with absolute
path, thus we need to set DYLD_LIBRARY_PATH. Running the binary from a
command line, all is fine, because the environment variable is set.

If we are trying to build PETSc (and I do not know how you guys are testing
that the complier works), it fails, because the build system no longer sees
the environment variable, because El Capitan removes that from the
environment of the child processes.

As I said before the fix here is to link libomp.dylib using the absolute
path, i.e. we need to do something on our end. It is not a bug in PETSc's
build system. I just wanted to give you guys a heads up, because some users
might run into a similar issue...

Hope that it is more clear,
--
​David​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151007/c2c139df/attachment.html>


More information about the petsc-dev mailing list