Newer
Older
# 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"
# configurations
WITH_TESTS: "no"
Jakub Klinkovský
committed
WITH_BENCHMARKS: "no"
WITH_EXAMPLES: "no"
WITH_TOOLS: "no"
WITH_PYTHON: "no"
# template for build jobs
.build_template_def: &build_template
stage: build
script:
Jakub Klinkovský
committed
# all cores including hyperthreading
# - export NUM_CORES=$(grep "core id" /proc/cpuinfo | wc -l)
# # all pyhsical cores
- export NUM_CORES=$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
# ninja does not have -l
# - export MAKEFLAGS="-l$(echo 1.5*$NUM_CORES | bc) -j$NUM_CORES"
- export NINJAFLAGS="-j$NUM_CORES"
- export CTEST_OUTPUT_ON_FAILURE=1
- mkdir -p "./builddir/$CI_JOB_NAME"
- pushd "./builddir/$CI_JOB_NAME"
- 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}
Jakub Klinkovský
committed
-DWITH_BENCHMARKS=${WITH_BENCHMARKS}
Jakub Klinkovský
committed
-DWITH_TOOLS=${WITH_TOOLS}
-DWITH_PYTHON=${WITH_PYTHON}
# "install" implies the "all" target
# - make test
- ninja ${NINJAFLAGS} install
- if [[ ${WITH_TESTS} == "yes" ]]; then
ninja test;
fi
- popd
variables:
<<: *default_cmake_flags
BUILD_TYPE: Debug
# Cuda builds are specified first because they take more time than host-only builds,
# which can be allocated on hosts whitout GPUs.
# Similarly, release builds are launched first to avoid the tail effect (they take
# significantly more time than debug builds).
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
cuda_tests_Debug:
<<: *build_template
tags:
- openmp
- gpu
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
BUILD_TYPE: Debug
WITH_TESTS: "yes"
cuda_tests_Release:
<<: *build_template
tags:
- openmp
- gpu
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
BUILD_TYPE: Release
WITH_TESTS: "yes"
cuda_examples_Debug:
<<: *build_template
tags:
- openmp
- gpu
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
BUILD_TYPE: Debug
WITH_EXAMPLES: "yes"
cuda_examples_Release:
- gpu
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
BUILD_TYPE: Release
WITH_EXAMPLES: "yes"
cuda_benchmarks_tools_python_Debug:
<<: *build_template
tags:
- openmp
- gpu
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
BUILD_TYPE: Debug
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
cuda_benchmarks_tools_python_Release:
variables:
<<: *default_cmake_flags
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
cuda_mpi_tests_Debug:
<<: *build_template
tags:
- openmp
- gpu
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Debug
WITH_TESTS: "yes"
cuda_mpi_tests_Release:
<<: *build_template
tags:
- openmp
- gpu
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Release
WITH_TESTS: "yes"
cuda_mpi_examples_Debug:
variables:
<<: *default_cmake_flags
Jakub Klinkovský
committed
WITH_EXAMPLES: "yes"
cuda_mpi_examples_Release:
<<: *build_template
tags:
variables:
<<: *default_cmake_flags
WITH_CUDA: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Release
WITH_EXAMPLES: "yes"
cuda_mpi_benchmarks_tools_python_Debug:
<<: *build_template
tags:
- openmp
- gpu
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_CUDA: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Debug
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
cuda_mpi_benchmarks_tools_python_Release:
variables:
<<: *default_cmake_flags
WITH_MPI: "yes"
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
BUILD_TYPE: Release
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
default_tests_Debug:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Debug
WITH_TESTS: "yes"
default_tests_Release:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Release
WITH_TESTS: "yes"
default_examples_Debug:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Debug
WITH_EXAMPLES: "yes"
default_examples_Release:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Release
WITH_EXAMPLES: "yes"
default_benchmarks_tools_python_Debug:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Debug
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
default_benchmarks_tools_python_Release:
<<: *build_template
variables:
<<: *default_cmake_flags
BUILD_TYPE: Release
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
tags:
- openmp
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Debug
WITH_TESTS: "yes"
tags:
- openmp
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_MPI: "yes"
<<: *build_template
tags:
- openmp
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Debug
WITH_EXAMPLES: "yes"
mpi_examples_Release:
<<: *build_template
tags:
- openmp
- mpi
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
WITH_MPI: "yes"
BUILD_TYPE: Release
WITH_EXAMPLES: "yes"
mpi_benchmarks_tools_python_Debug:
<<: *build_template
tags:
- openmp
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
Jakub Klinkovský
committed
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"
mpi_benchmarks_tools_python_Release:
<<: *build_template
tags:
- openmp
variables:
<<: *default_cmake_flags
WITH_OPENMP: "yes"
Jakub Klinkovský
committed
WITH_BENCHMARKS: "yes"
WITH_TOOLS: "yes"
WITH_PYTHON: "yes"