Skip to content

Build SPERR From Source

Samuel Li edited this page Sep 19, 2023 · 37 revisions

Basic Build Steps

SPERR is written in C++ and uses CMake to configure. On a system with a modern C++ compiler that supports C++17 standard (e.g., GCC>=8.0), the configuration and build steps look like

cmake /path/to/the/source/directory
make -j 4
ctest .        # run a set of unit tests
make install   # install static or dynamic libraries

The build system also benefits from an internet access, as CMake needs to download and build a few optional dependencies as listed below. Note that the user does not need to build these dependencies manually; CMake handles it.

  • Google Test to compile the unit tests,
  • CLI11 to parse command line options, and

A successful build will indicate 100% tests passed in the ctest step.

Build Configurations

There are a few useful build configurations which can be toggled on or off using CMake.

  1. BUILD_CLI_UTILITIES: to build a set of command line utilities. Default: ON.
  2. BUILD_SHARED_LIBRARIES: build shared libraries instead of static ones. Default: ON.
  3. BUILD_UNIT_TESTS: to build a set of unit tests. Default: ON.
  4. USE_OMP: use OpenMP to parallelize 3D compression and decompression. Default: ON.
    • MacOS does not ship OpenMP by default, so it's useful to turn it off on macs.
  5. CMAKE_INSTALL_PREFIX: where to install the SPERR library as well as its utility programs after build.