Fix portability for AlmaLinux 8 / manylinux_2_28 (gcc 8)#261
Merged
Fix portability for AlmaLinux 8 / manylinux_2_28 (gcc 8)#261
Conversation
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]>
4 tasks
nileshnegi
approved these changes
Apr 23, 2026
There was a problem hiding this comment.
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++fsforstd::filesystemcompatibility 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::filesystemfrom the default libstdc++. This PR makes TransferBench actually build on those toolchains.#include <barrier>fromsrc/header/TransferBench.hpp.<barrier>is C++20 and requires libstdc++ ≥ 10.std::barrierwas never used.#include <iomanip>,<numeric>,<limits>toUtilities.hpp,NicPeerToPeer.hpp,AllToAll.hpp,AllToAllN.hpp. Older libstdc++ doesn't pull these in via other standard headers.libstdc++fsunconditionally forstd::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'sfind_librarydoes not search. Baretarget_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.shfor building relocatable packages against TheRock SDK on top of these fixes.Test plan
quay.io/pypa/manylinux_2_28_x86_64(AlmaLinux 8, gcc 8.5)🤖 Generated with Claude Code