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

Fix a Typo Which Causes It Unable to Compile with Old Glibc #5694

Closed
wants to merge 1 commit into from

Conversation

PeronGH
Copy link

@PeronGH PeronGH commented Feb 23, 2024

I encoutered this error when compiling llama.cpp.

ggml.c: In function 'ggml_numa_init':
ggml.c:2088:26: error: 'SYS_getcpu' undeclared (first use in this function); did you mean 'SYS_get_cpu'?
 2088 |     getcpu_ret = syscall(SYS_getcpu,&current_cpu,&g_state.numa.current_node);
      |                          ^~~~~~~~~~
      |                          SYS_get_cpu
ggml.c:2088:26: note: each undeclared identifier is reported only once for each function it appears in

I followed the comiler suggestions to fix the typo and then successfully compiled it.

Fix a typo which causes it unable to compile with old glibc
@cebtenzzre
Copy link
Collaborator

But this isn't a typo - there is no SYS_get_cpu on my system (Arch Linux with up-to-date Linux and glibc), only SYS_getcpu. Perhaps SYS_get_cpu was a typo in the headers that was later fixed?

See the discussion at #5557

@PeronGH
Copy link
Author

PeronGH commented Feb 23, 2024

Maybe this is specific to the old version of glibc? Here is more info about my system:

$ uname -a
Linux xxx 3.10.0-1160.105.1.el7.x86_64 #1 SMP Mon Nov 6 06:58:51 EST 2023 x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (conda-forge gcc 13.2.0-5) 13.2.0
...

$ ldd --version
ldd (GNU libc) 2.17
...

And SYS_get_cpu works for me, but SYS_getcpu doesn't.

@ggerganov
Copy link
Owner

Maybe ifdef it specifically for that version of glibc

@petterreinholdtsen
Copy link

See ggerganov/whisper.cpp#1897 for a proposed solution handling both SYS_ names.

@bobqianic
Copy link
Contributor

bobqianic commented Feb 24, 2024

I've searched through various versions of Linux but couldn't locate any reference to SYS_get_cpu. It seems only SYS_getcpu is available.

https://elixir.bootlin.com/linux/latest/A/ident

And SYS_get_cpu works for me, but SYS_getcpu doesn't.

This is strange.

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

Successfully merging this pull request may close these issues.

5 participants