Skip to content

Latest commit

 

History

History
170 lines (125 loc) · 3.19 KB

BUILD.md

File metadata and controls

170 lines (125 loc) · 3.19 KB

Requirements

Required operating systems

  • CentOS 6.x or CentOS 7.x
  • Debian 9.5
  • SUSE 12.2
  • Ubuntu 16.04
  • Mac OS X (experimental)

Required compilers

  • GCC 4.8.5 or higher
  • CMake 3.3 or higher

Required libraries

  • libpcap-devel
  • boost-devel
  • boost-static

Build steps

CentOS and RedHat

  1. Prepair the environment.
# install gcc
yum groupinstall "Development Tools"
# install cmake
yum -y install cmake
# install more required libraries
yum -y install libpcap-devel boost-devel boost-static
  1. Clone or download the project.
  2. Go to the project folder and build it.
cd /path/to/packet-agent
mkdir build && cd build
cmake .. && make
  1. Check output binaries. There should be four files in the bin folder.
ls ../bin
gredemo*     gredump*     pcapcompare* pktminerg*

Debian and Ubuntu

  1. Prepair the environment.
# install gcc
apt-get -y install build-essential
# install cmake
apt-get -y install cmake
# install more required libraries
apt-get -y install libpcap-dev libboost-all-dev
  1. Clone or download the project.
  2. Go to the project folder and build it.
cd /path/to/packet-agent
mkdir build && cd build
cmake .. -DPLATFORM_DEBIAN=ON && make
  1. Check output binaries. There should be four files in the bin folder.
ls ../bin
gredemo*     gredump*     pcapcompare* pktminerg*

SUSE

  1. Prepair the environment.
# install git
zypper -n install git-core
# install cmake
zypper -n install cmake
# install more required libraries
zypper -n install libpcap-devel boost-devel
zypper -n si boost
cd /usr/src/packages/SOURCES/
tar --bzip2 -xf boost_1_54_0.tar.bz2
cd  boost_1_54_0/
./bootstrap.sh
./b2 install stage 
  1. Clone or download the project.
  2. Go to the project folder and build it.
cd /path/to/packet-agent
mkdir build && cd build
cmake ..  && make
  1. Check output binaries. There should be four files in the bin folder.
ls ../bin
gredemo*     gredump*     pcapcompare* pktminerg*

Mac OS X

  1. Install Xcode.
  2. Download the latest release of libpcap from tcpdump site. Extract the zip, enter the folder and build the library.
cd /path/to/libpcap
./configure 
make
make install
# Check that libpcap.a and libpcap.dylib exist.
ls /usr/local/lib/libpcap*
  1. Recommended: install brew for easier package management.
# install boost
brew install boost
  1. Clone or download the project.
  2. Build the project.
cd /path/to/packet-agent
mkdir build && cd build
cmake .. && make
  1. Ensure the build is successful. The bin folder should contain four binary files.
ls ../bin
gredemo*     gredump*     pcapcompare* pktminerg*

FAQ

CMake Error 51

CMake Error at /usr/local/Cellar/cmake/3.9.4/share/cmake/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

A: Firstly, check that Xcode has been installed. Then make sure you have accepted the xcodebuild license.

sudo xcodebuild -license accept