How to compile with scons on Windows V1.5.1/Linux Mint

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderators: Forum Moderators, Developers

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby loonycyborg » December 17th, 2015, 10:23 am

I used TDM mingw-w64 5.1.0 from http://tdm-gcc.tdragon.net/. I added multilib_arch option to scons to make 32-bit binaries since mingw-w64 makes 64-bit binaries by default. multilib_arch=32 would pas -m32 both to compiler and linker. I also upgraded boost to 1.59. Didn't get any errors with this setup.
"meh." - zookeeper
User avatar
loonycyborg
Windows Packager
 
Posts: 262
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby SigurdFireDragon » December 18th, 2015, 1:33 am

My latest attempts used tdm-gcc 5.1.0 64 & 32

I built boost 1.59 as 32-bit with the tdm-gcc 5.1.0
(if using 64x, make.bat needs a _64 for the path to bjam & a address-model=32 when calling bjam.)
Choice of 32 or 64 bit compiler had no effect on how the 32-bit boost was built or the output of the compile attempts, other than the above.
altered the 1.3.8 win scons make_scons.bat appropriately and ran it.

here's my log for the attempt with 5.1.0 64bit compiler
I used the multilib_arch=32 with this run
The compiler seemed to run despite the first line of the log...
A bunch of warnings & then mention of incompatibility at the end of the log.
Spoiler:


here's my log for 5.1.0 32 bit compiler
it mentions the "'SHGFP_TYPE_CURRENT' was not declared in this scope" whereas the 64-bit didn't
Spoiler:


I didn't use "-F pe-i386 to the windres" as I didn't know how to fit it in, and loonycyborg's post didn't mention it. Should it have been used?
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby shadowm » December 18th, 2015, 3:44 am

SigurdFireDragon wrote:I didn't use "-F pe-i386 to the windres" as I didn't know how to fit it in, and loonycyborg's post didn't mention it. Should it have been used?

Code: Select all
C:/Compiling/TDM-GCC-64-510/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `packaging\windows\wesnoth.o' is incompatible with i386 output

Yes, because this error is caused by windres compiling resources for x86_64 by default. I don’t know how to set its command line with SCons, though.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
I also made Wesnoth RCX, a team-color preview tool for artists and content creators.
Elsewhere: shadowmBlogFollow me on Twitter
User avatar
shadowm
Wesnoth.org Administrator
 
Posts: 6185
Joined: November 14th, 2006, 5:54 pm
Location: Chile

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby Pentarctagon » December 18th, 2015, 6:42 am

SigurdFireDragon wrote:My latest attempts used tdm-gcc 5.1.0 64 & 32

I built boost 1.59 as 32-bit with the tdm-gcc 5.1.0
(if using 64x, make.bat needs a _64 for the path to bjam & a address-model=32 when calling bjam.)
Choice of 32 or 64 bit compiler had no effect on how the 32-bit boost was built or the output of the compile attempts, other than the above.
altered the 1.3.8 win scons make_scons.bat appropriately and ran it.


Could you post how you called bjam/scons? I had tried adding the address-model=32 option, but in the configuration checks it still stated that it was building as 64-bit. On the other hand, it's being built in a path containing "address-model-32" so maybe it is actually 32-bit? I'm assuming it's not though, since when I go to build scons it fails every pre-requisite check except for: m, round(), g++ >= 3.3, Boost smart_ptr library, pango with cairo backend, and fontconfig.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2976
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby SigurdFireDragon » December 18th, 2015, 7:48 am

SigurdFireDragon wrote:My latest attempts used tdm-gcc 5.1.0 64 & 32

I built boost 1.59 as 32-bit with the tdm-gcc 5.1.0
(if using 64x, make.bat needs a _64 for the path to bjam & a address-model=32 when calling bjam.)
Choice of 32 or 64 bit compiler had no effect on how the 32-bit boost was built or the output of the compile attempts, other than the above.
altered the 1.3.8 win scons make_scons.bat appropriately and ran it.


I was somewhat unclear there...those lines read better with:
I built boost 1.59 as 32-bit with both tdm-gcc 5.1.0 64 & 32
(if using 5.1.0 64x to compile boost, make.bat needs a _64 for the path to bjam & a address-model=32 when calling bjam.)
Choice of 32 or 64 bit compiler had no effect on how the 32-bit boost was built or the output of the scons wesnoth compile attempts, other than the above.
altered the 1.3.8 win scons make_scons.bat appropriately and ran it.


Here's how I changed the make.bat for building boost with the 64-bit compiler:
(Note I put put 'set PATH' in my scripts instead of in Start Menu -> Computer -> Properties, as it's quicker for changing things)
Spoiler:


Here's what the 32-bit compiler make.bat that I tried looked like:
Spoiler:


Though as above, both produced the same error log when used with scons (the "here's my log for the attempt with 5.1.0 64bit compiler" from my last post)


Here's my current make_scons.bat
Spoiler:
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby Pentarctagon » December 18th, 2015, 8:14 am

Ah, apparently it has to come before other options. I had placed it between BZIP2_SOURCE and --toolset which didn't work. As a side note, specifying:
Code: Select all
cxxflags="-m32" linkflags="-m32"

also works.

For passing additional options to windres, in <wesnoth>/packaging/windows/SConscript there's a variable RCFLAGS used on line 11 which I assume would be used for this purpose, but I am not sure how to pass it in from the command line. Adding the option after "$RCFLAGS" manually does work and wesnoth compiles successfully, though now trying to run the executable gives the error:
Code: Select all
The procedure entry point GOMP_parallel could not be located in the dynamic link library libgomp-1.dll
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2976
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby SigurdFireDragon » December 18th, 2015, 5:49 pm

Tried the wesnoth>/packaging/windows/SConscript hack that you mentioned, got the same result.

Compared the libgomp-1.dll within the win scons pack (46 KB) to the one that was installed with Wesnoth 1.13.2a (128 KB)
swapping in the larger one produces a different error - a windows "Wesnoth Game Client has stopped working" when I try to launch it.


EDIT:
Removed all the dll's that came with win scons 1.3.8 method and swapped in all the 1.13.2a dlls. Had to add back in libhistory6.dll as well (as the win scon 1.3.8 method uses this optional dll), and that got wesnoth running. :)
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby Pentarctagon » December 20th, 2015, 2:49 am

Alright, I've can get it to compile, but when trying to run it I immediately get a "program is not responding" error. I'm assuming that's because I'm missing a dll, but I have no idea what it is since the error itself says nothing useful. I'm using all the dlls from the 1.13.2a download minus the old SDL1.2 dlls and have overwritten any existing dlls that also came with the SDL2.0 development file downloads.

Are there any other new libraries that need to be added/updated?

dlls:
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2976
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby SigurdFireDragon » December 22nd, 2015, 1:49 am

Went to add the SDL 2.0 like you did, and it compiled and ran for me. I'm not sure what I did differently from you so I'll list it here, being overly specific to avoid any confusion.

1. Downloaded all the SDL runtime binaries from https://www.libsdl.org/download-2.0.php & https://www.libsdl.org/projects/ (for image, mixer, net, rtf, & ttf ) (the 32-bit Windows ones with -win32-x86.zip at the end)
2. Dumped all the new SDL dlls overtop the old ones (the 1.13.2a dlls) in my wesnoth master folder, overwriting any with the same name.

3. Downloaded all the Windows development libraries for the above components (the MinGW 32/64-bit ones with -mingw.tar.gz at the end)
4. Unpacked and merged all the i686-w64-mingw32 folder contents inside those archives.
5. Dumped the merged folders into the scons-dependencies folder, and told windows to overwrite any files with same name

6. Used the latest master (2015-12-21 - sha: 571014f374e6e7d8767ac93736bbeb494fbe5488)
7. Compiled and it ran.
Last edited by SigurdFireDragon on December 22nd, 2015, 5:26 pm, edited 1 time in total.
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby Pentarctagon » December 22nd, 2015, 7:40 am

Where did you get the SDL2.0 RTF binary? The project page says it's for SDL1.2 and has only the source code download available. The description also says it's a sample library.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2976
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby shadowm » December 22nd, 2015, 9:25 am

Wesnoth uses SDL_ttf, not SDL_rtf.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
I also made Wesnoth RCX, a team-color preview tool for artists and content creators.
Elsewhere: shadowmBlogFollow me on Twitter
User avatar
shadowm
Wesnoth.org Administrator
 
Posts: 6185
Joined: November 14th, 2006, 5:54 pm
Location: Chile

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby SigurdFireDragon » December 22nd, 2015, 5:23 pm

Pentarctagon wrote:Where did you get the SDL2.0 RTF binary? The project page says it's for SDL1.2 and has only the source code download available. The description also says it's a sample library.


Ooops, I don't have a SDL2.0 RTF binary, or anything for it at all. That was a mistake.
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby loonycyborg » December 23rd, 2015, 2:20 pm

I've committed a change that makes scons pass -F pe-i386 for multilib 32bit builds. Also I've uploaded my current dependency archive for dev branch. It contains SDL2 too.
"meh." - zookeeper
User avatar
loonycyborg
Windows Packager
 
Posts: 262
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

Re: How to compile with scons on Windows V1.3.8/Linux Mint

Postby Pentarctagon » December 24th, 2015, 12:50 am

Interestingly, it turns out it wasn't the libraries, it was the "-O3" option I was adding via extra_flags_release. The default release of "-O2" works fine and on Mint the option "-O3" works fine, but for whatever reason it causes problems on Windows now.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2976
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to compile with scons on Windows V1.3.9/Linux Mint

Postby SigurdFireDragon » December 26th, 2015, 5:37 pm

Thanks Pentarctagon, shadowm, & loonycyborg for helping getting this running again.
User avatar
SigurdFireDragon
Developer
 
Posts: 323
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

PreviousNext

Return to Release Announcements, Compiling & Installation

Who is online

Users browsing this forum: Google [Bot] and 2 guests