Compiling with msys2


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

User avatar

Dungeon Dilettante

Posts: 4

Joined: Saturday, 1st August 2015, 08:13

Location: Japan

Post Friday, 30th March 2018, 14:19

Compiling with msys2

Hi all.

I had built dcss 0.21.1 with msys2, but some tiles are not displayed.

Image

What should I do to fix this problem?

Environment:
- Windows 10 (Home)
- Git for windows SDK 1.0.6 https://github.com/git-for-windows/build-extra/releases
- g++.exe (Rev1, Built by MSYS2 project) 7.2.0
- building as follows:
  Code:
$ git clone --recursive https://github.com/crawl/crawl.git dcss-0.21
$ cd dcss-0.21/crawl-ref/source
$ git checkout stone_soup-0.21
$ git describe --tags
0.21.1-1-g345015fe64

edit contrib/sdl2/src/core/windows/SDL_xinput.h for compile error:
  Code:
#if 0 // comment out for compile error
#ifndef HAVE_XINPUT_GAMEPAD_EX
typedef struct
{
    WORD wButtons;
    BYTE bLeftTrigger;
    BYTE bRightTrigger;
    SHORT sThumbLX;
    SHORT sThumbLY;
    SHORT sThumbRX;
    SHORT sThumbRY;
    DWORD dwPaddingReserved;
} XINPUT_GAMEPAD_EX;
#endif

#ifndef HAVE_XINPUT_STATE_EX
typedef struct
{
    DWORD dwPacketNumber;
    XINPUT_GAMEPAD_EX Gamepad;
} XINPUT_STATE_EX;
#endif
#endif

  Code:
$ make TILES=y
$ ./crawl.exe

Dungeon Master

Posts: 283

Joined: Monday, 18th August 2014, 20:04

Post Friday, 30th March 2018, 14:39

Re: Compiling with msys2

This pops up sporadically but it's not entirely clear what's going on, and it often resolves on its own. In past reports like this, what's usually been necessary is to upgrade your video driver. Specifically, you should download the latest version from the graphics card manufacturer's site, since the windows update thing won't necessarily get this. There are specific graphics cards that show up more in reports (HP). You should also do any pending windows updates etc. Also, for unclear reasons, this seems to consistently happen when dcss runs in a virtualbox VM, and there is unfortunately no known solution to that right now.

Do you have this problem with release version of 0.21.1?

(Also, the SDL_xinput.h thing is patched in trunk, and is unrelated to this graphical issue.)
User avatar

Dungeon Dilettante

Posts: 4

Joined: Saturday, 1st August 2015, 08:13

Location: Japan

Post Friday, 30th March 2018, 15:26

Re: Compiling with msys2

Thank you for reply.

> Do you have this problem with release version of 0.21.1?

With official release binary(stone_soup-0.21.1-tiles-win32), It looks all fine.
(screen shot) https://i.imgur.com/Q1vVMrt.png

What building environment did devteam use for windows binary?

Dungeon Master

Posts: 283

Joined: Monday, 18th August 2014, 20:04

Post Friday, 30th March 2018, 15:34

Re: Compiling with msys2

dplusplus wrote:Thank you for reply.

> Do you have this problem with release version of 0.21.1?

With official release binary(stone_soup-0.21.1-tiles-win32), It looks all fine.
(screen shot) https://i.imgur.com/Q1vVMrt.png

What building environment did devteam use for windows binary?


It's actually cross-compiled on linux, using msys2; gammafunk is the one who does these so he would have more information on exactly how it is built. There aren't many devs around who build on windows right now; I've only done windows work in a VM. It's a bit puzzling that the release version would work, though, and it does suggest that there may be some build setting that isn't right. I'll see if I can check what exact build options gammafunk uses for doing the cross-compiling.

For this message the author advil has received thanks:
dplusplus

Dungeon Master

Posts: 283

Joined: Monday, 18th August 2014, 20:04

Post Saturday, 31st March 2018, 00:56

Re: Compiling with msys2

The one potentially relevant thing I found out about how it is cross-compiled is that it is a 64 bit build target; so maybe make sure you aren't running the 32bit version of msys2 (IIRC there are different shell commands). The full cross-compiling build command is `make CROSSHOST=i686-w64-mingw32 package-windows`, which probably would need to be run on a linux instance with the right libraries installed. You could try `make package-windows`, since that does maybe do something to set the architecture. Let me know if you have any success.

At some point I'll try to test this problem out again on a VM but I need to rebuild the VM from scratch so I won't get to it immediately.

For this message the author advil has received thanks:
dplusplus
User avatar

Dungeon Dilettante

Posts: 4

Joined: Saturday, 1st August 2015, 08:13

Location: Japan

Post Monday, 2nd April 2018, 14:08

Re: Compiling with msys2

I've tried to build as follows, though, it didn't work out.

- Install mingw-w64 http://mingw-w64.org/doku.php/download/mingw-builds
- Install makensis http://nsis.sourceforge.net/Download
- add to $PATH
- edit Makefile
  Code:
-AR := $(CROSSHOST)-ar
-RANLIB := $(CROSSHOST)-ranlib
+AR := $(CROSSHOST)-gcc-ar
+RANLIB := $(CROSSHOST)-gcc-ranlib

- edit SDL_xinput.h if needed
  Code:
 $ make CROSSHOST=i686-w64-mingw32 package-windows

 ...

 * rebuilding tilegen: new build flags or prefix
    HOSTCXX tool/tile_colour.o
    HOSTCXX tool/tile.o
    HOSTCXX tool/tile_page.o
    HOSTCXX tool/tile_list_processor.o
    HOSTCXX tool/main.o
    HOSTLINK tool/tilegen.elf
tool/tile_colour.o: In function `Z9write_pngPKcP11tile_colourjj':
C:\git-sdk-64\dcss-0.21-test\crawl-ref\source\rltiles/tool/tile_colour.cc:260: undefined reference to `png_create_write_struct'
C:\git-sdk-64\dcss-0.21-test\crawl-ref\source\rltiles/tool/tile_colour.cc:265: undefined reference to `png_create_info_struct'
C:\git-sdk-64\dcss-0.21-test\crawl-ref\source\rltiles/tool/tile_colour.cc:272: undefined reference to `png_init_io'
(ommited)



Finally, I've suceed to build win32 binary with `make CROSSHOST=i686-w64-mingw32 package-windows-zips` on Ubuntu Linux / mingw-w64.
It works very fine. Thanks for your advice!

Dungeon Master

Posts: 283

Joined: Monday, 18th August 2014, 20:04

Post Monday, 2nd April 2018, 14:55

Re: Compiling with msys2

well, I'm glad something worked. Those png errors look to be something new, but I'm not immediately sure what (linking against wrong version of libpng, maybe; we often use a contrib version in a submodule).

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.