setup.py.in 2.1 KB
Newer Older
T
typhoonzero 已提交
1
from setuptools import setup, Distribution, Extension
2 3 4
class BinaryDistribution(Distribution):
    def has_ext_modules(foo):
        return True
Z
zhangjinchao01 已提交
5 6 7 8 9

packages=['paddle',
          'paddle.proto',
          'paddle.trainer',
          'paddle.trainer_config_helpers',
Q
qiaolongfei 已提交
10
          'paddle.utils',
Y
Yu Yang 已提交
11 12
          'paddle.v2',
          'paddle.v2.dataset',
Y
Yancey1989 已提交
13
          'paddle.v2.reader',
H
Helin Wang 已提交
14
          'paddle.v2.master',
15 16
          'paddle.v2.plot',
          'paddle.v2.framework',
17 18
          'paddle.v2.framework.proto',
          'py_paddle']
Z
zhangjinchao01 已提交
19

20 21
with open('@PADDLE_SOURCE_DIR@/python/requirements.txt') as f:
    setup_requires = f.read().splitlines()
22 23 24 25

if '${CMAKE_SYSTEM_PROCESSOR}' not in ['arm', 'armv7-a', 'aarch64']:
    setup_requires+=["opencv-python"]

26
# the prefix is sys.prefix which should always be usr
27
paddle_bin_dir = 'opt/paddle/bin'
28 29 30
paddle_bins = ['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
               '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
               '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
31 32
               '${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main',
               '${PADDLE_BINARY_DIR}/paddle/scripts/paddle']
33

34
paddle_rt_lib_dir = 'lib'
L
Luo Tao 已提交
35 36 37
paddle_rt_libs = ['${WARPCTC_LIBRARIES}']
if '${MKL_SHARED_LIBS}'!= '':
  paddle_rt_libs += '${MKL_SHARED_LIBS}'.split(';')
T
tensor-tang 已提交
38

39
setup(name='paddlepaddle',
Z
zhangjinchao01 已提交
40 41
      version='${PADDLE_VERSION}',
      description='Parallel Distributed Deep Learning',
42
      install_requires=setup_requires,
L
Luo Tao 已提交
43
      packages=packages,
T
typhoonzero 已提交
44
      ext_modules=[Extension('_foo', ['stub.cc'])],
45 46 47 48
      package_data={
        'paddle.v2.master': ['libpaddle_master.so'],
        'paddle.v2.framework': ['core.so'],
        'py_paddle':['*.py','_swig_paddle.so']
49
      },
Z
zhangjinchao01 已提交
50
      package_dir={
51 52 53
          '': '${CMAKE_CURRENT_SOURCE_DIR}',
          # The paddle.v2.framework.proto will be generated while compiling.
          # So that package points to other directory.
54 55
          'paddle.v2.framework.proto': '${PADDLE_BINARY_DIR}/paddle/framework',
          'py_paddle': '${PADDLE_SOURCE_DIR}/paddle/py_paddle'
56
      },
57 58
      scripts=paddle_bins,
      data_files=[(paddle_rt_lib_dir, paddle_rt_libs)]
Z
zhangjinchao01 已提交
59
)