Skip to content

Compiling SUMO Source Version Under WSL2 of Windows11-Ubuntu

SUMO(Simulation of Urban MObility)

SUMO is an open-source, highly portable, microscopic and continuous multi-modal traffic simulation package designed to handle large networks. SUMO allows modelling of intermodal traffic systems including road vehicles, public transport and pedestrians.[3].

There are binary versions of SUMO available for 64bit Windows platform. So, you can easily install a suitable binary version for Windows 11.

Even it is possible to compile SUMO under Windows 11 natively using Microsoft Visual Studio.

But this procedure is for compiling SUMO from its original sources under Linux which was installed under WSL2 of  Windows 11.

Cation: Those who are wishing to use the binary version or trying to compile source natively under Windows Using VC++ or any other compiler, may avoid following his procedure.

The Windows Subsystem for Linux (WSL): 

The Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup[1]. Particularly, by using the latest version of WSL2 under Windows 11 one can easily install SUMO under Windows 11.

Compiling the latest Linux-based simulation tool SUMO under Cygwin, MinGW and MSYS2  will be a challenging task. But, using different virtualisation solutions such as Microsoft Virtual PC, Microsoft Hyper-V, VMWare, VirtualBox, etc., one can successfully install and use any Linux-based application under Windows. But the performance of SUM simulation in terms of speed will not be good under these kinds of desktop virtualization solutions.  But Windows Subsystem for Linux is the best and most efficient way of running Linux-based simulation tools under Windows. It will give better performance in terms of speed while comparing with other virtualization technologies.

Installing WSL2 and suitable Linux version Under Windows 11

The following step-by-step procedure explains the way of installing WSL2, and Ubuntu under the latest Windows 11 version.

 

Installing WSL2 Under Windows 11 and Running GUI Linux Apps.

 

 

Installing SUMO

The installation procedure that we present here is almost the same as the Part-I of the following procedure (Part – I. The SUMO Installation).

You may refer the following article to install SUMO in your machine.  It is an installation procedure that will do the installation in chroot jail. One may use the same procedure to install SUMO in their native Linux installation also.

For native SUMO install, you may follow the Part-I of the procedure (Part – I. The SUMO Installation).

Installing ms-van3t – A Multi-Stack VANET Framework for ns-3

Instead of installing SUMO under chroot, we are going to install it under WSL2 of Windows 11.

 

In this demonstration, I decided to compile the latest version of SUMO from the source.

Step 1: Install the Dependencies for SUMO

$ cd /home/your_home
$ sudo  apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig
 

Step 2: Download the source version of SUMO

So, I decided to compile a suitable version from the source.  (you may download a prefered version of SUMO)

$ git clone –recursive -j8 https://github.com/eclipse/sumo

Caution: The command “git clone –recursive -j8 https://github.com/eclipse/sumo” will download a higher version in future. 

One can download the SUMO version of their choice from  https://sourceforge.net/projects/sumo/files/sumo/

For example, simply you may download a specific version 1.8.0 using a specific link as follows:

The following screenshot shows the extraction of the sumo source version 1.10.0.
After downloading sumo, extract it in a folder under your home directory.  In my install, I am keeping it under /home/your_home folder.
 

 

Step 3: Compile SUMO

For compiling SUMO, do the following:

$ cd /home/sumo-1.10.0
$ mkdir ./cmakebuild
$ cd cmakebuild
$ cmake ../.
 
The following screenshot shows the successful creation of Makefile.
 
 
Now we may compile sumo using “make” command.
 

$ make -j8

# -j8  assumes compiling it as 8 jobs for 8 CPU cores

 
 
The following screenshot shows the successful compile of sumo.
 
Now you will get all the binaries under sumo-1.10.0/bin folder (in our case it is “/home/your_home/sumo-1.10.0/bin”).
 
 
Do the necessary things to add the path of the binaries from the .bashprofile.
 

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

Step 3: Running SUMO-GUI

 
Now you can use SUMO and create your road network topology as explained in the following articles:

 

Simulating Manhattan Grid Mobility Model for VANET with SUMO

 

Creating Random Road Network, Traffic Flows, Signals in SUMO

 

Conclusion

With the latest Windows 11 and its WSL2 support, we can run any GUI-based Linux applications under windows. The future version of WSL may even have excellent support for applications that may use 3D graphics subsystem. We can install any text-based as well as GUI-based Linux application under this Ubuntu which is running under WSL2. 

 

We may see the installation procedure of different simulation tools under WSL2 in different future articles.
Meantime one may try the following installation procedures under WSL2.

https://www.projectguideline.com/installing-netsimulyzer-3d-visualization-tool-under-linux-virtual-guest-operating-system-environment/

Installing NetSimulyzer 3D Visualization Tool Under Linux Virtual Guest Operating System Environment

https://www.projectguideline.com/installing-aquasim-aqua3d-on-an-old-linux-under-virtualbox/

Installing Aquasim & Aqua3D on an old Linux under VirtualBox

 

https://www.projectguideline.com/installing-omnet-6-on-a-64-bit-debian-10-under-chroot-jail/

 

Installing OMNeT++ 6 on a 64-bit Debian 10 Under Chroot-Jail

 

References 

    1. https://docs.microsoft.com/en-us/windows/wsl/about
    2. https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview
    3. https://www.nsnam.org/wiki/Installation
    4. https://www.eclipse.org/sumo/
    5. https://www.projectguideline.com/installing-wsl2-under-windows-11-and-running-gui-linux-apps/
    6. https://www.projectguideline.com/installing-ms-van3t-a-multi-stack-vanet-framework-for-ns-3/
WhatsApp Discuss Through WhatsApp