[Python-Dev] Distutils confuses Berkeley DB and dbm?

Barry A. Warsaw barry@zope.com
Fri, 31 May 2002 01:50:01 -0400


>>>>> "SM" == Skip Montanaro <skip@pobox.com> writes:

    SM> Would someone on Linux please try the following:

    |     import dbm
    |     f = dbm.open("foo", "c")
    |     f["1"] = "1"
    |     f.close

    SM> then ask the file command what kind of file it is.  On my
    SM> system it tells me the file is a Berkeley DB 1.85 hash file.

On my RH6.1-ish system, foo.db is: Berkeley DB 2.X Hash/Little Endian
(Version 5)

On my stock, but loaded Mandrake 8.2 system, foo.db is: Berkeley DB
(Hash, version 5, native byte-order)

Note that my main problem with the bsddb module is building it.  On
the RH6.1 system I get:

gcc -g -Wall -Wstrict-prototypes -fPIC -DHAVE_DB_185_H=1 -I. -I/home/barry/projects/python/./Include -I/usr/local/include -IInclude/ -c /home/barry/projects/python/Modules/bsddbmodule.c -o build/temp.linux-i686-2.3/bsddbmodule.o
gcc -shared build/temp.linux-i686-2.3/bsddbmodule.o -L/usr/local/lib -ldb-3.1 -o build/lib.linux-i686-2.3/bsddb.so
*** WARNING: renaming "bsddb" since importing it failed: build/lib.linux-i686-2.3/bsddb.so: undefined symbol: dbopen

but on the Mandrake 8.2 system I get:

gcc -g -Wall -Wstrict-prototypes -fPIC -DHAVE_DB_185_H=1 -I/usr/include/db3 -I. -I/home/barry/projects/python/./Include -I/usr/local/include -IInclude/ -c /home/barry/projects/python/Modules/bsddbmodule.c -o build/temp.linux-i686-2.3/bsddbmodule.o
gcc -shared build/temp.linux-i686-2.3/bsddbmodule.o -L/usr/local/lib -ldb2 -o build/lib.linux-i686-2.3/bsddb.so
*** WARNING: renaming "bsddb" since importing it failed: build/lib.linux-i686-2.3/bsddb.so: undefined symbol: __db185_open

    SM> I know there is a bug report open about something related to
    SM> building Berkeley DB-based modules, but I'm offline at the
    SM> moment so I can't check it.  Barry, were you going to look at
    SM> this?  How about a little collaboration?  I think I'm mostly
    SM> responsible for what distutils does as far as building bsddb.

I'm too tired to think about this more tonight, but if you want to
hook up on irc.openprojects.net #python tomorrow, we can try to wade
our way through things.

-Barry