Using the Template Makefile - 2022.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2022-12-07
Version
2022.2 English

A template Makefile is provided in the Vitis installation folder that can be included by your Makefile to greatly ease the development of custom Makefiles. The following describes variables required to use the template Makefile by your own Makefile:

# Accelerator source files (ie. Vitis HLS code, or vpp_acc code) 
# must be specified here; they will be processed by v++ --compile
ACC_SRCS  := src/conv_filter_acc.cpp
 
# Host source files are defined here:
HOST_SRCS := src/host.cpp src/function_cpu.cpp
 
# Include tool provided Makefile template:
include ${XILINX_VITIS}/system_compiler/examples/vpp_sc.mk

The build targets of the template Makefile include: all, run, build, clean, and ultraclean. A valid make command to build the design for hardware emulation (hw_emu) could be:

$ make DEVICE=<platform> TARGET=hw_emu build

A make command to run the target as well could be:

$ make DEVICE=<platform> TARGET=hw_emu run
Important: VSC uses g++ -dumpversion to get the version number of g++, and stops the build if the version is older than 7.1.0. However, on some OSes this command returns only the major version, for example version 7.5.0 is seen as version 7, and returns the following error:
vpp_sc.mk: Using /usr/bin/g++
vpp_sc.mk: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 <Installation path of Vitis 2022.2>/system_compiler/examples/vpp_sc.mk:29:
*** gcc version lower then 7.1.0 is not supported. Stop.

To resolve this error use the make command with GCC_VERSION=75000. In this case the version is returned as 75000 in the template Makefile, and the build will continue.