From 0f4d9f4cef37ee6b731b11602da7c065f48de7b4 Mon Sep 17 00:00:00 2001 From: Yellow Shine Date: Tue, 20 Aug 2024 12:13:33 +0800 Subject: [PATCH] enhance: upgrade gcc to 11 Signed-off-by: Yellow Shine --- build/docker/builder/cpu/ubuntu20.04/Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build/docker/builder/cpu/ubuntu20.04/Dockerfile b/build/docker/builder/cpu/ubuntu20.04/Dockerfile index 8f36ce6dc5b69..9358e6ba76c39 100644 --- a/build/docker/builder/cpu/ubuntu20.04/Dockerfile +++ b/build/docker/builder/cpu/ubuntu20.04/Dockerfile @@ -13,13 +13,23 @@ FROM ubuntu:focal-20220426 ARG TARGETARCH -RUN apt-get update && apt-get install -y --no-install-recommends wget curl ca-certificates gnupg2 \ - g++ gcc gdb gdbserver ninja-build git make ccache libssl-dev zlib1g-dev zip unzip \ +RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common wget curl ca-certificates gnupg2 \ + gdb gdbserver ninja-build git make ccache libssl-dev zlib1g-dev zip unzip \ clang-format-12 clang-tidy-12 lcov libtool m4 autoconf automake python3 python3-pip \ pkg-config uuid-dev libaio-dev libopenblas-dev && \ apt-get remove --purge -y && \ rm -rf /var/lib/apt/lists/* +# Install GCC 11 and G++ 11 separately +RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc-11 g++-11 && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Set GCC 11 as the default compiler +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \ + && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 + RUN pip3 install conan==1.64.1 RUN echo "target arch $TARGETARCH"