CMakeLists.txt 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
message(STATUS "use ${x86_kernels}")
message(STATUS "use ${ops_lite}")

if(WITH_PYTHON)
  cc_library(bind_executor_lite SRCS executor_lite.cc DEPS pybind framework_proto)
  set(PYBIND_DEPS pybind python proto_desc memory executor async_executor fleet_wrapper nccl_wrapper prune
    feed_fetch_method pass_builder parallel_executor profiler layer scope_pool bind_executor_lite cxx_api_lite scope_lite ${ops_lite} ${host_kernels} ${x86_kernels} mir_passes kernel_lite op_lite optimizer_lite 
    tracer analysis_predictor imperative_profiler nccl_context)
endif(WITH_PYTHON)

F
flame 已提交
11

S
sneaxiy 已提交
12 13 14
if(WITH_PYTHON)
  list(APPEND PYBIND_DEPS py_func_op)
endif()
D
dongdaxiang 已提交
15
set(PYBIND_SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc reader_py.cc async_executor_py.cc fleet_wrapper_py.cc nccl_wrapper_py.cc data_set_py.cc imperative.cc ir.cc inference_api.cc)
16

17
if(WITH_PYTHON)
18 19
  if(WITH_AMD_GPU)
    hip_library(paddle_pybind SHARED
D
dzhwinter 已提交
20
      SRCS ${PYBIND_SRCS}
S
sabreshao 已提交
21 22
      DEPS ARCHIVE_START ${PYBIND_DEPS}
      ${GLOB_OP_LIB} ${GLOB_OPERATOR_DEPS} ARCHIVE_END)
23 24
  else()
    cc_library(paddle_pybind SHARED
D
dzhwinter 已提交
25
      SRCS ${PYBIND_SRCS}
D
dzhwinter 已提交
26
      DEPS ${PYBIND_DEPS}
W
Wu Yi 已提交
27
      ${GLOB_OP_LIB} ${GLOB_OPERATOR_DEPS})
T
Tao Luo 已提交
28
    if(NOT APPLE AND NOT WIN32)
29
      target_link_libraries(paddle_pybind rt)
T
Tao Luo 已提交
30
    endif(NOT APPLE AND NOT WIN32)
31
  endif(WITH_AMD_GPU)
32

P
peizhilin 已提交
33 34
  get_property (os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
  target_link_libraries(paddle_pybind ${os_dependency_modules})
P
peizhilin 已提交
35

36
endif(WITH_PYTHON)