NS-2 wiki
http://nsnam.isi.edu/nsnam/index.php
NS-3 wiki
http://www.nsnam.org/wiki/index.php
NS-2はOTCLと結合することに対して、NS-3はPythonと結合するか、完全にC++でやるかのどっちですね
まぁ、今はNS-2だけでも精一杯で、時間があればNS-3の移行に目を移す
sudo apt-get update sudo apt-get install build-essential xorg-dev libpcap-dev libtool gcc g++ xgraph |
wget http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz/download |
tar zxvf ns-allinone-2.34.tar.gz |
rm -rf xgraph-12.1 |
gedit install |
============================================================ * Build OTcl-1.13 ============================================================ No .configure file found in current directory Continuing with default options... checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for string.h... (cached) yes checking for main in -lXbsd... no checking for socket in -lsocket... no checking for gethostbyname in -lnsl... yes checking for dcgettext in -lintl... no checking for getnodebyname in -ldnet_stub... no checking that g++ can handle -O2... no checking standard STL is available... no checking for tcl.h... -I../include checking for tclInt.h... -I../include checking for libtcl8.4... -L../lib -ltcl8.4 checking for init.tcl... ../lib/tcl8.4 checking for http.tcl... ../lib/tcl8.4/http1.0 checking Tcl http.tcl library... yes checking for tclsh8.4.18... no checking for tclsh8.4... ../bin/tclsh8.4 checking for tk.h... -I../include checking for libtk8.4... -L../lib -ltk8.4 checking for tk.tcl... ../lib/tk8.4 checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11... yes checking for XShmAttach in -lXext... yes checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking system version (for dynamic loading)... Linux-2.6.32-21-generic No explicit static compilation flag; setting V_STATIC to "" checking for dlopen in -ldl... yes checking for a BSD-compatible install... /usr/bin/install -c configure: creating ./config.status config.status: creating Makefile rm -f libotcl.so otcl.o so_locations gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/usr/local/ns-allinone-2.34/include -I/usr/local/ns-allinone-2.34/include -I/usr/local/ns-allinone-2.34/include -I/include otcl.c ld -shared -o libotcl.so otcl.o otcl.o: In function `OTclDispatch': /usr/local/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local' otcl.o: In function `Otcl_Init': /usr/local/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local' ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined ld: final link failed: Nonrepresentable section on output make: *** [libotcl.so] エラー 1 otcl-1.13 make failed! Exiting ... See http://www.isi.edu/nsnam/ns/ns-problems.html for problems |
sudo apt-get update sudo apt-get install gcc-4.3 |
CC= @CC@ |
CC= gcc-4.3 |
./install |
./install &> compile.out |
(1) You MUST put /home/k/ns-allinone-2.34/otcl-1.13, /home/k/ns-allinone-2.34/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH= (2) You MUST put /home/k/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup. |
cd |
gedit .bashrc |
# PATH for NS-2 # VERSION NS_VER=2.34 OTCL_VER=1.13 TCL_VER=8.4.18 # Parent directory path NS_PAR=/usr/local # NS home directory path NS_HOME=$NS_PAR/ns-allinone-$NS_VER # LD_LIBRARY_PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NS_HOME/otcl-$OTCL_VER:$NS_HOME/lib # TCL_LIBRARY export TCL_LIBRARY=$NS_HOME/tcl$TCL_VER/library # PATH PATH=$PATH:$NS_HOME/bin |
source .bashrc |
ns |
nam |