[MITgcm-support] [Fwd: Auto-discard notification]
Ed Hill
ed at eh3.com
Wed Sep 29 13:59:24 EDT 2004
On Wed, 2004-09-29 at 13:24, Karsten Friis wrote:
> Hi Ed,
>
> so the genmake2 finally provides me with: 'Can we create NetCDF-enabled
> binaries... yes' - Great!
>
> I'll CVS the newest version and try...
>
> Cool, thanx, I'll let you know
Hi Karsten,
I'm glad its working.
And just for reference sake, heres what happened:
1) An unhelpful sysadmin compiled netcdf with some unknown
and g77-incompatible compiler and then installed it in a
system-wide default location.
2) Karsten tried to use g77 which then automatically found the
incompatible library (with "-lnetcdf") and it tried and
failed to link against it.
3) Karsten then solved the problem by installing his own g77-
compatible version of netcdf using the commands:
$ cd $HOME
$ wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-3.5.1.tar.Z
$ tar -xzf netcdf-3.5.1.tar.Z
$ cd netcdf-3.5.1/src
$ export CPPFLAGS="-DNDEBUG -Df2cFortran -fPIC"
$ export CFLAGS="-Df2cFortran -fPIC"
$ export FC="g77"
$ ./configure
$ make
$ cp libsrc/libnetcdf.a libsrc/libnetcdf_g77.a
and then created a custom MITgcm optfile that contained
the lines:
INCLUDES="-I$HOME/netcdf-3.5.1/src/fortran"
LIBS="-L$HOME/netcdf-3.5.1/src/libsrc -lnetcdf_g77"
where $HOME is Karsten's home directory.
I just wanted to make sure that this was documented since the above
approach will, with just a few small changes, work for any compiler.
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-support
mailing list