diff --git a/build/build.sh b/build/build.sh index a66889c6561..a479a927cb7 100755 --- a/build/build.sh +++ b/build/build.sh @@ -58,7 +58,7 @@ usage() echo "[-noert] Do not treat missing ERT FW as a build error" echo "[-noinit] Do not initialize Git submodules" echo "[-noctest] Skip unit tests" - echo "[-npu] Build for NPU only. Disable bundling of Alveo Linux drivers. Do not treat missing ERT FW as a build error. Compile XDP plugins for NPU." + echo "[-npu] Build for NPU only, implies -noert and disables bundling of Alveo Linux drivers" echo "[-with-static-boost Build binaries using static linking of boost from specified boost install" echo "[-clangtidy] Run clang-tidy as part of build" echo "[-pskernel] Enable building of POC ps kernel" @@ -160,7 +160,7 @@ while [ $# -gt 0 ]; do alveo=0 noert=1 cmake_flags+=" -DXDP_CLIENT_BUILD_CMAKE=yes" - cmake_flags+=" -DNPU=1" + cmake_flags+=" -DXRT_NPU=1" ;; -opt) dbg=0 @@ -190,6 +190,7 @@ while [ $# -gt 0 ]; do ;; -ccache) export CCACHE_DIR=${CCACHE_DIR:-/scratch/ccache/$USER} + mkdir -p $CCACHE_DIR cmake_flags+=" -DXRT_CCACHE=1" shift ;; @@ -262,8 +263,10 @@ cmake_flags+=" -DXRT_ENABLE_WERROR=$werror" # set CMAKE_INSTALL_PREFIX cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$xrt_install_prefix -DXRT_INSTALL_PREFIX=$xrt_install_prefix" +# Set CMake variable indicating build for Alveo +# Specifying '-npu' disables Alveo if [[ $alveo == 1 ]]; then - cmake_flags+=" -DXRT_DKMS_ALVEO=ON" + cmake_flags+=" -DXRT_ALVEO=1" fi here=$PWD diff --git a/src/CMake/cpackLin.cmake b/src/CMake/cpackLin.cmake index d3868acb9d8..23a9b9b0fa0 100644 --- a/src/CMake/cpackLin.cmake +++ b/src/CMake/cpackLin.cmake @@ -19,9 +19,12 @@ SET(CPACK_ARCHIVE_COMPONENT_INSTALL ON) SET(CPACK_DEB_COMPONENT_INSTALL ON) SET(CPACK_RPM_COMPONENT_INSTALL ON) -if (DEFINED NPU) - SET(CPACK_PACKAGE_NAME "npu") -endif() +# For some reason CMake doesn't populate CPACK_COMPONENTS_ALL when the +# project has only one component, this leads to cpack generating +# pacage without component name appended. To work-around this, +# populate the variable explictly. +get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS) +message("Install components in the project: ${CPACK_COMPONENTS_ALL}") # When the rpmbuild occurs for packaging, it uses a default version of # python to perform a python byte compilation. For the CentOS 7.x OS, this @@ -209,13 +212,4 @@ SET(CPACK_PACKAGE_CONTACT "sonal.santan@amd.com") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Runtime stack for use with AMD platforms") SET(CPACK_RESOURCE_FILE_LICENSE "${XRT_SOURCE_DIR}/../LICENSE") -add_custom_target(xrtpkg - echo "COMMAND ${CMAKE_CPACK_COMMAND}" - COMMAND ${CMAKE_CPACK_COMMAND} - COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.deb ${CPACK_PACKAGE_FILE_NAME}.deb 2> /dev/null - COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.rpm ${CPACK_PACKAGE_FILE_NAME}.rpm 2> /dev/null - COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.tar.gz ${CPACK_PACKAGE_FILE_NAME}.tar.gz 2> /dev/null - -) - INCLUDE(CPack) diff --git a/src/CMake/nativeLnx.cmake b/src/CMake/nativeLnx.cmake index dbee8c6e0a9..ecfcc19eb69 100644 --- a/src/CMake/nativeLnx.cmake +++ b/src/CMake/nativeLnx.cmake @@ -152,7 +152,7 @@ message("-- XRT version: ${XRT_VERSION_STRING}") # -- CPack include (CMake/cpackLin.cmake) -if (XRT_DKMS_ALVEO STREQUAL "ON") +if (XRT_ALVEO) message("-- XRT Alveo drivers will be bundled with the XRT package") 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 6fbde05e966..fedad362bfd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,13 +27,21 @@ include(CMake/settings.cmake) # set to something different then a development component will be created with # link libraries and header which are then excluded from runtime component set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "xrt") - + # Enable development package by specifying development component name # If XRT_DEV_COMPONENT is same DEFAULT_COMPONENT then only that package # is created with both development and run-time content. #set (XRT_DEV_COMPONENT "xrt-dev") +set (XRT_COMPONENT "xrt") set (XRT_DEV_COMPONENT "xrt") +# For NPU builds the defalt component is "npu". +if (XRT_NPU) + set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "npu") + set (XRT_COMPONENT "npu") + set (XRT_DEV_COMPONENT "npu") +endif(XRT_NPU) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${XRT_SOURCE_DIR}/CMake/") # This makes aiebu submodule use ELFIO from XRT diff --git a/src/runtime_src/CMakeLists.txt b/src/runtime_src/CMakeLists.txt index 989b434968e..46e3647cb6e 100644 --- a/src/runtime_src/CMakeLists.txt +++ b/src/runtime_src/CMakeLists.txt @@ -36,7 +36,8 @@ xrt_add_subdirectory(tools/xclbinutil) xrt_add_subdirectory(xocl) xrt_add_subdirectory(xrt) -if (XRT_DKMS_ALVEO STREQUAL "ON") +if (XRT_ALVEO) + # Enable building of ERT firmware for Alveo xrt_add_subdirectory(ert) endif() diff --git a/src/runtime_src/core/pcie/tools/CMakeLists.txt b/src/runtime_src/core/pcie/tools/CMakeLists.txt index dff157d6aa1..b1db0afe28e 100644 --- a/src/runtime_src/core/pcie/tools/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/CMakeLists.txt @@ -3,5 +3,9 @@ # if(NOT WIN32) add_subdirectory(cloud-daemon) - add_subdirectory(xbflash.qspi) + + if(XRT_ALVEO) + add_subdirectory(xbflash.qspi) + endif(XRT_ALVEO) + endif(NOT WIN32) diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt b/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt index aa459263ffb..716c70069c6 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt @@ -79,7 +79,9 @@ install (FILES ${XRT_HEADER_SRC} DESTINATION ${XRT_INSTALL_INCLUDE_DIR} COMPONENT ${XRT_DEV_COMPONENT} ) - -add_subdirectory(aws) -add_subdirectory(azure) -add_subdirectory(container) + +if (XRT_ALVEO) + add_subdirectory(aws) + add_subdirectory(azure) + add_subdirectory(container) +endif() diff --git a/src/runtime_src/core/tools/CMakeLists.txt b/src/runtime_src/core/tools/CMakeLists.txt index 5c5bacbc2d1..1b0432c9684 100644 --- a/src/runtime_src/core/tools/CMakeLists.txt +++ b/src/runtime_src/core/tools/CMakeLists.txt @@ -12,7 +12,7 @@ if (${XRT_NATIVE_BUILD} STREQUAL "yes") xrt_add_subdirectory(xbmgmt2) if(NOT WIN32) xrt_add_subdirectory(xbtop) - if (XRT_DKMS_ALVEO STREQUAL "ON") + if (XRT_ALVEO) xrt_add_subdirectory(xbflash2) endif() xrt_add_subdirectory(nagios)