-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Do not use _GNU_SOURCE gratuitously. #2035
Conversation
macOS builds are working, that's good, but I have not tested cmake-driven builds, sorry for that, and of course they have to fail. I will have limited time for rest of the work week, so it's possible I will look at it only during weekend. I will have to check what are the best ways to provide FTMs in cmake, as I am not familiar with this build system. |
No worries - whenever you get the time |
Check this for cmake fix: |
Thanks, @howard0su. I haven't spent much time with CMake (whenever I looked at any CMakeLists.txt files in the past over years, they repelled me for some reason), so I'm not able to judge atm if what you've done is proper (idiomatic) way of handling FTMs in CMake, but at least it looks like viable way way of doing that, so I may end up adding your commit to PR. For now I've noticed that |
158dabf
to
9769461
Compare
I rebased it (and did one new removal in one commit) on top of #2235 (fix-make-on-msys2), so do not merge current #2035 before merging #2235 first (which atm does not fix CMake on MSYS2, as I already commented there). I added modified commit from howard0su here. Was hoping CI checks would trigger automatically, as they were already enabled in the past for this PR, but it's not the case. |
9769461
to
23ae8b5
Compare
f5bc245
to
2182590
Compare
FreeBSD is not covered in |
I finally updated ggerganov/whisper.cpp#1129 today, so I will have to update this one too, but |
2182590
to
40d9ca9
Compare
I updated the branch, but it's kind of untested locally yet, so theoretically it may be not clean. |
Portable applications should employ |
What is needed to build llama.cpp and examples is availability of stuff defined in The Open Group Base Specifications Issue 6 (https://pubs.opengroup.org/onlinepubs/009695399/) known also as Single Unix Specification v3 (SUSv3) or POSIX.1-2001 + XSI extensions, plus some stuff from BSD that is not specified in POSIX.1. Well, that was true until NUMA support was added recently, so enable GNU libc extensions for Linux builds to cover that. Not having feature test macros in source code gives greater flexibility to those wanting to reuse it in 3rd party app, as they can build it with FTMs set by Makefile here or other FTMs depending on their needs. It builds without issues in Alpine (musl libc), Ubuntu (glibc), MSYS2.
40d9ca9
to
39d1b76
Compare
Rebased after #3037 got merged. Hopefully there won't be any problems in checks anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @przemoc
Let's wait for the CI and merge if everything is OK
What is needed to build llama.cpp and examples is availability of stuff defined in The Open Group Base Specifications Issue 6 (https://pubs.opengroup.org/onlinepubs/009695399/) known also as Single Unix Specification v3 (SUSv3) or POSIX.1-2001 + XSI extensions, plus some stuff from BSD that is not specified in POSIX.1.
Well, that was true until NUMA support was added recently, so enable GNU libc extensions for Linux builds to cover that.
Not having feature test macros in source code gives greater flexibility to those wanting to reuse it in 3rd party app, as they can build it with FTMs set by Makefile here or other FTMs depending on their needs.
It builds without issues in Alpine (musl libc), Ubuntu (glibc), MSYS2.
llama : use posix_madvise() instead of madvise() derived from BSD
sed -i 's,<madvise>,posix_&,g;s,<MADV_,POSIX_&,g' llama-util.h
make : enable Darwin extensions for macOS builds
This is an attempt at fixing macOS build error coming from the fact that RLIMIT_MEMLOCK define is not available there without Darwin extensions.
cmake : follow recent FTM improvements from Makefile