[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #TYX-942858]: NetCDF 4.0, gfortran,Cygwin, undefined reference



> I am planning to access IPCC CMIP3 Climate data which is in NetCDF format
> using NetCDF 4.0, gfortran 4.4.0, Cygwin 3.4.4, Windows XP SP2, Intel
> Pentium 4. The NetCDF binary is extracted from
> binary-netcdf-4.0_gfortran_gfortran_c++.tar.gz.
> The test program that I am trying to compile is the sample Unidata program
> simple_xy_wr.f90. The command I use is:
> gfortran -I/usr/local/include /usr/local/lib/libnetcdf.a simple_xy_wr.f90
> and as many variants of that that I can think of.  I get messages of the
> sort:
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0xbb):
> undefined reference to `___netcdf_MOD_nf90_create'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0xf3):
> undefined reference to `___netcdf_MOD_nf90_def_dim'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x12b):
> undefined reference to `___netcdf_MOD_nf90_def_dim'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x20b):
> undefined reference to `___netcdf_MOD_nf90_def_var_manydims'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x244):
> undefined reference to `___netcdf_MOD_nf90_enddef'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x2ea):
> undefined reference to `___netcdf_MOD_nf90_put_var_2d_fourbyteint'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x303):
> undefined reference to `___netcdf_MOD_nf90_close'
>
/cygdrive/c/DOCUME~1/LOUUMS~1/LOCALS~1/Temp/ccCyazf7.o:simple_xy_wr.f90:(.text+0x3db):
> undefined reference to `___netcdf_MOD_nf90_strerror'
> collect2: ld returned 1 exit status
> nm of libnetcdf.a shows the undefined references. libnetcdf.a is where I say
> it is. A search of the support archive did not provide a solution. Any help
> would be appreciated.
>
> Lou Umscheid
>
>
>

Howdy Lou!

Can I ask you to try building from source? Get the daily snapshot here:
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

and build it in accordance with these instructions:
http://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf-install/Quick-Instructions.html

(You will also need to install HDF5-1.8.1 and the zlib library. The
quick-instructions tells how, and provides a link to get them.)

Windows is a tricky platform for binaries, but cygwin is well-behaved and
builds for me cleanly in nightly testing.

Please let me know how it goes.

Thanks,

Ed

Ticket Details
===================
Ticket ID: TYX-942858
Department: Support netCDF
Priority: Normal
Status: Open