Skip to content

[cmake治理]删除paddle_test多余无用依赖 #60013

@risemeup1

Description

@risemeup1

问题描述 Please describe your issue

一、需求背景

飞桨正在优化cmake代码,来减少编译时候的开发成本,目前paddle编译c++单测有多种方式,如cc_test_old(link静态库),cc_test(windows下link静态库,linux下link paddle.so),paddle_test(windows和linux下都link动态库paddle.so),现在推荐使用paddle_test,好处在于:

  1. link动态库无需手动加过多的依赖,大部分符号在paddle.so中已存在;
  2. link libpaddle.so可以大幅度减小C++单测的体积 ,从而减少build目录体积大小

二、存在的问题

paddle仓库中大概有50个使用paddle_test的代码,有一部分后面加了额外不需要的依赖,需要删除,如test/cpp/pir/shape_dialect/CMakeLists.txt中shape_struct_test单测依赖了gtest,实际上是额外的依赖,应该删掉。

三、建议步骤

1 在linux下,将paddle_test DEPS依赖全部删掉编译,如果遇到找不到一些符号,再加上必要的依赖
2 linux下报错解决后,windows下可能也会遇到一些编译问题

四、任务划分

序号 目录 认领人/状态/PR号
1 paddle/fluid/inference/utils/CMakeLists.txt @Liyulingyue
2 test/cpp/auto_parallel/CMakeLists.txt @zade23 #60274 #60348
3 test/cpp/eager/performance_tests/CMakeLists.txt @BeingGod
4 test/cpp/fluid/CMakeLists.txt @DrRyanHuang #60160
5 test/cpp/fluid/cinn/CMakeLists.txt @ccsuzzh #60235
6 test/cpp/fluid/framework/CMakeLists.txt @RedContritio
7 test/cpp/fluid/framework/details/CMakeLists.txt @RedContritio
8 test/cpp/fluid/lite/CMakeLists.txt @ccsuzzh
9 test/cpp/fluid/pscore/CMakeLists.txt @xiaoyewww #60240
10 test/cpp/pir/cinn/CMakeLists.txt @zrr1999 #60239
11 test/cpp/pir/cinn/adt/CMakeLists.txt @zrr1999
@Liyulingyue #60154
12 test/cpp/pir/core/CMakeLists.txt @DrRyanHuang #60161
13 test/cpp/pir/shape_dialect/CMakeLists.txt @sanbuphy
@Liyulingyue #60517
14 test/cpp/pir/sub_graph/CMakeLists.txt @DrRyanHuang
@xiaoyewww #60087
15 test/cpp/prim/CMakeLists.txt @enkilee
@Liyulingyue #60149

认领方式

请大家以 comment 的形式认领任务,如:

【报名】:1、3、12-13

多个任务之间需要使用中文顿号分隔,报名多个连续任务可用横线表示,如 2-5
PR 提交格式:在 PR 的标题中以 【CMake opt】 开头,注明任务编号

看板信息

任务方向 任务数量 提交作品 / 任务认领 提交率 完成 完成率
快乐开源 15 10 / 15 66.67% 10 66.67%

统计信息

排名不分先后 @zade23 (1) @DrRyanHuang (2) @ccsuzzh (1) @xiaoyewww (2) @zrr1999 (1) @Liyulingyue (3)

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions