Skip to content

Commit 0607ad0

Browse files
committed
Code format
1 parent 86efb97 commit 0607ad0

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

INSTALL.md

+43-16
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@ Quartz can be built from source code using the following instructions.
77
### Prerequisites
88

99
* `apt install build-essential` (Linux/Unix)
10-
* CMAKE 3.16 or higher: `apt install cmake` (Linux/Unix) or `brew install cmake` (MacOS) or https://cmake.org/download/ (Windows)
10+
* CMAKE 3.16 or higher: `apt install cmake` (Linux/Unix) or `brew install cmake` (MacOS)
11+
or https://cmake.org/download/ (Windows)
1112
* conda:
12-
* MacOS:
13-
```
14-
brew install anaconda
15-
/opt/homebrew/anaconda3/bin/conda init zsh # Please use your shell name and the directory you installed Anaconda
16-
```
17-
* Other OS: Follow the instructions on https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
13+
* MacOS:
14+
```
15+
brew install anaconda
16+
/opt/homebrew/anaconda3/bin/conda init zsh # Please use your shell name and the directory you installed Anaconda
17+
```
18+
* Other OS: Follow the instructions on https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
1819
* Cython 3.0 or higher (We will install it with Python later by `conda`)
1920
* OpenMP (We will install it later by `conda` or Homebrew)
2021
2122
#### Additional Prerequisites for Windows:
2223
23-
* Microsoft Visual Studio Community 2019 or later (Visual Studio 2022 or later recommended): https://visualstudio.microsoft.com/downloads/
24+
* Microsoft Visual Studio Community 2019 or later (Visual Studio 2022 or later
25+
recommended): https://visualstudio.microsoft.com/downloads/
2426
2527
### Build Quartz Runtime
2628
2729
1. To get started, clone the Quartz source code from GitHub.
30+
2831
```shell
2932
git clone --recursive https://github.com/quantum-compiler/quartz.git
3033
cd quartz
@@ -38,46 +41,54 @@ conda activate quartz
3841
conda install openmp # on MacOS, please run "brew install libomp" instead
3942
```
4043

41-
3. Build the Quartz runtime library (optional with CLion, see [below](INSTALL.md#clion-integration-optional)). This step differs a little bit between Windows and other OS.
44+
3. Build the Quartz runtime library (optional with CLion, see [below](INSTALL.md#clion-integration-optional)). This step
45+
differs a little bit between Windows and other OS.
4246

4347
#### Unix/Linux/MacOS:
48+
4449
```shell
4550
mkdir build
4651
cd build
4752
cmake .. # see notes below
4853
make install
4954
```
5055

51-
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:
56+
Note that line 3 in the example will have the runtime library and include files installed into the default
57+
path `/usr/local/`. To modify the install path, you can set the path explicitly in line 3, for example:
5258

5359
```shell
5460
cmake -D CMAKE_INSTALL_PREFIX:PATH=~/opt/ ..
5561
```
5662

5763
#### Windows:
64+
5865
```batch
5966
mkdir build
6067
cd build
6168
cmake ..
6269
```
70+
6371
Use Visual Studio to open `quartz/build/Quartz.sln`, click Build -> Build Solution (F7).
6472

6573
4. Run Quartz's optimization to see if you installed successfully (optional).
6674

6775
#### Unix/Linux/MacOS:
76+
6877
```shell
6978
cd .. # should be at the root directory of quartz/ now
7079
./build/test_optimize
7180
```
7281

7382
#### Windows:
83+
7484
```batch
7585
cd ..
7686
:: should be at the root directory of quartz/ now
7787
"build/Debug/test_optimize.exe"
7888
```
7989

8090
You should see an output similar to the following on either OS:
91+
8192
```
8293
number of xfers: 130
8394
[barenco_tof_3] Best cost: 58.000000 candidate number: 22 after 0.170 seconds.
@@ -93,11 +104,14 @@ cd ../python
93104
python setup.py build_ext --inplace install
94105
```
95106

96-
Note that if you changed the install directory in step 3, you have to modified `include_dirs` and `library_dirs` in `setup.py`.
107+
Note that if you changed the install directory in step 3, you have to modified `include_dirs` and `library_dirs`
108+
in `setup.py`.
97109

98-
6. To use `quartz` library in python, you should make sure the directory where you install `quartz` runtime library, that is `libquartz_runtime.so`, is in Python's searching directories.
110+
6. To use `quartz` library in python, you should make sure the directory where you install `quartz` runtime library,
111+
that is `libquartz_runtime.so`, is in Python's searching directories.
99112

100113
#### Unix/Linux:
114+
101115
You can add:
102116

103117
```shell
@@ -107,11 +121,14 @@ export LD_LIBRARY_PATH=/your/path/:$LD_LIBRARY_PATH
107121
to `~/.bashrc`.
108122

109123
## CLion Integration (Optional)
124+
110125
### Additional Prerequisites
126+
111127
* CLion: https://www.jetbrains.com/clion/download/
112128
* First 2 steps in [Build Quartz Runtime](INSTALL.md#build-quartz-runtime)
113129

114130
### CLion Settings
131+
115132
- Settings -> Build, Execution, Deployment -> Toolchains -> add "Visual Studio"
116133
- Toolset: select the folder where Visual Studio is installed.
117134
- Architecture: select `amd64`.
@@ -122,23 +139,33 @@ to `~/.bashrc`.
122139
- Settings -> Plugins -> "BlackConnect" -> Install
123140

124141
### Configuration to Run
142+
125143
- `test_optimize | Debug-Visual Studio` -> Edit Configurations... -> Working Directory -> fill in `(path\to\quartz)`
126144
- Click "Run 'test_optimize'" (Shift + F10)
127145

128146
## Visual Studio Integration (Optional) (only for Windows)
147+
129148
### Additional Prerequisites
130-
* Visual Studio: Workloads -> Python Development. You can use Visual Studio Installer to modify an existing Visual Studio installation if the Python Development component was not installed before.
149+
150+
* Visual Studio: Workloads -> Python Development. You can use Visual Studio Installer to modify an existing Visual
151+
Studio installation if the Python Development component was not installed before.
131152
* First 3 steps in [Build Quartz Runtime](INSTALL.md#build-quartz-runtime)
132153

133154
### Configuration to Run
155+
134156
- View -> Solution Explorer
135157
- In Solution Explorer, right click `test_optimize`, click "Set as Startup Project"
136-
- In Solution Explorer, right click `test_optimize`, click "Properties"; in the pop-up window, in "Configuration Properties", click Debugging -> Working Directory -> dropdown menu -> <Browse...> -> select `(path\to\quartz)`
158+
- In Solution Explorer, right click `test_optimize`, click "Properties"; in the pop-up window, in "Configuration
159+
Properties", click Debugging -> Working Directory -> dropdown menu -> <Browse...> -> select `(path\to\quartz)`
137160
- Click "Local Windows Debugger/Start Debugging (F5)" or "Start Without Debugging (Ctrl + F5)"
138161

139162
### Troubleshooting
140-
- If there is a pop-up window saying missing "python311.dll" (name varies with Python version) or "zlib.dll", go to `(path\to\conda)\envs\quartz`, copy the required .dll files to `(path\to\quartz)\build\Debug`.
141-
- For any program (test/benchmark) requiring pybind11, please make sure that the working directory of that program does **not** contain "python311.dll" (name varies with Python version). If you encounter "Debug Error! ... abort() has been called" with Exception 0xe06d7363, this might be the cause.
163+
164+
- If there is a pop-up window saying missing "python311.dll" (name varies with Python version) or "zlib.dll", go
165+
to `(path\to\conda)\envs\quartz`, copy the required .dll files to `(path\to\quartz)\build\Debug`.
166+
- For any program (test/benchmark) requiring pybind11, please make sure that the working directory of that program
167+
does **not** contain "python311.dll" (name varies with Python version). If you encounter "Debug Error! ... abort()
168+
has been called" with Exception 0xe06d7363, this might be the cause.
142169

143170
## Dependencies for the Simulator (Optional)
144171

0 commit comments

Comments
 (0)