diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed757bd1bfbd23ca24445c15e7cf8e13860d26f..804fe435927f8d1ac3e483a69c5cffd06cc139d5 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 a19bf2a7998ed7772a66f6a7eb5f9e858b0e75a2..a6cb74853efc849f0384ac3ca75b3c4ffdca00c2 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()