From 0ed4c8f6630ef00344df6d02fcaf2b90675bbcf9 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Sep 2004 19:13:43 +0000 Subject: [PATCH] A break from writing: fix the bug that Brian hacked around for me. Ensure that OMPI_F77_* are always defined, even if a) a f77 compiler is not found, or b) the user disables the f77 MPI bindings. This commit was SVN r2618. --- config/f77_find_ext_symbol_convention.m4 | 96 +++++++++++++----------- configure.ac | 4 +- src/tools/ompi_info/param.cc | 8 +- 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/config/f77_find_ext_symbol_convention.m4 b/config/f77_find_ext_symbol_convention.m4 index 687f78e247..f786aa0689 100644 --- a/config/f77_find_ext_symbol_convention.m4 +++ b/config/f77_find_ext_symbol_convention.m4 @@ -11,57 +11,65 @@ ompi_fortran_single_underscore=0 ompi_fortran_caps=0 ompi_fortran_plain=0 -cat > conftestf.f < conftestf.f <&5 2>&1 -if test ! -s conftestf.o; then - AC_MSG_WARN(unable to produce an object file testing F77 compiler) -else - nm conftestf.o | grep foo_bar__ > /dev/null 2>&1 - if test $? = "0"; then - AC_MSG_RESULT([double underscore]) - ompi_fortran_double_underscore=1 - ompi_ac_doubleunder=y + $1 $FFLAGS -c conftestf.f 1>&5 2>&1 + if test ! -s conftestf.o; then + AC_MSG_WARN(unable to produce an object file testing F77 compiler) else - nm conftestf.o | grep foo_bar_ > /dev/null 2>&1 - if test $? = "0"; then - AC_MSG_RESULT([single underscore]) - ompi_fortran_single_underscore=1 - ompi_ac_singleunder=y - else - # We may get into trouble here if we start accepting mixed - # case compilers -- we may need to have caps underscore, - # or caps double underscore, for example. But we haven't - # found any that require that yet. :-) - nm conftestf.o | grep FOO_bar > /dev/null 2>&1 - if test $? = "0"; then - AC_MSG_RESULT([mixed case, so FORTRANCAPS]) - ompi_fortran_caps=1 - ompi_ac_caps=y - else - nm conftestf.o | grep foo_bar > /dev/null 2>&1 - if test $? = "0"; then - AC_MSG_RESULT([no underscore]) - ompi_fortran_plain=1 - ompi_ac_nounder=y - else - nm conftestf.o | grep FOO_BAR > /dev/null 2>&1 - if test $? = "0"; then - AC_MSG_RESULT([all upper case]) - ompi_fortran_caps=1 - ompi_ac_caps=y - else - AC_MSG_WARN([*** Could not find name of subroutine foo_bar]) - AC_MSG_ERROR([Cannot continue]) - fi - fi - fi - fi + nm conftestf.o | grep foo_bar__ > /dev/null 2>&1 + if test $? = "0"; then + AC_MSG_RESULT([double underscore]) + ompi_fortran_double_underscore=1 + ompi_ac_doubleunder=y + else + nm conftestf.o | grep foo_bar_ > /dev/null 2>&1 + if test $? = "0"; then + AC_MSG_RESULT([single underscore]) + ompi_fortran_single_underscore=1 + ompi_ac_singleunder=y + else + # We may get into trouble here if we start accepting + # mixed case compilers -- we may need to have caps + # underscore, or caps double underscore, for example. + # But we haven't found any that require that yet. :-) + nm conftestf.o | grep FOO_bar > /dev/null 2>&1 + if test $? = "0"; then + AC_MSG_RESULT([mixed case, so FORTRANCAPS]) + ompi_fortran_caps=1 + ompi_ac_caps=y + else + nm conftestf.o | grep foo_bar > /dev/null 2>&1 + if test $? = "0"; then + AC_MSG_RESULT([no underscore]) + ompi_fortran_plain=1 + ompi_ac_nounder=y + else + nm conftestf.o | grep FOO_BAR > /dev/null 2>&1 + if test $? = "0"; then + AC_MSG_RESULT([all upper case]) + ompi_fortran_caps=1 + ompi_ac_caps=y + else + AC_MSG_WARN([*** Could not find name of subroutine foo_bar]) + AC_MSG_ERROR([Cannot continue]) + fi + fi + fi + fi + fi fi fi diff --git a/configure.ac b/configure.ac index 3f646716e1..e6c43cc24e 100644 --- a/configure.ac +++ b/configure.ac @@ -297,9 +297,7 @@ OMPI_ALIGNMENT_FORTRAN_COMPLEX=0 OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX=0 OMPI_SETUP_F77 -if test "$OMPI_F77" != "none" ; then - OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77) -fi +OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77) # Even if we don't want fortran support, we have to have a size for # INTEGER because it's needed to define MPI_Fint, which is part of diff --git a/src/tools/ompi_info/param.cc b/src/tools/ompi_info/param.cc index be663c961f..eb2ad4b54d 100644 --- a/src/tools/ompi_info/param.cc +++ b/src/tools/ompi_info/param.cc @@ -275,16 +275,12 @@ void ompi_info::do_arch(ompi_cmd_line_t *cmd_line) // void ompi_info::do_config(bool want_all) { -#if OMPI_WANT_F77_BINDINGS - const string f77(string("yes (") + + const string f77(OMPI_WANT_F77_BINDINGS ? string("yes (") + (OMPI_HAVE_WEAK_SYMBOLS ? "all" : (OMPI_F77_CAPS ? "caps" : (OMPI_F77_PLAIN ? "lower case" : (OMPI_F77_SINGLE_UNDERSCORE ? "single underscore" : - "double underscore")))) + string(")")); -#else - const string f77("no"); -#endif + "double underscore")))) + string(")"): "no"); const string f90(OMPI_WANT_F90_BINDINGS ? "yes" : "no"); const string threads(OMPI_HAVE_SOLARIS_THREADS ? "solaris" : (OMPI_HAVE_POSIX_THREADS ? "posix" : "no"));