This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Baldeep, > To: address@hidden > From: baldeep hira <address@hidden> > Subject: Problem with netCDF fortran library > Organization: Iowa State University > Keywords: 199903222114.OAA11882 In the above message, you wrote: > I am having some problems in linking my fortran code with the > netcdf fortran library. Any help tht you can provide will be > appreciated. > > I compiled the netcdf using commercial compilers by Portland > group namely, pgcc, pgf77 and pgCC. The "configure" and > "make" commands go through successfully. But when I try to > test netcdf functions using "make test" command. It runs > fine for the C version but gives me an error for the fortran > test cases. The errors are something like this. > > pgf77 -c -O ftest.F > ar cru ../libsrc/libnetcdf.a fort-attio.o fort-control.o fort-dim.o > fort-genatt.o fort-geninq.o fort-genvar.o fort-lib.o fort-misc.o > fort-v2compat.o fort-vario.o fort-var1io.o fort-varaio.o fort-varmio.o > fort-varsio.o > ranlib ../libsrc/libnetcdf.a > pgf77 -o ftest -O ftest.o ../libsrc/libnetcdf.a > Linking: ftest.o(.data+0x2360): undefined reference to `nf_inq_libvers_' > ftest.o(.data+0x2364): undefined reference to `nf_strerror_' > ftest.o(.data+0x2368): undefined reference to `nf_issyserr_' > ftest.o(.data+0x236c): undefined reference to `nf_create_' > ftest.o(.data+0x2374): undefined reference to `nf_open_' > ftest.o(.data+0x237c): undefined reference to `nf_set_fill_' > ftest.o(.data+0x2380): undefined reference to `nf_redef_' > ftest.o(.data+0x23 > > > It seems like the function names have been changed because > instead of being "nf_open" it is being read as "nf_open_". > The C and C++ libraries are running fine. Its the problem > only with the fortran library. We've seen this problem before. The solution can be found in the netCDF, user-support email archive at the following URL: <http://www.unidata.ucar.edu/glimpse/netcdf/3230> -------- Steve Emmerson <http://www.unidata.ucar.edu>