Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to cross compile python packages (e.g. Numpy) for ARM

I know this question have been posted before. But I couldn't find a complete answer on how to do it.

I would like to use python packages with C extensions such as Numpy and Twisted in an embedded system (platform architecture: ARM 32Bit and some Linux distribution).

Info: the tool chain is already configured.

Found this alternatives:

  • Using dockers

  • Using distutilscross (sounds the easiest, but couldn't find documentation)

    https://pypi.python.org/pypi/distutilscross

  • Using VM

Thank you in advance

like image 585
Hangon Avatar asked Aug 16 '26 14:08

Hangon


1 Answers

Crossenv

But I get the issues with multiarray among working with numpy all the time.

  1. Numpy dependable cross compilations are failing with the issue. So I modified PATH to make them start building.
  2. Built numpy also fires the issue when imported in target python.

For the second issue:

$ sudo apt install python-numpy

is meant to be the solution but since I am developing for an embedded system I cannot/have never tried to use it.

I get to a conclusion that I should cross compile it by myself but then a lot more dependency issues occurred. However, one can try it if the target is not a minimalist linux and apt is available.

like image 71
Ivan Slaev Avatar answered Aug 18 '26 04:08

Ivan Slaev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!