You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'make check' can be made to work on a Mac but it's hard.
Several issues get in the way:
pip doesn't work with the default system python because of openssl issues (don't know
when that stopped working).
it's common to have several versions of python but they have to be installed outside of
/usr/bin and /usr/lib where the system python lives.
the CMAKE find_package(PythonLibs) is not reliable. It may find /usr/lib/libpython2.7.dylib
(i.e., the system version) instead of the version one actually wants.
The only way I got it to work is by finding the right library and forcing cmake to use it:
But in general on a Mac you do not want to be using the system python, especially since you need to install some extra packages. I currently can't do a make check on my python2 machine.
No problems on my python3 machine. I will update once I solve this.
On my other laptop, where I only have a brew version of python3 the make check worked out of the box, once I ported the libpoly/python and libpoly/tests to python3.
I have a couple of loose ends to tie up today, but I should be able to make a pull request with the port shortly.
And for contrast, without specifying the PYTHON_LIBRARY and PYTHON_INCLUDE_DIR, it
finds a python and dynamic library that don't match and the make check crashes with
Fatal Python error: PyThreadState_Get: no current thread
I will look into the what happens to people who try and use the system python (contrary to Apple's advice), once the port is over.
-- Found PythonInterp: /usr/local/opt/python@2/bin/python (found version "2.7.16")
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.16")
Activity
dddejan commentedon Apr 19, 2018
Yes, python seems to be a mess on Mac.
ianamason commentedon Sep 25, 2019
But in general on a Mac you do not want to be using the system python, especially since you need to install some extra packages. I currently can't do a
make checkon my python2 machine.No problems on my python3 machine. I will update once I solve this.
ianamason commentedon Sep 26, 2019
After a
and a
I did
and
make checksucceeded without any failures.On my other laptop, where I only have a brew version of
python3themake checkworked out of the box, once I ported thelibpoly/pythonandlibpoly/teststo python3.I have a couple of loose ends to tie up today, but I should be able to make a pull request with the port shortly.
BrunoDutertre commentedon Sep 26, 2019
Make sure it works for people who don't use brew.
ianamason commentedon Sep 26, 2019
And for contrast, without specifying the
PYTHON_LIBRARYandPYTHON_INCLUDE_DIR, itfinds a python and dynamic library that don't match and the
make checkcrashes withI will look into the what happens to people who try and use the system python (contrary to Apple's advice), once the port is over.
dddejan commentedon Sep 26, 2019
I tried some cmake hack. Can you guys check if this works.
ianamason commentedon Sep 26, 2019
OK will try out now ...
Nope:
dddejan commentedon Sep 27, 2019
But does it crash? (
Fatal Python error: PyThreadState_Get: no current thread)ianamason commentedon Sep 27, 2019
Amazing! No it doesn't crash. What sort of magic is this?
ianamason commentedon Sep 27, 2019
OK after my beach walk I will pull this into my python3 branch and see if it works there too.
ianamason commentedon Sep 27, 2019
facebook magic :-(
dddejan commentedon Sep 27, 2019
Ok, so I changed cmake to do the following:
use the interpreter to get the headers locationThis doesn't work, reverted.ianamason commentedon Sep 27, 2019
So it works on my python3 port. Why do we need the PythonLibs stuff still?