commit | 896d3aaff47dea328a0fc70d84686998b4d8613e | [log] [tgz] |
---|---|---|
author | Valentin Churavy <v.churavy@gmail.com> | Sat Feb 08 19:27:54 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Sep 02 16:37:59 2020 -0700 |
tree | d07872c0f31b323034a0ad55d56d70c92e294e6b | |
parent | cc9283b4376ab32756b2d27f1382c1b041eeacbe [diff] |
[MLIR] Add support for libMLIR.so Putting this up mainly for discussion on how this should be done. I am interested in MLIR from the Julia side and we currently have a strong preference to dynamically linking against the LLVM shared library, and would like to have a MLIR shared library. This patch adds a new cmake function add_mlir_library() which accumulates a list of targets to be compiled into libMLIR.so. Note that not all libraries make sense to be compiled into libMLIR.so. In particular, we want to avoid libraries which primarily exist to support certain tools (such as mlir-opt and mlir-cpu-runner). Note that the resulting libMLIR.so depends on LLVM, but does not contain any LLVM components. As a result, it is necessary to link with libLLVM.so to avoid linkage errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken because mlir-tblgen is linked against libLLVM.so and and independent LLVM components (updated by Stephen Neuendorffer) Differential Revision: https://reviews.llvm.org/D73130 GitOrigin-RevId: 1246e867164b06fc3f0de6bfaaa0922d99cb5ce9
See https://mlir.llvm.org/ for more information.