Update to oneAPI beta09
[alexxy/gromacs.git] / admin / gitlab-ci / global.gitlab-ci.yml
1 # Mix-in job definitions.
2 # The (hidden) job definitions in this file are available to the regular job
3 # definitions in other files because this file is first in the *include* list
4 # in the root `.gitlab-ci.yml` file.
5
6 # Centralized definitions of common job parameter values.
7 # Parameters with many optional configurations may be in separate files.
8 # Refer to the Infrastructure section of the GROMACS Developer Guide.
9
10 .variables:default:
11   variables:
12     KUBERNETES_CPU_LIMIT: 8
13     KUBERNETES_CPU_REQUEST: 4
14     KUBERNETES_MEMORY_REQUEST: 4Gi
15     KUBERNETES_MEMORY_LIMIT: 8Gi
16     KUBERNETES_EXTENDED_RESOURCE_NAME: ""
17     KUBERNETES_EXTENDED_RESOURCE_LIMIT: 0
18     CACHE_FALLBACK_KEY: "$CI_JOB_NAME-$CI_JOB_STAGE-master"
19     BUILD_DIR: build
20     INSTALL_DIR: install
21     CMAKE_GMXAPI_OPTIONS: ""
22
23 # Our generic before_script to install dependencies and prepare the ccache directory.
24 .before_script:default:
25   before_script:
26     - mkdir -p ccache
27     - export CCACHE_BASEDIR=${PWD}
28     - export CCACHE_DIR=${PWD}/ccache
29
30 # Behavioral templates
31
32 # Use a persistent compiler cache to speed up rebuilds for a single job.
33 .use-ccache:
34   cache:
35     key: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
36     paths:
37       - ccache/
38
39 # Tool chains
40
41 .use-cuda:
42   variables:
43     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
44     CMAKE_GPU_OPTIONS: -DGMX_GPU=CUDA
45
46 .use-mpi:
47   variables:
48     CMAKE_MPI_OPTIONS: "-DGMX_MPI=ON"
49
50 .use-opencl:
51   variables:
52     CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
53     CMAKE_GPU_OPTIONS: -DGMX_GPU=OpenCL
54
55 # Base definition for using gcc.
56 .use-gcc:base:
57   variables:
58     CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=gcc-$COMPILER_MAJOR_VERSION -DCMAKE_CXX_COMPILER=g++-$COMPILER_MAJOR_VERSION
59   before_script:
60     - mkdir -p ccache
61     - export CCACHE_BASEDIR=${PWD}
62     - export CCACHE_DIR=${PWD}/ccache
63
64 # Base definition for using clang.
65 .use-clang:base:
66   variables:
67     CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=clang-$COMPILER_MAJOR_VERSION -DCMAKE_CXX_COMPILER=clang++-$COMPILER_MAJOR_VERSION
68   before_script:
69     - mkdir -p ccache
70     - export CCACHE_BASEDIR=${PWD}
71     - export CCACHE_DIR=${PWD}/ccache
72     - export ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer
73
74 # Base definition for using oneAPI.
75 .use-oneapi:base:
76   variables:
77     # Use the HPC variants of icc and icpc so that OpenMP is active
78     CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_INCLUDE_PATH=/opt/intel/oneapi/compiler/latest/linux/include/sycl -DCMAKE_PREFIX_PATH=/opt/intel/oneapi/compiler/latest/linux
79     CMAKE_EXTRA_OPTIONS: -DGMX_FFT_LIBRARY=mkl
80   before_script:
81     # Necessary to override gitlab default 'set -e' which breaks Intel's
82     # setvar.sh script
83     - set +e
84     - source /opt/intel/oneapi/setvars.sh
85     - set -e
86     - mkdir -p ccache
87     - export CCACHE_BASEDIR=${PWD}
88     - export CCACHE_DIR=${PWD}/ccache