1 year ago

#268403

test-img

user5570258

[oneTBB]: undefined reference to tbb::detail::r1::xxxxx #802

with the usage:

ExternalProject_Add(tbb
    PREFIX ${CMAKE_SOURCE_DIR}/deps
    DOWNLOAD_NO_PROGRESS 1
    DOWNLOAD_NAME v2021.4.0
    # TODO: add wb cdn link
    URL https://codeload.github.com/oneapi-src/oneTBB/tar.gz/refs/tags/v2021.4.0
    URL_HASH SHA1=2641f9a1ead4621a8660ee07a1664627fa0eb477
    BUILD_IN_SOURCE 1
    LOG_CONFIGURE 1
    LOG_BUILD 1
    LOG_INSTALL 1
    CMAKE_COMMAND ${CMAKE_COMMAND}
    CMAKE_ARGS 
        -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> 
        -DBUILD_SHARED_LIBS=OFF 
        -DTBB_TEST=OFF 
        -DTBB_EXAMPLES=OFF 
        -DTBB_BENCH=OFF
    #CONFIGURE_COMMAND ""
    BUILD_COMMAND make extra_inc=big_iron.inc ${ENABLE_STD_LIB}
    INSTALL_COMMAND bash -c "/bin/cp -f */libtbb.${TBB_LIB_SUFFIX}* ${CMAKE_SOURCE_DIR}/deps/lib/"
    BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/deps/lib/libtbb.${TBB_LIB_SUFFIX}
)

lead to

/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:271: error: undefined reference to 'tbb::detail::r1::initialize(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_small_object_pool.h:61: error: undefined reference to 'tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_arena.h:466: error: undefined reference to 'tbb::detail::r1::max_concurrency(tbb::detail::d1::task_arena_base const*)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_task.h:191: error: undefined reference to 'tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'

In mac OS , it works well, but centos 7.2(gcc 7.2) and ubuntu(clang 6) it lead to the errors . Any one can help??

c++

undefined-reference

tbb

0 Answers

Your Answer

Accepted video resources