llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

mlir build failed with "library not found for -lMLIRExecutionEngine"

Open Colloportus0 opened this issue 1 year ago • 1 comments

When I build mlir, specifically, toy-ch6. Reported the following error.

ld: library not found for -lMLIRExecutionEngine
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I find the missing lib?

Colloportus0 avatar Oct 16 '22 16:10 Colloportus0

@llvm/issue-subscribers-mlir

llvmbot avatar Oct 16 '22 16:10 llvmbot

One thing to check is that you're building for the correct architecture. I hit this same issue when accidentally using -DLLVM_TARGETS_TO_BUILD="X86" on an M1 Mac. Switching to -DLLVM_TARGETS_TO_BUILD="AArch64" built cleanly. See this CMakeLists comment for why this happened in my case.

BradLarson avatar Oct 17 '22 22:10 BradLarson

I hit this same issue when accidentally using -DLLVM_TARGETS_TO_BUILD="X86" on an M1 Mac. Switching to -DLLVM_TARGETS_TO_BUILD="AArch64" built cleanly.

That's exactly the mistake I've made. Thanks for your help!

Colloportus0 avatar Oct 18 '22 02:10 Colloportus0

This looks like something to catch with some nice error message at CMake configuration time instead of failing with a linker error later?

joker-eph avatar Oct 18 '22 03:10 joker-eph