787 |
|
fi |
788 |
|
]) |
789 |
|
|
790 |
– |
dnl check for the required MPI library |
791 |
– |
AC_DEFUN([ACX_MPI], [ |
790 |
|
|
793 |
– |
# Set variables... |
794 |
– |
MPI_LIB_DIR="$MPI/lib" |
795 |
– |
MPI_INC_DIR="$MPI/include" |
796 |
– |
AC_SUBST([MPI_LIB_DIR]) |
797 |
– |
AC_SUBST([MPI_INC_DIR]) |
791 |
|
|
799 |
– |
AC_LANG(C) |
800 |
– |
AC_MSG_CHECKING([for mpi.h]) |
801 |
– |
have_mpi_h=0 |
802 |
– |
rm -f conftest* |
803 |
– |
echo '#include <mpi.h>' > conftest.c |
804 |
– |
if ${CC} -I${MPI_INC_DIR} -c conftest.c 2>&1 ; then |
805 |
– |
AC_MSG_RESULT(yes) |
806 |
– |
have_mpi_h=1 |
807 |
– |
else |
808 |
– |
if test -s conftest.out ; then |
809 |
– |
cat conftest.out >> config.log |
810 |
– |
fi |
811 |
– |
AC_MSG_RESULT(no! Check MPI include paths) |
812 |
– |
USE_MPI="no" |
813 |
– |
fi |
814 |
– |
rm -f conftest* |
815 |
– |
if test "$have_mpi_h" = 1; then |
816 |
– |
AC_DEFINE(HAVE_MPI_H, 1, [have mpi.h]) |
817 |
– |
fi |
792 |
|
|
819 |
– |
AC_MSG_CHECKING([whether mpif.h is usable]) |
820 |
– |
AC_LANG_SAVE() |
821 |
– |
AC_LANG(Fortran) |
822 |
– |
ac_save_ext=$ac_ext |
823 |
– |
ac_ext=F90 |
824 |
– |
ac_save_FCFLAGS=$FCFLAGS |
825 |
– |
have_mpif_h=0 |
826 |
– |
rm -f conftest* |
827 |
– |
cat >conftest.$ac_ext <<EOF |
828 |
– |
program main |
829 |
– |
include 'mpif.h' |
830 |
– |
end |
831 |
– |
EOF |
832 |
– |
if $FC -I$MPI_INC_DIR -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext > conftest.out 2>&1 ; then |
833 |
– |
AC_MSG_RESULT(yes) |
834 |
– |
MPI_F90_INC="$MPI_INC_DIR" |
835 |
– |
have_mpif_h=1 |
836 |
– |
else |
837 |
– |
if test -s conftest.out ; then |
838 |
– |
cat conftest.out >> config.log |
839 |
– |
fi |
840 |
– |
AC_MSG_RESULT([no! Check MPI include paths]) |
841 |
– |
USE_MPI="no" |
842 |
– |
fi |
843 |
– |
rm -f conftest* |
844 |
– |
AC_SUBST(MPI_F90_INC) |
845 |
– |
if test "$have_mpif_h" = 1; then |
846 |
– |
AC_DEFINE(HAVE_MPIF_H, 1, [have mpif.h]) |
847 |
– |
fi |
848 |
– |
FCFLAGS=$ac_save_FCFLAGS |
849 |
– |
ac_ext=$ac_save_ext |
850 |
– |
AC_LANG_RESTORE() |
851 |
– |
|
852 |
– |
AC_LANG_PUSH(C) |
853 |
– |
ac_save_LDFLAGS=$LDFLAGS |
854 |
– |
LDFLAGS="-L${MPI_LIB_DIR} ${LDFLAGS} " |
855 |
– |
|
856 |
– |
if test x = x"$MPI_LIB"; then |
857 |
– |
AC_CHECK_LIB(mpich, MPI_Init, [MPI_LIB="-lmpich"]) |
858 |
– |
fi |
859 |
– |
$as_unset ac_cv_lib_mpich_MPI_Init |
860 |
– |
if test x = x"$MPI_LIB"; then |
861 |
– |
AC_CHECK_LIB(pmpich, MPI_Init, [MPI_LIB="-lpmpich -lmpich -lpmpich -lmpich"], [], |
862 |
– |
[-lmpich -lpmpich -lmpich]) |
863 |
– |
fi |
864 |
– |
if test x = x"$MPI_LIB"; then |
865 |
– |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi"]) |
866 |
– |
fi |
867 |
– |
$as_unset ac_cv_lib_mpi_MPI_Init |
868 |
– |
if test x = x"$MPI_LIB"; then |
869 |
– |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam"], [], |
870 |
– |
[-llam]) |
871 |
– |
fi |
872 |
– |
$as_unset ac_cv_lib_mpi_MPI_Init |
873 |
– |
if test x = x"$MPI_LIB"; then |
874 |
– |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam -lpthread"],[ |
875 |
– |
AC_MSG_ERROR([Didn't find liblam, libmpi, or libmpich; check path for MPI package first...]) |
876 |
– |
USE_MPI="no" |
877 |
– |
], |
878 |
– |
[-llam -lpthread]) |
879 |
– |
fi |
880 |
– |
|
881 |
– |
AC_SUBST(MPI_LIB) |
882 |
– |
|
883 |
– |
AC_MSG_CHECKING([for MPI Fortran library]) |
884 |
– |
MPI_F90_LIB="" |
885 |
– |
if test -f "$MPI_LIB_DIR/libfmpich.a" ; then |
886 |
– |
MPI_F90_LIB="-lfmpich" |
887 |
– |
elif test -f "$MPI_LIB_DIR/liblamf77mpi.a" ; then |
888 |
– |
MPI_F90_LIB="-llamf77mpi" |
889 |
– |
else |
890 |
– |
dnl nothing special found, we'll assume that the C |
891 |
– |
dnl library is all we need |
892 |
– |
MPI_F90_LIB=" " |
893 |
– |
fi |
894 |
– |
AC_MSG_RESULT([found $MPI_F90_LIB]) |
895 |
– |
AC_SUBST(MPI_F90_LIB) |
896 |
– |
])dnl ACX_MPI |
897 |
– |
|
898 |
– |
|
899 |
– |
|
793 |
|
AC_DEFUN([adl_FUNC_GETOPT_LONG], |
794 |
|
[AC_PREREQ(2.49)dnl |
795 |
|
# clean out junk possibly left behind by a previous configuration |