forked from mindspore-Ecosystem/mindspore
refactor build scripts to fit latest Ascend pacakge structure
This commit is contained in:
parent
ce51f5f93d
commit
106c41a595
|
@ -3,7 +3,7 @@ project(MindSpore)
|
|||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
|
||||
message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
|
||||
message(FATAL_ERROR "GCC version must be 7.3.0 and above, but found ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.4.0)
|
||||
message(WARNING "GCC version ${CMAKE_CXX_COMPILER_VERSION} is greater than 9.4.0, may cause unknown problems.")
|
||||
endif()
|
||||
|
@ -11,6 +11,8 @@ endif()
|
|||
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/check_requirements.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/ascend_variables.cmake)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
if(NOT ENABLE_GLIBCXX)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
|
||||
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
|
||||
else()
|
||||
set(ASCEND_PATH /usr/local/Ascend)
|
||||
endif()
|
||||
# driver
|
||||
set(ASCEND_DRIVER_PATH ${ASCEND_PATH}/driver/lib64/common)
|
||||
set(ASCEND_DRIVER_HAL_PATH ${ASCEND_PATH}/driver/lib64/driver)
|
||||
|
||||
# CANN packages
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
set(ASCEND_CANN_OPP_PATH ${ASCEND_PATH}/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(ASCEND_CANN_PLUGIN_PATH ${ASCEND_CANN_RUNTIME_PATH}/plugin/opskernel)
|
||||
|
||||
# Ascend-toolkit packages
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/lib64)
|
||||
set(ASCEND_TOOLKIT_OPP_PATH ${ASCEND_PATH}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(ASCEND_TOOLKIT_PLUGIN_PATH ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel)
|
||||
|
||||
# nnae packages (for rpath only)
|
||||
set(ASCEND_NNAE_RUNTIME_PATH ${ASCEND_PATH}/nnae/latest/lib64)
|
||||
set(ASCEND_NNAE_OPP_PATH ${ASCEND_PATH}/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
|
@ -13,6 +13,19 @@ set(FBS_FILES
|
|||
)
|
||||
ms_build_flatbuffers(FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}../../schema generated_fbs_files ${SERVER_FLATBUFFER_OUTPUT})
|
||||
|
||||
if(ENABLE_D OR ENABLE_ACL)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH
|
||||
${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
elseif(ENABLE_GPU)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:${CUDA_PATH}/lib64)
|
||||
endif()
|
||||
|
||||
if(ENABLE_D)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/plugin/device/ascend/kernel/aicpu/aicpu_ops)
|
||||
add_subdirectory(plugin/device/ascend/kernel/aicpu/aicpu_ops)
|
||||
|
@ -410,80 +423,26 @@ elseif(ENABLE_CPU AND NOT WIN32)
|
|||
-Wl,--no-as-needed mindspore::event_core ps_cache)
|
||||
endif()
|
||||
|
||||
if(MODE_ASCEND_ALL OR MODE_ASCEND_ACL)
|
||||
# common env paths
|
||||
if(DEFINED ENV{D_LINK_PATH})
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
MESSAGE("system processor matches aarch64")
|
||||
set(D_LIB_PATH $ENV{D_LINK_PATH}/aarch64)
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
MESSAGE("system processor matches x86_64")
|
||||
set(D_LIB_PATH $ENV{D_LINK_PATH}/x86_64)
|
||||
else()
|
||||
MESSAGE("system ${CMAKE_HOST_SYSTEM_PROCESSOR} not support")
|
||||
endif()
|
||||
else()
|
||||
MESSAGE("use system default lib")
|
||||
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
|
||||
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
|
||||
else()
|
||||
set(ASCEND_PATH /usr/local/Ascend)
|
||||
endif()
|
||||
set(ASCEND_DRIVER_PATH ${ASCEND_PATH}/driver/lib64/common)
|
||||
set(ASCEND_DRIVER_BACK_PATH ${ASCEND_PATH}/driver/lib64/driver)
|
||||
set(ASCEND_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
|
||||
set(ASCEND_RUNTIME_NEW_PATH ${ASCEND_PATH}/lib64)
|
||||
set(ASCEND_OPP_PATH ${ASCEND_PATH}/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_NEW_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
set(ASCEND_CANN_OPP_PATH ${ASCEND_PATH}/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_NEW_PATH ${ASCEND_PATH}/ascend-toolkit/latest/lib64)
|
||||
set(ASCEND_TOOLKIT_OPP_PATH ${ASCEND_PATH}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_D)
|
||||
find_library(GE_RUNNER ge_runner ${ASCEND_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(GRAPH graph ${ASCEND_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(HCCL hccl ${ASCEND_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(GE_RUNNER ge_runner ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(GRAPH graph ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(HCCL hccl ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
target_link_libraries(mindspore_backend PUBLIC ${GE_RUNNER} ${GRAPH} ${HCCL})
|
||||
endif()
|
||||
|
||||
if(MODE_ASCEND_ALL)
|
||||
MESSAGE("USE DAV LIB PATH: ${ASCEND_PATH}")
|
||||
find_library(ERROR_MANAGER error_manager ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(RUNTIME_LIB runtime ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(TSDCLIENT tsdclient HINTS ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH} ${ASCEND_DRIVER_BACK_PATH})
|
||||
find_library(DATATRANSFER datatransfer HINTS ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH} ${ASCEND_DRIVER_BACK_PATH})
|
||||
find_library(PROFILING msprofiler ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(ACL ascendcl ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(ACL_TDT_CHANNEL acl_tdt_channel ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(PLATFORM platform ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(OPTILING optiling ${ASCEND_OPP_PATH} ${ASCEND_TOOLKIT_OPP_PATH} ${ASCEND_CANN_OPP_PATH})
|
||||
find_library(OPT_FEATURE opt_feature ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
|
||||
find_library(ERROR_MANAGER error_manager ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(RUNTIME_LIB runtime ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(TSDCLIENT tsdclient HINTS ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(DATATRANSFER datatransfer HINTS ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(PROFILING msprofiler ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(ACL ascendcl ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(ACL_TDT_CHANNEL acl_tdt_channel ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(PLATFORM platform ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(OPT_FEATURE opt_feature ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(adump_server libadump_server.a ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(OPTILING optiling ${ASCEND_CANN_OPP_PATH} ${ASCEND_TOOLKIT_OPP_PATH})
|
||||
target_link_libraries(mindspore_backend PUBLIC ${RUNTIME_LIB} ${TSDCLIENT} ${DATATRANSFER} ${ERROR_MANAGER}
|
||||
-Wl,--no-as-needed ${OPTILING} ${PLATFORM} ${ACL} ${ACL_TDT_CHANNEL} ${OPT_FEATURE} ${PROFILING})
|
||||
target_link_libraries(mindspore PUBLIC -Wl,--start-group proto_input mindspore::protobuf -Wl,--end-group)
|
||||
|
@ -514,25 +473,8 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|||
else()
|
||||
MESSAGE(FATAL_ERROR "other platform: ${CMAKE_SYSTEM_NAME}")
|
||||
endif()
|
||||
|
||||
if(MODE_ASCEND_ALL)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH
|
||||
${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
elseif(ENABLE_GPU)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:${CUDA_PATH}/lib64)
|
||||
endif()
|
||||
set(MINDSPORE_RPATH ${ORIGIN_PATH}/lib:${MINDSPORE_RPATH})
|
||||
|
||||
set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
|
@ -587,9 +529,6 @@ if(ENABLE_MINDDATA)
|
|||
endif()
|
||||
|
||||
if(MODE_ASCEND_ALL)
|
||||
find_library(adump_server libadump_server.a ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_RUNTIME_NEW_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_NEW_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
target_link_libraries(_c_expression PRIVATE ${adump_server})
|
||||
endif()
|
||||
|
||||
|
|
|
@ -129,26 +129,17 @@ endif()
|
|||
if(ENABLE_D OR ENABLE_ACL)
|
||||
# 310 mode
|
||||
add_compile_definitions(ENABLE_DVPP_INTERFACE)
|
||||
find_library(acl libascendcl.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(acl_cblas libacl_cblas.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(acl_dvpp libacl_dvpp.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(acl_runtime libruntime.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(ge_compiler libge_compiler.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(libplatform libplatform.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(libcompress libcompress.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(libopskernel libopskernel.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(libaicore_utils libaicore_utils.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(libaicpu_engine_common libaicpu_engine_common.so ${ASCEND_RUNTIME_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(acl libascendcl.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(acl_cblas libacl_cblas.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(acl_dvpp libacl_dvpp.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(acl_runtime libruntime.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(ge_compiler libge_compiler.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(libplatform libplatform.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(libcompress libcompress.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(libopskernel libopskernel.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(libaicore_utils libaicore_utils.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(libaicpu_engine_common libaicpu_engine_common.so ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
|
||||
target_link_libraries(mindspore_shared_lib PRIVATE -Wl,--no-as-needed graph ${ge_compiler}
|
||||
${acl_retr} ${acl_cblas} ${acl_dvpp} ${acl_runtime} ${libplatform} ${libcompress} ${libopskernel}
|
||||
|
@ -160,8 +151,7 @@ endif()
|
|||
|
||||
# Before build inference
|
||||
if(ENABLE_D)
|
||||
find_library(adump_server libadump_server.a ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH})
|
||||
find_library(adump_server libadump_server.a ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
target_link_libraries(mindspore_shared_lib PRIVATE ${adump_server})
|
||||
endif()
|
||||
|
||||
|
@ -176,28 +166,18 @@ if(ENABLE_GPU)
|
|||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# duplicate, should be remove after backend decoupling is done
|
||||
set(MINDSPORE_RPATH $ORIGIN)
|
||||
if(ENABLE_D OR ENABLE_ACL)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH
|
||||
${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
set(MINDSPORE_RPATH
|
||||
${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/atc/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/atc/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/atc/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/atc/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/acllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/acllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/acllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/acllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling)
|
||||
endif()
|
||||
|
||||
set_target_properties(mindspore_shared_lib PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
|
||||
endif()
|
||||
|
|
|
@ -38,13 +38,7 @@ if(ENABLE_D)
|
|||
target_include_directories(_mindspore_plugin_device_ascend_hal_device_obj PRIVATE ${CMAKE_BINARY_DIR}/proto/ge)
|
||||
add_dependencies(_mindspore_plugin_device_ascend_hal_device_obj graph)
|
||||
if(ENABLE_MPI)
|
||||
set(ASCEND_PATH /usr/local/Ascend)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(ASCEND_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_NEW_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
find_library(HCCL hccl ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(HCCL hccl ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
file(GLOB_RECURSE ASCEND_COLLECTIVE_LIST "distribute/mpi_collective_group.cc"
|
||||
"distribute/collective_group_wrapper.cc")
|
||||
set_property(SOURCE ${ASCEND_COLLECTIVE_LIST}
|
||||
|
|
|
@ -2,53 +2,15 @@ add_library(hccl_plugin SHARED hccl_plugin.cc)
|
|||
target_include_directories(hccl_plugin PRIVATE ${CMAKE_BINARY_DIR}/proto/ge)
|
||||
add_dependencies(hccl_plugin graph)
|
||||
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/fwkacllib/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/fwkacllib/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64/plugin/opskernel)
|
||||
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64/plugin/opskernel)
|
||||
|
||||
set_target_properties(hccl_plugin PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
|
||||
|
||||
if(DEFINED ENV{D_LINK_PATH})
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
MESSAGE("system processor matches aarch64")
|
||||
set(D_LIB_PATH $ENV{D_LINK_PATH}/aarch64)
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
MESSAGE("system processor matches x86_64")
|
||||
set(D_LIB_PATH $ENV{D_LINK_PATH}/x86_64)
|
||||
else()
|
||||
MESSAGE("system ${CMAKE_HOST_SYSTEM_PROCESSOR} not support")
|
||||
endif()
|
||||
else()
|
||||
MESSAGE("use system default lib")
|
||||
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
|
||||
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
|
||||
else()
|
||||
set(ASCEND_PATH /usr/local/Ascend)
|
||||
endif()
|
||||
set(ASCEND_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_NEW_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
set(ASCEND_PLUGIN_PATH ${ASCEND_RUNTIME_PATH}/plugin/opskernel)
|
||||
set(ASCEND_PLUGIN_NEW_PATH ${ASCEND_CANN_RUNTIME_NEW_PATH}/plugin/opskernel)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(ASCEND_TOOLKIT_PLUGIN_PATH ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel)
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_PLUGIN_PATH ${ASCEND_CANN_RUNTIME_PATH}/plugin/opskernel)
|
||||
endif()
|
||||
|
||||
find_library(HCCL hccl ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(REGISTER register ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(HCCL_ADPTER hcom_graph_adaptor ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(HCCL_RA ra ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(HCCL_BUILDER hcom_opskernel_builder ${ASCEND_PLUGIN_PATH} ${ASCEND_TOOLKIT_PLUGIN_PATH}
|
||||
${ASCEND_CANN_PLUGIN_PATH} ${ASCEND_PLUGIN_NEW_PATH})
|
||||
find_library(HCCL hccl ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(REGISTER register ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(HCCL_ADPTER hcom_graph_adaptor ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(HCCL_RA ra ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
find_library(HCCL_BUILDER hcom_opskernel_builder ${ASCEND_CANN_PLUGIN_PATH} ${ASCEND_TOOLKIT_PLUGIN_PATH})
|
||||
target_link_libraries(hccl_plugin -Wl,--no-as-needed ${HCCL} ${HCCL_ADPTER} ${REGISTER} ${HCCL_BUILDER} ${HCCL_RA})
|
||||
|
|
|
@ -476,10 +476,8 @@ if(MSLITE_ENABLE_ACL)
|
|||
else()
|
||||
set(ASCEND_PATH /usr/local/Ascend)
|
||||
endif()
|
||||
set(ASCEND_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/fwkacllib/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_NEW_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/lib64)
|
||||
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/lib64)
|
||||
endif()
|
||||
|
||||
set(PKG_NAME_PREFIX mindspore-lite-${VERSION_STR})
|
||||
|
|
|
@ -425,8 +425,7 @@ add_dependencies(lite_src_mid fbs_src)
|
|||
if(MSLITE_ENABLE_ACL AND NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
|
||||
include_directories(${TOP_DIR}/graphengine/inc/external)
|
||||
add_subdirectory(extendrt/kernel/ascend)
|
||||
link_directories(${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
endif()
|
||||
|
||||
add_library(mindspore-lite SHARED $<TARGET_OBJECTS:lite_src_mid>)
|
||||
|
|
|
@ -153,7 +153,7 @@ if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
|
|||
if(MSLITE_ENABLE_ACL)
|
||||
include_directories(${TOP_DIR}/graphengine/inc/external)
|
||||
add_subdirectory(kernel/ascend)
|
||||
link_directories(${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH})
|
||||
link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
endif()
|
||||
|
||||
if(SUPPORT_CUDA)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
include_directories(${TOP_DIR}/graphengine/inc/external)
|
||||
|
||||
find_library(ge_graph libgraph.so ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
find_library(ge_graph libgraph.so ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
|
||||
aux_source_directory(src ACL_SRC)
|
||||
add_library(ascend_kernel_mid OBJECT ${ACL_SRC})
|
||||
|
|
|
@ -102,8 +102,7 @@ if(MSLITE_ENABLE_ACL)
|
|||
include(${TOP_DIR}/cmake/dependency_graphengine.cmake)
|
||||
endif()
|
||||
add_subdirectory(adapter/acl)
|
||||
link_directories(${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH} ${ASCEND_CANN_RUNTIME_PATH}
|
||||
${ASCEND_CANN_RUNTIME_NEW_PATH})
|
||||
link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||
endif()
|
||||
|
||||
file(GLOB CXX_API_SRCS
|
||||
|
|
Loading…
Reference in New Issue