# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # BRANDT NOTE: # AC_MSG_ERRORS (and probably other things) will not except commas!!! # Bad things will happen!!! AC_PREREQ(2.13) AC_INIT(qmcplusplus,0.1.0) AC_CONFIG_AUX_DIR([config]) #AC_CONFIG_SRCDIR([src/ohmms-config.h]) AM_INIT_AUTOMAKE([qmcplusplus], [0.1.0]) AH_TOP([// -*- c++ -*- // //Ohmms Configuration Header. Automatically Generated // //See the LICENSE file in the top-level directory for copyright notices // #ifndef OHMMS_QMC_CONFIGURATION_H #define OHMMS_QMC_CONFIGURATION_H ]) AH_BOTTOM([#endif // OHMMS_QMCCONFIGURATION_H]) AM_CONFIG_HEADER([src/ohmms-config.h]) # setting up config directory to hold autoconf stuff AC_SUBST(ac_aux_dir) # Declare variables which we want substituted in the Makefile.in's # compiler/linker/ar related AC_SUBST(CXX_LIBS) AC_SUBST(CXX_OPTIMIZE_FLAGS) AC_SUBST(CXX_DEBUG_FLAGS) AC_SUBST(CXXFFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(F77) AC_SUBST(F90) AC_SUBST(FFLAGS) AC_SUBST(F77_OPTIMIZE_FLAGS) AC_SUBST(F90_OPTIMIZE_FLAGS) AC_SUBST(AR) AC_SUBST(AR_FLAGS) AC_SUBST(RANLIB) AC_SUBST(INCLUDES) #package related AC_SUBST(MKL_LIBS) AC_SUBST(HDF5_LIBS) AC_SUBST(SPRNG_LIBS) # Adding the lines below just in case we do anything with libtool for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do test -f $top_builddir/configure && break done # lapack, blas, and a whole lot of other libraries are special # check the autoconf macro website to see which other ones are special # TODO: change "config" to AUX_DIST_DIR sinclude(config/ac_cxx_namespaces.m4) sinclude(config/ac_cxx_have_complex_math1.m4) sinclude(config/ac_cxx_have_complex_math2.m4) sinclude(config/ac_path_generic.m4) sinclude(config/ac_check_package.m4) sinclude(config/acx_mpi.m4) sinclude(config/acx_blas.m4) sinclude(config/acx_lapack.m4) sinclude(config/acx_sprng.m4) sinclude(config/acx_hdf5.m4) sinclude(config/acx_blitz.m4) sinclude(config/acx_restrict.m4) sinclude(config/ac_cxx_bz_compiler.m4) qmcapp=MolecuApps ############################################## # imported from blitz configure.in # overwrite compiler flags with blitz configure.in # start ############################################## know_compiler=0 cxx_option_save="" cxx_native_cmpiler=true AC_ARG_WITH(cxx, AC_HELP_STRING([--with-cxx=COMPILER[:name-flags]], [set options for COMPILER (KCC, SGI, FCC, cray, gcc, DECcxx, aCC, icc, icc8, ecc, pgCC, xlC)]), [ cxx_option_save="$withval" case "$withval" in KCCdev) # KAI C++ (development flags) echo "Configuring for KAI C++ development environment" bz_compiler=kccdev cxx_native_compiler=false CXX=KCC CXXFLAGS="-DTV_KCC --restrict \ --no_implicit_include --abstract_pointer --abstract_float \ --no_implicit_typename --no_old_specializations \ --strict_warnings" CXX_OPTIMIZE_FLAGS="+K3 -O3" CXX_DEBUG_FLAGS="-g +K0 -DPRINT_DEBUG" ;; KCC*) # KAI C++ http://www.kai.com/ echo "Configuring for KAI C++" bz_compiler=kcc cxx_native_compiler=false case "$target" in *aix*) # When using KCC under AIX, enable long long type AC_BZ_SET_COMPILER($withval,"KCC","--restrict --longlong --strict_warnings") ;; *) AC_BZ_SET_COMPILER($withval,"KCC","--restrict --strict_warnings") ;; esac CXX_OPTIMIZE_FLAGS="+K3 -O3" CXX_DEBUG_FLAGS="-g +K0 -DPRINT_DEBUG" AR="\$(CXX)" AR_FLAGS="-o" ;; SGI64*) # SGI C++ http://www.sgi.com echo "Configuring for SGI C++ (64 bit abi)" bz_compiler=sgiCC AC_BZ_SET_COMPILER($withval,"CC","-64 -LANG:std -LANG:restrict -DADD_") CXX_LIBS="-lCio" CXX_OPTIMIZE_FLAGS="-Ofast" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" LDFLAGS="-64 -lCio" RANLIB="ar ts" ;; SGI32*) # SGI C++ http://www.sgi.com echo "Configuring for SGI C++ (32 bit abi)" bz_compiler=sgiCC AC_BZ_SET_COMPILER($withval,"CC","-n32 -LANG:std -LANG:restrict -DADD_") CXX_LIBS="-lCio" CXX_OPTIMIZE_FLAGS="-Ofast" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" LDFLAGS="-n32 -lCio" RANLIB="ar ts" ;; SGI*) # SGI C++ http://www.sgi.com echo "Configuring for SGI C++" bz_compiler=sgiCC AC_BZ_SET_COMPILER($withval,"CC","-LANG:std -LANG:restrict -DADD_") CXX_OPTIMIZE_FLAGS="-Ofast" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" AR="\$(CXX)" AR_FLAGS="-ar -o" RANLIB="ar ts" ;; FCC*) echo "Configuring for Fujitsu C++" bz_compiler=FCC AC_BZ_SET_COMPILER($withval,"FCC","") CXX_OPTIMIZE_FLAGS="-K fast" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" ;; DECcxx6.2) # DEC C++ http://www.digital.com/ echo "Configuring for DEC cxx 6.2" bz_compiler=cxx AC_BZ_SET_COMPILER($withval,"cxx","-DBZ_ENABLE_XOPEN_SOURCE -std strict_ansi") CXX_OPTIMIZE_FLAGS="-O4 -tune host" CXX_DEBUG_FLAGS="-g -msg_display_tag -DPRINT_DEBUG" AR_FLAGS="-rv" RANLIB="ar ts" ;; DECcxx6.3) # DEC C++ http://www.digital.com/ echo "Configuring for DEC cxx 6.3" bz_compiler=cxx AC_BZ_SET_COMPILER($withval,"cxx","-DBZ_ENABLE_XOPEN_SOURCE -std strict_ansi -nopure_cname") CXX_OPTIMIZE_FLAGS="-O4 -tune host" CXX_DEBUG_FLAGS="-g -msg_display_tag -DPRINT_DEBUG" AR_FLAGS="-rv" RANLIB="ar ts" ;; cray*) # Cray C++ echo "Configuring for Cray C++." bz_compiler=cray AC_BZ_SET_COMPILER($withval,"CC","-h instantiate=used") CXX_OPTIMIZE_FLAGS="-O3 -hpipeline3 -hunroll -haggress -hscalar2" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" ;; gcc*) # gcc http://gcc.gnu.org/ echo "Configuring for gcc (wahoo!)" bz_compiler=gcc AC_BZ_SET_COMPILER($withval,"g++","-ftemplate-depth-60 -DADD_") CXX_OPTIMIZE_FLAGS="-O3 -funroll-loops -fstrict-aliasing -ffast-math -finline-limit=1000 -fno-gcse" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" ;; aCC) # HP-UX compiler http://www.hp.com/go/c++ echo "Configuring for aCC (HP-UX)" bz_compiler=aCC AC_BZ_SET_COMPILER($withval,"aCC","-AA") CXX_OPTIMIZE_FLAGS="-O" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" ;; icc) # Intel C++ compiler http://www.intel.com/ echo "Configuring for Intel C++. Setting CC and F77 to intel compilers" bz_compiler=icc cxx_native_compiler=false AC_BZ_SET_COMPILER($withval,"icc","-restrict -DADD_") if test x"$CC" = x; then CC="icc" fi if test x"$F77" = x; then F77="ifc" fi CXX_OPTIMIZE_FLAGS="-O3 -unroll" CXX_DEBUG_FLAGS="-g -O0 -DPRINT_DEBUG" ;; icc8) # Intel C++ compiler http://www.intel.com/ echo "Configuring for Intel C++. Setting CC and F77 to intel compilers" bz_compiler=icc cxx_native_compiler=false AC_BZ_SET_COMPILER($withval,"icc","-restrict -DADD_ -fno-alias -ansi -no-gcc") if test x"$CC" = x; then CC="icc" fi if test x"$F77" = x; then F77="ifort" fi CXX_OPTIMIZE_FLAGS="-O3 -unroll -ipo -ipo_obj" CXX_DEBUG_FLAGS="-g -O0 -DPRINT_DEBUG" ;; ecc) # Intel C++ compiler for IA64 http://www.intel.com/ echo "Configuring for Intel C++. Setting CC and F77 to intel compilers version 6 and 7" echo "In order to use intel 8 compiler, use --with-cxx=icc8" bz_compiler=ecc cxx_native_compiler=false if test x"$CC" = x; then CC="ecc" fi if test x"$F77" = x; then F77="efc" fi AC_BZ_SET_COMPILER($withval,"ecc","-restrict -ftz -DADD_") CXX_OPTIMIZE_FLAGS="-O3 -unroll" CXX_DEBUG_FLAGS="-g -O0 -DPRINT_DEBUG" ;; pgCC*) # Portland group http://www.pgroup.com/ echo "Configuring for Portland Group C++" bz_compiler=pgCC AC_BZ_SET_COMPILER($withval,"pgCC","") CXX_OPTIMIZE_FLAGS="-O4 -Mnoframe -Mnodepchk -Minline=levels:25" CXX_DEBUG_FLAGS="-g -O0 -DPRINT_DEBUG" ;; xlC*) # IBM Visual Age C++ http://www.ibm.com/ echo "Configuring for IBM Visual Age C++" bz_compiler=xlC if test x"$CC" = x; then CC="xlc" fi if test x"$F77" = x; then F77="xlf" fi AC_BZ_SET_COMPILER($withval,,"-qstrict -qarch=auto -qtune=auto -qansialias -qrtti=dyna -qkeepinlines") CXX_OPTIMIZE_FLAGS="-O3 -qinline=1000 -qspill=2000 -qalias=typeptr -qnoeh" CXX_DEBUG_FLAGS="-g -DPRINT_DEBUG" ;; *) AC_MSG_WARN([--with-cxx: invalid option $withval]) ;; esac know_compiler=1 ]) if test $know_compiler -eq 0; then cat << 'EOH' This script only recognizes a small set of compilers and platforms so far. You will have to rerun this script with one of these options: --with-cxx=KCC KAI C++ (http://www.kai.com/) --with-cxx=SGI SGI C++ 7.3 or better (http://www.sgi.com/) --with-cxx=gcc gcc (http://gcc.gnu.org/) --with-cxx=cray Cray C++ 3.0 or better (http://www.cray.com/) --with-cxx=DECcxx6.2 DEC cxx 6.2 (http://www.dec.com/) --with-cxx=DECcxx6.3 DEC cxx 6.3 or better (http://www.dec.com/) --with-cxx=aCC HP-UX aCC 3.33 or better (http://www.hp.com/go/c++) --with-cxx=icc Intel icc 5.x, 6.x and 7.x (http://www.intel.com/) --with-cxx=icc8 Intel icc 8.x or higher (http://www.intel.com/) --with-cxx=ecc Intel ecc 5.x, 6.x and 7.x on IA64 (http://www.intel.com/) --with-cxx=pgCC PGI pgCC 3.0 or better (http://www.pgroup.com/) --with-cxx=xlC IBM xlC 5.0 or better (http://www.ibm.com/) EOH exit 1 fi #enable mpi #only set the ohmms_mpi to 1 and after compiler/linker flags are set, add mpi stuff AC_ARG_ENABLE(mpi, AC_HELP_STRING([--enable-mpi],[enable MPI compilation flags (default=no)]),, enable_mpi=no) # Check if the script was called with --enable-64bit # and if so modify the compilation flags. bz_64bit=false AC_ARG_ENABLE(64bit, AC_HELP_STRING([--enable-64bit],[enable 64-bit compilation flags]), [if test "$enableval" = yes; then echo "64-bit compilation flags enabled" bz_64bit=true fi], enable_64bit=no) # Set platform-specific fortran compilers and optimization settings case "$target" in *aix*) echo "AIX: assuming xlf and xlf90" F77="xlf" F77_OPTIMIZE_FLAGS="-O3 -qstrict -qhot" F90="xlf90 -qsuffix=f=f90" F90_OPTIMIZE_FLAGS="-O3 -qstrict -qhot" # FORTLIBS="-lxlf90" if test "$bz_64bit" = true; then F77="xlf -q64" F90="xlf90 -q64 -qsuffix=f=f90" case "$CXX" in xlC) CXXFLAGS="-q64 $CXXFLAGS" AR_FLAGS="-cruX64" ;; KCC) CXXFLAGS="-q64 $CXXFLAGS" AR_FLAGS="-q64 -o" ;; gcc) CXXFLAGS="-maix64 $CXXFLAGS" ;; esac fi ;; *irix*) echo "IRIX: assuming f77 and f90" F77=f77 F77_OPTIMIZE_FLAGS="-Ofast" F90=f90 F90_OPTIMIZE_FLAGS="-Ofast" case "$CXX" in KCC) # When using KAI C++ under IRIX, enable some backend optimizations CXX_OPTIMIZE_FLAGS="+K3 -O3 --COMPO_fe --output_restrict --backend -LANG:restrict=on -mips4" ;; esac if test "$bz_64bit" = true; then F77="f77 -64" F90="f90 -64" case "$CXX" in CC) CXXFLAGS="-64 $CXXFLAGS" AR_FLAGS="-64 -ar -o" ;; KCC) CXXFLAGS="-64 $CXXFLAGS" AR_FLAGS="-64 -o" ;; gcc) CXXFLAGS="-mabi64 $CXXFLAGS" ;; esac fi ;; *solaris*) echo "Solaris: assuming f77 and f90" F77=f77 F77_OPTIMIZE_FLAGS="-O3" F90=f90 F90_OPTIMIZE_FLAGS="-O3" ;; *hp-hpux*) echo "HP-UX: assuming f70 and f90" F77=f90 F77_OPTIMIZE_FLAGS="-O3" F90=f90 F90_OPTIMIZE_FLAGS="-O3" # FORTLIBS="-lc -lF90" ;; *osf*) echo "OSF: assuming f77 and f90" F77=f77 F77_OPTIMIZE_FLAGS="-O4 -tune host" F90=f90 F90_OPTIMIZE_FLAGS="-O4 -tune host" # FORTLIBS="-lfor" ;; alpha-cray-unicos) echo "Cray T3D/E: Setting special optimization flags" F77=fort77 F77_OPTIMIZE_FLAGS="-O aggress -O 3 -O unroll2 -O pipeline3" F90=f90 F90_OPTIMIZE_FLAGS="-O 3 -O aggress -O unroll2 -O pipeline3" CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_CAPS" case "$CXX" in KCC) # When using KAI C++ on the T3E, need to enable a bunch of # backend optimizations CXX_OPTIMIZE_FLAGS="+K3 -O3 --backend -hpipeline3 --backend -hunroll \ --backend -haggress --backend -hscalar2" ;; esac ;; *) echo "Assuming linux with g++/g77 or icc/ifc" case "$CXX" in g++) F77=g77 F77_OPTIMIZE_FLAGS="-O2 -funroll-loops" F90=g77 F90_OPTIMIZE_FLAGS="-O2 -funroll-loops" ;; icc) F77=ifc F77_OPTIMIZE_FLAGS="-w90 -O2" F90=ifc F90_OPTIMIZE_FLAGS="-O2" ;; ecc) F77=efc F77_OPTIMIZE_FLAGS="-ftz -O2" F90=efc F90_OPTIMIZE_FLAGS="-O2" ;; esac ;; esac # Checks for programs. AC_PROG_AWK AC_PROG_CXX AC_PROG_CC AC_PROG_F77 AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_MAKE_SET # Checking for libraries. AC_CXX_NAMESPACES([], [AC_MSG_ERROR([Could not find namespaces], 1)]) AC_CXX_HAVE_COMPLEX_MATH1([], [AC_MSG_ERROR([Could not find complex math libraries], 1)]) AC_CXX_HAVE_COMPLEX_MATH2 ACX_C_RESTRICT # #checking blas/lapack # i) --with-mkl=DIR or --with-mkl using ENV{$MKL} # ii) --with-blas && --with-lapapack # found_blas_lapack=0 AC_ARG_WITH(mkl, AC_HELP_STRING([--with-mkl=DIR], [Use mkl in DIR/lib for blas/lapack libraries. If DIR is not given, the env variable MKL is used.]), [ if test x$withval!=xno; then if test -d $withval; then found_blas_lapack=1 LAPACK_LIBS="-L$withval -lmkl -lmkl_lapack -lguide -lpthread" else mkl_save="${MKL}" if test x"$mkl_save" != x; then found_blas_lapack=1 LAPACK_LIBS="$mkl_save" fi fi fi ], []) if test $found_blas_lapack -eq 0; then ACX_BLAS([], [AC_MSG_WARN([Could not find blas. Add it manually.])]) ACX_LAPACK([], [AC_MSG_WARN([Could not find lapack. Add it manually])]) fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([limits.h stddef.h stdlib.h string.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. #old autoconf/automake needs m4 file for this. #inline does not work so well with xlC/intel std libraries. #AC_HEADER_STDBOOL #AC_C_INLINE AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_C_VOLATILE AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(bool, 4) # Checks for library functions. AC_FUNC_ERROR_AT_LINE #AC_FUNC_MALLOC AC_TYPE_SIGNAL AC_CHECK_FUNCS([atexit clock_gettime floor gettimeofday memset pow sqrt strcasecmp strdup strstr uname]) #time to add mpi stuff only for --enable-mpi=yes needtobuild_oompi=false if test "$enable_mpi" != "no"; then echo "MPI compilation is requested. Checking mpi stuff...." ACX_MPI( [ echo "Checking MPICXX=$MPICXX" if test x"$MPICXX" != x ; then if test "$MPICXX" = "cmpicc";then if test "$CXX" = "icc"; then echo "cmpicc requires an extra option when compiled with intel compilers" CXXFLAGS="$CXXFLAGS -icc" fi fi CXX="$MPICXX" fi AC_DEFINE([HAVE_MPI], 1, [Define to 1 if you have MPI library]) AC_DEFINE([HAVE_OOMPI], 1, [Define to 1 if you have OOMPI library]) ]) fi #enable openmp #add openmp related flags if the platform supports it # AC_ARG_ENABLE(openmp, AC_HELP_STRING([--enable-openmp], [enable OPENMP compilation flags (default=yes)]), [ if test x"$enableval" != xno; then echo "Checking if the compilers support openmp" can_enable_openmp=1 case "$cxx_option_save" in SGI*) CXXFLAGS="$CXXFLAGS -mp" ;; xlC*) CXXFLAGS="$CXXFLAGS -qsmp=omp" ;; icc|ecc) CXXFLAGS="$CXXFLAGS -openmp" ;; *) can_enable_openmp=0 AC_MSG_WARN([The compilers do not support openmp. Disable it.]) ;; esac if test $can_enable_openmp -eq 1; then AC_DEFINE([ENABLE_OPENMP], 1, [Enable OpenMP parallelization.]) fi fi ], enable_openmp=no) #AM_CONDITIONAL(NEEDTOBUILD_OOMPI,test $build_oompi -eq 1) # Check if the script was called with --enable-optimize # AC_ARG_ENABLE(optimize, AC_HELP_STRING([--enable-optimize],[enable compiler optimization flags (default=yes)]), [ if test x$enableval != no; then echo "Optimization flags enabled" CXXFLAGS="$CXXFLAGS $CXX_OPTIMIZE_FLAGS" FFLAGS="$F77_OPTIMIZE_FLAGS $FFLAGS" fi ], []) # --enable-debug, and if so modify the compilation flags. AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable compiler debug flags (default=no)]), [if test x"$enableval" = xyes; then echo "Debugging flags enabled" CXXFLAGS="$CXXFLAGS $CXX_DEBUG_FLAGS" FFLAGS="$F77_DEBUG_FLAGS $FFLAGS" fi], []) #add fortran-related libraries to CXXFLAGS CXXFLAGS="$CXXFLAGS $CXXFFLAGS" if test "$cxx_native_compiler" = "false"; then AC_MSG_WARN([The compilers may need to include /usr/local/include.]) # CXXFLAGS="$CXXFLAGS -I/usr/local/include" fi echo "" echo "CXX = $CXX" echo "CXXFLAGS = $CXXFLAGS" echo "CXX_OPTIMIZE_FLAGS = $CXX_OPTIMIZE_FLAGS" echo "CXX_DEBUG_FLAGS = $CXX_DEBUG_FLAGS" echo "F77 = $F77" echo "F77_OPTIMIZE_FLAGS = $F77_OPTIMIZE_FLAGS" echo "F90 = $F90" echo "F90_OPTIMIZE_FLAGS = $F90_OPTIMIZE_FLAGS" echo "FLIBS = $FLIBS" echo "" echo ".... Compiler options are set. Checking application-level options." echo "" ############################################## # end # imported from blitz configure.in ############################################## # basic macros defining the problem: physical dimension, block size, cache size etc AC_ARG_ENABLE(dimension, AC_HELP_STRING([--enable-dimension],[set the physical dimension (default=3)]), [ if test x$enableval = x; then $enableval=3 fi AC_DEFINE_UNQUOTED(OHMMS_DIM,${enableval}) ], [ AC_DEFINE([OHMMS_DIM], 3, [Define the physical dimension of appliation.]) ]) AC_DEFINE([OHMMS_INDEXTYPE], int, [Define integer for the index type.]) AC_ARG_WITH(precision, AC_HELP_STRING([--with-precision=single|double], [Define precision for real type (default double).]), [ if test x$withval = x"single"; then AC_DEFINE([OHMMS_PRECISION], float, [Define precision for the real type.]) else AC_DEFINE([OHMMS_PRECISION], double, [Define precision for the real type.]) fi ], [ AC_DEFINE([OHMMS_PRECISION], double, [Define double-precision double for the real type.]) ]) AC_ARG_WITH(app, AC_HELP_STRING([--with-app=MolecuApps|QDApps], [Define the main application (default MolecuApps).]), [ if test x"$withval" = x"QDApps"; then qmcapp=$withval fi ], [ AC_MSG_WARN([Using MolecuApps.]) ]) AM_CONDITIONAL(USE_QDAPPS, test "$qmcapp" = "QDApps") AM_CONDITIONAL(USE_MOLECUAPPS, test "$qmcapp" = "MolecuApps") # #check libxml2, if the package is not found, die # AC_PATH_GENERIC(xml2, 2.3.0, [AC_DEFINE([HAVE_LIBXML2], 1, [Define to 1 if you have libxml2])], [AC_MSG_ERROR([You need libxml2 version 2.3.0 or above], 1)]) echo "return value of ac_path_generic $XML2_CFLAGS" CXXFLAGS="$CXXFLAGS $XML2_CFLAGS" # check hdf5 library is available. #AC_caolan_CHECK_PACKAGE(hdf5,H5Fopen,hdf5,hdf5.h, # [AC_DEFINE([HAVE_PKG_hdf5], 1, [Define to 1 if you have hdf5])], # []) ACX_HDF5([], [AC_MSG_WARN([Could not find hdf5. Disabled.])]) #use config/acx_sprng.m4 file ACX_SPRNG([], [AC_MSG_WARN([Could not find sprng. Disabled.])]) ACX_BLITZ([], [AC_MSG_WARN([Could not find blitz. Disabled.])]) #CXXFLAGS="$CXXFLAGS $CFLAGS" ################################################################## # create a header file to define enabled features: # potentials, propagators, and applications ################################################################## AC_OUTPUT_COMMANDS([ outfile=src/QMC/main.cpp tmpfile=${outfile} dirname="sed s,^.*/,,g" echo creating $outfile cat > $tmpfile << _EOF_ #include "Utilities/OhmmsInfo.h" #include "QMC/${qmcapp}.h" /**file main.cpp *@brief a main function for QMC simulation. *Actual works are done by QMCApps and its derived classe. *For other simulations, one can derive a class from QMCApps, similarly to Molec uApps. * *Only requirements are the constructor and init function to initialize. */ int main(int argc, char **argv) { OhmmsInfo welcome(argc,argv); ohmmsqmc::${qmcapp} qmc(argc,argv); if(argc>1) { // build an XML tree from a the file; xmlDocPtr m_doc = xmlParseFile(argv[1]); if (m_doc == NULL) { ERRORMSG("File " << argv[1] << " is invalid") xmlFreeDoc(m_doc); return 1; } // Check the document is of the right kind xmlNodePtr cur = xmlDocGetRootElement(m_doc); if (cur == NULL) { ERRORMSG("Empty document"); xmlFreeDoc(m_doc); return 1; } qmc.run(cur); } else { WARNMSG("No argument is given. Assume that ${qmcapp} does not need an input file") qmc.run(NULL); } LOGMSG("Bye") return 0; } _EOF_ ], [ qmcapp=${qmcapp} ]) LIBS="$XML2_LIBS $HDF5_LIBS $LAPACK_LIBS $BLAS_LIBS $SPRNG_LIBS $FLIBS $LIBS" QMCBASE_LIBS="-L\$(top_builddir)/src -lqmcbase" AC_SUBST(QMCBASE_LIBS) AC_OUTPUT([Makefile src/Makefile src/QMC/Makefile ])