From df1f2b5d510bf692bfcf45d03f5114868faba536 Mon Sep 17 00:00:00 2001 From: RedContritio Date: Sun, 11 Jun 2023 16:56:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=93?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E7=BC=96=E8=AF=91=E3=80=91add=20pslib,=20psl?= =?UTF-8?q?ib=5Fbrpc=20cache=20(#54466)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add pslib cache * fix bug --- cmake/external/pslib.cmake | 13 ++++++++++--- cmake/external/pslib_brpc.cmake | 10 +++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cmake/external/pslib.cmake b/cmake/external/pslib.cmake index d7de1aae860..d361a8c3c90 100644 --- a/cmake/external/pslib.cmake +++ b/cmake/external/pslib.cmake @@ -27,15 +27,18 @@ if((NOT DEFINED PSLIB_VER) OR (NOT DEFINED PSLIB_URL)) set(PSLIB_URL "https://pslib.bj.bcebos.com/pslib.tar.gz" CACHE STRING "" FORCE) + set(PSLIB_SUBDIR "pslib") else() set(PSLIB_URL "https://pslib.bj.bcebos.com/pslib_3631b2/pslib.tar.gz" CACHE STRING "" FORCE) + set(PSLIB_SUBDIR "pslib_3631b2") endif() endif() + message(STATUS "PSLIB_NAME: ${PSLIB_NAME}, PSLIB_URL: ${PSLIB_URL}") set(PSLIB_PREFIX_DIR "${THIRD_PARTY_PATH}/pslib") -set(PSLIB_DOWNLOAD_DIR "${PSLIB_PREFIX_DIR}/src/${PSLIB_PROJECT}") +set(PSLIB_SOURCE_DIR "${PSLIB_PREFIX_DIR}/src/${PSLIB_PROJECT}") set(PSLIB_DST_DIR "pslib") set(PSLIB_INSTALL_ROOT "${THIRD_PARTY_PATH}/install") set(PSLIB_INSTALL_DIR ${PSLIB_INSTALL_ROOT}/${PSLIB_DST_DIR}) @@ -44,6 +47,7 @@ set(PSLIB_INC_DIR ${PSLIB_ROOT}/include) set(PSLIB_LIB_DIR ${PSLIB_ROOT}/lib) set(PSLIB_LIB ${PSLIB_LIB_DIR}/libps.so) set(JVM_LIB ${PSLIB_LIB_DIR}/libjvm.so) +set(PSLIB_DOWNLOAD_DIR "${PADDLE_SOURCE_DIR}/third_party/${PSLIB_SUBDIR}") set(PSLIB_VERSION_PY ${PSLIB_DOWNLOAD_DIR}/pslib/version.py) set(PSLIB_IOMP_LIB ${PSLIB_LIB_DIR}/libiomp5.so) #todo what is this set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${PSLIB_ROOT}/lib") @@ -61,8 +65,11 @@ ExternalProject_Add( ${EXTERNAL_PROJECT_LOG_ARGS} PREFIX ${PSLIB_PREFIX_DIR} DOWNLOAD_DIR ${PSLIB_DOWNLOAD_DIR} - DOWNLOAD_COMMAND wget --no-check-certificate ${PSLIB_URL} -c -q -O - ${PSLIB_NAME}.tar.gz && tar zxvf ${PSLIB_NAME}.tar.gz + DOWNLOAD_COMMAND + COMMAND wget --no-check-certificate ${PSLIB_URL} -c -q -O ${PSLIB_NAME}.tar.gz + && tar zxvf ${PSLIB_NAME}.tar.gz -C ${PSLIB_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy "${PSLIB_DOWNLOAD_DIR}/CMakeLists.txt" + "${PSLIB_SOURCE_DIR}" DOWNLOAD_NO_PROGRESS 1 UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PSLIB_INSTALL_ROOT} diff --git a/cmake/external/pslib_brpc.cmake b/cmake/external/pslib_brpc.cmake index eef91052a40..f604773f7ee 100644 --- a/cmake/external/pslib_brpc.cmake +++ b/cmake/external/pslib_brpc.cmake @@ -31,8 +31,7 @@ message( STATUS "PSLIB_BRPC_NAME: ${PSLIB_BRPC_NAME}, PSLIB_BRPC_URL: ${PSLIB_BRPC_URL}") set(PSLIB_BRPC_PREFIX_DIR "${THIRD_PARTY_PATH}/pslib_brpc") -set(PSLIB_BRPC_DOWNLOAD_DIR - "${PSLIB_BRPC_PREFIX_DIR}/src/${PSLIB_BRPC_PROJECT}") +set(PSLIB_BRPC_SOURCE_DIR "${PSLIB_PREFIX_DIR}/src/${PSLIB_BRPC_PROJECT}") set(PSLIB_BRPC_DST_DIR "pslib_brpc") set(PSLIB_BRPC_INSTALL_ROOT "${THIRD_PARTY_PATH}/install") set(PSLIB_BRPC_INSTALL_DIR ${PSLIB_BRPC_INSTALL_ROOT}/${PSLIB_BRPC_DST_DIR}) @@ -42,6 +41,7 @@ set(PSLIB_BRPC_LIB_DIR ${PSLIB_BRPC_ROOT}/lib) set(PSLIB_BRPC_LIB ${PSLIB_BRPC_LIB_DIR}/libbrpc.a) set(PSLIB_BRPC_IOMP_LIB ${PSLIB_BRPC_LIB_DIR}/libiomp5.so) #todo what is this set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${PSLIB_BRPC_ROOT}/lib") +set(PSLIB_BRPC_DOWNLOAD_DIR "${PADDLE_DOWLOAD_DIR}/third_party/pslib_brpc") include_directories(${PSLIB_BRPC_INC_DIR}) @@ -57,8 +57,12 @@ ExternalProject_Add( PREFIX ${PSLIB_BRPC_PREFIX_DIR} DOWNLOAD_DIR ${PSLIB_BRPC_DOWNLOAD_DIR} DOWNLOAD_COMMAND + COMMAND wget --no-check-certificate ${PSLIB_BRPC_URL} -c -q -O - ${PSLIB_BRPC_NAME}.tar.gz && tar zxvf ${PSLIB_BRPC_NAME}.tar.gz + ${PSLIB_BRPC_NAME}.tar.gz && tar zxvf ${PSLIB_BRPC_NAME}.tar.gz -C + ${PSLIB_BRPC_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy "${PSLIB_BRPC_DOWNLOAD_DIR}/CMakeLists.txt" + "${PSLIB_BRPC_SOURCE_DIR}" DOWNLOAD_NO_PROGRESS 1 UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PSLIB_BRPC_INSTALL_ROOT} -- GitLab