-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-compiler
More file actions
executable file
·40 lines (32 loc) · 1.03 KB
/
test-compiler
File metadata and controls
executable file
·40 lines (32 loc) · 1.03 KB
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
#!/bin/bash
set -eu
compiler_name=$1
compiler_version=$2
debug=${3:-OFF}
IMAGES_DB="images.json"
get () {
local request="$1"
jq -jM "$request" "$IMAGES_DB" | sed 's/null//'
}
compiler_command=$(get ".\"$compiler_name\".command")
os_version=$(get ".\"$compiler_name\".versions.\"$compiler_version\".os_version")
cuda_version=$(get ".\"$compiler_name\".versions.\"$compiler_version\".cuda_version")
flags=$(get ".\"$compiler_name\".versions.\"$compiler_version\".flags")
image=test-$compiler_name:$compiler_version
docker build \
-t "$image" \
--build-arg VERSION="$compiler_version" \
--build-arg OS_VERSION="$os_version" \
--build-arg CUDA_VERSION="$cuda_version" \
"docker/$compiler_name"
docker run \
-it \
--rm \
--volume "$PWD:/work" \
--user "$(id -u "$USER"):$(id -g "$USER")" \
"$image" \
cmake \
-B "build/$compiler_name/$compiler_version" \
-DCMAKE_CXX_FLAGS="$flags" \
-DCMAKE_CXX_COMPILER="$compiler_command" \
-DCPPFT_ENABLE_ERROR_LOG="${debug}"