-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
149 lines (119 loc) · 4.39 KB
/
Makefile
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
PWD != pwd
BIN = $(PWD)/bin
# VENV
PYTHON = python3
VENV_DIR = $(PWD)/venv
PIP = $(VENV_DIR)/bin/pip
PYTHON_EXEC = $(VENV_DIR)/bin/python
export REBENCH_EXEC = $(VENV_DIR)/bin/rebench
export REBENCH_PROCESSOR = $(PWD)/process_graph.py
# BUILD
ALLOY_REPO = https://github.com/jacob-hughes/alloy
ALLOY_SRC_DIR = $(PWD)/alloy
ALLOY_VERSION = handle_intrinsics
ALLOY_BOOTSTRAP_STAGE = 1
ALLOY_CFGS = alloy finalise_elide finalise_naive barriers_naive \
barriers_none barriers_opt
PATCHES = $(PWD)/patches
# BENCH
export PEXECS ?= 10
# Only applicable for AWFY and CLBG
export ITERS ?= 1
all: build bench plot
.PHONY: venv
.PHONY: build build-alloy build-perf build-barriers build-elision
.PHONY: bench bench-perf bench-barriers bench-elision
.PHONY: plot plot-perf plot-barriers plot-elision
.PHONY: clean clean-builds clean-plots clean-benchmarks check-clean
plot: plot-perf plot-barriers plot-elision
plot-perf:
cd sws_benchmarks && make plot-perf
cd awfy_benchmarks && make plot-perf
cd grmtools_benchmarks && make plot-perf
cd alacritty_benchmarks && make plot-perf
plot-barriers:
cd sws_benchmarks && make plot-barriers
cd awfy_benchmarks && make plot-barriers
cd grmtools_benchmarks && make plot-barriers
cd alacritty_benchmarks && make plot-barriers
plot-elision:
cd sws_benchmarks && make plot-elision
cd awfy_benchmarks && make plot-elision
cd grmtools_benchmarks && make plot-elision
cd alacritty_benchmarks && make plot-elision
bench: bench-perf bench-barriers bench-elision
bench-perf:
cd sws_benchmarks && make bench-perf
cd awfy_benchmarks && make bench-perf
cd grmtools_benchmarks && make bench-perf
cd alacritty_benchmarks && make bench-barriers
bench-barriers:
cd sws_benchmarks && make bench-barriers
cd awfy_benchmarks && make bench-barriers
cd grmtools_benchmarks && make bench-barriers
cd alacritty_benchmarks && make bench-barriers
bench-elision:
cd sws_benchmarks && make bench-elision
cd awfy_benchmarks && make bench-elision
cd grmtools_benchmarks && make bench-elision
cd alacritty_benchmarks && make bench-elision
build: build-alloy build-benchmarks
build-benchmarks: build-perf build-barriers build-elision
build-perf:
cd sws_benchmarks && make build-perf
cd awfy_benchmarks && make build-perf
cd grmtools_benchmarks && make build-perf
cd alacritty_benchmarks && make build-perf
build-barriers:
cd sws_benchmarks && make build-barriers
cd awfy_benchmarks && make build-barriers
cd grmtools_benchmarks && make build-barriers
cd alacritty_benchmarks && make build-barriers
build-elision:
cd sws_benchmarks && make build-elision
cd awfy_benchmarks && make build-elision
cd grmtools_benchmarks && make build-elision
cd alacritty_benchmarks && make build-elision
build-alloy: $(addprefix $(BIN)/alloy/, $(ALLOY_CFGS)) $(ALLOY_SRC_DIR)
$(addprefix $(BIN)/alloy/, $(ALLOY_CFGS)): $(ALLOY_SRC_DIR)
cd $(ALLOY_SRC_DIR) && git reset --hard && ./x.py clean
if [ -f "$(PATCHES)/alloy/$(notdir $@).patch" ]; then \
echo "git apply $(PATCHES)/alloy/$(notdir $@).patch"; \
cd $(ALLOY_SRC_DIR) && git apply $(PATCHES)/alloy/$(notdir $@).patch; \
fi
$(PYTHON) $(ALLOY_SRC_DIR)/x.py install --config benchmark.config.toml \
--stage $(ALLOY_BOOTSTRAP_STAGE) \
--build-dir $(ALLOY_SRC_DIR)/build \
--set build.docs=false \
--set install.prefix=$@ \
--set install.sysconfdir=etc
$(ALLOY_SRC_DIR): venv
git clone $(ALLOY_REPO) $(ALLOY_SRC_DIR)
cd $(ALLOY_SRC_DIR) && git checkout $(ALLOY_VERSION)
venv: $(VENV_DIR)/bin/activate
$(VENV_DIR)/bin/activate: requirements.txt
$(PYTHON) -m venv $(VENV_DIR)
$(PIP) install -r requirements.txt
clean: clean-confirm clean-plots clean-benchmarks clean-builds
rm -rf $(ALLOY_SRC_DIR)
@echo "Clean"
clean-confirm:
@echo $@
@( read -p "Are you sure? [y/N]: " sure && case "$$sure" in [yY]) true;; *) false;; esac )
clean-plots:
cd sws_benchmarks && make clean-plots
cd awfy_benchmarks && make clean-plots
cd grmtools_benchmarks && make clean-plots
cd alacritty_benchmarks && make clean-plots
clean-benchmarks: clean-confirm
cd sws_benchmarks && make clean-benchmarks
cd awfy_benchmarks && make clean-benchmarks
cd grmtools_benchmarks && make clean-benchmarks
cd alacritty_benchmarks && make clean-benchmarks
clean-builds: clean-confirm
cd sws_benchmarks && make clean-builds
cd awfy_benchmarks && make clean-builds
cd grmtools_benchmarks && make clean-builds
cd alacritty_benchmarks && make clean-builds
clean-alloy: clean-confirm
rm -rf $(BIN)