Mac OS X General Release for 0.80
Moderator: Moderators
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Re: Mac OS X General Release for 0.80
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?
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
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!
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
adso,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)
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
Don't worry, I have started documenting what I've done / how I've compiled everything - Dependencies required etc.Belmakor wrote:adso,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)
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!
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

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
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)
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
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.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?
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]; ")";
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
If you find anything wrong or unclear other than that, please point it out, too.
Re: Mac OS X General Release for 0.80
Could it be it should be something more like this? i.e. move the semicolon: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]; ")";
Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1] ");";
Re: Mac OS X General Release for 0.80
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!
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
You can have full confidence in this commityokosou wrote: Speaking of my commits, I have little confidence on one of them. It modifies jna_wrappEvents.awk:207.And removes the semicolon before ")". Without this, I get a error while building Java-AIInterface and it is.Code: Select all
name = name ".getIntArray(0, " evtsMembers_name[evtIndex, m+1]; ")";

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
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.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.
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.
Re: Mac OS X General Release for 0.80
[quote="Belmakor"][/quote]
BEL LONG TIME NO SEE MAEK BELS
hi
BEL LONG TIME NO SEE MAEK BELS
hi
Re: Mac OS X General Release for 0.80
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?
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
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)
);
}
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
it'd be best if you pushed your changes to a github fork.
Re: Mac OS X General Release for 0.80
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!
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
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.
As for the =b output register... if bochs can use it, so can Spring.

Re: Mac OS X General Release for 0.80
I just googled with the error message and found pages like this. And just tried it.FourtyTwo wrote:how did you ever find that fix though? it seems really, um, difficult to debug.
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?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?
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
-
- Posts: 20
- Joined: 14 Jun 2009, 03:50
Re: Mac OS X General Release for 0.80
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
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.
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
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.
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.