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.
Mike, > I recompiled with the following options: > > ./configure --with-hdf5=/home/mbueti/hdf5 --with-zlib=/home/mbueti/zlib > --enable-f90 --prefix=/home/mbueti/netcdf/ > > and now I'm getting: > > /opt/intel/Compiler/11.1/064/bin/intel64/ifort -O1 -convert big_endian -I > /home/mbueti/netcdf/include/ -o windonly MAIN.o windsubs.o -L > /home/mbueti/netcdf/lib -lnetcdf > windsubs.o: In function `output_': > windsubs.f:(.text+0x20a3): undefined reference to `netcdf_mp_nf90_create_' > make: *** [windonly] Error 1 > > -lnetcdff does not work as a flag either. Hmmm, then I can't figure out what's wrong from just the information you've provided. We know netCDF builds with ifort 10.1, as we test our current snapshot on Linux with that compiler. Here's output from a successful build of version 4.1.1 with ifort 10.1: http://www.unidata.ucar.edu/netcdf/builds/4_1_1/out_spock_2010040807_19_1.txt using the flags and settings: CC=icc CFLAGS="-g -O2" CXX=icpc CXXFLAGS=-I/opt/intel/cce/10.1.023/include FC=ifort FCFLAGS=-g F77=ifort FFLAGS=-g configure --enable-netcdf-4 --with-hdf5=[HDF5 lib dir] make check At one point you had "make check" working fine. That should have tested compiling Fortran test programs, including some simple example programs, so we knew the Fortran compiler worked OK. If you can get a successful "make check", and "make install", then the "nc-config" utility will be installed in the same bin directory as ncdump, ncgen, and nccopy. Try running "nc-config --flibs" to see what library arguments ifort requires, and also run "nc-config --all" to make sure it was built with the compilers you intended. If none of that helps, or if you can no longer get a successful build, please send the output requested here: http://www.unidata.ucar.edu/netcdf/docs/netcdf-install/Reporting-Problems.html --Russ Try running the utility nc-config like > On Oct 14, 2010, at 3:30 PM, Unidata netCDF Support wrote: > > >> That seems to be a step in the right direction. I am now getting a whole > >> mess of new errors that seem to be thrown by the module itself: > >> > >> /opt/intel/Compiler/11.1/064/bin/intel64/ifort -O1 -convert big_endian > >> -I /home/mbueti/netcdf/include/ -o windonly MAIN.o windsubs.o -L > >> /home/mbueti/netcdf/lib -lnetcdf > >> /home/mbueti/netcdf/lib/libnetcdf.a(netcdf.o): In function > >> `nf90_put_var_text': > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_text_variables.f90:18: undefined > >> reference to `nf_put_vars_text_' > >> /home/mbueti/netcdf/lib/libnetcdf.a(netcdf.o): In function > >> `nf90_put_var_1d_eightbyteint': > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_eightbyte.f90:25: undefined reference > >> to `nf_put_varm_int_' > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_eightbyte.f90:28: undefined reference > >> to `nf_put_vars_int_' > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_eightbyte.f90:31: undefined reference > >> to `nf_put_vara_int_' > >> /home/mbueti/netcdf/lib/libnetcdf.a(netcdf.o): In function > >> `nf90_inq_libvers': > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_file.f90:5: undefined reference to > >> `nf_inq_libvers_' > > > > It looks like the f90 API is in your library, but not the f77 API it calls. > > Did you > > configure and build in some way that excluded the f77 API, such as by > > specifying both > > --disable-f77 and --enable-f90? I didn't think the configure script would > > permit > > that, but if it does, that won't work The f90 API requires the f77 API > > also. > > > > Another possibility is that you have specified --enable-shared or > > --enable-separate-fortran, > > when configuring, in which case an extra library named "netcdff" would have > > to be used to > > link, as in > > > > /opt/intel/Compiler/11.1/064/bin/intel64/ifort -O1 -convert big_endian > > -I /home/mbueti/netcdf/include/ -o windonly MAIN.o windsubs.o -L > > /home/mbueti/netcdf/lib -lnetcdf -lnetcdff > > > > It might be easiest to try adding "-lnetcdff" at the end of your link line > > first, to see > > if that works. If not, please make sure you don't have any old versions of > > netCDF installed > > as shared libraries that might by searched before the new library you have > > installed. > > > > --Russ > > > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_expanded.f90:2636: undefined > >> reference to `nf_get_vars_double_' > >> /home/mbueti/netcdf-4.1.1/f90/netcdf_expanded.f90:2639: undefined > >> reference to `nf_get_vara_double_' > >> make: *** [windonly] Error 1 > >> > >> > >> On Oct 14, 2010, at 1:32 PM, Unidata netCDF Support wrote: > >> > >>> Hi Mike, > >>> > >>>> I am trying to create a fresh netCDF archive using the FORTRAN interface > >>>> and am receiving the following error upon compilation: > >>>> > >>>> windsubs.f:(.text+0x2098): undefined reference to > >>>> `netcdf_mp_nf90_create_' > >>>> > >>>> Arising from the method call: > >>>> > >>>> status = NF90_CREATE(path = "foo.nc", > >>>> & cmode = NF90_CLOBBER, ncid = ncid) > >>>> > >>>> > >>>> I have included a 'USE netcdf' call at the top of my subroutine, that > >>>> seems to be loading the module properly. > >>>> > >>>> The fortran code is being compiled with the following flags: > >>>> > >>>> /opt/intel/Compiler/11.1/064/bin/intel64/ifort -O1 -convert big_endian > >>>> -I /home/mbueti/netcdf/include/ -L /home/mbueti/netcdf/lib -lnetcdf -o > >>>> windonly MAIN.o windsubs.o > >>> > >>> I think you need to change the order of your arguments so that the library > >>> is searched after the object files: > >>> > >>> /opt/intel/Compiler/11.1/064/bin/intel64/ifort -O1 -convert big_endian > >>> -I /home/mbueti/netcdf/include/ -o windonly MAIN.o windsubs.o -L > >>> /home/mbueti/netcdf/lib -lnetcdf > >>> > >>> --Russ > >>> > >>> > >>> Russ Rew UCAR Unidata Program > >>> address@hidden http://www.unidata.ucar.edu > >>> > >>> > >>> > >>> Ticket Details > >>> =================== > >>> Ticket ID: BHW-570052 > >>> Department: Support netCDF > >>> Priority: Normal > >>> Status: Closed > >>> > >> > >> > > > > Russ Rew UCAR Unidata Program > > address@hidden http://www.unidata.ucar.edu > > > > > > > > Ticket Details > > =================== > > Ticket ID: BHW-570052 > > Department: Support netCDF > > Priority: Normal > > Status: Closed > > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: BHW-570052 Department: Support netCDF Priority: Normal Status: Closed