Bro 2.3.2 and pf_ring 6.0.2

When trying to build Bro 2.3.2 with libpcap from pf_ring 6.0.2
(./configure --with-pcap=/usr/local/lib, where libpcap-1.1.1-ring is
installed) I get errors:

-- Looking for include files HAVE_PCAP_INT_H
-- Looking for include files HAVE_PCAP_INT_H - not found.
-- Looking for pcap_freecode
-- Looking for pcap_freecode - not found
-- No implementation for pcap_freecode()
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER - Failed
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER - Failed
CMake Error at cmake/PCAPTests.cmake:58 (message):
  Can't determine if pcap_compile_nopcap takes an error parameter
Call Stack (most recent call first):
  CMakeLists.txt:176 (include)
-- Configuring incomplete, errors occurred!

There is no other libpcap on this system. I have just tried on a clean
and freshly installed VM.

What am I doing wrong? I'd like to link Bro with pcap pf_ring, not the
system one.

grep PCAP build/CMakeCache.txt

PCAP_INCLUDE_DIR:PATH=/usr/local/include
PCAP_LIBRARY:FILEPATH=/usr/local/lib/libpcap.so
PCAP_ROOT_DIR:PATH=/usr/local/lib
//Details about finding PCAP
FIND_PACKAGE_MESSAGE_DETAILS_PCAP:INTERNAL=[/usr/local/lib/libpcap.so][/usr/local/include][v()]
HAVE_LIBPCAP_PCAP_FREECODE:INTERNAL=
//Have includes HAVE_PCAP_INT_H
HAVE_PCAP_INT_H:INTERNAL=
//Test LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER
LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER:INTERNAL=
//Test LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER
LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER:INTERNAL=
//ADVANCED property for variable: PCAP_INCLUDE_DIR
PCAP_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: PCAP_LIBRARY
PCAP_LIBRARY-ADVANCED:INTERNAL=1
//Test PCAP_LINKS_SOLO
PCAP_LINKS_SOLO:INTERNAL=1
//ADVANCED property for variable: PCAP_ROOT_DIR
PCAP_ROOT_DIR-ADVANCED:INTERNAL=1

Can you send the contents of build/CMakeFiles/CMakeError.log ?

- Jon

I think you just want /usr/local/ for that argument.

  .Seth

Siwek, Jon:

When trying to build Bro 2.3.2 with libpcap from pf_ring 6.0.2
(./configure --with-pcap=/usr/local/lib, where libpcap-1.1.1-ring is
installed) I get errors:

-- Looking for include files HAVE_PCAP_INT_H
-- Looking for include files HAVE_PCAP_INT_H - not found.
-- Looking for pcap_freecode
-- Looking for pcap_freecode - not found
-- No implementation for pcap_freecode()
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER - Failed
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER
-- Performing Test LIBPCAP_PCAP_COMPILE_NOPCAP_NO_ERROR_PARAMETER - Failed
CMake Error at cmake/PCAPTests.cmake:58 (message):
Can't determine if pcap_compile_nopcap takes an error parameter
Call Stack (most recent call first):
CMakeLists.txt:176 (include)
-- Configuring incomplete, errors occurred!

Can you send the contents of build/CMakeFiles/CMakeError.log ?

I wish I'd thought of that. Instead I kludged a quick solution:

LDFLAGS="-Wl,--no-as-needed -lrt" ./configure

I'm not sure why that bit of ugliness helps, but it got me up and
running again.

-lou

/usr/bin/gcc -Wall -Wno-unused
-DCHECK_FUNCTION_EXISTS=pcap_get_pfring_id
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o -o
cmTryCompileExec -rdynamic /opt/pfring/lib/libpcap.so
-Wl,-rpath,/opt/pfring/lib

/usr/bin/ld: warning: libsnf.so.0, needed by
/opt/pfring/lib/libpcap.so, not found (try using -rpath or
-rpath-link)

/opt/pfring/lib/libpcap.so: undefined reference to `clock_gettime'

/opt/pfring/lib/libpcap.so: undefined reference to `snf_ring_open@snf_0.1'

Uhm, looks like I have mixed in the snf == Myricom somehow in here.
Looks like it's a bad idea to build pfring and myricom linked pcap
applications on the same host.

Sorry for the noise and thanks for the hint where to look for errors :slight_smile:

Yep, confirmed

LDFLAGS exported to "-Wl,--no-as-needed -lrt" is needed or the
configure fails on Ubuntu with

/opt/pfring/lib/libpcap.so: undefined reference to `clock_gettime'