Intel® FPGA RTE for OpenCL™ Standard Edition: Getting Started Guide

ID 683550
Date 9/24/2018
Public
Document Table of Contents

2.7.1. Building the Host Application

The <path_to_exm_opencl_hello_world_x64_windows_<version>>\hello_world\hello_world.sln file contains the host solution. After you open this .sln file in Microsoft Visual Studio, you can build the OpenCL™ host application in the main.cpp file.
If you are using Microsoft Visual Studio, you need the FCD, and the Installable Client Driver (ICD) from Khronos. To set up Microsoft Visual Studio with FCD and ICD, perform the following tasks prior to building the host application:
  1. Verify that FCD and ICD are set up correctly. You must set up FCD and ICD manually if invoking the aocl install <path_to_customplatform> utility command fails to set them up. For instructions, refer to the Accessing Custom Platform-Specific Functions and Linking to the ICD Loader Library on Windows sections of the Intel® FPGA RTE for OpenCL™ Standard Edition Programming Guide for more information.
  2. Link the host application to the OpenCL.lib library.
    1. Under the solution properties, select Configuration Properties > Linker > Input.
    2. In the Additional Dependencies field, enter OpenCL.lib.
    Attention: Because you are using FCD and ICD, do not link the host program to alteracl.lib or to your Custom Platform's MMD libraries directly.
To build the hello_world host application, perform the following tasks:
  1. Open the <path_to_exm_opencl_hello_world_x64_windows_<version>>\hello_world\hello_world.sln file in Microsoft Visual Studio.
  2. Verify that the build configuration is correct. The default build configuration is Debug, but you can use Release. You must select the appropriate option as the solution platform (for example, for x64 architecture, select x64).
  3. Build the solution by selecting the Build > Build Solution menu option, or by pressing the F7 key.
    The hello_world.exe executable will be in the <path_to_exm_opencl_hello_world_x64_windows_<version>>\hello_world\bin folder.
  4. Verify that the build is correct. An output ending with a message similar to the one shown below notifies you of a successful build:
    1> Build succeeded.
    1>
    1> Time Elapsed 00:00:03:29
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    Attention: You can ignore the LNK4009: PDB 'vc90.pdb' was not found with... warnings because they have no effect on the build. The compiler might issue this type of warning messages if you have built your Windows libraries using a previous version of Microsoft Visual Studio.