Skip to content
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

Apple Silicon Build Issue #201

Open
jeremiahpslewis opened this issue Sep 26, 2022 · 6 comments
Open

Apple Silicon Build Issue #201

jeremiahpslewis opened this issue Sep 26, 2022 · 6 comments

Comments

@jeremiahpslewis
Copy link

Hi! I'm utterly new to the project, but wanted to build your tool for Apple ARM processors and seem to be hitting the following error:

[16:52:36] g++ -Wall -O3 -static-libgcc -static-libstdc++ -pthread -std=c++14 -c kmc_core/cpu_info.cpp -o kmc_core/cpu_info.o
[16:52:36] In member function ‘void CpuInfoImpl::cpuid(int*, int) const’,
[16:52:36]     inlined from ‘const std::string& CpuInfoImpl::GetBrand()’ at kmc_core/cpu_info.cpp:105:8,
[16:52:36]     inlined from ‘static const std::string& CCpuInfo::GetBrand()’ at kmc_core/cpu_info.cpp:135:31:
[16:52:36] kmc_core/cpu_info.cpp:52:17: error: impossible constraint in ‘asm’
[16:52:36]    52 |                 __asm__("cpuid\n\t"
[16:52:36]       |                 ^~~~~~~
[16:52:36] In member function ‘void CpuInfoImpl::cpuid(int*, int) const’,
[16:52:36]     inlined from ‘const std::string& CpuInfoImpl::GetBrand()’ at kmc_core/cpu_info.cpp:112:9,
[16:52:36]     inlined from ‘static const std::string& CCpuInfo::GetBrand()’ at kmc_core/cpu_info.cpp:135:31:
[16:52:36] kmc_core/cpu_info.cpp:52:17: error: impossible constraint in ‘asm’
[16:52:36]    52 |                 __asm__("cpuid\n\t"
[16:52:36]       |                 ^~~~~~~
[16:52:36] make: *** [Makefile:111: kmc_core/cpu_info.o] Error 1
[16:52:36]  ---> make kmc kmc_dump kmc_tools
[16:52:36]  ---> make kmc kmc_dump kmc_tools
[16:52:36] Previous command exited with 2
[16:52:36] Child Process exited, exit code 2

Is this something that might be amenable to a minor tweak?

@jeremiahpslewis
Copy link
Author

jeremiahpslewis commented Sep 26, 2022

Here's the PR for packaging the binary for the Julia ecosystem in case you're interested. :) JuliaPackaging/Yggdrasil#5582

@marekkokot
Copy link
Contributor

Hello!
Thanks.
Adding support for ARM build is quite high on our priorities list, but we have some things that are higher and need to be completed first. Unfortunately, I'm unable to say when we will add ARM support.

Best
Marek

@jeremiahpslewis
Copy link
Author

Cool! Good to know it's a known topic, will just deactivate the platform for now. :)

@jamshed
Copy link
Contributor

jamshed commented Mar 2, 2023

Hi @marekkokot: mentioning a related update! Recently we released cuttlefish v2.2.0, which builds and runs on M1 and M2. For such, we (@theJasonFan) patched KMC to adopt SIMDe, and this allows KMC to compile natively for ARM. The update-PR is here. This modification should work on other ARM processors too, we believe.

@hmusta
Copy link

hmusta commented Mar 2, 2023

I was looking into this and I noticed that the only SIMD commands used in KMC (_mm_stream_si64 and _mm_stream_si128) have no equivalents in ARM (at least, none that I could find), so SIMDe defaults to doing a regular copy in its implementations of these. So maybe incorporating SIMDe into KMC for this is overkill.

@marekkokot
Copy link
Contributor

marekkokot commented Mar 10, 2023

Hi @jeremiahpslewis @hmusta @jamshed, thank you all very much!

In principle, we prefer to fix such things on our own instead of using big libraries (if possible with an acceptable development cost of course), and here it was only a couple of places in the code to be changed. I've just created a new release with precompiled binaries for ARM64. We would really appreciate any feedback if something is wrong.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants