Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CMake configuration for external projects #1549

Open
burmako opened this issue May 28, 2023 · 0 comments
Open

Add a CMake configuration for external projects #1549

burmako opened this issue May 28, 2023 · 0 comments
Assignees
Labels

Comments

@burmako
Copy link
Contributor

burmako commented May 28, 2023

Right now, StableHLO is oftentimes depended on through MLIR-HLO, but given the plans to sunset the MLIR-HLO repository, we need to tighten our story in this area.

Direct dependencies on the StableHLO repository already work through Bazel (e.g. this is how XLA depends on StableHLO), but CMake support is currently missing. We would need to implement something along the lines of what MLIR-HLO does - this doesn't appear to be particularly hard.

@burmako burmako added the Build label May 28, 2023
@burmako burmako self-assigned this May 28, 2023
burmako pushed a commit that referenced this issue Jun 13, 2023
This applies when stablehlo is built by other projects enabled as an
external llvm project.

This change makes it match the mlir-hlo configuration more closely:

https://github.com/tensorflow/mlir-hlo/blob/51ce2fa22bc9acff37332ad02ef39412f21ffc98/CMakeLists.txt#L113-L130,
and ease the transition from mlir-hlo to stablehlo:
https://discourse.llvm.org/t/sunsetting-the-mlir-hlo-repository/70536.

Tested by embedding stablehlo into IREE.

Issue: #1549
burmako pushed a commit that referenced this issue Jun 23, 2023
To follow up on #1612, this PR further aligns StableHLO and MLIR-HLO
builds to facilitate the transition from mlir-hlo to stablehlo.

Changes in this PR:
  1) Adds Ccache support.
  2) Adds support for LLVM_ENABLE_ZLIB.
  3) Removes STABLEHLO_STANDALONE_BUILD, to better align with MLIR-HLO
     terminology.

Deltas between CMakeLists.txt in this PR and CMakeLists.txt in MLIR-HLO:
  a) Says "StableHLO" instead of "MHLO".
  b) Supports STABLEHLO_ENABLE_STRICT_BUILD (there is no equivalent
     in the MLIR-HLO build).
  c) Doesn't support ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules yet,
     as well as some MLIR_HLO_FOO_DIR variables needed for that.
     (We have #1549 to follow up on this).
@burmako burmako assigned GleasonK and unassigned burmako Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants