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) + diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 0325a7de..d0683f77 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -615,7 +615,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 @@ -663,9 +674,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 @@ -764,8 +772,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 $<$:ONLY_COMPILE_OPEN_SRC> @@ -780,14 +796,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 @@ -799,7 +808,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