Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ipasichnyk
Novice
71 Views

TBB code with IBM XLC++ build error

Hi!

I am trying to build the code with IBM XL C/C++ which uses concurrent vector container:

#include <vector>
#include "tbb/tbb.h"
using namespace std;
tbb::concurrent_vector<int> my_list;
void add_element(int i) {
     my_list.push_back(i);
}
int main() {
     const int size = 100000;
     tbb::parallel_for(0,size,1, [=](int i) {
         add_element(i);
     } );
     return 0;
}

An example successfully compiles with GNU C++.  But IBM XL C++ has problems. Using the following command line:

xlc++ -std=c++0x example.cpp -ltbb

I get undefined references

    /tmp/83646_0.o:(.data+0x2a0): undefined reference to `tbb::internal::concurrent_vector_base_v3::~concurrent_vector_base_v3()'
    /tmp/83646_0.o:(.data+0x560): undefined reference to `tbb::internal::concurrent_vector_base_v3::~concurrent_vector_base_v3()'
    /tmp/83646_0.o:(.toc+0x180): undefined reference to `tbb::internal::concurrent_vector_base_v3::~concurrent_vector_base_v3()'

 

Does anybody has an experience with XLC++ compilers and TBB? The code which does not use concurrent vectors compiles also successfully with XLC++
 

0 Kudos
0 Replies
Reply