MLIR build related

Hello Everyone,

From yesterday(as I recall), I’m facing a build issue while building mlir-opt.
log:
ninja mlir-opt
[1/1] Linking CXX executable bin/mlir-opt
/binutils-2.32/bin/ld: cannot find -lLLVMNVPTXCodeGen
/binutils-2.32/bin/ld: cannot find -lLLVMNVPTXDesc
/binutils-2.32/bin/ld: cannot find -lLLVMNVPTXInfo
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

CMake script used:
cmake …/…/llvm/ -G “Ninja” -DCMAKE_BUILD_TYPE=RELEASE -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS=“clang;lld;lldb;mlir” -DLLVM_ENABLE_ASSERTIONS:BOOL=ON -DCLANG_DEFAULT_LINKER:STRING=lld

Please note here mlir-translate, mlir-tblgen is getting build fine.
Is their something wrong with cmake config, do we actually need these LLVMNVPTXCodeGen and others libs?

Thanks,
Sourabh.

I think there’s a bug in the cmakefile for the GPUToCUDA conversion. This file attempts to disable certain parts of the code if the NVPTX target is not configured, but still ends up having to link against the NVPTX libraries. The simplest solution is to enable the NVPTX target. Or if you’d like to take a shot at fixing that CMakeFile, then patches would be appreciated!

Is this related to this bug I reported last week?
https://bugs.llvm.org/show_bug.cgi?id=45140

Yes, this log seems same!

Hi Uday,
I just tried to narrow down this issue. Issue is seen after this https://reviews.llvm.org/D74592 @mehdi_amini get in. If you try resetting before that i.e reset too 07211d951d584b19951ad8dedbaf7c728297f4b5. mlir-opt is building fine.
Can anyone confirm this please!

It was broken here: https://github.com/llvm/llvm-project/commit/9f979d7ad5d10#diff-0e9e0fcb1cf58bfe3047d815696e1f0dR18 (@stephenneuendorffer), should be fixed in https://github.com/llvm/llvm-project/commit/f80c6d8dec18

1 Like