Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/onetbb/doc/GSG/integrate.rst
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

69 lines
2.3 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.. _integrate:
Integrate oneTBB
================
If you want to improve the performance and scalability of your application, you can integrate oneTBB into your project.
For example, you may want to integrate oneTBB if your application needs to process large amounts of data in parallel.
To integrate oneTBB, you need to:
* Link oneTBB with the project's source code.
* Provide the necessary compiler and linker flags.
However, you can use CMake* and the pkg-config tool to simplify the process of integrating oneTBB into your project and handling its dependencies.
See the instructions below to learn how to use the tools.
Integrate oneTBB with CMake*
****************************
CMake* is a cross-platform build tool that helps you manage dependencies and build systems.
Integrating oneTBB into your project using CMake*:
* Simplifies the process of building and linking against the library.
* Ensures that your project can be built and run on multiple platforms.
* Lets you manage oneTBB dependencies.
To add oneTBB to another project using CMake*, add the following commands to your ``CMakeLists.txt`` file:
.. code-block:: cmake
find_package(TBB REQUIRED)
target_link_libraries(my_executable TBB::tbb)
After that, configure your project with CMake* as usual.
Compile a Program Using pkg-config
***********************************
The pkg-config tool is used to simplify the compilation line by retrieving information about packages
from special metadata files. It helps avoid large hard-coded paths and makes compilation more portable.
To compile a test program ``test.cpp`` with oneTBB on Linux* OS,
provide the full path to search for included files and libraries, or provide a line as the following:
.. code-block::
g++ -o test test.cpp $(pkg-config --libs --cflags tbb)
Where:
``--cflags`` provides oneTBB library include path:
.. code-block::
$ pkg-config --cflags tbb
-I<path-to>/tbb/latest/lib/pkgconfig/../..//include
``--libs`` provides the Intel(R) oneTBB library name and the search path to find it:
.. code-block::
$ pkg-config –libs tbb
-L<path to>tbb/latest/lib/pkgconfig/../..//lib/intel64/gcc4.8 -ltbb
.. note::
For Windows* OS, additionally, use the ``--msvc-syntax`` option flag that converts the compiling and linking flags in an appropriate mode.