Skip to content

1. Install

Ciro Luiz Araujo Ceissler edited this page Apr 13, 2018 · 15 revisions

Using directly from the source might be useful if you want to contribute to HardCloud or if you want to use the last feature without waiting for a release. The following tutorial considers that $WORKSPACE environment variable contains the path to the folder you want to work in and $INSTALL_PATH the installation path.

Tools

The HardCloud project uses the following tools:

  • Intel FPGA Quartus 17.1
  • ModelSim Altera Edition 17.1

For more information about these tools, access Intel FPGA.

HardCloud

Library Dependency

Install the following libraries dependencies:

  • uuid
  • json-c
  • boost_program_options
  • libelf
  • libffi

Repository

Clone the HardCloud repository with all dependencies:

$ cd ${WORKSPACE}
$ git clone git@github.com:omphardcloud/hardcloud.git --recursive

Install Intel OPAE SDK

OPAE is the Open Programmable Acceleration Engine, a software framework for managing and accessing programmable accelerators (FPGAs). The OPAE SDK is a collection of libraries and tools to facilitate the development of software applications and accelerators using OPAE.

$ mkdir -p $WORKSPACE/hardcloud/opae-sdk/build
$ cd $WORKSPACE/hardcloud/opae-sdk/build
$ cmake -DBUILD_ASE=1 -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
$ make
$ make install

For more information, access OPAE.

Install Intel BBB_cci_mpf

This basic building block (BBB) is a shim to transform the CCI-P interface to add new features. The Memory Properties Factory (MPF) includes the following features: virtual memory, ordered read responses, read/write hazard detection, and masked (partial) writes.

$ mkdir -p $WORKSPACE/hardcloud/intel-fpga-bbb/BBB_cci_mpf/sw/build
$ cd $WORKSPACE/hardcloud/intel-fpga-bbb/BBB_cci_mpf/sw/build
$ cmake -DOPAELIB_INC_PATH=${INSTALL_PATH}/include \
    -DOPAELIB_LIBS_PATH=${INSTALL_PATH}/lib \
    -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} ..
$ make
$ make install

For more information, access Intel FPGA BBB.

Install LLVM/Clang LSC-OpenMP

The LLVM/Clang LSC-OpenMP is a version of the original compiler that works with OpenMP offloading library, called libomptarget. The libomptarget handles the OpenMP 4.x target directive in an agnostic manner. Moreover, the Intel FPGA HARP selection is identified by the device directive that will execute a specific plugin that manages the communication via the OPAE library.

$ ln -s $WORKSPACE/hardcloud/clang  $WORKSPACE/hardcloud/llvm/tools/
$ ln -s $WORKSPACE/hardcloud/openmp $WORKSPACE/hardcloud/llvm/projects/
$ mkdir -p $WORKSPACE/hardcloud/llvm/build
$ cd $WORKSPACE/hardcloud/llvm/build
$ cmake -DOPENMP_ENABLE_LIBOMPTARGET=ON      \
  -DCMAKE_BUILD_TYPE="release"               \
  -DOPAE=${INSTALL_PATH}                     \
  -DBBB_CCI_MPF=${INSTALL_PATH}              \
  -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} ..
$ make
$ make install

For more information, access Building LLVM with CMake and repository to LLVM/CLang with support to HardCloud.

Configure

Create the following script, $WORKSPACE/setup.hardcloud, to configure the environment:

#!/usr/bin/env bash

# configure llvm
export LLVM=${INSTALL_DIR}

# configure opae
export OPAE_BASEDIR=${INSTALL_DIR}/opae-sdk

# configure quartus
export QUARTUS_HOME=$ALTERA_PATH/quartus
export QUARTUS_ROOTDIR=$QUARTUS_HOME
export QUARTUS_64BIT=1
export QUARTUS_ROOTDIR_OVERRIDE=$QUARTUS_HOME

# configure modelsim
export MTI_HOME=$MODELSIM_PATH/modelsim_ae
export QUESTA_HOME=${MTI_HOME}/linux

# set library path
export LD_LIBRARY_PATH=${INSTALL_PATH}/lib:$LD_LIBRARY_PATH

# set path
export PATH="${PATH}:$QUARTUS_HOME/bin:$QUESTA_HOME"

# configure license
export QUARTUS_LICENSE=""
export MGLS_LICENSE=""
export LM_LICENSE_FILE="${QUARTUS_LICENSE}:${MGLS_LICENSE}"

# configure simulator
export ASE_WORKDIR=$WORKSPACE/hardcloud/ase/work