1大页设置
yum install make automake gcc gcc-c++ kernel-devel
echo 128 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
2环境变量设置
#environment config
export RTE_SDK=/home/dpdk-stable-17.02.1
export RTE_TARGET=x86_64-native-linuxapp-gcc
export KERNELDIR=/lib/modules/3.10.0-514.el7.x86_64/build/
3、dpdk编译设置 so igb_uio
cd /home/dpdk-stable-17.02.1
vim config/common_base
CONFIG_RTE_BUILD_SHARED_LIB=y
CONFIG_RTE_EAL_IGB_UIO=y
4、make
make config T=x86_64-native-linuxapp-gcc
make install T=$RTE_TARGET DESTDIR=/usr/local/dpdk -j 4
cp x86_64-native-linuxapp-gcc/lib/lib* /lib64#安装后会在/usr/local/dpdk找到相关内容
补充参照同样方法编译dpdk19.08版本时遇到问题
1、无numa.h
yum install numactl-devel
2、/lib/modules/3.10.xxx.x86_64/build无此目录首先ll查看build指向的/usr/src/kernels是否有对应包,没有则安装
yum install kernel-devel-$(uname -r)
有则直接删除build然后重新链接
rm -f build
ln -s /usr/src/kernels/3.10.0-1160.el7.x86_64/ ./build
5、后续设置,根据其他博客内容设置,也可不设
mkdir /root/dpdk
cp /usr/local/dpdk/include /root/dpdk/
cp /usr/local/dpdk/lib /root/dpdk/
cp /usr/local/dpdk/lib/modules /root/dpdk/
cp /usr/local/dpdk/share/dpdk/usertools /root/dpdk/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/dpdk/lib
5、gcc helloworld文章来源:https://www.toymoban.com/news/detail-491339.html
cd /home/dpdk-stable-17.02.1/examples/helloworld
gcc main.c -I /root/dpdk/include/dpdk/ -L /root/dpdk/lib/ -lrte_eal -lrte_mempool -lrte_ring -o helloworld文章来源地址https://www.toymoban.com/news/detail-491339.html
到了这里,关于centos 编译dpdk-stable-17.02.1的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!