diff --git a/cmake/external/dgc.cmake b/cmake/external/dgc.cmake index 199ca88b47754638d5e93043e078d552261dc088..a58b8c68d7716a901db1907af64c4a344a24cfc6 100644 --- a/cmake/external/dgc.cmake +++ b/cmake/external/dgc.cmake @@ -34,7 +34,7 @@ ExternalProject_Add( BUILD_IN_SOURCE 1 ) -ADD_LIBRARY(dgc SHARED IMPORTED GLOBAL) +ADD_LIBRARY(dgc STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET dgc PROPERTY IMPORTED_LOCATION ${DGC_LIBRARIES}) ADD_DEPENDENCIES(dgc extern_dgc) diff --git a/paddle/fluid/framework/details/CMakeLists.txt b/paddle/fluid/framework/details/CMakeLists.txt index d4939779a2401c9828e0478f5f5de780907c767e..f1ce744a93b73aa5f00554f93796663c8a698e80 100644 --- a/paddle/fluid/framework/details/CMakeLists.txt +++ b/paddle/fluid/framework/details/CMakeLists.txt @@ -25,8 +25,12 @@ if(WITH_DISTRIBUTE) endif() if(WITH_GPU) + set(dgc_deps "") + if(NOT WIN32) + set(dgc_deps dgc) + endif() nv_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory - dynload_cuda variable_visitor dgc) + dynload_cuda variable_visitor ${dgc_deps}) nv_library(fused_all_reduce_op_handle SRCS fused_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory dynload_cuda variable_visitor) if(WITH_DISTRIBUTE) diff --git a/paddle/fluid/platform/CMakeLists.txt b/paddle/fluid/platform/CMakeLists.txt index c3db59563f3ae77acd860216b34d2cfb4f8b6560..f889e2e9658eecb4c1931390122fc8b7915bc303 100644 --- a/paddle/fluid/platform/CMakeLists.txt +++ b/paddle/fluid/platform/CMakeLists.txt @@ -44,9 +44,12 @@ add_subdirectory(dynload) cc_library(cpu_helper SRCS cpu_helper.cc DEPS cblas enforce) cc_test(cpu_helper_test SRCS cpu_helper_test.cc DEPS cpu_helper) +set(dgc_deps "") IF(WITH_GPU) set(GPU_CTX_DEPS dynload_cuda dynamic_loader) - set(dgc_deps dgc) + if(NOT WIN32) + set(dgc_deps dgc) + endif() ELSE() set(dgc_deps) ENDIF()