MLIR build related

Hello Everyone,

From yesterday(as I recall), I’m facing a build issue while building mlir-opt.
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:

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?


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?

Yes, this log seems same!

Hi Uday,
I just tried to narrow down this issue. Issue is seen after this @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: (@stephenneuendorffer), should be fixed in

1 Like