LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2006-09-06 11:51:35


On Wed, 2006-09-06 at 11:36 -0400, Kyle Wheeler wrote:
> I’m trying to put together my own, autoconf’d/libtool’d library that
> requires MPI (it’s an MPI tracing library).
>
> 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.
>
> My solution so far has been to set CC=$( $MPICC -showme ), but this
> seems like a poor solution to me (is -showme portable to all mpicc
> implementations?). Does anyone know a better way of doing this? I
> assume I’m not the first guy to have this problem.

This is an issue, unfortunately. -showme isn't portable across MPI
implementations. Both LAM/MPI and Open MPI will use the -showme feature
to get the linker / include flags. However, MPICH uses a slightly
different syntax (-show, I believe). Many other MPI implementations, of
course, use -lmpi and the standard system compiler.

I've attached some code I've used in the past for finding the CFLAGS,
CXXFLAGS, and LDFLAGS/LIBS. It's not perfect and I don't support it,
but here it is. Note that the default is to not have MPI support, so
you might want to edit that part.

Good luck!

Brian



  • application/x-m4 attachment: mpi.m4