{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , symlinkJoin , substituteAll , cmake , clang , clr , rocm-core , rocm-thunk , rocm-device-libs , roctracer , rocdbgapi , rocm-smi , hsa-amd-aqlprofile-bin , numactl , libpciaccess , libxml2 , elfutils , mpi , systemd , gtest , python3Packages , gpuTargets ? clr.gpuTargets }: let rocmtoolkit-merged = symlinkJoin { name = "rocmtoolkit-merged"; paths = [ rocm-core rocm-thunk rocm-device-libs roctracer rocdbgapi rocm-smi hsa-amd-aqlprofile-bin clr ]; postBuild = '' rm -rf $out/nix-support ''; }; in stdenv.mkDerivation (finalAttrs: { pname = "rocprofiler"; version = "5.7.1"; src = fetchFromGitHub { owner = "ROCm"; repo = "rocprofiler"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-1s/7C9y+73ADLF/17Vepw0pZNVtYnKoP24GdwKc9X2Y="; }; patches = [ # These just simply won't build ./0000-dont-install-tests-hsaco.patch # Fix bad paths (substituteAll { src = ./0001-fix-shell-scripts.patch; rocmtoolkit_merged = rocmtoolkit-merged; }) ]; nativeBuildInputs = [ cmake clang clr python3Packages.lxml python3Packages.cppheaderparser python3Packages.pyyaml python3Packages.barectf ]; buildInputs = [ numactl libpciaccess libxml2 elfutils mpi systemd gtest ]; propagatedBuildInputs = [ rocmtoolkit-merged ]; cmakeFlags = [ "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" "-DHIP_ROOT_DIR=${clr}" "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" # Manually define CMAKE_INSTALL_