当前位置:网站首页>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} )
边栏推荐
- JVM Memory and Garbage Collection - 10. Direct Memory
- R语言使用glm函数构建logistic回归模型,使用forestmodel包的forest_model函数可视化逻辑回归模型对应的森林图
- How to turn off system protection in Win11?How to turn off the system protection restore function?
- 宝塔实测-搭建LightPicture开源图床系统
- 关于HBuilder X鼠标变为_ 替换字符的问题
- Creo5.0 introductory tutorial free material
- Tensor flow 踩坑记
- C language pointer practice questions
- 走出迷宫的最少步数2
- 【CAS:41994-02-9 |Biotinyl tyramide】生物素基酪氨酰胺价格
猜你喜欢
技术分享 | 接口自动化测试如何处理 Header cookie
高校就业管理系统设计与实现
Penetration Testing and Offensive and Defense Confrontation - Vulnerability Scanning & Logic Vulnerability (Part1)
Leetcode80. 删除有序数组中的重复项 II
02|运算符
3.11-程序基本的控制语句 3.12-表达式 3.13-数据类型 3.14-常量/变量 3.15-标识符
Leetcode79. 单词搜索
Fedora 36 dnf 安装ModSecurity和 OWASP 核心规则集
算法---整数替换(Kotlin)
Win11怎么关闭系统保护功能?系统保护还原功能怎么关闭?
随机推荐
由生物素参与的D-Biotinol,CAS号:53906-36-8具体特性说明
How to turn off system protection in Win11?How to turn off the system protection restore function?
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG衍生物
Docker 面试题2则--取数据库连接数和docker-compose
Docker interview question 2--get the number of database connections and docker-compose
基于ABP的AppUser对象扩展
Kubernetes 60个为什么
Leetcode79. 单词搜索
labelme标注的json标签转txt格式
R语言使用glm函数构建logistic回归模型,使用forestmodel包的forest_model函数可视化逻辑回归模型对应的森林图
Characteristics of the (CAS:1527486-16-3TAMRA-azide-PEG3-Biotin) reaction in biotin azide!
Pagoda measurement - building LightPicture open source map bed system
使用 apxs 构建和安装 Apache 扩展共享对象模块
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
Leetcode83. 删除排序链表中的重复元素
西安生物素-四聚乙二醇-酰胺-4苯酚 浅黄色半固态
-Vector Dot Product-
数据的存储——C语言
When knowledge and action are one
Penetration Testing and Offensive and Defense Confrontation - Vulnerability Scanning & Logic Vulnerability (Part1)