From 818762456c61ed75abfc3dfa417dee6a4bfbb226 Mon Sep 17 00:00:00 2001 From: Manoj Takasi Date: Wed, 1 Nov 2023 14:36:59 +0530 Subject: [PATCH 1/7] Modified CMakeLists.txt to build xclbinutil independently of XRT Signed-off-by: Manoj Takasi --- build/build.sh | 5 ++++ src/CMake/findpackage.cmake | 28 ++++++++++-------- src/CMake/nativeLnx.cmake | 54 ++++++++++++++++------------------ src/CMakeLists.txt | 7 ++++- src/runtime_src/CMakeLists.txt | 15 ++++++---- 5 files changed, 62 insertions(+), 47 deletions(-) diff --git a/build/build.sh b/build/build.sh index eacfc213064..fa073c620e7 100755 --- a/build/build.sh +++ b/build/build.sh @@ -65,6 +65,7 @@ usage() echo "[-ccache] Build using RDI's compile cache" echo "[-toolchain ] Extra toolchain file to configure CMake" echo "[-driver] Include building driver code" + echo "[-xclbinutil] Build xclbinutil only" echo "[-checkpatch] Run checkpatch.pl on driver code" echo "[-verbose] Turn on verbosity when compiling" echo "[-ertbsp ] Path to directory with pre-downloaded BSP files for building ERT (default: download BSP files during build time)" @@ -207,6 +208,10 @@ while [ $# -gt 0 ]; do cmake_flags+=" -DXRT_PSKERNEL_BUILD=ON" shift ;; + -xclbinutil) + cmake_flags+=" -DBUILD_TARGET=xclbinutil" + shift + ;; -verbose) verbose="VERBOSE=1" shift diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index 3cdfb4f816b..a9c1c928f6e 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -44,18 +44,20 @@ 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 WIN32) -install( - EXPORT xrt-targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} - ) -endif() +if (NOT BUILD_TARGET) + if (NOT WIN32) + install( + EXPORT xrt-targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} + ) + endif() -if (${XRT_NATIVE_BUILD} STREQUAL "yes") -install( - EXPORT xrt-dev-targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} - ) + if (${XRT_NATIVE_BUILD} STREQUAL "yes") + install( + EXPORT xrt-dev-targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${XRT_INSTALL_DIR}/share/cmake/${PROJECT_NAME} + ) + endif() endif() diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index 8b4ec271249..3790ce7256f 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -170,32 +170,31 @@ message("-- Compiler: ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}") include (CMake/lint.cmake) xrt_add_subdirectory(runtime_src) - -#XMA settings START -set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") -set(XMA_VERSION_STRING ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}) -set(XMA_SOVERSION ${XRT_SOVERSION}) -xrt_add_subdirectory(xma) -#XMA settings END - -# --- Python bindings --- -xrt_add_subdirectory(python) - -# --- Python tests --- -set(PY_TEST_SRC - ../tests/python/22_verify/22_verify.py - ../tests/python/utils_binding.py - ../tests/python/23_bandwidth/23_bandwidth.py - ../tests/python/23_bandwidth/host_mem_23_bandwidth.py - ../tests/python/23_bandwidth/versal_23_bandwidth.py) -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}") - +if (NOT BUILD_TARGET) + #XMA settings START + set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") + set(XMA_VERSION_STRING ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}) + set(XMA_SOVERSION ${XRT_SOVERSION}) + xrt_add_subdirectory(xma) + #XMA settings END + + # --- Python bindings --- + xrt_add_subdirectory(python) + + # --- Python tests --- + set(PY_TEST_SRC + ../tests/python/22_verify/22_verify.py + ../tests/python/utils_binding.py + ../tests/python/23_bandwidth/23_bandwidth.py + ../tests/python/23_bandwidth/host_mem_23_bandwidth.py + ../tests/python/23_bandwidth/versal_23_bandwidth.py) + 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}") # -- CPack include (CMake/cpackLin.cmake) @@ -217,9 +216,8 @@ 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") include (CMake/tags.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 262d7058fb7..517d55142cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,11 +27,14 @@ 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") endif() - if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" ) set(XRT_WARN_OPTS -Wall @@ -126,7 +129,9 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") else() include(CMake/nativeLnx.cmake) endif() + if (NOT BUILD_TARGET) xrt_include(CMake/nativeTests.cmake) + endif() else() include(CMake/embedded_system.cmake) endif() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 47bf11a2d06..3e632a7e052 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -30,12 +30,15 @@ endif(XRT_ENABLE_WERROR) if (${XRT_NATIVE_BUILD} STREQUAL "yes") add_compile_options( ${XRT_WARN_OPTS} ) endif() -xrt_add_subdirectory(xdp) +if (NOT BUILD_TARGET) + xrt_add_subdirectory(xdp) + xrt_add_subdirectory(xocl) + xrt_add_subdirectory(xrt) + xrt_add_subdirectory(ert) +endif() xrt_add_subdirectory(tools/xclbinutil) -xrt_add_subdirectory(xocl) -xrt_add_subdirectory(xrt) -xrt_add_subdirectory(ert) + if (${XRT_NATIVE_BUILD} STREQUAL "yes") # Only for host native build. # For embedded, headers and libraries are installed in /usr @@ -47,7 +50,9 @@ endif() set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") -xrt_add_subdirectory(core) +if (NOT BUILD_TARGET) + xrt_add_subdirectory(core) +endif() else() # = WINDOWS =================================================================== From aac987b9fc5b10fa05f5e1dd8b1eb1d6f90b8b7a Mon Sep 17 00:00:00 2001 From: Manoj Takasi Date: Wed, 1 Nov 2023 20:36:34 +0530 Subject: [PATCH 2/7] changes to build xclbinutil seperately --- build/build.sh | 2 +- src/CMake/findpackage.cmake | 2 +- src/CMake/nativeLnx.cmake | 11 ++++++----- src/CMakeLists.txt | 9 +++------ src/runtime_src/CMakeLists.txt | 6 +++--- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/build/build.sh b/build/build.sh index fa073c620e7..060a2330b99 100755 --- a/build/build.sh +++ b/build/build.sh @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do shift ;; -xclbinutil) - cmake_flags+=" -DBUILD_TARGET=xclbinutil" + cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=ON" shift ;; -verbose) diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index a9c1c928f6e..4cbb21f48af 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -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 diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index 3790ce7256f..769edf1b3be 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -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}") @@ -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") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 517d55142cc..6b8be8eb541 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) @@ -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") @@ -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. @@ -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() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 3e632a7e052..e5916c9c8c1 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -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() @@ -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) @@ -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() From 7d2b653093a964133ddcadd764ef6978ba7fd4a3 Mon Sep 17 00:00:00 2001 From: Manoj Takasi Date: Thu, 2 Nov 2023 11:07:13 +0530 Subject: [PATCH 3/7] Modiified the changes to build xclbinutil only --- build/build.sh | 2 +- src/CMake/findpackage.cmake | 2 +- src/CMake/nativeLnx.cmake | 6 ++++-- src/CMakeLists.txt | 7 +++++-- src/runtime_src/CMakeLists.txt | 6 +++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/build/build.sh b/build/build.sh index 060a2330b99..a4e767f2ecd 100755 --- a/build/build.sh +++ b/build/build.sh @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do shift ;; -xclbinutil) - cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=ON" + cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=yes" shift ;; -verbose) diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index 4cbb21f48af..6beba42a79f 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -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 ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") +if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") if (NOT WIN32) install( EXPORT xrt-targets diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index 769edf1b3be..d37c22295b1 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -171,7 +171,7 @@ include (CMake/lint.cmake) xrt_add_subdirectory(runtime_src) -if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") +if(${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") #XMA settings START set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") @@ -198,7 +198,8 @@ if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") endif() # -- CPack include (CMake/cpackLin.cmake) -if(NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") + +if(${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") set (XRT_DKMS_DRIVER_SRC_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime_src/core") include (CMake/dkms.cmake) @@ -220,5 +221,6 @@ include (CMake/coverity.cmake) # --- Find Package Support --- include (CMake/findpackage.cmake) + set (CTAGS "${XRT_SOURCE_DIR}/runtime_src/tools/scripts/tags.sh") include (CMake/tags.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6b8be8eb541..ab0bf8a1506 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,7 +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) +option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" no) + # Include utility functions include(CMake/utilities.cmake) @@ -33,6 +34,7 @@ set(XRT_NATIVE_BUILD "yes") if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) set(XRT_NATIVE_BUILD "no") endif() + if ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" ) set(XRT_WARN_OPTS -Wall @@ -74,6 +76,7 @@ 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. @@ -126,7 +129,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") else() include(CMake/nativeLnx.cmake) endif() - if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") + if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") xrt_include(CMake/nativeTests.cmake) endif() else() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index e5916c9c8c1..e81576d226e 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -6,7 +6,7 @@ if( NOT WIN32) - if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XRT_ONLY_XCLBINUTIL} STREQUAL "yes") + if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") xrt_add_subdirectory(doc) endif() @@ -30,7 +30,7 @@ endif(XRT_ENABLE_WERROR) if (${XRT_NATIVE_BUILD} STREQUAL "yes") add_compile_options( ${XRT_WARN_OPTS} ) endif() -if (NOT ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") +if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") xrt_add_subdirectory(xdp) xrt_add_subdirectory(xocl) xrt_add_subdirectory(xrt) @@ -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 ${XRT_ONLY_XCLBINUTIL} STREQUAL "ON") +if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") xrt_add_subdirectory(core) endif() From 929f2d41dea725a89869c0323e5b82138d3b33d9 Mon Sep 17 00:00:00 2001 From: Manoj Takasi Date: Thu, 2 Nov 2023 11:11:23 +0530 Subject: [PATCH 4/7] Modified runtime CMakeLists.txt --- src/runtime_src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index e81576d226e..f7f85961597 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -6,7 +6,7 @@ if( NOT WIN32) - if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") xrt_add_subdirectory(doc) endif() From bd136984224f74fa4c180b9b9be7fdb93ff665ca Mon Sep 17 00:00:00 2001 From: Manoj Takasi <133196374+ManojTakasi@users.noreply.github.com> Date: Thu, 2 Nov 2023 12:13:26 +0530 Subject: [PATCH 5/7] Update build.sh --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index a4e767f2ecd..b82ea0a2ccd 100755 --- a/build/build.sh +++ b/build/build.sh @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do shift ;; -xclbinutil) - cmake_flags+=" -DXRT_ONLY_XCLBINUTIL=yes" + cmake_flags+=" -DXCLBINUTIL_ONLY_BUILD=yes" shift ;; -verbose) From 41d4f9da062a00bc72e72b100c9b4d320938e8fc Mon Sep 17 00:00:00 2001 From: Manoj Takasi <133196374+ManojTakasi@users.noreply.github.com> Date: Thu, 2 Nov 2023 12:34:11 +0530 Subject: [PATCH 6/7] Update CMakeLists.txt --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab0bf8a1506..bab98cbf0ce 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5.0) project(XRT) set(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT") -option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" no) +option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" "no") # Include utility functions From 0730179f6298f5bb1452e9afadb43cbdfe476d28 Mon Sep 17 00:00:00 2001 From: Garg Date: Thu, 2 Nov 2023 09:33:28 +0000 Subject: [PATCH 7/7] Modifying cmake files to build the xclbinutil independently --- build/build.sh | 2 +- src/CMake/findpackage.cmake | 4 ++-- src/CMake/nativeLnx.cmake | 4 ++-- src/CMakeLists.txt | 4 ++-- src/runtime_src/CMakeLists.txt | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/build.sh b/build/build.sh index b82ea0a2ccd..74d8cce552e 100755 --- a/build/build.sh +++ b/build/build.sh @@ -209,7 +209,7 @@ while [ $# -gt 0 ]; do shift ;; -xclbinutil) - cmake_flags+=" -DXCLBINUTIL_ONLY_BUILD=yes" + cmake_flags+=" -DXCLBINUTIL_ONLY_BUILD=ON" shift ;; -verbose) diff --git a/src/CMake/findpackage.cmake b/src/CMake/findpackage.cmake index 6beba42a79f..dca18125623 100644 --- a/src/CMake/findpackage.cmake +++ b/src/CMake/findpackage.cmake @@ -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 (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if (NOT ${XCLBINUTIL_ONLY_BUILD}) if (NOT WIN32) install( EXPORT xrt-targets @@ -53,7 +53,7 @@ if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") ) endif() - if (${XRT_NATIVE_BUILD} STREQUAL "yes") + if (NOT ${XRT_NATIVE_BUILD}) install( EXPORT xrt-dev-targets NAMESPACE ${PROJECT_NAME}:: diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index d37c22295b1..7fa2abe4e6e 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -171,7 +171,7 @@ include (CMake/lint.cmake) xrt_add_subdirectory(runtime_src) -if(${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if(NOT ${XCLBINUTIL_ONLY_BUILD}) #XMA settings START set(XMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(XMA_INSTALL_DIR "${XRT_INSTALL_DIR}") @@ -199,7 +199,7 @@ endif() # -- CPack include (CMake/cpackLin.cmake) -if(${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if(NOT ${XCLBINUTIL_ONLY_BUILD}) set (XRT_DKMS_DRIVER_SRC_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime_src/core") include (CMake/dkms.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bab98cbf0ce..c00bb4205f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5.0) project(XRT) set(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT") -option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" "no") +option(XCLBINUTIL_ONLY_BUILD "Option to enable and disable build only xclbinutil" OFF) # Include utility functions @@ -129,7 +129,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") else() include(CMake/nativeLnx.cmake) endif() - if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") + if (NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_include(CMake/nativeTests.cmake) endif() else() diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index f7f85961597..3122b6eba1f 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -6,7 +6,7 @@ if( NOT WIN32) -if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND ${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") + if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes" AND NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_add_subdirectory(doc) endif() @@ -30,7 +30,7 @@ endif(XRT_ENABLE_WERROR) if (${XRT_NATIVE_BUILD} STREQUAL "yes") add_compile_options( ${XRT_WARN_OPTS} ) endif() -if (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if (NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_add_subdirectory(xdp) xrt_add_subdirectory(xocl) xrt_add_subdirectory(xrt) @@ -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 (${XCLBINUTIL_ONLY_BUILD} STREQUAL "no") +if (NOT ${XCLBINUTIL_ONLY_BUILD}) xrt_add_subdirectory(core) endif()