{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocm-smi , clr , perl , hipify , gtest , chrpath , buildTests ? false , gpuTargets ? [ ] }: stdenv.mkDerivation (finalAttrs: { pname = "rccl"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rccl"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-Oyml47yGEB7fALxBcDjqFngS38cnI39sDj94/JV7wE0="; }; 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_