-
Notifications
You must be signed in to change notification settings - Fork 9
Compiling
Ambit requires a C++11 capable compiler. Other requirements include:
- Boost 1.55+
- CMake 3
- Python 2.6+, if compiling the Python interface, additionally require Boost.Python.
If compiling the distributed backend the following are necessary:
To install Boost on Mac using Homebrew type
% brew install boost --c++11
Boost.Python is provided by a different Homebrew recipe:
% brew install boost-python --c++11
To install CMake on Mac using Homebrew type
% brew install cmake
Clone the Cyclops repository:
% git clone https://github.com/solomonik/ctf.git
Change into the ctf directory and copy one of the templates from the mkfiles directory.
% cd ctf
% cp mkfiles/config.mk.linux config.mk
If needed, edit the config.mk file to fit your system. You may need to modify the math library variables to match your system. Lastly, compile Cyclop.
% make
Clone the Elemental repository:
% git clone --recursive https://github.com/elemental/Elemental.git
Using CMake, configure Elemental for compilation. Elemental defaults to creating shared libraries at this time we require static libraries (BUILD_SHARED_LIBS=OFF). For testing purposes, set CMAKE_BUILD_TYPE=PureDebug. Also, ensure the MPI compilers can be found in your path.
% cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=PureDebug
Once successfully configured compile:
% make
Use the setup script found in the top source directory of ambit. For compiling a simple serial, debug version of the library use:
% setup --type=debug
For a release version using the Intel compilers including vectorization:
% setup --cc=icc --cxx=icpc --type=release --vectorization
For a debug version with the Cyclops distributed backend and LAPACK functionality from Elemental:
% setup --type=debug --mpi --cyclops=/Users/jturney/Build/ctf --elemental=/Users/jturney/Build/elemental/pure_debug
The MPI compiler (mpicxx) is expected to be found in your path. It is assumed that the path given to the --cyclops option there is a lib directory with libctf.a and an include directory with ctf.hpp. Likewise, for the path given for --elemental there exists libEl.a and an include directory with El.h and El.hpp. The locations for Cyclops and Elemental given in the example above are specific to my computer.
Upon successful setup, simply call make:
% make