Skip to content

Fix portability for AlmaLinux 8 / manylinux_2_28 (gcc 8)#261

Merged
thananon merged 1 commit intodevelopfrom
users/thananon/manylinux-portability
Apr 23, 2026
Merged

Fix portability for AlmaLinux 8 / manylinux_2_28 (gcc 8)#261
thananon merged 1 commit intodevelopfrom
users/thananon/manylinux-portability

Conversation

@thananon
Copy link
Copy Markdown
Contributor

Summary

gcc 8.5 (AlmaLinux 8 base, used by manylinux_2_28) is older than what Ubuntu 22.04 ships and doesn't pull in some headers transitively or expose std::filesystem from the default libstdc++. This PR makes TransferBench actually build on those toolchains.

  • Drop unused #include <barrier> from src/header/TransferBench.hpp. <barrier> is C++20 and requires libstdc++ ≥ 10. std::barrier was never used.
  • Add explicit #include <iomanip>, <numeric>, <limits> to Utilities.hpp, NicPeerToPeer.hpp, AllToAll.hpp, AllToAllN.hpp. Older libstdc++ doesn't pull these in via other standard headers.
  • Link libstdc++fs unconditionally for std::filesystem. gcc < 9 ships it as a separate static archive in a gcc-private libdir (e.g. /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++fs.a), which CMake's find_library does not search. Bare target_link_libraries(... stdc++fs) lets the compiler driver find it. On gcc 9+ it resolves to a no-op stub archive shipped for compatibility, so it's harmless elsewhere.

Context

This is the portability slice of the original #260, split out so it can land independently. A follow-up PR will add the GitHub Actions workflow + build_packages_local.sh for building relocatable packages against TheRock SDK on top of these fixes.

Test plan

  • Reproduced original link/compile failures inside quay.io/pypa/manylinux_2_28_x86_64 (AlmaLinux 8, gcc 8.5)
  • Build succeeds inside the same container after this patch
  • No effect on the existing Azure DevOps Ubuntu/ROCm CI (changes are toolchain-portability only; on gcc ≥ 9 the stdc++fs link is a no-op and the extra includes are redundant but harmless)

🤖 Generated with Claude Code

gcc 8.5 (AlmaLinux 8 base, used by quay.io/pypa/manylinux_2_28_x86_64)
is older than what Ubuntu 22.04 ships and doesn't pull in some headers
transitively or expose std::filesystem from the default libstdc++.

- Drop unused #include <barrier> from TransferBench.hpp. <barrier> is
  C++20 and requires libstdc++ >= 10. std::barrier was never used.

- Add explicit #include <iomanip>, <numeric>, <limits> to Utilities.hpp,
  NicPeerToPeer.hpp, AllToAll.hpp, AllToAllN.hpp. Older libstdc++ does
  not pull these in via other standard headers.

- Link libstdc++fs unconditionally for std::filesystem. gcc < 9 ships
  it as a separate static archive in a gcc-private libdir (e.g.
  /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++fs.a), which CMake's
  find_library does not search. Bare target_link_libraries(... stdc++fs)
  lets the compiler driver find it. On gcc 9+ it resolves to a no-op
  stub archive shipped for compatibility, so it's harmless elsewhere.

Verified by reproducing the build inside quay.io/pypa/manylinux_2_28_x86_64
locally.

Co-Authored-By: Claude Opus 4 <[email protected]>
@thananon thananon requested a review from a team as a code owner April 23, 2026 19:26
@nileshnegi nileshnegi requested a review from Copilot April 23, 2026 20:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improve build portability on AlmaLinux 8 / manylinux_2_28 toolchains (gcc 8-era libstdc++) by removing a C++20-only header, adding missing explicit standard-library includes, and ensuring std::filesystem links successfully.

Changes:

  • Removed unused C++20 <barrier> include to avoid requiring newer libstdc++ headers.
  • Added explicit standard headers (<iomanip>, <numeric>, <limits>) where corresponding facilities are used.
  • Updated CMake linking to include stdc++fs for std::filesystem compatibility on older libstdc++.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/header/TransferBench.hpp Drops unused <barrier> to avoid C++20 dependency.
src/client/Utilities.hpp Adds <iomanip> needed for manipulators used in table formatting.
src/client/Presets/NicPeerToPeer.hpp Adds <numeric> for std::iota usage.
src/client/Presets/AllToAll.hpp Adds <limits> for std::numeric_limits usage.
src/client/Presets/AllToAllN.hpp Adds <limits> for std::numeric_limits usage.
CMakeLists.txt Links stdc++fs to support std::filesystem on gcc 8-era libstdc++.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thananon thananon merged commit 73427c5 into develop Apr 23, 2026
8 checks passed
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.

3 participants