Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gcc version 14 #336

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CodeCoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:

jobs:
linux:
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'

# Don't run on dependabot PRs
if: github.actor != 'dependabot[bot]'
Expand All @@ -44,7 +44,7 @@ jobs:

matrix:
compiler:
- "gcc-13"
- "gcc-14"

build_type:
- "Debug"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
- { os: ubuntu-20.04, compiler_version: "11" }
- { os: ubuntu-22.04, compiler_version: "12" }
- { os: ubuntu-22.04, compiler_version: "13" }
- { os: ubuntu-24.04, compiler_version: "14" }

build_type:
- "Debug"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@
matrix:
# Pair of os version and XCode version
cfg:
- { os: macos-11, compiler_version: "11.7" }

Check warning on line 52 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L52

Too many spaces inside braces.
- { os: macos-11, compiler_version: "12.4" }

Check warning on line 53 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L53

Too many spaces inside braces.
- { os: macos-11, compiler_version: "12.5.1" }
- { os: macos-11, compiler_version: "13.0" }

Check warning on line 55 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L55

Too many spaces inside braces.
- { os: macos-11, compiler_version: "13.1" }

Check warning on line 56 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L56

Too many spaces inside braces.
- { os: macos-11, compiler_version: "13.2.1" }
- { os: macos-12, compiler_version: "13.3.1" }
- { os: macos-12, compiler_version: "13.4.1" }
- { os: macos-12, compiler_version: "14.0.1" }
- { os: macos-12, compiler_version: "14.1" }

Check warning on line 61 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L61

Too many spaces inside braces.
- { os: macos-12, compiler_version: "14.2" }

Check warning on line 62 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L62

Too many spaces inside braces.
- { os: macos-13, compiler_version: "14.3" }

Check warning on line 63 in .github/workflows/MacOS.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/MacOS.yml#L63

Too many spaces inside braces.
- { os: macos-13, compiler_version: "15.0.1" }
- { os: macos-13, compiler_version: "15.1" }
- { os: macos-13, compiler_version: "15.2" }
Expand Down Expand Up @@ -115,6 +115,7 @@
- "11"
- "12"
- "13"
- "14"

build_type:
- "Debug"
Expand Down
36 changes: 2 additions & 34 deletions scripts/ci/InstallTools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
set -e
set -u

upgraded_pip=0
added_llvm_apt=0
added_ubuntu_test_ppa=0
root_dir=$(pwd)
Expand Down Expand Up @@ -36,30 +35,6 @@ function apt_install() {
echo "- Running apt-get install [$*] done"
}

function pip_install() {
echo "- Running pip install [$*]..."
retry sudo -H pip3 --no-cache-dir install "$@"
echo "- Running pip install [$*] done"
}

# Make sure pip is using the latest version
upgrade_pip() {
if [[ "$upgraded_pip" == 0 ]]; then
echo "-- Upgrading pip..."

pip_install --upgrade pip
upgraded_pip=1

echo "-- Upgrading pip done"
fi
}

install_python_wheel() {
echo "--- Installing wheel on pip..."
pip_install wheel
echo "--- Installing wheel on pip done"
}

add_llvm_apt() {
if [[ "$added_llvm_apt" == 0 ]]; then
echo "-- Adding LLVM-$1 apt..."
Expand Down Expand Up @@ -99,11 +74,8 @@ add_ubuntu_test_ppa() {
}

install_gcovr() {
upgrade_pip
install_python_wheel

echo "-- Installing gcovr..."
pip_install gcovr
apt_install gcovr
echo "-- Installing gcovr done"

# Verify
Expand All @@ -114,12 +86,8 @@ install_gcovr() {
}

install_cmake_format() {
upgrade_pip
install_python_wheel

echo "-- Installing cmake-format..."
# See https://cmake-format.readthedocs.io/en/latest/installation.html#installation
pip_install cmakelang pyyaml
apt_install cmake-format
echo "-- Installing cmake-format done"

# Verify
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/SetupEnvironment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ echo "UBSAN_OPTIONS=print_stacktrace=1:report_error_type=1:halt_on_error=1" >>"$

# Latest versions
echo "LATEST_LLVM_VERSION=18" >>"$GITHUB_ENV"
echo "LATEST_GCC_VERSION=13" >>"$GITHUB_ENV"
echo "LATEST_GCC_VERSION=14" >>"$GITHUB_ENV"

if [[ $machine == "linux" ]]; then
# Workaround for the unreliable Github Actions caching proxy
Expand Down
9 changes: 7 additions & 2 deletions scripts/cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ elseif(PHI_COMPILER_GCC)
set(phi_cxx_common_flags -fsized-deallocation -fconcepts)
set(phi_color_diagnostics_flag -fdiagnostics-color)
set(phi_disable_all_warnings_flag -w)
set(phi_debug_flags -fasynchronous-unwind-tables -fcheck-new -fvar-tracking
-fvar-tracking-assignments -grecord-gcc-switches)
set(phi_debug_flags -fasynchronous-unwind-tables -fcheck-new -fvar-tracking-assignments
-grecord-gcc-switches)
set(phi_debug_only_flags)
set(phi_coverage_compile_flags -fno-common -fno-inline -fno-default-inline -fno-inline-functions
-fno-omit-frame-pointer)
Expand Down Expand Up @@ -640,6 +640,11 @@ elseif(PHI_COMPILER_GCC)
-ftrivial-auto-var-init=pattern)
endif()

# GCC-14 flags
if(PHI_GCC_VERSION VERSION_GREATER_EQUAL 14)
set(phi_cxx_warning_flags ${phi_cxx_warning_flags} -Wnrvo)
endif()

elseif(PHI_COMPILER_MSVC)

set(phi_warning_flags /Wall)
Expand Down