You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/pecos-engines/QIR_RUNTIME.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,32 @@
2
2
3
3
The QIR (Quantum Intermediate Representation) compiler in PECOS uses a Rust runtime library to implement quantum operations. This library is automatically built by the `build.rs` script in the `pecos-engines` crate.
4
4
5
+
## Requirements
6
+
7
+
To use QIR functionality, you need:
8
+
9
+
-**LLVM version 14 specifically**:
10
+
- On Linux: Install using your package manager (e.g., `sudo apt install llvm-14`)
11
+
- On macOS: Install using Homebrew (`brew install llvm@14`)
12
+
- On Windows: Download and install LLVM 14.x from the [LLVM website](https://releases.llvm.org/download.html#14.0.0)
13
+
14
+
-**Required tools**:
15
+
- Linux/macOS: The `llc` compiler tool must be in your PATH
16
+
- Windows: The `clang` compiler must be in your PATH
17
+
18
+
**Note**: PECOS requires LLVM version 14.x specifically, not newer versions. LLVM 15 or later versions are not compatible with PECOS's QIR implementation.
19
+
20
+
If LLVM 14 is not installed or the required tools aren't found, QIR functionality will be disabled but the rest of PECOS will continue to work normally.
21
+
5
22
## How It Works
6
23
7
24
The `build.rs` script:
8
25
9
26
1. Runs automatically when building the `pecos-engines` crate
10
-
2. Checks if the QIR runtime library needs to be rebuilt
11
-
3. Builds the library only if necessary (if source files have changed)
12
-
4. Places the built library in both `target/debug` and `target/release` directories
27
+
2. Checks for LLVM 14+ dependencies
28
+
3. Checks if the QIR runtime library needs to be rebuilt
29
+
4. Builds the library only if necessary (if source files have changed)
30
+
5. Places the built library in both `target/debug` and `target/release` directories
13
31
14
32
When the QIR compiler runs, it looks for the pre-built library in these locations. If the library is not found, the compiler will attempt to build it by running `cargo build -p pecos-engines` before raising an error.
0 commit comments