AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb

[BUG] cmake.FindTBB.cmake does not detect TBB while CMake version of FindTBB.cmake does detect it.

Open
#2,143 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.4k
Forks
777
Avg merge
3d 9h
Merged PRs (30d)
34

Description

Environment

Windows 10, x64
VisualStudio 2022.
CMake 4.0.2

Describe the bug

CMake can not detect the TBB package.
OpenVDB provides cmake\FindTBB.cmake which is not finding TBB

At least CMake 4.0.2 comes with another version of FindTBB.cmake that does work.
Removing the the OpenVDB version of this script solves the problem.

But the problem is persisting. Running a 'Install' after a succefull build fails because cmake\FindTBB.cmake is part of the installment.

I'm just signaling the problem and what I have done with it. In no way I can oversee all implications, I'm not an expert in CMake and for another progran just need to have OpenVDB.
It is not possible for me to make a pull request.

To Reproduce
  1. Checkout the latest version
  2. Run CMake.exe
    CMAKE_PREFIX_PATH=h:/lib/Boost;h:/lib/zlib;h:/lib/TBB\oneapi-tbb-2022.3.0
    cmake.exe -S ./openvdb-13_0_0 -B c:/Spool/CMake/OpenVDB/_build_13_0_0 --fresh -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON
    -- Building for: Visual Studio 17 2022
    -- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
    -- The CXX compiler identification is MSVC 19.44.35217.0
    ...
    -- Found ZLIB: H:/lib/zlib/lib/zd.lib (found version "1.3.1.1")
    CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:227 (message):
    Could NOT find TBB (missing: Tbb_LIB_COMPONENTS tbb) (found suitable
    version "2022.3", minimum required is "2020.3")
    Call Stack (most recent call first):
    C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:591 (_FPHSA_FAILURE_MESSAGE)
    cmake/FindTBB.cmake:370 (find_package_handle_standard_args)
    openvdb/openvdb/CMakeLists.txt:132 (find_package)
    -- Configuring incomplete, errors occurred!
Expected behavior (with cmake\FindTBB.cmake removed)

CMAKE_PREFIX_PATH=h:/lib/Boost;h:/lib/zlib;h:/lib/TBB\oneapi-tbb-2022.3.0;h:/lib/Blosc
cmake.exe -S ./openvdb-13_0_0 -B c:/Spool/CMake/OpenVDB/_build_13_0_0 -DCMAKE_INSTALL_PREFIX=h:/lib/OpenVDB --fresh -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
-- The CXX compiler identification is MSVC 19.44.35217.0
...
-- Found ZLIB: H:/lib/zlib/lib/zd.lib (found suitable version "1.3.1.1", minimum required is "1.2.7")


-- ----------- Configuring OpenVDBBinaries ------------


-- Configuring done (15.5s)
-- Generating done (1.0s)
-- Build files have been written to: C:/Spool/CMake/OpenVDB/_build_13_0_0
CMake build=c:/Spool/CMake/OpenVDB/_build_13_0_0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cmake/FindTBB.cmake and the find_package call in openvdb/openvdb/CMakeLists.txt. Reproduce the Windows configuration using the reported CMake, Visual Studio, and TBB paths, then compare the bundled module with CMake 4.0.2's version. Done means TBB is detected and a subsequent install no longer fails because of the bundled module.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.