官方安装教程:https://www.nsnam.org/wiki/Installation

推荐使用Ubuntu18.04,Ubuntu20.04有些依赖无法下载。

准备工作

# 如果下载速度很慢,可以更换源
sudo sed -i 's#archive.ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list
# 下面的一定要执行
sudo apt update
sudo apt upgrade

安装 ns3 所需要的依赖环境

# Ubuntu18.04 下依赖都能安装
sudo apt-get install g++ python3
sudo apt-get install g++ python3 python3-dev pkg-config sqlite3
sudo apt-get install python3-setuptools git
sudo apt-get install qt5-default mercurial
sudo apt-get install 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-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
sudo apt-get install autoconf cvs bzr unrar
sudo apt-get install gdb valgrind
sudo apt-get install uncrustify
sudo apt-get install doxygen graphviz imagemagick
sudo apt-get install texlive texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng latexmk
sudo apt-get install python3-sphinx dia
sudo apt-get install gsl-bin libgsl-dev libgsl23 libgslcblas0
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install cmake libc6-dev libc6-dev-i386 libclang-6.0-dev llvm-6.0-dev automake
sudo apt install python3-pip
sudo pip3 install --upgrade pip
python3 -m pip install --user cxxfilt
sudo apt-get install libgtk-3-dev
sudo apt-get install vtun lxc uml-utilities
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
# 建议安装完,copy全部,再执行一遍,看有没有漏掉的。

下载源文件并进行解压安装

下载地址:https://www.nsnam.org/releases/

tar xjf ns-allinone-3.31.tar.bz2 # 解压
chmod -R 777 ns-allinone-3.31 # 修改权限
ls
cd ns-allinone-3.31 # 切换到解压目录下

./build.py --enable-examples --enable-test

输出如下

# Build NS-3
Entering directory `./ns-3.31'
=> /usr/bin/python3 waf configure clean --with-pybindgen ../pybindgen-0.21.0
Setting top to : /home/ns-allinone-3.31/ns-3.31
Setting out to : /home/ns-allinone-3.31/ns-3.31/build
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for cc version : 7.5.0
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for compilation flag -Wl,--soname=foo support : ok
Checking for compilation flag -std=c++11 support : ok
Checking boost includes : 1_65_1
Checking boost libs : ok
Checking for boost linkage : ok
Checking for program 'python' : /usr/bin/python3
Checking for python version >= 2.3 : 3.6.9
python-config : /usr/bin/python3-config
Asking python-config for pyembed '--cflags --libs --ldflags --embed' flags : not found
Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes
Testing pyembed configuration : yes
Asking python-config for pyext '--cflags --libs --ldflags' flags : yes
Testing pyext configuration : yes
Checking for compilation flag -fvisibility=hidden support : ok
Checking for compilation flag -Wno-array-bounds support : ok
Checking for pybindgen location : ../pybindgen-0.21.0 (given)
Checking for python module 'pybindgen' : 0.21.0
Checking for pybindgen version : 0.21.0
Checking for code snippet : yes
Checking for types uint64_t and unsigned long equivalence : no
Checking for code snippet : no
Checking for types uint64_t and unsigned long long equivalence : yes
Checking for the apidefs that can be used for Python bindings : gcc-LP64
Checking for internal GCC cxxabi : complete
Checking for python module 'pygccxml' : not found
Checking for click location : not found
Checking for program 'pkg-config' : /usr/bin/pkg-config
Checking for 'gtk+-3.0' : yes
Checking for 'libxml-2.0' : yes
checking for uint128_t : not found
checking for __uint128_t : yes
Checking high precision implementation : 128-bit integer (default)
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for header sys/types.h : yes
Checking for header sys/stat.h : yes
Checking for header dirent.h : yes
Checking for header signal.h : yes
Checking for header pthread.h : yes
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for library rt : yes
Checking for header sys/ioctl.h : yes
Checking for header net/if.h : yes
Checking for header net/ethernet.h : yes
Checking for header linux/if_tun.h : yes
Checking for header netpacket/packet.h : yes
Checking for NSC location : not found
Checking for OpenFlow location : not found
Checking for 'sqlite3' : yes
Checking for header semaphore.h : yes
Checking for header linux/if_tun.h : yes
Checking for python module 'gi' : 3.26.1
Checking for python module 'gi.repository.GObject' : ok
Checking for python module 'cairo' : ok
Checking for python module 'pygraphviz' : 1.4rc1
Checking for python module 'gi.repository.Gtk' : ok
Checking for python module 'gi.repository.Gdk' : ok
Checking for python module 'gi.repository.Pango' : ok
Checking for python module 'gi.repository.GooCanvas' : ok
Checking for program 'sudo' : /usr/bin/sudo
Checking for program 'valgrind' : /usr/bin/valgrind
Checking for 'gsl' : yes
libgcrypt-config : not found
Checking for compilation flag -fstrict-aliasing support : ok
Checking for compilation flag -fstrict-aliasing support : ok
Checking for compilation flag -Wstrict-aliasing support : ok
Checking for compilation flag -Wstrict-aliasing support : ok
Checking for program 'doxygen' : /usr/bin/doxygen
---- Summary of optional NS-3 features:
Build profile : debug
Build directory :
BRITE Integration : not enabled (BRITE not enabled (see option --with-brite))
DES Metrics event collection : not enabled (defaults to disabled)
Emulation FdNetDevice : enabled
Examples : not enabled (defaults to disabled)
File descriptor NetDevice : enabled
GNU Scientific Library (GSL) : enabled
Gcrypt library : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore : enabled
MPI Support : not enabled (option --enable-mpi not selected)
NS-3 Click Integration : not enabled (nsclick not enabled (see option --with-nsclick))
NS-3 OpenFlow Integration : not enabled (OpenFlow not enabled (see option --with-openflow))
Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc))
PlanetLab FdNetDevice : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
`PyViz visualizer : enabled`
Python API Scanning Support : not enabled (Missing 'pygccxml' Python module)
Python Bindings : enabled
Real Time Simulator : enabled
SQLite stats support : enabled
Tap Bridge : enabled
Tap FdNetDevice : enabled
Tests : not enabled (defaults to disabled)
Threading Primitives : enabled
Use sudo to set suid bit : not enabled (option --enable-sudo not selected)
XmlIo : enabled
'configure' finished successfully (5.788s)
'clean' finished successfully (0.016s)

重点关注下列输出,涉及到能否支持Python。

Python API Scanning Support   : not enabled (Missing 'pygccxml' Python module)
Python Bindings : enabled
pip3 install pygccxml

cd ns-3.31
./waf --build-profile=debug --enable-examples --enable-test configure

pip3 install CastXML #安装好后,重启一下。

./test.py #问题解决了,继续安装
./waf --run hello-simulator # 验证是否安装成功

其它问题

 pip3 install PyBindGen

记一次ns3的安装过程的更多相关文章

  1. 与PHP5.3.5的战斗----记php5.3.5安装过程

    与PHP5.3.5的战斗----记php5.3.5安装过程 摘自:http://blog.csdn.net/lgg201/article/details/6125189这篇文章写的很是不错,,,也是我 ...

  2. Sublime Text 无法使用Package Control的解决方法 以及 常用的插件安装过程

    大概一个月之前给 Macbook air 装 Sublime Text 3 的时候,遇到过这个问题,当时解决了,现在回想,感觉忘的七七八八了,赶紧趁着还没有全忘光的时候记下来,当时的过程记得不一定准确 ...

  3. (转)linux下mysql的安装过程

    最近在linux安装了mysql,根据网上收集的资料和个人的操作过程,大概做了个整理,以便以后进行参考回顾. 1.下载mysql-5.1.36.tar.gz,并且解压. tar -xzvf mysql ...

  4. MySql 安装过程(摘自网络)

    下面的是MySQL安装的图解,用的可执行文件安装的,详细说明了一下! 打开下载的mysql安装文件mysql-5.0.27-win32.zip,双击解压缩, 运行“setup.exe”,出现如下界面 ...

  5. MySQL5.7.25(解压版)Windows下详细的安装过程

    大家好,我是浅墨竹染,以下是MySQL5.7.25(解压版)Windows下详细的安装过程 1.首先下载MySQL 推荐去官网上下载MySQL,如果不想找,那么下面就是: Windows32位地址:点 ...

  6. nginx+awstats安装过程

    awstats来来回回也装了好多遍了,每次都是现装现查,隐约的记得整个配置比较麻烦,中间有几个需要特别注意的地方,又记不得那些需要特殊对待,只能边找资料边回忆,最终还是搞出来了,在此分享给大家. 首先 ...

  7. Qt5.2+opencv2.4.9配置安装过程

    Qt5.2+Opencv2.4.9的安装与配置 安装环境 Win10系统 Qt5.2.0 Opencv2.4.9 1. 安装Qt5.2.0 安装在D:\Qt\5.2.0文件夹(记为A文件夹) Qt下载 ...

  8. Fedora 28 UEFI模式安装过程记录

    这次的折腾是个意外.不过还是要记录一下. 多次做启动盘,把U盘做坏了.将U盘用量产工具修复以后就能做启动盘了.从官网下了Fedora 28的镜像(与CentOS同属RedHat系,尽量与鸟哥一致),用 ...

  9. 【语音识别】Microsoft Speech Platform 自学笔记2 环境要求与安装过程

    笔记人:又吹风 时 间:2012/12/16 主要内容:Microsoft Speech Platform的环境要求与安装过程. 上次也说过了,当前Microsoft Speech Platform最 ...

随机推荐

  1. CentOS7.7 系统下 virbr0 虚拟网卡的维护与管理

    在 CentOS 7 系统的安装过程中,如果有选择相关虚拟化的的服务安装系统后,启动网卡时会发现有一个以网桥连接的私网地址的 virbr0 网卡,这个是因为在虚拟化中有使用到 libvirtd 服务生 ...

  2. 2018年10月份编程语言排行榜(来自TIOBE Index for October 2018)

    TIOBE Index for October 2018 from:https://www.tiobe.com/tiobe-index// October Headline: Swift is kno ...

  3. RHSA-2017:1931-中危: bash 安全和BUG修复更新(代码执行)

    [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 修复命令: 使用root账号登陆She ...

  4. How to install the NVIDIA drivers on Fedora 32

    https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-fedora-32 The NVIDIA Driver is a progra ...

  5. SQl编程存储过程

    过程化存储 存储过程,一组为完成特定功能.经过编译后存储在数据库中的SQL语序集 灵活性:存储过程中可以进行流程控制和循环操作来完成复杂的判断和运算 一致性:通过存储过程可以使一些关联的操作一起发生, ...

  6. 方格取数(简单版)+小烈送菜(不知道哪来的题)-----------奇怪的dp增加了!

    一.方格取数: 设有N*N的方格图(N<=20),我们将其中的某些方格中填入正整数,而其他的方格中则放入数字0. 某人从图的左上角的A(1,1) 点出发,可以向下行走,也可以向右走,直到到达右下 ...

  7. linux硬盘分区及挂载

    今天买的一台服务器发现其硬盘容量与购买界面的描述不符,于是我去问了客服才知道有一块硬盘需要自己挂载,所以记录自己硬盘分区以及挂载操作得此文. 测试环境 ​ 由于时间限制,本人仅在centos 8下测试 ...

  8. django—csrf中间件校验流程

    CSRF(跨站请求伪造)是一种挟制用户在当前已登录的Web应用程序上执行非本意的操作的攻击方法. 这利用了web中用户身份验证的一个漏洞:简单的身份验证只能保证请求发自某个用户的浏览器,却不能保证请求 ...

  9. vue学习第一部

    目录 基础操作 vue基础使用 步骤 vue的框架思想(mvvm) 显示数据 vue 常用指令 属性操作 事件绑定 操作样式 条件渲染指令 列表渲染指令 vue对象提供的属性功能 过滤器 计算和侦听属 ...

  10. 配置通过Console口登录交换机

    组网图形 图1 通过Console口登录交换机组网图 通过Console口登录交换机简介 通过Console口登录交换机是指使用专门的Console通信线缆将用户PC的串口与交换机的Console口相 ...