{"id":5729,"library":"tbb","title":"Intel® oneAPI Threading Building Blocks (oneTBB)","description":"The `tbb` library provides Intel® oneAPI Threading Building Blocks (oneTBB), a C++ template library for parallel programming. The Python package primarily distributes the oneTBB C++ runtime libraries and headers, enabling other Python packages (e.g., NumPy, SciPy) to leverage TBB for parallelization. It is currently at version 2022.3.1 and sees regular updates, typically a few times per year, to introduce new features and address issues.","status":"active","version":"2022.3.1","language":"python","source_language":"en","source_url":"https://github.com/oneapi-src/oneTBB","tags":["parallel-computing","high-performance","c++","intel","runtime","scientific-computing"],"install":[{"cmd":"pip install tbb","lang":"bash","label":"Install the TBB Python package"}],"dependencies":[],"imports":[{"wrong":"import tbb; version_info = tbb.version_info","symbol":"version_info","correct":"import tbb; version_info = tbb.__version__"}],"quickstart":{"code":"import tbb\nimport os\n\n# The 'tbb' Python package primarily provides access to the underlying\n# C++ library paths and version, not direct Python parallel computing APIs.\n# Other Python libraries (e.g., NumPy, SciPy) might be built to use TBB\n# and will detect it automatically if installed.\n\nprint(f\"TBB package version: {tbb.version_info}\")\n\n# Paths useful for C++ projects or Python extensions that link against TBB\nprint(f\"TBB C++ include directory: {tbb.include_dir()}\")\nprint(f\"TBB C++ library directory: {tbb.lib_dir()}\")\n\n# Example of checking if TBB-enabled features are available in another library\n# (Conceptual, 'some_tbb_enabled_lib' is a placeholder)\n# try:\n#     import some_tbb_enabled_lib\n#     if hasattr(some_tbb_enabled_lib, 'is_tbb_enabled') and some_tbb_enabled_lib.is_tbb_enabled():\n#         print(\"A TBB-enabled Python library is detected and can use TBB.\")\n# except ImportError:\n#     print(\"No specific TBB-enabled Python library found for direct usage example.\")","lang":"python","description":"Demonstrates how to import the `tbb` package to retrieve information about the installed Intel oneTBB C++ library, such as its version and file system paths. This is useful for verifying installation or for C++/Python interoperability projects."},"warnings":[{"fix":"Understand that `tbb` is a backend dependency provider. For Python parallelization, consider libraries like `joblib`, `numba`, or native `multiprocessing`.","message":"The `tbb` Python package primarily provides Intel oneTBB C++ runtime libraries and headers. It does not offer direct Python APIs for parallelizing Python code. Users typically interact with libraries like NumPy, SciPy, or scikit-learn, which may be *built against* TBB for their internal parallelization.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update C++ build scripts or environment configurations to use `C_INCLUDE_PATH` and `CPLUS_INCLUDE_PATH` instead of `CPATH` when building against TBB 2022.2.0 or newer.","message":"Environment variable names for C++ include paths changed in oneTBB 2022.2.0. `CPATH` was replaced by `C_INCLUDE_PATH` and `CPLUS_INCLUDE_PATH` to prevent unintended compiler warnings.","severity":"breaking","affected_versions":">=2022.2.0"},{"fix":"Ensure your development environment has a compatible C++ compiler (e.g., GCC, Clang, MSVC) and a build system (e.g., CMake, Make) configured to locate and link against the TBB libraries.","message":"While the `tbb` Python package provides the necessary shared objects and headers, direct C++ development or Python extensions that link against TBB still require a C++ compiler and appropriate build system setup.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When writing or updating C++ code that uses TBB, prefer `oneapi::tbb::` for types and functions. For older code, verify that the TBB version you are linking against provides the necessary `tbb::` aliases.","message":"The primary C++ namespace for TBB migrated from `tbb` to `oneapi::tbb` with the introduction of oneAPI. While aliases often exist for backward compatibility, new C++ code should use the `oneapi::tbb` namespace.","severity":"breaking","affected_versions":"Primarily >=2021.x"},{"fix":"For C++ code, migrate usage from `tbb::task_scheduler_init` to `tbb::task_arena` to leverage improved control and modern best practices for task scheduling.","message":"The `tbb::task_scheduler_init` class has been largely deprecated in modern TBB versions in favor of `tbb::task_arena` for finer-grained control over task execution and thread management.","severity":"deprecated","affected_versions":"Primarily >=2021.x"}],"env_vars":null,"search_vec":"'2022.3.1':53 'address':69 'block':5,15 'build':4,14 'c':18,31,77 'comput':73,82 'current':50 'distribut':28 'e.g':40 'enabl':36 'featur':67 'header':35 'high':75 'high-perform':74 'intel':1,11,78 'introduc':65 'issu':70 'leverag':44 'librari':9,20,33 'new':66 'numpi':41 'oneapi':2,12 'onetbb':6,16,30 'packag':26,39 'parallel':22,47,72 'parallel-comput':71 'per':62 'perform':76 'primarili':27 'program':23 'provid':10 'python':25,38 'regular':56 'runtim':32,79 'scientif':81 'scientific-comput':80 'scipi':42 'see':55 'tbb':8,45 'templat':19 'thread':3,13 'time':61 'typic':58 'updat':57 'version':52 'year':63","created_at":"2026-04-14T03:41:13.614008+00:00","updated_at":"2026-04-16T22:42:38.660647+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'tbb'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2023.1.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html","github":"https://github.com/oneapi-src/oneTBB","docs":null,"changelog":null,"pypi":"https://pypi.org/project/tbb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-30","next_check":"2026-07-10","install_tag":null}}