标签:linux
yum install gcc gcc-c++ glibc-headers -y #cd mcpp-2.7.2
#./configure --prefix=/usr/local/ice/mcpp CFLAGS=-fPIC -enable-mcpplib -disable-shared
#make && make install
2、安装 BerkeleyDB:
#cd db-5.3.21.NC/build_unix
#../dist/configure --prefix=/usr/local/ice/db --enable-cxx --enable-java
#make && make install
3、安装bzip2:
#cd bzip2-1.0.6
#vi Makefile //编辑Makefile,
1)将其中的PREFIX修改成 /usr/local/ice/bzip2
2)在其中的CFLAGS参数的值后添加 -fPIC
#make && make install
4、安装expat:
#cd expat-2.2.1
#./configure --prefix=/usr/local/ice/expat
#make && make install
5、安装openssl:
#cd openssl-master
#./config --prefix=/usr/local/ice/openssl enable-shared -fPIC
#make && make install
6、建立 lib64 到各依赖库的lib软连接(添加环境变量,让程序可以识别)
ln -s /usr/local/ice/mcpp/lib/ /usr/lib/
ln -s /usr/local/ice/db/lib/ /usr/lib/
ln -s /usr/local/ice/bzip2/lib/ /usr/lib/
ln -s /usr/local/ice/expat/lib/ /usr/lib/
ln -s /usr/local/ice/openssl/lib/* /usr/lib/
7、安装Ice-3.6.3
#cd Ice-3.6.3/cpp
#vi config/Make.rules // 编辑Make.rules文件
# prefix ?= /opt/Ice-$(VERSION)
prefix ?= /usr/local/ice/Ice-3.6.3
#embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
embedded_runpath_prefix ?= /usr/local/ice/Ice-3.6.3
BZIP2_HOME ?= /usr/local/ice/bzip2
DB_HOME ?= /usr/local/ice/db
EXPAT_HOME ?= /usr/local/ice/expat
OPENSSL_HOME ?= /usr/local/ice/openssl
MCPP_HOME ?= /usr/local/ice/mcpp
#make && make install
#vi /etc/profile //设置Ice-3.6.3的环境变量
ICEJ_HOME=/usr/local/ice/Ice-3.6.3
PATH=$ICEJ_HOME/bin:$PATH
export ICEJ_HOME PATH
#source /etc/profile
#cd Ice-3.6.3/java
make && make install
#遇到的问题:
1、编译cpp出错,添加参数 /usr/local/src/ice/ice-3.6.3/cpp/config/Make.rules.Linux
BASELIBS = -lIceUtil -lpthread -lrt -liconv
2、编译java出错,找不到db.jar ,在编译 BerkeleyDB 添加参数--enable-java
3、编译java出错, /usr/local/src/ice/ice-3.6.3/cpp/bin/slice2java command failed: 1
查出来是由于,实验是写错了路径,导致有些库找不到
标签:linux
原文地址:http://blog.51cto.com/11962757/2092055