Skip to content

Commit

Permalink
Merge branch 'Xilinx:master' into client_port_trace_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
vipangul authored Feb 5, 2025
2 parents 5db8bdc + 4d5ba1b commit f4ee9dc
Show file tree
Hide file tree
Showing 119 changed files with 28,252 additions and 2,055 deletions.
20 changes: 16 additions & 4 deletions build/build-win22.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BUILDDIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
CORE=`grep -c ^processor /proc/cpuinfo`

CMAKE="/mnt/c/Program Files/CMake/bin/cmake.exe"
CPACK="/mnt/c/Program Files/CMake/bin/cpack.exe"
EXT_DIR=/mnt/c/Xilinx/xrt/ext.new
BOOST=$EXT_DIR
KHRONOS=$EXT_DIR
Expand All @@ -28,6 +29,7 @@ usage()
echo "[-j <n>] Compile parallel (default: system cores)"
echo "[-dbg] Build debug library (default: optimized)"
echo "[-all] Build debug and optimized library (default: optimized)"
echo "[-sdk] Create NSIS XRT SDK NPU Installer (requires NSIS installed)."

exit 1
}
Expand All @@ -38,6 +40,7 @@ nocmake=0
noabi=0
dbg=0
release=1
sdk=0
alveo_build=0
npu_build=0
base_build=0
Expand Down Expand Up @@ -110,6 +113,12 @@ while [ $# -gt 0 ]; do
cmake_flags+=" -DDISABLE_ABI_CHECK=1"
shift
;;
-sdk)
shift
npu_build=1
cmake_flags+=" -DXRT_NPU=1"
sdk=1
;;
*)
echo "unknown option '$1'"
usage
Expand Down Expand Up @@ -139,17 +148,15 @@ cmake_flags+=" -DMSVC_PARALLEL_JOBS=$jcore"
cmake_flags+=" -DKHRONOS=$KHRONOS"
cmake_flags+=" -DBOOST_ROOT=$BOOST"

echo "${cmake_flags[@]}"

if [ $dbg == 1 ]; then
cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
mkdir -p WDebug
cd WDebug

if [ $nocmake == 0 ]; then
echo "${cmake_flags[@]}"
"$CMAKE" -G "Visual Studio 17 2022" $cmake_flags ../../src
fi
"$CMAKE" --build . --verbose --config Debug
"$CMAKE" --build . --verbose --config Debug --target install
cd $BUILDDIR
fi
Expand All @@ -159,10 +166,15 @@ if [ $release == 1 ]; then
mkdir -p WRelease
cd WRelease
if [ $nocmake == 0 ]; then
echo "${cmake_flags[@]}"
"$CMAKE" -G "Visual Studio 17 2022" $cmake_flags ../../src
fi
"$CMAKE" --build . --verbose --config Release
"$CMAKE" --build . --verbose --config Release --target install

if [[ $sdk == 1 && $npu_build == 1 ]]; then
echo "Creating SDK installer ..."
"$CPACK" -G NSIS -C Release
fi
cd $BUILDDIR
fi

Expand Down
30 changes: 18 additions & 12 deletions build/build22.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set DEBUG=1
set RELEASE=1
set EXT_DIR=C:/Xilinx/XRT/ext.new
set CREATE_PACKAGE=0
set CREATE_SDK=0
set CMAKEFLAGS=
set NOCMAKE=0
set NOCTEST=0
Expand Down Expand Up @@ -39,6 +40,16 @@ IF DEFINED MSVC_PARALLEL_JOBS ( SET LOCAL_MSVC_PARALLEL_JOBS=%MSVC_PARALLEL_JOBS
if [%1] == [-opt] (
set DEBUG=0
) else (
if [%1] == [-npu] (
set CMAKEFLAGS=%CMAKEFLAGS% -DXRT_NPU=1
) else (
if [%1] == [-noabi] (
set CMAKEFLAGS=%CMAKEFLAGS% -DDISABLE_ABI_CHECK=1
) else (
if [%1] == [-sdk] (
set CREATE_SDK=1
set CMAKEFLAGS=%CMAKEFLAGS% -DXRT_NPU=1
) else (
if [%1] == [-pkg] (
set CREATE_PACKAGE=1
) else (
Expand Down Expand Up @@ -66,7 +77,7 @@ IF DEFINED MSVC_PARALLEL_JOBS ( SET LOCAL_MSVC_PARALLEL_JOBS=%MSVC_PARALLEL_JOBS
) else (
echo Unknown option: %1
goto Help
)))))))))))))
))))))))))))))))
shift
goto parseArgs

Expand Down Expand Up @@ -95,13 +106,16 @@ ECHO.
ECHO [-help] - List this help
ECHO [-clean] - Remove build directories
ECHO [-dbg] - Creates a debug build
ECHO [-noabi] - Do not compile with ABI version check (make incremental builds faster)
ECHO [-opt] - Creates a release build
ECHO [-sdk] - Create NSIS XRT SDK Installer for NPU (requires NSIS installed).
echo [-package] - Packages the release build to a MSI archive.
ECHO Note: Depends on the WIX application.
ECHO [-xclmgmt arg] - The directory to the xclmgmt drivers (used with [-package])
ECHO [-xocluser arg] - The directory to the xocluser drivers (used with [-package])
ECHO [-xclmgmt2 arg] - The directory to the xclmgmt2 drivers (used with [-package])
ECHO [-xocluser2 arg] - The directory to the xocluser2 drivers (used with [-package])
ECHO [-npu] - Build NPU component of XRT (deployment and development)
ECHO [-hip] - Enable hip library build
GOTO:EOF

Expand Down Expand Up @@ -133,9 +147,6 @@ if [%NOCMAKE%] == [0] (
IF errorlevel 1 (POPD & exit /B %errorlevel%)
)

cmake --build . --verbose --config Debug
IF errorlevel 1 (POPD & exit /B %errorlevel%)

cmake --build . --verbose --config Debug --target install
IF errorlevel 1 (POPD & exit /B %errorlevel%)

Expand Down Expand Up @@ -177,21 +188,16 @@ if [%NOCMAKE%] == [0] (
IF errorlevel 1 (POPD & exit /B %errorlevel%)
)

cmake --build . --verbose --config Release
IF errorlevel 1 (POPD & exit /B %errorlevel%)

cmake --build . --verbose --config Release --target install
IF errorlevel 1 (POPD & exit /B %errorlevel%)

ECHO ====================== Zipping up Installation Build ============================
cpack -G ZIP -C Release

if [%CREATE_PACKAGE%] == [1] (
ECHO ====================== Creating MSI Archive ============================
cpack -G WIX -C Release
if [%CREATE_SDK%] == [1] (
ECHO ====================== Creating SDK Installer ============================
cpack -G NSIS -C Release
)

popd
GOTO:EOF


2 changes: 1 addition & 1 deletion build/petalinux.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# When updating Petalinux build please file a SH ticket to retain the build
# https://jira.xilinx.com/secure/CreateIssue!default.jspa
PETALINUX=/proj/petalinux/2025.1/petalinux-v2025.1_01061007/tool/petalinux-v2025.1-final
PETALINUX=/proj/petalinux/2025.1/petalinux-v2025.1_01271330/tool/petalinux-v2025.1-final
35 changes: 15 additions & 20 deletions src/CMake/components.cmake
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.

# Custom variables imported by this CMake stub which should be defined by parent CMake:
# LINUX_FLAVOR

if (NOT WIN32)
if (${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)")
set (XRT_DEV_COMPONENT_SUFFIX "dev")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos)")
set (XRT_DEV_COMPONENT_SUFFIX "devel")
endif()
else()
set(LINUX_FLAVOR "none")
endif()
# Custom variables imported by this CMake stub which should be defined
# by parent CMake: LINUX_FLAVOR

# The default XRT build is legacy
if (NOT XRT_BASE AND NOT XRT_NPU AND NOT XRT_ALVEO)
message("-- Defaulting to legacy XRT build")
set(XRT_XRT 1)
endif()

if (NOT WIN32 AND ${LINUX_FLAVOR} MATCHES "^(ubuntu|debian|rhel|centos)")
if (NOT WIN32)
if (${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)")
set (XRT_DEV_COMPONENT_SUFFIX "dev")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos)")
set (XRT_DEV_COMPONENT_SUFFIX "devel")
set (XRT_DEV_COMPONENT_SUFFIX "-dev")
elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|fedora)")
set (XRT_DEV_COMPONENT_SUFFIX "-devel")
endif()
endif()

# NSIS packager cannot handle '-' in component names
if (WIN32)
set (XRT_DEV_COMPONENT_SUFFIX "_dev")
endif()

# Enable development package by specifying development component name
# If XRT_{PKG}_DEV_COMPONENT is same XRT_{PKG}_COMPONENT then only
# that package is created with both development and run-time content.
Expand Down Expand Up @@ -71,7 +66,7 @@ if (XRT_BASE)
# been explicitly marked for base
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "base")
set (XRT_BASE_COMPONENT "base")
set (XRT_BASE_DEV_COMPONENT "base-${XRT_DEV_COMPONENT_SUFFIX}")
set (XRT_BASE_DEV_COMPONENT "base${XRT_DEV_COMPONENT_SUFFIX}")

# Tempoary fix for cpackLin conditionally adding dependencies for
# legacy XRT when XRT_DEV_COMPONENT equals "xrt". We don't want the
Expand All @@ -88,9 +83,9 @@ if (XRT_NPU)
# been explicitly marked alveo or npu
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "npu")
set (XRT_COMPONENT "npu")
set (XRT_DEV_COMPONENT "npu")
set (XRT_BASE_COMPONENT ${XRT_COMPONENT})
set (XRT_BASE_DEV_COMPONENT ${XRT_DEV_COMPONENT})
set (XRT_DEV_COMPONENT "npu${XRT_DEV_COMPONENT_SUFFIX}")
set (XRT_BASE_COMPONENT "base")
set (XRT_BASE_DEV_COMPONENT "base${XRT_DEV_COMPONENT_SUFFIX}")
endif(XRT_NPU)

# Alveo builds one Alveo package for both deployment and development
Expand Down
44 changes: 44 additions & 0 deletions src/CMake/cpack-windows-sdk.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
cmake_minimum_required(VERSION 3.20)

set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "XDNA RunTime stack for use with AMD FPGA and NPU platforms")

set(CPACK_PACKAGE_NAME "XRT SDK")
set(CPACK_PACKAGE_VERSION_RELEASE "${XRT_VERSION_RELEASE}")
set(CPACK_PACKAGE_VERSION "${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION_MAJOR "${XRT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${XRT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${XRT_VERSION_PATCH}")
set(CPACK_REL_VER "windows")
set(CPACK_ARCH "x86_64")

set(CPACK_ARCHIVE_COMPONENT_INSTALL 1)
set(CPACK_PACKAGE_FILE_NAME "xrtsdk-${CPACK_PACKAGE_VERSION}-${CPACK_REL_VER}-${CPACK_ARCH}")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "XRT")
set(CPACK_NSIS_PACKAGE_NAME "XRT SDK ${CPACK_PACKAGE_VERSION}")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_MENU_LINKS "")

# Initialize CPACK_COMPONENTS_ALL variable to just the SDK
# component, which is base-dev
set(CPACK_COMPONENTS_ALL "base_dev")
set(CPACK_ARCHIVE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})

message("-- ${CMAKE_BUILD_TYPE} ${PACKAGE_KIND} package")

include(CPack)

cpack_add_component(base_dev
DISPLAY_NAME "XRT SDK"
DESCRIPTION "XRT software development kit with header files and link libraries for application development."
GROUP Development
)

cpack_add_component_group(Development
EXPANDED
DESCRIPTION "XRT Software Development Kits"
)
Loading

0 comments on commit f4ee9dc

Please sign in to comment.