{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, pkg-config, cmake, rocm-cmake, clr, clang-tools-extra, openmp, rocblas, rocmlir, composable_kernel, miopengemm, miopen, protobuf, half, nlohmann_json, msgpack, sqlite, oneDNN_2, blaze, cppcheck, rocm-device-libs, texliveSmall, doxygen, sphinx, docutils, ghostscript, python3Packages, buildDocs ? false, buildTests ? false, }: 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 = "5.7.1"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "AMDMIGraphX"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-lg3pxHBpwqxBvdOQgE44YKLuumhkVF6b3Xx4+cw7jNQ="; }; 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 miopengemm 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_