Skip to content

Instantly share code, notes, and snippets.

@yspkm
Created December 2, 2023 07:56
Show Gist options
  • Save yspkm/8093dd79c8e2f8b07679ded27282a752 to your computer and use it in GitHub Desktop.
Save yspkm/8093dd79c8e2f8b07679ded27282a752 to your computer and use it in GitHub Desktop.
Omnetpp

README for Omnetpp Installation

Overview

This README provides detailed instructions for installing Omnetpp and its prerequisites on a Linux system.

Prerequisites

  • Linux Operating System
  • Internet connection
  • Sufficient disk space

Installation Steps

1. Update Package Database

Before starting, update the package database to ensure you have access to the latest versions of packages.

sudo apt-get update

2. Install Required Packages

Install the necessary development tools and libraries.

sudo apt-get install -y build-essential clang lld gdb bison flex perl python3 python3-pip \
qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5opengl5-dev libxml2-dev \
zlib1g-dev doxygen graphviz libwebkit2gtk-4.0-37

3. Install Python Libraries

Install required Python libraries using pip.

python3 -m pip install --user --upgrade numpy pandas matplotlib scipy seaborn posix_ipc

4. Install 3D Visualization Support (Optional)

For Qtenv with 3D visualization, install OpenSceneGraph and osgEarth packages.

sudo apt-get install -y libopenscenegraph-dev

5. Install MPI Packages (Optional)

To enable optional parallel simulation support, install MPI packages.

sudo apt-get install -y mpi-default-dev

6. Installing Omnetpp

Download and extract Omnetpp.

wget https://github.com/omnetpp/omnetpp/releases/download/omnetpp-6.0.2/omnetpp-6.0.2-linux-x86_64.tgz
tar xvfz omnetpp-6.0.2-linux-x86_64.tgz
OMNETPP_HOME=$HOME/omnetpp-6.0.2
mv omnetpp* $OMNETPP_HOME

Set environment variables and build Omnetpp.

echo '[ -f "$OMNETPP_HOME/setenv" ] && source "$OMNETPP_HOME/setenv"' >> ~/.bashrc
cd $OMNETPP_HOME
source setenv -f
./configure
make -j $(( ( $(nproc) + 1 ) / 2 ))

7. Verifying the Installation

Test the installation by running a sample project.

cd $OMNETPP_HOME/samples/aloha
./aloha

Conclusion

Follow these steps to successfully install Omnetpp and its prerequisites on your Linux system.

# Installing Prerequisite Packages
# Before starting the installation, refresh the database of available packages.
sudo apt-get update
# To install the required packages, type in the terminal:
sudo apt-get install -y build-essential clang lld gdb bison flex perl python3 python3-pip \
qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5opengl5-dev libxml2-dev \
zlib1g-dev doxygen graphviz libwebkit2gtk-4.0-37
python3 -m pip install --user --upgrade numpy pandas matplotlib scipy seaborn posix_ipc
# To use Qtenv with 3D visualization support, install the development packages for Open-
# SceneGraph (3.4 or later) and the osgEarth (2.9 or later) packages.
sudo apt-get install -y libopenscenegraph-dev
# To enable the optional parallel simulation support you will need to install the MPI packages:
sudo apt-get install -y mpi-default-dev
# Installing Omnetpp
wget https://github.com/omnetpp/omnetpp/releases/download/omnetpp-6.0.2/omnetpp-6.0.2-linux-x86_64.tgz
tar xvfz omnetpp-6.0.2-linux-x86_64.tgz
OMNETPP_HOME=$HOME/omnetpp-6.0.2
mv omnetpp* $OMNETPP_HOME
echo '[ -f "$OMNETPP_HOME/setenv" ] && source "$OMNETPP_HOME/setenv"' >> ~/.bashrc
cd $OMNETPP_HOME
source setenv -f
./configure
make -j $(( ( $(nproc) + 1 ) / 2 ))
# Verifying the installation
cd $OMNETPP_HOME/samples/aloha
./aloha
@mfatihkoc
Copy link

python3 -m pip install --user --upgrade numpy pandas matplotlib scipy seaborn posix_ipc
is not working for me

I see externally managed environment error

how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment