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.
Delphine, > many thanks for your help. I've made sure to build the library for a 64-bit. > > I also corrected the links regarding the // > > However, I've perform a make check and got one error. > I'm attaching the result of this command. > > Could this be the cause of the problem? The error you are now seeing: > *** Testing HDF5/NetCDF-4 interoperability... > *** Creating a HDF5 file with one var with two dimension scales...ok. > *** Checking that HDF5 file can be read by netCDF-4, and adding an att...ok. > *** Checking that one var, two dimscales, one att file can still be read by > HDF5...ok. > *** Creating a HDF5 file with one var and no dimension scales...ok. > HDF5-DIAG: Error detected in HDF5 (1.8.6) thread 0: > #000: H5O.c line 717 in H5Oget_info_by_idx(): group not found > major: Symbol table > minor: Object not found is the result of using the combination netCDF-4.1.1 and HDF5-1.8.6. Here's a discussion of the problem and possible workarounds: http://www.unidata.ucar.edu/netcdf/docs/known_problems.html#incompat-411-186 --Russ > On 15 Mar 2011, at 21:19, Unidata netCDF Support wrote: > > > Hi Delphine , > > > >> I'm trying to compile a fortran code but it seems my netcdf library is > >> not referenced correctly. However, I can't find the reason why. I hope > >> you could help me finding the source of the problem. > >> > >> My environment is Mac OS X 10.6.6. > >> Fortran compiler is ifort 12.0.0 > >> > >> I have installed the netcdf 4.1.1 library. See below the results of the > >> command 'nc-config --all' > >> > >> I'm trying to compile a simple code requiring netcdf library. However, > >> I'm getting this error message: > >> > >> Undefined symbols: > >> "_nf_open_", referenced from: > >> _wr4dnc_ in netcdf4d.o > >> ld: symbol(s) not found > >> make: *** [main] Error 1 > > > > First, please check that the library was compiled for the same architecture > > as your application program. A common error on Mac's is to build a library > > for a 64-bit x86_64 architecture and try to link a program compiled for a > > 32-bit i386 architecture with that library (or vice versa). The result is > > that netCDF library functions won't be found. You can check what > > architectures your program and library are compiled for with the "file" > > command, as in > > > > $ file /opt/local/lib/netcdff.dylib > > /opt/local/lib/netcdff.dylib: Mach-O 64-bit dynamically linked shared > > library x86_64 > > > > If your Fortran and C compilers have different defaults for arcitectures, > > you may have to use -m64 or -m32 CFLAGS or FCFLAGS explicitly to make sure > > they match. > > > > That may not be the problem, because I see another possible symptom of > > a problem in the nc-config output you sent: > > > >> --libs -> -L/opt/local/lib -lnetcdf -L/opt/local//lib -lhdf5_hl -lhdf5 > >> -L/opt/local//lib -lz -lm -L/opt/local//lib -lsz -L/opt/local/lib -lcurl > >> -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn -lssl -lcrypto > >> -lssl -lcrypto -lz -lz > > ... > >> --flibs -> -L/opt/local/lib -lnetcdf -L/opt/local//lib -lhdf5_hl -lhdf5 > >> -L/opt/local//lib -lz -lm -L/opt/local//lib -lsz -L/opt/local/lib -lcurl > >> -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn -lssl -lcrypto > >> -lssl -lcrypto -lz -lz > > > > Both of these have a double slash "//" in some -L options, as in > > "-L/opt/local//lib". That seems wrong, and may be the result of a typo > > when the library was configured and built, or may be a bug in nc-config, > > but I don't see such a double slash in the --libs or --flibs output of > > the 4.1.1 nc-config here. > > > > Can you check if things work if you change this "//" to "/" in your link > > command? > > > > --Russ > > > >> nc-config --all > >> > >> This netCDF 4.1.1 has been built with the following features: > >> > >> --cc -> icc > >> --cflags -> -I/opt/local/include > >> --libs -> -L/opt/local/lib -lnetcdf -L/opt/local//lib -lhdf5_hl > >> -lhdf5 -L/opt/local//lib -lz -lm -L/opt/local//lib -lsz > >> -L/opt/local/lib -lcurl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib > >> -lidn -lssl -lcrypto -lssl -lcrypto -lz -lz > >> > >> --cxx -> icpc > >> --has-c++ -> yes > >> > >> --fc -> ifort > >> --fflags -> -g -I/opt/local/include > >> --flibs -> -L/opt/local/lib -lnetcdf -L/opt/local//lib -lhdf5_hl > >> -lhdf5 -L/opt/local//lib -lz -lm -L/opt/local//lib -lsz > >> -L/opt/local/lib -lcurl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib > >> -lidn -lssl -lcrypto -lssl -lcrypto -lz -lz > >> --has-f77 -> yes > >> --has-f90 -> yes > >> > >> --has-dap -> yes > >> --has-nc2 -> yes > >> --has-nc4 -> yes > >> --has-hdf5 -> yes > >> --has-hdf4 -> no > >> --has-szlib -> yes > >> > >> --prefix -> /opt/local > >> --includedir-> /opt/local/include > >> --version -> netCDF 4.1.1 > >> > >> > > > > Russ Rew UCAR Unidata Program > > address@hidden http://www.unidata.ucar.edu > > > > > > > > Ticket Details > > =================== > > Ticket ID: QGV-335526 > > Department: Support netCDF > > Priority: Normal > > Status: Closed > > > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: QGV-335526 Department: Support netCDF Priority: Normal Status: Closed