OMNet++安装步骤

来源:互联网 发布:收音机软件不需要网络 编辑:程序博客网 时间:2024/04/29 04:54

 

        OMNeT++是一个事件驱动的仿真器,适合做离散事件网络系统仿真。通常可进行通信系统通信模型仿真、协议仿真、硬件体系结构验证、复杂软件系统性能评估、任何其他离散事件驱动应用的建模与仿真。

        OMNeT++在原理和结构上与OPNET(大名鼎鼎的商用仿真器)相似。而它是免费的,且上手很快。

        因为某种需要,所以在FC5下安装了一个OMNeT++,并整理了相关步骤。

        1.先从网上下载omnetpp包,我的是omnetpp-3.3-src.gz

        然后解压到/root下,我的是解压到/root下,其实路径可以自己定。

        $tarzxvf omnetpp-3.3-src.gz
$mv omnetpp-3.3 /root/

        2.设置环境变量

        $vi /root/.bashrc
–>
加入如下设置
export PATH=$PATH:/root/omnetpp
3.3/bin
export LD_LIBRARY_PATH=/root/omnetpp-3.3/lib

        exportTCL_LIBRARY=/usr/lib/tcl8.4
        需要设置PATH,LD_LIBRARY_PATH还需要设置TCL_LIBRARY,OMNEST/OMNeT++ GUI程序能够找到BLT.实际上,./configure结束后,会检测环境变量是否设置.若未设置(或设置后未logout, log in), 它会提示你设置.所以在这里先设置了。
        3../configure观察warningerror
        下面列出一些error的排除方法
        (1)configure:error: Cannot build Tcl/Tk apps, probably due to misconfigured ormissing X11 headers or libs. Check config.log for more info!
        安装doxygenimagemagick
        如果有yum并且能用的话,可以执行
        $yuminstall doxygen
        类似的命令把以上的安装包装了,如果有安装碟则可以在安装碟中将以下几个rpm拷贝到电脑中安装,或者到清华大学的ftp中找,里面有,地址是ftp3.tsinghua.edu.cn
doxygen-1.4.6-3.i386.rpm
doxygen-doxywizard-1.4.6-3.i386.rpm
ImageMagick-6.2.5.4-4.2.1.i386.rpm
ImageMagick-c++-6.2.5.4-4.2.1.i386.rpm
ImageMagick-c++-devel-6.2.5.4-4.2.1.i386.rpm
ImageMagick-devel-6.2.5.4-4.2.1.i386.rpm
ImageMagick-perl-6.2.5.4-4.2.1.i386.rpm
(2)configure:error: Cannot build Tcl/Tk apps, probably due to misconfigured ormissing X11 headers or libs. Check config.log for more info!
未安装tcl或者tk,可以用yum安装也可以上清华找,也可以在安装盘里面找下面几个rpm
tcl-8.4.12-4.i386.rpm
tcl-devel-8.4.12-4.i386.rpm
tcl-html-8.4.12-4.i386.rpm
tk-8.4.12-1.2.i386.rpm
tk-devel-8.4.12-1.2.i386.rpm
安装。
(3)configure:error: Tcl/Tk not found, needed for all GUI parts. Version 8.4.0+ anddevel package required. Check config.log for more info!
configure.user中加入
TK_CFLAGS=”-I/usr/include/tcl8.4-fwritable-strings”
TK_LIBS=”-L/usr/lib -ltk8.4-ltcl8.4 -I/usr/lib”
(4)
或许你还需要以下程序,不过很大部分在安装系统时已经带了,以防万一,下来装了吧。
bison-2.1-1.2.1.i386.rpm
bison-devel-2.1-1.2.1.i386.rpm
bison-runtime-2.1-1.2.1.i386.rpm
boost-1.33.1-5.i386.rpm
boost-devel-1.33.1-5.i386.rpm
boost-doc-1.33.1-5.i386.rpm
byacc-1.9-29.2.1.i386.rpm
flex-2.5.4a-37.4.i386.rpm
giftrans-1.12.2-19.i386.rpm
libxml2-2.6.23-1.2.i386.rpm
libxml2-devel-2.6.23-1.2.i386.rpm

libxml2-python-2.6.23-1.2.i386.rpm
4.
至此,如果你在XWindows下边configure那么就可以通过了!下面是我的结果:
[root@localhostomnetpp]# ./configure
checkingbuild system type… i686-pc-linux-gnu
checkinghost system type… i686-pc-linux-gnu
configure:———————————————–
configure:reading configure.user for your custom settings
configure:———————————————–
checkingfor icc… no
checkingfor gcc… gcc
……………………………………..(省略了很多)…………………………..
configure:WARNING: Cannot compile or link program with BLT: BLT or BLT-develmay not be installed — check config.log for details. Plove andScalars require BLT to build.
……………………………………..(省略了很多)…………………………..
config.status:creating samples/queues/Makefile
config.status:creating samples/tictoc/Makefile
config.status:creating samples/tokenring/Makefile
config.status:creating samples/sockets/Makefile
config.status:creating test/Makefile
WARNING:The configuration script could not detect the following packages:
Graphviz BLT  MPI (optional)  Akaroa (optional)
Scrollup to see the warning messages (use shift+PgUp key), and seeconfig.log
formore details. While you can use OMNeT++/OMNEST in the current
configuration,please be aware that some functionality may be unavailable
orincomplete.
YourPATH contains /root/omnetpp/bin. Good!
YourLD_LIBRARY_PATH is set. Good!
TCL_LIBRARYis set. Good!
[root@localhostomnetpp]#
        之所以会出现几个warning,是因为MPI Akaroa没有安装,不过没有什么大碍,因为是可选项目。你可以下载并安装消除warning
        6.好了,最后一步
[root@localhostomnetpp]#make
………………(一大堆信息)…………………
        至此安装成功了。
        7。运行
[root@localhostomnetpp]#cd /root/omnetpp-3.3/samples/dyna
[root@localhostomnetpp]#./dyna
        或许你的会出现这个提示:errorwhile loading shared libraries /root/omnetpp/lib/libnedxml.so cannotrestore segment prot after reloc:
        关闭SELinux就好了,把selinux的值改成Permissive
        再次运行。

原创粉丝点击