From 16758ee2b1e10e36c0293d400f493f9a09720b38 Mon Sep 17 00:00:00 2001 From: wqtshg Date: Thu, 24 Dec 2020 11:31:39 +0800 Subject: [PATCH] update c76 code --- CMakeLists.txt | 22 +++++++++++----------- ge/CMakeLists.txt | 18 ++++++++++++++---- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d0184b..776a3232 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,11 @@ endif() if(DEFINED ENV{D_PKG_SERVER}) set(GE_PB_PKG $ENV{D_PKG_SERVER}) - message("Download packages from PKG server") -endif() + message("Download packages from DPKG server") +elseif(DEFINED ENV{MSLIBS_SERVER}) + set(GE_PB_PKG "http://$ENV{MSLIBS_SERVER}:8081") + message("Download packages from MSPKG server") +endif () set(ASCEND_DRIVER_DIR ${ASCEND_DIR}/driver/lib64) set(ASCEND_DRIVER_COMMON_DIR ${ASCEND_DIR}/driver/lib64/common) @@ -82,6 +85,8 @@ if (ENABLE_OPEN_SRC) find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH}) find_module(msprofiler_fwk libmsprofiler_fwk.a ${GE_LIB_PATH}) #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) + elseif(ENABLE_GE_COV OR ENABLE_GE_UT) + add_subdirectory(tests) else() find_module(slog libslog.so ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) @@ -105,7 +110,7 @@ if (ENABLE_OPEN_SRC) find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR}) - #find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) + #find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) if(PRODUCT STREQUAL "flr3") elseif(PRODUCT STREQUAL "flr1") find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) @@ -115,7 +120,7 @@ if (ENABLE_OPEN_SRC) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) endif() elseif(PLATFORM STREQUAL "all") - find_module(msprofiler libmsprofiler.a ${ASCEND_DRIVER_COMMON_DIR}) + find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR}) find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR}) find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR}) find_module(runtime libruntime.so ${ASCEND_ACL_DIR}) @@ -123,17 +128,12 @@ if (ENABLE_OPEN_SRC) find_module(resource libresource.so ${ASCEND_ATC_DIR}) find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) - find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_ACL_DIR}) + find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) #find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) else() - message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!") + message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!") endif() - - if (ENABLE_GE_COV OR ENABLE_GE_UT) - add_subdirectory(tests) - endif() - endif() set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 85a1bd18..3a0f7638 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -607,7 +607,7 @@ 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}) target_compile_definitions(ge_runner PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 @@ -648,11 +648,14 @@ target_include_directories(ge_runner PRIVATE ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ) -target_link_libraries(ge_runner +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 @@ -712,7 +715,7 @@ target_include_directories(ge_compiler PRIVATE ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ) -target_link_libraries(ge_compiler +target_link_libraries(ge_compiler PRIVATE $ ge_memory static_mmpa @@ -766,7 +769,14 @@ target_link_options(opensrc_ascendcl PRIVATE -Wl,--allow-multiple-definition -Wl,-z,muldefs -Wl,-Bsymbolic - -Wl,--exclude-libs,ALL + -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 ) target_link_libraries(opensrc_ascendcl PRIVATE -Wl,--whole-archive