Browse Source

update cmakelist

tags/v1.2.0
taoxiangdong 3 years ago
parent
commit
af5190136b
2 changed files with 7 additions and 27 deletions
  1. +3
    -3
      CMakeLists.txt
  2. +4
    -24
      ge/CMakeLists.txt

+ 3
- 3
CMakeLists.txt View File

@@ -80,7 +80,7 @@ if (ENABLE_OPEN_SRC)
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_fwk libmsprofiler_fwk.a ${GE_LIB_PATH})
find_module(msprofiler_fwk libmsprofiler_fwk.a ${GE_LIB_PATH})
#find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH})
else()
find_module(slog libslog.so ${ASCEND_ATC_DIR})
@@ -92,7 +92,7 @@ if (ENABLE_OPEN_SRC)
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(resource libresource.so ${ASCEND_RUNTIME_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR})
#find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR})
find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
if(PRODUCT STREQUAL "flr3")
message(FATAL_ERROR "This platform is not supported in train mode, build terminated")
@@ -123,7 +123,7 @@ 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_RUNTIME_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()


+ 4
- 24
ge/CMakeLists.txt View File

@@ -603,32 +603,9 @@ set(INFER_SRC_LIST
"analyzer/analyzer.cc"
)

#if (ENABLE_OPEN_SRC)
# file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object)
# if(EXISTS ${ASCEND_RUNTIME_DIR}/libmsprofiler_fwk.a)
# message(status "libmsprofiler_fwk.a has been found!")
# execute_process(
# COMMAND ar x ${ASCEND_RUNTIME_DIR}/libmsprofiler_fwk.a
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object
# )
# file(GLOB msprof_file ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object/*.o)
# else()
# message(status "libmsprofiler_fwk.a can not be found!")
# file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/msprofiler_fwk.cc CONTENT "")
# set(msprof_file ${CMAKE_BINARY_DIR}/msprofiler_fwk.cc)
# endif()
# add_library(msprofiler_fwk OBJECT ${msprof_file})
#endif()

if (ENABLE_OPEN_SRC)
add_library(msprofiler_fwk STATIC IMPORTED)
set_target_properties(msprofiler_fwk PROPERTIES
IMPORTED_LOCATION ${ASCEND_RUNTIME_DIR}/libmsprofiler_fwk.a)
endif()

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} $<TARGET_OBJECTS:msprofiler_fwk>)
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
@@ -674,6 +651,9 @@ target_link_libraries(ge_runner
ge_memory
adump_server
static_mmpa
-Wl,--whole-archive
msprofiler_fwk
-Wl,--no-whole-archive
-Wl,--no-as-needed
graph
ge_common


Loading…
Cancel
Save