[Mlir-commits] [mlir] build multi python bindings for mlir (PR #177143)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jan 25 16:44:16 PST 2026


zhouronghua wrote:

> Hey could you share your goals? My understanding is that this is only for the convenience of individual development, am I right? (suspecting this though.) If it’s intended for a release for multiple python versions, it seems we don’t need to do it this way. (You can check [how eudsl did this](https://github.com/llvm/eudsl/tree/main/projects/mlir-python-bindings).)

A typical scenario is that a software company building on MLIR needs to release multiple versions of Python wheel packages, but it does not want to recompile MLIR multiple times for each required Python version when compiling the software. If the MLIR source code remains unchanged, it can be compiled once to generate a prebuilt tar package compatible with multiple Python versions. Then, during release or linking of the software, it only needs to link against these LLVM static libraries and include the corresponding MLIR dynamic library for the packaged Python version.

In other words, before this modification, if a software needed to support Python 3.9/3.10/3.11/3.12/..., it had to compile at least 5+ different LLVM tar packages—one for each Python version—to complete the release. After the modification, it only needs to configure the required Python versions, compile the LLVM package once, and obtain MLIR dynamic libraries for all those Python versions.


https://github.com/llvm/llvm-project/pull/177143


More information about the Mlir-commits mailing list