I could not install netcdf when I upgraded to Scientific Linux 6.1 (x86-64). After “configure” I found an error like
Error: ld: cannot find -lm
This error appears because the static version of glibc is not installed anymore on a newer redhat like linux (see here). Thus you need to install it.
# yum install glibc-static.x86_64
netCDF-3.6.3 may still be better to be installed for FVCOM. In case using Intel compilers 12.1.3 for FVCOM, you also need to compile netCDF using the same compilers. The following environmental parameters in bash may be fine. Here “-xHost” is a flexible option for optimization available on each system.
export CFLAGS='-O3 -xHost -ip -no-prec-div -static'
export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static'
export FFLAGS='-O3 -xHost -ip -no-prec-div -static'
export CPP='icc -E'
export CXXCPP='icpc -E'
Then you can compile and install netCDF in the extracted directory as follows:
$ ./configure --prefix=/usr/local/netcdf-3.6.3-ifc12.1.3
$ make check # optional test
# make install