How to Install netCDF4 on Linux Ubunto:

Open a terminal, then write the following commands to install zlib, HDF5 and netCDF4 respectively (change 'noori' with your home account):

NOTE:If “make check” fails for either zlib or HDF5, the problem must be resolved before the netCDF-4 installation can continue.

Install zlib (e.g. version 1.2.5)

Uncompress the file, go inside the directory (e.g., Downloads/zlib-1.2.5) and then run the following commands:

$ ./configure --prefix=/home/noori/zlib125

$ sudo make check install   

Install HDF5 (e.g. version 1.8.7)

Uncompress the file, go inside the directory (e.g., Downloads/hdf5-1.8.7) and then run the following commands:

$ ./configure --with-zlib=/home/noori/zlib125 --prefix=/home/noori/hdf5187 --disable-shared

$ sudo make check install   

After HDF5 and zlib installation is done,its time to build netCDF:

Install Netcdf (e.g. version 4.1.3)

Uncompress the file, go inside the directory (e.g., Downloads/netcdf-4.1.3) and then run the following commands:

$ ./configure --enable-netcdf-4 --enable-large-file-tests --enable-ncgen4 --with-hdf5=/home/noori/hdf5187 --with-zlib=/home/noori/zlib125 --prefix=/home/noori/netcdf4 

$ sudo make check install

How to compile and install udunits library

The Udunits library UDUNITS supports conversion of unit specifications between formatted and binary forms, arithmetic manipulation of units, and conversion of values between compatible scales of measurement. See http://www.unidata.ucar.edu/software/udunits/ for further documentation and for download.

Uncompress the file, go inside the directory (e.g., cd /Users/matteo/Downloads/udunits-2.1.24) and then type the following commands:

$ ./configure  --prefix=/Users/matteo/local

$ make check install-html install-pdf