[Debian-med-packaging] Seeking CMake help for spades

Sascha Steinbiss satta at tetrinetsucht.de
Sun Feb 21 18:20:13 UTC 2016


Hi Gert,

thanks for your help!

>> [ 73%] Building CXX object io/CMakeFiles/input.dir/logger_impl.cpp.o
>> /build/spades-3.6.2+dfsg/src/io/logger_impl.cpp: In member function
>> 'void logging::logger::log(logging::level, const char*, size_t, const
>> char*, const char*)':
>> /build/spades-3.6.2+dfsg/src/io/logger_impl.cpp:107:51: error:
>> 'je_mallctl' was not declared in this scope
>>   je_mallctl("stats.cactive", &cmem, &clen, NULL, 0);
> 
> Since the compiler doesn't complain about include files not found, this
> is not a cmake issue. 

I see, and I suspected as much.

> I've pushed a patch to the build git that defines JEMALLOC_NO_RENAME
> before including jemalloc/jemalloc.h. 
> I did test compiling, but didn't look whether linking actually works.

Yes, this indeed fixed the compiling for this file (and the rest as well after adding 'add_definitions(-DJEMALLOC_NO_RENAME)’.

> AFAICS the library actually exports the je_* names though.  

Unfortunately it doesn’t:

[vagrant at vagrant-debian-jessie:/vagrant/spades] $ nm -Dg /usr/lib/x86_64-linux-gnu/libjemalloc.so.1 | grep \ T
0000000000006550 T aligned_alloc
0000000000009b00 T allocm
00000000000065b0 T calloc
0000000000009cd0 T dallocm
0000000000009160 T dallocx
000000000002b60c T _fini
0000000000004240 T free
00000000000030b0 T _init
0000000000009780 T mallctl
00000000000098c0 T mallctlbymib
0000000000009840 T mallctlnametomib
0000000000005f10 T malloc
0000000000009990 T malloc_stats_print
0000000000009a40 T malloc_usable_size
0000000000006c80 T mallocx
0000000000005d40 T memalign
0000000000009ce0 T nallocm
00000000000095d0 T nallocx
0000000000006540 T posix_memalign
0000000000009bc0 T rallocm
0000000000007de0 T rallocx
0000000000004b90 T realloc
0000000000009cb0 T sallocm
00000000000090b0 T sallocx
0000000000006c30 T valloc
0000000000008e30 T xallocx

and linking consequently fails with undefined references to the je_* functions.

It might help to patch the source to use the non-je_* names instead. But then there will be mixed use in the same binary, e.g. using an overridden free() when a regular free() was intended, since there is no way to tell them apart any more. 
I guess keeping the je_* variants in spades was upstream’s approach to keep them separate. Looks like that’s not possible when using the Debian packaged versions?

Thanks,
Sascha


More information about the Debian-med-packaging mailing list