[mpich2-dev] CFLAGS=-fPIC not passed down to MPE ?

Anthony Chan chan at mcs.anl.gov
Mon Aug 6 13:58:35 CDT 2012


Hi Dave,

> Hmm… not sure exactly what's going on here. It looks like most of the
> MPE build system is still written assuming that "mpicc" from the build
> dir is around, but then uses some default fallback of "$CC
> $MPICPPFLAGS" since it's not. That is, it's ignoring "$CFLAGS" in the
> fallback.

MPE is meant to be a profiling tool for all MPI implementations, so
its build system fundamentally assumes that a complete MPI implementation
already exists.  It is a reasonable assumption for a MPI profiling/checking
tool.  Even MPE's build system is rewritten with automake+libtool, the
same assumption holds.  MPE's configure does have some hacks to get it to
work when building within MPICH2.

> Anthony, do you have a suggestion on what the right way to fix this
> would be? I'm tempted to just insert "$CFLAGS" in the fallback, but
> that's almost certainly wrong given that I'm only looking at this
> through a tiny peephole.

Not all MPICH2's CFLAGS/FFLAGS is needed, only the CFLAGS/FFLAGS used
in the install_dir's mpicc/mpif77 are needed by MPE.

> If you want a very short-term workaround, you can probably add "-fPIC"
> to "$MPICPPFLAGS" in your environment.

Passing -fPIC through MPICPPFLAGS to MPE configure is OK as a temporary
workaround.  I believe a correct fix is to pass -fPIC down as CFLAGS.

A.Chan



More information about the mpich2-dev mailing list