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: "Bryan C. Weare" <address@hidden> >Subject: Re: 980217: Incompatibility of netcdf 2.3.2 run on OSF3.2 41 and >netcdf 3.3.1 on OSF4.0 464 >Organization: U.C. Davis >Keywords: 199802171929.MAA13356 Bryan, > I ran make test, and this worked OK, except the C++ warning, since I > don't have this compilier. > > Thinking back over the installation though, I suspect that I have > mislocated or left out something. I didn't understand where > "configure" expected to have me put the results. I ran it in a local > directory and then copied what I thought were the relevant pieces to > /usr/local. I suspect this is wrong. Below is the directory structure > of the final netcdf installation. > > /usr/local/netcdf > bin include lib man > > netcdf/bin: > ncdump ncgen > > netcdf/include: > netcdf.h netcdf.inc > > netcdf/lib: > libnetcdf.a > > netcdf/man: > man1 man3 man3f whatis > > netcdf/man/man1: > ncdump.1 ncgen.1 > > netcdf/man/man3: > netcdf.3 netcdf.3f > > netcdf/man/man3f: > netcdf.3f The directory structure all looks OK. There would be an extra file in /usr/local/netcdf/include/ and /usr/local/netcdf/lib/ if you had a C++ compiler and wanted the C++ interface, but what you have should work fine for C and Fortran programs. > However, I think that the actual libary link is a copy of libnetcdf.a > in /usr/lib/ > > Can you tell me what I did wrong or what to expect? When you link a Fortran program with your installed library, you need to tell the compiler where to look for the library, since it's not in any standard place like /usr/lib/ or /usr/local/lib/. So you need to use something like f77 -o program -I/usr/local/netcdf/include program.f -L/usr/local/netcdf/lib -lnetcdf where "program.f" is the name of your Fortran source file and "program" is where you want the executable. If you don't have the -L/usr/local/netcdf/lib option to f77, it will look in /usr/lib/ and use whatever netcdf library it finds there ... Hope this helps. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu