.. include:: vars.rst .. _section-build: Build Connext TSS Libraries *************************** The |TSS| libraries are shipped as source and must be built before use by a FACE application. This chapter focuses on how to build |TSS| libraries for an architecture supported by RTI (refer to :ref:`section-platform-support` for a list of platforms supported in this release). The following sections must be performed in the order presented. Prerequisites ============= - |CONNEXT_MICRO| must be installed and built for the appropriate target architecture and FACE profile. For instructions, refer to the ``doc`` folder in your |CONNEXT_MICRO| installation directory. This |TSS| release supports |CONNEXT_MICRO| 2.4.13.1, 2.4.13.4, and 2.4.13.5. - Set the ``JREHOME`` environment variable to the location of the JRE included with |CONNEXT_MICRO|. A JRE is needed to execute *rtiddsgen*. - Download and install `CMake `_. |TSS| provides and uses CMake scripts to generate the environment to build its libraries and example applications. .. _configure-build-environment: Setting Your Environment ======================== Before building |TSS| source code, the ``RTITSSHOME`` and ``RTIMEHOME`` environment variables must be set to the installation paths for |TSS| and |CONNEXT_MICRO|, respectively. 1. Make sure CMake is in the **PATH** environment variable. |br| |br| 2. Set the **RTITSSHOME** environment variable to point to your |TSS| installation directory. For example, if |TSS| is installed in ``/home/user/rti/rti_connext_tss-4.1.0/``, set the **RTITSSHOME** environment variable with this command (in bash): .. code-block:: bash export RTITSSHOME=/home/user/rti/rti_connext_tss-4.1.0 4. Set the **RTIMEHOME** environment variable to point to your |CONNEXT_MICRO| installation. For example, if |CONNEXT_MICRO| is installed in ``/opt/local/rti/rti_connext_micro.2.4.13.4``, then set **RTIMEHOME** with this command (in bash): .. code-block:: bash export RTIMEHOME=/opt/local/rti/rti_connext_micro.2.4.13.4 .. note:: The |CONNEXT_MICRO| libraries must be conformant to the FACE profile of the |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. .. _setting-the-architecture: Setting Your Architecture ========================= The architecture identifies the platform on which to run |TSS|. After setting up your environment, configure the appropriate architecture for your build. .. note:: For a list of platforms that have been demonstrated with |CONNEXT_MICRO|, refer to :ref:`section-platform-support`. The ``RTITSSHOME/resource`` folder includes CMake architecture files for the following platforms: * ppce6500Vx653-3.0.1.1gcc4.3.3.cmake * ppce6500Vx653-3.0.1.1gcc4.3.3FACE_SB.cmake * x64Linux4gcc7.3.0FACE_GP.cmake * x64Linux4gcc7.3.0FACE_SB.cmake * x64Linux4gcc8.5.0.cmake * x64Linux4gcc8.5.0FACE_GP.cmake * x64Linux5gcc12.3.0.cmake * x64Linux5gcc12.3.0FACE_GP.cmake * x64Linux5gcc12.3.0FACE_SB.cmake * x64Win64VS2022.cmake * x86Lynx1782022.07.1.APEXgcc7.1.0.cmake * x86Lynx1782022.07.1.APEXgcc7.1.0FACE_SB.cmake After choosing an architecture, set the environment variable **RTITSSARCH** to the selected architecture. For example: .. code-block:: bash export RTITSSARCH=x64Linux4gcc7.3.0 If compiling |TSS| for the SafetyBase FACE Profile, you will also need to set the **RTIMEARCH** environment variable and append the **_cert** suffix to the architecture name. For example: .. code-block:: bash export RTITSSARCH=x64Linux4gcc7.3.0 export RTIMEARCH=x64Linux4gcc7.3.0 .. note:: To use a different architecture from those listed above, refer to the :ref:`section-porting` chapter in this manual. .. _build-cmakeCommand-label: Building the Libraries ====================== After setting the appropriate architecture, use CMake to create an out-of-source build of |TSS|. 1. Create a build directory: .. code-block:: bash cd ${RTITSSHOME} mkdir build 2. Run CMake with the required definitions, as noted in the following command: .. code-block:: bash cd build cmake -DRTI_CONNEXT_TYPE=micro -DRTI_TSS_ENABLE_FACE_COMPLIANCE= -DCMAKE_BUILD_TYPE= ../ The CMake definitions in the above command are required to successfully build |TSS|. - ``RTI_CONNEXT_TYPE`` sets |CONNEXT_MICRO| as the RTI product being used. - ``RTI_TSS_ENABLE_FACE_COMPLIANCE`` sets the FACE OSS (Operating System Segment) profile |TSS| will conform to: - "*None*" (**default**) - "*GeneralPurpose*" - "*SafetyExtended*" - "*SafetyBase*" - "*Security*" .. note:: While ``RTI_TSS_ENABLE_FACE_COMPLIANCE`` can be set to any FACE OSS profile, this release of |TSS| supports both the GeneralPurpose and SafetyBase profiles with |CONNEXT_MICRO| versions 2.4.13.1, 2.4.13.4, and 2.4.13.5. For information about FACE profiles, see the `FACE Technical Standard `_. 3. Build the |TSS| libraries: .. code-block:: bash cmake --build . Alternatively, you can use the CMake GUI (cmake-gui) instead of the command line to complete the build. Optional CMake Definitions -------------------------- The following definitions can be used to customize your build. - ``CMAKE_BUILD_TYPE`` sets the type of library or executable built: - "*Release*" (**default**) - "*Debug*" - ``BUILD_TSS`` enables or disables building TS/TA Library: - "*ON*" (**default**) - "*OFF*" - ``BUILD_STRINGS_SEQUENCES`` enables or disables building RTI Strings/Sequences: - "*ON*" (**default**) - "*OFF*" - ``BUILD_SERIALIZATION`` enables or disables building Serialization UoC: - "*ON*" (**default**) - "*OFF*" - ``BUILD_MICRO_TPM`` enables or disables building RTI Micro TPM: - "*ON*" (**default**) - "*OFF*" - ``BUILD_PRO_TPM`` enables or disables building RTI Pro TPM: - "*ON*" - "*OFF*" (**default**) .. note:: |TSS| 4.1.0 is an EAR (Early Access Release) and does not support |CONNEXT| *Professional*. - ``LANGUAGE`` sets the language to build the enabled libraries for: - "*c*" (**default**) - "*cpp*"" .. note:: RTI's C++ API is a wrapper around the C API. When C++ is selected, both C and C++ libraries are built. - ``BUILD_SHARED_LIBS`` defines whether libraries are built as dynamic or static: - "*ON*" - "*OFF*" (**default**) .. note:: This |TSS| release does not support dynamic libraries in Windows. Verify Build ============ A successful build creates multiple libraries depending on which CMake flags were set. All created libraries are in ``/lib//``: - **librti_tssc(pp)**: |TA| library. - **librti_tpm_micro_c(pp)**: |TPM| library based on |CONNEXT_MICRO|. - **librti_tss_serialization_c(pp)**: Serialization support library. - **librti_tss_strings_sequencesc(pp)**: Strings and sequences library.