# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(MPQC, 2.3.1, [foo@molecuilder.de], [molecuilder], [http://www.molecuilder.de/]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/bin/mpqc/mpqc.cc]) AC_CONFIG_HEADERS([src/lib/scconfig.h]) AC_CONFIG_MACRO_DIR([m4]) # Define these substitions here to keep all version information in one place. # For information on how to properly maintain the library version information, # refer to the libtool manual, section "Updating library version information": # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST([MPQC_SO_VERSION], [8:0:1]) AC_SUBST([MPQC_API_VERSION], [2.3.1]) define([sc_mmm_version],[2.3.1]) define([sc_buildid],[]) define([sc_so_version],[8:0:1]) dnl Process this file with autoconf to produce a configure script. define([AC_CACHE_LOAD], )dnl for debugging configure.in define([AC_CACHE_SAVE], )dnl for debugging configure.in AC_CANONICAL_SYSTEM AC_DEFINE_UNQUOTED(HOST_ARCH, "$host", ["host"]) AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target", ["target"]) dnl define([default_prefix_dash],ifelse(sc_buildid, ,[],[-])) dnl define([default_prefix],builtin(format,"/usr/local/mpqc/%s%s%s", dnl sc_mmm_version,default_prefix_dash,sc_buildid)) SC_MMM_VERSION=sc_mmm_version SC_SO_VERSION=sc_so_version AC_SUBST(SC_SO_VERSION) changequote(<<, >>)dnl SC_MAJOR_VERSION=`echo $SC_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'` SC_MINOR_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'` SC_MICRO_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'` changequote([, ])dnl AC_DEFINE_UNQUOTED(SC_MAJOR_VERSION,$SC_MAJOR_VERSION, ["major version number"]) AC_DEFINE_UNQUOTED(SC_MINOR_VERSION,$SC_MINOR_VERSION, ["minor version number"]) AC_DEFINE_UNQUOTED(SC_MICRO_VERSION,$SC_MICRO_VERSION, ["micro version number"]) EXCLUDED_DIRS= # Checks for programs. AC_PROG_CXX AC_PROG_INSTALL # use doxygen DX_HTML_FEATURE(ON) DX_PS_FEATURE(OFF) DX_PDF_FEATURE(OFF) DX_INIT_DOXYGEN(MPQC, doxygen.cfg, ${docdir}) # parallel-tests: use parallel test druver # color-tests: us coloring to indicate success/failure when available # tar-pax: use newer tar implementation with longer filename (>99 chars) AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects]) dnl --------- Features --------- AC_ARG_ENABLE(debug, [ --enable-debug Compile with debugging options], [ case $enableval in yes) DEBUG=yes ;; no) DEBUG=no ;; opt) DEBUG=opt ;; *) AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)]) ;; esac ],[ DEBUG=no ] ) AC_ARG_ENABLE(strict-arch, [ --enable-strict-arch Code might only work on target cpu type], [ case $enableval in yes) STRICT_ARCH=yes ;; no) STRICT_ARCH=no ;; *) AC_MSG_ERROR([Invalid value for --enable-strict-arch ($enableval)]) ;; esac ],[ STRICT_ARCH=no ] ) enableproduction=no AC_ARG_ENABLE(production, [ --enable-production Prepare for a production install.], [ case $enableval in yes) enableproduction=yes ;; no) ;; *) AC_MSG_ERROR([Invalid value for --enable-production ($enableval)]) ;; esac ]) AC_ARG_ENABLE(sysv-ipc, [ --disable-sysv-ipc Disable use of SysV IPC.], [ case $enableval in yes) SYSVIPC=yes ;; no) SYSVIPC=no ;; *) AC_MSG_ERROR([Invalid value for --enable-sysv-ipc ($enableval)]) ;; esac ],[ SYSVIPC=yes ] ) AC_ARG_ENABLE(parallel, [ --disable-parallel Compile for serial execution.], [ case $enableval in yes) PARALLEL=yes ;; no) PARALLEL=no ;; *) AC_MSG_ERROR([Invalid value for --enable-parallel ($enableval)]) ;; esac ],[ PARALLEL=yes ] ) AC_ARG_ENABLE(always-use-mpi, [ --enable-always-use-mpi Causes MPI_Init to always be called from main], [ case $enableval in yes) ALWAYS_USE_MPI=yes ;; no) ALWAYS_USE_MPI=no ;; *) AC_MSG_ERROR([Invalid value for --enable-always-use-mpi ($enableval)]) ;; esac ],[ ALWAYS_USE_MPI=no ] ) DEFAULT_PARALLEL=none AC_ARG_WITH(default-parallel, [ --with-default-parallel Default parallism model: none, mpi, armcimpi or mtmpi], DEFAULT_PARALLEL=$withval ) if test $DEFAULT_PARALLEL = mpi; then AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"]) elif test $DEFAULT_PARALLEL = mtmpi; then AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"]) AC_DEFINE(DEFAULT_MTMPI, 1, ["use multi-threaded MPI as default"]) elif test $DEFAULT_PARALLEL = armcimpi; then AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"]) AC_DEFINE(DEFAULT_ARMCI, 1, ["use ARMCI as default"]) fi SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE AC_ARG_WITH(mpi-thread, [ --with-mpi-thread Thread level for MPI (multiple,serialized,funneled,single)], [ case $withval in multiple) SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE ;; serialized) SC_MPI_THREAD_LEVEL=MPI_THREAD_SERIALIZED ;; funneled) SC_MPI_THREAD_LEVEL=MPI_THREAD_FUNNELED ;; single) SC_MPI_THREAD_LEVEL=MPI_THREAD_SINGLE ;; *) AC_MSG_ERROR([Invalid value for --with-mpi-thread ($withval)]) ;; esac ] ) AC_DEFINE_UNQUOTED(SC_MPI_THREAD_LEVEL,$SC_MPI_THREAD_LEVEL, ["thread level for MPI"]) AC_ARG_ENABLE(long-long, [ --disable-long-long Disable use of long long.], [ case $enableval in yes) LONGLONG=yes ;; no) LONGLONG=no ;; *) AC_MSG_ERROR([Invalid value for --enable-long-long ($enableval)]) ;; esac ],[ LONGLONG=yes ] ) AC_ARG_ENABLE(threads, [ --enable-threads Compile allowing use of threads, if possible.], [ case $enableval in yes) THREADS=yes ;; no) THREADS=no ;; *) AC_MSG_ERROR([Invalid value for --enable-threads ($enableval)]) ;; esac ],[ THREADS=yes ] ) AC_ARG_ENABLE(ref-debug, [ --enable-ref-debug Check for reference count overwrites/overflows/etc], [ case $enableval in yes) ;; no) AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"]) ;; *) AC_MSG_ERROR([Invalid value for --enable-ref-debug ($enableval)]) ;; esac ],[ if test $DEBUG = no -o $DEBUG = opt; then AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"]) fi ] ) AC_ARG_ENABLE(cross-compile, [ --enable-cross-compile Rather than checking, assume cross compilation.], [ case $enableval in yes) cross_compiling=yes ;; no) ;; *) AC_MSG_ERROR([Invalid value for --enable-cross-compile ($enableval)]) ;; esac ]) DOXYGEN_MAN=YES AC_ARG_ENABLE(doxygen-man, [ --disable-doxygen-man Disable doxygen man pages.], [ case $enableval in yes) ;; no) DOXYGEN_MAN=NO ;; *) AC_MSG_ERROR([Invalid value for --(dis|en)able-doxygen-man ($enableval)]) ;; esac ] ) AC_SUBST(DOXYGEN_MAN) AC_ARG_ENABLE(sourceforge, [ --enable-sourceforge Enable SourceForge web page generation], [ case $enableval in yes) FOOTER_HTML=sf_footer.html ;; no) FOOTER_HTML=footer.html ;; *) AC_MSG_ERROR([Invalid value for --enable-sourceforge ($enableval)]) ;; esac ],[ FOOTER_HTML=footer.html ] ) AC_SUBST(FOOTER_HTML) AC_ARG_ENABLE(components, [ --enable-components Enable CCA components], [ case $enableval in yes) components=yes ;; no) components=no ;; *) AC_MSG_ERROR([Invalid value for --enable-components ($enableval)]) ;; esac ],[ components=no ] ) ENABLECCA=$components AC_SUBST(ENABLECCA) BUILDID="sc_buildid" AC_ARG_WITH(build-id, [ --with-build-id Gives an identifier for the build.], BUILDID=$withval ) AC_SUBST(BUILDID) AC_DEFINE_UNQUOTED(SC_BUILDID,"$BUILDID", ["build identifier"]) DEFAULT_SC_MEMORY=32000000 AC_ARG_WITH(default-memory, [ --with-default-memory Gives the default memory allocation.], DEFAULT_SC_MEMORY=$withval ) AC_DEFINE_UNQUOTED(DEFAULT_SC_MEMORY,$DEFAULT_SC_MEMORY, ["default memory allocation"]) if test "$BUILDID"; then SC_VERSION="$SC_MMM_VERSION-$BUILDID" else SC_VERSION="$SC_MMM_VERSION" fi AC_DEFINE_UNQUOTED(SC_VERSION, "$SC_VERSION", ["SC version"]) AC_SUBST(SC_VERSION) ac_default_prefix="/usr/local/mpqc/$SC_VERSION" AC_ARG_WITH(cc, [ --with-cc Gives the name of the C compiler to use.], CC=$withval ) AC_ARG_WITH(cxx, [ --with-cxx Gives the name of the C++ compiler to use.], CXX=$withval ) AC_ARG_WITH(f77, [ --with-f77 Gives the name of the FORTRAN 77 compiler to use.], F77=$withval ) AC_ARG_WITH(cxx-optflags, [ --with-cxx-optflags Optimization flags to use with the C++ compiler.], GIVEN_CXXOPTIONS_OPT=$withval ) AC_ARG_WITH(cc-optflags, [ --with-cc-optflags Optimization flags to use with the C compiler.], GIVEN_COPTIONS_OPT=$withval ) DOT=yes AC_ARG_WITH(dot, [ --with-dot Gives the path to the dot graph generator.], DOT=$withval ) AC_ARG_WITH(ranlib, [ --with-ranlib Gives the name of the ranlib program.], RANLIB=$withval ) AC_ARG_WITH(ar, [ --with-ar Names the archive creator.], AR=$withval ) ARFLAGS=r AC_ARG_WITH(ar-flags, [ --with-ar-flags Flags for the the archive creator.], ARFLAGS=$withval ) AC_SUBST(ARFLAGS) AC_ARG_WITH(ld, [ --with-ld Names the object linker.], LD=$withval ) changequote(<<, >>)dnl LAUNCH="%MPQC% [-o %OUTPUT%] %INPUT%" changequote([, ])dnl AC_ARG_WITH(launch, [ --with-launch The mpqcrun script launch string.], LAUNCH=$withval ) AC_SUBST(LAUNCH) changequote(<<, >>)dnl CCALAUNCH="%CCAFE% --ccafe-rc %INPUT% --ccafe-remap-stdio --ccafe-outputdir %OUTPUT%"; changequote([, ])dnl AC_ARG_WITH(cca-launch, [ --with-cca-launch The ccarun script launch string.], CCALAUNCH=$withval ) AC_SUBST(CCALAUNCH) if test $prefix = $ac_default_prefix -o $prefix = NONE; then scdatadir=$datadir else #scdatadir=$datadir/mpqc/$SC_VERSION scdatadir=$datadir/molecuilder fi AC_ARG_WITH(sc-datadir, [ --with-sc-datadir Specifies arch-independent install subdir.], scdatadir=$withval ) AC_SUBST(scdatadir) AC_ARG_WITH(include, [ --with-include Specifies include directories (-Idir1 -Idir2).], EXTRAINCLUDE=$withval CPPFLAGS=$withval echo Using extra include directories: $withval ) template_instantiation=none AC_ARG_WITH(template, [ --with-template Specifies template instantation model.], template_instantiation=$withval echo Using extra include directories: $withval ) scincludedir=$includedir AC_ARG_WITH(sc-includedir, [ --with-sc-includedir Specifies include file install subdir.], scincludedir=$withval ) AC_SUBST(scincludedir) AC_ARG_WITH(libs, [ --with-libs Specifies libraries (-llib1 -llib2).], LIBS=$withval echo Using extra libraries: $withval ) XTRA_FLIBS= AC_ARG_WITH(extra-flibs, [ --with-extra-flibs Specifies libs needing a F77 runtime (-llib1 -llib2).], XTRA_FLIBS=$withval echo Using extra FORTRAN libraries: $withval ) have_flibs=no AC_ARG_WITH(flibs, [ --with-flibs Specifies the F77 runtime (by default, will guess).], FLIBS=$withval have_flibs=yes echo Using FORTRAN runtime libraries: $withval ) LDFLAGS= LIBDIRS= AC_ARG_WITH(libdirs, [ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).], LIBDIRS=$withval LDFLAGS=$withval echo Using extra library directories: $withval ) AC_ARG_WITH(cca-chem-config, [ --with-cca-chem-config Specifies full pathname of cca-chem-config script.], [ CCA_CHEM_CONFIG=$withval echo Using cca-chem-config: $withval ],[ if test "$components" == "yes"; then AC_PATH_PROG(CCA_CHEM_CONFIG,cca-chem-config,"not-found") fi ] ) dnl --------- Want absolute path for srcdir, not relative. --------- if test X$ac_srcdir_defaulted = Xyes; then case $srcdir in .|..|./*|../*) srcdir=`(cd $srcdir; pwd)` #srcdir=`(cd $srcdir; echo $PWD)` ;; esac fi dnl --------- Get the path to the compile dir. --------- compiledir=`pwd` AC_SUBST(compiledir) dnl --------- Need actual paths for substitution outside of a makefile. --------- if test $exec_prefix = "NONE"; then if test $prefix = "NONE"; then scbindir=$ac_default_prefix/bin; sclibdir=$ac_default_prefix/lib; else scbindir=$prefix/bin; sclibdir=$prefix/lib; fi else scbindir=$exec_prefix/bin sclibdir=$exec_prefix/lib fi AC_SUBST(scbindir) AC_SUBST(sclibdir) dnl --------- Checks for programs. --------- AC_PROG_LN_S AC_PROG_INSTALL dnl obsolete because of LT_INIT dnl AC_PROG_RANLIB AC_PROG_CC dnl ac_prog_cxx's order isn't what i need AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc) dnl sees if CXX is a GNU compiler AC_PROG_CXX if test ! "$F77" = no ; then AC_PROG_F77 if test "X$have_flibs" = Xno; then AC_F77_LIBRARY_LDFLAGS fi fi FLIBS="$XTRA_FLIBS $FLIBS" AC_PROG_CPP AC_PROG_CXXCPP AC_CHECK_PROG(AR,ar,ar) AC_CHECK_PROG(PERL,perl,perl) AC_CHECK_PROG(WISH,wish,/usr/bin/wish) dnl --------- use libtool --------------------- LT_INIT([static]) AC_SUBST([LIBTOOL_DEPS]) dnl The lack of certain tools is a show stopper changequote(<<, >>)dnl if [ X$PERL = X ]; then echo "Could not find the program perl. It can be obtained at" echo "ftp://prep.ai.mit.edu/pub/gnu" exit 1 fi changequote([, ])dnl dnl --------- Check for the graph generator used by doxygen DOT_PATH="" if test X$DOT = Xno; then HAVE_DOT=NO elif test X$DOT = Xyes; then AC_CHECK_PROG(HAVE_DOT,dot,YES,NO) else HAVE_DOT=YES DOT_PATH=$DOT fi AC_SUBST(DOT_PATH) AC_SUBST(HAVE_DOT) dnl -------- Checks for cross compiling. ---------- # obsolete starting at autoconf 2.12 #if test X$cross_compiling != Xyes; then #AC_C_CROSS #fi #if test X$cross_compiling = Xyes -a X$target = X$host; then # AC_MSG_ERROR([Cross compiling, but target is host (use --host).]) #fi dnl -------- Checks for compiler/linker options. ---------- # options needed only for optimization COPTIONS_OPT=-O # options needed only for debugging COPTIONS_DBG=-g # options that are always needed COPTIONS_MISC= # options needed only for optimization CXXOPTIONS_OPT=-O # options needed only for debugging CXXOPTIONS_DBG=-g # options that are always needed CXXOPTIONS_MISC= OBJSUF=o LIBSUF=a dnl -- check how dependency information is built -- # The GNU compilers work with: CCDEPENDSUF=none CXXDEPENDSUF=none CCDEPENDFLAGS=-M CXXDEPENDFLAGS=-M /bin/rm -f depcheck.u depcheck.c depcheck.o # Check for an IBM visual age C compiler echo "#include " > depcheck.c $CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1 if test -f depcheck.u; then CCDEPENDSUF=u fi /bin/rm -f depcheck.u depcheck.c depcheck.o # Check for an IBM visual age C++ compiler echo "#include " > depcheck.cc $CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1 if test -f depcheck.u; then CXXDEPENDSUF=u CXXDEPENDFLAGS="-M -E" fi /bin/rm -f depcheck.u depcheck.cc depcheck.o dnl -- special misc options -- AC_MSG_CHECKING([for miscellaneous flags]) case $target in *-cray-unicos*) if test ! X$GXX = Xyes; then CXXOPTIONS_MISC="$CXXOPTIONS_MISC -h new_for_init" fi AC_MSG_RESULT(cray) ;; *) AC_MSG_RESULT(none) ;; esac dnl -- special optimization options -- AC_MSG_CHECKING([for special optimization options]) case $target in rs6000-ibm-aix3.2.* | rs6000-ibm-aix4.* | powerpc-ibm-aix4.* | powerpc-ibm-aix5.*) if test X$GCC != Xyes; then COPTIONS_OPT="-O -qnolm" fi if test X$GXX != Xyes; then CXXOPTIONS_OPT="-O -qnolm -qrtti" fi AC_MSG_RESULT("rs6000 or powerpc") ;; alphaev6-*) if test X$GCC = Xyes; then COPTIONS_OPT="-O3 -mcpu=ev6" else COPTIONS_OPT="-O5 -arch ev6" fi if test X$GXX = Xyes; then CXXOPTIONS_OPT="-O3 -mcpu=ev6" else CXXOPTIONS_OPT="-O5 -arch ev6" fi AC_MSG_RESULT("alphaev6") ;; alphaev56-*) if test X$GCC = Xyes; then COPTIONS_OPT="-O3 -mcpu=ev56" else COPTIONS_OPT="-O5 -arch ev56" fi if test X$GXX = Xyes; then CXXOPTIONS_OPT="-O3 -mcpu=ev56" else CXXOPTIONS_OPT="-O5 -arch ev56" fi AC_MSG_RESULT("alphaev56") ;; mips*-sgi-irix5*) if test X$GCC != Xyes; then COPTIONS_OPT="-O -Olimit 2000" fi AC_MSG_RESULT("mips*-sgi-irix5") ;; changequote(<<, >>)dnl mips*-sgi-irix6.[01]*) changequote([, ])dnl if test X$GCC != Xyes; then COPTIONS_OPT="-O2 -TENV:use_fp \ -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000" fi if test X$GXX != Xyes; then CXXOPTIONS_OPT="-O2 -TENV:use_fp \ -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000" fi AC_MSG_RESULT("mips*-sgi-irix6.0 or mips*-sgi-irix6.1") ;; mips*-sgi-irix*) if test X$GCC != Xyes; then COPTIONS_OPT="-O2 -OPT:Olimit=0" fi if test X$GXX != Xyes; then CXXOPTIONS_OPT="-O2 -OPT:Olimit=0" fi AC_MSG_RESULT("mips*-sgi-irix") ;; changequote(<<, >>)dnl i[56]86-*) changequote([, ])dnl if test X$GCC = Xyes; then COPTIONS_OPT="-O2" fi if test X$GXX = Xyes; then CXXOPTIONS_OPT="-O2" fi AC_MSG_RESULT("i586 or i686") ;; i860-intel-*) if test X$GCC != Xyes; then COPTIONS_OPT="-O3 -Knoieee" fi AC_MSG_RESULT("i860") ;; *) AC_MSG_RESULT("none") ;; esac dnl -- special architecture options -- case $target_cpu in i786) opt_target_cpu=pentium4 ;; *) opt_target_cpu=$target_cpu ;; esac if test X$GXX == Xyes; then AC_MSG_CHECKING([for C++ cpu tuning flag]) AC_LANG_SAVE AC_LANG_CPLUSPLUS CXXFLAGS_SAV=$CXXFLAGS CXXFLAGS="-mtune=$opt_target_cpu $CXXFLAGS_SAV" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cxx_tuneflag="-mtune",cxx_tuneflag="-mcpu") CXXFLAGS=$CXXFLAGS_SAV AC_LANG_RESTORE AC_MSG_RESULT($cxx_tuneflag) fi if test X$GCC == Xyes; then AC_MSG_CHECKING([for C cpu tuning flag]) CFLAGS_SAV=$CFLAGS CFLAGS="-mtune=$opt_target_cpu $CFLAGS_SAV" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cc_tuneflag="-mtune",cc_tuneflag="-mcpu") CFLAGS=$CFLAGS_SAV AC_MSG_RESULT($cc_tuneflag) fi AC_MSG_CHECKING([for special architecture options]) case $target in *-solaris2*) if test X$GCC != Xyes; then CCDEPENDFLAGS="-xM" fi if test X$GXX != Xyes; then CXXDEPENDFLAGS="-xM" fi ;; rs6000-ibm-aix* | powerpc-ibm-aix*) if test X$GCC != Xyes; then LDFLAGS="$LDFLAGS -bmaxdata:0x70000000" fi AC_MSG_RESULT(rs6000 or powerpc) ;; i686-intel-cougar*) COPTIONS_MISC="$COPTIONS_MISC -mcougar" CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mcougar" EXTRADEFINES="-D_REENTRANT $EXTRADEFINES" if test X$cross_compiling = Xyes; then AR=tflop-ar fi AC_MSG_RESULT(teraflop cougar) ;; changequote(<<, >>)dnl i[4567]86-* | pentium-* | pentium4-* | pentiumpro-* | k6-* | athlon-*) changequote([, ])dnl if test X$STRICT_ARCH = Xyes; then cxx_cpu_arch_option="-march=$opt_target_cpu" cc_cpu_arch_option="-march=$opt_target_cpu" else cxx_cpu_arch_option="$cxx_tuneflag=$opt_target_cpu" cc_cpu_arch_option="$cc_tuneflag=$opt_target_cpu" fi if test X$GCC = Xyes; then COPTIONS_OPT="$COPTIONS_OPT $cc_cpu_arch_option" fi if test X$GXX = Xyes; then CXXOPTIONS_OPT="$CXXOPTIONS_OPT $cxx_cpu_arch_option" fi AC_MSG_RESULT(IA-32: $cpu_arch_option) ;; i860-intel-puma*) if test X$GCC = Xyes; then COPTIONS_MISC="$COPTIONS_MISC -mpuma" else COPTIONS_MISC="$COPTIONS_MISC -D__PUMAGON__" COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/puma" COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/puma" COPTIONS_MISC="$COPTIONS_MISC -lpuma -lm -lkmath" COPTIONS_MISC="$COPTIONS_MISC $PARAGON_XDEV/paragon/lib-coff/puma/libstubs.o" fi if test X$GXX = Xyes; then CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mpuma" fi if test X$cross_compiling = Xyes; then AR=ar860 fi AC_MSG_RESULT(paragon puma) ;; i860-intel-sunmos*) if test X$GCC = Xyes; then COPTIONS_MISC="$COPTIONS_MISC -msunmos" else COPTIONS_MISC="$COPTIONS_MISC -DSUNMOS -D__PUMAGON__" COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/sunmos" COPTIONS_MISC="$COPTIONS_MISC -Wl,-d0x4000000,-k" COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/sunmos" COPTIONS_MISC="$COPTIONS_MISC -lm -lsunmos -lm" fi if test X$GXX = Xyes; then CXXOPTIONS_MISC="$CXXOPTIONS_MISC -msunmos" fi if test X$cross_compiling = Xyes; then AR=ar860 fi AC_MSG_RESULT(paragon sunmos) ;; i860-intel-osf*) if test X$GCC = Xyes; then COPTIONS_MISC="$COPTIONS_MISC -mnx" fi if test X$GXX = Xyes; then CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mnx" fi if test X$cross_compiling = Xyes; then AR=ar860 fi AC_MSG_RESULT(paragon osf) ;; *) AC_MSG_RESULT("none") ;; esac dnl -- check for overriden optimization options -- if test -n "$GIVEN_COPTIONS_OPT"; then COPTIONS_OPT=$GIVEN_COPTIONS_OPT AC_MSG_NOTICE("overriding C optimization flags with $COPTIONS_OPT") fi if test -n "$GIVEN_CXXOPTIONS_OPT"; then CXXOPTIONS_OPT=$GIVEN_CXXOPTIONS_OPT AC_MSG_NOTICE("overriding C++ optimization flags with $CXXOPTIONS_OPT") fi dnl ----------- check for C++ typename --------------- dnl This is done before template flags are set to avoid dnl undefined symbol problems. AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING("for C++ typename keyword") AC_TRY_LINK([ class X { public: typedef int t; X(){} }; template void f(T i) {typename T::t x;} ],[ X g; f(g); ],[ AC_DEFINE(HAVE_TYPENAME, 1, ["use typename keyword"]) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") AC_DEFINE(typename, [], ["remove usage of absent typename keyword by empty define"]) ); AC_LANG_RESTORE dnl ----------- check for C++ restrict extension --------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_LINK(,[double *restrict x=0;], AC_DEFINE(CXX_RESTRICT, 1, ["c++ restricted extensions"]) AC_DEFINE(restrictxx, [restrict], ["convert keyword for c++ restricted extensions"]), AC_DEFINE(restrictxx, [], ["convert keyword to none for c++ restricted extensions"]), ) AC_LANG_RESTORE dnl ---------- Checks for C++ header files. ----------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(iostream sstream) AC_LANG_RESTORE AC_MSG_CHECKING(iostream name) if test x$ac_cv_header_iostream = xyes; then iostream=iostream else iostream=iostream.h fi AC_MSG_RESULT($iostream) dnl ----------- check for namespace std --------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING("for namespace std") AC_TRY_LINK([ #include <$iostream> using namespace std; ],[ ostream &o = cout; o << endl; ],[ AC_DEFINE(USING_NAMESPACE_STD, 1, ["using namespace std"]) NAMESPACE_STD=std:: AC_MSG_RESULT("yes") ], NAMESPACE_STD= AC_MSG_RESULT("no") ); AC_LANG_RESTORE dnl ----------- check for GNU libc++-v3 prerelease bug --------------- if test X$GXX = Xyes; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING("for GNU libc++-v3 prerelease bug") AC_TRY_LINK([ #include #include <$iostream> ],[ ],[ AC_MSG_RESULT("no") ], EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1" AC_MSG_RESULT("yes") ); AC_LANG_RESTORE fi dnl -- other options -- if test $DEBUG = yes; then CFLAGS="$COPTIONS_DBG $COPTIONS_MISC" CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC" LDFLAGS="$LDFLAGS -g" elif test $DEBUG = opt; then CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC" CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_OPT $CXXOPTIONS_MISC" LDFLAGS="$LDFLAGS -g" else CFLAGS="$COPTIONS_OPT $COPTIONS_MISC" CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC" fi AC_SUBST(EXTRAINCLUDE) AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBDIRS) AC_SUBST(OBJSUF) AC_SUBST(LIBSUF) AC_SUBST(CCDEPENDSUF) AC_SUBST(CXXDEPENDSUF) AC_SUBST(CCDEPENDFLAGS) AC_SUBST(CXXDEPENDFLAGS) dnl -------- Checks for architecture specific features. -------- dnl (Doesn't work for cross compilation.) dnl AC_CHECK_SIZEOF(void*) dnl This version works on more machines without the need to run dnl a test program. AC_DEFUN([SC_C_BIGENDIAN], [AC_CHECK_HEADERS(fp.h endian.h machine/endian.h sys/endian.h sys/machine.h) AC_CACHE_CHECK(whether byte ordering is bigendian, sc_cv_c_bigendian, [sc_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. AC_TRY_COMPILE([#include "confdefs.h" #ifdef HAVE_FP_H #include #endif #ifdef HAVE_ENDIAN_H #include #endif #ifdef HAVE_MACHINE_ENDIAN_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_SYS_MACHINE_H #include #endif #include #include ], [ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. AC_TRY_COMPILE([#include "confdefs.h" #ifdef HAVE_FP_H #include #endif #ifdef HAVE_MP_H #include #endif #ifdef HAVE_ENDIAN_H #include #endif #ifdef HAVE_MACHINE_ENDIAN_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_SYS_MACHINE_H #include #endif #include #include ], [ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif], sc_cv_c_bigendian=yes, sc_cv_c_bigendian=no)]) if test $sc_cv_c_bigendian = unknown; then AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], sc_cv_c_bigendian=no, sc_cv_c_bigendian=yes, AC_MSG_ERROR([Could not determine endianness and cross compiling]) ) fi]) if test $sc_cv_c_bigendian = yes; then AC_DEFINE(WORDS_BIGENDIAN, 1, ["use big endian encoding"]) fi ]) SC_C_BIGENDIAN dnl --------- Checks for libraries. --------- dnl -- libpthread should be linked in last. dnl -- Check on pthread_join since pthread_create, but not pthread_join, dnl -- seems to be in libc on IRIX and we must generate a -lpthread in LIBS. if test "(" X$PARALLEL = Xyes -a X$THREADS != Xno ")" -o X$THREADS = Xyes; then AC_MSG_CHECKING([pthreads]) dnl see if posix threads are automatically linked ... AC_LANG_SAVE AC_LANG_CPLUSPLUS LIBSSAV="$LIBS" AC_TRY_LINK([#include ],[pthread_join(0,0);],[ HAVE_PTHREAD=yes],[ HAVE_PTHREAD=no]) AC_LANG_RESTORE dnl see if posix threads are in -lpthread if test $HAVE_PTHREAD = no; then AC_LANG_SAVE AC_LANG_CPLUSPLUS LIBSSAV="$LIBS" LIBS="$LIBS -lpthread" AC_TRY_LINK([#include ],[pthread_join(0,0);],[ HAVE_PTHREAD=yes],[ HAVE_PTHREAD=no LIBS="$LIBSSAV"]) AC_LANG_RESTORE fi dnl see if posix threads are in -lpthreads if test $HAVE_PTHREAD = no; then AC_LANG_SAVE AC_LANG_CPLUSPLUS LIBSSAV="$LIBS" LIBS="$LIBS -lpthreads" AC_TRY_LINK([#include ],[pthread_join(0,0);],[ HAVE_PTHREAD=yes],[ HAVE_PTHREAD=no LIBS="$LIBSSAV"]) AC_LANG_RESTORE fi AM_CONDITIONAL(COND_PTHREAD, [test X$HAVE_PTHREAD = Xyes]) AC_MSG_RESULT($HAVE_PTHREAD) fi if test X$HAVE_PTHREAD = Xyes; then AC_DEFINE(HAVE_PTHREAD, 1, ["use pthreads"]) EXTRADEFINES="-D_REENTRANT $EXTRADEFINES" AC_CHECK_FUNC(pthread_attr_getstacksize, [HAVE_PTHREAD_ATTR_GETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_GETINHERITSCHED=no]) AC_CHECK_FUNC(pthread_attr_setstacksize, [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=no]) AC_CHECK_FUNC(pthread_attr_setscope, [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=no]) AC_CHECK_FUNC(pthread_attr_getscope, [HAVE_PTHREAD_ATTR_GETSCOPE=yes], [HAVE_PTHREAD_ATTR_GETSCOPE=no]) AC_CHECK_FUNC(pthread_attr_setinheritsched, [HAVE_PTHREAD_ATTR_GETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_GETSTACKSIZE=no]) AC_CHECK_FUNC(pthread_attr_getinheritsched, [HAVE_PTHREAD_ATTR_SETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_SETINHERITSCHED=no]) AC_CHECK_FUNC(pthread_attr_setschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=no]) AC_CHECK_FUNC(pthread_attr_getschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=no]) AC_CHECK_FUNC(pthread_attr_setschedparam, [HAVE_PTHREAD_ATTR_SETSCOPE=yes], [HAVE_PTHREAD_ATTR_SETSCOPE=no]) AC_CHECK_FUNC(pthread_attr_getschedparam, [HAVE_PTHREAD_ATTR_SETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_SETSTACKSIZE=no]) AC_CHECK_FUNC(sched_get_priority_max, [HAVE_SCHED_GET_PRIORITY_MAX=yes], [HAVE_SCHED_GET_PRIORITY_MAX=no]) AC_CHECK_FUNC(sched_get_priority_min, [HAVE_SCHED_GET_PRIORITY_MIN=yes], [HAVE_SCHED_GET_PRIORITY_MIN=no]) fi AC_DEFINE(HAVE_PTHREAD_ATTR_GETINHERITSCHED, [$HAVE_PTHREAD_ATTR_GETINHERITSCHED], ["use pthread_attr_getstacksize"]) AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_GETSCHEDPARAM], ["use pthread_attr_setstacksize"]) AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_GETSCHEDPOLICY], ["use pthread_attr_setscope"]) AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCOPE, [$HAVE_PTHREAD_ATTR_GETSCOPE], ["use pthread_attr_getscope"]) AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE, [$HAVE_PTHREAD_ATTR_GETSTACKSIZE], ["use pthread_attr_setinheritsched"]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETINHERITSCHED, [$HAVE_PTHREAD_ATTR_SETINHERITSCHED], ["use pthread_attr_getinheritsched"]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_SETSCHEDPARAM], ["use pthread_attr_setschedpolicy"]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_SETSCHEDPOLICY], ["use pthread_attr_getschedpolicy"]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE, [$HAVE_PTHREAD_ATTR_SETSCOPE], ["use pthread_attr_setschedparam"]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE, [$HAVE_PTHREAD_ATTR_SETSTACKSIZE], ["use pthread_attr_getschedparam"]) AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MAX, [$HAVE_SCHED_GET_PRIORITY_MAX], ["use sched_get_priority_max"]) AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MIN, [$HAVE_SCHED_GET_PRIORITY_MIN], ["use sched_get_priority_max"]) AC_CHECK_LIB(dl,main) dnl commented out for Cray X1 (-lsun falsely detected) dnl AC_CHECK_LIB(sun,main) AC_CHECK_LIB(m,main) dnl AC_CHECK_LIB(fl,main) AC_CHECK_HEADER(perf.h,[ AC_CHECK_LIB(perf,perf_set_config,[ HAVE_PERF=yes LIBS="-lperf $LIBS" AC_DEFINE(HAVE_PERF, 1, ["use perf"]) ]) ] ) AC_CHECK_HEADER(execinfo.h,HAVE_EXECINFO_H_INC=1) AC_CHECK_FUNC(backtrace, HAVE_BACKTRACE_FUNC=1) AC_CHECK_FUNC(backtrace_symbols_fd, HAVE_BACKTRACE_SYMBOLS_FD_FUNC=1) if test -n "$HAVE_EXECINFO_H_INC" -a -n "$HAVE_BACKTRACE_FUNC" -a -n "$HAVE_BACKTRACE_SYMBOLS_FD_FUNC"; then AC_DEFINE(HAVE_BACKTRACE, 1, ["use backtrace"]) fi if test X$PARALLEL = Xyes; then dnl ----- check for the mpi library AC_LANG_SAVE AC_LANG_CPLUSPLUS dnl Must use try_link since check_header runs cpp which doesn't dnl always find mpi.h (if mpicc and no -I is used for example) AC_MSG_CHECKING(for mpi.h) AC_TRY_LINK([#include ],[],have_mpi_h=yes,have_mpi_h=no) AC_MSG_RESULT($have_mpi_h) if test "$have_mpi_h" = yes; then AC_CHECK_FUNC(MPI_Init,HAVE_MPI=yes,HAVE_MPI=no) if test "$HAVE_MPI" = no; then AC_CHECK_LIB(mpi,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpi $LIBS"]) fi if test "$HAVE_MPI" = no; then AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich $LIBS"]) fi fi if test X$HAVE_MPI = Xyes; then AC_DEFINE(HAVE_MPI, 1, ["have MPI"]) AC_CHECK_FUNC(MPI_File_open, [HAVE_MPIIO=yes;AC_DEFINE(HAVE_MPIIO, 1, ["have MPI IO extensions"])]) AC_CHECK_FUNC(MPI_Init_thread, [AC_DEFINE(HAVE_MPI_INIT_THREAD, 1, ["have MPI init thread"])]) HAVE_MPIPP=no; AC_CHECK_LIB(mpi++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lmpi++ $LIBS"]) if test X$HAVE_MPIPP = Xno; then AC_CHECK_LIB(pmpich++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lpmpich++ $LIBS"]) fi AC_DEFINE(HAVE_MPIPP, 1, ["have MPI PP"]) fi AC_LANG_RESTORE fi AM_CONDITIONAL(COND_MPI, [test X$HAVE_MPI = Xyes]) if test X$HAVE_MPI != Xyes -a $ALWAYS_USE_MPI = yes; then AC_MSG_ERROR([--enable-always-use-mpi is set but MPI is not available]) elif test $ALWAYS_USE_MPI = yes; then AC_DEFINE(ALWAYS_USE_MPI, 1, ["always use MPI"]) fi dnl ------ check for the armci library AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADER(armci.h,[ AC_CHECK_FUNC(ARMCI_Init,HAVE_ARMCI=yes,[ AC_CHECK_LIB(armci,ARMCI_Init,[HAVE_ARMCI=yes;LIBS="-larmci $LIBS"]) ]) ]) AC_LANG_RESTORE if test X$HAVE_ARMCI = Xyes; then AC_DEFINE(HAVE_ARMCI, 1, ["use ARMCI"]) fi AM_CONDITIONAL(COND_ARMCI, [test X$HAVE_ARMCI = Xyes]) if test $DEFAULT_PARALLEL = mtmpi -a X$HAVE_MPI != Xyes; then AC_MSG_ERROR([--with-default-parallel=mtmpi but MPI not available]) fi if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_MPI != Xyes; then AC_MSG_ERROR([--with-default-parallel=armcimpi but MPI not available]) fi if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_ARMCI != Xyes; then AC_MSG_ERROR([--with-default-parallel=armcimpi but ARMCI not available]) fi AC_SUBST(HAVE_PERF) AC_SUBST(HAVE_MPI) AC_SUBST(ALWAYS_USE_MPI) AC_SUBST(HAVE_ARMCI) AC_SUBST(HAVE_MPIIO) AC_SUBST(EXTRADEFINES) dnl ---------- Checks for header files. ----------- AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h pwd.h) AC_CHECK_HEADERS(sys/times.h sys/resource.h time.h machine/fpu.h asm/fpu.h) AC_CHECK_HEADERS(termios.h sys/stat.h sys/types.h dlfcn.h stdint.h) dnl -- Checks for typedefs, structures, and compiler characteristics. -- AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM dnl --------- Checks for library functions. --------- AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(strerror sigfillset signal system getpwuid geteuid) AC_CHECK_FUNCS(gethostname time ctime) AC_CHECK_FUNCS(setrlimit setenv) dnl --------- Check for an isnan and make sure it can be used dnl with iostream (it can't on OS X) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING(isnan and iostream) AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include #include ],[isnan(1.0); return 0; ])], AC_DEFINE(HAVE_ISNAN,1, ["isnan available"]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) AC_LANG_RESTORE dnl --------- Check for the glibc extensions to C99 fenv.h. --------- AC_CHECK_HEADERS(fenv.h) AC_CHECK_FUNCS(feenableexcept fedisableexcept) dnl --------- Checks for a C++ linkable fchdir. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([fchdir]) AC_TRY_COMPILE([#include ],[ fchdir(0); ],[HAVE_FCHDIR=yes AC_DEFINE(HAVE_FCHDIR, 1, ["have fchdir"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) HAVE_FCHDIR=no ]) AC_LANG_RESTORE AC_SUBST(HAVE_FCHDIR) dnl --------- Check for ios::fmtflags. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([ios::fmtflags]) AC_TRY_COMPILE([#include <$iostream>],[ $NAMESPACE_STD ios::fmtflags flags; ],[HAVE_IOS_FMTFLAGS=yes AC_DEFINE(HAVE_IOS_FMTFLAGS, 1, ["have iostream format flags"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) HAVE_IOS_FMTFLAGS=no ]) AC_LANG_RESTORE AC_SUBST(HAVE_IOS_FMTFLAGS) dnl --------- check for long long --------- if test X"$LONGLONG" = Xyes; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING(long long) AC_TRY_COMPILE([],[ long long i; ],[AC_DEFINE(HAVE_LONG_LONG, 1, ["have long long"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) ]) AC_LANG_RESTORE fi dnl --------- Check for sgetn. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([sgetn]) AC_TRY_COMPILE([#include <$iostream>],[ char *c=0; $NAMESPACE_STD streambuf *s=0; s->sgetn(c,0); ],[HAVE_SGETN=yes AC_DEFINE(HAVE_SGETN, 1, ["have sgetn"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) HAVE_SGETN=no ]) AC_LANG_RESTORE AC_SUBST(HAVE_SGETN) dnl --------- Check for pubseekoff. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([pubseekoff]) AC_TRY_COMPILE([#include <$iostream>],[ $NAMESPACE_STD cout.rdbuf()->pubseekoff(0,$NAMESPACE_STD ios::beg, $NAMESPACE_STD ios::out); ],[HAVE_PUBSEEKOFF=yes AC_DEFINE(HAVE_PUBSEEKOFF, 1, ["have pubseekoff"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) HAVE_PUBSEEKOFF=no ]) AC_LANG_RESTORE AC_SUBST(HAVE_PUBSEEKOFF) dnl --------- Check for seekoff. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([seekoff]) AC_TRY_COMPILE([#include <$iostream>],[ $NAMESPACE_STD cout.rdbuf()->seekoff(0,$NAMESPACE_STD ios::beg, $NAMESPACE_STD ios::out); ],[HAVE_SEEKOFF=yes AC_DEFINE(HAVE_SEEKOFF, 1, ["have seekoff"]) AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no) HAVE_SEEKOFF=no ]) AC_LANG_RESTORE AC_SUBST(HAVE_SEEKOFF) dnl --------- Check for signal handler argument lists. --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([signal handler needs ellipsis]) AC_TRY_LINK([ #include extern "C" { typedef void (*signal_handler)(...); void handler(int); } void handler(int) {} ],[ signal(SIGINT, (signal_handler)handler); ], AC_DEFINE(SIGHASELLIP, 1, ["signal handler needs ellipsis"]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_LANG_RESTORE dnl --------- Checks for rand functions --------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_FUNCS(drand48) AC_LANG_RESTORE dnl --------- Checks for SYSV IPC. --------- if test "X$SYSVIPC" = Xyes; then AC_CHECK_FUNCS(shmget semget) AC_CHECK_HEADERS(sys/ipc.h sys/sem.h sys/shm.h) AC_MSG_CHECKING([for SYSV IPC]) if test X$ac_cv_func_shmget = Xyes -a \ X$ac_cv_func_semget = Xyes -a \ X$ac_cv_header_sys_ipc_h = Xyes -a \ X$ac_cv_header_sys_sem_h = Xyes -a \ X$ac_cv_header_sys_shm_h = Xyes; then HAVE_SYSV_IPC=yes AC_DEFINE(HAVE_SYSV_IPC, 1, ["use SYSVIPC"]) else HAVE_SYSV_IPC=no fi AC_MSG_RESULT($HAVE_SYSV_IPC) AC_SUBST(HAVE_SYSV_IPC) else HAVE_SYSV_IPC=no AC_SUBST(HAVE_SYSV_IPC) fi AM_CONDITIONAL(COND_SYSV_IPC, [test "X$HAVE_SYSV_IPC" = Xyes]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([if semctl requires semun]) AC_TRY_LINK([ #include #include #include ],[ int val = 0; semctl(0,0,0,val); ],[ case $target in *-sgi-irix*) AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(sgi-irix -- yes) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(yes)) AC_LANG_RESTORE AC_DEFINE(SHMTYPE, [char *], ["type to use in shared memory"]) dnl ----------- See if Fortran works -------------- AC_MSG_CHECKING(if fortran compiler works) if test -n "$F77" -a "$F77" != no ; then /bin/rm -f ffunc.f flink.c echo " program main" > ffunc.f echo " end" >> ffunc.f if $F77 -o ffunc ffunc.f 1>&5 2>&5; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_FAILURE(fortran compiler does not work) fi /bin/rm -f ffunc ffunc.f fi dnl ----------- Fortran symbol names -------------- AC_MSG_CHECKING(fortran symbols) if test -n "$F77" -a "$F77" != no ; then /bin/rm -f ffunc.f flink.c echo " subroutine ffunc()" > ffunc.f echo " return" >> ffunc.f echo " end" >> ffunc.f $F77 -c ffunc.f 1>/dev/null 2>/dev/null echo "main(){ FF(); return 0; }" > flink.c if $CC -o flink -DFF=ffunc flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then AC_MSG_RESULT(same as C) F77_SYMBOLS=symbol elif $CC -o flink -DFF=ffunc_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then AC_MSG_RESULT(lowercase with underscore) F77_SYMBOLS=symbol_ elif $CC -o flink -DFF=FFUNC flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then AC_MSG_RESULT(uppercase) F77_SYMBOLS=SYMBOL elif $CC -o flink -DFF=FFUNC_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then AC_MSG_RESULT(uppercase with underscore) F77_SYMBOLS=SYMBOL_ else AC_MSG_RESULT(giving up) AC_MSG_ERROR(could not determine F77 symbol names) fi /bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc else F77_SYMBOLS=symbol_ AC_MSG_RESULT(guessing lowercase with underscore) fi AC_SUBST(F77_SYMBOLS) dnl ----------- check for FORTRAN libraries -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS LIBSSAV="$LIBS" LIBS="$LIBSSAV $FLIBS" LIBBLAS="" F77_DGEMM=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DAXPY` AC_CHECK_FUNC($F77_DGEMM,HAVE_BLAS=yes,[ AC_CHECK_LIB(essl,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lessl"], AC_CHECK_LIB(blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lblas"]) )] ) if test X$HAVE_BLAS != Xyes; then LIBSSAV2="$LIBS" LIBS="-latlas $LIBS" AC_CHECK_LIB(f77blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lf77blas -latlas"], LIBS="$LIBSSAV2") fi AC_SUBST(HAVE_BLAS) if test X$HAVE_BLAS != Xyes; then echo "WARNING: Could not link to the BLAS library. It can be obtained at" echo "http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs" echo "to specify the name of the library." AC_MSG_ERROR([BLAS is required to complete the build]) fi LIBS="$LIBSSAV $LIBBLAS $FLIBS" LIBLAPACK="" F77_DGESVD=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DGESVD` AC_CHECK_FUNC($F77_DGESVD,HAVE_LAPACK=yes,[ AC_CHECK_LIB(lapack,$F77_DGESVD,[HAVE_LAPACK=yes;LIBLAPACK="-llapack"] )] ) AC_DEFINE(HAVE_LAPACK, [$HAVE_LAPACK], ["use lapack"]) if test X$HAVE_LAPACK != Xyes; then echo "Could not link to the LAPACK library. It can be obtained at" echo "http://www.netlib.org/lapack. Use --with-libdirs and/or --with-libs" echo "to specify the name of the library." AC_MSG_ERROR([LAPACK is required to complete the build]) fi FLIBS="$LIBLAPACK $LIBBLAS $FLIBS" AC_LANG_RESTORE dnl ----------- check for Scalable BLAS library -------------- LIBSSAV="$LIBS" LIBS="$LIBS $FLIBS" HAVE_SCALABLE_BLAS=no AC_CHECK_FUNC(sB_init, HAVE_SCALABLE_BLAS=yes,[ AC_CHECK_LIB(sB_BLAS,sB_init,[ HAVE_SCALABLE_BLAS=yes LIBSSAV="-lsB_BLAS $LIBSSAV" ])] ) LIBS="$LIBSSAV" if test $HAVE_SCALABLE_BLAS = yes; then AC_DEFINE(HAVE_SCALABLE_BLAS, 1, ["have scalabale blas"]) fi dnl ----------- NIAMA library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_PROG(NIAMACFG,niama-config,niama-config) if test X$NIAMACFG != X; then LIBSSAV="$LIBS" CPPSAV="$CPPFLAGS" NIAMALIBS="`niama-config --libs` `niama-config --corbalibs`" CPPFLAGS="$CPPFLAGS `niama-config --cppflags`" LIBS="$NIAMALIBS $LIBS" AC_TRY_LINK([ #include ],[ exit(0); ],[ AC_DEFINE(HAVE_NIAMA, 1, ["have NIAMA"]) ],[ LIBS="$LIBSSAV" CPPFLAGS="$CPPSAV" ] ) fi AC_LANG_RESTORE dnl ----------- libint library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libint/libint.h, HAVE_LIBINT_LIBINT_H=yes AC_CHECK_LIB(int,init_libint_base, HAVE_LIBINT=yes AC_DEFINE(HAVE_LIBINT, 1, ["have libint"]) AC_SUBST(HAVE_LIBINT) LIBS="-lint $LIBS" ), HAVE_LIBINT_LIBINT_H=no ) AC_LANG_RESTORE AC_DEFINE(HAVE_LIBINT_LIBINT_H, [$HAVE_LIBINT_LIBINT_H], ["use libint.h"]) AM_CONDITIONAL([COND_LIBINT], [test x"$HAVE_LIBINT" = x"1"]) dnl ----------- libr12 library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libr12/libr12.h, HAVE_LIBR12_LIBR12_H=yes AC_CHECK_LIB(r12,init_libr12_base, HAVE_LIBR12=yes AC_DEFINE(HAVE_LIBR12, 1, ["have libr12"]) AC_SUBST(HAVE_LIBR12) LIBS="-lr12 $LIBS" ), HAVE_LIBR12_LIBR12_H=no ) AC_LANG_RESTORE AC_DEFINE(HAVE_LIBR12_LIBR12_H, [$HAVE_LIBR12_LIBR12_H], ["use libr12.h"]) AM_CONDITIONAL([COND_LIBR12], [test x"$HAVE_LIBR12" = x"1"]) dnl ----------- libderiv library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libderiv/libderiv.h, HAVE_LIBDERIV_LIBDERIV_H=yes AC_CHECK_LIB(deriv,init_libderiv_base, HAVE_LIBDERIV=yes AC_DEFINE(HAVE_LIBDERIV, 1, ["have libderiv"]) AC_SUBST(HAVE_LIBDERIV) LIBS="-lderiv $LIBS" ), HAVE_LIBDERIV_LIBDERIV_H=no ) AC_LANG_RESTORE AC_DEFINE(HAVE_LIBDERIV_LIBDERIV_H, [$HAVE_LIBDERIV_LIBDERIV_H], ["use libderiv.h"]) AM_CONDITIONAL([COND_LIBDERIV], [test x"$HAVE_LIBDERIV" = x"1"]) dnl ----------- make sure we have everything for cints and mbptr12 ---------- if test ! X$HAVE_LIBR12 = Xyes -o ! X$HAVE_LIBINT = Xyes; then EXCLUDED_DIRS="-x SRC_LIB_CHEMISTRY_QC_CINTS -x SRC_LIB_CHEMISTRY_QC_MBPTR12 $EXCLUDED_DIRS" fi dnl --------- Template instantiation. --------- if test $template_instantiation = auto; then AC_MSG_CHECKING(choosing template instantiation method) if test X$GXX = Xyes; then AC_MSG_RESULT("gcc (none)") else case $target in *-sgi-irix6.0*) AC_MSG_RESULT("*-sgi-irix6.0* (none)") ;; *-sgi-irix*) template_instantiation=ptused AC_MSG_RESULT("*-sgi-irix* (ptused)") ;; *-cray-unicos*) template_instantiation=craysimp AC_MSG_RESULT("*-cray-unicos* (craysimp)") ;; *-dec-osf*) template_instantiation=repodir AC_MSG_RESULT("*-dec-osf* (repodir)") ;; alpha*) template_instantiation=repodir AC_MSG_RESULT("alpha* non-GNU C++ (repodir)") ;; *-solaris*) template_instantiation=sunexpl AC_MSG_RESULT("*-solaris* (sunexpl)") ;; *) AC_MSG_RESULT("generic non GNU (none)") ;; esac fi fi if test $template_instantiation = auto; then template_instantiation=none fi AC_MSG_CHECKING(template instantiation flags) TMPLINST=no TMPLREPO= TMPLINLIB=no case $template_instantiation in repodir) TMPLREPO=cxx_repository TMPLINLIB=yes ;; craysimp) CXXFLAGS="$CXXFLAGS -h simple_templates" ;; gnurepo) TMPLINST=yes CXXFLAGS="$CXXFLAGS -frepo" AC_MSG_RESULT(gnurepo) ;; gnuexpl) # automatic template instantiation causes problems with libstc++-v3 CXXFLAGS="$CXXFLAGS -fno-implicit-templates" EXPLICIT_TEMPLATE_INSTANTIATION=yes AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"]) ;; sunexpl) CXXFLAGS="$CXXFLAGS -instances=explicit" AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"]) ;; ptused) CXXFLAGS="$CXXFLAGS -ptused" ;; none) AC_MSG_RESULT(none) ;; *) AC_MSG_RESULT($template_instantiation) AC_MSG_ERROR(unknown template instantiation method) esac AC_SUBST(TMPLINST) AC_SUBST(TMPLREPO) AC_SUBST(TMPLINLIB) dnl --------- Checks that must be done last. --------- AC_MSG_CHECKING([for special flags that must be set last]) case $target in i860-intel-puma*) LDFLAGS="$LDFLAGS -mpuma -mnoieee" AC_MSG_RESULT(paragon puma) ;; i686-intel-cougar*) LDFLAGS="$LDFLAGS -mcougar -mnoieee" AC_MSG_RESULT(teraflop cougar) ;; i860-intel-sunmos*) LDFLAGS="$LDFLAGS -msunmos -mnoieee" AC_MSG_RESULT(paragon sunmos) ;; i860-intel-osf*) LDFLAGS="$LDFLAGS -mnx -mnoieee" AC_MSG_RESULT(osf paragon) ;; *) AC_MSG_RESULT(none) ;; esac dnl --------- Shared library configuration. --------- enablelibtool=yes AC_ARG_ENABLE(libtool, [ --disable-libtool Do not use libtool.], [ case $enableval in yes) ;; no) enablelibtool=no ;; *) AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)]) ;; esac ]) if test "$enablelibtool" = yes; then dnl by default make only static libraries AC_DISABLE_SHARED AC_PROG_LIBTOOL OBJSUF=lo LIBSUF=la else enable_shared=no fi if test "$enable_shared" = "no"; then OBJSUF=o LIBSUF=a fi ENABLESHARED=$enable_shared AC_SUBST(ENABLESHARED) dnl --------- CCA component configuration --------- have_condcca="false" if test $components == "yes"; then if test $HAVE_MPI == "yes" && test $HAVE_MPIPP == "no"; then AC_MSG_ERROR([libmpi++ needed for mpi cca components]) fi if test -z $CCA_CHEM_CONFIG && ! test -x $CCA_CHEM_CONFIG; then AC_MSG_ERROR([cca-chem-config is required to build CCA component code]) fi CCA_CHEM_INCLUDE=`$CCA_CHEM_CONFIG --includedir` CCA_CHEM_LIB=`$CCA_CHEM_CONFIG --libdir` CCA_CHEM_PREFIX=`$CCA_CHEM_CONFIG --prefix` CCA_CHEM_REPO=$CCA_CHEM_PREFIX/repo AC_SUBST(CCA_CHEM_INCLUDE) AC_SUBST(CCA_CHEM_LIB) AC_SUBST(CCA_CHEM_REPO) CCAFE_CONFIG=`$CCA_CHEM_CONFIG --ccafe-config` ENABLE_PYTHON="no" # no need for python checks AC_CHECK_CCA() LIBS="-L$CCAFE_LIB $LIBS" CCA_CHEM_INCLUDE=-I$CCA_CHEM_INCLUDE BABEL_INCLUDE=-I$BABEL_INCLUDE CCA_SPEC_BABEL_INCLUDE=-I$CCA_SPEC_BABEL_INCLUDE CCAFE_INCLUDE="-I$CCAFE_INCLUDE -I$CCAFE_INCLUDE/dc/babel/babel-cca/server" CPPFLAGS="$CPPFLAGS $BABEL_INCLUDE $CCA_SPEC_BABEL_INCLUDE $CCA_CHEM_INCLUDE $CCAFE_INCLUDE" AC_CHECK_HEADER(sidl.h, AC_DEFINE(HAVE_SIDL_HEADERS, 1, ["have sidl"]), AC_MSG_ERROR([problem with babel headers]) ) AC_CHECK_HEADER(gov_cca_IOR.h, AC_DEFINE(HAVE_CCA_SPEC_BABEL_HEADERS, 1, ["have CCA spec babel headers"]), AC_MSG_ERROR([problem with cca-spec-babel headers]) ) AC_CHECK_HEADER(Chemistry_QC_Model_IOR.h, AC_DEFINE(HAVE_CCA_CHEM_HEADERS, 1, ["have CCA chem headers"]), AC_MSG_ERROR([problem with cca-chem-generic headers]) ) have_condcca="true" else EXCLUDED_DIRS="-x LIB_CCA -x SRC_LIB_CHEMISTRY_CCA -x SRC_LIB_CHEMISTRY_QC_INTCCA $EXCLUDED_DIRS" fi AM_CONDITIONAL(COND_CCA, [test x"$have_condcca" = x"true"]) dnl --------- Find the list of all sc libraries. --------- SCLIBS=`$PERL $srcdir/bin/listlibs.pl -I$srcdir/src/lib -DLIBSUF=$LIBSUF $srcdir/src/lib` AC_SUBST(SCLIBS) dnl --------- Define the library directory macros. --------- if test "$enableproduction" = "no"; then # abs_srcdir is not available, only srcdir, which is insufficient abs_srcdir=$(readlink -m "${srcdir}") AC_DEFINE_DIR(SRC_SCLIBDIR, abs_srcdir/lib, ["source SC libdir"]) fi AC_DEFINE_DIR(INSTALLED_SCLIBDIR, prefix/lib, ["install SC libdir"]) AC_DEFINE_DIR(SCDATADIR, scdatadir, ["SC data dir"]) dnl --------- Create the stub Makefiles. --------- dnl $PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir ### output files AC_CONFIG_FILES([ bin/mkf77sym.pl ]) AC_CONFIG_FILES([ doc/doxygen.cfg ]) AC_CONFIG_FILES([ Makefile lib/Makefile src/lib/Makefile src/bin/mpqc/Makefile ]) AC_CONFIG_TESTDIR([src/bin/mpqc/validate]) AC_CONFIG_FILES([ src/bin/mpqc/validate/atlocal src/bin/mpqc/validate/Makefile ]) AC_CONFIG_FILES([src/bin/mpqc/validate/molecuilder_mpqc], [chmod +x src/bin/mpqc/validate/molecuilder_mpqc]) AC_CONFIG_FILES([src/lib/test_env.sh], [chmod +x src/lib/test_env.sh]) AC_OUTPUT