New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile all-clusters-app on M1 Mac #19134
Comments
This is being built on an M1, right? And you are building x86-64 (for Rosetta) but do not have the relevant OpenSSL installed, just the ARM version. You should either install the x86-64 version of OpenSSL or do a native ARM build... That said, I'm a little surprised we are not defaulting to a native ARM build to start with. @mspang @andy31415 any idea why that's happening? |
@bzbarsky-apple Yes.. This is on M1 Mac |
@phonnakasturi-apple The point is you need to install the x86-64 version of openssl, not the ARM version. I do not have an M1, so have no idea how to do this, unfortunately. The internet suggests that
might work... But again, it's not clear why you are ending up building the x86-64 version of Matter to start with. |
@bzbarsky-apple I tried with arch -x86_64 brew install openssl and it says;
And throws the same error when I try to compile it |
That does not sound like it installed the x64-64 version, then.... |
What happens if you add 'current_cpu="arm64"' as a build parameter? Not sure if it is related, but it sounds a bit like the problem discussed in this issue: #16759 |
adding the build parameter allowed me to build Matter. I tried also building the python CHIP controller by adding the same parameter to the build script here: https://github.com/project-chip/connectedhomeip/blob/master/scripts/build_python.sh#L116 But I get |
Weird, with no modification I got some SSL errors and was not able to build, if I added the "current_cpu" parameter I was able to build but got a few warnings since the target is macOS 11. Forcing it to set the target to macOS 12, which I also noticed removed the errors in the earlier mentioned issue, I have no issue or warnings when running scripts/build_python.sh. My line 116 looks like this: |
yeah unfortunately that's not working for me and I'm not sure how to troubleshoot it |
We did some investigation in that today, and the reason is that Pigweed uses Rosetta by default on M1 currently (see https://pigweed.dev/docs/faq.html#host-platforms-that-we-are-likely-to-support-in-the-future). But pigweed got you quite far: It essentially built the whole Matter stack, and created a wheel for you for MacOSX/arm64. It's just that installing it using the pigweed Python/pip environment doesn't work since that's a x86-64 Python. The solution to that is to not pass |
There may need to be a Matter side change to account for |
Probably this:
|
Can someone with access to an M1 host test the above change? |
Hmm, I tried adding in the change and bootstrap it. It seems like it still throws the error when I try to build chip-tool.
I did notice that before it stated "_PW_ROSETTA=1" and after the change it reported "_PW_ROSETTA=0". |
Can you provide the build command and the rest of the output ? FWIW you can set chip_crypto="mbedtls" to avoid the openssl via brew hassle |
I did not know about the mbedtls crypto, that might be useful. I ended up using the 'current_cpu="arm64"' 'mac_deployment_target="12.0"' parameters, which have worked great for me, so had not changed that yet. Sure no problem, I re-added the change and tried again. This time I deleted my .environment folder since bootstrap for some reason failed and now it seems to be working so maybe my environment had not gotten the change properly yesterday, but a "vanilla" chip-tool build seems to work ok now: scripts/examples/gn_build_example.sh examples/chip-tool out/chip-tool/
|
With SHA 6c4b54e
all-clusters-app cannot be complied on on-network device (mac)
Steps to reproduce the issue;
Error:
FAILED: address-resolve-tool address-resolve-tool.map
g++ -target x86_64-apple-macos10.15 -O0 -fPIC -Werror -fdiagnostics-color -Wl,-dead_strip -L/opt/homebrew/Cellar/openssl@3/3.0.3/lib -Wl,-map,./address-resolve-tool.map @./address-resolve-tool.rsp -o ./address-resolve-tool
ld: warning: ignoring file /opt/homebrew/Cellar/openssl@3/3.0.3/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/openssl@3/3.0.3/lib/libssl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"_RAND_priv_bytes", referenced from:
chip::Crypto::DRBG_get_bytes(unsigned char*, unsigned long) in libChipCrypto.a(libChipCrypto.CHIPCryptoPALOpenSSL.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[440/455] ar libCHIPAppServer.a
ninja: build stopped: subcommand failed.
Attaching the complete error log:
on-netwrok_logs.txt
The text was updated successfully, but these errors were encountered: