etmc / tmLQCD

tmLQCD is a freely available software suite providing a set of tools to be used in lattice QCD simulations. This is mainly a HMC implementation (including PHMC and RHMC) for Wilson, Wilson Clover and Wilson twisted mass fermions and inverter for different versions of the Dirac operator. The code is fully parallelised and ships with optimisations for various modern architectures, such as commodity PC clusters and the Blue Gene family.
http://www.itkp.uni-bonn.de/~urbach/software.html
GNU General Public License v3.0
32 stars 47 forks source link

fix compilation on Hawk #477

Closed kostrzewa closed 3 years ago

kostrzewa commented 3 years ago

Using gcc 9.2.0 revealed some issues with circular dependencies in header files as well as problems dealing with manipulations that https://github.com/usqcd-software/c-lime does to preprocessor macros coming from its own AC_INIT and which are included via lime.h. (basically things like PACKAGE_VERSION are undef'ed).

I've cleaned up many of the include satements in the code and have attempted a workaround for the problem with c-lime.

kostrzewa commented 3 years ago

The problem is one of include order and what other autoconf-based packages do with defines like PACKAGE_VERSION. C-lime, for example, undefs these and then they are gone.

Now, one would think that one could simply include lime.h first and then tmlqcd_config.h, but unfortunately, that doesn't always help because tmlqcd_config.h might have been included somewhere, where lime.h was NOT included. As a result, _CONFIG_H is now defined. When the compiler then gets to a file wherelime.h is actually included, the PACKAGE_* definitions will be undeffed by lime.h and won't be available anymore.

Hence the deferral to an include file without header guards and the redefinition.