You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build mlir on Windows, but I got many errors on undefined references when linking mlir-tblgen.exe:
If you look the attached screenshot, you can see that I have highlighted lib/libMLIRTableGen.a.
This is a static library and it is the cause of the problem, because it has not its dependencies satisfied.
By looking into the generated build.ninja file, I have found this line, which provides the above libraries when linking:
or all static libraries and then all import libraries if you prefer.
It is interesting to notice that lib/libMLIRTblgenLib.a and lib/libMLIRTableGen.a cannot be swapped, lib/libMLIRTblgenLib.a must be written before lib/libMLIRTableGen.a, otherwise you will got lot of undefined references again.
Evidently, one static library is also a dependency for the other one.
MSVC does not seem to suffer about this behaviour on libraries at link time.
I configured the sources according to the guidelines, by using this command line:
This effect happens with GCC for CYGWIN and MinGW-w64 cross compiler.
I'm using -DBUILD_SHARED_LIBS=ON on the command line since this is the only way to bypass issue #60659 for me.
EDIT: unfortunately, I was not able to find the right point for fixing this issue, if somebody could give me some suggestions about the fixes to do, I could test them and provide a patch at https://reviews.llvm.org/.
I'm using the development sources from head, 4f30746.
The text was updated successfully, but these errors were encountered:
Actually, building mlir-pdll.exe shows the same identical problem, but when the issue on mlir-tblgen.exe will be solved, probably mlir-pdll.exe will be solved too.
I tried to build mlir on Windows, but I got many errors on undefined references when linking
mlir-tblgen.exe
:If you look the attached screenshot, you can see that I have highlighted
lib/libMLIRTableGen.a
.This is a static library and it is the cause of the problem, because it has not its dependencies satisfied.
By looking into the generated build.ninja file, I have found this line, which provides the above libraries when linking:
I just did a quick hack to this file, by changing the above line to:
After that,
mlir-tblgen.exe
has been linked successfully.Actually, the libraries should respect some order when linking, something like:
or all static libraries and then all import libraries if you prefer.
It is interesting to notice that
lib/libMLIRTblgenLib.a
andlib/libMLIRTableGen.a
cannot be swapped,lib/libMLIRTblgenLib.a
must be written beforelib/libMLIRTableGen.a
, otherwise you will got lot of undefined references again.Evidently, one static library is also a dependency for the other one.
MSVC does not seem to suffer about this behaviour on libraries at link time.
I configured the sources according to the guidelines, by using this command line:
This effect happens with GCC for CYGWIN and MinGW-w64 cross compiler.
I'm using
-DBUILD_SHARED_LIBS=ON
on the command line since this is the only way to bypass issue #60659 for me.EDIT: unfortunately, I was not able to find the right point for fixing this issue, if somebody could give me some suggestions about the fixes to do, I could test them and provide a patch at https://reviews.llvm.org/.
I'm using the development sources from head, 4f30746.
The text was updated successfully, but these errors were encountered: