ns3安装起来比较复杂,自己装了两天写了这个简明的安装教程:
1.下载并安装cygwin:http://cygwin.com/install.html
2.下载并安装python:http://www.python.org/download/
注:安装python不要更改安装目录,如果更改,在windows中注册环境变量。可以在cygwin中用which python命令来查阅是否安装好了python
3.下载并安装mercurial:http://mercurial.selenic.com/release/windows/
注:并不需要安装tortoisehg.tortoisehg是mercurial的一个图形界面,mercurial简称hg,非常亲切的,我用过tortoiseSVN。
4.在cygwin下的安装目录下新建一个文件夹repos,路径是C:\cygwin\home\用户名\repos,输入:
cdmkdir reposcd reposhg clone http://code.nsnam.org/ns-3-allinone
destination directory: ns-3-allinonerequesting all changesadding changesetsadding manifestsadding file changesadded 31 changesets with 45 changes to 7 files7 files updated, 0 files merged, 0 files removed, 0 files unresolved
build.py*constants.pydist.py*download.py*README util.py
./download.py -n ns-3-dev -r ns-3-dev-ref-traces
./download.py
## Get NS-3#Cloning ns-3 branch=> hg clone http://code.nsnam.org/ns-3-dev ns-3-devrequesting all changesadding changesetsadding manifestsadding file changesChapter 3: Getting Started 8added 4634 changesets with 16500 changes to 1762 files870 files updated, 0 files merged, 0 files removed, 0 files unresolved
## Get the regression traces#Synchronizing reference traces using Mercurial.=> hg clone http://code.nsnam.org/ns-3-dev-ref-traces ns-3-dev-ref-tracesrequesting all changesadding changesetsadding manifestsadding file changesadded 86 changesets with 1178 changes to 259 files208 files updated, 0 files merged, 0 files removed, 0 files unresolved
## Get PyBindGen#Required pybindgen version: 0.10.0.640Trying to fetch pybindgen; this will fail if no network connection is available. Hit Ctrl-=> bzr checkout -rrevno:640 https://launchpad.net/pybindgen pybindgenFetch was successful.
## Get NSC#Required NSC version: nsc-0.5.0Retrieving nsc from https://secure.wand.net.nz/mercurial/nsc=> hg clone https://secure.wand.net.nz/mercurial/nsc nscrequesting all changesadding changesetsadding manifestsadding file changesadded 273 changesets with 17565 changes to 15175 files10622 files updated, 0 files merged, 0 files removed, 0 files unresolved
build.py* constants.pyc download.py* ns-3-dev-ref-traces/ pybindgen/ util.pyconstants.py dist.py* ns-3-dev/ nsc/ README util.pyc
AUTHORS examples/ regression/ scratch/ waf*bindings/ LICENSE regression.py src/ waf.bat*CHANGES.html ns3/ RELEASE_NOTES utils/ wscriptdoc/ README samples/ VERSION wutils.py
6.同样的,下面的教程使用命令行进行build,而我直接双击运行了build.py
./build.py
Waf: Leaving directory ‘/home/craigdo/repos/ns-3-allinone/ns-3-dev/build’’build’ finished successfully (2m30.586s)
cd ns-3-dev
参考文献:
【1】步骤2和3参考http://mercurial.selenic.com/wiki/WindowsInstall
【2】步骤1、4、5、6参考自http://yangfei1.blog.51cto.com/1471532/368586、http://yangfei1.blog.51cto.com/1471532/368585