From 7a06fc7a9981945e6e88cb83564daa72b5f7663d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Thu, 13 Feb 2020 09:25:01 +0800 Subject: [PATCH] support dynamic cuda libs, test=release/1.7 (#22419) * update external lite, test=develop * switch WITH_TESTING to OFF, test=develop --- cmake/external/lite.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/external/lite.cmake b/cmake/external/lite.cmake index 0ce9d8203a6..6c837c97089 100644 --- a/cmake/external/lite.cmake +++ b/cmake/external/lite.cmake @@ -25,7 +25,7 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) set(LITE_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lite) # No quotes, so cmake can resolve it as a command with arguments. - set(LITE_BUILD_COMMAND $(MAKE) -j) + set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j) set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON -DLITE_WITH_CUDA=${WITH_GPU} -DWITH_MKLDNN=OFF @@ -34,9 +34,10 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) -DWITH_LITE=OFF -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF - -DWITH_TESTING=ON + -DWITH_TESTING=OFF -DLITE_BUILD_EXTRA=ON -DCUDNN_ROOT=${CUDNN_ROOT} + -DLITE_WITH_STATIC_CUDA=OFF -DLITE_WITH_ARM=OFF) ExternalProject_Add( @@ -74,7 +75,7 @@ include_directories(${LITE_SOURCE_DIR}) include_directories(${LITE_BINARY_DIR}) function(external_lite_static_libs alias path) - add_library(${alias} STATIC IMPORTED GLOBAL) + add_library(${alias} SHARED IMPORTED GLOBAL) SET_PROPERTY(TARGET ${alias} PROPERTY IMPORTED_LOCATION ${path}) if (LITE_PROJECT) @@ -82,6 +83,6 @@ function(external_lite_static_libs alias path) endif() endfunction() -external_lite_static_libs(lite_full_static ${LITE_BINARY_DIR}/lite/api/libapi_full_static.a) +external_lite_static_libs(lite_full_static ${LITE_BINARY_DIR}/inference_lite_lib/cxx/lib/libpaddle_full_api_shared.so) add_definitions(-DPADDLE_WITH_LITE) -- GitLab