HDF library specification

I have been using an easy-build for abinit, but it is a little old so I would like to compile the latest version of abinit. I have downloaded abinit-9.10.3 and am having trouble with configure. I am running centos 7.9 with the Intel oneapi compiler. I initially followed the INSTALL-CentOS.md script manually (as the script downloads an older version 9.0.4 of abinit). These included the libraries:

sudo dnf install gcc-gfortran
sudo dnf install mpich mpich-devel
sudo dnf install hdf5-mpich hdf5-mpich-devel
sudo dnf install netcdf-mpich-devel netcdf-fortran-mpich-devel
sudo dnf install libxc libxc-devel
sudo dnf install python3

The libraries were installed without trouble, but the configure script using the line

./configure FC=mpiifort CC=icx --with-config-file=aconfig.ac

with aconfig.ac contents

# installation location
prefix=/opt/abinit

# MPI settings
with_mpi="yes"
enable_mpi_io="yes"

# linear algebra settings
with_linalg_flavor="mkl"
#LINALG_LIBS="-L/usr/lib64 -lopenblas"

# mandatory libraries
with_hdf5="yes"
HDF5_LIBS=-L/opt/hdf5/lib -lhdf5 -lhdf5_hl
with_netcdf="yes"
with_netcdf_fortran="yes"
with_libxc="yes"

# FFT flavor
with_fft_flavor="dfti"
FFTW3_LIBS="-L${MKLROOT}/lib/intel64 -lfftw3 -lfftw3f"

# Enable Netcdf mode in Abinit (use netcdf as default I/O library)
enable_netcdf_default="yes"

fails stating that " WARNING : HDF5 is not WORKING !" as well the same not working for libxc. I initially thought that the HDF version I installed via yum (1.10.5) might be too old so I downloaded and built the latest HDF 1-14.2 and specified the path to the newly installed hdf5 libraries. I still see the same error message. Does anyone have an idea of how to fix this? Even better, does anyone have a aconfig.ac file that will work for CentOS 7.9 with the intel compiler. In any case, a suggestion as to what to try next would be greatly appreciated.

Hi,

a quick answer with a complet recipe to compile abinit v9.10 under CentOS 8.4.2105 + intel oneAPI 2021.5.0

get abinit sources :

wget https://www.abinit.org/sites/default/files/packages/abinit-9.10.3.tar.gz
tar xzf abinit-9.10.3.tar.gz
cd abinit-9.10.3

set environment for oneAPI :

source /opt/intel/oneapi/setvars.sh

create a aconfig.ac file :

CPP="icc -E"
CC="mpiicc"
CXX="mpiicpc"
FC="mpiifort"
FC_LIBS="-lstdc++ -ldl"

with_mpi="yes"
enable_mpi_io="yes"

with_linalg_flavor="mkl"
LINALG_CPPFLAGS="-I${MKLROOT}/include"
LINALG_FCFLAGS="-I${MKLROOT}/include"
LINALG_LIBS="-L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl"

enable_python_invocation="yes"
enable_gw_dpc="yes"
enable_netcdf_default="yes"

with_fft_flavor="dfti"
FFT_FCFLAGS="-I${MKLROOT}/include"

# FALLBACKS  : they will be generated later

launch configure for the first time :

./configure --with-config-file=aconfig.ac

as expected, the fallbacks do not work :wink:

we are now going to compile the fallbacks in the sources :

cd fallbacks/
./build-abinit-fallbacks.sh

at the end of the fallback compilation, the 4 with_* lines must be integrated into the aconfig.ac file

with_libxc=/home/buildbot/WorkSpace/abinit-9.10.3/fallbacks/install_fb/intel/2021.5/libxc/6.0.0
with_hdf5=/home/buildbot/WorkSpace/abinit-9.10.3/fallbacks/install_fb/intel/2021.5/hdf5/1.10.8
with_netcdf=/home/buildbot/WorkSpace/abinit-9.10.3/fallbacks/install_fb/intel/2021.5/netcdf4/4.9.0
with_netcdf_fortran=/home/buildbot/WorkSpace/abinit-9.10.3/fallbacks/install_fb/intel/2021.5/netcdf4_fortran/4.6.0

launch configure for the second time :

cd ..
./configure --with-config-file=aconfig.ac

if all goes well, the configuration ends well with these parameters :

Core build parameters
---------------------

  * C compiler        : intel version 2021.5
  * Fortran compiler  : intel version 2021.5
  * architecture      : intel xeon (64 bits)
  * debugging         : basic
  * optimizations     : standard

  * OpenMP enabled    : no (collapse: ignored)
  * MPI    enabled    : yes (flavor: auto)
  * MPI    in-place   : no
  * MPI-IO enabled    : yes
  ...
  * HDF5 enabled      : yes (MPI support: yes)
  * NetCDF enabled    : yes (MPI support: yes)
  * NetCDF-F enabled  : yes (MPI support: yes)

  * FFT flavor        : dfti (libs: user-defined)
  * LINALG flavor     : mkl (libs: user-defined)
  * SCALAPACK enabled : yes
  ...
  * FCFLAGS           : -g -extend-source -nofpscomp     ...
  * CPATH             :  ...

Thank you for your help. The compile procedure proceeded without error and I am in the process of running tests now (with all passing so far). I am not sure if it is important, but I am curious why my attempts to specify the HDF libraries I have installed (I built the most recent HDF from source) in the configure file. When I tried, I always found that the configure script would give an error saying that a HDF program could not be run (while the HDF supplied tests worked fine). All in all, I am happy with the version built so I will use this. I will also try adding the --with-gpu to the command line and see if this builds as painlessly as the procedure you showed me above. Thanks again!

I can try to reproduce the problem with your config.
But Iā€™ll need the OS version:

cat /etc/redhat-release

thx

Sure. I am running CentOS Linux release 7.9.2009 (Core). I am planning on switching the system over however in a month or so to Rocky Linux due to the ending of support for CentOS 7.

strangeā€¦
Iā€™ve never been able to compile under CentOS 7.9 with oneAPI
can you run :

ldd src/98_main/abinit

thx

Sure. You are probably referring to the GLIBCXX_3.4.21 problem I assume. I found a work around since the oneapi compilers donā€™t work without this library. I installed the latest version of gcc using mamba and then made a short bash script that appends the newer gcc library to the LD_LIBRARY_PATH environment variable without activating the mamba gcc environment. abinit runs fine with this setup and passes the tests. Of course, this is just another reason to update to Rocky Linux.

Without the LD_LIBRARY_PATH fix

-bash-4.2$ ldd src/98_main/abinit
src/98_main/abinit: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by src/98_main/abinit)
src/98_main/abinit: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by src/98_main/abinit)
	linux-vdso.so.1 =>  (0x00007ffea99cc000)
	libmkl_scalapack_lp64.so.2 => not found
	libmkl_intel_lp64.so.2 => not found
	libmkl_sequential.so.2 => not found
	libmkl_core.so.2 => not found
	libmkl_blacs_intelmpi_lp64.so.2 => not found
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcd51efe000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fcd51bfc000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fcd519f8000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fcd517e2000)
	libmpi.so.12 => /opt/intel/oneapi/mpi/2021.8.0/lib/release/libmpi.so.12 (0x00007fcd4fec5000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fcd4fbbd000)
	libmpifort.so.12 => /opt/intel/oneapi/mpi/2021.8.0/lib/libmpifort.so.12 (0x00007fcd4f809000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fcd4f601000)
	libifport.so.5 => not found
	libifcoremt.so.5 => not found
	libimf.so => not found
	libsvml.so => not found
	libirc.so => not found
	libc.so.6 => /lib64/libc.so.6 (0x00007fcd4f233000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcd5211a000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fcd4f01d000)

With the LD_LIBRARY_PATH fix
paulfons@kaon:~>cd /data/Software/abinit/abinit-9.10.3/
paulfons@kaon:/data/Software/abinit/abinit-9.10.3>ldd src/98_main/abinit
	linux-vdso.so.1 =>  (0x00007ffd7c6f2000)
	libmkl_scalapack_lp64.so.2 => /opt/intel/oneapi/mkl/2023.0.0/lib/intel64/libmkl_scalapack_lp64.so.2 (0x00002b7e6df58000)
	libmkl_intel_lp64.so.2 => /opt/intel/oneapi/mkl/2023.0.0/lib/intel64/libmkl_intel_lp64.so.2 (0x00002b7e6e685000)
	libmkl_sequential.so.2 => /opt/intel/oneapi/mkl/2023.0.0/lib/intel64/libmkl_sequential.so.2 (0x00002b7e6f8b1000)
	libmkl_core.so.2 => /opt/intel/oneapi/mkl/2023.0.0/lib/intel64/libmkl_core.so.2 (0x00002b7e712e7000)
	libmkl_blacs_intelmpi_lp64.so.2 => /opt/intel/oneapi/mkl/2023.0.0/lib/intel64/libmkl_blacs_intelmpi_lp64.so.2 (0x00002b7e6dd5a000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b7e756c9000)
	libm.so.6 => /lib64/libm.so.6 (0x00002b7e758e5000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002b7e75be7000)
	libz.so.1 => /data/mamba/envs/gcc/lib/libz.so.1 (0x00002b7e6dddd000)
	libmpi.so.12 => /opt/intel/oneapi/mpi/2021.8.0//lib/release/libmpi.so.12 (0x00002b7e75deb000)
	libstdc++.so.6 => /data/mamba/envs/gcc/lib/libstdc++.so.6 (0x00002b7e77708000)
	libmpifort.so.12 => /opt/intel/oneapi/mpi/2021.8.0//lib/libmpifort.so.12 (0x00002b7e778eb000)
	librt.so.1 => /lib64/librt.so.1 (0x00002b7e77c9f000)
	libifport.so.5 => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libifport.so.5 (0x00002b7e6ddfd000)
	libifcoremt.so.5 => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libifcoremt.so.5 (0x00002b7e77ea7000)
	libimf.so => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libimf.so (0x00002b7e7801d000)
	libsvml.so => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libsvml.so (0x00002b7e78402000)
	libirc.so => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libirc.so (0x00002b7e6de27000)
	libc.so.6 => /lib64/libc.so.6 (0x00002b7e79a0e000)
	/lib64/ld-linux-x86-64.so.2 (0x00002b7e6dd34000)
	libgcc_s.so.1 => /data/mamba/envs/gcc/lib/libgcc_s.so.1 (0x00002b7e6de9b000)
	libintlc.so.5 => /opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002b7e6deb6000)

1 Like

I ā€œinstalledā€ the fix ( miniforge3 + export LD_LIBRARY_PATH=~/miniforge3/lib/:$LD_LIBRARY_PATH )!

I also fixed a compilation problem with icx during configure :

icx: error: unknown argument ā€˜-mkl=clusterā€™; did you mean ā€˜-qmkl=clusterā€™?

fix with a sed command :

sed -i 's/mkl=cluster/qmkl=cluster/g' configure

you need to install the following two packages :

hdf5-devel.x86_64
netcdf-devel.x86_64
netcdf-fortran-develā€¦x86_64

now, itā€™s better :

 +----------------+--------+--------+--------+--------+
  |Feature         |Enabled |Init    |Working |Fallback|
  +----------------+--------+--------+--------+--------+
  |abinit_common   |no      |def     |unknown |no      |
  |bigdft          |no      |def     |unknown |disabled|
  |fft             |yes     |kwd     |yes     |no      |
  |fftw3           |yes     |env     |unknown |no      |
  |gpu             |no      |def     |no      |no      |
  |hdf5            |yes     |yon     |yes     |disabled|
  |levmar          |no      |def     |unknown |no      |
  |libpaw          |no      |def     |unknown |no      |
  |libpsml         |no      |def     |unknown |disabled|
  |libxc           |yes     |yon     |yes     |disabled|
  |libxml2         |no      |def     |unknown |no      |
  |linalg          |yes     |def     |yes     |disabled|
  |mpi             |yes     |env     |yes     |no      |
  |netcdf          |yes     |yon     |yes     |disabled|
  |netcdf_fortran  |yes     |yon     |no      |disabled|
  |papi            |no      |def     |unknown |no      |
  |pfft            |no      |def     |unknown |no      |
  |triqs           |no      |def     |unknown |no      |
  |wannier90       |no      |def     |unknown |disabled|
  |xmlf90          |no      |def     |unknown |disabled|
  +----------------+--------+--------+--------+--------+

  +------------------------------------------------------------------+
  | WARNING : NetCDF Fortran is not WORKING !                        |
  +------------------------------------------------------------------+
  | Please specify the installation directory for Netcdf-fortran     |
  +------------------------------------------------------------------+

thereā€™s still a problem with netCDF-fortran and I think itā€™s impossible to fix it: the netCDF-fortran package was compiled with gcc whereas ifort is usedā€¦

:frowning:

PS : obviously, you could compile the netCDF-f source with the mpiif90 compiler but thatā€™s still a lot of fiddlingā€¦ : itā€™s easier to compile all the fallbacks with the oneAPI compilers :wink: