0.82.7.1

0.82.7.1

Discuss everything related to compiling and running Spring on Mac OS X.

Moderator: Moderators

Post Reply
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

0.82.7.1

Post by doomagent13 »

I have managed to compile spring without touching macports. (I do have it installed, just wanted to avoid it for this) However, it crashes on start. http://pastebin.com/rKknvT2y has the entire output in Terminal. Just looking at other threads, the solution would seem to involve adding #include "SDL_Main.h" to rts/System/Main.cpp, but that leads to a linking error, involving _main not being found. That also seems to have a solution, but not that avoids macports. Anyway, any insights would be appreciated.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: 0.82.7.1

Post by daftalx »

The problem is that two different targets are using this same Main.cpp file: if you add the include line, then "make spring" should build and link correctly (and that's basically the one you want to play). But the same line will indeed fail to link if you just type "make", since the headless-dependent targets should not use SDL.

On the Macports version, I'm providing the Main.cpp with the include line, and building the "spring" target only. For completeness I should provide a second port just for the headless version, but that's not the priority here (I/O with the lobby is more critical at this stage)

Hope this helps
daft
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: 0.82.7.1

Post by hoijui »

sounds like it could be fixed by an #if !defined HEADLESS. would that make sense? make patch?
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: 0.82.7.1

Post by daftalx »

didn't know about that flag. If it's that simple, I can forsee a green light in the waterfall in the near future 8)
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

Re: 0.82.7.1

Post by doomagent13 »

I think I've got it working, using SDL in dylib form rather than as a framework. Only problem now looks to be getting the necessary content to actually run it. Should it be able to run straight after "make spring", in which case something is wrong, or do I need to download/acquire resources for it? To be specific, it complains about a missing font, specifically 'fonts/FreeSansBold.otf'.

EDIT:
Nevermind, I copied the data files from a Windows install, and it partially works. It reaches the main menu, but due to assorted files not being found, I have yet to get it to load a game.

EDIT2:
After a little more testing, it seems to fail to load the .sdz and .sd7 files properly.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: 0.82.7.1

Post by daftalx »

doomagent13 wrote:I think I've got it working, using SDL in dylib form rather than as a framework.
Well, true, in fact a key point is that gcc should point to the SDL provided by MacPorts instead of the stock Mac SDL framework (easily done by just moving the /System/Library/Frameworks/SDL.Framework away from its initial location). It's anyway an outdated version compared to the MacPorts one. Other than that build options should not need any change.
doomagent13 wrote:Only problem now looks to be getting the necessary content to actually run it. Should it be able to run straight after "make spring", in which case something is wrong, or do I need to download/acquire resources for it? To be specific, it complains about a missing font, specifically 'fonts/FreeSansBold.otf'.
Also had the issue a while back, and though I can't recall exactly how I solved it, I'm pretty sure it was by adding freetype as a dependency in the MacPorts script.
doomagent13 wrote:EDIT:
Nevermind, I copied the data files from a Windows install, and it partially works. It reaches the main menu, but due to assorted files not being found, I have yet to get it to load a game.
Same goes with other platforms. The spring bundles don't give you maps/mods, however a lobby like SL lets you dl stuff when you double-click on a game. Spring alone only browses your ~/.spring/mods and ~/.spring/maps folder to run.
doomagent13 wrote:EDIT2:
After a little more testing, it seems to fail to load the .sdz and .sd7 files properly.
Could you give a bit more detail on the failure ? On my side I'm testing with an (old) BA 7.12 mod, a SpeedBall16 map and whichever AI available. No worries here. Which mod/map are you trying to use ?
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

Re: 0.82.7.1

Post by doomagent13 »

I've played a bit in Windows, so a large number of maps (2+ GB) and several mods were part of what I copied. BA 7.20 and ZK 0.7.3 failed to load the background for the loading screen. Kernel Panic 4.1 actually reached its loading screen, but then failed to load some graphics effect. I tried this with DSD for most of the attempts, although I did try Digital Divide with KP. For AI, I tried the KP AI, KAIK, and one of the NullAIs. I suppose it might be worth noting that the main menu fails to load its background image.

I unzipped the ZK .sdz and whichever image it complains about not finding is there in what looks to be the right path. I also tried with only 3 maps rather than the 200+ without success.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: 0.82.7.1

Post by hoijui »

looks like it fails to find base-files, which should look like:

Code: Select all

base/
base/springcontent.sdz
base/cursors.sdz
base/maphelper.sdz
base/spring/bitmaps.sdz
you also need the correct version of these files of course, and make sure that these only exist once in the data-dirs used by spring.
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

Re: 0.82.7.1

Post by doomagent13 »

As far as I can tell, the only copies of those files are the ones that came with the source code, and they're sitting right next to the executable. Do I need to run "make install" or should it work from the build directory?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: 0.82.7.1

Post by hoijui »

you need to run make install (or just copy them to the right dir manually).
the right dir is a read-only data-dir (using the structure i showed (everything under base/)).
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

Re: 0.82.7.1

Post by doomagent13 »

I did 'make install-spring', but it still fails to load whatever it had been failing on.

I tried turning on some of the log subsystems and found what could be the problem:

Code: Select all

[f=0000000] [ArchiveScanner] /usr/local/share/games/spring/base/springcontent.sdz checksum: -811163863/3483803433
[f=0000000] [ArchiveScanner] /usr/local/share/games/spring/base/spring/bitmaps.sdz checksum: -605683803/3689283493
...
[f=0000000] [ArchiveScanner] /usr/local/share/games/spring/base/maphelper.sdz checksum: -2014801887/2280165409
It would appear that the checksums are failing, which might then lead to them being rejected as sources. It kinda looks like it's using a signed integer when it should be unsigned.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: 0.82.7.1

Post by daftalx »

Forgive the silly question... But why would you actually not go through MacPorts, since 1) you have it, 2) it works ?
doomagent13
Posts: 6
Joined: 05 Jun 2011, 23:28

Re: 0.82.7.1

Post by doomagent13 »

I've had issues with macports in the past that were a pain to fix. As such, I prefer to use it as a last resort. But if it works, I suppose I might as well use it, even if it is harder to work on.

Now I just have to reverse the 'make install-spring'...
Guillaume Outters
Posts: 6
Joined: 20 Jun 2011, 16:15

Re: 0.82.7.1

Post by Guillaume Outters »

I made the whole thing compile without using MacPorts at all ( but happily doing some modifications to code that didn't work).
I would be interested in experiments to make the process automatic (it is already) and universal (this is the whole point: I know it compiles on my machine then there's the rest of the world); please see http://springrts.com/phpbb/viewtopic.ph ... 16#p492316
Post Reply

Return to “Mac OS X”