当前位置:网站首页>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} )
边栏推荐
- C语言--数据的存储(上)
- 《痞子衡嵌入式半月刊》 第 60 期
- 西安生物素-四聚乙二醇-酰胺-4苯酚 浅黄色半固态
- 3.9 - 正规表达式和正规集 3.10 - 有限自动机
- 渗透测试与攻防对抗——漏洞扫描&逻辑漏洞(Part1)
- ASEMI整流桥GBJ1010参数,GBJ1010规格,GBJ1010封装
- c语言文件基本操作总结
- How to add control panel to right click menu in win7
- The technical aspects of the byte have been passed, and the salary has been negotiated for 20K*13, but the result is still being brushed. I asked the HR why...
- 【CAS:41994-02-9 |Biotinyl tyramide】Biotinyl tyramide price
猜你喜欢
高校就业管理系统设计与实现
基于SSM实现手机销售商城系统
Mysql database ALTER basic operations
Quick responsiveness intelligent/smart responsiveness of polyethylene glycol type nano/reduction response hydrogels research and preparation
C language structure, function and pointer exercise (simple address book)
收银管理软件如何做好员工管理?
CST Studio Suite 2021 software installation package and installation tutorial
How to turn off system protection in Win11?How to turn off the system protection restore function?
7. type( )函数——查询数据类型
关于HBuilder X鼠标变为_ 替换字符的问题
随机推荐
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
R语言使用glm函数构建逻辑回归模型(logistic)、使用subgroupAnalysis函数进行亚组分析并可视化森林图
阿里云混合云管理平台多Region架构
Characteristics of the (CAS:1527486-16-3TAMRA-azide-PEG3-Biotin) reaction in biotin azide!
3.4 - 编译与解释 3.5 - 编译过程 3.8 - 文法
ASEMI整流桥GBJ1010参数,GBJ1010规格,GBJ1010封装
pytest:如何在测试中编写和报告断言
Biotin-Cy2 Conjugate,生物素-Cy2 偶联物_Cy2 生物素偶联物
Kubernetes 开发环境比对
Stanford CS143 速通PA1教程
基于Web的疫情隔离区订餐系统
OSS-访问oss生成的url无法访问,直接下载问题
Kubernetes 60个为什么
deepstream学习笔记(三):deepstream-imagedata-multistream解析与接入适配yolov5模型测试
微信公众号如何开通支付功能?
C language pointer practice questions
Next.js获取路由参数及styled-jsx 的使用
聚焦热点 | ISC 2022软件供应链安全治理与运营论坛圆满落幕
CVPR22 Oral|通过多尺度token聚合分流自注意力,代码已开源
Penetration Testing and Offensive and Defense Confrontation - Vulnerability Scanning & Logic Vulnerability (Part1)