有问题可看看官网的依赖环境链接<很重要>

Ubuntu/Debian/Mint
The following list of packages should be accurate through the Ubuntu 21.04 release; other releases or other Debian-based systems may slightly vary. Ubuntu 16.04 LTS release is probably the oldest release that is known to work with the most recent ns-3 releases.

Note: As of ns-3.30 release (August 2019), ns-3 uses Python 3 by default, but earlier releases depend on Python 2 packages, and at least a Python 2 interpreter is recommended. If working with an earlier release, one may in general substitute ‘python’ for ‘python3’ in the below (e.g. install ‘python-dev’ instead of ‘python3-dev’).

minimal requirements for C++ users (release 3.35 and earlier): This is the minimal set of packages needed to run ns-3 from a released tarball.

 apt install g++ python3

Note: As of January 2022 (ns-3.36 release and ns-3-dev), the minimum g++ version is g+±8. Older Ubuntu releases (18.04, 16.04) come with an older default g++. On Ubuntu 18.04, this StackOverflow answer can be followed to install and prefer g+±8: https://askubuntu.com/a/1028656. On older Ubuntu such as 16.04, to use the most recent code, you must install g+±8 or g+±9 from the Ubuntu toolchain:

https://launchpad.net/%7Eubuntu-toolchain-r/+archive/ubuntu/test

minimal requirements for C++ users (release 3.36 and development): For ns-3-dev and ns-3.36 (and later) releases, CMake is also needed.
apt install g++ python3 cmake
minimal requirements for Python API users (release 3.30 and newer, and ns-3-dev): This is the minimal set of packages needed to work with Python bindings from a released tarball.
apt install g++ python3 python3-dev pkg-config sqlite3 cmake
additional minimal requirements for Python (development): For use of ns-3-allinone repository (cloned from Git), additional packages are needed to fetch and successfully install pybindgen and netanim.
apt install python3-setuptools git
Netanim animator: qt5 development tools are needed for Netanim animator; qt4 will also work but we have migrated to qt5.
apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
Note: For Ubuntu 20.10 and earlier, the single ‘qt5-default’ package suffices

apt install qt5-default
Support for ns-3-pyviz visualizer
For Ubuntu 18.04 and later, python-pygoocanvas is no longer provided. The ns-3.29 release and later upgrades the support to GTK+ version 3, and requires these packages:
apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3
For ns-3.28 and earlier releases, PyViz is based on GTK+ 2, GooCanvas, and GraphViz:
apt install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev ipython
Support for MPI-based distributed emulation
apt install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
Support for bake build tool:
apt install autoconf cvs bzr unrar
Debugging:
apt install gdb valgrind
Support for utils/check-style.py code style check program
apt install uncrustify
Doxygen and related inline documentation:

apt install doxygen graphviz imagemagick
apt install texlive texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng latexmk

If you get an error such as ‘convert … not authorized source-temp/figures/lena-dual-stripe.eps’, see this post about editing ImageMagick’s security policy configuration: https://cromwell-intl.com/open-source/pdf-not-authorized.html. In brief, you will want to make this kind of change to ImageMagick security policy:

 --- ImageMagick-6/policy.xml.bak    2020-04-28 21:10:08.564613444 -0700+++ ImageMagick-6/policy.xml  2020-04-28 21:10:29.413438798 -0700@@ -87,10 +87,10 @@<policy domain="path" rights="none" pattern="@*"/>-  <policy domain="coder" rights="none" pattern="PS" />+  <policy domain="coder" rights="read|write" pattern="PS" /><policy domain="coder" rights="none" pattern="PS2" /><policy domain="coder" rights="none" pattern="PS3" /><policy domain="coder" rights="none" pattern="EPS" />-  <policy domain="coder" rights="none" pattern="PDF" />+  <policy domain="coder" rights="read|write" pattern="PDF" /><policy domain="coder" rights="none" pattern="XPS" /></policymap>

The ns-3 manual and tutorial are written in reStructuredText for Sphinx (doc/tutorial, doc/manual, doc/models), and figures typically in dia (also needs the texlive packages above):
apt install python3-sphinx dia
Note: Sphinx version >= 1.12 required for ns-3.15. To check your version, type “sphinx-build”. To fetch this package alone, outside of the Ubuntu package system, try “sudo easy_install -U Sphinx”.

GNU Scientific Library (GSL) support for more accurate 802.11b WiFi error models (not needed for OFDM):
apt install gsl-bin libgsl-dev libgslcblas0
If the above doesn’t work (doesn’t detect GSL on the system), consult: https://coral.ise.lehigh.edu/jild13/2016/07/11/hello/. But don't worry if you are not using 802.11b models.

To read pcap packet traces
apt install tcpdump
Database support for statistics framework
apt install sqlite sqlite3 libsqlite3-dev
Xml-based version of the config store (requires libxml2 >= version 2.7)
apt install libxml2 libxml2-dev
Support for generating modified python bindings
apt install cmake libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip
python3 -m pip install --user cxxfilt
and you will want to install castxml and pygccxml as per the instructions for python bindings (or through the bake build tool as described in the tutorial). The ‘castxml’ and ‘pygccxml’ packages provided by Ubuntu 18.04 and earlier are not recommended; a source build (coordinated via bake) is recommended. If you plan to work with bindings or rescan them for any ns-3 C++ changes you might make, please read the chapter in the manual on this topic.

Note: Ubuntu versions (through 19.04) and systems based on it (e.g. Linux Mint 18) default to an old version of clang and llvm (3.8), when simply ‘libclang-dev’ and ‘llvm-dev’ are specified. The packaging on these 3.8 versions is broken. Users of Ubuntu will want to explicitly install a newer version by specifying ‘libclang-6.0-dev’ and ‘llvm-6.0-dev’. Other versions newer than 6.0 may work (not tested).

A GTK-based configuration system
apt install libgtk-3-dev
To experiment with virtual machines and ns-3
apt install vtun lxc uml-utilities
Support for openflow module (requires libxml2-dev if not installed above) and Boost development libraries
apt install libxml2 libxml2-dev libboost-all-dev

# run: yes|sh bash.sh
apt install gsl-bin libgsl-dev libgslcblas0
apt install tcpdump
apt install sqlite sqlite3 libsqlite3-dev
apt install libxml2 libxml2-dev
apt install cmake libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pipapt install libgtk-3-dev
apt install vtun lxc uml-utilities
apt install libxml2 libxml2-dev libboost-all-dev
apt install doxygen graphviz imagemagick
apt install texlive texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng latexmk
apt install python3-sphinx dia
apt install gdb valgrind
apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 install g++ python3
apt install g++ python3 cmake g++ python3 python3-dev pkg-config sqlite3 cmake  python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools install qt5-default
python3 -m pip install --user cxxfilt

run yes|sh bash.sh

./build.py  --enable-examples --enable-tests --python=/usr/bin/python --with-pybindgen=/home/dell/ns-allinone-3.36.1/pybindgen-0.22.1
cd ns3
./waf
./test.py -c core

reconfigure

cd ns3
./waf  configure --enable-examples --enable-test --with-pybindgen=/home/dell/ns-allinone-3.36.1/pybindgen-0.22.1
./waf

Ubuntu中安装ns3相关推荐

  1. Ubuntu中安装docker-compose

    安装最新Docker社区版请看博客<Ubuntu中安装最新Docker社区版> Compose是用于定义和运行多容器Docker应用程序的工具.通过Compose,我们可以使用YAML文件 ...

  2. abp 打包部署到ubuntu_如何在Ubuntu中安装Docker和运行 Docker容器

    Docker是一种开源且流行的操作系统级虚拟化(俗称"容器化")技术,主要在Linux和Windows上运行. Docker使用容器可以更轻松地创建,部署和运行应用程序. 使用容器 ...

  3. ubuntu安装matlab2009,Ubuntu中安装Matlab2010a

    Ubuntu中安装Matlab2010a 一.前言: 相信大家对于Matlab应该很熟悉吧,我就不多做介绍了. 对于如何在Ubuntu中安装Matlab很多人都不懂,大家都是新手,可以理解.我自己本身 ...

  4. unbantu上python安装步骤_如何在Ubuntu中安装Python 3.6?

    Python是增长最快的主要通用编程语言.原因有很多,比如它的可读性和灵活性,易于学习和使用,可靠和高效. 有两个主要的Python版本被使用- 2和3 (Python的现在和未来);前者将看不到新的 ...

  5. Ubuntu中安装Eclipse的SVN插件——subclipse

    Ubuntu中安装Eclipse的SVN插件--subclipse (2010-07-01 18:38) 分类: Linux 安装好Eclipse以后 进入菜单Help->Install new ...

  6. samba服务器新建文件权限,Ubuntu中安装samba服务器创建文件共享的方法及普通用户设置共享的问题解析...

    Ubuntu中安装samba服务器创建文件共享的方法及普通用户设置共享的问题解析 发布时间:2011-01-04 19:10:00   作者:佚名   我要评论 本文是基于ubuntu桌面版进行操作说 ...

  7. labview linux 内核 不匹配,Linux CentOS7(或Ubuntu)中安装NI-VISA后一打开范例Simple Serial.vi就闪退,LabVIEW就崩溃。...

    Linux CentOS7(或Ubuntu)中安装NI-VISA后一打开范例Simple Serial.vi就闪退,LabVIEW就崩溃. 我安装了LabVIEW pro 2017 for Linux ...

  8. 在Ubuntu中安装MySQL (转载)

    MySQL在Linux Ubuntu中安装 本文使用的Linux是Ubuntu 12.04.2 LTS 64bit的系统,安装MySQL数据库软件包可以通过apt-get实现. 在Linux Ubun ...

  9. Ubuntu: Ubuntu中安装使用Source Inside 3.5

    Ubuntu: Ubuntu中安装使用Source Inside 3.5 1. 安装wine $ sudo apt-get install wine 2. 安装Source Inside 3.5 $ ...

  10. 如何在 Ubuntu 中安装和删除软件

    文章目录 1.Ubuntu Software 1.1.使用Ubuntu软件中心安装软件[推荐] 1.2.使用Ubuntu软件中心删除软件[推荐] 2..deb 文件 2.1.使用 .deb 文件在 U ...

最新文章

  1. AI做不了“真”3D图像?试试Google的新生成模型
  2. 基于TensorFlow理解三大降维技术:PCA、t-SNE 和自编码器
  3. Shell脚本中的并发
  4. python循环输入若干学生信息保存到字典、并按学号排序,Python实现按学生年龄排序的实际问题详解...
  5. python3 并行计算_Python-并行计算
  6. 生活的花环:看雷加对文学的回顾
  7. NodeJS常用模块介绍
  8. com.alibaba.easyexcel导出指定的列_使用Python导入导出Excel表格
  9. java递归优化_在Java中谈尾递归--尾递归和垃圾回收的比较
  10. 斗拱展开面积表_144996_河南省仿古建筑工程计价综合单价2009
  11. elk-可视化图标(nginx)
  12. Python发送邮件(Email SMTP)
  13. 关于nginx性能优化CPU参数worker_cpu_affinity使用说明
  14. ubuntu20.x安装 podman
  15. 英伟达TX2烧录系统_英伟达秀全球最大GPU,黄仁勋从烤箱里拿出的产品果然爆了...
  16. 如何让素数分列C语言,哥德巴赫猜想栾生三生素数无限波林那克猜想两素数差证明,(定稿...
  17. ES的索引(倒排索引),文档,查询
  18. 老版人人商城提示“百度未授权地图API”
  19. btc、usdt 根据交易hash计算手续费
  20. Set? set和Set set的区别?

热门文章

  1. 智慧消防:如何利用智能化手段,精准防控消防风险?
  2. cocos2dx基础篇(10)——编辑框之一CCTextFieldTTF
  3. 《赛灵思中国通讯》学习记录第1期:为何使用Zynq SoC可以让企业产品利润激增
  4. 分布式系统互斥算法---令牌环算法
  5. 华为交换机冗余链路(VRRP)和vlan负载均衡
  6. ActiveMQ系列(四)ActiveMQ核心功能持久化、事务、签收
  7. 智能汽车路径规划-曲线插值法、人工势场法
  8. 疯狂java讲义 如何_[java学习]《疯狂java讲义》
  9. 《安富莱嵌入式周报》第228期:2021.08.30--2021.09.05
  10. 完成端口IOCP详解