Ubuntu 10.04.3 :
sudo apt-get install g++-4.1
------------------------------------------------------------------
tar -xzvf ns-allinone-2.33.tar.gz
------------------------------------------------------------------
cd ns-allinone-2.33/tk8.4.18/
wget ftp://ftp.swin.edu.au/gentoo-portage/dev-lang/tk/files/tk-8.4-lastevent.patch
------------------------------------------------------------------
The program 'patch' is currently not installed. You can install it by typing:
sudo apt-get install patch
------------------------------------------------------------------
&& patch -p0 < tk-8.4-lastevent.patch
&& cd ../ && export CC=gcc-4.1 CXX=g++-4.1
######################################
sudo apt-get install autoconf automake libxmu-dev
######################################
&& ./install
########################################
sudo gedit ~/.bashrc
------------------------------------------------------------------
Add these lines to your bashrc file. Replace “your directory” with the installation directory of your ns2 program.
############# NS2 ##########################################
#environment values for NS2/NAM
# LD_LIBRARY_PATH
OTCL_LIB=/home/ns2/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/ns2/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/ns2/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/ns2/ns-allinone-2.33/bin:/home/ns2/ns-allinone-2.33/tcl8.4.18/unix:/home/ns2/ns-allinone-2.33/tk8.4.18/unix
NS=/home/ns2/ns-allinone-2.33/ns-2.33/
NAM=/home/ns2/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
#########################################################
------------------------------------------------------
source ~/.bashrc
########################################
&& cd ns-2.33/ && mv ns ns233
&& make clean
&& mv Makefile Makefile.org
---------------------------------------------------------------------------------
sudo apt-get install subversion
--------------------------------------------------------------------------------
&& svn checkout http://lte-model.googlecode.com/svn/trunk/ lte-model-read-only && mkdir project && cd lte-model-read-only/
&& sh checkin
&& cd ../project/
&& ln -s ../lte-model-read-only/*.h .
-------------------------------------------------------------------------
.... Where the period ( . ) means the current directory.
-------------------------------------------------------------------------
&& ln -s ../lte-model-read-only/dlqueue.cc && cd ../
Edit the new Makefile in ns-allinone-2.33/ns-2.33/ , lines 41, 67, 82 to actual location. ( I.e all : /root/ns-allinone.... to : <your-path>/ns-allinone.... ).( 8 times edit.) ... And lines 36 - 37 to : CC = gcc-4.1 CPP = g++-4.1
... And now you can run make in ns-allinone-2.33/ns-2.33/
, and hopfully get a workable 'ns' ( ns works OK here.) ( Better make a backup : cp ns ns-LTE ). .
-------------------------------------------------------------------------
After that, use this command to list installed gcc in your Ubuntu:
ls /usr/bin/gcc*
and use this command to check which is default:
gcc -v
-------------------------------------------------------------------------
sudo gedit /etc/apt/sources.list
deb http://mirrors.us.kernel.org/ubuntu/ lucid main universe
sudo apt-get update
-------------------------------------------------------------------------
sudo apt-get install openssh-server