-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
65 lines (56 loc) · 1.93 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
from distutils.core import setup, Extension
import subprocess
# Classifiers: https://pypi.python.org/pypi?%3Aaction=list_classifiers
macros = [
('SDM_USE_BITCOUNT_TABLE', None),
('SDM_ENABLE_OPENCL', None),
]
extra_compile_args = None
extra_link_args = None
libraries = None
try:
os_string = subprocess.check_output(['uname', '-s']).strip().lower()
except OSError:
os_string = None
# Python 3 fix
os_string = os_string.decode()
if os_string == 'darwin':
macros.append(('OS_OSX', None))
extra_link_args = ['-framework', 'OpenCL']
# elif os_string == 'linux':
else:
macros.append(('OS_LINUX', None))
libraries = ['OpenCL', 'pthread', 'bsd']
libsdm_ext = Extension('sdm._libsdm', [
'src/bitstring.c', 'src/address_space.c', 'src/counter.c',
'src/scanner_thread.c', 'src/scanner_opencl.c',
'src/scanner_thread2.c', 'src/scanner_opencl2.c',
'src/operations.c', 'src/lib/base64.c',
], libraries=libraries, define_macros=macros, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args)
setup(name='sdm',
version='1.6.0',
license='GPLv2',
author='Marcelo Salhab Brogliato',
author_email='msbrogli@vialink.com.br',
description='Sparse Distributed Memory Framework',
long_description='',
ext_modules=[libsdm_ext],
packages=['sdm'],
package_data={'sdm': ['scanner_opencl.cl', 'scanner_opencl2.cl']},
url='https://github.com/msbrogli/sdm-framework',
install_requires=[
'future',
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
'Topic :: Scientific/Engineering',
'Programming Language :: C',
'Programming Language :: Python',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
]
)