p4c-bm安装

Generates the JSON configuration for the behavioral-model (bmv2).它是用来形成 行为模型BMV2 的 JSON配置 的。
Important: the PD has been moved out of this repository and split between the bmv2 repository (for fixed part of the PD) and the new p4-build repository (build infrastructure for the auto-generated / program-dependent part of the PD).

目前正在理清楚我所安装的这些工具之间的关系,在p4behavioral-model里面提到要安装这个工具。

安装的过程很顺利。

安装:To install p4c-bm on your machine:

照样,将p4c-bmfork到自己的仓库.
git clone 下来。

cd 进目录,然后执行以下:

sudo pip install -r requirements.txt

sudo pip install -r requirements_v1_1.txt

sudo python setup.py install

第二条命令用于编译P4v1.1的程序。

使用它:Using p4c-bm

    Try p4c-bmv2 -h
    --json to generate a JSON representation of the P4 program
    --pd to generate the PD C++ code
    --p4-v1.1 if your input program is a P4 v1.1 program

这些命令是用来编译P4程序的,目前仍然不清楚它们之间是什么关系。要逐渐理清楚。

在非默认路径上安装

如果你想安装在非默认的自己选择的路径上,需要这样做:

    python setup.py build install --prefix <your_path> [--single-version-externally-managed] --record install_files.txt
    cat install_files.txt | xargs rm -rf (if you need to uninstall later on)

2016/9/27

原文地址:https://www.cnblogs.com/qq952693358/p/5912745.html