Removing -A from CMAKE_CXX_STANDARD_COMPILE_OPTION for PGI_CXX
Discussion for !5025 (merged).
The -A
flag, set by CMAKE_CXX11_STANDARD_COMPILE_OPTION
causes pgc++ to be very pedantic about certain code. An example is while building Trilinos's Muelu package with pgc++, you would encounter this error:
"trilinos-12.12.1/src/Trilinos-mas
ter/packages/ifpack/src/Ifpack_Chebyshev.h", line 155: error: virtual
inline function "Ifpack_Chebyshev::Apply" was never defined
virtual inline int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
From: https://github.com/trilinos/Trilinos/blob/master/packages/ifpack/src/Ifpack_Chebyshev.h#L155
This error occurs because the -A
flag is pedantic about not having a definition when the function is marked inline.
pgc++ allows the above code with the --c++11
flag (and without -A
), which is consistent with g++'s -std=c++11
, also set by CMAKE_CXX11_STANDARD_COMPILE_OPTION
. The -A
flag should be removed from pgc++ CMAKE_CXX_STANDARD_COMPILE_OPTION
to be consistent with g++, as --c++11
should be enough to set a C++ standard, and -A
would only make the compiler unnecessarily pedantic.