分类: LINUX
2011-09-28 15:57:31
ns-allinone-2.34 installs on Ubuntu Intrepid 8.10. Make sure you have the following packages installed:
libxt-dev libx11-dev libxmu-devFor Ubuntu 9.10 (karmic), you may encounter this error in the linking of otcl:
otcl.o: In function `OTclDispatch': /home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local' otcl.o: In function `Otcl_Init': /home/ns/ns-allinone-2.34/otcl/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] Error 1This error is because the linker being used is "ld -shared" instead of "gcc -shared". If you edit one line in otcl-1.13/configure, and rerun install, it should work:
--- configure.orig 2009-11-02 12:14:52.556167945 -0800 +++ configure 2009-11-02 12:17:28.966706099 -0800 @@ -6301,7 +6301,7 @@ ;; Linux*) SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -shared" + SHLIB_LD="gcc -shared" SHLIB_SUFFIX=".so" DL_LIBS="-ldl" SHLD_FLAGS=""This will be fixed in future revisions of ns-2.
设置环境变量加入到 ~/.bashrc
PATH="$PATH":/home/lizhipeng/Downloads/ns-allinone-2.34/bin:/home/lizhipeng/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/lizhipeng/Downloads/ns-allinone-2.34/tk8.4.18/unix
LD_LIBRARY_PATH="/home/lizhipeng/Downloads/ns-allinone-2.34/otcl-1.13:/home/lizhipeng/Downloads/ns-allinone-2.34/lib"
TCL_LIBRARY="/home/lizhipeng/Downloads/ns-allinone-2.34/tcl8.4.18/library"