greg7mdp / parallel-hashmap

A family of header-only, very fast and memory-friendly hashmap and btree containers.
https://greg7mdp.github.io/parallel-hashmap/
Apache License 2.0
2.53k stars 239 forks source link

Link against TBB if available #242

Closed Earthwings closed 5 months ago

Earthwings commented 5 months ago

This is a follow-up in the same environment as PR #241, where I'm running into

[ 98%] Linking CXX executable ex_llil4map
/usr/bin/ld: CMakeFiles/ex_llil4map.dir/examples/llil4map.cc.o: in function `tbb::detail::d1::execution_slot(tbb::detail::d1::execution_data const&)':
llil4map.cc:(.text._ZN3tbb6detail2d114execution_slotERKNS1_14execution_dataE[_ZN3tbb6detail2d114execution_slotERKNS1_14execution_dataE]+0x18): undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)'
/usr/bin/ld: CMakeFiles/ex_llil4map.dir/examples/llil4map.cc.o: in function `tbb::detail::d1::current_thread_index()':
llil4map.cc:(.text._ZN3tbb6detail2d120current_thread_indexEv[_ZN3tbb6detail2d120current_thread_indexEv]+0x12): undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/ex_llil4map.dir/build.make:99: ex_llil4map] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1121: CMakeFiles/ex_llil4map.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

with libtbb-dev installed.

greg7mdp commented 5 months ago

Thank you for the fix @Earthwings