CMake finds python2 on Ubuntu
I notice
-- Found PythonInterp: /usr/bin/python (found version "2.7.18")
-- Found PYTHON_EXECUTABLE=/usr/bin/python
-- Python version 2.7.18
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found version "3.8.10")
-- Found PYTHON_INCLUDE_DIRS=/usr/include/python3.8
-- Found PYTHON_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.8.so
that's bound to give problems.
Originally posted by @KrisThielemans in https://github.com/SyneRBI/SIRF-SuperBuild/issues/623#issuecomment-961969788
That's a known problem. In the VM we specify those https://github.com/SyneRBI/SIRF-SuperBuild/blob/448356272bf150846115daeafe55a2e600c1a1cd/VirtualBox/scripts/UPDATE.sh#L145-L146
and use them as https://github.com/SyneRBI/SIRF-SuperBuild/blob/448356272bf150846115daeafe55a2e600c1a1cd/VirtualBox/scripts/UPDATE.sh#L191-L206
I thought of adding version info, but https://cmake.org/cmake/help/latest/module/FindPythonInterp.html claims that might not help either. We really need to move to find_package(python) #313. Of course, that won't solve #624
I think modern Ubuntu, later than 22.04, do not ship with python2 and this issue can be closed, @KrisThielemans ?
Sure. it's the same for different versions of Python 3 of course, but there's nothing we can do about that, except tell the user to specify their python executable.