For the NS2 case, the most relevant is the Gcc compiler. Installing the latest version
of ns-2 (ns-2.33) with gcc 4.1.2 is not difficult at all because the source code has mapped to the current gcc configuration. Even though there is a small bug in ./configure of tk, tcl, otcl, less attempt has been done compare to the older version. You can't compile ns-2.27 (and 2.26 too) with gcc3.4.2, even with new versions of linux distributions. There is Error of "tclcl make failed".
The old version such as ns-2.26 will not work with current gcc 4.1.2. So we’ve to install the gcc-2.95.
HOW-TO:
1. Download the all-in-one package of ns-2 and unzip it:OR by command line, do following
cd to home directory and type:
wget http://www.isi.edu/nsnam/dist/ns-allinone-2.26.tar.gz;
tar -xzvf ns-allinone-2.26.tar.gz;
2. install the following Debian packages:
- apt-get install gcc-2.95
- apt-get install g++-2.95
- apt-get install libstdc++2.10-glibc2.2
- apt-get install libx11-dev
- apt-get install libxt-dev
need changed to:
That is, the second to last character (') needs to be deleted. In ns-allinone-2.26, this occurs in four places (files and line numbers):
./tcl8.3.2/unix/configure:5705
./tk8.3.2/unix/configure:1520
./otcl-1.0a8/configure:4167
4. Set your compiler environment variables in the terminal in which you will run the install script such that they point to the 2.95 version of the tools instead of the default ones. In the C shell:
setenv CPP /usr/bin/cpp-2.95;
setenv CXX /usr/bin/g++-2.95;
Use the paths appropriate for your system. If you use the bash shell, the general form for setting an environment variable is:
Now, the configure scripts will use these versions of the compiler tools.
5. When compiling the TCL/C++ interface (e.g., tclcl-1.0b13), I received a warning that stopped the compilation that line 193 of /usr/include/sys/types.h does not declare anything. Though this is not generally recommended, I used the -fpermissive option for the compiler to continue compilation.
In the file /usr/local/dload/ns-allinone-2.26/tclcl-1.0b13/Makefile.in, I changed the CCOPT parameter on line 56 to be:
6. At this point, I just had to run the install script an everything compiled (with lots of warnings) except for nam which I didn’t need since I don’t use the visualization tools in ns-2.
(Make sure you run this in the terminal in which the CC, CPP, and CXX variables are set appropriately)
7. Now, to get your existing ns-2 code to compile (i.e., the code in /usr/local/ns-2.26), you need to reconfigure your Makefile by specifying the new paths:
Note that this will overwrite your existing Makefile, so if there was anything specific that you needed in it, you should move those commands to the Makefile.in file in /usr/local/ns-2.26.
....Now successful to install old version...
3 comments:
Hi Rajeev,
Is the same procedure works for ns2.1b9a? I tried to install ns2.1b9a (for now I am trying under cygwin), but I couldn't install. Thanks.
One alternative way to install ns2.19a is that first, you have to install any higher version of ns2, secondly, you need to replace ns2.XX directory with ns2.19a directory, thirdly, you need to make some change into "install" file inside ns-allinone.xx directory as change version number from ns2.xx to ns2.19. Finally compile with ./install command and see changes according to this new build. I'm sure that you can build successfully at last after minor changes. The above procedure works only for linux-OS not for using cygwin.
DEAR SIR ,
my project on ns2 and how to plot the xgraph and how to plot graph by using trace file in excel ... plz reply
ankitgehalot16@gmail.com
Post a Comment