build: add CMake package config#28
Merged
Merged
Conversation
voltjia
marked this pull request as ready for review
July 15, 2026 06:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InfiniRTConfig.cmake,InfiniRTConfigVersion.cmake, and the namespacedInfiniRT::infinirttarget so downstream CMake projects can usefind_package(InfiniRT CONFIG REQUIRED).CMAKE_PREFIX_PATHand the imported target.Motivation
Installed InfiniRT prefixes currently expose headers and
libinfinirtwithout a CMake package, so each downstream project must rediscover the include directory, library, language requirement, and backend dependencies. A versioned package config provides a standard downstream interface and avoids exporting backend SDK paths from the build machine.N/A - no linked issue.
Type of Change
feat- new feature / new backend capability / new public APIfix- bug fixperf- performance improvement without behavior changerefactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_HYGON)WITH_METAX)WITH_MOORE)WITH_CAMBRICON)WITH_ASCEND)Smoke Build and Test Result
All platform checkouts were pinned to commit
9ae8f8fd0b0ac4807a0d8b325fb0d3b2809fb161. NVIDIA, Iluvatar, Moore, Cambricon, and Ascend builds ran in theaccelerator-dev/<platform>:latestimages with--privileged. MetaX device smoke used its documented image, while the build ran directly on the same host because that image does not contain CMake; the host provides CMake 3.28.3 and the same/opt/macaSDK.Each completed platform test set includes
test_installandtest_install_consumer. The latter configures an external project with an exact version requirement, resolves the installed package throughCMAKE_PREFIX_PATH, validatesInfiniRT_ENABLED_BACKENDSand everyInfiniRT_WITH_<BACKEND>value, linksInfiniRT::infinirt, and runs the resulting executable. A negative configure check also confirmed that mismatched expected metadata is rejected.Device tensor smoke results and image IDs:
InfiniOps downstream validation used current
InfiniTensor/InfiniOpsmaster at296271487beb594a248fd463e5fff14f7ab74293. Its temporary checkout was changed only to consumeInfiniRT::infinirt; configuration receivedCMAKE_PREFIX_PATHand no legacy InfiniRT root, include, or library variables.Test Results on Supported Platforms
ssh hygon(10.211.3.27:22) timed out from the local host and five accelerator hosts; no container or source command ran./opt/maca; the documented image supplied the successful device smoke but lacks CMake.Full `ctest` summary
Benchmark / Performance Impact
N/A - this changes CMake package metadata, installation checks, examples, and documentation; runtime implementation and dispatch behavior are unchanged.
Notes for Reviewers
0.1.0matches the project version used by downstream packaging.CUDAToolkit; MetaX, Moore, Cambricon, and Ascend packages rediscover their SDK runtime targets from consumer-side hints and environment variables. This keeps build-machine SDK paths out of the installed target export.find_path/find_librarylogic tofind_package(InfiniRT CONFIG REQUIRED)andInfiniRT::infinirt.