HDF5 for nvhpc

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
Zhiyuan Yin
Newbie
Newbie
Posts: 5
Joined: Wed May 28, 2025 4:02 am

HDF5 for nvhpc

#1 Post by Zhiyuan Yin » Thu Jul 24, 2025 10:50 pm

Hi,

I am trying to compile VASP 6.5.1 with HDF5 support (-DVASP_HDF5) using the NVIDIA HPC SDK compiler suite (nvfortran 25.3).

I have tested multiple versions of HDF5, built with --enable-fortran and --enable-parallel, using mpifort and mpicc from the NVIDIA toolchain.
With HDF5 1.14.x or 1.12.x, compilation fails in vhdf5_base.F with errors such as:

NVFORTRAN-S-0079-Keyword form of argument illegal in this context
NVFORTRAN-S-0038-Symbol, c_loc, has not been explicitly declared

I then tried older HDF5 versions:

HDF5 1.8.21 builds fine with nvfortran, but fails in VASP 6.5.1 because vhdf5_base.F still calls c_loc and expects iso_c_binding to be available from HDF5.

hdf5-1.8.21-nvhpc/include -c minimax_functions2D.f90
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for use_file_locking (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for ignore_disabled_locks (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for hdferr (vhdf5_base.F: 378)
0 inform, 0 warnings, 3 severes, 0 fatal for vh5_file_access_swmr
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for use_file_locking (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for ignore_disabled_locks (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for hdferr (vhdf5_base.F: 378)
0 inform, 0 warnings, 3 severes, 0 fatal for vh5_file_access_swmr
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for use_file_locking (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for ignore_disabled_locks (vhdf5_base.F: 378)
NVFORTRAN-S-0079-Keyword form of argument illegal in this context for hdferr (vhdf5_base.F: 378)
0 inform, 0 warnings, 3 severes, 0 fatal for vh5_file_access_swmr
mpif90 -mp -Mfree -Mbackslash -Mlarge_arrays -tp host -fast -I/opt/nvidia/hpc_sdk/Linux_x86_64/25.3/compilers/extras/qd/include/qd -I/usr/lib/x86_64-linux-gnu//include -I/home/zhyin/hdf5-1.8.21-nvhpc/include -c ml_ff_logfile.f90

There appears to be a mismatch: older HDF5 avoids Fortran 2003, but VASP requires it; newer HDF5 provides it, but nvfortran rejects it.


Zhiyuan Yin
Newbie
Newbie
Posts: 5
Joined: Wed May 28, 2025 4:02 am

Re: HDF5 for nvhpc

#2 Post by Zhiyuan Yin » Fri Jul 25, 2025 12:54 am

I figured out that if I add one additional flag in makefile.include:

> CPP_OPTIONS+= -DVASP_HDF5
> HDF5_ROOT ?= /...
> LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
> INCS += -I$(HDF5_ROOT)/include -I$(HDF5_ROOT)/mod/static

Then make can recognize the .mod files.


christopher_sheldon1
Global Moderator
Global Moderator
Posts: 119
Joined: Mon Mar 25, 2024 1:36 pm

Re: HDF5 for nvhpc

#3 Post by christopher_sheldon1 » Fri Jul 25, 2025 10:16 am

Hi Zhiyuan,

Thank you for your question. Have you succeeded in compiling with HDF5 then? If not, could you upload your makefile?

Best wishes,

Chris


Post Reply