From 4588892aeb45e745625ba74ef5cb23d717fd450e Mon Sep 17 00:00:00 2001 From: XiaociZhang Date: Wed, 28 Jun 2023 10:46:10 +0800 Subject: [PATCH] [XPU] fix compile issue for XPTI (#54800) * [XPU] fix compile issue for XPTI * bugfix * bugfix --- CMakeLists.txt | 8 ++++++++ cmake/external/xpu.cmake | 2 +- tools/xpu/get_xpti_dependence.sh | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fed539e51ec..a97a83c025a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -429,6 +429,14 @@ if(NOT WITH_XPU AND WITH_XPU_XFT) CACHE STRING "Enable WITH_XPU when compiling with WITH_XPU_XFT" FORCE) endif() +if(NOT WITH_XPU AND WITH_XPTI) + message( + WARNING "Disable XPTI when compiling without XPU. Force WITH_XPTI=OFF.") + set(WITH_XPTI + OFF + CACHE STRING "Disable XPTI when compiling without XPU" FORCE) +endif() + if(NOT WITH_XPU AND WITH_XPU_BKCL) message( WARNING "Disable BKCL when compiling without XPU. Force WITH_XPU_BKCL=OFF.") diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index cd2a6734a84..c837631fbd5 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -137,7 +137,7 @@ ExternalProject_Add( pack_paddle_depence.sh ${XPU_XRE_URL} ${XPU_XRE_DIR_NAME} ${XPU_XDNN_URL} ${XPU_XDNN_DIR_NAME} ${XPU_XCCL_URL} ${XPU_XCCL_DIR_NAME} && wget ${XPU_XFT_GET_DEPENCE_URL} && bash get_xft_dependence.sh ${XPU_XFT_URL} - ${XPU_XFT_DIR_NAME} [ -n "$WITH_XPTI" ] && bash + ${XPU_XFT_DIR_NAME} && bash ${CMAKE_SOURCE_DIR}/tools/xpu/get_xpti_dependence.sh ${XPU_XPTI_URL} ${XPU_XPTI_DIR_NAME} DOWNLOAD_NO_PROGRESS 1 diff --git a/tools/xpu/get_xpti_dependence.sh b/tools/xpu/get_xpti_dependence.sh index 2ebf8c12106..95cc4a110ed 100644 --- a/tools/xpu/get_xpti_dependence.sh +++ b/tools/xpu/get_xpti_dependence.sh @@ -19,6 +19,10 @@ set -ex XPTI_URL=$1 XPTI_DIR_NAME=$2 +if ! [ -n "$WITH_XPTI" ]; then + exit 0 +fi + wget --no-check-certificate ${XPTI_URL} -c -q -O xpti.tar.gz if [[ $? -ne 0 ]]; then echo "downloading failed: ${XPTI_URL}" -- GitLab