Installation¶
This section provide guidelines for installing XACC and its TPLs.
Pre-Requisites¶
The following software is required before building XACC:
Packages |
Dependency |
Version |
|---|---|---|
C++11 Compiler |
Required |
See below |
OpenSSL |
Required |
1.0 |
CMake |
Required |
3.2+ |
Note that you must have a C++11 compliant compiler. If you prefer gcc/g++,
it is recommended that you use at least version 5.0 and up. Using [4.8,5) will
cause XACC to skip building and installing Antlr, which is required for most XACC
Compiler extensions.
The other dependencies are relatively easy to install on various operating systems. Any of the following commands will work for Mac, Fedora/RedHat/CentOS, or Ubuntu:
$ (macosx) brew/port install cmake openssl
$ (fedora) dnf install cmake openssl-devel
$ (ubuntu) apt-get install cmake libssl-dev
Building XACC¶
Clone the XACC repository:
$ git clone --recursive https://github.com/eclipse/xacc
Note you must pass the --recursive flag. If you don’t you must run
git submodule update --init --recursive.
XACC requires CMake 3.2+. Run the following to configure and build XACC:
$ cd xacc && mkdir build && cd build
$ cmake ..
$ make install
This will build and install XACC to $HOME/.xacc by default. If you would
like to install XACC somewhere else, replace the above cmake command with the following
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/local/install
You can also build XACC with Python support:
$ export PY_INC_DIR=$(python -c "import sysconfig; print(sysconfig.get_paths()['platinclude'])")
$ cmake .. -DPYTHON_INCLUDE_DIR=$PY_INC_DIR
$ make install
To build with tests
$ cmake .. -DXACC_BUILD_TESTS=TRUE
$ make install
$ ctest