pthread behavior (MPICH 3.2)

I am having trouble building MPICH 3.2 using PGI 18.10 which I just installed. The problem seems to be that the system pthread.h is not usable by PGI. When configuring the hwloc core, I get the following:

checking pthread.h usability… no
checking pthread.h presence… yes
configure: WARNING: pthread.h: present but cannot be compiled
configure: WARNING: pthread.h: check for missing prerequisite headers?
configure: WARNING: pthread.h: see the Autoconf documentation
configure: WARNING: pthread.h: section “Present But Cannot Be Compiled”
configure: WARNING: pthread.h: proceeding with the compiler’s result
checking for pthread.h… no

Although the configuration completes successfully, I get the following when I go to compile/link:

make[4]: Entering directory /scratch/build/mpich-3.2/src/pm/hydra/tools/topo/hwloc/hwloc/src' CC topology.lo CC traversal.lo CC distances.lo CC components.lo PGC-S-0040-Illegal use of symbol, cpu_set_t (/usr/include/pthread.h: 390) PGC-W-0156-Type not specified, 'int' assumed (/usr/include/pthread.h: 390) PGC-S-0040-Illegal use of symbol, cpu_set_t (/usr/include/pthread.h: 397) PGC-W-0156-Type not specified, 'int' assumed (/usr/include/pthread.h: 397) PGC-S-0040-Illegal use of symbol, cpu_set_t (/usr/include/pthread.h: 459) PGC-W-0156-Type not specified, 'int' assumed (/usr/include/pthread.h: 459) PGC-S-0040-Illegal use of symbol, cpu_set_t (/usr/include/pthread.h: 464) PGC-W-0156-Type not specified, 'int' assumed (/usr/include/pthread.h: 464) PGC/x86-64 Linux 18.10-0: compilation completed with severe errors make[4]: *** [components.lo] Error 1 make[4]: Leaving directory /scratch/build/mpich-3.2/src/pm/hydra/tools/topo/hwloc/hwloc/src’
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory /scratch/build/mpich-3.2/src/pm/hydra/tools/topo/hwloc/hwloc' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory /scratch/build/mpich-3.2/src/pm/hydra’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/scratch/build/mpich-3.2’
make: *** [all] Error 2

Does anyone have advice for moving beyond this issue?


Hi Mike,

How are you invoking the MPICH configure script?

One thing you might need to do is set CPP=cpp when invoking ./configure. There are differences between the PGI preprocessor and the GNU preprocessor, which some open source packages do not account for. Setting CPP=cpp configures the MPICH build to use the GNU preprocessor instead, and this often solves a lot of problems.

Good luck,


Hey Chris,

Thank you for the reply. Here is how I am invoking configure:

LD=ld CPP=cpp ./configure --enable-static --enable-shared --enable-fast=all,O3 --with-ibverbs=/usr --with-ibverbs-include=/usr/include --with-ibverbs-lib=/usr/lib64 --prefix=/apps/software/pgi-18.10/mpich/3.2

I should also mention that I have environment variables set to use GCC 5.4 vs. the system GCC 4.8. I have a localrc set to handle this.

Let me know if you have any other suggestions or need more information.


I found the problem. Before I had the localrc set up, I had loaded the include directories into CPATH for both PGI and gcc5. Thus,


Apparently, the include-gcc50 path was causing the problem. Removing that (and the two gcc5 paths since they are in localrc) seems to clear things up.

Thank you for your help Chris!