TheBaum
TheBaum

Reputation: 164

Compilation Error using TBB: inlining failed in call to ‘always_inline’

I want to use the TBB library for my Project, but the compilation fails with this error:

/usr/lib/gcc/x86_64-linux-gnu/12/include/waitpkgintrin.h: In function ‘void tbb::detail::r1::prolonged_pause()’:
/usr/lib/gcc/x86_64-linux-gnu/12/include/waitpkgintrin.h:53:1: error: inlining failed in call to ‘always_inline’ ‘unsigned char _tpause(unsigned int, long long unsigned int)’: target specific option mismatch
   53 | _tpause (unsigned int __A, unsigned long long __B)
      | ^~~~~~~
compilation terminated due to -Wfatal-errors.

I made a minimal reproducible setup were I still get this error:

CMake:

include(FetchContent)
FetchContent_Declare(
    tbb
    GIT_REPOSITORY "https://github.com/oneapi-src/oneTBB"
    GIT_TAG "v2021.2.3"
)
FetchContent_MakeAvailable(tbb)

add_executable(TestTbb test_tbb.cpp)
target_link_libraries(TestTbb PUBLIC TBB::tbb )
target_include_directories(TestTbb PRIVATE ${tbb_SOURCE_DIR}/include)

test_tbb.cpp

#include <iostream>
#include <tbb/concurrent_unordered_map.h>
int main(){
    tbb::concurrent_unordered_map<int, char> t;
    t.insert({1, 'a'});
    t.insert({2, 'b'});
    auto element = t.find(1);
    std::cout << "result for " << 1 << " = " << element->second << std::endl;
}

I'm using CLion with the WSL(Debian) Toolchain on Windows 11.

EDIT: The answers to related Question inlining failed in call to always_inline ‘_mm_mullo_epi32’: target specific option mismatch did not solve my Problem.

Upvotes: 0

Views: 61

Answers (0)

Related Questions