ubuntu15.04下搭建Ice3.4.1开发环境

来源:互联网 发布:p级袖珍战列舰数据 编辑:程序博客网 时间:2024/06/07 18:12

由于工作需要,需要在我的64位的ubuntu15.04上搭建Ice3.4.1的开发环境。经过几天的断断续续的百度谷歌终于把它搭建起来。发现自己无论做什么,完全按照网上的步骤来,但总会遇到各种问题,无法像网上给出的步骤那样顺利安装。好了,废话少说,下面开始。
1.首先给出ice的官网,后面需要的资料都会在这里下载:https://zeroc.com/。
2.由于开始接触ice,所以我先安装了ice3.6。其实3.6的安装步骤是很简单,官网已经给出了。步骤如下:

Ubuntu 15.04wget https://zeroc.com/download/GPG-KEY-zeroc-releasesudo apt-key add GPG-KEY-zeroc-releasesudo apt-add-repository "deb https://zeroc.com/download/apt/ubuntu15.04 stable main"sudo apt-get updatesudo apt-get install zeroc-ice-all-runtime zeroc-ice-all-dev

3.但我需要的是3.4.1,所以体验完就要卸载了:

sudo apt-get remove --purge zeroc-ice-all-runtime zeroc-ice-all-devsudo apt-get autoremove --purge zeroc-ice-all-runtime zeroc-ice-all-dev

4.下载ice3.4.1,地址:https://zeroc.com/download/Ice/3.4/
需要下载的包括:Ice-3.4.1.tar.gz 和ThirdParty-Sources-3.4.1.tar.gz其中ThirdParty-Sources-3.4.1.tar.gz 是所需的第三方库,有点坑爹的是,我当时没有注意到官网也有提供,所以到各个第三方库的官网去找,浪费了很多时间。下面是安装步骤:

4.1 解压Ice-3.4.1.tar.gz到/opt/Ice-3.4.1;解压ThirdParty-Sources-3.4.1.tar.gz。
4.2编译安装第三方库
解压:tar xzf 文件名
bzip2-1.0.5:

cd bzip2-1.0.5修改Makefile:PREFIX=/opt/Ice-3.4.1/bzip2-1.0.5makemake install

mcpp-2.7.2:

./configure --prefix=/opt/Ice-3.4.1/mcpp-2.7.2/ CFLAGS=-fPIC -enable-mcpplib -disable-sharedmakemake install

db-4.8.30:

cd db-4.8.30.NC/build_unix/../dist/configure --prefix=/opt/Ice-3.4.1/db-4.8.30 -enable-cxxmakemake install

expat-2.0.1:

./configure --prefix=/opt/Ice-3.4.1/expat-2.0.1makemake install

openssl:

./config --prefix=/opt/Ice-3.4.1/opensslmakemake install

5.安装ice3.4.1
5.1修改Ice-3.4.1/cpp/config/Make.rules

BZIP2_HOME              ?=/opt/Ice-3.4.1/bzip2-1.0.5## If Berkeley DB is not installed in a standard location where the# compiler can find it, set DB_HOME to the Berkeley DB installation# directory.##DB_HOME                ?=/opt/Ice-3.4.1/BerkeleyDB.6.1DB_HOME         ?=/opt/Ice-3.4.1/db-4.8.30## If expat is not installed in a standard location where the compiler# can find it, set EXPAT_HOME to the expat installation directory.#EXPAT_HOME              ?=/opt/Ice-3.4.1/expat-2.0.1## If OpenSSL is not installed in a standard location where the# compiler can find it, set OPENSSL_HOME to the OpenSSL installation# directory.#OPENSSL_HOME            ?=/opt/Ice-3.4.1/openssl## If MCPP is not installed in a standard location where the compiler # can find it, set MCPP_HOME to the Mcpp installation directory.#MCPP_HOME               ?=/opt/Ice-3.4.1/mcpp-2.7.2

5.2编译:make
发生错误:
1.各种缺少头文件,手动添加。

2.到最后如果显示跟 upCast 有关的错误。则需要到https://forums.zeroc.com/forum/patches/5799-patch-for-compiling-ice-with-clang-and-gcc4-7?t=5647下载补丁,打完补丁后,重新编译。中间可能会有跟XXX.o找不到的错误有关,我这里是有些需要lib64,所以将第三方支持库的一些lib改为lib64,后面如遇到symbol bad什么的错误,就将对应的库删掉。

5.3 make install

6.配置/etc/profile

export ICE_HOME=/opt/Ice-3.4.1  export PATH=$ICE_HOME/bin:$PATH  export LD_LIBRARY_PATH=$ICE_HOME/lib64:$LD_LIBRARY_PATH

7.test

icegridnode -v3.4.1

到此,64位ubuntu15.04下的Ice3.4.1编译安装成功。

0 0
原创粉丝点击