Skip to content

Commit

Permalink
Build gcc-14
Browse files Browse the repository at this point in the history
  • Loading branch information
dr8co committed Jun 6, 2024
1 parent 71110cb commit 8ff62db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions scripts/build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion scripts/prepare-qodana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8ff62db

Please sign in to comment.