Python compiled modules are too big in size (even after strip)

K

King

Hi,

I have just compiled python 2.6.5 from sources on ubuntu "hardy" 8.04.
I have used a simple script to do everything in one go:

../configure --enable-shared
make
make install

Python is compiled and installed successfully. However the
modules(_socket.so, _random.so etc) are two big in terms of file size.
They are around 4.5-5.0 mb each. I have used "strip strip-all *.so",
but still size is around 1.5 mb each. This is still too big compare to
size of modules on ubuntu karmic's pre installed python 2.6.5.

Am I missing something here? Do I have to re-configure or re-compile
the python again from sources?

Regards

Prashant
 
J

Jon Clements

Hi,

I have just compiled python 2.6.5 from sources on ubuntu "hardy" 8.04.
I have used a simple script to do everything in one go:

./configure --enable-shared
make
make install

Python is compiled and installed successfully. However the
modules(_socket.so, _random.so etc) are two big in terms of file size.
They are around 4.5-5.0 mb each. I have used "strip strip-all *.so",
but still size is around 1.5 mb each. This is still too big compare to
size of modules on ubuntu karmic's pre installed python 2.6.5.

Am I missing something here? Do I have to re-configure or re-compile
the python again from sources?

Regards

Prashant

Err, the common install on "karmic" is 2.6.4...

IIRC (and probably not) the default was 2.6.2 on "hardy"

Obviously doesn't help where you're finding large sized shared libs,
but anyway...

Jon.
 
K

King

Hi Jon,

I do have a limited skill sets in c/c++ and also new on linux. I think
I am missing some flags or anything when I am compiling python from
sources.

Still hoping that some one point me out the missing link.

Cheers

Prashant
 
A

Antoine Pitrou

Le Tue, 27 Apr 2010 02:43:19 -0700, King a écrit :
Python is compiled and installed successfully. However the
modules(_socket.so, _random.so etc) are two big in terms of file size.
They are around 4.5-5.0 mb each. I have used "strip strip-all *.so", but
still size is around 1.5 mb each.

This is way more than it should be. Even if debug mode, most extension
modules should be around 100kB or smaller.
Am I missing something here? Do I have to re-configure or re-compile the
python again from sources?

I would suggest to check the compile options gcc gets (look at "make"
output), and try changing them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top