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

Swift/Xcode build errors since #4935: spm-headers/llama.h:235:9 Unknown type name 'ggml_backend_sched_eval_callback' #5029

Closed
brittlewis12 opened this issue Jan 18, 2024 · 4 comments

Comments

@brittlewis12
Copy link

brittlewis12 commented Jan 18, 2024

Since b1901 (rev 44a1a4a #4935), I've been unable to build llama.cpp with the provided Package.swift. I bisected back to this PR as the first breaking commit — b1900 (rev c918fe8) seems to work well.

I'm not terribly comfortable with C++, so to my eye I don't see anything wrong with the patch. I noticed the lack of GGML_API prefix like other types in the file, but I tried changing that locally and didn't notice a difference, though it's very possible I applied said change incorrectly/incompletely. EDIT: it seems committing this change indeed resolved the visibility issue I experienced as a result. Proposed a patch: #5030

I would be more than happy to share any other relevant information or test any proposed fixes to the extent that would be helpful!


Here's the full error log:

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Users/tito/code/llama.cpp/spm-headers/llama.h"
        ^
/Users/tito/code/llama.cpp/spm-headers/llama.h:235:9: error: unknown type name 'ggml_backend_sched_eval_callback'
        ggml_backend_sched_eval_callback cb_eval;
@ggerganov
Copy link
Member

It should work without GGML_API - I think your changes coincided with a ggml package update. If you init cleanly the Swift project it should work without modifications

@brittlewis12
Copy link
Author

brittlewis12 commented Jan 19, 2024

That does indeed resolve the build errors I was seeing — thanks very much!

I wonder if this might also have been compounded by the way the ggml dependency is declared in this repo's Package.swift — it appears to use a branch specifier for "release", rather than mirroring the latest synced SHA in the repo. Could that have an effect if they get out of sync temporarily?

EDIT: I've read thru #4867 and appreciate the current design is to enable whisper.cpp & this repo to share the ggml dep.

@ggerganov
Copy link
Member

Well, it's pretty much the same thing, because I manually update the release branch when I have to update the Swift package. Overall, the current process is not optimal, but I think we are converging to a stable solution and such kind of problems will happen less often

@brittlewis12
Copy link
Author

I can very much appreciate the underlying complexity you're wrangling, and I have no doubt it will continue to improve with time. Thanks again for all your hard work on these fantastic projects!

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