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.
Don, I see from the configure output that you did not specify the "--enable-netcdf-4" option, which means the default netCDF-3 software will be built. This is still the appropriate choice for most users, because the great majority of data in archives and still being produced is written through the simpler netCDF-3 interface to "classic netCDF" files. NetCDF-4 has an advanced data model and some high-performance features like parallel I/O, but I assume netCDF-3 is the version you want (because you originally mentioned trying to build version 3.6.2). The only reason I mention this is becasue you are trying to compile an example, nc4_pres_temp4D_wr.f90, that uses netCDF-4 features. That will not work with a netCDF-3 library. But you should be able to compile and run examples such as pres_temp_4D_wr.f90 and other netCDF-3 examples found on the Example netCDF programs page: http://www.unidata.ucar.edu/netcdf/examples/programs/ If the tests run by "make check" all pass, then these example programs have already been compiled and run as part of the tests. You can see the examples in the examples/F90/ directory in which you built the software, and you should be able to run "make clean check" in the example/ directory to see how the programs were compiled and linked during testing. However, during testing the "libtool" tool is used to assist in compiling and linking, and it's more complex than is needed for simple use of compilers to build applications. But its use can provide examples of the -L and -l library arguments used in linking. It looks like the Absoft f90 compiler requires a lot of library arguments to link, after the netCDF library arguments: -L/Applications/Absoft10.1/lib -laf90math -lafio -lamisc -labsoftmain -laf77math -lm -lmv The output you sent makes it look as if you left out at least the -lafio argument. Perhaps the compiler came with some scripts to run to set up environment variables and make it easier to compile simple programs with all the library paths and libraries that are needed included by the scripts? Looking more closely at the make output you attached, it doesn't look as if you ran "make check", as the output only seems to be a result of running "make all" or just "make". The nm output you appears OK, but the undefined symbols you are getting are not from the netCDF library, they are Fortran run-time support functions to do basic read, open, and close operations, and are probably in the Absoft afio library. My advice would be to check the Absoft documentation for configuration or scripts to run to provide simpler compiling and linking that automatically gets the run-time libraries linked in. Unfortunately since I don't have an Absoft compiler, I can't offer much more help with this ... --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: SKD-481794 Department: Support netCDF Priority: Critical Status: Closed