project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.29k stars 1.95k forks source link

[Platform] linux(arm64) #34030

Closed hassan-xy closed 2 weeks ago

hassan-xy commented 2 months ago

Reproduction steps

I run the command ./gn_build.sh It builds and takes a space of around 30GB while my linux arm64 dev board has only 8 GB. Any ideas as to how I can cross-compile and resolve the issue.

Platform

other

Platform Version(s)

No response

Type

Manually tested with SDK

(Optional) If manually tested please explain why this is only manually tested

No response

Anything else?

No response

bzbarsky-apple commented 2 months ago

./gn_build.sh builds a whole bunch of different example apps and configurations. It's supposed to be a "build and test everything" kind of thing, not appropriate for anything like a constrained device.

@hassan-xy What are you actually trying to build?

hassan-xy commented 2 months ago

I am trying to build chip-tool firstly. Later I would want to test example codes for Linux arm64 arch. If there is a way to only build for my arch then that would be great.

bzbarsky-apple commented 2 months ago

If you want to just build chip-tool, I would recommend either

scripts/examples/gn_build_example.sh examples/chip-tool place/to/put/binary

or

./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-arm64-chip-tool"

All the builds ./gn_build.sh does are for your arch, but it does them with different compilers/settings...

hassan-xy commented 2 months ago

image Well I am running on the x86 desktop for my target board.

bzbarsky-apple commented 2 months ago

@andy31415 what's the right way to build just chip-tool while cross-compiling?

andy31415 commented 2 months ago

Only clang can cross-compile, hence the error there saying due to rule ONLY IF-(clang|nodeps)`.

The target should be linux-arm64-chip-tool-clang

hassan-xy commented 2 months ago

Hi @andy31415 I tried and I got a diffrent error this time. image image I have tried different combinations like --out-prefix, --clean but still the same error.

Edit: I am also trying to build on my board by inserting the 64GB SD card. But I am getting some errors due to python. I had python 3.6 while pulling the recursive git files then updated to python 3.8.0. Let me know if you have any suggestions for this as well. image

Thanks guys

bzbarsky-apple commented 1 month ago

@hassan-xy You want

./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-arm64-chip-tool-clang build"
hassan-xy commented 1 month ago

Well... image I am cross-compiling for arm64 environment on x86_64 ubuntu 20.04 desktop.

I am also parallely trying to build on the dev board by building inside of a sd card. I am also facing the same python dependencies. Do you guys have a list of all the python packages or versions necessary for build to succeed?

bzbarsky-apple commented 1 month ago

The sysroot env var presumably needs to be set to the relevant sysroot for the cross-compile that has the other-arhc compilers, libraries, etc? That's about as much as I know about the cross-compiling bits, which are badly under-documented....

hassan-xy commented 1 month ago

Hi, Well I tried to move the binary to my device after building on RPI 4 board but faced issues with glibc 2.35 version and openssl 3. Even after building the source code to update, the current version I am facing the issue.

So, can you share a list of all the dependencies connectedIP and its example binaries like chip-tool has so I can prepare for it. Also please provide support for the linux yocto environment. I very popular among developers and will beneficial for everyone.

I will be waiting for your responses. THANKS!!!

hassan-xy commented 1 month ago

Guys, I am waiting for your comments...

bzbarsky-apple commented 1 month ago

I think fundamentally: no one knows the answers to your questions.

hassan-xy commented 1 month ago

Well can you at least share the I'd of the person working with platform integration.

https://www.yoctoproject.org/ Link to the yocto project. It's just another flavour of the Linux distro but quite popular.

Let me know if anything else is needed.

hassan-xy commented 3 weeks ago

Still waiting for a comment....

hassan-xy commented 2 weeks ago

No updates here as well.