Skip to content

Commit

Permalink
Exclude Alveo content from NPU component
Browse files Browse the repository at this point in the history
Ensure that Alveo specific content is built only for Alveo or legacy XRT
components.  E.g., only build Alveo artifacts when XRT_ALVEO is defined.

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe committed Jan 16, 2025
1 parent c19b80a commit 0449fb2
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/CMake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes")
endif()

# This is not required on MPSoC platform. To avoid yocto error, do NOT intall
if ((${XRT_NATIVE_BUILD} STREQUAL "yes") AND (NOT WIN32))
if (XRT_ALVEO AND (${XRT_NATIVE_BUILD} STREQUAL "yes") AND (NOT WIN32))
# Copied over from dkms.cmake. TODO: cleanup
set (XRT_DKMS_INSTALL_DIR "/usr/src/xrt-${XRT_VERSION_STRING}")
install(FILES ${PROJECT_BINARY_DIR}/gen/version.h
Expand Down
10 changes: 6 additions & 4 deletions src/runtime_src/core/pcie/emulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved.
#
add_subdirectory(common_em)
add_subdirectory(sw_emu)
add_subdirectory(hw_emu)
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
if (XRT_ALVEO)
add_subdirectory(common_em)
add_subdirectory(sw_emu)
add_subdirectory(hw_emu)
endif()
6 changes: 3 additions & 3 deletions src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ target_link_libraries(xrt_hwemu_static

install (TARGETS xrt_hwemu xrt_hwemu_static
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_ALVEO_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_COMPONENT} NAMELINK_COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
)

6 changes: 3 additions & 3 deletions src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ target_link_libraries(xrt_swemu_static

install (TARGETS xrt_swemu xrt_swemu_static
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_ALVEO_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_COMPONENT} NAMELINK_COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
)
8 changes: 5 additions & 3 deletions src/runtime_src/core/pcie/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ target_link_libraries(xrt_core_static
pthread
)

# Shim for Linux is installed in the base component as it is
# used by both Alveo and NPU components.
install(TARGETS xrt_core xrt_core_static
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_BASE_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_BASE_COMPONENT} NAMELINK_COMPONENT ${XRT_BASE_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_BASE_DEV_COMPONENT}
)
11 changes: 8 additions & 3 deletions src/runtime_src/core/pcie/noop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved.
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
if (NOT XRT_ALVEO)
return()
endif()

add_library(xrt_noop SHARED
device_noop.cpp
shim.cpp
Expand Down Expand Up @@ -31,7 +36,7 @@ set_target_properties(xrt_noop PROPERTIES

install(TARGETS xrt_noop
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_ALVEO_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_COMPONENT} NAMELINK_COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
)
5 changes: 2 additions & 3 deletions src/runtime_src/core/pcie/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved.
#
add_subdirectory(cloud-daemon)

# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
if(XRT_ALVEO)
add_subdirectory(cloud-daemon)
add_subdirectory(xbflash.qspi)
endif(XRT_ALVEO)
6 changes: 4 additions & 2 deletions src/runtime_src/core/pcie/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved.
#
xrt_add_subdirectory(alveo)
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
if (XRT_ALVEO)
xrt_add_subdirectory(alveo)
endif()
6 changes: 3 additions & 3 deletions src/runtime_src/core/pcie/windows/alveo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif()
# platforms.
install(TARGETS xrt_core xrt_core_static
EXPORT xrt-targets
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_COMPONENT} NAMELINK_COMPONENT ${XRT_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_DEV_COMPONENT}
RUNTIME DESTINATION ${XRT_INSTALL_BIN_DIR} COMPONENT ${XRT_ALVEO_COMPONENT}
LIBRARY DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_COMPONENT} NAMELINK_COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
ARCHIVE DESTINATION ${XRT_INSTALL_LIB_DIR} COMPONENT ${XRT_ALVEO_DEV_COMPONENT}
)
43 changes: 27 additions & 16 deletions src/runtime_src/tools/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,39 @@
# Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved.
#
if (NOT WIN32)
set(XRT_SETUP_SCRIPTS
setup.sh
setup.csh)

set(XRT_SETUP_SCRIPTS
setup.sh
setup.csh)
set(XRT_LOADER_SCRIPTS
loader)

set(XRT_LOADER_SCRIPTS
loader)

set (XRT_SCRIPTS
service_bundle.sh
plp_program.sh)
set (XRT_SCRIPTS
service_bundle.sh
plp_program.sh)

else()

set(XRT_SETUP_SCRIPTS
setup.bat)
set(XRT_SETUP_SCRIPTS
setup.bat)

set (XRT_LOADER_SCRIPTS
loader.bat)
set (XRT_LOADER_SCRIPTS
loader.bat)

endif(NOT WIN32)

install (PROGRAMS ${XRT_SCRIPTS} DESTINATION ${XRT_INSTALL_BIN_DIR})
install (PROGRAMS ${XRT_LOADER_SCRIPTS} DESTINATION ${XRT_INSTALL_UNWRAPPED_DIR})
install (FILES ${XRT_SETUP_SCRIPTS} DESTINATION ${XRT_INSTALL_DIR})
if (XRT_BASE)
install (PROGRAMS ${XRT_LOADER_SCRIPTS}
DESTINATION ${XRT_INSTALL_UNWRAPPED_DIR}
COMPONENT ${XRT_BASE_COMPONENT})

install (FILES ${XRT_SETUP_SCRIPTS}
DESTINATION ${XRT_INSTALL_DIR}
COMPONENT ${XRT_BASE_COMPONENT})
endif()

if (XRT_ALVEO)
install (PROGRAMS ${XRT_SCRIPTS}
DESTINATION ${XRT_INSTALL_BIN_DIR}
COMPONENT ${XRT_ALVEO_COMPONENT})
endif()

0 comments on commit 0449fb2

Please sign in to comment.