From: Paul Bauer Date: Thu, 6 May 2021 09:35:44 +0000 (+0000) Subject: Use more modern clang for linters and sanitizers X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=82860efede444213f6ea51e3d29e3652690f3ede;p=alexxy%2Fgromacs.git Use more modern clang for linters and sanitizers --- diff --git a/admin/clang-format.sh b/admin/clang-format.sh index 36fc12d9e3..4a2fc71327 100755 --- a/admin/clang-format.sh +++ b/admin/clang-format.sh @@ -2,7 +2,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2019,2020, by the GROMACS development team, led by +# Copyright (c) 2019,2020,2021, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -98,15 +98,15 @@ then if [ -z "$CLANG_FORMAT" ] then echo "Please set the path to clang-format using the git hook" - echo "git config hooks.clangformatpath /path/to/clang-format" + echo "git config hooks.clangformatpath /path/to/clang-format-11" echo "or by setting an environment variable, e.g." - echo "CLANG_FORMAT=/path/to/clang-format" + echo "CLANG_FORMAT=/path/to/clang-format-11" echo "See docs/dev-manual/code-formatting.rst for how to get clang-format." exit 2 fi if ! which "$CLANG_FORMAT" 1>/dev/null then - echo "clang-format not found: $CLANG_FORMAT" + echo "clang-format-11 not found: $CLANG_FORMAT" exit 2 fi fi diff --git a/admin/clang-tidy.sh b/admin/clang-tidy.sh index 9668b506e8..b7f770d87e 100755 --- a/admin/clang-tidy.sh +++ b/admin/clang-tidy.sh @@ -2,7 +2,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2020, by the GROMACS development team, led by +# Copyright (c) 2020,2021, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -107,12 +107,12 @@ then echo "Please set the path to run-clang-tidy using the git hook" echo "git config hooks.runclangtidypath /path/to/run-clang-tidy-9.py" echo "or by setting an environment variable, e.g." - echo "RUN_CLANG_TIDY=/path/to/run-clang-tidy-9.py" + echo "RUN_CLANG_TIDY=/path/to/run-clang-tidy-11.py" exit 2 fi if ! which "$RUN_CLANG_TIDY" 1>/dev/null then - echo "run-clang-tidy-9.py not found: $RUN_CLANG_TIDY" + echo "run-clang-tidy-11.py not found: $RUN_CLANG_TIDY" exit 2 fi fi diff --git a/admin/git-pre-commit b/admin/git-pre-commit index e6506adaa1..f20e930d7d 100755 --- a/admin/git-pre-commit +++ b/admin/git-pre-commit @@ -88,7 +88,7 @@ then if [ -z "$runclangtidy_path" ] then echo "Please set the path to run-clang-tidy using 'git config hooks.runclangtidypath'." - echo "Note that you need at least clang-tidy-9." + echo "Note that you should use clang-tidy-11 to get the same checking as in CI." exit 1 fi export RUN_CLANG_TIDY="$runclangtidy_path" diff --git a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-ASAN.gitlab-ci.yml b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-ASAN.gitlab-ci.yml index cf3f98e97a..78d0dcec3c 100644 --- a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-ASAN.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-ASAN.gitlab-ci.yml @@ -7,7 +7,7 @@ # Scope: configure, build, unit tests, regression tests # Test implementation choices (free to change as needed): # OS: Ubuntu 18.04 -# Compiler: Clang 8 +# Compiler: Clang 11 # MPI: thread_MPI # SIMD: AVX2_256 # FFT: FFTW3 @@ -18,10 +18,10 @@ gromacs:clang-ASAN:configure: - .gromacs:base:configure - .use-clang:base - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake - COMPILER_MAJOR_VERSION: 8 + COMPILER_MAJOR_VERSION: 11 CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=ASAN" gromacs:clang-ASAN:build: @@ -31,7 +31,7 @@ gromacs:clang-ASAN:build: - .use-clang:base - .use-ccache - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake tags: @@ -44,7 +44,7 @@ gromacs:clang-ASAN:test: - .gromacs:base:test - .use-clang:base - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake CTEST_RUN_MODE: "ExperimentalMemCheck" @@ -58,7 +58,7 @@ gromacs:clang-ASAN:regressiontest: - .gromacs:base:regressiontest - .use-clang:base - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake tags: diff --git a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-TSAN.gitlab-ci.yml b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-TSAN.gitlab-ci.yml index e44f168cc3..0ea46d802f 100644 --- a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-TSAN.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-TSAN.gitlab-ci.yml @@ -7,7 +7,7 @@ # Scope: configure, build, unit tests, regression tests # Test implementation choices (free to change as needed): # OS: Ubuntu 18.04 -# Compiler: Clang 8 +# Compiler: Clang 11 # MPI: thread_MPI # SIMD: AVX2_256 # FFT: FFTW3 @@ -18,10 +18,10 @@ gromacs:clang-TSAN:configure: - .gromacs:base:configure - .use-clang:base - .rules:merge-and-post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.17.2/bin/cmake - COMPILER_MAJOR_VERSION: 8 + COMPILER_MAJOR_VERSION: 11 CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=TSAN" gromacs:clang-TSAN:build: @@ -31,7 +31,7 @@ gromacs:clang-TSAN:build: - .use-clang:base - .use-ccache - .rules:merge-and-post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.17.2/bin/cmake needs: @@ -41,7 +41,7 @@ gromacs:clang-TSAN:test: extends: - .gromacs:base:test - .rules:post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.17.2/bin/cmake needs: @@ -51,7 +51,7 @@ gromacs:clang-TSAN:regressiontest: extends: - .gromacs:base:regressiontest - .rules:post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.17.2/bin/cmake tags: diff --git a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-UBSAN.gitlab-ci.yml b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-UBSAN.gitlab-ci.yml index 46dc34c879..75bbd7a00d 100644 --- a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-UBSAN.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-UBSAN.gitlab-ci.yml @@ -7,7 +7,7 @@ # Scope: configure, build, unit tests # Test implementation choices (free to change as needed): # OS: Ubuntu 18.04 -# Compiler: Clang 8 +# Compiler: Clang 11 # MPI: thread_MPI # SIMD: AVX2_256 # FFT: FFTW3 @@ -18,10 +18,10 @@ gromacs:clang-UBSAN:configure: - .gromacs:base:configure - .use-clang:base - .rules:merge-and-post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake - COMPILER_MAJOR_VERSION: 8 + COMPILER_MAJOR_VERSION: 11 CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=UBSAN" gromacs:clang-UBSAN:build: @@ -31,7 +31,7 @@ gromacs:clang-UBSAN:build: - .use-clang:base - .use-ccache - .rules:merge-and-post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake tags: @@ -44,7 +44,7 @@ gromacs:clang-UBSAN:test: - .gromacs:base:test - .use-clang:base - .rules:post-merge-acceptance - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.18.4/bin/cmake tags: diff --git a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-static-analyzer.gitlab-ci.yml b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-static-analyzer.gitlab-ci.yml index d49f8d3a33..61ea460f0f 100644 --- a/admin/gitlab-ci/gromacs.matrix/gromacs.clang-static-analyzer.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.matrix/gromacs.clang-static-analyzer.gitlab-ci.yml @@ -17,7 +17,7 @@ gromacs:clang-static-analyzer:configure: - .gromacs:base:configure - .use-clang:base - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake CMAKE_COMPILER_SCRIPT: "-DCMAKE_CXX_COMPILER=/usr/local/libexec/c++-analyzer -DCMAKE_C_COMPILER=gcc" @@ -31,7 +31,7 @@ gromacs:clang-static-analyzer:build: - .use-clang:base - .use-ccache - .rules:merge-requests - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-tsan + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake tags: diff --git a/admin/gitlab-ci/lint.gitlab-ci.yml b/admin/gitlab-ci/lint.gitlab-ci.yml index 7147b368c0..799cb53893 100644 --- a/admin/gitlab-ci/lint.gitlab-ci.yml +++ b/admin/gitlab-ci/lint.gitlab-ci.yml @@ -5,10 +5,10 @@ clang-tidy:configure-push: - .gromacs:base:configure - .use-clang:base - .rules:basic-push - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9 + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake - COMPILER_MAJOR_VERSION: 9 + COMPILER_MAJOR_VERSION: 11 BUILD_DIR: build-clang-tidy CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON @@ -17,10 +17,10 @@ clang-tidy:configure-schedule: - .gromacs:base:configure - .use-clang:base - .rules:nightly-not-for-release - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9 + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake - COMPILER_MAJOR_VERSION: 9 + COMPILER_MAJOR_VERSION: 11 BUILD_DIR: build-clang-tidy CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON @@ -31,7 +31,7 @@ clang-tidy:build: - .variables:default - .rules:nightly-not-for-release stage: source-check - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9 + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan needs: - job: clang-tidy:configure-schedule variables: @@ -44,12 +44,12 @@ clang-tidy:test: - .variables:default - .rules:basic-push stage: source-check - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9 + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan needs: - job: clang-tidy:configure-push variables: CMAKE: /usr/local/cmake-3.16.3/bin/cmake - COMPILER_MAJOR_VERSION: 9 + COMPILER_MAJOR_VERSION: 11 BUILD_DIR: build-clang-tidy EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION KUBERNETES_CPU_LIMIT: 4 @@ -81,9 +81,9 @@ clang-format: - .rules:basic-push cache: {} stage: pre-build - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-7-docs + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: - COMPILER_MAJOR_VERSION: 7 + COMPILER_MAJOR_VERSION: 11 KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_REQUEST: 2Gi @@ -112,7 +112,7 @@ copyright-check: - .rules:basic-push cache: {} stage: pre-build - image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-7-docs + image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1