-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
120 lines (102 loc) · 3.29 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env python
import imp
import os
import pkg_resources
import sys
from setuptools.command.build_py import build_py
from setuptools.command.install import install
from setuptools import setup
import ideep4py_setup
if sys.version_info[:3] == (3, 5, 0):
if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')):
msg = """
Chainer does not work with Python 3.5.0.
We strongly recommend to use another version of Python.
If you want to use Chainer with Python 3.5.0 at your own risk,
set CHAINER_PYTHON_350_FORCE environment variable to 1."""
print(msg)
sys.exit(1)
setup_requires = []
install_requires = [
'filelock',
'numpy>=1.9.0',
'protobuf>=3.0.0',
'six>=1.9.0',
]
cupy_require = 'cupy==3.0.0a1'
cupy_pkg = None
try:
cupy_pkg = pkg_resources.get_distribution('cupy')
except pkg_resources.DistributionNotFound:
pass
if cupy_pkg is not None:
install_requires.append(cupy_require)
print('Use %s' % cupy_require)
here = os.path.abspath(os.path.dirname(__file__))
__version__ = imp.load_source(
'_version', os.path.join(here, 'chainer', '_version.py')).__version__
class _build_py(build_py):
def run(self):
ideep4py_setup.prepare_mkldnn()
self.run_command('build_ext')
build_py.run(self)
class _install(install):
def run(self):
ideep4py_setup.prepare_mkldnn()
self.run_command('build_ext')
install.run(self)
packages = ['chainer',
'chainer.dataset',
'chainer.datasets',
'chainer.functions',
'chainer.functions.activation',
'chainer.functions.array',
'chainer.functions.connection',
'chainer.functions.evaluation',
'chainer.functions.loss',
'chainer.functions.math',
'chainer.functions.noise',
'chainer.functions.normalization',
'chainer.functions.pooling',
'chainer.functions.theano',
'chainer.functions.util',
'chainer.function_hooks',
'chainer.iterators',
'chainer.initializers',
'chainer.links',
'chainer.links.activation',
'chainer.links.caffe',
'chainer.links.caffe.protobuf3',
'chainer.links.connection',
'chainer.links.loss',
'chainer.links.model',
'chainer.links.model.vision',
'chainer.links.normalization',
'chainer.links.theano',
'chainer.optimizers',
'chainer.serializers',
'chainer.testing',
'chainer.training',
'chainer.training.extensions',
'chainer.training.triggers',
'chainer.training.updaters',
'chainer.utils']
ext_modules = ideep4py_setup.ext_modules
packages += ideep4py_setup.packages
setup(
name='chainer',
version=__version__,
description='A flexible framework of neural networks',
author='Seiya Tokui',
author_email='[email protected]',
url='https://chainer.org/',
license='MIT License',
packages=packages,
ext_modules=ext_modules,
cmdclass={'install': _install, 'build_py': _build_py},
zip_safe=False,
setup_requires=setup_requires,
install_requires=install_requires,
tests_require=['mock',
'pytest'],
)