Community
cancel
Showing results for 
Search instead for 
Did you mean: 
akhal
Beginner
607 Views

Undefined reference to "scalable_free"

Jump to solution
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
607 Views
you need-ltbb as well as -ltbbmalloc
icc -openmp histogram.cc -o histogram -ltbb-ltbbmalloc

--Vladimir

View solution in original post

4 Replies
Anton_M_Intel
Employee
607 Views
scalable_malloc is defined in the separate shared object (i.e. DLL), please specify -ltbbmalloc for the compiler as well.
On Windows, it links automatically thanks to#pragma comment(lib, "tbbmalloc.lib") specified in the .h file.
akhal
Beginner
607 Views
I tried it that way now, but now it produces again so many errors (though as I said it successfully compiles and runs in windows);

[x_akhal@neolith1 HISTOGRAM]$ icc -openmp histogram.cc -o histogram -ltbbmalloc
/tmp/icc0vXt7v.o: In function `main':
histogram.cc:(.text+0x18a): undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned long)'
histogram.cc:(.text+0x7fb): undefined reference to `tbb::task_group_context::init()'
histogram.cc:(.text+0x822): undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
histogram.cc:(.text+0x864): undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
histogram.cc:(.text+0x88b): undefined reference to `tbb::task_group_context::~task_group_context()'
histogram.cc:(.text+0xa98): undefined reference to `tbb::task_scheduler_init::terminate()'
histogram.cc:(.text+0xb20): undefined reference to `tbb::task_group_context::~task_group_context()'
/tmp/icc0vXt7v.o: In function `hist_tbb(long*, int*)':
histogram.cc:(.text+0x1090): undefined reference to `tbb::task_group_context::init()'
histogram.cc:(.text+0x10b7): undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
histogram.cc:(.text+0x1102): undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
histogram.cc:(.text+0x112f): undefined reference to `tbb::task_group_context::~task_group_context()'
histogram.cc:(.text+0x1147): undefined reference to `tbb::task_group_context::~task_group_context()'
/tmp/icc0vXt7v.o: In function `operator delete(void*, tbb::internal::allocate_root_with_context_proxy const&)':
histogram.cc:(.gnu.linkonce.t._ZdlPvRKN3tbb8internal32allocate_root_with_context_proxyE[.gnu.linkonce.t._ZdlPvRKN3tbb8internal32allocate_root_with_context_proxyE]+0xb): undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
/tmp/icc0vXt7v.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]+0x56): undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
histogram.cc:(.gnu.linkonce.t._ZN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEE7executeEv[.gnu.linkonce.t._ZN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEE7executeEv]+0xa2): undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
/tmp/icc0vXt7v.o: In function `operator delete(void*, tbb::internal::allocate_child_proxy const&)':
histogram.cc:(.gnu.linkonce.t._ZdlPvRKN3tbb8internal20allocate_child_proxyE[.gnu.linkonce.t._ZdlPvRKN3tbb8internal20allocate_child_proxyE]+0xb): undefined reference to `tbb::internal::allocate_child_proxy::free(tbb::task&) const'
/tmp/icc0vXt7v.o: In function `operator delete(void*, tbb::internal::allocate_continuation_proxy const&)':
histogram.cc:(.gnu.linkonce.t._ZdlPvRKN3tbb8internal27allocate_continuation_proxyE[.gnu.linkonce.t._ZdlPvRKN3tbb8internal27allocate_continuation_proxyE]+0xb): undefined reference to `tbb::internal::allocate_continuation_proxy::free(tbb::task&) const'
/tmp/icc0vXt7v.o: In function `tbb::task_scheduler_init::~task_scheduler_init()':
histogram.cc:(.gnu.linkonce.t._ZN3tbb19task_scheduler_initD1Ev[.gnu.linkonce.t._ZN3tbb19task_scheduler_initD1Ev]+0xa): undefined reference to `tbb::task_scheduler_init::terminate()'
/tmp/icc0vXt7v.o:(.gnu.linkonce.d._ZTIN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEEE[.gnu.linkonce.d._ZTIN3tbb8internal12start_reduceINS_13blocked_rangeIiEE13histogram_tbbKNS_16auto_partitionerEEE]+0x10): undefined reference to `typeinfo for tbb::task'
/tmp/icc0vXt7v.o:(.gnu.linkonce.d._ZTVN3tbb8internal13finish_reduceI13histogram_tbbEE[.gnu.linkonce.d._ZTVN3tbb8internal13finish_reduceI13histogram_tbbEE]+0x28): undefined reference to `tbb::task::note_affinity(unsigned short)'
/tmp/icc0vXt7v.o:(.gnu.linkonce.d._ZTIN3tbb8internal13finish_reduceI13histogram_tbbEE[.gnu.linkonce.d._ZTIN3tbb8internal13finish_reduceI13histogram_tbbEE]+0x10): undefined reference to `typeinfo for tbb::task'
[x_akhal@neolith1 HISTOGRAM]$

608 Views
you need-ltbb as well as -ltbbmalloc
icc -openmp histogram.cc -o histogram -ltbb-ltbbmalloc

--Vladimir

View solution in original post

akhal
Beginner
607 Views
Thank you so much. I wont be able to solve such minor issues by googling without your support, Thanks once again....
Reply