[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #ZBZ-885882]: netcdf.inc
- Subject: [netCDF #ZBZ-885882]: netcdf.inc
- Date: Wed, 07 Nov 2012 16:12:32 -0700
Yuanfu,
> I encountered another problem. I have installed and run test on netcdf
> fortran. The examples worked fine. However, when I link it to our LAPS build
> and get the following problem. We compiled LAPS all the time some other
> platforms. This is my test using gfortran. Would you see what was the
> problem? Thanks
>
> Best regards,
>
> Yuanfu
>
> PS: Segment of my compilation of our LAPS code.
> gfortran lga.f -fd-lines-as-comments -I../../src/include
> -I/Volumes/local/Users/xiey/laps/netcdf/include -I../../src/lib
> -I../../src/lib/modules -I../../src/lib/radar/synp liblga.a
> ../../src/lib/bgdata/libbgdata.a ../../src/lib/util/libutil.a
> ../../src/lib/liblaps.a ../../src/lib/mthermo/libmthermo.a
> ../../src/lib/modules/libmodules.a ../../src/lib/degrib/libdegrib.a
> ../../src/lib/w3lib/libw3.a ../../src/lib/g2lib/libg2_4.a \
> -L/Volumes/local/Users/xiey/laps/netcdf/lib -lnetcdf -lgcc -lz -o lga.exe
> Undefined symbols for architecture x86_64:
> "_nf_get_att_text_", referenced from:
> ___wrf_netcdf_MOD_get_wrfnc_2d in libmodules.a(module_wrf_netcdf.o)
> ___wrf_netcdf_MOD_get_wrfnc_3d in libmodules.a(module_wrf_netcdf.o)
> ___wrf_netcdf_MOD_get_wrf2_timeinfo in libmodules.a(module_wrf_netcdf.o)
> _get_attribute_sbn_ in libbgdata.a(get_attr_sbn.o)
> "_ncvgt_", referenced from:
> ___wrf_netcdf_MOD_get_wrfnc_2d in libmodules.a(module_wrf_netcdf.o)
> ___wrf_netcdf_MOD_get_wrfnc_3d in libmodules.a(module_wrf_netcdf.o)
> _get_laps_lat_lon_ in libbgdata.a(lapsio.o)
> _get_laps_wind_ in libbgdata.a(lapsio.o)
> _get_laps_2d_sfc_ in libbgdata.a(lapsio.o)
> _get_laps_sfc_elev_ in libbgdata.a(lapsio.o)
I think you need to make sure both the Fortran netCDF library and the C
netCDF library get searched, which requires
-lnetcdff -lnetcdf
instead of just
-lnetcdf
This is a change from earlier versions of netCDF, where the Fortran library
and C library were together in a single library archive. The reasons for this
change were explained here:
http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2011/msg00377.html
--Russ
> On Nov 7, 2012, at 8:58 AM, Unidata netCDF Support wrote:
>
> > Hi Yuanfu,
> >
> >> I downloaded the netcdf-4.2.1.1 however there is no netcdf.inc. Would
> >> you know what is the problem?
> >
> > Yes, netCDF-4.2.1.1 is only the netCDF C library, which you need to build
> > and install before building and installing the Fortran netCDF library. The
> > Fortran library was separated from the C library in netCDF 4.2 and later
> > versions.
> >
> > Here are the directions for building and installing the netCDF Fortran
> > library,
> > which includes netcdf-inc:
> >
> >
> > http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html
> >
> > --Russ
> >
> > Russ Rew UCAR Unidata Program
> > address@hidden http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: ZBZ-885882
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
>
>
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: ZBZ-885882
Department: Support netCDF
Priority: Normal
Status: Closed