SprinGW (MinGW for Spring)

SprinGW (MinGW for Spring)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

SprinGW (MinGW for Spring)

Post by SpliFF »

As some of you may have noticed I'm now at the end of my third day of attempts to build Spring under MinGW on Windows.

To be honest I'm not surprised. I already knew that:

a.) The majority, if not all, of Spring's core developers are linux users;
b.) Getting open-source compiling tools setup on Windows is a fuckfest;
c.) Getting anything to works on Windows is some kind of miracle.

So anyway, here I am going into day 4 somewhat tired, but wiser for the experience. The primary lesson I've learned is that it's simply impractical to guide new developers through the process via a half-page, half-maintained wiki and links to other sites.

The simple reason for this is that within a day of updating the wiki something will end up changing in spring, in the mingwlib dependencies, in windows itself, or in the extrordinary number of 3rd-party sites where the necessary tools are scattered around the web.

The best example of this is mingw itself. There are so many packages on there that finding the right package and version of any given part of it is like a needle in a haystack. Chances are by the time you read the wiki there'll be a new and incompatible version in place of what you need (using a new naming convention).

In general though the entire build infrastructure is entirely too flakey. It's nobody's fault, it's just that there are too many dependencies scattered around too many places and they're all extremely fussy about which versions of everything else they'll work with. Also many of the tools conflict when installed at the same time (ie MinGW doesn't like the presence of sh.exe but Git requires it). I know there are workarounds but does the n00b trying all this for the first time? It's doubtful.

So what to do about it?

Well I've decided to start a new project. Its name is SprinGW and its goal will be to unify ALL required tools and libraries for building Spring on Windows into a single integrated installer.

It's basically an extension of the work already done on the Spring mingwlibs package but taken even further to synchronise these libraries with a portable and reliable build environment, helpful scripts and complete instructions.

The plan is to test each formal release of Spring against this package and update it if necessary to maintain compatibility.

Now with the preamble done I just wanted to check something. I've decided to start with the latest stable versions of prebuilt libraries I can find and work backwards if needed. Right now I have:

CMake 2.8
GCC 4.5.1
Boost 1.44.0 (Patched to remove a warning)
Binutils 2.20.1
Mingw Runtime 3.18 (*not* showing _tls error - fixed by boost 1.44?)
w32api 3.14
Freetype 2.4.2
Glew 1.5.5
Ogg 1.2.0
Vorbis 1.3.1
SDL 1.2.14

The whole thing compiles with no warnings however my last attempt failed on linking ogg, easy enough to solve though. I'm running it again and going to bed.

Anyway the main point of this thread is to let you guys know what I'm planning and to check if there are any foreseeable complications with the versions I'm using or the concept in general.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: SprinGW (MinGW for Spring)

Post by aegis »

I've never had issues building syncable spring with tdm/dw2 mingw and the provided mingwlibs
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: SprinGW (MinGW for Spring)

Post by Super Mario »

Can I talk to you through msn? Or some other IM? Cause I can help you setting up the build environment.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SprinGW (MinGW for Spring)

Post by SpliFF »

@aegis : I don't think you really get it. There are currently 3 versions of the mingwlibs. 1.) - the git master - is for pre 4.4.2, 2.) is for post 4.4.2, and 3.) which has dw2 instead of sjlj isn't even on git, FloZi sent me a link for it. If it worked for you then you just had the version that matched your particular MinGW setup. For someone who hasn't done this before getting the right version and tools could be an intimidating process.

@Super Mario: I appreciate the help but I don't actually need it. The tools I have are fine now. The issues I had are with the multiple mingw versions TDM/Official SjLj/Dwarf2 and that CMake2.6 wouldn't build spring-multithreaded because the ld commandline exceeded 32k characters (fixed in CMake2.8).

The purpose of this project isn't to get help for my own issues, it's to help others. I want Spring to have a reference build environment that we can point people to when their own setup is missing, broken or incompatible. I remember going through issues like this when GCC version 4 was released. In the future it'll be other issues. We just don't have enough win32 dedicated developers to keep testing Spring Spring under all possible tool and library combinations so it makes sense to ensure there will always be one combination or libraries and tools we know will work that is easy for newcomers to find and install.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: SprinGW (MinGW for Spring)

Post by jK »

SpliFF wrote:@aegis : I don't think you really get it. There are currently 3 versions of the mingwlibs. 1.) - the git master - is for pre 4.4.2, 2.) is for post 4.4.2, and 3.) which has dw2 instead of sjlj isn't even on git, FloZi sent me a link for it. If it worked for you then you just had the version that matched your particular MinGW setup. For someone who hasn't done this before getting the right version and tools could be an intimidating process.
Incorrect ... all are build with dwarf2.
So the git repo ones work! and even the master branch works with gcc 4.5.0!

Also CMake2.6 work under windows too when you use a different commandline (check google to find such ones, or try the msysgit bash).


The problem aren't our mingwlibs, the problem is to get a working mingw environment, which is harder than it might sound.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: SprinGW (MinGW for Spring)

Post by aegis »

I've compiled both with the mingwlibs zip that's around and the git mingwlibs for latest spring... stock install of cmake whatever and the dw2 minglibs that was in the wiki
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SprinGW (MinGW for Spring)

Post by SpliFF »

jK wrote:Incorrect ... all are build with dwarf2.
Perhaps now. It's hard to tell when that changed: http://springrts.com/phpbb/viewtopic.ph ... 75#p435075. The files provided there actually worked for me with the official MinGW 4.4.0 whereas the one on git did not. It's even possible the downloadable mingwlibs and the git mingwlibs are out of sync (I used the git 4.4.2 branch).
jK wrote:Also CMake2.6 work under windows too when you use a different commandline (check google to find such ones, or try the msysgit bash).
I was explicitly told on #sy that Spring might not build under msys and even if it does the provided instructions on the wiki assume you're using cmd.exe.

In addition while I'd like to build under msys there are 2 issues:
1.) I'd like to integrate with codeblocks and that's designed to use MinGW by itself.
2.) ming32-make gets cranky when it finds sh.exe in your path. I have to clear my path before building anything to avoid git, msys, cygwin and mingw fighting over whose executables run. I know you are supposed to be able to install MinGW over the top of msys but i've had bad experience with that in the past.

At any rate hoijoi patched a check for CMake 2.8 into the build scripts.
jK wrote:The problem aren't our mingwlibs, the problem is to get a working mingw environment, which is harder than it might sound.
The problem is both.

Also a lack of clear and/or accurate and/or up-to-date instructions.

You have to understand I've done all this before, I understand the windows shell, batch programming, the concept and structure of mingw32, I know linux and cmake scripting, I've built Spring successfully on Windows before - and yet - the provided instructions repeatedly failed in several different ways. What chance does anyone who has never compiled anything but a VS project got?

Pointing the finger at what I might have done wrong is unhelpful. All I did was follow the instructions provided and it failed to build. I also tried alternatives and they failed.

There seems to be an implication here that this project isn't needed because everything just works. If it worked for you then more power to you. On the other hand I know based on the forum and #sy that the process is not as easy for newcomers as implied and that blaming them isn't solving anything.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SprinGW (MinGW for Spring)

Post by SpliFF »

aegis wrote:I've never had issues building syncable spring with tdm/dw2 mingw and the provided mingwlibs
I was told I should NOT be using TDM builds. The wiki says it is an "alternative". To a newcomer that means "try this last".

It was my understanding that TDM builds are bleeding-edge and possibly unstable. The site says "the latest stable version of GCC" but it seems like it has some major internal differences from the official MinGW and that historically it takes new versions of GCC a while to reliably work with existing code (usually they puke new warnings everywhere).

It sounds a lot like the "mm" kernel series to me. A way to test new things for people who know what to do when they break. Of course if you complain your critical production server crashed while running it you'll just get laughed at.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: SprinGW (MinGW for Spring)

Post by jK »

SpliFF wrote:The files provided there actually worked for me with the official MinGW 4.4.0 whereas the one on git did not. It's even possible the downloadable mingwlibs and the git mingwlibs are out of sync (I used the git 4.4.2 branch).
SpliFF wrote:I was told I should NOT be using TDM builds. The wiki says it is an "alternative". To a newcomer that means "try this last".
The current official MinGW has GCC 4.5.0
The problem is that the MinGW project fails at giving easy install packages atm for it, so as said it is a extremely hard to get it working. The TDM webinstaller allows you to download this official MinGW 4.5.0, what makes it a lot easier. Still even doing it this way, it might install mingwrt 3.18+ which causes "multiple definition of _tls_used" linker errors as noted on the wiki (you also find some discussions here on the forum), so you need to download the mingwrt 3.17 yourself and replace the installed files with it.
Also GCC4.4.0 had a bug/issue, that's why it needed special mingwlibs (those are available in the branch in the mingwlibs git repo!), with GCC4.5.0 any mingwlibs package should work again.

And yeah, the wiki isn;t updated for 4.5.0, still the linker error is noted in there, also the install way is the same (it just doesn't note the 2nd solution with the TDM webinstaller).
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SprinGW (MinGW for Spring)

Post by SpliFF »

jK wrote: The current official MinGW has GCC 4.5.0
The problem is that the MinGW project fails at giving easy install packages atm for it, so as said it is a extremely hard to get it working.
The current official webinstaller actually installs 4.5.0 and works fine despite its alpha status. It's obviously changed since you last checked. That makes the TDM installer redundant for the moment and I'd still recommend building an "official" spring mingw packages around the official mingw rather than a repacked third-party solution..
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: SprinGW (MinGW for Spring)

Post by zwzsg »

I tried to install MinGW once. It was a total failure. There were like two ways in MinGW website, but both were hopelessly broken on multiple levels. So yea, I'd be happy if SpliFF made a nice complete installer. IMO the important point is to make sure SpliFF stuff contains a copy of everything needed, and never relies on downloading any part from the internet. Because links dies, or get updated with slightly miscompatible versions, and there the nightmare starts.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SprinGW (MinGW for Spring)

Post by SpliFF »

Agreed, though as it happens I have the benefit of insane amounts of free server space and bandwidth for the foreseeable future. I have no qualms hosting anything and everything that's required in one place.
Post Reply

Return to “Engine”