-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·95 lines (79 loc) · 3.21 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
#!/usr/bin/env python
import numpy as np
import sys
import subprocess
import setuptools
from Cython.Build import cythonize
# c extension modules
c_modules = []
extra_compile_args = ['-Wall',] #'-march=native', '-O3']
# these devices are currently only supported on linux
if sys.platform.startswith('linux'):
# Neuropulse Mindset-24R
c_modules.append(
setuptools.Extension('cebl.rt.sources.neuropulse.libmindset24r',
sources=['cebl/rt/sources/neuropulse/libmindset24r.c'],
extra_compile_args=extra_compile_args))
# BioSemi ActiveTwo
c_modules.append(
setuptools.Extension('cebl.rt.sources.biosemi.libactivetwo',
sources=['cebl/rt/sources/biosemi/activetwo.c'],
libraries=['bsif', 'usb-1.0'],
#libraries=['usb'],
library_dirs=['cebl/rt/sources/biosemi/'],
language='c++',
extra_compile_args=extra_compile_args))
# fast tanh in c
## c_modules.append(
## setuptools.Extension('cebl.util.fasttanh',
## sources=['cebl/util/fasttanh.c'],
## libraries=['pthread', 'gomp'],
## include_dirs=[np.get_include()],
## extra_compile_args=extra_compile_args + ['-fopenmp',]))
# cython extension modules
cython_modules = []
# source extension
cython_modules.append(
setuptools.Extension('cebl.rt.sources.source.source',
sources=['cebl/rt/sources/source/source.pyx'],
extra_compile_args=extra_compile_args))
# cythonized wx.lib.plot
cython_modules.append(
setuptools.Extension('cebl.rt.widgets.wxlibplot.plotcanvas',
sources=['cebl/rt/widgets/wxlibplot/plotcanvas.pyx'],
extra_compile_args=extra_compile_args))
cython_modules.append(
setuptools.Extension('cebl.rt.widgets.wxlibplot.polyobjects',
sources=['cebl/rt/widgets/wxlibplot/polyobjects.pyx'],
extra_compile_args=extra_compile_args))
## # g.tec g.MOBILab+
## cython_modules.append(
## setuptools.Extension('cebl.rt.sources.gtec.gmobilab.gmobilab',
## sources=['cebl/rt/sources/gtec/gmobilab/gmobilab.pyx'],
## extra_compile_args=extra_compile_args))
##
## # g.tec g.Nautilus
## cython_modules.append(
## setuptools.Extension('cebl.rt.sources.gtec.gnautilus.gnautilus',
## sources=['cebl/rt/sources/gtec/gnautilus/gnautilus.pyx'],
## extra_compile_args=extra_compile_args))
# all extension modules
ext_modules=c_modules + cythonize(cython_modules, language_level='3')
# extract version from startup script
# this is all hacky - XXX idfah
version=subprocess.check_output(['scripts/cebl', '--version']).decode()
version='.'.join(version.split('.')[:3])
setuptools.setup(
name='CEBL',
version=version,
author='Elliott Forney and Charles Anderson',
author_email='eeg@cs.colostate.edu',
url='http://www.cs.colostate.edu/eeg',
packages=setuptools.find_packages(),
ext_modules=ext_modules,
scripts=['scripts/cebl'],
license='GPL3, Copyright (2017) Elliott Forney, Charles Anderson, Colorado State University',
description='Colorado Electroencephalography and Brain-Computer Interfaces Laboratory (CEBL)',
include_package_data=True,
install_requires=['matplotlib', 'numpy', 'scipy', 'wxPython', 'pylibftdi', 'serial']
)