espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
226 stars 183 forks source link

Add prefix to preprocessor macros #4974

Open jngrad opened 1 month ago

jngrad commented 1 month ago

ESPResSo uses a myconfig.hpp containing preprocessor macros like CUDA, P3M, MASS, FFTW. These macros prevent us from using similarly named classes and enum values. For a concrete example, when including header files from PyTorch, which define a CUDA enum value, we can only compile ESPResSo by introducing #undef CUDA.

We need to add an ESPRESSO_ prefix to all our preprocessor macros. This is the solution used by Boost and waLBerla.

This change will break all existing myconfig files, unless we can figure out a way to post-process the myconfig file in Python, like we do with external features, which are preprocessor macros generated by CMake and post-processed by Python.