Ubuntu14.04下 安裝p4c

參考:

Github p4c READMEhtml

Ubuntu14.04下 安裝p4c

這裏提供一個直接安裝p4c的腳本:install_p4c.shpython

1.git clone下來p4c:ios

$ git clone --recursive https://github.com/p4lang/p4c.git

注意, 若是沒有使用--recursive, 則須要再將submodule clone下來:git

[option] $ git submodule update --init --recursive

2.安裝依賴:github

依賴(原文):ubuntu

  • A C++11 compiler. GCC 4.9 or later or Clang 3.3 or later is required.
  • git for version control
  • GNU autotools for the build process
  • CMake 3.0.2 or higher
  • Boehm-Weiser garbage-collector C++ library
  • GNU Bison and Flex for the parser and lexical analyzer generators.
  • Google Protocol Buffers 3.0 for control plane API generation
  • GNU multiple precision library GMP
  • C++ boost library (minimally used)
  • Python 2.7 for scripting and running tests
  • Optional: Documentation generation (enabled when configuring with --enable-doxygen-doc) requires Doxygen (1.8.10 or higher) and Graphviz (2.38.0 or higher).
$ sudo apt-get install g++ git automake libtool libgc-dev bison flex libfl-dev libgmp-dev libboost-dev libboost-iostreams-dev pkg-config python python-scapy python-ipaddr tcpdump cmake

可選, 用於生成文檔:tcp

[option] $ sudo apt-get install -y doxygen graphviz texlive-full

GCC4.9升級方法: ubuntu 14.04 更新 gcc/g++ 4.9.2ide

安裝protobuf: Ubuntu 14.04 下 安裝Protocol Buffersflex

更新cmake: Ubuntu14.04下 升級 cmakeui

3.構建:

$ mkdir build
$ cd build
$ cmake .. [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_INSTALL_PREFIX=<path>] [-DENABLE_DOCS=ON (default off)] [-DENABLE_P4RUNTIME_TO_PD=OFF (default on)]
$ make -j4
$ make -j4 check

4.安裝:

$ sudo make install

2017.9

相關文章
相關標籤/搜索