{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, cmake, rocm-cmake, rocm-smi, clr, perl, hipify, gtest, chrpath, buildTests ? false, gpuTargets ? [ ], }: stdenv.mkDerivation (finalAttrs: { pname = "rccl"; version = "5.7.1"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rccl"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-nFkou/kjGBmImorlPOZNTlCrxbfAYpDhgRveyoAufu8="; }; nativeBuildInputs = [ cmake rocm-cmake clr perl hipify ]; buildInputs = [ rocm-smi gtest ] ++ lib.optionals buildTests [ chrpath ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h # Manually define CMAKE_INSTALL_