Plexe

The Platooning Extension for Veins.

This page shows the step to build Plexe version 3.1. For instructions on how to build previous versions, please look at the following pages:

Compatibility notes

Note: Plexe 3.1 comes with the possibility of using heterogeneous interfaces, i.e., VLC (provided by Veins VLC) and LTE C-V2X Mode 3 (provided by SimuLTE). While standard, pure Plexe (i.e., 802.11p only) has evolved to support OMNeT++ version 6, some of the frameworks required for heterogeneous communication still don’t. If you plan to use Plexe for 802.11p simulations only, OMNeT++ 6 will work fine. Otherwise, it is better to use OMNeT++ version 5.7.2.

Pre-requirements for all OSes

Plexe currently works on Linux, macOS, and Windows as well, although the latest option is not recommended. On Linux you will have the most efficient working environment for Plexe. Downloading and building Plexe will be basically automatic, and you will have free tools available for debugging your code. On macOS, the situation is very similar to Linux, but you might need to install Xcode, which is undesirable, but besides that everything will work as on Linux. On Windows instead, building Plexe still requires manual steps (such as downloading external libraries), which is highly inefficient. If you are working on a Windows environment, or if you simply want to quickly try out Plexe, you might want to check out Instant Plexe in the download section.

Building for Linux (tested on Ubuntu 20.04.02)

Install required libraries and tools

Install build tools and required libraries:

1
sudo apt-get install build-essential gcc g++ bison flex perl python python3 qt5-default libqt5opengl5-dev tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkit2gtk-4.0-dev libopenscenegraph-dev libosgearth-dev openscenegraph-plugin-osgearth libxerces-c-dev libproj-dev libgdal-dev libfox-1.6-dev libavformat-dev libavcodec-dev libswscale-dev python-dev python-configparser cmake r-base

Note: On different distributions, some packages might have a different name, so you would need to install the version available on your system. For example, on Ubuntu 16.04 you need to install libwebkitgtk-1.0-0 instead of libwebkit2gtk-4.0-dev.

Step 1: Install OMNeT++

Note: These instructions provide minimal help as the OMNeT++ install guide provides many hints on this. Should you find any problem, please refer to the official OMNeT++ manual.

Download and extract OMNeT++ in your ~/src/ folder. Add the OMNeT++ folder to your PATH in your .bashrc, .zshrc, .profile, or equivalent.

1 2
echo 'export PATH=$PATH:~/src/omnetpp-<your version>/bin' >> ~/.bashrc source ~/.bashrc

Build OMNeT++ as described in the official documentation:

1 2 3
cd ~/src/omnetpp-<your version> ./configure make -j <number of cores of your PC>

Step 2: Install Plexe and Veins

Download the Veins 5.2 and Plexe 3.1 zip archives and extract them in the ~/src/ folder. Alternatively, you can clone both Veins 5.2 and Plexe 3.1 from their github repositories. Once you have the source code, you can build Veins and Plexe by running

1 2 3 4 5 6
cd ~/src/veins ./configure make -j <number of cores of your PC> cd ~/src/plexe ./configure --with-veins=../veins make -j <number of cores of your PC>

Via cookiecutter

Alternatively, you can use cookiecutter, a software to generate project templates. In brief, it can automatically download all the required software so that you only need to run configure and make. First install cookiecutter for python via pip

1
pip install --user cookiecutter

Then download the cookiecutter-plexe-project via git

1 2
cd ~/src git clone https://github.com/michele-segata/cookiecutter-plexe-project.git

and automatically download all the required source code by running

1 2
cd ~/src cookiecutter -v cookiecutter-plexe-project

Cookiecutter will prompt about some basic information, such as project name, project download folder, etc. You can simply leave all the default values besides the last one. The last prompt will ask you whether you want to use the heterogeneous networking extension or not (use_hetnet). If you type no, then standard Plexe (802.11p only) will be downloaded, otherwise cookiecutter will take care of downloading all the required extensions. If will find all the required software under the plexe_proj folder and every framework (Veins, Plexe, INET, etc.) will be located in a subfolder. To build all the software simply type

1 2 3
cd ~/src/plexe_proj ./configure make

Note: If you choose to use the HetNet extension, compiling can take quite a lot of time depending on your hardware, primarily due to the size of the INET framework.

Note: If you use cookiecutter, the Plexe root folder will be ~/src/plexe_proj/plexe rather than ~/src/plexe. Please remember this when following the tutorials.

Step 3: Install SUMO

As of SUMO 1.2.0, Plexe models are included within the official release. Any version starting from SUMO 1.2.0 should thus work fine. If you have to install it from scratch, choose SUMO 1.12.0: you just need to install the binary version. Please follow the official guidelines here. Alternatively, if you need to modify SUMO (e.g., to implement new control models) you can download the sources for SUMO 1.12.0 and build it following the official instructions.

Step 4: Setup up R and Python

As OMNeT++ 6 dropped the support for the OMNeT++ R plugin, data extraction scripts now work using a mix of R and python scripts. First, download the R package for processing OMNeT++ result files without extracting the archive. After installing R, install the required libraries. Type R in your terminal and in the R console type

1
install.packages(c('ggplot2', 'data.table'))

Choose a mirror and, if asked, reply YES when asked whether libraries should be installed in a local folder. Finally install the OMNeT++ result files package by typing

1
install.packages("omnetpp_0.7-1.tar.gz", repos=NULL)

Note: If you are using a C++17 compiler you might get the following error:

scave/export.cc:290:66: error: no member named 'mem_fun_ref' in namespace 'std'

If that is the case simply add the following line

CXXFLAGS += -std=c++11

to your $HOME/.R/Makevars file.

After this, install the required python packages using

1
pip install --user pandas scipy matplotlib

Building for macOS (tested on macOS 12.6.3 Monterey)

Building on Apple M1 processors

OMNeT++ is not yet fully compatible with Apple M1 processors. Yet, thanks to Rosetta, you can still emulate x86 processors and compile OMNeT++, Plexe, Veins, and all the required software. First, download the following setenv file and substitute the one in the OMNeT++ root folder. Then, start a terminal with an x86 emulation

1
arch -x86_64 /bin/zsh -i

If you are not using zsh, substitute /bin/zsh with the one you are using. Go to your OMNeT++ source folder and source setenv:

1 2
cd ~/src/omnetpp-<your version>/ source setenv

From the same terminal, now navigate to the folders of the software you have to compile (e.g., ~/src/veins or ~/src/plexe) and run build commands as usual.

Install required libraries and tools

On macOS X you will need to install MacPorts, which in turn MIGHT require you to install Xcode. It looks like you can install MacPorts without the full Xcode software, but I never tried. Feel free to send me feedbacks. Then to install the required tools type

1
sudo port install bison flex zlib tk autoconf libtool proj gdal fox xercesc R wget cmake

Installing OMNeT++, Plexe, Veins, SUMO, and setting up R and Python

See Linux instructions

cMersenneTwister is not a subclass of cRNG

If you encounter this error when running the simulations, please look at the FAQs.

Building for Windows

Note: If you are having troubles compiling for Windows, you might want to check out Instant Plexe in the download section.

Step 1: Install OMNeT++

Download and extract the OMNeT++ Windows sources in C:\Users\<user>\src. Open the Mingw terminal inside the OMNeT++ folder and type

1 2
./configure make -j <number of cores of your PC>

Step 2: Install Plexe and Veins

Open the Mingw terminal in the OMNeT++ source folder and cd into /c/Users/<user>/src/veins (for building Veins) and into /c/Users/<user>/src/plexe (for building Plexe). To compile Veins and Plexe follow Linux instructions.

Step 3: Install SUMO

Please visit the official SUMO website and dowload SUMO 1.12.0 binaries. If you need to modify SUMO (e.g., to implement new control models) you can download the sources for SUMO 1.12.0 and build it following the official instructions

TODO: add instructions for setting the PATH

Step 4: Set up R and Python

Note: This instructions refer to R version 3.3.0, but the procedure for version 4 should be equivalent.

Install R for Windows from the official website and then install R tools. When the installation is complete, edit your Windows PATH to include R and Rtools binaries folder (e.g., c:\Rtools\bin;c:\Rtools\mingw_64\bin;C:\Program Files\R\R-3.3.0\bin\x64\;). Open the R console and install the required packages by typing

1
install.packages(c('ggplot2', 'data.table'))

The installation will ask you to install the packages to a local folder. Reply with YES and take note of that folder. Then add an additional environmental variable called R_LIBS which points to the location of the installed R libraries, for example

1
C:\Users\<user>\Documents\R\win-library\3.3

Now you should be able to start R by typing R in the Mingw console provided by OMNeT++.

After this, in the same terminal, install the required python packages using

1
pip install --user pandas scipy matplotlib