signalflow icon indicating copy to clipboard operation
signalflow copied to clipboard

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

Open ideoforms opened this issue 4 years ago • 2 comments

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 avatar May 03 '21 16:05 ideoforms

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

Symbol not found: _PyCMethod_New

ideoforms avatar May 03 '21 16:05 ideoforms

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.

ideoforms avatar May 27 '23 17:05 ideoforms