I'm trying to install Netcdf 4 which supports an air quality model that I will compile after finishing this netcdf installation.
However, I faced the "error: Can't find or link to the hdf5 library" which I found several solutions from your website and others, however, all do not work.
My steps to install include:
#install zlib:
tar xvzf zlib-1.2.11.tgz
cd zlib-1.2.11
mkdir /usr/local/zlib-1.2.11
./configure --prefix=/usr/local/zlib-1.2.11
make
make install
#install hdf5
tar xvzf hdf5-1.12.0.tar.gz
cd hdf5-1.12.0
mkdir /usr/local/hdf5-1.12.0
exportLDFLAGS=-L/usr/local/zlib-1.2.11
export FC=gfortran
./configure --prefix=/usr/local/hdf5-1.12.0 --enable-fortran
make
make install
#Install netcdf
tar xvzf netcdf-4.6.2.tar.gz
cd netcdf-4.6.2
mkdir /usr/local/netcdf-4.6.2
export CFLAGS=-I/usr/local/hdf5-1.12.0/include
export LDFLAGS=-L/usr/local/hdf5-1.12.0/lib
export LD_LIBRARY_PATH=/usr/local/hdf5-1.12.0/lib/
export FC=gfortran
./configure --prefix=/usr/local/netcdf-4.6.2
then faced the error message:
"checking for library containing H5Fflush... no
configure: error: Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors."
My laptop information is:
Static hostname: it-Precision-7520
Icon name: computer-laptop
Chassis: laptop
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.11.0-27-generic
Architecture: x86-64
Please advise me what could be the problem? How could I solve it?
Thank you very very much.
Chi