1.环境
安装Tcl/Tk8.4 with BLT和libgmp
sudo apt-get install build-essential bison flex perl tcl-dev tk-dev blt libxml2-dev
sudo apt-get install zlib1g-dev sun-java6-jdk doxygen graphviz openmpi-bin libopenmpi-dev sudo apt-get install libpcap-dev tk8.4-dev
sudo apt-get install libgmp3-dev blt-dev
下载安装zlib,zlib主页http://www.zlib.net/,下载地址http://zlib.net/zlib-1.2.5.tar.gz
下载之后用tar xzvf命令解压,运行./configure,运行make,运行sudo make install
2.安装OMNeT++
OMNeT++的当前最新版本为2010年6月14日发布的4.1版。下载地址为http://www.omnetpp.org/omnetpp/doc_details/2217-omnet-41-source--ide-tgz。下载
创建仿真平台的安装目录,比如我在opt目录下创建一个目录。切换到目录,解压OMNeT++,我的OMNeT++*.tgz文件在/opt目录下。如下命令中~表示用户的根目录,在配置环境变量时,请使用绝对路径。
(1)解压
tar xzvf omnetpp-4.1-src.tgz
(2)配置环境变量
. setenv
gedit ~/.bashrc或gedit /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/omnetpp-4.1/lib
export PATH=$PATH:/opt/omnetpp-4.1/bin
export TCL_LIBRARY=/usr/share/tcltk/tcl8.4
source ~/.bashrc
source /etc/profile
(3)配置
./configure
(4)编译
make
注意:上面的一些警告是因为一些工具没有安装,具体为:
a. BLT (i.e. blt2.4z)
b. MPI - Message Passing Interface (i.e. OpenMPI-1.2.4)
c. Akaroa (i.e. akaroa-2.7.6)
可以选择安装,但不影响后面的操作。
2.akaroa的安装
1.步骤
./configure
make
make install
2.默认安装路径/usr/local/akaroa/bin, /usr/local/akaroa/lib and /usr/local/akaroa/include
3.make出现错误 /bin/sh: pushd: not found
This has to do with /bin/sh being linked to /bin/dash instead of /bin/bash in ubuntu’s latest releases. To fix it once and for all do the following:
# rm -f /bin/sh
# ln -s /bin/bash /bin/sh
4.重复1的内容完成
5.在OMNeT++中akaroa目录不是安装的路径,可在configure.user中找到akaroa目录为
/home/tools
把他改为
# AKAROA_CFLAGS="-I/d/usr/local/akaroa/include" # AKAROA_LIBS="-L/d//usr/local/lib -lakaroa"
3.建立快捷方式
找到图标文件,omnet下我选择了vicon.xpm在ide目录下
$ sudo cp icon.xpm /usr/share/icons
一般把图标都放在/usr/share/icons 下
$ cd /usr/share/applications
$ sudo gedit omnet.desktop
把以下内容填入
[Desktop Entry]
Name=Omnet4.1
Comment=Omnet4.1
Exec=/opt/omnetpp-4.1/ide/omnetpp
Icon=/usr/share/icons/icon.xpm
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true
保存重启即可。
3.安装INET框架
下载地址http://www.oversim.org/chrome/site/INET-OverSim-20100505.tgz
(1)解压
cd ~/sim
tar xzvf /tmp/INET-Oversim-20100505.tgz
(2)编译
cd ~/sim/INET-Oversim-20100505
make
4.安装OverSim
下载地址http://www.oversim.org/chrome/site/OverSim-20100526.tgz
(1)解压
cd ~/sim
tar xzvf /tmp/Oversim-20100526.tgz
(2)编译
cd ~/sim/Oversim-20100526
make
5.测试
切换目录至OverSim-20100526/simulations
cd ~/sim/OverSim-20100526/simulations
在该目录下启动OverSim,命令为
../src/Oversim
弹出Set up an Inifile Configuration对话框,和OMNeT++/Tkenv对话框。
感谢博友:http://blog.163.com/try_yanming/blog/static/182219260201121244239270/