undefined reference to 'scalable_free'

undefined reference to 'scalable_free'

Hello

I have installed individual free versions of parallel studio xe both in Windows (Visual Studio) and in my Linux systems. I made a program that uses since I am using scalable_malloc and scalable_free inside my functor object. My program compiles and runs successfuly in Visual Studio, but When I try compiling it in Linux system (after setting environment), I get this error:

icc -openmp histogram.cc -o histogram -ltbb

/tmp/icc8Kgyh5.o: In function `tbb::internal::start_reduce, histogram_tbb, tbb::auto_partitioner const>::execute()':
histogram.cc:(.gnu.linkonce.t._ZN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEE7executeEv[.gnu.linkonce.t._ZN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEE7executeEv]+0x1e7): undefined reference to `scalable_malloc'
/tmp/icc8Kgyh5.o: In function `tbb::internal::finish_reduce::execute()':
histogram.cc:(.gnu.linkonce.t._ZN3tbb8internal13finish_reduceI13histogram_tbbE7executeEv[.gnu.linkonce.t._ZN3tbb8internal13finish_reduceI13histogram_tbbE7executeEv]+0x30): undefined reference to `scalable_free'

I wonder whats problem with scalable_allocator here, Can anyone help please ?

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Hello,
Thanks for contacting us with questions. You need to link it to another library called libtbb_malloc.so. So your compiler command line would be

icc -openmp histogram.cc -o histogram -ltbb -ltbb_malloc

Please let me know if you have any questions.

Thanks,
Krishna

Thank you so much, it worked for me. Quite valuable infor which is hard to find by googling, thanks again:)

No problem. I am glad we got you moving forward on this one.

Thanks,
Krishna

Leave a Comment

Please sign in to add a comment. Not a member? Join today