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 2.4.5.6 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 2.4.5.5 -> 2.4.5.6 ?

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 2.4.5.4. Somehow, I never saw that 2.4.5.5 was released.

So the breaking change is relative to 2.4.5.4.

2.4.5.5 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:

    BOOST_INCLUDE_DIR
    BOOST_LIBRARY_DIR
    BOOST_LIB_DIR
    CMAKE_OBJCXX_COMPILER
    CMAKE_OBJC_COMPILER
    CMAKE_POLICY_DEFAULT_CMP0025
    CMAKE_POLICY_DEFAULT_CMP0060
    Python_EXECUTABLE

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.

...