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

Errors in tbb interface and concurrent_unordered_impl

nav_i_
Beginner
2,570 Views
I had successfully compiled my code 6 months back with TBB version 3, but now when I try with version 4 or 3, it gives the errors as shown below. Please help, as I'm stuck with this for 4 days already. Am using Linux localhost.localdomain 2.6.32-431.el6.x86_64 Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) TBB version 4: On using /usr/local/tbb43_20150316oss/include /usr/local/tbb43_20150316oss/lib/intel64/gcc4.4/libtbb.so g++ -c -g -Iinclude -I../Estimator/include -I/opt/intel/composer_xe_2015.2.164/mkl/include -I/usr/local/tbb43_20150316oss/include -MMD -MP -MF build/Debug/GNU-Linux-x86/source/Group.o.d -o build/Debug/GNU-Linux-x86/source/Group.o source/Group.cpp In file included from /usr/local/tbb43_20150316oss/include/tbb/concurrent_hash_map.h:47, from /usr/local/tbb43_20150316oss/include/tbb/tbb.h:42, from source/Group.cpp:17: /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:270: error: ‘__TBB_FORWARDING_REF’ has not been declared /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:270: error: expected ‘,’ or ‘...’ before ‘t’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:286: error: expected nested-name-specifier before ‘__TBB_PARAMETER_PACK’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:286: error: expected ‘>’ before ‘Args’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: ‘Args’ was not declared in this scope /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: there are no arguments to ‘__TBB_FORWARDING_REF’ that depend on a template parameter, so a declaration of ‘__TBB_FORWARDING_REF’ must be available /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: expected ‘)’ before ‘__TBB_PARAMETER_PACK’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: ISO C++ forbids initialization of member ‘create_node_v’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: making ‘create_node_v’ static /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:287: error: template declaration of ‘tbb::interface5::internal::split_ordered_list::node* tbb::interface5::internal::create_node_v’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h: In member function ‘tbb::interface5::internal::split_ordered_list::node* tbb::interface5::internal::split_ordered_list::create_node(tbb::interface5::internal::sokey_t, int (*)(Arg))’: /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:275: error: ‘forward’ is not a member of ‘tbb::internal’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:275: error: expected primary-expression before ‘>’ token /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:275: error: ‘t’ was not declared in this scope /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h: At global scope: /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: expected primary-expression before ‘)’ token /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: there are no arguments to ‘__TBB_FORWARDING_REF’ that depend on a template parameter, so a declaration of ‘__TBB_FORWARDING_REF’ must be available /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: expected ‘)’ before ‘value’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: expected primary-expression before ‘pnode’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: ISO C++ forbids initialization of member ‘internal_insert’ /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: making ‘internal_insert’ static /usr/local/tbb43_20150316oss/include/tbb/internal/_concurrent_unordered_impl.h:1288: error: template declaration of ‘std::pair::iterator, bool> tbb::interface5::internal::internal_insert’ In file included from /usr/local/tbb43_20150316oss/include/tbb/flow_graph.h:2910, from /usr/local/tbb43_20150316oss/include/tbb/tbb.h:53, from source/Group.cpp:17: /usr/local/tbb43_20150316oss/include/tbb/internal/_flow_graph_indexer_impl.h:37: error: expected ‘>’ before numeric constant gmake[2]: *** [build/Debug/GNU-Linux-x86/source/Group.o] Error 1 gmake[2]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake[1]: *** [.build-conf] Error 2 gmake[1]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 9s) ---------------------------------------------------------------------------------------------------------------------------------------- TBB version 3 On trying /usr/local/tbb30_20100406oss/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/libtbb.so and /usr/local/tbb30_20100406oss/include g++ -o dist/Debug/GNU-Linux-x86/Assoc build/Debug/GNU-Linux-x86/source/AssignmentPair.o build/Debug/GNU-Linux-x86/source/Assoc.o build/Debug/GNU-Linux-x86/source/CoordinateConversion.o build/Debug/GNU-Linux-x86/source/DummyPredictedTrack.o build/Debug/GNU-Linux-x86/source/GateInfo.o build/Debug/GNU-Linux-x86/source/GenerateCostMatrix.o build/Debug/GNU-Linux-x86/source/Group.o build/Debug/GNU-Linux-x86/source/GroupHypo.o build/Debug/GNU-Linux-x86/source/GroupNode.o build/Debug/GNU-Linux-x86/source/Hungarian.o build/Debug/GNU-Linux-x86/source/Hypo.o build/Debug/GNU-Linux-x86/source/LapJv.o build/Debug/GNU-Linux-x86/source/Main.o build/Debug/GNU-Linux-x86/source/Measurement.o build/Debug/GNU-Linux-x86/source/MergeGroup.o build/Debug/GNU-Linux-x86/source/Mht.o build/Debug/GNU-Linux-x86/source/MhtProcessingThread.o build/Debug/GNU-Linux-x86/source/MhtSendThread.o build/Debug/GNU-Linux-x86/source/Murty.o build/Debug/GNU-Linux-x86/source/PlotAsterixDecoder.o build/Debug/GNU-Linux-x86/source/ReceiveData.o build/Debug/GNU-Linux-x86/source/SplitGroup.o build/Debug/GNU-Linux-x86/source/Track.o build/Debug/GNU-Linux-x86/source/TrackAsterix.o build/Debug/GNU-Linux-x86/source/UdpServer_.o ../Estimator/dist/Debug/GNU-Linux-x86/libestimator.a /opt/intel/mkl/lib/intel64/libmkl_rt.so /usr/local/tbb30_20100406oss/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/libtbb.so /usr/local/tbb30_20100406oss/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/libtbbmalloc.so build/Debug/GNU-Linux-x86/source/Assoc.o: In function `~parallel_do_feeder_impl': /usr/local/tbb30_20100406oss/include/tbb/parallel_do.h:189: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Group.o: In function `~task_group': /usr/local/tbb30_20100406oss/include/tbb/task_group.h:164: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' /usr/local/tbb30_20100406oss/include/tbb/task_group.h:168: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Group.o: In function `~parallel_do_feeder_impl': /usr/local/tbb30_20100406oss/include/tbb/parallel_do.h:189: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Mht.o: In function `~parallel_do_feeder_impl': /usr/local/tbb30_20100406oss/include/tbb/parallel_do.h:189: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Mht.o:/usr/local/tbb30_20100406oss/include/tbb/parallel_do.h:189: more undefined references to `tbb::interface5::internal::task_base::destroy(tbb::task&)' follow collect2: ld returned 1 exit status gmake[2]: *** [dist/Debug/GNU-Linux-x86/Assoc] Error 1 gmake[2]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake[1]: *** [.build-conf] Error 2 gmake[1]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 38s)
0 Kudos
1 Solution
Christophe_H_Intel
2,570 Views

Hello, Nav,

Thank you for asking.  The __TBB_FORWARDING_REF macro is to help support C++11 rvalue references, and is a new feature for TBB.  (I don't know about the task::destroy error.)

Is it possible you have more than one version of tbb include files in your path?  Could you try your compile with -H, or -E to preprocess the file, and see if this is the case?

I hope we can help you,
Chris

View solution in original post

0 Kudos
7 Replies
Christophe_H_Intel
2,571 Views

Hello, Nav,

Thank you for asking.  The __TBB_FORWARDING_REF macro is to help support C++11 rvalue references, and is a new feature for TBB.  (I don't know about the task::destroy error.)

Is it possible you have more than one version of tbb include files in your path?  Could you try your compile with -H, or -E to preprocess the file, and see if this is the case?

I hope we can help you,
Chris

0 Kudos
nav_i_
Beginner
2,570 Views
Ah thanks! Tried -H and -E and found that scalable_allocator was being included from two places: /opt/intel/tbb/include/tbb/scalable_allocator.h and /usr/include/tbb/scalable_allocator.h Fixed that, and now the error shown is: In file included from /opt/intel/tbb/include/tbb/flow_graph.h:2892, from /opt/intel/tbb/include/tbb/tbb.h:53, from source/Group.cpp:17: /opt/intel/tbb/include/tbb/internal/_flow_graph_indexer_impl.h:37: error: expected ‘>’ before numeric constant gmake[2]: *** [build/Debug/GNU-Linux-x86/source/GroupFormation.o] Error 1 gmake[2]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake[1]: *** [.build-conf] Error 2 gmake[1]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake: *** [.build-impl] Error 2
0 Kudos
RafSchietekat
Valued Contributor III
2,570 Views

Macro K defined somewhere?

0 Kudos
nav_i_
Beginner
2,570 Views
My goodness! Raf, how in the world did you find that out? Yes there was a K defined which had caused a conflict with Boost a few years back.
#define K 6.0 //BUG/WARNING/CAUTION: using this macro may conflict with a 'class K' of ptr_map of boost
Noted. Should use a more meaningful name for variable/constant names.

After renaming K to SCAN_K, I tried building with -s and -c options too, and the builds were successful. Problem happens during linking. Now the error on linking is: g++ -o dist/Debug/GNU-Linux-x86/Assoc build/Debug/GNU-Linux-x86/source/AssignmentPair.o build/Debug/GNU-Linux-x86/source/Assoc.o build/Debug/GNU-Linux-x86/source/CoordinateConversion.o build/Debug/GNU-Linux-x86/source/DummyPredictedTrack.o build/Debug/GNU-Linux-x86/source/GateInfo.o build/Debug/GNU-Linux-x86/source/GenerateCostMatrix.o build/Debug/GNU-Linux-x86/source/GroupFormation.o build/Debug/GNU-Linux-x86/source/GroupHypo.o build/Debug/GNU-Linux-x86/source/GroupNode.o build/Debug/GNU-Linux-x86/source/Hungarian.o build/Debug/GNU-Linux-x86/source/Hypo.o build/Debug/GNU-Linux-x86/source/LapJv.o build/Debug/GNU-Linux-x86/source/Main.o build/Debug/GNU-Linux-x86/source/Measurement.o build/Debug/GNU-Linux-x86/source/MergeGroup.o build/Debug/GNU-Linux-x86/source/Mht.o build/Debug/GNU-Linux-x86/source/MhtProcessingThread.o build/Debug/GNU-Linux-x86/source/MhtSendThread.o build/Debug/GNU-Linux-x86/source/Murty.o build/Debug/GNU-Linux-x86/source/PlotAsterixDecoder.o build/Debug/GNU-Linux-x86/source/ReceiveData.o build/Debug/GNU-Linux-x86/source/SplitGroup.o build/Debug/GNU-Linux-x86/source/Track.o build/Debug/GNU-Linux-x86/source/TrackAsterix.o build/Debug/GNU-Linux-x86/source/UdpServer_.o ../Estimator/dist/Debug/GNU-Linux-x86/libestimator.a /opt/intel/mkl/lib/intel64/libmkl_rt.so /opt/intel/tbb/lib/intel64/gcc4.4/libtbb.so /opt/intel/tbb/lib/intel64/gcc4.4/libtbbmalloc.so build/Debug/GNU-Linux-x86/source/Assoc.o: In function `~parallel_do_feeder_impl': /opt/intel/tbb/include/tbb/parallel_do.h:182: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/GroupFormation.o: In function `tbb::internal::throw_exception(tbb::internal::exception_id)': /opt/intel/tbb/include/tbb/tbb_exception.h:117: undefined reference to `tbb::internal::throw_exception_v4(tbb::internal::exception_id)' build/Debug/GNU-Linux-x86/source/GroupFormation.o: In function `~task_group_base': /opt/intel/tbb/include/tbb/task_group.h:121: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' /opt/intel/tbb/include/tbb/task_group.h:124: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' /opt/intel/tbb/include/tbb/task_group.h:129: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/GroupFormation.o: In function `~parallel_do_feeder_impl': /opt/intel/tbb/include/tbb/parallel_do.h:182: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Mht.o: In function `~parallel_do_feeder_impl': /opt/intel/tbb/include/tbb/parallel_do.h:182: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)' build/Debug/GNU-Linux-x86/source/Mht.o:/opt/intel/tbb/include/tbb/parallel_do.h:182: more undefined references to `tbb::interface5::internal::task_base::destroy(tbb::task&)' follow collect2: ld returned 1 exit status gmake[2]: *** [dist/Debug/GNU-Linux-x86/Assoc] Error 1 gmake[2]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake[1]: *** [.build-conf] Error 2 gmake[1]: Leaving directory `/home/nkipe/NetBeansProjects/Assoc' gmake: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 41s) Alexy had suggested in this thread https://software.intel.com/en-us/forums/topic/288908, to try one of the example programs of TBB and use ldd, so when I tried, this is the output I got: ldd game_of_life linux-vdso.so.1 => (0x00007fff03c8a000) libtbb.so.2 => /usr/lib64/libtbb.so.2 (0x00007fbd2ffe8000) librt.so.1 => /lib64/librt.so.1 (0x000000302ce00000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x000000346e400000) libm.so.6 => /lib64/libm.so.6 (0x000000302be00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000346e000000) libc.so.6 => /lib64/libc.so.6 (0x000000302c200000) libpthread.so.0 => /lib64/libpthread.so.0 (0x000000302c600000) libdl.so.2 => /lib64/libdl.so.2 (0x000000302ca00000) /lib64/ld-linux-x86-64.so.2 (0x000000302ba00000) Although from the build output, it appears the correct libraries are being linked: /opt/intel/tbb/lib/intel64/gcc4.4/libtbb.so /opt/intel/tbb/lib/intel64/gcc4.4/libtbbmalloc.so
0 Kudos
nav_i_
Beginner
2,570 Views
Update: After taking a backup of the files, I deleted the tbb include and lib files from /usr/lib64 and added -L/opt/intel/tbb/lib/intel64/gcc4.4 -I/opt/intel/tbb/include to the "Additional options" in the linker options. Build was successful this time. On running the executable, it gave the error /home/nkipe/NetBeansProjects/Assoc/dist/Debug/GNU-Linux-x86/assoc: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory Even adding export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/intel/tbb/lib/intel64/gcc4.4" to .bashrc and sourcing it with source ~/.bashrc did not help. The "cannot open shared object file: No such file or directory" error still occurs. ldd shows: ldd assoc linux-vdso.so.1 => (0x00007fffd359a000) /opt/intel/mkl/lib/intel64/libmkl_rt.so (0x00007fbf705f9000) libtbb.so.2 => not found libtbbmalloc.so.2 => not found libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x000000346e400000) libm.so.6 => /lib64/libm.so.6 (0x000000302be00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000346e000000) libc.so.6 => /lib64/libc.so.6 (0x000000302c200000) libpthread.so.0 => /lib64/libpthread.so.0 (0x000000302c600000) libdl.so.2 => /lib64/libdl.so.2 (0x000000302ca00000) /lib64/ld-linux-x86-64.so.2 (0x000000302ba00000) How can it not be found when I have linked it and the program got built successfully?
0 Kudos
nav_i_
Beginner
2,570 Views
Solved! The /opt/intel/tbb folder was actually a link to a folder in the composer folder's tbb. Maybe that's why the .so.2's could not be found. I downloaded tbb30_20100406oss and pointed all paths to it. After building, although I wasn't able to run it via Netbeans because of a /home/nkipe/NetBeansProjects/Association/dist/Debug/GNU-Linux-x86/assoc: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory error, I was able to run it via the commandline. Thanks a lot Raf and Christopher!!! :-)
0 Kudos
RafSchietekat
Valued Contributor III
2,570 Views

To make sure we're on the same page, please create a new shell, and use it to consecutively echo the path, list the *.so.2 contents of the relevant directory (full output to see permissions), do ldd assoc, and then ./assoc.

(Added) Oops, didn't see the previous posting. Perhaps logging out and back in (shortest explanation and greatest assurance) will allow the program to run when launched from NetBeans?

0 Kudos
Reply