From 5e0d55345f464f0ddff15d75fb8ff04b03444c7a Mon Sep 17 00:00:00 2001 From: donlk Date: Sat, 15 Jun 2024 23:20:42 +0200 Subject: [PATCH] Fixed oneTBB compatibility based on: https://github.com/nmoehrle/mvs-texturing/pull/211. --- apps/texrecon/texrecon.cpp | 6 +++--- elibs/CMakeLists.txt | 2 +- elibs/tbb/FindTBB.cmake | 2 +- libs/tex/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/texrecon/texrecon.cpp b/apps/texrecon/texrecon.cpp index 42568302..a135f3bd 100644 --- a/apps/texrecon/texrecon.cpp +++ b/apps/texrecon/texrecon.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -60,8 +60,8 @@ int main(int argc, char **argv) { } // Set the number of threads to use. - tbb::task_scheduler_init schedule(conf.num_threads > 0 ? conf.num_threads : tbb::task_scheduler_init::automatic); - if (conf.num_threads > 0) { + int num_threads = conf.num_threads > 0 ? conf.num_threads : oneapi::tbb::info::default_concurrency(); + if (num_threads > 0) { omp_set_dynamic(0); omp_set_num_threads(conf.num_threads); } diff --git a/elibs/CMakeLists.txt b/elibs/CMakeLists.txt index e2beebc9..19305071 100644 --- a/elibs/CMakeLists.txt +++ b/elibs/CMakeLists.txt @@ -1,7 +1,7 @@ externalproject_add(ext_mapmap PREFIX ext_mapmap GIT_REPOSITORY https://github.com/dthuerck/mapmap_cpu.git - GIT_TAG 55d14fd + GIT_TAG fa526e0 UPDATE_COMMAND "" SOURCE_DIR ${CMAKE_SOURCE_DIR}/elibs/mapmap CONFIGURE_COMMAND "" diff --git a/elibs/tbb/FindTBB.cmake b/elibs/tbb/FindTBB.cmake index a1131aad..cc72075a 100644 --- a/elibs/tbb/FindTBB.cmake +++ b/elibs/tbb/FindTBB.cmake @@ -184,7 +184,7 @@ if(NOT TBB_FOUND) ################################## if(TBB_INCLUDE_DIRS) - file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) + file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file) string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${_tbb_version_file}") string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" diff --git a/libs/tex/CMakeLists.txt b/libs/tex/CMakeLists.txt index c51ff60f..3978187d 100644 --- a/libs/tex/CMakeLists.txt +++ b/libs/tex/CMakeLists.txt @@ -5,5 +5,5 @@ set(LIBRARY tex) add_library(${LIBRARY} STATIC ${SOURCES}) set_property(TARGET ${LIBRARY} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) add_dependencies(${LIBRARY} ext_rayint ext_mapmap) -target_link_libraries(${LIBRARY} ${TBB_LIBRARIES} -lmve -lmve_util ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES}) +target_link_libraries(${LIBRARY} ${TBB_LIBRARIES} -lmve -lmve_util tbb ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES}) install(TARGETS ${LIBRARY} ARCHIVE DESTINATION lib)