Building & Installation

The HiCR Core API is a self-sufficient include-only library that does not require compilation. Its backends, however, may require the presence of dependencies (libraries or drivers) in the system to work and link against. Its frontends may also contain source code that requires compilation. We use the Meson build system to handle all of these aspects and provide a seamless compilation of HiCR-based applications.

Getting HiCR

HiCR is released in a continuous basis. The latest release is always the latest master branch commit in its git repository. To obtain the latest release, simply run:

git clone https://github.com/Algebraic-Programming/HiCR

Software Requirements

Before installing HiCR, make sure the following libraries and tools are installed:

  • C++ compiler with suppport for C++20 (e.g., g++ >= 11.0)

  • python (version >= 3.9)

  • meson (version > 1.0.0)

  • ninja (version > 1.0.0)

  • gtest

The following libraries and tools are only necessary for certain HiCR backends:

  • Ascend ascend-toolkit 7.0.RC1.alpha003

  • Boost libboost-context-dev (version >= 1.71)

  • HWLoc hwloc (version >= 2.1.0)

  • LPF LPF (version 'noc_extension')

  • MPI openmpi (version >= 5.0.2)

  • nOS-V nos-v (version >= 3.1.0)

  • OpenCL opencl (version >= 3.0) and a compatible opencl icd loader

  • Pthreads

Configuration

HiCR uses meson as build and installation system. To build HiCR, you can run the following command:

# [Example] Configuring HiCR's meson project, with its default configuration, in the folder "build"
meson setup build

# [Example] Configuring HiCR's meson project, with all its backends, and frontends. The build folder is "build"
meson setup build -DbuildExamples=true -DbuildTests=true -Dbackends=hwloc,boost,pthreads,mpi,lpf,ascend,nosv,opencl -Dfrontends=channel,RPCEngine,tasking,objectStore

# Compiling
meson compile -C build

# or
cd build
ninja

Building Tests and Examples

To compile HiCR’s tests and examples, add the corresponding flags in the configuration command

# Configuring HiCR's meson project, along with its examples and tests
meson setup build -DbuildExamples=true -DbuildTests=true

To execute them:

meson test -C build

Installation

By default, HiCR will install in the system’s default folder, but this can be configured:

# Configuring HiCR's meson project with a non-default install folder
meson setup build -Dprefix=$HOME/.local

# Installing
meson install -C build

Running

To run a HiCR-based application (or one of the included examples), simply run it as usual:

# Running example (from within the build folder)
examples/topology/hwloc

If the application uses a backend that requires a specific launcher (e.g., MPI), you should use it:

# Running MPI-based example
mpirun -n 2 examples/topologyRPC/mpi