Ubuntu 12.04安装ns nam记录
使用apt工具安装nam后执行时总是出现段错误,就把ns, nam全部remove后重新用源码安装.
源码下载地址:
1. https://nchc.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz
2. https://nchc.dl.sourceforge.net/project/nsnam/nam-1/1.15/nam-src-1.15.tar.gz
首先安装ns, 再安装nam.
ns安装教程可参考这个链接:
http://www.linuxdiyf.com/linux/16007.html
需要注意的是一个编译错误的解决方法:
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: * [linkstate/ls.o] Error 1修改ls文件:ns-2.35/linkstate/ls.h第137行
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }改为:void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
保存后 sudo ./install #重新安装顺利完成
ns安装完成 之后,再安装nam.
需要注意的问题有:
xwd.c:87:29: fatal error: X11/Xmu/WinUtil.h: No such file or directory
解法方法:check existence of /usr/include/X11/Xmu/ . If does not exist, run this as root:
apt-get install libxmu-headers
来自 https://sourceforge.net/p/nsnam/bugs/76/undefined reference to `gzopen’ ……
解法方法:修改nam目录下的Makefile,添加-lz
LIB = \
-L/home/hct/ns-allinone-2.31/tclcl-1.19 -ltclcl -L/home/hct/ns-allinone-2.31/otcl -lotcl -L/home/hct/ns-allinone-2.31/lib -ltk8.4 -L/home/hct/ns-allinone-2.31/lib -ltcl8.4 -lz \
再make sudo make install
参考来自http://www.cnblogs.com/buptmuye/archive/2013/11/30/3451753.htmlconfigure参数注意要正确:
./ configure –with-tcl=/home/xxx/ns-allinone-2.35/tcl8.5.10 –with-tcl-ver=8.5.10 –with-tk=/home/xxx/ns-allinone-2.35/tk8.5.10 –with-tk-ver=8.5.10 –with-otcl=/home/xxx/ns-allinone-2.35/otcl –with-tclcl=/home/xxx/ns-allinone-2.35/tclcl