Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2040,16 +2040,25 @@ then
fi
mpi_fc='h5pfc'

elif test "$parallel_compiler" == mpif90
elif test "$parallel_compiler" == mpif90 || test "$parallel_compiler" == mpifort
then
mpi_compiler=`basename $(mpif90 -show | awk {'print $1'})`
mpi_fc='HDF5_FLINKER=mpif90 HDF5_FC=mpif90 h5fc'
mpi_compiler=`basename $($parallel_compiler -show | awk {'print $1'})`
# The h5fc wrapper in HDF5 1.x lets HDF5_FC and HDF5_FLINKER replace the
# compiler it calls, so we can make it call the MPI wrapper. The h5fc in
# HDF5 2.x is a different, pkg-config based script that ignores these
# variables and always calls the serial compiler, so in that case we do the
# reverse and make the MPI wrapper call h5fc (MPICH_FC is read by MPICH and
# OMPI_FC by Open MPI). The HDF5 2.x wrapper also no longer adds the linker
# flags HDF5 was built with, so we pass on LDFLAGS ourselves.
h5fc_compiler=`HDF5_FLINKER=$parallel_compiler HDF5_FC=$parallel_compiler h5fc -show | awk {'print $1'}`
if test "$h5fc_compiler" == "$parallel_compiler"
then
mpi_fc="HDF5_FLINKER=$parallel_compiler HDF5_FC=$parallel_compiler h5fc"

elif test "$parallel_compiler" == mpifort
then
mpi_compiler=`basename $(mpifort -show | awk {'print $1'})`
mpi_fc='HDF5_FLINKER=mpifort HDF5_FC=mpifort h5fc'
else
mpi_fc="MPICH_FC=h5fc OMPI_FC=h5fc $parallel_compiler $LDFLAGS"

fi
else
as_fn_error $? "\"h5pfc or mpif90 need to be present\"" "$LINENO" 5
fi
Expand Down
25 changes: 17 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,23 @@ then
mpi_compiler=`basename $(mpifort -show | awk {'print $1'})`
fi
AC_SUBST(mpi_fc, 'h5pfc')
elif test "$parallel_compiler" == mpif90
then
mpi_compiler=`basename $(mpif90 -show | awk {'print $1'})`
AC_SUBST(mpi_fc, 'HDF5_FLINKER=mpif90 HDF5_FC=mpif90 h5fc')
elif test "$parallel_compiler" == mpifort
then
mpi_compiler=`basename $(mpifort -show | awk {'print $1'})`
AC_SUBST(mpi_fc, 'HDF5_FLINKER=mpifort HDF5_FC=mpifort h5fc')
elif test "$parallel_compiler" == mpif90 || test "$parallel_compiler" == mpifort
then
mpi_compiler=`basename $($parallel_compiler -show | awk {'print $1'})`
# The h5fc wrapper in HDF5 1.x lets HDF5_FC and HDF5_FLINKER replace the
# compiler it calls, so we can make it call the MPI wrapper. The h5fc in
# HDF5 2.x is a different, pkg-config based script that ignores these
# variables and always calls the serial compiler, so in that case we do the
# reverse and make the MPI wrapper call h5fc (MPICH_FC is read by MPICH and
# OMPI_FC by Open MPI). The HDF5 2.x wrapper also no longer adds the linker
# flags HDF5 was built with, so we pass on LDFLAGS ourselves.
h5fc_compiler=`HDF5_FLINKER=$parallel_compiler HDF5_FC=$parallel_compiler h5fc -show | awk {'print $1'}`
if test "$h5fc_compiler" == "$parallel_compiler"
then
AC_SUBST(mpi_fc, "HDF5_FLINKER=$parallel_compiler HDF5_FC=$parallel_compiler h5fc")
else
AC_SUBST(mpi_fc, "MPICH_FC=h5fc OMPI_FC=h5fc $parallel_compiler $LDFLAGS")
fi
else
AC_MSG_ERROR("h5pfc or mpif90 need to be present")
fi
Expand Down
Loading