mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-27 09:00:16 -06:00
The `native` architecture compiles for the host's GPUs, but our CI jobs
may may run on hosts with GPUs newer than supported by their version of
the CUDA toolkit. Add an undocumented environment variable to tell
CMake to clamp the native architecture to that supported by the toolkit.
Without this, we may try to compile for architectures not supported by
the CUDA Toolkit, which fails. Since commit d1b48bfabd (CUDA: Add
support for CUDA_ARCHITECTURES=native, 2022-03-04), our CUDA 9.2 CI job
fails when it runs on a CI host with a GPU architecture newer than that
CUDA 9.2 supports. Clamping the architecture level fixes that.
Do not document this clamp behavior publicly, at least for now.
Users can be responsible for building with a CUDA toolkit recent
enough to support their host's GPUs.
Issue: #22375
544 lines
13 KiB
YAML
544 lines
13 KiB
YAML
# Linux-specific builder configurations and build commands
|
|
|
|
## Base images
|
|
|
|
### Release
|
|
|
|
.linux_prep_source:
|
|
image: "fedora:35"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
|
|
.linux_release_x86_64:
|
|
image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
|
|
CMAKE_ARCH: x86_64
|
|
|
|
.linux_release_aarch64:
|
|
image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
LAUNCHER: "scl enable devtoolset-7 --"
|
|
CMAKE_ARCH: aarch64
|
|
|
|
.linux_package:
|
|
variables:
|
|
BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"'
|
|
|
|
.needs_centos6_x86_64:
|
|
dependencies:
|
|
- b:centos6-x86_64
|
|
needs:
|
|
- b:centos6-x86_64
|
|
|
|
.needs_centos7_aarch64:
|
|
dependencies:
|
|
- b:centos7-aarch64
|
|
needs:
|
|
- b:centos7-aarch64
|
|
|
|
### Debian
|
|
|
|
.debian10:
|
|
image: "kitware/cmake:ci-debian10-x86_64-2022-02-25"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: x86_64
|
|
|
|
.debian10_iwyu:
|
|
extends: .debian10
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_iwyu
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CMAKE_CI_NO_INSTALL: 1
|
|
|
|
.debian10_aarch64:
|
|
image: "kitware/cmake:ci-debian10-aarch64-2022-02-21"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: aarch64
|
|
|
|
### Fedora
|
|
|
|
.fedora35:
|
|
image: "kitware/cmake:ci-fedora35-x86_64-2022-02-21"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
|
|
CMAKE_ARCH: x86_64
|
|
|
|
#### Lint builds
|
|
|
|
.fedora35_tidy:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_tidy
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CMAKE_CI_NO_INSTALL: 1
|
|
|
|
.fedora35_clang_analyzer:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_clang_analyzer
|
|
CMAKE_CI_BUILD_TYPE: Debug
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CMAKE_CI_NO_INSTALL: 1
|
|
|
|
.fedora35_sphinx:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_sphinx
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
|
|
CMAKE_CI_NO_INSTALL: 1
|
|
|
|
.fedora35_sphinx_package:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_sphinx_package
|
|
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
|
|
|
|
#### Build and test
|
|
|
|
.debian10_ninja:
|
|
extends: .debian10
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_ninja
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.debian10_aarch64_ninja:
|
|
extends: .debian10_aarch64
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_aarch64_ninja
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.debian10_makefiles_inplace:
|
|
extends: .debian10
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_makefiles_inplace
|
|
CMAKE_GENERATOR: "Unix Makefiles"
|
|
CMAKE_CI_BOOTSTRAP: 1
|
|
CMAKE_CI_INPLACE: 1
|
|
CMAKE_CI_NO_INSTALL: 1
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.fedora35_ninja:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_ninja
|
|
CMAKE_CI_BUILD_TYPE: Release
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.fedora35_ninja_multi:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_ninja_multi
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CMAKE_GENERATOR: "Ninja Multi-Config"
|
|
|
|
.fedora35_makefiles:
|
|
extends: .fedora35
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_makefiles
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
CMAKE_GENERATOR: "Unix Makefiles"
|
|
|
|
### Clang Compiler
|
|
|
|
.debian10_makefiles_clang:
|
|
extends: .debian10
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_makefiles_clang
|
|
CMAKE_GENERATOR: "Unix Makefiles"
|
|
|
|
.debian10_ninja_clang:
|
|
extends: .debian10
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: debian10_ninja_clang
|
|
|
|
### Sanitizers
|
|
|
|
.fedora_memcheck:
|
|
variables:
|
|
CMAKE_CI_BUILD_TYPE: RelWithDebInfo
|
|
|
|
.fedora_asan_addon:
|
|
extends: .fedora_memcheck
|
|
|
|
variables:
|
|
CTEST_MEMORYCHECK_TYPE: AddressSanitizer
|
|
CTEST_MEMORYCHECK_SANITIZER_OPTIONS: ""
|
|
|
|
.fedora35_asan:
|
|
extends:
|
|
- .fedora35
|
|
- .fedora_asan_addon
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: fedora35_asan
|
|
|
|
### Intel Compiler
|
|
|
|
.intelcompiler:
|
|
image: "kitware/intelcompiler:$CMAKE_CI_INTELCOMPILER_IMAGE_TAG"
|
|
environment:
|
|
name: intel-compiler
|
|
variables:
|
|
CMAKE_ARCH: x86_64
|
|
|
|
.intelclassic_makefiles:
|
|
extends: .intelcompiler
|
|
variables:
|
|
CMAKE_CONFIGURATION: intelclassic_makefiles
|
|
CMAKE_GENERATOR: "Unix Makefiles"
|
|
|
|
.inteloneapi_makefiles:
|
|
extends: .intelcompiler
|
|
variables:
|
|
CMAKE_CONFIGURATION: inteloneapi_makefiles
|
|
CMAKE_GENERATOR: "Unix Makefiles"
|
|
|
|
### CUDA builds
|
|
|
|
.cuda9.2:
|
|
image: "kitware/cmake:ci-cuda9.2-x86_64-2021-10-01"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: x86_64
|
|
CTEST_LABELS: "CUDA"
|
|
CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1
|
|
|
|
.cuda9.2_nvidia:
|
|
extends: .cuda9.2
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: cuda9.2_nvidia
|
|
CMAKE_GENERATOR: "Ninja Multi-Config"
|
|
|
|
.cuda10.2:
|
|
image: "kitware/cmake:ci-cuda10.2-x86_64-2021-06-16"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: x86_64
|
|
CTEST_LABELS: "CUDA"
|
|
CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1
|
|
|
|
.cuda10.2_nvidia:
|
|
extends: .cuda10.2
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: cuda10.2_nvidia
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.cuda10.2_clang:
|
|
extends: .cuda10.2
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: cuda10.2_clang
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.cuda11.6:
|
|
image: "kitware/cmake:ci-cuda11.6-x86_64-2022-02-28"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: x86_64
|
|
CTEST_LABELS: "CUDA"
|
|
CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1
|
|
|
|
.cuda11.6_nvidia:
|
|
extends: .cuda11.6
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: cuda11.6_nvidia
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
.cuda11.6_clang:
|
|
extends: .cuda11.6
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: cuda11.6_clang
|
|
CTEST_NO_WARNINGS_ALLOWED: 1
|
|
|
|
### HIP builds
|
|
|
|
.hip4.2:
|
|
image: "kitware/cmake:ci-hip4.2-x86_64-2021-07-09"
|
|
|
|
variables:
|
|
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
|
|
CMAKE_ARCH: x86_64
|
|
CTEST_LABELS: "HIP"
|
|
|
|
.hip4.2_radeon:
|
|
extends: .hip4.2
|
|
|
|
variables:
|
|
CMAKE_CONFIGURATION: hip4.2_radeon
|
|
CMAKE_GENERATOR: "Ninja Multi-Config"
|
|
|
|
## Tags
|
|
|
|
.linux_builder_tags:
|
|
tags:
|
|
- cmake
|
|
- build
|
|
- docker
|
|
- linux
|
|
|
|
.linux_builder_tags_qt:
|
|
tags:
|
|
- cmake
|
|
- build
|
|
- docker
|
|
- linux
|
|
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
|
|
|
|
.linux_builder_tags_x11:
|
|
tags:
|
|
- cmake
|
|
- docker
|
|
- linux
|
|
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
|
|
- x11
|
|
|
|
.linux_builder_tags_cuda:
|
|
tags:
|
|
- cmake
|
|
- cuda-rt
|
|
- docker
|
|
- linux
|
|
|
|
.linux_builder_tags_radeon:
|
|
tags:
|
|
- cmake
|
|
- radeon
|
|
- docker
|
|
- linux
|
|
|
|
.linux_builder_tags_aarch64:
|
|
tags:
|
|
- cmake
|
|
- build
|
|
- docker
|
|
- linux-aarch64
|
|
|
|
.linux_builder_tags_aarch64_qt:
|
|
tags:
|
|
- cmake
|
|
- build
|
|
- docker
|
|
- linux-aarch64
|
|
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
|
|
|
|
## Linux-specific scripts
|
|
|
|
.before_script_linux: &before_script_linux
|
|
- source .gitlab/ci/env.sh
|
|
- .gitlab/ci/cmake.sh
|
|
- export PATH=$PWD/.gitlab/cmake/bin:$PATH
|
|
- .gitlab/ci/ninja.sh
|
|
- export PATH=$PWD/.gitlab:$PATH
|
|
- cmake --version
|
|
- ninja --version
|
|
|
|
.cmake_prep_source_linux:
|
|
stage: prep
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- dnf install --setopt=install_weak_deps=False -y git-core
|
|
- v="$(.gitlab/ci/cmake_version.sh)"
|
|
- mkdir -p build/
|
|
- git archive --format=tgz "--prefix=cmake-$v/" -o "build/cmake-$v.tar.gz" HEAD
|
|
- git -c core.autocrlf=true -c core.eol=crlf archive --format=zip --prefix="cmake-$v/" -o "build/cmake-$v.zip" HEAD
|
|
|
|
interruptible: true
|
|
|
|
.cmake_prep_doc_linux:
|
|
stage: prep
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
|
|
|
interruptible: true
|
|
|
|
.cmake_codespell_linux:
|
|
stage: build
|
|
extends: .fedora35
|
|
script:
|
|
- codespell
|
|
interruptible: true
|
|
|
|
.cmake_build_linux:
|
|
stage: build
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- .gitlab/ci/sccache.sh
|
|
- sccache --start-server
|
|
- sccache --show-stats
|
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
|
- sccache --show-stats
|
|
|
|
interruptible: true
|
|
|
|
.cmake_test_linux:
|
|
stage: test
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake"
|
|
|
|
interruptible: true
|
|
|
|
.cmake_memcheck_linux:
|
|
stage: test
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_memcheck.cmake"
|
|
|
|
interruptible: true
|
|
|
|
.cmake_build_linux_release:
|
|
stage: build
|
|
|
|
script:
|
|
- source .gitlab/ci/env.sh
|
|
# Bootstrap.
|
|
- mkdir -p build/
|
|
# Exclude documentation. A job dependency provides it for packaging.
|
|
- sed '/^# Build doc/,/^$/d' Utilities/Release/linux/$CMAKE_ARCH/cache.txt > build/CMakeCache.txt
|
|
# Make sccache available.
|
|
- .gitlab/ci/sccache.sh
|
|
- export PATH=$PWD/.gitlab:$PATH
|
|
# Append sccache settings to the cache.
|
|
- echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
|
|
- echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
|
|
# CI settings.
|
|
- echo "CMake_TEST_INSTALL:BOOL=OFF" >> build/CMakeCache.txt
|
|
- echo "CMAKE_INSTALL_PREFIX:PATH=$PWD/build/install" >> build/CMakeCache.txt
|
|
- echo "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY:BOOL=ON" >> build/CMakeCache.txt
|
|
# Appease Git. The Git in this container is old (1.7) and doesn't
|
|
# understand some things. But, it doesn't need to, so make it blind.
|
|
- mkdir -p .git/info
|
|
- echo "* -crlf" >> .git/info/attributes
|
|
- git reset --hard
|
|
# Bootstrap
|
|
- cd build/
|
|
- '$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake $BOOTSTRAP_ARGS'
|
|
# FIXME: When CTest can drive an external CMake for the build as well,
|
|
# use the scripts here.
|
|
- "$LAUNCHER make -j$(nproc)"
|
|
# NOTE: This regex matches that used in the release build.
|
|
- "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|CMakeServerLib\\.|RunCMake\\.ctest_memcheck)'"
|
|
# Make a package.
|
|
- bin/cpack -G TGZ
|
|
- bin/cpack -G STGZ
|
|
- sccache --show-stats
|
|
|
|
interruptible: true
|
|
|
|
.cmake_build_linux_standalone:
|
|
stage: build
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- .gitlab/ci/sccache.sh
|
|
- sccache --start-server
|
|
- sccache --show-stats
|
|
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake"
|
|
- sccache --show-stats
|
|
|
|
interruptible: true
|
|
|
|
.cmake_test_linux_release:
|
|
stage: test-ext
|
|
|
|
script:
|
|
- *before_script_linux
|
|
# Make the CMake package available.
|
|
- mkdir -p build/install
|
|
- tar -C build/install --strip-components=1 -xzf build/cmake-*-linux-$CMAKE_ARCH.tar.gz
|
|
- .gitlab/ci/sccache.sh
|
|
- sccache --start-server
|
|
- sccache --show-stats
|
|
- "$LAUNCHER build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake"
|
|
- sccache --show-stats
|
|
|
|
interruptible: true
|
|
|
|
.cmake_test_linux_external:
|
|
stage: test-ext
|
|
|
|
script:
|
|
- *before_script_linux
|
|
- .gitlab/ci/sccache.sh
|
|
- sccache --start-server
|
|
- sccache --show-stats
|
|
- "$LAUNCHER build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake"
|
|
- sccache --show-stats
|
|
|
|
interruptible: true
|
|
|
|
.cmake_test_linux_intelclassic_makefiles:
|
|
extends:
|
|
- .intelclassic_makefiles
|
|
- .cmake_test_linux_release
|
|
- .linux_builder_tags_qt
|
|
- .run_manually
|
|
- .needs_centos6_x86_64
|
|
variables:
|
|
CMAKE_CI_JOB_NIGHTLY: "true"
|
|
|
|
.cmake_test_linux_inteloneapi_makefiles:
|
|
extends:
|
|
- .inteloneapi_makefiles
|
|
- .cmake_test_linux_release
|
|
- .linux_builder_tags_qt
|
|
- .run_manually
|
|
- .needs_centos6_x86_64
|
|
variables:
|
|
CMAKE_CI_JOB_NIGHTLY: "true"
|
|
|
|
### Documentation
|
|
|
|
.cmake_org_help:
|
|
stage: build
|
|
extends:
|
|
- .fedora35
|
|
- .linux_builder_tags
|
|
- .cmake_org_help_artifacts
|
|
script:
|
|
- *before_script_linux
|
|
- mkdir -p build/
|
|
- cd build/
|
|
- cmake ../Utilities/Sphinx -GNinja -DSPHINX_HTML=ON -DSPHINX_FLAGS="-A versionswitch=1"
|
|
- ninja
|