Quartz can be built from source code using the following instructions.
apt install build-essential
- CMAKE 3.16 or higher:
apt install cmake
- Cython 3.0 or higher (We will install it with Python later by
conda
)
- To get started, clone the Quartz source code from GitHub.
git clone --recursive https://github.com/quantum-compiler/quartz.git
cd quartz
- Set up the environment (including Python, Cython, OpenMP) by conda.
conda env create --name quartz --file env.yml
conda activate quartz
- Build the Quartz runtime library. The configuration of the Quartz runtime can be modified by
config.cmake
.
mkdir build;
cd build;
cmake .. # see notes below
make install
Note that line 3 in the example will have the runtime library and include files installed into the default path /usr/local/
. To modify the install path, you can set the path explicitly in line 3, for example:
cmake -D CMAKE_INSTALL_PREFIX:PATH=~/opt/ ..
- Install the Quartz python package.
cd ../python
python setup.py build_ext --inplace install
Note that if you changed the install directory in the last step, you have to modified include_dirs
and library_dirs
in setup.py
.
- To use
quartz
library in python, you should make sure the directory where you installquartz
runtime library, that islibquartz_runtime.so
, is in python's searching directories.
You can add:
export LD_LIBRARY_PATH=/your/path/:$LD_LIBRARY_PATH
to ~/.bashrc
.