Install Yambo with external HDF5 and NetCDF libraries

From The Yambo Project
Revision as of 17:36, 9 January 2022 by Attacc (talk | contribs)
Jump to navigation Jump to search

In the major part of supercomputing centre HDF5 and NetCDF libraries are already installed.
Here we will show how to configure Yambo to use the installed libraries instead of the internal ones.

HFD5 libraries

First of all you have to load the corresponding modules, if available, with something like:

module load hdf5_1.12.0

then you should have in your PATH the executable h5pfc that is a fortran compiler that
automatically link the HDF5 libraries. Now we will extract from this compiler all information to configure Yambo.

Just type:

h5pfc -show

the compiler will show the command line to compiler codes with HDF5, it will look something like (we added the colors):

mpiifort -assume bscc -O3 -g -ip -I/home/netcdf/hdf5-1.12.0_rosa/include -L/home/netcdf/hdf5-1.12.0_rosa/lib  /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5hl_fortran.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5_hl.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5_fortran.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5.a -lz -ldl -lm -Wl,-rpath -Wl,/home/netcdf/hdf5-1.12.0_rosa/lib

from this line we can extract different information the include path in red (/home/netcdf/hdf5-1.12.0_rosa/include), the lib path(/home/netcdf/hdf5-1.12.0_rosa/lib) in green and the list of libraries. The simplest way to use this HDF5 is to pass the installation path to Yambo (remove include or lib at the end):

./configure --enable-hdf5-par-io --with-hdf5-path=/home/netcdf/hdf5-1.12.0_rosa/

if this does not work you can pass separately includedir, libdir and the list of libraries with the command:

./configure --enable-hdf5-par-io --with-hdf5-includedir=/home/netcdf/hdf5-1.12.0_rosa/include --with-hdf5-libdir=/home/netcdf/hdf5-1.12.0_rosa/lib  --with-hdf5-libs="/home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5hl_fortran.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5_hl.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5_fortran.a /home/netcdf/hdf5-1.12.0_rosa/lib/libhdf5.a -lz -ldl -lm"