MueLu: Macro redefinition in ETI OFF build
Created by: mhoemmen
Sierra's Trilinos integration build reports the following error:
In file included from .../include/MueLu_ParameterListInterpreter.hpp:2:0, from .../include/MueLu_CreateTpetraPreconditioner.hpp:22,
from [some .cpp file]:
.../include/MueLu_ParameterListInterpreter_def.hpp:225:0: error: "MUELU_KOKKOS_FACTORY" redefined [-Werror]
#define MUELU_KOKKOS_FACTORY(varName, oldFactory, newFactory) \
^
In file included from .../include/MueLu_FactoryManager.hpp:2:0,
from .../include/MueLu_Hierarchy_decl.hpp:67,
from .../include/MueLu_Hierarchy.hpp:1,
from [same .cpp file as above]:
.../include/MueLu_FactoryManager_def.hpp:88:0: note: this is the location of the previous definition
#define MUELU_KOKKOS_FACTORY(varName, oldFactory, newFactory) \
I'm guessing that MueLu developers didn’t test with ETI (explicit template instantiation) on off [edited by jhux2].
Diagnostic: Both macro definitions occur in _def.hpp files, which normally aren’t exposed to each other in ETI=ON builds.
HAVE_MUELU_KOKKOS_REFACTOR
is undefined by default in both Trilinos’ CMake logic, and in Sierra’s Bjam logic for Trilinos. Thus, MueLu developers are seeing the same macro defines as Sierra.
@trilinos/muelu @jhux2
Possible Solution
Undefine MUELU_KOKKOS_FACTORY
before and after each use.