cross compile Python to Linux-ARM

J

jefm

Hi,
We are looking to use Python on an embedded Linux ARM system.
What I gather from googling the subject is that it is not that
straight forward (a fair amount of patching & hacking).
Nobody out there that has done it claims it is easy, which makes me
worried.

I haven't seen a description on porting Python 2.6 or 3.0 yet. Is it
much different than for the earlier versions (the latest I have seem
is Python 2.5).

Does it matter whether Python is cross compiled to Linux 2.4 or Linux
2.6 ?

Can anyone point to a howto they know works well ?

What are the chances of an 'officially' supported ARM-Linux Python
distribution ?
(or is it safer to wait for industrial spec Intel Atom boards to avoid
the cross compilation altogether ?

What would it take for the Linux version of Python to be easily cross
compiled (i.e. would the Linux-Python maintainers be willing to
include and maintain cross-compilation specific functions) ?

Let's say we can get it done.
How is the performance and stability of a working Python on an
embedded ARM-Linux system ?

Does cross compiling Python automatically include the standard Python
library, or is that yet another adventure ?

thanks
 
P

Paul McGuire

Hi,
We are looking to use Python on an embedded Linux ARM system.
What I gather from googling the subject is that it is not that
straight forward (a fair amount of patching & hacking).
Nobody out there that has done it claims it is easy, which makes me
worried.

I've been able to use Debian to create a gumstix (I'm pretty sure this
is ARM-based) build root with Python, and I am a mere Linux dabbler.
Once built, I had the full standard Python lib, and was able to import
my custom pure Python code without a hitch.

-- Paul
 
J

JanC

jefm said:
We are looking to use Python on an embedded Linux ARM system.
What I gather from googling the subject is that it is not that
straight forward (a fair amount of patching & hacking).
Nobody out there that has done it claims it is easy, which makes me
worried. [...]
What would it take for the Linux version of Python to be easily cross
compiled (i.e. would the Linux-Python maintainers be willing to
include and maintain cross-compilation specific functions) ?

Let's say we can get it done.
How is the performance and stability of a working Python on an
embedded ARM-Linux system ?

Does cross compiling Python automatically include the standard Python
library, or is that yet another adventure ?

Python (including (most of) the standard library) is available for several
linux distributions for ARM:
- Debian (see packages.debian.org)
- OpenWRT, e.g. http://downloads.openwrt.org/kamikaze/8.09/ixp4xx/packages/
- the next Ubuntu release will support some ARM chips
- several other (embeded) distributions...

You should check whether your specific hardware is supported though. There
are several ARM designs from very simple embeded systems with very limited
CPU & memory resources and lacking a FPU up to chips for netbooks and
low-end desktop/server systems that have built-in 3D graphics.
Obviously, python won't work if your system doesn't even have enough space
to store python... ;-)


BTW: you can run many of those linux distributions on qemu too, if you want
to test some things before you have the hardware (it's obviously only an
emulation though).
 
T

Tomasz Rola

Hi,
We are looking to use Python on an embedded Linux ARM system.
What I gather from googling the subject is that it is not that
straight forward (a fair amount of patching & hacking).
Nobody out there that has done it claims it is easy, which makes me
worried.

From my ocassional googling, I was quite convinced that ARM (and
StrongARM) were well supported targets. Besides Debian, already mentioned
by OPs, you can also try Familiar Linux Distribution, aimed at
StrongARM-based devices:

http://www.handhelds.org/geeklog/index.php

They have a wiki, maybe you can find some pointers there:

http://www.handhelds.org/moin/moin.cgi/BuildSystem?action=highlight&value=crosscompile

http://www.handhelds.org/moin/moin.cgi/FamiliarUnderQemu?action=highlight&value=crosscompile
(or is it safer to wait for industrial spec Intel Atom boards to avoid
the cross compilation altogether ?

Depends. If you know for sure when they are going to be here and if they
will be price-performance-competitive.

Regards
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature. **
** As the answer, master did "rm -rif" on the programmer's home **
** directory. And then the C programmer became enlightened... **
** **
** Tomasz Rola mailto:[email protected] **
 
D

David Boddie

We are looking to use Python on an embedded Linux ARM system.
What I gather from googling the subject is that it is not that
straight forward (a fair amount of patching & hacking).
Nobody out there that has done it claims it is easy, which makes me
worried.

I think the hard part is often getting a working cross-compiler. The changes
to Python are just inconvenient, not difficult.
I haven't seen a description on porting Python 2.6 or 3.0 yet. Is it
much different than for the earlier versions (the latest I have seem
is Python 2.5).

Does it matter whether Python is cross compiled to Linux 2.4 or Linux
2.6 ?

Unless Python has been changed to rely on features only provided by Linux
2.6, it shouldn't matter. Of course, you need to make sure your toolchain
matches the kernel on your device, and that may be a constraint you can't
easily change.
Can anyone point to a howto they know works well ?

Not really. There are plenty of sites that claim to have good "recipes" for
cross-compiling, but many of them are out of date.
What are the chances of an 'officially' supported ARM-Linux Python
distribution ?
(or is it safer to wait for industrial spec Intel Atom boards to avoid
the cross compilation altogether ?

What would it take for the Linux version of Python to be easily cross
compiled (i.e. would the Linux-Python maintainers be willing to
include and maintain cross-compilation specific functions) ?

There are tickets and patches in the Python bug tracker for this, waiting
for people with enough time to review them. Here's a recent submission:

http://bugs.python.org/issue1006238
Let's say we can get it done.
How is the performance and stability of a working Python on an
embedded ARM-Linux system ?

It seemed OK to me the last time I tried this, but then I used to use Python
on a non-Linux, 48MHz ARM system in the late 1990s and performance wasn't
really a serious problem then, either.
Does cross compiling Python automatically include the standard Python
library, or is that yet another adventure ?

Parts of it. I had problems with one or two modules, so I just excluded
them from the build.

David
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top