Hi! I am new to MLIR, I am trying to set up Python bindings as per this guide but I am running into some issues.
In a virtual env, I ran the following in a build folder to configure and build LLVM and MLIR.
► cmake -G Ninja ../llvm \ (tvm-test-env)
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD=all \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DMLIR_INCLUDE_INTEGRATION_TESTS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON
► cmake --build . --target check-mlir
Then I exported the path to mlir_core to the PYTHONPATH, as specified by the guide, and ran ninja install
.
python3 -c "import mlir"
works fine if I run it in the LLVM directory but mlir is not found when running it in any other directory and I can’t import it to a Python file.
If anyone could let me know what I am doing wrong, it would be greatly appreciated. Thanks!