I tried a smaller test file with only:
and was able to reproduce the same error.
Using -P stripped out a little too much to easily tell what was coming from where, but I liked the idea, and noticed the -dI option. Here’s some abridged output using “pgcc -dI test.c”:
PGC-F-0249-#error – “Never use <bits/byteswap.h> directly; include <byteswap.h> instead.” (/opt/pgi/linux86/8.0-1/include/bits/byteswap.h: 21)
PGC/x86 Linux 8.0-1: compilation aborted
I also noticed a
line before a couple of blocks in that include chain.
I also got similar errors when recompiling NetCDF 4 using the instructions for an older version of the compiler (and an older version of NetCDF). Mind you, I encountered a few other errors first. On the first go, the configure script failed with:
checking size of short… 0
checking size of int… 0
checking size of long… 0
checking size of float… 0
checking size of double… 0
checking size of off_t… configure: error: cannot compute sizeof (off_t)
See `config.log’ for more details.
Removing the CC environment variable (and removing or adjusting CFLAGS too), and the configure script then runs fine, but then when I run make I get the same error above about byteswap.h from pgCC.
without any environment variables set, it builds fine, but it seemed to be using the system cc compiler, and pgf95.