| 1 |
|
dnl **** Process this file with autoconf to produce a configure script. |
| 2 |
|
AC_PREREQ(2.59) |
| 3 |
< |
AC_INIT(OOPSE, 4.0, gezelter@nd.edu, oopse) |
| 3 |
> |
AC_INIT(OpenMD, 1.0, gezelter@nd.edu, openmd) |
| 4 |
|
AC_CONFIG_AUX_DIR(ac-tools) |
| 5 |
< |
AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp]) |
| 5 |
> |
AC_CONFIG_SRCDIR([src/applications/openmd/openmd.cpp]) |
| 6 |
|
AC_CONFIG_HEADER([src/config.h]) |
| 7 |
|
|
| 8 |
< |
builtin(include, ac-tools/OOPSE.m4) |
| 8 |
> |
builtin(include, ac-tools/OpenMD.m4) |
| 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) |
| 12 |
> |
builtin(include, ac-tools/ax_mpi.m4) |
| 13 |
|
|
| 14 |
|
# who am i |
| 15 |
|
AC_CANONICAL_HOST |
| 17 |
|
AC_PREFIX_DEFAULT("/usr/local") |
| 18 |
|
|
| 19 |
|
# set program name |
| 20 |
< |
PROGNAME="oopse" |
| 20 |
> |
PROGNAME="openmd" |
| 21 |
|
AC_SUBST(PROGNAME) |
| 22 |
|
|
| 23 |
|
AC_EXEEXT |
| 24 |
|
AC_OBJEXT |
| 25 |
|
OBJEXT=".$OBJEXT" |
| 26 |
|
|
| 27 |
< |
OOPSE=oopse |
| 27 |
> |
OPENMD=openmd |
| 28 |
|
|
| 29 |
< |
dnl **** define home dir of oopse |
| 29 |
> |
dnl **** define home dir of OpenMD |
| 30 |
|
if test "x${prefix}" = "xNONE" |
| 31 |
|
then |
| 32 |
< |
OOPSE_HOME=${ac_default_prefix}/oopse |
| 32 |
> |
OPENMD_HOME=${ac_default_prefix}/openmd |
| 33 |
|
else |
| 34 |
< |
OOPSE_HOME=${prefix}/oopse |
| 34 |
> |
OPENMD_HOME=${prefix}/openmd |
| 35 |
|
fi |
| 36 |
< |
AC_ARG_ENABLE(oopse-home, |
| 37 |
< |
[ --enable-oopse-home=DIR define oopse home dir [PREFIX/oopse]], |
| 38 |
< |
[OOPSE_HOME="${enableval}"]) |
| 36 |
> |
AC_ARG_ENABLE(openmd-home, |
| 37 |
> |
[ --enable-openmd-home=DIR define OpenMD home dir [PREFIX/openmd]], |
| 38 |
> |
[OPENMD_HOME="${enableval}"]) |
| 39 |
|
|
| 40 |
|
# there are two ways to do debugging. One with the --enable-debug flag |
| 41 |
|
# and one using the DEBUG environment variable |
| 42 |
|
|
| 43 |
|
debug=0 |
| 44 |
< |
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile OOPSE in debug mode]), [debug=1]) |
| 44 |
> |
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile OpenMD in debug mode]), [debug=1]) |
| 45 |
|
if test "${DEBUG}"; then |
| 46 |
|
AC_DEFINE(debug, 1, [Code compiled in debug mode]) |
| 47 |
|
msg="$msg, debug mode" |
| 48 |
|
fi |
| 49 |
|
AC_SUBST(debug) |
| 50 |
|
|
| 51 |
< |
AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile OOPSE in single precision])], ok=$enableval, ok=no) |
| 51 |
> |
AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile OpenMD in single precision])], ok=$enableval, ok=no) |
| 52 |
|
AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval) |
| 53 |
|
if test "$ok" = "yes"; then |
| 54 |
|
AC_DEFINE(SINGLE_PRECISION,1,[Define to compile in single precision.]) |
| 56 |
|
AC_SUBST(USE_SINGLE_PRECISION) |
| 57 |
|
fi |
| 58 |
|
|
| 59 |
< |
if test x"$CC" != x; then |
| 60 |
< |
AC_CHECK_PROGS(ac_cc_set,[$CC],[no]) |
| 61 |
< |
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!])]) |
| 59 |
> |
AC_PROG_CXX([$CXX icpc pathCC pgCC c++ xlc++ xlC g++ CC]) |
| 60 |
> |
AC_PROG_CC([$CC icc pathcc pgcc cc xlc gcc]) |
| 61 |
> |
AC_PROG_FC([$FC ifort ifc pathf95 pgf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95) |
| 62 |
|
|
| 63 |
< |
AS_IF([test AS_VAR_GET([ac_cc_path]) != no],[ |
| 64 |
< |
AC_MSG_NOTICE([Will attempt to use $CC as C compiler])],[ |
| 65 |
< |
AC_ERROR([Can't find path to user-specified C compiler $CC])]) |
| 66 |
< |
fi |
| 63 |
> |
save_CXX=$CXX |
| 64 |
> |
save_CC=$CC |
| 65 |
> |
save_FC=$FC |
| 66 |
> |
save_LIBS=$LIBS |
| 67 |
|
|
| 68 |
< |
if test x"$CXX" != x; then |
| 69 |
< |
AC_CHECK_PROGS(ac_cxx_set,[$CXX],[no]) |
| 70 |
< |
AS_IF([test AS_VAR_GET([ac_cxx_set]) != no],[ |
| 71 |
< |
AC_PATH_PROG(ac_cxx_path,[$ac_cxx_set],[no])],[ |
| 72 |
< |
AC_ERROR([Specified C++ compiler $CXX doesn't seem to exist!])]) |
| 73 |
< |
|
| 74 |
< |
AS_IF([test AS_VAR_GET([ac_cxx_path]) != no],[ |
| 75 |
< |
AC_MSG_NOTICE([Will attempt to use $CXX as C++ compiler])],[ |
| 76 |
< |
AC_ERROR([Can't find path to user-specified C++ compiler $CXX])]) |
| 77 |
< |
fi |
| 78 |
< |
|
| 79 |
< |
if test x"$FC" != x; then |
| 80 |
< |
AC_CHECK_PROGS(ac_fc_set,[$FC],[no]) |
| 81 |
< |
AS_IF([test AS_VAR_GET([ac_fc_set]) != no],[ |
| 82 |
< |
AC_PATH_PROG(ac_fc_path,[$ac_fc_set],[no])],[ |
| 83 |
< |
AC_ERROR([Specified Fortran compiler $FC doesn't seem to exist!])]) |
| 84 |
< |
|
| 85 |
< |
AS_IF([test AS_VAR_GET([ac_fc_path]) != no],[ |
| 86 |
< |
AC_MSG_NOTICE([Will attempt to use $FC as Fortran compiler])],[ |
| 87 |
< |
AC_ERROR([Can't find path to user-specified Fortran compiler $FC])]) |
| 88 |
< |
fi |
| 89 |
< |
|
| 90 |
< |
|
| 91 |
< |
dnl do MPI checks |
| 92 |
< |
ACX_MPI([USE_MPI="yes"], |
| 93 |
< |
[USE_MPI="no" |
| 94 |
< |
AC_MSG_WARN([No suitable MPI implementation found. oopse_MPI will not be build.])]) |
| 68 |
> |
AC_LANG([C++]) |
| 69 |
> |
AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")]) |
| 70 |
> |
AC_SUBST(LIBDL) |
| 71 |
> |
AX_MPI([USE_MPI="yes"], |
| 72 |
> |
[USE_MPI="no" |
| 73 |
> |
AC_MSG_WARN([No suitable C++ MPI implementation found. openmd_MPI will not be built.])]) |
| 74 |
> |
AS_IF([test AS_VAR_GET([USE_MPI]) != no],[ |
| 75 |
> |
AC_LANG([C]) |
| 76 |
> |
AX_MPI([USE_MPI="yes"], |
| 77 |
> |
[USE_MPI="no" |
| 78 |
> |
AC_MSG_WARN([No suitable C MPI implementation found. openmd_MPI will not be built.])]) |
| 79 |
> |
]) |
| 80 |
> |
AS_IF([test AS_VAR_GET([USE_MPI]) != no],[ |
| 81 |
> |
AC_LANG([Fortran]) |
| 82 |
> |
AX_MPI([USE_MPI="yes"], |
| 83 |
> |
[USE_MPI="no" |
| 84 |
> |
AC_MSG_WARN([No suitable Fortran MPI implementation found. openmd_MPI will not be built.])]) |
| 85 |
> |
]) |
| 86 |
> |
AS_IF([test AS_VAR_GET([USE_MPI]) != no],[ |
| 87 |
> |
CXX=$MPICXX |
| 88 |
> |
CC=$MPICC |
| 89 |
> |
FC=$MPIFC |
| 90 |
> |
LIBS="$MPILIBS $LIBS" |
| 91 |
> |
],[ |
| 92 |
> |
CXX=$save_CXX |
| 93 |
> |
CC=$save_CC |
| 94 |
> |
FC=$save_FC |
| 95 |
> |
LIBS=$save_LIBS |
| 96 |
> |
] |
| 97 |
> |
) |
| 98 |
|
AC_SUBST(USE_MPI) |
| 99 |
|
|
| 100 |
|
# Checks for programs. |
| 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) |
| 101 |
|
AC_PROG_CPP |
| 102 |
|
AC_PROG_EGREP |
| 103 |
|
AC_PROG_LN_S |
| 104 |
|
AC_PROG_MAKE_SET |
| 105 |
|
AC_PROG_RANLIB |
| 109 |
– |
AC_PROG_YACC |
| 110 |
– |
AC_PROG_LEX |
| 106 |
|
AX_SYS_PERLSHARPBANG |
| 107 |
|
AC_PROG_INSTALL |
| 108 |
|
case "x$INSTALL" in |
| 109 |
|
x/*) ;; |
| 110 |
|
*) INSTALL=`pwd`/ac-tools/"shtool install -c" ; |
| 111 |
|
esac |
| 112 |
< |
MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f" |
| 112 |
> |
MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f -m 755" |
| 113 |
|
AC_CHECK_PROG(AR, ar, ar, NONE) |
| 114 |
|
if test "$AR" = "NONE"; then |
| 115 |
|
AC_CACHE_SAVE |
| 189 |
|
|
| 190 |
|
# Checks for header files. |
| 191 |
|
AC_HEADER_STDC |
| 192 |
< |
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]) |
| 192 |
> |
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]) |
| 193 |
|
|
| 194 |
|
# Checks for typedefs, structures, and compiler characteristics. |
| 195 |
|
AC_HEADER_STDBOOL |
| 196 |
|
AC_C_CONST |
| 197 |
|
AC_C_INLINE |
| 203 |
– |
AC_C_RESTRICT |
| 198 |
|
AC_TYPE_SIZE_T |
| 199 |
|
AC_HEADER_TIME |
| 206 |
– |
AC_CHECK_TYPES(clock_t) |
| 207 |
– |
AC_C_CONST |
| 208 |
– |
AC_C_INLINE |
| 200 |
|
|
| 201 |
|
# Checks for library functions. |
| 202 |
|
AC_FUNC_MALLOC |
| 212 |
– |
AC_FUNC_MEMCMP |
| 203 |
|
AC_FUNC_REALLOC |
| 204 |
|
AC_FUNC_SELECT_ARGTYPES |
| 215 |
– |
AC_FUNC_STRFTIME |
| 205 |
|
AC_FUNC_STRTOD |
| 206 |
< |
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]) |
| 206 |
> |
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]) |
| 207 |
|
|
| 208 |
|
# special check for _system_configuration because AIX <4.3.2 do not |
| 209 |
|
# contain the `physmem' member. |
| 215 |
|
[Define if you have the _system_configuration variable.])], |
| 216 |
|
[AC_MSG_RESULT([no])]) |
| 217 |
|
|
| 229 |
– |
dnl check for system getopt |
| 230 |
– |
adl_FUNC_GETOPT_LONG |
| 231 |
– |
|
| 232 |
– |
AC_LANG_CPLUSPLUS |
| 233 |
– |
AC_CXX_NAMESPACES |
| 234 |
– |
AC_CXX_STD |
| 235 |
– |
AC_CHECK_HEADERS([ctype.h iostream fstream sstream strstream]) |
| 236 |
– |
# AC_CPP_FUNC |
| 237 |
– |
# ------------------ # |
| 238 |
– |
# Checks to see if ANSI C99 CPP variable __func__ works. |
| 239 |
– |
# If not, perhaps __FUNCTION__ works instead. |
| 240 |
– |
# If not, we'll just define __func__ to "". |
| 241 |
– |
AC_DEFUN([AC_CPP_FUNC], |
| 242 |
– |
[AC_REQUIRE([AC_PROG_CC_STDC])dnl |
| 243 |
– |
AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func, |
| 244 |
– |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 245 |
– |
[[const char *foo = __func__;]])], |
| 246 |
– |
[ac_cv_cpp_func=yes], |
| 247 |
– |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 248 |
– |
[[const char *foo = __FUNCTION__;]])], |
| 249 |
– |
[ac_cv_cpp_func=__FUNCTION__], |
| 250 |
– |
[ac_cv_cpp_func=no])])]) |
| 251 |
– |
if test $ac_cv_cpp_func = __FUNCTION__; then |
| 252 |
– |
AC_DEFINE(__func__,__FUNCTION__, |
| 253 |
– |
[Define to __FUNCTION__ or "" if `__func__' does not conform to |
| 254 |
– |
ANSI C.]) |
| 255 |
– |
elif test $ac_cv_cpp_func = no; then |
| 256 |
– |
AC_DEFINE(__func__,"", |
| 257 |
– |
[Define to __FUNCTION__ or "" if `__func__' does not conform to |
| 258 |
– |
ANSI C.]) |
| 259 |
– |
fi |
| 260 |
– |
])# AC_CPP_FUNC |
| 261 |
– |
|
| 262 |
– |
AC_CPP_FUNC |
| 263 |
– |
AC_SUBST(__func__) |
| 264 |
– |
|
| 265 |
– |
|
| 218 |
|
dnl check for strong optimization options |
| 219 |
|
|
| 220 |
|
case $debug in |
| 227 |
|
;; |
| 228 |
|
esac |
| 229 |
|
|
| 278 |
– |
dnl OpenBabel needs this: |
| 279 |
– |
AC_DEFINE([OBAPI], [], [Used to export symbols for DLL / shared library builds]) |
| 280 |
– |
|
| 281 |
– |
dnl check for CGAL library |
| 282 |
– |
ACX_CGAL |
| 283 |
– |
USE_CGAL=no |
| 284 |
– |
if test "$acx_cgal_found" == yes; then |
| 285 |
– |
USE_CGAL=yes |
| 286 |
– |
AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.]) |
| 287 |
– |
AC_SUBST(CGAL_CXXFLAGS) |
| 288 |
– |
AC_SUBST(CGAL_LDFLAGS) |
| 289 |
– |
AC_SUBST(CGAL_CPPFLAGS) |
| 290 |
– |
AC_SUBST(CGAL_LIBS) |
| 291 |
– |
fi |
| 292 |
– |
AC_SUBST(USE_CGAL) |
| 293 |
– |
|
| 294 |
– |
|
| 230 |
|
BB_ENABLE_DOXYGEN |
| 231 |
|
|
| 232 |
|
AC_SUBST(EXEEXT) |
| 233 |
|
AC_SUBST(OBJEXT) |
| 234 |
|
AC_SUBST(BATEXT) |
| 235 |
|
AC_SUBST(MKINSTALLDIRS) |
| 236 |
< |
AC_SUBST(OOPSE) |
| 237 |
< |
AC_SUBST(OOPSE_HOME) |
| 236 |
> |
AC_SUBST(OPENMD) |
| 237 |
> |
AC_SUBST(OPENMD_HOME) |
| 238 |
|
AC_SUBST(SUBDIRS) |
| 239 |
|
AC_SUBST(CFLAGS) |
| 240 |
|
AC_SUBST(CXXFLAGS) |
| 243 |
|
AC_SUBST(LDFLAGS) |
| 244 |
|
AC_SUBST(PREPDEFFLAG) |
| 245 |
|
AC_SUBST(F90_MODULE_NAMES) |
| 246 |
< |
AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/math/Makefile src/applications/atom2md/Makefile scripts/filepp], [chmod 0755 scripts/*]) |
| 246 |
> |
AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/math/Makefile src/integrators/Makefile src/applications/atom2md/Makefile scripts/filepp], [chmod 0755 scripts/*]) |
| 247 |
|
|
| 248 |
|
AC_OUTPUT |