{ 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 , texlive , doxygen , sphinx , docutils , ghostscript , python3Packages , buildDocs ? false , buildTests ? false }: let latex = lib.optionalAttrs buildDocs texlive.combine { inherit (texlive) scheme-small latexmk tex-gyre fncychap wrapfig capt-of framed needspace tabulary varwidth titlesec epstopdf; }; in stdenv.mkDerivation (finalAttrs: { pname = "migraphx"; version = "5.7.0"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "AMDMIGraphX"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-7yL7Zn5I8GUPIAgB7tVLZI7OEHLv0E4FcLVx9xMfsNY="; }; 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_