xbtest build

Introduction

The AVED release on GitHub includes an AVED/sw folder which contains both the AVED/sw/AMI and AVED/sw/xbtest source folders.

This allows for user modification of source if needed and the ability to rebuild packages and executables to include these modifications.

AMI regeneration is included in the AMI Architecture within the AMI README document; xbtest executable and package regeneration is outlined here.

AVED Release Source

Within the AVED github repo sw branch (AVED/sw/), the source used to recreate the .rpm and .deb packages and the xbtest executable are included, therefore enabling a rebuild of xbtest if either the AMI source or the xbtest source is changed by the user.

github repo folder structure

AVED/sw/xbtest
├── rpm_generate
│   └── build
│       └── license
└── sw
    ├── include
    │   ├── api
    │   ├── share
    │   ├── xbtest_common
    │   └── xbtest_sw
    └── src
        ├── api
        ├── share
        ├── xbtest_common
        └── xbtest_sw

Rebuild options

1. Executable rebuild

Simple xbtest executable regeneration instructions are included below.

For more detailed xbtest documentation and usage of makefile, see: xbtest user guide.


xbtest executable is built using the makefile included in the AVED/sw/xbtest/sw folder.** **
[user@server sw]$ pwd
/<local_aved_tests>/AVED/sw/xbtest/sw
[user@server sw]$ make help

INFO: [XBTEST_MAKEFILE-1] The following rules are available:
INFO: [XBTEST_MAKEFILE-1]          - ./output/libxbtest.a : Generate libxbtest.a archive
INFO: [XBTEST_MAKEFILE-1]          - ./output/xbtest : Only link the compiled object and generate the xbtest executable
INFO: [XBTEST_MAKEFILE-1]          - ./output/xbtest_debug : Only link the compiled object and generate the xbtest debug executable
INFO: [XBTEST_MAKEFILE-1]          - all : Generate all output above
INFO: [XBTEST_MAKEFILE-1]          - clean : Remove output directory
INFO: [XBTEST_MAKEFILE-1]          - check : Run clang-tidy tool
INFO: [XBTEST_MAKEFILE-1]          - info : Print makefile info
INFO: [XBTEST_MAKEFILE-1]          - help : Print this message

INFO: [XBTEST_MAKEFILE-1] The following inputs are available:
INFO: [XBTEST_MAKEFILE-1]          - ami              : Build for AMI (default)
INFO: [XBTEST_MAKEFILE-1]          - ami_cflags       : Compile flags for AMI
INFO: [XBTEST_MAKEFILE-1]          - ami_libs         : Link flags for AMI
INFO: [XBTEST_MAKEFILE-1]          - xrt              : Build for XRT instead of AMI
INFO: [XBTEST_MAKEFILE-1]          - xrt_cflags       : Compile flags for XRT
INFO: [XBTEST_MAKEFILE-1]          - xrt_libs         : Link flags for XRT
INFO: [XBTEST_MAKEFILE-1]          - no_driver        : DEBUG - Use low level peek-poke instead of AMI (default) and do not get sensors (only supported for xbtest debug executable)
INFO: [XBTEST_MAKEFILE-1]          - internal_release : Attach 'INTERNAL' flags in the host application
INFO: [XBTEST_MAKEFILE-1]          - build_version    : Build version used as #define preprocessor directive
INFO: [XBTEST_MAKEFILE-1]          - build_date       : Build date used as #define preprocessor directive
INFO: [XBTEST_MAKEFILE-1]          - debug            : Build host application with debug info to run application with debbuger
INFO: [XBTEST_MAKEFILE-1]          - code_coverage    : Enable --coverage g++ option
INFO: [XBTEST_MAKEFILE-1]          - checks           : Use 'make check' to run clang-tidy. Define clang-tidy option providing 'checks=<opt>' or use default

Below is an example of the make command that is used to recreate the xbtest_sw executable. In the example shown, the version aligns to the value in the AVED/sw/xbtest/xbtest_sw_version.json file.

This will recreate the xbtest executable in an AVED/sw/xbtest/sw/output folder, which can be used to replace the existing xbtest executable in the installation.

For any changes made to the source by the user a new <build_version> number should be created to provide tracking of changes to xbtest source, diverging from the AMD provided source lineup.

make -j build_version=4023995 build_date="Fri Oct 13 08:22:31 2023"

...............
...............

INFO: [XBTEST_MAKEFILE-5] Host application generated: ./output/xbtest

  1. Package regeneration

xbtest sw packages are rebuilt using the gen_rpm.py file - included in the AVED/sw/xbtest/rpm_generate/ folder.
Pre-requisites:
  • Prebuilt ami_package must be installed on HOST for the gen_rpm to complete. If AMI has changed - please refer to documentation to rebuild and install the ami package for appropriate environment.

  • python3 is installed on host.


From the AVED/sw/xbtest/rpm_generate folder, run the gen_rpm.py script. For most applications no switches will be needed, python3 ./gen_rpm.py.

This will create a new xbtest package in the ./output/<date&time>/ folder (unless a specific folder has been specified in the –output_dir switch) in the format below.


xbtest_7.0-<pkg_release>_amd64_22.04.deb for Ubuntu installation (ubuntu 22.04 in this case)
or
xbtest-7.0-<pkg_release>.x86_64_8.x.rpm for RedHat installation

The created package should then be installed on the HOST, removing the original package, following standard package removal/installation instructions as appropriate.

[user@server rpm_generate]$ pwd
/<local_aved_tests>/AVED/sw/xbtest/rpm_generate
[user@server rpm_generate]$ python3 ./gen_rpm.py --help
INFO: [GEN_RPM-53] Command line provided: $ /bin/python3 ./gen_rpm.py --help
INFO: [GEN_RPM-54] Parsing command line options
INFO: [GEN_RPM-54]      --help
INFO: [GEN_RPM-6] Usage: $ python3 gen_rpm.py [options]
INFO: [GEN_RPM-6]       --help              / -h: Display this message
INFO: [GEN_RPM-6]       --version           / -v: Display version
INFO: [GEN_RPM-6]       --verbose           / -V: Turn on verbosity
INFO: [GEN_RPM-6]       --force             / -f: Override output directory if already existing
INFO: [GEN_RPM-6]       --output_dir        / -o: Path to the output directory. Default ./output/<date>_<time>/
INFO: [GEN_RPM-6]       --pkg_release       / -r: Package release. Default 4023995
INFO: [GEN_RPM-6]       --g_code_coverage   / -C: Compile host application with --code_coverage flag
INFO: [GEN_RPM-6]       --g_debug           / -d: Compile host application with debug flag to include symboles for debugger
INFO: [GEN_RPM-6]       --use_xrt           / -X: Generate xbtest which use XRT. (use AMI by default)
INFO: [GEN_RPM-6] Examples:
INFO: [GEN_RPM-6]        python3 gen_rpm.py
INFO: [GEN_RPM-6] Expects XRT or AMI installed on host

Page Revision: v. 30