-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
357 lines (299 loc) · 9.74 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
SANITY = tests/sanity/*.fpcore
TESTS = benchmarks/*.fpcore tests/*.fpcore
FILTER = racket infra/filter.rkt
### Install / Compile
setup:
raco pkg install --skip-installed -n fpbench --auto generic-flonum
raco make main.rkt export.rkt transform.rkt toolserver.rkt evaluate.rkt
testsetup:
raco make infra/*.rkt
distribute:
mkdir -p fpbench-compiled/
cp README.md fpbench-compiled/
cp LICENSE.txt fpbench-compiled/
cp logo.png fpbench-compiled/
raco exe -o fpbench --orig-exe --embed-dlls --vv main.rkt
[ ! -f fpbench.exe ] || (raco distribute fpbench-compiled fpbench.exe && rm fpbench.exe)
[ ! -f fpbench.app ] || (raco distribute fpbench-compiled fpbench.app && rm fpbench.app)
[ ! -f fpbench ] || (raco distribute fpbench-compiled fpbench && rm fpbench)
##### Testing
c-sanity:
ifneq (, $(shell which $(CC)))
cat $(SANITY) | racket infra/test-core2c.rkt --repeat 1
else
$(warning skipping C sanity tests; unable to find C compiler $(CC))
endif
java-sanity:
ifneq (, $(shell which java))
cat $(SANITY) | racket infra/test-core2java.rkt --repeat 1
else
$(warning skipping Java sanity tests; unable to find Java compiler)
endif
fptaylor-sanity:
ifneq (, $(shell which fptaylor))
cat $(SANITY) | racket infra/test-core2fptaylor.rkt --repeat 1
$(RM) -r log tmp
else
$(warning skipping fptaylor sanity tests; unable to find fptaylor)
endif
js-sanity:
ifneq (, $(shell which node))
cat $(SANITY) | racket infra/test-core2js.rkt --repeat 1
else
$(warning skipping javascript sanity tests; unable to find node)
endif
smtlib2-sanity:
ifneq (, $(shell which z3))
cat $(SANITY) | racket infra/test-core2smtlib2.rkt --repeat 1
else
$(warning skipping smtlib2 sanity tests; unable to find z3)
endif
sollya-sanity:
ifneq (, $(shell which sollya))
cat $(SANITY) | racket infra/test-core2sollya.rkt --repeat 1
else
$(warning skipping sollya sanity tests; unable to sollya interpreter)
endif
cakeml-sanity:
ifneq (, $(shell which cake))
cat $(SANITY) | racket infra/test-core2cakeml.rkt --repeat 1
else
$(warning skipping CakeML sanity tests; unable to find CakeML compiler)
endif
wls-sanity:
ifneq (, $(shell which wolframscript))
cat $(SANITY) | racket infra/test-core2wls.rkt --repeat 1
else
$(warning skipping wolframscript sanity tests; unable to find wolframscript interpreter)
endif
go-sanity:
ifneq (, $(shell which go))
cat $(SANITY) | racket infra/test-core2go.rkt --repeat 1
else
$(warning skipping Go sanity tests; unable to find go)
endif
rust-sanity:
ifneq (, $(shell which rustc))
cat $(SANITY) | racket infra/test-core2rust.rkt --repeat 1
else
$(warning skipping Rust sanity tests; unable to find Rust compiler)
endif
scala-sanity:
ifneq (, $(shell which daisy))
cp -r $(DAISY_BASE)/library .
cat $(SANITY) | racket infra/test-core2scala.rkt --repeat 1
rm -r library
else
$(warning skipping Scala sanity tests; unable to find Scala compiler)
endif
ocaml-sanity:
ifneq (, $(shell which ocamlopt))
cat $(SANITY) | racket infra/test-core2ocaml.rkt --repeat 1
else
$(warning skipping OCaml sanity tests; unable to find OCaml compiler)
endif
python-sanity:
ifneq (, $(shell which python3))
cat $(SANITY) | racket infra/test-core2python.rkt --repeat 1
else
$(warning skipping Python sanity tests; unable to find Python interpreter)
endif
fortran-sanity:
ifneq (, $(shell which $(CC)))
cat $(SANITY) | racket infra/test-core2fortran03.rkt --repeat 1
else
$(warning skipping Fortran sanity tests; unable to find Fortran compiler)
endif
matlab-sanity:
ifneq (, $(shell which matlab))
cat $(SANITY) | racket infra/test-core2matlab.rkt --repeat 1
else
$(warning skipping MATLAB sanity tests; unable to find MATLAB tool)
endif
haskell-sanity:
ifneq (, $(shell which ghc))
cat $(SANITY) | racket infra/test-core2haskell.rkt --repeat 1
else
$(warning skipping Haskell sanity tests; unable to find Haskell compiler)
endif
julia-sanity:
ifneq (, $(shell which julia))
cat $(SANITY) | racket infra/test-core2julia.rkt --repeat 1
else
$(warning skipping Julia sanity tests; unable to find Julia interpreter)
endif
vivado-sanity:
ifneq (, $(shell which vivado_hls))
cat $(SANITY) | racket infra/test-core2vivado.rkt --repeat 1
else
$(warning skipping Vivado sanity tests; unable to find Vivado compiler)
endif
sanity: c-sanity java-sanity js-sanity go-sanity smtlib2-sanity sollya-sanity \
wls-sanity cml-sanity fptaylor-sanity scala-sanity ocaml-sanity \
python-sanity fortran-sanity matlab-sanity haskell-sanity julia-sanity \
rust-sanity vivado-sanity
raco-test:
raco test .
c-test:
ifneq (, $(shell which $(CC)))
cat $(TESTS) | racket infra/test-core2c.rkt --error 3
else
$(warning skipping C tests; unable to find C compiler $(CC))
endif
java-test:
ifneq (, $(shell which java))
cat $(TESTS) | racket infra/test-core2java.rkt --error 3
else
$(warning skipping Java tests; unable to find Java compiler)
endif
fptaylor-test:
ifneq (, $(shell which fptaylor))
cat $(TESTS) | racket infra/test-core2fptaylor.rkt --error 3
$(RM) -r log tmp
else
$(warning skipping fptaylor tests; unable to find fptaylor)
endif
js-test:
ifneq (, $(shell which node))
cat $(TESTS) | racket infra/test-core2js.rkt --error 150
else
$(warning skipping javascript tests; unable to find node)
endif
smtlib2-test:
ifneq (, $(shell which z3))
cat $(TESTS) | racket infra/test-core2smtlib2.rkt
else
$(warning skipping smtlib2 tests; unable to find z3)
endif
sollya-test:
ifneq (, $(shell which sollya))
cat $(TESTS) | racket infra/test-core2sollya.rkt
else
$(warning skipping sollya tests; unable to find sollya interpreter)
endif
cakeml-test:
ifneq (, $(shell which cake))
cat $(TESTS) | racket infra/test-core2cakeml.rkt
else
$(warning skipping CakeML tests; unable to find CakeML compiler)
endif
wls-test:
ifneq (, $(shell which wolframscript))
cat $(TESTS) | racket infra/test-core2wls.rkt -s --error 150
else
$(warning skipping wolframscript tests; unable to find wolframscript interpreter)
endif
go-test:
ifneq (, $(shell which go))
cat $(TESTS) | racket infra/test-core2go.rkt -s --error 150
else
$(warning skipping Go tests; unable to find Go compiler)
endif
rust-test:
ifneq (, $(shell which rustc))
cat $(TESTS) | racket infra/test-core2rust.rkt -s --error 3
else
$(warning skipping Rust tests; unable to find Rust compiler)
endif
scala-test:
ifneq (, $(shell which daisy))
cp -r $(DAISY_BASE)/library .
cat $(TESTS) | racket infra/test-core2scala.rkt
rm -r library
else
$(warning skipping Scala tests; unable to find Scala compiler)
endif
ocaml-test:
ifneq (, $(shell which ocamlopt))
cat $(TESTS) | racket infra/test-core2ocaml.rkt --error 3
else
$(warning skipping OCaml tests; unable to find OCaml compiler)
endif
python-test:
ifneq (, $(shell which python3))
cat $(TESTS) | racket infra/test-core2python.rkt --error 3
else
$(warning skipping Python tests; unable to find Python interpreter)
endif
fortran-test:
ifneq (, $(shell which $(CC)))
cat $(TESTS) | racket infra/test-core2fortran03.rkt --error 3
else
$(warning skipping Fortran tests; unable to find Fortran compiler)
endif
matlab-test:
ifneq (, $(shell which matlab))
cat $(TESTS) | racket infra/test-core2matlab.rkt --error 3
else
$(warning skipping MATLAB sanity tests; unable to find MATLAB tool)
endif
haskell-test:
ifneq (, $(shell which ghc))
cat $(TESTS) | racket infra/test-core2haskell.rkt --error 3
else
$(warning skipping Haskell tests; unable to find Haskell compiler)
endif
julia-test:
ifneq (, $(shell which julia))
cat $(TESTS) | racket infra/test-core2julia.rkt --error 20
else
$(warning skipping Julia tests; unable to find Julia interpreter)
endif
# For CI, Julia takes to long in a single run
julia-benchmarks:
ifneq (, $(shell which julia))
cat benchmarks/*.fpcore | racket infra/test-core2julia.rkt --error 20
else
$(warning skipping Julia tests; unable to find Julia interpreter)
endif
# For CI, Julia takes to long in a single run
julia-binary64:
ifneq (, $(shell which julia))
cat tests/*default.fpcore tests/letstar.fpcore tests/metadata.fpcore | \
racket infra/test-core2julia.rkt --error 20
else
$(warning skipping Julia tests; unable to find Julia interpreter)
endif
# For CI, Julia takes to long in a single run
julia-binary32:
ifneq (, $(shell which julia))
cat tests/*binary32.fpcore | racket infra/test-core2julia.rkt --error 20
else
$(warning skipping Julia tests; unable to find Julia interpreter)
endif
vivado-test:
ifneq (, $(shell which vivado_hls))
cat $(TESTS) | racket infra/test-core2vivado.rkt -s --error 4
else
$(warning skipping Vivado tests; unable to find Vivado compiler)
endif
update-tool-tests:
tests/scripts/test-export.sh generate
tests/scripts/test-transform.sh generate
tests/scripts/test-evaluate.sh generate
export-test:
tests/scripts/test-export.sh
transform-test:
tests/scripts/test-transform.sh
toolserver-test:
tests/scripts/test-toolserver.sh
evaluate-test:
tests/scripts/test-evaluate.sh
tensor-test:
cat tests/tensor/batch.txt | racket toolserver.rkt
tools-test: export-test transform-test toolserver-test evaluate-test tensor-test
test: c-test java-test js-test go-test smtlib2-test sollya-test wls-test \
cml-test fptaylor-test daisy-test ocaml-test python-test matlab-test \
haskell-test rust-test vivado-test export-test transform-test \
toolserver-test evaluate-test raco-test
clean:
$(RM) -r library tmp log *.zo *.dep
www/benchmarks.jsonp: $(wildcard benchmarks/*.fpcore)
racket infra/core2json.rkt --padding load_benchmarks $^ > "$@"
.PHONY: c-sanity c-test fptaylor-sanity fptaylor-test js-sanity js-test \
julia-sanity julia-test julia-benchmarks julia-binary64 julia-binary32 \
smtlib2-sanity smtlib2-test sollya-sanity sollya-test wls-sanity wls-test \
cml-sanity cml-test go-sanity go-test scala-sanity scala-test \
vivado-sanity vivado-test raco-test export-test transform-test \
toolserver-test evaluate-test tools-test sanity test testsetup setup \
update-tool-tests clean