static compiled python modules

Thomas Linden tom at
Sun Jan 9 07:32:08 EST 2005


I made a static version of my python modules (2.4), all modules were
build statically. The modules were linked into libpython2.4.a which
has ~ 8 MB then. The build process then links the python binary against
the libpython2.4.a, the resulting binary has ~ 5 MB afterwards (?).

The problem is, that python ignores several modules, it tries to load
the dynamic versions. E.g. if I do 'import math', it tells that it
cannot find a module 'math'. Of course there is no
somewhere, because it is statically build-in. When I use 'nm' to take
a look at the python binary, I can find all functions exported by
the math module, so it is there, but python ignores it.

In contrast, for example the posix module works. Its also compiled in,
and doesn't exist as

How can I tell python to use the compiled in modules and not try to
load them from outside?

kind regards, Tom

 Thomas Linden   (  tom at co dot daemon dot de

More information about the Python-list mailing list