当前位置:网站首页>CMake 编译运行dpdk项目程序
CMake 编译运行dpdk项目程序
2022-08-10 00:02:00 【独正己身】
1 引言
dpdk20.11以及以后使用Pkg-Config维护它依赖库路径、头文件路径、编译选项、链接选项等信息,文件名后缀是.pc
,方便第三方开发者便捷地获取相关信息 按官网流程安装完dpdk后发现/usr/loca/lib64中包含pkgconfig文件夹内包含libdpdk.pc
2 基本使用
vim /etc/profile
export PKG_CONFIG_PATH=/usr/loca/lib64/pkgconfig/
source /etc/profile
可以通过Linux的PkgConfig
命令获取相关信息,如pkg-config --libs --cflags libdpdk
3 CMake中如何调用
CMake通过FindPkgConfig
模块来使用获取相关信息,比较经典的写法是:
set(ENV{PKG_CONFIG_PATH} /usr/local/lib64/pkgconfig/)
find_package(PkgConfig)
pkg_search_module(LIBDPDK REQUIRED libdpck)
后面就可以通过SEASTARPC_LIBRARIES
等方式获取相关编译选项和库名称等。
MESSAGE(STATUS ${LIBDPDK_LIBRARIES})
MESSAGE(STATUS ${LIBDPDK_INCLUDE_DIRS})
###输出如下
-- rte_noderte_graphrte_bpfrte_flow_classifyrte_pipelinerte_tablerte_portrte_fibrte_ipsecrte_vhostrte_stackrte_securityrte_schedrte_reorderrte_ribrte_regexdevrte_rawdevrte_pdumprte_powerrte_memberrte_lpmrte_latencystatsrte_knirte_jobstatsrte_ip_fragrte_gsorte_grorte_eventdevrte_efdrte_distributorrte_cryptodevrte_compressdevrte_cfgfilerte_bitratestatsrte_bbdevrte_aclrte_timerrte_hashrte_metricsrte_cmdlinerte_pcirte_ethdevrte_meterrte_netrte_mbufrte_mempoolrte_rcurte_ringrte_ealrte_telemetryrte_kvargs
-- /usr/local/include
具体有哪些可以使用,可以参看CMake的FindPkgConfig模块使用.
4 后续链接
# 使用以下共享链接
target_compile_options (test_dpdk PRIVATE ${LIBDPDK_CFLAGS} )
target_link_libraries (test_dpdk ${LIBDPDK_LDFLAGS} )
# 或使用以下静态链接
target_compile_options (test_dpdk PRIVATE ${LIBDPDK_STATIC_CFLAGS} )
target_link_libraries (test_dpdk ${LIBDPDK_STATIC_LDFLAGS} )
边栏推荐
- Penetration Testing and Offensive and Defense Confrontation - Vulnerability Scanning & Logic Vulnerability (Part1)
- Minimum number of steps to get out of the maze 2
- 微信公众号如何开通支付功能?
- ASEMI整流桥GBJ1010参数,GBJ1010规格,GBJ1010封装
- How to turn off system protection in Win11?How to turn off the system protection restore function?
- Next.js获取路由参数及styled-jsx 的使用
- 将string类对象中的内容格式化到字符串Buffer中时遇到的异常崩溃分析
- WPF DataGrid using data templates
- FITC标记生物素(FITC-生物素|CAS:134759-22-1)有哪些知识了?
- 【CAS:41994-02-9 |Biotinyl tyramide】生物素基酪氨酰胺价格
猜你喜欢
随机推荐
const修饰指针的三种情况
Interlay集成至Moonbeam,为网络带来interBTC和INTR
MATLB|And her ups and downs and finally reached the peak of life [Romantic Journey]
3.9 - 正规表达式和正规集 3.10 - 有限自动机
OSS-访问oss生成的url无法访问,直接下载问题
Fury:一个基于JIT动态编译的高性能多语言原生序列化框架
XSS详解及复现gallerycms字符长度限制短域名绕过
Stanford CS143 速通PA1教程
宽带由20M换为100M
Prometeus 2.31.0 新特性
Win11怎么关闭系统保护功能?系统保护还原功能怎么关闭?
Quick responsiveness intelligent/smart responsiveness of polyethylene glycol type nano/reduction response hydrogels research and preparation
365 days challenge LeetCode1000 questions - Day 052 Step by step summation to get the minimum value of positive numbers Greedy
365天挑战LeetCode1000题——Day 052 逐步求和得到正数的最小值 贪心
Leetcode81. 搜索旋转排序数组 II
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG derivative
移动终端数据业务高安全通信方案研究
微服务【同步和异步通讯详解】第6章
生物素叠氮化物中的(CAS:1527486-16-3TAMRA-azide-PEG3-Biotin)反应的特点!
手把手教你编写性能测试用例