Re: [netcdfgroup] Building netCDF on OS X 10.10

On Feb 27, 2015, at 6:54 PM, Roy Mendelssohn - NOAA Federal 
<roy.mendelssohn@xxxxxxxx<mailto:roy.mendelssohn@xxxxxxxx>> wrote:

Hi Ken:

If I had to guess, from the installation instructions:

After HDF5 is done, build netcdf, specifying the location of the HDF5, zlib, 
and (if built into HDF5) the szip header files and libraries in the CPPFLAGS 
and LDFLAGS environment variables.

    CPPFLAGS=-I/home/ed/local/include LDFLAGS=-L/home/ed/local/lib ./configure 
    make check install

The configure script will try to find necessary tools in your path. When you 
run configure you may optionally use the --prefix argument to change the 
default installation directory. The above examples install the zlib, HDF5, and 
netCDF-4 libraries in /home/ed/local/lib, the header file in 
/home/ed/local/include, and the utilities in /home/ed/local/bin.

Check that your CPPFLAGS and LDFLAGS are defined as needed before you do the 
configure and make.



Thanks, Roy.  That did the trick.

I attach below the commands that I used to build the installation in case this 
is helpful to others.

Cheers, Ken

Installing netCDF from the command line on OS X 10.10 with netCDF-4 support


1.  You should be logged in as an administrative user.

2.  Check the various source distributions for newer versions before installing.

3.  Be sure to run the Xcode app on your Mac before attempting to install the 
following software.  The initial run of Xcode installs some software 
development components that are necessary for the builds to succeed.  You can 
then quit Xcode and run the installs from the command line.

4.  The commands below install the various libraries in /usr/local.

Installing zlib v1.2.8

curl -o zlib-1.2.8.tar.gz
gunzip zlib-1.2.8.tar.gz
tar -xf zlib-1.2.8.tar
rm zlib-1.2.8.tar
cd zlib-1.2.8
sudo make install
cd ..

Installing HDF5 v1.8.14

curl -o 
gunzip hdf5-1.8.14.tar.gz
tar -xf hdf5-1.8.14.tar
rm hdf5-1.8.14.tar
cd hdf5-1.8.14
./configure --prefix=/usr/local
make check
sudo make install
sudo make check-install
cd ..

Installing netCDF v4.3.3.1

curl -o 
gunzip netcdf-
tar -xf netcdf-
rm netcdf-
cd netcdf-
CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure 
make check
sudo make install
cd ..

  • 2015 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: