Installing Ubuntu11.04 is only a simple step. The installation of NS2. According to the instructions on the internet, it seems that it is very easy to install NS2. only decompression and installation can be successful, but the fact is that due to the high version I downloaded, many files are not updated accordingly, during installation, you must manually modify the file. 1. Update Ubuntu system files. Although the system is in the latest version, it does not mean that all files in Ubuntu are up-to-date and need to be updated. Open the Ubuntu terminal and enter the sudoap command in sequence.
Installing the Ubuntu 11.04 operating system is only a simple step. The installation of NS2.
According to the instructions on the internet, it seems that it is very easy to install NS2. only decompression and installation can be successful, but the fact is that due to the high version I downloaded, many files are not updated accordingly, during installation, you must manually modify the file.
1. Update Ubuntu system files. Although the system is in the latest version, it does not mean that all files in Ubuntu are up-to-date and need to be updated.
Open the Ubuntu terminal and enter commands in sequence.
Sudo apt-get update
Sudo apt-get upgrade
Sudo apt-get dist-upgrade
You can. When sudo is used for the first time, the user password is required, that is, it is set when ubuntu is installed.
2. To better install NS2. you also need to install some packages, open the terminal, and enter
Sudo apt-get install build-essential
Sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
Sudo apt-get install libxmu-dev libxmu-headers
3.
Tar xvfz ns-allinone-2.34.tar.gz
Cd/home/yourfiles/ns-allinone-2.34
./Install
4. Two problems may occur during the above installation, resulting in the failure of the NS2. this is also the case in previous versions. You need to manually modify some files for both issues.
Problem 1: After the above installation is complete, tcl8.4.18 make failed will appear! Exiting! The search solution is as follows,
Cd/home/yourfiles/ns-allinone-2.34
Cd otcl-1.13
Sudo geditconfigure. in
In the pop-up window, change SHLIB_LD = "ld-shared" in the 77 rows to SHLIB_LD = "gcc-shared" and save and exit.
Sudo geditconfigure
In the dialog box that appears, change SHLIB_LD = "ld-shared" to SHLIB_LD = "gcc-shared" and save and exit.
Problem 2: mobile/nakagami occurs. cc: 183: 73: error: cannot callconstructor mobile/nakagami. cc: 185: 67: error: for a function-style cast, remove the redundant ': GammaRandomVariable'
Make: *** [mobile/nakagami. o,
Cd/home/yourfiles/ns-allinone-2.34
Cd ns-2.34
Sudo gedittools finds row 219 in the pop-up window and deletes: GammaRandomVariable
Sudo geditmobile finds row 183 in the pop-up window file, deletes: ErlangRandomVariable, finds row 185, and deletes: GammaRandomVariable
5. Now, run the./install command again to install NS2. in this case, you need to set the path of the environment variable.
Sudo gedit. bashrc
Enter
ExportPATH = $ PATH:/home/yourfile/ns-allinone-2.34/bin:/home/yourfile/ns-allinone-2.34/tcl8.4.18/unix:/home/yourfile/ns-allinone-2.34/tk8.4.18/unix
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/home/yourfile/ns-allinone-2.34/otcl-1.13:/home/yourfile/ns-allinone-2.34/lib
ExportTCL_LIBRARY = $ TCL_LIBRARY:/home/yourfile/ns-alllinone-2.34/tcl8.4.18/library
6. Close the Ubuntu terminal, open it again, and enter ns. The command prompt is displayed, that is, NS2.
Sudo apt-get install NS2. Enter ns again, and "%" appears, indicating that the installation is successful.
7. install auxiliary software commands such as nam sudo apt-get install nam
8. Run sudo apt-get autoremove nam to uninstall the software.