32 |
|
AC_PROG_CC([icc xlc gcc cc]) |
33 |
|
|
34 |
|
dnl Checks for C++ compiler |
35 |
< |
AC_PROG_CXX([icpc icc xlC CC g++ c++]) |
35 |
> |
AC_PROG_CXX([icpc icc xlc++ xlC CC g++ c++]) |
36 |
|
|
37 |
|
dnl If we are not running g++ then we might need some other flags |
38 |
|
dnl to get the templates compiled correctly |
123 |
|
exit 1 |
124 |
|
fi |
125 |
|
|
126 |
< |
AC_MSG_CHECKING([for mpi-directory]) |
126 |
> |
|
127 |
|
AC_ARG_WITH(mpi, |
128 |
< |
[ --with-mpi=MPIDIR give the path for MPI [/usr/local]], |
129 |
< |
MPI_DIR="$withval", MPI_DIR="/usr/local") |
130 |
< |
AC_MSG_RESULT([$MPI_DIR]) |
131 |
< |
AC_SUBST([mpi]) |
128 |
> |
[AC_HELP_STRING([--with-mpi=<prefix>], |
129 |
> |
[compile with MPI libraries in <prefix> [default=no]])], |
130 |
> |
with_mpi=$withval, |
131 |
> |
with_mpi="no") |
132 |
|
|
133 |
< |
AC_MSG_CHECKING([for mpi-lib-directory]) |
134 |
< |
AC_ARG_WITH(mpi_libdir, |
135 |
< |
[ --with-mpi-libdir=dir give the path for MPI-libraries [MPI_DIR/lib]], |
136 |
< |
MPI_LIBDIR="$withval", MPI_LIBDIR="$MPI_DIR/lib") |
137 |
< |
AC_MSG_RESULT([$MPI_LIBDIR]) |
138 |
< |
AC_SUBST([MPI_LIBDIR]) |
139 |
< |
|
140 |
< |
AC_MSG_CHECKING([for mpi-inc-directory]) |
141 |
< |
AC_ARG_WITH(mpi-inc, |
142 |
< |
[ --with-mpi-inc=dir give the path for MPI-include-files [MPI_DIR/include]], |
143 |
< |
MPI_INC="$withval", MPI_INC="$MPI_DIR/include") |
144 |
< |
AC_MSG_RESULT([$MPI_INC]) |
145 |
< |
AC_SUBST([MPI_INC]) |
146 |
< |
|
147 |
< |
AC_MSG_CHECKING([for mpi.h]) |
148 |
< |
HAVE_MPIDOTH_C="no" |
149 |
< |
echo '#include <mpi.h>' > conftest.cc |
150 |
< |
if test -z "`${CXX} -I${MPI_INC} -c conftest.cc 2>&1`"; then |
151 |
< |
AC_MSG_RESULT(yes) |
152 |
< |
HAVE_MPIDOTH_C="yes" |
153 |
< |
else |
154 |
< |
AC_MSG_RESULT(no! Check MPI include paths) |
155 |
< |
fi |
156 |
< |
rm -f conftest* |
157 |
< |
|
158 |
< |
AC_MSG_CHECKING([whether mpif.h is usable]) |
159 |
< |
HAVE_MPIFDOTH_F90="no" |
160 |
< |
rm -f conftest* |
161 |
< |
cat >conftest.f90 <<EOF |
162 |
< |
program main |
163 |
< |
include 'mpif.h' |
164 |
< |
end |
165 |
< |
EOF |
166 |
< |
if $F90 -I$MPI_INC -c conftest.f90 > conftest.out 2>&1 ; then |
167 |
< |
AC_MSG_RESULT(yes) |
168 |
< |
MPI_F90INC="$MPI_INC" |
169 |
< |
HAVE_MPIFDOTH_F90="yes" |
170 |
< |
else |
171 |
< |
if test -s conftest.out ; then cat conftest.out >> config.log ; fi |
172 |
< |
AC_MSG_RESULT([no! Check MPI include paths]) |
133 |
> |
case "x$with_mpi" in |
134 |
> |
xyes | "x") USE_MPI=yes;; |
135 |
> |
xno) USE_MPI=no ;; |
136 |
> |
*) MPI="$with_mpi"; USE_MPI=yes ;; |
137 |
> |
esac |
138 |
> |
if test "$USE_MPI" = "yes" -a -z "$with_mpi"; then |
139 |
> |
MPI="/usr/local" |
140 |
|
fi |
141 |
< |
rm -f conftest* |
142 |
< |
AC_SUBST([MPI_F90INC]) |
143 |
< |
|
177 |
< |
AC_LANG_PUSH(C) |
178 |
< |
ac_save_LDFLAGS=$LDFLAGS |
179 |
< |
LDFLAGS="${LDFLAGS} -L${MPI_LIBDIR} " |
180 |
< |
|
181 |
< |
if test x = x"$MPI_LIB"; then |
182 |
< |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi"]) |
141 |
> |
if test "$USE_MPI" = "yes"; then |
142 |
> |
echo "MPI = $MPI" |
143 |
> |
ACX_MPI |
144 |
|
fi |
145 |
< |
if test x = x"$MPI_LIB"; then |
185 |
< |
AC_CHECK_LIB(mpich, MPI_Init, [MPI_LIB="-lmpich"]) |
186 |
< |
fi |
187 |
< |
$as_unset ac_cv_lib_mpi_MPI_Init |
188 |
< |
if test x = x"$MPI_LIB"; then |
189 |
< |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam"], [], |
190 |
< |
"-llam") |
191 |
< |
fi |
145 |
> |
AC_SUBST(USE_MPI) |
146 |
|
|
193 |
– |
$as_unset ac_cv_lib_mpi_MPI_Init |
194 |
– |
if test x = x"$MPI_LIB"; then |
195 |
– |
AC_CHECK_LIB(mpi, MPI_Init, [MPI_LIB="-lmpi -llam -lpthread"], |
196 |
– |
[AC_MSG_ERROR([Didn't find liblam, libmpi, or libmpich; check path for MPI package first...])], |
197 |
– |
[-llam -lpthread]) |
198 |
– |
fi |
147 |
|
|
200 |
– |
AC_MSG_RESULT(found $MPI_LIB) |
201 |
– |
AC_SUBST(MPI_LIB) |
202 |
– |
|
203 |
– |
AC_MSG_CHECKING([for MPI Fortran library]) |
204 |
– |
MPI_F90LIB="" |
205 |
– |
if test -f "$MPI_LIBDIR/libfmpich.a" ; then |
206 |
– |
MPI_F90LIB="-lfmpich" |
207 |
– |
elif test -f "$MPI_LIBDIR/liblamf77mpi.a" ; then |
208 |
– |
MPI_F90LIB="-llamf77mpi" |
209 |
– |
else |
210 |
– |
# nothing special found, we'll assume that the C library is all we need |
211 |
– |
MPI_F90LIB=" " |
212 |
– |
fi |
213 |
– |
AC_MSG_RESULT([found $MPI_F90LIB]) |
214 |
– |
AC_SUBST(MPI_F90LIB) |
215 |
– |
|
216 |
– |
dnl CHECK_MPI |
217 |
– |
|
218 |
– |
dnl I don't think this works right now: |
219 |
– |
dnl ACX_MPI |
220 |
– |
|
148 |
|
AM_PATH_SPRNG |
149 |
|
CHECK_MKL |
150 |
|
|
174 |
|
MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f" |
175 |
|
|
176 |
|
dnl **** Final list of subdirs |
177 |
< |
SUBDIRS="libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party" |
177 |
> |
SUBDIRS="libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party " |
178 |
|
|
179 |
|
dnl **** Define CFLAGS etc empty to prevent configure from setting them |
180 |
|
CFLAGS=${CFLAGS-""} |
210 |
|
AC_SUBST(LDFLAGS) |
211 |
|
AC_SUBST(PREPFLAG) |
212 |
|
AC_SUBST(PREPDEFFLAG) |
213 |
< |
AC_CONFIG_HEADER([libmdtools/config.h]) |
213 |
> |
AC_CONFIG_HEADER([libBASS/config.h libmdtools/config.h]) |
214 |
|
AC_CONFIG_FILES([Makefile |
215 |
|
libBASS/Makefile libmdtools/Makefile src/Makefile utils/Makefile |
216 |
|
utils/sysbuilder/Makefile forceFields/Makefile samples/Makefile |