Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build XDP depending on XRT component being built #8695

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/build-win22.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ while [ $# -gt 0 ]; do
-npu)
shift
npu_build=1
cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes"
cmake_flags+=" -DXRT_NPU=1"
;;
-j)
Expand Down
1 change: 0 additions & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ while [ $# -gt 0 ]; do
shift
npu_build=1
noert=1
cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes"
cmake_flags+=" -DXRT_NPU=1"
;;
-opt)
Expand Down
3 changes: 3 additions & 0 deletions src/CMake/embedded_system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ endif(GIT_FOUND)
set(LINUX_FLAVOR ${CMAKE_SYSTEM_NAME})
set(LINUX_KERNEL_VERSION ${CMAKE_SYSTEM_VERSION})

# --- Set up what components of XRT to build ---
include(CMake/components.cmake)

# --- Boost Libraries ---
include (CMake/boostUtil.cmake)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ else()
add_compile_options( ${XRT_WARN_OPTS} )
endif()

if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes")
if (XRT_NPU)
set(AIERT_DIR ${CMAKE_CURRENT_BINARY_DIR}/aie-rt/driver/src)
set(XAIENGINE_BUILD_SHARED OFF)
xrt_add_subdirectory_disable_install_target(aie-rt/driver/src)
Expand Down
19 changes: 13 additions & 6 deletions src/runtime_src/core/common/xdp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ target_include_directories(core_common_xdp_profile_objects
${XRT_SOURCE_DIR}/runtime_src
)

if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes")
# Compile defintions when building npu, alveo, or legacy xrt
# components
if (XRT_NPU)

target_compile_definitions(core_common_xdp_profile_objects
PRIVATE
XDP_CLIENT_BUILD=1
)

elseif (XDP_VE2_BUILD_CMAKE STREQUAL "yes")
target_compile_definitions(core_common_xdp_profile_objects
PRIVATE
XDP_VE2_BUILD=1
)

target_compile_definitions(core_common_xdp_profile_objects
PRIVATE
XDP_VE2_BUILD=1
)

endif()


14 changes: 8 additions & 6 deletions src/runtime_src/xdp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# of the plugins and subdirectories. Also, set the install
# locations for the plugins on Linux and Windows
# ================================================================

if (NOT WIN32)

include_directories(
Expand All @@ -29,13 +28,16 @@ else()

endif()

if (XDP_CLIENT_BUILD_CMAKE STREQUAL "yes")

add_compile_options("-DSKIP_IOCTL")
# Only include xdp in npu, alveo, or legacy xrt components
# For npu, set up different flags used conditionally in
# in subdirectories.
if (XRT_NPU)

add_subdirectory(profile)
set(XDP_CLIENT_BUILD_CMAKE "yes")
add_compile_options("-DSKIP_IOCTL")
add_subdirectory(profile)

else()
elseif(XRT_ALVEO)

add_subdirectory(appdebug)
add_subdirectory(debug)
Expand Down
Loading