- 论坛徽章:
- 0
|
基于Linux的TAO安装说明
一、概述
两个有用的网址:
介绍及文档:
http://www.cs.wustl.edu/%7Eschmidt/TAO.html
软件下载:
http://download.dre.vanderbilt.edu/
http://download.huihoo.com/
这几个网站都有关联的,总能互相找的到
几个基本的概念:
从http://www.cs.wustl.edu/%7Eschmidt/TAO.html中可以看到:
• ACE is an open-source framework that provides many components and patterns for developing high-performance, distributed real-time and embedded systems. ACE provides powerful, yet efficient abstractions for sockets, demultiplexing loops, threads, synchronization primitives.
• TAO (The ACE ORB) is an open-source implementation of a CORBA Object Request Broker (ORB) built using components and patterns in the ACE framework.
• CIAO (Component Integrated ACE ORB) is an open-source implementation of the CORBA Component Model (CCM) built on top of TAO.
从概念中可以知道,目前的TAO是ACE的ORB,所以,安装TAO之前首先要安装ACE。
二、软件的安装
1.软件来源
可以从http://download.dre.vanderbilt.edu/下载所需要的软件,这里是从http://download.huihoo.com/middleware/ace-tao/ 中下载的ACE-5.5+TAO-1.5.tar.gz版本
下面具体的过程参照ACE_wrappers/ACE-INSTALL.html及/ACE_wrappers/TAO/TAO-INSTALL.html过程,下面给出说明。
其中的软件包提供的这两个文件的安装说明有可能和http://www.cs.wustl.edu/%7Eschmidt/TAO.html中看到的有出入,比如说在TAO-INSTALL.html文件中关于Build and install the TAO release under $TAO_ROOT第6点的描述,http://www.cs.wustl.edu/%7Eschmidt/TAO.html给出的 Building TAO说明中描述如下:
Run MPC like this, $ACE_ROOT/bin/mwc.pl TAO_ACE.mwc -type gnuace。而软件包中描述如下:Run MPC like this, $ACE_ROOT/bin/mwc.pl TAO_ACE.mwc(少了后面的参数)
对于上述的差异,本文提到的安装以软件包内的说明为准。
2.解压ACE-TAO
把ACE-5.5+TAO-1.5.tar.gz上传到linux主机,在其存放的目录下解压此包(命令:tar –xzvf ACE-5.5+TAO-1.5.tar.gz),会在当前目录下生成ACE_wrappers目录,其中是具体的程序文件。
3.安装ACE
系统提供了
GNU Autoconf
Traditional ACE/GNU Make Configuration
安装方式,由于不太相信自动的方式,对可能的安装出错也无计可施,所以下面采用Using the Traditional ACE/GNU Configuration的方式安装(也是系统推荐)。
1)在.bash_profile文件中设置ACE环境变量
#ACE_ROOT environment
export ACE_ROOT=/usr/Tao/ACE_wrappers
2)创建配置文件$ACE_ROOT/ace/config.h,该配置文件用来说明操作系统环境,其内容写入如下(一行):
#include "ace/config-linux.h"
在$ACE_ROOT/ace目录下面,包含了许多操作系统下的头文件,这里按需使用,所以选择了config-linux.h。 为什么没有选择同目录下的config-linux-common.h,请参看config-linux-common.h文件内的说明。
3)创建编译配置文件$ACE_ROOT/include/makeinclude/platform_macros.GNU
安装文件中如是描述,但可能描述不是很准确,因为实际的$ACE_ROOT/include/makeinclude/platform_macros.GNU是一个已经存在的链接文件,指向一个并不存在的文件/usr/Tao/ACE_wrappers/ace/platform_macros.GNU,所以要创建文件应该为/usr/Tao/ACE_wrappers/ace/platform_macros.GNU,该文件写入如下内容(一行):
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
其中$ACE_ROOT/include/makeinclude/下包括了许多平台的配置文件,这里选用的是platform_linux.GNU。
4)在启动文件.bash_profile中增加ACE的Lib文件环境变量
LD_LIBRARY_PATH=$ACE_ROOT/ace ACE_ROOT/lib
export LD_LIBRARY_PATH
在ACE成功编译以后,该目录下$ACE_ROOT/lib会产生诸多Lib文件
5)重新登陆,使得.bash_profile中的环境变量生效
6)进入到ACE根目录下,进行编译
cd $ACE_ROOT
make
根据机器配置和运行情况,这里大概经过10分钟左右便编译完成。一般情况下,不会报错,如果出现错误,请核对系统实际环境和配置的是否一致。
4.安装TAO
在ACE成功安装的基础上安装TAO
1)在.bash_profile文件中设置$TAO_ROOT环境变量
#TAO_ROOT environment
export TAO_ROOT=$ACE_ROOT/TAO
2)编译TAO
根据文档的说明,最简单易行的方式就是在$TAO_ROOT目录下执行make,但是文档并没有明确说明这样做的效果是什么,所以,并没有人告诉我们该方式最后安装了些什么。
另外一个可以明确的说法是如何完全的安装所有的TAO内容(compile all the core tao and orbsvcs, including its dependencies in ACE and ACEXML),我们也是采取了这样的方式,在当前的机器上,编译安装的过程大概执行了1个小时左右。下文也就说明这样的安装内容
3)删除$ TAO_ROOT目录下所有的GNUmakefiles文件
Cd $ TAO_ROOT
Find . –name “*GNUmakefile*” | xargs rm
4) 重新生成makefile文件(TAO also uses GNUmakefiles files generated from MPC to compile.)
Cd $TAO_ROOT
$ACE_ROOT/bin/mwc.pl TAO_ACE.mwc
5) 编译
Make
NOTE:To test that the TAO release is properly configured, follow instructions on executing the various examples under $TAO_ROOT/tests.
5. 启动命名服务
参见ACE_wrappers\TAO\docs\tutorials\Quoter\index.html 下文档“TAO's Naming Service”一项:
$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -ORBEndpoint iiop://199.3.13.7:12001 -m 1
6.启动事件服务
参见ACE_wrappers\TAO\docs\tutorials\Quoter\index.html 下文档“TAO's COS Event Service”一项:
$TAO_ROOT/orbsvcs/CosEvent_Service/CosEvent_Service
7.启动通知服务
参见ACE_wrappers\TAO\orbsvcs\Notify_Service\README:
$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -Factory NotifyEventChannelFactory -NameSvc -Channel NotifyEventChannel -ORBRunThreads 1 -ORBEndpoint iiop://199.3.13.7:12002
8.检查服务运行状况
netstat -an | grep 1200
tcp 0 0 199.3.13.7:12001 0.0.0.0:* LISTEN
tcp 0 0 199.3.13.7:12002 0.0.0.0:* LISTEN
tcp 0 0 199.3.13.7:12001 199.3.13.7:33307 ESTABLISHED
tcp 0 0 199.3.13.7:12001 199.3.13.7:33303 ESTABLISHED
tcp 0 0 199.3.13.7:33307 199.3.13.7:12001 ESTABLISHED
tcp 0 0 199.3.13.7:33303 199.3.13.7:12001 ESTABLISHED
udp 0 0 224.9.9.2:12001 0.0.0.0:*
9.测试
ACE_wrappers/TAO/TAO-INSTALL.html#build一节中描述,To test that the TAO release is properly configured, follow instructions on executing the various examples under $TAO_ROOT/tests. 所以这边就用下面的例子进行测试: $TAO_ROOT/orbsvcs/tests
TAO要求see MPC USAGE document for details on how to generate build files for other compilers and tools.去生成makefile文件,参见\ACE_wrappers\MPC\USAGE文档说明:
The most common way to use the Make Project Creator is to run the
workspace generator (mwc.pl). This script will generate projects and a
single workspace that contains the generated projects. If no input file
(.mwc file) is specified, it will recurse into the directory in which the
script was started. It looks for .mpc files and generates a project or
projects for each one found.也就是说,通过mwc.pl命令及一个.mwc file的输入文件,就会产生默认的makefile文件,其中也是包括了install的选项。
该段语句说明,执行了“mwc.pl 某个.mwc” 以后,该脚本会搜寻当前及其所有的子目录的 .mpc文件(该文件每个例子中都有),根据此文件生成各个例子的makefile文件(实际为GNUmakefile文件)。
mvc的文件并不是在每个例子中都有的,在$TAO_ROOT/orbsvcs/tests许多的测试例子里,只有$TAO_ROOT/orbsvcs/tests目录下有一个tests.mwc的文件,在$TAO_ROOT/orbsvcs/tests目录下执行:
cd $TAO_ROOT/orbsvcs/tests
$ACE_ROOT/bin/mwc.pl tests.mwc
make
x.其他有用的网站
http://www.huihoo.org/ace_tao/index.html
http://www.theaceorb.com/faq/index.html //TAO FAQ |
|