Skip to content

Conversation

DamonFool
Copy link
Contributor

llama.cpp fails to build with -march=armv9-a on MacOS.

cmake .. -DCMAKE_C_FLAGS=-march=armv9-a \
         -DCMAKE_CXX_FLAGS=-march=armv9-a

The failure is caused by 'sys/prctl.h' file not found.

In file included from /Users/jiefu/llama.cpp/ggml/src/ggml-quants.c:6:
/Users/jiefu/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h:72:10: fatal error: 'sys/prctl.h' file not found
   72 | #include <sys/prctl.h>
      |          ^~~~~~~~~~~~~
1 error generated.

Similar issue had been reported before: sysown/proxysql#1920 .
Reason: sys/prctl.h does not exist on Mac OS X, only on Linux.

The fix follows what has been done in ggml by adding defined(__linux__) : https://github.com/ggml-org/llama.cpp/blob/master/ggml/src/ggml.c#L72

Signed-off-by: Jie Fu <jiefu@tencent.com>
Copy link
Member

@slaren slaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use SVE ggml_init_arm_arch_features needs to be implemented to initialize sve_cnt.

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants