在 Ubuntu 24.04 (noble) 上的 jetson-inference 构建失败 — jetson-utils 子模块不一致

作者: kais-bedioui创建于 2026年8月11日更新于 2026年8月11日

cmake 配置在构建 ZZTERM18ZZ 绑定时失败,出现了几个较旧的已解决问题(#538、#1228、#1799、#1730)中常见的重复目标签名:

-- found ZZTERM19ZZ version:  3.12 (3.12.3)
...
CMake Error at utils/cuda/FindCUDA.cmake:1809 (add_library):
  add_library cannot create target "jetson-utils-ZZTERM20ZZ-312" because another
  target with the same name already exists. The existing target is a shared
  library created in source directory
  "/opt/jetson-inference/utils/ZZTERM21ZZ/bindings". See documentation for
  policy CMP0002 for more details.
Call Stack (most recent call first):
  utils/ZZTERM22ZZ/bindings/CMakeLists.txt:57 (cuda_add_library)
CMake Error at utils/ZZTERM23ZZ/bindings/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "jetson-utils" to target
  "jetson-utils-ZZTERM24ZZ-312" which is not built in this directory.
  This is allowed only when policy CMP0079 is set to NEW.
CMake Error at utils/ZZTERM25ZZ/bindings/CMakeLists.txt:62 (target_link_libraries):
  Attempt to add link library "npymath" to target "jetson-utils-ZZTERM26ZZ-312"
  which is not built in this directory.
  This is allowed only when policy CMP0079 is set to NEW.
-- detecting ZZTERM27ZZ 3.7...

构建尝试使用第二个不同请求的 ZZTERM28ZZ 版本 ("detecting ZZTERM29ZZ 3.7..."),紧跟着成功通过 3.12 版本 — 这个问题的历史实例都遵循相同的模式:PYTHON_BINDING_VERSIONS 列表包含多个条目,其中多个条目都解析为主机上的同一实现,导致 CMake 目标重复出现。

内容来源: dusty-nv/jetson-inference