预备知识
(by huihoo.com connect_freeman 翻译 )
Subsections
Unix
Windows 95/NT using Cygnus CDK
--------------------------------------------------------------------------------
Prerequisits
Unix
Before trying to compile MICO make sure you have installed the following software packages:
gnu make version 3.7 or newer (required)
C++ compiler and library (required):
g++ 2.7.2.x and libg++ 2.7.2, or
g++ 2.8.x and libg++ 2.8.x, or
egcs 1.x
flex 2.5.2 or newer (optional)
bison 1.22 or newer (optional)
JDK 1.1.5 (SUN's Java developers kit) (optional)
JavaCUP 0.10g (parser generator for Java) (optional)
flex and bison are only necessary if you change their input files (files having the suffix .l and .y) or if you want to compile the graphical user unterface. The last two items (JDK and JavaCUP) are only needed for the graphical interface repository browser, not for MICO itself. So you can get along without installing the Java stuff.
It is important that you use one of the above listed C++ compilers and a C++ library that matches the version of the compiler. Your best bet is using either egcs or g++ 2.8. In contrast to gcc 2.7.2 both of them have proper support for exceptions. egcs is a bit easier to install than g++, because it includes a matching C++ library.
Windows 95/NT using Cygnus CDK
In order to run MICO on Windows 95 or NT you have to use the Cygnus CDK beta 19, a port of the GNU tools to Win32 or Microsoft's Visual-C++ compiler. For instructions on how to compile MICO using the Visual-C++ compiler, refer to Section 2.4.
Install the CDK by running its setup program. Note that you have to install it in the directory the setup program suggests (c:CygnusCDKB19); otherwise bison won't be able to find its skeleton files. Then create c:bin and put an sh.exe into it. Likewise create c:lib and put a cpp.exe into it:
mkdir c:\bin
copy c:\Cygnus\CDK\B19\H-i386-cygwin32\bin\bash.exe c:\bin\sh.exe
mkdir c:\lib
copy c:\Cygnus\CDK\B19\H-i386-cygwin32\lib\gcc-lib\2.7-B19\cpp.exe c:\lib
Now you are ready to unpack and compile MICO as described in section 2.3.
There are some problems with the current release of the CDK:
On standalone machines which are not connected to a name server resolving IP addresses other than 127.0.0.1 into host names will hang forever. This is either a problem with the CDK or with Windows in general. On standalone machines you therefore have to make all servers bind to 127.0.0.1 by specifying -ORBIIOPAddr inet:127.0.0.1: on the command line.
The gcc 2.7 that comes with the CDK has broken exception handling. Furthermore it seems to be unable to use virtual memory, at least I get out of virtual memory errors although there is a lot of free swap space. I know there are ports of egcs and gcc 2.8 (which might do better), but didn't give them a try.
There seems to be a problem with automatic TCP port number selection. Usually one binds to port number 0 and the system automatically picks an unused port for you. This basically works with CDK, but sometimes causes hanging connections. The solution is to always explicitely specify port numbers, i.e. give all servers--even ones that are started by micod--the option -ORBIIOPAddr inet::, where is nonzero.
--------------------------------------------------------------------------------
子节
2.2.1Unix
2.2.2在Windows 95/NT下使用 Cygnus CDK
--------------------------------------------------------------------------------
2.2预备知识
2.2.1Unix
在编译MICO前确认你已经安装以下的软件包:
gnu make 版本 3.7 或更新版本(必需)
C++ 编译器和库 (必需):
g++ 2.7.2.x 和 libg++ 2.7.2, 或
g++ 2.8.x 和 libg++ 2.8.x, 或
egcs 1.x
flex 2.5.2 或更新版本 (任选)
bison 1.22 或更新版本 (任选)
JDK 1.1.5 (SUN's Java 开发包) (任选)
JavaCUP 0.10g ( Java语法生成器) (任选)
flex 和 bison只有在你修改了它们的输入文件(文件后缀为 .l 和 .y) 或你想编译图形用户接口时才用到。最后两项(JDK和JavaCUP)对MICO说不是必需的,只是图形接口库浏览器才需要用到。这样你就可以在没有安装Java资料的情况下继续使用了。
重要的一点是你在使用以上列出的的C++编译器和C++库之一时,库必需和编译器的版本相符。你最好用egcs和g++2.8其中之一。gcc 2.7.2和他们差异之处只在于对异常的支持上.egcs在安装上比g++稍微容易先,因为它包括有相符的C++库.
2.2.2在Windows 95/NT下使用 Cygnus CDK
为了在Windows 95或NT下运行MICO,你得使用 Cygnus CDK beta 19,一个在WIN32平台上的GNU工具集的接口.或者是用Microsoft的Visual-C++编译器.如何用Visual-C++编译器编译MICO的用法说明,可以查询2.4节.
在使用设置程序安装CDK的过程中.注意如果你不安装到设置程序提议的目录(c:CygnusCDKB19)下;bison将找不到支撑文件。接着建立c:bin和放入sh.exe文件.同样的建立c:lib和放入cpp.exe文件:
mkdir c:\bin
copy c:\Cygnus\CDK\B19\H-i386-cygwin32\bin\bash.exe c:\bin\sh.exe
mkdir c:\lib
copy c:\Cygnus\CDK\B19\H-i386-cygwin32\lib\gcc-lib\2.7-B19\cpp.exe c:\lib
现在你可以来象2.3节中描述那样来解压和编译MICO
使用当前CDK的发布还有一些问题:
在通常那些没有联结到名字服务器来解析IP地址的机器,除了用127.0.0.1来成为主机名的,一般都会挂机。那是用CDK或Windows常见的问题.因此你通常得将所有服务器绑定到127.0.0.1,而且在命令行下使用选项-ORBIIOPAddr inet::127.0.0.1<端口>。
和CDK一起使用gcc 2.7会破坏异常处理过程。此外它看起来还不能使用虚存,起码我虽然有了很多空闲的交换区,还是能捕捉到虚拟内存的错误.我知道egcs和gcc 2.8(可能工作得更好)的端口,但没有试过。
看起来使用TCP端口选择会有问题.通常一个绑定是到端口0并且系统会自动为你取得一个未用的端口号.基本上CDK也是这般工作的,但有时这就是造成挂起连接的原因.解决方法一般是明确指定端口号等等.给所有服务器--甚至仅一个也要在micod启动时带上--选项 -ORBIIOPAddr inet:<主机>:<端口>,<端口>不为零。