compiling bro with tcmalloc

All,
   I'm taking a stab at using tcmalloc with Bro. I'm running FreeBSD-8.3. I'v
e got tcmalloc built and installed from gperftools :

$ file /usr/local/lib/libtcmalloc.so.5
/usr/local/lib/libtcmalloc.so.5: ELF 64-bit LSB shared object, x86-64, version
1 (FreeBSD), dynamically linked, not stripped

  When I run configure, Bro says it finds GooglePerfTools, but shows "false" fo
r tcmalloc :

- -- Found GooglePerftools: /usr/local/lib/libtcmalloc.so
...
gperftools found: true
        tcmalloc: false
       debugging: false

   When I compile Bro and check to see if tcmalloc is there, ldd doesn't show i
t in the shared libraries.
   Am I misunderstanding something about how Bro is compiling in/using tcmalloc
or Bro's configure output?

Thanks!

- - Keith

Hi Keith:

Might need to do:

setenv LDFLAGS -L/usr/local/lib
setenv CPPFLAGS -I/usr/local/include

or the moral equivalent for your shell, before running configure

Hope this helps.

Am I misunderstanding something about how Bro is compiling in/using tcmalloc
or Bro's configure output?

Since 2.1, you need to explicitly pass --enable-perftools for Bro to
use tcmalloc. We changed this because non-Linux platforms have less
reliable tcmalloc support.

    Matthias

> Am I misunderstanding something about how Bro is compiling in/using tcmall
oc
> or Bro's configure output?

Since 2.1, you need to explicitly pass --enable-perftools for Bro to
use tcmalloc. We changed this because non-Linux platforms have less
reliable tcmalloc support.

That did the trick.

Might I ask what "less reliable tcmalloc support" entails? Anything specific or am I just in for random crashes, etc.?

- - Keith

Might I ask what "less reliable tcmalloc support" entails? Anything specific or am I just in for random crashes, etc.?

For example, we have encountered a Darwin (10.7) setup with MacPorts
where Bro just segfaults immediately as it starts, you could not even
get to the usage information. Similar segfault issues apparently also
exist for FreeBSD 8.2. This does not mean that tcmalloc does not work
with BSD in general, just some specific configurations turn out to be
complicated.

    Matthias