First create a directory where you are going to store all you libraries. It is common to create this directory under /local/name_of_the_compiler. In my case I want to compile using Intel 13 compiler and therefore I will issue:
cd local mkdir Intel13
wget http://zlib.net/zlib-1.2.8.tar.gz tar -xvf zlib-1.2.8.tar.gz
Then go into the folder and issue:
./configure --prefix='/home/ucl/naps/sponce/local/Intel13' make make install
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.11.tar tar -xvf hdf5-1.8.11.tar
Then go into the folder and issue:
./configure --with-zlib=/home/ucl/naps/sponce/local/Intel13 --prefix=/home/ucl/naps/sponce/local/Intel13 --enable-fortran --enable-cxx make make install
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.1.3.tar.gz tar -xvf netcdf-4.1.3.tar.gz
Because the –with-hdf5= option does not work for necdf-4.1.3, you will need to export HDF5 location paths as follows:
export CPPFLAGS=-I/home/ucl/naps/sponce/local/Intel13/include/ export LDFLAGS=-L/home/ucl/naps/sponce/local/Intel13/lib export LD_LIBRARY_PATH=/home/ucl/naps/sponce/local/Intel13/lib export FC=ifort export CC=icc
Then issue:
./configure --enable-netcdf4 --prefix=/home/ucl/naps/sponce/local/Intel13 --enable-dap --enable-shared make make install
Be careful if you have set flags into you .ac file. You should unset the variable first:
unset FC unset CC
You should then add the following lines into your .ac configuration file:
with_netcdf_incs="-I/home/ucl/naps/sponce/local/Intel13/include" with_netcdf_libs="-L/home/ucl/naps/sponce/local/Intel13/lib -lnetcdf -lnetcdff" with_trio_flavor="netcdf+etsf_io"
For some mpi-io parallel I/O fancy stuff you may need to add the hdf5 explicitly
with_netcdf_incs="-I/home/ucl/naps/sponce/local/Intel13/include " with_netcdf_libs="-L/home/ucl/naps/sponce/local/Intel13/lib -lnetcdf -lnetcdff -lhdf5_fortran -lhdf5_hl -lhdf5" with_trio_flavor="netcdf+etsf_io"
Note that here all of the libraries have been put in the same lib and include directories for convenience (otherwise you need to add the corresponding -I<path>/include and -L<path>/lib statements)
Then you should make a build directory into Abinit and issue:
../configure --with-config-file='./name_of_your_ac_file.ac' make mj4