472,354 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

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

Jul 7 '08 #1
2 1372
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 "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
Jul 7 '08 #2
On Mon, 7 Jul 2008 10:15:59 +0200, Hendrik van Rooyen <ma**@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 "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 ...

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: logistix | last post by:
PyXR 0.9.3- Cross-Referenced HTML from Python Source PyXR generates HTML pages from python source files. It also generates cross-referenced hyperlinks and integrates with the Python Library...
4
by: Jonathan P. | last post by:
....that would be for desktop-based apps, games, 3d graphics, and multimedia. ....thanks to APIs and bindings like Pygame, PyOpenGL, PyGtk and PyGtkGLExt. A summary of a lengthy post on the...
1
by: Timur Safin | last post by:
Hi All, Sorry if it is offtopic here, I wasn't able to find any more relevant group... I'm slowly approaching AMD64 build for our product (as my personal fun project). And after I ran that...
1
by: Doug Crawford | last post by:
Has anyone successfully compiled python 2.4 to run under linux powerpc 604? I have the ELINOS cross compile environemnt working, but always run into problems when executing make. Unfortunately, my...
1
by: Han-Wen Nienhuys | last post by:
Hello, I have a small patch for Python SVN that makes it possible to cross-compile python on Unix to various other Unix targets. I have successfully built a binary for FreeBSD on Linux. The...
1
by: Otacon22 | last post by:
Hi all, I want to create a robot with a router board based on processor atheros 2.6, called "fonera". I have installed a version of linux, Openwrt and python and i want to use it for some...
3
by: Squat'n Dive | last post by:
Does anyone have an idea why -fno-strict-aliasing is turned off when cross compiling? in configure generated for 2.4.4: case $GCC in yes) # Python violates C99 rules, by casting between...
0
by: Hendrik van Rooyen | last post by:
Jorgen Grahn wrote: The eBox comes with a non free (both as in beer and speech) distribution, without even a root password, and tied to the mac address in the hardware so that it can only run...
5
by: Hartmut Goebel | last post by:
Hi, has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I have a Windows partition with Python installed there, so this would "only" required working on a different...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.