-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
178 lines (155 loc) · 4.71 KB
/
xmake.lua
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
add_rules(
"mode.tsan", "mode.ubsan", "mode.asan",
"mode.debug", "mode.release", "mode.valgrind"
)
add_requires(
"benchmark", "gtest", "csv2",
"concurrentqueue",
"gperftools"
)
add_packages("csv2", "concurrentqueue")
set_languages("c++23", "c17")
set_policy("build.warning", true)
set_policy("build.optimization.lto", false)
set_toolset("cc", "mold", {force = true})
if is_mode("asan") then
add_cxxflags("-fno-inline", {force = true})
set_optimize("none", {force = true})
end
if is_mode("release") then
set_optimize("fastest", {force = true})
end
add_includedirs("libcuckoo/libcuckoo")
target("nbtlru")
set_kind("headeronly")
add_packages("concurrentqueue");
add_packages("atomic_queue");
set_warnings("all", "error")
add_includedirs(
"include",
"smhasher/src",
"rustex",
"dirtyzipf",
{ public = true }
)
target("test")
set_kind("binary")
add_deps("nbtlru")
add_files(
"test/*.cc",
"smhasher/src/Murmur*.cpp"
)
add_packages("gtest")
set_warnings("all", "error")
after_build(function (target)
os.execv(target:targetfile(), {"--gtest_color=yes"})
print("xmake: unittest complete.")
end)
on_run(function (target)
--nothing
end)
target("benchmark-deps")
set_kind("shared")
add_packages("csv2")
add_files(
"benchmark-deps/*.cc",
"smhasher/src/Murmur*.cpp"
)
add_includedirs("dirtyzipf")
add_packages("csv2")
set_policy("build.warning", false)
add_deps("nbtlru")
add_packages(
"gflags",
"concurrentqueue"
)
target("benchmark")
set_kind("binary")
add_deps("benchmark-deps")
add_files(
"benchmark/*.cc",
"smhasher/src/Murmur*.cpp"
)
add_includedirs("dirtyzipf")
add_packages("csv2")
set_policy("build.warning", true)
add_deps("nbtlru")
add_packages(
"gflags",
"concurrentqueue"
)
after_run(function (target)
if is_mode("debug") then
return
end
print("drawing pictures ... ")
os.execv(
"python", {
"scripts/different_dist.py",
target:targetdir() .. "/different_dist_on_naive.csv",
"experiment-report/pics/different_dist_on_naive.png"
}
)
os.execv(
"python", {
"scripts/different_dist.py",
target:targetdir() .. "/different_dist_on_fifo-hybrid.csv",
"experiment-report/pics/different_dist_on_fifo-hybrid.png"
}
)
os.execv(
"python", {
"scripts/different_dist.py",
target:targetdir() .. "/different_dist_on_sampling.csv",
"experiment-report/pics/different_dist_on_sampling.png"
}
)
os.execv(
"python", {
"scripts/multi_threads_on_both_in_total.py",
target:targetdir() .. "/multi_threads_on_naive_latency.csv",
target:targetdir() .. "/multi_threads_on_fifo-hybrid_latency.csv",
target:targetdir() .. "/multi_threads_on_sampling_latency.csv",
"experiment-report/pics/multi_threads_on_both_latency",
"Time Elasped (ms)",
"1"
}
)
os.execv(
"python", {
"scripts/multi_threads_on_both_in_total.py",
target:targetdir() .. "/multi_threads_on_naive_hitratio.csv",
target:targetdir() .. "/multi_threads_on_fifo-hybrid_hitratio.csv",
target:targetdir() .. "/multi_threads_on_sampling_hitratio.csv",
"experiment-report/pics/multi_threads_on_both_hitratio",
"Hits Ratio",
"0"
}
)
print("compiling report ... ")
old_working_dir = os.workingdir()
os.cd('experiment-report')
os.execv("xelatex", { "main.tex" })
os.cd(old_working_dir)
end)
target("only-fifo-hybrid")
set_kind("binary")
set_optimize("fastest")
add_cxxflags("-g", "-fno-omit-frame-pointer")
set_symbols("debug")
add_deps("benchmark-deps", "nbtlru")
add_files("only-fifo-hybrid/*.cc")
target("only-naive")
set_kind("binary")
set_optimize("fastest")
add_cxxflags("-g", "-fno-omit-frame-pointer")
set_symbols("debug")
add_deps("benchmark-deps", "nbtlru")
add_files("only-naive/*.cc")
target("only-sampling")
set_kind("binary")
set_optimize("fastest")
add_cxxflags("-g", "-fno-omit-frame-pointer")
set_symbols("debug")
add_deps("benchmark-deps", "nbtlru")
add_files("only-sampling/*.cc")