diff --git a/paddle/fluid/framework/io/crypto/cipher.cc b/paddle/fluid/framework/io/crypto/cipher.cc index 316f8f9c7515ee0255a261645caa38a9807c3fc3..6a29419ffb3b8345c600f8541ca5155ba9f7bc8e 100644 --- a/paddle/fluid/framework/io/crypto/cipher.cc +++ b/paddle/fluid/framework/io/crypto/cipher.cc @@ -56,9 +56,9 @@ std::shared_ptr CipherFactory::CreateCipher( } } // namespace framework -#ifdef PADDLE_ON_INFERENCE + std::shared_ptr MakeCipher(const std::string& config_file) { return framework::CipherFactory::CreateCipher(config_file); } -#endif + } // namespace paddle diff --git a/paddle/fluid/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt index 1896be4f9216b59a2c743616c776fc5f62482dd0..fb55d5463621ec1fa4e6fb8dcbfa03a85fad51ee 100644 --- a/paddle/fluid/inference/CMakeLists.txt +++ b/paddle/fluid/inference/CMakeLists.txt @@ -76,14 +76,20 @@ set(SHARED_INFERENCE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/utils/io_utils.cc ${mkldnn_quantizer_src_file}) -# Create shared inference library defaultly -if(NOT WITH_PSCORE) - cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS} - DEPS ${fluid_modules} analysis_predictor) -else() - cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS} - DEPS ${fluid_modules} analysis_predictor fleet ps_service) -endif() +# shared inference library deps +set(SHARED_INFERENCE_DEPS ${fluid_modules} analysis_predictor) + +if (WITH_CRYPTO) + set(SHARED_INFERENCE_DEPS ${SHARED_INFERENCE_DEPS} paddle_crypto) +endif (WITH_CRYPTO) + +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) target_link_libraries(paddle_fluid_shared ${os_dependency_modules}) diff --git a/paddle/fluid/inference/api/paddle_api.h b/paddle/fluid/inference/api/paddle_api.h index 0262ab54517cf860951e1b7738ac521ef098bfde..11f362504b6f6e320a4696e0738fc88c3ea18d8c 100644 --- a/paddle/fluid/inference/api/paddle_api.h +++ b/paddle/fluid/inference/api/paddle_api.h @@ -451,9 +451,7 @@ PD_INFER_DECL std::string get_version(); PD_INFER_DECL std::string UpdateDllFlag(const char* name, const char* value); -#ifdef PADDLE_ON_INFERENCE PD_INFER_DECL std::shared_ptr MakeCipher( const std::string& config_file); -#endif } // namespace paddle