| 1 |
|
dnl **** Process this file with autoconf to produce a configure script. |
| 2 |
|
AC_PREREQ(2.59) |
| 3 |
< |
AC_INIT(OOPSE, 3.0, gezelter@nd.edu, oopse) |
| 3 |
> |
AC_INIT(OOPSE, 4.0, gezelter@nd.edu, oopse) |
| 4 |
|
AC_CONFIG_AUX_DIR(ac-tools) |
| 5 |
|
AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp]) |
| 6 |
|
AC_CONFIG_HEADER([src/config.h]) |
| 9 |
|
builtin(include, ac-tools/AC_CXX_HAVE_STL.m4) |
| 10 |
|
builtin(include, ac-tools/AC_CXX_NAMESPACES.m4) |
| 11 |
|
builtin(include, ac-tools/AC_CXX_STD.m4) |
| 12 |
+ |
builtin(include, ac-tools/ACX_MPI.m4) |
| 13 |
+ |
builtin(include, ac-tools/CGAL.m4) |
| 14 |
|
|
| 15 |
|
# who am i |
| 16 |
|
AC_CANONICAL_HOST |
| 57 |
|
AC_SUBST(USE_SINGLE_PRECISION) |
| 58 |
|
fi |
| 59 |
|
|
| 60 |
+ |
if test x"$CC" != x; then |
| 61 |
+ |
AC_CHECK_PROGS(ac_cc_set,[$CC],[no]) |
| 62 |
+ |
AS_IF([test AS_VAR_GET([ac_cc_set]) != no],[ |
| 63 |
+ |
AC_PATH_PROG(ac_cc_path,[$ac_cc_set],[no])],[ |
| 64 |
+ |
AC_ERROR([Specified C compiler $CC doesn't seem to exist!])]) |
| 65 |
+ |
|
| 66 |
+ |
AS_IF([test AS_VAR_GET([ac_cc_path]) != no],[ |
| 67 |
+ |
AC_MSG_NOTICE([Will attempt to use $CC as C compiler])],[ |
| 68 |
+ |
AC_ERROR([Can't find path to user-specified C compiler $CC])]) |
| 69 |
+ |
fi |
| 70 |
+ |
|
| 71 |
+ |
if test x"$CXX" != x; then |
| 72 |
+ |
AC_CHECK_PROGS(ac_cxx_set,[$CXX],[no]) |
| 73 |
+ |
AS_IF([test AS_VAR_GET([ac_cxx_set]) != no],[ |
| 74 |
+ |
AC_PATH_PROG(ac_cxx_path,[$ac_cxx_set],[no])],[ |
| 75 |
+ |
AC_ERROR([Specified C++ compiler $CXX doesn't seem to exist!])]) |
| 76 |
+ |
|
| 77 |
+ |
AS_IF([test AS_VAR_GET([ac_cxx_path]) != no],[ |
| 78 |
+ |
AC_MSG_NOTICE([Will attempt to use $CXX as C++ compiler])],[ |
| 79 |
+ |
AC_ERROR([Can't find path to user-specified C++ compiler $CXX])]) |
| 80 |
+ |
fi |
| 81 |
+ |
|
| 82 |
+ |
if test x"$FC" != x; then |
| 83 |
+ |
AC_CHECK_PROGS(ac_fc_set,[$FC],[no]) |
| 84 |
+ |
AS_IF([test AS_VAR_GET([ac_fc_set]) != no],[ |
| 85 |
+ |
AC_PATH_PROG(ac_fc_path,[$ac_fc_set],[no])],[ |
| 86 |
+ |
AC_ERROR([Specified Fortran compiler $FC doesn't seem to exist!])]) |
| 87 |
+ |
|
| 88 |
+ |
AS_IF([test AS_VAR_GET([ac_fc_path]) != no],[ |
| 89 |
+ |
AC_MSG_NOTICE([Will attempt to use $FC as Fortran compiler])],[ |
| 90 |
+ |
AC_ERROR([Can't find path to user-specified Fortran compiler $FC])]) |
| 91 |
+ |
fi |
| 92 |
+ |
|
| 93 |
+ |
|
| 94 |
+ |
dnl do MPI checks |
| 95 |
+ |
ACX_MPI([USE_MPI="yes"], |
| 96 |
+ |
[USE_MPI="no" |
| 97 |
+ |
AC_MSG_WARN([No suitable MPI implementation found. oopse_MPI will not be build.])]) |
| 98 |
+ |
AC_SUBST(USE_MPI) |
| 99 |
+ |
|
| 100 |
|
# Checks for programs. |
| 101 |
< |
AC_PROG_CXX([mpicxx icpc pathCC pgCC c++ xlc++ xlC g++ CC]) |
| 102 |
< |
AC_PROG_CC([mpicc icc pathcc pgcc cc xlc gcc]) |
| 103 |
< |
AC_PROG_FC([mpif90 ifort ifc pathf95 pgf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95) |
| 101 |
> |
AC_PROG_CXX([$CXX $ac_cv_prog_acx_mpi_mpicxx icpc pathCC pgCC c++ xlc++ xlC g++ CC]) |
| 102 |
> |
AC_PROG_CC([$CC $ac_cv_prog_acx_mpi_mpicc icc pathcc pgcc cc xlc gcc]) |
| 103 |
> |
AC_PROG_FC([$FC $ac_cv_prog_acx_mpi_mpif90 ifort ifc pathf95 pgf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95) |
| 104 |
|
AC_PROG_CPP |
| 105 |
|
AC_PROG_EGREP |
| 106 |
|
AC_PROG_LN_S |
| 187 |
|
AC_CHECK_LIB(m, asin, , exit) |
| 188 |
|
ACX_CHECK_ZLIB |
| 189 |
|
ACX_CHECK_FFTW |
| 190 |
+ |
ACX_CHECK_QHULL |
| 191 |
+ |
ACX_CHECK_OPENBABEL |
| 192 |
|
|
| 149 |
– |
|
| 193 |
|
# Checks for header files. |
| 194 |
|
AC_HEADER_STDC |
| 195 |
< |
AC_CHECK_HEADERS([conio.h dlfcn.h fstream.h iostream.h libintl.h limits.h machine/hal_sysinfo.h math.h stddef.h stdio.h stdlib.h string.h strings.h strstream.h sys/param.h sys/pstat.h sys/sysmp.h sys/sysctl.h sys/sysinfo.h sys/systemcfg.h sys/table.h sys/time.h time.h unistd.h zlib.h]) |
| 195 |
> |
AC_CHECK_HEADERS([libintl.h limits.h machine/hal_sysinfo.h stdlib.h string.h strings.h sys/param.h sys/pstat.h sys/sysctl.h sys/sysinfo.h sys/sysmp.h sys/systemcfg.h sys/table.h sys/time.h unistd.h]) |
| 196 |
|
|
| 197 |
|
# Checks for typedefs, structures, and compiler characteristics. |
| 198 |
|
AC_HEADER_STDBOOL |
| 199 |
|
AC_C_CONST |
| 200 |
|
AC_C_INLINE |
| 158 |
– |
AC_C_RESTRICT |
| 201 |
|
AC_TYPE_SIZE_T |
| 202 |
|
AC_HEADER_TIME |
| 161 |
– |
AC_CHECK_TYPES(clock_t) |
| 162 |
– |
AC_C_CONST |
| 163 |
– |
AC_C_INLINE |
| 203 |
|
|
| 204 |
|
# Checks for library functions. |
| 205 |
|
AC_FUNC_MALLOC |
| 167 |
– |
AC_FUNC_MEMCMP |
| 206 |
|
AC_FUNC_REALLOC |
| 207 |
|
AC_FUNC_SELECT_ARGTYPES |
| 170 |
– |
AC_FUNC_STRFTIME |
| 208 |
|
AC_FUNC_STRTOD |
| 209 |
< |
AC_CHECK_FUNCS([floor getpagesize gettimeofday memchr memmove memset pow pstat_getdynamic pstat_getstatic rint select snprintf sranddev sqrt strcasecmp strchr strdup stricmp strncasecmp strnicmp strrchr strstr strtol sysmp getsysinfo sysctl table]) |
| 209 |
> |
AC_CHECK_FUNCS([floor getpagesize gettimeofday memset pow pstat_getdynamic pstat_getstatic select sqrt strcasecmp strchr strdup stricmp strncasecmp strnicmp strstr strtol sysmp getsysinfo sysctl table]) |
| 210 |
|
|
| 211 |
|
# special check for _system_configuration because AIX <4.3.2 do not |
| 212 |
|
# contain the `physmem' member. |
| 217 |
|
AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, |
| 218 |
|
[Define if you have the _system_configuration variable.])], |
| 219 |
|
[AC_MSG_RESULT([no])]) |
| 183 |
– |
|
| 184 |
– |
dnl check for system getopt |
| 185 |
– |
adl_FUNC_GETOPT_LONG |
| 186 |
– |
|
| 187 |
– |
AC_LANG_CPLUSPLUS |
| 188 |
– |
AC_CXX_NAMESPACES |
| 189 |
– |
AC_CXX_STD |
| 190 |
– |
AC_CHECK_HEADERS([ctype.h iostream fstream sstream strstream]) |
| 191 |
– |
# AC_CPP_FUNC |
| 192 |
– |
# ------------------ # |
| 193 |
– |
# Checks to see if ANSI C99 CPP variable __func__ works. |
| 194 |
– |
# If not, perhaps __FUNCTION__ works instead. |
| 195 |
– |
# If not, we'll just define __func__ to "". |
| 196 |
– |
AC_DEFUN([AC_CPP_FUNC], |
| 197 |
– |
[AC_REQUIRE([AC_PROG_CC_STDC])dnl |
| 198 |
– |
AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, |
| 199 |
– |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 200 |
– |
[[const char *foo = __func__;]])], |
| 201 |
– |
[ac_cv_cpp_func=yes], |
| 202 |
– |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 203 |
– |
[[const char *foo = __FUNCTION__;]])], |
| 204 |
– |
[ac_cv_cpp_func=__FUNCTION__], |
| 205 |
– |
[ac_cv_cpp_func=no])])]) |
| 206 |
– |
if test $ac_cv_cpp_func = __FUNCTION__; then |
| 207 |
– |
AC_DEFINE(__func__,__FUNCTION__, |
| 208 |
– |
[Define to __FUNCTION__ or "" if `__func__' does not conform to |
| 209 |
– |
ANSI C.]) |
| 210 |
– |
elif test $ac_cv_cpp_func = no; then |
| 211 |
– |
AC_DEFINE(__func__,"", |
| 212 |
– |
[Define to __FUNCTION__ or "" if `__func__' does not conform to |
| 213 |
– |
ANSI C.]) |
| 214 |
– |
fi |
| 215 |
– |
])# AC_CPP_FUNC |
| 220 |
|
|
| 217 |
– |
AC_CPP_FUNC |
| 218 |
– |
AC_SUBST(__func__) |
| 219 |
– |
|
| 220 |
– |
|
| 221 |
|
dnl check for strong optimization options |
| 222 |
|
|
| 223 |
|
case $debug in |
| 230 |
|
;; |
| 231 |
|
esac |
| 232 |
|
|
| 233 |
< |
dnl OpenBabel needs this: |
| 234 |
< |
AC_DEFINE([OBAPI], [], [Used to export symbols for DLL / shared library builds]) |
| 235 |
< |
|
| 236 |
< |
|
| 237 |
< |
AC_ARG_WITH(mpi, |
| 238 |
< |
[AC_HELP_STRING([--with-mpi=<prefix>], |
| 239 |
< |
[compile with MPI installed in <prefix> [default=no]])], |
| 240 |
< |
with_mpi=$withval, |
| 241 |
< |
with_mpi="no") |
| 242 |
< |
|
| 243 |
< |
case "x$with_mpi" in |
| 244 |
< |
xyes | "x") USE_MPI=yes;; |
| 245 |
< |
xno) USE_MPI=no ;; |
| 246 |
< |
*) MPI="$with_mpi"; USE_MPI=yes ;; |
| 247 |
< |
esac |
| 248 |
< |
if test "$USE_MPI" = "yes" -a -z "$with_mpi"; then |
| 249 |
< |
MPI="/usr/local" |
| 250 |
< |
fi |
| 251 |
< |
if test "$USE_MPI" = "yes"; then |
| 252 |
< |
ACX_MPI |
| 233 |
> |
dnl check for CGAL library |
| 234 |
> |
ACX_CGAL |
| 235 |
> |
USE_CGAL=no |
| 236 |
> |
if test "$acx_cgal_found" == yes; then |
| 237 |
> |
USE_CGAL=yes |
| 238 |
> |
AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.]) |
| 239 |
> |
AC_SUBST(CGAL_CXXFLAGS) |
| 240 |
> |
AC_SUBST(CGAL_LDFLAGS) |
| 241 |
> |
AC_SUBST(CGAL_CPPFLAGS) |
| 242 |
> |
AC_SUBST(CGAL_LIBS) |
| 243 |
|
fi |
| 244 |
< |
AC_SUBST(USE_MPI) |
| 244 |
> |
AC_SUBST(USE_CGAL) |
| 245 |
|
|
| 246 |
|
|
| 247 |
|
BB_ENABLE_DOXYGEN |
| 260 |
|
AC_SUBST(LDFLAGS) |
| 261 |
|
AC_SUBST(PREPDEFFLAG) |
| 262 |
|
AC_SUBST(F90_MODULE_NAMES) |
| 263 |
< |
AC_CONFIG_FILES([make/Makefile src/utils/Makefile scripts/filepp], [chmod 0755 scripts/*]) |
| 263 |
> |
AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/math/Makefile src/integrators/Makefile src/applications/atom2md/Makefile scripts/filepp], [chmod 0755 scripts/*]) |
| 264 |
|
|
| 265 |
|
AC_OUTPUT |