Install ICE3.4.2 For Linux

來源:互聯網
上載者:User

ICE在Linux下的完整編譯安裝
安裝平台要求:最好用gcc 4.x版編譯ICE,在Slackware下發現gcc3.3.6和gcc3.4.6都無法編譯通過
為了方便管理,將ICE相關的軟體都安裝到/usr/local/ICE-3.3.0/目錄下
 
首先 安裝第三方包:ThirdParty-Sources-3.3.0.tar.gz
解壓 ThirdParty-Sources-3.3.0.tar.gz
# cd ThirdParty-Sources-3.3.0
 
1)mcpp  is a C/C++ preprocessor
------
解壓 mcpp-2.7.2.tar.gz
# cd mcpp-2.7.2
# ./configure --prefix=/usr/local/ICE-3.3.0/mcpp-2.7.2/ CFLAGS=-fPIC -enable-mcpplib -disable-shared
# make
# make install
 
2)Berkeley DB  是一個高效能的,嵌入資料庫編程庫,和C語言, C++, Java, Perl, Python, Tcl以及其他很多語言都有綁定。
--------
解壓 db-4.6.21.NC.tar.gz
# cd db-4.6.21.NC
# cd build_unix
# ../dist/configure --prefix=/usr/local/ICE-3.3.0/BerkeleyDB.4.6/ -enable-cxx
# make
# make install
 
3)bzip2 是 Julian Seward 開發並按照自由軟體/開源軟體協議發布的資料壓縮演算法及程式
--------
解壓 bzip2-1.0.5.tar.gz
# cd bzip2-1.0.5
修改Makefile,將PREFIX指向/usr/local/ICE-3.3.0/bzip2-1.0.5
# make
# make install
 
4) expat 是一個 XML parsing C library
--------
解壓 expat-2.0.1.tar.gz
# cd expat-2.0.1
# ./configure --prefix=/usr/local/ICE-3.3.0/expat-2.0.1/
# make
# make install
 
5) openssl 是 Secure Socket Layer (SSL) binary and related cryptographic tools
--------
解壓 openssl-0.9.8g.tar.gz
# cd openssl-0.9.8g
# ./config --prefix=/usr/local/ICE-3.3.0/openssl
# make
# make install
 
現在正式安裝 Ice-3.3.0.tar.gz
--------
解壓 Ice-3.3.0.tar.gz
1) 編譯 cpp版本:
# cd Ice-3.3.0/cpp
# vi config/Make.rules
 

...
#
# Select an installation base directory. The directory will be created
# if it does not exist.
#

# prefix ?= /opt/Ice-$(VERSION)
prefix ?= /usr/local/ICE-3.3.0/Ice-$(VERSION)
 
#
# The "root directory" for runpath embedded in executables. Can be unset
# to avoid adding a runpath to Ice executables.
#

# embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
embedded_runpath_prefix ?= /usr/local/ICE-3.3.0/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
...
#
#
# If libbzip2 is not installed in a standard location where the
# compiler can find it, set BZIP2_HOME to the bzip2 installation
# directory.
#
BZIP2_HOME             ?= /usr/local/ICE-3.3.0/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/db
DB_HOME ?= /usr/local/ICE-3.3.0/BerkeleyDB.4.6
 
#
# 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/expat
EXPAT_HOME ?= /usr/local/ICE-3.3.0/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/openssl
OPENSSL_HOME ?= /usr/local/ICE-3.3.0/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/mcpp
MCPP_HOME ?= /usr/local/ICE-3.3.0/mcpp-2.7.2
...
特別注意: cpp/config/Make.rules的相關第三方庫的路徑
# make
# make install
 
2)編譯python  版本
# cd Ice-3.3.0/py
# vi config/Make.rules
修改方法參考cpp部分描述
# make
# make install

設定ICE環境變數
#vi /etc/profile
 

export PYTHONPATH=/usr/local/ICE-3.3.0/Ice-3.3/python/:
export ICE_HOME=/usr/local/ICE-3.3.0/Ice-3.3
export PATH=$PATH:$ICE_HOME/bin
export LD_LIBRARY_PATH=$ICE_HOME/lib
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC ICE_HOME
#source /etc/profile

++++++++++++++++++++++++++++++++++++++++

安裝Ice3.4.2之前,應該下載並安裝其依賴庫。

1. 下載第三方包和Ice源檔案:http://www.zeroc.com/download.html(官方下載頁面)

在Source Distributions一欄下下載源檔案:Ice-3.4.2.tar.gz;在Third-Party Source Code 一欄下選擇ThirdParty-Sources-3.4.2.tar.gz第三方壓縮包下載。

2. 安裝第三方依賴庫

    解壓ThirdParty-Sources-3.4.2.tar.gz:tar -xzvf ThirdParty-Sources-3.4.2.tar.gz 。

    2.1) 安裝Berkeley DB

          $tar zxvf db-4.8.30.NC.tar.gz

          $cd db-4.8.30.NC/build_unix

          $../dist/configure --prefix=/usr --enable-cxx

                     (說明:db的預設安裝prefix路徑是/usr/local/BerkeleyDB.4.6,需要改為/usr,否則make Ice時會找不到路徑)
          $make                                     #編譯
          $sudo make install              #安裝

   2.2)安裝 bzip2-1.0.6.tar.gz    

          $tar zxvf bzip2-1.0.6.tar.gz

          $cd bzip2-1.0.6

          $make install

   2.3)安裝 expat-2.0.1.tar.gz

          $tar zxvf expat-2.0.1.tar.gz
          $cd expat-2.0.1
          $./configure
          $sudo make install

   2.4)安裝openssl-0.9.8d.tar.gz

          $tar zxvf openssl-0.9.8d.tar.gz
          $cd openssl-0.9.8d
          $./config --prefix=/usr --openssldir=/usr/openssl
           (注意:prefix為/usr/local/ssl,openssldir預設為/usr/ssl/openssl,需要改為上面的,否則預設安裝路徑會找不到。)
          $ make
          $ make test
          $ sudo make install

    2.5)安裝mcpp

          $sudo apt-get install libmcpp-dev

 

3.安裝Ice-3.4.2    

          $tar zxvf Ice-3.4.2.tar.gz
          $cd Ice-3.4.2/cpp

          $export LD_LIBRARY_PATH=/opt/Ice-3.4.2/lib

          $make
          $sudo make install

 

4.安裝過程中出現的一些錯誤,及解決方案:

     4.1)錯誤提示:/usr/lib.ld:Error:cannot find -lmcpp   --->解決方案:應該是mcpp之前沒有安裝成功,將mcpp重新安裝成功後就行

     4.2)錯誤提示:fatal error:db_cxx.h:No such file or directory   -->解決方案:之前沒有把db-4.8.3安裝成功,重新安裝一遍

     4.3)安裝Ice完成後,運行例子錯誤提示:error while loading shared libraries: libIce.so.34: cannot open shared object file: No such file or directory  -->解決辦法:應該是之前編譯Ice某些目錄配置不對;使用命令 export LD_LIBRARY_PATH=/opt/Ice-3.4.2/lib重新來匯出動態連結程式庫目錄即可。

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.