Compiling Openmpi with PGI v 18.4 Community edition

Hi all,

I am trying to compile openmpi 3.1.1 with PGI community edition 18.4, but its dying during the ./configure step:

  • pgi-2018/linux86-64/18.4/bin/pgcc option to accept ISO C99… none needed
    checking size of void *… 8
    checking size of size_t… 8
    checking size of ssize_t… 8
    configure: error: ptrdiff_t type is not available, this is required by C99 standard. Cannot continue

Any ideas how to resolve please?
Thanks :)

I have also tried

./configure CFLAGS=-c99 CXXFLAGS=-c99

but this still fails at the same point with the same error.

Hi Mr. Pither,

pgcc defaults to using C99 so I wouldn’t expect a difference with or without the “-c99” flag.

While I would expect a different error, one possible cause would be that you need to specify “CPP=cpp” on your configure line. There’s some files that need to be preprocessed with cpp rather than pgc++. Here’s my configure line:

env CC=pgcc CFLAGS=-O2 CPP=cpp CXX=pgc++ CXXFLAGS=-O2 FC=pgfortran FCFLAGS=-O2 ./configure --enable-shared --enable-static --without-tm --enable-mpi-cxx

If you still get the failure, then my best guess is that there’s something off with your system header files, or there’s some other type of configuration issue.


HI Mat,

Thanks for the reply.

I have tried this now on:

  • CentOS 7.4 with kernel 4.13 from
  • CentOS 7.5 with the native centos kernel 3.10

I used your env and .configure lines … but the same error continues to be generated when trygin to compile openmpi3.1.1 with pgi-2018 I am afraid

Mr. P

These are my installed glibc and gcc rpms:

[openmpi-3.1.1]$ rpm -qa |grep gcc

[openmpi-3.1.1]$ rpm -qa |grep glibc

Hi Mr. Pither,

Could you send us the config.log file generated after you ran ./configure and it failed? This will help shed some light on what might be causing the failure.

You can email the file to, and it will find its way to me.



Chris thanks a lot. I have sent over that email with reasons for lag in response time.

Much appreciated!

Did you ever get a solution for this? I’m running into the same issue.

Hi Mr. Pither,

Sorry for the similar delay in my response - apparently I had missed the email where you had sent your config.log to me. My apologies.

I reviewed your config.log, and it looks like you did not set CPP=cpp as Mat had suggested above. I see this in your config.log:

CPP='/cm/opt/pgi-2018/linux86-64/18.4/bin/pgcc -Mcpp'

This is the default value set by the PGI module files, but unfortunately, the PGI preprocessor does not process certain source files used by Open MPI’s configure tests in a way that Open MPI expects. The workaround for this is to use the GNU preprocessor instead, by explicitly setting CPP=cpp.

Make sure you set CPP=cpp as in the following example invocation of ./configure:

env CC=pgcc CFLAGS=-O2 CPP=cpp CXX=pgc++ CXXFLAGS=-O2 FC=pgfortran FCFLAGS=-O2 ./configure --enable-shared --enable-static --without-tm --enable-mpi-cxx --prefix=/var/tmp/openmpi

I just ran this ./configure line with Open MPI 3.1.2 on our centos7 (CentOS Linux release 7.5.1804 (Core) release) with the 18.4 CE, and ./configure completed all the way to the end successfully for me.

Hope this helps.


This worked for me. Thanks.
I’d been smashing my head against the wall for the better part 3 weeks now over this. Now I can proceed with my thesis.

Of note though:

The order of the flags in there made a difference. I was having an issue compiling still( I was using some additional flags).

also had this same issue when trying to compile FFTW.

Actually still getting the same issue with FFTW.

picc -DHAVE_CONFIG_H -I. -I…/…/mpi -I… -I …/… -I …/…/api -O3 -c -o mpi_bench-mpi-bench.o test -f 'mpi-bench.c' || echo '../../mpi/'mpi-bench.c
PGC-F-0249-#error – MPI type for ptrdiff_t is unknown (…/…/mpi/mpi-bench.c: 31)
PGC/x86-64 Linux 18.4-0: compilation aborted
make[3]: *** [mpi_bench-mpi-bench.o] Error 2
make[3]: Leaving directory /root/Downloads/fftw-3.3.8/build/mpi' make[2]: *** [all] Error 2 make[2]: Leaving directory /root/Downloads/fftw-3.3.8/build/mpi’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Downloads/fftw-3.3.8/build’
make: *** [all] Error 2

This was using openmpi compiled with PGI 18.4


Send your config.log file that FFTW to, and I’ll take a look at it.