View topic - Compiling Spring (Mac OsX)



All times are UTC + 1 hour


Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 28 Nov 2009, 14:11 

Joined: 06 Mar 2009, 14:19
Hello,

i didnt find a suitable subforum for this, so please forgive me for posting here, i thought to some extend it might be similar to the linux compiling:wink:.
I followed the guide in the Spring wiki, got all dependencies with Macports or compiled them from source.

It worked fine until i got this error at 59% during the compilation of Util.cpp:
Code:
[ 59%] Building CXX object rts/CMakeFiles/spring.dir/System/Util.cpp.o
{standard input}:20:suffix or operands invalid for `push'
{standard input}:23:suffix or operands invalid for `pop'
make[2]: *** [rts/CMakeFiles/spring.dir/System/Util.cpp.o] Error 1
make[1]: *** [rts/CMakeFiles/spring.dir/all] Error 2
make: *** [all] Error 2


Unfortunatly, Util.cpp is written in assembler (right?) , so i cannot even try to fix it, the only thing i figured out was the error was about these lines:

Code:
   void ExecCPUID(unsigned int* a, unsigned int* b, unsigned int* c, unsigned int* d)
   {
   #ifndef __APPLE__
      __asm__ __volatile__(
         "cpuid"
         : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d)
         : "0" (*a)
      );
   #else
      __asm__ __volatile__(
         "pushl %%ebx\n\t"
         "cpuid\n\t"
         "movl %%ebx, %1\n\t"
         "popl %%ebx"
         : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d)
         : "0" (*a)
      );


Terminal output: http://springonmacosx.pastebin.com/m320030c2
CMakeOutput.log: http://springonmacosx.pastebin.com/m4a3c60a5
CMakeError.log: http://springonmacosx.pastebin.com/m1669b6f

Thanks for ur help, :-)
grapfruit

P.S.: I also tried scons, but i failed configuring because of a lacking jni.h
header file ...


Top
 Offline Profile  
 
PostPosted: 01 Dec 2009, 13:34 

Joined: 01 Dec 2009, 13:15
Hi,

Try this:
Code:
#else
  __asm__ __volatile__(
    "pushq %%rbx\n\t"
    "cpuid\n\t"
    "movl %%ebx, %1\n\t"
    "popq %%rbx"
    : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d)
    : "0" (*a)
  );
#endif


I'm not sure it works, because I'm still building. But at least it compiles.

(http://www.x86-64.org/documentation/assembly.html)


Top
 Offline Profile  
 
PostPosted: 01 Dec 2009, 14:37 

Joined: 01 Dec 2009, 13:15
Confirmed, it works. I'm testing the game right now :)


Top
 Offline Profile  
 
PostPosted: 01 Dec 2009, 19:39 

Joined: 06 Mar 2009, 14:19
thx tranchis for your fast help :-)

the util.c fix worked perfectly,
i had to make another fix because there was no error handler window for mac osx, so i used x for it.
And some of the java interface files failed to build, but i read somewhere that they are just important for certain widgets and most widgets dont need that (right?).

But in the end, Spring finally started on my MacBok Pro :mrgreen:

But i still need to figure out where to put the mods and the maps :wink:

[CoW]GrapeFruit :-)

P.S.: are u on osx, tranchis?


Top
 Offline Profile  
 
PostPosted: 01 Dec 2009, 20:09 
Spring Developer

Joined: 24 Jun 2007, 07:34
Location: 50┬░ 56' N, 11┬░ 35' O
Does it work, or just compiles? Also, is it 32bit compatible?


Top
 Offline Profile  
 
PostPosted: 01 Dec 2009, 20:26 

Joined: 06 Mar 2009, 14:19
it compiles, runs with xta and altored and im on a 32 bit machine.
i think osx runs in 32 bit by default, but u can set it to 64 before starting

[CoW]GrapeFruit


Top
 Offline Profile  
 
PostPosted: 02 Dec 2009, 00:37 
Spring Developer

Joined: 24 Jun 2007, 07:34
Location: 50┬░ 56' N, 11┬░ 35' O
Was asking because I wanted to apply the patch, but have no mac to test.


Top
 Offline Profile  
 
PostPosted: 02 Dec 2009, 11:05 

Joined: 01 Dec 2009, 13:15
I'm in OSX, yes, in Snow Leopard.

I'm not sure it should compile in 32 bits, because operations like pushq and popq are 64-bit specific. Maybe you could use a flag in there to let the compiler choose between both.

It compiled and I'm pretty sure it works. There are some traces of the CPU identification on the console while running and they seem to retrieve correct information.


Top
 Offline Profile  
 
PostPosted: 02 Dec 2009, 15:49 

Joined: 06 Mar 2009, 14:19
what lobby client do u use?
i tried springlobby, but the wxmac didnt compile neither through macports nor from source, allthough i used the build flags for snow leopard.

[CoW]GrapeFruit


Top
 Offline Profile  
 
PostPosted: 05 Dec 2009, 12:33 

Joined: 01 Dec 2009, 13:15
I've committed a fix for Util.cpp in a fork in GitHub just in case someone wants to add it to the master fork:

http://github.com/tranchis/spring/commit/d4714c8f96f5c4b281361ab9c9936c9a66a75caf

GrapeFruit, I don't use any Lobby. I'm just testing some coding of AI scripts, and with the test runs it's enough for me.


Top
 Offline Profile  
 
PostPosted: 05 Dec 2009, 16:12 

Joined: 06 Mar 2009, 14:19
i updated the spring on mac osx wiki page:
http://springrts.com/wiki/Spring_on_MacOSX

grapefruit


Top
 Offline Profile  
 
PostPosted: 08 Dec 2009, 10:47 
AI Coder

Joined: 07 Sep 2009, 13:28
Location: Aalborg, Denmark
Now all we need is a guide to make an app-file, and you guys would be awesome...


Top
 Offline Profile  
 
PostPosted: 08 Dec 2009, 14:46 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
wxwidgets compiles fine in snow leapoard as long as you force it to 32bits, Im not sure how to build springlobby in 32bit arch however =/


Top
 Offline Profile  
 
PostPosted: 09 Dec 2009, 18:05 

Joined: 06 Mar 2009, 14:19
works fine, looks ugly ;) :
http://img69.imageshack.us/img69/3451/s ... 9at180.png

edit:
doesnt accept the unitsync.dylib i compiled cause its 64 bit :(


Top
 Offline Profile  
 
PostPosted: 13 Dec 2009, 01:07 
User avatar

Joined: 16 Oct 2008, 17:54
GrapeFruit wrote:
works fine, looks ugly ;) :
http://img69.imageshack.us/img69/3451/s ... 9at180.png

edit:
doesnt accept the unitsync.dylib i compiled cause its 64 bit :(

I don't see what you think is ugly about that.

Why doesn't wxwidgets compile in 64-bits? (That's what I've gathered from AF's post)


Top
 Offline Profile  
 
PostPosted: 13 Dec 2009, 02:07 

Joined: 06 Mar 2009, 14:19
It did finally compile in 64 bit, but its an unstable build (the stable release is using carbon, but osx has no 64 bit carbon support), so braindamage and koshi had to make fixes for springlobby to compile (thx :-) )
It still gives error messages at random times but it pretty much works fine now ! :wink:

I think we are finally getting a mac build of spring, :mrgreen:
[CoW]GrapeFruit

Image


Attachments:
File comment: Spring Mac OSC
Screen shot 2009-12-13 at 01.49.27.png [1.03 MiB]
Downloaded 2 times
Top
 Offline Profile  
 
PostPosted: 17 Dec 2009, 17:03 

Joined: 01 Dec 2009, 13:15
Is anyone already trying to get a MacOS Application bundle?

If no one is already on it, I might try during this week or the next one.


Top
 Offline Profile  
 
PostPosted: 17 Dec 2009, 17:57 

Joined: 06 Mar 2009, 14:19
yeah braindamage and me are trying that as well, but tbh i wasnt able to try much cause i have to play in a concert on christmas, so im kinda busy practicing not to ruin it ;)

grapefruit


Top
 Offline Profile  
 
PostPosted: 15 Mar 2010, 14:33 

Joined: 15 Mar 2010, 14:20
Hi everybody (is there still anybody ;-) ?

I am trying to compile spring on my macbook pro, osx 10.5.8 (THIS IS NOT SNOW!)

I have followed the wiki
http://springrts.com/wiki/Spring_on_MacOSX

until "make" ("cmake ." is ok)

after several try I found that gcc4.0 was the best (and not 4.2) but I have this problem at 16% of compiling : Does anyone has the same problem ? I guess it is problem of compiler version but I cannot find any information on that... thanks !

Code:
[ 16%] Building CXX object rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o
/opt/local/include/boost/functional/hash/detail/float_functions.hpp: In member function ÔÇÿfloat boost::hash_detail::call_cpp_frexpf<true>::operator()(float, T) const [with T = int*]ÔÇÖ:
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:44:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_impl2(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:84:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_impl(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/detail/hash_float.hpp:92:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_value(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/hash.hpp:299:   instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:200: error: call of overloaded ÔÇÿfrexp(float&, int*&)ÔÇÖ is ambiguous
/usr/include/architecture/i386/math.h:331: note: candidates are: double frexp(double, int*)
/usr/include/c++/4.0.0/cmath:269: note:                 long double std::frexp(long double, int*)
/usr/include/c++/4.0.0/cmath:265: note:                 float std::frexp(float, int*)
/Users/guiochet/Desktop/spring_0.81.2/rts/lib/streflop/SMath.h:466: note:                 streflop::Double streflop::frexp(streflop::Double, int*)
/Users/guiochet/Desktop/spring_0.81.2/rts/lib/streflop/SMath.h:258: note:                 streflop::Simple streflop::frexp(streflop::Simple, int*)
/opt/local/include/boost/functional/hash/detail/float_functions.hpp: In member function ÔÇÿfloat boost::hash_detail::call_cpp_ldexpf<true>::operator()(float, T) const [with T = int]ÔÇÖ:
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:57:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_impl2(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:84:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_impl(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/detail/hash_float.hpp:92:   instantiated from ÔÇÿsize_t boost::hash_detail::float_hash_value(T) [with T = float]ÔÇÖ
/opt/local/include/boost/functional/hash/hash.hpp:299:   instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:188: error: call of overloaded ÔÇÿldexp(float&, int&)ÔÇÖ is ambiguous
/usr/include/architecture/i386/math.h:328: note: candidates are: double ldexp(double, int)
/usr/include/c++/4.0.0/cmath:284: note:                 long double std::ldexp(long double, int)
/usr/include/c++/4.0.0/cmath:280: note:                 float std::ldexp(float, int)
/Users/guiochet/Desktop/spring_0.81.2/rts/lib/streflop/SMath.h:467: note:                 streflop::Double streflop::ldexp(streflop::Double, int)
/Users/guiochet/Desktop/spring_0.81.2/rts/lib/streflop/SMath.h:259: note:                 streflop::Simple streflop::ldexp(streflop::Simple, int)
make[2]: *** [rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o] Error 1
make[1]: *** [rts/CMakeFiles/spring.dir/all] Error 2
make: *** [all] Error 2


Top
 Offline Profile  
 
PostPosted: 07 Jul 2010, 22:52 

Joined: 07 Jul 2010, 22:50
iMac 24, can't build, here's stack trace:
Code:
Putting child 0x01a35640 (rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o) PID 15114 on the chain.
Live child 0x01a35640 (rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o) PID 15114
[ 14%] Reaping winning child 0x01a35640 PID 15114
Live child 0x01a35640 (rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o) PID 15115
Building CXX object rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o
Reaping winning child 0x01a35640 PID 15115
Live child 0x01a35640 (rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o) PID 15116
/opt/local/include/boost/functional/hash/detail/float_functions.hpp: In member function 'float boost::hash_detail::call_cpp_frexpf<true>::operator()(float, T) const [with T = int*]':
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:44:   instantiated from 'size_t boost::hash_detail::float_hash_impl2(T) [with T = float]'
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:84:   instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with T = float]'
/opt/local/include/boost/functional/hash/detail/hash_float.hpp:92:   instantiated from 'size_t boost::hash_detail::float_hash_value(T) [with T = float]'
/opt/local/include/boost/functional/hash/hash.hpp:282:   instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:200: error: call of overloaded 'frexp(float&, int*&)' is ambiguous
/usr/include/architecture/i386/math.h:331: note: candidates are: double frexp(double, int*)
/usr/include/c++/4.0.0/cmath:269: note:                 long double std::frexp(long double, int*)
/usr/include/c++/4.0.0/cmath:265: note:                 float std::frexp(float, int*)
/Users/alex/Projects/tmp/spring/src/rts/lib/streflop/SMath.h:466: note:                 streflop::Double streflop::frexp(streflop::Double, int*)
/Users/alex/Projects/tmp/spring/src/rts/lib/streflop/SMath.h:258: note:                 streflop::Simple streflop::frexp(streflop::Simple, int*)
/opt/local/include/boost/functional/hash/detail/float_functions.hpp: In member function 'float boost::hash_detail::call_cpp_ldexpf<true>::operator()(float, T) const [with T = int]':
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:57:   instantiated from 'size_t boost::hash_detail::float_hash_impl2(T) [with T = float]'
/opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:84:   instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with T = float]'
/opt/local/include/boost/functional/hash/detail/hash_float.hpp:92:   instantiated from 'size_t boost::hash_detail::float_hash_value(T) [with T = float]'
/opt/local/include/boost/functional/hash/hash.hpp:282:   instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:188: error: call of overloaded 'ldexp(float&, int&)' is ambiguous
/usr/include/architecture/i386/math.h:328: note: candidates are: double ldexp(double, int)
/usr/include/c++/4.0.0/cmath:284: note:                 long double std::ldexp(long double, int)
/usr/include/c++/4.0.0/cmath:280: note:                 float std::ldexp(float, int)
/Users/alex/Projects/tmp/spring/src/rts/lib/streflop/SMath.h:467: note:                 streflop::Double streflop::ldexp(streflop::Double, int)
/Users/alex/Projects/tmp/spring/src/rts/lib/streflop/SMath.h:259: note:                 streflop::Simple streflop::ldexp(streflop::Simple, int)
Reaping losing child 0x01a35640 PID 15116
make[2]: *** [rts/CMakeFiles/spring.dir/Game/GameServer.cpp.o] Error 1
Removing child 0x01a35640 PID 15116 from chain.
Reaping losing child 0x001118b0 PID 15113
make[1]: *** [rts/CMakeFiles/spring.dir/all] Error 2
Removing child 0x001118b0 PID 15113 from chain.
Reaping losing child 0x00107790 PID 15046
make: *** [all] Error 2
Removing child 0x00107790 PID 15046 from chain.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.