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
{{ message }}
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -78,9 +78,47 @@ In general, PI is very alpha; to get a rough idea of the current status check th
78
78
79
79
Currently, we're passing ~650 out of 786 of Torch-MLIR's test-suite (`torch-mlir==20230127.731`).
80
80
81
-
# Build Wheel
81
+
# Development
82
+
83
+
Spin up a venv (or conda environment) with `pip install -r requirements.txt ` and configure CMake with
84
+
85
+
```shell
86
+
cmake \
87
+
-DCMAKE_INSTALL_PREFIX=$PI_SRC_DIR/pi \
88
+
-DPython3_EXECUTABLE=$(which python) \
89
+
-S $PI_SRC_DIR \
90
+
-B $PI_BUILD_DIR
91
+
```
92
+
93
+
where `$PI_SRC_DIR` is the path to the checkout of this repo and `$PI_BUILD_DIR` is where you want to build into. Then
94
+
95
+
```shell
96
+
cmake --build $PI_BUILD_DIR --target install
97
+
```
98
+
99
+
which will install `_mlir_libs`, `dialects`, and `runtime` underneath `$PI_SRC_DIR/mlir`.
100
+
Then add `$PI_SRC_DIR` to your `PYTHONPATH` and you're good to go. E.g.,
101
+
102
+
```shell
103
+
PYTHONPATH=$PI_SRC_DIR pytest ../tests/unit/*
104
+
```
105
+
106
+
**Why build the `install` target?** Because you can't do a `pip install . -e` (editable install) because of the pybind/C-extension so this is the next best thing.
107
+
108
+
Note, if you're using CLion and you're getting something like
109
+
110
+
```shell
111
+
Process finished with exit code 127
112
+
```
113
+
114
+
you need to disable `Add content roots to PYTHONPATH` and `Add source roots to PYTHONPATH`[in Run/Debug Configurations](https://stackoverflow.com/a/48471173).
0 commit comments