You can compile the embedded application by following the typical cross-compilation flow for the Arm Cortex-A72 processor.
In order to compile and link the host application to run on the Versal architecture board you must use the Vitis 2023.1 software.
The expectation is that you have completed the following setup:
- Install the Vitis 2023.1 software. The Vitis release includes all the embedded base platforms, including the VCK190 base platforms.
- In addition, ensure you have downloaded the Common Images for Embedded
Vitis Platforms from this link https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms/2023-1.html
The common image package contains a prebuilt Linux kernel and root file system that can be used with the Versal architecture board for embedded design development using Vitis.
- Unzip the Versal common image package.
- In a Bash shell, run the following script:
/Common Images Dir/xilinx-versal-common-v2023.1/environment-setup-cortexa72-cortexa53-xilinx-linux
This script sets up the
SDKTARGETSYSROOT
andCXX
variables.If the script is not present, you must run
/Common Images Dir/xilinx-versal-common-v2023.1/sdk.sh
.
Now you are ready to compile and link the host application.
Compiling the Host Application
CXX
variable. The following is an example command for compiling the PS
application:$CXX -std=c++17 -I${SDKTARGETSYSROOT}/usr/include/xrt/ -g -Wall -c -fmessage-length=0 -o host.o host.cpp
Many of the options in the preceding command are standard and can be found
in a description of the g++
command. The more
important options are listed as follows.
-
-std=c++17
-
-I${SDKTARGETSYSROOT}/usr/include/xrt/
-
-o host.o host.cpp
Linking the Host Application
CXX
variable. The following is an example command for linking the PS
application:$CXX -lxrt_coreutil -o host.exe host.o
xrt_coreutil
: Required library for linking for XRT API.
For compilation and linking for host code contains ADF API, see Compiling the Embedded Application for the Cortex-A72 Processor .