diff --git a/CMakeLists.txt b/CMakeLists.txt index d06e7d3c..ecfd3792 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,8 @@ if (ENABLE_OPEN_SRC) find_module(resource libresource.so ${GE_LIB_PATH}) find_module(error_manager liberror_manager.so ${GE_LIB_PATH}) find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH}) + find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH}) + find_module(msprofiler libmsprofiler.a ${GE_LIB_PATH}) else() if(DEFINED ENV{ASCEND_CUSTOM_PATH}) set(ASCEND_DIR $ENV{ASCEND_CUSTOM_PATH}) @@ -59,6 +61,7 @@ if (ENABLE_OPEN_SRC) set(ASCEND_DRIVER_COMMON_DIR ${ASCEND_DIR}/driver/lib64/common) set(ASCEND_RUNTIME_DIR ${ASCEND_DIR}/fwkacllib/lib64) set(ASCEND_ATC_DIR ${ASCEND_DIR}/atc/lib64) + set(ASCEND_ACL_DIR ${ASCEND_DIR}/acllib/lib64) find_module(slog libslog.so ${ASCEND_DRIVER_DIR}) find_module(mmpa libmmpa.so ${ASCEND_DRIVER_DIR}) find_module(msprof libmsprof.so ${ASCEND_DRIVER_DIR}) @@ -69,6 +72,8 @@ if (ENABLE_OPEN_SRC) find_module(resource libresource.so ${ASCEND_RUNTIME_DIR}) find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR}) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) + find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) + find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR}) endif() set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef) diff --git a/cmake/external_libs/protobuf_shared.cmake b/cmake/external_libs/protobuf_shared.cmake index 59cc7ff3..fd2aa695 100755 --- a/cmake/external_libs/protobuf_shared.cmake +++ b/cmake/external_libs/protobuf_shared.cmake @@ -10,8 +10,7 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR set(CMAKE_INSTALL_PREFIX ${GE_CODE_DIR}/output CACHE STRING "path for install()" FORCE) message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") endif() - -set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 $<$:-D_GLIBCXX_USE_CXX11_ABI=0> -O2") +set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") ExternalProject_Add(protobuf_build URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz diff --git a/cmake/external_libs/protobuf_static.cmake b/cmake/external_libs/protobuf_static.cmake index 0cf68946..e5d296bb 100755 --- a/cmake/external_libs/protobuf_static.cmake +++ b/cmake/external_libs/protobuf_static.cmake @@ -8,7 +8,7 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") endif() -set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 $<$:-D_GLIBCXX_USE_CXX11_ABI=0> -O2") +set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2") set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") set(PROTOBUF_STATIC_PKG_DIR ${CMAKE_INSTALL_PREFIX}/protobuf_static) ExternalProject_Add(protobuf_static_build diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index c238a78d..f692689b 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -441,6 +441,7 @@ set(INFER_SRC_LIST "graph/partition/engine_place.cc" "graph/partition/graph_partition.cc" "graph/partition/dynamic_shape_partition.cc" + "graph/partition/stage_partition.cc" "generator/ge_generator.cc" "generator/generator_api.cc" "graph/manager/graph_var_manager.cc" @@ -712,7 +713,15 @@ add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c) set(DUMMY_OBJ $) add_library(opensrc_ascendcl SHARED ${DUMMY_OBJ}) - +target_compile_options(opensrc_ascendcl PRIVATE + -O2 + -fvisibility=hidden +) +target_link_options(opensrc_ascendcl PRIVATE + -rdynamic + -Wl,-Bsymbolic + -Wl,--exclude-libs,ALL +) target_link_libraries(opensrc_ascendcl PRIVATE -Wl, --whole-archive ge_executor @@ -733,9 +742,7 @@ target_link_libraries(opensrc_ascendcl PRIVATE msprof ascend_hal_stub -Wl, --as-needed - $<$>:-lrt> -ldl - $<$:-llog> json )