[mpich-discuss] Compiling shared libraries with Fortran 77 compiler and unexpected option

Dave Goodell goodell at mcs.anl.gov
Wed Sep 7 09:47:35 CDT 2011


On Sep 7, 2011, at 8:45 AM CDT, Thomas Jahns wrote:

> On 09/07/2011 11:20 AM, Thomas Jahns wrote:
>> while the patch works for the intended purpose, there is another problem:
>> setbotf.f in src/binding/f77 introduces a dependency of libmpich.a/.la/.so on
>> the Fortran runtime. Since my intention is to build working shared libraries,
>> I'd like to avoid this dependency.
>> 
>> Therefore I tried to change this by setting MPIFLIBNAME=fmpich and
>> PFMPILIBNAME=pfmpich and changing
> 
> also: this trick does not work for me with Intel icc/icpc/ifort because
> MPI_Init_thread references mpirinitf_ for some reason, although MPI_Init seems
> to make do without?

The call to the fortran init routine happens in MPIR_Init_thread, which is a function that is called by both MPI_Init and MPI_Init_thread to actually do the work of initializing the MPI library.

I don't think you can separate the setbotf object from the main MPI library as you are attempting to do.  The MPI library must be able to obtain the addresses of the fortran common block variables or the Fortran bindings simply will not work correctly.

-Dave



More information about the mpich-discuss mailing list