Building Spring on Linux

Development < Building Spring < Building Spring on Linux

Contents

Build From Source on Linux

If prefer to use your distributions package system, refer to the Linux SetupGuide.

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.

Warning: Be carefull when building from source. You might encounter sync errors in online play if you are using special compilers (all GCC from the 4.x series should be safe) or unstandard compiler settings (be carefull about -march)!

Obtaining the Source

Current (0.81.1.3)

(For playing Spring online) Source .tar.lzma (aka 7z)

Source .tar.gz

Backups in case the above doesn't work:

Source .tar.lzma (aka 7z)

Source .tar.gz

This code is the same as that used to build the last public release. See Building spring for build instructions.

Development Sources from Git

(Bleeding-edge, unstable code for Development and Testing)

Spring project page at github (status page)

Git clone URL for the master repo: git://github.com/spring/spring.git

For serious developers. This will also allow you to make a patch out of the changes you make to the code, and send it to one of the developers with repository access.

Assuming the GIT-commandline client is installed, you can clone the repository with

git clone git://github.com/spring/spring.git

and update it with

git pull

If github is unavailable or slow, there is a mirror: git://springrts.git.sourceforge.net/gitroot/springrts/springrts

There's a branch that's for MacOS development. You can find it at git://github.com/yokosou/spring/spring.git.

Get 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.

Full list

  • Programs necessary to build
    • cmake
    • 7zip (aka p7zip)
    • The usual build toolchain
      • gcc
      • make
  • Libraries
    • SDL
    • boost (version 1.35 or later)
      • threads
      • regex
      • signals
      • system
    • DeviL (IL, ILU)
    • OpenAL (openal-soft, older openal-0.0.8 does not work)
    • OpenGL headers (mesa, glew, etc.)
    • zlib
    • freetype
    • ogg,vorbis and vorbisfile
  • Optional, for bindings and Ais
    • Python (2.5)
    • Java-SDK

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. This works with Ubuntu 8.10, too. The version of spring from git repository depends on boost at least version 1.35.* (if your distro is behind you can try some unofficial backports) and won't work on lower versions.

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 build-essential zlib1g-dev libfreetype6-dev
sudo aptitude install libsdl1.2-dev libopenal-dev libglew-dev zip
sudo aptitude install libvorbis-dev libxcursor-dev libdevil-dev
sudo aptitude install libboost-system1.37-dev libboost-system1.37-thread-dev
sudo aptitude install libboost-system1.37-regex-dev 
sudo aptitude install libboost-system1.37-serialization-dev
sudo aptitude install libboost-system1.37-program-options-dev

and either scons and python2.5-dev or cmake, depending on what you use for building (I advise to use cmake). On debian 5.0 (lenny), libglew1.5-dev is required as well.

Ubuntu 8.04

Additionally you will need to install these packages:

apt-get install p7zip-full libboost-thread1.40-dev libboost-regex1.40-dev
apt-get install libboost-program-options1.40-dev libboost-signals1.40-dev 

(or exchange the libboost 1.40 for 1.37 if you're using that version)

Gentoo

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

emerge cmake \>=media-libs/freetype-2.0.0 \>=media-libs/libsdl-1.2.0
emerge media-libs/openal media-libs/glew dev-libs/boost
emerge app-arch/zip media-libs/libogg
USE="png jpg tiff opengl" emerge media-libs/devil 

Fedora

On Fedora 8, these dependencies should be sufficient:

yum install cmake boost-devel openal-devel SDL-devel \
DevIL-devel glew-devel libvorbis-devel 

On Fedora 12, these dependencies should be sufficient:

yum install gcc-c++ cmake boost-devel DevIL-devel freetype-devel \
glew-devel libvorbis-devel libXcursor-devel openal-devel SDL-devel p7zip

Slackware

On Slackware 13, cmake, ogg vorbis, boost, glew and SDL already come with the full regular install, both libs and headers. Also here you will find helper scripts to easily compile and package DEvIL, openAL and spring itself.

Build And Install

Using CMake (2.6 or newer)

Configure and build:

cmake .
make

Install:

make install


Your paths are: Spring executable in /usr/local/bin/spring and read-only data in /usr/local/share/games/spring. If you want /usr prefix instead /usr/local do the compilation in this way:

cmake -DCMAKE_INSTALL_PREFIX=/usr .
make

Additionally, If you experience performance problems on multi core 64 bit systems, try these additional commands:


cmake -DUSE_GML=1 -DUSE_GML_SIM=1 .
make

And install as shown previously

Using Scons

Configure and build:

scons configure
scons

Install:

scons install


Finalizing installation

Now you have Spring installed.
Depending on your distribution/package you still need a Multiplayer Lobby, for Linux the most common one is SpringLobby, you can get it here.

Maps & Mods

Since Spring is only an engine, you need to download games/mods for it, and the maps that go with those games.

Springlobby will automatically do this for you using bittorrent when you attempt to join a game with a map or mod that you don't currently have.

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

Pick any of those sites, download a map or mod, and then double click it. This will move it to your Spring folder using the spring map/mod installer program. If you wish to move maps/mods by hand, they are located under ~/.spring/maps/ or ~/.spring/mods/ (if the folder doesn't exist - create it). Don't unpack the file in any way though, just download and save it. Reload your maps/mods in Springlobby, (Tools -> Reload maps/mods) and they will be ready to use.

These sites also may provide other neat things like lua widgets, epic replays, AI bots (for playing offline or to team up on with a freind). Generally the installation requires you to download the file and place it in the appropriate folder in your ~/.spring directory. (you may have to create the folder)

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.

OTA Content

Certain mods require content from the Total Annihilation game, you need to download the following file to play them:

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, Expand & Exterminate, S44, BA and CA.


Linux specific Troubleshooting

Compiletime

hpiutil2 error with cmake

make[1]: *** [rts/lib/CMakeFiles/hpiutil2.dir/all] Error 2 make: *** [all] Error 2

Run cmake TWICE. It doesn't always work properly on the first run.

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. Update it.

Ingame

Slow Mouse

Run:

echo '# Slow fullscreen cursor fix for Spring' >> ~/.xsessionrc
echo 'SDL_MOUSE_RELATIVE=0' >> ~/.xsessionrc
echo 'export SDL_MOUSE_RELATIVE' >> ~/.xsessionrc

And log out and log in again.

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

Rotating Buildings

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.

If you want to save these keys you have to edit the uikeys.txt.

Problems with Audio

The engine needs at least OpenAL Soft 1.6 for its sound. If you still have the old openal-0.0.8 installed, you should update it.

Additionally, pulseaudio causes lots of issues, so try to disable it for spring if you have sound problems.

Desync in game

Spring only send the commands and not the result over the network, so it needs to run all math in a repeatable manner, so all other clients in a multiplayer match get the same results. So some CPU specific features have to enabled/disabled. If you desync you either have a CPU that isn't SSE capable or you set the wrong -march /-mtune compiler flags. If you compile Spring via scons you should try:

scons configure arch=i686

Cmake users should try:

cmake -DMARCH_FLAG="i686"

If You Still Have Problems

Join either IRC chat in #taspring on Freenode or #sy on QuakeNet, or ask for help in the lobby channels #sy or #springlobby.

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.

FAQ

IRC

  1. #sy @ QuakeNet
  2. #sy @ taspringmaster.clan-sy.com (with SpringLobbies only)
  3. #taspring @ FreeNode

Asking For Help

Okay, 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://springrts.com/wiki/Building_Spring_on_Linux"

This page has been accessed 16,668 times. This page was last modified 04:20, 24 February 2010.


 
 

Page editing toolbox

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Donations
Edit
View source
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in
Special pages
New pages
File list
Statistics
Bug reports
More...

Site layout created by Roflcopter.