hal icon indicating copy to clipboard operation
hal copied to clipboard

FindPythonInterp is deprecated, use FindPython3 instead [fixed in new HAL version 4.0]

Open RenWal opened this issue 2 years ago • 5 comments

The following line causes a cmake failure on my Ubuntu 20.04 machine: https://github.com/emsec/hal/blob/5e004f6010a9e690b56fe02b54f38a970f8fa5f9/cmake/detect_dependencies.cmake#L148

"Dual stack" python installs, i.e. having both python2 and python3 installed, will trigger this if the system's default python points to python2.

For this reason, as of cmake 3.12, FindPython3 should be used instead of FindPythonInterp.

RenWal avatar Oct 14 '21 09:10 RenWal

(The same goes for deps/pybind11 which still has the deprecated CMakeLists)

RenWal avatar Oct 14 '21 09:10 RenWal

As someone who just had the issue, one can work around this by using the cmake option

-DPYTHON_EXECUTABLE=`which python3` 

suzizecat avatar Nov 26 '21 20:11 suzizecat

@RenWal could you prepare a Pull Request?

nils1603 avatar Dec 01 '21 13:12 nils1603

Can someone from your team point out whether there's anything that prevents updating pybind to a version that doesn't use deprecated CMake? (And while we're at it – it looks like you have the entire pybind repo verbatim inside your git repository. Don't know if @swallat still manages your build system; have you considered making this a git submodule, as is recommended by the pybind maintainers? This would make managing such dependencies easier.)

RenWal avatar Dec 04 '21 09:12 RenWal

The pybind version has been updated to 2.9. We also fixed the python3 include if both python2.7 and python3 are installed. This will be merged into the master with the new HAL v4.0. Note that we will not include pybind as a git submodule, since these create more problems for beginners. We will keep the static dependency.

https://github.com/emsec/hal/tree/v4.0.0

nils1603 avatar Jan 10 '22 10:01 nils1603

This has been merged, closing.

RenWal avatar Oct 17 '22 15:10 RenWal