-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.exec-helper
146 lines (122 loc) · 3.23 KB
/
.exec-helper
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
commands:
setup: Setup the project infrastructure (compilation database etc.)
init: Initialize the project build dir
build: Build-only + install-only
build-only: Build compontents
install-only: Install the built components
run: Run a binary
clean: Clean the build directory
distclean: Distclean the build directory
cp-source: Copy the source to the container
start-container: Start the container
docker: Execute the command in Docker
patterns:
TARGET:
default-values:
- test_normal_computation
- benchmark_normal_computation
short-option: t
long-option: target
MODE:
default-values:
- debug
- release
short-option: m
long-option: mode
CONTAINER:
default-values:
- normal-computation-opencl
short-option: d
long-option: docker
COMMAND:
default-values:
- init
- build
- run
short-option: c
long-option: cmd
setup:
- command-line-command
init:
- command-line-command
cp-source:
- command-line-command
build:
- build-only
- install-only
build-only:
- make
install-only:
- make
clean:
- make
distclean:
- command-line-command
run:
- command-line-command
start-container:
- command-line-command
docker:
- cp-source
- command-line-command
command-line-command:
patterns:
- EH_WORKING_DIR
working-dir: "{EH_WORKING_DIR}"
setup:
patterns:
- MODE
- EH_WORKING_DIR
command-line: [ ln, -fs, "build/{MODE}/build/compile_commands.json"]
init:
patterns:
- MODE
- EH_WORKING_DIR
command-line: [cmake, -H., "-Bbuild/{MODE}/build", "-DCMAKE_INSTALL_PREFIX=build/{MODE}/install", -DCMAKE_EXPORT_COMPILE_COMMANDS=ON, "-DCMAKE_BUILD_TYPE={MODE}" ]
distclean:
patterns:
- MODE
- EH_WORKING_DIR
command-line: [ rm, -rf, "build/{MODE}/build"]
run:
patterns:
- TARGET
- MODE
- EH_WORKING_DIR
working-dir: "{EH_WORKING_DIR}"
command-line: [nice, -n, -10, "build/{MODE}/install/bin/{TARGET}"]
cp-source:
patterns:
- CONTAINER
- EH_WORKING_DIR
command-line:
- create-source-dir: [ docker, exec, "{CONTAINER}", "mkdir -p {EH_WORKING_DIR}"]
- copy-sources: [docker, cp, ., "{CONTAINER}:{EH_WORKING_DIR}/"]
start-container:
patterns:
- CONTAINER
command-line: [ docker, start, "{CONTAINER}"]
docker:
patterns:
- CONTAINER
- COMMAND
- MODE
- TARGET
- EH_WORKING_DIR
command-line: [ docker, exec, "--workdir={EH_WORKING_DIR}", "{CONTAINER}", "exec-helper {COMMAND} --mode {MODE} --target {TARGET}"]
make:
patterns:
- TARGET
- MODE
- EH_WORKING_DIR
working-dir: "{EH_WORKING_DIR}"
build-dir: build/{MODE}/build
build-only:
command-line:
- "{TARGET}"
clean:
command-line:
- clean
install-only:
command-line:
- install