Go to file
Mark Berrill 7cac7a99c3 Modifying CUDA flags so they pick up debug/optimized flags based on the build type
git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@6648 e5b18d87-469d-4833-9cc0-8cdfa06e9491
2015-12-18 16:56:57 +00:00
CMake Remove hardwired -O3. Will be set by build type. Suggestion from Ye Luo 2015-12-15 21:59:50 +00:00
config Moving old toolchains to attic directory. Only leaving updated BG files. Bring back and update files as needed, but prefer to improve CMake scripts. 2015-12-17 19:35:55 +00:00
docs Note on Yosemite and Accelerate framework instead of Veclib 2014-11-06 12:55:23 +00:00
examples Partial move of tests: 2015-08-17 19:51:53 +00:00
external_codes/quantum_espresso Autodownload and patch script for QE 5.2.1 and pw2qmcpack. Minor update due to changed calls to ESM code in read_file_lite (unused but needed to link). 2015-10-12 21:16:10 +00:00
manual git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@6617 e5b18d87-469d-4833-9cc0-8cdfa06e9491 2015-11-11 19:44:21 +00:00
nexus nexus: fix obsolete call to add_attributes 2015-11-23 22:11:00 +00:00
schema XML renderin of ESHDF format. 2011-05-02 21:14:36 +00:00
src git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@6647 e5b18d87-469d-4833-9cc0-8cdfa06e9491 2015-12-17 19:49:11 +00:00
tests Note to help testers 2015-12-16 16:22:35 +00:00
utils add a helper script to run ctest on BGQ 2015-12-17 05:41:27 +00:00
CMakeLists.txt Modifying CUDA flags so they pick up debug/optimized flags based on the build type 2015-12-18 16:56:57 +00:00
LICENSE Change qmcplusplus to qmcpack. 2006-11-23 23:27:22 +00:00
README Modifying CUDA flags so they pick up debug/optimized flags based on the build type 2015-12-18 16:56:57 +00:00
build.sh In case anyone actually runs the build script without reading further 2015-12-16 16:45:07 +00:00
configure URL fix 2014-10-28 22:02:09 +00:00
qmcpack.settings Create bin/qmcpack.settings to record the build settings, e.g., compiler flags, system info etc. 2013-12-17 20:00:01 +00:00

README

h1. Getting and building QMCPACK

Obtain the latest release or development copy from http://www.qmcpack.org

h2. Prerequisite 

* C/C++ compilers
* cmake, build utility, http://www.cmake.org
* blas/lapack, numerical library, use platform-optimized libraries
* libxml2, XML parser, http://xmlsoft.org/ 
* hdf5, portable I/O library, http://www.hdfgroup.org/HDF5/
* boost, peer-reviewed portable C++ source libraries, http://www.boost.org
* fftw, FFT library, http://www.fftw.org/

Note that the einspline library is no longer required.

h3. Building with cmake

The build system for qmcpack is based on CMake.  It will autoconfigure
based on the detected compilers and libraries. Previously QMCPACK made
extensive use of toolchains, but the system has since been updated to
eliminate the use of toolchain files for most cases.  The build
system works with GNU, Intel, and IBM XLC compilers.  Specific compile options
can be specified either through specific environmental or CMake
variables.  When the libraries are installed in standard locations,
e.g., /usr, /usr/local, there is no need to set environmental or cmake
variables for the packages.

See http://docs.qmcpack.org for build examples on Linux, Mac OS X etc.


h3.1. Set the environment

A number of enviornmental variables affect the build.  In particular
they can control the default paths for libraries, the default
compilers, etc.  The list of enviornmental variables is given below:

   CXX              C++ compiler
   CC               C Compiler
   MKL_HOME         Path for MKL
   LIBXML2_HOME     Path for libxml2
   HDF5_ROOT        Path for HDF5
   BOOST_ROOT       Path for Boost
   FFTW_HOME        Path for FFTW


h3.2. CMake options

In addition to reading the enviornmental variables, CMake provides a number of optional variables
that can be set to control the build and configure steps.  When passed to CMake, these variables
will take precident over the enviornmental and default variables.  To set them add -D FLAG=VALUE
to the configure line between the cmake command and the path to the source directory.

  * General build options
    CMAKE_BUILD_TYPE    A variable which controls the type of build (defaults to Release).  Possible values are:
                        None (Do not set debug/optmize flags, use CMAKE_C_FLAGS or CMAKE_CXX_FLAGS)
                        Debug (create a debug build)
                        Release (create a release/optimized build)
                        RelWithDebInfo (create a release/optimized build with debug info)
                        MinSizeRel (create an executable optimized for size)
    CMAKE_C_COMPILER    Set the C compiler
    CMAKE_CXX_COMPILER  Set the C++ compiler
    CMAKE_C_FLAGS       Set the C flags.  Also supported: CMAKE_C_FLAGS_DEBUG, CMAKE_C_FLAGS_RELEASE, CMAKE_C_FLAGS_RELWITHDEBINFO
    CMAKE_CXX_FLAGS     Set the C++ flags.  Also supported: CMAKE_CXX_FLAGS_DEBUG, CMAKE_CXX_FLAGS_RELEASE, CMAKE_CXX_FLAGS_RELWITHDEBINFO

  * QMC build options
    QMC_DATA            Specify data directory for QMCPACK (used for unit tests)
    QMC_EXTRA_LIBS      Add extra link libraries
    QMC_BUILD_STATIC    Add -static flags to build
    QMC_CUDA            Enable CUDA (1:yes, 0:no)

  * libxml
    Libxml2_INCLUDE_DIRS  Specify include directories for libxml2
    Libxml2_LIBRARY_DIRS  Specify library directories for libxml2

  * FFTW
    FFTW_INCLUDE_DIRS   Specify include directories for FFTW
    FFTW_LIBRARY_DIRS   Specify library directories for FFTW


h3.3. Configure and build

* Move to build directory, run cmake and make

   cd build
   cmake ..
   make -j 8


h3.4. Example configure and build

* Set the environments (the examples below assume bash, Intel compilers and MKL library)

  export CXX=icpc
  export CC=icc
  export MKL_HOME=/usr/local/intel/mkl/10.0.3.020
  export LIBXML2_HOME=/usr/local
  export HDF5_ROOT=/usr/local
  export BOOST_ROOT=/usr/local/boost
  export FFTW_HOME=/usr/local/fftw

* Move to build directory, run cmake and make

  cd build
  cmake -D CMAKE_BUILD_TYPE=Release ..
  make -j 8


h3.5.  Special notes

It is common to create a helper script that contains the configure line for CMake.  
This is particularly useful when avoiding enviornmental variables, packages are installed
in custom locations, or the configure line may be long or complex.  In this case it is
recommended to add "rm -rf CMake*" before the configure line to remove existing CMake
configure files to ensure a fresh configure each time that the script is called.  
and example script is given below:

   export CXX=mpic++
   export CC=mpicc
   export ACML_HOME=/opt/acml-5.3.1/gfortran64
   export HDF5_ROOT=/opt/hdf5
   export BOOST_ROOT=/opt/boost

   rm -rf CMake*

   cmake                                                \
      -D CMAKE_BUILD_TYPE="Debug"                       \
      -D Libxml2_INCLUDE_DIRS=/usr/include/libxml2      \
      -D Libxml2_LIBRARY_DIRS=/usr/lib/x86_64-linux-gnu \
      -D FFTW_INCLUDE_DIRS=/usr/include                 \
      -D FFTW_LIBRARY_DIRS=/usr/lib/x86_64-linux-gnu    \
      -D QMC_EXTRA_LIBS="-ldl ${ACML_HOME}/lib/libacml.a -lgfortran" \
      -D QMC_DATA=/projects/QMCPACK/qmc-data            \
      ..



For more informaton, consult QMCPACK pages at http://www.qmcpack.org and http://docs.qmcpack.org