{ lib , stdenv , fetchFromGitHub , cmake , rocm-cmake , rocm-runtime , rocm-device-libs , rocm-comgr , rocm-smi , hip , gtest , chrpath ? null , buildTests ? false }: assert buildTests -> chrpath != null; stdenv.mkDerivation rec { pname = "rccl"; rocmVersion = "5.3.1"; version = "2.12.10-${rocmVersion}"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rccl"; rev = "rocm-${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_