Error installing hdf5-1.14.0 to build vasp 6.2.0 with hdf5 support

Hello,
I tried installing hdf5-1.14.0 on a virtual machine Linux str957-cluster 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux with the following procedure:

gunzip < hdf5-X.Y.Z.tar.gz | tar xf -
cd hdf5-X.Y.Z
CXX=icpc CC=icc FC=ifort ./configure --enable-fortran --enable-cxx; make -j 4
make check 
make install
make check-install

Then I used the following makefile.include to try to compile vasp 6.2.0 with hdf5 support

# Precompiler options
CPP_OPTIONS= -DHOST=\"LinuxIFC\"\
             -DMPI -DMPI_BLOCK=8000 -Duse_collective \
             -DscaLAPACK \
             -DCACHE_SIZE=4000 \
             -Davoidalloc \
             -Dvasp6 \
             -Duse_bse_te \
             -Dtbdyn \
             -Dfock_dblbuf

CPP        = fpp -f_com=no -free -w0  $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)

FC         = mpiifort
FCL        = mpiifort -mkl=sequential

FREE       = -free -names lowercase

FFLAGS     = -assume byterecl -w -xHOST
OFLAG      = -O2
OFLAG_IN   = $(OFLAG)
DEBUG      = -O0

MKL_PATH   = $(MKLROOT)/lib/intel64
BLAS       =
LAPACK     =
BLACS      = -lmkl_blacs_intelmpi_lp64
SCALAPACK  = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)

OBJECTS    = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o

INCS       =-I$(MKLROOT)/include/fftw

LLIBS      = $(SCALAPACK) $(LAPACK) $(BLAS)

OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB    = $(CPP)
FC_LIB     = $(FC)
CC_LIB     = icc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB   = $(FREE)

OBJECTS_LIB= linpack_double.o getshmem.o

# For the parser library
CXX_PARS   = icpc
LLIBS      += -lstdc++

# Normally no need to change this
SRCDIR     = ../../src
BINDIR     = ../../bin

#================================================
# GPU Stuff

CPP_GPU    = -DCUDA_GPU -DRPROMU_CPROJ_OVERLAP -DUSE_PINNED_MEMORY -DCUFFT_MIN=28 -UscaLAPACK -Ufock_dblbuf

OBJECTS_GPU= fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d_gpu.o fftmpiw_gpu.o

CC         = icc
CXX        = icpc
CFLAGS     = -fPIC -DADD_ -Wall -qopenmp -DMAGMA_WITH_MKL -DMAGMA_SETAFFINITY -DGPUSHMEM=300 -DHAVE_CUBLAS

# Minimal requirement is CUDA >= 10.X. For "sm_80" you need CUDA >= 11.X.
CUDA_ROOT  ?= /usr/local/cuda/
NVCC       := $(CUDA_ROOT)/bin/nvcc -ccbin=icc -allow-unsupported-compiler
CUDA_LIB   := -L$(CUDA_ROOT)/lib64 -lnvToolsExt -lcudart -lcuda -lcufft -lcublas

GENCODE_ARCH    := -gencode=arch=compute_60,code=\"sm_60,compute_60\" \
                   -gencode=arch=compute_70,code=\"sm_70,compute_70\" \
                   -gencode=arch=compute_80,code=\"sm_80,compute_80\"

## For all legacy Intel MPI versions (before 2021)
#MPI_INC    = $(I_MPI_ROOT)/intel64/include/

# Or when you are using the Intel oneAPI compiler suite
MPI_INC    = $(I_MPI_ROOT)/include/

#Needed for py4vasp
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= /home/myname/hdf5-1.14.0/hdf5
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include


When I make vasp I get the following error:

if [ ! -d build/std ] ; then mkdir build/std  ; fi;
cp src/makefile src/.objects src/makedeps.awk makefile.include build/std ;
make -C build/std VERSION=std cleandependencies -j1
make[1]: Entering directory '/home/myname/vasp.6.2.0/build/std'
rm -f .depend
make[1]: Leaving directory '/home/myname/vasp.6.2.0/build/std'
make -C build/std VERSION=std all
make[1]: Entering directory '/home/myname/vasp.6.2.0/build/std'
rsync -ru ../../src/lib .
cp makefile.include lib
make -C lib -j1
make[2]: Entering directory '/home/myname/vasp.6.2.0/build/std/lib'
make libdmy.a
make[3]: Entering directory '/home/myname/vasp.6.2.0/build/std/lib'
make[3]: 'libdmy.a' is up to date.
make[3]: Leaving directory '/home/myname/vasp.6.2.0/build/std/lib'
make[2]: Leaving directory '/home/myname/vasp.6.2.0/build/std/lib'
rsync -ru ../../src/parser .
cp makefile.include parser
make -C parser -j1
make[2]: Entering directory '/home/myname/vasp.6.2.0/build/std/parser'
make libparser.a
make[3]: Entering directory '/home/myname/vasp.6.2.0/build/std/parser'
make[3]: 'libparser.a' is up to date.
make[3]: Leaving directory '/home/myname/vasp.6.2.0/build/std/parser'
make[2]: Leaving directory '/home/myname/vasp.6.2.0/build/std/parser'
rsync -u ../../src/*.F ../../src/*.inc .
rm -f vasp ; make vasp ; cp vasp ../../bin/vasp_std
make[2]: Entering directory '/home/myname/vasp.6.2.0/build/std'
mpiifort -free -names lowercase -assume byterecl -w -xHOST -O2 -I/home/software/materia/intel_lib/mkl/2021.4.0/include/fftw -I/home/myname/hdf5-1.14.0/hdf5/include  -c vhdf5_base.f90
vhdf5_base.F(6): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [HDF5]
  use hdf5
------^
vhdf5_base.F(36): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5intermediategroup_id
----------^
vhdf5_base.F(37): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5infileid
----------^
vhdf5_base.F(38): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5outfileid
----------^
vhdf5_base.F(39): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5wavefileid
----------^
vhdf5_base.F(40): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5ininputgroup_id
----------^
vhdf5_base.F(41): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5outinputgroup_id
----------^
vhdf5_base.F(42): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T):: ih5outoriginalgroup_id
----------^
vhdf5_base.F(57): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
  integer(HID_T) :: create_inter_prop
----------^
vhdf5_base.F(204): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(218): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(232): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(247): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(263): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(274): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) :: fileid
------------^
vhdf5_base.F(316): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) :: fileid
------------^
vhdf5_base.F(344): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) ::   locid
------------^
vhdf5_base.F(346): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) ::  groupid
------------^
vhdf5_base.F(357): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) ::   groupid
------------^
vhdf5_base.F(370): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) ::   locid
------------^
vhdf5_base.F(372): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) ::  groupid
------------^
vhdf5_base.F(387): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) ::   locid
------------^
vhdf5_base.F(389): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(out) ::  groupid
------------^
vhdf5_base.F(410): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) ::   groupid
------------^
vhdf5_base.F(426): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) :: locid
------------^
vhdf5_base.F(451): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) :: groupid
------------^
vhdf5_base.F(457): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T) :: dset_id, attr_id, aspace, string_type
------------^
vhdf5_base.F(458): error #6683: A kind type parameter must be a compile-time constant.   [HSIZE_T]
    integer(HSIZE_T) :: dimensions(1)
------------^
vhdf5_base.F(459): error #6683: A kind type parameter must be a compile-time constant.   [HSIZE_T]
    integer(HSIZE_T) :: strlen
------------^
vhdf5_base.F(500): error #6683: A kind type parameter must be a compile-time constant.   [HID_T]
    integer(HID_T), intent(in) :: locid
------------^
vhdf5_base.f90(2776): catastrophic error: Too many errors, exiting
compilation aborted for vhdf5_base.f90 (code 1)
make[2]: *** [makefile:181: vhdf5_base.o] Error 1
make[2]: Leaving directory '/home/myname/vasp.6.2.0/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:146: all] Error 1
make[1]: Leaving directory '/home/myname/vasp.6.2.0/build/std'
make: *** [makefile:9: std] Error 2

EDIT: I have checked that /home/myname/hdf5-1.14.0/hdf5 is the directory which has the include folder, however no file hdf5.mod is found. Instead I was able to generate hdf5.mod by using the default compiler in ./configure step (which however is incompatible with the compilation of vasp I’m trying to do).

Thank you in advance for your help,

Does that directory (/home/myname/hdf5-1.14.0/hdf5) exist?

Yes and it contains include, lib, bin and share folders.

Is vasp 6.20 compatible with hdf5-1.14.0?

I don’t know, as I haven’t seen suggestions on which version to download. I may try with an older one.

I was able to compile vasp 6.3.2 with intel mkl + intel mpi with hdf5 1.14:

hdf5 1.14 install instructions I use:
DONWLOAD —> https://www.hdfgroup.org/downloads/hdf5/source-code/# last version tar.gz
./autogen.sh
./configure --prefix=$DIRECTORIO/hdf5 --enable-fortran --enable-cxx --with-pic CC=icc FC=ifort CXX=icpc CFLAGS="-fPIC -O3 -xHost -ip -align" FFLAGS="-fPIC -O3 -xHost -ip -align" CXXFLAGS="-fPIC -O3 -xHost -ip -align" FFLAGS="-I/opt/intel/oneapi/mpi/latest/include -L/opt/intel/oneapi/mpi/latest/lib" --with-szlib=$DIRECTORIO/szlib --with-zlib=$DIRECTORIO/zlib
make -j 20
make install
echo ‘LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path/to/hdf5/lib’ >> ~/.zshrc