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: Olivier Marti <address@hidden> > Subject: Problem with NetCDF on Mac OS X > Organization: Laboratoire des Sciences du Climat et de l'Environnement > Keywords: 200402121317.i1CDHup1027678 netCDF MacOS-X Olivier, >> I'm trying to install NetCDF on Max OS X. Onlys the C anf Fortran 77 >> (IBM xlf) interface. Config and compilation are OK, but the test >> crashes. > > This error occurs in testing the C interface, so it doesn't look like > it is related to your use of the IBM xlf compiler. We know that the > current netCDF 3.5.1 release compiles and tests correctly on Mac OS X > 10.3, although we used g77 rather than xlf. Can you try the 3.5.1 > version of netCDF, available from: > > ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.Z > > instead of 3.5.0? If it still doesn't work, please send us the > details. We don't have an xlf compiler installed on our Mac OS X > platform, so we haven't tested the release with that compiler. > > > Russ, > > Thank you for your answer. NetCDF 3.5.1 hasn't solved the problem. I've > simplified my installation by not trying to build any Fortran > interface. It keeps failing in the test phase. What puzzles me in this > version is : > > gcc -c -g -I../libsrc -I. load.c > Warning: ncgentab.c is out-of-date with respect to ncgen.y > Warning: It should be recreated via yacc on an OSF/1 system > > Is it a real problem, explaining the failure in the test phase, or not ? No, that is not a symptom of a real problem, and I'm not sure why it is even occurring. When I unpack the 3.5.1 distribution and look at the dates on the files with "ls -lt" it lists ncgentab.c as the more recently modified file: -rw-r--r-- 1 russ ustaff 42517 Jan 20 2002 ncgentab.c -rw-r--r-- 1 russ ustaff 22503 Jan 20 2002 ncgen.y even though the listed dates are identical. Also the problem you are seeing is with testing the core netcdf library, not the ncgen utility that depends on the library: > Making `test' in directory /usr/local/install/netcdf-3.5.1/src/libsrc > > gcc -c -g -I. t_nc.c > ar cru libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o > putget.o string.o v1hpg.o v2i.o var.o > ranlib libnetcdf.a > gcc -o t_nc -g t_nc.o -L. -lnetcdf > ./t_nc > trying again > make[2]: *** [test] Error 28 > make[1]: *** [subdir_target] Error 1 > make: *** [libsrc/test] Error 2 But this seems to be different from the error you first reported: > gcc -c -g -I. -DIBMR2Fortran t_nc.c > ar cru libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o > putget.o string.o v1hpg.o v2i.o var.o > ranlib libnetcdf.a > gcc -o t_nc -g t_nc.o -L. -lnetcdf > ./t_nc > posixio.c:189: failed assertion `*posp == OFF_NONE || *posp == > lseek(nciop->fd, 0, SEEK_CUR)' > make[2]: *** [test] Abort trap > make[1]: *** [subdir_target] Error 1 > make: *** [libsrc/test] Error 2 I just tried 3.5.1 on a MacOSX system with the Developer Tools installed. However, I notice you are using an earlier Mac OS X version that I don't have access to (10.2?): > uname -a : > Darwin lsce3005.local. 6.8 Darwin Kernel Version 6.8: Wed Sep 10 > 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power > Macintosh powerpc My platform (Mac OS X 10.3.2) has: uname -a : Darwin mort.unidata.ucar.edu 7.2.0 Darwin Kernel Version 7.2.0: Thu Dec 11 16:20:23 PST 2003; root:xnu/xnu-517.3.7.obj~1/RELEASE_PPC Power Macintosh powerpc We are both using gcc-3.3, but my version is a little later: > gcc -v : > Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs > Thread model: posix > gcc version 3.3 20030304 (Apple Computer, Inc. build 1493) gcc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs Thread model: posix gcc version 3.3 20030304 (Apple Computer, Inc. build 1495) Also from the output of configure, you have: > checking how to run the C preprocessor... /lib/cpp but when I ran configure, I got checking how to run the C preprocessor... gcc -E Is there some environment variable you set to specify using "/lib/cpp" as the C preprocessor? If so, I recommend unsetting it so that "gcc -E" will be used, but I don't know whether this has anything to do with the problem you are seeing. Another difference in the configure output may be more significant: > checking for stdlib.h... no > checking for sys/types.h... no ... > checking for ANSI C header files... no > checking for size_t... no > checking for off_t... no > checking for ssize_t... no > checking for ptrdiff_t... no whereas I got checking for stdlib.h... yes checking for sys/types.h... yes ... checking for ANSI C header files... yes checking for size_t... yes checking for off_t... yes checking for ssize_t... yes checking for ptrdiff_t... yes This leads me to suspect a problem in the installation of gcc-3.3 on your Mac. I'm just guessing, but did you attempt to install gcc-3.3 on an older Mac platform (for example, Mac OS X 10.1 or 10.2) and have problems with installing the include files or libraries? I think netCDF 3.5.1 will install and test OK on Mac OS X 10.1 or 10.2, but only if the version of gcc that came with those operating system versions is used. On my Mac OS X system, all the tests complete successfully after this point, so I can't reproduce the problem you are seeing in running the t_nc test ... --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu/staff/russ