@@ -690,8 +690,22 @@ if test "x$enable_darshan_runtime" = xyes ; then
690690 #error OPENMPI FOUND
691691 #endif
692692 ] ) ] ,
693- [ ] ,
694- [ AC_DEFINE ( HAVE_OPEN_MPI , 1 , Define if OpenMPI is being used ) ] )
693+ [ is_ompi=0] , [ is_ompi=1] )
694+
695+ if test "x$is_ompi" = x1 ; then
696+ AC_DEFINE ( HAVE_OPEN_MPI , 1 , [ Define if OpenMPI is being used] )
697+
698+ dnl Check if version is 5.0.6 or later
699+ AC_MSG_CHECKING ( [ Check if OpenMPI version is 5.0.6 or later] )
700+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <mpi.h>
701+ #if (OMPI_MAJOR_VERSION*1000000 + OMPI_MINOR_VERSION*1000 + OMPI_RELEASE_VERSION < 5000006)
702+ choke me
703+ #endif
704+ ] ] ) ] , [ ompi_ge_5_0_6=1] , [ ompi_ge_5_0_6=0] )
705+ AC_MSG_RESULT ( [ $ompi_ge_5_0_6] )
706+ AC_DEFINE_UNQUOTED ( OMPI_GE_5_0_6 , [ $ompi_ge_5_0_6] ,
707+ [ Define if OpenMPI version is 5.0.6 or later] )
708+ fi
695709
696710 # determine if the MPI library includes MPI-IO functions or not
697711 AC_MSG_CHECKING ( for MPI-IO support in MPI )
@@ -918,6 +932,8 @@ AC_SUBST(HDF5_PATH, ["$with_hdf5"])
918932AC_SUBST ( PNETCDF_PATH , [ "$with_pnetcdf"] )
919933AC_SUBST ( DAOS_PATH , [ "$with_daos"] )
920934AC_SUBST ( LDMS_PATH , [ "$LDMS_HOME"] )
935+ AC_SUBST ( HAVE_OPEN_MPI , [ "$is_ompi"] )
936+ AC_SUBST ( OMPI_GE_5_0_6 , [ "$ompi_ge_5_0_6"] )
921937
922938AM_CONDITIONAL(ENABLE_MMAP_LOGS, [ test "x$enable_mmap_logs" = xyes] )
923939AM_CONDITIONAL(ENABLE_LDPRELOAD, [ test "x$enable_ld_preload" = xyes] )
0 commit comments