Skip to content

Commit

Permalink
changes to build xclbinutil seperately
Browse files Browse the repository at this point in the history
  • Loading branch information
ManojTakasi committed Nov 1, 2023
1 parent 8187624 commit aac987b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do
shift
;;
-xclbinutil)
cmake_flags+=" -DBUILD_TARGET=xclbinutil"
cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=ON"
shift
;;
-verbose)
Expand Down
2 changes: 1 addition & 1 deletion src/CMake/findpackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install (
# This will generate a file that details all targets we have marked for export
# as part of the xrt-targets export group
# It will provide information such as the library file names and locations post install
if (NOT BUILD_TARGET)
if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
if (NOT WIN32)
install(
EXPORT xrt-targets
Expand Down
11 changes: 6 additions & 5 deletions src/CMake/nativeLnx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ message("-- Compiler: ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
include (CMake/lint.cmake)

xrt_add_subdirectory(runtime_src)
if (NOT BUILD_TARGET)

if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
#XMA settings START
set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}")
Expand All @@ -192,31 +193,31 @@ if (NOT BUILD_TARGET)
install (FILES ${PY_TEST_SRC}
PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION ${XRT_INSTALL_DIR}/test)

xrt_add_subdirectory("../tests/validate" "${CMAKE_CURRENT_BINARY_DIR}/validate_build")
message("-- XRT version: ${XRT_VERSION_STRING}")
endif()
# -- CPack
include (CMake/cpackLin.cmake)

if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
set (XRT_DKMS_DRIVER_SRC_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime_src/core")

include (CMake/dkms.cmake)
include (CMake/dkms-aws.cmake)
include (CMake/dkms-azure.cmake)
include (CMake/dkms-container.cmake)

# --- ICD ---
include (CMake/icd.cmake)

# --- Change Log ---
include (CMake/changelog.cmake)

endif()
# --- Package Config ---
include (CMake/pkgconfig.cmake)

# --- Coverity Support ---
include (CMake/coverity.cmake)
endif()

# --- Find Package Support ---
include (CMake/findpackage.cmake)
set (CTAGS "${XRT_SOURCE_DIR}/runtime_src/tools/scripts/tags.sh")
Expand Down
9 changes: 3 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.5.0)
project(XRT)
set(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT")

option(XRT_ONLY_XCLBINUTIL "Option to enable and disabel build only xclbinutil" OFF)

# Include utility functions
include(CMake/utilities.cmake)

Expand All @@ -27,10 +29,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("-- Host system processor is ${CMAKE_HOST_SYSTEM_PROCESSOR}")
message("-- Target system processor is ${CMAKE_SYSTEM_PROCESSOR}")

if(DEFINED BUILD_TARGET AND NOT ${BUILD_TARGET} STREQUAL "xclbinutil")
message(FATAL_ERROR "Build target should be set to xclbinutil")
endif()

set(XRT_NATIVE_BUILD "yes")
if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
set(XRT_NATIVE_BUILD "no")
Expand Down Expand Up @@ -76,7 +74,6 @@ set (CMAKE_INSTALL_PREFIX "/opt/xilinx")
if (${XRT_NATIVE_BUILD} STREQUAL "no")
set (CMAKE_INSTALL_PREFIX "/usr")
endif()

# Enable AIE even on x86. This is POC, once
# complete we will remove the need for these
# macros and defines.
Expand Down Expand Up @@ -129,7 +126,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes")
else()
include(CMake/nativeLnx.cmake)
endif()
if (NOT BUILD_TARGET)
if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
xrt_include(CMake/nativeTests.cmake)
endif()
else()
Expand Down
6 changes: 3 additions & 3 deletions src/runtime_src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if( NOT WIN32)

if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes")
if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XRT_ONLY_XCLBINUTIL} STREQUAL "yes")
xrt_add_subdirectory(doc)
endif()

Expand All @@ -30,7 +30,7 @@ endif(XRT_ENABLE_WERROR)
if (${XRT_NATIVE_BUILD} STREQUAL "yes")
add_compile_options( ${XRT_WARN_OPTS} )
endif()
if (NOT BUILD_TARGET)
if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
xrt_add_subdirectory(xdp)
xrt_add_subdirectory(xocl)
xrt_add_subdirectory(xrt)
Expand All @@ -50,7 +50,7 @@ endif()
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")

if (NOT BUILD_TARGET)
if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON")
xrt_add_subdirectory(core)
endif()

Expand Down

0 comments on commit aac987b

Please sign in to comment.