Hello Kyle,
* Kyle Wheeler wrote on Wed, Sep 06, 2006 at 05:36:14PM CEST:
>
> Ordinarily, in the configure script, I set CC=mpicc (well, $MPICC,
> because I detect where/whether itâs installed), but this poses some
> problems with libtool. Specifically, if mpicc is set to use a weird
> compiler (for example, IBMâs XL compilers), it requires different
> handling for building libraries. For example, you have to use -qpic
> instead of -fPIC. My libtool knows about IBMâs XL compilers, but
> because mpicc can be a frontend for *any* compiler, Iâm reluctant to
> edit my libtool to treat mpicc as a synonym for the XL compiler. What
> I want is a way to make sure that I tell libtool what compiler mpicc
> is *really* using so that the flags are correct.
Good question. I have to admit that my usage cases for this were so far
limited to either GCC as the underlying compiler, or packages where I've
used
./configure CC=xlc MPICC=mpicc
and only used $CC for the tests (knowing that it is also the compiler
underlying $MPICC).
> My solution so far has been to set CC=$( $MPICC -showme ), but this
> seems like a poor solution to me
It's not a bad one.
> (is -showme portable to all mpicc implementations?).
No. For MPICH, IIRC it's -compile-info/-link-info or -show.
> Does anyone know a better way of doing this? I
> assume Iâm not the first guy to have this problem.
Well, I assume we could fix this in Libtool, given that we can come up
with a decent method. I think all matches for compiler name go over
cc_basename, set in Libtool's libtool.m4:_LT_CC_BASENAME.
We could for example allow to override this choice by a variable given
by the user. And then you could write a new macro kw_PROG_MPICC_GET_CC
that would try to get the underlying compiler name from a given mpicc
and then exercise that override.
BTW, you do know the ACX_MPI macro from the Autoconf Macro Archive?
Cheers,
Ralf
|