[Mitgcm-support] RE: pgi+mpi linker problems

mitgcm-support at dev.mitgcm.org mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:51:05 EDT 2003


Tom,

 I think the tools/as hack is not needed with the up to date
RH and PGI. 
I think the problem you have is becaue you built mpi
with g77 as your Fortran compiler and now you are using
pgf77. This means that your mpi_recv routine that gets
linked from fortran is called mpi_recv__ not mpi_recv_.
Dumb and annoying I know!
The pgi option that may fix this is
-second_underscore. 
It could be something totally different though!

Chris

-----Original Message-----
From: Tom Haine [mailto:twnh at stommel.eps.jhu.edu]
Sent: Friday, June 07, 2002 5:22 PM
To: support at mitgcm.org
Cc: Thomas Haine
Subject: pgi+mpi linker problems


Hi,

I'm having problems linking with pgif77 and mpi on RH linux. I get:

undefined reference to `mpi_recv_'

for example. pgif77 without mpi works OK and compiling with g77+mpi also
works (so libs are defined OK).

I know I should send the compiler output through the tools/as wrapper for
the gnu assembler (with FFLAGS = .... -Ya,../tools in Makefile). But this
doesn't help. The sed command in tools/as

sed 's:/:#:' /tmp/pgf772gQPv1 | exec /usr/bin/as -o timestep_tracer.o --

(for example) translates "/" characters to "#" characters in the temporary
assembler file (right?). But why is this helpful?  The pgif77 comments,
apparently the cause of the trouble, are like:

# PGFTN 3.2 -opt 2 -norecursive
# lineno: 353

so I don't see how tools/as should fix the problem. Actually, I don't see
the symptoms of this should be undefined references to mpi fns.

Please can you give me some advice about how to tackle this problem?  
Perhaps my version of pgif77, sed, or as gives different results to yours?

Thanks, Tom.
P.S. Great model and documentation!  Can't wait to get going properly!
--------------------------------------------
 Thomas W. N. Haine

 Associate Professor of Physical Oceanography,
 Department of Earth & Planetary Sciences,
 329 Olin Hall, The Johns Hopkins University,
 Baltimore, MD 21218, USA.
 Tel : 410 516 7048,   Fax : 410 516 7933
 Thomas.Haine at jhu.edu  
 http://www.jhu.edu/~eps/faculty/haine
--------------------------------------------


On Mon, 16 Jul 2001, Chris Hill wrote:

> For pgf77 linker problem, we had to do this  ( see tools/as in any
> mitgcm from 
> checkpoint30 onwards ).
> 
> !/bin/csh -f
> 
> # This is a real hack of a wrapper for the linux assembler.
> # It replaces comment characters generated by pgf77 with
> # recognized comment characters. Invoke with -Ya,../tools
> # in the FFLAGS variable in Makefile
> 
> set asfile=$argv[$#argv]
> set argv[$#argv]="--"
> 
> echo "sed 's:/:#:' $asfile | exec /usr/bin/as $argv"
> 
> sed 's:/:#:' $asfile | exec /usr/bin/as $argv
> 
> Chris





More information about the MITgcm-support mailing list