HDFGroup / hdf5

Official HDF5® Library Repository
https://www.hdfgroup.org/
Other
619 stars 254 forks source link

Configure failure detecting logical kinds for MPI #4637

Open DJDavies2 opened 3 months ago

DJDavies2 commented 3 months ago

Describe the bug

Running configure with --enable-fortran and --enable-parallel fails like this:

configure: error: Failed to find Fortran KIND of LOGICAL in MPI

Expected behavior

Configure should work.

Platform (please complete the following information)

Additional context

In the past we have passed the location of the MPI library by setting FCFLAGS. However it looks like the configure script is doing this:

saved_FCFLAGS=$FCFLAGS check_Intel="$FC -V 2>&1 |grep '^Intel'" if test X != "X$check_Intel"; then FCFLAGS="-warn error" else FCFLAGS="" fi

This means that the FCFLAGS gets unset resulting in this compile line being executed:

configure:33247: gfortran -c conftest.f90 >&5

which fails as it cannot find the MPI module.

martin-g commented 2 weeks ago

After upgrading from 1.14.0 to 1.14.5 we also faced this issue at OpenHPC - https://obs.openhpc.community/package/live_build_log/OpenHPC3:3.2:Factory/phdf5-gnu14-impi/EL_9/x86_64 Is there a workaround/solution ?

DJDavies2 commented 1 week ago

I think it might not necessarily be related to Intel as I have since seen this with other compilers. For me it was fixed by using mpi compiler wrappers instead of using the compiler directly and setting FCFLAGS. The problem seems to be that the configure script ignores the environment FCFLAGS when building and running the program that tests the logical kinds. This means that the program cannot link when it relies on FCFLAGS being set to whatever the user sets. I suppose some might say that the compiler wrappers should be used anyway, but I think that this sort of configure test should respect user defined variables such as FCFLAGS.