compiling openmpi-1.6.5 with pgcc 15

I am trying to compile openmpi-1.6.5 with pgcc 15.1. I get the below errors :

make[2]: Leaving directory `/gpfs0/home/user/local/src/openmpi-1.6.5/ompi/include'
Making all in datatype
make[2]: Entering directory `/gpfs0/home/user/local/src/openmpi-1.6.5/ompi/datatype'
  CC     ompi_datatype_module.lo
PGC-W-0114-More than one type specified (/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h: 149)
PGC-W-0143-Useless typedef declaration (no declarators present) (/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h: 149)
PGC-S-0039-Use of undeclared variable INT64_T (ompi_datatype_module.c: 258)
PGC-S-0039-Use of undeclared variable AINT (ompi_datatype_module.c: 258)
PGC-S-0074-Non-constant expression in initializer (ompi_datatype_module.c: 258)
PGC-W-0093-Type cast required for this conversion of constant (ompi_datatype_module.c: 258)
PGC/x86-64 Linux 15.10-0: compilation completed with severe errors
make[2]: *** [ompi_datatype_module.lo] Error 1
make[2]: Leaving directory `/gpfs0/home/user/local/src/openmpi-1.6.5/ompi/datatype'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/gpfs0/home/user/local/src/openmpi-1.6.5/ompi'
make: *** [all-recursive] Error 1

This is a similar question asked

Is there a solution to this? Thanks.

Hi Lemonade,

This is a problem with the preprocessor. To fix, set the environment variable “CPP=cpp” and then rerun configure.

Hope this helps,

Thanks, that worked. I’m curious, why doesn’t the pgi preprocessor work in this instance?

I believe it’s because cpp implicitly defines “GNU” while pgprepro does not, so these macros don’t get defined with PGI’s preprocessor.