-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (44 loc) · 1.22 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
from setuptools import setup, Extension
from Cython.Build import cythonize
import os.path
_veo_path = '/opt/nec/ve/veos'
_veo_include_dir = _veo_path + '/include'
_veo_lib_dir = _veo_path + '/lib64'
_cuda_path = '/usr/local/cuda'
_cuda_include_dir = _cuda_path + '/include'
_cuda_lib_dir = _cuda_path + '/lib64'
_interdevcopy_path = '/opt/nec/interdevcopy'
_interdevcopy_include_dir = _interdevcopy_path + '/include'
ext_modules = {
'cupy-nlcpy': [
'orchespy.devicetype._transfer.cunlc',
],
}
include_dirs = {
'cupy-nlcpy': [_cuda_include_dir, _veo_include_dir, _interdevcopy_include_dir, ],
}
libraries = {
'cupy-nlcpy': ['veo', 'cudart', ],
}
library_dirs = {
'cupy-nlcpy': [_cuda_lib_dir, _veo_lib_dir, ],
}
extensions = []
for key in ext_modules:
for module in ext_modules[key]:
src = os.path.join(*module.split('.')) + '.pyx'
ext = Extension(
module,
[src, ],
libraries=libraries[key],
library_dirs=library_dirs[key],
include_dirs=include_dirs[key],
)
extensions.append(ext)
setup(
ext_modules=cythonize(
extensions,
compiler_directives={'embedsignature': True},
language_level=3
),
)