当前位置: 首页 > 工具软件 > nnpy > 使用案例 >

P4行为模型BMV2依赖关系安装:thrift nanomsg nnpy安装

景康安
2023-12-01

由于安装p4factory的步骤需要OF的支持,我需要下载p4的行为模型BMV2; thrift是支持BMV2的软件框架;nanomsg是一个实现了几种“可扩展协议”的高性能通信库,可扩展协议的任务是定义多个应用系统如何通信,从而组成一个大的分布式系统。 nnpy 是 nanomsg 的 Python 语言实现版本,基于 CFFI。

##安装thrift

首先都是Git clone下来,具体操作是先fork到自己的仓库,再在自己的仓库复制下载链接。 Git thrift

If you are building from the first time out of the source repository, you will need to generate the configure scripts. (This is not necessary if you downloaded a tarball.) From the top directory, do:

./bootstrap.sh

形成配置文件。

Once the configure scripts are generated, thrift can be configured. From the top directory, do:

./configure

You may need to specify the location of the boost files explicitly. If you installed boost in /usr/local, you would run configure as follows:

./configure --with-boost=/usr/local

指定boost文件位置。

Note that by default the thrift C++ library is typically built with debugging symbols included. If you want to customize these options you should use the CXXFLAGS option in configure, as such:

./configure CXXFLAGS='-g -O2'
./configure CFLAGS='-g -O2'
./configure CPPFLAGS='-DDEBUG_MY_FEATURE'

貌似是更改 thrift C++库 的头文件,不是必选。

To enable gcov required options -fprofile-arcs -ftest-coverage enable them:

./configure  --enable-coverage

开启gcov支持的选项

有问题可以执行:./configure --help

Please be aware that the Python library will ignore the --prefix option and just install wherever Python's distutils puts it (usually along the lines of /usr/lib/pythonX.Y/site-packages/). If you need to control where the Python modules are installed, set the PY_PREFIX variable. (DESTDIR is respected for Python and C++.) 大意是,python库会默认忽略--prefix选项,不管python的distutils模块在哪里安装都会进行,如果想要控制python模型安装的位置,要设置PY_PREFIX变量。

Make thrift:

make

From the top directory, become superuser and do:

make install

###Test

There are a large number of client library tests that can all be run from the top-level directory.

make -k check

This will make all of the libraries (as necessary), and run through the unit tests defined in each of the client libraries. If a single language fails, the make check will continue on and provide a synopsis at the end. 跑客户端库的例子,最后会提供make信息。

To run the cross-language test suite, please run:

make cross

This will run a set of tests that use different language clients and servers. 交叉语言环境测试。

##安装nanomsg

Git nanomsg

这个安装比较简单,按照步骤来就好。

Go to the root directory of the local source repository.    
To perform an out-of-source build, run:
    mkdir build
    cd build
    cmake .. 
(You can add -DCMAKE_INSTALL_PREFIX=/usr/local or some other directory.)
    cmake --build .
    ctest -C Debug .
    cmake --build . --target install 
NB: This may have to be done as a privileged user.

(Linux only) 
    ldconfig 
(As a privileged or root user.)

##安装nnpy

Git nnpy

clone完之后进入nnpy目录。

$ sudo pip install .

2016/9/25

转载于:https://www.cnblogs.com/qq952693358/p/5904949.html

 类似资料: