Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Intel TBB link question

johnpr01
Beginner
368 Views
I'm not quite sure how to pose this question because I'm so thoroughly confused by it, so I'll just jump right into it.

I have a simple little chunk of code that basically just grabs data from a text repository on disk. When I first started I had it in a single threaded process and it linked and worked just fine. Then I decided to thread it using tbb's parallel_for. I wrote the "Apply" constructor and overloaded the operator() and simply copy-and-pasted the for loop that originally worked into the operator() function and the only change I made was to the iteration space of the for loop. Now when I compile it, it throws an undefined reference to a function inside the for loop. What's really confusing is that other functions in the library that also contains the undefined function work just fine. I know this is a horrible description of the problem, was just hoping that someone else may have had a similar error and may give me some insight as to what is going on. And yes, ApplyParser does include the .h file in which storage_read is defined.

Thank you.

Here's the actual link error that it is throwing:
./src/PercyIndexer.o: In function `ApplyParser::operator()(tbb::blocked_range const&) const':
PercyIndexer.cc:(.text._ZNK11ApplyParserclERKN3tbb13blocked_rangeIjEE[ApplyParser::operator()(tbb::blocked_range const&) const]+0xf3): undefined reference to `storage_read(storage_t*, unsigned long, char*, long*)'
./src/PercyIndexer.o: In function `tbb::internal::start_for<:BLOCKED_RANGE>, ApplyParser>::execute()':
PercyIndexer.cc:(.text._ZN3tbb8internal9start_forINS_13blocked_rangeIjEE11ApplyParserE7executeEv[tbb::internal::start_for<:BLOCKED_RANGE>, ApplyParser>::execute()]+0x1d5): undefined reference to `storage_read(storage_t*, unsigned long, char*, long*)'
0 Kudos
0 Replies
Reply