Configuring HDF5 for VASP 6.4.1

I’m trying to install VASP 6.4.1 with HDF5. In Ubuntu 24.04, I use:

module purge
module load intel/2018a
./configure --prefix=/home/username/hdf5/hdf5-1.14.4-2 --with-zlib=/home/username/hdf5/zlib-1.3.1 CC=mpiicc FC=mpiifort CCX=mpiicpc --enable-fortran --enable-shared --build=x86_64 --enable-parallel
make
make install

and then in my VASP directory:

make all

and I receive hundreds of lines of undefined references:

ld: warning: libhdf5.so.8, needed by /lib/../lib64/libhdf5_fortran.so, may conflict with libhdf5.so.311
vhdf5_base.o: In function `vhdf5_base_mp_get_dimensions_':
vhdf5_base.f90:(.text+0x105): undefined reference to `h5d_mp_h5dopen_f_'
vhdf5_base.f90:(.text+0x127): undefined reference to `h5d_mp_h5dget_space_f_'
vhdf5_base.f90:(.text+0x149): undefined reference to `h5s_mp_h5sget_simple_extent_dims_f_'
vhdf5_base.f90:(.text+0x23b): undefined reference to `h5l_mp_h5lexists_f_'
vhdf5_base.f90:(.text+0x599): undefined reference to `h5l_mp_h5lexists_f_'
...

What am I configuring wrong that makes HDF5 unable to supply VASP with libhdf5.so.8?

It looks like the system has two HDF5 versions installed, and VASP is not using the one you installed. Can you specify the location of HDF5 at build for VASP?