However, the tools/mlir/python_packages/mlir_core/ directory is not present in my build, and when I run with python bindings enabled I’m given an error saying that the cmake option is ignored. How do I enable the python bindings when the cmake is being ignored? Do I have to add the cmake variables at the top elsewehere? I’m trying to use the MLIR python bindings and I’m at a bit of a loss, any help would be greatly appreciated.
MLIR_BINDINGS_PYTHON_ENABLED was renamed MLIR_ENABLE_BINDINGS_PYTHON about two months ago as part of a cleanup to make all these variable names consistent (using the imperative form). Those instructions would need an update.
I’m on mobile for a few days and can’t check. Can I suggest just doing a global “ninja install” for the moment. There is a discrete target for just installing this part but I can’t remember it off hand. Also, we still need to add a setup.py to the upstream project (similar to the one in mlir-npcomp). I haven’t done so because of the additional work to enable a CI for it, etc.
For upstream MLIR, if you install with python bindings enabled, the resultant python_packages/mlir_core is a standalone python package that you can copy to site-packages, etc.
We don’t (yet) distribute the bindings for the core project and are missing setup.py, which would make this more canonical. Downstreams have been working that out and when it stabilizes, we should do the same upsteam.