From 576f65ad489f99eb271bd36acfa1b322b18431a7 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Thu, 9 Apr 2020 19:07:01 +0800 Subject: [PATCH] add custom environment variable ASCEND_CUSTOM_PATH for customized Ascend software installation --- cmake/dependency_graphengine.cmake | 6 +++++- graphengine | 2 +- mindspore/ccsrc/CMakeLists.txt | 12 ++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cmake/dependency_graphengine.cmake b/cmake/dependency_graphengine.cmake index 2420f47736..2a90cc1458 100644 --- a/cmake/dependency_graphengine.cmake +++ b/cmake/dependency_graphengine.cmake @@ -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}) diff --git a/graphengine b/graphengine index 5369646b48..5bd0dc1ed5 160000 --- a/graphengine +++ b/graphengine @@ -1 +1 @@ -Subproject commit 5369646b489114b380a7b5208ddd6e632acb447f +Subproject commit 5bd0dc1ed59a9ec4ea6a602bf1385c59d845f922 diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index 1d104148c3..c49c962bdd 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -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}