Page 3 of 6

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

Posted: 06 Jan 2011, 06:50
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

Re: [Tutorial] Spring on Mac OS X

Posted: 17 Jan 2011, 15:50
by cowking
Is somebody working on the newest version?

Re: [Tutorial] Spring on Mac OS X

Posted: 25 Jan 2011, 08:49
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:

Re: [Tutorial] Spring on Mac OS X

Posted: 25 Jan 2011, 12:46
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

Re: [Tutorial] Spring on Mac OS X

Posted: 25 Jan 2011, 14:30
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: )

Re: [Tutorial] Spring on Mac OS X

Posted: 06 Feb 2011, 23:34
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

Re: [Tutorial] Spring on Mac OS X

Posted: 08 Feb 2011, 09:14
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

Re: [Tutorial] Spring on Mac OS X

Posted: 17 Feb 2011, 18:38
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?

Re: [Tutorial] Spring on Mac OS X

Posted: 22 Feb 2011, 20:27
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>

Re: [Tutorial] Spring on Mac OS X

Posted: 22 Mar 2011, 12:38
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!

Re: [Tutorial] Spring on Mac OS X

Posted: 22 Mar 2011, 13:37
by hoijui
rename the file from so to dylib (not a joke).

Re: [Tutorial] Spring on Mac OS X

Posted: 02 Apr 2011, 11:31
by marciolino
Is there a lobby working on mac?

Re: [Tutorial] Spring on Mac OS X

Posted: 05 Apr 2011, 12:59
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.

Re: [Tutorial] Spring on Mac OS X

Posted: 29 May 2011, 13:22
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?

Re: [Tutorial] Spring on Mac OS X

Posted: 30 May 2011, 01:16
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 :-)

Re: [Tutorial] Spring on Mac OS X

Posted: 07 Jun 2011, 11:10
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 !

Re: [Tutorial] Spring on Mac OS X

Posted: 07 Jun 2011, 11:24
by koshi
daftalx wrote:Go large on ideas
run SL with full logging and/or 'ldd' the unitsync lib file

Re: [Tutorial] Spring on Mac OS X

Posted: 08 Jun 2011, 15:48
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.

Re: [Tutorial] Spring on Mac OS X

Posted: 08 Jun 2011, 16:18
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?

Re: [Tutorial] Spring on Mac OS X

Posted: 08 Jun 2011, 16:39
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