diff --git a/cmake/external/gloo.cmake b/cmake/external/gloo.cmake index 337e326dc166fd844a938ecd936d8c4162a45573..895bc0849a2a3b57e9e7ba2576567032f07fb35b 100644 --- a/cmake/external/gloo.cmake +++ b/cmake/external/gloo.cmake @@ -14,13 +14,21 @@ INCLUDE(ExternalProject) +execute_process(COMMAND bash -c "gcc -dumpversion" OUTPUT_VARIABLE GCC_VERSION) + SET(GLOO_PROJECT "extern_gloo") IF((NOT DEFINED GLOO_VER) OR (NOT DEFINED GLOO_URL)) MESSAGE(STATUS "use pre defined download url") SET(GLOO_VER "master" CACHE STRING "" FORCE) SET(GLOO_NAME "gloo" CACHE STRING "" FORCE) - SET(GLOO_URL "https://pslib.bj.bcebos.com/gloo.tar.gz" CACHE STRING "" FORCE) + + if(${GCC_VERSION} VERSION_EQUAL "8.2.0") + SET(GLOO_URL "https://fleet.bj.bcebos.com/gloo/gloo.tar.gz.gcc8" CACHE STRING "" FORCE) + else() + SET(GLOO_URL "https://fleet.bj.bcebos.com/gloo/gloo.tar.gz.gcc482" CACHE STRING "" FORCE) + endif() ENDIF() + MESSAGE(STATUS "GLOO_NAME: ${GLOO_NAME}, GLOO_URL: ${GLOO_URL}") SET(GLOO_SOURCE_DIR "${THIRD_PARTY_PATH}/gloo") SET(GLOO_DOWNLOAD_DIR "${GLOO_SOURCE_DIR}/src/${GLOO_PROJECT}") diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index be536b2eefbb123d73ec6f8d17c3d22e5aca2cfc..5b2c0f51cd745ff8b39e7757a9832955ec6aeb5a 100644 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -263,10 +263,6 @@ if(WITH_PSLIB) endif() endif(WITH_PSLIB) -if(NOT WIN32 AND NOT APPLE) - include(external/gloo) - list(APPEND third_party_deps extern_gloo) -endif() if(WITH_BOX_PS) include(external/box_ps) @@ -274,6 +270,11 @@ if(WITH_BOX_PS) endif(WITH_BOX_PS) if(WITH_DISTRIBUTE) + if(WITH_GLOO) + include(external/gloo) + list(APPEND third_party_deps extern_gloo) + endif() + if(WITH_GRPC) list(APPEND third_party_deps extern_grpc) else() diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 4efcec7a41ded9f76fedce534ff95224935cc01c..4bd93da72ef682cedf585871dc764da2a4da32c5 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -195,6 +195,12 @@ function cmake_base() { distibuted_flag=${WITH_DISTRIBUTE:-OFF} grpc_flag=${WITH_GRPC:-${distibuted_flag}} + if [ "$SYSTEM" == "Darwin" ]; then + gloo_flag="OFF" + else + gloo_flag=${distibuted_flag} + fi + cat <