To build a fundamental unit test would require building many targets.
Created by: wangkuiyi
When I was building channel_test.cc
, which is a very fundamental module and doesn't depend on any operators, I noticed that I have to build all operators, which takes a very long time.
I noticed that in this change, @QiJune made all unit tests depend on a target paddle_gtest_main
. Then, I made cmake outputs the target dependency graph, and it seems that paddle_gtest_main -> init -> operator
.
λ 6ee0c1df0c94 /paddle/build {explain_boost-version} grep 'paddle_gtest_main ->' test.dot
"node199" -> "node700" // paddle_gtest_main -> glog
"node199" -> "node701" // paddle_gtest_main -> gflags
"node199" -> "node705" // paddle_gtest_main -> -lpthread
"node199" -> "node359" // paddle_gtest_main -> init
"node199" -> "node278" // paddle_gtest_main -> paddle_memory
"node199" -> "node707" // paddle_gtest_main -> gtest
λ 6ee0c1df0c94 /paddle/build {explain_boost-version} grep 'init ->' test.dot
"node359" -> "node700" // init -> glog
"node359" -> "node701" // init -> gflags
"node359" -> "node705" // init -> -lpthread
"node359" -> "node311" // init -> device_context
"node359" -> "node309" // init -> place
"node359" -> "node260" // init -> stringpiece
"node359" -> "node356" // init -> operator
λ 6ee0c1df0c94 /paddle/build {explain_boost-version} grep 'operator ->' test.dot
"node356" -> "node700" // operator -> glog
"node356" -> "node701" // operator -> gflags
"node356" -> "node705" // operator -> -lpthread
"node356" -> "node354" // operator -> op_info
"node356" -> "node311" // operator -> device_context
"node356" -> "node357" // operator -> tensor
"node356" -> "node344" // operator -> scope
"node356" -> "node355" // operator -> shape_inference
"node356" -> "node340" // operator -> data_transform
"node356" -> "node352" // operator -> lod_tensor
Could we remove these unnecessary dependencies?