Page 3 of 6
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 00:36
by Auswaschbar
IF anyone of you is Soichiro Yokoyama:
If MACOSX_BUNDLE necessary? From what I got from the discussion, its not possible for nonbundled apps to get focus, so is there a reason to build a non-bundle for spring?
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 01:08
by adso
Spring still gets focus even as a command line app.
However, I still think for a proper release, we should be compiling it as an .app bundle.
I would do it, but my programming skills are still quite meager, and I'm not too sure how to link everything up in Xcode to do it.
On that note, by a sad twist of fate I am working again, so my progress on this might be a bit slower than before (as I won't be able to pull my 4am debugging sessions now :p)
anyway back to work!
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 01:36
by Belmakor
adso wrote:
On that note, by a sad twist of fate I am working again, so my progress on this might be a bit slower than before (as I won't be able to pull my 4am debugging sessions now :p)
adso,
Regardless of how much time you get in the next little while, can you *please* make your number 1 priority documenting what you have done so far? e.g. you say you have springlobby working with the unitsync.dyllib. If so, do tell how. etc. If you pass on as much info as possible, someone else might be able to finish the last few steps and finally we'll get a proper spring for Mac OS! Let's all work together on this!
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 05:21
by adso
Belmakor wrote:adso wrote:
On that note, by a sad twist of fate I am working again, so my progress on this might be a bit slower than before (as I won't be able to pull my 4am debugging sessions now :p)
adso,
Regardless of how much time you get in the next little while, can you *please* make your number 1 priority documenting what you have done so far? e.g. you say you have springlobby working with the unitsync.dyllib. If so, do tell how. etc. If you pass on as much info as possible, someone else might be able to finish the last few steps and finally we'll get a proper spring for Mac OS! Let's all work together on this!
Don't worry, I have started documenting what I've done / how I've compiled everything - Dependencies required etc.
I will try and make this as easy as possible so that people on OSX can get this going.
Springlobby is somewhat unstable loading the unitsync library (need to pass a command line option so that it doesn't complain about errors that aren't acutally happening).
Once I've documented my spring / springlobby findings, I will move onto sorting out the boost errors! I'm fairly confident I could gzip my source directories and anyone could compile Spring / Springlobby on OSX without any modification. I can upload these to my FTP for anyone interested.
Or would it be easier to make my own github branch of this (i'm really new to GIT sorry

) and just comment on the files I've changed?
Thanks to everyone who has allowed this to come so far... Once spring can start running script.txt's on OSX, then we can test to see if the unitsync libraries work nicely with the PC / Linux version (can't see why they won't if it's all x86 architecture)
Okay, that's enough of a ramble for my lunchtime!
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 06:03
by Belmakor
Cool. Sounds good. Where are you documenting? Somewhere online? In the Spring wiki would be good!
Would love to try building your code. I do have a built version of both springlobby and spring itself, and can run spring and play around with it and sound works, etc, but of course, the two aren't talking to each other.
If you upload your stuff to FTP soonish, maybe I could take a look at the boost errors myself tonight.
(and I'm new to git, too. totally used to svn, so git seems a bit weird for me right now)
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 06:10
by yokosou
Auswaschbar wrote:IF anyone of you is Soichiro Yokoyama:
If MACOSX_BUNDLE necessary? From what I got from the discussion, its not possible for nonbundled apps to get focus, so is there a reason to build a non-bundle for spring?
I am. As adso explained, spring gets focus as a command line app. I think the discussion applies only to programs that use wxWidgets, so it's possible to use nonbundled spring via bundled springlobby.
Speaking of my commits, I have little confidence on one of them. It modifies jna_wrappEvents.awk:207.
Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1]; ")";
And removes the semicolon before ")". Without this, I get a error while building Java-AIInterface and it is.
Code: Select all
awk: illegal statement
input record number 318, file /Users/sou/Desktop/spring_0.80.2/spring/rts/ExternalAI/Interface/AISEvents.h
source line number 207
make[3]: *** [AI/Interfaces/Java/libAIInterface.dylib] Error 2
make[2]: *** [AI/Interfaces/Java/CMakeFiles/Java-AIInterface.dir/all] Error 2
make[1]: *** [AI/Interfaces/Java/CMakeFiles/Java-AIInterface.dir/rule] Error 2
make: *** [Java-AIInterface] Error 2
Is it a right approach to avoid the error?
If you find anything wrong or unclear other than that, please point it out, too.
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 06:19
by Belmakor
yokosou wrote:
Speaking of my commits, I have little confidence on one of them. It modifies jna_wrappEvents.awk:207.
Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1]; ")";
Could it be it should be something more like this? i.e. move the semicolon:
Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1] ");";
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 06:30
by adso
Belmakor -
Try this to get your unitsync library working with Springlobby
run Springlobby from the terminal passing the command -nc (./springlobby -nc)
then point springlobby to the libunitsync.dylib and it shouldn't throw errors at you (and in the terminal window it will display all the unitsync library info)
this is the ONLY way I can get springlobby to load the dylib and let me join online games. When the game begins spring will throw boost errors at you :)
good luck and happy testing!
I will try and submit as much info as I can tonight on the OSX wiki, I think I will begin with a darwinports guide for all the dependencies...
and go from there!
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 10:04
by hoijui
yokosou wrote:
Speaking of my commits, I have little confidence on one of them. It modifies jna_wrappEvents.awk:207.
Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1]; ")";
And removes the semicolon before ")". Without this, I get a error while building Java-AIInterface and it is.
You can have full confidence in this commit

you fixed it right. It was/is a copy paste error of mine.. the thing is, AWK is quite forgiving, but what it forgives depends on which AWK you use. This typo/bug never caused problem with GAWK on windows and linux.
so.. merge time? :D
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 12:43
by yokosou
yokosou wrote:I am. As adso explained, spring gets focus as a command line app. I think the discussion applies only to programs that use wxWidgets, so it's possible to use nonbundled spring via bundled springlobby.
Sorry, I was wrong. The discussion basically applies to spring and my macfix branch will make spring that doesn't get focus as a command line app. But, it seems that SDLMain.m can set up the app so that they can get focus.
When I started porting, spring worked as a command line app. After that, SDLMain.m was updated and spring was not getting focus as a command line app since then. But I didn't test it carefully, so I believed not-bundled spring can still get focus.
And I found how to fix the boost error although I don't understand why it does. Removing "-fvisibility=hidden" seems to fix it. Inserting "#pragma GCC visibility push(default)" and "#pragma GCC visibility pop" in the first line and the last line of BaseCmd.h also seemed to work.
[edit]
At first post, I wrote BaseCmd.cpp and "#pragma GCC visibility push("default")", but it was a mistake.
Posted: 28 Aug 2009, 17:50
by FourtyTwo
Good job yokosou! that was the last fix that i was working working on, i just tested spring with my version of springlobby and it launches and starts the game!
how did you ever find that fix though? it seems really, um, difficult to debug.
Re: Mac OS X General Release for 0.80
Posted: 28 Aug 2009, 18:24
by REVENGE
[quote="Belmakor"][/quote]
BEL LONG TIME NO SEE MAEK BELS
hi
Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 08:25
by adso
I have updated the MacOSX wiki, please feel free to add to it.
Keeping in mind I have to add in all the minor source code changes so that it works :)
also here is one of the changes I made, is it possible to merge this into the main source for the next release?
Code: Select all
namespace proc {
#if defined(__GNUC__)
// function inlining breaks this
__attribute__((__noinline__))
void ExecCPUID(unsigned int* a, unsigned int* b, unsigned int* c, unsigned int* d)
{
__asm__ __volatile__(
"cpuid"
: "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d)
: "0" (*a)
);
}
for some reason, OSX will not compile if this is left in it's standard form (=b)
I was reading about cpuid commands and it seems like that most people avoid using the register =b for most programs now too...
once I change =b to =S Util.cpp compiles fine... otherwise I get a BREG error
Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 10:08
by imbaczek
it'd be best if you pushed your changes to a github fork.
Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 10:53
by hoijui
woo huh!
nice work adso, with the Wiki!!
you broke with the mystery of the work beeing lost, of all those that tried to get spring onto OS X :D
congratulation!
and yeah, what imbaczek said.. it would be good. it will show your name for the changes, so the honor is yours, and you will be in the list of spring source code devs for eternity!

Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 11:37
by Kloot
There is already a Mac-specific ExecCPUID (#ifdef'ed) in master.
As for the =b output register... if bochs can use it, so can Spring.

Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 15:07
by yokosou
FourtyTwo wrote:how did you ever find that fix though? it seems really, um, difficult to debug.
I just googled with the error message and found pages like
this. And just tried it.
adso wrote:I have updated the MacOSX wiki, please feel free to add to it.
Keeping in mind I have to add in all the minor source code changes so that it works :)
also here is one of the changes I made, is it possible to merge this into the main source for the next release?
First, thank you for updating the wiki! I have just read it and noticed that your makefile builds a unusable spring. But, makefile builds a usable spring here. Does it show any error message?
Well, I pushed a similar commit to my branch and Auswaschbar seems to have brought it to master. Also, I think you can get my branch by the following. Note that this may not contain Tobi's float3 fix.
Code: Select all
sudo port install git-core
git clone git://github.com/yokosou/spring.git
cd spring
git checkout origin/macfix
I found a way to get a focus on a nonbundled spring. So, I am rebasing and updating my macfix branch. After that, I will inclued libraries inside the bundle and upload it to somewhere so that they can be tested.
Re: Mac OS X General Release for 0.80
Posted: 29 Aug 2009, 18:18
by redwyaster5
hey if you guys are looking for a 17" macbook pro. iv got one that we can test spring on. its a 2.4 ghz with 4 gbs of ram.
Re: Mac OS X General Release for 0.80
Posted: 31 Aug 2009, 11:19
by yokosou
Thanks for that, redwyaster5. But sorry, I found another problem that I think must be solved before making the bundle.
Sound attenuation is much stronger on Mac than on Linux. I think this is because OpenAL on Mac will not permit sources' gain to be higher than 1.0 and when set, it is clamped to [0, 1.0]. The attenuation is calculated after that and the result will be an actual gain from the source.
On OpenAL spec (and probably on other platforms), Sources' gain can be higher than 1.0. The attenuation factor is first calculated and multiplied by the gain. Then, the result will be clamped to [0, 1.0].ÒÇÇ
So, I think setting sources' gain higher than 1.0 is similar to weakening the attenuation that applies to the source. And I am trying to change AL_REFERENCE_DISTANCE and AL_ROLLOFF_FACTOR depending on source's gain so that I can get a similar output on Mac.
Re: Mac OS X General Release for 0.80
Posted: 31 Aug 2009, 16:19
by FourtyTwo
found out something interesting about what kind of mac spring can me built on, i am running a 2008 white mac book with the Intel GMA X3100 built in graphics card, and under the 10.5 version of the operating system the computer only has version 1.2 of OpenGL, so i got spring to compile but could not run it. it would crash whenever it tried to load up the map in the pre-game loading.
However i updated to 10.6 "snow leopard" on friday hoping for some good news about the OpenGL, and it seems that OpenGL is now upto 2.0. so the game can now run.
the only problem is this :
http://bugzilla.libsdl.org/show_bug.cgi?id=581 SDL wont build on snow leopard, but they are working on a fix in the next release, so you should be able to get it to compile if you use the UNSTABLE subversion code for SDL, however i am unsure about that.
so for anyone trying to compile spring it might be a good idea to wait to upgrade. :)
i did manage to get the old spring engine to run against the old libraries that i linked it to, so it CAN run on snow leopard, you just can't compile it yet.