ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/ac-tools/aclocal.m4
(Generate patch)

Comparing trunk/OOPSE/ac-tools/aclocal.m4 (file contents):
Revision 948 by gezelter, Thu Jan 15 15:51:17 2004 UTC vs.
Revision 1238 by gezelter, Fri Jun 4 14:59:17 2004 UTC

# Line 534 | Line 534 | if test "$ac_test_CFLAGS" != "set"; then
534          fi;;
535     *darwin*)
536          if test "$CC" = xlc -o "$CC" = cc; then
537 <                CFLAGS="-qthreaded -O5 -Q=20 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
537 >                CFLAGS="-qthreaded -O5 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
538          fi;;
539    esac
540  
# Line 652 | Line 652 | if test "$ac_test_CXXFLAGS" != "set"; then
652                  echo "*******************************************************"
653          fi;;
654     *darwin*)
655 <        if test "$CXX" = xlC; then
656 <                CXXFLAGS="-qthreaded -O5 -Q=20 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
655 >        if test "$CXX" = xlc++; then
656 >                CXXFLAGS="-qthreaded -O5 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
657          fi;;
658    esac
659  
# Line 767 | Line 767 | if test x"$F90FLAGS" = x ; then
767                  echo "*******************************************************"
768          fi;;
769     *darwin*)
770 <        if test "$F90" = f90 -o "$F90" = xlf90; then
770 >        if test "$F90" = f90 -o "$F90" = xlf90 -o "$F90" = xlf95; then
771                  F90FLAGS="-qthreaded -O5 -qtune=auto -qarch=auto -qunroll=auto"
772          fi;;
773    esac
# Line 921 | Line 921 | AC_DEFUN([ACX_MPI], [
921   fi
922   ])
923  
924 + dnl check for the required MPI library
925   AC_DEFUN([ACX_MPI], [
925 AC_PREREQ(2.50) dnl for AC_LANG_CASE
926  
927 < AC_LANG_CASE([C], [
928 <        AC_REQUIRE([AC_PROG_CC])
929 <        AC_ARG_VAR(MPICC,[MPI C compiler command])
930 <        AC_CHECK_PROGS(MPICC, mpicc hcc mpcc mpcc_r mpxlc, $CC)
931 <        acx_mpi_save_CC="$CC"
932 <        CC="$MPICC"
933 <        AC_SUBST(MPICC)
934 < ],
935 < [C++], [
936 <        AC_REQUIRE([AC_PROG_CXX])
937 <        AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
938 <        AC_CHECK_PROGS(MPICXX, mpiCC mpCC, $CXX)
939 <        acx_mpi_save_CXX="$CXX"
940 <        CXX="$MPICXX"
941 <        AC_SUBST(MPICXX)
942 < ],
943 < [Fortran 90], [
944 <        AC_REQUIRE([AC_PROG_F90])
945 <        AC_ARG_VAR(MPIF77,[MPI Fortran compiler command])
946 <        AC_CHECK_PROGS(MPIF90, mpif90 hf90 mpxlf90 mpf90 mpxlf95 mpxlf_r, $F90)
947 <        acx_mpi_save_F90="$F90"
948 <        F90="$MPIF90"
949 <        AC_SUBST(MPIF90)
950 < ])
927 > # Set variables...
928 > MPI_LIB_DIR="$MPI/lib"
929 > MPI_INC_DIR="$MPI/include"
930 > AC_SUBST([MPI_LIB_DIR])
931 > AC_SUBST([MPI_INC_DIR])
932  
933 < if test x = x"$MPILIBS"; then
934 <        AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
935 <                [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
936 <                [Fortran 90], [AC_MSG_CHECKING([for MPI_Init])
937 <                        AC_TRY_LINK([],[      call MPI_Init], [MPILIBS=" "
938 <                                AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])])
933 > AC_MSG_CHECKING([for mpi.h])
934 > have_mpi_h=0
935 > echo '#include <mpi.h>' > conftest.cc
936 > if test -z "`${CXX} -I${MPI_INC_DIR} -c conftest.cc 2>&1`"; then
937 >        AC_MSG_RESULT(yes)
938 >        have_mpi_h=1
939 > else
940 >        AC_MSG_RESULT(no! Check MPI include paths)
941 >        USE_MPI="no"
942   fi
943 < if test x = x"$MPILIBS"; then
944 <        AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
943 > rm -f conftest*
944 > if test "$have_mpi_h" = 1; then
945 >    AC_DEFINE(HAVE_MPI_H, 1, [have mpi.h])
946   fi
962 if test x = x"$MPILIBS"; then
963        AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
964 fi
947  
948 < dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
949 < dnl latter uses $CPP, not $CC (which may be mpicc).
950 < AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
951 <        AC_MSG_CHECKING([for mpi.h])
952 <        AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
953 <                AC_MSG_RESULT(no)])
954 < fi],
955 < [C++], [if test x != x"$MPILIBS"; then
956 <        AC_MSG_CHECKING([for mpi.h])
957 <        AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
958 <                AC_MSG_RESULT(no)])
959 < fi])
948 > AC_MSG_CHECKING([whether mpif.h is usable])
949 > have_mpif_h=0
950 > rm -f conftest*
951 > cat >conftest.f90 <<EOF
952 > program main
953 >   include 'mpif.h'
954 > end
955 > EOF
956 > if $F90 -I$MPI_INC_DIR -c conftest.f90 > conftest.out 2>&1 ; then
957 >        AC_MSG_RESULT(yes)
958 >        MPI_F90_INC="$MPI_INC_DIR"
959 >        have_mpif_h=1
960 > else
961 >        if test -s conftest.out ; then
962 >                cat conftest.out >> config.log
963 >        fi
964 >        AC_MSG_RESULT([no! Check MPI include paths])
965 >        USE_MPI="no"
966 > fi
967 > rm -f conftest*
968 > AC_SUBST(MPI_F90_INC)
969 > if test "$have_mpif_h" = 1; then
970 >    AC_DEFINE(HAVE_MPIF_H, 1, [have mpif.h])
971 > fi
972  
973 < AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
974 <        [C++], [CXX="$acx_mpi_save_CXX"],
975 <        [Fortran 90], [F90="$acx_mpi_save_F90"])
973 > AC_LANG_PUSH(C)
974 > ac_save_LDFLAGS=$LDFLAGS
975 > LDFLAGS="${LDFLAGS} -L${MPI_LIB_DIR} "
976  
977 < AC_SUBST(MPILIBS)
977 > if test x = x"$MPI_LIB"; then
978 >        AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi"])
979 > fi
980 > if test x = x"$MPI_LIB"; then
981 >        AC_CHECK_LIB(mpich, MPI_Init, [MPI_LIB="-lmpich"])
982 > fi
983 > $as_unset ac_cv_lib_mpi_MPI_Init
984 > if test x = x"$MPI_LIB"; then
985 >        AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam"], [],
986 >                     "-llam")
987 > fi
988  
989 < # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
990 < if test x = x"$MPILIBS"; then
991 <        $2
992 <        :
989 > $as_unset ac_cv_lib_mpi_MPI_Init
990 > if test x = x"$MPI_LIB"; then
991 > AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam -lpthread"],[
992 >             AC_MSG_ERROR([Didn't find liblam, libmpi, or libmpich; check path for MPI package first...])
993 >             USE_MPI="no"
994 >             ],
995 >             [-llam -lpthread])
996 > fi
997 >
998 > AC_SUBST(MPI_LIB)
999 >
1000 > AC_MSG_CHECKING([for MPI Fortran library])
1001 > MPI_F90_LIB=""
1002 > if test -f "$MPI_LIB_DIR/libfmpich.a" ; then
1003 >        MPI_F90_LIB="-lfmpich"
1004 > elif test -f "$MPI_LIB_DIR/liblamf77mpi.a" ; then
1005 >        MPI_F90_LIB="-llamf77mpi"
1006   else
1007 <        ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
1008 <        :
1007 >        dnl nothing special found, we'll assume that the C
1008 >        dnl library is all we need
1009 >        MPI_F90_LIB="  "
1010   fi
1011 + AC_MSG_RESULT([found $MPI_F90_LIB])
1012 + AC_SUBST(MPI_F90_LIB)
1013   ])dnl ACX_MPI
994

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines