forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·90 lines (73 loc) · 3.17 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
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('integrate', parent_package, top_path)
# Get a local copy of lapack_opt_info
lapack_opt = dict(get_info('lapack_opt',notfound_action=2))
# Pop off the libraries list so it can be combined with
# additional required libraries
lapack_libs = lapack_opt.pop('libraries', [])
mach_src = [join('mach','*.f')]
quadpack_src = [join('quadpack','*.f')]
odepack_src = [join('odepack','*.f')]
dop_src = [join('dop','*.f')]
quadpack_test_src = [join('tests','_test_multivariate.c')]
odeint_banded_test_src = [join('tests', 'banded5x5.f')]
config.add_library('mach', sources=mach_src,
config_fc={'noopt':(__file__,1)})
config.add_library('quadpack', sources=quadpack_src)
config.add_library('odepack', sources=odepack_src)
config.add_library('dop', sources=dop_src)
# Extensions
# quadpack:
config.add_extension('_quadpack',
sources=['_quadpackmodule.c'],
libraries=(['quadpack', 'mach'] + lapack_libs),
depends=(['quadpack.h','__quadpack.h']
+ quadpack_src + mach_src),
**lapack_opt)
# odepack
odepack_libs = ['odepack','mach'] + lapack_libs
odepack_opts = lapack_opt.copy()
odepack_opts.update(numpy_nodepr_api)
config.add_extension('_odepack',
sources=['_odepackmodule.c'],
libraries=odepack_libs,
depends=(odepack_src + mach_src),
**odepack_opts)
# vode
config.add_extension('vode',
sources=['vode.pyf'],
libraries=odepack_libs,
depends=(odepack_src
+ mach_src),
**lapack_opt)
# lsoda
config.add_extension('lsoda',
sources=['lsoda.pyf'],
libraries=odepack_libs,
depends=(odepack_src
+ mach_src),
**lapack_opt)
# dop
config.add_extension('_dop',
sources=['dop.pyf'],
libraries=['dop'],
depends=dop_src)
config.add_extension('_test_multivariate',
sources=quadpack_test_src)
# Fortran+f2py extension module for testing odeint.
config.add_extension('_test_odeint_banded',
sources=odeint_banded_test_src,
libraries=odepack_libs,
depends=(odepack_src + mach_src),
**lapack_opt)
config.add_data_dir('tests')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())