ideoforms / signalflow

A sound synthesis framework for Python, designed for clear and concise expression of complex musical ideas
https://signalflow.dev
MIT License
167 stars 14 forks source link

CMake selects the wrong Python version if a newer non-default install exists #84

Open ideoforms opened 3 years ago

ideoforms commented 3 years ago

On a system with two Python installs, in which the older of the two is the default, CMake will find and build with the newer (reported by kraysh). This causes run-time linking to fail. This bug is mentioned here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252277

CMake should be instructed to build with the default (i.e, whichever is symlinked by python3). There does not seem to currently be a way to do this, so the recommended fix is to delete the newer non-default version, or build and run from a virtualenv.

ideoforms commented 3 years ago

On a system with Python 3.8 and 3.9, this generates the error

Symbol not found: _PyCMethod_New
ideoforms commented 1 year ago

This is fixed for virtualenvs in the latest CMakeLists, by using Python_FIND_VIRTUALENV (available in CMake since version 3.15.0). Need to check whether this still affects non-virtualenv systems with multiple Python installs.