comparison Makefile @ 1274:c8d6580d9307 tooling/benchmarks

Add Make targets for running benchmarks
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 28 Feb 2023 20:46:29 +0100
parents c9e35f1ca269
children e1aefebe4ea2
comparison
equal deleted inserted replaced
1238:d4d1eae7c7ca 1274:c8d6580d9307
8 BROWSER_DEFAULT := $(if $(BROWSER_DEFAULT), $(BROWSER_DEFAULT), open) 8 BROWSER_DEFAULT := $(if $(BROWSER_DEFAULT), $(BROWSER_DEFAULT), open)
9 BROWSER?=$(BROWSER_DEFAULT) 9 BROWSER?=$(BROWSER_DEFAULT)
10 10
11 help: 11 help:
12 @echo 'Targets:' 12 @echo 'Targets:'
13 @echo ' help - Show this help.' 13 @echo ' help - Show this help.'
14 @echo ' docs - Generate docs for webserver deployment.' 14 @echo ' docs - Generate docs for webserver deployment.'
15 @echo ' localdocs - Generate docs for local viewing.' 15 @echo ' localdocs - Generate docs for local viewing.'
16 @echo ' opendocs - Open documentation in the browser remaking it if necessary.' 16 @echo ' opendocs - Open documentation in the browser remaking it if necessary.'
17 @echo ' benchmark - Run benchmark suite.'
18 @echo ' benchmarkrev - Run benchmark suite for revision REV.'
19 @echo ' benchmarkcmp - Run benchmark suite comparing TARGET to BASELINE.'
17 @echo '' 20 @echo ''
18 @echo 'Variables:' 21 @echo 'Variables:'
19 @echo ' JULIA - Controls which command is used to run julia' 22 @echo ' JULIA - Controls which command is used to run julia'
20 @echo ' Default $(JULIA_DEFAULT)' 23 @echo ' Default $(JULIA_DEFAULT)'
21 @echo ' BROWSER - Sets the command for how to open html files' 24 @echo ' BROWSER - Sets the command for how to open html files'
22 @echo ' Default: xdg-open if it exists otherwise open' 25 @echo ' Default: xdg-open if it exists otherwise open'
26 @echo ' REV - Valid Mercurial revision specifier used in benchmarkrev'
27 @echo ' TARGET - Valid Mercurial revision specifier used in benchmarkcmp'
28 @echo ' as the target revision'
29 @echo ' BASELINE - Valid Mercurial revision specifier used in benchmarkcmp'
30 @echo ' as the baseline revision'
23 @echo '' 31 @echo ''
24 @echo 'Variables can be set on the commandline using the -e flag for make, e.g.' 32 @echo 'Variables can be set on the commandline using the -e flag for make, e.g.'
25 @echo ' make localdocs -e JULIA=path/to/julia' 33 @echo ' make localdocs -e JULIA=path/to/julia'
26 @echo 'or as shell environment variables.' 34 @echo 'or as shell environment variables.'
27 35
30 localdocs: docs/build-local 38 localdocs: docs/build-local
31 39
32 opendocs: localdocs 40 opendocs: localdocs
33 $(BROWSER) docs/build-local/index.html 41 $(BROWSER) docs/build-local/index.html
34 42
35 clean: 43 cleandocs:
36 rm -rf docs/build 44 rm -rf docs/build
37 rm -rf docs/build-local 45 rm -rf docs/build-local
38 46
39 .PHONY: help docs localdocs opendocs clean 47 benchmark: benchmark/run-benchmark
48
49 benchmarkrev: benchmark/run-benchmark-rev
50
51 benchmarkcmp: benchmark/run-benchmark-cmp
52
53 cleanbenchmark:
54 rm -rf benchmark/results
55 rm -f benchmark/tune.json
56
57 clean: cleandocs cleanbenchmark
58
59 .PHONY: help clean docs localdocs opendocs cleandocs benchmark benchmarkrev benchmarkcmp cleanbenchmark
40 60
41 SRC_DIRS = src docs/src 61 SRC_DIRS = src docs/src
42 SRC_FILES_AND_DIRS = $(foreach dir,$(SRC_DIRS),$(shell find $(dir))) 62 SRC_FILES_AND_DIRS = $(foreach dir,$(SRC_DIRS),$(shell find $(dir)))
43 DEP_IGNORE = %/.DS_Store 63 DEP_IGNORE = %/.DS_Store
44 DOCS_DEPENDENCIES = docs/make.jl $(filter-out $(DEP_IGNORE),$(SRC_FILES_AND_DIRS)) 64 DOCS_DEPENDENCIES = docs/make.jl $(filter-out $(DEP_IGNORE),$(SRC_FILES_AND_DIRS))
46 $(JULIA) --project=docs docs/make.jl --build-dir build --prettyurls 66 $(JULIA) --project=docs docs/make.jl --build-dir build --prettyurls
47 67
48 docs/build-local: $(DOCS_DEPENDENCIES) 68 docs/build-local: $(DOCS_DEPENDENCIES)
49 $(JULIA) --project=docs docs/make.jl --build-dir build-local 69 $(JULIA) --project=docs docs/make.jl --build-dir build-local
50 70
71 benchmark/run-benchmark:
72 $(JULIA) --project=benchmark benchmark/make.jl
73
74 benchmark/run-benchmark-rev:
75 $(JULIA) --project=benchmark benchmark/make.jl --rev $(REV)
76
77 benchmark/run-benchmark-cmp:
78 $(JULIA) --project=benchmark benchmark/make.jl --cmp $(TARGET) $(BASELINE)
79
51 80
52 .PHONY: temp 81 .PHONY: temp
53 temp: 82 temp:
54 @echo $(SRC_FILES_AND_DIRS) 83 @echo $(SRC_FILES_AND_DIRS)