Skip to content

Update pybind11 to v2.7.1

Tobias Leibner requested to merge pybind11_2.7.1 into master

This MR updates pybind11 to version 2.7.1, and includes some minor backwards-compatible changes to support DUNE 2.8.

The update of pybind11 is also necessary to support DUNE 2.8, since the old version gave broken LTO flags in combination with DUNE 2.8 (no clue why).

Unfortunately, pybind11 v2.7.1 significantly changes the CMake setup, which made our copied CMake functions incompatible with the new pybind11 version. In order to avoid copying a lot of CMake code over from pybind11, I changed the setup to include pybind11 as a subdirectory such that we only need to copy and adapt the `pybind11_add_module`` function. As a consequence, in dune-gdt, we have to include the line

add_subdirectory(${dune-xt_MODULE_PATH}/../../pybind11 ${CMAKE_CURRENT_BINARY_DIR}/pybind11)

However, this significantly simplifies the setup, and should simplify updating pybind11 in the future. Please have a look at the CMake changes, @ag-ohlberger/rene.fritze @falbr_01, I am open to suggestion how to improve that setup.

Merge request reports