1
1

- Update from yesterdays patch -- just check once and for all, getting

rid of optimization flags beforehand...

This commit was SVN r21370.
Этот коммит содержится в:
Rainer Keller 2009-06-05 01:00:59 +00:00
родитель 1b8d0cf146
Коммит 499f0850ae

Просмотреть файл

@ -10,6 +10,8 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved. dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved. dnl All rights reserved.
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$ dnl $COPYRIGHT$
dnl dnl
dnl Additional copyrights may follow dnl Additional copyrights may follow
@ -21,6 +23,7 @@ dnl
AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [ AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [
AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_PROG_GREP]) AC_REQUIRE([AC_PROG_GREP])
OMPI_VAR_SCOPE_PUSH([FFLAGS_NEW LDFLAGS_NEW FLAG])
# invalidate cache if result came from a run where F77 was disabled # invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_external_symbol" = "skipped" ; then if test "$ompi_cv_f77_external_symbol" = "skipped" ; then
@ -39,54 +42,34 @@ AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [
return return
end end
EOF EOF
happy=1 # Try without certain optimization flags, which produce object
OMPI_LOG_COMMAND([$F77 $FFLAGS -c conftest.f $LDFLAGS $LIBS], # files without the required external symbols;
[if $NM conftest.o | $GREP foo_bar__ >/dev/null 2>&1 ; then # e.g. option -fast turns on -ipo on Intel Compilers 11.0
ompi_cv_f77_external_symbol="double underscore"
elif $NM conftest.o | $GREP foo_bar_ >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="single underscore"
elif $NM conftest.o | $GREP FOO_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="mixed case"
elif $NM conftest.o | $GREP foo_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="no underscore"
elif $NM conftest.o | $GREP FOO_BAR >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="upper case"
else
$NM conftest.o >conftest.out 2>&1
OMPI_LOG_MSG([Could not determine Fortran naming convention. Output from $NM:])
OMPI_LOG_FILE([conftest.out])
happy=0
fi],
[happy=0])
if test "$happy" = "0" ; then
dnl Retry without certain optimization flags,
dnl which produce object files without the required external symbols
dnl E.g. Option -fast turns on -ipo on Intel Compilers 11.0
FFLAGS_NEW="" FFLAGS_NEW=""
LDFLAGS_NEW="" LDFLAGS_NEW=""
case $F77 in case $F77 in
ifort) ifort)
for FLAG in "$FFLAGS" ; do for FLAG in $FFLAGS ; do
case $FLAG in case $FLAG in
-fast) ;; -fast) ;;
-ipo*) ;; -ipo*) ;;
*) FFLAGS_NEW="$FFLAGS_NEW $FLAG" ;; *) FFLAGS_NEW="$FFLAGS_NEW $FLAG" ;;
esac esac
done done
for FLAG in "$LDFLAGS" ; do for FLAG in $LDFLAGS ; do
case $FLAG in case $FLAG in
-fast) ;; -fast) ;;
-ipo*) ;; -ipo*) ;;
*) LDFLAGS_NEW="$LDFLAGS_NEW $FLAG" ;; *) LDFLAGS_NEW="$LDFLAGS_NEW $FLAG" ;;
esac esac
done done
OMPI_LOG_MSG([Try with new FFLAGS: $FFLAGS_NEW and new LDFLAGS:$LDFLAGS_NEW])
;; ;;
*) *)
FFLAGS_NEW="$FFLAGS" FFLAGS_NEW="$FFLAGS"
LDFLAGS_NEW="$LDFLAGS" LDFLAGS_NEW="$LDFLAGS"
;;
esac esac
OMPI_LOG_MSG([Retry with new FFLAGS: $FFLAGS_NEW and new LDFLAGS:$LDFLAGS_NEW])
happy=1 happy=1
OMPI_LOG_COMMAND([$F77 $FFLAGS_NEW -c conftest.f $LDFLAGS_NEW $LIBS], OMPI_LOG_COMMAND([$F77 $FFLAGS_NEW -c conftest.f $LDFLAGS_NEW $LIBS],
@ -106,12 +89,7 @@ EOF
OMPI_LOG_FILE([conftest.out]) OMPI_LOG_FILE([conftest.out])
happy=0 happy=0
fi], fi],
[happy=0]) [AC_MSG_ERROR([Fortran compiler did not produce object file])])
fi
if test "$happy" = "0" ; then
AC_MSG_ERROR([Fortran compiler did not produce object file])
fi
fi]) fi])
ompi_fortran_double_underscore=0 ompi_fortran_double_underscore=0
@ -146,6 +124,7 @@ EOF
[$ompi_fortran_plain], [$ompi_fortran_plain],
[Whether fortran symbols have no trailing underscore or not]) [Whether fortran symbols have no trailing underscore or not])
OMPI_VAR_SCOPE_POP
rm -rf conftest.* rm -rf conftest.*
])dnl ])dnl