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

Zig build is broken #617

Closed
dmorn opened this issue Nov 20, 2023 · 2 comments · Fixed by #840
Closed

Zig build is broken #617

dmorn opened this issue Nov 20, 2023 · 2 comments · Fixed by #840

Comments

@dmorn
Copy link

dmorn commented Nov 20, 2023

I did a bisect, and the first bad commit is 3e551c0. I'll check later if I can fix it, in the meanwhile I'm opening the issue for reference.

@dmorn
Copy link
Author

dmorn commented Nov 20, 2023

Some files are missing in the build

diff --git a/build.zig b/build.zig
index 5aa379d..b6c98e7 100644
--- a/build.zig
+++ b/build.zig
@@ -37,6 +37,7 @@ pub fn build(b: *std.build.Builder) void {
     lib.addIncludePath(.{ .path = "./include/ggml" });
     lib.addCSourceFiles(&.{
         "src/ggml.c",
+        "src/ggml-alloc.c",
     }, &.{"-std=c11"});
     lib.linkLibC();
     lib.linkLibCpp();

I'll see if I can do something for the main branch as this one is from Aug.

@dmorn
Copy link
Author

dmorn commented Nov 20, 2023

OK so basically for master it is needed to add the .c files in src, that's it. Now the compiler is erroring with

error: cannot compare strings with !=
pub inline fn GGML_UNREACHABLE() @TypeOf(GGML_ASSERT(!("statement should not be reached" != 0))) {
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
tests/test0.zig:2:11: error: C import failed: AnalysisFail
const c = @cImport({
          ^~~~~~~~
referenced by:
    main: tests/test0.zig:13:18

Same for every other zig test.

CCLDArjun pushed a commit to CCLDArjun/ggml that referenced this issue Dec 18, 2023
* ggml : add AVX quantize_row_q4_0()

* ggml : add AVX ggml_vec_dot_q4_0()

* ggml : refactor AVX part of ggml_vec_dot_q4_0()

ggerganov/llama.cpp#617 (comment)
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 a pull request may close this issue.

1 participant