I'm trying to compile a complex numerical simulation software. After running autoconf and then ./configure ... (with some other flags), I see the following in the output:

checking for malloc in -ltcmalloc... no
configure: WARNING: No tcmalloc support available.

After looking in configure.in I found:

%zsh> grep 'tcmalloc' configure.in
    AC_CHECK_LIB(tcmalloc,malloc,,AC_MSG_WARN([No tcmalloc support available.]))

I have gperftools installed which should provide tcmalloc I think. I do have a few libraries that are called something like that:

%zsh> ldconfig -p|grep 'tcmalloc'
    libtcmalloc_minimal_debug.so.4 (libc6,x86-64) => /usr/lib/libtcmalloc_minimal_debug.so.4
    libtcmalloc_minimal_debug.so (libc6,x86-64) => /usr/lib/libtcmalloc_minimal_debug.so
    libtcmalloc_minimal.so.4 (libc6,x86-64) => /usr/lib/libtcmalloc_minimal.so.4
    libtcmalloc_minimal.so (libc6,x86-64) => /usr/lib/libtcmalloc_minimal.so
    libtcmalloc_debug.so.4 (libc6,x86-64) => /usr/lib/libtcmalloc_debug.so.4
    libtcmalloc_debug.so (libc6,x86-64) => /usr/lib/libtcmalloc_debug.so
    libtcmalloc_and_profiler.so.4 (libc6,x86-64) => /usr/lib/libtcmalloc_and_profiler.so.4
    libtcmalloc_and_profiler.so (libc6,x86-64) => /usr/lib/libtcmalloc_and_profiler.so
    libtcmalloc.so.4 (libc6,x86-64) => /usr/lib/libtcmalloc.so.4
    libtcmalloc.so (libc6,x86-64) => /usr/lib/libtcmalloc.so

I tried adding libtcmalloc to the list in configure.in but I just get:

checking for tcmalloc in -llibtcmalloc... ./configure: line 11516: WARNING:: command not found

Is there a way to get autoconf's AC_CHECK_LIB to detect my tcmalloc library?

  • What does your config.log file say around the failing test? There are two things that are strange here: 1) You get a "command not found" error, and 2) it's testing with -llibtcmalloc instead of -ltcmalloc. If you can look in the config.log file for why this is so, then maybe we could sort this out. If you could mention what the software is called and where to find it, we could test compiling it for ourselves to see whether we too get the same error.
    – they
    Nov 26, 2021 at 7:00
  • Let us also know if you modified the configure, configure.in or similar file in the source distribution.
    – they
    Nov 26, 2021 at 7:10
  • @they Thanks, I seem to have messed something up last time. I modified configure.in at some point, as mentioned, hence the -llibtcmalloc part. Surprisingly, in a fresh source tree, I can't reproduce the warning anymore.
    – adigitoleo
    Nov 27, 2021 at 1:35

1 Answer 1


Not sure if this is a "fix" or a "workaround", and I realise it's hard to help without more information about the software in question, but I was able to avoid the warning by explicitly adding -ltcmalloc to LIBS in the configure flag:

./configure LIBS='-ltcmalloc ...' ...

Update 27 Nov:

I somehow can't reproduce the warning anymore, even without the workaround. It's possible that I used a slightly different set of configure fags, or had somehow messed up my configure scripts. I'll leave this here in case the workaround is helpful to others.

  • This is a workaround, not a solution.
    – they
    Nov 26, 2021 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.