On Jun 13, 2007, at 8:47 PM, Julian Cummings wrote:
I did some quick tests with my little hello example that indicate that
the application code only needs to be *linked* with -fpic, not
compiled
with it. The -fpic flag on the mpicxx link line points the linker
to a
PGI "libso" subdirectory that contains dynamic versions of the
compiler
libraries. In this case, probably libC.so is most important. Anyway,
at least you do not have to potentially degrade the performance of the
application code by compiling all of it with -fpic. I would recommend
that the OpenMPI configuration be modified to insert this flag (or
some
equivalent) as an LCXXFLAGS or even an LDFLAGS component in the
compiler
driver scripts whenever PGI is used.
We've had debates about this internally. There was pushabck from
some of the developers that we don't want to handle every single
compiler bug that's out there (there are many). It can be a never-
ending battle. This is a big enough compiler bug, however (it spans
the 6.2 and 7.0 PGI series) that if someone contributes a patch, we
might be able to make a big enough case to fix it. The functionality
I'd like to see in such a patch is:
- in the C++ section of configure, try to compile and run a simple C+
+ (non-MPI) program
- if it works, fine
- if it doesn't work, try again but link it with -fpic
- if that works, then add -fpic to the C++ compiler wrapper flags
All with appropriate comments describing why this check is there (so
that someone doesn't look at it in 6 months and wonder why the heck
we're checking for that).
FWIW, you can easily modify the wrapper scripts to automatically put
this flag in after Open MPI is installed (see http://www.open-mpi.org/
faq/?category=mpi-apps#override-wrappers-after-v1.0).
--
Jeff Squyres
Cisco Systems