From a20fe71e909c78e00f6857867d9084737570baa6 Mon Sep 17 00:00:00 2001 From: Arm Patinyasakdikul Date: Thu, 23 Apr 2026 15:24:33 -0400 Subject: [PATCH] Fix portability for AlmaLinux 8 / manylinux_2_28 (gcc 8) 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 from TransferBench.hpp. is C++20 and requires libstdc++ >= 10. std::barrier was never used. - Add explicit #include , , 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 --- CMakeLists.txt | 4 ++++ src/client/Presets/AllToAll.hpp | 2 ++ src/client/Presets/AllToAllN.hpp | 1 + src/client/Presets/NicPeerToPeer.hpp | 2 ++ src/client/Utilities.hpp | 1 + src/header/TransferBench.hpp | 1 - 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b533f01a..2da6baa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,6 +259,10 @@ target_link_libraries(TransferBench PRIVATE dl) target_link_libraries(TransferBench PRIVATE ${NUMA_LIBRARY}) target_link_libraries(TransferBench PRIVATE ${HSA_LIBRARY}) +# gcc <9 ships std::filesystem in a separate library (libstdc++fs). +# Required on AlmaLinux 8 / manylinux_2_28; harmless no-op stub on newer toolchains. +target_link_libraries(TransferBench PRIVATE stdc++fs) + rocm_install(TARGETS TransferBench COMPONENT devel) rocm_setup_version(VERSION ${VERSION_STRING}) diff --git a/src/client/Presets/AllToAll.hpp b/src/client/Presets/AllToAll.hpp index 49ea5db7..2beae8af 100644 --- a/src/client/Presets/AllToAll.hpp +++ b/src/client/Presets/AllToAll.hpp @@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + int AllToAllPreset(EnvVars& ev, size_t const numBytesPerTransfer, std::string const presetName) diff --git a/src/client/Presets/AllToAllN.hpp b/src/client/Presets/AllToAllN.hpp index 82887470..7dac6b22 100644 --- a/src/client/Presets/AllToAllN.hpp +++ b/src/client/Presets/AllToAllN.hpp @@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include #include "EnvVars.hpp" int AllToAllRdmaPreset(EnvVars& ev, diff --git a/src/client/Presets/NicPeerToPeer.hpp b/src/client/Presets/NicPeerToPeer.hpp index 11463f53..24f5d71f 100644 --- a/src/client/Presets/NicPeerToPeer.hpp +++ b/src/client/Presets/NicPeerToPeer.hpp @@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + // Helper functions // Returns a schedule of round robin pairing of N elements, using Circle Method diff --git a/src/client/Utilities.hpp b/src/client/Utilities.hpp index 7604c7ae..0ba93fc6 100644 --- a/src/client/Utilities.hpp +++ b/src/client/Utilities.hpp @@ -21,6 +21,7 @@ THE SOFTWARE. */ #pragma once +#include #include #include #include "TransferBench.hpp" diff --git a/src/header/TransferBench.hpp b/src/header/TransferBench.hpp index 113de968..7b74dc5b 100644 --- a/src/header/TransferBench.hpp +++ b/src/header/TransferBench.hpp @@ -25,7 +25,6 @@ THE SOFTWARE. #include #include #include -#include #include #include #include