Skip to content

xbmgmt2: configure fails with -DXRT_EDGE=ON due to wrong target variable #9829

Description

@talhaHavadar

Summary

src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt references the wrong CMake variable in its XRT_EDGE branch, causing the configure step to fail for any build that sets -DXRT_EDGE=ON. The non-edge / native PCIe build path is unaffected. Reproduced against current master as well as the 202610.2.23.0_Canonical tag.

Reproduction

Configure XRT with XRT_EDGE enabled — anything that exercises the edge build path triggers it. Minimal repro on a native arm64 host (also reproduces via cross-compile or by manually forcing -DXRT_EDGE=ON):

$ cmake -S src -B build -DXRT_EDGE=ON -DXRT_AIE_BUILD=ON
...
-- add_subdirectory(xbmgmt2)
CMake Error at xrt/XRT/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt:68 (target_compile_definitions):
  Cannot specify compile definitions for target "PRIVATE" which is not built
  by this project.

Root cause

src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt:68:

if (NOT XRT_EDGE)
  target_compile_definitions(${XBMGMT2_NAME} PRIVATE ENABLE_NATIVE_SUBCMDS_AND_REPORTS)
else()
  target_compile_definitions(${XBUTIL2_NAME} PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION)
endif()

XBUTIL2_NAME is set in the sibling src/runtime_src/core/tools/xbutil2/CMakeLists.txt:63 (set(XBUTIL2_NAME "xrt-smi")) — that's a directory-local scope and is not visible inside xbmgmt2/. In this scope the variable expands to an empty string, and CMake parses the call as target_compile_definitions(PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION), which fails because there's no target name.

The if (NOT XRT_EDGE) branch on line 66 correctly uses ${XBMGMT2_NAME}, so this looks like a copy/paste from xbutil2/CMakeLists.txt:78 where the variable rename was missed.

Impact

  • Any configure with -DXRT_EDGE=ON fails before generation completes — the build doesn't produce xbmgmt, xrt-smi, or any other target in runtime_src.
  • Native PCIe builds (-DXRT_EDGE unset / OFF) are not affected: the else-branch isn't entered.
  • Affects current master and the 202610.2.23.0_Canonical release tag (and presumably every earlier release where the XRT_EDGE branch existed in this file).

Suggested fix

--- a/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt
+++ b/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt
@@ -65,7 +65,7 @@ add_executable(${XBMGMT2_NAME} ${XBMGMT_V2_SRCS})
 if (NOT XRT_EDGE)
   target_compile_definitions(${XBMGMT2_NAME} PRIVATE ENABLE_NATIVE_SUBCMDS_AND_REPORTS)
 else()
-  target_compile_definitions(${XBUTIL2_NAME} PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION)
+  target_compile_definitions(${XBMGMT2_NAME} PRIVATE ENABLE_DEFAULT_ONE_DEVICE_OPTION)
 endif()

Environment

  • Distro: Ubuntu 26.04 LTS (arm64)
  • CMake: 4.1.2
  • XRT tag: 202610.2.23.0_Canonical (also reproduced on master HEAD)
  • Reproducer: cmake -DXRT_EDGE=ON -DXRT_AIE_BUILD=ON (sbuild / native build, no cross-compile required to trigger the configure-time error)

Reported while packaging XRT for Ubuntu (source package xrt).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions