# Plexe

The Platooning Extension for Veins.

# 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:

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++ 5.6.2 in your ~/src/ folder. Add the OMNeT++ folder to your PATH in your .bashrc, .zshrc, .profile, or equivalent.

Build OMNeT++ as described in the official documentation:

### Step 2: Install Plexe and Veins

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

### 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.8.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.8.0 and build it following the official instructions.

### Step 4: Setup up R

First, download the package for processing OMNeT++ result files without extracting the archive. Start R in the same folder where you downloaded the library 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

### Installing OMNeT++, Plexe, Veins, 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.

### 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

### 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.8.0 binaries. If you need to modify SUMO (e.g., to implement new control models) you can download the sources for SUMO 1.8.0 and build it following the official instructions

### Step 4: Set up R

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\;). 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++.