-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwscript
138 lines (117 loc) · 4.21 KB
/
wscript
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! /usr/bin/env python
# encoding: utf-8
APPNAME = 'samcsynthetic'
VERSION = '0.4'
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_c compiler_cxx python cython')
opt.add_option('-d', '--debug', action='store_true', default=False, help='Debug flag.')
opt.add_option('-p', '--prof', action='store_true', default=False, help='Profiling flag.')
def configure(conf):
conf.load('compiler_c compiler_cxx python cython')
conf.check_python_headers()
conf.check_python_module('numpy')
conf.check_python_module('scipy')
#conf.check_python_module('networkx')
conf.check_python_module('pandas')
conf.env.append_value('LINKFLAGS', '-L%s/lib' % conf.path.abspath())
conf.env.append_value('LINKFLAGS', '-L/share/apps/lib')
#conf.check(compiler='cc', lib='Judy', uselib_store='JUDY')
conf.check(compiler='cc', lib='m', uselib_store='MATH')
#conf.check(compiler='cc', lib='profiler', uselib_store='PROF')
#conf.check_cxx(lib='gmp', uselib_store='GMP')
#conf.check_cxx(lib='gmpxx', uselib_store='GMPXX')
#conf.env.append_value('LINKFLAGS', '-lgmpxx')
#conf.check_cxx(lib='dai', uselib_store='DAI')
def build(bld):
libs = 'MATH'.split()
#libs = 'JUDY MATH'.split()
includes = ['-I/share/apps/include']
CFLAGS = ['-Wall','-std=c99'] + includes
CXXFLAGS = ['-fPIC'] + includes
LDFLAGS = []
CYTHONFLAGS = []
if bld.options.debug:
print('Beginning debug build')
CFLAGS += ['-g','-DDEBUG']
CXXFLAGS += ['-g','-DDEBUG']
CYTHONFLAGS += ['--gdb']
LDFLAGS += ['-g','-DDEBUG']
if bld.options.prof:
print('Adding profiling flag build')
CFLAGS += ['-pg']
CXXFLAGS += ['-pg']
LDFLAGS += ['-pg']
#libs += ['PROF']
if not bld.options.prof and not bld.options.debug:
CFLAGS += ['-O2', '-g']
CXXFLAGS += ['-O2', '-g']
#bld.env.CYTHONFLAGS = CYTHONFLAGS
bld.env['PREFIX'] = '.'
#bld.shlib(source = bld.path.ant_glob('samcnet/netcost/*.c'),
#target='cost',
#cflags=CFLAGS,
#linkflags=LDFLAGS,
#use=libs)
#bld(features='c cshlib pyext',
#source=['samcnet/samc.pyx'],
#includes=[],
#libpath=['.','./build'],
#cflags=CFLAGS,
#ldflags=LDFLAGS,
#target='samc')
bld(features='c cshlib pyext',
source=['samcnet/mh.pyx'],
includes=[],
libpath=['.','./build'],
cflags=CFLAGS,
ldflags=LDFLAGS,
target='mh')
#bld(features='c cshlib pyext',
#source=['samcnet/bayesnet.pyx'],
#includes=['samcnet/netcost'],
#use='cost',
#libpath=['.','./build'],
#cflags=CFLAGS,
#ldflags=LDFLAGS,
#target='bayesnet')
bld(features='c cshlib pyext',
source=['samcnet/mixturepoisson.pyx'],
#includes=['samcnet/netcost'],
#use='cost',
#libpath=['.','./build'],
cflags=CFLAGS,
ldflags=LDFLAGS,
target='mixturepoisson')
#bld(features='c cshlib cxx pyext',
#source=['samcnet/probability.pyx'],
##libpath=['.','./build'],
#includes=['deps/libdai/include'],
#cxxflags=CXXFLAGS,
#ldflags=LDFLAGS,
#target='probability')
#libs = ['MATH', 'DAI', 'GMP', 'GMPXX']
#bld(features='c cshlib cxx pyext',
#source=['samcnet/bayesnetcpd.pyx', 'samcnet/utils.cpp'],
#includes=['deps/libdai/include','include'],
#libpath=['lib','.','./build'],
#use=libs,
#cxxflags=CXXFLAGS,
#ldflags=LDFLAGS,
#target='bayesnetcpd')
#CFLAGS.remove('-Wall')
#bld(features='c cshlib cxx pyext',
#source=['samcnet/pydai.pyx'],
#libpath=['lib','.','build'],
#includes=['deps/libdai/include'],
#use=libs,
#cxxflags=CXXFLAGS,
#ldflags=LDFLAGS,
#target='pydai')
#bld.env['PREFIX'] = '.'
#for x in 'dai.so probability.so bayesnetcpd.so bayesnet.so samc.so cost.so'.split():
#bld.symlink_as('${PREFIX}/lib/%s' % x, 'build/%s' % x)
def dist(ctx):
ctx.excl = '**/*.zip **/*.bz2 **/.waf-1* **/*~ **/*.pyc **/*.swp **/.lock-w*'
#ctx.files = ctx.path.ant_glob('**/wscript **/*.h **/*.cpp waf')