操作系统与源码依赖
在 Ubuntu 16.04 上编译 VPP 20.01
获取源码
可以从 2 个官方地址拉取代码(建议使用第二条命令):
$ git clone https://gerrit.fd.io/r/vpp
$ git clone https://github.com.cnpmjs.org/FDio/vpp.git
获取成功后, 源码目录结构如下:
$ ls -F vpp
build/ docs/ gmod/ MAINTAINERS RELEASE.md
build-data/ doxygen/ INFO.yaml Makefile src/
build-root/ extras/ LICENSE README.md test/
安装依赖项
CMake
如果 CMake 版本过旧, 编译时可能会遇到问题, 请确保 CMake 版本至少是 3.5, 如果 3.5 也报错, 比如下面的情况, 请编译安装更新的版本:
CMake Warning at vpp-api/python/CMakeLists.txt:14 (find_package):
By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Python3", but
CMake did not find one.
Could not find a package configuration file provided by "Python3" with any
of the following names:
Python3Config.cmake
python3-config.cmake
Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
"Python3_DIR" to a directory containing one of the above files. If
"Python3" provides a separate development package or SDK, be sure it has
been installed.
移除之前的安装
在安装前, 首先检查有没有已安装的包, 如果有, 需要移除. 通过以下命令来检查:
$ dpkg -l | grep vpp
$ dpkg -l | grep DPDK
移除的方法类似:
$ sudo dpkg --purge libvppinfra
安装依赖的软件包
切换到想要的分支:
$ git checkout stable/2001
然后可以安装以来的软件包:
$ make install-</