This is an archive of the discontinued LLVM Phabricator instance.

Always link the MLIR python bindings native extension to libMLIR.so
ClosedPublic

Authored by mehdi_amini on Nov 4 2020, 7:09 PM.

Details

Summary

The Python bindings now require -DLLVM_BUILD_LLVM_DYLIB=ON to build.
This change is needed to be able to build multiple Python native
extension without having each of them embedding a copy of MLIR, which
would make them incompatible with each other. Instead they should all
link to the same copy of MLIR.

Diff Detail

Event Timeline

mehdi_amini created this revision.Nov 4 2020, 7:09 PM
mehdi_amini requested review of this revision.Nov 4 2020, 7:09 PM

Lgtm. Also see https://reviews.llvm.org/D90824 where I am trying a different approach. It is easy enough to change as we go forward, so let's land this and keep discussing.

mlir/lib/Bindings/Python/CMakeLists.txt
108–113

Maybe just take this out and put it in the target_link_libraries below?

stellaraccident accepted this revision.Nov 4 2020, 10:45 PM
This revision is now accepted and ready to land.Nov 4 2020, 10:45 PM
mehdi_amini added inline comments.Nov 5 2020, 11:53 AM
mlir/lib/Bindings/Python/CMakeLists.txt
108–113

It is all gone in the next revision :)