Skip to content

Installation

Samar Abdi edited this page May 20, 2016 · 1 revision

#PFPSIM Framework The framework consists of three tools

- Tooling Description
1 pfpgen FAD Compiler
2 libpfpsim Framework Runtime Library
3 pfpdb PFP Debugger

This section describes the install for the PFPSIM runtime library. Also included is the setup for P4 Libraries.

#Installation ##The quickest way: Grab the .deb package from our releases page and sudo dpkg -i <PFPSIM-x.x.x.deb> That's it.

This is only for debian/ubuntu distro 64-bit.

##From Source:

####Get the source:

  • Clone this git repository:
    • git clone https://github.com/pfpsim/PFPSim.git or
  • Download one of the source packages from our releases page.

####Installing Dependencies: For the sake of sanity we provide an install script for installing pre-install dependencies.

Note: PFPSIM is tested and can be used with both for GCC and the CLANG/LLVM toolchains. The following steps assume you are building using CLANG/LLVM.

Most packages with the exception of SystemC should be available from your package manager, but steps are provided nonetheless if required to build from source {especially if you are on gentoo linux}.

Packages needed:

  • cmake
  • clang/llvm [3.2 or +]
  • make/ninja
  • bisonc++
  • flexc++
  • libstdc++
  • libprotobuf
  • nanomsg
  • libpcap
  • SystemC

Packages for P4: -- TODO;

#####Installing SystemC For the sake of sanity we provide an install script for installing SystemC.

  • Download the systemc source from:
  • [http://www.accellera.org/downloads/standards/systemc]
  • Building SystemC:
  • [Elevated privileges may be required]
  • [The following setup assumes Clang/LLVM toolchain]
SYSTEMC_LLVM=/usr/local/systemc-llvm
tar -xzvf systemc.tgz
mkdir build
cd build
../configure --prefix=$SYSTEMC_LLVM --with-unix-layout CC=clang CXX=clang++ CPP=`clang++ -E` CFLAGS=-stdlib=    libstdc++ CXXFLAGS=-stdlib=libstdc++ LDFLAGS="-stdlib=libstdc++ -lc++abi"

make
sudo make install
# Link to default location
ln -s $SYSTEMC_LLVM $SYSTEMC_HOME
echo export SYSTEMC_HOME="$SYSTEMC_HOME" >> /etc/profile.d/systemc.sh
#Linker
echo "$SYSTEMC_HOME"/lib-linux64 >> /etc/ld.so.conf.d/systemc.conf
ldconfig -v | grep systemc                                               

#####Installing Protobuf: Note: Protobuf can be installed using your package manager, if that causes a problem due to version mismatch please build from source as:

  • Download: Protocol Buffers v2.6.1: https://github.com/google/protobuf/releases/tag/v2.6.1
  • Installation: follow protobuf's README.md file with the following configure if using Clang/LLVM
./autogen.sh
./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libstdc++ -O3 -g' LDFLAGS='-stdlib=libstdc++' LIBS="-lc++ -lc++abi"
make
sudo make install
sudo ldconfig # may or may not be necessary
make check #will fail if using clang and so don't bother running it.

#####Installing Nanomsg:

  • Download: nanomsg v0.5-beta [http://download.nanomsg.org/nanomsg-0.5-beta.tar.gz]
  • Follow readme it's pretty straight forward.

#####Installing CMake from Source: See this page]


####Installing PFPSIM & PFP-P4:

We will build out of source in a separate build directory.

#<-In the repository root.
mkdir build
cd build
cmake ../
make
sudo make install
make doc # Generates documentation - See documentation requirements section

Each library (PFPSIM & PFP-P4) can be installed individually by toggling the PFPSIM and PFP-P4 cmake flags ON or OFF. This can be done in the following way.

cmake -DPFPSIM=ON|OFF -DPFP-P4=ON|OFF ../

In order to compile with debug symbols, set the CMAKE_BUILD_TYPE flag to 'debug' as shown below.

cmake -DCMAKE_BUILD_TYPE=debug ../

####Uninstalling PFPSIM:

  • If installed using source: sudo make uninstall from the build directory.
  • If installed using .deb package:
sudo dpkg --remove pfpsim
sudo dpkg --remove pfp-p4
Clone this wiki locally