| @@ -49,6 +49,8 @@ if (ENABLE_OPEN_SRC) | |||||
| find_module(resource libresource.so ${GE_LIB_PATH}) | find_module(resource libresource.so ${GE_LIB_PATH}) | ||||
| find_module(error_manager liberror_manager.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(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() | else() | ||||
| if(DEFINED ENV{ASCEND_CUSTOM_PATH}) | if(DEFINED ENV{ASCEND_CUSTOM_PATH}) | ||||
| set(ASCEND_DIR $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_DRIVER_COMMON_DIR ${ASCEND_DIR}/driver/lib64/common) | ||||
| set(ASCEND_RUNTIME_DIR ${ASCEND_DIR}/fwkacllib/lib64) | set(ASCEND_RUNTIME_DIR ${ASCEND_DIR}/fwkacllib/lib64) | ||||
| set(ASCEND_ATC_DIR ${ASCEND_DIR}/atc/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(slog libslog.so ${ASCEND_DRIVER_DIR}) | ||||
| find_module(mmpa libmmpa.so ${ASCEND_DRIVER_DIR}) | find_module(mmpa libmmpa.so ${ASCEND_DRIVER_DIR}) | ||||
| find_module(msprof libmsprof.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(resource libresource.so ${ASCEND_RUNTIME_DIR}) | ||||
| find_module(error_manager liberror_manager.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(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() | endif() | ||||
| set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef) | set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef) | ||||
| @@ -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) | 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}.") | message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") | ||||
| endif() | endif() | ||||
| set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 $<$<STREQUAL:${PRODUCT_SIDE},host>:-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_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") | ||||
| ExternalProject_Add(protobuf_build | ExternalProject_Add(protobuf_build | ||||
| URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz | URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz | ||||
| @@ -8,7 +8,7 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR | |||||
| message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") | message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") | ||||
| endif() | endif() | ||||
| set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 $<$<STREQUAL:${PRODUCT_SIDE},host>:-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_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") | ||||
| set(PROTOBUF_STATIC_PKG_DIR ${CMAKE_INSTALL_PREFIX}/protobuf_static) | set(PROTOBUF_STATIC_PKG_DIR ${CMAKE_INSTALL_PREFIX}/protobuf_static) | ||||
| ExternalProject_Add(protobuf_static_build | ExternalProject_Add(protobuf_static_build | ||||
| @@ -441,6 +441,7 @@ set(INFER_SRC_LIST | |||||
| "graph/partition/engine_place.cc" | "graph/partition/engine_place.cc" | ||||
| "graph/partition/graph_partition.cc" | "graph/partition/graph_partition.cc" | ||||
| "graph/partition/dynamic_shape_partition.cc" | "graph/partition/dynamic_shape_partition.cc" | ||||
| "graph/partition/stage_partition.cc" | |||||
| "generator/ge_generator.cc" | "generator/ge_generator.cc" | ||||
| "generator/generator_api.cc" | "generator/generator_api.cc" | ||||
| "graph/manager/graph_var_manager.cc" | "graph/manager/graph_var_manager.cc" | ||||
| @@ -712,7 +713,15 @@ add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c) | |||||
| set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>) | set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>) | ||||
| add_library(opensrc_ascendcl SHARED ${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 | target_link_libraries(opensrc_ascendcl PRIVATE | ||||
| -Wl, --whole-archive | -Wl, --whole-archive | ||||
| ge_executor | ge_executor | ||||
| @@ -733,9 +742,7 @@ target_link_libraries(opensrc_ascendcl PRIVATE | |||||
| msprof | msprof | ||||
| ascend_hal_stub | ascend_hal_stub | ||||
| -Wl, --as-needed | -Wl, --as-needed | ||||
| $<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME}, Android>>:-lrt> | |||||
| -ldl | -ldl | ||||
| $<$<STREQUAL:${TARGET_SYSTEM_NAME}, Android>:-llog> | |||||
| json | json | ||||
| ) | ) | ||||