From 8ff62db6add506f9fcd35fb8fc252ceb7148edf8 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Thu, 6 Jun 2024 03:20:36 +0300 Subject: [PATCH] Build gcc-14 --- scripts/build-functions.sh | 21 +++++++++++++++++++++ scripts/prepare-qodana.sh | 5 ++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/build-functions.sh b/scripts/build-functions.sh index a98c80a..95c5062 100755 --- a/scripts/build-functions.sh +++ b/scripts/build-functions.sh @@ -51,4 +51,25 @@ function build_project() { cmake --build build --config Debug -j "$PARALLELISM_LEVEL" } +function abort() { + echo "An unexpected error occurred. Program aborted." + exit 1 +} + +function build_install_gcc_14() { + apt update + apt install -y software-properties-common build-essential wget libgmp-dev libmpfr-dev libmpc-dev + wget -q https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz + tar -xf gcc-14.1.0.tar.xz + cd gcc-14.1.0 || abort + ./contrib/download_prerequisites + mkdir build + cd build || abort + ../configure --enable-languages=c,c++ --disable-multilib + make -j "$PARALLELISM_LEVEL" + make install + update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/gcc 60 --slave /usr/bin/g++ g++ /usr/local/bin/g++ + apt purge -y gcc cpp g++ +} + trap "echo 'An unexpected error occurred. Program aborted.'" ERR diff --git a/scripts/prepare-qodana.sh b/scripts/prepare-qodana.sh index 29be1b0..4eee182 100755 --- a/scripts/prepare-qodana.sh +++ b/scripts/prepare-qodana.sh @@ -9,8 +9,11 @@ cd "$(dirname "$0")" || (echo "Running from $(pwd)" && exit 1) # Root access is required to install the dependencies. check_root +# Build and install GCC 14 +build_install_gcc_14 + # Install dependencies -apt remove -y --purge --auto-remove llvm-toolchain-bookworm-16 clang-16 clang-tidy-16 clang-format-16 lld-16 libc++-16-dev libc++abi-16-dev +apt remove -y --purge --auto-remove llvm-16-dev clang-16 clang-tidy-16 clang-format-16 lld-16 libc++-16-dev libc++abi-16-dev apt update && apt install -y software-properties-common wget unzip build-essential openssl libreadline8 libreadline-dev libsodium23 libsodium-dev libgcrypt20-dev wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc add-apt-repository -y "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main"