Detecting CrayPrgEnv CMAKE_CXX_COMPILER_WRAPPER
It appears there are two dimensions of variability that affect the preprocessor macros defined by a CrayPE-wrapped compiler:
- The platform the compiler is running on (CrayXC, CrayXE, Apollo80, etc.)
- The compiler that is being wrapped (Cray, Intel, GNU, etc.)
In ages past, CMake checked for the platform macros (__CRAYXC
, __CRAYXE
, etc.). This is nice because these macros are defined no matter which compiler CrayPE is wrapping. But it's not so nice when we have a new platform (e.g. Apollo80), and CMake stops setting CMAKE_CXX_COMPILER_WRAPPER
correctly because it isn't checking for the macro for that new platform. This was the subject of !5561 (merged).
But the venerable !5561 (merged) neglected to account for variability in the wrapped compiler. It only checked for macros defined when CrayPE wraps the Cray compiler, leaving the Intel and GNU compilers non-functional. And thus, #21894 (closed) was born.
And now our heroes quest to find a new macro which will transcend both the platform and the wrapped compiler, to reliably detect the CrayPrgEnv wrapper for all platforms, for all compilers, and for all time!