Installing

The recommended way to install the Mochi libraries and dependencies is to use Spack. Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments.

Installing Spack and the Mochi repository

First, you will need to install Spack as explained here.

Mercury, Argobots, Margo, and Thallium are available as builtin packages in Spack. For all the other Mochi libraries, you will need to clone the following git reporitory and add it as a Spack namespace.

git clone https://github.com/mochi-hpc/mochi-spack-packages.git
spack repo add mochi-spack-packages

Important

The above reporitory may contain newer versions of Mercury, Argobots, Margo, and Thallium than what is available in Spack by default, so we recommend using it even if you will only work with these libraries.

You can then check that Spack can find Margo (for example) by typping:

spack info mochi-margo

You should see something like the following.

AutotoolsPackage:   mochi-margo

Description:
    A library that provides Argobots bindings to the Mercury RPC
    implementation.

Homepage: https://github.com/mochi-hpc/mochi-margo
... (more lines follow) ...

Installing the Mochi libraries

Installing Margo is then as simple as typping the following.

spack install mochi-margo

You will notice that Spack also installs Mercury and Argobots, since these are needed by Margo, as well as other dependencies.

You can install Thallium using spack install mochi-thallium (this will install Margo if you didn’t install it before, as well as its dependencies).

spack install mercury can be used to install Mercury, and spack install argobots can be used to install Argobots, should you need to install either independently of Margo or Thallium. spack install mochi-abt-io will install ABT-IO. spack install mochi-ssg will install SSG.

Loading and using the Mochi libraries

Once installed, you can load Margo using the following command.

spack load mochi-margo

This will load Margo and its dependencies (Mercury, Argobots, etc.). spack load mochi-thallium will load Thallium and its dependencies (Margo, Mercury, Argobots, etc.). You are now ready to use the Mochi libraries!

Using the Mochi libraries with pkg-config

Once loaded, all the Mochi libraries can be found using pkg-config. For examples:

$ pkg-config --libs margo

Using the Mochi libraries with cmake

Within a cmake project, Thallium, Mercury, Yokan, and Bedrock can be found using:

find_package(mercury REQUIRED)
find_package(thallium REQUIRED)
find_package(yokan REQUIRED)
find_package(bedrock REQUIRED)

To make cmake find Margo, Argobots, ABT-IO, or SSG, you can use cmake’s PkgConfig module:

find_package (PkgConfig REQUIRED)
pkg_check_modules (MARGO REQUIRED IMPORTED_TARGET margo)
pkg_check_modules (ABT REQUIRED IMPORTED_TARGET argobots)
pkg_check_modules (ABTIO REQUIRED IMPORTED_TARGET abt-io)
pkg_check_modules (SSG REQUIRED IMPORTED_TARGET ssg)

You can now link targets as follows.

# Code using Mercury
add_executable(my_mercury_prog source.c)
target_link_libraries(my_mercury_prog mercury)

# Code using Margo
add_executable(my_margo_prog source.c)
target_link_libraries(my_margo_prog PkgConfig::MARGO)

# Code using Thallium
add_executable(my_thallium_prog source.cpp)
target_link_libraries(my_thallium_prog thallium)

# Code using Argobots
add_executable(my_abt_prog source.c)
target_link_libraries(my_abt_prog PkgConfig::ABT)

# Code using ABT-IO
add_executable(my_abt_io_prog source.c)
target_link_libraries(my_abt_io_prog PkgConfig::ABTIO)

# Code using SSG
add_executable(my_ssg_prog source.c)
target_link_libraries(my_ssg_prog PkgConfig::SSG)

# Code using Bedrock
add_executable(my_bedrock_prog source.cpp)
target_link_libraries(my_bedrock_prog bedrock-client)
# link against bedrock-server if you need an embedded server

# Code using Yokan
add_executable(my_yokan_prog source.cpp)
target_link_libraries(my_yokan_prog yokan-client yokan-server yokan-admin)
# select the relevant library to link against