mld2p4-2:

Fixed configry stuff.
stopcriterion
Salvatore Filippone 9 years ago
parent b3eda57ab3
commit 20ba6eab08

@ -18,7 +18,7 @@ dnl make it work even if ac_fc_ext="f"
AC_DEFUN([AX_F90_MODULE_FLAG],[ AC_DEFUN([AX_F90_MODULE_FLAG],[
AC_CACHE_CHECK([fortran 90 modules inclusion flag], AC_CACHE_CHECK([fortran 90 modules inclusion flag],
ax_f90_modflag, ax_cv_f90_modflag,
[AC_LANG_PUSH(Fortran) [AC_LANG_PUSH(Fortran)
i=0 i=0
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
@ -26,6 +26,7 @@ while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
done done
mkdir tmpdir_$i mkdir tmpdir_$i
cd tmpdir_$i cd tmpdir_$i
ac_ext='f90';
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
module conftest_module module conftest_module
contains contains
@ -34,10 +35,10 @@ AC_COMPILE_IFELSE([
end subroutine conftest_routine end subroutine conftest_routine
end module conftest_module end module conftest_module
],[],[]) ],[],[])
cd .. cd ..;
ax_f90_modflag="not found" ax_cv_f90_modflag="not found"
for ax_flag in "-I " "-M" "-p"; do for ax_flag in "-I " "-M" "-p"; do
if test "$ax_f90_modflag" = "not found" ; then if test "$ax_cv_f90_modflag" = "not found" ; then
ax_save_FCFLAGS="$FCFLAGS" ax_save_FCFLAGS="$FCFLAGS"
FCFLAGS="$ax_save_FCFLAGS ${ax_flag}tmpdir_$i" FCFLAGS="$ax_save_FCFLAGS ${ax_flag}tmpdir_$i"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
@ -45,13 +46,13 @@ for ax_flag in "-I " "-M" "-p"; do
use conftest_module use conftest_module
call conftest_routine call conftest_routine
end program conftest_program end program conftest_program
],[ax_f90_modflag="$ax_flag"],[]) ],[ax_cv_f90_modflag="$ax_flag"],[])
FCFLAGS="$ax_save_FCFLAGS" FCFLAGS="$ax_save_FCFLAGS"
fi fi
done done
rm -fr tmpdir_$i rm -fr tmpdir_$i
if test "$ax_flag" = "not found" ; then if test "$ax_cv_f90_modflag" = "not found" ; then
AC_MSG_ERROR([unable to find compiler flag for modules inclusion]) AC_MSG_ERROR([unable to find compiler flag for modules inclusion])
fi fi
AC_LANG_POP(Fortran) AC_LANG_POP(Fortran)
])]) ])])

@ -42,7 +42,8 @@ AC_DEFUN([PAC_CHECK_LIBS],
] ]
])dnl ])dnl
dnl @synopsis PAC_FORTRAN_FUNC_MOVE_ALLOC( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl @synopsis PAC_FORTRAN_HAVE_MOVE_ALLOC( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl dnl
dnl Will try to compile and link a program with move_alloc (a Fortran 2003 function). dnl Will try to compile and link a program with move_alloc (a Fortran 2003 function).
dnl dnl
@ -53,34 +54,25 @@ dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl dnl
AC_DEFUN([PAC_FORTRAN_HAVE_MOVE_ALLOC], AC_DEFUN([PAC_FORTRAN_HAVE_MOVE_ALLOC],
ac_exeext=''
ac_ext='f'
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
dnl Warning : square brackets are EVIL! dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([for MOVE_ALLOC intrinsic]) [AC_MSG_CHECKING([support for Fortran MOVE_ALLOC intrinsic])
cat > conftest.$ac_ext <<EOF AC_LANG_PUSH([Fortran])
program test_move_alloc ac_ext='f90';
integer, allocatable :: a(:), b(:) AC_COMPILE_IFELSE([ program test_move_alloc
allocate(a(3)) integer, allocatable :: a(:), b(:)
call move_alloc(a, b) allocate(a(3))
print *, allocated(a), allocated(b) call move_alloc(a, b)
print *, b print *, allocated(a), allocated(b)
end program test_move_alloc print *, b
EOF end program test_move_alloc],
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then [ AC_MSG_RESULT([yes])
AC_MSG_RESULT([yes]) ifelse([$1], , :, [ $1])],
ifelse([$1], , :, [rm -rf conftest* [ AC_MSG_RESULT([no])
$1]) echo "configure: failed program was:" >&AC_FD_CC
else cat conftest.$ac_ext >&AC_FD_CC
AC_MSG_RESULT([no]) ifelse([$2], , , [ $2])])
echo "configure: failed program was:" >&AC_FD_CC AC_LANG_POP([Fortran])
cat conftest.$ac_ext >&AC_FD_CC ])
ifelse([$2], , , [ rm -rf conftest*
$2
])dnl
fi
rm -f conftest*])
dnl @synopsis PAC_CHECK_HAVE_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl @synopsis PAC_CHECK_HAVE_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
@ -95,36 +87,31 @@ dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl dnl
AC_DEFUN(PAC_CHECK_HAVE_GFORTRAN, AC_DEFUN(PAC_CHECK_HAVE_GFORTRAN,
ac_exeext='' [AC_MSG_CHECKING([for GNU Fortran])
ac_ext='F' AC_LANG_PUSH([Fortran])
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ac_exeext=''
dnl Warning : square brackets are EVIL! ac_ext='F90'
[ dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cat > conftest.$ac_ext <<EOF ac_fc=${MPIFC-$FC};
AC_COMPILE_IFELSE([
program main program main
#ifdef __GNUC__ #ifdef __GNUC__
print *, "GCC!" print *, "GCC!"
#else #else
this program will fail this program will fail
#endif #endif
end end],
[ AC_MSG_RESULT([yes])
EOF ifelse([$1], , :, [ $1])],
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then [ AC_MSG_RESULT([no])
ifelse([$1], , :, [rm -rf conftest* echo "configure: failed program was:" >&AC_FD_CC
$1]) cat conftest.$ac_ext >&AC_FD_CC
else ifelse([$2], , , [ $2])])
echo "configure: failed program was:" >&AC_FD_CC AC_LANG_POP([Fortran])
cat conftest.$ac_ext >&AC_FD_CC ])
ifelse([$2], , , [ rm -rf conftest*
$2
])dnl
fi
rm -f conftest*])
dnl @synopsis PAC_HAVE_MODERN_GCC( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl @synopsis PAC_HAVE_MODERN_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl dnl
dnl Will check if the GNU fortran version is suitable for PSBLAS. dnl Will check if the GNU fortran version is suitable for PSBLAS.
dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND. dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
@ -133,34 +120,29 @@ dnl Note : Will use MPIFC; if unset, will use '$FC'.
dnl dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl dnl
AC_DEFUN(PAC_HAVE_MODERN_GCC, AC_DEFUN(PAC_HAVE_MODERN_GFORTRAN,
ac_exeext='' [AC_MSG_CHECKING([for recent GNU Fortran])
ac_ext='F' AC_LANG_PUSH([Fortran])
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ac_exeext=''
dnl Warning : square brackets are EVIL! ac_ext='F90'
[ dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cat > conftest.$ac_ext <<EOF ac_fc=${MPIFC-$FC};
AC_COMPILE_IFELSE([
program main program main
#if ( __GNUC__ >= 4 && __GNUC_MINOR__ > 6 ) || ( __GNUC__ > 4 ) #if ( __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 ) || ( __GNUC__ > 4 )
print *, "ok" print *, "ok"
#else #else
this program will fail this program will fail
#endif #endif
end end],
[ AC_MSG_RESULT([yes])
EOF ifelse([$1], , :, [ $1])],
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then [ AC_MSG_RESULT([no])
ifelse([$1], , :, [rm -rf conftest* echo "configure: failed program was:" >&AC_FD_CC
$1]) cat conftest.$ac_ext >&AC_FD_CC
else ifelse([$2], , , [ $2])])
echo "configure: failed program was:" >&AC_FD_CC AC_LANG_POP([Fortran])
cat conftest.$ac_ext >&AC_FD_CC ])
ifelse([$2], , , [ rm -rf conftest*
$2
])dnl
fi
rm -f conftest*])
dnl @synopsis PAC_FORTRAN_CHECK_HAVE_MPI_MOD( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl @synopsis PAC_FORTRAN_CHECK_HAVE_MPI_MOD( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl dnl
@ -173,31 +155,24 @@ dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl Modified Salvatore Filippone <salvatore.filippone@uniroma2.it> dnl Modified Salvatore Filippone <salvatore.filippone@uniroma2.it>
dnl dnl
AC_DEFUN(PAC_FORTRAN_CHECK_HAVE_MPI_MOD, AC_DEFUN(PAC_FORTRAN_CHECK_HAVE_MPI_MOD,
ac_exeext='' [AC_MSG_CHECKING([for Fortran MPI mod])
ac_ext='f90' AC_LANG_PUSH([Fortran])
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ac_exeext=''
dnl Warning : square brackets are EVIL! ac_ext='F90'
[AC_MSG_CHECKING([MPI Fortran interface]) dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cat > conftest.$ac_ext <<EOF ac_fc=${MPIFC-$FC};
AC_COMPILE_IFELSE([
program test program test
use mpi use mpi
end program test end program test],
EOF [ AC_MSG_RESULT([yes])
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ifelse([$1], , :, [ $1])],
AC_MSG_RESULT([ use mpi ]) [ AC_MSG_RESULT([no])
ifelse([$1], , :, [rm -rf conftest* echo "configure: failed program was:" >&AC_FD_CC
$1]) cat conftest.$ac_ext >&AC_FD_CC
else ifelse([$2], , , [ $2])])
echo "configure: failed program was:" >&AC_FD_CC AC_LANG_POP([Fortran])
cat conftest.$ac_ext >&AC_FD_CC ])
AC_MSG_RESULT([ include mpif.h ])
ifelse([$2], , , [ rm -rf conftest*
$2
])dnl
fi
rm -f conftest*])
dnl @synopsis PAC_ARG_WITH_FLAGS(lcase_name, UCASE_NAME) dnl @synopsis PAC_ARG_WITH_FLAGS(lcase_name, UCASE_NAME)
dnl dnl
@ -354,26 +329,21 @@ dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl dnl
AC_DEFUN(PAC_FORTRAN_HAVE_PSBLAS, AC_DEFUN(PAC_FORTRAN_HAVE_PSBLAS,
ac_objext='.o'
ac_ext='f90'
ac_compile='${MPIFC-$FC} -c -o conftest${ac_objext} $FMFLAG$PSBLAS_DIR/include $FMFLAG$PSBLAS_DIR/lib conftest.$ac_ext 1>&5'
dnl Warning : square brackets are EVIL! dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([for working installation of PSBLAS]) [AC_MSG_CHECKING([for working installation of PSBLAS])
cat > conftest.$ac_ext <<EOF AC_LANG_PUSH([Fortran])
program test ac_objext='o'
use psb_base_mod ac_ext='f90'
end program test ac_fc="${MPIFC-$FC}";
EOF save_FCFLAGS="$FCFLAGS";
if AC_TRY_EVAL(ac_compile) && test -s conftest${ac_objext}; then FCFLAGS=" $FMFLAG$PSBLAS_DIR/include $save_FCFLAGS"
ifelse([$1], , :, [rm -rf conftest* AC_COMPILE_IFELSE([
$1]) program test
else use psb_base_mod
echo "configure: failed program was:" >&AC_FD_CC end program test],
cat conftest.$ac_ext >&AC_FD_CC [ifelse([$1], , :, [ $1 ])],
ifelse([$2], , , [ rm -rf conftest* [ ifelse([$2], , , [ $2 ])])
$2 AC_LANG_POP([Fortran])
])dnl
fi
rm -f conftest*]) rm -f conftest*])
@ -390,57 +360,46 @@ dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it> dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
dnl dnl
AC_DEFUN(PAC_FORTRAN_PSBLAS_VERSION, AC_DEFUN(PAC_FORTRAN_PSBLAS_VERSION,
[AC_MSG_CHECKING([for version of PSBLAS])
AC_LANG_PUSH([Fortran])
ac_exeext='' ac_exeext=''
ac_objext='.o' ac_objext='o'
ac_ext='f90' ac_ext='f90'
ac_compile='${MPIFC-$FC} -c -o conftest${ac_objext} $FMFLAG$PSBLAS_DIR/include $FMFLAG$PSBLAS_DIR/lib conftest.$ac_ext 1>&5' save_FCFLAGS=$FCFLAGS;
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $FMFLAG$PSBLAS_DIR/include -L$PSBLAS_DIR/lib -lpsb_base $LIBS 1>&5' FCFLAGS=" $FMFLAG$PSBLAS_DIR/include $save_FCFLAGS"
save_LDFLAGS=$LDFLAGS;
LDFLAGS=" -L$PSBLAS_DIR/lib -lpsb_base $save_LDFLAGS"
dnl ac_compile='${MPIFC-$FC} -c -o conftest${ac_objext} $FMFLAG$PSBLAS_DIR/include $FMFLAG$PSBLAS_DIR/lib conftest.$ac_ext 1>&5'
dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $FMFLAG$PSBLAS_DIR/include -L$PSBLAS_DIR/lib -lpsb_base $LIBS 1>&5'
dnl Warning : square brackets are EVIL! dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([for version of PSBLAS])
cat > conftest.$ac_ext <<EOF
program test
use psb_base_mod
print *,psb_version_major_
end program test
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pac_cv_psblas_major=`./conftest${ac_exeext} | sed 's/^ *//'`
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
pac_cv_psblas_major="unknown";
fi
cat > conftest.$ac_ext <<EOF
program test
use psb_base_mod
print *,psb_version_minor_
end program test
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pac_cv_psblas_minor=`./conftest${ac_exeext} | sed 's/^ *//'`
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
pac_cv_psblas_minor="unknown";
fi
cat > conftest.$ac_ext <<EOF
program test
use psb_base_mod
print *,psb_patchlevel_
end program test
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pac_cv_psblas_patchlevel=`./conftest${ac_exeext} | sed 's/^ *//'`
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
pac_cv_psblas_patchlevel="unknown";
fi
rm -f conftest*
AC_MSG_RESULT([Done])
]
)
AC_LINK_IFELSE([
program test
use psb_base_mod
print *,psb_version_major_
end program test],
[pac_cv_psblas_major=`./conftest${ac_exeext} | sed 's/^ *//'`],
[pac_cv_psblas_major="unknown"])
AC_LINK_IFELSE([
program test
use psb_base_mod
print *,psb_version_minor_
end program test],
[pac_cv_psblas_minor=`./conftest${ac_exeext} | sed 's/^ *//'`],
[pac_cv_psblas_minor="unknown"])
AC_LINK_IFELSE([
program test
use psb_base_mod
print *,psb_patchlevel_
end program test],
[pac_cv_psblas_patchlevel=`./conftest${ac_exeext} | sed 's/^ *//'`],
[pac_cv_psblas_patchlevel="unknown"])
AC_MSG_RESULT([Done])
AC_LANG_POP([Fortran])])
dnl @synopsis PAC_FORTRAN_TEST_TR15581( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl @synopsis PAC_FORTRAN_TEST_TR15581( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl dnl
@ -457,18 +416,13 @@ dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it> dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
AC_DEFUN(PAC_FORTRAN_TEST_TR15581, AC_DEFUN(PAC_FORTRAN_TEST_TR15581,
ac_exeext=''
ac_ext='f90'
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([support for Fortran allocatables TR15581]) [AC_MSG_CHECKING([support for Fortran allocatables TR15581])
i=0 AC_LANG_PUSH([Fortran])
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do ac_exeext=''
i=`expr $i + 1` ac_ext='F90'
done dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
mkdir tmpdir_$i ac_fc=${MPIFC-$FC};
cd tmpdir_$i AC_COMPILE_IFELSE([
cat > conftest.$ac_ext <<EOF
module conftest module conftest
type outer type outer
integer, allocatable :: v(:) integer, allocatable :: v(:)
@ -517,22 +471,16 @@ program testtr15581
write(*,*) b write(*,*) b
write(*,*) db%v write(*,*) db%v
end program testtr15581 end program testtr15581],
EOF [ AC_MSG_RESULT([yes])
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ifelse([$1], , :, [ $1])],
AC_MSG_RESULT([yes]) [ AC_MSG_RESULT([no])
ifelse([$1], , :, [ echo "configure: failed program was:" >&AC_FD_CC
$1]) cat conftest.$ac_ext >&AC_FD_CC
else ifelse([$2], , , [ $2])])
AC_MSG_RESULT([no]) AC_LANG_POP([Fortran])
echo "configure: failed program was:" >&AC_FD_CC ])
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$2], , , [
$2
])dnl
fi
cd ..
rm -fr tmpdir_$i])
dnl @synopsis PAC_FORTRAN_TEST_VOLATILE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl @synopsis PAC_FORTRAN_TEST_VOLATILE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl dnl
dnl Will try to compile and link a program checking the VOLATILE Fortran support. dnl Will try to compile and link a program checking the VOLATILE Fortran support.
@ -548,183 +496,25 @@ dnl
dnl @author Michele Martone <michele.martone@uniroma2.it> dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it> dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
AC_DEFUN(PAC_FORTRAN_TEST_VOLATILE, AC_DEFUN(PAC_FORTRAN_TEST_VOLATILE,
ac_exeext=''
ac_ext='f90'
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
dnl Warning : square brackets are EVIL! dnl Warning : square brackets are EVIL!
[AC_MSG_CHECKING([support for Fortran VOLATILE]) [AC_MSG_CHECKING([support for Fortran VOLATILE])
i=0 AC_LANG_PUSH([Fortran])
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do ac_exeext=''
i=`expr $i + 1` ac_ext='F90'
done dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
mkdir tmpdir_$i ac_fc=${MPIFC-$FC};
cd tmpdir_$i AC_COMPILE_IFELSE([
cat > conftest.$ac_ext <<EOF
program conftest program conftest
integer, volatile :: i, j integer, volatile :: i, j
end program conftest end program conftest],
EOF [ AC_MSG_RESULT([yes])
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ifelse([$1], , :, [ $1])],
AC_MSG_RESULT([yes]) [ AC_MSG_RESULT([no])
ifelse([$1], , :, [ echo "configure: failed program was:" >&AC_FD_CC
$1]) cat conftest.$ac_ext >&AC_FD_CC
else ifelse([$2], , , [ $2])])
AC_MSG_RESULT([no]) AC_LANG_POP([Fortran])
echo "configure: failed program was:" >&AC_FD_CC ])
cat conftest.$ac_ext >&AC_FD_CC
ifelse([$2], , , [
$2
])dnl
fi
cd ..
rm -fr tmpdir_$i])
dnl @synopsis PAC_CHECK_BLACS
dnl
dnl Will try to find the BLACS
dnl
dnl Will use MPIFC, otherwise '$FC'.
dnl
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
dnl Note : This file will be likely to induce the compiler to create a module file
dnl (for a module called conftest).
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
dnl in the present directory, or in another, or with another name. So be warned!
dnl
dnl @author Michele Martone <michele.martone@uniroma2.it>
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
dnl
AC_DEFUN(PAC_CHECK_BLACS,
[AC_ARG_WITH(blacs, AC_HELP_STRING([--with-blacs=LIB], [Specify BLACSLIBNAME or -lBLACSLIBNAME or the absolute library filename.]),
[psblas_cv_blacs=$withval],
[psblas_cv_blacs=''])
case $psblas_cv_blacs in
yes | "") ;;
-* | */* | *.a | *.so | *.so.* | *.o)
BLACS_LIBS="$psblas_cv_blacs" ;;
*) BLACS_LIBS="-l$psblas_cv_blacs" ;;
esac
#
# Test user-defined BLACS
#
if test x"$psblas_cv_blacs" != "x" ; then
save_LIBS="$LIBS";
AC_LANG([Fortran])
LIBS="$BLACS_LIBS $LIBS"
AC_MSG_CHECKING([for dgesd2d in $BLACS_LIBS])
AC_TRY_LINK_FUNC(dgesd2d, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
AC_MSG_RESULT($psblas_cv_blacs_ok)
if test x"$psblas_cv_blacs_ok" == x"yes"; then
AC_MSG_CHECKING([for blacs_pinfo in $BLACS_LIBS])
AC_TRY_LINK_FUNC(blacs_pinfo, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
AC_MSG_RESULT($psblas_cv_blacs_ok)
fi
LIBS="$save_LIBS";
fi
AC_LANG([C])
######################################
# System BLACS with PESSL default names.
######################################
if test x"$BLACS_LIBS" == "x" ; then
AC_LANG([Fortran])
PAC_CHECK_LIBS([blacssmp blacsp2 blacs],
[dgesd2d],
[psblas_cv_blacs_ok=yes; LIBS="$LIBS $pac_check_libs_LIBS " ]
[BLACS_LIBS="$pac_check_libs_LIBS" ]
AC_MSG_NOTICE([BLACS libraries detected.]),[]
)
if test x"$BLACS_LIBS" != "x"; then
save_LIBS="$LIBS";
LIBS="$BLACS_LIBS $LIBS"
AC_MSG_CHECKING([for blacs_pinfo in $BLACS_LIBS])
AC_LANG([Fortran])
AC_TRY_LINK_FUNC(blacs_pinfo, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
AC_MSG_RESULT($psblas_cv_blacs_ok)
LIBS="$save_LIBS";
fi
fi
######################################
# Maybe we're looking at PESSL BLACS?#
######################################
if test x"$BLACS_LIBS" != "x" ; then
save_LIBS="$LIBS";
LIBS="$BLACS_LIBS $LIBS"
AC_MSG_CHECKING([for PESSL BLACS])
AC_LANG([Fortran])
AC_TRY_LINK_FUNC(esvemonp, [psblas_cv_pessl_blacs=yes], [psblas_cv_pessl_blacs=no])
AC_MSG_RESULT($psblas_cv_pessl_blacs)
LIBS="$save_LIBS";
fi
if test "x$psblas_cv_pessl_blacs" == "xyes"; then
FDEFINES="$psblas_cv_define_prepend-DHAVE_ESSL_BLACS $FDEFINES"
fi
##############################################################################
# Netlib BLACS library with default names
##############################################################################
if test x"$BLACS_LIBS" == "x" ; then
save_LIBS="$LIBS";
AC_LANG([Fortran])
PAC_CHECK_LIBS([ blacs_MPI-LINUX-0 blacs_MPI-SP5-0 blacs_MPI-SP4-0 blacs_MPI-SP3-0 blacs_MPI-SP2-0 blacsCinit_MPI-ALPHA-0 blacsCinit_MPI-IRIX64-0 blacsCinit_MPI-RS6K-0 blacsCinit_MPI-SPP-0 blacsCinit_MPI-SUN4-0 blacsCinit_MPI-SUN4SOL2-0 blacsCinit_MPI-T3D-0 blacsCinit_MPI-T3E-0
],
[dgesd2d],
[psblas_cv_blacs_ok=yes; LIBS="$LIBS $pac_check_libs_LIBS "
psblas_have_netlib_blacs=yes; ]
[BLACS_LIBS="$pac_check_libs_LIBS" ]
AC_MSG_NOTICE([BLACS libraries detected.]),[]
)
if test x"$BLACS_LIBS" != "x" ; then
AC_LANG([Fortran])
PAC_CHECK_LIBS([ blacsF77init_MPI-LINUX-0 blacsF77init_MPI-SP5-0 blacsF77init_MPI-SP4-0 blacsF77init_MPI-SP3-0 blacsF77init_MPI-SP2-0 blacsF77init_MPI-ALPHA-0 blacsF77init_MPI-IRIX64-0 blacsF77init_MPI-RS6K-0 blacsF77init_MPI-SPP-0 blacsF77init_MPI-SUN4-0 blacsF77init_MPI-SUN4SOL2-0 blacsF77init_MPI-T3D-0 blacsF77init_MPI-T3E-0
],
[blacs_pinfo],
[psblas_cv_blacs_ok=yes; LIBS="$pac_check_libs_LIBS $LIBS" ]
[BLACS_LIBS="$pac_check_libs_LIBS $BLACS_LIBS" ]
AC_MSG_NOTICE([Netlib BLACS Fortran initialization libraries detected.]),[]
)
fi
if test x"$BLACS_LIBS" != "x" ; then
AC_LANG([C])
PAC_CHECK_LIBS([ blacsCinit_MPI-LINUX-0 blacsCinit_MPI-SP5-0 blacsCinit_MPI-SP4-0 blacsCinit_MPI-SP3-0 blacsCinit_MPI-SP2-0 blacsCinit_MPI-ALPHA-0 blacsCinit_MPI-IRIX64-0 blacsCinit_MPI-RS6K-0 blacsCinit_MPI-SPP-0 blacsCinit_MPI-SUN4-0 blacsCinit_MPI-SUN4SOL2-0 blacsCinit_MPI-T3D-0 blacsCinit_MPI-T3E-0
],
[Cblacs_pinfo],
[psblas_cv_blacs_ok=yes; LIBS="$pac_check_libs_LIBS $LIBS" ]
[BLACS_LIBS="$BLACS_LIBS $pac_check_libs_LIBS" ]
AC_MSG_NOTICE([Netlib BLACS C initialization libraries detected.]),[]
)
fi
LIBS="$save_LIBS";
fi
if test x"$BLACS_LIBS" == "x" ; then
AC_MSG_ERROR([
No BLACS library detected! $PACKAGE_NAME will be unusable.
Please make sure a BLACS implementation is accessible (ex.: --with-blacs="-lblacsname -L/blacs/dir" )
])
else
save_LIBS="$LIBS";
LIBS="$BLACS_LIBS $LIBS"
AC_MSG_CHECKING([for ksendid in $BLACS_LIBS])
AC_LANG([Fortran])
AC_TRY_LINK_FUNC(ksendid, [psblas_cv_have_sendid=yes],[psblas_cv_have_sendid=no])
AC_MSG_RESULT($psblas_cv_have_sendid)
LIBS="$save_LIBS"
AC_LANG([C])
if test "x$psblas_cv_have_sendid" == "xyes"; then
FDEFINES="$psblas_cv_define_prepend-DHAVE_KSENDID $FDEFINES"
fi
fi
])dnl
dnl @synopsis PAC_MAKE_IS_GNUMAKE dnl @synopsis PAC_MAKE_IS_GNUMAKE
dnl dnl
@ -772,7 +562,7 @@ AC_ARG_WITH(umfpacklibdir, AC_HELP_STRING([--with-umfpacklibdir=DIR], [Specify t
[mld2p4_cv_umfpacklibdir=$withval], [mld2p4_cv_umfpacklibdir=$withval],
[mld2p4_cv_umfpacklibdir='']) [mld2p4_cv_umfpacklibdir=''])
AC_LANG([C]) AC_LANG_PUSH([C])
save_LIBS="$LIBS" save_LIBS="$LIBS"
save_CPPFLAGS="$CPPFLAGS" save_CPPFLAGS="$CPPFLAGS"
if test "x$mld2p4_cv_umfpackincdir" != "x"; then if test "x$mld2p4_cv_umfpackincdir" != "x"; then
@ -857,6 +647,7 @@ if test "x$pac_umf_header_ok" == "xyes" ; then
fi fi
LIBS="$SAVE_LIBS"; LIBS="$SAVE_LIBS";
CPPFLAGS="$SAVE_CPPFLAGS"; CPPFLAGS="$SAVE_CPPFLAGS";
AC_LANG_POP([C])
])dnl ])dnl
dnl @synopsis PAC_CHECK_SUPERLU dnl @synopsis PAC_CHECK_SUPERLU
@ -905,7 +696,7 @@ fi
LIBS="$SLU_LIBS $LIBS" LIBS="$SLU_LIBS $LIBS"
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADER([slu_ddefs.h], AC_CHECK_HEADERS([slu_ddefs.h],
[pac_slu_header_ok=yes], [pac_slu_header_ok=yes],
[pac_slu_header_ok=no; SLU_INCLUDES=""]) [pac_slu_header_ok=no; SLU_INCLUDES=""])
if test "x$pac_slu_header_ok" == "xno" ; then if test "x$pac_slu_header_ok" == "xno" ; then
@ -914,7 +705,7 @@ dnl Maybe Include or include subdirs?
SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include " SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include "
CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADER([slu_ddefs.h], AC_CHECK_HEADERS([slu_ddefs.h],
[pac_slu_header_ok=yes], [pac_slu_header_ok=yes],
[pac_slu_header_ok=no; SLU_INCLUDES=""]) [pac_slu_header_ok=no; SLU_INCLUDES=""])
fi fi
@ -938,37 +729,21 @@ if test "x$pac_slu_header_ok" == "xyes" ; then
fi fi
if test "x$pac_slu_header_ok" == "xyes" ; then if test "x$pac_slu_header_ok" == "xyes" ; then
AC_MSG_CHECKING([for superlu version 5]) AC_MSG_CHECKING([for superlu version 5])
ac_objext='.o' AC_LANG_PUSH([C])
ac_ext='c' AC_COMPILE_IFELSE(
ac_compile='${MPICC-$CC} -c -o conftest${ac_objext} $CPPFLAGS conftest.$ac_ext 1>&5' [AC_LANG_SOURCE([[#include "slu_ddefs.h"
i=0 int testdslu()
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; { SuperMatrix AC, *L, *U;
do int *perm_r, *perm_c, *etree, panel_size, permc_spec, relax, info;
i=`expr $i + 1` superlu_options_t options; SuperLUStat_t stat;
done GlobalLU_t Glu;
mkdir tmpdir_$i dgstrf(&options, &AC, relax, panel_size, etree,
cd tmpdir_$i NULL, 0, perm_c, perm_r, L, U, &Glu, &stat, &info);
cat > conftest.$ac_ext <<EOF
#include "slu_ddefs.h" }]])],
int testdslu() [ AC_MSG_RESULT([yes]); pac_slu_version="5";],
{ SuperMatrix AC, *L, *U; [ AC_MSG_RESULT([no]); pac_slu_version="3_4";])
int *perm_r, *perm_c, *etree, panel_size, permc_spec, relax, info; AC_LANG_POP([C])
superlu_options_t options; SuperLUStat_t stat;
GlobalLU_t Glu;
dgstrf(&options, &AC, relax, panel_size, etree,
NULL, 0, perm_c, perm_r, L, U, &Glu, &stat, &info);
}
EOF
if AC_TRY_EVAL(ac_compile) && test -s conftest${ac_objext}; then
pac_slu_version="5";
AC_MSG_RESULT([yes]);
else
pac_slu_version="3_4";
AC_MSG_RESULT([no]);
fi
cd ..;
rm -fr tmpdir_$i;
fi fi
LIBS="$save_LIBS"; LIBS="$save_LIBS";
@ -1028,7 +803,7 @@ fi
LIBS="$SLUDIST_LIBS $save_LIBS" LIBS="$SLUDIST_LIBS $save_LIBS"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADER([superlu_ddefs.h], AC_CHECK_HEADERS([superlu_ddefs.h],
[pac_sludist_header_ok=yes], [pac_sludist_header_ok=yes],
[pac_sludist_header_ok=no; SLUDIST_INCLUDES=""]) [pac_sludist_header_ok=no; SLUDIST_INCLUDES=""])
if test "x$pac_sludist_header_ok" == "xno" ; then if test "x$pac_sludist_header_ok" == "xno" ; then
@ -1037,7 +812,7 @@ dnl Maybe Include or include subdirs?
SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include" SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include"
CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS"
AC_CHECK_HEADER([superlu_ddefs.h], AC_CHECK_HEADERS([superlu_ddefs.h],
[pac_sludist_header_ok=yes], [pac_sludist_header_ok=yes],
[pac_sludist_header_ok=no; SLUDIST_INCLUDES=""]) [pac_sludist_header_ok=no; SLUDIST_INCLUDES=""])
fi fi
@ -1061,34 +836,18 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
fi fi
AC_MSG_RESULT($pac_sludist_lib_ok) AC_MSG_RESULT($pac_sludist_lib_ok)
AC_MSG_CHECKING([for superlu_dist version 4]) AC_MSG_CHECKING([for superlu_dist version 4])
ac_objext='.o' AC_LANG_PUSH([C])
ac_ext='c' ac_cc=${MPICC-$CC}
ac_compile='${MPICC-$CC} -c -o conftest${ac_objext} $CPPFLAGS conftest.$ac_ext 1>&5' AC_COMPILE_IFELSE(
i=0 [AC_LANG_SOURCE([[ #include "superlu_ddefs.h"
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; int testdslud()
do { LUstruct_t *LUstruct;
i=`expr $i + 1` int n;
done LUstructInit(n, LUstruct);
mkdir tmpdir_$i }]])],
cd tmpdir_$i [ AC_MSG_RESULT([yes]); pac_sludist_version="4";],
cat > conftest.$ac_ext <<EOF [ AC_MSG_RESULT([no]); pac_sludist_version="2_3";])
#include "superlu_ddefs.h" AC_LANG_POP([C])
int testdslud()
{ LUstruct_t *LUstruct;
int n;
LUstructInit(n, LUstruct);
}
EOF
if AC_TRY_EVAL(ac_compile) && test -s conftest${ac_objext}; then
pac_sludist_version="4";
AC_MSG_RESULT([yes]);
else
pac_sludist_version="2_3";
AC_MSG_RESULT([no]);
fi
cd ..;
rm -fr tmpdir_$i;
fi fi
LIBS="$save_LIBS"; LIBS="$save_LIBS";
CPPFLAGS="$save_CPPFLAGS"; CPPFLAGS="$save_CPPFLAGS";

6217
configure vendored

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save