Merged
refactor(package): 排除7个aicpu公共头在pkg_inc/aicpu_common下的重复安装 #829
refactor(package): 排除7个aicpu公共头在pkg_inc/aicpu_common下的重复安装 #829
Merged
liu-weiAdd on Sep 8
liu-wei
liu-weiCollaborators
Sep 8

描述

cmake/package.cmake 中 include/op_common/aicpu_common/ 下的 7 个公共头文件被同时安装到 include/aicpu/ 和 pkg_inc/aicpu_common/context/{common,cpu_proto}/ 两个路径,产生重复副本。本 PR 在整目录安装规则中新增 PATTERN ... EXCLUDE 排除这 7 个文件,仅保留 include/aicpu/ 一份。

关联的Issue

https://gitcode.com/cann/opbase/issues/419

测试

  • 出包对比:修改前后 include/aicpu/ 下 8 个文件完全一致,pkg_inc/aicpu_common/ 下减少 7 个重复文件,其余产物零差异
  • 装包对比:安装后产物差异与包内清单一致
  • 下游兼容:下游 Findaicpu.cmake 已含 include/aicpu 路径,删除重复副本后编译不受影响
likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for liu-wei's contribution.)
liu-weiliu-weiCollaborators
Sep 8 Created pull request, commit 74ee22f2
atomgit-bot
atomgit-bot
Sep 8 Comments:

变更摘要

本 PR 旨在排除 7 个 aicpu 公共头文件在 pkg_inc/aicpu_common 下的重复安装。修改集中在 cmake/package.cmake:其中 include/op_common/aicpu_common 目录原本会被整体安装到 ${CMAKE_SYSTEM_PROCESSOR}-linux/pkg_inc/aicpu_common 目标路径,而其中 7 个公共头已由 aicpu_headers_src 规则扁平安装到 include/aicpu/,因此在本次安装规则中新增 PATTERN ... EXCLUDE 过滤,避免同一头文件被重复打包。

主要改动

  • 新增排除注释: 在 install(DIRECTORY ...) 规则前补充注释,说明这 7 个公共头已由 aicpu_headers_src 规则安装至 include/aicpu/,此处排除以避免重复。
  • 排除 cpu_kernel.h 等头文件安装: 为 aicpu_common_public 的目录安装规则新增 7 条 PATTERN ... EXCLUDE 过滤,排除 cpu_attr_value.h、cpu_tensor.h、cpu_tensor_shape.h、cpu_context.h、cpu_types.h、cpu_kernel.h、cpu_kernel_register.h。
  • 保持目标路径与下游行为不变: 排除仅针对已重复交付的头文件,装包时其余头文件仍合并安装到同一目标路径 pkg_inc/aicpu_common,对下游保持兼容。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 8 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 8 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 8 Comments:

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
repo-cann/opbase ✅ 王瑞, 宋恺 (2/2) ✅ 王瑞, 宋恺 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
59 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 15 Added label: approved
songkai111Collaborators
Sep 15 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 15 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 15 Merged pull request