Ice-3.5.1在CentOS 6.5系统中的编译配置教程

1 操作系统

CentOS release 6.5 (Final)  x86_64 系统。

2 源码包下载

Ice-3.5.1.zip

下载地址:https://zeroc.com/download/Ice/3.5/Ice-3.5.1.zip

ThirdParty-Sources-3.5.1.tar.gz,

下载地址:http://download.zeroc.com/Ice/3.5/ThirdParty-Sources-3.5.1.tar.gz

其中包括:

1) db-5.3.21.NC.tar.gz 及随ICE-3.5.1发布的补丁文件patch.db.5.3.21

2) jgoodies-common-1_4_0.zip

3) jgoodies-forms-1_6_0.zip

4) jgoodies-looks-2_5_2.zip

5) mcpp-2.7.2.tar.gz 及随ICE-3.5.1发布的补丁文件patch.mcpp.2.7.2

此外,还需要下载:

1) bzip2-1.0.6.tar.gz

2) expat-2.1.1.tar.bz2

3) mono-2.11.3.tar.bz2

4) OpenSSL_0_9_8-stable.zip

3 编译环境配置

在系统的个人目录,例如:/home/$(username)/Documents下:

1)解压ice-3.5.1.zip形成ice-3.5.1源码目录,新建名为install文件夹,用于安装编译后的第三方软件工具。

2)解压ThirdParty-Sources-3.5.1.tar.gz文件,形成第三方源码文件目录。

3)新建ice的环境变量文件env.sh.

首先,根据ThirdParty-Sources-3.5.1文件夹中的“README”文件内容,进行带补丁的第三方工具mcpp和db-5.3.21的编译和安装:

(1)解压缩mcpp-2.7.2.tar.gz文件

$ cd mcpp-2.7.2

通过补丁文件patch.mcpp.2.7.2,对mcpp-2.7.2中的部分源代码进行自动化地修改。

$ patch -p0 < ../mcpp/patch.mcpp.2.7.2

$ ./configure CFLAGS=-fPIC --enable-mcpplib --disable-shared

--prefix=/home/$(username)/Documents/Ice/install/3rd/mcpp272

$ make

$ make install

(2)解压缩db-5.3.21.NC.tar.gz文件。

$ cd db-5.3.21.NC

通过补丁文件patch.db.5.3.21,对db-5.3.21.NC中的部分源代码进行自动化地修改。

$ patch -p0 < ../db/patch.db.5.3.21

$ cd db-5.3.21.NC/build_unix

$ ../dist/configure --prefix=/home/$(username)/Documents/Ice/install/3rd/db5321--enable-cxx --enable-java --enable-shared --enable-static

然后,进行其它第三方工具的安装:

(3)解压缩bzip2-1.0.6.tar.gz文件。

$ cd bzip2-1.0.6

$ make install PREFIX=/home/$(username)/Documents/Ice/install/3rd/bzip2106

(4)解压缩expat-2.1.1.tar.bz2文件。

$ cd expat-2.1.1

$ ./configure --prefix=/home/$(username)/Documents/Ice/install/3rd/expat211

$ make

$ make install

(5)解压缩mono-2.11.3.tar.bz2文件

$ cd mono-2.11.3

$ ./configure --prefix=/home/$(username)/Documents/Ice/install/3rd/nono2113

$ make

$ make install

(6)解压缩OpenSSL_0_9_8-stable.zip文件

$ cd openssl-OpenSSL_0_9_8-stable

$ ./config --prefix=/home/$(username)/Documents/Ice/install/3rd/openssl098

--openssldir=/home/$(username)/Documents/Ice/install/3rd/openssl098/openssl

$ make

$ make install

(7)在/home/$(username)/Documents/Ice/install/3rd/目录中,新建文件夹jgoodies,并将下面三个文件解压至该文件夹。

三个文件分别是:jgoodies-common-1_4_0.zip、jgoodies-forms-1_6_0.zip和jgoodies-looks-2_5_2.zip。

主要是获取jgoodies-common-1.4.0.jar,jgoodies-forms-1.6.0.jar和jgoodies-looks-2.5.2.jar三个Java包。

最后,编辑环境变量文件env.sh,内容如下:

===========================================================================

export TOPDIR=/home/$(username)/Documents/Ice

#bzip

export PATH=$TOPDIR/install/3rd/bzip2106/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/bzip2106/lib:$LD_LIBRARY_PATH

#Berkeley DB

export PATH=$TOPDIR/install/3rd/db5321/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/db5321/lib:$LD_LIBRARY_PATH

#expat

export PATH=$TOPDIR/install/3rd/expat211/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/expat211/lib:$LD_LIBRARY_PATH

#mcpp

export PATH=$TOPDIR/install/3rd/mcpp272/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/mcpp272/lib:$LD_LIBRARY_PATH

#openssl

export PATH=$TOPDIR/install/3rd/openssl098/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/openssl098/lib:$LD_LIBRARY_PATH

#mono-2.1.1.3

export PATH=$TOPDIR/install/3rd/nono2113/bin:$PATH

export LD_LIBRARY_PATH=$TOPDIR/install/3rd/nono2113/lib:$LD_LIBRARY_PATH

#java classpath

export CLASSPATH=$TOPDIR/ThirdParty-Sources-3.5.1/jgoodies/jgoodies-common-1.4.0/jgoodies-common-1.4.0.jar:$CLASSPATH

export CLASSPATH=$TOPDIR/ThirdParty-Sources-3.5.1/jgoodies/jgoodies-forms-1.6.0/jgoodies-forms-1.6.0.jar:$CLASSPATH

export CLASSPATH=$TOPDIR/ThirdParty-Sources-3.5.1/jgoodies/jgoodies-looks-2.5.2/jgoodies-looks-2.5.2.jar:$CLASSPATH

export CLASSPATH=$TOPDIR/install/3rd/db5321/lib/db.jar:$CLASSPATH

===============================================================================

4 编译过程

4.1 cpp模块的编译

首先,切换目录到:/home/$(username)/Documents/Ice/ice-3.5.1/cpp,编译cpp部分:

编译cpp的过程中会报错:找不到libmcpp.a这个静态库:

===============================================================================

g++ -shared -Wl,--enable-new-dtags -Wl,-rpath,/opt/Ice-3.5/lib64 -rdynamic -m64 -Wall -Werror -pthread -fPIC -g  -L../../lib -o ../../lib/libSlice.so.3.5.1 -Wl,-h,libSlice.so.35   Scanner.o ../Slice/Grammar.o Parser.o CPlusPlusUtil.o CsUtil.o JavaUtil.o Preprocessor.o Checksum.o PythonUtil.o DotNetNames.o RubyUtil.o PHPUtil.o Util.o FileTracker.o MD5.o MD5I.o -lIceUtil  -lmcpp

/usr/bin/ld: cannot find -lmcpp

collect2: ld returned 1 exit status

make[3]: *** [../../lib/libSlice.so.3.5.1] Error 1

make[3]: Leaving directory `/home/zhchshen/.local/share/Trash/files/ice-3.5.1/cpp/src/Slice'

make[2]: *** [Slice] Error 2

make[2]: Leaving directory `/home/zhchshen/.local/share/Trash/files/ice-3.5.1/cpp/src'

make[1]: *** [all] Error 1

make[1]: Leaving directory `/home/zhchshen/.local/share/Trash/files/ice-3.5.1/cpp'

make: *** [all] Error 1

===============================================================================

根据出错信息所显示的编译命令中的静态库文件的目录引导:-L../../lib,和出错后的第一层退出位置:/home/zhchshen/.local/share/Trash/files/ice-3.5.1/cpp/src/Slice/,可知编译过程的库文件位置为:/home/$(username)/Documents/Ice/ice-3.5.1/cpp/lib,此处没有libmcpp.a库文件。

将/home/$(username)/Documents/Ice/install/3rd/mcpp272/lib/libmcpp.a库文件,复制到:

/home/$(username)/Documents/Ice/ice-3.5.1/cpp/lib目录中:

关闭当前已经显示出错信息的Linux终端,重新打开终端,并source环境变量文件env.sh,再次编译,成功!

编译cpp的test程序,在进行make test之前,需要修改目录:

/home/$(username)/Documents/Ice/ice-3.5.1/cpp/test/IceUtil/unicode中的filename文件名,修改为:filename.txt。否则,会报如下错误:

==============================================================================

*** running tests 3/84 in /home/zhchshen/Documents/Ice/ice-3.5.1/cpp/test/IceUtil/unicode

*** configuration: Default

*** test started: 08/12/17 14:16:11

starting client... ok

testing UTF-8 to wstring (utf32le) conversion... ok

wstring (utf32le) to UTF-8 conversion... ok

testing UTF-8 filename... failed!

Client.cpp:197: assertion `os.is_open()' failed

unexpected exit status: expected: 0, got -6

('test in /home/zhchshen/Documents/Ice/ice-3.5.1/cpp/test/IceUtil/unicode failed with exit status', 256)

===============================================================================

测试程序编译、执行完毕:

4.2 Java模块的编译

类似cpp模块的编译,先source环境变量,然后在Linux终端,切换目录:

$ cd /home/$(username)/Documents/Ice/ice-3.5.1/java

$ make

该过程中会出现如下错误信息:

/home/$(username)/Documents/Ice/ice-3.5.1/java/test/Ice/slicing/objects/ServerPrivateAMD.ice:159: `Forward' is not defined

/home/$(username)/Documents/Ice/ice-3.5.1/java/test/Ice/slicing/objects/ServerPrivateAMD.ice:220: `Forward' is not defined

这是由于ServerPrivateAMD.ice文件的第159行出现了如下所示的双斜线注释语句:

class Forward;          // Forward-declared class defined in another compilation unit

需要将注释的双斜线修改为/* Forward-declared class defined in another compilation unit */

然后继续编译。成功编译后,执行测试:

$ make test

4.3 cs模块的编译

类似cpp模块的编译,先source环境变量,然后在Linux终端,切换目录:

$ cd /home/$(username)/Documents/Ice/ice-3.5.1/cs

$ make

编译过程中同样会报出‘Forward’没有定义的错误:

/home$(username)/Documents/Ice/ice-3.5.1/cs/test/Ice/slicing/objects/TestAMD.ice:153: `Forward' is not defined,同样是slice文件双斜线注释引起的问题:

class Forward;  // Forward-declared class defined in another compilation unit

双斜线修改为/* */,重新编译,成功编译后,执行测试:

$ make test

4.4 python模块的编译

类似cpp模块的编译,先source环境变量,然后在Linux终端,切换目录:

$ cd /home/$(username)/Documents/Ice/ice-3.5.1/py

$ make

成功编译后,执行测试:

$ make test

在测试的过程中出现‘Forward’没有定义的错误:

===============================================================================

starting ServerAMD.py. Traceback (most recent call last):

File "/home/zhchshen/Documents/Ice/ice-3.5.1/py/test/Ice/slicing/objects/run.py", line 31, in <module>

TestUtil.clientServerTest(server="ServerAMD.py")

File "/home/zhchshen/Documents/Ice/ice-3.5.1/scripts/TestUtil.py", line 1309, in clientServerTest serverProc = spawnServer(server, env = serverenv, lang=serverCfg.lang, mx=serverCfg.mx)

File "/home/zhchshen/Documents/Ice/ice-3.5.1/scripts/TestUtil.py", line 1125, in spawnServer server.expect("[^\n]+ ready\n")

File "/home/zhchshen/Documents/Ice/ice-3.5.1/scripts/Expect.py", line 399, in expect raise e

Expect.TIMEOUT: timeout exceeded in match

pattern: "[^\n]+ ready\n"

buffer: "/home/zhchshen/Documents/Ice/ice-3.5.1/py/test/Ice/slicing/objects/TestAMD.ice:153: `Forward\' is not defined

Traceback (most recent call last):

File \"/home/zhchshen/Documents/Ice/ice-3.5.1/py/test/Ice/slicing/objects/ServerAMD.py\", line 14, in <module>

Ice.loadSlice(\'-I. --all ServerPrivateAMD.ice Forward.ice\')

RuntimeError: Slice parsing failed for `-I. --all ServerPrivateAMD.ice Forward.ice\'"('test in /home/zhchshen/Documents/Ice/ice-3.5.1/py/test/Ice/slicing/objects failed with exit status', 256)

===============================================================================

修改文件:

/home/$(username)/Documents/Ice/ice-3.5.1/py/test/Ice/slicing/objects/TestAMD.ice的69行,双斜线注释,修改为/* */注释。然后继续make test。

4.5 其它模块的编译

其它模块包括php,ruby和vb,暂时不需要这些语言的支持,本教程没有涉及。

来源:http://blog.csdn.net/zhcshen/article/details/77121869

Ice-3.5.1在CentOS 6.5系统中的编译配置教程相关推荐

  1. linux 5识别网卡,Atheros AR8151网卡识别错误在CentOS 5.5系统中的修复

    CentOS 5.5系统是很多的小伙伴在安装的系统,那对于电脑中的问题很多的小伙伴最不想要遇到的就是系统不能上网的问题,有小伙伴在CentOS 5.5中发现无法连接网络Atheros AR8151网卡 ...

  2. CENTOS/RHEL 7 系统中设置SYSTEMD SERVICE的ULIMIT资源限制

    转自 http://smilejay.com/2016/06/centos-7-systemd-conf-limits/ 在bash中,有个ulimit命令,提供了对shell及该shell启动的进程 ...

  3. CentOS 6.5系统下安装和配置NFS服务

    一.环境介绍: 服务器:centos 192.168.1.225 客户端:centos 192.168.1.226 二.安装: NFS的安装配置: centos 5 : 1 yum -y instal ...

  4. Mac VirtualBox 命令行Centos 挂载Mac系统中的文件夹

    注意操作前请备份镜像 防止系统崩溃 1 https://www.cnblogs.com/mychangee/p/12087951.html#_5 2 centos安装增强功能出现kernel head ...

  5. 如何在CentOS 8.1系统中安装mkcert及其用法

    在CentOS和Fedora中安装mkcert类似于Ubuntu/Debian安装,只需要先安装nss-tools工具: sudo yum install nss-tools 安装完成后,下载二进制包 ...

  6. centos redis验证_centos7中安装、配置、验证、卸载redis

    本文介绍在centos7中安装.配置.验证.卸载redis等操作,以及在使用redis中的一些注意事项. 一 安装redis 1 创建redis的安装目录 利用以下命令,切换到/usr/local路径 ...

  7. 修改CentOS 7.2系统的主机名

    之前使用网上的大部分说法,修改了两个配置文件: /etc/hosts /etc/sysconfig/network 然后,并没有什么卵用. 后来,搜阿里云配置,看到这个办法: 使用"经典网络 ...

  8. CentOS 7系统中查看网卡信息

    1,查看网卡信息(ifconfig) 因一直习惯使用 ifconfig 命令查看 CentOS 中的网络连接,包括 IP 地址.MAC 地址.网络连接状态等.升级到 CentOS 7 之后 ifcon ...

  9. linux centos 7查看网卡信息,CentOS 7系统中查看网卡信息

    1,查看网卡信息(ifconfig) 因一直习惯使用 ifconfig 命令查看 CentOS 中的网络连接,包括 IP 地址.MAC 地址.网络连接状态等.升级到 CentOS 7 之后 ifcon ...

最新文章

  1. 简单介绍Lua中三种循环语句的使用
  2. Oracle字符集的查看查询和Oracle字符集的设置修改
  3. C#3.0笔记(五)Lambda表达式
  4. 体感(Kinect)开发要点总结一
  5. 整理了二个基本的css库(高手请绕道)
  6. Redis持久化(RDB 和 AOF)
  7. c语言sgoto 标志位,如何在Go中设置TCP数据包的“不分段”标志位?(How to set “don't fragment” flag bit for TCP packet in Go?)...
  8. 2.12 主成分分析(下)
  9. linux环境手动编译安装Nginx实践过程 附异常解决
  10. 002-一般处理程序(HttpHandler)
  11. 使用CrossFTP跨越不同站点复制/移动数据
  12. Android的Gallery3D模块介绍
  13. 埃氏筛_四种形式 ( pass even , bool , char , differently judge )
  14. 连续时间 Markov 链从某一状态 i 转移到其他状态之前在 i 逗留的时间服从指数分布
  15. Qtum量子链周报(7月29日-8月4日)
  16. scrapy--Rule()与LinkExtractor()函数理解
  17. H264码流中NALU sps pps IDR帧的理解
  18. 超越源域的攻击:面向黑盒域制作对抗样本
  19. 【旧资料整理】8086汇编 鼠标操作
  20. Linus Torvalds 在 22 号宣布Linux 5.18发布

热门文章

  1. alexnet训练多久收敛_卷积神经网络之AlexNet
  2. 「Ubuntu」仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal Release” 没有 Release 文件。
  3. 5.中文问题(自身,操作系统级别,应用软件的本身),mysql数据库备份
  4. 视差图转为深度图_Parallax Mapping视差映射:模拟冰块
  5. 装完黑苹果怎么装windows_BlackArch(黑Arch)、怎么装?
  6. HTML文件撰写的注意事项有哪些,CSS及HTML 常见误区和注意事项(一)
  7. 使用genext2fs制作ramdisk
  8. modelsim与modelsim_altera使用的一些区别
  9. Ubuntu NFS服务器的配置
  10. 编写一个函数,函数接收一个字符串,是由十六进制数组成的一组字符串,函数的功能是把接到的这组字符串转换成十进制数字.并将十进制数字返回