setup.py.in 2.0 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"]

T
tensor-tang 已提交
26 27 28 29 30 31 32
mkl_shared_libs='${MKL_SHARED_LIBS}'

mkl_libs = []
if mkl_shared_libs != '':
  mkl_libs += mkl_shared_libs.split(';')
print mkl_libs

33
setup(name='paddlepaddle',
Z
zhangjinchao01 已提交
34 35
      version='${PADDLE_VERSION}',
      description='Parallel Distributed Deep Learning',
36
      install_requires=setup_requires,
L
Luo Tao 已提交
37
      packages=packages,
38 39 40 41
      package_data={
        'paddle.v2.master': ['libpaddle_master.so'],
        'paddle.v2.framework': ['core.so'],
        'py_paddle':['*.py','_swig_paddle.so']
42
      },
Z
zhangjinchao01 已提交
43
      package_dir={
44 45 46
          '': '${CMAKE_CURRENT_SOURCE_DIR}',
          # The paddle.v2.framework.proto will be generated while compiling.
          # So that package points to other directory.
47 48
          'paddle.v2.framework.proto': '${PADDLE_BINARY_DIR}/paddle/framework',
          'py_paddle': '${PADDLE_SOURCE_DIR}/paddle/py_paddle'
49
      },
50
      scripts=['${PADDLE_BINARY_DIR}/paddle/scripts/paddle'],
51 52
      distclass=BinaryDistribution,
      data_files=[('/usr/local/opt/paddle/bin',
53 54 55
                       ['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
                        '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
                        '${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
T
tensor-tang 已提交
56 57
                        '${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main']),
                  ('/usr/local/opt/paddle/lib', mkl_libs)]
Z
zhangjinchao01 已提交
58
)