Newer
Older
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
# vim: tabstop=4 shiftwidth=4 softtabstop=4
before_script:
- which g++
- which cmake
# Stages are useful only to enforce some ordering of the jobs. Every job is run
# in its own directory and only very few data can be shared between the jobs in
# different stages. It has to be zipped and uploaded to the server, so we can't
# do it with the build directory. Hence, we must build, test and install in the
# same job.
stages:
- build
# default flags for cmake
.default_cmake_flags_def: &default_cmake_flags
WITH_CUDA: "no"
WITH_CUDA_ARCH: "auto"
WITH_MIC: "no"
WITH_TESTS: "yes"
WITH_COVERAGE: "no"
WITH_EXAMPLES: "yes"
# template for build jobs
.build_template_def: &build_template
stage: build
script:
- export MAKEFLAGS=-j$(grep "core id" /proc/cpuinfo | wc -l)
- mkdir -p "./$BUILD_TYPE"
- pushd "./$BUILD_TYPE"
- cmake ..
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=$(pwd)/${BUILD_TYPE}_install_prefix
-DWITH_CUDA=${WITH_CUDA}
-DWITH_CUDA_ARCH=${WITH_CUDA_ARCH}
-DWITH_MIC=${WITH_MIC}
-DWITH_TESTS=${WITH_TESTS}
-DWITH_COVERAGE=${WITH_COVERAGE}
-DWITH_EXAMPLES=${WITH_EXAMPLES}
- make
- make test
- make install
# clean to save disk space on the runner
- popd
- rm -rf "./$BUILD_TYPE"
variables:
<<: *default_cmake_flags
BUILD_TYPE: Debug
base_Debug:
<<: *build_template
base_Release:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Release
# TODO
#openmp:
# <<: *build_template
# tags:
# - openmp
# variables:
# WITH_OPENMP: "yes"
cuda_Debug:
<<: *build_template
tags:
- gpu
variables:
<<: *default_cmake_flags
WITH_CUDA: "yes"
BUILD_TYPE: Debug
cuda_Release:
<<: *build_template
tags:
- gpu
variables:
<<: *default_cmake_flags
WITH_CUDA: "yes"
BUILD_TYPE: Release
#openmp+cuda:
# <<: *build_template
# tags:
# - openmp
# - gpu
# variables:
# TODO
# WITH_OPENMP: "yes"
# WITH_CUDA: "yes"