OpenMPI compilation error with PGI

I am trying to compile OpenMPI with PGI. We only have license for pgfortran so this is how I configured it.

./configure FC=pgfortran FCFLAGS=-fast

It configures, but then I do make and I get this error.

make[2]: Entering directory `/install/src/openmpi-2.0.0/ompi/mpi/fortran/use-mpi-ignore-tkr'
  GENERATE mpi-ignore-tkr-sizeof.h
  GENERATE mpi-ignore-tkr-sizeof.f90
  PPFC     mpi-ignore-tkr.lo
  FC       mpi-ignore-tkr-sizeof.lo
  FCLD     libmpi_usempi_ignore_tkr.la
pgfortran-Error-Unknown switch: -pthread
make[2]: *** [libmpi_usempi_ignore_tkr.la] Error 1

Any pointers to how to solve this problem?

So the switch -pthread is the problem.

It should probably translate to
-lpthread

Create a world readable file
$PGI/linux86-64/16.5/bin/siterc

to solve this for everyone, or put it in your $HOME directory for it to only
work for you.

In the file, add the line

switch -pthread is
append(LDLIB1=-lpthread);



To verify it works, look at

pgfortran -dryrun foo.f
output, and make sure the siterc file is being read.

dave