Page 1 of 1

Yambo 5.2.4 compilation with spack

Posted: Wed Apr 09, 2025 10:02 am
by cloirec
- compiler : gcc version 12.2.1 20221121 (Red Hat 12.2.1-7) (GCC)
- arch : AMD/genoa x86_64
- parallel version
- Yambo version : 5.2.4

I'm opening this topic just to inform developers, and in particular those in charge of the configure file, that I'm having a problem installing yambo version 5.2.4 with spack. I think the problem comes from the configure file. Here's the compile command I use after loading modules making external libraries (fftw, hdf5, netcdf,blas,lapack) accessible to yambo :

./configure --enable-open-mp --enable-mpi --prefix=/............/yambo/5.2. 4 --with-blas-libs=“-L$CRAY_PE_LIBSCI_PREFIX/lib -lsci_gnu_121 -lsci_gnu_121” --with-lapack-libs=“-L$CRAY_PE_LIBSCI_PREFIX/lib -lsci_gnu_121 -lsci_gnu_121” --with-hdf5-path=“$HDF5_ROOT” - -with-netcdf-path=“$NETCDF_C_ROOT” --with-netcdff-path=“$NETCDF_FORTRAN_ROOT” --with-fft-path=“$FFTW_ROOT” FFLAGS=“-fallow-argument-mismatch” FCFLAGS="-fallow-argument-mismatch”

The directories for the libraries and include files for its tools (fft, ...etc) are found. However, the creation of the config/setup file is erroneous. There are carriage returns for the lhdf5 and ihdf5 variables, as the lines below show:

lhdf5 =

-L/......./__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/hdf5-1.14.3-gcc-12.1.genoa-q7wq/lib -lhdf5_fortran -lhdf5 -I/opt/cray/pe/mpich/8.1.28/ofi/gnu/10.3/include -I/opt/cray/pe/mpich/8.1.28/ofi/gnu/10.3/include -L/opt/cray/pe/mpich/8.1.28/ofi/gnu/10.3/lib -lmpifort_gnu_103 -lmpi_gnu_103
ihdf5 = -I

/......../__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/hdf5-1.14.3-gcc-12.1.genoa-q7wq/include
hdf5_opt = --enable-parallel
hdf5_mode = production

If I modify the config/setup file by removing the carriage returns and use the command: “make main”, the compilation completes and yambo is installed.

But when installing with spack, the config/setup file cannot be modified manually. I can modify the spack recipe via yambo's package.py file, but I think it would be simpler to correct the configure file, or at least the config/setup file creation step. That's why I wanted to send you this information

Regards,
M. Cloirec

Re: Yambo 5.2.4 compilation with spack

Posted: Wed Apr 09, 2025 10:48 am
by cloirec
This seems to be due to the use of the h5pfc and h5fc tools from line 13841 to line 13850 of the configure file.
A solution could be to replace these lines with :

if test -e $h5pfc && test $IO_LIB_VER = “parallel”; then
try_HDF5_LIBS=`$h5pfc -show | awk -F'-L' '{$1=“”; for (i=2; i<=NF;i++) $i=“-L”$i; print $0}'| sed '/^\s*$/d'`
try_hdf5_incdir=`$h5pfc -show | awk -F'-I' '{print $2}' | awk '{print $1}'| sed '/^\s*$/d'`
IO_LIB_VER=“parallel”;
elif test -e $h5fc && test $IO_LIB_VER = “serial”; then
try_HDF5_LIBS=`$h5fc -show | awk -F'-L' '{$1=“”; for (i=2; i<=NF;i++) $i=“-L”$i; print $0}'| sed '/^\s*$/d'`
try_hdf5_incdir=`$h5fc -show | awk -F'-I' '{print $2}' | awk '{print $1}'| sed '/^\s*$/d'`
IO_LIB_VER=“serial”;
enable_hdf5_par_io=“no”;
fi

Regards,
M. Cloirec

Re: Yambo 5.2.4 compilation with spack

Posted: Wed Apr 09, 2025 10:55 am
by Nicola Spallanzani
Dear M. Cloirec,
please sign your posts with your name and affiliation, this is a rule of the forum, and you can do once for all by filling your user profile.

If you are using spack for the installations you can use my external repo
https://github.com/nicspalla/my-repo

In the Yambo recipe there is the patch to solve the hdf5 issue.
In the README file there are instructions to configure spack.
Let me know if you need more help on spack.

Best regards,
Nicola

Re: Yambo 5.2.4 compilation with spack

Posted: Wed Apr 09, 2025 1:04 pm
by cloirec
Thank you for your feedback, I will follow the information on https://github.com/nicspalla/my-repo

Regards
-------------------
M. Cloirec
CINES - Centre Informatique National de l’Enseignement Supérieur
Montpellier, France
https://www.cines.fr/