Why python3 is build native in yocto ??? #python


William Jacob
 

Hi,
I am trying to compile python package for yocto and I found  python3 (python3.7) is  build native then it cross compiled.I want to know why it is done like this in python.

Basically I want python3 binary cross compiled for arm architecture should be available in recipe-sysroot and  recipe-sysroot-native directory . Right now it is available only in recipe-sysroot-native.

 

Thanks 

William Jacob


Josef Holzmayr
 

Howdy!

Am Fr., 6. Nov. 2020 um 09:23 Uhr schrieb <william.jacob@sama.com.sg>:

Hi,
I am trying to compile python package for yocto and I found python3 (python3.7) is build native then it cross compiled.I want to know why it is done like this in python.

Basically I want python3 binary cross compiled for arm architecture should be available in recipe-sysroot and recipe-sysroot-native directory . Right now it is available only in recipe-sysroot-native.
I'm sorry, but I don't really understand the question. You say you
want python3 crosscompiled. This will happen if something that goes
into your image depends/rdepends on it, or if you explicitly add it to
said image via IMAGE_INSTALL. Does this not work for you?

Greetz

Thanks

William Jacob


Ross Burton
 

On Fri, 6 Nov 2020 at 08:23, <william.jacob@sama.com.sg> wrote:
I am trying to compile python package for yocto and I found python3 (python3.7) is build native then it cross compiled.I want to know why it is done like this in python.
The python3 build for target doesn't directly depend on python3-native.

Some recipes do depend on python3-native (although by definition there
is a python3 on your host) as they need to run non-standard Python
modules as part of their build. We don't want to assume that you've
installed all of these modules (as the list is ever growing) and we
don't want to assume that you've installed python3-dev on the host (as
we want to have minimal build requirements, and C modules are not
portable between Python versions).

Basically I want python3 binary cross compiled for arm architecture should be available in recipe-sysroot and recipe-sysroot-native directory . Right now it is available only in recipe-sysroot-native.
Please explain what you are actually trying to do. For 99% of python
modules, simply inheriting setuptool3 or even better pypi is
sufficient. If a package has hand-coded Python detection then it gets
a lot more complicated as Python doesn't have great support for
cross-compiling, and most people writing the build scripts don't
consider it at all.

Ross


William Jacob
 

I am sorry , I will explain in detail.

so what I required is that my python3 binary should be present in both recipe-sysroot and recipe-sysroot-native both as I need to build some python packages using python present in the recipe-sysroot directory.Currently my python binary is present only in recipe-sysroot-native directory.

 

If you want more details please let me know


Ross Burton
 

DEPEND on python3 and python3-native then.

Ross

On Fri, 6 Nov 2020 at 09:34, <william.jacob@sama.com.sg> wrote:

I am sorry , I will explain in detail.

so what I required is that my python3 binary should be present in both recipe-sysroot and recipe-sysroot-native both as I need to build some python packages using python present in the recipe-sysroot directory.Currently my python binary is present only in recipe-sysroot-native directory.



If you want more details please let me know




Richard Purdie
 

On Mon, 2020-11-09 at 09:14 +0000, Ross Burton wrote:
DEPEND on python3 and python3-native then.
Note that whilst the python headers and library will be in recipe-
sysroot, the python3 binaries will not. This is because they're
designed to run on the target, not the host you're building on so we
don't bother putting them there.

Cheers,

Richard


William Jacob
 

Understood but this is where it gets tricky for me .

I am trying to compile llvmlite which depends on llvm . The problem is that because native python is used it will give me OS Error when I link LLVM build for ARM The reason I get this error is because llvmlite is looking for LLVM built for x86 .

On 09/11/20 3:59 pm, Richard Purdie wrote:
On Mon, 2020-11-09 at 09:14 +0000, Ross Burton wrote:
DEPEND on python3 and python3-native then.
Note that whilst the python headers and library will be in recipe-
sysroot, the python3 binaries will not. This is because they're
designed to run on the target, not the host you're building on so we
don't bother putting them there.

Cheers,

Richard