0
0

More than 1 year has passed since last update.

Ubuntu22.04にns-3.32をインストール

Last updated at Posted at 2023-06-21

環境

  • Ubuntu 22.04.2 LTS
  • Windows10 Pro

プリインストール

ns3をインストールする前に必要なモジュールをインストールしておきます。

!#/bin/bash

sudo apt install -y gcc g++ python python3 python3-dev
sudo apt install -y python3-setuptools git mercurial
sudo apt install -y qt5-default mercurial
sudo apt install -y gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3  
sudo apt install -y openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
sudo apt install -y uncrustify
sudo apt install -y gsl-bin libgsl-dev libgsl23 libgslcblas0
sudo apt install -y sqlite sqlite3 libsqlite3-dev
sudo apt install -y libxml2 libxml2-dev
sudo apt install -y cmake libc6-dev libc6-dev-i386 libclang-6.0-dev llvm-6.0-dev automake pip
python3 -m pip install --user cxxfilt
sudo apt install -y libgtk2.0-0 libgtk2.0-dev
sudo apt install -y vtun lxc
sudo apt install -y libboost-signals-dev libboost-filesystem-dev
sudo apt install -y doxygen graphviz imagemagick
sudo apt install -y texlive texlive-extra-utils texlive-latex-extra texlive-font-utils texlive-lang-portuguese dvipng latexmk
sudo apt install -y python3-sphinx dia 

ns3のインストール

ホームディレクトリを汚したくなかったので、ワーキングディレクトリを作り、そこにインストールしました。

 cd
 mkdir workspace
 cd workspace
 git clone https://gitlab.com/nsnam/ns-3-allinone.git
 cd ns-3-allinone
 python download.py -n ns-3.30

ns3のビルド

 cd ns-3.30
 ./waf configure --build-profile=debug --enable-examples --enable-tests
 ./waf build

自分の環境ではビルドは11分程度でした。

image.png

ns3のテスト

ns3に同封されているテストコードを実行して正常に動くか確認します。

./test.py

自分の環境では25分程度かかりました。
image.png

シナリオファイルの実行

 ./waf --run hello-simulator

Hello Simulator と表示されればns3のインストールは成功です。

つまずいた所

エラー現象

Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3

解決方法

# sudo apt install python-is-python3

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0