Skip to content
Draft
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
48 changes: 24 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,66 +36,66 @@ jobs:
fail-fast: false
matrix:
include:
- name: GCC 14 Release (Linux Intel)
- name: GCC 15 Release (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Release
COMPILER: gcc

- name: GCC 14 Release with ASan (Linux Intel)
- name: GCC 15 Release with ASan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_ADDRESS: ON

- name: GCC 14 Release with TSan (Linux Intel)
- name: GCC 15 Release with TSan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_THREAD: ON

- name: GCC 14 Release with UBSan (Linux Intel)
- name: GCC 15 Release with UBSan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_UB: ON

- name: GCC 14 Debug (Linux Intel)
- name: GCC 15 Debug (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Debug
COMPILER: gcc

- name: GCC 14 Debug with ASan (Linux Intel)
- name: GCC 15 Debug with ASan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Debug
COMPILER: gcc
SANITIZE_ADDRESS: ON

- name: GCC 14 Debug with TSan (Linux Intel)
- name: GCC 15 Debug with TSan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Debug
COMPILER: gcc
SANITIZE_THREAD: ON

- name: GCC 14 Debug with UBSan (Linux Intel)
- name: GCC 15 Debug with UBSan (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Debug
COMPILER: gcc
SANITIZE_UB: ON

- name: GCC 14 Debug without AVX2 (Linux Intel)
- name: GCC 15 Debug without AVX2 (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Debug
COMPILER: gcc
AVX2: OFF

- name: GCC 14 Release static analysis & cpplint (Linux Intel)
- name: GCC 15 Release static analysis & cpplint (Linux Intel)
os: ubuntu-latest
BUILD_TYPE: Release
COMPILER: gcc
STATIC_ANALYSIS: ON
CPPLINT: ON

- name: GCC 14 default CMake configuration (Linux Intel)
- name: GCC 15 default CMake configuration (Linux Intel)
os: ubuntu-latest
COMPILER: gcc

Expand Down Expand Up @@ -267,47 +267,47 @@ jobs:
SANITIZE_UB: ON
AVX2: OFF

- name: GCC 14 Release (Linux ARM64)
- name: GCC 15 Release (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Release
COMPILER: gcc

- name: GCC 14 Release with ASan (Linux ARM64)
- name: GCC 15 Release with ASan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_ADDRESS: ON

- name: GCC 14 Release with TSan (Linux ARM64)
- name: GCC 15 Release with TSan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_THREAD: ON

- name: GCC 14 Release with UBSan (Linux ARM64)
- name: GCC 15 Release with UBSan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Release
COMPILER: gcc
SANITIZE_UB: ON

- name: GCC 14 Debug (Linux ARM64)
- name: GCC 15 Debug (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Debug
COMPILER: gcc

- name: GCC 14 Debug with ASan (Linux ARM64)
- name: GCC 15 Debug with ASan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Debug
COMPILER: gcc
SANITIZE_ADDRESS: ON

- name: GCC 14 Debug with TSan (Linux ARM64)
- name: GCC 15 Debug with TSan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Debug
COMPILER: gcc
SANITIZE_THREAD: ON

- name: GCC 14 Debug with UBSan (Linux ARM64)
- name: GCC 15 Debug with UBSan (Linux ARM64)
os: ubuntu-24.04-arm
BUILD_TYPE: Debug
COMPILER: gcc
Expand Down Expand Up @@ -376,12 +376,13 @@ jobs:

- name: Setup dependencies for GCC
run: |
sudo apt-get install -y g++-14
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get install -y g++-15
if: runner.os == 'Linux' && env.COMPILER == 'gcc'

- name: Setup multilib dependencies for GCC (x86 only)
run: |
sudo apt-get install -y g++-14-multilib
sudo apt-get install -y g++-15-multilib
if: runner.os == 'Linux' && env.COMPILER == 'gcc' && !contains(matrix.os, 'arm')

- name: Setup dependencies for Linux LLVM (common)
Expand Down Expand Up @@ -439,10 +440,9 @@ jobs:
CBT=""
fi
if [[ $COMPILER == "gcc" ]]; then
V=14
EXTRA_CMAKE_ARGS=()
export CC=gcc-$V
export CXX=g++-$V
export CC=gcc
export CXX=g++
Comment on lines 442 to +445
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: GCC 15 build will use system default GCC, not GCC 15.

Line 444-445 removed version specifiers from CC and CXX, so the build uses gcc and g++ from $PATH (typically GCC 11 on ubuntu-latest), not the installed g++-15 from line 380. This defeats the entire PR objective of testing GCC 15.

The VERSION matrix variable becomes unused, and all GCC matrix entries will compile with whatever default GCC is on the runner.

Apply this diff to restore version binding:

          if [[ $COMPILER == "gcc" ]]; then
            EXTRA_CMAKE_ARGS=()
-           export CC=gcc
-           export CXX=g++
+           export CC=gcc-15
+           export CXX=g++-15

Alternatively, if dynamic versioning is desired (not just GCC 15):

          if [[ $COMPILER == "gcc" ]]; then
            EXTRA_CMAKE_ARGS=()
-           export CC=gcc
-           export CXX=g++
+           export CC=gcc-${VERSION}
+           export CXX=g++-${VERSION}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ $COMPILER == "gcc" ]]; then
V=14
EXTRA_CMAKE_ARGS=()
export CC=gcc-$V
export CXX=g++-$V
export CC=gcc
export CXX=g++
if [[ $COMPILER == "gcc" ]]; then
EXTRA_CMAKE_ARGS=()
export CC=gcc-${VERSION}
export CXX=g++-${VERSION}
🤖 Prompt for AI Agents
.github/workflows/build.yml around lines 442-445: the script currently exports
CC and CXX as unversioned gcc/g++, causing builds to use the system default GCC
(e.g., gcc-11) instead of the intended gcc-15; restore version binding by
setting CC and CXX to the versioned compiler (e.g., gcc-15 and g++-15) or use
the matrix VERSION variable (e.g., export CC=gcc-${VERSION} and export
CXX=g++-${VERSION}) so the installed compiler from earlier steps is actually
used during the build.

elif [[ $COMPILER == "clang" ]]; then
V=21
export CC=clang-$V
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: build-with-old-compilers
name: build-with-old-compilers-jammy

on:
push:
Expand Down Expand Up @@ -777,7 +777,7 @@ jobs:
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-13
sudo apt-get install -y "g++-${VERSION}"
if: env.COMPILER == 'gcc' && env.VERSION == '13'

- name: Configure CMake
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/old-compilers-noble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
name: build-with-old-compilers-noble

on:
push:
branches:
- master
pull_request:

env:
DEFAULT_SANITIZE_ADDRESS: OFF
DEFAULT_SANITIZE_THREAD: OFF
DEFAULT_SANITIZE_UB: OFF

permissions: {}

jobs:
build:
runs-on: ubuntu-24.04

env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
VERSION: ${{matrix.VERSION}}
SANITIZE_ADDRESS: ${{matrix.SANITIZE_ADDRESS}}
SANITIZE_THREAD: ${{matrix.SANITIZE_THREAD}}
SANITIZE_UB: ${{matrix.SANITIZE_UB}}

strategy:
fail-fast: false
matrix:
include:
- name: GCC 14 Release
BUILD_TYPE: Release
VERSION: 14

- name: GCC 14 Release with ASan
BUILD_TYPE: Release
SANITIZE_ADDRESS: ON
VERSION: 14

- name: GCC 14 Release with TSan
BUILD_TYPE: Release
SANITIZE_THREAD: ON
VERSION: 14

- name: GCC 14 Release with UBSan
BUILD_TYPE: Release
SANITIZE_UB: ON
VERSION: 14

- name: GCC 14 Debug
BUILD_TYPE: Debug
VERSION: 14

- name: GCC 14 Debug with ASan
BUILD_TYPE: Debug
SANITIZE_ADDRESS: ON
VERSION: 14

- name: GCC 14 Debug with TSan
BUILD_TYPE: Debug
SANITIZE_THREAD: ON
VERSION: 14

- name: GCC 14 Debug with UBSan
BUILD_TYPE: Debug
SANITIZE_UB: ON
VERSION: 14

steps:
- uses: actions/checkout@v5
with:
submodules: true
persist-credentials: false

- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y libboost-dev libc6-dev-i386 "g++-${VERSION}"

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
run: |
SANITIZE_ADDRESS="${SANITIZE_ADDRESS:-$DEFAULT_SANITIZE_ADDRESS}"
SANITIZE_THREAD="${SANITIZE_THREAD:-$DEFAULT_SANITIZE_THREAD}"
SANITIZE_UB="${SANITIZE_UB:-$DEFAULT_SANITIZE_UB}"
export CC="gcc-${VERSION}"
export CXX="g++-${VERSION}"
EXTRA_CMAKE_ARGS=("-DMAINTAINER_MODE=ON")
set +e
cmake -B build "$GITHUB_WORKSPACE" -DSTANDALONE=ON \
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \
"-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}" \
"-DSANITIZE_THREAD=${SANITIZE_THREAD}" \
"-DSANITIZE_UB=${SANITIZE_UB}" \
"${EXTRA_CMAKE_ARGS[@]}"
CMAKE_EXIT_CODE=$?
set -e
if [ $CMAKE_EXIT_CODE -ne 0 ]; then
if [ -f build/CMakeFiles/CMakeConfigureLog.yaml ]; then
echo "::group::CMakeConfigureLog.yaml"
cat build/CMakeFiles/CMakeConfigureLog.yaml
echo "::endgroup::"
fi
fi
exit $CMAKE_EXIT_CODE

- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3 -k

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V

- name: Benchmark correctness test
working-directory: ${{github.workspace}}/build
run: make -k quick_benchmarks
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ set(GCC_GE_11_CXX_WARNING_FLAGS
set(GCC_GE_12_CXX_WARNING_FLAGS "-Winterference-size")
set(GCC_GE_14_CXX_WARNING_FLAGS "-Wnrvo" "-Welaborated-enum-base"
"-Wdangling-reference")
set(GCC_GE_15_CXX_WARNING_FLAGS "-Wleading-whitespace=spaces"
"-Wtrailing-whitespace=any")

set(UNIX_CXX_FLAGS "-g")

Expand Down Expand Up @@ -411,6 +413,7 @@ set(cxx_ge_12 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,12.0>")
set(cxx_lt_13 "$<VERSION_LESS:$<CXX_COMPILER_VERSION>,13.0>")
set(cxx_ge_13 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,13.0>")
set(cxx_ge_14 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,14.0>")
set(cxx_ge_15 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,15.0>")
set(cxx_ge_21 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,21.0>")
set(is_clang_lt_13_not_windows "$<AND:${is_clang_not_windows},${cxx_lt_13}>")
set(is_clang_ge_13_not_windows "$<AND:${is_clang_not_windows},${cxx_ge_13}>")
Expand All @@ -421,6 +424,7 @@ set(is_darwin_clang_ge_21_arm64 "$<AND:$<PLATFORM_ID:Darwin>,${is_clang_ge_21_no
set(is_gxx_ge_11 "$<AND:${is_gxx_genex},${cxx_ge_11}>")
set(is_gxx_ge_12 "$<AND:${is_gxx_genex},${cxx_ge_12}>")
set(is_gxx_ge_14 "$<AND:${is_gxx_genex},${cxx_ge_14}>")
set(is_gxx_ge_15 "$<AND:${is_gxx_genex},${cxx_ge_15}>")
# Configuration
set(has_avx2 "$<BOOL:${AVX2}>")
set(use_boost_stacktrace "$<BOOL:${USE_BOOST_STACKTRACE}>")
Expand Down Expand Up @@ -733,6 +737,7 @@ function(COMMON_TARGET_PROPERTIES TARGET)
"$<$<AND:${is_standalone},${is_gxx_ge_11}>:${GCC_GE_11_CXX_WARNING_FLAGS}>"
"$<$<AND:${is_standalone},${is_gxx_ge_12}>:${GCC_GE_12_CXX_WARNING_FLAGS}>"
"$<$<AND:${is_standalone},${is_gxx_ge_14}>:${GCC_GE_14_CXX_WARNING_FLAGS}>"
"$<$<AND:${is_standalone},${is_gxx_ge_15}>:${GCC_GE_15_CXX_WARNING_FLAGS}>"
# Optimization
"$<${is_not_release_genex}:$<IF:${is_windows_genex},/Od,-O0>>"
"$<$<AND:${is_release_genex},${is_not_windows}>:$<IF:${coverage_on},-O0,-O3>>"
Expand Down
Loading