1. Go to http://www.unidata.ucar.edu/downloads/netcdf/index.jsp, download The netCDF C library and utilities, version 4.2.1.1 and The netCDF Fortran 77 and Fortran 90 libraries.
2. tar -xzvf netcdf-4.2.1.1
tar -xzvf netcdf-fortran-4.2
3. cd netcdf-4.2.1.1
./configure --disable-netcdf-4 --disable-dap
Install location is /usr/local, you can change the location with --prefix=....
4. cd ../netcdf-fortran-4.2
CPPFLAGS=-I/usr/local/include LD_LIBRARY_PATH=/usr/local/lib LDFLAGS=-lnetcdf ./configure
export LD_LIBRARY_PATH=/usr/local/lib #before make check
make check
sudo make install

浙公网安备 33010602011771号