Compiling spring 0.82 rc

Compiling spring 0.82 rc

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
wolas
Posts: 112
Joined: 30 Jul 2010, 20:40

Compiling spring 0.82 rc

Post by wolas »

So i m trying to compile it on ubuntu 10.04 32bit

Got a problem :

[ 58%] Building C object rts/lib/headlessStubs/CMakeFiles/headlessStubs.dir/sdlstub.c.o
/home/wolas/Desktop/DEVELOPMENT/spring_0.82.0/rts/lib/headlessStubs/sdlstub.c:8:17: error: SDL.h: No such file or directory
/home/wolas/Desktop/DEVELOPMENT/spring_0.82.0/rts/lib/headlessStubs/sdlstub.c:23: error: expected ÔÇÿ=ÔÇÖ, ÔÇÿ,ÔÇÖ, ÔÇÿ;ÔÇÖ, ÔÇÿasmÔÇÖ or ÔÇÿ__attribute__ÔÇÖ before ÔÇÿstubKeyStateÔÇÖ
/home/wolas/Desktop/DEVELOPMENT/spring_0.82.0/rts/lib/headlessStubs/sdlstub.c:24: error: expected ÔÇÿ=ÔÇÖ, ÔÇÿ,ÔÇÖ, ÔÇÿ;ÔÇÖ, ÔÇÿasmÔÇÖ or ÔÇÿ__attribute__ÔÇÖ before ÔÇÿstubVersionÔÇÖ...
... (many of those lines)

well SDL.h is on my system in /usr/include/SDL/SDL.h
so what can be wrong?
bbe
Posts: 10
Joined: 15 Nov 2008, 17:24

Re: Compiling spring 0.82 rc

Post by bbe »

I have the same problem on my Gentoo install (this is manual compile as there's no ebuild in the overlay yet).


There is also a warning about the 'tools' directory from cmake, but I forget the details and don't have them to hand at the moment.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

the problem is, that the tarbal of the current RC is incompleete.
it has been fixed already. sorry for this.
the compleete source can be downloaded here:
http://github.com/spring/spring/archives/0.82.0
bbe
Posts: 10
Joined: 15 Nov 2008, 17:24

Re: Compiling spring 0.82 rc

Post by bbe »

Thanks Hoijui that works much better. I found 'make spring' and 'make install-spring' to make the build time quicker. I'll have to try out the MT version at some point.

One other point to note for anyone following this thread is that two of the Skirmish AIs (Hugh and E323) are not included in that git generated archive. If you just download their own archive and stick them in the correct directory and reconfigure it worked fine for me.
wolas
Posts: 112
Joined: 30 Jul 2010, 20:40

Re: Compiling spring 0.82 rc

Post by wolas »

compiled sucessfully but how to have two springs? since i playing 0.81 i dont want to "make install" is it possible to make it "portable"?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Compiling spring 0.82 rc

Post by SirMaverick »

cmake -DCMAKE_INSTALL_PREFIX=/where/ever

You might also want to use a different user account, or at least a different .springrc config file that indicates a different SpringData directory. Otherwise everytime you switch between 0.81 and 0.82 spring rescans your maps and mods (because base file changed -> different hash).
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

for the AIs:
i would say, if you want them, it is easier/better to get the sources through git. these AIs are referenced as git submodules, so you do:

Code: Select all

git clone http://github.com/spring/spring.git
git submodule update --init
make spring and make install-spring should be mentioned on the wiki already.

what SirMaverick said, plus -DSPRING_DATADIR=/where/ever.
which is, in my eyes, the best solution to solve the mentioned cache issue.
wolas
Posts: 112
Joined: 30 Jul 2010, 20:40

Re: Compiling spring 0.82 rc

Post by wolas »

thanks for replies :)
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

Some notes about compiling 0.82.3 which may be related to this thread (installation logs attached):

Running ÔÇ£make install-springÔÇØ makes files in rts/lib/headlessStubs/ and tools/unitsync/ to be compiled. This should obviously happens while running ÔÇ£make springÔÇØ, not at installation time.

Sources in the AI directory are not compiled, making ÔÇ£make install-springÔÇØ ends with errors. Running ÔÇ£makeÔÇØ in this directory and then ÔÇ£make install-springÔÇØ in the top-level directory fix the problem.
Attachments
spring_0.82.3-install_logs.txt
(16.61 KiB) Downloaded 18 times
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

this new stuff is not working well, because of cmake not working as it should. for some people it works as expected, for others not, and it seems to not to be pin-pointable to a certain cmake version...
anyway, if you configure multiple times (as in, reconfigure) it might work as expected.
i will try some rearrangement to limit this, but can not promise anything.
basically, we are using a sort of hack, as cmake does not allow natively to install only a subset of an application. the build part is less hacky, but still plagued by the order in which the individual targets are defined/in what subdirs they are.
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

OK, I see. I tried ÔÇ£cmake CMAKE_BACKWARDS_COMPATIBILITY="2.8" .ÔÇØ (default is 2.4) since I use cmake 2.8.1. Now the AI directory is compiled at install time, but at least the installation is completed without errors.
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

or not. CMAKE_BACKWARDS_COMPATIBILITY actually doesnt change anything, my bad, I guess I used make instead of make spring.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

i did the rearrangement in spring master. it works for me.
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

Now is the right time to write it:
weepee wrote:Now the AI directory is compiled at install time, but at least the installation is completed without errors.
Thanks for this. However I urge you to consider that compiling code at install time means doing it as root, which may lead to serious troubles for the user in case of nasty bugs.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

is that with spring master or 0.82.3?
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

With the current version in the git repository (I supposed this is the Spring master).
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

the thing is, that we need to do cmake hackery to be bale to combine a subset of targets in a single target name. this hackery seemingly randomly works or not. one thing that should always work, is using bare make and make install, instead of make spring and make install-spring. this means you have to compile everything though. you can also do make and make install-spring, to build everything and install only spring(default stuff).
then again, the best solution for you is probably to not install under /usr, but under ~/ somewhere (thats what i do when compiling spring myself, while only having packages under /usr. then you do not need root access for install.
weepee
Posts: 13
Joined: 15 Aug 2010, 13:50

Re: Compiling spring 0.82 rc

Post by weepee »

Actually I fully agree with what you wrote. My point was not to solve a problem of mine but rather to point out potential problems. So, if the cmake issue canÔÇÖt be solve for all configurations, I think it is very important to clearly document it in the installation instructions. Anyway, thank for your help.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Compiling spring 0.82 rc

Post by hoijui »

thanks :-)
sadly, there is no way to get people to read a document that contains such hints. ;-)
"install.. where.. where is the commands i have to c&p? ... there!! c&p, c&P!!! ... why no work?!? i post forum!"
not that this is bad, i guess i am not different. it is human.
Post Reply

Return to “Linux”