Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda-recipe: On OSX, the binary includes an extraneous LC_RPATH command #13

Open
stuarteberg opened this issue Aug 22, 2016 · 2 comments

Comments

@stuarteberg
Copy link
Contributor

stuarteberg commented Aug 22, 2016

(I'm just opening this issue here so I don't forget about it. You can probably stop reading.)

For some reason, the _nifty.so file produced by the conda recipe has an extra LC_RPATH that doesn't get properly cleaned up in the conda post-processing step. You can see it by inspecting the output of otool -l:

$ otool -l /miniconda2/envs/ilastik-new/lib/python2.7/site-packages/nifty/_nifty.so | grep -A 2 -B 1 LC_RPATH
Load command 17
          cmd LC_RPATH
      cmdsize 40
         path /miniconda2/envs/_build/lib (offset 12)
--
--
Load command 20
          cmd LC_RPATH
      cmdsize 40
         path @loader_path/../../../ (offset 12)

The second LC_RPATH entry is correct, but the first one (/miniconda2/envs/_build/lib) shouldn't be there. It references the _build environment on my machine. For most people, this will not cause any problems whatsoever. But if that directory happens to exist on your machine, then you'll get an error when you try to use nifty:

Fatal Python error: PyThreadState_Get: no current thread

That's because it's loading the wrong libpython2.7.dylib at runtime.

PS -- Note for mac users (okay, just me): diagnosing this issue was made easier with the DYLD_PRINT_RPATHS environment variable.

@DerThorsten
Copy link
Owner

Hi @stuarteberg,

I swichted to a new version of pybind11 which defines a cmake-function to add python modules.
This could change a lot (also this might undo some fixes...)

@stuarteberg
Copy link
Contributor Author

OK, thanks for the warning.

DerThorsten pushed a commit that referenced this issue Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants