{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , pkg-config , cmake , rocm-cmake , clr , clang-tools-extra , openmp , rocblas , rocmlir , composable_kernel , miopen , protobuf , half , nlohmann_json , msgpack , sqlite , oneDNN_2 , blaze , cppcheck , rocm-device-libs , texliveSmall , doxygen , sphinx , docutils , ghostscript , python3Packages , buildDocs ? false , buildTests ? false , gpuTargets ? clr.gpuTargets }: let latex = lib.optionalAttrs buildDocs (texliveSmall.withPackages (ps: with ps; [ latexmk tex-gyre fncychap wrapfig capt-of framed needspace tabulary varwidth titlesec epstopdf ])); in stdenv.mkDerivation (finalAttrs: { pname = "migraphx"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "AMDMIGraphX"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-VDYUSpWYAdJ63SKVCO26DVAC3RtZM7otqN0sYUA6DBQ="; }; nativeBuildInputs = [ pkg-config cmake rocm-cmake clr clang-tools-extra python3Packages.python ] ++ lib.optionals buildDocs [ latex doxygen sphinx docutils ghostscript python3Packages.sphinx-rtd-theme python3Packages.breathe ]; buildInputs = [ openmp rocblas rocmlir composable_kernel miopen protobuf half nlohmann_json msgpack sqlite oneDNN_2 blaze cppcheck python3Packages.pybind11 python3Packages.onnx ]; cmakeFlags = [ "-DMIGRAPHX_ENABLE_GPU=ON" "-DMIGRAPHX_ENABLE_CPU=ON" "-DMIGRAPHX_ENABLE_FPGA=ON" "-DMIGRAPHX_ENABLE_MLIR=OFF" # LLVM or rocMLIR mismatch? # Manually define CMAKE_INSTALL_