[Tutorial] Building Spring on Mac OS X

[Tutorial] Building Spring on Mac OS X

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

Moderator: Moderators

User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

[Tutorial] Building Spring on Mac OS X

Post by daftalx »

For better visibility and to avoid confusions & duplicates, the tutorial for compiling and running Spring and lobby (-ies) on Mac OS X has been updated and moved from here to the Wiki at http://springrts.com/wiki/Spring_on_MacOSX, replacing its (outdated) predecessor.

This topic is here for you to post your compilation/installation/running experiences using this tutorial.

Good luck and happy Mac-Springing !

last tutorial update: 2011/08/01 (SpringLobby 0.135)
Last edited by daftalx on 02 Nov 2011, 08:32, edited 13 times in total.
axyd
Posts: 4
Joined: 07 Jul 2010, 23:50

Re: [HOWTO] Spring on Mac OS X

Post by axyd »

Error :(

iMac 24, 10.5.8

Code: Select all

  Model Name:	iMac
  Model Identifier:	iMac8,1
  Processor Name:	Intel Core 2 Duo
  Processor Speed:	2.8 GHz
  Number Of Processors:	1
  Total Number Of Cores:	2
  L2 Cache:	6 MB
  Memory:	2 GB
  Bus Speed:	1.07 GHz

Code: Select all

--->  Extracting openssl
--->  Applying patches to openssl
Error: Target org.macports.patch returned: can't read "configure.sdkroot": no such variable
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python25 failed
Before reporting a bug, first run the command again with the -d flag to get complete output.
You have new mail in /var/mail/alex
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [HOWTO] Spring on Mac OS X

Post by daftalx »

axyd wrote:

Code: Select all

--->  Extracting openssl
--->  Applying patches to openssl
Error: Target org.macports.patch returned: can't read "configure.sdkroot": no such variable
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python25 failed
Before reporting a bug, first run the command again with the -d flag to get complete output.
A couple of updates / ideas :

- First things first. It seems you already had MacPorts installed on your system, as it tried to upgrade a port. So make sure you run the latest MacPorts with a "sudo port selfupdate" (1.9.1 was released recently), eventually followed by a "sudo port upgrade outdated" to upgrade all ports independently of the present tutorial. This will help narrowing bugs.

- I've updated the Portfile to remove the dependency to Python 2.5, as the project runs fine with the stock Python that comes with Mac OS (it should be no different for 10.5). Try hitting a "sudo port sync" before re-attempting the install command.

- Since you're on a 10.5 system, not everything runs 64b (well.. much less than 10.6 at least), so you could try to add " +universal" at the end of the install line if the original one fails again. This will force MacPorts to build the project and it's dependencies in universal form, which should cover both 32b and 64b cases.
Out of curiosity, since you have an Intel cpu, any reason not to upgrade to SL (besides the 129$ price) ? Recent builds are pretty stable and faster than 10.5 in most cases...

- Finally, next time you have an issue, it would be useful for us to have the full MacPorts install log. If you installed MacPorts in the default location, the full path of the log file should be something like:

Code: Select all

/opt/local/var/macports/logs/_opt_local_var_macports_sources_daftserver.game-host.org_macports-devel_games_springrts/main.log
You can then paste the contents into a paste bin (http://www.pastebin.ca) and then post the generated short link here.
axyd wrote:

Code: Select all

You have new mail in /var/mail/alex
That probably means you have mail :wink:
Chamrin
Posts: 33
Joined: 05 Mar 2010, 12:31

Re: [HOWTO] Spring on Mac OS X

Post by Chamrin »

daftalx wrote: Out of curiosity, since you have an Intel cpu, any reason not to upgrade to SL (besides the 129$ price) ? Recent builds are pretty stable and faster than 10.5 in most cases...
It's actually only $29.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [HOWTO] Spring on Mac OS X

Post by daftalx »

Chamrin wrote:
daftalx wrote: Out of curiosity, since you have an Intel cpu, any reason not to upgrade to SL (besides the 129$ price) ? Recent builds are pretty stable and faster than 10.5 in most cases...
It's actually only $29.
My bad, totally lost track of Mac OS client prices a while ago, instead I started (and still am) crying on the EUR'499 to get a server license :cry:
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by zoggop »

The line

Code: Select all

rsync://daftserver.game-host.org/macports/
added to sources.conf breaks macports because it can't connect to the server daftserver.game-host.org, I think. I mean, I certainly can't ping daftserver.game-host.org

Specifically, the error I get when I run

Code: Select all

sudo port sync
is:

Code: Select all

Error: Synchronization of the local ports tree failed doing rsync
port sync failed: Synchronization of 1 source(s) failed
Has the server gone down?
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

zoggop wrote:The line

Code: Select all

rsync://daftserver.game-host.org/macports/
added to sources.conf breaks macports because it can't connect to the server daftserver.game-host.org, I think. I mean, I certainly can't ping daftserver.game-host.org
You can't ping that server, as I've set it to stealth mode on purpose. Still, don't think it breaks the rest of the sync process (the official MacPorts list should still sync correctly).
zoggop wrote: Specifically, the error I get when I run

Code: Select all

sudo port sync
is:

Code: Select all

Error: Synchronization of the local ports tree failed doing rsync
port sync failed: Synchronization of 1 source(s) failed
Has the server gone down?
Actually not, but MacPorts may have been victim of a time-out due to high server workload (it's only a dual core cpu and compiles a whole bunch of stuff in routine). Try that again when you have time and let me know.

btw, FYI versions of both spring and lobbies are clearly outdated on MacPorts as we speak (I'm just landing back from long holidays). So single player mode will work, but not online play until I update the ports (and this tutorial)
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by zoggop »

Thanks! The macports repository works fine upon recent inspection.
Building springrts resulted in an error that confuses me (which is not terribly remarkable).

Code: Select all

--->  Fetching springrts
--->  Attempting to fetch spring_0.81.2.1_src.tar.gz from http://distfiles.macports.org/springrts
--->  Attempting to fetch spring_0.81.2.1_src.tar.gz from http://springrts.com/dl/
--->  Verifying checksum(s) for springrts
--->  Extracting springrts
--->  Configuring springrts
--->  Building springrts
Error: Target org.macports.build returned: shell command failed
Error: Status 1 encountered during processing.
Shell command failed? Hmm. This occurred after it had been "Building springrts" for at least twenty minutes, so the shell command it refers to isn't the compiler, I'm guessing. My best guess is that macports scripted a shell command that executes a binary that it didn't find in the right directory or filename. I wish it gave me more information... maybe there's a log file around here somewhere...
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

zoggop wrote:Thanks! The macports repository works fine upon recent inspection.
Building springrts resulted in an error that confuses me (which is not terribly remarkable).

Code: Select all

--->  Fetching springrts
--->  Attempting to fetch spring_0.81.2.1_src.tar.gz from http://distfiles.macports.org/springrts
--->  Attempting to fetch spring_0.81.2.1_src.tar.gz from http://springrts.com/dl/
--->  Verifying checksum(s) for springrts
--->  Extracting springrts
--->  Configuring springrts
--->  Building springrts
Error: Target org.macports.build returned: shell command failed
Error: Status 1 encountered during processing.
Shell command failed? Hmm. This occurred after it had been "Building springrts" for at least twenty minutes, so the shell command it refers to isn't the compiler, I'm guessing. My best guess is that macports scripted a shell command that executes a binary that it didn't find in the right directory or filename. I wish it gave me more information... maybe there's a log file around here somewhere...
My guess is that's definitely a build or link error (most likely a linking one since it occurs later in the process). But to diagnose further please follow the troubleshooting steps described in the "basics" section of this tutorial, otherwise we'll keep speculating :wink:
epicethos
Posts: 1
Joined: 26 Sep 2010, 02:14

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by epicethos »

OK, first post here. I've seen Spring in action and it looks amazing. Unfortunately I'm on a Mac running OS X 10.5.8. I was just wondering if an all-in-one installer is still planned, and if it is, when it can be expected. I don't usually compile anything myself... but if all else fails I'll give this a shot.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

epicethos wrote:OK, first post here. I've seen Spring in action and it looks amazing. Unfortunately I'm on a Mac running OS X 10.5.8. I was just wondering if an all-in-one installer is still planned, and if it is, when it can be expected. I don't usually compile anything myself... but if all else fails I'll give this a shot.
Short answer is "yes", the ultimate goal of all this is to get an all-in-one installer for Mac users. There is though no timeline for a release, as we are very few working on it, and there is yet no (stable) automated build system for the Mac binary.

This tutorial doesn't ask you to know too much about compilation, since everything happens "blindly" behind the MacPorts system. I've tried to make it as simple as possible, and after you follow it once, upgrades to the latest versions will be possible in a single command line. You still need to know how to use a terminal though :wink:
frequencyandsulphur
Posts: 10
Joined: 10 Oct 2010, 14:33

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by frequencyandsulphur »

zoggop wrote:The error I get when I run

Code: Select all

sudo port sync
is:

Code: Select all

Error: Synchronization of the local ports tree failed doing rsync
port sync failed: Synchronization of 1 source(s) failed
Unfortunately, I'm having the same issues, and have been for nearly a day. Is this server still up? If not, is there a secondary MacPorts server I can try using to get this data?
frequencyandsulphur
Posts: 10
Joined: 10 Oct 2010, 14:33

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by frequencyandsulphur »

frequencyandsulphur wrote:
zoggop wrote:The error I get when I run

Code: Select all

sudo port sync
is:

Code: Select all

Error: Synchronization of the local ports tree failed doing rsync
port sync failed: Synchronization of 1 source(s) failed
Unfortunately, I'm having the same issues, and have been for nearly a day. Is this server still up? If not, is there a secondary MacPorts server I can try using to get this data?
Looks like the server is back up. Spring is installing as we speak. I'm very excited :)
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

right. Sorry I couldn't come back earlier. I've been having severe power failure in my building, affecting both network and power in my server room. Hardware checks are fine, so things should be up and running as before.

Have fun!
frequencyandsulphur
Posts: 10
Joined: 10 Oct 2010, 14:33

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by frequencyandsulphur »

So, I've built everything, and that was problem free. The game main menu starts up, lets me select my mod and map but now I'm getting these "102: Operation not supported on socket" errors any time I try and run a skirmish ("Test the game"). Any idea what that's about? Terminal Output is below.

BTW, running this on a Macbook Pro (5,2), C2D, Snow Leopard. Based on advice in prior threads, I've made sure that my ~/.spring directory is +w, and the issue occurs with any Mod and Map and AI that I've tried. Solved below. Post maintained for anybody having similar issues.

Also, Alx, thanks for setting this all up :)

Code: Select all

username: ~ $ spring
using default configuration source "/Users/username/.springrc"
[CMyMath::Init] CPU SSE mask: 126, flags:
	SSE 1.0:  1,  SSE 2.0:  1
	SSE 3.0:  1, SSSE 3.0:  1
	SSE 4.1:  1,  SSE 4.2:  0
	SSE 4.0A: 0,  SSE 5.0A: 0
	using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Mac OS X
OS: 64bit native mode
Could not create directory /opt/local/bin/spring: File exists
LogOutput initialized.
Spring 0.81.2.1
Build date/time: Oct 11 2010 14:57:33
Available log subsystems: Sound, VFS-detail, VFS, ArchiveScanner, unit, CollisionVolume, mapinfo
Enabled log subsystems: Sound, 
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
Using read-write data directory: /Users/username/.spring/
Using read-only  data directory: /opt/local/share/games/spring/
ERROR in /opt/local/share/games/spring/ArchiveCacheV7.lua: could not open file: /opt/local/share/games/spring/ArchiveCacheV7.lua
Scanning: /opt/local/share/games/spring/base
Scanning: /Users/username/.spring/maps
Scanning: /Users/username/.spring/mods
Video mode set to  1024 x 768 / 32 bit
SDL:  1.2.14
GL:   2.1 NVIDIA-1.6.18
GL:   NVIDIA Corporation
GL:   NVIDIA GeForce 9600M GT OpenGL Engine
GLEW: 1.5.1
Connecting to local server
Starting GameServer: 6 ms
Fatal system error: 102: Operation not supported on socket
Sound: OpenAL info:
Sound:   Vendor:     Apple Computer Inc.
Sound:   Version:    1.1
Sound:   Renderer:   Software
Sound:   AL Extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER
Sound:   ALC Extensions: ALC_EXT_capture ALC_ENUMERATION_EXT ALC_EXT_MAC_OSX ALC_EXT_ASA ALC_EXT_ASA_DISTORTION ALC_EXT_ASA_ROGER_BEEP
Sound:   Device:     Built-in Output
Sound:   Available Devices:  
Sound:                       Built-in Output
EDIT: This problem was resolved by booting using a 32 bit kernel rather than a 64bit kernel. When this was changed, the game started, the map loaded, and I was able to fire a D-Gun for the first time in years. Hallelujah!
frequencyandsulphur
Posts: 10
Joined: 10 Oct 2010, 14:33

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by frequencyandsulphur »

Well, I'm now quite happily springing. If you need help testing any future mac builds, I'm more than happy to help. I'm no coder (at least, not in C), but I play stupid user very well.

Thanks, Mac Spring crew, for all the work you've put in here :)
facet
Posts: 4
Joined: 19 Oct 2010, 23:37

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by facet »

I think that 'freetype' is missing from the springrts dependencies. I got a similar command line error, checked the log and tried just porting freetype. Solved.

facets-iMac:_opt_local_var_macports_sources_daftserver.game-host.org_macports_games_springrts facet$ sudo port install springrts
---> Computing dependencies for springrts
---> Configuring springrts
Error: Target org.macports.configure returned: configure failure: shell command failed
Log for springrts is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_daftserver.game-host.org_macports_games_springrts/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
facets-iMac:_opt_local_var_macports_sources_daftserver.game-host.org_macports_games_springrts facet$ sudo port install Freetype
---> Computing dependencies for freetype
---> Fetching freetype
---> Attempting to fetch freetype-2.4.3.tar.bz2 from http://ovh.dl.sourceforge.net/freetype
---> Attempting to fetch freetype-doc-2.4.3.tar.bz2 from http://ovh.dl.sourceforge.net/freetype
---> Verifying checksum(s) for freetype
---> Extracting freetype
---> Applying patches to freetype
---> Configuring freetype
---> Building freetype
---> Staging freetype into destroot
---> Installing freetype @2.4.3_0
---> Activating freetype @2.4.3_0
---> Cleaning freetype
facets-iMac:_opt_local_var_macports_sources_daftserver.game-host.org_macports_games_springrts facet$ sudo port install springrts
---> Computing dependencies for springrts
---> Configuring springrts
---> Building springrts
---> Staging springrts into destroot
---> Installing springrts @0.81.2.1_0
---> Activating springrts @0.81.2.1_0
---> Cleaning springrts
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

facet wrote:I think that 'freetype' is missing from the springrts dependencies. I got a similar command line error, checked the log and tried just porting freetype. Solved.
Thanks for pointing this out. I didn't realize it was an actual dependency for spring. Oh well, I guess most people have freetype installed as soon as they start fiddling out with MacPorts...
I've updated the portfile.
facet
Posts: 4
Joined: 19 Oct 2010, 23:37

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by facet »

np daftalx. : )

now I have springrts up and running, but no bots or multiplayer. : /

Any help appreciated!

I would most like to get bots working before I join multiplayer. Getting bots working may not be a Mac issue, but pointers welcome.

I have tried the qt4 lobby, it compiled but it did not seem to recognise the change in library extension and so I was unable to point it at the unitsync lib. (Did I see this mentioned on another thread? - I cant seem to find it now).

I have also tried the springlobby, but that has not compiled.

...facets-iMac:Mods facet$ sudo port install springlobby
Password:
---> Computing dependencies for springlobby
---> Dependencies to be installed: libtorrent-rasterbar wxWidgets libsdl_mixer flac smpeg
---> Building libtorrent-rasterbar
Error: Target org.macports.build returned: shell command failed
Log for libtorrent-rasterbar is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_daftserver.game-host.org_macports_net_libtorrent-rasterbar/main.log
Error: The following dependencies failed to build: libtorrent-rasterbar wxWidgets libsdl_mixer flac smpeg
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Log:http://pastebin.com/BcNn53U8

Model Name: iMac
Model Identifier: iMac11,2
Processor Name: Intel Core i3
Processor Speed: 3.2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L3 Cache: 4 MB
Memory: 4 GB

System Version: Mac OS X 10.6.4 (10F2056)
Kernel Version: Darwin 10.4.1
64-bit Kernel and Extensions: No
Time since boot: 24 days 13:21
uname -a:
Darwin facets-iMac.local 10.4.1 Darwin Kernel Version 10.4.1: Fri Jul 16 23:04:20 PDT 2010; root:xnu-1504.7.51~1/RELEASE_I386 i38

erm anything else?

Finally:

In trying to get this to work intrepid Mac users like me have to follow a quite convoluted route to get to the FM! What can I do to help fix this?
http://springrts.com/wiki/Spring_on_MacOSX
http://springrts.com/wiki/Building_Spring_on_MacOSX
are both very different from the FM here. How confusing/daunting!

I am loving the macports repo - great work, thankyou.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Compiling spring and lobbies on Mac OS 10.6

Post by daftalx »

facet wrote:np daftalx. : )
now I have springrts up and running, but no bots or multiplayer. : /
Fact: you can't join multiplayer games if your Spring version doesn't coincide with the server's. It takes a lot of time and effort to catch up with the code updates though, and I don't have that much time these days...
Until then, you can always try a solo mode, e.g. Chicken BA. They're weird-looking bots, but they do kick your ass if you don't rock your defenses :wink:
facet wrote:I have tried the qt4 lobby, it compiled but it did not seem to recognise the change in library extension and so I was unable to point it at the unitsync lib. (Did I see this mentioned on another thread? - I cant seem to find it now).
Have you tried specifying the full path to the unitsync lib (with correct extension) manually ?
facet wrote:I have also tried the springlobby, but that has not compiled.
Found it. I've updated the libtorrent-rasterbar port, which had ugly non ISO C++ code in it. New version should roll out fine.
facet wrote:In trying to get this to work intrepid Mac users like me have to follow a quite convoluted route to get to the FM! What can I do to help fix this?
http://springrts.com/wiki/Spring_on_MacOSX
http://springrts.com/wiki/Building_Spring_on_MacOSX
are both very different from the FM here. How confusing/daunting!
True. Never found the courage to unify all these pages. So I just did. The tutorial has been moved to the first wiki page you mention, and the second points to that one in the first paragraph.
Post Reply

Return to “Mac OS X”