distutils problem with interdependent modules

Daniel Wexler wex at flarg.com
Mon Dec 24 03:10:46 EST 2001


Thanks so much for the feedback.

> I'm surprised it does. Python loads the extensions with
> RTLD_LOCAL. Are you sure you are not getting two copies of your module
> loaded?

It is possible, and I'll check to see for sure, however, my
libraries have no global data, only code, so it really doesn't
matter if they are loaded twice, does it?  I really don't care
about the extra overhead or memory, since the library is
fairly small.  But actually, I think that Linux will only load
the code segment once no matter what, it is only the BSS
that is duplicated.

I don't get it.  How should I be segmenting my code?
I have two Python C extensions, FOO and BAR.  BAR is
dependent on FOO.  How should these be compiled, linked
and used together?

By the way, I have now massaged distutils to work under Linux,
but I have to make a symlink to the .so files in the build directory
to the top level package dir. I've almost got the whole thing working
with distutils under Windows, except that I need the .lib files in
the top level directory and I can't figure out how to move them there
from the build directory after each extension compiles.  Right now
I have to do that manually each time an extension finishes and the
build fails.

Thanks again for the help,

Dan





More information about the Python-list mailing list