Newsgroups: comp.parallel.mpi
From: jpc1@lobster.doc.ic.ac.uk (Justin Cormack)
Subject: Re: MPICH on Linux Machines using Nag F90 ??
Organization: Dept. of Computing, Imperial College, University of London, UK.
Date: 11 May 1998 15:21:17 GMT
Message-ID: <6j751d$3c1$1@magpie.doc.ic.ac.uk>

In article <3556f590.0@news.uni-ulm.de>, akohlmey@rincewind.chemie.uni-ulm.de (Axel Kohlmeyer) writes:
> In article <3556CD8D.651BD9E1@physik.uni-freiburg.de>, Peter Biechele <peter.biechele@physik.uni-freiburg.de> writes:
> > I am using the NAG f90 Compiler and the MPICH 1.1 Implementation of MPI
> > on Linux.
> > When I try to compile F90 Programs I can=B4t get the Linker to find the
> > correct library, because
> > the Nag F90 Compiler always appends an underscore (_) to the MPI Routine
> > names.
> > 
> > So the errors are like:
> > 3dturb_parallel.o(.text+0x21): undefined reference to `mpi_init_'
> > 
> > 
> > There doesn=B4t seem to be any way of changing the behaviour of the Nag
> > Compiler, is there
> > a way to get it working anyway ??
> > 
> 
> this isn't a problem of the NAG-compiler appending underscores per se.
> that is ok in most cases. but MPICH assumes, that you use f2c/gcc or
> g77 which both append _TWO_ undersores to all fortran symbols(variables
> or functions) already containung _ONE_ underscore, e.g. mpi_init. 
> 
> so, in order to get your program going, you either append an underscore to
> all mpi_xxYY symbols in your fortran code (this is the quick and really
> dirty method). or dig into the configuration files of the MPICH to change
> the underscoring behavior (i don't know much abaout MPICH, it may be
> quite hairy, but this is _the_ clean solution) and recompile MPICH.

There is a flag for MPICH -fortnames=UNDERSCORE or DOUBLEUNDERSCORE that you
could try (look in the install guide: it says it should be autodetected, but
it may not be in your case)

justin

