diff --git a/CMakeLists.txt b/CMakeLists.txt index 956f430ab045f836540a74b6ca838c62e47501e1..36b33e0eba6f7b66c6320801b3a40984b1a6cc24 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,12 @@ if(WITH_PROFILER) add_definitions(-DWITH_GPERFTOOLS) endif() +if(WITH_DISTRIBUTE) + if(LINUX) + set(WITH_GLOO ON CACHE STRING "Enable GLOO when compiling WITH_DISTRIBUTE=ON." FORCE) + endif() +endif() + include(ccache) # set ccache for compilation include(util) # set unittest and link libs include(version) # set PADDLE_VERSION @@ -251,12 +257,6 @@ if(WITH_AMD_GPU) include(hip) endif(WITH_AMD_GPU) -if(WITH_DISTRIBUTE) - if(LINUX) - set(WITH_GLOO ON CACHE STRING "Enable GLOO when compiling WITH_DISTRIBUTE=ON." FORCE) - endif() -endif() - if(WITH_ARM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")