Spring is running in SMP - Page 7

Spring is running in SMP

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Spring is running in SMP

Post by koshi »

doesn't build on gcc version 4.2.1 (Ubuntu 4.2.1-5ubuntu4): http://pastebin.ca/1019840
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Thanks!

Most errors are related to a TLS variable, GCC requires a different syntax.

I will fix that...
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Is it any better now?
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Spring is running in SMP

Post by koshi »

errors are different http://pastebin.ca/1020867
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Strange... is the GCC syntax for "typename" somehow different?

template<class T>
class gmlVectorIter {
public:
T *p;
gmlVectorIter() {}
gmlVectorIter(T *d) {p=d;}
void operator=(const typename gmlVectorIter<T> &i) {p=i.p;} <<< ERROR HERE
...
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Spring is running in SMP

Post by Kloot »

Leave the typename out, gcc (4.1.3 at least) chokes on it.

Code: Select all

void operator = (const gmlVectorIter<T>& i) { p = i.p; }
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Spring is running in SMP

Post by AF »

If you could put logs in your svn commits rather than leaving them blank it would be much appreciated, that way we can see how your working and what your changes do.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

AF wrote:If you could put logs in your svn commits rather than leaving them blank it would be much appreciated, that way we can see how your working and what your changes do.
Yep, I'll try to do that - if this was trunk I would put more effort into it. Right now it's mostly generic bugfixes/tweaks.

I tried compiling with scons/mingw but it spits out this error:
rts/lib/gml/gmlcls.h:61: error: thread-local storage not supported for this target

Does it not support TLS, or can it be enabled via some compiler flag?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring is running in SMP

Post by hoijui »

i found this:
http://sourceforge.net/mailarchive/mess ... a%40anykey

and this:
"For MinGW with gcc < 4, you cannot build a static library because TLS (thread local storage, using __thread) support was not introduced until version 4.
So gcc3 doesn't have the required feature."
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Spring is running in SMP

Post by imbaczek »

use at least gcc 4.2, suggested gcc 4.3 (even though it's alpha.) gcc 4.2 will be a bit easier to set up due to boost.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Spring is running in SMP

Post by Tobi »

GCC < 4 won't sync with official release builds anyway, so it isn't really a problem.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

imbaczek wrote:use at least gcc 4.2, suggested gcc 4.3 (even though it's alpha.) gcc 4.2 will be a bit easier to set up due to boost.
Has anyone been able to compile boost with 4.3? I'm getting this error:

In file included from mingwlibs\include/boost/spirit/attribute/closure.hpp:24,
from mingwlibs\include/boost/spirit/attribute.hpp:36,
from rts\System\/tdf_grammar.hpp:9,
from rts\System\TdfParser.cpp:14:
mingwlibs\include/boost/spirit/phoenix/operators.hpp:355: error: 'INT_MAX' was not declared in this scope
scons: *** [build\rts\System\TdfParser.o] Error 1
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Spring is running in SMP

Post by imbaczek »

I think I had this... Can't remember how I fixed it. Maybe boost 1.35 fixed it. Anyway, try including limits.h before including any boost files in TdfParser.h/cpp.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Spring is running in SMP

Post by lurker »

Tobi wrote:GCC < 4 won't sync with official release builds anyway, so it isn't really a problem.
My gcc claims to be 3.4.5 and has always synced, though it occasionally gets a 1/2 bit error in the checksum while not actually desyncing.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Spring is running in SMP

Post by Tobi »

Hmm weird, I'm sure my 3.4.5 desynced vs 4.X in my original sync test. Of course it might have been some memory corruption or something that only and consistently showed up in 3.4.5, would have to do the test again I guess. (Heck I even remember the desync was in the 7th minute on the Finns Revenge AAI games I did the test with :-))
Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Spring is running in SMP

Post by Manoa »

I was under the impression that you were going to leave the optimization stage for after debugging is finished... but I have to admit that R5915 is very good, it seems that it is also faster for a change (usually a new version of spring is slower than the older)
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

OK, I was finally able to build this with GCC 4.3 and boost 1.35.

However, it refuses to run and says: "Program too big to fit in memory".
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Spring is running in SMP

Post by koshi »

you didn't commit the changes?
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Spring is running in SMP

Post by koshi »

with rev 5921 i'm getting this: http://pastebin.ca/1027790
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Thanks for testing.
What boost version are you using?

It seems the error is caused by

Code: Select all

long var=++obj;
where obj is of type boost::detail::atomic_count

Check how your boost version defines the operator++ in atomic_count.
Post Reply

Return to “Engine”