Software Archive
Read-only legacy content
17061 Discussions

undefined reference to 'scalable_free'

akhal
Beginner
714 Views
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<:BLOCKED_RANGE>, 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 ?
0 Kudos
1 Solution
Krishna_R_Intel
Employee
714 Views
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

View solution in original post

0 Kudos
3 Replies
Krishna_R_Intel
Employee
715 Views
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
0 Kudos
akhal
Beginner
714 Views
Thank you so much, it worked for me. Quite valuable infor which is hard to find by googling, thanks again:)
0 Kudos
Krishna_R_Intel
Employee
714 Views
No problem. I am glad we got you moving forward on this one.

Thanks,
Krishna
0 Kudos
Reply