# Compiling 64-bit NetCDF4 with HDF5 on Mac OS X

I needed a 64-bit version of HDF5 and NetCDF4, here’s how you get that going on Mac OS X 10.6.

export CC='gcc' CFLAGS='-g -m64' CFLAGS='-g -m64' CXXFLAGS='-g -m64' HDF5DIR='/path/to/hdf5/folder' LIBS='-lsz' LDFLAGS='-L/path/to/hdf5/folder/lib' You will obviously have to use the true path to the folder.
./configure --disable-f77 --disable-f90 --target=x86_64-apple-darwin -build=x86_64-apple-darwin --host=x86_64-apple-darwin --with-hdf5=$HDF5DIR --with-zlib=$HDF5DIR --with-szlib=\$HDF5DIR --enable-shared
I ran make check and everything worked well. I just wanted the resulting libraries, which can be found in liblib/.libs/, but I’m sure you can do a make install if you actually want to install the libraries.