eigenpy icon indicating copy to clipboard operation
eigenpy copied to clipboard

Installed `eigenpyConfig.cmake` finds a different python executable version

Open jmirabel opened this issue 2 years ago • 8 comments

If I am not wrong, the version of the Python executable is not export and only the boost component (e.g. python38) contains some version information.

When installing it as a binary package from robotpkg, we hit a case where the python executable found by eigenpyConfig.cmake is Python 2.7 while we installed robotpkg-py38-eigenpy.

Shouldn't the version of the Python executable be stored in the Eigenpy cmake config file and used to find the correct python executable?

I know I can bypass this by setting manually the PYTHON_EXECUTABLE variable.

jmirabel avatar Dec 04 '23 08:12 jmirabel

I think you are right, and we should export this.

You can also bypass this with sudo apt install python-is-python3 , and/or sudo apt autoremove --purge \*python2\*. I'd recommend both :)

nim65s avatar Dec 04 '23 09:12 nim65s

I took a look at https://github.com/jrl-umi3218/jrl-cmakemodules/blob/master/python.cmake#L58, and sadly it seems that the arguments to FIND_PYTHON() macros are not used at all, and the documentation is wrong about the ability to use eg. FIND_PYTHON(3.8 EXACT REQUIRED) in eigenpyConfig.cmake

nim65s avatar Dec 04 '23 09:12 nim65s

If I'm not wrong I'm the one who wrote that. I'm 99% sure it did work when I wrote that.

jmirabel avatar Dec 04 '23 11:12 jmirabel

After double checking, yes, it was using FIND_PACKAGE(PythonInterp ${ARGN}), which isn't the case anymore.

jmirabel avatar Dec 04 '23 11:12 jmirabel

This is still in https://github.com/jrl-umi3218/jrl-cmakemodules/blob/master/python.cmake#L214, but only for CMake < 3.12, And we also enforce CMake >= 3.10.

nim65s avatar Dec 04 '23 11:12 nim65s

Still an issue @jmirabel?

jcarpent avatar Feb 11 '24 08:02 jcarpent

I don't think the issue has been resolved.

It would be cleaner to set the Python version in the export file but I would not mind if you prefer to close this. It is rather easy to bypass.

@nim65s a low effort solution would be to compare the Python version found with the exported compile-time Python version and just fail when they happen to be different.

jmirabel avatar Feb 12 '24 12:02 jmirabel

I still think we should set this version in the FINDPYTHON() call in eigenpyConfig.cmake, and fix the argument use of this FINDPYTHON() macro. I could work on this, but probably not this week

nim65s avatar Feb 12 '24 12:02 nim65s