|
|
|
@ -16,9 +16,21 @@ cc_library(paddle_fluid_api
|
|
|
|
|
DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB})
|
|
|
|
|
|
|
|
|
|
get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES)
|
|
|
|
|
get_property(cuda_modules GLOBAL PROPERTY CUDA_MODULES)
|
|
|
|
|
get_property(fluid_third_partys GLOBAL PROPERTY FLUID_THRID_PARTYS)
|
|
|
|
|
if (WIN32)
|
|
|
|
|
list(APPEND fluid_third_partys gflags glog protobuf cblas)
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
|
# paddle_fluid_origin exclude inference api interface
|
|
|
|
|
cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)
|
|
|
|
|
if(WIN32)
|
|
|
|
|
sep_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)
|
|
|
|
|
if(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
target_link_libraries(paddle_fluid_origin ${cuda_modules})
|
|
|
|
|
endif(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
else(WIN32)
|
|
|
|
|
cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
|
add_subdirectory(api)
|
|
|
|
|
|
|
|
|
@ -28,8 +40,16 @@ set(SHARED_INFERENCE_SRCS
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/api/analysis_predictor.cc
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/api/details/zero_copy_tensor.cc)
|
|
|
|
|
|
|
|
|
|
# Create static library
|
|
|
|
|
cc_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} zero_copy_tensor reset_tensor_array analysis_config paddle_pass_builder)
|
|
|
|
|
if(WIN32)
|
|
|
|
|
sep_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} zero_copy_tensor reset_tensor_array
|
|
|
|
|
analysis_config paddle_pass_builder)
|
|
|
|
|
if(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
target_link_libraries(paddle_fluid ${cuda_modules})
|
|
|
|
|
endif(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
else(WIN32)
|
|
|
|
|
cc_library(paddle_fluid DEPS ${fluid_modules} ${STATIC_INFERENCE_APIS} zero_copy_tensor reset_tensor_array
|
|
|
|
|
analysis_config paddle_pass_builder)
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
|
if(NOT APPLE)
|
|
|
|
|
# TODO(liuyiqu: Temporarily disable the link flag because it is not support on Mac.
|
|
|
|
@ -38,11 +58,20 @@ if(NOT APPLE)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Create shared library
|
|
|
|
|
cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS}
|
|
|
|
|
DEPS ${fluid_modules} paddle_fluid_api reset_tensor_array analysis_config paddle_pass_builder)
|
|
|
|
|
if(WIN32)
|
|
|
|
|
sep_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS}
|
|
|
|
|
DEPS ${fluid_modules} paddle_fluid_api reset_tensor_array analysis_config paddle_pass_builder)
|
|
|
|
|
target_link_libraries(paddle_fluid_shared shlwapi)
|
|
|
|
|
if(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
target_link_libraries(paddle_fluid_origin ${cuda_modules})
|
|
|
|
|
endif(WITH_GPU AND NOT WITH_DSO)
|
|
|
|
|
else(WIN32)
|
|
|
|
|
cc_library(paddle_fluid_shared SHARED SRCS ${SHARED_INFERENCE_SRCS}
|
|
|
|
|
DEPS ${fluid_modules} paddle_fluid_api reset_tensor_array analysis_config paddle_pass_builder)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set_target_properties(paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid)
|
|
|
|
|
if(NOT APPLE)
|
|
|
|
|
if(NOT APPLE AND NOT WIN32)
|
|
|
|
|
# TODO(liuyiqun): Temporarily disable the link flag because it is not support on Mac.
|
|
|
|
|
set(LINK_FLAGS "-Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/paddle_fluid.map")
|
|
|
|
|
set_target_properties(paddle_fluid_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
|
|
|
|
|