Results 1 to 2 of 2

Thread: Ice-3.0.1 with a non standard install of DB

  1. #1
    josephwinston is offline Registered User
    Join Date
    Jul 2005
    Posts
    3

    Ice-3.0.1 with a non standard install of DB

    Here's the context diffs to get ICE to link with a non stanard location for the database.

    ==== //depot/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/backup/Makefile#1 - /home/jody/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/backup/Makefile ====
    ***************
    *** 25,31 ****

    $(CLIENT): $(OBJS) $(COBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lFreeze $(LIBS)

    IntLongMap.h IntLongMap.cpp: $(SLICE2FREEZE)
    rm -f IntLongMap.h IntLongMap.cpp
    --- 25,31 ----

    $(CLIENT): $(OBJS) $(COBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lFreeze $(DB_LIBS) $(LIBS)

    IntLongMap.h IntLongMap.cpp: $(SLICE2FREEZE)
    rm -f IntLongMap.h IntLongMap.cpp
    ==== //depot/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/bench/Makefile#1 - /home/jody/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/bench/Makefile ====
    ***************
    *** 25,31 ****

    $(CLIENT): $(OBJS) $(COBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lFreeze $(LIBS)

    BenchTypes.h BenchTypes.cpp: Test.ice $(SLICE2FREEZE)
    rm -f BenchTypes.h BenchTypes.cpp
    --- 25,31 ----

    $(CLIENT): $(OBJS) $(COBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) -lFreeze $(DB_LIBS) $(LIBS)

    BenchTypes.h BenchTypes.cpp: Test.ice $(SLICE2FREEZE)
    rm -f BenchTypes.h BenchTypes.cpp
    ==== //depot/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/library/Makefile#1 - /home/jody/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/library/Makefile ====
    ***************
    *** 55,65 ****

    $(SERVER): $(OBJS) $(SOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze $(LIBS)

    $(COLLOCATED): $(OBJS) $(COLOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) -lFreeze $(LIBS) $(READLINE_LIBS)

    LibraryTypes.h LibraryTypes.cpp: Library.ice $(SLICE2FREEZE)
    rm -f LibraryTypes.h LibraryTypes.cpp
    --- 55,65 ----

    $(SERVER): $(OBJS) $(SOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze $(DB_LIBS) $(LIBS)

    $(COLLOCATED): $(OBJS) $(COLOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) -lFreeze $(DB_LIBS) $(LIBS) $(READLINE_LIBS)

    LibraryTypes.h LibraryTypes.cpp: Library.ice $(SLICE2FREEZE)
    rm -f LibraryTypes.h LibraryTypes.cpp
    ==== //depot/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/phonebook/Makefile#1 - /home/jody/src/Tools/Distributed/Ice/Ice-3.0.1/demo/Freeze/phonebook/Makefile ====
    ***************
    *** 55,65 ****

    $(SERVER): $(OBJS) $(SOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze $(LIBS)

    $(COLLOCATED): $(OBJS) $(COLOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) -lFreeze $(LIBS) $(READLINE_LIBS)

    NameIndex.h NameIndex.cpp: PhoneBook.ice $(SLICE2FREEZE)
    rm -f NameIndex.h NameIndex.cpp
    --- 55,65 ----

    $(SERVER): $(OBJS) $(SOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze $(DB_LIBS) $(LIBS)

    $(COLLOCATED): $(OBJS) $(COLOBJS)
    rm -f $@
    ! $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) -lFreeze $(DB_LIBS) $(LIBS) $(READLINE_LIBS)

    NameIndex.h NameIndex.cpp: PhoneBook.ice $(SLICE2FREEZE)
    rm -f NameIndex.h NameIndex.cpp
    Joseph Winston
    Programmer at Bluware (http://www.bluware.com/)
    Ice Projects -- Just evaluation

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Joseph,

    Let me explain the issue for other forum readers:
    in C++, Freeze uses Berkeley DB internally. The Freeze API does not expose any DB API in its headers, and the Freeze library is linked with the C++ DB library.
    On a number of platforms, when creating an executable, the linker insists to see all shared libraries dependencies, even indirect dependencies. So when you link with "libFreeze", the linker wants to find "libdb_cxx".

    As of Ice 3.0.1, the recommended way to make the linker happy when Berkeley DB is not installed in /usr/lib is to put the Berkeley DB lib directory in LD_LIBRARY_PATH (or another variable depending on your platform/linker). For example:
    export LD_LIBRARY_PATH=/opt/db/lib:$LD_LIBRARY_PATH

    Adding DB_LIBS in the various Makefiles (this patch) is another solution, but it's more complicated.

    Ice 3.1 will provide a nicer solution. All Makefiles have been updated to provide third-party directories using -rpath-link (Linux) or -L (Solaris, HP-UX).

    Also Joseph, please update your signature as desbribed here.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 12-17-2009, 10:12 AM
  2. Replies: 4
    Last Post: 03-01-2008, 10:24 PM
  3. Is there a standard way to esacpe '#' in config files?
    By Markus Bernhard in forum Help Center
    Replies: 2
    Last Post: 12-02-2007, 06:54 AM
  4. Replies: 5
    Last Post: 03-25-2004, 05:58 PM
  5. static linking of standard libs
    By galbe in forum Help Center
    Replies: 4
    Last Post: 03-08-2004, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •