From 4f6abeab07b1ab546744678e543e3f04cb04e7b2 Mon Sep 17 00:00:00 2001 From: whispers Date: Sun, 27 Sep 2026 16:43:30 -0400 Subject: [PATCH] rocmPackages.migraphx: explicitly specify c++17 for abseil-cpp abseil exposes different interfaces depending on what is available in std in a given C++ standard. gcc 16 defaults to C++20, thus causing the default abseil-cpp to expose a different interface than the one migraphx (built with C++17) expects. thus, we explicitly override abseil to specify the desired C++ standard. failing build logs: https://hydra.nixos.org/build/346880137 --- pkgs/development/rocm-modules/migraphx/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/rocm-modules/migraphx/default.nix b/pkgs/development/rocm-modules/migraphx/default.nix index 5b79f8213d64..1949418bca41 100644 --- a/pkgs/development/rocm-modules/migraphx/default.nix +++ b/pkgs/development/rocm-modules/migraphx/default.nix @@ -39,6 +39,12 @@ }: let + # this standard version needs to match the version that migraphx pins, or + # compilation fails if the pinned version is not the same as the compiler's + # default. + # https://github.com/ROCm/AMDMIGraphX/blob/07ef4ba4f9ef95d241b7be165e60ad148f3344ee/CMakeLists.txt#L143-L148 + abseil-cpp' = abseil-cpp.override { cxxStandard = "17"; }; + latex = lib.optionalAttrs buildDocs ( texliveSmall.withPackages ( ps: with ps; [ @@ -143,7 +149,7 @@ stdenv.mkDerivation (finalAttrs: { ]; postPatch = '' - export CXXFLAGS+=" -w -isystem${rocmlir}/include/rocmlir -I${half}/include -I${lib.getInclude abseil-cpp}/include -I${hipblas-common}/include -I${lib.getInclude protobuf}/include" + export CXXFLAGS+=" -w -isystem${rocmlir}/include/rocmlir -I${half}/include -I${lib.getInclude abseil-cpp'}/include -I${hipblas-common}/include -I${lib.getInclude protobuf}/include" patchShebangs tools # `error: '__clang_hip_runtime_wrapper.h' file not found [clang-diagnostic-error]`