On Thu, 30 Oct 2003, Lei Pan wrote:
> I would like to build the MPI libraries such that they have both, say
> MPI_Send and mpi_send_, in them. In this way, I may choose to use the
> f90 option -B108 (append a single underscore to the names). I need this
> because I am parallelizing legacy code for which the Makefile uses
> -B108.
We don't actually have a mechanism to do this. :-(
The reason that this is not supported natively is that some
compilers/linkers do not support multiple weak symbols for a single
back-end strong symbol. The faults of some destroy it for the rest of us.
:-(
However, you might be able to do a somewhat-ugly workaround to get what
you need (I'm assuming that you're working with LAM/MPI 7.0.2):
- configure, build, and install with one of the Fortran options.
- rename the resulting $prefix/lib/liblamf77mpi.a to liblamf77mpi2.a (or
whatever you want -- as long as it's not liblamf77mpi.a)
- configure, build, and install with the other fortran option
You can now use "mpif77 -lliblamf77mpi2 ..." and you get both ways of
fortran linking. That's not elegant, but it should work fine.
If you want to be a bit more clever, after you do those three steps,
you could deconstruct the liblamf77mpi.a and liblamf77mpi2.a into
their respective .o files and then re-combine them into huge, mondo,
combined liblamf77mpi.a that contains both symbol types. The exact
commands to do this will depend on your back-end compiler, but it
would result in you being able to do "mpif77 ..." and get both symbol
types.
Now -- with all that said -- I'm providing this information with the
BIG DISCLAIMER that those switcher you mentioned *ONLY* change the
symbol linking style. If they change other things in how the
generated code works, you may run into problems (simple example: if
different types are supported and/or are different sizes), and I would
*NOT* recommend either of the methods that I mentioned above -- you'll
need to have two LAM installations in that case. Sorry! :-(
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|