From 7fb48d69bb1d0e0c797cb160c741d3269b060785 Mon Sep 17 00:00:00 2001 From: taoxudonghaha Date: Tue, 29 Dec 2020 19:20:30 +0800 Subject: [PATCH 1/2] verify profiler modify --- ge/CMakeLists.txt | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 5960da1a..dd1a909f 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -611,7 +611,18 @@ set(INFER_SRC_LIST if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) ############ libge_runner.so ############ -add_library(ge_runner SHARED ${TRAIN_SRC_LIST} ${PROTO_SRCS} ${PROTO_CLIENT_SRCS}) +add_library(ge_runner SHARED + ${TRAIN_SRC_LIST} + ${PROTO_SRCS} + ${PROTO_CLIENT_SRCS} + $,msprofiler_fwk,msprofiler_fwk_object>> +) + +add_library(msprofiler_fwk_object OBJECT IMPORTED GLOBAL) + +if (msprofiler_fwk_LIBRARY_DIR) + set_property(TARGET msprofiler_fwk_object PROPERTY IMPORTED_OBJECTS ${msprofiler_fwk_LIBRARY_DIR}) +endif() target_compile_definitions(ge_runner PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 @@ -659,9 +670,6 @@ target_link_libraries(ge_runner PRIVATE ge_memory adump_server static_mmpa - -Wl,--whole-archive - msprofiler_fwk - -Wl,--no-whole-archive -Wl,--no-as-needed graph ge_common @@ -760,8 +768,16 @@ endif() add_library(opensrc_ascendcl SHARED ${OBJECT_LIST} + $,msprofiler,msprofiler_object>> + ) +add_library(msprofiler_object OBJECT IMPORTED GLOBAL) + +if (msprofiler_LIBRARY_DIR) + set_property(TARGET msprofiler_object PROPERTY IMPORTED_OBJECTS ${msprofiler_LIBRARY_DIR}) +endif() + target_compile_definitions(opensrc_ascendcl PRIVATE google=ascend_private ) @@ -775,14 +791,7 @@ target_link_options(opensrc_ascendcl PRIVATE -Wl,--allow-multiple-definition -Wl,-z,muldefs -Wl,-Bsymbolic - -Wl,--exclude-libs,libascend_protobuf.a - -Wl,--exclude-libs,libge_executor.a - -Wl,--exclude-libs,libge_common.a - -Wl,--exclude-libs,libgraph.a - -Wl,--exclude-libs,libmmpa.a - -Wl,--exclude-libs,libregister.a - -Wl,--exclude-libs,liberror_manager.a - -Wl,--exclude-libs,libadump_server.a + -Wl,--exclude-libs,ALL ) target_link_libraries(opensrc_ascendcl PRIVATE -Wl,--whole-archive @@ -794,7 +803,6 @@ target_link_libraries(opensrc_ascendcl PRIVATE register_static error_manager_static adump_server - msprofiler -Wl,--no-whole-archive -Wl,--no-as-needed c_sec From 6b98ed95543b176268db837759ae2069c16f5e55 Mon Sep 17 00:00:00 2001 From: taoxudonghaha Date: Thu, 31 Dec 2020 15:21:31 +0800 Subject: [PATCH 2/2] test --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 776a3232..21ddebde 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,3 +187,4 @@ else() endif() add_subdirectory(ge) +