Browse Source

atc and fwk atc.bin

tags/v1.2.0
taoxudonghaha 3 years ago
parent
commit
a4821a3ccc
3 changed files with 34 additions and 15 deletions
  1. +25
    -7
      ge/offline/CMakeLists.txt
  2. +7
    -6
      ge/offline/atc
  3. +2
    -2
      ge/offline/module.mk

+ 25
- 7
ge/offline/CMakeLists.txt View File

@@ -74,22 +74,22 @@ target_link_libraries(atc PRIVATE
-ldl
)

############ atc.bin ############
add_executable(atc.bin ${SRC_LIST} ${PROTO_HDRS})
############ atc_atc.bin ############
add_executable(atc_atc.bin ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(atc.bin PRIVATE
target_compile_options(atc_atc.bin PRIVATE
-Werror
-O2
-Wno-deprecated-declarations
)

target_compile_definitions(atc.bin PRIVATE
target_compile_definitions(atc_atc.bin PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
COMPILE_OMG_PACKAGE
google=ascend_private
)

target_include_directories(atc.bin PRIVATE
target_include_directories(atc_atc.bin PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${GE_CODE_DIR}
${GE_CODE_DIR}/ge
@@ -115,7 +115,7 @@ target_include_directories(atc.bin PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
)

target_link_libraries(atc.bin PRIVATE
target_link_libraries(atc_atc.bin PRIVATE
$<BUILD_INTERFACE:intf_pub>
ascend_protobuf
ge_common
@@ -134,6 +134,11 @@ target_link_libraries(atc.bin PRIVATE
-ldl
)

set_target_properties(atc_atc.bin PROPERTIES
OUTPUT_NAME atc.bin
RUNTIME_OUTPUT_DIRECTORY atclib
)

############ fwk_atc.bin ############
add_executable(fwk_atc.bin ${SRC_LIST} ${PROTO_HDRS})

@@ -194,10 +199,23 @@ target_link_libraries(fwk_atc.bin PRIVATE
-ldl
)

set_target_properties(fwk_atc.bin PROPERTIES
OUTPUT_NAME atc.bin
RUNTIME_OUTPUT_DIRECTORY fwkacl
)

############ install ############
set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib)

install(TARGETS atc atc.bin fwk_atc.bin OPTIONAL
install(TARGETS atc OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
)

install(TARGETS atc_atc.bin OPTIONAL
RUNTIME DESTINATION ${INSTALL_LIBRARY_DIR}/atclib
)

install(TARGETS fwk_atc.bin OPTIONAL
RUNTIME DESTINATION ${INSTALL_LIBRARY_DIR}/fwkacl
)

+ 7
- 6
ge/offline/atc View File

@@ -4,7 +4,12 @@
# Copyright 2020 Huawei Technologies Co., Ltd. All rights reserved.
#-------------------------------------------------------------------

LOCAL_PATH=$(cd "$(dirname "$0")"; pwd)
real_path=$(readlink "$0")
if [ $? -eq 0 ]; then
LOCAL_PATH=$(cd "$(dirname "$real_path")"; pwd)
else
LOCAL_PATH=$(cd "$(dirname "$0")"; pwd)
fi
PKG_PATH=$(cd ${LOCAL_PATH}/..; pwd)
LIB_P="/lib64"
PYTHON_P="/python/site-packages"
@@ -13,8 +18,4 @@ PYTHON_PATH="${PKG_PATH}${PYTHON_P}"
export LD_LIBRARY_PATH="${LIB64_PATH}:${LD_LIBRARY_PATH}"
export PYTHONPATH="${PYTHON_PATH}:${PYTHONPATH}"

if [ -f "${PKG_PATH}/bin/atc.bin" ];then
${PKG_PATH}/bin/atc.bin/atc.bin $@
else
${PKG_PATH}/bin/atc.bin/fwk_atc.bin $@
fi
${PKG_PATH}/bin/atc.bin "$@"

+ 2
- 2
ge/offline/module.mk View File

@@ -56,7 +56,7 @@ include $(BUILD_HOST_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE := atc.bin
LOCAL_MODULE := atclib/atc.bin

LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DCOMPILE_OMG_PACKAGE -O2 -Dgoogle=ascend_private
@@ -109,7 +109,7 @@ include $(BUILD_HOST_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE := fwk_atc.bin
LOCAL_MODULE := fwkacl/atc.bin

LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DCOMPILE_OMG_PACKAGE -O2 -Dgoogle=ascend_private


Loading…
Cancel
Save