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.
>To: address@hidden >From: address@hidden >Subject: Problems installing netcdf >Organization: . >Keywords: 199612061947.AA01686 Hi Jil, > > > SunOS spruce 5.5.1 Generic sun4m sparc SUNW,SPARCsystem-600 ... [environment variable values] No problem there. > # more config.log > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. ... [config.log with error messages] Error messages in "config.log" are not necessarily indicative of a problem, since the "configure" script may need to try things that generate errors in order to deduce and correctly configure the compilation environment. > # more log > > making `all' in directory /usr/local/netcdf-2.4.3/src/port ... > making `all' in directory /usr/local/netcdf-2.4.3/src/cxx > > ar rcuv libnetcdf_c++.a netcdf.o ncvalues.o > case "" in \ > '') ;; \ > *) ar rucv libnetcdf_c++.a ;; \ > esac > ranlib libnetcdf_c++.a > CC nctst.o -L. -lnetcdf_c++ -L../libsrc -lnetcdf -o nctst > Undefined first referenced > symbol in file > xdr_enum ../libsrc/libnetcdf.a(array.o) > xdr_float ../libsrc/libnetcdf.a(cdf.o) > xdr_int ../libsrc/libnetcdf.a(array.o) > xdr_vector ../libsrc/libnetcdf.a(sharray.o) > xdr_u_long ../libsrc/libnetcdf.a(array.o) > xdr_double ../libsrc/libnetcdf.a(cdf.o) > xdr_long ../libsrc/libnetcdf.a(dim.o) > xdr_opaque ../libsrc/libnetcdf.a(array.o) The immediate cause of this error was a missing "-lnsl" flag on the CC line above that linked with the libraries. This "-lnsl" flag should have been included in the cxx/Makefile when it was generated by the "configure" script. The fact that it's not there seems to indicate that the "configure" script hasn't been run on this platform yet, or is using incorrect information it finds in the cache file "config.cache". It looks like you're trying to run "make" without first running "make clean" and "configure". This would work OK if you had previously run the "configure" script on this system, but if what you have is left over from a previous run of "configure" on a different system, this won't work. The INSTALL file gives the details of what's needed to build netCDF, but if you're starting from a previously built source tree, you should first run "make clean" (to get rid of all the old object files) and "rm config.cache" to make sure the "configure" script starts with a clean slate and not some previously generated but incorrect information about the plat-from. Then run "configure", possibly with a "--prefix=whatever" argument to specify where you want things to be installed, if the default is not appropriate. Then run "make all", "make test", and if everything goes OK "make install". --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu