Cross Compiler for Python?

  • Thread starter Hendrik van Rooyen
  • Start date
H

Hendrik van Rooyen

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 "distribution" 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
 
D

Diez B. Roggisch

Hendrik said:
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 "distribution" 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
 
J

Jorgen Grahn

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 "distribution" 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 ...
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top