[Python-bugs-list] [Bug #132600] 2.1a2 tries to build bsddb without "-ldb"

noreply@sourceforge.net noreply@sourceforge.net
Fri, 23 Feb 2001 08:34:08 -0800


Bug #132600, was updated on 2001-Feb-15 12:51
Here is a current snapshot of the bug.

Project: Python
Category: Build
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Submitted by: mfavas
Assigned to : akuchling
Summary: 2.1a2 tries to build bsddb without "-ldb"

Details: Platform: Tru64 Unix, V4.0F, Compaq C compiler version: Compaq C
V6.3-129 (dtk) on Digital UNIX V4.0F  (Rev. 1229), Compiler Driver V6.3-126
(dtk)

"make" causes setup.py to generate the following compile/link lines for the
bsddb extension:

cc -O -Olimit 1500 -I.
-I/home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/./Include
-IInclude/ -I/usr/local/include -c
/home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/Modules/bsddbmodule.c
-o build/temp.osf1-V4.0-alpha-2.1/bsddbmodule.o
ld -shared -expect_unresolved *
build/temp.osf1-V4.0-alpha-2.1/bsddbmodule.o -L/usr/local/lib -o
build/lib.osf1-V4.0-alpha-2.1/bsddb.so

The lack of a "-ldb" in the ld command causes "make test" to skip the bsddb
test (and "import bsddb" to fail) due to unresolved symbols. Looking at the
code in setup.py, the "-ldb" is only included if "db_185.h" is found. If
"db.h" is found instead, no "-l" is appended to the link line. Compaq Tru64
comes standard with db (a Compaq-modified 1.85 version, I believe), with
/usr/include/db.h and /usr/lib/libdb.a and /usr/shlib/libdb.so. Manually
adding "-ldb" to the above link line allows test_bsddb to run and pass.

Follow-Ups:

Date: 2001-Feb-23 08:34
By: akuchling

Comment:
Apparently fixed by patch #103937. 
-------------------------------------------------------

Date: 2001-Feb-22 15:58
By: mfavas

Comment:
Andrew, I've just tried your revised patch - works fine on my platform,
thanks!
-------------------------------------------------------

Date: 2001-Feb-22 08:05
By: akuchling

Comment:
I've submitted a further revised patch that tries to resolve
all the problems surrounding the bsddb module.  Does it work for you?

http://sourceforge.net/patch/?func=detailpatch&patch_id=103937&group_id=5470
-------------------------------------------------------

Date: 2001-Feb-19 15:07
By: mfavas

Comment:
I've just submitted a patch to setup.py to fix this - patch ID 103886.
-------------------------------------------------------

Date: 2001-Feb-16 02:47
By: twouters

Comment:
This bug is connected to at least one other bsddb bug ("clash with BSD db
when building", #117464) and maybe more. I think the solution is to rip out
all the autoconf stuff and do all the detecting in setup.py. I'm not sure
how to do it, though, and I don't have time to learn distutils right now
:-)

Andrew, assigning this (as well as the other bug) to you, so you can
consider the distutils solution. I can give you a rundown on how it should
work: basically, it should check for /usr/include/db{3,2}/db_185.h,
/usr/include/db1/db.h, /usr/include/db_185.h and /usr/include/db.h in that
order, try to find out if the found db.h is indeed version 1 (if it doesn't
contain a DB_VERSION_MAJOR #define, or it's #defined as 1, it's version 1),
and then try to find out if dbopen() is in libc or not. This all can be
written in autoconf, if it's really necessary, though it would probably
create quite a mess in bsddbmodule.c, what with the
#ifdef/else/ifdef/else/ifdef/else chain to get the right include file.

Let me know if you don't want the job, and I'll do the autoconf way
instead.

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=132600&group_id=5470