-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·113 lines (108 loc) · 3.68 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
from glob import glob
from platform import system
from unittest.mock import Mock
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup, find_packages
if system() == 'Windows':
# /path/to/eigen3/download
EIGEN_DIR = 'c:/vcpkg/installed/x64-windows/include/eigen3'
# 用于解决在Windows下构建时, 链接错误 error LNK2001: unresolved external symbol
build_ext.get_export_symbols = Mock(return_value=None)
else:
# /path/to/eigen3/download
EIGEN_DIR = '/usr/local/include/eigen3'
with open('README.md', 'r', encoding='utf-8') as fp:
long_description = fp.read()
extension_modules = [
# backend._utils模块
Pybind11Extension(
'classicML/backend/cc/_utils',
sorted(glob('classicML/backend/cc/_utils/*.cc')),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.activations模块
Pybind11Extension(
'classicML/backend/cc/activations',
sorted(glob('classicML/backend/cc/activations/*.cc')),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.callbacks模块
Pybind11Extension(
'classicML/backend/cc/callbacks',
sorted(glob('classicML/backend/cc/callbacks/*.cc')),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.initializers模块
Pybind11Extension(
'classicML/backend/cc/initializers',
sorted(glob('classicML/backend/cc/initializers/*.cc') + ['classicML/backend/cc/matrix_op.cc']),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.kernels模块
Pybind11Extension(
'classicML/backend/cc/kernels',
sorted(glob('classicML/backend/cc/kernels/*.cc') + ['classicML/backend/cc/matrix_op.cc']),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.losses模块
Pybind11Extension(
'classicML/backend/cc/losses',
sorted(glob('classicML/backend/cc/losses/*.cc')),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.metrics模块
Pybind11Extension(
'classicML/backend/cc/metrics',
sorted(glob('classicML/backend/cc/metrics/*.cc')),
include_dirs=[EIGEN_DIR],
language='c++',
),
# backend.ops模块
Pybind11Extension(
'classicML/backend/cc/ops',
sorted(glob('classicML/backend/cc/ops/*.cc') + ['classicML/backend/cc/matrix_op.cc']),
include_dirs=[EIGEN_DIR],
language='c++',
)
]
setup(
name='classicML',
version='0.9.1a3',
description='An easy-to-use ML framework',
long_description=long_description,
long_description_content_type='text/markdown',
author='Steve R. Sun',
author_email='s1638650145@gmail.com',
url='https://github.com/sun1638650145/classicML',
packages=find_packages(),
ext_modules=extension_modules,
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: C++',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
license='Apache Software License',
cmdclass={'build_ext': build_ext},
install_requires=[
'h5py>=3.7.0, <=3.7.0',
'matplotlib>=3.5.0, <=3.6.2',
'numpy>=1.21.0, <=1.24.0',
'packaging>=21.3, <=22.0',
'pandas>=1.3.4, <=1.5.2',
'psutil>=5.9.3, <=5.9.4',
],
python_requires='>=3.7',
)