--- trunk/OOPSE-3.0/ac-tools/configure.in 2005/12/16 21:52:50 2518 +++ trunk/OOPSE-3.0/ac-tools/configure.in 2006/05/16 20:38:23 2753 @@ -1,15 +1,17 @@ dnl **** Process this file with autoconf to produce a configure script. - -AC_INIT(OOPSE, 2.0, gezelter@nd.edu, oopse) +AC_PREREQ(2.59) +AC_INIT(OOPSE, 3.0, gezelter@nd.edu, oopse) AC_CONFIG_AUX_DIR(ac-tools) +AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp]) +AC_CONFIG_HEADER([src/config.h]) -builtin(include, ac-tools/fortran90.m4) -builtin(include, ac-tools/aclocal.m4) +builtin(include, ac-tools/OOPSE.m4) builtin(include, ac-tools/AC_CXX_HAVE_STL.m4) builtin(include, ac-tools/AC_CXX_NAMESPACES.m4) builtin(include, ac-tools/AC_CXX_STD.m4) -AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp]) +# who am i +AC_CANONICAL_HOST AC_PREFIX_DEFAULT("/usr/local") @@ -17,6 +19,23 @@ AC_SUBST(PROGNAME) PROGNAME="oopse" AC_SUBST(PROGNAME) +AC_EXEEXT +AC_OBJEXT +OBJEXT=".$OBJEXT" + +OOPSE=oopse + +dnl **** define home dir of oopse +if test "x${prefix}" = "xNONE" +then + OOPSE_HOME=${ac_default_prefix}/oopse +else + OOPSE_HOME=${prefix}/oopse +fi +AC_ARG_ENABLE(oopse-home, +[ --enable-oopse-home=DIR define oopse home dir [PREFIX/oopse]], +[OOPSE_HOME="${enableval}"]) + # there are two ways to do debugging. One with the --enable-debug flag # and one using the DEBUG environment variable @@ -28,82 +47,70 @@ AC_SUBST(debug) fi AC_SUBST(debug) -# who am i -AC_CANONICAL_HOST - - - -dnl Checks for C compiler -AC_PROG_CC([pathcc icc xlc gcc cc]) - -dnl Checks for C++ compiler -AC_PROG_CXX([pathCC icpc icc xlc++ xlC CC g++ c++]) - -dnl Checks for C preprocessor +# Checks for programs. +AC_PROG_CXX([icpc icc pgCC pathCC c++ xlc++ xlC g++ CC]) +AC_PROG_CC([icc pgcc pathcc cc xlc gcc]) +AC_PROG_FC([ifort ifc pgf95 pathf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95) AC_PROG_CPP - -dnl Checks for grep and egrep AC_PROG_EGREP - -dnl If we are not running g++ then we might need some other flags -dnl to get the templates compiled correctly -OOPSE_TEMPLATE_FLAGS="" -if test $ac_cv_prog_gxx = no; then - AC_MSG_CHECKING([checking whether ${CXX} accepts -ptused -no_prelink]) - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then - AC_MSG_RESULT(yes) - OOPSE_TEMPLATE_FLAGS="-ptused -no_prelink" - else - AC_MSG_RESULT(no) - fi - rm -f conftest* - AC_MSG_CHECKING([checking whether ${CXX} accepts -instances=static]) - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then - AC_MSG_RESULT(yes) - OOPSE_TEMPLATE_FLAGS="-instances=static" - else - AC_MSG_RESULT(no) - fi - rm -f conftest* - AC_MSG_CHECKING([checking whether ${CXX} accepts -pto]) - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -pto -c conftest.cc 2>&1`"; then - AC_MSG_RESULT(yes) - OOPSE_TEMPLATE_FLAGS="-pto" - else - AC_MSG_RESULT(no) - fi - rm -f conftest* - AC_MSG_CHECKING([checking whether ${CXX} accepts -LANG:std]) - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -LANG:std -c conftest.cc 2>&1`"; then - AC_MSG_RESULT(yes) - - - EXTRA_CC_FLAG=${EXTRA_CC_FLAG}" -LANG:std" - else - AC_MSG_RESULT(no) - fi +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB +AX_SYS_PERLSHARPBANG +AC_PROG_INSTALL +case "x$INSTALL" in + x/*) ;; + *) INSTALL=`pwd`/ac-tools/"shtool install -c" ; +esac +MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f" +AC_CHECK_PROG(AR, ar, ar, NONE) +if test "$AR" = "NONE"; then + AC_CACHE_SAVE + exit 1 fi -AC_SUBST(OOPSE_TEMPLATE_FLAGS) -AC_SUBST(EXTRA_CC_FLAG) +AC_PATH_PROG(PS, ps) +AC_CACHE_CHECK([for POSIX or BSD ps syntax], ac_cv_prog_ps_syntax, [ + if $PS ax -o rss > /dev/null 2>&1; then + ac_cv_prog_ps_ax=yes + else + ac_cv_prog_ps_ax=no + fi + if $PS -ef -o rss > /dev/null 2>&1; then + ac_cv_prog_ps_ef=yes + else + ac_cv_prog_ps_ef=no + fi + if test "$ac_cv_prog_ps_ax" = yes; then + ac_cv_prog_ps_syntax=BSD + else + if test "$ac_cv_prog_ps_ef" = yes; then + ac_cv_prog_ps_syntax=POSIX + else + AC_MSG_ERROR(Could not determine ps syntax) + fi + fi +]) +AC_DEFINE_UNQUOTED(PSCOMMAND, $PS, [Path to ps program]) +if test "$ac_cv_prog_ps_syntax" = BSD; then + AC_DEFINE(PSTYPE_IS_BSD, 1, [ps uses BSD-style arguments]) +else + if test "$ac_cv_prog_ps_syntax" = POSIX; then + AC_DEFINE(PSTYPE_IS_POSIX, 1, [ps uses POSIX-style arguments]) + else + AC_MSG_ERROR(Unknown ps syntax type!) + fi +fi -dnl Fortran 90 compilation checks are next - -AC_PROG_F90([pathf95 ifort ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95]) +AC_LANG_PUSH(Fortran) +AC_FC_SRCEXT(F90) dnl Check the flag for Fortran90 preprocessing ACX_PROG_F90_PREPFLAG dnl Check to see if a flag is required for preprocessing defines ACX_PROG_F90_PREPDEFFLAG -AC_LANG_PUSH(Fortran 90) -AC_LANG_PREPROC(Fortran 90) -AC_F90_LIBRARY_LDFLAGS -dnl How does Fortran mangle function names -AC_F90_WRAPPERS -AC_SUBST(F90_FUNC) -AC_SUBST(F90_FUNC_) +AC_FC_WRAPPERS +AC_SUBST(FC_FUNC) +AC_SUBST(FC_FUNC_) +AC_FC_LIBRARY_LDFLAGS dnl Fortran 90 module suffix AC_CHECK_MODSUFFIX dnl Fortran 90 module path specifier @@ -124,21 +131,38 @@ AC_LANG_CPLUSPLUS AC_SUBST(F90_MODULE_NAMES) AC_LANG_POP -AC_LANG_CPLUSPLUS -AC_HEADER_STDC -AC_CXX_NAMESPACES -AC_CXX_STD +AC_LANG_C dnl Checks for libraries. AC_CHECK_LIB(m, asin, , exit) - ACX_CHECK_ZLIB -dnl Checks for header files. -AC_CHECK_HEADERS([stdlib.h string.h sys/param.h unistd.h sys/time.h stdio.h conio.h strstream.h iostream.h fstream.h math.h time.h sys/pstat.h sys/sysmp.h sys/sysinfo.h sys/table.h sys/sysctl.h sys/sytemcfg.h machine/hal_sysinfo.h]) -AC_LANG_CPLUSPLUS -AC_CHECK_HEADERS([ctype.h iostream fstream sstream strstream]) -AC_LANG_C -AC_CHECK_FUNCS([rint snprintf sranddev strcasecmp strncasecmp stricmp strnicmp pstat_getstatic sysmp getsysinfo sysctl table]) +ACX_CHECK_FFTW + + +# Checks for header files. +AC_HEADER_STDC +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]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE +AC_C_RESTRICT +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_CHECK_TYPES(clock_t) +AC_C_CONST +AC_C_INLINE + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STRFTIME +AC_FUNC_STRTOD +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]) + # special check for _system_configuration because AIX <4.3.2 do not # contain the `physmem' member. AC_MSG_CHECKING([for external symbol _system_configuration]) @@ -148,30 +172,14 @@ AC_HEADER_TIME AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])], [AC_MSG_RESULT([no])]) -AC_HEADER_TIME -dnl Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_TYPES(clock_t) -AC_C_CONST -AC_C_INLINE - - dnl check for system getopt adl_FUNC_GETOPT_LONG -dnl check for strong optimization options - -case $debug in - 1) - ;; - *) - ACX_PROG_CC_MAXOPT - ACX_PROG_CXX_MAXOPT - ACX_PROG_F90_MAXOPT - ;; -esac - AC_LANG_CPLUSPLUS +AC_CXX_NAMESPACES +AC_CXX_STD +AC_CHECK_HEADERS([ctype.h iostream fstream sstream strstream]) # AC_CPP_FUNC # ------------------ # # Checks to see if ANSI C99 CPP variable __func__ works. @@ -200,58 +208,23 @@ AC_LANG_C AC_CPP_FUNC AC_SUBST(__func__) -AC_LANG_C -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_RANLIB -AC_PROG_YACC -AC_PROG_LEX -AX_SYS_PERLSHARPBANG -AC_CHECK_PROG(AR, ar, ar, NONE) -if test "$AR" = "NONE"; then - AC_MSG_ERROR(--> Can't find \`ar'!) - AC_CACHE_SAVE - exit 1 -fi -AC_PATH_PROG(PS, ps) -AC_CACHE_CHECK([for POSIX or BSD ps syntax], ac_cv_prog_ps_syntax, [ - if $PS ax -o rss > /dev/null 2>&1; then - ac_cv_prog_ps_ax=yes - else - ac_cv_prog_ps_ax=no - fi - if $PS -ef -o rss > /dev/null 2>&1; then - ac_cv_prog_ps_ef=yes - else - ac_cv_prog_ps_ef=no - fi - if test "$ac_cv_prog_ps_ax" = yes; then - ac_cv_prog_ps_syntax=BSD - else - if test "$ac_cv_prog_ps_ef" = yes; then - ac_cv_prog_ps_syntax=POSIX - else - AC_MSG_ERROR(Could not determine ps syntax) - fi - fi -]) +dnl check for strong optimization options -AC_DEFINE_UNQUOTED(PSCOMMAND, $PS, [Path to ps program]) -AC_DEFINE([OBAPI], [], [Used to export symbols for DLL / shared library builds]) +case $debug in + 1) + ;; + *) + ACX_PROG_FC_MAXOPT + ACX_PROG_CC_MAXOPT + ACX_PROG_CXX_MAXOPT + ;; +esac +dnl OpenBabel needs this: +AC_DEFINE([OBAPI], [], [Used to export symbols for DLL / shared library builds]) -if test "$ac_cv_prog_ps_syntax" = BSD; then - AC_DEFINE(PSTYPE_IS_BSD, 1, [ps uses BSD-style arguments]) -else - if test "$ac_cv_prog_ps_syntax" = POSIX; then - AC_DEFINE(PSTYPE_IS_POSIX, 1, [ps uses POSIX-style arguments]) - else - AC_MSG_ERROR(Unknown ps syntax type!) - fi -fi AC_ARG_WITH(mpi, [AC_HELP_STRING([--with-mpi=], @@ -272,25 +245,6 @@ dnl AC_ARG_WITH(sprng, fi AC_SUBST(USE_MPI) -dnl AC_ARG_WITH(sprng, -dnl [AC_HELP_STRING([--with-sprng=], -dnl [compile with SPRNG installed in [default=/usr/local]])], -dnl with_sprng=$withval, -dnl with_sprng="/usr/local") -dnl -dnl case "x$with_sprng" in -dnl xyes | "x") USE_SPRNG=yes;; -dnl xno) USE_SPRNG=no ;; -dnl *) SPRNG="$with_sprng"; USE_SPRNG=yes ;; -dnl esac -dnl if test "$USE_SPRNG" = "yes" -a -z "$with_sprng"; then -dnl SPRNG="/usr/local" -dnl fi -dnl if test "$USE_SPRNG" = "yes"; then -dnl ACX_SPRNG -dnl fi -dnl AC_SUBST(USE_SPRNG) - dnl ######################################## dnl # Check for CGAL headers and libraries # dnl ######################################## @@ -490,53 +444,8 @@ dnl CHECK_MKL AC_SUBST(CGAL_CXXFLAGS) AC_SUBST(CGAL_LIBS) -dnl CHECK_MKL - BB_ENABLE_DOXYGEN -AC_EXEEXT -AC_OBJEXT -OBJEXT=".$OBJEXT" - -OOPSE=oopse - -dnl **** define home dir of oopse -if test "x${prefix}" = "xNONE" -then - OOPSE_HOME=${ac_default_prefix}/oopse -else - OOPSE_HOME=${prefix}/oopse -fi -AC_ARG_ENABLE(oopse-home, -[ --enable-oopse-home=DIR define oopse home dir [PREFIX/oopse]], -[OOPSE_HOME="${enableval}"]) - -case "x$INSTALL" in - x/*) ;; - *) INSTALL=`pwd`/ac-tools/"shtool install -c" ; -esac - -MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f" - -dnl **** Define CFLAGS etc empty to prevent configure from setting them -CFLAGS=${CFLAGS-""} -CXXFLAGS=${CXXFLAGS-""} -CPPFLAGS=${CPPFLAGS-""} -FFLAGS=${FFLAGS-""} -F90FLAGS=${F90FLAGS-""} -LDFLAGS=${LDFLAGS-""} -DEBUG=${DEBUG-"-g"} - -case $debug in - 1) - FFLAGS="$DEBUG $FFLAGS" - F90FLAGS="$DEBUG $F90FLAGS" - ;; - *) - ;; -esac - - AC_SUBST(EXEEXT) AC_SUBST(OBJEXT) AC_SUBST(BATEXT) @@ -547,13 +456,10 @@ AC_SUBST(FFLAGS) AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(CPPFLAGS) -AC_SUBST(FFLAGS) -AC_SUBST(F90FLAGS) +AC_SUBST(FCFLAGS) AC_SUBST(LDFLAGS) -AC_SUBST(PREPFLAG) AC_SUBST(PREPDEFFLAG) AC_SUBST(F90_MODULE_NAMES) -AC_CONFIG_HEADER([src/config.h]) AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/applications/nanoRodBuilder/Makefile scripts/filepp], [chmod 0755 scripts/*]) AC_OUTPUT