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.
Hi, > I am trying to compile netcdf 4 in my mac book OS x 10.5.7 with > following env variables > > export F77=gfortran > export F90=gfortran > export CC=/usr/bin/gcc > export CXX=/usr/bin/c++ > export CPP='/usr/bin/cpp -C -P -xassembler-with-cpp -traditional' > export FFLAGS='-g -O2 -ffixed-form -fno-underscoring -m64' > export FCFLAGS='-g -O2 -m64' > export F90FLAGS='-g -O2 -ffree-form -fno-underscoring -m64' > export FCFLAGS_f90='-g -O2 -m64' > export CFLAGS='-m64 -O3 -DMACOS -fno-common' > export CXXFLAGS='-m64 -O3 -DMACOS -fno-common' > export CPPFLAGS='-Df2cFortran -DNDEBUG' > export LIBS='-lSystemStubs' > ./configure --prefix=/usr/local/gfort/netcdf It's possible that the C compiler you are using from /usr/bin/gcc is not compatible with the gfortran you are using, because gfortran is not available from Apple, but /usr/bin/gcc, is from the Apple XCode developer tools, but you may have gotten gfortran from the fink software packaging system. I believe that gfortran requires at least gcc 4.3, so if your version of gcc is earlier than this, it may not work with gfortran. You can get a binary of netcdf with gfortran support from the fink package management system, as described here in the comment from Roy: http://www.macresearch.org/how-install-netcdf-gfortran-libraries and the fink system will make sure you have a compatible gcc installed. You can also get gfortran and a matching gcc 4.3 version doirectly from macreasearch: http://www.macresearch.org/gfortran-leopard There's a bit more information here: http://www.macresearch.org/netcdf-gfortran If the links above still don't help, I recommend posting your question to the address@hidden mailing list. I think there are users on that list who have compiled with gfortran on Mac laptops ... --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: OMZ-758902 Department: Support netCDF Priority: High Status: Closed