Go Back   ZeroC Forums > Patches

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-23-2006
josephwinston 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
Reply With Quote
  #2 (permalink)  
Old 05-23-2006
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about install ICE on Linux oraclexiao Help Center 3 11-03-2005 03:18 AM
Install Ice2.12 on Tru64 myer Patches 1 08-16-2005 12:32 PM
make install uphill Bug Reports 0 05-06-2005 09:55 AM
static linking of standard libs galbe Help Center 4 03-08-2004 11:24 AM
INSTALL.LINUX typo Ivan Bug Reports 1 05-30-2003 12:27 PM


All times are GMT -4. The time now is 06:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.