2.1.1. NS2 Installation on Ubuntu 1804¶
I’m going to choose all-in-one package. I list the problems I encountered while installing and my solution.
2.1.1.1. Reference Websites¶
2.1.1.2. General Instruction¶
Download the source code tarball
Untar and then execute
./install
2.1.1.3. FAQ¶
2.1.1.3.1. “Can’t find X includes” while compiling¶
Install xorg
apt-get install xorg-dev
2.1.1.3.2. recipe for target ‘mdart/mdart_adp.o’ failed¶
ns2 can be compiled with a “no PIE” g++ version 4.4 .. 5.4 , no later.
Solution for Ubuntu 18.04 :
sudo apt install g++-4.8
export CC=gcc-4.8 CXX=g++-4.8 && ./install
2.1.1.3.3. recipe for target ‘linkstate/ls.o’ failed¶
change following line in ns-2.35/linkstate/ls.h file.
Line No.: 138 Change
void eraseAll() {erase(baseMap::begin(), baseMap::end()); }
With
void eraseAll() { baseMap::erase(baseMap::begin(), baseMap::end()); }
and run ./install from all-in-one folder.
2.1.1.4. Post Installation¶
Pay attention to the final description about PATH, LD_LIBRARY, TCL_LIBRARY. Modify your .bash_profile as instructed.