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_INIT(src/lib/util/ref/ref.h) AC_PREREQ(2.55) AC_CONFIG_HEADER(src/lib/scconfig.h) AC_CONFIG_AUX_DIR(bin) AC_CANONICAL_SYSTEM AC_DEFINE_UNQUOTED(HOST_ARCH, "$host") AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target") define([default_prefix_dash],ifelse(sc_buildid, ,[],[-])) define([default_prefix],builtin(format,"/usr/local/mpqc/%s%s%s", 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) AC_DEFINE_UNQUOTED(SC_MINOR_VERSION,$SC_MINOR_VERSION) AC_DEFINE_UNQUOTED(SC_MICRO_VERSION,$SC_MICRO_VERSION) EXCLUDED_DIRS= 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) elif test $DEFAULT_PARALLEL = mtmpi; then AC_DEFINE(DEFAULT_MPI) AC_DEFINE(DEFAULT_MTMPI) elif test $DEFAULT_PARALLEL = armcimpi; then AC_DEFINE(DEFAULT_MPI) AC_DEFINE(DEFAULT_ARMCI) 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) 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) ;; *) AC_MSG_ERROR([Invalid value for --enable-ref-debug ($enableval)]) ;; esac ],[ if test $DEBUG = no -o $DEBUG = opt; then AC_DEFINE(REF_OPTIMIZE) 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") 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) if test "$BUILDID"; then SC_VERSION="$SC_MMM_VERSION-$BUILDID" else SC_VERSION="$SC_MMM_VERSION" fi AC_DEFINE_UNQUOTED(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 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 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 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.c 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([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([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) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ); 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)) 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) 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) 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 AC_MSG_RESULT($HAVE_PTHREAD) fi if test X$HAVE_PTHREAD = Xyes; then AC_DEFINE(HAVE_PTHREAD) EXTRADEFINES="-D_REENTRANT $EXTRADEFINES" AC_CHECK_FUNC(pthread_attr_getstacksize) AC_CHECK_FUNC(pthread_attr_setstacksize) AC_CHECK_FUNC(pthread_attr_setscope) AC_CHECK_FUNC(pthread_attr_getscope) AC_CHECK_FUNC(pthread_attr_setinheritsched) AC_CHECK_FUNC(pthread_attr_getinheritsched) AC_CHECK_FUNC(pthread_attr_setschedpolicy) AC_CHECK_FUNC(pthread_attr_getschedpolicy) AC_CHECK_FUNC(pthread_attr_setschedparam) AC_CHECK_FUNC(pthread_attr_getschedparam) AC_CHECK_FUNC(sched_get_priority_max) AC_CHECK_FUNC(sched_get_priority_min) fi 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) 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) ]) ] ) 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) 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) AC_CHECK_FUNC(MPI_File_open, [HAVE_MPIIO=yes;AC_DEFINE(HAVE_MPIIO)]) AC_CHECK_FUNC(MPI_Init_thread, [AC_DEFINE(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) fi AC_LANG_RESTORE fi 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) 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) fi 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(HAVE_PTHREAD) 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([ #include #include int main(int,char**) { isnan(1.0); return 0; } ], AC_DEFINE(HAVE_ISNAN) 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) 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) 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) 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) 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) 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) 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) 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) 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 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) AC_MSG_RESULT(sgi-irix -- yes) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_DEFINE(SEMCTL_REQUIRES_SEMUN) AC_MSG_RESULT(yes)) AC_LANG_RESTORE 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_SUBST(HAVE_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) 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) ],[ LIBS="$LIBSSAV" CPPFLAGS="$CPPSAV" ] ) fi AC_LANG_RESTORE dnl ----------- libint library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libint/libint.h, AC_CHECK_LIB(int,init_libint_base, HAVE_LIBINT=yes AC_DEFINE(HAVE_LIBINT) AC_SUBST(HAVE_LIBINT) LIBS="-lint $LIBS" ) ) AC_LANG_RESTORE dnl ----------- libr12 library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libr12/libr12.h, AC_CHECK_LIB(r12,init_libr12_base, HAVE_LIBR12=yes AC_DEFINE(HAVE_LIBR12) AC_SUBST(HAVE_LIBR12) LIBS="-lr12 $LIBS" ) ) AC_LANG_RESTORE dnl ----------- libderiv library checks -------------- AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(libderiv/libderiv.h, AC_CHECK_LIB(deriv,init_libderiv_base, HAVE_LIBDERIV=yes AC_DEFINE(HAVE_LIBDERIV) AC_SUBST(HAVE_LIBDERIV) LIBS="-lderiv $LIBS" ) ) AC_LANG_RESTORE 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) ;; sunexpl) CXXFLAGS="$CXXFLAGS -instances=explicit" AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION) ;; 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 --------- 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), AC_MSG_ERROR([problem with babel headers]) ) AC_CHECK_HEADER(gov_cca_IOR.h, AC_DEFINE(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), AC_MSG_ERROR([problem with cca-chem-generic headers]) ) else EXCLUDED_DIRS="-x LIB_CCA -x SRC_LIB_CHEMISTRY_CCA -x SRC_LIB_CHEMISTRY_QC_INTCCA $EXCLUDED_DIRS" fi 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 AC_DEFINE_DIR(SRC_SCLIBDIR, srcdir/lib) fi AC_DEFINE_DIR(INSTALLED_SCLIBDIR, prefix/lib) AC_DEFINE_DIR(SCDATADIR, scdatadir) dnl --------- Create the stub Makefiles. --------- $PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir AC_OUTPUT(lib/LocalMakefile lib/cca/components.cca bin/sc-config bin/mkf77sym.pl src/bin/mpqc/mpqcrun src/bin/mpqc/ccarun src/bin/mpqc/validate/makeccain.pl doc/doxygen.cfg doc/doxygen.man1.cfg doc/doxygen.man3.cfg) chmod +x bin/sc-config chmod +x src/bin/mpqc/mpqcrun chmod +x src/bin/mpqc/ccarun chmod +x src/bin/mpqc/validate/makeccain.pl