First, the installation of ns-3 is best not to use root permissions, ordinary users can install, or later to find files will be more trouble.
First, install dependent packages
Install the dependent packages first. According to the official website (Https://www.nsnam.org/wiki/Installation#CentOS) Given the command to install, many items, more cumbersome, including a few will have problems, solutions are listed. After you enter each command, empty a grid, plus "-y", you do not have to enter Y to confirm, you can install the article to do something else. In addition, if you feel that these commands are too many, you can also write a shell script, the direct implementation of all the more convenient. Each command is listed below:
yum install gcc-c++ python
Yum Install Python-devel
Yum Install Qt4-devel
Yum Install mercurial
Yum Install BZR
Yum Install CMake glibc-devel.i686glibc-devel.x86_64
And you'll want to install Gccxml Andpygccxml as per the instructions for Python bindings (or through thebake b Uild tool as described in thetutorial). "1"
installation Gccxml and the Pygccxml . First install cmake, from the Internet to find a tutorial installed. Then search gccxml, to the official website choose download link to git to download the compressed package, Extract (unzip) it out. Take note of the extracted directory, because it will be used later. Based on a tutorial on git,
Mkdirgccxml-build
Cdgccxml-build
CMake. /gccxml-dcmake_install_prefix:path=/installation/path
Make
Make install
when you execute the third article, you need to change the directory. For example, before extracting to the tmp folder, then enter cmake/tmp/gccxml-master .
install pygccxml : Search pygccxml git install There are two ways to choose the first one will be relatively simple. To install pip
Search Pip , in Pip Official Internet access installation link, download First Pip , and then enter python get-pip.py (Forget the need to add a path here, if there is a problem, add it, should be no need) is OK Pip up.
input Command pip Install Pygccxml , it's fine. Pygccxml up.
Yum Install Doxygen Graphviz ImageMagick
Yum Install Python-sphinx dia Texlivetexlive-latex
Yum Install Openmpi Openmpi-devel
Yum Install tcpdump Wireshark
Yum Install SQLite sqlite-devel
Yum Install LIBXML2 Libxml2-devel
Yum Install uncrustify " 2 "
I typed the command directly and I didn't succeed.Yumthe source or the file could not be found. Firstgo to Uncrustifythe website, click ConnectreleasedownloadsDownloaduncrustify(the suffix is. tar.gz), locate the downloaded file in your computer, and right-click here. again touncrustifythe website provides theGitHubconnection, according toReadmeinQuickStartoperation. The first of these instructions,./configureThe path of the file to download and unzip instead, such as/tmp/uncrustify-0.62/configure, you can.
Yum Install Boost-devel
Yum install Graphviz graphviz-develpython-setuptools-devel
sudo easy_install Pygraphviz
Some Additional packages is needed (Goocanvas and Pygoocanvas). It's suggested to enable the Rpmforge repo asdescribed here:http://wiki.centos.org/AdditionalResources/ Repositories/rpmforge. " 3 "
Open the URL, download rpmforge for CentOS 6 in the x86_64, install, after completing a few commands to enter the download page, generally do not error
Then, try this:
Yum install Goocanvas pygtk2-devel
Then obtain the RPM for Pygoocanvas andpygoocanvas-devel from here: http://li.nux.ro/download/nux/dextop/el6/x86_64 /
rpm-ivhpygoocanvas-0.14.1-3.el6.nux.x86_64.rpm
rpm-ivhpygoocanvas-devel-0.14.1-3.el6.nux.x86_64.rpm " 4 "
Open the URL to find pygoocanvas-0.14.1-3.el6.nux.x86_64.rpm and the pygoocanvas-devel-0.14.1-3.el6.nux.x86_64.rpm download and then execute the two commands above. Note that these two commands are not complete and need to be accompanied by a file path. such as downloading (and then moving) to the tmp folder, you will enter rpm-ivh/tmp/pygoocanvas-0.14.1-3.el6.nux.x86_64.rpm
However, I will make an error when these two commands are executed. So I chose to search the internet for Pygoocanvas and pygoocanvas-devel Two The latest version, download and then execute two commands, as if the installation succeeded ...
yum install git
yum install GSL gsl-devel
Yum Install gtk2 Gtk2-devel
Yum Install gdb Valgrind
At this point, the dependent software installation is complete, and then enter the official installation of ns-3.
Second, download and compile the installation ns-3
The following information is based on the official website and may vary.
Open the official website (https://www.nsnam.org/docs/release/3.24/tutorial/html/getting-started.html#downloading-ns3), See there are two ways to download, the first is relatively simple, here the first example.
Cd
mkdir Workspace
CD Workspace
wgethttp://www.nsnam.org/release/ns-allinone-3.24.tar.bz2
TARXJF ns-allinone-3.24.tar.bz2
Enter the above command in turn, depending on the speed and other times will be different.
Then there are two types of compilation and installation. Select Building with build.py. According to the official website, enter the command ./build.py--enable-examples–enable-tests, Note that at this point the command is in the ns-allinone-3.24 directory .
And then it was a long wait. Finally, if it goes smoothly, it will be roughly the same as the official website.
Some people may use the first installation method does not work, then uses the WAF compiles the way, according to the tutorial, is not very troublesome.
Third, testing
The ./test.py-ccore and ./waf--runhello-simulator commands are available according to the official website, but be aware of the position at this point, For example, the second command is entered in the terminal to enter the ns-3.24 directory.
Ns-3 Installation Tutorials under CentOS