XOCC (Xilinx OpenCL Compiler) Command Line Utility

The Xilinx® OpenCL™ Compiler (xocc) is a standalone command line utility for compiling kernel accelerator functions and linking them with the SDAccel™ environment supported platforms. This section describes the xocc link and compile commands. All commands are provided in the following sections:
The first activity in building any system is to select an acceleration platform supported by Xilinx or third-party providers and to compile a kernel accelerator function using the -c/--compile option.
TIP: The default output name for the .xo file is a.xo; rename the file to reflect the kernel name.

The -c/--compile command syntax is as follows:

xocc -c --platform <platform_name> <kernel_source_file> -o <xo_kernel_name>.xo
TIP: OpenCL uses the kernel keyword within the OpenCL file to identify a kernel. For C/C++ kernels, you need to provide the kernel name by --kernel <kernel_name>.
The second activity is to link one or more kernels into the platform to create the binary container xclbin file using the -l/--link option.
TIP: The default output name for the xclbin file is a.xclbin; rename it as needed.

The -l/--link command syntax is as follows:

xocc -l --platform <platform_name> <xo_kernel1_name>.xo \ [<xo_kernel2_name>.xo ..] -o <xclbin_name>.xclbin
For a list of supported platforms, see the release notes for the product you are using: .
IMPORTANT!: All examples in the SDAccel installation use the Makefile to compile OpenCL applications with xcpp and xocc commands that can be used as references for compiling user applications.