forked from zrnsm/pyloess
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
62 lines (58 loc) · 2.37 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
#!/usr/bin/env python
__author__ = "Pierre GF Gerard-Marchant ($Author$)"
__version__ = '1.0'
__revision__ = "$Revision$"
__date__ = '$Date$'
import os
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_append
confgr = Configuration('pyloess',parent_package,top_path)
# Configuration of LOWESS
confgr.add_extension('_lowess',
sources=[join('src', 'f_lowess.pyf'),
join('src', 'lowess.f'),]
)
# Configuration of STL
confgr.add_extension('_stl',
sources=[join('src', 'f_stl.pyf'),
join('src', 'stl.f')],
)
# Configuration of LOESS
build_info = {
'f2py_options': ['--verbose', '-L/usr/lib', '-lblas']
}
f_sources = ('loessf.f', 'linpack_lite.f')
confgr.add_library('floess',
sources = [join('src',x) for x in f_sources],
**build_info)
blas_info = get_info('blas_opt')
build_info = {}
dict_append(build_info, **blas_info)
dict_append(build_info, libraries=['floess'])
c_sources = ['loess.c', 'loessc.c', 'misc.c', 'predict.c',]
confgr.add_extension('_loess',
sources=[join('src','_loess.c')] + \
[join('src', x) for x in c_sources],
depends = [join('src','*.h'),
join('src','*.pyx'),
join('src','*.pxd')
],
**build_info
)
confgr.add_extension('_mloess',
sources=[join('src','_mloess.c')] + \
[join('src', x) for x in c_sources],
depends = [join('src','*.h'),
join('src','*.pyx'),
join('src','*.pxd')
],
**build_info
)
confgr.add_data_dir('tests')
return confgr
if __name__ == "__main__":
from numpy.distutils.core import setup
config = configuration(top_path='').todict()
setup(**config)