如何为ARM交叉编译python包(例如Numpy)

Han*_*gon 5 python linux arm numpy cross-compiling

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:

Thank you in advance

小智 1

交叉环境

但我在使用 numpy 时总是遇到多数组的问题。

  1. Numpy 可靠的交叉编译因该问题而失败。所以我修改了 PATH 让它们开始构建。
  2. 当导入目标 python 时,构建的 numpy 也会引发该问题。

对于第二个问题:

$ sudo apt install python-numpy
Run Code Online (Sandbox Code Playgroud)

本来就是解决方案,但由于我正在为嵌入式系统开发,所以我不能/从未尝试使用它。

我得出的结论是我应该自己交叉编译它,但随后发生了更多的依赖问题。但是,如果目标不是极简 Linux 并且 apt 可用,则可以尝试一下。