{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocminfo , ninja , clr , git , libxml2 , libedit , zstd , zlib , ncurses , python3Packages , buildRockCompiler ? false , buildTests ? false # `argument of type 'NoneType' is not iterable` }: # Theoretically, we could have our MLIR have an output # with the source and built objects so that we can just # use it as the external LLVM repo for this let suffix = if buildRockCompiler then "-rock" else ""; llvmNativeTarget = if stdenv.isx86_64 then "X86" else if stdenv.isAarch64 then "AArch64" else throw "Unsupported ROCm LLVM platform"; in stdenv.mkDerivation (finalAttrs: { pname = "rocmlir${suffix}"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals (!buildRockCompiler) [ "external" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocMLIR"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-AypY0vL8Ij1zLycwpG2EPWWl4utp4ejXpAK0Jj/UvrA="; }; nativeBuildInputs = [ cmake rocm-cmake ninja clr python3Packages.python python3Packages.tomli ]; buildInputs = [ git libxml2 libedit ]; propagatedBuildInputs = [ zstd zlib ncurses ]; cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" "-DLLVM_ENABLE_ZSTD=ON" "-DLLVM_ENABLE_ZLIB=ON" "-DLLVM_ENABLE_TERMINFO=ON" "-DROCM_PATH=${clr}" # Manually define CMAKE_INSTALL_