Skip to content

Using the Example Code

Before you build and run these examples, complete the following steps:

  1. Install the XRT distribution, as described in XRT Installation
  2. Obtain and install the license, as described in XRT Installation - License Installation
  3. As different systems install packages in different locations, you might need to update the env.sh file, which sets environment variables including PATH and LD_LIBRARY_PATH
  4. Load the env.sh file, using the following command:
    source /opt/iotech/xrt/bin/env.sh
    
  5. Copy the examples to a temporary directory, using the following command:
    cp -R /opt/iotech/xrt/examples .
    
  6. Navigate to the temporary directory, using the following command:
    cd examples
    
  7. If using the iotech-xrt-dev package, build the examples using the following command:
    make
    
  8. Navigate to the example you want to run. For example, to run the Container example, enter the following command:

    cd container
    

    Note

    The provided configuration data expects the test to be run from the location in which the config directory is available.

  9. Run XRT using the following command, where provides the location of the config folder and [<time_in_seconds>] allows you to define the time for which XRT is to run in seconds if required:

     xrt <config> [<time_in_seconds>]
    
    For example, to run the examples for five seconds, enter the following command:
    xrt config 5
    

Provided Examples

The following examples are provided:

Back to top