Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Intel TBB NOT found! on Ubuntu 22.04 #6253

Closed
enm10k opened this issue May 28, 2022 · 3 comments
Closed

ERROR: Intel TBB NOT found! on Ubuntu 22.04 #6253

enm10k opened this issue May 28, 2022 · 3 comments

Comments

@enm10k
Copy link

enm10k commented May 28, 2022

Hi,
I tried to build 5.26 branch from source code following instructions of the document on Ubuntu 22.04 but it failed.
Does anyone have the same issue?

~/osrm-backend/build$ cmake ..
...
ERROR: Intel TBB NOT found!
-- Looked for Threading Building Blocks in /usr
CMake Error at cmake/FindTBB.cmake:274 (message):
  Could NOT find TBB library.
Call Stack (most recent call first):
  CMakeLists.txt:527 (find_package)
...

cmake .. --trace-expand 2>&1 | grep FindTBB

$ cmake .. --trace-expand 2>&1| grep FindTBB
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(57):  if(WIN32 )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(81):  if(UNIX )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(82):  if(APPLE )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(103):  else(APPLE )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(105):  set(_TBB_DEFAULT_INSTALL_DIR /usr )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(106):  set(_TBB_LIB_NAME tbb )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(107):  set(_TBB_LIB_MALLOC_NAME tbbmalloc )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(108):  set(_TBB_LIB_DEBUG_NAME tbb_debug )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(109):  set(_TBB_LIB_MALLOC_DEBUG_NAME tbbmalloc_debug )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(113):  set(_TBB_COMPILER  )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(114):  set(_TBB_ARCHITECTURE  )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(118):  if(CMAKE_SYSTEM MATCHES SunOS.* )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(127):  set(TBB_FOUND NO )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(132):  if(TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(133):  set(_TBB_INSTALL_DIR /usr )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(136):  if(NOT _TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(152):  if(NOT _TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(158):  if(NOT _TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(160):  else(NOT _TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(162):  if(NOT TBB_INSTALL_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(170):  macro(TBB_CORRECT_LIB_DIR var_name )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(183):  set(TBB_INC_SEARCH_DIR /usr/include )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(186):  find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h HINTS /usr/include ENV CPATH )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(190):  mark_as_advanced(TBB_INCLUDE_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(194):  if(NOT  STREQUAL  )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(203):  if(( NOT  STREQUAL  ) AND ( NOT  STREQUAL  ) )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(213):  list(APPEND _TBB_LIBRARY_DIR /usr/lib )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(215):  if(EXISTS /usr/build )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(229):  find_library(TBB_LIBRARY tbb HINTS  /usr/lib )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(230):  find_library(TBB_MALLOC_LIBRARY tbbmalloc HINTS  /usr/lib )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(233):  get_filename_component(TBB_LIBRARY_DIR /usr/lib/x86_64-linux-gnu/libtbb.so PATH )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(237):  mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(241):  find_library(TBB_LIBRARY_DEBUG tbb_debug HINTS  /usr/lib PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(243):  find_library(TBB_MALLOC_LIBRARY_DEBUG tbbmalloc_debug HINTS  /usr/lib PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(248):  get_filename_component(TBB_LIBRARY_DEBUG_DIR TBB_LIBRARY_DEBUG-NOTFOUND PATH )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(252):  mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(255):  if(TBB_INCLUDE_DIR )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(269):  if(NOT TBB_FOUND )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(270):  message(ERROR: Intel TBB NOT found! )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(271):  message(STATUS Looked for Threading Building Blocks in /usr )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(273):  if(TBB_FIND_REQUIRED )
/home/ubuntu/osrm-backend/cmake/FindTBB.cmake(274):  message(FATAL_ERROR Could NOT find TBB library. )
CMake Error at cmake/FindTBB.cmake:274 (message):

apt info libtbb-dev

$ apt info libtbb-dev
...
Version: 2021.5.0-7ubuntu2
...

dpkg -L libtbb-dev

$ dpkg -L libtbb-dev
/.
/usr
/usr/include
/usr/include/oneapi
/usr/include/oneapi/tbb
/usr/include/oneapi/tbb/blocked_range.h
/usr/include/oneapi/tbb/blocked_range2d.h
/usr/include/oneapi/tbb/blocked_range3d.h
/usr/include/oneapi/tbb/blocked_rangeNd.h
/usr/include/oneapi/tbb/cache_aligned_allocator.h
/usr/include/oneapi/tbb/collaborative_call_once.h
/usr/include/oneapi/tbb/combinable.h
/usr/include/oneapi/tbb/concurrent_hash_map.h
/usr/include/oneapi/tbb/concurrent_lru_cache.h
/usr/include/oneapi/tbb/concurrent_map.h
/usr/include/oneapi/tbb/concurrent_priority_queue.h
/usr/include/oneapi/tbb/concurrent_queue.h
/usr/include/oneapi/tbb/concurrent_set.h
/usr/include/oneapi/tbb/concurrent_unordered_map.h
/usr/include/oneapi/tbb/concurrent_unordered_set.h
/usr/include/oneapi/tbb/concurrent_vector.h
/usr/include/oneapi/tbb/detail
/usr/include/oneapi/tbb/detail/_aggregator.h
/usr/include/oneapi/tbb/detail/_aligned_space.h
/usr/include/oneapi/tbb/detail/_allocator_traits.h
/usr/include/oneapi/tbb/detail/_assert.h
/usr/include/oneapi/tbb/detail/_concurrent_queue_base.h
/usr/include/oneapi/tbb/detail/_concurrent_skip_list.h
/usr/include/oneapi/tbb/detail/_concurrent_unordered_base.h
/usr/include/oneapi/tbb/detail/_config.h
/usr/include/oneapi/tbb/detail/_containers_helpers.h
/usr/include/oneapi/tbb/detail/_exception.h
/usr/include/oneapi/tbb/detail/_export.h
/usr/include/oneapi/tbb/detail/_flow_graph_body_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_cache_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_indexer_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_item_buffer_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_join_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_node_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_node_set_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_nodes_deduction.h
/usr/include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_trace_impl.h
/usr/include/oneapi/tbb/detail/_flow_graph_types_impl.h
/usr/include/oneapi/tbb/detail/_hash_compare.h
/usr/include/oneapi/tbb/detail/_intrusive_list_node.h
/usr/include/oneapi/tbb/detail/_machine.h
/usr/include/oneapi/tbb/detail/_mutex_common.h
/usr/include/oneapi/tbb/detail/_namespace_injection.h
/usr/include/oneapi/tbb/detail/_node_handle.h
/usr/include/oneapi/tbb/detail/_pipeline_filters.h
/usr/include/oneapi/tbb/detail/_pipeline_filters_deduction.h
/usr/include/oneapi/tbb/detail/_range_common.h
/usr/include/oneapi/tbb/detail/_rtm_mutex.h
/usr/include/oneapi/tbb/detail/_rtm_rw_mutex.h
/usr/include/oneapi/tbb/detail/_scoped_lock.h
/usr/include/oneapi/tbb/detail/_segment_table.h
/usr/include/oneapi/tbb/detail/_small_object_pool.h
/usr/include/oneapi/tbb/detail/_string_resource.h
/usr/include/oneapi/tbb/detail/_task.h
/usr/include/oneapi/tbb/detail/_task_handle.h
/usr/include/oneapi/tbb/detail/_template_helpers.h
/usr/include/oneapi/tbb/detail/_utils.h
/usr/include/oneapi/tbb/detail/_waitable_atomic.h
/usr/include/oneapi/tbb/enumerable_thread_specific.h
/usr/include/oneapi/tbb/flow_graph.h
/usr/include/oneapi/tbb/flow_graph_abstractions.h
/usr/include/oneapi/tbb/global_control.h
/usr/include/oneapi/tbb/info.h
/usr/include/oneapi/tbb/memory_pool.h
/usr/include/oneapi/tbb/mutex.h
/usr/include/oneapi/tbb/null_mutex.h
/usr/include/oneapi/tbb/null_rw_mutex.h
/usr/include/oneapi/tbb/parallel_for.h
/usr/include/oneapi/tbb/parallel_for_each.h
/usr/include/oneapi/tbb/parallel_invoke.h
/usr/include/oneapi/tbb/parallel_pipeline.h
/usr/include/oneapi/tbb/parallel_reduce.h
/usr/include/oneapi/tbb/parallel_scan.h
/usr/include/oneapi/tbb/parallel_sort.h
/usr/include/oneapi/tbb/partitioner.h
/usr/include/oneapi/tbb/profiling.h
/usr/include/oneapi/tbb/queuing_mutex.h
/usr/include/oneapi/tbb/queuing_rw_mutex.h
/usr/include/oneapi/tbb/rw_mutex.h
/usr/include/oneapi/tbb/scalable_allocator.h
/usr/include/oneapi/tbb/spin_mutex.h
/usr/include/oneapi/tbb/spin_rw_mutex.h
/usr/include/oneapi/tbb/task.h
/usr/include/oneapi/tbb/task_arena.h
/usr/include/oneapi/tbb/task_group.h
/usr/include/oneapi/tbb/task_scheduler_observer.h
/usr/include/oneapi/tbb/tbb_allocator.h
/usr/include/oneapi/tbb/tbbmalloc_proxy.h
/usr/include/oneapi/tbb/tick_count.h
/usr/include/oneapi/tbb/version.h
/usr/include/oneapi/tbb.h
/usr/include/tbb
/usr/include/tbb/blocked_range.h
/usr/include/tbb/blocked_range2d.h
/usr/include/tbb/blocked_range3d.h
/usr/include/tbb/blocked_rangeNd.h
/usr/include/tbb/cache_aligned_allocator.h
/usr/include/tbb/collaborative_call_once.h
/usr/include/tbb/combinable.h
/usr/include/tbb/concurrent_hash_map.h
/usr/include/tbb/concurrent_lru_cache.h
/usr/include/tbb/concurrent_map.h
/usr/include/tbb/concurrent_priority_queue.h
/usr/include/tbb/concurrent_queue.h
/usr/include/tbb/concurrent_set.h
/usr/include/tbb/concurrent_unordered_map.h
/usr/include/tbb/concurrent_unordered_set.h
/usr/include/tbb/concurrent_vector.h
/usr/include/tbb/enumerable_thread_specific.h
/usr/include/tbb/flow_graph.h
/usr/include/tbb/flow_graph_abstractions.h
/usr/include/tbb/global_control.h
/usr/include/tbb/info.h
/usr/include/tbb/memory_pool.h
/usr/include/tbb/null_mutex.h
/usr/include/tbb/null_rw_mutex.h
/usr/include/tbb/parallel_for.h
/usr/include/tbb/parallel_for_each.h
/usr/include/tbb/parallel_invoke.h
/usr/include/tbb/parallel_pipeline.h
/usr/include/tbb/parallel_reduce.h
/usr/include/tbb/parallel_scan.h
/usr/include/tbb/parallel_sort.h
/usr/include/tbb/partitioner.h
/usr/include/tbb/profiling.h
/usr/include/tbb/queuing_mutex.h
/usr/include/tbb/queuing_rw_mutex.h
/usr/include/tbb/scalable_allocator.h
/usr/include/tbb/spin_mutex.h
/usr/include/tbb/spin_rw_mutex.h
/usr/include/tbb/task.h
/usr/include/tbb/task_arena.h
/usr/include/tbb/task_group.h
/usr/include/tbb/task_scheduler_observer.h
/usr/include/tbb/tbb.h
/usr/include/tbb/tbb_allocator.h
/usr/include/tbb/tbbmalloc_proxy.h
/usr/include/tbb/tick_count.h
/usr/include/tbb/version.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/cmake
/usr/lib/x86_64-linux-gnu/cmake/TBB
/usr/lib/x86_64-linux-gnu/cmake/TBB/TBBConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/TBB/TBBConfigVersion.cmake
/usr/lib/x86_64-linux-gnu/cmake/TBB/TBBTargets-none.cmake
/usr/lib/x86_64-linux-gnu/cmake/TBB/TBBTargets.cmake
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/tbb.pc
/usr/share
/usr/share/doc
/usr/share/doc/libtbb-dev
/usr/share/doc/libtbb-dev/README.Debian
/usr/share/doc/libtbb-dev/copyright
/usr/lib/x86_64-linux-gnu/libtbb.so
/usr/lib/x86_64-linux-gnu/libtbbmalloc.so
/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
/usr/share/doc/libtbb-dev/changelog.Debian.gz
@enm10k
Copy link
Author

enm10k commented May 28, 2022

After some trials, I successfully executed cmake .. with the following change.

$ git diff
diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index 09ba16555..2394062a6 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -184,7 +184,8 @@ set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
 # Jiri: tbbvars now sets the CPATH environment variable to the directory
 #       containing the headers.
 find_path(TBB_INCLUDE_DIR
-    tbb/task_scheduler_init.h
+    # tbb/task_scheduler_init.h
+    tbb/info.h
     HINTS ${TBB_INC_SEARCH_DIR} ENV CPATH
 )
 mark_as_advanced(TBB_INCLUDE_DIR)
@@ -279,7 +280,7 @@ endif (NOT _TBB_INSTALL_DIR)
 
 if (TBB_FOUND)
        set(TBB_INTERFACE_VERSION 0)
-       FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
+       FILE(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _TBB_VERSION_CONTENTS)
        STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
        set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
         message(STATUS "TBB interface version: ${TBB_INTERFACE_VERSION}")

However, I got the following error on executing cmake --build ..
Apparently, the version of libtbb-dev I'm using is not correct.
I cannot find tbb/atomic.h in the result of dpkg -L libtbb-dev.

~/osrm-backend/build$ cmake --build .
Consolidate compiler generated dependencies of target UTIL
[ 11%] Built target UTIL
[ 11%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/compressed_edge_container.cpp.o
In file included from /home/ubuntu/osrm-backend/include/extractor/segment_data_container.hpp:4,
                 from /home/ubuntu/osrm-backend/include/extractor/compressed_edge_container.hpp:4,
                 from /home/ubuntu/osrm-backend/src/extractor/compressed_edge_container.cpp:1:
/home/ubuntu/osrm-backend/include/util/packed_vector.hpp:14:10: fatal error: tbb/atomic.h: No such file or directory
   14 | #include <tbb/atomic.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/EXTRACTOR.dir/build.make:76: CMakeFiles/EXTRACTOR.dir/src/extractor/compressed_edge_container.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:241: CMakeFiles/EXTRACTOR.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

@danpat
Copy link
Member

danpat commented May 28, 2022

OSRM depends on an older version of TBB than you're using. Newer TBB versions are not compatible with the older interface that OSRM was built against.

You can try building OSRM using the pre-built binaries we depend on: do cmake -DENABLE_MASON=ON and see if that fixes it for you - that will pull down a pre-compiled version of the older TBB library that works, and will statically link the OSRM binaries.

@enm10k
Copy link
Author

enm10k commented May 28, 2022

Thanks for your advice.
I successfully built OSRM with -DENABLE_MASON=ON option.

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

No branches or pull requests

2 participants