diff options
author | Stella Laurenzo <stellaraccident@gmail.com> | 2021-11-11 17:31:39 -0800 |
---|---|---|
committer | Stella Laurenzo <stellaraccident@gmail.com> | 2021-11-11 18:04:31 -0800 |
commit | c7be8b75399c727ec9e1ddc3f81510f284c65155 (patch) | |
tree | e456cbb8fef630ece052e978e8fc474c778f553c /mlir/test/Examples | |
parent | e1d6f29a1e640e267e1d2b94d0d761e1d15e99bd (diff) | |
download | llvm-c7be8b75399c727ec9e1ddc3f81510f284c65155.zip llvm-c7be8b75399c727ec9e1ddc3f81510f284c65155.tar.gz llvm-c7be8b75399c727ec9e1ddc3f81510f284c65155.tar.bz2 |
[mlir] Allow out-of-tree python building from installed MLIR.
* Depends on D111504, which provides the boilerplate for building aggregate shared libraries from installed MLIR.
* Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled).
* Rips out remnants of custom extension building in favor of `pybind11_add_module` which does the right thing.
* Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API.
* Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan).
* Adds a ROOT_DIR argument to `declare_mlir_python_extension` since now all C++ sources for an extension must be under the same directory (to line up at install time).
* Need to validate against a downstream or two and adjust, prior to submitting.
Downstreams will need to adapt by:
* Remove absolute paths from any SOURCES for `declare_mlir_python_extension` (I believe all downstreams are just using `${CMAKE_CURRENT_SOURCE_DIR}` here, which can just be ommitted). May need to set `ROOT_DIR` if not relative to the current source directory.
* To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for `declare_mlir_python_extension`.
Reviewed By: stephenneuendorffer, mikeurbach
Differential Revision: https://reviews.llvm.org/D111513
Diffstat (limited to 'mlir/test/Examples')
-rw-r--r-- | mlir/test/Examples/standalone/test.toy | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy index 2e5c4cd..02385f2 100644 --- a/mlir/test/Examples/standalone/test.toy +++ b/mlir/test/Examples/standalone/test.toy @@ -1,4 +1,6 @@ # RUN: %cmake %mlir_src_root/examples/standalone -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir ; %cmake --build . --target check-standalone | tee %t | FileCheck %s -# CHECK: Passed: 4 +# Note: The number of checked tests is not important. The command will fail +# if any fail. +# CHECK: Passed # UNSUPPORTED: windows, android |