Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MSYS2 MinGW-w64 #393

Closed
ghost opened this issue Mar 1, 2023 · 8 comments
Closed

Support MSYS2 MinGW-w64 #393

ghost opened this issue Mar 1, 2023 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 1, 2023

xmake config --mode=releasedbg failed to install assimp:

=> install assimp v5.2.5 .. failed

C:/msys64/mingw64/include/c++/12.2.0/cmath:45:15: fatal error: math.h: No such file or directory
   45 | #include_next <math.h>
      |               ^~~~~~~~
compilation terminated.
  ${yellow}> in ${bright}C:\msys64\tmp\.xmake\230301\_9FBCAB64B619410AA5B53DAE28D84EC2.cpp
if you want to get more verbose errors, please see:
  -> C:\Users\iahuntn\AppData\Local\.xmake\cache\packages\2303\a\assimp\v5.2.5\installdir.failed\logs\install.txt
error: install failed!

Update: xmake installed with pacman -S mingw-w64-x86_64-xmake

@SirLynix
Copy link
Contributor

SirLynix commented Mar 1, 2023

Hi,

This is caused by msys2/MINGW-packages#10761.
The only fix I'm aware of is to disable the usage of -isystem and rely on -I instead.

You can do this by disabling the package.include_external_headers:n policy.
xmake config --mode=releasedbg --policies=package.include_external_headers:n

this is what's done on the MinGW CI

@ghost
Copy link
Author

ghost commented Mar 2, 2023

Hi,

This is caused by msys2/MINGW-packages#10761. The only fix I'm aware of is to disable the usage of -isystem and rely on -I instead.

You can do this by disabling the package.include_external_headers:n policy. xmake config --mode=releasedbg --policies=package.include_external_headers:n

this is what's done on the MinGW CI

It doesn't work!

  => install assimp v5.2.5 .. failed

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0x9ea5): undefined reference to `unzOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0x9fc6): undefined reference to `unzGoToFirstFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa02e): undefined reference to `unzGetCurrentFileInfo'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa0c8): undefined reference to `unzOpenCurrentFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa0f8): undefined reference to `unzReadCurrentFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa129): undefined reference to `unzCloseCurrentFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa192): undefined reference to `unzGoToNextFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(IFCLoader.cpp.obj):IFCLoader.cpp:(.text+0xa1a3): undefined reference to `unzClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0x818): undefined reference to `unzClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0xbdb): undefined reference to `unzGoToFilePos'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0xbeb): undefined reference to `unzOpenCurrentFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0xc7a): undefined reference to `unzReadCurrentFile'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0xdf3): undefined reference to `unzOpen2'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0xe32): undefined reference to `unzClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0x11cc): undefined reference to `unzOpen2'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0x11dc): undefined reference to `unzClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\iahuntn\AppData\Local\.xmake\packages\a\assimp\v5.2.5\315bab8ab3e04a7ebfc148df500488da\lib/libassimp.a(ZipArchiveIOSystem.cpp.obj):ZipArchiveIOSystem.cpp:(.text+0x12df): undefined reference to `unzOpen2'
if you want to get more verbose errors, please see:
  -> C:\Users\iahuntn\AppData\Local\.xmake\cache\packages\2303\a\assimp\v5.2.5\installdir.failed\logs\install.txt
error: install failed!

@SirLynix
Copy link
Contributor

SirLynix commented Mar 2, 2023

This is a whole different error.

Could you try to run xmake config --mode=releasedbg --policies=package.include_external_headers:n -vD and send the full log here to help debug it?

Also, if you don't need assimp for now you can disable it with --assimp=n

@ghost
Copy link
Author

ghost commented Mar 2, 2023

xmake has native support for msys2, my solution is use pacman packages to speed up the build process and also as a workaround for this problem. Sometimes, the software doesn't compile out of the box and needs the msys2 maintainer to patch it. Most of the time, mixing packaging systems will result in errors like this. I still remember my misery with libarchive and pkgsrc (pkgsrc uses it own patched libarchive, but on the bootstrap process it links with the system's libarchive even though I passed option to force it to prefer it own version libarchive). Yeah, this is on FreeBSD but I learned the lesson (I have never able to have pkgsrc works on FreeBSD because of this problem).

Long story short, when it ask you please input: y (y/n/m), choose m and manually force it to use pacman packages instead of building it own.

@SirLynix
Copy link
Contributor

SirLynix commented Mar 2, 2023

It works well on the MinGW/msys2 CI, I'd like to know why it's failing for you.

@SirLynix
Copy link
Contributor

Closed since user deleted their account and lacking info to reproduce.

@SirLynix SirLynix closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2023
@waruqi
Copy link

waruqi commented Sep 2, 2023

I have improved it. xmake-io/xmake@35dd6cb

@SirLynix
Copy link
Contributor

SirLynix commented Sep 2, 2023

Thank you! I will test this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants