Everyone,

I just wanted to follow up on this, to help others, or possibly even a future me, having problems compiling OpenMPI with the PGI compilers. I did get it to work a few weeks ago, but I've been too busy to share my solution here. I need to give a shout out to Matt Thompson for providing the missing link: the siterc file (See https://www.mail-archive.com/users@lists.open-mpi.org/msg30918.html)

Here's what I did, step by step. This is on a CentOS 6.8 system:

1. Create a siterc file with the following contents in the bin directory where your pgcc, pgfortran, etc. live. For me, I installed PGI 17.3 in /usr/pppl/pgi/17.3, so this file is located at /usr/pppl/pgi/17.3/linux86-64/17.3/bin/siterc:

$ cat  /usr/pppl/pgi/17.3/linux86-64/17.3/bin/siterc
#################################
# siterc for gcc commands PGI does not support
#################################

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

####################################


This will prevent this error:

pgcc-Error-Unknown switch: -pthread


2. During the configure step, specify the -fPIC explicitly in CFLAGS, CXXFLAGS, and FCFLAGS. For some reason, this isn't added automatically for PGI, which leads to a linking failure deep into the build process. Here's my configure command:

./configure \
  --prefix=/usr/pppl/pgi/17.3-pkgs/openmpi-1.10.3 \
  --disable-silent-rules \
  --enable-shared \
  --enable-static \
  --enable-mpi-thread-multiple \
  --with-pmi=/usr/pppl/slurm/15.08.8 \
  --with-hwloc \
  --with-verbs \
  --with-slurm \
  --with-psm \
  CC=pgcc \
  CFLAGS="-fPIC -tp=x64 -fast" \
  CXX=pgc++ \
  CXXFLAGS="-fPIC -tp=x64 -fast" \
  FC=pgfortran \
  FCFLAGS="-fPIC -tp=x64 -fast" \
  2>&1 | tee configure.log

Obviously, you probably won't be specifying all the same options. The '-tp=x64' tells PGI to create a 'unified binary' that will run optimally on all the 64-bit x86 processors (according to PGI). Technically, I should be specifying '-fpic' instead of '-fPIC', but PGI accepts '-fPIC' for compatibility with other compilers, and I typed '-fPIC' out of habit.

That's it! Those two changes allowed me to build and install OpenMPI 1.10.3 with PGI 17.3


Prentice

On 04/03/2017 10:20 AM, Prentice Bisbal wrote:
Greeting Open MPI users! After being off this list for several years, I'm back! And I need help:

I'm trying to compile OpenMPI 1.10.3 with the PGI compilers, version 17.3. I'm using the following configure options:

./configure \
  --prefix=/usr/pppl/pgi/17.3-pkgs/openmpi-1.10.3 \
  --disable-silent-rules \
  --enable-shared \
  --enable-static \
  --enable-mpi-thread-multiple \
  --with-pmi=/usr/pppl/slurm/15.08.8 \
  --with-hwloc \
  --with-verbs \
  --with-slurm \
  --with-psm \
  CC=pgcc \
  CFLAGS="-tp x64 -fast" \
  CXX=pgc++ \
  CXXFLAGS="-tp x64 -fast" \
  FC=pgfortran \
  FCFLAGS="-tp x64 -fast" \
  2>&1 | tee configure.log

Which leads to this error  from libtool during make:

pgcc-Error-Unknown switch: -pthread

I've searched the archives, which ultimately lead to this work around from 2009:

https://www.open-mpi.org/community/lists/users/2009/04/8724.php

Interestingly, I participated in the discussion that lead to that workaround, stating that I had no problem compiling Open MPI with PGI v9. I'm assuming the problem now is that I'm specifying --enable-mpi-thread-multiple, which I'm doing because a user requested that feature.

It's been exactly 8 years and 2 days since that workaround was posted to the list. Please tell me a better way of dealing with this issue than writing a 'fakepgf90' script. Any suggestions?



_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to