sumo-install in ubuntu16.04


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.

Contents

  • Installing required tools and libraries

Note:
Since revision 25121 building SUMO requires a C++11 enabled compiler
  • For the build infrastructure you will need a moderately recent g++ (4.8 will do) or clang++ together with the autotools (autoconf / automake).
  • The libraries needed are the Fox Toolkit in version 1.6.x, Xerces-C, Proj and GDAL. To compile you will need the devel versions of all packages. For openSUSE this means installing libxerces-c-devel, libproj-devel, libgdal-devel, and fox16-devel. There are some platform specific and manual build instructions for the libraries
  • Optionally you may want to add ffmpeg-devel (for video output), libOpenSceneGraph-devel (for the experimental 3D GUI) and python-devel (for running TraCI pythons scripts without a socket connection)
  • OPEN TERMINAL BY PRESSING "CTRL + ALT + T" AND TYPE :
  • "$ sudo apt-get install libgdal1h libgdal-dev g++ libxerces-c3.1 libxerces-c-dev libicu-dev libproj-dev libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev python-dev" 

  • Getting the source code

STEP1: release version or nightly tarball

Download sumo-src-0.31.0.tar.gz or http://sumo.dlr.de/daily/sumo-src-svn.tar.gz

tar xzf sumo-src-<version>.tar.gz
cd sumo-<version>/

STEP2 subversion checkout

To build from a checkout the GNU autotools are needed. The call to the autotools is hidden in Makefile.cvs.

The following commands should be issued:

svn co https://svn.code.sf.net/p/sumo/code/trunk/sumo
cd sumo
make -f Makefile.cvs 
Note:
If you use git-svn see Downloads#Hint for git-svn users

STEP3 :Definition of SUMO_HOME

Before compiling is advisable (essential if you want to use Clang) to define the environment variable SUMO_HOME. Assuming that you placed SUMO in the folder "/home/<user>/sumo-<version>", if you want to define only for the current session, type in the console

SUMO_HOME="/home/<user>/sumo-<version>"; export SUMO_HOME

If you want to define for all sessions (i.e. for every time that you run your Linux distribution), go to your HOME folder, and find one of the next tree files (depending of your Linux distribution): .bash_profile, .bash_login or .profile (Note that these files can be hidden). Then edit the file, add at the end and reboot your session.关机

export SUMO_HOME="/home/<user>/sumo-<version>"

You can check that SUMO_HOME was successfully set if you type

echo $SUMO_HOME

and console shows "/home/<user>/sumo-<version>"

Building the SUMO binaries

./configure [options]
make

If you built the required libraries manually, you may need to tell the configure script where you installed them (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), --enable-debug (to build a version of SUMO that's easier to debug), and --with-python which enables the direct linking of python.

For additional options please see

./configure --help

After doing make you will find all binaries in the bin subdir without the need for installation. You may of course do a make install to your intended destination as well, see below.

Building with clang

If you want to use a different compiler (just for the fun of it or because it has additional features) you can enable it at configure time. Our current clang configuration for additional static code checking looks like this:

./configure CXX=clang++ CXXFLAGS="-stdlib=libstdc++ -fsanitize=undefined,address,integer,unsigned-integer-overflow -fno-omit-frame-pointer -fsanitize-blacklist=$PWD/build/clang_sanitize_blacklist.txt"

You may of course leave out all the sanitizer-checks you don't want but the stdlib option has to be set. The blacklist filters out a known bug in the cstdlib. For details see the clang documentation.

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 bin subfolder (bin/sumo-gui and bin/sumo).

If you want to install the SUMO binaries, run

make install


# FIRST ONE:
        "$ sudo ./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"

#SECOND ONE:
        "$ sudo make"

#THIRD ONE:
        "$ sudo make install"











posted @ 2017-10-20 11:23  Hello_to_Sa's_world  阅读(1667)  评论(0编辑  收藏  举报