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 software.
The expectation is that you have completed the following setup:
- Install the Vitis 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.
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-v2025.1/environment-setup-cortexa72-cortexa53-amd-linuxThis script sets up the
SDKTARGETSYSROOTandCXXvariables.If the script is not present, you must run
/Common Images Dir/xilinx-versal-common-v2025.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 as follows:
-
--std=c++17 -
-I${SDKTARGETSYSROOT}/usr/include/xrt/ -
-o host.o host.cpp
--std option, use --std=c++17 or later, as XRT code relies on C++17 features. 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.
v++ --package command. Details on
building and running the Versal device system
using the Vitis tool flow is described in
Building and
Running the System in the
Data
Center Acceleration using Vitis (UG1700)
.