[svn-r5112]

Purpose:
	Bug Fix
Description:
	Parallel Fortran wasn't working on Modi4. The tests for parallel
	MPI Fortran were failing to find MPI files.
Solution:
	Changed the AC_TRY_FLINK() macro so that libraries are included
	at the end of the link line so that unresolved symbols can be
	found...
Platforms tested:
	Modi4
This commit is contained in:
Bill Wendling 2002-03-28 16:16:04 -05:00
parent 97d0dc22ee
commit f8bfe1cb01
3 changed files with 44 additions and 56 deletions

View File

@ -77,7 +77,7 @@ AC_DEFUN(AC_LANG_FORTRAN9X, [
define([AC_LANG], [FORTRAN9X])
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&AC_FD_CC'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&AC_FD_CC'
cross_compiling=$ac_cv_prog_f9x_cross
])

72
fortran/configure vendored
View File

@ -1825,7 +1825,7 @@ echo "configure:1823: checking whether the Fortran 9X compiler ($F9X $FFLAGS $LD
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -1928,7 +1928,7 @@ echo "configure:1926: checking what $F9X does with modules" >&5
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2292,14 +2292,14 @@ rm -f confcache
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
PARALLEL=""
RUNSERIAL=""
RUNPARALLEL=""
TESTPARALLEL=""
case "$F9X" in
mpif90)
@ -2361,7 +2361,7 @@ case "X-$enable_parallel" in
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2373,12 +2373,11 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
else
@ -2388,7 +2387,7 @@ else
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2400,8 +2399,7 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
@ -2410,7 +2408,7 @@ if test -n "mpi"; then
LDFLAGS="$LDFLAGS -lmpi"
fi
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
else
@ -2431,7 +2429,7 @@ rm -rf conftest*
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2443,19 +2441,21 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
else
:
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2467,8 +2467,7 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
@ -2477,7 +2476,7 @@ if test -n "mpio"; then
LDFLAGS="$LDFLAGS -lmpio"
fi
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
else
@ -2487,9 +2486,6 @@ fi
cd ..
rm -rf conftest*
else
:
fi
cd ..
rm -rf conftest*
@ -2511,7 +2507,7 @@ rm -rf conftest*
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2523,8 +2519,7 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
@ -2533,7 +2528,7 @@ if test -n "fmpich"; then
LDFLAGS="$LDFLAGS -lfmpich"
fi
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
else
@ -2558,20 +2553,20 @@ fi
ADD_PARALLEL_FILES="no"
if test -n "$PARALLEL"; then
echo $ac_n "checking prefix for running on one processor""... $ac_c" 1>&6
echo "configure:2562: checking prefix for running on one processor" >&5
echo "configure:2557: checking prefix for running on one processor" >&5
echo "$ac_t""$RUNSERIAL" 1>&6
echo $ac_n "checking prefix for running in parallel""... $ac_c" 1>&6
echo "configure:2565: checking prefix for running in parallel" >&5
echo "configure:2560: checking prefix for running in parallel" >&5
echo "$ac_t""$RUNPARALLEL" 1>&6
echo $ac_n "checking whether a simple MPI-IO program can be linked""... $ac_c" 1>&6
echo "configure:2569: checking whether a simple MPI-IO program can be linked" >&5
echo "configure:2564: checking whether a simple MPI-IO program can be linked" >&5
ac_ext=f90
ac_compile='${F9X-f90} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${F9X-f90} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f9x_cross
@ -2583,12 +2578,11 @@ cat >conftest.$ac_ext <<EOF
program conftest
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )
call mpi_file_open( ierr )
end
EOF
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
:
echo "$ac_t""yes" 1>&6
else
@ -2616,7 +2610,7 @@ fi
echo $ac_n "checking make""... $ac_c" 1>&6
echo "configure:2620: checking make" >&5
echo "configure:2614: checking make" >&5
if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\
sed -n 1p|cut -c1-8`" = "GNU Make"; then
@ -2633,7 +2627,7 @@ fi
if test -z "$DEPEND"; then
echo $ac_n "checking how to include a makefile""... $ac_c" 1>&6
echo "configure:2637: checking how to include a makefile" >&5
echo "configure:2631: checking how to include a makefile" >&5
cat >makeinc <<EOF
foo:

View File

@ -360,10 +360,10 @@ dnl protect the expansion until make executes the
dnl command). The value of this variable is
dnl substituted in *.in files.
dnl
AC_SUBST(PARALLEL)
AC_SUBST(RUNSERIAL)
AC_SUBST(RUNPARALLEL)
AC_SUBST(TESTPARALLEL)
AC_SUBST(PARALLEL) PARALLEL=""
AC_SUBST(RUNSERIAL) RUNSERIAL=""
AC_SUBST(RUNPARALLEL) RUNPARALLEL=""
AC_SUBST(TESTPARALLEL) TESTPARALLEL=""
dnl ----------------------------------------------------------------------
dnl If the compiler is obviously a parallel compiler then we're building
@ -443,23 +443,19 @@ case "X-$enable_parallel" in
dnl Try link a simple MPI program. If fail, try again with -lmpi.
AC_TRY_FLINK(mpif.h, [
integer ierr
call MPI_INIT( ierr )],,
call mpi_file_open( ierr )],,
AC_CHECK_FLIB(mpi, [
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )],, PARALLEL=no))
call mpi_file_open( ierr )],, PARALLEL=no))
dnl Then try link a simple MPI-IO program. If fail, try again with
dnl -lmpio.
if test "X$PARALLEL" = "Xyes"; then
AC_TRY_FLINK(mpif.h, [
integer ierr
call MPI_INIT( ierr )],
call mpi_file_open( ierr )],,
AC_CHECK_FLIB(mpio, [
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )],, PARALLEL=no))
call mpi_file_open( ierr )],, PARALLEL=no))
fi
dnl Set RUNPARALLEL to mpirun if not set yet.
@ -484,8 +480,7 @@ case "X-$enable_parallel" in
PARALLEL=mpich
AC_CHECK_FLIB(fmpich, [
include 'mpif.h'
integer ierr
call MPI_INIT( ierr )],, AC_MSG_ERROR(no mpich library))
call mpi_file_open( ierr )],, AC_MSG_ERROR(no mpich library))
;;
*)
@ -515,8 +510,7 @@ if test -n "$PARALLEL"; then
dnl Check that we can link a simple MPI and MPI-IO application
AC_MSG_CHECKING(whether a simple MPI-IO program can be linked)
AC_TRY_FLINK(mpif.h,[
integer ierr
call MPI_INIT( ierr )],
call mpi_file_open( ierr )],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
AC_MSG_ERROR('unable to link a simple MPI-IO application'))