Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

ARM64 cross compiled tbb lib link errors

Evans__Brian
Beginner
1,748 Views

Hello,

I would like to use the TBB on my dev board (linux, ARM Cortex-A53 MPCore) and I am running into issue with linking the cross compiled TBB for ARM64 with my application. A simple Hello World cross compiled with same compiler runs on the target linux OS minus tbb. If buid for host platform with tbb compiled for Host x86 it works fine.

My introduction to TDD was from this article: https://solarianprogrammer.com/2019/05/09/cpp-17-stl-parallel-algorithms-gcc-intel-tbb-linux-macos/

I just followed it and then for cross compiled switched to cross compiler to create the tbb libs for arm64. I have been able to use TBB on my raspberry PI4 successfully with latest gcc and tbb source but built on PI. 

Not sure if there is a flag I am missing or something simple. Checked all the paths and those point to correct libs based on the link above.

Dev Setup:

Ubuntu 16.04 VM using C++17 and utilizing std execution policy feature.

I have cross compiled TBB 2019_U9 with aarch64-linux-gnu-g++-9.

I just have a simple program that sorts for now just to test the std::execution policy.

example: std::sort(std::execution::par, curr_data.begin(), curr_data.end());

Any suggestions would be great, Thanks!

 

Build output:

*************

[100%] Linking CXX executable arm-exe
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `__pstl::__par_backend::__merge_task<double*, double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, __pstl::__par_backend::__serial_destroy, __pstl::__par_backend::__serial_move_merge<__pstl::__par_backend::__stable_sort_task<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}>::execute()::{lambda(double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >)#1}, {lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}::execute()::{lambda(double*, double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >)#2}> >::execute()':
main.cpp:(.text._ZN6__pstl13__par_backend12__merge_taskIPdS2_N9__gnu_cxx17__normal_iteratorIS2_St6vectorIdSaIdEEEESt4lessIdENS0_16__serial_destroyENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S2_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS2_S8_E_ZNSV_7executeEvEUlS2_S2_S8_E0_EEE7executeEv[_ZN6__pstl13__par_backend12__merge_taskIPdS2_N9__gnu_cxx17__normal_iteratorIS2_St6vectorIdSaIdEEEESt4lessIdENS0_16__serial_destroyENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S2_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS2_S8_E_ZNSV_7executeEvEUlS2_S2_S8_E0_EEE7executeEv]+0xd0): undefined reference to `tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `__pstl::__par_backend::__merge_task<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*, std::less<double>, __pstl::__par_backend::__binary_no_op, __pstl::__par_backend::__serial_move_merge<__pstl::__par_backend::__stable_sort_task<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}>::execute()::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*)#3}, {lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}::execute()::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*)#4}> >::execute()':
main.cpp:(.text._ZN6__pstl13__par_backend12__merge_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES8_S4_St4lessIdENS0_14__binary_no_opENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S4_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS8_S4_E1_ZNSV_7executeEvEUlS8_S8_S4_E2_EEE7executeEv[_ZN6__pstl13__par_backend12__merge_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES8_S4_St4lessIdENS0_14__binary_no_opENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S4_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS8_S4_E1_ZNSV_7executeEvEUlS8_S8_S4_E2_EEE7executeEv]+0xd8): undefined reference to `tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `__pstl::__par_backend::__merge_task<double*, double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, __pstl::__par_backend::__binary_no_op, __pstl::__par_backend::__serial_move_merge<__pstl::__par_backend::__stable_sort_task<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}>::execute()::{lambda(double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >)#1}, {lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}::execute()::{lambda(double*, double*, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >)#2}> >::execute()':
main.cpp:(.text._ZN6__pstl13__par_backend12__merge_taskIPdS2_N9__gnu_cxx17__normal_iteratorIS2_St6vectorIdSaIdEEEESt4lessIdENS0_14__binary_no_opENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S2_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS2_S8_E_ZNSV_7executeEvEUlS2_S2_S8_E0_EEE7executeEv[_ZN6__pstl13__par_backend12__merge_taskIPdS2_N9__gnu_cxx17__normal_iteratorIS2_St6vectorIdSaIdEEEESt4lessIdENS0_14__binary_no_opENS0_19__serial_move_mergeIZNS0_18__stable_sort_taskIS8_S2_SA_ZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SP_T1_T2_SL_IbLb1EESS_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEvEUlS2_S8_E_ZNSV_7executeEvEUlS2_S2_S8_E0_EEE7executeEv]+0xd0): undefined reference to `tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `main':
main.cpp:(.text.startup+0xa0): undefined reference to `tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long)'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `__pstl::__par_backend::__stable_sort_task<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double*, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}>::execute()':
main.cpp:(.text._ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv[_ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv]+0x78): undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: main.cpp:(.text._ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv[_ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv]+0xb8): undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: main.cpp:(.text._ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv[_ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv]+0x148): undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: main.cpp:(.text._ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv[_ZN6__pstl13__par_backend18__stable_sort_taskIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES4_St4lessIdEZZNS_10__internal14__pattern_sortIRKNS_9execution2v115parallel_policyES8_SA_St17integral_constantIbLb0EEEEvOT_T0_SM_T1_T2_SI_IbLb1EESP_ENKUlvE_clEvEUlS8_S8_SA_E_E7executeEv]+0x178): undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/arm-exe.dir/main.cpp.o: in function `tbb::interface7::internal::delegated_function<__pstl::__par_backend::__parallel_stable_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}>(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, __pstl::__internal::__pattern_sort<__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false> >(__pstl::execution::v1::parallel_policy const&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>, std::integral_constant<bool, false>, std::integral_constant<bool, true>, std::integral_constant<bool, true>)::{lambda()#1}::operator()() const::{lambda(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, std::less<double>)#1}, unsigned long)::{lambda()#1} const, void>::operator()() const':
main.cpp:(.text._ZNK3tbb10interface78internal18delegated_functionIKZN6__pstl13__par_backend22__parallel_stable_sortIRKNS3_9execution2v115parallel_policyEN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEESt4lessIdEZZNS3_10__internal14__pattern_sortISA_SH_SJ_St17integral_constantIbLb0EEEEvOT_T0_SQ_T1_T2_SM_IbLb1EEST_ENKUlvE_clEvEUlSH_SH_SJ_E_EEvSP_SQ_SQ_SR_SS_mEUlvE_vEclEv[_ZNK3tbb10interface78internal18delegated_functionIKZN6__pstl13__par_backend22__parallel_stable_sortIRKNS3_9execution2v115parallel_policyEN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEESt4lessIdEZZNS3_10__internal14__pattern_sortISA_SH_SJ_St17integral_constantIbLb0EEEEvOT_T0_SQ_T1_T2_SM_IbLb1EEST_ENKUlvE_clEvEUlSH_SH_SJ_E_EEvSP_SQ_SQ_SR_SS_mEUlvE_vEclEv]+0x6c): undefined reference to `tbb::internal::allocate_via_handler_v3(unsigned long)'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: main.cpp:(.text._ZNK3tbb10interface78internal18delegated_functionIKZN6__pstl13__par_backend22__parallel_stable_sortIRKNS3_9execution2v115parallel_policyEN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEESt4lessIdEZZNS3_10__internal14__pattern_sortISA_SH_SJ_St17integral_constantIbLb0EEEEvOT_T0_SQ_T1_T2_SM_IbLb1EEST_ENKUlvE_clEvEUlSH_SH_SJ_E_EEvSP_SQ_SQ_SR_SS_mEUlvE_vEclEv[_ZNK3tbb10interface78internal18delegated_functionIKZN6__pstl13__par_backend22__parallel_stable_sortIRKNS3_9execution2v115parallel_policyEN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEESt4lessIdEZZNS3_10__internal14__pattern_sortISA_SH_SJ_St17integral_constantIbLb0EEEEvOT_T0_SQ_T1_T2_SM_IbLb1EEST_ENKUlvE_clEvEUlSH_SH_SJ_E_EEvSP_SQ_SQ_SR_SS_mEUlvE_vEclEv]+0x7c): undefined reference to `tbb::internal::allocate_root_proxy::allocate(unsigned long)'
collect2: error: ld returned 1 exit status
CMakeFiles/arm-exe.dir/build.make:83: recipe for target 'arm-exe' failed
make[2]: *** [arm-exe] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/arm-exe.dir/all' failed
make[1]: *** [CMakeFiles/arm-exe.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

************

 

 

 

0 Kudos
1 Solution
Vladimir_P_1234567890
1,748 Views

Hello, there is something wrong with your build scripts. there are lin64-tbb-export.def def files so the library build should fails in case it can't export symbols from that def file. I've tried ubuntu's default 7.4 cross compiler, everything look ok there except I can launch nothing:)

 

test:> basename `pwd`
linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release
test:> readelf -h libtbb.so.2 | grep Machine
  Machine:                           AArch64
test:> nm -gDC libtbb.so.2 | grep allocate
000000000001f668 T tbb::captured_exception::allocate(char const*, char const*)
000000000001c478 T tbb::internal::allocate_closure_v3(unsigned long)
000000000001ec48 T tbb::internal::allocate_root_proxy::free(tbb::task&)
000000000001ebc0 T tbb::internal::allocate_root_proxy::allocate(unsigned long)
00000000000185a8 T tbb::internal::allocate_via_handler_v3(unsigned long)
00000000000185f0 T tbb::internal::deallocate_via_handler_v3(void*)
000000000001ef50 T tbb::internal::allocate_child_proxy::free(tbb::task&) const
000000000001eef0 T tbb::internal::allocate_child_proxy::allocate(unsigned long) const
000000000001ee78 T tbb::internal::allocate_continuation_proxy::free(tbb::task&) const
000000000001ee10 T tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const
000000000001eda0 T tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const
000000000001ecb8 T tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const
000000000001f1a8 T tbb::internal::allocate_additional_child_of_proxy::free(tbb::task&) const
000000000001ef58 T tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const
                 U __cxa_allocate_exception
test:> cd ../../src/
test:> make test_parallel_for
make -C "../build/linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release" -r -f ../../build/Makefile.test cfg=release test_parallel_for
make[1]: Entering directory '../build/linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release'
aarch64-linux-gnu-g++-7 -o test_parallel_for.o -c -MMD -DDO_ITT_NOTIFY -g -O2 -DUSE_PTHREAD   -DTEST_USES_TBB=1 -Wall -Wextra -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor    -I../../src -I../../src/rml/include -I../../inc
lude -I. -include ../../src/test/harness_preload.h ../../src/test/test_parallel_for.cpp
aarch64-linux-gnu-g++-7 -o test_parallel_for.exe -DDO_ITT_NOTIFY -g -O2 -DUSE_PTHREAD   -DTEST_USES_TBB=1 -Wall -Wextra -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor  test_parallel_for.o libtbb.so   -lpthread -lrt -Wl,-rpa
th-link=. -rdynamic
./test_parallel_for.exe
./test_parallel_for.exe: 1: ./test_parallel_for.exe: Syntax error: Unterminated quoted string

Vladimir

View solution in original post

0 Kudos
5 Replies
Mark_L_Intel
Moderator
1,748 Views

Hi,

    This is a question that requires understanding of the TBB build process. I asked TBB developers to help through the internal email. You might also contact them directly:

1) Publicly on the forum: https://software.intel.com/en-us/forums/intel-threading-building-blocks 

2) Directly to the team; In the linked documentation we have included the contact email Inteltbbdevelopers@intel.com

0 Kudos
Aleksei_F_Intel
Employee
1,745 Views

Hi Brian,

It seems that either correct TBB library is not in the path during the linking process or the built TBB library does not have necessary symbols exported.

Could you please check what exactly TBB library the linker uses and does this library have necessary symbols?

Regards, Aleksei

0 Kudos
Evans__Brian
Beginner
1,745 Views

Aleksei,

TBB is in the path and I did not have any other tbb installed previously. As previously stated building the lib for x86 works fine and linking to my simple program works ok.

Here are the consolidated undefined refs:

 undefined reference to `tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const'
 undefined reference to `tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long)'
 undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
 undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
 undefined reference to `tbb::internal::allocate_via_handler_v3(unsigned long)' 
 undefined reference to `tbb::internal::allocate_root_proxy::allocate(unsigned long)'

Attached are symbol dump (nm -gDC libtbb.so.2) of the libtbb.

 

Context Example: 

Following line compiles with arm64 tbb using std::execution::seq

  • std::sort(std::execution::seq, curr_data.begin(), curr_data.end());

but when I use the built in parallel then I get the undefined refs

  • std::sort(std::execution::par, curr_data.begin(), curr_data.end());

 

Not sure if there is a flag that is not getting set during the build process, feels like its something simple that I am missing.

Thanks

 

0 Kudos
Vladimir_P_1234567890
1,749 Views

Hello, there is something wrong with your build scripts. there are lin64-tbb-export.def def files so the library build should fails in case it can't export symbols from that def file. I've tried ubuntu's default 7.4 cross compiler, everything look ok there except I can launch nothing:)

 

test:> basename `pwd`
linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release
test:> readelf -h libtbb.so.2 | grep Machine
  Machine:                           AArch64
test:> nm -gDC libtbb.so.2 | grep allocate
000000000001f668 T tbb::captured_exception::allocate(char const*, char const*)
000000000001c478 T tbb::internal::allocate_closure_v3(unsigned long)
000000000001ec48 T tbb::internal::allocate_root_proxy::free(tbb::task&)
000000000001ebc0 T tbb::internal::allocate_root_proxy::allocate(unsigned long)
00000000000185a8 T tbb::internal::allocate_via_handler_v3(unsigned long)
00000000000185f0 T tbb::internal::deallocate_via_handler_v3(void*)
000000000001ef50 T tbb::internal::allocate_child_proxy::free(tbb::task&) const
000000000001eef0 T tbb::internal::allocate_child_proxy::allocate(unsigned long) const
000000000001ee78 T tbb::internal::allocate_continuation_proxy::free(tbb::task&) const
000000000001ee10 T tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const
000000000001eda0 T tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const
000000000001ecb8 T tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const
000000000001f1a8 T tbb::internal::allocate_additional_child_of_proxy::free(tbb::task&) const
000000000001ef58 T tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const
                 U __cxa_allocate_exception
test:> cd ../../src/
test:> make test_parallel_for
make -C "../build/linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release" -r -f ../../build/Makefile.test cfg=release test_parallel_for
make[1]: Entering directory '../build/linux_intel64_gcc_cc7.4.0_libc2.27_kernel4.4.0_release'
aarch64-linux-gnu-g++-7 -o test_parallel_for.o -c -MMD -DDO_ITT_NOTIFY -g -O2 -DUSE_PTHREAD   -DTEST_USES_TBB=1 -Wall -Wextra -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor    -I../../src -I../../src/rml/include -I../../inc
lude -I. -include ../../src/test/harness_preload.h ../../src/test/test_parallel_for.cpp
aarch64-linux-gnu-g++-7 -o test_parallel_for.exe -DDO_ITT_NOTIFY -g -O2 -DUSE_PTHREAD   -DTEST_USES_TBB=1 -Wall -Wextra -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor  test_parallel_for.o libtbb.so   -lpthread -lrt -Wl,-rpa
th-link=. -rdynamic
./test_parallel_for.exe
./test_parallel_for.exe: 1: ./test_parallel_for.exe: Syntax error: Unterminated quoted string

Vladimir

0 Kudos
Evans__Brian
Beginner
1,745 Views

Vladimir,

Thanks for the hint! Build script linux.inc needed to be updated for correct arch and 64 bit def file. Linking now and running on target.

Thanks,

Brian Evans

0 Kudos
Reply