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
1. **If you want the more straightforward option**, run the "in-tree" setup:
100
+
101
+
```shell
102
+
cmake -GNinja -Bbuild \
103
+
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
104
+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
105
+
-DLLVM_ENABLE_ASSERTIONS=ON \
106
+
-DPython3_FIND_VIRTUALENV=ONLY \
107
+
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
108
+
-DLLVM_TARGETS_TO_BUILD=host \
109
+
`# For building LLVM "in-tree"` \
110
+
externals/llvm-project/llvm \
111
+
-DLLVM_ENABLE_PROJECTS=mlir \
112
+
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
113
+
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD"
114
+
```
115
+
116
+
- NOTE: uses external/llvm-project/llvm as the main build, so LLVM will be built in addition to torch-mlir and its sub-projects.
117
+
1. **If you want to use a separate build of LLVM from another directory**, run the "out-of-tree" setup:
118
+
119
+
```shell
120
+
cmake -GNinja -Bbuild \
121
+
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
122
+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
123
+
-DLLVM_ENABLE_ASSERTIONS=ON \
124
+
-DPython3_FIND_VIRTUALENV=ONLY \
125
+
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
126
+
-DLLVM_TARGETS_TO_BUILD=host \
127
+
`# For building LLVM "out-of-tree"` \
128
+
-DMLIR_DIR="$LLVM_INSTALL_DIR/lib/cmake/mlir/" \
129
+
-DLLVM_DIR="$LLVM_INSTALL_DIR/lib/cmake/llvm/"
130
+
```
131
+
132
+
- Be sure to have built LLVM with `-DLLVM_ENABLE_PROJECTS=mlir`.
133
+
- Be aware that the installed version of LLVM needs in general to match the committed version in`externals/llvm-project`. Using a different version may or may not work.
1. **If you anticipate needing to frequently rebuild LLVM**, leverage quicker builds by appending:
99
137
100
-
###### If you want the more straightforward option
101
-
102
-
Run the "in-tree" setup:
103
-
104
-
```shell
105
-
cmake -GNinja -Bbuild \
106
-
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
107
-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
108
-
-DLLVM_ENABLE_ASSERTIONS=ON \
109
-
-DPython3_FIND_VIRTUALENV=ONLY \
110
-
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
111
-
-DLLVM_TARGETS_TO_BUILD=host \
112
-
`# For building LLVM "in-tree"` \
113
-
externals/llvm-project/llvm \
114
-
-DLLVM_ENABLE_PROJECTS=mlir \
115
-
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
116
-
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$PWD"
117
-
```
118
-
119
-
- NOTE: uses external/llvm-project/llvm as the main build, so LLVM will be built in addition to torch-mlir and its sub-projects.
120
-
121
-
###### If you want to use a separate build of LLVM from another directory
122
-
123
-
Run the "out-of-tree" setup:
124
-
125
-
```shell
126
-
cmake -GNinja -Bbuild \
127
-
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
128
-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
129
-
-DLLVM_ENABLE_ASSERTIONS=ON \
130
-
-DPython3_FIND_VIRTUALENV=ONLY \
131
-
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
132
-
-DLLVM_TARGETS_TO_BUILD=host \
133
-
`# For building LLVM "out-of-tree"` \
134
-
-DMLIR_DIR="$LLVM_INSTALL_DIR/lib/cmake/mlir/" \
135
-
-DLLVM_DIR="$LLVM_INSTALL_DIR/lib/cmake/llvm/"
136
-
.
137
-
```
138
-
139
-
- Be sure to have built LLVM with `-DLLVM_ENABLE_PROJECTS=mlir`.
140
-
- Be aware that the installed version of LLVM needs in general to match the committed version in `externals/llvm-project`. Using a different version may or may not work.
0 commit comments