Skip to content

Commit

Permalink
Update install component for exported headers (Xilinx#8698)
Browse files Browse the repository at this point in the history
* Hook up building of Alveo component

Alveo builds one Alveo package for both deployment and development for
everything enabled by XRT_ALVEO and XRT_BASE.

Signed-off-by: Soren Soe <[email protected]>

* Update install component for exported headers

All exported headers should use XRT_BASE_DEV_COMPONENT.  This symbolic
component is controlled by XRT depending on what component is being
built.

Signed-off-by: Soren Soe <[email protected]>

* Exclude rumtime_src/core/common unless XRT_BASE is being built

XRT_BASE is currently defined when building npu, alveo, and base,
so this change really is a no-op as of now.

Signed-off-by: Soren Soe <[email protected]>

* Indicate build is for edge by setting XRT_EDGE CMake variable

Set XRT_EDGE for embedded builds.  Use XRT_EDGE conditionally for
clarity.

Signed-off-by: Soren Soe <[email protected]>

---------

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe authored Jan 16, 2025
1 parent e0b20f1 commit c19b80a
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 26 deletions.
34 changes: 26 additions & 8 deletions src/CMake/components.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ if (XRT_BASE)
set (XRT_DEV_COMPONENT ${XRT_BASE_DEV_COMPONENT})
endif(XRT_BASE)

# NPU builds the one NPU package for both deployment and development
# for everything enabled by XRT_NPU. This will change into base and
# npu separated packages along with packages for development and
# deployment
# NPU builds one NPU package for both deployment and development
# for everything enabled by XRT_NPU and XRT_BASE
if (XRT_NPU)
set (XRT_BASE 1)
set (XRT_BASE_COMPONENT "npu")
set (XRT_BASE_DEV_COMPONENT "npu")
set (XRT_NPU_COMPONENT "npu")
Expand All @@ -71,15 +70,34 @@ if (XRT_NPU)
set (XRT_DEV_COMPONENT ${XRT_NPU_DEV_COMPONENT})
endif(XRT_NPU)

# Alveo builds one Alveo package for both deployment and development
# for everything enabled by XRT_ALVEO and XRT_BASE
if (XRT_ALVEO)
set (XRT_BASE 1)

set (XRT_BASE_COMPONENT "alveo")
set (XRT_BASE_DEV_COMPONENT "alveo")
set (XRT_ALVEO_COMPONENT "alveo")
set (XRT_ALVEO_DEV_COMPONENT "alveo")

# For the time being, dump everything into alveo that has not
# been explicitly marked alveo or npu
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "alveo")
set (XRT_COMPONENT ${XRT_ALVEO_COMPONENT})
set (XRT_DEV_COMPONENT ${XRT_ALVEO_DEV_COMPONENT})
endif(XRT_ALVEO)

# Legacy, build one XRT package for both deployment and development
# This build is for alveo
# Include everything enabled by XRT_BASE and XRT_ALVEO
if (XRT_XRT)
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "xrt")
set (XRT_BASE 1)
set (XRT_ALVEO 1)
set (XRT_NPU 0)

set (XRT_BASE_COMPONENT "xrt")
set (XRT_BASE_DEV_COMPONENT "xrt")
set (XRT_ALVEO_COMPONENT "xrt")
set (XRT_ALVEO_DEV_COMPONENT "xrt")
set (XRT_ALVEO 1)
set (XRT_NPU 0)
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "xrt")
endif(XRT_XRT)

4 changes: 3 additions & 1 deletion src/CMake/embedded_system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ endif(GIT_FOUND)
set(LINUX_FLAVOR ${CMAKE_SYSTEM_NAME})
set(LINUX_KERNEL_VERSION ${CMAKE_SYSTEM_VERSION})

# --- Set up what components of XRT to build ---
# Set up what components of XRT to build
# Indicate that we are building for edge
include(CMake/components.cmake)
set(XRT_EDGE 1)

# --- Boost Libraries ---
include (CMake/boostUtil.cmake)
Expand Down
6 changes: 5 additions & 1 deletion src/runtime_src/core/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved.
# Copyright (C) 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2022-2025 Advanced Micro Devices, Inc. All rights reserved.
if (NOT XRT_BASE)
return()
endif()

add_subdirectory(api)
add_subdirectory(xdp)
add_subdirectory(runner)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/core/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(XRT_CORE_HEADER_SRC
# Legacy deprecated install
install (FILES ${XRT_CORE_HEADER_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}
COMPONENT ${XRT_DEV_COMPONENT})
COMPONENT ${XRT_BASE_DEV_COMPONENT})

# Legacy experimental
add_subdirectory(experimental)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/core/include/experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ set(XRT_EXPERIMENTAL_HEADER_SRC
# Legacy deprecated install
install (FILES ${XRT_EXPERIMENTAL_HEADER_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}/experimental
COMPONENT ${XRT_DEV_COMPONENT})
COMPONENT ${XRT_BASE_DEV_COMPONENT})
7 changes: 1 addition & 6 deletions src/runtime_src/core/include/xrt/detail/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ set(XRT_XRT_DETAIL_HEADER_SRC
param_traits.h
pimpl.h)

# base component install
install (FILES ${XRT_XRT_DETAIL_HEADER_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}/xrt/detail
COMPONENT ${XRT_BASE_DEV_COMPONENT})

set(XRT_XRT_DETAIL_LEGACY_SRC
ert.h
xclbin.h
xrt_error_code.h
xrt_mem.h)

# base component install
install (FILES ${XRT_XRT_DETAIL_LEGACY_SRC}
install (FILES ${XRT_XRT_DETAIL_HEADER_SRC} ${XRT_XRT_DETAIL_LEGACY_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}/xrt/detail
COMPONENT ${XRT_BASE_DEV_COMPONENT})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ set(XRT_WINDOWS_HEADER_SRC
types.h
uuid.h)

# xrt component deprecated install
# Legacy deprecated install
install (FILES ${XRT_WINDOWS_HEADER_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}/windows
COMPONENT ${XRT_DEV_COMPONENT})

# xrt component install
install (FILES ${XRT_WINDOWS_HEADER_SRC}
DESTINATION ${XRT_INSTALL_INCLUDE_DIR}/xrt/detail/windows
COMPONENT ${XRT_DEV_COMPONENT})
COMPONENT ${XRT_BASE_DEV_COMPONENT})

# base component install
install (FILES ${XRT_WINDOWS_HEADER_SRC}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/xdp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (XRT_NPU)
add_compile_options("-DSKIP_IOCTL")
add_subdirectory(profile)

elseif(XRT_ALVEO)
elseif(XRT_ALVEO OR XRT_EDGE)

add_subdirectory(appdebug)
add_subdirectory(debug)
Expand Down

0 comments on commit c19b80a

Please sign in to comment.