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

Dave Goodell goodell at mcs.anl.gov
Mon Aug 6 14:07:26 CDT 2012


On Aug 6, 2012, at 1:58 PM CDT, Anthony Chan wrote:

>> 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.

Right, automake+libtool only affects the ease with which we could build shared libraries.  Right now it's challenging to do portably without libtool.

>> 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.

Well, IIRC, those are strictly a superset of the CFLAGS given to mpich2's configure.  Right now MPE is not correctly using the CFLAGS that are passed to it from MPICH2.

>> 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.

It *is* passed as CFLAGS to MPE, MPE is just not including it in all of the right places in the makefile, partly due to some *MPE* configure logic.  I would just add the $CFLAGS in a place that would make this case work myself, but I'm virtually guaranteed to break some other use case of MPE and it's not an easy thing for me to test.  That's why I was hoping you would look at how the CFLAGS are (not) being incorporated and suggest a more robust solution.

-Dave



More information about the mpich2-dev mailing list