Archived

This forum has been archived. Please start a new discussion on GitHub.

Install Ice 3.3.1 on a Gentoo System

Hi

I have some problems to install ICE on a 64-Bit Gentoo Linux System. I want to integrate code from a student in my c++ project.

The Readme says, that i need the following packages to install ICE on my Linux system:

- Berkeley DB 4.6.21
- expat 1.95.7 or 2.0.1
- OpenSSL 0.9.7 or later (OpenSSL 0.9.8 or later recommended)
- bzip2 1.0.x
- mcpp 2.7.2

openssl, bzip and mcpp should be installed on my system, but i don't really know, how I should prove, if Berkeley and expat are installed. I don't have administration rights, so i can't install easily (it is possible, I only have to go to the operator and tell him, what i need) this packages.

The next step was to modify the Make.rules.
# **********************************************************************
#
# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

#
# Select an installation base directory. The directory will be created
# if it does not exist.
#
prefix			 ?= /home/qc1/Ice-Libs/

#
# The "root directory" for runpath embedded in executables. Can be unset
# to avoid adding a runpath to Ice executables.
#
embedded_runpath_prefix  ?= /home/qc1/Ice-rootpath/

#
# Define OPTIMIZE as yes if you want to build with
# optimization. Otherwise Ice is build with debug information.
#
#OPTIMIZE		= yes

#
# Define LP64 as yes or no if you want force a 32 or 64 bit. The
# default is platform-dependent
#
#LP64			?= yes


#
# Define USE_READLINE as yes if you want to build parts of Ice using
# readline on platforms where readline is available (see
# PLATFORM_HAS_READLINE in Make.rules.$(UNAME))
#
# readline is used by a number of Ice admin programs to provide
# command history, an optional feature.
#
# readline is licensed by the Free Software Foundation under the GNU
# Public License v2, and cannot be combined with GPL-incompatible
# software in any program. In particular the OpenSSL license is
# GPL-incompatible.
#
# If you combine Ice with more GPL-incompatible software, or have
# licensed Ice under a commercial (non-GPL) license, you should ponder
# the licensing implications of using readline.
# 

USE_READLINE		?= no


#
# 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		?= /opt/bzip2


#
# 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

#
# 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

#
# 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

#
# 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

#
# If readline is not installed in a standard location where the
# compiler can find it, AND you want to use readline, set
# READLINE_HOME to the readline installation directory.
#
#READLINE_HOME		?= /opt/readline

#
# Generate position independent code unless GENPIC is set to no
#
#GENPIC                     ?= yes

I hope, I did it right. qc1 is my username and i have on my homefolder the rights to create and write files.

After trying to compile the ICE, i got this error messages:
make[2]: Entering directory `/home/qc1/Ice-3.3.1/cpp/src/Freeze'
c++ -c -I.. -I../../include -DFREEZE_API_EXPORTS   -m64 -ftemplate-depth-128 -Wall -D_REENTRANT -I/usr/include/nptl -fPIC -g  BackgroundSaveEvictorI.cpp
In file included from ../Freeze/ObjectStore.h:18,
                 from ../Freeze/EvictorI.h:16,
                 from ../Freeze/BackgroundSaveEvictorI.h:13,
                 from BackgroundSaveEvictorI.cpp:10:
../Freeze/TransactionI.h:15:20: error: db_cxx.h: No such file or directory
In file included from ../Freeze/EvictorI.h:16,
                 from ../Freeze/BackgroundSaveEvictorI.h:13,
                 from BackgroundSaveEvictorI.cpp:10:
../Freeze/ObjectStore.h:62: error: ISO C++ forbids declaration of 'Db' with no type
../Freeze/ObjectStore.h:62: error: expected ';' before '*' token
../Freeze/ObjectStore.h:74: error: 'Db' was not declared in this scope
../Freeze/ObjectStore.h:74: error: template argument 1 is invalid
../Freeze/ObjectStore.h:135: error: expected initializer before '*' token
In file included from BackgroundSaveEvictorI.cpp:14:
../Freeze/Util.h:29: error: 'Dbt' has not been declared
../Freeze/Util.h: In function 'void Freeze::initializeInDbt(const std::vector<unsigned char, std::allocator<unsigned char> >&, int&)':
../Freeze/Util.h:31: error: request for member 'set_data' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:32: error: request for member 'set_size' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:33: error: request for member 'set_ulen' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:34: error: request for member 'set_dlen' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:35: error: request for member 'set_doff' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:36: error: request for member 'set_flags' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:36: error: 'DB_DBT_USERMEM' was not declared in this scope
../Freeze/Util.h: At global scope:
../Freeze/Util.h:40: error: 'Dbt' has not been declared
../Freeze/Util.h: In function 'void Freeze::initializeOutDbt(std::vector<unsigned char, std::allocator<unsigned char> >&, int&)':
../Freeze/Util.h:43: error: request for member 'set_data' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:44: error: request for member 'set_size' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:45: error: request for member 'set_ulen' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:46: error: request for member 'set_dlen' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:47: error: request for member 'set_doff' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:48: error: request for member 'set_flags' in 'dbt', which is of non-class type 'int'
../Freeze/Util.h:48: error: 'DB_DBT_USERMEM' was not declared in this scope
../Freeze/Util.h: At global scope:
../Freeze/Util.h:60: error: expected ',' or '...' before '&' token
../Freeze/Util.h:60: error: ISO C++ forbids declaration of 'DbException' with no type
../Freeze/Util.h:63: error: expected ',' or '...' before '&' token
../Freeze/Util.h:64: error: ISO C++ forbids declaration of 'DbException' with no type
../Freeze/Util.h:67: error: expected ',' or '...' before '&' token
../Freeze/Util.h:68: error: ISO C++ forbids declaration of 'DbException' with no type
BackgroundSaveEvictorI.cpp: In member function 'virtual void Freeze::BackgroundSaveEvictorI::run()':
BackgroundSaveEvictorI.cpp:1097: error: invalid use of incomplete type 'struct DbEnv'
../../include/Freeze/Initialize.h:22: error: forward declaration of 'struct DbEnv'
BackgroundSaveEvictorI.cpp:1102: error: invalid use of incomplete type 'struct DbTxn'
../../include/Freeze/Initialize.h:23: error: forward declaration of 'struct DbTxn'
BackgroundSaveEvictorI.cpp:1117: error: invalid use of incomplete type 'struct DbTxn'
../../include/Freeze/Initialize.h:23: error: forward declaration of 'struct DbTxn'
BackgroundSaveEvictorI.cpp:1125: error: invalid use of incomplete type 'struct DbTxn'
../../include/Freeze/Initialize.h:23: error: forward declaration of 'struct DbTxn'
BackgroundSaveEvictorI.cpp:1145: error: ISO C++ forbids declaration of 'DbDeadlockException' with no type
BackgroundSaveEvictorI.cpp:1145: error: expected `)' before '&' token
BackgroundSaveEvictorI.cpp:1145: error: expected `{' before '&' token
BackgroundSaveEvictorI.cpp:1145: error: expected primary-expression before ')' token
BackgroundSaveEvictorI.cpp:1145: error: expected `;' before ')' token
BackgroundSaveEvictorI.cpp:1416: error: expected `}' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `}' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `while' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `(' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected primary-expression at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `)' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `;' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `}' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `}' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `catch' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `(' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected type-specifier at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `)' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `{' at end of input
BackgroundSaveEvictorI.cpp:1416: error: expected `}' at end of input
make[2]: *** [BackgroundSaveEvictorI.o] Error 1
make[2]: Leaving directory `/home/qc1/Ice-3.3.1/cpp/src/Freeze'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/qc1/Ice-3.3.1/cpp/src'

And that's my problem. I don't know, what the error-messages really means. What did i wrong?
Can you please help me?

best regards
Martin

Comments

  • matthew
    matthew NL, Canada
    That means berkeley db isn't installed on your system. As an aside, you don't need to actually edit your Make.rules file. You can also set those variables in your environment.

    For example:
    prefix= /home/qc1/Ice-Libs/ make
    
  • bernard
    bernard Jupiter, FL
    You need the C++ Berkeley DB libraries ... not just the C libraries. If you build DB yourself, configure it with --enable-cxx. You can find complete build instructions for DB and other dependencies in our third-party archives: http://www.zeroc.com/download.html#src.

    Best regards,
    Bernard
  • xdm
    xdm La Coruña, Spain
    Hi Martin,

    Note that there is currently an ebuild to install Ice-3.3.1 on gentoo, so your sysadmin can install it with emerge.

    3.3.1 is masked in gentoo but your sysamdin can umask it and emerge for you.

    to unmaks add this to /etc/portage/package.keywords
    >=dev-cpp/Ice-3.3.1 ~amd64 ~x86
    >=dev-cpp/libmcpp-2.7.2 ~amd64 ~x86
    

    And then
    emerge dev-cpp/Ice
    

    Cheers,
    Jose
  • thanks for your post, matthew and xdm!

    After asking my operator for the berkeley db, he means, that I didn't need it anymore, because there are a installation of ICE on the Server.

    I know, that the programm example was compiled on another Windows PC in Visual Studio 2008. The differenz are only, that i am using ICE V3.2.1 and on the Windows PC, ICE V3.3.1 was installed. So, the only thing, that I thougt, that I should do, is to slice the 2 .ice files to cpp and added it to my eclipse work project. I only had to correct the includes (from #include <header.h> to #inlucde "header.h") and after then, the first Compile looks very positiv.

    After than, I've got a long list of Errors:
    **** Build of configuration Debug for project QCTrack2 ****
    
    make -j2 all 
    Building target: QCTrack
    Invoking: GCC C++ Linker
    g++ -L/mnt/common/qwt/lib -L/usr/lib -L/usr/lib64/qt4 -L/usr/lib64 -L/home/qc1/workspace/QCTrack/libs -o"QCTrack"  ./Fishstorm.o ./IceFish.o ./MGTrackServer.o ./MstPhoenixTracker.o ./Subscriber.o ./VZLink.o ./client.o ./controller.o ./controller_pid.o ./controller_speedestimate.o ./ftdicon.o ./gui.o ./gui_3dview.o ./gui_3dview_camera.o ./gui_eval.o ./gui_mess.o ./gui_quad.o ./gui_status_quad.o ./gui_trajektorie.o ./gui_wdaten.o ./gui_wregler.o ./gui_wregler_bs.o ./gui_wregler_pid.o ./gui_wverbind.o ./main.o ./moc_gui.o ./moc_gui_3dview.o ./moc_gui_mess.o ./moc_gui_quad.o ./moc_gui_status_quad.o ./moc_gui_trajektorie.o ./moc_gui_wdaten.o ./moc_gui_wregler.o ./moc_gui_wregler_pid.o ./moc_gui_wverbind.o ./options.o ./quadrocopter.o ./trace.o ./viztracker.o   -lqwt -lglut -lQtOpenGL -lQtGui -lftd2xx -lQtCore
    ./Fishstorm.o: In function `Demo::__patch__DudePtr(void*, IceInternal::Handle<Ice::Object>&)':
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:536: undefined reference to `Ice::UnexpectedObjectException::UnexpectedObjectException(char const*, int)'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:539: undefined reference to `Ice::UnexpectedObjectException::~UnexpectedObjectException()'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:539: undefined reference to `typeinfo for Ice::UnexpectedObjectException'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:539: undefined reference to `Ice::UnexpectedObjectException::~UnexpectedObjectException()'
    ./Fishstorm.o: In function `Demo::Dude::__read(IceInternal::Handle<Ice::InputStream> const&, bool)':
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:523: undefined reference to `Ice::MarshalException::MarshalException(char const*, int)'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:525: undefined reference to `Ice::MarshalException::~MarshalException()'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:525: undefined reference to `typeinfo for Ice::MarshalException'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:525: undefined reference to `Ice::MarshalException::~MarshalException()'
    ./Fishstorm.o: In function `Demo::Dude::__write(IceInternal::Handle<Ice::OutputStream> const&) const':
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:515: undefined reference to `Ice::MarshalException::MarshalException(char const*, int)'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:517: undefined reference to `Ice::MarshalException::~MarshalException()'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:517: undefined reference to `typeinfo for Ice::MarshalException'
    /home/qc1/workspace/QCTrack2/Debug/../Fishstorm.cpp:517: undefined reference to `Ice::MarshalException::~MarshalException()'
    ./Fishstorm.o: In function `Demo::Dude::__read(IceInternal::BasicStream*, bool)':
    
    (...)
    
    ./VZLink.o: In function `Subscriber':
    /home/qc1/workspace/QCTrack2/Debug/../Subscriber.h:28: undefined reference to `Ice::Application::Application()'
    /home/qc1/workspace/QCTrack2/Debug/../Subscriber.h:28: undefined reference to `Ice::Application::~Application()'
    ./VZLink.o:(.rodata._ZTV6VZLink[vtable for VZLink]+0x28): undefined reference to `Ice::Application::interruptCallback(int)'
    ./client.o: In function `__static_initialization_and_destruction_0':
    /usr/include/Ice/FactoryTable.h:26: undefined reference to `IceInternal::FactoryTable::FactoryTable()'
    /usr/include/Ice/FactoryTable.h:26: undefined reference to `IceInternal::FactoryTable::~FactoryTable()'
    ./client.o: In function `__static_initialization_and_destruction_0':
    /usr/include/Ice/Locator.h:173: undefined reference to `Ice::AdapterNotFoundException::~AdapterNotFoundException()'
    ./client.o: In function `Client::RelayRecieveChannelNames()':
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:88: undefined reference to `IceUtil::operator<<(std::basic_ostream<char, std::char_traits<char> >&, IceUtil::Exception const&)'
    ./client.o: In function `Client::RelayPInfoS(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:77: undefined reference to `IceUtil::operator<<(std::basic_ostream<char, std::char_traits<char> >&, IceUtil::Exception const&)'
    ./client.o: In function `Client::RelayPInfo(int, int, int)':
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:67: undefined reference to `IceUtil::operator<<(std::basic_ostream<char, std::char_traits<char> >&, IceUtil::Exception const&)'
    ./client.o: In function `Client::RelayGetNumTargets()':
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:51: undefined reference to `IceUtil::operator<<(std::basic_ostream<char, std::char_traits<char> >&, IceUtil::Exception const&)'
    ./client.o: In function `Client::startclient(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:19: undefined reference to `Ice::initialize(Ice::InitializationData const&, int)'
    /home/qc1/workspace/QCTrack2/Debug/../client.cpp:32: undefined reference to `IceUtil::operator<<(std::basic_ostream<char, std::char_traits<char> >&, IceUtil::Exception const&)'
    ./client.o:(.gcc_except_table+0x44): undefined reference to `typeinfo for IceUtil::Exception'
    ./client.o:(.gcc_except_table+0x64): undefined reference to `typeinfo for IceUtil::Exception'
    ./client.o:(.gcc_except_table+0x84): undefined reference to `typeinfo for IceUtil::Exception'
    ./client.o:(.gcc_except_table+0xa0): undefined reference to `typeinfo for IceUtil::Exception'
    ./client.o:(.gcc_except_table+0x1c4): undefined reference to `typeinfo for IceUtil::Exception'
    ./client.o: In function `IceInternal::ProxyHandle<IceProxy::Fishserver::Communication> IceInternal::checkedCastImpl<IceInternal::ProxyHandle<IceProxy::Fishserver::Communication> >(IceInternal::ProxyHandle<IceProxy::Ice::Object> const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const*)':
    /usr/include/Ice/Proxy.h:435: undefined reference to `typeinfo for IceProxy::Ice::Object'
    /usr/include/Ice/Proxy.h:441: undefined reference to `IceProxy::Ice::Object::__copyFrom(IceInternal::ProxyHandle<IceProxy::Ice::Object> const&)'
    collect2: ld returned 1 exit status
    make: *** [QCTrack] Error 1
    
    

    I thought, this happens, when I am not using the right preprocessor definitions (like in QT -lQtGui). But in the Visual Studio 2008 Preference of the Project, there are no Libs there.
    Here a screenshot:
    ImageBanana - problem.png

    The Libaries of ICE are all in the /usr/lib Folder.

    what did i wrong?
  • dwayne
    dwayne St. John's, Newfoundland
    You are not linking with the Ice libraries. You need to add "-lIce -lIceUtil" to your link line.
  • thanks for your help!
    now, all is working fine!
  • I'm also on gentoo trying to install Ice 3.3.1, having problems with berkdb.

    I have version 4.6.21 installed with cpp headers, but the make script didn't even try to include it. So what I did was whenever the build script reached files that needed db_cxx.h, I copied the command that failed:

    c++ -c -I.. -I../../include -m64 -ftemplate-depth-128 -Wall -D_REENTRANT -I/usr/include/nptl -fPIC -g Transformer.cpp

    then I changed to the directory it was executed from (cpp/src/FreezeScript), added "-I/usr/include/db4.6" to the command, changed the filename to *.cpp and compiled everything in that directory:

    c++ -c -I.. -I../../include -m64 -ftemplate-depth-128 -Wall -D_REENTRANT -I/usr/include/nptl -fPIC -g -I/usr/include/db4.6 *.cpp

    then went back to the cpp directory and continued make from there.


    Seems to work so far.
  • benoit
    benoit Rennes, France
    Hi,

    Search for DB_FLAGS in cpp/config/Make.rules, changing /usr/include/db46 to /usr/include/db4.6 should fix your issue.

    Cheers,
    Benoit.
  • Yeah I had already done that with no luck, but setting DB_HOME to /usr/include/db4.6 and setting DB_FLAGS to -I$(DB_HOME) worked.