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

error: call to undeclared function 'pthread_getaffinity_np'; ISO C99 and later do not support implicit function declarations #5565

Closed
USBhost opened this issue Feb 18, 2024 · 2 comments

Comments

@USBhost
Copy link

USBhost commented Feb 18, 2024

Android 14
OnePlus 12
Running Termux.

git revert f486f6e

That revert fixes the issue so something is broken on that merge for android.

~/llama.cpp $ make
make: which: No such file or directory
I ccache not found. Consider installing it for faster compilation.
expr: syntax error: unexpected argument ‘070100’
expr: syntax error: unexpected argument ‘080100’
make: jetson_release: No such file or directory
I llama.cpp build info:
I UNAME_S:   Linux
I UNAME_P:   unknown
I UNAME_M:   aarch64
I CFLAGS:    -I. -Icommon -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG  -std=c11   -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wdouble-promotion -pthread -mcpu=native -Wunreachable-code-break -Wunreachable-code-return -Wdouble-promotion
I CXXFLAGS:  -I. -Icommon -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG  -std=c++11 -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread -mcpu=native   -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi
I NVCCFLAGS: -O3
I LDFLAGS:
I CC:        clang version 17.0.6
I CXX:       clang version 17.0.6

cc  -I. -Icommon -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG  -std=c11   -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wdouble-promotion -pthread -mcpu=native -Wunreachable-code-break -Wunreachable-code-return -Wdouble-promotion    -c ggml.c -o ggml.o
ggml.c:1327:5: warning: implicit conversion increases floating-point precision: 'float32_t' (aka 'float') to 'ggml_float' (aka 'double') [-Wdouble-promotion]
 1327 |     GGML_F16_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ggml.c:842:41: note: expanded from macro 'GGML_F16_VEC_REDUCE'
  842 |     #define GGML_F16_VEC_REDUCE         GGML_F32Cx4_REDUCE
      |                                         ^
ggml.c:832:38: note: expanded from macro 'GGML_F32Cx4_REDUCE'
  832 |     #define GGML_F32Cx4_REDUCE       GGML_F32x4_REDUCE
      |                                      ^
ggml.c:762:11: note: expanded from macro 'GGML_F32x4_REDUCE'
  762 |     res = GGML_F32x4_REDUCE_ONE(x[0]);         \
      |         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ggml.c:747:34: note: expanded from macro 'GGML_F32x4_REDUCE_ONE'
  747 | #define GGML_F32x4_REDUCE_ONE(x) vaddvq_f32(x)
      |                                  ^~~~~~~~~~~~~
ggml.c:1375:9: warning: implicit conversion increases floating-point precision: 'float32_t' (aka 'float') to 'ggml_float' (aka 'double') [-Wdouble-promotion]
 1375 |         GGML_F16_VEC_REDUCE(sumf[k], sum[k]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ggml.c:842:41: note: expanded from macro 'GGML_F16_VEC_REDUCE'
  842 |     #define GGML_F16_VEC_REDUCE         GGML_F32Cx4_REDUCE
      |                                         ^
ggml.c:832:38: note: expanded from macro 'GGML_F32Cx4_REDUCE'
  832 |     #define GGML_F32Cx4_REDUCE       GGML_F32x4_REDUCE
      |                                      ^
ggml.c:762:11: note: expanded from macro 'GGML_F32x4_REDUCE'
  762 |     res = GGML_F32x4_REDUCE_ONE(x[0]);         \
      |         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ggml.c:747:34: note: expanded from macro 'GGML_F32x4_REDUCE_ONE'
  747 | #define GGML_F32x4_REDUCE_ONE(x) vaddvq_f32(x)
      |                                  ^~~~~~~~~~~~~
ggml.c:2018:5: error: call to undeclared function 'pthread_getaffinity_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2018 |     pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
      |     ^
ggml.c:2018:5: note: did you mean 'pthread_getattr_np'?
/data/data/com.termux/files/usr/include/pthread.h:190:5: note: 'pthread_getattr_np' declared here
  190 | int pthread_getattr_np(pthread_t __pthread, pthread_attr_t* _Nonnull __attr);
      |     ^
ggml.c:2066:22: error: call to undeclared function 'getcpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2066 |     int getcpu_ret = getcpu(&current_cpu, &g_state.numa.current_node);
      |                      ^
2 warnings and 2 errors generated.
make: *** [Makefile:617: ggml.o] Error 1
@thistleknot
Copy link

thistleknot commented Feb 18, 2024

solution PR 5557: f486f6e#r138767107

@USBhost
Copy link
Author

USBhost commented Feb 18, 2024

solution PR 5577: f486f6e#r138767107

Thanks and I was blind I did not see the other bug post. Closing as a dup.

@USBhost USBhost closed this as completed Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants