Cross Compiler for Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hendrik van Rooyen

    Cross Compiler for Python?

    Up to now, I have been innocently using the vanilla python
    that comes with the Linux distribution (Suse in my case).

    For the past few days, I have been playing with a little
    device called an eBox - it is basically a 486 with 128Mb
    memory, and a 1Gig pcmcia flash drive.

    We want to try to use this as an industrial controller, so
    I want to load python onto it.

    So I downloaded the sources, and got them into the box,
    over its ethernet connection.

    Then I got stymied - the configure script will not run,
    because the "distributi on" has no C compiler - it is
    basically a kernel, and Busybox, with precious little else.

    So I googled, and I found mobile python, and portable python,
    both aimed at windows. - no good to me.

    Adding "embedded" to the Google string is also useless,
    as it basically brings up instances of embedding the
    interpreter into another app, not for small processors.

    So how does one do a compile of python on one machine
    aimed at another one? - All I want is a vanilla installation
    with the stuff in all the usual places. And just to make matters
    interesting, the two Linux boxes I have available are both
    64 bit dual core animals, one Intel, one AMD...

    I don't need much more than the interpreter, sys, os, sockets
    and ctypes.

    Alternatively, where can one find a set of binaries for
    32 bit Linux?

    Looking for some sane advice please.

    - Hendrik

  • Diez B. Roggisch

    #2
    Re: Cross Compiler for Python?

    Hendrik van Rooyen wrote:
    Up to now, I have been innocently using the vanilla python
    that comes with the Linux distribution (Suse in my case).
    >
    For the past few days, I have been playing with a little
    device called an eBox - it is basically a 486 with 128Mb
    memory, and a 1Gig pcmcia flash drive.
    >
    We want to try to use this as an industrial controller, so
    I want to load python onto it.
    >
    So I downloaded the sources, and got them into the box,
    over its ethernet connection.
    >
    Then I got stymied - the configure script will not run,
    because the "distributi on" has no C compiler - it is
    basically a kernel, and Busybox, with precious little else.
    >
    So I googled, and I found mobile python, and portable python,
    both aimed at windows. - no good to me.
    >
    Adding "embedded" to the Google string is also useless,
    as it basically brings up instances of embedding the
    interpreter into another app, not for small processors.
    >
    So how does one do a compile of python on one machine
    aimed at another one? - All I want is a vanilla installation
    with the stuff in all the usual places. And just to make matters
    interesting, the two Linux boxes I have available are both
    64 bit dual core animals, one Intel, one AMD...
    >
    I don't need much more than the interpreter, sys, os, sockets
    and ctypes.
    >
    Alternatively, where can one find a set of binaries for
    32 bit Linux?
    >
    Looking for some sane advice please.
    Look at the gumstix project, they do have a cross-compiled python in there.
    You should be able to get an idea on how to do that yourself.

    It involves (or at least did back then) a bit of trickery as the
    build-process of python uses the freshly created interpreter to pre-compile
    modules. But it is possible.

    Diez

    Comment

    • Jorgen Grahn

      #3
      Re: Cross Compiler for Python?

      On Mon, 7 Jul 2008 10:15:59 +0200, Hendrik van Rooyen <mail@microcorp .co.zawrote:
      Up to now, I have been innocently using the vanilla python
      that comes with the Linux distribution (Suse in my case).
      >
      For the past few days, I have been playing with a little
      device called an eBox - it is basically a 486 with 128Mb
      memory, and a 1Gig pcmcia flash drive.
      >
      We want to try to use this as an industrial controller, so
      I want to load python onto it.
      >
      So I downloaded the sources, and got them into the box,
      over its ethernet connection.
      >
      Then I got stymied - the configure script will not run,
      because the "distributi on" has no C compiler - it is
      basically a kernel, and Busybox, with precious little else.
      ....

      This is a special case of a more general, non-Python problem which you
      will have to address if you want to build an industrial controller.

      If your target has no C compiler[1], you have to set up a cross-compiling
      environment. I'd be surprised if the eBox doesn't come with
      documentation covering this.

      If there are special procedures and requirements for cross-compiling
      Python (someone else indicated there are), I guess the Python
      installation notes must cover this in a general way.

      /Jorgen

      [1] Or even if it has one. It is much more convenient to build in your
      normal work environment where you have plenty of disk, CPU and RAM,
      a good text editor, version control, Perl ...

      --
      // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
      \X/ snipabacken.se R'lyeh wgah'nagl fhtagn!

      Comment

      Working...