Skip to content

Commit 1176fef

Browse files
superm1claude
andcommitted
rename to portable build and bundle XRT/XDNA libraries
- Rename FLM_STATIC_BUILD to FLM_PORTABLE_BUILD for clarity - Link XRT dynamically (not statically) to avoid uuid dependency issues - Link FFmpeg statically (built from source) for portability - Bundle XRT and XDNA .so files with distribution using file(GLOB) - Update preset from linux-static to linux-portable - Update workflow to verify portable build This creates a portable distribution with: - Static FFmpeg (no external FFmpeg deps) - Dynamic XRT bundled in lib/ directory - RPATH set to $ORIGIN/../lib for automatic discovery Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c469308 commit 1176fef

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

src/CMakeLists.txt

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -558,28 +558,35 @@ else()
558558
559559
# Bundle system libraries for portable distribution
560560
if(FLM_PORTABLE_BUILD)
561-
# Bundle XRT core library
562-
find_file(SYSTEM_XRT_COREUTIL
563-
NAMES libxrt_coreutil.so.2
564-
PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu
565-
NO_DEFAULT_PATH
561+
# Bundle XRT core library and its symlinks
562+
# Find the versioned library (e.g., libxrt_coreutil.so.2.21.75)
563+
file(GLOB XRT_COREUTIL_FILES
564+
/usr/lib/libxrt_coreutil.so*
565+
/usr/local/lib/libxrt_coreutil.so*
566+
/usr/lib/x86_64-linux-gnu/libxrt_coreutil.so*
566567
)
567-
if(SYSTEM_XRT_COREUTIL)
568-
message(STATUS "Will bundle XRT library: ${SYSTEM_XRT_COREUTIL}")
569-
install(FILES ${SYSTEM_XRT_COREUTIL} DESTINATION lib)
568+
if(XRT_COREUTIL_FILES)
569+
message(STATUS "Will bundle XRT library files:")
570+
foreach(XRT_FILE ${XRT_COREUTIL_FILES})
571+
message(STATUS " ${XRT_FILE}")
572+
install(FILES ${XRT_FILE} DESTINATION lib)
573+
endforeach()
570574
else()
571575
message(WARNING "XRT library not found for bundling. Install libxrt-dev package.")
572576
endif()
573577
574-
# Bundle XDNA plugin
575-
find_file(SYSTEM_XDNA_PLUGIN
576-
NAMES libxrt_driver_xdna.so.2
577-
PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu
578-
NO_DEFAULT_PATH
578+
# Bundle XDNA plugin and its symlinks
579+
file(GLOB XDNA_PLUGIN_FILES
580+
/usr/lib/libxrt_driver_xdna.so*
581+
/usr/local/lib/libxrt_driver_xdna.so*
582+
/usr/lib/x86_64-linux-gnu/libxrt_driver_xdna.so*
579583
)
580-
if(SYSTEM_XDNA_PLUGIN)
581-
message(STATUS "Will bundle XDNA plugin: ${SYSTEM_XDNA_PLUGIN}")
582-
install(FILES ${SYSTEM_XDNA_PLUGIN} DESTINATION lib)
584+
if(XDNA_PLUGIN_FILES)
585+
message(STATUS "Will bundle XDNA plugin files:")
586+
foreach(XDNA_FILE ${XDNA_PLUGIN_FILES})
587+
message(STATUS " ${XDNA_FILE}")
588+
install(FILES ${XDNA_FILE} DESTINATION lib)
589+
endforeach()
583590
else()
584591
message(WARNING "XDNA plugin not found for bundling. Install libxrt-npu2 package.")
585592
endif()

0 commit comments

Comments
 (0)