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: Joseph Shacat <address@hidden> >Subject: NetCDF installation on Mac OS X >Organization: University of Hawaii >Keywords: 200406250124.i5P1O0Wb001517 netCDF 3.5.1 MacOS-X Hi, Joseph, > I am having troubles installing NetCDF ver. 3.5.1 on my system with Mac OS > 10.3.4. I have tried the suggestions in the "Reporting Problems" section > of the "Installing NetCDF" page. > > Here is a brief summary of my efforts: > > 1) NetCDF 3.5.1 would not compile (?) when trying to install via the GMT > installer. > > 2) I downloaded the "last beta release", uncompressed it with Stuffit. I > set environment variables as such: We're in the process of preparing a new beta release, so currently what you got is the same as the normal 3.5.1 release. > setenv CC /usr/bin/cc > setenv CXX /usr/bin/c++ > setenv FC "" > > (I am using tcsh and don't have a Fortran compiler installed, to my > knowledge). > > 3) ran "make distclean" - this went fine, no errors You don't need to run "make distclean" with a newly acquired source distribution that was just uncompressed with StuffIt, but you do need to change to the "src/" subdirectory of the distribution before trying to run the "configure" script. I would have expected errors from "make distclean" run on a new distribution, because the configure script hasn't created the necessary Makefiles yet. If you were using the distribution you tried with the GMT installer, then "make distclean" might run without errors. > 4) there was no "config.cache" file to remove Right, there wouldn't be in a new distribution. > 5) ran ./configure with no error mesages. Not sure though how to redirect > standard output and standard error to "configure.log". Would this just be > via "./configure >> configure.log" ??? No, if you're using tcsh, you need to use this syntax: % ./configure >& configure.log The resulting configure.log should look like: creating cache ./config.cache checking for top-level source-directory /Users/jshacat/netcdf-3.5.1/src checking for m4 preprocessor checking for m4... m4 checking m4 flags... -B10000 checking C compiler "/usr/bin/cc"... works checking how to make dependencies... false checking for /usr/bin/c++... /usr/bin/c++ checking C++ compiler "/usr/bin/c++"... works checking how to run the C preprocessor... /usr/bin/cc -E configure: warning: Fortran-77 compiler is explicitly null configure: warning: The Fortran-77 interface will not be built checking for Fortran .F compiler... checking for Fortran preprocessor... /usr/bin/cc -E checking "" as Fortran-90 compiler... failed to build test program checking for xlf90... no checking for f90... no configure: warning: Could not find working Fortran-90 compiler configure: warning: The Fortran-90 interface will not be built checking for nm utility checking for nm... nm checking nm flags... checking for math library checking for tanh in -lc... yes checking for ar utility checking for ar... ar checking ar flags... cru checking for nm utility checking for nm... (cached) nm checking nm flags... checking for ranlib... ranlib checking for stdlib.h... yes checking for sys/types.h... yes checking for strerror... yes checking for working ftruncate()... yes checking for working alloca.h... yes checking for alloca... yes checking for st_blksize in struct stat... yes checking for IEEE floating point format... 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 checking for uchar... no checking whether char is unsigned... no checking whether byte ordering is bigendian... yes checking size of short... 2 checking size of int... 4 checking size of long... 4 checking size of float... 4 checking size of double... 8 checking size of off_t... 8 checking size of size_t... 4 checking for catman... catman checking for manual-page index command... catman -w -M $(MANDIR) checking binary distribution directory... /home/ftp/pub/binary/dummy_system updating cache ./config.cache creating ./config.status creating macros.make udcreating fortran/nfconfig.inc creating libsrc/ncconfig.h > 6) ran "make" and get the following errors: > > Making `all' in directory /Users/jshacat/netcdf-3.5.1/src/libsrc > > /usr/bin/cc -c -O -I. -DNDEBUG attr.c > /usr/bin/cc -c -O -I. -DNDEBUG dim.c > /usr/bin/cc -c -O -I. -DNDEBUG error.c > error.c: In function `strerror': > error.c:23: error: conflicting types for `sys_nerr' > /usr/include/stdio.h:258: error: previous declaration of `sys_nerr' > error.c:24: error: conflicting types for `sys_errlist' > /usr/include/stdio.h:259: error: previous declaration of `sys_errlist' > make[2]: *** [error.o] Error 1 > make[1]: *** [subdir_target] Error 1 > make: *** [libsrc/all] Error 2 I just tried the same thing on a Mac running 10.3.4 and it worked fine: Making `all' in directory /Users/russ/work/netcdf-3.5.1/src/libsrc /usr/bin/cc -c -O -I. -DNDEBUG attr.c /usr/bin/cc -c -O -I. -DNDEBUG dim.c /usr/bin/cc -c -O -I. -DNDEBUG error.c /usr/bin/cc -c -O -I. -DNDEBUG -DVERSION=`cat ../VERSION` libvers.c /usr/bin/cc -c -O -I. -DNDEBUG nc.c /usr/bin/cc -c -O -I. -DNDEBUG ncio.c /usr/bin/cc -c -O -I. -DNDEBUG ncx.c ... /usr/bin/c++ -c -I../libsrc -I. -DNDEBUG nctst.cpp /usr/bin/c++ -o nctst nctst.o libnetcdf_c++.a -L../libsrc -lnetcdf Returning to directory /Users/russ/work/netcdf-3.5.1/src Not making `fortran/all' because no FORTRAN compiler Not making `f90/all' because no FORTRAN-90 compiler > This is the same set of errors I get when trying to install NetCDF > through the GMT installer (install_gmt). > > In the meantime, I was able to download the MacOSX binary for NetCDF > 3.5.0. > > Any suggestions would be greatly appreciated. Please run the ./configure command again and send us the output. Also, after running the configure script, the file netcdf-3.5.1/src/libsrc/ncconfig.h should have the following on lines 24 and 25: /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 to indicate that standard C header files were detected by the configure script. If it doesn't, that would explain the error you got and would indicate that something serious is wrong with the compilation environment, in which case you might want to reinstall the Panther Developer Tools that came with the system. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu/staff/russ