From ba6f645edcc4985022f0ab6efa421743e96b9252 Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Mon, 29 Nov 2021 11:40:09 +0800 Subject: [PATCH] unity variable name in third_party cmake files (#37590) --- cmake/external/brpc.cmake | 4 ++-- cmake/external/cinn.cmake | 4 ++-- cmake/external/dirent.cmake | 9 ++++----- cmake/external/dlpack.cmake | 6 +++--- cmake/external/lapack.cmake | 2 -- cmake/external/leveldb.cmake | 8 ++++---- cmake/external/libmct.cmake | 6 +++--- cmake/external/libxsmm.cmake | 4 ++-- cmake/external/lite.cmake | 10 +++++----- cmake/external/mklml.cmake | 2 +- cmake/external/pslib.cmake | 6 +++--- cmake/external/pslib_brpc.cmake | 6 +++--- cmake/external/rocksdb.cmake | 10 +++++----- cmake/external/snappy.cmake | 4 ++-- cmake/external/xpu.cmake | 6 +++--- 15 files changed, 42 insertions(+), 45 deletions(-) diff --git a/cmake/external/brpc.cmake b/cmake/external/brpc.cmake index c782da81652..93bd26655d8 100644 --- a/cmake/external/brpc.cmake +++ b/cmake/external/brpc.cmake @@ -25,7 +25,7 @@ SET_PROPERTY(TARGET ssl PROPERTY IMPORTED_LOCATION ${OPENSSL_SSL_LIBRARY}) ADD_LIBRARY(crypto SHARED IMPORTED GLOBAL) SET_PROPERTY(TARGET crypto PROPERTY IMPORTED_LOCATION ${OPENSSL_CRYPTO_LIBRARY}) -SET(BRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/brpc) +SET(BRPC_PREFIX_DIR ${THIRD_PARTY_PATH}/brpc) SET(BRPC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/brpc) SET(BRPC_INCLUDE_DIR "${BRPC_INSTALL_DIR}/include" CACHE PATH "brpc include directory." FORCE) SET(BRPC_LIBRARIES "${BRPC_INSTALL_DIR}/lib/libbrpc.a" CACHE FILEPATH "brpc library." FORCE) @@ -42,7 +42,7 @@ ExternalProject_Add( # TODO(gongwb): change to de newst repo when they changed GIT_REPOSITORY "https://github.com/wangjiawei04/brpc" GIT_TAG "e203afb794caf027da0f1e0776443e7d20c0c28e" - PREFIX ${BRPC_SOURCES_DIR} + PREFIX ${BRPC_PREFIX_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 85ae5173b71..581a5f93768 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -25,7 +25,7 @@ add_definitions(-w) # Build CINN from Git External Project ###################################### include(ExternalProject) -set(CINN_SOURCE_DIR ${THIRD_PARTY_PATH}/CINN) +set(CINN_PREFIX_DIR ${THIRD_PARTY_PATH}/CINN) # TODO(zhhsplendid): Modify git tag after we have release tag set(CINN_GIT_TAG develop) set(CINN_OPTIONAL_ARGS -DPY_VERSION=${PY_VERSION} @@ -42,7 +42,7 @@ ExternalProject_Add( ${EXTERNAL_PROJECT_LOG_ARGS} GIT_REPOSITORY "${GIT_URL}/PaddlePaddle/CINN.git" GIT_TAG ${CINN_GIT_TAG} - PREFIX ${CINN_SOURCE_DIR} + PREFIX ${CINN_PREFIX_DIR} BUILD_COMMAND ${CINN_BUILD_COMMAND} INSTALL_COMMAND "" CMAKE_ARGS ${CINN_OPTIONAL_ARGS}) diff --git a/cmake/external/dirent.cmake b/cmake/external/dirent.cmake index 45c9c7c2d68..59caa437415 100644 --- a/cmake/external/dirent.cmake +++ b/cmake/external/dirent.cmake @@ -18,8 +18,7 @@ INCLUDE (ExternalProject) SET(DIRENT_PREFIX_DIR ${THIRD_PARTY_PATH}/dirent) -SET(DIRENT_SOURCE_DIR ${THIRD_PARTY_PATH}/dirent/src/extern_dirent) -SET(DIRENT_INCLUDE_DIR ${DIRENT_SOURCE_DIR}/include) +SET(DIRENT_INCLUDE_DIR ${THIRD_PARTY_PATH}/dirent/src/extern_dirent/include) include_directories(${DIRENT_INCLUDE_DIR}) @@ -30,9 +29,9 @@ ExternalProject_Add( extern_dirent ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${DIRENT_REPOSITORY} - GIT_TAG ${DIRENT_TAG} - PREFIX ${DIRENT_PREFIX_DIR} + GIT_REPOSITORY ${DIRENT_REPOSITORY} + GIT_TAG ${DIRENT_TAG} + PREFIX ${DIRENT_PREFIX_DIR} UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/external/dlpack.cmake b/cmake/external/dlpack.cmake index 60a4ecb0bf9..1aeea752e66 100644 --- a/cmake/external/dlpack.cmake +++ b/cmake/external/dlpack.cmake @@ -26,9 +26,9 @@ ExternalProject_Add( extern_dlpack ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${DLPACK_REPOSITORY} - GIT_TAG ${DLPACK_TAG} - PREFIX ${DLPACK_PREFIX_DIR} + GIT_REPOSITORY ${DLPACK_REPOSITORY} + GIT_TAG ${DLPACK_TAG} + PREFIX ${DLPACK_PREFIX_DIR} UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/external/lapack.cmake b/cmake/external/lapack.cmake index c28c31c906a..4cca61681c6 100644 --- a/cmake/external/lapack.cmake +++ b/cmake/external/lapack.cmake @@ -17,7 +17,6 @@ INCLUDE (ExternalProject) SET(LAPACK_PREFIX_DIR ${THIRD_PARTY_PATH}/lapack) SET(LAPACK_SOURCE_DIR ${THIRD_PARTY_PATH}/lapack/src/extern_lapack) SET(LAPACK_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lapack) -SET(LAPACK_INCLUDE_DIR ${LAPACK_SOURCE_DIR}) SET(LAPACK_LIB_DIR ${LAPACK_INSTALL_DIR}/lib) # Note(zhouwei): lapack need fortan compiler which many machines don't have, so use precompiled library. @@ -57,7 +56,6 @@ ExternalProject_Add( URL ${LAPACK_URL} URL_MD5 ${LAPACK_URL_MD5} PREFIX ${LAPACK_PREFIX_DIR} - DOWNLOAD_DIR ${LAPACK_SOURCE_DIR} DOWNLOAD_NO_PROGRESS 1 PATCH_COMMAND "" UPDATE_COMMAND "" diff --git a/cmake/external/leveldb.cmake b/cmake/external/leveldb.cmake index c36f49d3bd3..65a21a87dbd 100644 --- a/cmake/external/leveldb.cmake +++ b/cmake/external/leveldb.cmake @@ -14,7 +14,7 @@ INCLUDE(ExternalProject) -SET(LEVELDB_SOURCES_DIR ${THIRD_PARTY_PATH}/leveldb) +SET(LEVELDB_PREFIX_DIR ${THIRD_PARTY_PATH}/leveldb) SET(LEVELDB_INSTALL_DIR ${THIRD_PARTY_PATH}/install/leveldb) SET(LEVELDB_INCLUDE_DIR "${LEVELDB_INSTALL_DIR}/include" CACHE PATH "leveldb include directory." FORCE) SET(LEVELDB_LIBRARIES "${LEVELDB_INSTALL_DIR}/lib/libleveldb.a" CACHE FILEPATH "leveldb library." FORCE) @@ -23,15 +23,15 @@ INCLUDE_DIRECTORIES(${LEVELDB_INCLUDE_DIR}) ExternalProject_Add( extern_leveldb ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${LEVELDB_SOURCES_DIR} + PREFIX ${LEVELDB_PREFIX_DIR} GIT_REPOSITORY "https://github.com/google/leveldb" GIT_TAG v1.18 UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND CXXFLAGS=-fPIC make -j ${NUM_OF_PROCESSOR} libleveldb.a INSTALL_COMMAND mkdir -p ${LEVELDB_INSTALL_DIR}/lib/ - && cp ${LEVELDB_SOURCES_DIR}/src/extern_leveldb/libleveldb.a ${LEVELDB_LIBRARIES} - && cp -r ${LEVELDB_SOURCES_DIR}/src/extern_leveldb/include ${LEVELDB_INSTALL_DIR}/ + && cp ${LEVELDB_PREFIX_DIR}/src/extern_leveldb/libleveldb.a ${LEVELDB_LIBRARIES} + && cp -r ${LEVELDB_PREFIX_DIR}/src/extern_leveldb/include ${LEVELDB_INSTALL_DIR}/ BUILD_IN_SOURCE 1 BUILD_BYPRODUCTS ${LEVELDB_LIBRARIES} ) diff --git a/cmake/external/libmct.cmake b/cmake/external/libmct.cmake index d318bc7d0f3..c002def29c7 100644 --- a/cmake/external/libmct.cmake +++ b/cmake/external/libmct.cmake @@ -22,8 +22,8 @@ IF((NOT DEFINED LIBMCT_VER) OR (NOT DEFINED LIBMCT_URL)) SET(LIBMCT_URL "https://pslib.bj.bcebos.com/libmct.tar.gz" CACHE STRING "" FORCE) ENDIF() MESSAGE(STATUS "LIBMCT_NAME: ${LIBMCT_NAME}, LIBMCT_URL: ${LIBMCT_URL}") -SET(LIBMCT_SOURCE_DIR "${THIRD_PARTY_PATH}/libmct") -SET(LIBMCT_DOWNLOAD_DIR "${LIBMCT_SOURCE_DIR}/src/${LIBMCT_PROJECT}") +SET(LIBMCT_PREFIX_DIR "${THIRD_PARTY_PATH}/libmct") +SET(LIBMCT_DOWNLOAD_DIR "${LIBMCT_PREFIX_DIR}/src/${LIBMCT_PROJECT}") SET(LIBMCT_DST_DIR "libmct") SET(LIBMCT_INSTALL_ROOT "${THIRD_PARTY_PATH}/install") SET(LIBMCT_INSTALL_DIR ${LIBMCT_INSTALL_ROOT}/${LIBMCT_DST_DIR}) @@ -42,7 +42,7 @@ FILE(WRITE ${LIBMCT_DOWNLOAD_DIR}/CMakeLists.txt ExternalProject_Add( ${LIBMCT_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${LIBMCT_SOURCE_DIR} + PREFIX ${LIBMCT_PREFIX_DIR} DOWNLOAD_DIR ${LIBMCT_DOWNLOAD_DIR} DOWNLOAD_COMMAND wget --no-check-certificate ${LIBMCT_URL} -c -q -O ${LIBMCT_NAME}.tar.gz && tar zxvf ${LIBMCT_NAME}.tar.gz diff --git a/cmake/external/libxsmm.cmake b/cmake/external/libxsmm.cmake index fae8154eb1c..da7cb696ef8 100644 --- a/cmake/external/libxsmm.cmake +++ b/cmake/external/libxsmm.cmake @@ -14,7 +14,7 @@ INCLUDE (ExternalProject) -SET(LIBXSMM_SOURCES_DIR ${THIRD_PARTY_PATH}/libxsmm) +SET(LIBXSMM_PREFIX_DIR ${THIRD_PARTY_PATH}/libxsmm) SET(LIBXSMM_INSTALL_DIR ${THIRD_PARTY_PATH}/install/libxsmm) SET(LIBXSMM_INCLUDE_DIR "${LIBXSMM_INSTALL_DIR}/include" CACHE PATH "LIBXSMM include directory." FORCE) SET(LIBXSMM_LIBRARY_DIR "${LIBXSMM_INSTALL_DIR}/lib" CACHE PATH "LIBXSMM library directory." FORCE) @@ -26,7 +26,7 @@ ExternalProject_Add( ${SHALLOW_CLONE} GIT_REPOSITORY "${GIT_URL}/hfp/libxsmm.git" GIT_TAG "7cc03b5b342fdbc6b6d990b190671c5dbb8489a2" - PREFIX ${LIBXSMM_SOURCES_DIR} + PREFIX ${LIBXSMM_PREFIX_DIR} UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 diff --git a/cmake/external/lite.cmake b/cmake/external/lite.cmake index 097ca38be07..47bbfee5745 100644 --- a/cmake/external/lite.cmake +++ b/cmake/external/lite.cmake @@ -46,7 +46,7 @@ endif() if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) include(ExternalProject) set(LITE_PROJECT extern_lite) - set(LITE_SOURCES_DIR ${THIRD_PARTY_PATH}/lite) + set(LITE_PREFIX_DIR ${THIRD_PARTY_PATH}/lite) set(LITE_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lite) if(NOT LITE_GIT_TAG) @@ -85,8 +85,8 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ${EXTERNAL_PROJECT_LOG_ARGS} GIT_REPOSITORY "${GIT_URL}/PaddlePaddle/Paddle-Lite.git" GIT_TAG ${LITE_GIT_TAG} - PREFIX ${LITE_SOURCES_DIR} - PATCH_COMMAND mkdir -p ${LITE_SOURCES_DIR}/src/extern_lite-build/lite/gen_code && touch ${LITE_SOURCES_DIR}/src/extern_lite-build/lite/gen_code/__generated_code__.cc && sed -i "/aarch64-linux-gnu-gcc/d" ${LITE_SOURCES_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake && sed -i "/aarch64-linux-gnu-g++/d" ${LITE_SOURCES_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake + PREFIX ${LITE_PREFIX_DIR} + PATCH_COMMAND mkdir -p ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code && touch ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code/__generated_code__.cc && sed -i "/aarch64-linux-gnu-gcc/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake && sed -i "/aarch64-linux-gnu-g++/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake UPDATE_COMMAND "" BUILD_COMMAND ${LITE_BUILD_COMMAND} INSTALL_COMMAND "" @@ -132,9 +132,9 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ${EXTERNAL_PROJECT_LOG_ARGS} GIT_REPOSITORY "${GIT_URL}/PaddlePaddle/Paddle-Lite.git" GIT_TAG ${LITE_GIT_TAG} - PREFIX ${LITE_SOURCES_DIR} + PREFIX ${LITE_PREFIX_DIR} UPDATE_COMMAND "" - PATCH_COMMAND sed -i "s?NNadapter_bridges_path = os.path.abspath('..')+\"\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?NNadapter_bridges_path = os.path.abspath(\'..\')+\"\/extern_lite\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?" ${LITE_SOURCES_DIR}/src/extern_lite//lite/tools/cmake_tools/record_supported_kernel_op.py + PATCH_COMMAND sed -i "s?NNadapter_bridges_path = os.path.abspath('..')+\"\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?NNadapter_bridges_path = os.path.abspath(\'..\')+\"\/extern_lite\/lite\/kernels\/nnadapter\/bridges\/paddle_use_bridges.h\"?" ${LITE_PREFIX_DIR}/src/extern_lite//lite/tools/cmake_tools/record_supported_kernel_op.py BUILD_COMMAND ${LITE_BUILD_COMMAND} INSTALL_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 3b9a88cc6c3..a2fd2fe03c1 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -16,7 +16,7 @@ INCLUDE(ExternalProject) SET(MKLML_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mklml) SET(MKLML_INC_DIR ${MKLML_INSTALL_DIR}/include) SET(MKLML_LIB_DIR ${MKLML_INSTALL_DIR}/lib) -SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib") +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_LIB_DIR}") IF(WIN32) SET(MKLML_VER "mklml_win_2019.0.5.20190502" CACHE STRING "" FORCE) diff --git a/cmake/external/pslib.cmake b/cmake/external/pslib.cmake index 40d198b2958..47a83d905e8 100644 --- a/cmake/external/pslib.cmake +++ b/cmake/external/pslib.cmake @@ -22,8 +22,8 @@ IF((NOT DEFINED PSLIB_VER) OR (NOT DEFINED PSLIB_URL)) SET(PSLIB_URL "https://pslib.bj.bcebos.com/pslib.tar.gz" CACHE STRING "" FORCE) ENDIF() MESSAGE(STATUS "PSLIB_NAME: ${PSLIB_NAME}, PSLIB_URL: ${PSLIB_URL}") -SET(PSLIB_SOURCE_DIR "${THIRD_PARTY_PATH}/pslib") -SET(PSLIB_DOWNLOAD_DIR "${PSLIB_SOURCE_DIR}/src/${PSLIB_PROJECT}") +SET(PSLIB_PREFIX_DIR "${THIRD_PARTY_PATH}/pslib") +SET(PSLIB_DOWNLOAD_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}) @@ -46,7 +46,7 @@ FILE(WRITE ${PSLIB_DOWNLOAD_DIR}/CMakeLists.txt ExternalProject_Add( ${PSLIB_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${PSLIB_SOURCE_DIR} + 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 diff --git a/cmake/external/pslib_brpc.cmake b/cmake/external/pslib_brpc.cmake index d69c27a197b..27e2788aa21 100644 --- a/cmake/external/pslib_brpc.cmake +++ b/cmake/external/pslib_brpc.cmake @@ -22,8 +22,8 @@ IF((NOT DEFINED PSLIB_BRPC_NAME) OR (NOT DEFINED PSLIB_BRPC_URL)) SET(PSLIB_BRPC_URL "https://pslib.bj.bcebos.com/pslib_brpc.tar.gz" CACHE STRING "" FORCE) ENDIF() MESSAGE(STATUS "PSLIB_BRPC_NAME: ${PSLIB_BRPC_NAME}, PSLIB_BRPC_URL: ${PSLIB_BRPC_URL}") -SET(PSLIB_BRPC_SOURCE_DIR "${THIRD_PARTY_PATH}/pslib_brpc") -SET(PSLIB_BRPC_DOWNLOAD_DIR "${PSLIB_BRPC_SOURCE_DIR}/src/${PSLIB_BRPC_PROJECT}") +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_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}) @@ -45,7 +45,7 @@ FILE(WRITE ${PSLIB_BRPC_DOWNLOAD_DIR}/CMakeLists.txt ExternalProject_Add( ${PSLIB_BRPC_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${PSLIB_BRPC_SOURCE_DIR} + PREFIX ${PSLIB_BRPC_PREFIX_DIR} DOWNLOAD_DIR ${PSLIB_BRPC_DOWNLOAD_DIR} DOWNLOAD_COMMAND wget --no-check-certificate ${PSLIB_BRPC_URL} -c -q -O ${PSLIB_BRPC_NAME}.tar.gz && tar zxvf ${PSLIB_BRPC_NAME}.tar.gz diff --git a/cmake/external/rocksdb.cmake b/cmake/external/rocksdb.cmake index f5b85cc71a2..befbc8138fc 100644 --- a/cmake/external/rocksdb.cmake +++ b/cmake/external/rocksdb.cmake @@ -14,7 +14,7 @@ INCLUDE(ExternalProject) -SET(ROCKSDB_SOURCES_DIR ${THIRD_PARTY_PATH}/rocksdb) +SET(ROCKSDB_PREFIX_DIR ${THIRD_PARTY_PATH}/rocksdb) SET(ROCKSDB_INSTALL_DIR ${THIRD_PARTY_PATH}/install/rocksdb) SET(ROCKSDB_INCLUDE_DIR "${ROCKSDB_INSTALL_DIR}/include" CACHE PATH "rocksdb include directory." FORCE) SET(ROCKSDB_LIBRARIES "${ROCKSDB_INSTALL_DIR}/lib/librocksdb.a" CACHE FILEPATH "rocksdb library." FORCE) @@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(${ROCKSDB_INCLUDE_DIR}) ExternalProject_Add( extern_rocksdb ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${ROCKSDB_SOURCES_DIR} + PREFIX ${ROCKSDB_PREFIX_DIR} GIT_REPOSITORY "https://github.com/facebook/rocksdb" GIT_TAG v6.10.1 UPDATE_COMMAND "" @@ -34,10 +34,10 @@ ExternalProject_Add( -DWITH_GFLAGS=OFF -DCMAKE_CXX_FLAGS=${ROCKSDB_CMAKE_CXX_FLAGS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -# BUILD_BYPRODUCTS ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/librocksdb.a +# BUILD_BYPRODUCTS ${ROCKSDB_PREFIX_DIR}/src/extern_rocksdb/librocksdb.a INSTALL_COMMAND mkdir -p ${ROCKSDB_INSTALL_DIR}/lib/ - && cp ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/librocksdb.a ${ROCKSDB_LIBRARIES} - && cp -r ${ROCKSDB_SOURCES_DIR}/src/extern_rocksdb/include ${ROCKSDB_INSTALL_DIR}/ + && cp ${ROCKSDB_PREFIX_DIR}/src/extern_rocksdb/librocksdb.a ${ROCKSDB_LIBRARIES} + && cp -r ${ROCKSDB_PREFIX_DIR}/src/extern_rocksdb/include ${ROCKSDB_INSTALL_DIR}/ BUILD_IN_SOURCE 1 ) diff --git a/cmake/external/snappy.cmake b/cmake/external/snappy.cmake index fb4c1c7cc8a..42320df1397 100644 --- a/cmake/external/snappy.cmake +++ b/cmake/external/snappy.cmake @@ -16,7 +16,7 @@ include (ExternalProject) # NOTE: snappy is needed when linking with recordio -set(SNAPPY_SOURCES_DIR ${THIRD_PARTY_PATH}/snappy) +set(SNAPPY_PREFIX_DIR ${THIRD_PARTY_PATH}/snappy) set(SNAPPY_INSTALL_DIR ${THIRD_PARTY_PATH}/install/snappy) set(SNAPPY_INCLUDE_DIR "${SNAPPY_INSTALL_DIR}/include" CACHE PATH "snappy include directory." FORCE) @@ -37,7 +37,7 @@ ExternalProject_Add( extern_snappy GIT_REPOSITORY "https://github.com/google/snappy" GIT_TAG "1.1.7" - PREFIX ${SNAPPY_SOURCES_DIR} + PREFIX ${SNAPPY_PREFIX_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index c87d11ad994..0c19a17fd00 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -41,8 +41,8 @@ SET(XPU_XDNN_URL "${XPU_BASE_URL}/${XPU_XDNN_DIR_NAME}.tar.gz" CACHE STRING "" F SET(XPU_XCCL_URL "${XPU_BASE_URL_WITHOUT_DATE}/20210623/${XPU_XCCL_DIR_NAME}.tar.gz" CACHE STRING "" FORCE) SET(XPU_PACK_DEPENCE_URL "https://baidu-kunlun-public.su.bcebos.com/paddle_depence/pack_paddle_depence.sh" CACHE STRING "" FORCE) -SET(XPU_SOURCE_DIR "${THIRD_PARTY_PATH}/xpu") -SET(XPU_DOWNLOAD_DIR "${XPU_SOURCE_DIR}/src/${XPU_PROJECT}") +SET(SNAPPY_PREFIX_DIR "${THIRD_PARTY_PATH}/xpu") +SET(XPU_DOWNLOAD_DIR "${SNAPPY_PREFIX_DIR}/src/${XPU_PROJECT}") SET(XPU_INSTALL_DIR "${THIRD_PARTY_PATH}/install/xpu") SET(XPU_INC_DIR "${THIRD_PARTY_PATH}/install/xpu/include") SET(XPU_LIB_DIR "${THIRD_PARTY_PATH}/install/xpu/lib") @@ -61,7 +61,7 @@ FILE(WRITE ${XPU_DOWNLOAD_DIR}/CMakeLists.txt ExternalProject_Add( ${XPU_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${XPU_SOURCE_DIR} + PREFIX ${SNAPPY_PREFIX_DIR} DOWNLOAD_DIR ${XPU_DOWNLOAD_DIR} DOWNLOAD_COMMAND wget ${XPU_PACK_DEPENCE_URL} && bash 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} -- GitLab