diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed757bd1b..804fe43592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ include(system) include(simd) ###################### Configurations ############################ -option(WITH_DSO "Compile PaddlePaddle with dynamic linked libraries" ON) +option(WITH_DSO "Compile PaddlePaddle with dynamic linked libraries" OFF) option(WITH_GPU "Compile PaddlePaddle with gpu" ${CUDA_FOUND}) option(WITH_DOUBLE "Compile PaddlePaddle with double precision, otherwise use single precision" OFF) option(WITH_AVX "Compile PaddlePaddle with avx intrinsics" ${AVX_FOUND}) diff --git a/cmake/util.cmake b/cmake/util.cmake index a19bf2a799..a6cb74853e 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -120,6 +120,11 @@ function(link_paddle_exe TARGET_NAME) target_link_libraries(${TARGET_NAME} rt) endif() endif() + + if(NOT WITH_DSO) + target_link_libraries(${TARGET_NAME} ${WARPCTC_LIBRARIES}) + endif() + add_dependencies(${TARGET_NAME} ${external_project_dependencies}) endfunction()