{ lib , stdenv , fetchFromGitHub , writeScript , cmake , rocm-cmake , rocm-runtime , rocm-device-libs , rocm-comgr , rocm-smi , hip , gtest , chrpath ? null , buildTests ? false }: assert buildTests -> chrpath != null; stdenv.mkDerivation (finalAttrs: { pname = "rccl"; repoVersion = "2.12.10"; rocmVersion = "5.3.3"; version = "${finalAttrs.repoVersion}-${finalAttrs.rocmVersion}"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rccl"; rev = "rocm-${finalAttrs.rocmVersion}"; hash = "sha256-whRXGD8oINDYhFs8+hEWKWoGNqacGlyy7xi8peA8Qsk="; }; nativeBuildInputs = [ cmake rocm-cmake hip ]; buildInputs = [ rocm-runtime rocm-device-libs rocm-comgr rocm-smi gtest ] ++ lib.optionals buildTests [ chrpath ]; cmakeFlags = [ "-DCMAKE_C_COMPILER=hipcc" "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_