Skip to content

Cmake: some people build shared libtbb - #23089

Merged
bellenot merged 1 commit into
root-project:masterfrom
andresailer:fixTBBMac26
Aug 20, 2026
Merged

Cmake: some people build shared libtbb#23089
bellenot merged 1 commit into
root-project:masterfrom
andresailer:fixTBBMac26

Conversation

@andresailer

Copy link
Copy Markdown
Contributor

This Pull request:

Replaces #23087

Changes or fixes:

It fixes build errors on mac OS 26 with shared library builds of libtbb.
When STATIC is given, the rpath configuration during the linking of libThread is incorrect,

[ 57%] Linking CXX shared library ../../lib/libThread.so
/Library/Developer/CommandLineTools/usr/bin/clang++  -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fsized-deallocation -fno-common -Qunused-arguments -pthread -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -dynamiclib -Wl,-headerpad_max_install_names -m64 -Wl,-dead_strip_dylibs -o ../../lib/libThread.so -install_name @rpath/libThread.so CMakeFiles/Thread.dir/src/TCondition.cxx.o CMakeFiles/Thread.dir/src/TConditionImp.cxx.o CMakeFiles/Thread.dir/src/TMutex.cxx.o CMakeFiles/Thread.dir/src/TMutexImp.cxx.o CMakeFiles/Thread.dir/src/TReentrantRWLock.cxx.o CMakeFiles/Thread.dir/src/TRWLock.cxx.o CMakeFiles/Thread.dir/src/TRWMutexImp.cxx.o CMakeFiles/Thread.dir/src/TRWSpinLock.cxx.o CMakeFiles/Thread.dir/src/TSemaphore.cxx.o CMakeFiles/Thread.dir/src/TThread.cxx.o CMakeFiles/Thread.dir/src/TThreadFactory.cxx.o CMakeFiles/Thread.dir/src/TThreadImp.cxx.o CMakeFiles/Thread.dir/src/TPosixCondition.cxx.o CMakeFiles/Thread.dir/src/TPosixMutex.cxx.o CMakeFiles/Thread.dir/src/TPosixThread.cxx.o CMakeFiles/Thread.dir/src/TPosixThreadFactory.cxx.o CMakeFiles/G__Thread.dir/G__Thread.cxx.o  -Wl,-rpath,/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib ../../lib/libCore.so /Users/sftnight/build/workspace/lcg_nightly_pipeline/install/dev3/tbb/2023.1.0/arm64-mac26-clang170-opt/lib/libtbb.dylib

leading to errors later on.

[ 60%] Generating G__Net.cxx, ../../lib/Net.pcm
dyld[97986]: Library not loaded: @rpath/libtbb.12.dylib
  Referenced from: <0A33E4C2-1C88-3AEE-8935-D13F217B6639> /Volumes/build_drive/SPI-macOS-26/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libThread.so
  Reason: tried: '/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/sftnight/build/workspace/lcg_nightly_pipeline/build/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib/libtbb.12.dylib' (no such file)
Subprocess aborted

After this change:

[ 55%] Linking CXX shared library ../../lib/libThread.so
cd /Users/sailer/SPI/lcgcmake/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/core/thread && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/Thread.dir/link.txt --verbose=1 /Library/Developer/CommandLineTools/usr/bin/c++  -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fsized-deallocation -fno-common -Qunused-arguments -pthread -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -dynamiclib -Wl,-headerpad_max_install_names -m64 -Wl,-dead_strip_dylibs -o ../../lib/libThread.so -install_name @rpath/libThread.so CMakeFiles/Thread.dir/src/TCondition.cxx
.o CMakeFiles/Thread.dir/src/TConditionImp.cxx.o CMakeFiles/Thread.dir/src/TMutex.cxx.o CMakeFiles/Thread.dir/src/TMutexImp.cxx.o CMakeFiles/Thread.dir/src/TReentrantRWLock.cxx.o CMakeFiles/Thread.dir/src/TRWLock.
cxx.o CMakeFiles/Thread.dir/src/TRWMutexImp.cxx.o CMakeFiles/Thread.dir/src/TRWSpinLock.cxx.o CMakeFiles/Thread.dir/src/TSemaphore.cxx.o CMakeFiles/Thread.dir/src/TThread.cxx.o CMakeFiles/Thread.dir/src/TThreadFactory.cxx.o CMakeFiles/Thread.dir/src/TThreadImp.cxx.o CMakeFiles/Thread.dir/src/TPosixCondition.cxx.o CMakeFiles/Thread.dir/src/TPosixMutex.cxx.o CMakeFiles/Thread.dir/src/TPosixThread.cxx.o CMakeFiles/Thread.dir/src/TPosixThreadFactory.cxx.o CMakeFiles/G__Thread.dir/G__Thread.cxx.o  -Wl,-rpath,/Users/sailer/SPI/lcgcmake/projects/ROOT-c050cbde/src/ROOT-c050cbde-build/lib -Wl,-rpath,/Users/sailer/SPI/install/dev3/tbb/2023.1.0/arm64-mac26-clang170-opt/lib ../../lib/libCore.so /Users/sailer/SPI/install/dev3/tbb/2023.1.0/arm64-mac26-clang170-opt/lib/libtbb.dylib

Note the rpath setting before libtbb.dylib here

Checklist:

  • tested changes locally for macos 26

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 18h 55m 28s ⏱️
 3 859 tests  3 858 ✅ 0 💤 1 ❌
78 618 runs  78 616 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 4887ff4.

♻️ This comment has been updated with latest results.

Comment thread cmake/modules/FindTBB.cmake
@pcanal pcanal closed this Aug 18, 2026
@pcanal pcanal reopened this Aug 18, 2026

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@andresailer

Copy link
Copy Markdown
Contributor Author

@bellenot Could you review this please?

@bellenot bellenot closed this Aug 19, 2026
@bellenot bellenot reopened this Aug 19, 2026

@bellenot bellenot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, once all platforms are green...

@andresailer

Copy link
Copy Markdown
Contributor Author

@bellenot Everything is green now

@bellenot bellenot self-assigned this Aug 20, 2026
@bellenot
bellenot merged commit 5dde2ca into root-project:master Aug 20, 2026
202 of 290 checks passed
@andresailer
andresailer deleted the fixTBBMac26 branch August 20, 2026 08:17
@bellenot

Copy link
Copy Markdown
Member

/backport to 6.40

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #23089 to branch 6.40 requested by bellenot

@root-project-bot

Copy link
Copy Markdown

Something went wrong with the creation of the PR to backport to 6.40: @bellenot please see the logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants