Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

memory_pool linking error

Yadava__Himanshu
Beginner
484 Views

I'm implementing a custom allocator using the tbb memory_pool class, Everything seems to compile fine, but during linking I get the following linker error. Any ideas why I might be getting this? I was already using  tbb::parallel_for in my code, which works fine. So I know tbb library is getting linked.

Host: centos 7

Compiler: c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)

CMakeFiles/spell.dir/src/tools/test.cc.o: In function `tbb::interface6::internal::pool_base::malloc(unsigned long)':
/home/hyadava/git/speller/libspeller/ext/tbb/include/tbb/memory_pool.h:58: undefined reference to `rml::pool_malloc(rml::MemoryPool*, unsigned long)'
CMakeFiles/spell.dir/src/tools/test.cc.o: In function `tbb::interface6::internal::pool_base::free(void*)':
/home/hyadava/git/speller/libspeller/ext/tbb/include/tbb/memory_pool.h:61: undefined reference to `rml::pool_free(rml::MemoryPool*, void*)'
CMakeFiles/spell.dir/src/tools/test.cc.o: In function `tbb::interface6::memory_pool<tbb::scalable_allocator<char> >::memory_pool(tbb::scalable_allocator<char> const&)':
/home/hyadava/git/speller/libspeller/ext/tbb/include/tbb/memory_pool.h:224: undefined reference to `rml::pool_create_v1(long, rml::MemPoolPolicy const*, rml::MemoryPool**)'
CMakeFiles/spell.dir/src/tools/test.cc.o: In function `tbb::scalable_allocator<char>::allocate(unsigned long, void const*)':
/home/hyadava/git/speller/libspeller/ext/tbb/include/tbb/scalable_allocator.h:266: undefined reference to `scalable_malloc'
CMakeFiles/spell.dir/src/tools/test.cc.o: In function `tbb::scalable_allocator<char>::deallocate(char*, unsigned long)':
/home/hyadava/git/speller/libspeller/ext/tbb/include/tbb/scalable_allocator.h:274: undefined reference to `scalable_free'
collect2: error: ld returned 1 exit status

0 Kudos
1 Reply
Viet_H_Intel
Moderator
484 Views

Seems to me  that TBB libs didn't correctly link in.

0 Kudos
Reply