add custom environment variable ASCEND_CUSTOM_PATH for customized Ascend software installation

This commit is contained in:
yanghaoran 2020-04-09 19:07:01 +08:00 committed by chang zherui
parent 735923c0ce
commit 99c353e696
2 changed files with 15 additions and 3 deletions

View File

@ -39,7 +39,11 @@ elseif (DEFINED ENV{D_LINK_PATH})
find_library(resource libresource.so ${GE_LIB_PATH})
else()
# Ascend mode
set(ASCEND_PATH /usr/local/Ascend)
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_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
find_library(c_sec libc_sec.so ${ASCEND_DRIVER_PATH})

View File

@ -296,7 +296,11 @@ if(ENABLE_D)
endif()
else()
MESSAGE("use system default lib")
set(ASCEND_PATH /usr/local/Ascend)
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_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
endif()
@ -500,7 +504,11 @@ add_dependencies(add_ms_lib _c_expression)
if (NOT ENABLE_GE)
if (ENABLE_D)
set(ASCEND_PATH /usr/local/Ascend)
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)
add_custom_target(add_ge_lib ALL
COMMAND cp ${MS_CCSRC_BUILD_PATH}/../../graphengine/src/common/graph/libgraph.so ${MS_LIB_PATH}