.. index:: double: install; toolchain; OmpSs@FPGA .. _install-ompssatfpga-toolchain: Install OmpSs\@FPGA toolchain ::::::::::::::::::::::::::::: This page should help you install the OmpSs@FPGA toolchain. However, it is preferred using the pre-build Docker image with the latest stable toolchain. They are available at DockerHUB (https://hub.docker.com/r/bscpm/ompss_at_fpga). Moreover, we distribute pre-built SD images for some SoC. Do not hesitate to contact us at if you need help. First, it describes the prerequisites to do the toolcahin installation. After that, the following sections explain different approaches to do the installation. Prerequisites ============= - Git Large File Storage (https://git-lfs.github.com/) - Python 3.5 or later (https://www.python.org/) - Vendor backends: - Xilinx Vivado 2018.3 or later (https://www.xilinx.com/products/design-tools/vivado.html) Git Large File Storage ---------------------- AIT repository uses Git Large File Storage to handle relatively-large files that are frequently updated (i.e. hardware runtime IP files) to avoid increasing the history size unnecessarily. You must install it so Git is able to download these files. Follow instructions on their website to install it. Vendor backends - Xilinx Vivado ------------------------------- Follow installation instructions from Xilinx Vivado, VivadoHLS and SDK, as well as the device support for the devices you're working, should be enabled during setup. However, components can be added or removed afterwards. Stable release ============== There is a meta-repository that points to latest stable version of all tools: https://github.com/bsc-pm-ompss-at-fpga/ompss-at-fpga-releases. It contains a Makefile that based on some environment variables will compile and install the toolchain. The evironment variables are: * ``TARGET`` [Def: ``aarch64-linux-gnu``] Linux architecture that toolchain will target * ``PREFIX_HOST`` [Def: ``/``] Installation prefix for the host tools (e.g. mcxx, ait) * ``PREFIX_TARGET`` [Def: ``/``] Installation prefix for the target tools (e.g. nanox, libxdma) * ``EXTRAE_HOME`` [Def: ] (Optional) Extrae installation path * ``BUILDCPUS`` [Def: ``nproc``] Number of processes used for building The following example will cross-build the toolchain for the `aarch64-linux-gnu` architecture and install it in ``/opt/bsc/host-arm64/ompss`` and ``/opt/bsc/arm64/ompss``: .. code:: bash git clone --recursive https://github.com/bsc-pm-ompss-at-fpga/ompss-at-fpga-releases.git cd ompss-at-fpga-releases export TARGET=aarch64-linux-gnu export PREFIX_HOST=/opt/bsc/host-arm64/ompss export PREFIX_TARGET=/opt/bsc/arm64/ompss make Individual git repos ==================== The master branches of all tools should generate a compatible toolchain. Each package should contain information about how to compile/install itself, look for the README files. The following points briefly describe each tool and provide a possible build configuration/setup for each one. We assume that all packages will be installed in a Linux OS in the ``/opt/bsc/arm64/ompss`` folder. Moreover, we assume that the packages will be cross-compiled from an Intel machine to be run on an ARM64 embedded board. List of tools to install: - [AIT](https://github.com/bsc-pm-ompss-at-fpga/ait) - [Kernel module](https://github.com/bsc-pm-ompss-at-fpga/ompss-at-fpga-kernel-module) - [xdma](https://github.com/bsc-pm-ompss-at-fpga/xdma) - [xtasks](https://github.com/bsc-pm-ompss-at-fpga/xtasks) - [Nanos++](https://github.com/bsc-pm-ompss-at-fpga/nanox) - [Mercurium](https://github.com/bsc-pm-ompss-at-fpga/mcxx) Accelerator Integration Tool (AIT) ---------------------------------- To install AIT just clone the repository, run the ``/install.sh`` script and add ``PREFIX/ait/`` to PATH. .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/ait cd ait git lfs install git lfs fetch ./install.sh PREFIX/ait/ all all export PATH=PREFIX/ait/:$PATH Kernel module ------------- The driver is only needed to execute the applications. To compile them, the library must be installed on the host but the kernel module may not be loaded. Example to cross-compile the driver: .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/ompss-at-fpga-kernel-module cd ompss-at-fpga-kernel-module export CROSS_COMPILE=aarch64-linux-gnu- export KDIR=/home/my_user/kernel-headers export ARCH=arm64 make XDMA ---- Example to cross-compile the library and install it in the ``/opt/bsc/arm64/ompss/libxdma`` folder: .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/xdma cd xdma/src/zynq export CROSS_COMPILE=aarch64-linux-gnu- export KERNEL_MODULE_DIR=/path/to/ompss-at-fpga/kernel/module/src make make PREFIX=/opt/bsc/arm64/ompss/libxdma install xTasks ------ Example to cross-compile the library and install it in the ```/opt/bsc/arm64/ompss/libxtasks`` folder: .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/xtasks cd xtasks/src/zynq export CROSS_COMPILE=aarch64-linux-gnu- export LIBXDMA_DIR=/opt/bsc/arm64/ompss/libxdma make make PREFIX=/opt/bsc/arm64/ompss/libxtasks install Nanos++ ------- Example to cross-compile the runtime library and install it in the ``/opt/bsc/arm64/ompss/nanox`` folder: .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/nanox cd nanox autoreconf -ifv mkdir build-fpga-arm64 cd build-fpga-arm64 ../configure --prefix=/opt/bsc/arm64/ompss/nanox --host=aarch64-linux-gnu host_alias=aarch64-linux-gnu --with-xtasks=/opt/bsc/arm64/ompss/libxtasks [--with-extrae=/opt/bsc/arm64/ompss/extrae] make make install Nanos++ with cluster support ---------------------------- Example to cross-compile the runtime library, with cluster architecture enabled, and install it in the ``/opt/bsc/arm64/ompss/nanox`` folder. The example assumes that mpich and GASNet are already compiled and installed. .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/nanox cd nanox autoreconf -ifv mkdir build-fpga-cluster-arm64 cd build-fpga-cluster-arm64 export PATH=$PATH:/opt/bsc/arm64/ompss/mpich/bin ../configure --prefix=/opt/bsc/arm64/ompss/nanox --host=aarch64-linux-gnu host_alias=aarch64-linux-gnu --with-xtasks=/opt/bsc/arm64/ompss/libxtasks --with-gasnet=/opt/bsc/arm64/ompss/gasnet --with-mpi=/opt/bsc/arm64/ompss/mpich LDFLAGS="-Wl,--allow-shlib-undefined" MPICC=mpicc MPICXX=mpicxx CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ make make install Mercurium --------- Example to build a Mercurium cross-compiler that runs on the host and creates binaries for another platform (ARM64 in the example): .. code:: bash git clone https://github.com/bsc-pm-ompss-at-fpga/mcxx cd mcxx autoreconf -ifv mkdir build-fpga cd build-fpga ../configure --prefix=/opt/bsc/host-arm64/ompss/mcxx-arm64 --with-nanox=/opt/bsc/arm64/ompss/nanox --enable-ompss --enable-tl-openmp-nanox --target=aarch64-linux-gnu target_alias=aarch64-linux-gnu make make install