-
Notifications
You must be signed in to change notification settings - Fork 26
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
Broken Conda macOS Python interpreter #292
Comments
Okay, the problem is that, as @chryswoods mentions here, To see this we can create our own Python interpreter with a static link of $HOME/sire.app/bin/x86_64-conda_cos6-linux-gnu-g++ test.cpp -I $HOME/sire.app/include/python3.7m -I $HOME/sire.app/include -L $HOME/sire.app/lib $HOME/sire.app/lib/libpython3.7m.a -lrt -lpthread -lm -ldl -lutil -o $HOME/sire.app/bin/test_python Then move to the install directory: cd $HOME/sire.app/bin Launch the interpreter: ./test_python Import Sire: import Sire Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Sire
[1] 13662 segmentation fault (core dumped) ./test_python Previously we fixed this by using a Miniconda that came with a macOS Python interpreter that predated the change to static linking (I think version 3.5). However, it looks like the Python version has got updated along the way (which led to the initial appearance of the segmentation fault) and we have since updated the Miniconda version anyway. For the source and binary package we could solve this problem by symlinking |
We've already implemented a supposed solution in the if (APPLE)
# Also need to add '-undefined dynamic_lookup' so that we can build
# modules that can be imported by a python that has statically linked libPython
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -undefined dynamic_lookup" )
endif() I assume that we are somehow still linking to |
(This is a known issue and, at present, I'm not sure what we can do about it. I'm just documenting it here for posterity. References to issues can be found here and here.)
The current macOS Python 3.7 interpreter from the
conda-forge
channel does not work with Sire, which segmentation faults on import. Importing Sire works fine using the bundledsire_python
interpreter, with the current macOS Python 3.7 and 3.7m interpreters from python.org, and with the simplest home-cooked Python interpreter that you can make, e.g.:Compile with:
Then launch the interpreter:
$HOME/sire.app/bin/test_python
Finally import Sire:
No errors. Ridiculous!
I'll post a report on
conda-forge
to see if they can figure out what aspect of their Python 3.7 build is causing the issue for us.The text was updated successfully, but these errors were encountered: