Closed Qqwy closed 1 year ago
Hi @Qqwy, it works fine on my M2 MBP. I wonder if you have any error logs for that?
Maybe there is some weird configuration setting missing on my machine that makes Make/CMake think it should compile for x86 instead?
@Qqwy I think it is something related to Rosetta? Either make
or something else is compiling the wrong version. What happens if you set CMAKE_OSX_ARCHITECTURES=arm64
as an env var in your shell?
What happens if you set CMAKE_OSX_ARCHITECTURES=arm64 as an env var in your shell?
It does not change the output; it seems cmake
does not read those -D
settings (looking into its docs, they seem to be called 'cache entries') from the environment variables.
Running the arch
or uname -m
shell commands on this M1 laptop shows arm64
as expected. 🤔
At the very least it's good to know that it works on your computers, because then it is more likely that it is a problem with my laptop rather than something that needs to be improved in the library 😅
Emmm, that seems to be weird. Could you please add one line in the CMakeLists.txt, below line 14?
message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
It should look like this
... skipped
-- Using PRIV_DIR: /Users/cocoa/Workspace/Git/adbc/_build/test/lib/adbc/priv
-- CMAKE_HOST_SYSTEM_PROCESSOR: arm64
...
Yes, that prints -- CMAKE_HOST_SYSTEM_PROCESSOR: x86_64
🤔 .
I'm currently running cmake version 3.25.1
.
Ah! Updating cmake
resolved the issue. Either the other version was (too) old, or it was installed (only) as part of some kind of rosetta-app installation (which is weird, how did it end up in the non-Rosetta path? 🤐 ). Installing the up-to-date version 3.26.4
through the arm64 version of homebrew fixed the issue.
Thank you both for your help! 🙇
which is weird, how did it end up in the non-Rosetta path?
Maybe the path to the Rosetta bin presents before the non-Rosetta one in $PATH? 🤔
Or it might be linked with --force
option when installed by the x86_64 homebrew?
Until now, the project did not compile on my MacOS M1 laptop. It worked perfectly fine on my old x86-64 Linux laptop, but I wanted to try to make it compile properly on my current laptop as well.
After some trial and error, I've figured out that the proper way to do this, seems to be to pass the option
CMAKE_OSX_ARCHITECTURES=arm64
tocmake
.What I don't know, however, is what the best way to set this setting properly on the actual device the
Makefile
ends up executing on.Any ideas?