cant compile crawl locally?


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

User avatar

Tartarus Sorceror

Posts: 1881

Joined: Saturday, 7th September 2013, 21:16

Location: Itajubá, MG, Brazil.

Post Sunday, 16th November 2014, 21:57

cant compile crawl locally?

I'm trying to compile Trunk, after 2 weeks not playing, and I keep getting the message
"unrecognised command line option "-std=c++11"
preceded by various malformed iTXt chunk warnings...
does anyone know how to fix it?
my posts are to be read in a mildly playful tone, with a deep, sexy voice.

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Sunday, 16th November 2014, 22:45

Re: cant compile crawl locally?

It's because msysgit comes with g++ 4.4.0 which is too old of a version to compile c++11 code.
(I've been fighting this for over a week now)

FWIW the full version of MinGW with msys won't compile because it doesn't support the posix compatibility layer, and MSVC v12 doesn't support c++11, and MSVC 13 *does* support it (Well, at least a large chunk of it, not quite everything yet), but the configuration of the MSVC solution files don't work with MSVC 13 (They may not have worked for a while, it's been over two years since I compiled under MSVC 12)

As it stands, there's no "out of the box" way to compile crawl in windows currently. If I come up with something I'll post it here.

(Actually I haven't tried Cygwin yet, that sounds awful, but I may try that later today or tomorrow.)
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!
User avatar

Tartarus Sorceror

Posts: 1881

Joined: Saturday, 7th September 2013, 21:16

Location: Itajubá, MG, Brazil.

Post Monday, 17th November 2014, 00:48

Re: cant compile crawl locally?

thanks a lot. I'm glad it is not me being stupid.
my posts are to be read in a mildly playful tone, with a deep, sexy voice.

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Wednesday, 19th November 2014, 03:53

Re: cant compile crawl locally?

Success!

Here's what I did:
Followed the instructions here:
http://win-builds.org/1.4.0/msys-cygwin.html following the 1.2. MSYS Installation instructions
Spoiler: show
1.2. MSYS Installation
Download mingw-get-setup.exe and run it.
Click on Install.
Click on Change to chose another installation directory, go to C:/ and make a new directory named win_builds and validate. You are free to install anywhere else but remember to keep the various paths consistent.
Click on Continue.
Once the progress reaches 100%, click on Next.
In the new window, select All packages and then MSYS Base System.
On the right of the window, right-click on msys-base and select Mark for installation.
Now click on Installation in the menu bar at the top of the window and then Apply Changes.
In the new window, click on Apply. Once everything is installed, use the Close button and exit the installer.
Go to C:/win_builds/msys/1.0/ , right-click on msys.bat, hover over Send To and chose Desktop (create shortcut).
2. Win-builds Installation
Run either MSYS or Cygwin according to what you have installed then download yypkg-1.4.0.exe and run it from the command-line as:

for MSYS: ./yypkg-1.4.0.exe --deploy --host msys
for Cygwin: ./yypkg-1.4.0.exe --deploy --host cygwin
The package manager will prompt for the architectures to install win-builds for and will prompt for confirmation before the actual installation of each architecture that has been chosen.

3. Change toolchain on-the-fly
The win-builds-switch script takes care of everything; run it in your shell like:

# To switch to the i686 toolchain
. /opt/windows_32/bin/win-builds-switch 32
# To switch to the x86_64 toolchain
. /opt/windows_64/bin/win-builds-switch 64
4. Set a default toolchain (optional)
The easiest way to set a toolchain by default is to add its selection to the user’s profile. The command will be executed each time an interactive shell is started and will be valid for everything started from them.

echo '. /opt/windows_32/bin/win-builds-switch 32' >> ~/.profile

Then I used the MinGW Installation manager to install Perl for msys (All Packages->Msys->msys-perl)
Then I started up msys shell and cloned the crawl source tree with git.
Then I went into the source folder and discovered that for some reason Lua doesn't build into the right place. Went into the LUA folder and build the source, then copied the liblua.a library to the install folder indicated by the makefile:
contrib/install/$(ARCH)/lib
Where $(ARCH) was i686-w64-mingw32 for me.
Then I went back into crawl and make worked as expected.

This leaves out a lot of pain and mis-steps and invalid configurations along the way, but I think that's ultimately all the parts that were needed to make it work.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

For this message the author Siegurt has received thanks:
Hirsch I

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Wednesday, 19th November 2014, 04:26

Re: cant compile crawl locally?

Gammafunk's suggestion is to use msysgit to get msys, then use win-build's yypkg to install the compiler and toolchain (steps 2-4)

Also adding BUILD_LUA=y should avoid the un-needed extra step of building Lua separately.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

Vestibule Violator

Posts: 1567

Joined: Friday, 21st January 2011, 22:56

Post Wednesday, 19th November 2014, 15:17

Re: cant compile crawl locally?

For a tiles build this works:
Install the yypkg thing into msysgit. The msys folder it asks for is the one you installed msysgit to. Then build with: make NO_PKGCONFIG=y TILES=y BUILD_ALL=y
Possibly you can replace BUILD_ALL=y with something like BUILD_SDL=y BUILD_LUA=y BUILD_LIBPNG=y, but I haven't tested that yet.

Thanks to gammafunk and Grunt :)

Edit: oh, and it looks like you can ignore the iTXt chunk warnings, I didn't notice any problems with tiles.

Halls Hopper

Posts: 57

Joined: Saturday, 28th April 2012, 08:55

Post Thursday, 20th November 2014, 11:00

Re: cant compile crawl locally?

I did similiar thing, and it worked till yesterday. Today however, first I ran into problems with tilegen, and since I had no better idea I did "make clean" both for crawl and contribs, and now it crashes when compiling libpng:

  Code:
    CC png.o
In file included from pngpriv.h:72:0,
                 from png.c:14:
pnglibconf.h:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
 scripts/pnglibconf.h.prebuilt
        ^
In file included from png.c:14:0:
pngpriv.h:281:10: error: unknown type name 'png_double'
          typedef png_double*           png_doublep;
          ^
pngpriv.h:282:10: error: unknown type name 'png_double'
          typedef const png_double*     png_const_doublep;
          ^
pngpriv.h:283:10: error: unknown type name 'png_double'
          typedef png_double**          png_doublepp;
          ^
In file included from png.h:470:0,
                 from pngpriv.h:294,
                 from png.c:14:
pnglibconf.h:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
 scripts/pnglibconf.h.prebuilt
        ^
make[2]: *** [png.o] Error 1
make[2]: Leaving directory `/crawl/crawl-ref/source/contrib/libpng'
make[1]: *** [libpng] Error 2
make[1]: Leaving directory `/crawl/crawl-ref/source/contrib'
make: *** [.contrib-libs] Error 2


Any ideas?
User avatar

Tartarus Sorceror

Posts: 1881

Joined: Saturday, 7th September 2013, 21:16

Location: Itajubá, MG, Brazil.

Post Tuesday, 25th November 2014, 07:12

Re: cant compile crawl locally?

I did not manage to make crawl work, but I got a number of brand new errors! its something!
now it does not compile because it searches src/audio/directsound/directx.g:96:19 and does not find it!
my posts are to be read in a mildly playful tone, with a deep, sexy voice.

Vestibule Violator

Posts: 1567

Joined: Friday, 21st January 2011, 22:56

Post Tuesday, 25th November 2014, 16:44

Re: cant compile crawl locally?

There were a lot of fixes recently, and compilation worked for me again, using the same process as before the sdl2 merge (I tested compilation without sound only, no idea if it works with sound support). So install the compiler package into msysgit, then use the appropriate make options as mentioned above. Another important thing is that new submodules were added, which you will have to initialize and update. So if you haven't done so already go to the repository root directory and run "git submodule update --init".

For this message the author Galefury has received thanks:
MIC132

Halls Hopper

Posts: 57

Joined: Saturday, 28th April 2012, 08:55

Post Tuesday, 25th November 2014, 19:30

Re: cant compile crawl locally?

Yeah, I forgot to post here, but the basic issue was fixed, as stated here:
https://crawl.develz.org/mantis/view.php?id=9236

Also for me the compilation needs NO_PKGCONFIG parameter for make, otherwise the makefile fails to find the contribs.

Dungeon Dilettante

Posts: 3

Joined: Wednesday, 10th December 2014, 06:09

Post Wednesday, 10th December 2014, 06:14

Re: cant compile crawl locally?

I'm still getting ddraw.h and friends missing.

To clarify the updated install procedure:

1) I installed msysgit from the latest installer
2) I started msys.bat and ran
  Code:
./yypkg-1.4.0.exe --deploy --host msys

from the msys command line
3) I give it the msysgit install directory when it asks for the MSYS directory
4) Once it installs, to test it I type in
  Code:
. /opt/windows_32/bin/win-builds-switch 32

which appears to execute but doesn't return a message, and then version check gcc. It comes up 4.4.0 still.

Am I doing anything obviously wrong there?

EDIT:
On further poking around -
If I cd right down into the bin directory of the win-builds installation, and run win-builds-switch from there, a gcc check indicates I'm at 4.8.2.
But if I leave the directory, I'm at 4.4.0 again.

MORE EDITS:
Step 4 on the win-builds installation page doesn't help either - I double checked that the command was being written to .profile in my user directory, but no change to the gcc version on startup.

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 17 guests

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