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

Build functioning dev packages for IREECompiler and IREERuntime. #16008

Merged
merged 6 commits into from
Dec 29, 2023

Conversation

stellaraccident
Copy link
Collaborator

With this patch, external projects can do:

find_package(IREECompiler)
find_package(IREERuntime)

and access our targets by adding either the build or install tree lib/cmake/IREE to the CMake package search path.

There are still some ergonomic issues that need to be addressed going forward:

  • cpuinfo breaks the one downstream I am testing this against. We really should just finish killing that, so I am setting -DIREE_ENABLE_CPUINFO=OFF in the dist package.
  • We are not yet re-establishing the pretty iree::runtime:... aliases. The underscore versions are available (iree_runtime_...).
  • I want to further isolate the remaining bundled deps (yaml and flatcc).
  • New convenience install targets do not have full dependency information. Need to do an all build first.

As part of this, I did some longstanding cleanups:

  • Normalized the install component namespace. Defined IREECMakeExports, IREEDevLibraries-Compiler, IREEDevLibraries-Runtime, IREERuntimeLibraries-Compiler, IREEBundledLibraries, IREETools-Runtime.
  • Added convenience iree-install-* targets. Each includes a -stripped variant as well.
  • Moved MLIRInterop.h to the bindings/c directory where it should have been all along and straightened the deps.
  • Install the mlir-c headers to support libIREECompiler.so dev.
  • Added the "busybox" tool binaries to the install distribution (iree-lld, etc).
  • Stopped bundling upstream lld and clang by default because they bloat the size. lld is now bundled as iree-lld just like in the Python packages. Clang and llvm-link can be gotten by installing the new IREETools-CompilerExtra component if folks need those.

Note that this only installs public headers and libraries needed to build against the compiler and runtime. Installing private things needed to develop parts of the system are out of scope.

With this patch, external projects can do:

```
find_package(IREECompiler)
find_package(IREERuntime)
```

and access our targets by adding either the build or install tree `lib/cmake/IREE` to the CMake package search path.

There are still some ergonomic issues that need to be addressed going forward:

* cpuinfo breaks the one downstream I am testing this against. We really should just finish killing that, so I am setting -DIREE_ENABLE_CPUINFO=OFF in the dist package.
* We are not yet re-establishing the pretty `iree::runtime:...` aliases. The underscore versions are available (`iree_runtime_...`).
* I want to further isolate the remaining bundled deps (yaml and flatcc).
* New convenience install targets do not have full dependency information. Need to do an `all` build first.

As part of this, I did some longstanding cleanups:

* Normalized the install component namespace. Defined `IREECMakeExports`, `IREEDevLibraries-Compiler`, `IREEDevLibraries-Runtime`, `IREERuntimeLibraries-Compiler`, `IREEBundledLibraries`, `IREETools-Runtime`.
* Added convenience `iree-install-*` targets. Each includes a `-stripped` variant as well.
* Moved MLIRInterop.h to the bindings/c directory where it should have been all along and straightened the deps.
* Install the mlir-c headers to support libIREECompiler.so dev.
* Added the "busybox" tool binaries to the install distribution (iree-lld, etc).
* Stopped bundling upstream `lld` and `clang` by default because they bloat the size. `lld` is now bundled as `iree-lld` just like in the Python packages. Clang and llvm-link can be gotten by installing the new `IREETools-CompilerExtra` component if folks need those.

Note that this only installs public headers and libraries needed to build against the compiler and runtime. Installing private things needed to develop parts of the system are out of scope.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
jakzal Jakub Zalas

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
stellaraccident added a commit to stellaraccident/onnxruntime that referenced this pull request Dec 28, 2023
@stellaraccident stellaraccident merged commit 15c306f into main Dec 29, 2023
@stellaraccident stellaraccident deleted the cmake_exports_install branch December 29, 2023 03:03
stellaraccident added a commit to nod-ai/onnxruntime that referenced this pull request Dec 29, 2023
vinayakdsci pushed a commit to vinayakdsci/onnxruntime that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants