Intel® FPGA SDK for OpenCL™ Standard Edition: Programming Guide

ID 683342
Date 4/22/2019
Public
Document Table of Contents

6.6.3.2. Linking to the ICD Loader Library on Linux

Before linking your Linux OpenCL™ host application to the ICD Loader Library, ensure that you have set up FCD correctly. The Intel® FPGA SDK for OpenCL™ utility aocl link-config will then automatically output the required flags for linking to the ICD Loader Library.
  1. If you need to manually set up FCD support for your Custom Platform, perform the following tasks:
    1. Consult with your board vendor to identify the libraries that the FCD requires. Alternatively, you can invoke the aocl ldlibs command and identify the libraries that your OpenCL application requires.
    2. Ensure that the file /opt/Intel/OpenCL/Boards/my_board.fcd exists in your Custom Platform and contains the name of the vendor-specific libraries (for example, /data/board_vendor_a/libmy_board_mmd.so).
      The FCD loader scans the contents of the .fcd file and then loads the library libmy_board_mmd.so file from the board_vendor_a folder.
  2. For Cyclone V SoC boards, when you build the SD flash card image for your Custom Platform, create an Altera.icd file containing the text libalteracl.so. Store the Altera.icd file in the /etc/OpenCL/vendors directory of your Custom Platform.
    Refer to Building an SD Flash Card Image section of the Intel® FPGA SDK for OpenCL™ Cyclone V SoC Development Kit Reference Platform Porting Guide for more information.
Attention: If your host application fails to run while linking to the ICD, ensure that the file /etc/OpenCL/vendors/Altera.icd matches the file found in the directory that INTELFPGAOCLSDKROOT specifies. The environment variable INTELFPGAOCLSDKROOT points to the location of the SDK installation. If the files do not match, or if it is missing from /etc/OpenCL/vendors, copy the Altera.icd file from INTELFPGAOCLSDKROOT to /etc/OpenCL/vendors.