[MITgcm-support] help with netcdf

Ed Hill ed at eh3.com
Tue Apr 26 13:40:07 EDT 2005


On Tue, 2005-04-26 at 12:39 -0400, samar khatiwala wrote: 
> Hi Baylor
> 
> I don't have g77 installed. Everything is compiled with gcc/xlf. And yes,
> it is almost certainly a problem with leading/trailing underscores and
> calling fortran from C and vice versa. This is a constant hastle.
> xlf provides you with the -qextname flag to deal with this. Problem is, my
> mpi source is compiled with -qextname (because I prefer it that way)
> and the netcdf code is compiled without it (again because doing otherwise
> would break a lot of other code). Anyway, I'll sort it out. ugh.

Hi Samar,

You know, you can always compile a *SECOND* (or third or fourth...) set
of netCDF libs that has the compiler flags that you need with respect to
the -qextname flag and then use that version for your MITgcm builds.
You don't need to restrict yourself to just one build for everything--
especially since you've decided to fiddle with the -qextname flag.

And yes, these name-mangling things are a pain.  We'll just have to
thank the Fortran and C standards committees for failing (after
*numerous* proposals) to define a standard for cross-language linking.

Ed

ps - You can also use the "nm" command to see how symbols are 
     defined within binary files.  For example, "nm some_file.o" 
     will give you the list of defined symbols for that object 
     file no matter whether its been compiled from C or Fortran.
     And the same works for "nm libnetcdf.a", etc.

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464




More information about the MITgcm-support mailing list