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.
Santiago, > To: address@hidden > From: "Santiago Gasso'" <address@hidden> > Subject: compiling netCDF in an ultra-60 Wstation > Organization: NASA/GFSC > Keywords: netCDF large file The above message contained the following: > We have just installed the netCDF library in our SolarisOS 5.8 in a Sparc > Ultra-60. The installation of the netCDF library followed the instructions > found in the NetCDF website for this OS: > CC=/opt/SUNWspro/bin/c89 > CFLAGS="-xarch=v9" # 64-bit SPARC binary > FC=/opt/SUNWspro/bin/f90 > FFLAGS="-w -xarch=v9" > CXX=/opt/SUNWspro/bin/CC > CXXFLAGS="-xarch=v9" > > > I am having trouble in compiling a fortran code, actually the failure is at > the linking stage. The error message I get is: > > 40 sunhsieh% make > f77 -o farop_v13.exe main.o case15rad.o case234rad.o getsungeo.o > getphase2.o get3param.o readnaap.o readnogaps2.o interpsun.o interp.o > extscat.o raycross.o efftable.o waterabs.o handle_err.o > /export/home/ji/netcdf-3.5.0/lib/libnetcdf.a > ld: fatal: file main.o: wrong ELF class: ELFCLASS64 > ld: fatal: File processing errors. No output written to farop_v13.exe > make: *** [farop_v13.exe] Error 1 > > > It seems that it is related to whether it is a 64 or 32 bits compilation. > But even when I put the right flags appropriate (and I tried several > combinations), I keep getting the same error. > > Do you have any suggestions? Maybe I need to reinstall or is it an issue of > the compiler (it's the Sun compiler)? Strictly speaking, this isn't a netCDF-related problem. I might be able to help, however, based on how the netCDF package builds 64-bit programs on a SunOS 5.8/SPARC system. What is the absolute pathname of your f77(1) utility? The netCDF package ensures that the "-xarch=v9" option is always specified on the C and Fortran compilation commands. The f77(1) command above doesn't have that option. You should be able to use the file(1) utility to examine the object-modules in the above f77(1) link-command and determine which ones are 32-bit and which are 64-bit (you can't mix them). Please let me know what you discover. Regards, Steve Emmerson