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:
Extract the downloaded binary archive;
Set the environment variables by using the script from the
envsubdirectory 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:
Download TCM sources either by checking out the repository or downloading sources from the releases page;
Configure and build TCM using CMake and a C++ compiler;
Install using CMake’s
--installcommand.
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 |
|---|---|
|
When set to |
|
When set to |
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 |
|---|---|
|
Macro defined to integral value representing major version of the library. |
|
Macro defined to integral value representing minor version of the library. |
|
Macro defined to integral value representing patch version of the library. |
|
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.