Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to port a python package to a embedded system

788 views
Skip to first unread message

chenchao

unread,
Apr 24, 2017, 5:46:13 AM4/24/17
to
Hi, everybody:

I have port python-2.7 to my arm board. But i don't know how to
port a python package to my embedded system. For example, numpy pakage.
Therefore, is there anybody know how to do this? Thanks!



justin walters

unread,
Apr 24, 2017, 11:48:20 AM4/24/17
to
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Could you be a bit more specific?

When you say: " I have port python-2.7 to my arm board.", it could mean:

* You want to run a CPython interpreter on an ARM chip
* You want to compile your Python code into a binary executable for ARM
chips
* Something entirely different

You also say that you need to port numpy. Numpy itself consists of a heck
of a lot of C,
so you will need to compile that with ARM as your target.

Michael Torrie

unread,
Apr 24, 2017, 12:14:49 PM4/24/17
to
On 04/24/2017 03:45 AM, chenchao wrote:
> Hi, everybody:
>
> I have port python-2.7 to my arm board. But i don't know how to
> port a python package to my embedded system. For example, numpy pakage.
> Therefore, is there anybody know how to do this? Thanks!

Are you running a Linux distro on a board like the Raspberry Pi or the
Beaglebone Black? Or are you talking about something like MicroPython
running on bare metal?

chenchao

unread,
Apr 24, 2017, 10:05:37 PM4/24/17
to
Hi, everybody:

I have x-compiled the cpython-2.7.10 and ported it on my ARM
board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
have to use numpy python package on my board. So how do i x-compile this
package? Is there anybody know how to do this? Thanks!


Michael Torrie

unread,
Apr 24, 2017, 10:34:36 PM4/24/17
to
Sorry but you'll have to be much more specific. Are you running a
version of Linux? If so, what version?




Michael Torrie

unread,
Apr 24, 2017, 10:38:13 PM4/24/17
to
On 04/24/2017 08:04 PM, chenchao wrote:
> Hi, everybody:
>
> I have x-compiled the cpython-2.7.10 and ported it on my ARM
> board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
> have to use numpy python package on my board. So how do i x-compile this
> package? Is there anybody know how to do this? Thanks!

Also what processor are you using? Many ARM processors lack a floating
point unit, and if yours is one of those, then numpy will be of very
little use on that platform as it requires floating point in the CPU for
speed.

chenchao

unread,
Apr 24, 2017, 10:48:18 PM4/24/17
to
Hi, everybody:

I have x-compiled the cpython-2.7.10 and ported it on my ARM
board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
have to use numpy python package on my board. So how do i x-compile this
package? Is there anybody know how to do this? Thanks!

My embedded system version:
h

My PC system is ubuntu10.04.

chenchao

unread,
Apr 24, 2017, 10:56:02 PM4/24/17
to
Hi, all:

My board is the ARM Cortex-A8 processor and support floating point
arithmetic.

On 04/24/2017 10:37 PM, Michael Torrie wrote:
> On 04/24/2017 08:04 PM, chenchao wrote:
>> Hi, everybody:
>>
>> I have x-compiled the cpython-2.7.10 and ported it on my ARM
>> board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
>> have to use numpy python package on my board. So how do i x-compile this
>> package? Is there anybody know how to do this? Thanks!

Michael Torrie

unread,
Apr 24, 2017, 11:40:08 PM4/24/17
to
On 04/24/2017 08:47 PM, chenchao wrote:
> I have x-compiled the cpython-2.7.10 and ported it on my ARM
> board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
> have to use numpy python package on my board. So how do i x-compile this
> package? Is there anybody know how to do this? Thanks!
>
> My embedded system version:
> h
>
> My PC system is ubuntu10.04.

I know it would be a bit slow, but it might be easiest to compile and
install numpy on the board itself using the normal tools (the same as
you'd build numpy on a PC).





chenchao

unread,
Apr 25, 2017, 2:29:09 AM4/25/17
to
Hi, all:

I installed it by 'pip install numpy' or 'python setup.cfg
install' on my PC, but I do not know how to do this on my arm board.
Because of my arm board does not have tool of pip. could you please tell
me any idea? Thanks!

alister

unread,
Apr 25, 2017, 4:07:47 AM4/25/17
to
so what board is it, why the great secret?

if you expect anyone here to be able to assist you then you need to
provide the information they need to be able to help.

what board, and what operating system as a bare minimum.





--
It will be advantageous to cross the great stream ... the Dragon is on
the wing in the Sky ... the Great Man rouses himself to his Work.

MRAB

unread,
Apr 25, 2017, 10:07:43 AM4/25/17
to
On 2017-04-25 07:28, chenchao wrote:
> Hi, all:
>
> I installed it by 'pip install numpy' or 'python setup.cfg
> install' on my PC, but I do not know how to do this on my arm board.
> Because of my arm board does not have tool of pip. could you please tell
> me any idea? Thanks!
>
This might help:

How to install pip on Ubuntu
http://www.saltycrane.com/blog/2010/02/how-install-pip-ubuntu/

>
> On 04/24/2017 11:39 PM, Michael Torrie wrote:
>> On 04/24/2017 08:47 PM, chenchao wrote:
>>> I have x-compiled the cpython-2.7.10 and ported it on my ARM
>>> board(it is not the Raspberry Pi and the Beaglebone Black). But now, I
>>> have to use numpy python package on my board. So how do i x-compile this
>>> package? Is there anybody know how to do this? Thanks!
>>>

Michael Torrie

unread,
Apr 25, 2017, 1:15:57 PM4/25/17
to
On 04/25/2017 08:07 AM, MRAB wrote:
> On 2017-04-25 07:28, chenchao wrote:
>> Hi, all:
>>
>> I installed it by 'pip install numpy' or 'python setup.cfg
>> install' on my PC, but I do not know how to do this on my arm board.
>> Because of my arm board does not have tool of pip. could you please tell
>> me any idea? Thanks!
>>
> This might help:
>
> How to install pip on Ubuntu
> http://www.saltycrane.com/blog/2010/02/how-install-pip-ubuntu/

If chenchao installed Python from a distro package (always recommended)
then that link is exactly what he needs to do. In fact it would be a
good idea to install numpy from the repositories using apt-get also, if
it's there.

If he installed python from source (sounds like he did, since he
"x-compiled" it), he should already have pip as it's a standard part of
python since 2.7.9. If pip isn't in the path, he can try:

python -m pip install numpy

and see what happens. Alternatively he can download this:
https://bootstrap.pypa.io/get-pip.py

and then run it with:

python get-pip.py

Chris Angelico

unread,
Apr 25, 2017, 1:58:49 PM4/25/17
to
On Wed, Apr 26, 2017 at 3:15 AM, Michael Torrie <tor...@gmail.com> wrote:
> If chenchao installed Python from a distro package (always recommended)
> then that link is exactly what he needs to do. In fact it would be a
> good idea to install numpy from the repositories using apt-get also, if
> it's there.
>
> If he installed python from source (sounds like he did, since he
> "x-compiled" it), he should already have pip as it's a standard part of
> python since 2.7.9. If pip isn't in the path, he can try:
>
> python -m pip install numpy
>
> and see what happens. Alternatively he can download this:
> https://bootstrap.pypa.io/get-pip.py
>
> and then run it with:
>
> python get-pip.py

My suspicion here is that it's not pip's issue - numpy has some fairly
serious dependencies.

ChrisA

chenchao

unread,
Apr 25, 2017, 9:42:19 PM4/25/17
to
Hi, all:

I have installed the PIP on my arm board now. But the 'numpy'
package includes some of C codes. This part of the C code must be
x-compiled and I don't know how to x-compiled this package. So, is there
a good idea for this issue?


On 04/25/2017 01:15 PM, Michael Torrie wrote:
> On 04/25/2017 08:07 AM, MRAB wrote:
>> On 2017-04-25 07:28, chenchao wrote:
>>> Hi, all:
>>>
>>> I installed it by 'pip install numpy' or 'python setup.cfg
>>> install' on my PC, but I do not know how to do this on my arm board.
>>> Because of my arm board does not have tool of pip. could you please tell
>>> me any idea? Thanks!
>>>
>> This might help:
>>
>> How to install pip on Ubuntu
>> http://www.saltycrane.com/blog/2010/02/how-install-pip-ubuntu/

Nathan Ernst

unread,
Apr 25, 2017, 10:35:38 PM4/25/17
to
As previously asked: what board are you using? There might be a simple
response to your issue, but you've yet to state the board you're using. You
will not get any useful responses until you answer this very, very simple
question.

If you can't "pip install", you'll probably have to build from source and
the board will likely matter very much. Building from source isn't normally
terribly difficult, but no one here can help you if we don't know your
environment.

Help us help you.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Michael Torrie

unread,
Apr 25, 2017, 10:40:45 PM4/25/17
to
On 04/25/2017 07:41 PM, chenchao wrote:
> Hi, all:
>
> I have installed the PIP on my arm board now. But the 'numpy'
> package includes some of C codes. This part of the C code must be
> x-compiled and I don't know how to x-compiled this package. So, is there
> a good idea for this issue?

Why do you think it must be cross compiled? It's a bit slow but
perfectly reasonable to install GCC and friends with apt-get. Most of
these packages you are working with were not really designed to be
cross-compiled. If you cannot compile them on the board itself due to
resource constraints, you will have to use qemu and set up an Arm
environment on your PC and do the build there. This will not be as fast
as cross-compiling, but probably would be faster than building on the
Arm device itself.

https://wiki.ubuntu.com/ARM64/QEMU

If you can't compile on your board, setting all this up is a major
undertaking.

0 new messages