openPMD / openPMD-api

:floppy_disk: C++ & Python API for Scientific I/O
https://openpmd-api.readthedocs.io
GNU Lesser General Public License v3.0
134 stars 51 forks source link

Python: Fix ODR Violation #1521

Closed ax3l closed 10 months ago

ax3l commented 10 months ago

In pybind11 (and nanobind), auxiliary headers and PYBIND11_MAKE_OPAQUE definitions for distributed modules need to be included in every translation unit. Otherwise, a one-definition-rule violation occurs, which is undefined behavior.

Introduces a common Python helper header that must be used in all Python-binding related .cpp files.