Compile the libraries in Yambo independently

From The Yambo Project
Revision as of 22:54, 1 February 2022 by Attacc (talk | contribs)
Jump to navigation Jump to search

In general Yambo requires a series of libraries: HDF5, NetCDF-c, NetCDF-f, fft, lapack, blacs, iotk, libxc
plus a series of optional libreries: yaml, slepc, petsc, blacs, scalapack, futile.

Some of this libraries are included in the Yambo package, while other are downloaded from the internet.
In general Yambo configure and compile all these libraries. However on some particular computer, configure/compilation of a specific library can fail.
Here we will show you how to compile and install some of them and the use with Yambo.

If you configured Yambo and the compilation is stuck at some library you can find the tar.gz file of the libraries in:

lib/archive/

for example:

fftw-3.3.6-pl1.tar.gz  iotk-y1.2.2.tar.gz  Makefile      netcdf-c-4.7.4.tar.gz        package.list
hdf5-1.12.0.tar.gz     libxc-5.1.5.tar.gz  Makefile.loc  netcdf-fortran-4.5.3.tar.gz

The file package.list contains the libraries list and the link to download them.
Now we will show some example of external compilation of these libraries using intel fortran.
First of all create a folder where you want install them, in our case: /home/pippo/mylib

We start from hdf5, unpack the library and then configure it with the command:

cd hdf5-1.12.0/
./configure FC=mpif90 CC=mpicc CXX=mpicc --enable-fortran --enable-build-mode=production --enable-parallel --prefix=/home/ecannuccia/YamboLibs/
make 
make install

then the netcdf-c that requires the previous compiled HDF5:

 export LD_LIBRARY_PATH="/home/pippo/mylib/lib:$LD_LIBRARY_PATH"
./configure FC=ifort CC=icc CXX=icc --prefix=/home/pippo/mylib/ LIBS="-L/home/pippo/mylib/lib" CFLAGS="-O2 -I/home/pippo/mylib/include/" 
make 
make install

then the netcdf-f that requires the netcdf-c to be configured and compiled:

 ./configure FC=ifort F77=ifort CC=icc CXX=icc --prefix=/home/pippo/mylib/ LIBS="-L/home/pippo/mylib/lib" CFLAGS="-O2 -I/home/pippo/mylib/" 
 make 
 make install

In a similar way you can configure the other libraries. In this way you can solve problems in in each library individually.

Then you can link them in Yambo with the command:

./configure --with-hdf5-path=/home/pippo/mylib --with-netcdf-path=/home/pippo/mylib --with-netcdff-path=/home/pippo/mylib