ns3在ubuntu安装
时间: 2024-04-05 10:25:48 浏览: 77
以下是在Ubuntu中安装ns3的步骤:
1安装必要的依赖项
```shell
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev python-pygraphviz cvs mercurial bzr git cmake p7zip-full python-matplotlib python-tk python-dev python-kiwi python-gnome2-dev qt4-dev-tools qt4-qmake qt4-qmlviewer doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra texlive-font-utils texlive-lang-portuguese dvipng
```
2.下载ns3源代码
```shell
cd ~
mkdir ns3
cd ns3
wget https://www.nsnam.org/releases/ns-allinone-3.30.1.tar.bz2
tar xjf ns-allinone-3.30.1.tar.bz2
```
3.编译和安装ns3
```shell
cd ns-allinone-3.30.1/
./build.py --enable-examples --enable-tests
```
4.设置环境变量
```shell
echo 'export PATH=$PATH:/home/your_user_name/ns3/ns-allinone-3.30.1/ns-3.30.1' >> ~/.bashrc
source ~/.bashrc
```
5.测试ns3是否安装成功
```shell
cd ns-allinone-3.30.1/ns-3.30.1/
./waf --run hello-simulator
```
阅读全文