[Tutorial] Building Spring on Mac OS X - Page 3

[Tutorial] Building Spring on Mac OS X

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

Moderator: Moderators

priq000
Posts: 1
Joined: 06 Jan 2011, 06:06

Compile error: Spring's LuaParser.cpp on Mac OS X 10.5.8

Post by priq000 »

OS:
10.5.8 (fully updated)

uname -a output:
Darwin box.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

Hardware:
MacBookAir2,1 Core 2 Duo 1.86Ghz

MacPorts version:
1.9.2 (most recent, sync'd, works fine for other projects)


Symptoms: Build error. seems to be on LuaParser.cpp


Here the end of the log file:

<snip>

:info:build [ 20%] Building CXX object rts/CMakeFiles/spring.dir/Lua/LuaSyncedCtrl.cpp.o
:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts && /usr/bin/g++-4.0 -DSYNCCHECK -DNO_AVI -DSPRING_DATADIR=\"/opt/local/share/games/spring\" -DSTREFLOP_SSE -pipe -O2 -arch i386 -march=i686 -msse -mfpmath=sse -fsingle-precision-constant -frounding-math -mieee-fp -pipe -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pthread -O2 -DNDEBUG -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/lua/include -I/opt/local/include/SDL -I/opt/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts -I/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/System -I/System/Library/Frameworks/OpenAL.framework/Headers -I/opt/local/include/freetype2 -o CMakeFiles/spring.dir/Lua/LuaSyncedCtrl.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/Lua/LuaSyncedCtrl.cpp
:info:build /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*]':
:info:build /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]'
:info:build /opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:82: instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with T = float]'
:info:build /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]'
:info:build /opt/local/include/boost/functional/hash/hash.hpp:321: instantiated from here
:info:build /opt/local/include/boost/functional/hash/detail/float_functions.hpp:200: error: call of overloaded 'frexp(float&, int*&)' is ambiguous
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/architecture/i386/math.h:331: note: candidates are: double frexp(double, int*)
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:269: note: long double std::frexp(long double, int*)
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:265: note: float std::frexp(float, int*)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:466: note: streflop::Double streflop::frexp(streflop::Double, int*)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:258: note: streflop::Simple streflop::frexp(streflop::Simple, int*)
:info:build /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]':
:info:build /opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:54: instantiated from 'size_t boost::hash_detail::float_hash_impl2(T) [with T = float]'
:info:build /opt/local/include/boost/functional/hash/detail/hash_float_generic.hpp:82: instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with T = float]'
:info:build /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]'
:info:build /opt/local/include/boost/functional/hash/hash.hpp:321: instantiated from here
:info:build /opt/local/include/boost/functional/hash/detail/float_functions.hpp:188: error: call of overloaded 'ldexp(float&, int&)' is ambiguous
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/architecture/i386/math.h:328: note: candidates are: double ldexp(double, int)
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:284: note: long double std::ldexp(long double, int)
:info:build /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:280: note: float std::ldexp(float, int)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:467: note: streflop::Double streflop::ldexp(streflop::Double, int)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:259: note: streflop::Simple streflop::ldexp(streflop::Simple, int)
:info:build make[3]: *** [rts/CMakeFiles/spring.dir/Lua/LuaParser.cpp.o] Error 1
:info:build make[3]: *** Waiting for unfinished jobs....
:info:build make[2]: *** [rts/CMakeFiles/spring.dir/all] Error 2
:info:build make[1]: *** [rts/CMakeFiles/spring.dir/rule] Error 2
:info:build make: *** [spring] Error 2
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1" && /usr/bin/make -j2 spring " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
while executing
"command_exec build"
(procedure "portbuild::build_main" line 8)
invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for springrts): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Log for springrts is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/main.log
bash-3.2#


#######
### Manually building this dir with "make -d" (output too large to attach)
#######


bash-3.2# make -d -j2 spring > ~/springrts_manualmake.log
/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:82: 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:321: instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:200: error: call of overloaded ÔÇÿfrexp(float&, int*&)ÔÇÖ is ambiguous
/Developer/SDKs/MacOSX10.5.sdk/usr/include/architecture/i386/math.h:331: note: candidates are: double frexp(double, int*)
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:269: note: long double std::frexp(long double, int*)
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:265: note: float std::frexp(float, int*)
/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:466: note: streflop::Double streflop::frexp(streflop::Double, int*)
/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/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:54: 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:82: 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:321: instantiated from here
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:188: error: call of overloaded ÔÇÿldexp(float&, int&)ÔÇÖ is ambiguous
/Developer/SDKs/MacOSX10.5.sdk/usr/include/architecture/i386/math.h:328: note: candidates are: double ldexp(double, int)
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:284: note: long double std::ldexp(long double, int)
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/cmath:280: note: float std::ldexp(float, int)
/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:467: note: streflop::Double streflop::ldexp(streflop::Double, int)
/opt/local/var/macports/build/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/work/spring_0.81.2.1/rts/lib/streflop/SMath.h:259: note: streflop::Simple streflop::ldexp(streflop::Simple, int)
make[3]: *** [rts/CMakeFiles/spring.dir/Lua/LuaParser.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [rts/CMakeFiles/spring.dir/all] Error 2
make[1]: *** [rts/CMakeFiles/spring.dir/rule] Error 2
make: *** [spring] Error 2
Attachments
springrts_main.log
The full build log
(82.84 KiB) Downloaded 134 times
cowking
Posts: 16
Joined: 07 Mar 2007, 16:33

Re: [Tutorial] Spring on Mac OS X

Post by cowking »

Is somebody working on the newest version?
User avatar
marciolino
Posts: 268
Joined: 06 Sep 2010, 22:59

Re: [Tutorial] Spring on Mac OS X

Post by marciolino »

I'm not sure but you should contact daftalx.
The last news I heard was that last update is not compiling on OSX. :cry:
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: [Tutorial] Spring on Mac OS X

Post by jK »

@priq000
Your error is not in LuaParser.cpp
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:200: error: call of overloaded 'frexp(float&, int*&)' is ambiguous
note: candidates are: double frexp(double, int*)
note: long double std::frexp(long double, int*)
note: float std::frexp(float, int*)
note: streflop::Double streflop::frexp(streflop::Double, int*)
note: streflop::Simple streflop::frexp(streflop::Simple, int*)
...
/opt/local/include/boost/functional/hash/detail/float_functions.hpp:188: error: call of overloaded 'ldexp(float&, int&)' is ambiguous
note: candidates are: double ldexp(double, int)
note: long double std::ldexp(long double, int)
note: float std::ldexp(float, int)
note: streflop::Double streflop::ldexp(streflop::Double, int)
note: streflop::Simple streflop::ldexp(streflop::Simple, int)
-> fix your boost package
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

Hi guys,

Sorry for being off, I'm still a lot busy these days, and also I'm not receiving post notifications anymore for some reason ( good thing I have a clan-mate in the office next door :lol: )

To answer priq000, you're running Leopard, which I'm afraid is not "officially" supported (if I may say so), since 1) I don't have a 10.5.x box to test anymore and 2) I'm trying to run everything 64bit (via cocoa). You should consider upgrading to Snow Leopard, which in the end does a pretty good job at almost everything.

More generally, what I've noticed is that the Mac compiler is very non-tolerant when it comes to calling functions with similar name but declared in different places. As soon as it finds homonyms declared in different types, the compiler bangs and forces you to explicitly specify which exact method you are invoking ( in the form myDisambiguingType::myMethodThatLooksTheSameElseWhere() ).

I'm writing this here to keep a record, but I'd like to have more time mention that to engine/lobby devs to code that way (which after second thoughts is not a bad idea when it comes to debugging...). I just hope for now they'll stumble across this post until I chat with them in the lobby. Until then, readers are welcome to spread the info :wink:

(btw, SL should be soon updated to 0.120, finalizing/checking the port right now)

daft (not dead, just a bit sleepy :roll: )
phas
Posts: 28
Joined: 06 Feb 2011, 01:26

Re: [Tutorial] Spring on Mac OS X

Post by phas »

Hello, first of all thanks for finally getting close to a working solution for springrts on osx. Even if i still didn't manage to run a game i was able to get a "Test game" on a slightly outdated release and what i saw was promising. :)

Then, apparently rsync://daftserver.dyndns.org/macports/ is down. I read around that it can happen because there are automatic compilers on it and the machine is not-so-powerful, but it seems to be not working for at least some hours.

edit: still down after 10 hours
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

Good news everyone !

The latest version of spring (0.82.7.1 as of posting) builds and runs on Mac OS X (MacPorts-powered) !

Remaining caveats:
  • Some small bits are still missing (KAIK not building, cf. this post), therefore spring comes only with Java-based AIs
  • The build only gives you the "spring" executable (which is enough for playing online anyway)
  • Description panels when you hover the mouse on a unit/building doesn't display (as in the previous version).
Nothing special to do else than follow the wiki page on how to install this new version.

Thx to all who helped me track down the remaining bits of bugs !
Testers and D-Gunners welcome :wink:

daft
0.82.7.1.jpg
they've been waiting to spit metal for a while...
(314.12 KiB) Downloaded 2 times
frequencyandsulphur
Posts: 10
Joined: 10 Oct 2010, 14:33

Re: [Tutorial] Spring on Mac OS X

Post by frequencyandsulphur »

Daft, tried the build last night but the build failed from macports. Here's the log showing the failure:

http://pastebin.com/uBcKzt91

Any advice?
bhstone1
Posts: 33
Joined: 22 Feb 2011, 20:26

Re: [Tutorial] Spring on Mac OS X

Post by bhstone1 »

I got the following error. Don't understand it. I am running 10.6.6 with the latest XCode, mac ports, etc.
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Log for springrts is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_daftserver.dyndns.org_macports_games_springrts/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
cowking
Posts: 16
Joined: 07 Mar 2007, 16:33

Re: [Tutorial] Spring on Mac OS X

Post by cowking »

Hi,

I had everything installed smoothly like the wiki says (except I also had to 'sudo port install freetype' or something).

But now that I have springlobby installed, I cannot get springlobby function because, well.. there is no such thing as libunitsync.dylib like wiki tells. only .so file exists and springlobby does not accept that.. Any ideas?

Thanks!
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [Tutorial] Spring on Mac OS X

Post by hoijui »

rename the file from so to dylib (not a joke).
User avatar
marciolino
Posts: 268
Joined: 06 Sep 2010, 22:59

Re: [Tutorial] Spring on Mac OS X

Post by marciolino »

Is there a lobby working on mac?
TangentDelta
Posts: 22
Joined: 05 Apr 2011, 12:47

Re: [Tutorial] Spring on Mac OS X

Post by TangentDelta »

Hello community of spring! I joined recently because I am trying to put this wonderful game onto my mac. It downloaded successfully, but how do I launch it? Typing in "spring" gives an unknown command error. I found the decompiled files and when I attempted to use cmake to compile them, it wouldn't compile because of some GUI not being a gui (it was complaining about the capitalization). I have a mac mini with a intel core duo 2, 4 GB ram, and whatever the graphics card is that comes with mac minis. All the required programs are installed. I can try re-installing spring and see if that fixes my compiling problem.
axyd
Posts: 4
Joined: 07 Jul 2010, 23:50

Re: [Tutorial] Spring on Mac OS X

Post by axyd »

> sudo port install springrts

Hmm, maybe I'm wrong but I have a feeling that there's something wrong with this Mac installation:

1. It uses sudo - it can break already existing setting and libraries.
2. It's unclear how to uninstall it later, uninstalling ports - not so easy and safe.

Is it possible to pack all dependencies in one app?
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

axyd wrote:> sudo port install springrts
Hmm, maybe I'm wrong but I have a feeling that there's something wrong with this Mac installation:
1. It uses sudo - it can break already existing setting and libraries.
1) It uses sudo because that is how MacPorts is to be used via command line
2) Everything is installed (by default) into /opt/local, i.e. MacPorts is made to run independently of the rest of the OS (including libs etc). If you are referring to existing "MacPorts" libraries which are built with specific variants that may conflicts with what spring needs, then yeah, it's a known issue, and in general occurs very rarely.
axyd wrote:2. It's unclear how to uninstall it later, uninstalling ports - not so easy and safe.
Uninstalling is pretty straightforward and IS safe. It evens provides some flexibility. For instance, you can "port deactivate {xxx}" a port, which removes all files from their "final" location (like a reverse make install), or really remove the compiled files with "port uninstall {xxx}". It also forbids you to uninstall a port which has active dependencies. Does this answer your question ? I could add this to the tutorial I guess.
axyd wrote:Is it possible to pack all dependencies in one app?
yes/no. MacPorts lets you pack a compiled port into a .dmg or .pkg installer (which btw still deploys into /opt/local and still asks for your password, faking a sudo), however they don't bundle the dependencies altogether. I'd have to write a script to generate the full bundle. But that will wait until the port is more stable (spring is more or less ok, the lobby is another story...).

And as a general remark, I have to emphasize that MacPorts is the fastest way to get spring up and running, due to the huge amount of libraries available there and not on Mac OS. I believe most linux users are quite familiar with the command-line install process, but yeah, I do agree a simple nicely-packed .dmg or .app would appeal more to the default Mac user :-)
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

hoijui wrote:
cowking wrote:Hi,

I had everything installed smoothly like the wiki says (except I also had to 'sudo port install freetype' or something).

But now that I have springlobby installed, I cannot get springlobby function because, well.. there is no such thing as libunitsync.dylib like wiki tells. only .so file exists and springlobby does not accept that.. Any ideas?

Thanks!
rename the file from so to dylib (not a joke).
I'm actually reviving the issue. It's been a few versions now that SL wouldn't recognize my libunitsync (.so or .dylib regardless), SL complains it's unable to load it.

Go large on ideas if you have any, I can test a few !
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: [Tutorial] Spring on Mac OS X

Post by koshi »

daftalx wrote:Go large on ideas
run SL with full logging and/or 'ldd' the unitsync lib file
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

koshi wrote:run SL with full logging and/or 'ldd' the unitsync lib file
found it:

Code: Select all

(...)
15:39:49: Error: dlopen(/opt/local/lib/libunitsync.so, 2): Symbol not found: _png_set_gray_1_2_4_to_8
  Referenced from: /opt/local/lib/libIL.1.dylib
  Expected in: flat namespace
 in /opt/local/lib/libIL.1.dylib
After further searching, found out that "png_set_gray_1_2_4_to_8" was deprecated and REMOVED in libpng 1.4 and replaced with "png_set_expand_gray_1_2_4_to_8". MacPorts has libpng 1.4.7.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [Tutorial] Spring on Mac OS X

Post by hoijui »

so the unitsync was compiled against headers of an older version of the library then what is installed on your system?
or maybe one of the dependencies of unitsync (most likely DevIL)?
would be strange that you have old headers and new library...
any idea?
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: [Tutorial] Spring on Mac OS X

Post by daftalx »

hoijui wrote:so the unitsync was compiled against headers of an older version of the library then what is installed on your system?
or maybe one of the dependencies of unitsync (most likely DevIL)?
would be strange that you have old headers and new library...
any idea?
That's the weird thing. I checked the DevIL source code, and the il_png.c indeed points to a "png_set_gray_1_2_4_to_8" function, which I couldn't find anywhere in my libpng but the new one ("png_set_expand_gray_1_2_4_to_8").
In any case, it's not a spring/SL issue anymore. I'll check sources and headers more in-deep to figure this out.

UPDATE: working on a fix with the MacPorts guys, will let you know when it's done
Post Reply

Return to “Mac OS X”