Ubuntu14.04下 安装p4c

参考:

Github p4c README

Ubuntu14.04下 安装p4c

这里提供一个直接安装p4c的脚本:install_p4c.sh

1.git clone下来p4c:

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

注意, 如果没有使用--recursive, 则需要再将submodule clone下来:

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

2.安装依赖:

依赖(原文):

  • 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

可选, 用于生成文档:

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

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

安装protobuf: Ubuntu 14.04 下 安装Protocol Buffers

更新cmake: Ubuntu14.04下 升级 cmake

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值