* Ensure to pass the C++ exceptions flags to the C and Fortran
compilers as well. Not doing this was causing problems with MPI::ERRORS_THROW_EXCEPTIONS with gcc in 32 bit (but not 64 bit!). * Ensure that the C and Fortran compilers actually like the C++ exceptions flags. If not, currently just abort. Let's see if anyone complains about this -- I doubt they will because a) C++ exception support is not enabled by default, and b) I think C++ exceptions really only make sense within the same compiler family. This commit was SVN r19783.
Этот коммит содержится в:
родитель
56c014a3a2
Коммит
ac698173b9
@ -116,8 +116,24 @@ AC_DEFUN([OMPI_SETUP_CXX],[
|
|||||||
OMPI_CXX_FIND_EXCEPTION_FLAGS
|
OMPI_CXX_FIND_EXCEPTION_FLAGS
|
||||||
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
|
||||||
HAVE_CXX_EXCEPTIONS=1
|
HAVE_CXX_EXCEPTIONS=1
|
||||||
CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CFLAGS"
|
|
||||||
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_FFLAGS"
|
# Test to see if the C compiler likes these flags
|
||||||
|
AC_MSG_CHECKING([to see if C compiler likes the exception flags])
|
||||||
|
CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_C
|
||||||
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i = 0;]]),
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||||
|
AC_MSG_ERROR([*** Cannot continue])])
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
|
# We can't test the F77 and F90 compilers now because we
|
||||||
|
# haven't found/set the up yet. So just save the flags
|
||||||
|
# and test them later (in ompi_setup_f77.m4 and
|
||||||
|
# ompi_setup_f90.m4).
|
||||||
|
|
||||||
CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
CXXFLAGS="$CXXFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
|
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
|
||||||
|
|
||||||
|
@ -108,6 +108,27 @@ directory.
|
|||||||
EOF
|
EOF
|
||||||
AC_MSG_ERROR([C and Fortran 77 compilers are not link compatible. Can not continue.])])])
|
AC_MSG_ERROR([C and Fortran 77 compilers are not link compatible. Can not continue.])])])
|
||||||
|
|
||||||
|
# Test to see if the F90 compilers likes the C++ exceptions flags. If
|
||||||
|
# it doesn't, just abort. We *could* handle this scenario (e.g.,
|
||||||
|
# probe the F90 compiler for what flags would be necessary), but we're
|
||||||
|
# kinda assuming that no one will care. If they do, they'll e-mail us.
|
||||||
|
AC_MSG_CHECKING([to see if F77 compiler likes the C++ exception flags])
|
||||||
|
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
|
||||||
|
AC_MSG_RESULT([skipped (no F77 bindings)])
|
||||||
|
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
|
||||||
|
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
|
||||||
|
else
|
||||||
|
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
|
AC_LANG_PUSH(Fortran 77)
|
||||||
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[ INTEGER I
|
||||||
|
I = 3]]),
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||||
|
AC_MSG_ERROR([*** Cannot continue])])
|
||||||
|
AC_LANG_POP
|
||||||
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
|
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
|
||||||
[Whether we want the MPI f77 bindings or not])
|
[Whether we want the MPI f77 bindings or not])
|
||||||
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
|
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
|
||||||
|
@ -172,6 +172,27 @@ AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
|
|||||||
AC_FC_SRCEXT(f90)
|
AC_FC_SRCEXT(f90)
|
||||||
AC_LANG_POP(Fortran)])
|
AC_LANG_POP(Fortran)])
|
||||||
|
|
||||||
|
# Test to see if the F90 compilers likes the C++ exceptions flags. If
|
||||||
|
# it doesn't, just abort. We *could* handle this scenario (e.g.,
|
||||||
|
# probe the F90 compiler for what flags would be necessary), but we're
|
||||||
|
# kinda assuming that no one will care. If they do, they'll e-mail us.
|
||||||
|
AC_MSG_CHECKING([to see if F90 compiler likes the C++ exception flags])
|
||||||
|
if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
|
||||||
|
AC_MSG_RESULT([skipped (no F90 bindings)])
|
||||||
|
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
|
||||||
|
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
|
||||||
|
else
|
||||||
|
FCFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
|
||||||
|
AC_LANG_PUSH(Fortran)
|
||||||
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[ INTEGER I
|
||||||
|
I = 3]]),
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
|
||||||
|
AC_MSG_ERROR([*** Cannot continue])])
|
||||||
|
AC_LANG_POP
|
||||||
|
fi
|
||||||
|
|
||||||
# All done -- save values
|
# All done -- save values
|
||||||
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
|
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
|
||||||
[Whether we want the MPI f90 bindings or not])
|
[Whether we want the MPI f90 bindings or not])
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user