Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I'm the cadabra2 port maintainer for MacPorts. The update to version has caused an issue: Rather than picking up the MacPorts version of Python (it was set to 3.11 for the previous release, but should be updated to version 3.12, as that's now default), the cmake script picks up the macOS version instead (on my Ventura system, that would be 3.9.6). I can properly set -DPYTHON_LIBRARIES and -DPYTHON_SITE_PATH, but I don't see a way of choosing the path to the python binary.

in Installation trouble by (120 points)

Did this happen with just the change from -> ?

I mostly use whatever pybind11 offers in terms of finding Python, and that may well have a way to set the location of the Python binary. I'll have a look.

The current version on MacPorts is Somehow, I never saw that was released.

So the breaking change is relative to upgraded pybind11, which uses the new (well) FindPython logic in cmake. Does anything in https://cmake.org/cmake/help/latest/module/FindPython.html help? (e.g. setting Python_ROOT_DIR?)

No, setting Python_ROOT_DIR didn't help. Never mind, that it wouldn't neccesarily pick the correct version, as multiple versions of Python may be installed in /opt/local/bin. Unfortunately, it also ignores Python_EXECUTABLE and adds it to the warning about unused cmake variables:

CMake Warning:
  Manually-specified variables were not used by the project:


Found it! As we're not using the MacPorts version of pybind11, I had to set -DPYBIND11_PYTHON_VERSION to correctly set the python version.

After that, all built correctly.

Good to hear. As always, if there's anything that I can add to the main repo to make your life easier, let me know. And thanks for packaging this, I will add a bit about macports to the downloads page to point people in the right direction.

Please log in or register to answer this question.