Compiling Intel® oneAPI DPC++ FPGA Designs on Red Hat Enterprise Linux (RHEL)* 7.4 OS (Kernel 3.10)

Published: 09/25/2020  

Last Updated: 09/01/2021

The Intel® FPGA Add-on for oneAPI Base Toolkit does not officially support the Red Hat Enterprise Linux (RHEL) 7.4 OS (kernel 3.10). However, if you want to compile your FPGA designs on RHEL 7.4 OS, follow the instructions listed in this document.

NOTE: AC data types cannot run in the emulation flow on RHEL 7 systems. They provide support for variable-precision integers and variable-precision floating-point data types. For more information, see Variable-Precision Integer and Floating-Point Support section in the Intel® oneAPI DPC++ FPGA Optimization Guide.

1 Install Required Dependencies

1.1 Install the Extra Packages for Enterprise Linux (EPEL) Repository

FPGA add-on packages might require you to enable the Extra Packages for Enterprise Linux (EPEL) repository. Enable the repository by installing the epel-release-latest package using the following command:

$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Alternatively, contact your system administrator for support.

1.2 Install Open Programmable Application Engine (OPAE)-Specific Package Dependencies

Before you install and build the Open Programmable Application Engine (OPAE) software, you must install the required package dependencies by running the following commands:

$ sudo yum install gcc gcc-c++ make autoconf automake \ 
  libxml2 libxml2-devel json-c-devel boost ncurses ncurses-devel \ 
  ncurses-libs boost-devel libuuid libuuid-devel python2-jsonschema \
  doxygen hwloc-devel libpng12 rsync python2-pip tbb-devel
$ sudo pip install intelhex
$ sudo yum install -y python36 python36-pip
$ sudo yum install redhat-lsb-core

NOTE: These install commands install only the missing packages.

2 Install CMake Version 3.4 or Higher (for 2021.3 release and later) 

With the Intel® oneAPI Base Toolkit version 2021.3 release, oneAPI FPGA code samples require CMake version 3.4 or higher. Perform these steps to ensure your system meets the requirements:

  1. Verify the CMake software version installed on the system.
    $ yum info cmake

    If the CMake software version is 3.4 or higher, skip the remaining steps and proceed to Install GCC 7.4. Otherwise, uninstall CMake.

    $ sudo yum remove cmake -y
  2. Download the cmake-3.4.0.tar.gz file or a higher version of CMake from https://cmake.org/download.
    $ wget https://cmake.org/files/v3.4/cmake-3.4.0.tar.gz
  3. Extract the contents of the tar file and change the directory.
    $ tar -xvzf cmake-3.4.0.tar.gz
    $ cd cmake-3.4.0
  4. Execute the following commands to compile and install the newer version of CMake in the /usr/local/bin directory:   
    $ sudo ./bootstrap --prefix=/usr/local
    $ sudo make
    $ sudo make install
  5. Add the /usr/local/bin path to the PATH environment variable to use the newly installed CMake version. 

    $ export PATH=/usr/local/bin:$PATH

    If you want this change to apply to all future sessions, add it to the ~/.bashrc file. 

  6. Check the CMake version.

    $ cmake --version

3 Install GCC 7.4 

Ensure that you have GCC 7.4 installed from the source. Follow these steps to compile the source code and setup GCC 7.4 on your Linux system: 

  1. Download GCC 7.4.0 tarball by using the following command: 
    $ wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-7.4.0/gcc-7.4.0.tar.gz
  2. Unpack the tar archive and change the current working directory.
    $ tar zxf gcc-7.4.0.tar.gz
    $ cd gcc-7.4.0
    
  3. Install the bzip2 package.

    $ yum -y install bzip2
    
  4. Run the download_prerequisites script to download prerequisites required by the GCC. It would be best if you run the script from the top level of the GCC source tree.

    $ ./contrib/download_prerequisites
    
  5. Configure the GCC build environment.

    $ ./configure --disable-multilib --enable-languages=c,c++
  6. Compile the source code. It may take a few hours for the compilation to complete.

    $ make -j 4
    $ make install
  7. After the compilation process is complete, check if the GCC is properly installed. The output should report GCC 7.4.0.

    $ gcc --version

4 Install the Intel® FPGA Add-on for oneAPI Base Toolkit Package

To install the Intel® FPGA Add-on for oneAPI Base Toolkit, follow these instructions:

  1. Perform the installation steps provided in the Intel® oneAPI Toolkits Installation Guide for Linux to install the Intel® oneAPI Base Toolkit.  
  2. Depending on the FPGA board you want to use, follow the instructions in Install the Intel® FPGA Add-on for oneAPI Base Toolkit Package to install the FPGA Add-on package.

5 Compile the FPGA Design on RHEL 7.4 OS

Once you have set up the FPGA board (Intel® Programmable Acceleration Card (PAC) with Intel® Arria® 10 GX FPGA or Intel® FPGA PAC D5005) and the system with the required configurations, ensure that you have set the required environment variables and the Intel® oneAPI DPC++/C++ Compiler uses GCC 7.4.0. Then, compile your FPGA design. Refer to the following sections for more information.

5.1 Set the Environment Variables

For working in a command-line interface (CLI), tools in the oneAPI toolkits are configured via environment variables. Set up your CLI environment by sourcing the setvars script. Use the following commands to source the required environment before compiling by running the following commands:

$ cd /opt/intel/oneapi or <your own oneAPI base toolkit installation path>
$ source setvars.sh

5.2 Direct the Compiler to Use GCC 7.4.0  

When compiling (for example, on Intel® FPGA PAC D5005), the Intel® oneAPI DPC++/C++ Compiler attempts to use the default GCC version (which, in this case, is GCC version 4.8.5 for RHEL 7.4) on an OS. Your FPGA design compilation might fail with C++ library linking errors if the compiler fails to use the GCC version 7.4.0. To direct the compiler to use the correct version of GCC installed on the system, use the =--gcc-toolchain= flag in your dpcpp command.

If you are compiling an Intel oneAPI code sample using the cmake command, pass the --gcc-toolchain flag to the dpcpp compiler command using the define argument -DCMAKE_CXX_FLAGS=--gcc-toolchain= in the cmake command. 

For example, on Intel® FPGA PAC D5005: 

$ cmake .. -DFPGA_BOARD=intel_s10sx_pac:pac_s10 -DCMAKE_CXX_FLAGS=--gcc-toolchain=/usr/local 

References

Notices and Disclaimers

Intel® technologies may require enabled hardware, software, or service activation.

No product or component can be absolutely secure.

Your costs and results may vary.

© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.

No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.

The products described may contain design defects or errors known as errata, which may cause the product to deviate from published specifications. Currently characterized errata are available on request.

Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from a course of performance, course of dealing, or usage in trade.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.