0. 前提:
环境是CentOS7,archlinux编译有问题,不知道却什么。
1. 解压:
[root@dpdk dpdk]# tar Jxf dpdk-2.2.0.tar.xz
2. 设置环境变量
[root@dpdk dpdk-2.2.0]# export RTE_SDK=/root/src/thirdparty/dpdk/dpdk-2.2.0
[root@dpdk dpdk-2.2.0]# export RTE_TARGET=x86_64-native-linuxapp-gcc
[root@dpdk dpdk-2.2.0]# export |grep RTE
declare -x RTE_SDK="/root/src/thirdparty/dpdk/dpdk-2.2.0"
declare -x RTE_TARGET="x86_64-native-linuxapp-gcc"
[root@dpdk dpdk-2.2.0]#
3. 配置
[root@dpdk dpdk-2.2.0]# make config T=$RTE_TARGET O=$RTE_TARGET
4. 编译
[root@dpdk dpdk-2.2.0]# cd x86_64-native-linuxapp-gcc/
[root@dpdk x86_64-native-linuxapp-gcc]# make
5. 编译DEBUG版本
[root@okk x86_64-native-linuxapp-gcc]# make WERROR_CFLAGS='-O0 -g' D=y V=y
6. 完
7. update @ 20170727
在16.04上,貌似还不支持 WERROR_CFLAGS 选项
使用如下:
[root@T185 x86_64-native-linuxapp-gcc]# make EXTRA_CFLAGS="-g -O0" D=y V=y
8. update @ 20180410
安装到指定目录:
使用如下:
make install DESTDIR=myinstall prefix=/usr
参考:https://dpdk.org/doc/guides/prog_guide/dev_kit_root_make_help.html#install-targets
DISTDIR:
If your installation step would normally install /usr/local/bin/foo and /usr/local/lib/libfoo.a, then an installation invoked as in the example
above would install /tmp/stage/usr/local/bin/foo and /tmp/stage/usr/local/lib/libfoo.a instead.
prefix:
A prefix used in constructing the default values of the variables listed below. The default value of prefix should be /usr/local.
When building the complete GNU system, the prefix will be empty and /usr will be a symbolic link to /. (If you are using Autoconf,
write it as ‘@prefix@’.)