Installing/Linux Build

This document describes how to install SUMO on Linux from sources. If you don't want to extend SUMO, but merely use it, you might want to download one of our pre-built binary packages instead.

To be able to run SUMO on Linux, just follow these four steps:
 * 1) Install all of the required tools and libraries
 * 2) Get the source code
 * 3) Build the SUMO binaries
 * 4) Install the SUMO binaries to another path (optional)

Each of these steps is outlined below.

Installing required tools and libraries
This document contains instructions for two basic ways of installing tools and libraries. You can follow either way.
 * Either install them manually for the current user (no root privileges required)
 * Or let your distribution install them system-wide (root privileges required)

Manuall install
This document describes how to build and install (higher level) libraries SUMO depends on from scratch under Linux. There is no need for package management (RPM or such) or root access. All you need is a working GCC (version 3.3 and up should suffice) and probably some basic libraries Fox depends on.

It has been tested successfully on several SuSE Linux installations and with a recent cygwin. Everything that needs extra work on cygwin is described in the cygwin section.


 * First check whether your Linux distribution comes with a Xerces-C package and install it together with the header files (for SuSE users this is the -dev package). Version 3.0 is used for the current SVN version. You should also check whether Proj, GDAL and Fox already come with your distribution and (if so) install them together with the header files (devel packages). Every package installed this way you will not need to build by yourself.
 * Second download the sources of SUMO, Proj, GDAL, Fox (if you want a GUI), and Xerces-C (if it does not come with your distribution).
 * If you are building a fresh repository checkout and don't need precise geocoordinates you can leave out Proj and GDAL.

The tools
We use the GNU autotools for generating configure and Makefiles for Unix-like environments. Documentation can be found in the
 * GNU autoconf pages,
 * Manual for autoconf,
 * Manual for automake,
 * Manual for libtool, and
 * the Autobook.

The Libraries
tar xzf fox-1.6.36.tar.gz cd fox-1.6.36 ./configure --prefix=$HOME && make install cd .. tar xzf gdal-1.5.1.tar.gz cd gdal-1.5.1 ./configure --prefix=$HOME && make install cd .. tar xzf proj-4.6.0.tar.gz cd proj-4.6.0 ./configure --prefix=$HOME && make install
 * Build and install the libraries (if you don't have root access choose a different target for the libs and includes such as $HOME). For GDAL, Fox and Proj this is more or less straightforward:


 * Note: The "make install" for GDAL may fail due to the Python bindings which it wants to install into some only-root-writable directory. You can safely ignore this.
 * It is strongly recommended to use a user writable installation directory and do "make install" instead of trying to specify directories inside the directory trees of GDAL, Proj and Fox when building SUMO later on.
 * Note: It seems like some distributions of Fox are built with disabled openGl-support. If you get unresolved references to methods such as "glColor...", "glVertex3f...", etc. during compilation of SUMO-GUI you have to enable openGL-support before compiling the FOX-library using "./configure --with-opengl=yes --prefix=$HOME && make install"; Still, this is the default normally.


 * In contrast to the other libraries, it is very likely that Xerces-C also comes with your Linux distribution (at least it does with a recent SuSE). If so, please first try to install it from there and do not forget to install the developer package as well.
 * The Xerces build is somewhat more involved:

tar xzf xerces-c-current.tar.gz export XERCESCROOT=${HOME}/xerces-c-src_3_0_1 cd $XERCESCROOT/src/xercesc autoconf ./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread -P$HOME make make install

Concluding Remarks
After installing all of the required libraries and tools in this fashion, note that, when building SUMO, the following parameters will be required for the "./configure" run:

./configure --with-fox-config=$HOME/bin/fox-config --with-proj-gdal=$HOME --with-xerces=$HOME

Distribution-specific instructions
If you want to build and optionally install SUMO on Ubuntu systems, you can either use this bash script or follow the instructions below.

Building on Ubuntu 8.04 "Hardy Heron"
On Ubuntu 8.04 "Hardy Heron", the following packages are needed to build SUMO: sudo aptitude install libtool libgdal1-dev proj libxerces27-dev

For building the SUMO GUI, the following additional packages are needed: sudo aptitude install libfox1.4-dev libgl1-mesa-dev libglu1-mesa-dev

Ubuntu 8.04 does not ship with libgdal.so, but only with libgdal1.4.0.so.1, so you either need to create a symlink /usr/lib/libgdal.so -> /usr/lib/libgdal1.4.0.so.1

sudo ln -s /usr/lib/libgdal1.4.0.so.1 /usr/lib/libgdal.so

or if you are using the SVN version, you can patch the configure.ac file to look for libgdal1.4.0.so.1 instead by changing LIB_GDAL="gdal" to LIB_GDAL="gdal1.4.0" and running make -f Makefile.cvs to re-generate the configure script.

Note that, when building SUMO, the following parameters will be required for the "./configure" run:

./configure --with-fox-includes=/usr/include/fox-1.4 --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr --with-gdal-libraries=/usr --with-proj-gdal

Ubuntu 8.10 "Intrepid Ibex"
On Ubuntu 8.10 "Intrepid Ibex", the following packages are needed to build SUMO: sudo aptitude install libtool libgdal1-dev proj libxerces-c2-dev

For building the SUMO GUI, the following additional packages are needed: sudo aptitude install libfox1.4-dev libgl1-mesa-dev libglu1-mesa-dev

Ubuntu 8.10 does not ship with libgdal.so, but only with libgdal1.5.0.so. The easiest way to fix this is to run

cd /usr/lib; sudo ln -s libgdal1.5.0.so libgdal.so

Instead, you might want to patch the configure script, e.g. if you are using the SVN version, you can patch the configure.ac file to look for libgdal1.5.0.so instead by changing LIB_GDAL="gdal" to LIB_GDAL="gdal1.5.0" and running make -f Makefile.cvs to re-generate the configure script.

Note that, when building SUMO, the following parameters will be required for the "./configure" run:

./configure --with-fox-includes=/usr/include/fox-1.4 --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr --with-gdal-libraries=/usr --with-proj-gdal

Ubuntu 9.04 "Jaunty Jackalope"
For Ubuntu 9.04 "Jaunty Jackalope", follow the build instructions above for Ubuntu 8.10.

Ubuntu 9.10 "Karmic Koala"
For Ubuntu 9.10 follow the instructions for Ubuntu 8.10 with one exception:

Instead of libfox1.4-dev install libfox-1.6-dev (don't miss the additional dash '-'): sudo aptitude install libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev

Note that, when building SUMO, the following parameters will be required for the "./configure" run:

./configure --with-fox-includes=/usr/include/fox-1.6 --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr --with-gdal-libraries=/usr --with-proj-gdal

Ubuntu 10.04 "Lucid Lynx", 10.10 "Maverick Meerkat", 11.04 "Natty Narwhal"
Lucid comes with version 1.6.0 of libgdal. So to build and install on lucid take above instructions for karmic (9.10) which reference to intrepid (8.10) and replace "gdal1.5.0" with "gdal1.6.0" where applicable.

Cygwin
Cygwin comes with a quite old xerces-c (version 2.5). After installing it you need to make a symbolic link in /usr/lib such that the linker finds the correct library: cd /usr/lib; ln -s /usr/lib/libxerces-c25.dll.a /usr/lib/libxerces-c.dll.a Now everything (but the GUI) should build fine.

release version
tar xzf sumo-src- .tar.gz cd sumo- /

subversion checkout
The process is essentially the same as building a release except that one needs the GNU autotools (which were also necessary when building xerces). The call to the autotools is hidden in Makefile.cvs.

The following commands are needed: svn co https://svn.code.sf.net/p/sumo/code/trunk/sumo make -f Makefile.cvs

Building the SUMO binaries
./configure [options] make

You probably need to tell the configure script where you installed all of the required libraries (e.g. --with-xerces=...). Please see the above instructions on installing required tools and libraries to find out how to do that.

Other common options to ./configure include --prefix=$HOME (so installing SUMO means copying the files somewhere in your home directory) and --enable-debug (to build a version of SUMO that's easier to debug).

For additional options please see ./configure --help

Additional notes for Cygwin users
At the moment GUI building is still troublesome. It depends whether you want to use the X-Server or native Windows GUI. We tried native Windows GUI only and had to change the installed libFOX-1.4.la such that it contains dependency_libs=' -lgdi32 -lglaux -ldl -lcomctl32 -lwsock32 -lwinspool -lmpr -lpthread -lpng /usr/lib/libtiff.la /usr/lib/libjpeg.la -lz -lbz2 -lopengl32 -lglu32' Your mileage may vary.

Installing the SUMO binaries
This (optional) step will copy the SUMO binaries to another path, so that you can delete all source and intermediate files afterwards. If you do not want (or need) to do that, you can simply skip this step and run SUMO from the source subfolder (src/sumo-gui and src/sumo).

If you want to install the SUMO binaries, run

make install

Problems with aclocal.m4 and libtool
If you're experiencing problems with aclocal.m4 definitions and see "You should recreate aclocal.m4" during the build, you should run the following commands: aclocal libtoolize --force autoheader autoconf ./configure [your configure options] make [install]

Unresolved references to openGL-functions
Build reports unresolved references to openGL-functions, saying things such as "./utils/glutils/libglutils.a(GLHelper.o): In function `GLHelper::drawOutlineCircle(float, float, int, float, float)': /home/smartie/sumo-0.9.5/src/utils/glutils/GLHelper.cpp:352: undefined reference to `glEnd'" SUMO needs FOX-toolkit to be build with openGL-support enabled. Do this by compiling FOX-toolkit as following: tar xzf fox-1.4.34.tar.gz cd fox-1.4.34 ./configure --with-opengl=yes --prefix=$HOME && make install

Further comment from Michael Behrisch ([sumo-user], 4.4.2007): ''Probably there is something wrong with your OpenGL installation. Make sure you have the libGL.so and libGLU.so which are most likely symbolic links to libGL.so.1.2 or something like this. They should appear in /usr/lib and case does matter (so "libgl.so" won't do).''

Trouble with SVN r4182
Just wanted to drop a short note that I was only able to build r4182 after removing l.472 from src/Makefile: @@ -469,7 +469,6 @@ $(sumo_LDADD) \ ./utils/glutils/libglutils.a \ ./gui/GUIManipulator.o \ -./utils/gui/drawer/GUICompleteSchemeStorage.o \ -l$(LIB_FOX)

Problems with the socket subsystem
Problem: recv ./foreign/tcpip/libtcpip.a(socket.o) (symbol belongs to implicit dependency /usr/lib/libsocket.so.1)

Solution: http://lists.danga.com/pipermail/memcached/2005-September/001611.html

=Patches=

Building Version 0.9.9 on Fedora Core 9
Niek Sanders writes:

To get SUMO 0.9.9 compiling on Fedora Core 9 with gcc 4.3.0, the following is needed:

src/traci_testclient/tracitestclient_main.cpp

needs #include 

Thank you!