3. Building Connext TSS
The Connext TSS libraries are shipped as source and must be built before use by a FACE application. This chapter describes how to build Connext TSS libraries for an architecture supported by RTI (refer to Supported Platforms for a list of platforms supported in this release). Note that the instructions in the following sections must be performed in order.
3.1. Prerequisites
Connext Micro or Connext Professional must be installed (and built, if using Connext Micro) for the appropriate target architecture and FACE profile; check the Release Notes for compatibility information. For building instructions, refer to the
docfolder in your Connext Micro or Connext Professional installation directory.Install a Java Runtime Environment (JRE). RTI Code Generator (rtiddsgen) requires a JRE to execute; RTI recommends AdoptOpenJDK version 17.0.12 (LTS) or later.
Note
If you installed Connext TSS with Connext Professional, a JRE is already included in your Connext Professional installation. Before you build Connext TSS, make sure that the included JRE is version 17.0.12 (LTS) or later.
Set the
JREHOMEenvironment variable to the location of your JRE (if your JRE is not installed in your application’s path).Download and install CMake version 3.20 or above. Connext TSS provides and uses CMake scripts to generate the environment to build its libraries and example applications.
3.2. The Host and Target Environment
The following terminology is used to refer to the environment in which Connext TSS is built and run:
The host is the machine that runs the software to compile and link Connext TSS.
The target is the machine that runs Connext TSS.
In many cases Connext TSS is built and run on the same machine. This is referred to as a self-hosted environment.
The environment is the collection of tools, OS, compiler, linker, hardware, etc., needed to build and run applications.
The following sections describe how to set up both types of environments for compiling and running Connext TSS.
3.2.1. The host environment
Before building the Connext TSS source code, you must set some environment variables to the installation paths for Connext TSS and Connext Micro or Connext Professional.
Make sure CMake is in the PATH environment variable.
Set the
RTITSSHOMEenvironment variable to point to your Connext TSS installation directory.For example, if Connext TSS is installed in
/home/user/rti/rti_connext_tss-<version>/, set theRTITSSHOMEenvironment variable with this command (in bash):export RTITSSHOME=/home/user/rti/rti_connext_tss-<version>
Set the
RTIMEHOMEorNDDSHOMEenvironment variable to point to your Connext Micro or Connext Professional installation, respectively.For example, if Connext Micro is installed in
/opt/local/rti/rti_connext_dds_micro-<version>, then setRTIMEHOMEwith this command (in bash):export RTIMEHOME=/opt/local/rti/rti_connext_dds_micro-<version>
Note
For Pro TPM builds,
NDDSHOMEmust point to a non-FACE_GPConnext Professional library.
Note
The Connext Micro libraries must be conformant to the FACE profile of
the Connext TSS libraries being built. For help configuring and building
Connext Micro for FACE, refer to the user’s manual in the doc
folder of your Connext Micro installation directory.
3.2.2. The target environment
Connext TSS requires a CMake architecture file configured for the target environment where it will run.
Note
For a list of demonstrated architectures for Connext TSS, refer to Supported Platforms.
The RTITSSHOME/resource folder includes CMake architecture files for
the following platforms:
x64Linux6gcc13.3.0FACE_GP
x64Linux6gcc13.3.0FACE_SB
x64Win64VS2022FACE_GP
x86Lynx1782024.09.0.APEXgcc11.3.0FACE_SB
x64Vx23.09llvm16.0_rtpFACE_GP
Set the environment variable RTITSSARCH to the selected architecture. For
example:
export RTITSSARCH=x64Linux6gcc13.3.0FACE_GP
If compiling Connext TSS for the SafetyBase FACE Profile for Connext Micro, you may
need to set the RTIMEARCH environment variable and append the CERT
suffix to the architecture name. For example:
export RTITSSARCH=x64Linux6gcc13.3.0FACE_SB
export RTIMEARCH=x64Linux4gcc7.3.0CERT
If compiling Connext TSS for the General Purpose FACE Profile for Connext Professional, you
may need to set the NDDSARCH environment variable and append the FACE_GP
suffix to the architecture name. For example:
export RTITSSARCH=x64Linux6gcc13.3.0FACE_GP
export NDDSARCH=x64Linux4gcc7.3.0FACE_GP
Note
To use a different architecture from those listed above, refer to Porting Connext TSS.
3.3. Building the Libraries
After setting up your host and target environments, use CMake to create an out-of-source build of Connext TSS.
Create a build directory:
cd ${RTITSSHOME} mkdir build
Run CMake with the required definitions, as shown in the following command:
cd build cmake -DRTI_CONNEXT_TYPE=<micro|pro> -DRTI_TSS_ENABLE_FACE_COMPLIANCE=<your_face_profile> ../
The CMake definitions in the above command are required to successfully build Connext TSS.
-DRTI_CONNEXT_TYPEsets Connext Micro (micro) or Connext Professional (pro) as the RTI product being used.-DRTI_TSS_ENABLE_FACE_COMPLIANCEsets the FACE OSS (Operating System Segment) profile Connext TSS will conform to:None(default)GeneralPurposeSafetyExtendedSafetyBaseSecurity
Note
While
RTI_TSS_ENABLE_FACE_COMPLIANCEcan be set to any FACE OSS profile, check the Supported Platforms for information on which profiles are supported per platform. For more information about FACE profiles, see the FACE Technical Standard.Build the Connext TSS libraries:
cmake --build .
Alternatively, you can use the CMake GUI (cmake-gui) instead of the command
line to complete the build.
3.3.1. Optional CMake definitions
The following definitions can be used to customize your build.
Definition |
Description |
Options |
|---|---|---|
|
Sets the type of library or executable built. |
|
|
Enables or disables building the Transport Service/Type Abstraction library. |
|
|
Enables or disables building the RTI strings and sequences library. |
|
|
Enables or disables building the FACE-to-CDR (Common Data Representation) serialization library. |
|
|
Enables or disables building the Connext Micro TPM library. |
|
|
Enables or disables building the Connext Professional TPM library. |
|
Sets the language to build the enabled libraries for C or C++. |
|
|
|
Defines whether libraries are built as dynamic (on) or static (off). |
|
|
Enables or disables sequence element lifecycle operations for complex types. See Sequence Element Lifecycle Operations. |
|
3.3.2. Compile-time configuration
Connext TSS provides a set of compile-time parameters that control resource limits and
buffer sizes. These parameters are defined with default values in
code/RTI_Connext_TSS_Config.h. Each parameter is wrapped in an #ifndef
guard, so it can be overridden by passing -D<PARAMETER>=<value> to CMake.
For example, to set the maximum number of connections per Base instance to 100:
cmake -DMAX_CONNECTIONS_PER_BASE_INSTANCE=100 ...
The following parameters can be overridden through CMake:
Parameter |
Description |
Default |
|---|---|---|
|
Default bound for unbounded strings. |
255 |
|
Default bound for unbounded sequences. |
4096 |
|
Maximum number of connections that a Base instance can own. |
10000 |
|
Maximum number of TPM references that a Base instance can hold. |
50 |
|
Maximum number of channels that a connection can contain. |
10000 |
|
Maximum length of the TSS configuration string. Update based on the size of your configuration. |
1024 |
|
Maximum length of the log file name when logging is enabled. |
256 |
Note
When using Connext Micro, data larger than the transport MTU is only
fragmented for BEST_EFFORT reliability. RELIABLE communication does
not support fragmentation and over-MTU samples are discarded by Micro.
For this reason, keep effective serialized sample sizes within MTU by using
bounded types and appropriately sizing STRINGS_BOUND and
SEQUENCES_BOUND.
The following additional parameters are defined in RTI_Connext_TSS_Config.h
but are not passed through CMake. To override them, define them in your
compiler flags or edit the header directly:
Parameter |
Description |
Default |
|---|---|---|
|
Default maximum number of channels per channel manager. |
50 |
|
Maximum number of callbacks per connection. |
32 |
|
Buffer size for general-purpose operations (log messages, temporary buffers, etc.). |
256 |
|
Default message size for DDS message buffers. |
1024 |
|
Large buffer size for configuration strings and bulk data. |
8192 |
|
Default DDS domain ID when none is configured. |
0 |
|
Default timeout in milliseconds. |
1000 |
|
Length in nanoseconds of one bounded wait slice. A blocking
|
100000000 |
|
Size of internal log message buffer. |
4096 |
|
Initial bucket count for hash tables. |
128 |
The following hash table tuning parameters control the performance characteristics of internal hash tables used for connection, channel, and TPM lookups. Adjusting these values can trade memory usage for lookup speed:
Parameter |
Description |
Default |
|---|---|---|
|
Minimum bucket count for hash tables. Tables will not shrink below this size. |
64 |
|
Load factor threshold (as a percentage). When the ratio of entries to buckets exceeds this value, the table is resized. Lower values reduce collisions at the cost of more memory. |
75 |
|
Multiplier applied to the bucket count when the table is resized. A factor of 2 doubles the table on each resize. |
2 |
|
Maximum probe iterations for a single hash operation. Prevents unbounded search times in degenerate cases. |
100 |
|
Initial seed value for the DJB2 hash algorithm. |
5381 |
|
Multiplier used in the DJB2 hash calculation
( |
33 |
|
Offset basis for the FNV-1a hash algorithm. |
0x811c9dc5 |
|
Prime multiplier for the FNV-1a hash algorithm. |
0x01000193 |
Note
For SafetyBase (and stricter) profiles, dynamic memory allocation is disabled. In these profiles the resource limits set by these parameters determine the fixed, pre-allocated capacity of the system. Choosing values appropriate for your deployment is especially important.
3.4. Verifying Built Libraries
A successful build will create multiple libraries depending on which CMake flags
were set. If you build C++ libraries, both C and C++ libraries will be present.
All created libraries should be located in
<RTITSSHOME>/lib/<tss_arch>/<library_name>:
librti_tssc/librti_tsscpp: Type Abstraction library.
librti_tpm_micro_c/librti_tpm_micro_cpp: Transport Protocol Module library based on Connext Micro.
librti_tpm_pro_c: Transport Protocol Module library based on Connext Professional.Note
Connext TSS on Connext Professional does not support RTI Connext TSS C++ API.
librti_tss_serialization_c/librti_tss_serialization_cpp: FACE-to-CDR serialization support library.Note
Serialization support libraries are only used with Connext Micro.
The serialization libraries are built by default (
-DBUILD_SERIALIZATION=ON), but they are not automatically linked by application build scripts (including the provided exampleCMakeLists.txt).If your application uses FACE-to-CDR serialization, you must explicitly add
librti_tss_serialization_c(C API) orlibrti_tss_serialization_cpp(C++ API) to thetarget_link_librariescall in your application’sCMakeLists.txt.If serialization is not needed, you can disable building the libraries by passing
-DBUILD_SERIALIZATION=OFFto CMake when building Connext TSS.
librti_tss_strings_sequencesc: Strings and sequences library.
Note
Static versions of the libraries have the letter z postpended to the filename.
Debug versions of the libraries have the letter d postpended to the filename.
For example, librti_tsscz is the release version of the static C API Type Abstraction
library, and librti_tsscdz is the debug version of the static C API Type Abstraction
library. Therefore, you can build both release and debug versions of the
libraries in the same build directory.