Ubuntu 9.10+NS2 2.33+附加gnuplot和gawk 安装手册

首先声明,本文《Ubuntu 9.10+NS2 2.33+附加gnuplot和gawk 安装》非完全原创,通过收集一些网上资料,根据自己的实际操作体会进行的修改

1、首先是下载ns-allinone-2.33.tar.gz,地址为
下载在ISI官方即可很快的下载(针对教育网用户)

jacob为我的用户名,注意修改
cd /home/jacob
tar xvfz ns-allinone-2.33.tar.gz

2、安装几个需要使用的软件包:
sudo apt-get install build-essential

sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev

sudo apt-get install libxmu-dev

3、然后可以进行安装:
cd /home/yyang/ns-allinone-2.33.tar.gz
sudo ./install
然后看到命令行非常养眼地快速翻滚。在结束时突然报错:

ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/yyang/ns-allinone-2.33/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/yyang/ns-allinone-2.33/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 for problems

很奇怪的错误,于是上网找解决措施,在

发现解决办法:
gcc 4.0版本以前是用ld -share来生成共享库的,但是到了4.0以上的版本(我的为gcc version 4.4.1),这个命令改为了gcc -share即可

解决过程:
cd /home/yyang/ns-allinone-2.33/otcl-1.13
sudo gedit configure.in
把77行处的
        SHLIB_LD="ld -shared"
改为
        SHLIB_LD="gcc -shared"
保存退出,然后
sudo gedit configure
把5518行的
        SHLIB_LD="ld -shared"
改为
        SHLIB_LD="gcc -shared"
保存退出,然后
cd ..
回到目录ns-allinone-2.33下运行
sudo ./install

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/27369.html