From 6179e265d9a891d78f9b87ffb5e5f4ff0c573ed4 Mon Sep 17 00:00:00 2001 From: Vladyslav Usenko Date: Wed, 21 Oct 2020 13:27:22 +0200 Subject: [PATCH] Update to clang-11 --- doc/DevSetup.md | 10 +++++----- docker/b_image_bionic/Dockerfile | 4 ++-- docker/b_image_focal/Dockerfile | 4 ++-- scripts/clang-format-all.sh | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/DevSetup.md b/doc/DevSetup.md index 9f8f180..c698247 100644 --- a/doc/DevSetup.md +++ b/doc/DevSetup.md @@ -1,14 +1,14 @@ ### Clang-format -We use clang-format to maintain a consistent formating of the code. Since there are small differences between different version of clang-format we use version 10 on all platforms. +We use clang-format to maintain a consistent formating of the code. Since there are small differences between different version of clang-format we use version 11 on all platforms. -On **Ubuntu 20.04 or 18.04** run the following commands to install clang-format-10 +On **Ubuntu 20.04 or 18.04** run the following commands to install clang-format-11 ``` wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - -sudo sh -c 'echo "deb http://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-10 main" > /etc/apt/sources.list.d/llvm10.list' +sudo sh -c 'echo "deb http://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-11 main" > /etc/apt/sources.list.d/llvm11.list' sudo apt-get update -sudo apt-get install clang-format-10 +sudo apt-get install clang-format-11 ``` On **MacOS** [Homebrew](https://brew.sh/) should install the right version of clang-format: @@ -53,7 +53,7 @@ Go to `Tools` -> `Options` and select the Beautifier tab. There select ClangForm ![qt_creator_beautifier_general](/doc/img/qt_creator_beautifier_general.png) -Select file as predefined style in `Clang Format` tab. Also select `None` as the fallback style. For **Ubuntu 20.04 or 18.04** change the executable name to `/usr/bin/clang-format-10`. +Select file as predefined style in `Clang Format` tab. Also select `None` as the fallback style. For **Ubuntu 20.04 or 18.04** change the executable name to `/usr/bin/clang-format-11`. ![qt_creator_beautifier_clang_format](/doc/img/qt_creator_beautifier_clang_format.png) diff --git a/docker/b_image_bionic/Dockerfile b/docker/b_image_bionic/Dockerfile index e051b82..f16e50b 100644 --- a/docker/b_image_bionic/Dockerfile +++ b/docker/b_image_bionic/Dockerfile @@ -3,9 +3,9 @@ FROM ubuntu:18.04 RUN apt-get update && apt-get install -y wget gnupg RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - -RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" > /etc/apt/sources.list.d/llvm10.list +RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" > /etc/apt/sources.list.d/llvm11.list RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE RUN echo "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" > /etc/apt/sources.list.d/realsense.list -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cmake git libtbb-dev libeigen3-dev libglew-dev ccache libjpeg-dev libpng-dev openssh-client liblz4-dev libbz2-dev libboost-regex-dev libboost-filesystem-dev libboost-date-time-dev libboost-program-options-dev libopencv-dev libpython2.7-dev libgtest-dev lsb-core gcovr ggcov lcov librealsense2-dev librealsense2-gl-dev librealsense2-dkms librealsense2-utils doxygen graphviz libsuitesparse-dev clang-10 clang-format-10 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cmake git libtbb-dev libeigen3-dev libglew-dev ccache libjpeg-dev libpng-dev openssh-client liblz4-dev libbz2-dev libboost-regex-dev libboost-filesystem-dev libboost-date-time-dev libboost-program-options-dev libopencv-dev libpython2.7-dev libgtest-dev lsb-core gcovr ggcov lcov librealsense2-dev librealsense2-gl-dev librealsense2-dkms librealsense2-utils doxygen graphviz libsuitesparse-dev clang-11 clang-format-11 diff --git a/docker/b_image_focal/Dockerfile b/docker/b_image_focal/Dockerfile index d7f4711..d8d2735 100644 --- a/docker/b_image_focal/Dockerfile +++ b/docker/b_image_focal/Dockerfile @@ -3,9 +3,9 @@ FROM ubuntu:20.04 RUN apt-get update && apt-get install -y wget gnupg RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - -RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" > /etc/apt/sources.list.d/llvm10.list +RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" > /etc/apt/sources.list.d/llvm11.list RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE RUN echo "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" > /etc/apt/sources.list.d/realsense.list -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cmake git libtbb-dev libeigen3-dev libglew-dev ccache libjpeg-dev libpng-dev openssh-client liblz4-dev libbz2-dev libboost-regex-dev libboost-filesystem-dev libboost-date-time-dev libboost-program-options-dev libopencv-dev libpython2.7-dev libgtest-dev lsb-core gcovr ggcov lcov librealsense2-dev librealsense2-gl-dev librealsense2-dkms librealsense2-utils doxygen graphviz libsuitesparse-dev clang-10 clang-format-10 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cmake git libtbb-dev libeigen3-dev libglew-dev ccache libjpeg-dev libpng-dev openssh-client liblz4-dev libbz2-dev libboost-regex-dev libboost-filesystem-dev libboost-date-time-dev libboost-program-options-dev libopencv-dev libpython2.7-dev libgtest-dev lsb-core gcovr ggcov lcov librealsense2-dev librealsense2-gl-dev librealsense2-dkms librealsense2-utils doxygen graphviz libsuitesparse-dev clang-11 clang-format-11 diff --git a/scripts/clang-format-all.sh b/scripts/clang-format-all.sh index a51c886..f2d1572 100755 --- a/scripts/clang-format-all.sh +++ b/scripts/clang-format-all.sh @@ -9,7 +9,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" FOLDER="${1:-$SCRIPT_DIR/../include $SCRIPT_DIR/../src $SCRIPT_DIR/../test/src}" -CLANG_FORMAT_COMMANDS="clang-format-10 clang-format-9 clang-format-8 clang-format" +CLANG_FORMAT_COMMANDS="clang-format-11 clang-format-10 clang-format-9 clang-format" # find the first available command: for CMD in $CLANG_FORMAT_COMMANDS; do