Building HDF5 using mpifortran in NVIDIA HPC SDK

Repost here

Hi all, I am trying to build parallel HDF5 using the mpifortran given by the NVIDIA HPC SDK 24.5. However, I was unable to build the HDF5. The error message is

gfortran: error: libhdf5_fortran.so.102: No such file or directory
gfortran: error: unrecognized command line option ‘-rpath’
gfortran: error: unrecognized command line option ‘-rpath’
gfortran: error: unrecognized command line option ‘-soname’

Do anyone know how to solve these issues?

Hi HydroHLLCFV,

Can you provide more details on the steps you’ve taken the build and can you confirm which MPI driver you’re using?

The error messages appear to be coming from gfortran during the link step. So you may not be using the mpif90/mpifort that we ship, or somehow your environment or HDF5 build is setup to use gfortran as the linker.

-Mat

Yes sure!

My steps in building hdf5 is

FC=nvidia’s mpifort in comm_libs/mpi ./configure --prefix=my desired directory --enable-fortran --enable-parallel

make

make install

Ok, so just a basic build. Let me back up a bit.

In general, the more details you can provide, the more help we can give. Though let’s review what you’ve posted. The key items are: you’re using the default MPI (HPC-X) that ships with NVHPC 24.5 and the error messages are coming from gfortran.

Gfortran isn’t used by any of our tools including the MPI builds that we ship, meaning the issue isn’t with our tools.

Next, looking at the error messages, gfortran is complaining about unknown command line flags, “-rpath” and “-soname”. These are linker flags when creating a shared object, in this case “libhdf5_fortran.so”. In other words, gfortran is somehow being used as the linker instead of the normal “ld” utility.

So the questions is why is gfortran being used as the linker? I don’t know for sure, but my best guess is that you’ve set “LD=gfortran” in your environment or on the configure command line.

To see if you’ve overridden the linker in your environment, run the command “env | grep LD”.

Then also confirm your full configure command line isn’t setting “LD=gfortran”.

If neither of these show LD getting reset, please post the full output from the command line that’s causing the error. I’m don’t know if this is echo’d to the screen, so if not, look for any log files that may contain the full command.

I would suggest to use the CMake build for HDF5, it’s the primary way to build HDF5 and better supported.