Logo
Spacer News Wiki Features F.A.Q. Team members Screenshots Download Messageboard Bug tracker Submit files
Top divider

Build from source

Contents

[edit] Build From Source

You might encounter sync errors in online play if you are not using the exact same version of the compiler and same compiler settings as used for prebuilt packages!

For 0.76b1 these are: TODO add them here.

If there is no package tailored for your distribution, you have to install from sources manually. Doing this for distributions where packages are available is not recommended.

[edit] Get Source

You can either download the source as a 3.9MB tarball (recommended; v. 0.76b1) or get it from the subversion repository. Either way, the result is the same.

[edit] Tarball

cd /usr/local/src # or /var/tmp, or whatever
wget http://spring.clan-sy.com/dl/spring_0.76b1_src.tar.bz2
tar xjf spring_0.76b1_src.tar.bz2
cd spring_0.76b1

NOTE: The .zip release is for windows only. Linux users have to get .bz2 like shown above.

[edit] Subversion

aptitude install subversion # if you are not on debian, figure it out
svn co https://spring.clan-sy.com/svn/spring/tags/spring_0.76b1 \
	/usr/local/src/spring_0.76b1
cd /usr/local/src/spring_0.76b1

If the above subversion host happens to be down (which is unlikely since you're reading this wiki page now), you can try the following hourly updated mirror (replace the svn co line above with the following line):

svn co svn://caspring.org:3691/tags/spring_0.76b1 \
	/usr/local/src/spring_0.76b1

[edit] Dependencies

You will need to install some development packages Spring depends on. These vary from distro to distro and may also depend on your specific configuration.

If your distributions is not listed below, you should be able to figure out the correct package names from this. The scons configure will whine if you forget something, but it does not check if you remembered to install zip, even though you still need it.

[edit] Debian

For Etch (debian 4.0 stable) and Sid (debian unstable), I've confirmed the following to be the minimal set that is necessary to get. I have not tested with any version of Ubuntu, but the line is probably almost identical if not the same. Quilted tested with ubuntu fiesty fawn on july 28 2007 WORKS. Note that Spring 0.75b2 depends on the boost libraries version 1.34.* and won't work on lower versions. (updated libboost-serialization-dev, and libvorbis-dev dependencies for 0.76b1)

Also, on 64-bit be sure to build against devIl 1.6.8-rc2 or higher, 1.6.7 has a bug in the PNG loading code that causes issues.

sudo aptitude install scons build-essential zlib1g-dev libfreetype6-dev
sudo aptitude install libsdl1.2-dev libopenal-dev libglew-dev libboost-dev
sudo aptitude install libboost-thread-dev libboost-regex-dev libdevil-dev
sudo aptitude install libboost-serialization-dev python2.5-dev zip
sudo aptitude install sun-java6-jdk libvorbis-dev libxcursor-dev

[edit] Gentoo

This has been tested to work with a clean install of gentoo 2007.0:

emerge dev-util/scons \>=media-libs/freetype-2.0.0 \>=media-libs/libsdl-1.2.0
emerge media-libs/openal =dev-lang/python-2.4\* media-libs/glew dev-libs/boost
emerge media-libs/devil app-arch/zip media-libs/libogg

[edit] Fedora

On Fedora 8, these dependencies should be sufficient:

yum install scons boost-devel openal-devel SDL-devel \
DevIL-devel glew-devel java-1.7.0-icedtea-devel libvorbis-devel 

Fedora 9 has issues with 0.76b1, because it uses GCC 4.3 which changed a few compilation warnings into errors. However, the inofficial Linux installer may work for you (it installs a precompiled binary).

[edit] Build And Install

The build will spew out warnings like the following, which you can safely ignore:

warning: division by zero
warning: 'q' may be used uninitialized in this function

[edit] Using Scons

Configure and build:

scons configure
scons

Install:

scons install
mkdir -p /etc/spring
echo '$HOME/.spring' > /etc/spring/datadir

[edit] Using CMake (2.6 or newer)

Configure and build:

cmake .
make

Install:

make install
mkdir -p /etc/spring
echo '$HOME/.spring' > /etc/spring/datadir


Your paths are: Spring executable in /usr/local/games/spring and read-only data in /usr/local/share/games/spring.

[edit] Finalizing installation

Now you have Spring installed along with SpringLobby. You are now ready to start springlobby for the first time.

[edit] Mods

Since Spring itself is only an engine, you need to download mods for it. Springlobby will do this for you using bittorrent once you joined a game with a mod you don't have. If you want to download it manually, [1] has almost all mods ever created for spring. Once you downloaded them to ~/spring/mods, they are ready to use.

[edit] BA (Balanced Annihilation)

A popular mod to get started with is Balanced Annihilation (BA) 6.21. Please note that before you can run it though, you'll need to download the OTA content - read the section below on how to get that.

[edit] CA (Complete Annihilation)

A new mod with better models, graphical effects, and a different take on gameplay is the CA mod - get it here.


[edit] OTA Content

If you want to play mods based on Total Annihilation, for example XTA, AA, BA, or CA then you have to do the following:

If you are on Gentoo:

emerge spring-ota-content

Other distributions:

wget http://ipxserver.dyndns.org/games/spring/mods/xta/base-ota-content.zip -P ~/spring/base
unzip ~/spring/base/base-ota-content.zip -d ~/spring/base/

Note that you need to own a copy of Total Annihilation, to download this file legally. Mods that do not require this file are at least NanoBlobs, Kernel Panic and Expand & Exterminate

[edit] Maps

When joining a game with a map you don't have, springlobby will start downloading it using bittorrent.

If you want to browse existing maps, there are several easy to use websites - here are some:

Pick any of those sites, download a map, and save it under ~/spring/maps/ (if the folder doesn't exist - create it). Don't unpack the file in any way though, just download and save it.

Hint: If you know the map name you want, there is a Search function provided in those websites. Just write a part of the name, like one word, and you'll easily find the map you were looking for - this is helpful later on.

[edit] Tips

  • If spring hangs/crashes while in full screen mode, you can press ctrl+alt+backspace to restart X, so no need for a reboot.
  • Spring uses OpenAL for sound, Config your sound output i.e esd / arts / oss / alsa by editing /etc/openalrc or ~/.openalrc, example: ("'(" is not a typo)

    (define devices '(alsa))
    (define speaker-num 2)

    (define alsa-out-device "hw:0,0")
    (define alsa-in-device "hw:0,0")


    Adventurous people with an emu10k1 based card (sblive) can try the accelerated openal version. http://www.lost.org.uk/openal.html , don't submit audiobugs if you do.
  • If you really can't figure out how to get spring compiled, or you think there's a bug in the code or the buildsystem...
  • Just poke any developer on IRC:

[edit] Troubleshooting

[edit] Ingame

[edit] LuaUI Crash Ingame

This issue is caused by a memory corruption bug in spring. It will be fixed in version after 0.76b1. Ubuntu packages include the fix. Workaround: disable ground decals.

LuaUI can crash during game, because some lua script you use has a bug. 0.75 should be resistant to this problem, but 0.74b3 is not. After crash, you won't see the bottom left tooltip box and top right resource bar anymore. Fear not, help is near:

/resbar 1
/tooltip 1

These might not be necessary in 0.75 anymore at all.

Also, you won't be able to change the build menu page with mouse anymore, but keys , and . do the trick.

LuaUI can also be restarted after it crashed. Often this does the trick and it works fine the rest of the game:

/luaui reload

[edit] Mouse is slow in fullscreen mode

Run:

echo 'export SDL_MOUSE_RELATIVE=0' >> ~/.bash_profile

And log out and log in again.

The mouse should now be as fast as in windowed mode.

[edit] Rotating Buildings Ingame

You can rotate a building before you give the build order, but the keys that do this don't work in linux by default for some users. Issue the following commands in the beginning of the game:

/bind keycodex buildfacing inc
/bind keycodey buildfacing dec

Keycodex and keycodey above are just placeholders. What you want to write depends on which key you want to use. To see what keycodes any keys have, do:

/keydebug yes

And then hit the keys you want to use, and spring prints the keycodes in the message buffer.

TODO: add information on how to save the settings so that they work the next time you start spring.

[edit] Map is White

If the whole map is only shades of white and grey, there is a problem with your display driver. Maybe your gpu is very old and does not support some needed opengl feature. For example I had this problem with matrox g550 but not with some very old geforce.

[edit] Sound is Choppy

If the engine sound is very broken or choppy sounding, and you hear some noise or crackling, you need to tell OpenAL to try to use a different sound backend. If you don't have an ~/.openalrc file, create it with these contents, or modify your current one to look like this:

(define devices '(native alsa sdl arts esd null)) (define alsa-device "dsp0") (define speaker-num 2)

(define sampling-rate 22050)

The important line here is the "define devices" line, OpenAL attempts to use each of those sound output methods in order. It uses the first one that works; in some cases native will work best, in other cases perhaps alsa. If Gnome is running its sound daemon, esd would be the best choice, while KDE usually uses artsd.

[edit] Startup

[edit] Missing Default Cursor

This or any similar error of not being able to find a specific file are usually because the mod you are using needs ota content, download & install as explained earlier in this document.

[edit] could not open file: gamedata/defs.lua

Make sure your ~/spring does not contain an outdated version of base/springcontent.sdz because a new version of this file is distributed with spring. If you do, just remove it.

[edit] sounds/button9.wav "cant find wav file"

Same problem as above.

[edit] Couldnt find matching GLX visual

Reduce anti aliasing.

[edit] GL_ARB_texture_compression not found

This can be an issue with your gpu drivers. The drivers you are using do not support a feature that is required to run spring. You might have better luck with the closed source official drivers of nvidia or amd cards. If your gpu itself is really old, this might not help.

If you use the fglrx ati-graphics driver and you are getting this error there might be a chance that still spring work (I use this with ubuntu gusty). At first we must check that fglrx is installed correctly:

~$ fglrxinfo
display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon X1400
OpenGL version string: 2.0.6747 (8.40.4)

Then lets check the glx-extention.

~$ glxinfo | grep direct
Xlib:  extension "XFree86-DRI" missing on display ":1.0".
direct rendering: No

If you get this message, notice that glxinfo releates to display ':1' and fglrxinfo to display ':0'!! Lets check the glx-extention on display :0 now.

~$ DISPLAY=:0 glxinfo | grep direct
direct rendering: Yes

This message mean that you can start spring by typing (in a terminal)

~$ DISPLAY=:0 spring

If you use the TASclient with wine and the native linux spring. Start the whole TASclient-start-script by typing.

DISPLAY=:0 TASCLIENT-start-script

But Notice under circumstances is no windowmanager running on screen :0! This means there are NO windowframes at the TASClient window! You can't move it or close it by clicking the closebutton (unless you click at the close button on the terminal-window in witch you startet TAS). You can although close TAS with the keys ALT-F4

[edit] OpenAL Segfault

If spring crashes with this output:

OpenAL: ALC_EXT_capture AL_EXT_capture AL_EXT_vorbis AL_EXT_MP3
AL_LOKI_quadriphonic AL_LOKI_play_position AL_LOKI_WAVE_format
AL_LOKI_IMA_ADPCM_format AL_LOKI_buffer_data_callback ALC_LOKI_audio_channel
Segmentation fault (core dumped)

Look into this thread on the forums for a fix: http://spring.clan-sy.com/phpbb/viewtopic.php?f=20&t=12568

Then bug nemo in #taspring to finish this troubleshooting entry. He knows how to fix it.

This is mod-related, ie. it only happens on some mods. Please list here the mod versions that give this error for you.

- Star Wars mod, unknown version, by user report

The problematic mod contains a sound file that crashes openal. You can try to unzip the mod file that crashed for you, and play each sound file. Please report any sound files that fail to play right, just list them here.

- unknown file

[edit] Desync in game

If you start a network game with other players, and you get sync error messages in game, your lobby version may be too old. It does not support the new protocol so it does not set the options on spring correctly, and desyncs at game start.

[edit] Compiletime

[edit] invalid use of ILvoid / ALCvoid

During compiling, if you get a lot of the following errors:

/usr/include/IL/il.h:497: error: '<anonymous>' has incomplete type 
/usr/include/IL/il.h:497: error: invalid use of 'ILvoid'

This happens because the version of libdevil-dev you have installed is not compatible with gcc version 4.2 and newer.

You should upgrade your libdevil-dev to fix this issue. However, in some distributions (at least gentoo), the fixed package has the SAME version number as the older unfixed package, so you might actually need to remove your current libdevil-dev package completely and reinstall it.

this is an issue that can be better hacked there. while the packages aren't fixed for their maintainers, you will need to do nasty things, like that:

//typedef void ALCvoid;
#define ALCvoid void

[edit] Network Setup

Usually you don't need to do any network setup whatsoever, because the lobbies take care of nat traversal with firewall hole punching, but if you need to know the topology, it goes like this:

Host needs to enable incoming udp to port 8452, and outgoing replies to those. Non-host players need to enable outgoing udp, and incoming replies to those. So basically only non-host players initiate "connections", and only the server listens on a well-known port.

[edit] If You Still Have Problems

Join to #taspring on Freenode or #sy on QuakeNet and try your luck.

However, generic linux problems not really related to installing this should be asked elsewhere.

Prepare to list your distribution, which installation method you used, and what exactly is the error. Don't ask if people are around or not, just go straight to business and tell all details, for maximizing your chances of getting help.

[edit] IRC

  1. #taspring @ FreeNode
  2. #sy @ QuakeNet

[edit] Asking For Help

Ok so you need human help. This is how NOT to do it:

15:54 -!- **** [n=****@*] has joined #taspring
15:54 < ****> Hi, i have a problem with compiling spring on debian
15:54 < ****> can anyone help me?
15:57 -!- **** [n=****@*] has quit [Client Quit]

Don't ask to ask, instead go straight to business by stating the exact problem you have, and giving all necessary information. What you were trying to achieve, how did you try to do it, what happened and what did you expect to happen.

Then WAIT for someone to notice you.

Retrieved from "http://spring.clan-sy.com/wiki/Build_from_source"

This page has been accessed 1,942 times. This page was last modified 18:56, 4 August 2008.