Problem building Panda on Mac with Python3 from Homebrew

On my quest to make double precision wheels of Panda, I’m struggling build Panda on MacOS using Python3 from Homebrew.

I get several errors : if I do anything makepanda does not find libpython3.7m, if I follow Installing Panda3D on a Mac with Python 3.4? it builds partially, but fails later as there are unresolved symbols in pzip, …

Looking at the buildbot script for mac os I don’t see anything specific (and seeing that the python interpreter used to launch the build is /usr/local/bin/python I guess it’s also using Homebrew), there is also https://github.com/panda3d/panda3d/pull/263 but it seems invasive.

So, what is the recommended way ?

The unresolved symbols in pzip sounds like you may be referring to this problem:

It is caused by using thirdparty packages that are compiled against an older macOS SDK.

Ah, I missed that one :slight_smile: Which is exactly the problem I’m having with pzip, thanks!

It builds fine now, however the *.so libraries (core.so, direct.so, …) are not present in the generated wheel

Actually makewheel.py looks for files ending with “.cpython-37m-darwin.so” however makepanda.py generates simple “.so” files.

Nota: To be able to build I modified the line 2161 from :

elif GetTarget() == 'darwin':

to :

elif False:

But I don’t see why it should impact the suffix of the generated libraries.

Actually it’s worse than that, the files under built/panda3d were files from an older build, after cleaning and rebuilding all, the directory is empty and there is no core.so (or any variant) built anywhere.

Did you build with Python bindings enabled? Did the makepanda output say anything about not building with Python support enabled?

ah right that make more sense, I built with --everything and I saw “Using Python 3.7” but I overlooked the warning a dozen lines later :

WARNING: Could not locate thirdparty package python, excluding from build

I guess I’m back to square one to indicate to makepanda where my version of Python resides, I though the modification in SdkLocatePython() would be enough.

With the following command (and the test still deactivated in makepanda.py) it starts building with python enabled :

makepanda/makepanda.py --everything --wheel --threads 4 --osxtarget=10.7 --python-incdir  /usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/include --python-libdir  /usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib

And the build is successful and the wheel is working :slight_smile: