未验证 提交 10a8f3e5 编写于 作者: Z Zhang Jun 提交者: GitHub

fix bug on compiling inference shared lib with crypto;test=develop (#30269)

* fix bug on compiling inference shared lib with crypto;test=develop

* fix cmake bug when build inference lib using -DWITH_CRYPTO=OFF

* update cmake

* remove unnecessary enforce message
上级 28e156c2
...@@ -56,9 +56,9 @@ std::shared_ptr<Cipher> CipherFactory::CreateCipher( ...@@ -56,9 +56,9 @@ std::shared_ptr<Cipher> CipherFactory::CreateCipher(
} }
} // namespace framework } // namespace framework
#ifdef PADDLE_ON_INFERENCE
std::shared_ptr<framework::Cipher> MakeCipher(const std::string& config_file) { std::shared_ptr<framework::Cipher> MakeCipher(const std::string& config_file) {
return framework::CipherFactory::CreateCipher(config_file); return framework::CipherFactory::CreateCipher(config_file);
} }
#endif
} // namespace paddle } // namespace paddle
...@@ -76,14 +76,20 @@ set(SHARED_INFERENCE_SRCS ...@@ -76,14 +76,20 @@ set(SHARED_INFERENCE_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/utils/io_utils.cc ${CMAKE_CURRENT_SOURCE_DIR}/utils/io_utils.cc
${mkldnn_quantizer_src_file}) ${mkldnn_quantizer_src_file})
# Create shared inference library defaultly # shared inference library deps
if(NOT WITH_PSCORE) set(SHARED_INFERENCE_DEPS ${fluid_modules} analysis_predictor)
cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS}
DEPS ${fluid_modules} analysis_predictor) if (WITH_CRYPTO)
else() set(SHARED_INFERENCE_DEPS ${SHARED_INFERENCE_DEPS} paddle_crypto)
cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS} endif (WITH_CRYPTO)
DEPS ${fluid_modules} analysis_predictor fleet ps_service)
endif() if (WITH_PSCORE)
set(SHARED_INFERENCE_DEPS ${SHARED_INFERENCE_DEPS} fleet ps_service)
endif ()
# Create shared inference library
cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS}
DEPS ${SHARED_INFERENCE_DEPS})
get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES) get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
target_link_libraries(paddle_fluid_shared ${os_dependency_modules}) target_link_libraries(paddle_fluid_shared ${os_dependency_modules})
......
...@@ -451,9 +451,7 @@ PD_INFER_DECL std::string get_version(); ...@@ -451,9 +451,7 @@ PD_INFER_DECL std::string get_version();
PD_INFER_DECL std::string UpdateDllFlag(const char* name, const char* value); PD_INFER_DECL std::string UpdateDllFlag(const char* name, const char* value);
#ifdef PADDLE_ON_INFERENCE
PD_INFER_DECL std::shared_ptr<framework::Cipher> MakeCipher( PD_INFER_DECL std::shared_ptr<framework::Cipher> MakeCipher(
const std::string& config_file); const std::string& config_file);
#endif
} // namespace paddle } // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册