setup.py.in 2.1 KB
Newer Older
1 2 3 4
from setuptools import setup, Distribution
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 27 28 29 30 31 32 33
# the prefix is sys.prefix which should always be usr
paddle_bin_dir = 'local/opt/paddle/bin'
paddle_bins = ['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
               '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
               '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
               '${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main']

paddle_rt_lib_dir = 'local/lib'
T
refine  
tensor-tang 已提交
34
paddle_rt_libs = [] if '${MKL_SHARED_LIBS}'== '' else '${MKL_SHARED_LIBS}'.split(';')
T
tensor-tang 已提交
35

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