[MITgcm-devel] ffort and g77 libraries

Ed Hill ed at eh3.com
Wed Jul 21 23:53:33 EDT 2004


On Wed, 2004-07-21 at 10:16, Alistair Adcroft wrote:
> I warned you that you wouldn't like it (Chris in particular) but ...

I do like it.  Unfortunately, its (in all likelihood) not going to work
with most of the compilers.  But it will work with the latest Intel
ifort (see below).


> Compiling g77 with -fno-second-underscore allows us to link to
> libraries/objects copmiled with ifc. So if we uniformly switch to using this

Compilers have a nasty way of not being fully binary compatible unless
they were actually designed to be binary compatible.  Even on the same
architecture.  For instance, the g77 compiler on halem won't link with
the system-provided libnetcdf.a that was compiled with the native f77
compiler.  And I don't think forcing the function name mangling to match
will cure all the incompatibilities on that system or on our Intel
systems.


> What is a shame is that ifc doesn't have an option (that I found) to link to
> a library comiled with g77 and thus has the second under-score. May be Ed
> can figure out if it does because then we can modify the ifc optfiles rather
> than the g77 optfiles and leave all the libraries intact.

The latest (v8.x) versions of the Intel compilers *ARE* binary
compatible with GCC v3.3.x as you can read at:

  http://intel.com/software/products/compilers/linux/

which is helpful.  Other commercial compilers including PathScale:

  http://pathscale.com/products1.html

are supposedly GCC binary-compatible.  But then the PGI, NAG, and Lahey
compilers don't make any compatibility claims that I could locate.  And
our older versions of Intel are probably not incompatible with recent
GCC versions.

So, ultimately, I think we're going to be stuck with per-compiler NetCDF
libraries for the compilers other than GCC and Intel v8.  But its not a
big deal.  We just put the correct -L/path/to/the/lib entries in the
optfiles (as we do with MPI libs) and thats it.  And I'll be happy to
generate NetCDF libraries for all our compilers.  Theres already a few
ready to be used on the authors machines at:

  /usr/local/pkg/netcdf/netcdf-3.5.1/lib/${COMPILER_NAME}

Ed

-- 
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-devel mailing list