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.
>From: address@hidden (Graham Campbell) >Organization: BNL >Keywords: 199508291425.AA16025 netCDF AIX Ballard, >I am using the netCDF library on an IBM Risc6000. >which is running AIX v3.2 The netCDF library was built by >someone else on this platform. I have no problem reading >and writing netcdf files using the C routines, but I am >only able to read - not write - files using the Fortran >calls. Specifically: when I try NCID=NCCRE(etc.,.....) >it always returns a bad flag. I have of course tested >the program by writing ascii files beforehand. >What do you think might be wrong? There is a known problem with the C optimizer on AIX 3.2. Here is the listing from the netCDF FAQ (http://www.unidata.ucar.edu/packages/netcdf/faq.html): We have observed a problem with the optimizer in the C compiler of AIX 3.2. The default for our configure script is to specify optimization by using the "-O" compiler flag, but that causes the netCDF library to be built incorrectly under AIX 3.2, with the symptom that "make test" will fail even though there are no compile or link errors when building from source. A workaround is to build the netCDF library with CFLAGS="" (or "-g") explicitly, by setting the environment variable CFLAGS to "" or "-g" before invoking configure, or by using one of the other methods suggested in the INSTALL file to prevent the use of the "-O" flag for compilation. The specific file that is incorrectly compiled with "-O" is libsrc/string.c, so another workaround is to recompile that file without "-O". Delete the ncgen and ncdump executables before rebuilding, so they will get rebuilt using the new library. NOTE: This is no longer a problem on AIX 4.1.2. This may be causing the problem you are experiencing although we had noticed that read/writes in the C interface would fail. >Do you suggest rebuilding >the netCDF library with a FFLAGS = -g instead of -O ? >Thanks for any light you can shed on this matter >ballard andrews (address@hidden) Since there is no Fortran compiler involved in the netCDF build, this would not do anything (the Fortran jackets are functions written in C). Try rebuilding the library seting the CFLAGS macro as indicated above. Tom Yoksas