已合并
feat: 为opapi共享库链接opbase_util_objs以支持log.h调用 #2693
songkai111创建于 5月12日
feat: 为opapi共享库链接opbase_util_objs以支持log.h调用 #2693
已合并
songkai111创建于 5月12日
songkai111成员
5月12日

描述

cmake/symbol.cmakegen_opapi_symbol()gen_cust_opapi_symbol() 两个函数中,为 opapi 共享库和 cust_opapi 链接 opbase_util_objs 目标对象。

opbase_util_objscmake/func.cmake 定义,编译源文件包含 ${OPBASE_SOURCE_PATH}/src/op_common/log/*.cpp(日志工具实现)。此前 opapi 共享库未链接该目标对象,导致 opapi 中无法调用 log.h 提供的日志接口。本次改动通过 CMake generator expression $<$<TARGET_EXISTS:opbase_util_objs>:...> 条件性地引入,确保仅在目标存在时才链接,不影响不包含该目标的构建场景。

改动文件

  • cmake/symbol.cmake:在 gen_opapi_symbol()gen_cust_opapi_symbol() 中各增加一行 $<$<TARGET_EXISTS:opbase_util_objs>:$<TARGET_OBJECTS:opbase_util_objs>>

关联的Issue

  • #1517

测试

编译验证通过,opapi 共享库可正常链接并调用 log.h 接口。

文档更新

类型标签

Related Roadmap: https://gitcode.com/cann/ops-math/issues/1253

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 songkai111 的贡献)
Ssongkai111成员
5月12日 创建了 pull request,commit 7817de56
CANN-robot
CANN-robot成员
5月12日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/ops-math 张磊, wangrui_ (2/2) 张磊 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

songkai111, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
5月12日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
5月12日 将zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,llimwang,gubaocheng设为评审人
CANN-robotCANN-robot成员
5月12日 将zhou-qilong,wangrui_,rxtfeng,loov1,zhangzijie,jia0liang,llimwang,gubaocheng设为审查人
Ssongkai111成员
5月12日 修改标题为 “feat: 为opapi共享库链接opbase_util_objs以支持log.h调用”,原标题为“增加opapi调用log.h的能力”
Ssongkai111成员
5月12日 修改了pull request 的描述
songkai111成员
5月12日 评论:

compile

likedislike
Ssongkai111成员
5月12日 update merge request[project id: 7649531, iid: 2693, commit_id: d643d0b84ea9049c7223fa245bdb8b8502efb26c] virtual merging success
CANN-robotCANN-robot成员
5月12日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月12日 评论:

流水线任务触发成功
任务链接 [256b52abf995463fab00d3c98f23fdea][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>>
harmony-infer ✅ SUCCESS
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
ATK_Test_A2 ✅ SUCCESS

[2026-05-12 11:18:37]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月12日 评论:

流水线任务触发成功
任务链接 [660a9cc15e6347bd9d0fdcaeaaa224d5][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
cocheck_codestyle ✅ SUCCESS
precommit ✅ SUCCESS >>>>> >>>>>

[2026-05-12 11:08:14]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月12日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月12日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月12日 添加了label:ci-pipeline-passed
RuiWang_成员
5月14日 评论:

/lgtm

likedislike
Ssongkai111成员
5月14日 update merge request[project id: 7649531, iid: 2693, commit_id: b8d48e7fcacf1d31209428035436d7e8031753be] virtual merging success
Ssongkai111成员
5月14日 强制推送  1 个提交:f5bf27a2-增加opapi调用log.h的能力
Ssongkai111成员
5月14日 update merge request[project id: 7649531, iid: 2693, commit_id: e3df8a05108611e927545364b826e883f60e09b9] virtual merging success
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
5月14日 评论:

Notification

This pull request source branch has changed, so removes the following label(s): ci-pipeline-passed.

likedislike
songkai111成员
5月14日 评论:

compile

likedislike
Ssongkai111成员
5月14日 update merge request[project id: 7649531, iid: 2693, commit_id: c1eff52cf1699db55c09d23228f221e2671c4537] virtual merging success
CANN-robotCANN-robot成员
5月14日 删除了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月14日 评论:

流水线任务触发成功
任务链接 [a42425d16e45486ea6a4e9120d1645cf][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>>
harmony-infer ✅ SUCCESS
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
ATK_Test_A2 ✅ SUCCESS

[2026-05-14 10:48:35]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月14日 评论:

流水线任务触发成功
任务链接 [f8e77d18eb7b433f946bb7ed7a970048][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ❌ FAILED
antipoison ✅ SUCCESS
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ⚠️ WARNING >>>>> >>>>>
likedislike
RuiWang_成员
5月14日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-failed
songkai111成员
5月14日 评论:

compile

likedislike
Ssongkai111成员
5月14日 update merge request[project id: 7649531, iid: 2693, commit_id: c21eae049e90400bddfcc8c729859469607e2349] virtual merging success
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月14日 评论:

流水线任务触发成功
任务链接 [20f5a24c475d44d4b4ae84f1bd3e6858][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>>
harmony-infer ✅ SUCCESS
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
ATK_Test_A2 ✅ SUCCESS

[2026-05-14 11:41:51]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月14日 评论:

流水线任务触发成功
任务链接 [bcc477b709fd426ea03920481cca897a][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-05-14 11:32:21]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月14日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月14日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月14日 添加了label:ci-pipeline-passed
zl_hw成员
5月15日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月15日 添加了label:lgtmapproved
CANN-robot
CANN-robot成员
5月15日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 张磊.
Reviewers who wrote a comment of /lgtm are: 张磊, wangrui_.

likedislike
CANN-robotCANN-robot成员
5月15日 关闭了关联的issue
CANN-robotCANN-robot成员
5月15日 合入了pull request
Ssunday成员
7月2日 修改了pull request 的描述