Steps to install ns-2 in ubuntu
copy ns folder into usr/local
goto cd /usr/local/ns-allinone-2.34/otcl-1.13
run sudo ./configure
change the red highlight
Linux*) SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -shared" +
SHLIB_LD="gcc -shared" SHLIB_SUFFIX=".so" DL_LIBS="-ldl" SHLD_FLAGS=""
set the path and write sudo ./install
open cat ~/.bashrc and the lines from#LD_LIBRARY_PATH...............$NAM
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
#LD_LIBRARY_PATH
OTCL_LIB=/usr/local/ns-allinone-2.34/otcl-1.13
NS_LIB=/usr/local/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRAR_PATH=$LD_LIBRARY_PATH:$OTCL_LIB;$NS_LIB:$X11_LIB:$USR_LOCAL_LIB
TCL_LIB=/usr/local/ns-allinone-2.34/TCL8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB;$USR_LIB
XGRAPH=/usr/local/ns-allinone-2.34/bin:/usr/local/ns-allinone-2.34/tcl8.4.18/unix:/usr/local/ns-allinone-2.34/tk8.4.18/unix
NS=/usr/local/ns-allinone-2.34/ns-2.34/
NAM=/usr/local/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$xGRAPH:$NS:$NAM