Windows - Using WSL (RECOMMENDED)

Windows Subsystem for Linux (WSL) supports running a full Linux distribution on a Windows machine. Running OMNeT++ in WSL 2 has several advantages compared to running OMNeT++ natively on Windows:

Advantages:

  • You will probably see significant speedup on certain tasks (like compilation) compared to the native Windows (MinGW64) toolchain, because the compiler toolchain and the filesystem (ext4) is much faster in WSL 2 than their Windows equivalents.

  • The native MinGW64 toolchain on Windows is basically a mini (Unix-like) system, emulated on top of Windows. Because of the emulation, it may have incompatibilities and limitations compared to the Linux tools. You will have fewer issues and surprises when running OMNeT++ on Linux.

Disadvantages:

  • You will not be able to link against Windows libraries, however this is seldom needed as almost all libraries are available in the Linux environment, too.

Enabling or Upgrading WSL 2 on Windows

Installing OMNeT++ on WSL is supported on WSL 2.5.7 or later.

Open a PowerShell with Administrator privileges. On newer versions of Windows, you can install the WSL subsystem by typing:

wsl --install

Or if you have WSL already installed, just upgrade it to the latest version:

wsl.exe --upgrade

Make sure that it is 2.5.7 or later and continue to install either a Linux distribution from the Microsoft Store or opp_env in WSL.

Tip

We recommend installing and using the Windows Terminal application, which is available at https://www.microsoft.com/store/productId/9N0DX20HK701

opp_env.wsl is a pre-configured Linux environment that can be easily installed on Windows and contains the opp_env package manager, maintained by the OMNeT++ team. Its main advantage is that it can automate the installation of OMNeT++ and its dependencies. Additionally, it can install a growing list of simulation models and tools with a single, very simple command.

Just download the opp_env.wsl file from https://github.com/omnetpp/opp_env/releases/download/wsl/opp_env.wsl and start it from your browser or the File Explorer. Then, follow the on-screen instructions to install OMNeT++ and its dependencies.

From command line you can use:

curl.exe -L https://github.com/omnetpp/opp_env/releases/download/wsl/opp_env.wsl | wsl --import opp_env -

For more information, visit: https://github.com/omnetpp/opp_env.

Installing a Linux distribution in WSL

As a next step, you must install a Linux distribution from the Microsoft Store. We recommend using Ubuntu from https://apps.microsoft.com/detail/9pdxgncfsczv.

Once the installation is done, run the distro and finish the setup process by setting up a user name and password. At this point, you could install OMNeT++.

Install OMNeT++ Linux

At this point, you have a fully functional Linux environment that can run GUI apps. You can go on and follow the Ubuntu specific installation steps to finally install OMNeT++ on your system.

Windows - Using the MinGW64 Compiler Toolchain

Supported Windows Versions

OMNeT++ is supported on 64-bit versions of Windows 11.

Installing OMNeT++

Download the OMNeT++ source code from https://omnetpp.org. Make sure you select the Windows-specific archive, named omnetpp-6.4-windows-x86_64.7z.

The package is self-contained: in addition to OMNeT++ files it includes a C++ compiler, a command-line build environment, and all libraries and programs required by OMNeT++.

Copy the OMNeT++ archive to the directory where you want to install it. Choose a directory whose full path does not contain any space; for example, do not put OMNeT++ under Program Files.

Extract the archive file. To do so, right-click the file in Windows Explorer, and select Extract All from the menu.

When you look into the new omnetpp-6.4 directory, should see directories named doc, images, include, tools, etc., and files named opp_shell.cmd, configure, Makefile, and others.

Configuring and Building OMNeT++

Start opp_shell.cmd in the omnetpp-6.4 directory by double-clicking it in Windows Explorer. It will bring up a console with the MSYS bash shell, where the path is already set to include the omnetpp-6.4/bin directory. On the first start of the shell, you may need to wait for the extraction of the tools directory.

First, check the contents of the configure.user file to make sure it contains the settings you need. In most cases you don’t need to change anything.

notepad configure.user

Then enter the following commands:

$ ./configure
$ make -j16

The build process will create both debug and release binaries.

Note

If you want to install the dependencies manually instead of using the pre-packaged tools archive, delete all *.7z files from the tools directory before starting opp_shell.cmd the first time. This will prevent the extraction of the pre-packaged tools. After starting opp_shell.cmd, you must install the dependencies manually by executing the ./install.sh script. The script will install all the dependencies and configure, then build OMNeT++.

Verifying the Installation

You should now test all samples and check they run correctly. As an example, the aloha example is started by entering the following commands:

$ cd samples/aloha
$ ./aloha

By default, the samples will run using the graphical Qtenv environment. You should see GUI windows and dialogs.

Starting the IDE

OMNeT++ comes with an Eclipse-based Simulation IDE. You should be able to start the IDE by typing:

$ omnetpp

We recommend that you start the IDE from the command-line. The build process will also create a shortcut for you if you want to use the start menu.

Warning

Pinning the OMNeT++ IDE to the taskbar will NOT work.

Environment Variables

In general OMNeT++ requires that certain environment variables are set. Always use the the provided shell window to start the IDE or your simulations.

Reconfiguring the Libraries

If you need to recompile the OMNeT++ components with different flags (e.g. different optimization), then change the top-level OMNeT++ directory, edit configure.user accordingly, then type:

$ ./configure
$ make clean
$ make -j16

If you want to recompile just a single library, then change to the directory of the library (e.g. cd src/sim) and type:

$ make clean
$ make

By default, libraries are compiled in both debug and release mode. If you want to make release or debug builds only, use:

$ make MODE=release

or

$ make MODE=debug

By default, shared libraries will be created. If you want to build static libraries, set SHARED_LIBS=no in configure.user and re-configure your project.

Note

The built libraries and programs are immediately copied to the lib/ and bin/ subdirs.

Portability Issues

OMNeT++ has been tested with both the clang compiler from the MinGW-w64 package.

Microsoft Visual C++ is not supported in the Academic Edition.

Additional Packages

MPI

MPI is only needed if you would like to run parallel simulations.

There are several MPI implementations for Windows, and OMNeT++ does not mandate any specific one. We recommend DeinoMPI, which can be downloaded from http://mpi.deino.net.

After installing DeinoMPI, adjust the MPI_DIR setting in OMNeT++’s configure.user, and reconfigure and recompile OMNeT++:

$ ./configure
$ make cleanall
$ make

Note

In general, if you would like to run parallel simulations, we recommend that you use Linux, macOS, or another unix-like platform.

Akaroa

Akaroa 2.7.9, which is the latest version at the time of writing, does not support Windows. You may try to port it using the porting guide from the Akaroa distribution.