Ubuntu 16--installs--ns2.35 and Nam

Source: Internet
Author: User

  

Ubuntu 16.04 Installation Ns2.35+nam


Summarize the following installation steps

1: Update source
sudo apt-get update #更新源列表
sudo apt-get upgrade #更新已经安装的包
sudo apt-get dist-upgrade #更新软件, upgrade system
2: Install the NS2 required package
sudo apt-get install build-essential
sudo apt-get install tcl8.5 tcl8.5-dev tk8.5 tk8.5-dev #for tcl and TK
sudo apt-get install Libxmu-dev libxmu-headers #for nam
3: Download the installation package and install the official website: http://www.isi.edu/nsnam/ns/, download here ALLinONE

Tar Xvfz ns-allinone-2.35.tar.gz
CD ns-allinone-2.35
sudo./install #进行安装


First time installation Error:
Linkstate/ls.h:137:20:note:use ' This->erase ' instead
Make: * [LINKSTATE/LS.O] Error 1 Ns make failed!

Modify LS file: ns-2.35/linkstate/ls.h
Line 137th
void Eraseall () {Erase (Basemap::begin (), Basemap::end ());}

instead: void Eraseall () {this->erase (Basemap::begin (), Basemap::end ());}

After saving sudo./install #重新安装顺利完成

4: Configure Environment variables
Modify the current User environment variable (the corresponding file is the. BASHRC in the '/home/username '), not the blank under '/ns-allinone-2.35 '. BASHRC)

Gedit ~/.BASHRC or Vim ~/.BASHRC

Add at the end of the file
/# Add path for NS2

Export path= "$PATH:/home/installation folder name/ns-allinone-2.35/bin:/home/installation folder name/ns-allinone-2.35/tcl8.5.10/unix:/home/installation folder name/ Ns-allinone-2.35/tk8.5.10/unix "
Export ld_library_path= "$LD _library_path:/home/installation folder name/ns-allinone-2.35/otcl-1.14:/home/installation folder name/ns-allinone-2.35/ Lib
Export tcl_library= "$TCL _library:/home/installation folder name/ns-allinone-2.35/tcl8.5.10/library"
5: Verify that the NS2 installation is successful
Shut down terminal, restart Terminal, enter NS, show%, NS2 installation succeeded
    Note: If the environment variable is wrong, you will be prompted

The program "NS" is not installed. You can use the following command to install:
sudo apt-get install ns2 "
Do not install through this command, or go back to STEP4 to modify the environment variables!
6: Mount Nam
Enter NAM directory: CD ns-allinone-2.35/nam-1.15
Enter after Sudo./configure, and then sudo make

Note that there will be an error here
Tip for "installation of TCL seems incomplete or can ' t be found automatically" and other words
Workaround:
sudo./configure–with-tcl=/home/User Directory/File storage directory/ns-allinone-2.35/tcl8.5.10–with-tcl-ver=8.5.10–with-tk=/home/user Directory/ File storage Directory/ns-allinone-2.35/tk8.5.10–with-tk-ver=8.5.10
Last sudo make install


Command line Input Nam Eject Nam console instructions Nam installation succeeded.

Note: If NAM is installed through the "sudo apt-get install Nam", the NAM command will report an exception
"Segment error, core file has been dumped"
Users who encounter this problem can "sudo apt-get remove–purge nam" Uninstall Nam and configure it after pressing 6 to install.

7: Test SIMPLE.TCL
CD ns-allinone-2.35/ns-2.35/tcl/ex/
NS SIMPLE.TCL

Show the experimental diagram is all installed successfully!

Ubuntu 16--Install--ns2.35 and Nam

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.