Install

pigne edited this page Oct 10, 2012 · 21 revisions

Install OVNIS

Date: Jan 17, 2011
Author: Yoann Pigné
Organization: University of Luxembourg
Contact: yoann@pigne.org
Version: 0.1
Copyright: 2010-2011, University of Luxembourg

Welcome to the ovnis wiki. This page gives you hints on how to install the ONVIS framework on your machine.

Note that this project is currently only been tested on Linux (Ubuntu 10.10, 32 bits) and Mac Os X (Snow Leopard). It may however be possible to build ovnis on windows with Cygwin provided you succeed installing SUMO and ns-3 first.

Dependencies

As OVNIS promotes an integration of both ns-3 and SUMO, it obviously depends on the two projects that need to be compiled on your machine.

As of version 0.1, ovnis relies on:

  • ns-3 version 3.10;
  • SUMO version 0.12.2.

Please pay attention to the versions numbers. OVNIS won't compile with any other version of ns and sumo!

Building ns-3

The installation of ns-3 is largely explained for different architectures. Please refer to the ns-3 Install Pages for instructions. The best option is probably the ns-3-allinone install.

Note that unlike ns-3, ovnis does not use python as a scripting language. Only C++ is used to set up scripts. So if you only need ns-3 for use with ovnis, you don’t have to fucus on the installation of python bindings.

Building SUMO

Since you will need some header of the SUMO project (for the Traci part), you need to build SUMO on your machine and not only install binary packages.

Building SUMO on Linux

You may follow the SUMO building instruction for Linux from SUMO’s pages.

Building SUMO on Mac OS X

The installation of SUMO on Mac OS X, not widely documentent however should work properly.

  1. if not already done, you need to install Xcode (Apple’s development suite) from your Mac OS X install disk.
  2. Install MacPorts following the given instructions.
  3. Install the SUMO’s dependencies within MacPorts:
sudo port install xercesc proj fox gdal
  1. Download the source archive of version 0.12.2 of SUMO.
  2. Extract the downloaded file in a location of your choice.
  3. Open a Terminal and change to the directory you just extracted.
  4. Two files need editing to compile on Mac. Note this modification is included in earlier revisions of the svn repository.
  • add the following method in [/some/path]/sumo-0.12.2/src/utils/common/StdDefs.h:
template<typename T>
inline T
ISNAN(T a) {
   volatile T d = a;
   return d != d;
}
  • remove the following code in file [/some/path]/sumo-0.12.2src/router/RORouteDef_Alternatives.cpp, line 54:
#ifdef _MSC_VER
#define ISNAN _isnan
#else
#define ISNAN isnan
#endif
  1. Go on with the the classical GNU building steps, indicating the location of the dependencies:

export CPPFLAGS="$CPPFLAGS -I/opt/local/include" export LDFLAGS="$LDFLAGS -L/opt/local/lib" ./configure --with-fox=/opt/local

--with-proj-gdal=/opt/local --with-xerces=/opt/local --prefix=/opt/sumo

make

If everything went well, you should be able to run the sumo executable in the src subdirectory:

cd src
./sumo

That sould give you:

SUMO sumo Version 0.12.2
 (c) DLR 2001-2010; http://sumo.sourceforge.net
 Use --help to get the list of options.

The next step is to test the gui in the same folder, running sumo-gui. The window should take some long time to launch since it will first start an X11 server.

Building OVNIS

Once you have ns-3 and SUMO build and running you may proceed to the build of OVNIS itself.

OVNIS is build following the GNU autotools system (no we do not use waf). So the classical ./configure, make and optionally make install are used. You will need a version of autotools on your system to be able to proceed.

At configure time will need to specify the location of the tools OVNIS depends on: ns-3, SUMO and maybe Xerces-c, if it’s not installed on a default directory. Your should be aware of the location of ns-3 and SUMO since you have juste build them. Specify the location of Xerces-c only if it’s not on a default location (/opt/local/ for Mac/Macport users).

  1. Downloading the source of the project.
  2. Extract the archive to a location of your choice and open a terminal into the new folder.
  3. run the automake command
autoreconf -fis
  1. run the configure script specifying the location of ns-3, SUMO and eventually Xerces:
./configure \
    --with-ns3=[/some/path]/ns-3-allinone/ns-3.10/ \
    --with-sumo=[/some/path]/sumo-0.12.2/ \
    --with-xerces=/opt/local/
make
  1. Try the test program:
cd test/
./ovnisSample_static

If you get something like:

VehicleSpeed 4001000 3754.45 370
VehicleSpeed 4002000 3774.8 370
VehicleSpeed 4003000 3784.49 370
VehicleSpeed 4004000 3750.84 372
VehicleSpeed 4005000 3733.99 373
SentData 4006000 452 23
VehicleSpeed 4006000 3724.29 373
[...]

then congrats, you made it.

If you went into troubles, try the troubleshooting section. If the troubleshooting section is empty, then contact the author at yoann@pigne.org

Your turn to play

You should normally have a working installation of OVNIS now. The "test/" folder contains a very simple yet efficient test scenario where a map and vehicles are loaded. An application runs on each device (vehicle). They broadcast messages when stuck in traffic jam. Vehicles receiving these messages may change their predefined route online.

Use this simple code to start creating your own ns3 application. Most of the bits of this example may be useful for you.

Troubleshooting

Compilation errors

If you get that kind of error at make time after successfully passing the `./configure`step:

In file included from ./devices/wifi/ovnis-adhoc-wifi-mac.cc:21
./devices/wifi/ovnis-adhoc-wifi-mac.h:23:31: error: ns3/mac48-address.h: No such file or directory
./devices/wifi/ovnis-adhoc-wifi-mac.h:24:26: error: ns3/callback.h: No such file or directory
./devices/wifi/ovnis-adhoc-wifi-mac.h:25:24: error: ns3/packet.h: No such file or directory
./devices/wifi/ovnis-adhoc-wifi-mac.h:26:26: error: ns3/wifi-mac.h: No such file or directory
[ lots of lines of the same kind ]
./devices/wifi/ovnis-adhoc-wifi-mac.cc:222: error: ‘Mac48Address’ was not declared in this scope
./devices/wifi/ovnis-adhoc-wifi-mac.cc:303: error: expected `}' at end of input
make[2]: *** [ovnis-adhoc-wifi-mac.lo] Error 1

then you probably set relative paths in the configure parameters (--with-ns3, --with-sumo, --with-xerces). Use absolute paths (stating with ‘/’).

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.