470,575 Members | 1,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,575 developers. It's quick & easy.

Building Python with gdbm support

I am trying to use a Perl script which requires a Database module other
than "dbm" to be the default Mod. So, what the script is checking is

import anydbm
if (anydbm._defaultmod.__name__ == 'dumbdbm'
or anydbm._defaultmod.__name__ == 'dbm'):

First of, I'm doing this on a Sparc/Solaris 8 box.

So, I'm trying to get gdbm to be the default mod. I've downloaded and
built gdbm-1.8.3. It has not been build to /usr (I don't have root
access). I've built this fine.

When I build Python 2.4.1, it at first doesn't pick up on the gdbm
module ("dbm" is still the default module, and Modules directory in the
Python source doesn'thave a .o file for the gdbmmodule file).

I've nosed around, and found the a line commented out Modules/Setup
file, regarding building the gdbm module. I uncommented it (being sure
that the approrpiate directories for the .h and lib files are
provided), and it looked like it built the module. But when I attempt
to start python, I get an error:

ld.so.1: python: fatal: libgdbm.so.3: open failed: No such file or
Look, the bottom line is I don't know what the correct steps are to get
the gdbm module built in as part of the Python installation (as well as
setting it as the default database module). I've tried to piece
together bits and pieces of various newsgroup messages, as I haven't
found a decent spot for any doco.

Can anyone point me in the right direction, in regards to how to get my
Python installation set up the way I want?

Is it correct to edit the Modules/Setup file? I would have thought
that the configure approach would support these types of isses, rather
than manually editing a file? Should I be using the setup.py script?
I have no idea what that does, or where I would call it, but the name
of it sounds like it should be included?

Thanks for any help,

Jul 19 '05 #1
1 3769
I've actually sorted myself out. I updated Modules/Setup.dist, so that
it has the following line...

gdbm gdbmmodule.c -I/ct/ctapp/gnu/bin/gdbm-1.8.3/include
-L/ct/ctapp/gnu/bin/gdbm-1.8.3/lib -lgdbm

Rebuilt everything in Python. I also had to ensure that my environment
using the newly-built Python contained the gdbm/lib directory in it's
LD_LIBRARY_PATH (the same value as what's passed to -L in the above

I'm assuming this is alright. I guess if I change anything, I have to
remember to update Setup.dist. If I'm missing a step, or if there's an
easier way, I'm all ears... :)


Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Dave Harrison | last post: by
reply views Thread by Mike Maxwell | last post: by
7 posts views Thread by Erik Johnson | last post: by
1 post views Thread by Jerry LeVan | last post: by
5 posts views Thread by mrstephengross | last post: by
1 post views Thread by J. Jeffrey Close | last post: by
2 posts views Thread by Thomas Ploch | last post: by
reply views Thread by Chris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.