已合并
修复静态库编译打包问题 #10953
修复静态库编译打包问题 #10953
已合并
huangbolin创建于 8月31日
huangbolin
huangbolin成员
8月31日

描述

静态库编译后产生的cann-950-ops-transformer-static_9.2.0_linux-x86_64.tar.gz解压后没有libcann_transformer_static.a,原因是之前静态库编译优化时,打包这个文件使用的变量写错了,现在进行修复

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/4853

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 huangbolin 的贡献)
huangbolinhuangbolin成员
8月31日 创建了 pull request,commit f04fd707
atomgit-bot
atomgit-bot
8月31日 评论:

变更摘要

该 PR 主要修复静态库编译打包时安装条件判断错误的问题。在 cmake/static.cmake 中,将静态库文件安装(install)的开关条件由 ENABLE_PACKAGE 改为 ENABLE_BUILD_PKG,使打包流程与实际的构建打包开关保持一致,确保在启用构建打包时能够正确将生成的静态库(lib${OPSTATIC_NAME}.a)安装到指定目录 static_library_files/lib64。

主要改动

  • 修正打包开关判断:将 cmake/static.cmake 中安装静态库的条件从 ENABLE_PACKAGE 改为 ENABLE_BUILD_PKG,修正了编译打包场景下静态库安装条件判断不匹配的问题。
  • 确保静态库正确安装:在 ENABLE_BUILD_PKG 开启时,将 bin_tmp/${compute_unit} 目录下生成的 lib${OPSTATIC_NAME}.a 安装至 ${CMAKE_BINARY_DIR}/static_library_files/lib64,保证静态库产物在打包流程中被正确收集。
likedislike
不准确?
huangbolinhuangbolin成员
8月31日 修改了pull request 的描述
CANN-robotCANN-robot成员
8月31日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月31日 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

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

Module Approval Details

module lgtm status approve status
cmake ✅ wang-minbo, xtqh (2/2) ✅ wang-minbo (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
8月31日 将monologue815,jiang-lirui,Allan_Yu,wang-minbo,xtqh,liudan12,gaoxiang618,mabing1118设为评审人
此处折叠了10条事件消息 查看更多
CANN-robotCANN-robot成员
8月31日 添加了label:cann-cla/yes
huangbolin
huangbolin成员
8月31日 评论:

compile

likedislike
huangbolinhuangbolin成员
8月31日 预合并成功(commit_id: ebb65f16d2c42211f41974b9b7384294f510b34e)
CANN-robotCANN-robot成员
8月31日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
8月31日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_report_lcov ⚠️ WARNING >>>>>

[2026-08-31 15:17:30]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
8月31日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-08-31 15:16:34]    CI执行结束

likedislike
CANN-robotCANN-robot成员
8月31日 添加了label:api-check-pass
CANN-robotCANN-robot成员
8月31日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月31日 添加了label:ci-pipeline-passed
wang-minbo成员
9月1日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
9月1日 添加了label:approved
huangbolinhuangbolin成员
9月1日 关联了issue:[Bug-Report|缺陷反馈]:静态库编译少libcann_transformer_static.a
huangbolinhuangbolin成员
9月1日 修改了pull request 的描述
huangbolinhuangbolin成员
9月1日 修改了pull request 的描述
huangbolinhuangbolin成员
9月1日 修改了pull request 的描述
huangbolinhuangbolin成员
9月1日 修改了pull request 的描述
xtqh成员
9月1日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9月1日 添加了label:lgtm
CANN-robotCANN-robot成员
9月1日 关闭了关联的issue
CANN-robotCANN-robot成员
9月1日 合入了pull request