原文地址:http://blog.sina.com.cn/s/blog_74d98ffe01012h5h.html
CentOS环境下ACE编译指南
1.环境说明:
(1)CentOS6.3
2.编译步骤:
(1)定义环境变量:
ACE_ROOT=/root/work/cots/ACE_wrappers;export ACE_ROOT
LD_LIBRARY_PATH=$ACE_ROOT/lib;export LD_LIBRARY_PATH
也可以直接设置到~/.bashrc 中
export ACE_ROOT=***/ACE_wrappers
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace:$ACE_ROOT/lib
export TAO_ROOT=$ACE_ROOT/TAO
(2)新建config.h
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
INSTALL_PREFIX = /usr/local
(4)make
(5)make install
3.验证ACE是否成功
进入$ACE_ROOT,然后make,漫长的等待后,没有报错停止的情况下,可以写一个小程序来测试一下,test.cpp:
2
3
4
5
6
完成。
4、安装TAO
5. 启动命名服务 参见ACE_wrappers\TAO\docs\tutorials\Quoter\index.html 下文档“TAO's Naming Service”一项: $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
$ACE_ROOT/bin/mwc.pl -type gnuace TAO_ACE.mwc $make -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 NotifyEventChannelFactor y -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