# Plexe

The Platooning Extension for Veins.

# Pre-requirements for all OSes

Plexe currently works on Linux, Mac OS X, 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 Mac OS X, 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.

For Linux and Mac OS X be sure to have git installed on the system to obtain Plexe source code. For Windows, this is not required as git is included in the Mingw terminal which ships with OMNeT++ source code. Download OMNeT++ source code and extract it either in ~/src/ (Linux or Mac OS X) or in C:\Users\<user>\src (Windows). In your terminal (either system terminal in Linux/Mac OS X or Mingw inside the OMNeT++ source folder in Windows), cd into ~/src or /c/Users/<user>/src and obtain Plexe source code by typing

## Building for Linux (tested on Ubuntu 16.04)

### Install required libraries and tools

Install build tools and required libraries:

### Building OMNeT++

Add OMNeT++ folder to your PATH in your .bashrc, .zshrc, .profile, or equivalent.

Build OMNeT++ as explained in the official documentation:

### Setting up R

Start R by typing R in your terminal. In the R console type

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

## Building for macOS (tested on OS X 10.13 High Sierra)

### Install required libraries and tools

On Mac OS 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

### Building OMNeT++, Plexe-Veins, Plexe-SUMO, and setting up R

See Linux instructions

When compiling Plexe-SUMO in debug mode with clang, CMakeLists.txt adds a compiler flag that causes the compilation to fail. Applying the following patch (remove -stdlib=libstdc++) solves the problem.

Apparently there is a bug in the CMakeLists.txt file that causes cmake to fail searching for the FOX library. Applying the following patch to the CMakeLists.txt file in the Plexe-SUMO root folder seems to solve the problem.

After the upgrade from version 4 to version 5, the location of headers and library files has changed. If you perform a MacPorts upgrade which updates the library, cmake will fail to locate it. To avoid this issue, you can force MacPorts to re-install the old version. To revert the library to a working version do the following:

This will install Proj version 4.9.3 and SUMO will correctly locate the library.

#### For macOS Sierra (10.12) users:

If you are having problems in building SUMO, check that you installed the full XCode version. Although you can install MacPorts without the complete XCode, it seems that you will have problems building it if you don’t do so. In addition, check wether the MacPorts path in your PATH variable comes before the system path. In case you don’t find the MacPorts path in your .profile file, MacPorts might have added /opt/local/bin to the /etc/paths file. If this is the case, move the MacPorts path at the top of the list and restart your terminal.

If the SUMO GUI stopped working after a MacPorts upgrade, it might be due to an update to the FOX library. You can check the installed version by typing

in your terminal. If the answer is fox @1.6.53_0 (active) then you have a bugged version of the library. To revert the library to a working version do the following:

The clone operation downloads roughly 130 MB of data! This will install the previous version of the library. You can check the current version by typing again port installed | grep fox which should now show

The SUMO GUI should now be working again.

## Building for Windows

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

### Building OMNeT++

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

### Building Plexe-Veins

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

### Building Plexe-SUMO

Open the Mingw terminal in the OMNeT++ source folder and cd into /c/Users/<user>/src/plexe-sumo. Checkout the correct code version by typing

Building SUMO for Windows should now have become easier as SUMO moved to CMake, which can automatically generate Visual Studio solution files. Please visit the official SUMO website to find the instructions for building SUMO on Windows using CMake and Visual Studio.

Once built, add C:\Users\<user>\src\plexe-sumo\bin to your Windows PATH.

### Setting up R

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\;). Download the OMNeT++ R package from here and save it in C:\Users\<user>\src. Open the R console and install the required packages by typing

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

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