This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Support finding pybind11 from the python environment.
ClosedPublic

Authored by stellaraccident on Nov 20 2020, 6:05 PM.

Details

Summary
  • Makes pip install pybind11 do the right thing with no further config.
  • Since we now require a version of pybind11 greater than many LTS OS installs (>=2.6), a more convenient way to get a recent version is preferable.
  • Also adds the version spec to find_package so it will skip older versions that may be lying around.
  • Tested the full matrix of old system install, no system install, pip install and no pip install.

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Nov 20 2020, 6:05 PM
mehdi_amini accepted this revision.Nov 20 2020, 9:46 PM
This revision is now accepted and ready to land.Nov 20 2020, 9:46 PM

I'm wondering can we use the MLIRDetectPythonEnv.cmake or names like this (detect all the required Python environments), instead of MLIRDetectPybind11.cmake (only responsible for checking pybind11). In this case, we can define all the detecting functions (like mlir_detect_numpy_install) in one cmake file to avoid fragmentation.

Address comments and rebase

I'm wondering can we use the MLIRDetectPythonEnv.cmake or names like this (detect all the required Python environments), instead of MLIRDetectPybind11.cmake (only responsible for checking pybind11). In this case, we can define all the detecting functions (like mlir_detect_numpy_install) in one cmake file to avoid fragmentation.

Good idea. Done.

This revision was landed with ongoing or failed builds.Nov 22 2020, 12:56 PM
This revision was automatically updated to reflect the committed changes.