NS2 Installation Method

Source: Internet
Author: User

Regarding the installation method of NS2, there is a lot of information on the network now. However, there are still many things not to be able to understand, here I do some additions. Here I do not teach you how to install, only to clarify its installation mechanism.

First, download the installation file directly, and then execute "./install" in its directory after decompression. After the installation there will be a need to change into the variable note, can not ignore him. A "%" prompt appears after executing "./ns" in the installation directory, indicating that the installation was successful.

The installation of NS2 does not install the program into the/sur directory like any other software, but installs it directly under your Unzip folder, and the/bin in the Unpacked folder after the installation is complete contains all the execution files.
Note on environment variables
Because the NS2 installation is essentially just under its folder, it does not make any modifications to the system. Therefore, we can only execute the "ns" command in the installation directory after the installation is complete. To execute the command in any directory, we need to modify the system.

This note asks us to set the environment variables as follows:
#:gedit ~/.BASHRC
BASHRC This file is a hidden file in the "/root/" directory.
Add the following content:
#added by back1860 for NS2
Path= $PATH:/usr/share/ns-allinone-2.34/bin:/usr/share/ns-allinone-2.34/tcl8.4.18/unix:/usr/share/ Ns-allinone-2.34/tk8.4.18/unix
Ld_library_path= $LD _library_path:/usr/share/ns-allinone-2.34/otcl-1.13:/usr/share/ns-allinone-2.34/lib
tcl_library= $TCL _library:/usr/share/ns-allinone-2.34/tcl8.4.18/library
#added ends
About this note requires changes to change the variable, the personal feel in the distribution installation is more important, in this case, because Tcl and NS2 are compiled separately, NS2 do not know the installation location of TCL, in need to call Tcl is bound to directly use the system environment variables in the command. So we need to put it in the variable set. However, in the case of "ALLinONE", both compile and install at the same time, NS2 can find the required TCL command at the specified location. Therefore, the modification of environment variables is still not important. Of course, when you want to use TCL alone, its environment variables are still set.


For this reason, we can also copy the files under the "Bin" folder under the installation directory (the one under which the command is executed) directly under "/bin", regardless of the environment variables.

At the same time, we can install multiple versions of NS2 at the same time, since the installation of NS2 is only done in its unpacked directory. Without fear of conflict.

       NS2 Delete, it is possible to delete the installation directory and the link in "/bin" directly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.