-
Notifications
You must be signed in to change notification settings - Fork 15
/
wscript
99 lines (80 loc) · 2.89 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
#!/usr/bin/env python
# encoding: utf-8
VERSION = '0.0.1'
APPNAME = 'mcts'
srcdir = '.'
blddir = 'build'
from waflib.Build import BuildContext
import tbb
def options(opt):
opt.load('compiler_cxx')
opt.load('compiler_c')
opt.load('tbb')
def configure(conf):
conf.load('compiler_cxx')
conf.load('compiler_c')
conf.load('tbb')
conf.check_tbb()
if conf.env.CXX_NAME in ["icc", "icpc"]:
common_flags = "-Wall -std=c++14"
opt_flags = " -O3 -xHost -march=native -mtune=native -unroll -fma -g"
elif conf.env.CXX_NAME in ["clang"]:
common_flags = "-Wall -std=c++14"
opt_flags = " -O3 -march=native -g"
else:
common_flags = "-Wall -std=c++14"
opt_flags = " -O3 -march=native -g"
all_flags = common_flags + opt_flags
conf.env['CXXFLAGS'] = conf.env['CXXFLAGS'] + all_flags.split(' ')
print(conf.env['CXXFLAGS'])
def build(bld):
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/uct.cpp',
includes = './include',
target='uct')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/benchmarks/trap.cpp',
includes = './include',
defines = ['SINGLE'],
target='src/benchmarks/trap')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/benchmarks/trap.cpp',
includes = './include',
target='src/benchmarks/trap_parallel')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/benchmarks/trap.cpp',
includes = './include',
defines = ['SIMPLE', 'SINGLE'],
target='src/benchmarks/trap_simple')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/benchmarks/trap.cpp',
includes = './include',
defines = ['SIMPLE'],
target='src/benchmarks/trap_simple_parallel')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/toy_sim.cpp',
includes = './include',
target='toy_sim')
bld.program(features = 'cxx',
uselib = "TBB",
install_path = None,
source='src/toy_sim.cpp',
includes = './include',
defines = 'SINGLE',
target='toy_sim_single')
bld.install_files('${PREFIX}/include/mcts', 'include/mcts/uct.hpp')
bld.install_files('${PREFIX}/include/mcts', 'include/mcts/defaults.hpp')
bld.install_files('${PREFIX}/include/mcts', 'include/mcts/macros.hpp')
bld.install_files('${PREFIX}/include/mcts', 'include/mcts/parallel.hpp')