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 SDS repository

First, you will need to install Spack as explained here. Once Spack is installed and available in your path, clone the following git reporitory and add it as a Spack namespace.

git clone
spack repo add mochi-spack-packages

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

    A library that provides Argobots bindings to the Mercury RPC

... (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 -r mochi-margo

This will load Margo and its dependencies (Mercury, Argobots, etc.). spack load -r 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 and Mercury can be found using:

find_package(mercury REQUIRED)
find_package(thallium 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)