Simple question about freeze

Discussion in 'Python' started by mrstephengross, Feb 17, 2006.

  1. I'm working with the freeze utility, and I'm trying to learn the
    basics. For the most part, I think I understand how it works. I have a
    question about modules, though.

    I want to make sure that my native executable is entirely standalone.
    That is, it should have no dynamic linking. I've read through a number
    of posts on the subject, and think I get it. In order to make this
    work, I need to do two things:

    (1) Recompile libpythonXXX.a so that the required modules are indeed
    compiled into the archive.
    (2) Modify the freeze-generated Makefile to force gcc to use static
    linking and to use my custom-built libpythonXXX.a in linking together
    the native executable.

    My question is: is it sufficient to carry out the above steps? Freeze
    is designed to use the version of python installed on the host system,
    *not* a custom build in a different directory. If freeze looks to the
    system's default installation, but I've modified the makefile to use my
    custom-built libpython.a, will that cause problems? My sense is that it
    will not, but I want to make sure I think things through. Any thoughts?

    Thanks,
    --Steve ()
    mrstephengross, Feb 17, 2006
    #1
    1. Advertising

  2. mrstephengross wrote:
    > I want to make sure that my native executable is entirely standalone.
    > That is, it should have no dynamic linking. I've read through a number
    > of posts on the subject, and think I get it. In order to make this
    > work, I need to do two things:
    >
    > (1) Recompile libpythonXXX.a so that the required modules are indeed
    > compiled into the archive.
    > (2) Modify the freeze-generated Makefile to force gcc to use static
    > linking and to use my custom-built libpythonXXX.a in linking together
    > the native executable.
    >
    > My question is: is it sufficient to carry out the above steps?


    No. You also need to provide static versions of all system libraries.
    E.g. if you include _tkinter in your binary, you need static Tcl
    libraries, plus, on Unix, static X11 libraries, plus a static C
    library; if you include a bsddb module, you need a static bsddb library,
    and so on.

    > Freeze
    > is designed to use the version of python installed on the host system,
    > *not* a custom build in a different directory. If freeze looks to the
    > system's default installation, but I've modified the makefile to use my
    > custom-built libpython.a, will that cause problems? My sense is that it
    > will not, but I want to make sure I think things through. Any thoughts?


    I don't see a problem with that.

    Regards,
    Martin
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Feb 17, 2006
    #2
    1. Advertising

  3. Martin v. Löwis enlightened us with:
    > No. You also need to provide static versions of all system
    > libraries.


    You can also ship the required .so files along with the program, and
    set LD_LIBRARY_PATH to include the directory in which you stored those
    files. This can be easily done by a shell script that sets up the
    environment variable and then runs the real program.

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa
    Sybren Stuvel, Feb 18, 2006
    #3
    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. Wagner Dias
    Replies:
    3
    Views:
    3,034
    Andre Kostur
    Mar 28, 2005
  2. David Detlefsen

    Freeze Question

    David Detlefsen, Aug 4, 2003, in forum: Python
    Replies:
    0
    Views:
    294
    David Detlefsen
    Aug 4, 2003
  3. chong tan

    freeze question..

    chong tan, Apr 20, 2005, in forum: Python
    Replies:
    0
    Views:
    284
    chong tan
    Apr 20, 2005
  4. mrstephengross

    Another simple freeze question

    mrstephengross, Feb 17, 2006, in forum: Python
    Replies:
    0
    Views:
    257
    mrstephengross
    Feb 17, 2006
  5. Replies:
    5
    Views:
    226
    Olivier Renaud
    Mar 15, 2007
Loading...

Share This Page