C++ compilation error mingw
If one compiles with mingw under windows, by default, the include of cmath does not define pi values. This leads to a problem in the header https://gitlab.cern.ch/lthiele/BLonD/-/blob/master/blond/cpp_routines/vdtcore_common.h?ref_type=heads#L33 and the following definitions of MI_PI_4. On Linux, these definitions get automatically made. Therefore one should be able to include the
The issue can be fixed by including cflags += ['-Wall', '-Wno-unknown-pragmas', "-D_USE_MATH_DEFINES"]
in the compile script. This enforces the definition of the math variables as soon as the first cmath gets included.
More reading under https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170