Package Details: mlir 21.1.6-1

Git Clone URL: https://aur.archlinux.org/mlir.git (read-only, click to copy)
Package Base: mlir
Description: Multi-Level IR Compiler Framework for LLVM
Upstream URL: https://mlir.llvm.org/
Licenses: Apache-2.0 WITH LLVM-exception
Submitter: HoshinoAya
Maintainer: xantares
Last Packager: xantares
Votes: 6
Popularity: 0.034493
First Submitted: 2023-03-14 12:41 (UTC)
Last Updated: 2025-11-24 17:41 (UTC)

Latest Comments

1 2 3 Next › Last »

MartinDiehl commented on 2025-11-18 21:24 (UTC)

thank!

xantares commented on 2025-11-18 18:15 (UTC)

done

MartinDiehl commented on 2025-11-18 12:38 (UTC)

I needed a small adjustment to get rid of No such file or directory #include "mlir/Dialect/Vector/Transforms/VectorTransformsEnums.h.inc"

diff --git a/PKGBUILD b/PKGBUILD
index 55f2e00..4dacc41 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,6 +24,8 @@ prepare() {
   cd mlir-${pkgver}.src/
   # /usr/bin/ld: cannot find -lLLVMCodeGenTypes: No such file or directory
   sed -i 's|LLVM_LINK_COMPONENTS|IGNORE_THAT|g' tools/mlir-tblgen/CMakeLists.txt
+  # https://github.com/llvm/llvm-project/issues/160896
+  sed -i '13iMLIRVectorTransformsIncGen' lib/Dialect/Vector/IR/CMakeLists.txt
 }

 build() {

krystophny commented on 2025-11-07 20:32 (UTC) (edited on 2025-11-07 20:32 (UTC) by krystophny)

Please bump version and change linker to lld in order to support also CachyOS (should still work on vanilla Arch).

New PKGBUILD:

pkgname=mlir
pkgver=21.1.5
pkgrel=1
pkgdesc="Multi-Level IR Compiler Framework for LLVM"
arch=('x86_64')
url="https://mlir.llvm.org/"
license=("Apache-2.0 WITH LLVM-exception")
depends=("llvm-libs")
makedepends=("cmake" "llvm>=${pkgver%%.*}" "lld")
options=(!lto)
_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
source=($_source_base/mlir-$pkgver.src.tar.xz{,.sig}
        $_source_base/cmake-$pkgver.src.tar.xz{,.sig})
sha256sums=('136897b12083c42a6742a2ca62acc7cf42b0c181edebebd3b7366eeb41d3a805'
            'SKIP'
            '48013d5714a96419bf993a2e5e4c5827377e8cf9c565070731fb2305d50d9511'
            'SKIP')
validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A'  # Tom Stellard <tstellar@redhat.com>
              'D574BD5D1D0E98895E3BF90044F2485E45D59042'  # Tobias Hieta <tobias@hieta.se>
              'FFB3368980F3E6BB5737145A316C56D064CACBA5'  # Douglas Yung <douglas.yung@sony.com>
              '71046D1E9C6656BDD61171873E83BABF4A4F9E85') # Cullen Rhodes <cullen.rhodes@arm.com>

prepare() {
  cd mlir-${pkgver}.src/
  # /usr/bin/ld: cannot find -lLLVMCodeGenTypes: No such file or directory
  sed -i 's|LLVM_LINK_COMPONENTS|IGNORE_THAT|g' tools/mlir-tblgen/CMakeLists.txt
}

build() {
  cp -r cmake{-$pkgver.src,}
  cd mlir-${pkgver}.src

  export CXXFLAGS="${CXXFLAGS} -Wp,-U_GLIBCXX_ASSERTIONS"
  export LDFLAGS="${LDFLAGS} -Wl,--as-needed"

  cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLLVM_LINK_LLVM_DYLIB=ON \
    -DLLVM_BUILD_LLVM_DYLIB=ON \
    -DMLIR_LINK_MLIR_DYLIB=ON \
    -DLLVM_BUILD_TOOLS=ON \
    -DLLVM_BUILD_UTILS=ON \
    -DLLVM_ENABLE_PIC=ON \
    -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen \
    -DLLVM_USE_LINKER=lld \
    -B build -S .
  cmake --build build
}

package() {
  cd mlir-${pkgver}.src
  DESTDIR="${pkgdir}" cmake --build build --target install
}

e-kwsm commented on 2025-10-31 06:25 (UTC)

This version is broken, see https://github.com/llvm/llvm-project/issues/160896.

gonsolo commented on 2025-10-29 22:05 (UTC)

What wanghaoran said: Missing keys. Even installing the key doesn't help.

wanghaoran commented on 2025-10-29 06:59 (UTC)

missing validpgpkeys '71046D1E9C6656BDD61171873E83BABF4A4F9E85'# Cullen Rhodes cullen.rhodes@arm.com , so is flang

xantares commented on 2025-09-28 07:32 (UTC) (edited on 2025-09-28 09:47 (UTC) by xantares)

maybe try to uninstall any previous version of mlir first, or get rid of any cache/build files, also it takes a lot of memory if you have -jx MAKEFLAGS set in makepkg.conf

LeoTolstoi commented on 2025-09-27 12:32 (UTC)

When trying to install Flang (20.1.8) on CachyOS, the mlir compile fails with

/usr/bin/ld: /usr/lib/libLLVMTableGen.a: error adding symbols: file format not recognized collect2: error: ld returned 1 exit status make[2]: *** [tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/build.make:477: bin/mlir-tblgen] Error 1 make[1]: *** [CMakeFiles/Makefile2:15329: tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ==> ERROR: A failure occurred in build(). Aborting... error: failed to build 'mlir-20.1.8-1': error: can't build flang-20.1.8-1, deps not satisfied: mlir>=20 error: packages failed to build: mlir-20.1.8-1 flang-20.1.8-1 PAKtC

How can this be fixed / how can I provide the necessary information? From problems I've had before of linking Fortran modules, I suspect that the compiler used for LLVM is different from the compiler used to build MLIR, but I don't have enough technical knowledge to debug further / fix the problem, sorry.

HurricanePootis commented on 2025-09-06 19:57 (UTC)

@xantares

Do you think that you could switch mlir to use the Ninja backend for faster compile times? Also, please add yourself as maintainer to the top of the PKGBUILD. Furthermore, make the license() SPDX compliant.

diff --git a/PKGBUILD b/PKGBUILD
index 9aac26b..4d77782 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,12 +1,13 @@
+# Maintainer <xantares>
 pkgname=mlir
 pkgver=20.1.8
 pkgrel=1
 pkgdesc="Multi-Level IR Compiler Framework for LLVM"
 arch=('x86_64')
 url="https://mlir.llvm.org/"
-license=("custom:Apache 2.0 with LLVM Exception")
+license=("Apache-2.0 WITH LLVM-exception")
 depends=("llvm-libs")
-makedepends=("cmake" "llvm>=${pkgver%%.*}")
+makedepends=("cmake" "llvm>=${pkgver%%.*}" "ninja")
 options=(!lto)
 _source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
 source=($_source_base/mlir-$pkgver.src.tar.xz{,.sig}
@@ -26,8 +27,9 @@ prepare() {

 build() {
   cp -r cmake{-$pkgver.src,}
-  cd mlir-${pkgver}.src
   cmake \
+    -B build -S mlir-${pkgver}.src \
+    -GNinja \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DLLVM_LINK_LLVM_DYLIB=ON \
@@ -35,12 +37,10 @@ build() {
     -DMLIR_LINK_MLIR_DYLIB=ON \
     -DLLVM_BUILD_TOOLS=ON \
     -DLLVM_BUILD_UTILS=ON \
-    -DLLVM_ENABLE_PIC=ON \
-    -B build -S .
+    -DLLVM_ENABLE_PIC=ON
   cmake --build build
 }

 package() {
-  cd mlir-${pkgver}.src
   DESTDIR="${pkgdir}" cmake --build build --target install
 }