Get Started with TCM#

To install Thread Composability Manager (TCM), follow one of the approaches below.

Install from Release Packages#

To install Thread Composability Manager from the release packages do the following:

  1. Extract the downloaded binary archive;

  2. Set the environment variables by using the script from the env subdirectory in the extracted path.

Example for Linux* OS:

tar -xvf tcm-*.tgz
cd tcm-<version>
source env/vars.sh

Example for Windows* OS:

powershell -Command "Expand-Archive -Path tcm-*.zip -DestinationPath . -Force"
cd tcm-<version>
call env\vars.bat

Install from Sources#

To install from sources do the following:

  1. Download TCM sources either by checking out the repository or downloading sources from the releases page;

  2. Configure and build TCM using CMake and a C++ compiler;

  3. Install using CMake’s --install command.

Prerequisites#

  • CMake version 3.5 (or newer).

  • C++ compiler that supports at least C++17 version of the C++ standard.

  • HWLOC version 2.5 (or newer).

Configuring and building TCM#

Assuming TCM sources are in the current working directory, configuration involves running cmake.

For example, to build TCM in the build subdirectory, invoke

cmake -S . -B build

Additionally, the following configuration options can be passed to cmake:

Configuration Option

Description

-DTCM_TEST={ON,OFF}

When set to ON (the default), targets for TCM tests will also be created.

-DTCM_STRICT={ON,OFF}

When set to ON (the default), warnings generated by the compiler will be treated as errors.

To build the TCM project, invoke cmake --build . from the directory where the project was configured.

Installing the project#

To install the built TCM, invoke cmake --install . from the directory where the project was built.

Note

Refer to CMake Reference Documentation for additional options that can be provided to CMake, including build type and installation path.

Version Information#

TCM provides macros, an environment variable, and a function that helps determine version and runtime information of the library used.

Version Macros#

TCM defines the following macros related to versioning.

Name

Description

TCM_VERSION_MAJOR

Macro defined to integral value representing major version of the library.

TCM_VERSION_MINOR

Macro defined to integral value representing minor version of the library.

TCM_VERSION_PATCH

Macro defined to integral value representing patch version of the library.

TCM_VERSION

Macro defined to integral value combining major, minor, and patch version together.

TCM Runtime Version#

Runtime version information can be obtained using the function tcmGetVersion:

unsigned tcmGetVersion()

Returns the value of the TCM_VERSION macro.

Environment Variable#

When the environment variable TCM_VERSION is set to 1, additional information is printed to stderr. The lines start with "TCM: <value>", and may change from version to version.

Enabling Thread Composability Manager#

By default, Thread Composability Manager is disabled. To enable it, set TCM_ENABLE=1 environment variable when starting an application.