version: 3.6.3
source: http://www.unidata.ucar.edu/downloads/netcdf/
Make sure to get at least version 3.6.2, as it has a much simpler configuration. Untested with v4.
Netcdf builds as a static library only.
In the netcdf source:
export MACOSX_DEPLOYMENT_TARGET=10.5 ./configure --disable-dependency-tracking --enable-c-only \\ CFLAGS="-Os -arch ppc -arch i386 -arch ppc64 -arch x86_64 -D_FILE_OFFSET_BITS=64"
Unless you need the C++ library, use the c-only option above (GDAL is C++, but uses the C library). The FILE_OFFSET_BITS option is from habit, and may not be needed now.
After configuration, edit config.h and replace lines:
– the SIZEOF_LONG line with:
#ifdef __LP64__ #define SIZEOF_LONG 8 #else #define SIZEOF_LONG 4 #endif
– the SIZEOF_SIZE_T line with:
#ifdef __LP64__ #define SIZEOF_SIZE_T 8 #else #define SIZEOF_SIZE_T 4 #endif
– the WORDS_BIGENDIAN line with:
#ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN 1 #else #undef WORDS_BIGENDIAN #endif
make sudo make install
In the netcdf source:
export MACOSX_DEPLOYMENT_TARGET=10.4 ./configure --disable-dependency-tracking --enable-c-only \\ CFLAGS="-Os -arch ppc -arch i386 -D_FILE_OFFSET_BITS=64"
Edit config.h and replace lines:
– the WORDS_BIGENDIAN line with:
#ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN 1 #else #undef WORDS_BIGENDIAN #endif
make sudo make install
In the netcdf source:
./configure --disable-dependency-tracking --enable-c-only \\ CFLAGS="-Os -D_FILE_OFFSET_BITS=64" make sudo make install