|
|
@@ -19,13 +19,30 @@ endif () |
|
|
|
|
|
|
|
|
option(ENABLE_OPEN_SRC "Enable graphengine compile in opensource." FALSE) |
|
|
option(ENABLE_OPEN_SRC "Enable graphengine compile in opensource." FALSE) |
|
|
|
|
|
|
|
|
|
|
|
if (DEFINED ENV{ASCEND_CUSTOM_PATH}) |
|
|
|
|
|
set(ASCEND_OPENSDK_DIR $ENV{ASCEND_CUSTOM_PATH}/opensdk/opensdk) |
|
|
|
|
|
set(CMAKE_PREFIX_PATH |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/cmake |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/c_sec |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/json |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/openssl |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/zlib |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/protoc |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/grpc |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/protobuf_static |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/ascend_protobuf |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/ascend_protobuf_static |
|
|
|
|
|
${ASCEND_OPENSDK_DIR}/gtest) |
|
|
|
|
|
set(CMAKE_MODULE_PATH ${ASCEND_OPENSDK_DIR}/cmake/modules) |
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
if (ENABLE_OPEN_SRC) |
|
|
if (ENABLE_OPEN_SRC) |
|
|
set(HI_PYTHON python3) |
|
|
set(HI_PYTHON python3) |
|
|
|
|
|
|
|
|
include(cmake/external_libs/protobuf_shared.cmake) |
|
|
|
|
|
include(cmake/external_libs/protoc.cmake) |
|
|
|
|
|
include(cmake/external_libs/securec.cmake) |
|
|
|
|
|
include(cmake/external_libs/json.cmake) |
|
|
|
|
|
|
|
|
include(cmake/function.cmake) |
|
|
|
|
|
#find_package(ascend_protobuf_shared MODULE) |
|
|
|
|
|
#find_package(protoc MODULE) |
|
|
|
|
|
#find_package(securec MODULE) |
|
|
|
|
|
#find_package(json MODULE) |
|
|
include(cmake/FindModule.cmake) |
|
|
include(cmake/FindModule.cmake) |
|
|
include(cmake/intf_pub_linux.cmake) |
|
|
include(cmake/intf_pub_linux.cmake) |
|
|
|
|
|
|
|
|
@@ -43,8 +60,8 @@ if (ENABLE_OPEN_SRC) |
|
|
message(FATAL_ERROR "Running on a unsupported architecture: ${SYSTEM_TYPE}, build terminated") |
|
|
message(FATAL_ERROR "Running on a unsupported architecture: ${SYSTEM_TYPE}, build terminated") |
|
|
endif() |
|
|
endif() |
|
|
set(GE_LIB_PATH ${GE_LIB_PATH}/${GE_SYS_ARCH}) |
|
|
set(GE_LIB_PATH ${GE_LIB_PATH}/${GE_SYS_ARCH}) |
|
|
find_module(slog libalog.so ${GE_LIB_PATH}) |
|
|
|
|
|
find_module(static_mmpa libmmpa.a ${GE_LIB_PATH}) |
|
|
|
|
|
|
|
|
find_package(slog REQUIRED CONFIG) |
|
|
|
|
|
find_package(mmpa REQUIRED CONFIG) |
|
|
elseif(ENABLE_GE_COV OR ENABLE_GE_UT) |
|
|
elseif(ENABLE_GE_COV OR ENABLE_GE_UT) |
|
|
message(STATUS "Runing on llt mode, no need to depend other component") |
|
|
message(STATUS "Runing on llt mode, no need to depend other component") |
|
|
elseif(ENABLE_PARSER_UT OR ENABLE_PARSER_COV OR ENABLE_PARSER_ST) |
|
|
elseif(ENABLE_PARSER_UT OR ENABLE_PARSER_COV OR ENABLE_PARSER_ST) |
|
|
@@ -58,8 +75,8 @@ if (ENABLE_OPEN_SRC) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
set(ASCEND_COMPILER_DIR ${ASCEND_DIR}/compiler/lib64) |
|
|
set(ASCEND_COMPILER_DIR ${ASCEND_DIR}/compiler/lib64) |
|
|
find_module(slog libalog.so ${ASCEND_COMPILER_DIR}) |
|
|
|
|
|
find_module(static_mmpa libmmpa.a ${ASCEND_COMPILER_DIR}) |
|
|
|
|
|
|
|
|
find_package(slog REQUIRED CONFIG) |
|
|
|
|
|
find_package(mmpa REQUIRED CONFIG) |
|
|
endif() |
|
|
endif() |
|
|
|
|
|
|
|
|
if (NOT DEFINED METADEF_DIR) |
|
|
if (NOT DEFINED METADEF_DIR) |
|
|
@@ -140,7 +157,7 @@ target_include_directories(parser_graph_library_proto_obj PRIVATE |
|
|
target_compile_definitions(parser_graph_library_proto_obj PRIVATE |
|
|
target_compile_definitions(parser_graph_library_proto_obj PRIVATE |
|
|
google=ascend_private |
|
|
google=ascend_private |
|
|
) |
|
|
) |
|
|
target_link_libraries(parser_graph_library_proto_obj PRIVATE ascend_protobuf $<BUILD_INTERFACE:intf_pub>) |
|
|
|
|
|
|
|
|
target_link_libraries(parser_graph_library_proto_obj PRIVATE ascend_protobuf intf_pub) |
|
|
target_compile_options(parser_graph_library_proto_obj PRIVATE |
|
|
target_compile_options(parser_graph_library_proto_obj PRIVATE |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
@@ -161,7 +178,7 @@ target_include_directories(parser_tensorflow_protos_obj PRIVATE |
|
|
target_compile_definitions(parser_tensorflow_protos_obj PRIVATE |
|
|
target_compile_definitions(parser_tensorflow_protos_obj PRIVATE |
|
|
google=ascend_private |
|
|
google=ascend_private |
|
|
) |
|
|
) |
|
|
target_link_libraries(parser_tensorflow_protos_obj PRIVATE ascend_protobuf $<BUILD_INTERFACE:intf_pub>) |
|
|
|
|
|
|
|
|
target_link_libraries(parser_tensorflow_protos_obj PRIVATE ascend_protobuf intf_pub) |
|
|
target_compile_options(parser_tensorflow_protos_obj PRIVATE |
|
|
target_compile_options(parser_tensorflow_protos_obj PRIVATE |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
@@ -182,7 +199,7 @@ target_include_directories(parser_onnx_protos_obj PRIVATE |
|
|
target_compile_definitions(parser_onnx_protos_obj PRIVATE |
|
|
target_compile_definitions(parser_onnx_protos_obj PRIVATE |
|
|
google=ascend_private |
|
|
google=ascend_private |
|
|
) |
|
|
) |
|
|
target_link_libraries(parser_onnx_protos_obj PRIVATE ascend_protobuf $<BUILD_INTERFACE:intf_pub>) |
|
|
|
|
|
|
|
|
target_link_libraries(parser_onnx_protos_obj PRIVATE ascend_protobuf intf_pub) |
|
|
target_compile_options(parser_onnx_protos_obj PRIVATE |
|
|
target_compile_options(parser_onnx_protos_obj PRIVATE |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-O2 -fPIC -Wextra -Wfloat-equal> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
$<$<OR:$<STREQUAL:${PRODUCT_SIDE},host>,$<STREQUAL:${ENABLE_OPEN_SRC},True>>:-fexceptions> |
|
|
|