SIRF-SuperBuild icon indicating copy to clipboard operation
SIRF-SuperBuild copied to clipboard

CMake finds python2 on Ubuntu

Open KrisThielemans opened this issue 4 years ago • 2 comments

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

KrisThielemans avatar Nov 06 '21 09:11 KrisThielemans

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

paskino avatar Nov 08 '21 13:11 paskino

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

KrisThielemans avatar Nov 08 '21 14:11 KrisThielemans

I think modern Ubuntu, later than 22.04, do not ship with python2 and this issue can be closed, @KrisThielemans ?

paskino avatar Mar 11 '25 13:03 paskino

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.

KrisThielemans avatar Mar 11 '25 14:03 KrisThielemans