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

Dave Goodell goodell at mcs.anl.gov
Wed Sep 7 09:22:29 CDT 2011


On Sep 7, 2011, at 4:20 AM CDT, 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.

I'm not 100% sure that I understand what you mean here.  Are you saying that because setbotf.f lives in lib${MPIFLIBNAME}.so and MPIFLIBNAME=mpich that the libmpich.so must be linked with the fortran compiler?  And that furthermore applications linked via mpicc must include some libraries from the fortran compiler runtime on underlying link line?

Can you give us any specifics about which compiler you are using and what the internal Fortran runtime dependency is?

> Therefore I tried to change this by setting MPIFLIBNAME=fmpich and
> PFMPILIBNAME=pfmpich and changing
> 
> lib\${MPIFLIBNAME}_a_DIR = ROOTDIR/lib\
> lib\${MPIFLIBNAME}_a_SOURCES = \${mpi_sources} setbot.c setbotf.f\
> \
> 
> in src/binding/f77/buildiface to
> 
> lib\${MPIFLIBNAME}_a_DIR = ROOTDIR/lib\
> lib\${MPIFLIBNAME}_a_SOURCES = \${mpi_sources} setbotf.f\
> \
> lib\${MPILIBNAME}_a_DIR = ROOTDIR/lib\
> lib\${MPILIBNAME}_a_SOURCES = setbot.c\
> \
> 
> But I noticed running 'perl buildiface' in src/binding/f77 and 'perl
> maint/simplemake' in the top-level directory of the source tree produces
> significant differences in the produced Makefile.in files. Are these scripts
> current?

These scripts are current.  You should run these many scripts via "./maint/updatefiles", not by hand.  Their invocation is not as straightforward as you initially guessed.  You'll need the exact versions of the autotools described here:

http://wiki.mcs.anl.gov/mpich2/index.php/Getting_And_Building_MPICH2#Setting_up_the_build_environment

-Dave



More information about the mpich-discuss mailing list