Skip to content

build_native_lib.sh: require GCC 12 on x86_64 and check the compiler meson uses - #784

Open
foosekis4j wants to merge 1 commit into
datastax:mainfrom
foosekis4j:native-gcc12
Open

foosekis4j wants to merge 1 commit into
datastax:mainfrom
foosekis4j:native-gcc12

Conversation

@foosekis4j

Copy link
Copy Markdown

Problem

On x86_64, build_native_lib.sh builds the native library for Sapphire Rapids. Highway's HWY_AVX3_SPR target needs
GCC 12 or newer (third_party/highway/hwy/detect_targets.h), but the script required GCC 11. With GCC 11 the
version check passes, and the build then fails inside Highway.

The script also checks g++, while meson compiles with $CXX when it is set. So a machine with an old default
g++ and a newer compiler in CXX (for example CXX=g++-13, or gcc-toolset on RHEL) was rejected, even though
the build would have worked.

Change

  • MIN_GCC_VERSION is 12 on x86_64, and unchanged (11) elsewhere.
  • The compiler checked is ${CXX:-g++}, the one meson uses. Its version comes from -dumpfullversion -dumpversion
    (-dumpversion alone prints only the major version since GCC 7).

Tested

On Ubuntu 22.04 x86_64, default g++ 11.4.0:

  • Without CXX: the script stops before building:
    ERROR: g++ version 11.4.0 is too old. Please upgrade to g++ 12 or newer, or set CXX to one.
    
  • With CXX=g++-13: it builds libjvector-x86_64.so.

…meson uses

The x86_64 native build targets Sapphire Rapids, and Highway's HWY_AVX3_SPR target needs GCC 12
or newer (third_party/highway/hwy/detect_targets.h). With GCC 11 the script's version check
passed and the build then failed inside Highway. The script also checked `g++` while meson
compiles with `$CXX` when it is set, so a working `CXX=g++-13` next to an old default `g++` was
rejected.

- MIN_GCC_VERSION is 12 on x86_64 (11 elsewhere, unchanged).
- The compiler checked is `${CXX:-g++}`; its version comes from `-dumpfullversion -dumpversion`
  (GCC prints only the major version for -dumpversion since 7).
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Before you submit for review:

  • Does your PR follow guidelines from CONTRIBUTIONS.md?
  • Did you summarize what this PR does clearly and concisely?
  • Did you include performance data for changes which may be performance impacting?
  • Did you include useful docs for any user-facing changes or features?
  • Did you include useful javadocs for developer oriented changes, explaining new concepts or key changes?
  • Did you rebase your branch onto the latest main for regression testing and PR submission?
  • Did you trigger regression testing via Run Bench Main and review results?
  • Did you adhere to the code formatting guidelines (TBD)
  • Did you group your changes for easy review, providing meaningful descriptions for each commit?
  • Did you ensure that all files contain the correct copyright header?
  • Did you add documentation for this feature to the release notes directory?

If you did not complete any of these, then please explain below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant