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

Discussion in 'Python' started by King, Apr 27, 2010.

  1. King

    King Guest

    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
    King, Apr 27, 2010
    #1
    1. Advertising

  2. King

    Jon Clements Guest

    On 27 Apr, 10:43, King <> wrote:
    > 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.
    Jon Clements, Apr 27, 2010
    #2
    1. Advertising

  3. King

    King Guest

    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
    King, Apr 27, 2010
    #3
  4. 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.
    Antoine Pitrou, Apr 27, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaguf
    Replies:
    0
    Views:
    349
    Shaguf
    Dec 24, 2008
  2. Shaguf
    Replies:
    0
    Views:
    447
    Shaguf
    Dec 26, 2008
  3. Shaguf
    Replies:
    0
    Views:
    235
    Shaguf
    Dec 26, 2008
  4. Aquila
    Replies:
    35
    Views:
    451
    Mathieu Bouchard
    Mar 31, 2005
  5. Shaguf
    Replies:
    0
    Views:
    214
    Shaguf
    Dec 24, 2008
Loading...

Share This Page