Hello, it seems that the preprocessing macro GNUC is undefined for mpic++ but defined for pgc++.
I’m not sure whether the issue is with pgc++ or the mpi wrapper, but the issue does not occur for Intel so I’m posting here first.
The following example code demonstrates the problem.
#ifdef __GNUC__ #warning "__GNUC__ is defined" #else #warning "__GNUC__ is not defined" #endif
With recent versions of OpenMPI and pgc++, the compile-time output is:
mach5% mpic++ --version pgCC 15.10-0 64-bit target on x86-64 Linux -tp sandybridge The Portland Group - PGI Compilers and Tools Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. mach5% mpirun --version mpirun (Open MPI) 1.10.1 Report bugs to http://www.open-mpi.org/community/help/ mach5% mpic++ -c test.cpp "test.cpp", line 4: warning: #warning directive: "__GNUC__ is not defined" #warning "__GNUC__ is not defined" ^ mach5% pgc++ -c test.cpp "test.cpp", line 2: warning: #warning directive: "__GNUC__ is defined" #warning "__GNUC__ is defined" ^
I’ve tried PGI 15.10 with OpenMPI 1.10.1 (shown here) and PGI 12.9 with OpenMPI 1.6.2. Intel 16.0 with OpenMPI 1.10.1 does not have this problem.