1
1

Fix some of the Fortran issues by unifying all the various on/off

flags to LAM_WANT_F77_BINDINGS and LAM_WANT_F90_BINDINGS.  Also
changed the compiler flag for the Fortran 90/95/whatever compiler to
FCFLAGS to match what AC was already doing.

This commit was SVN r996.
Этот коммит содержится в:
Brian Barrett 2004-03-28 10:02:38 +00:00
родитель 43c35c42e7
Коммит 61557f0156
11 изменённых файлов: 178 добавлений и 98 удалений

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

@ -82,7 +82,6 @@ NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
*******************************************************************************
EOF
sleep 5
fi
# Clean up

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

@ -205,7 +205,7 @@ AC_DEFUN([LAM_INTL_POSIX_THREADS_PLAIN_FC], [
#
# Fortran compiler
#
if test "$lam_pthread_f77_success" = "0" -a "$WANT_MPI_F77" = "1"; then
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
@ -324,7 +324,7 @@ AC_DEFUN([LAM_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
#
# Fortran compiler
#
if test "$lam_pthread_f77_success" = "0" -a "$WANT_MPI_F77" = "1"; then
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
for pf in $pflags; do
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
FFLAGS="$orig_FFLAGS $pf"
@ -500,7 +500,7 @@ AC_DEFUN([LAM_INTL_POSIX_THREADS_LIBS_FC],[
#
# Fortran compiler
#
if test "$lam_pthread_f77_success" = "0" -a "$WANT_MPI_F77" = "1"; then
if test "$lam_pthread_f77_success" = "0" -a "$LAM_WANT_F77_BINDINGS" = "1"; then
if test ! "$lam_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $PTHREAD_LIBS])
LIBS="$orig_LIBS $PTHREAD_LIBS"
@ -610,7 +610,7 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LDFLAGS="$orig_LDFLAGS"
LIBS="$orig_LIBS"
if test "$WANT_MPI_F77" != "1"; then
if test "$LAM_WANT_F77_BINDINGS" != "1"; then
lam_pthread_f77_success=1
fi

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

@ -149,7 +149,7 @@ fi
AC_DEFUN([LAM_CONFIG_SOLARIS_THREADS_FC], [
if test "$LAM_WANT_FORTRAN" = "1"; then
if test "$LAM_WANT_F77_BINDINGS" = "1"; then
if test "$BASEFC" = "f77"; then
STHREAD_FFLAGS="-mt"
style="Workshop/Forte"
@ -208,7 +208,7 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[LAM_CONFIG_SOLARIS_THREADS_CXX],
[lam_sthread_cxx_success=1])
AC_PROVIDE_IFELSE([LAM_PROG_F77],
AC_PROVIDE_IFELSE([AC_PROG_F77],
[LAM_CONFIG_SOLARIS_THREADS_FC],
[lam_sthread_f77_success=1])

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

@ -104,6 +104,7 @@ fi
AC_DEFINE_UNQUOTED(LAM_ENABLE_DEBUG, $WANT_DEBUG,
[Whether we want developer-level debugging code or not])
#
# Fortran 77
#
@ -114,12 +115,13 @@ AC_ARG_ENABLE(f77,
[enable f77 MPI bindings (default: enabled)]))
if test "$enable_f77" != "no"; then
AC_MSG_RESULT([yes])
WANT_MPI_F77=1
LAM_WANT_F77_BINDINGS=1
else
AC_MSG_RESULT([no])
WANT_MPI_F77=0
LAM_WANT_F77_BINDINGS=0
fi
#
# Fortran 90
#
@ -127,15 +129,16 @@ fi
AC_MSG_CHECKING([if want Fortran 90 bindings])
AC_ARG_ENABLE(f90,
AC_HELP_STRING([--enable-f90],
[enable f90 MPI bindings (default: enabled)]))
if test "$enable_f90" != "no"; then
AC_MSG_RESULT([yes])
WANT_MPI_F90=1
else
[enable f90 MPI bindings (default: disabled)]))
if test "$enable_f90" != "yes"; then
AC_MSG_RESULT([no])
WANT_MPI_F90=0
LAM_WANT_F90_BINDINGS=0
else
AC_MSG_RESULT([yes])
LAM_WANT_F90_BINDINGS=1
fi
#
# MPI profiling
#

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

@ -2,6 +2,18 @@ dnl -*- shell-script -*-
dnl
dnl $HEADER$
dnl
dnl sets:
dnl F77 : full pathname to compiler
dnl BASEF77 : compiler name (no path)
dnl LAM_WANT_F77_BINDINGS : (actually set by lam_configure_options, may be
dnl redefined here)
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
dnl not be used
dnl defines:
dnl LAM_F77 : same as F77
dnl LAM_WANT_F77_BINDINGS :
dnl am_conditional:
dnl LAM_WANT_F77_BINDINGS :
AC_DEFUN([LAM_SETUP_F77],[
@ -10,18 +22,6 @@ AC_DEFUN([LAM_SETUP_F77],[
lam_show_subtitle "Fortran 77 compiler"
if test "$enable_fortran" = "no"; then
AC_MSG_WARN([*** Fortran disabled by user])
LAM_WANT_F77=0
F77=none
BASEF77=none
elif test "$enable_f77" = "no"; then
AC_MSG_WARN([*** Fortran 77 disabled by user])
LAM_WANT_F77=0
F77=none
BASEF77=none
else
#
# Check for the compiler
#
@ -30,23 +30,30 @@ else
# symbol conventions, type sizes, etc. We also pass it down to
# the wrapper compiler mpif77.
#
# Always run this test, even if fortran isn't wanted so that F77 has
# value for the Fint tests
#
lam_fflags_save="$FFLAGS"
AC_PROG_F77
FFLAGS="$lam_fflags_save"
if test -z "$F77"; then
AC_MSG_WARN([*** Could not find Fortran 77 compiler])
LAM_WANT_F77=0
F77=none
BASEF77=none
LAM_WANT_F77_BINDINGS=0
F77="none"
BASEF77="none"
else
LAM_WANT_F77=1
if test "$LAM_WANT_F77_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 77 disabled by user])
LAM_WANT_F77_BINDINGS=0
BASEF77="`basename $F77`"
else
LAM_WANT_F77_BINDINGS=1
BASEF77="`basename $F77`"
fi
fi
AC_DEFINE_UNQUOTED(LAM_ENABLE_MPI_F77, $LAM_WANT_F77,
AC_DEFINE_UNQUOTED(LAM_WANT_F77_BINDINGS, $LAM_WANT_F77_BINDINGS,
[Whether we want the MPI f77 bindings or not])
AC_DEFINE_UNQUOTED(LAM_F77, "$F77", [LAM underlying F77 compiler])
AM_CONDITIONAL(BUILD_MPI_F77, test "$LAM_WANT_F77" = "1")
AM_CONDITIONAL(LAM_WANT_F77_BINDINGS, test "$LAM_WANT_F77_BINDINGS" = "1")
])

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

@ -2,6 +2,20 @@ dnl -*- shell-script -*-
dnl
dnl $HEADER$
dnl
dnl LAM_SETUP_F90
dnl
dnl sets:
dnl F90 : full pathname to compiler
dnl BASEF90 : compiler name (no path)
dnl LAM_WANT_F90_BINDINGS : (actually set by lam_configure_options, may be
dnl redefined here)
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
dnl not be used
dnl defines:
dnl LAM_F90 : same as F90
dnl LAM_WANT_F90_BINDINGS :
dnl am_conditional:
dnl LAM_WANT_F90_BINDINGS :
AC_DEFUN([LAM_SETUP_F90],[
@ -10,16 +24,18 @@ AC_DEFUN([LAM_SETUP_F90],[
lam_show_subtitle "Fortran 90/95 compiler"
if test "$enable_fortran" = "no"; then
AC_MSG_WARN([*** Fortran disabled by user])
LAM_WANT_F90=0
FC=none
BASEF90=none
elif test "$enable_f90" = "no"; then
if test "$LAM_WANT_F77_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 90/95 disabled (Fortran 77 was disabled)])
LAM_WANT_F90_BINDINGS=0
FC="none"
F90="$FC"
BASEF90="none"
elif test "$LAM_WANT_F90_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 90/95 disabled by user])
LAM_WANT_F90=0
FC=none
BASEF90=none
LAM_WANT_F90_BINDINGS=0
FC="none"
F90="$FC"
BASEF90="none"
else
#
@ -31,29 +47,93 @@ else
# the wrapper compiler mpif90.
#
lam_fflags_save="$FFLAGS"
lam_fcflags_save="$FCFLAGS"
AC_PROG_FC
FFLAGS="$lam_fflags_save"
FCFLAGS="$lam_fcflags_save"
if test -z "$FC"; then
AC_MSG_WARN([*** Could not find Fortran 90/95 compiler])
LAM_WANT_F90=0
LAM_WANT_F90_BINDINGS=0
FC=none
F90=none
BASEF90=none
elif test "$FC" = "$F77"; then
AC_MSG_WARN([*** Found same compiler for Fortran 77 and 90/95.])
AC_MSG_WARN([*** Assuming no Fortran 90/95 compiler; disabling])
AC_MSG_WARN([*** Fortran 90 MPI bindings.])
LAM_WANT_F90=0
LAM_WANT_F90_BINDINGS=0
FC=none
F90=none
BASEF90=none
else
LAM_WANT_F90=1
F90="$FC"
BASEF90="`basename $FC`"
AC_LANG_PUSH(Fortran)
AC_FC_SRCEXT(f)
AC_FC_SRCEXT(f90)
AC_FC_SRCEXT(f95)
AC_LANG_POP(Fortran)
AC_MSG_CHECKING([whether $F77 and $F90 compilers are compatible])
LAM_INTL_F90_F77_INTERACTION(fortran_goodness=1, fortran_goodness=0)
if test "$fortran_goodness" = "0" ; then
AC_MSG_RESULT([no])
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
AC_MSG_WARN([*** Disabling Fortran 90 module])
LAM_WANT_F90_BINDINGS=0
else
AC_MSG_RESULT([yes])
LAM_WANT_F90_BINDINGS=1
fi
fi
fi
AC_DEFINE_UNQUOTED(LAM_ENABLE_MPI_F90, $LAM_WANT_F90,
AC_DEFINE_UNQUOTED(LAM_WANT_F90_BINDINGS, $LAM_WANT_F90_BINDINGS,
[Whether we want the MPI f90 bindings or not])
AC_DEFINE_UNQUOTED(LAM_F90, "$FC", [LAM underlying F90 compiler])
AM_CONDITIONAL(BUILD_MPI_F90, test "$LAM_WANT_F90" = "1")
AC_DEFINE_UNQUOTED(LAM_F90, "$F90", [LAM underlying F90 compiler])
AM_CONDITIONAL(LAM_WANT_F90_BINDINGS, test "$LAM_WANT_F90_BINDINGS" = "1")
unset fortran_goodness
])
AC_DEFUN([LAM_INTL_F90_F77_INTERACTION], [
# make sure that we can combine F90 and F77 code
AC_LANG_PUSH(Fortran)
# Fortran module
cat > conftestf77.f <<EOF
subroutine Conf1_test()
end
EOF
cat > conftestf90.f <<EOF
program main
call Conf1_test()
end
EOF
# Try the compile
LAM_LOG_COMMAND(
[$F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
LAM_LOG_COMMAND(
[$F77 $FFLAGS -c conftestf77.f],
LAM_LOG_COMMAND(
[$F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LIBS],
[HAPPY=1],
[HAPPY=0]),
[HAPPY=0]),
[HAPPY=0])
if test "$HAPPY" = "1"; then
$1
else
LAM_LOG_MSG([here is the F77 program:], 1)
LAM_LOG_FILE([conftestf77.f])
LAM_LOG_MSG([here is the F90 program:], 1)
LAM_LOG_FILE([conftestf90.f90])
$2
fi
unset HAPPY lam_conftest_h
/bin/rm -f conftest*
AC_LANG_POP(Fortran)
])dnl

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

@ -125,6 +125,7 @@ AM_ENABLE_STATIC
############################################################################
# Check for compilers and preprocessors
############################################################################
lam_show_title "Compiler and preprocessor tests"
##################################
# C compiler characteristics
@ -275,7 +276,7 @@ fi
# If we want fortran support, then get the sizes and alignments of all
# the rest of the fortran types
if test "$F77" != "none" -a "$WANT_MPI_F77" = "1"; then
if test "$LAM_WANT_F77_BINDINGS" = "1" ; then
# INTEGER is already done, per above
LAM_F77_GET_SIZEOF(REAL, LAM_SIZEOF_FORTRAN_REAL)
LAM_F77_GET_SIZEOF(DOUBLE PRECISION, LAM_SIZEOF_FORTRAN_DBLPREC)
@ -315,31 +316,7 @@ AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
$LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX,
[Size of fortran double complex])
#
# There are 2 layers to the MPI f77 layer. The only extra thing
# that determine f77 bindings is that fortran can be disabled by
# user. In such cases, we need to not build the target at all.
# One layer generates MPI_f77* bindings. The other layer
# generates PMPI_f77* bindings. The following conditions
# determine whether each (or both) these layers are
# built.
# Superceeding clause:
# - fortran77 bindings should be enabled, else everything is
# disabled
# 1. MPI_f77* bindings are needed if:
# - Profiling is not required
# - Profiling is required but weak symbols are not
# supported
# 2. PMPI_* bindings are needed if profiling is required.
# Hence we define 2 AM_CONDITIONALs which tell us whether
# each of these layers need to be built or NOT
#
AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER,
test "$WANT_MPI_PROFILING" = 0 -o "$LAM_PROFILING_COMPILE_SEPARATELY" = 1 -a "$WANT_MPI_F77" = 1)
AM_CONDITIONAL(WANT_PMPI_F77_BINDINGS_LAYER,
test "$WANT_MPI_F77" = 1 -a "$WANT_MPI_PROFILING" = 1)
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY,
test "$LAM_PROFILING_COMPILE_SEPARATELY" = 1)
#
# Fortran 90 setup
#
@ -366,6 +343,8 @@ LAM_SETUP_F90
# Libraries
##################################
lam_show_title "Library and Function tests"
# -lsocket
# -lnsl
# -lutil (openpty)
@ -503,6 +482,7 @@ LIBS="$LIBS $THREAD_LIBS"
WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS"
WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FFLAGS"
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS"
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $THREAD_LIBS"
@ -678,6 +658,16 @@ AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
[Additional FFLAGS to pass through the wrapper compilers])
AC_MSG_RESULT([$WRAPPER_EXTRA_FFLAGS])
#
# WRAPPER_EXTRA_FCFLAGS
#
AC_MSG_CHECKING([for mpif77/mpif90 FCFLAGS])
LAM_UNIQ(WRAPPER_EXTRA_FCFLAGS)
AC_SUBST(WRAPPER_EXTRA_FCFLAGS)
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
[Additional FCFLAGS to pass through the wrapper compilers])
AC_MSG_RESULT([$WRAPPER_EXTRA_FCFLAGS])
#
# WRAPPER_EXTRA_LDFLAGS
#
@ -707,6 +697,7 @@ AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(CXXCPPFLAGS)
AC_SUBST(FFLAGS)
AC_SUBST(FCFLAGS)
############################################################################

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

@ -11,7 +11,7 @@ SUBDIRS = c cxx f77 f90
# See if configure found a valid f77 compiler
if BUILD_MPI_F77
if LAM_WANT_F77_BINDINGS
f77_lib = f77/libmpi_f77.la
else
f77_lib =
@ -19,7 +19,7 @@ endif
# See if configure found a valid f90/f95 compiler
if BUILD_MPI_F90
if LAM_WANT_F90_BINDINGS
f90_lib =
else
f90_lib =

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

@ -262,8 +262,8 @@ void laminfo::do_arch(lam_cmd_line_t *cmd_line)
//
void laminfo::do_config(bool want_all)
{
const string f77(LAM_ENABLE_MPI_F77 ? "yes" : "no");
const string f90(LAM_ENABLE_MPI_F90 ? "yes" : "no");
const string f77(LAM_WANT_F77_BINDINGS ? "yes" : "no");
const string f90(LAM_WANT_F90_BINDINGS ? "yes" : "no");
const string sthreads(LAM_HAVE_SOLARIS_THREADS ? "yes" : "no");
const string pthreads(LAM_HAVE_POSIX_THREADS ? "yes" : "no");
const string memprofile(LAM_ENABLE_MEM_PROFILE ? "yes" : "no");
@ -271,9 +271,9 @@ void laminfo::do_config(bool want_all)
const string debug(LAM_ENABLE_DEBUG ? "yes" : "no");
const string cprofiling(LAM_ENABLE_MPI_PROFILING ? "yes" : "no");
const string cxxprofiling(LAM_ENABLE_MPI_PROFILING ? "yes" : "no");
const string f77profiling((LAM_ENABLE_MPI_PROFILING && LAM_ENABLE_MPI_F77) ?
const string f77profiling((LAM_ENABLE_MPI_PROFILING && LAM_WANT_F77_BINDINGS) ?
"yes" : "no");
const string f90profiling((LAM_ENABLE_MPI_PROFILING && LAM_ENABLE_MPI_F90) ?
const string f90profiling((LAM_ENABLE_MPI_PROFILING && LAM_WANT_F90_BINDINGS) ?
"yes" : "no");
const string cxxexceptions(LAM_HAVE_CXX_EXCEPTION_SUPPORT ? "yes" : "no");
int lam_mpi_param_check = 3;

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

@ -17,7 +17,7 @@ main(int argc, char *argv[])
// and pass in just a few arguments to customize for the language of
// this wrapper compiler.
#if !LAM_ENABLE_MPI_F77
#if !LAM_WANT_F77_BINDINGS
#if 0
show_help("hf77", "no-fortran-support", NULL);
#endif

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

@ -17,7 +17,7 @@ main(int argc, char *argv[])
// and pass in just a few arguments to customize for the language of
// this wrapper compiler.
#if !LAM_ENABLE_MPI_F90
#if !LAM_WANT_F90_BINDINGS
#if 0
show_help("hf90", "no-fortran-support", NULL);
#endif
@ -31,6 +31,6 @@ main(int argc, char *argv[])
return lam_wrap_engine(argc, argv,
str_vec, LAM_F90, false, false,
WRAPPER_EXTRA_FFLAGS);
WRAPPER_EXTRA_FCFLAGS);
#endif
}