Skip to content

Failed to build "sources/go-llama/llama.go:372:13: undefined: min" #1807

Closed
@longdafeng

Description

@longdafeng

LocalAI version:

git log
commit ad6fd7a9914cbdfee19f7ac2eb235e5f420546aa (HEAD -> master, origin/master, origin/HEAD)
Author: LocalAI [bot] <[email protected]>
Date:   Wed Mar 6 23:28:31 2024 +0100

    :arrow_up: Update ggerganov/llama.cpp (#1805)
    
    Signed-off-by: GitHub <[email protected]>
    Co-authored-by: mudler <[email protected]>

commit e022b5959ea409586bcead3473bbe8c180b9d2bf
Author: LocalAI [bot] <[email protected]>
Date:   Wed Mar 6 00:39:57 2024 +0100

    :arrow_up: Update mudler/go-stable-diffusion (#1802)
    
    Signed-off-by: GitHub <[email protected]>
    Co-authored-by: mudler <[email protected]>

Environment, CPU architecture, OS, and Version:

uname -a
Linux iZj6c6ukj0hyueihced2ctZ 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

debian_12_4_x64

aliyun ecs

Describe the bug

binding.cpp:809:17: warning: invalid use of incomplete type ‘struct llama_model’
  809 |     delete ctx->model;
      |            ~~~~~^~~~~
In file included from ./llama.cpp/common/common.h:5,
                 from binding.cpp:1:
./llama.cpp/llama.h:60:12: note: forward declaration of ‘struct llama_model’
   60 |     struct llama_model;
      |            ^~~~~~~~~~~
binding.cpp:809:5: note: neither the destructor nor the class-specific ‘operator delete’ will be called, even if they are declared when the class is defined
  809 |     delete ctx->model;
      |     ^~~~~~~~~~~~~~~~~
cd build && cp -rf CMakeFiles/ggml.dir/k_quants.c.o ../llama.cpp/k_quants.o
ar src libbinding.a llama.cpp/ggml.o llama.cpp/k_quants.o  llama.cpp/ggml-alloc.o llama.cpp/common.o llama.cpp/grammar-parser.o llama.cpp/llama.o binding.o
make[1]: Leaving directory '/home/longda/work/repo/LocalAI/sources/go-llama'
go mod edit -replace github.com/go-skynet/go-llama.cpp=/home/longda/work/repo/LocalAI/sources/go-llama
CGO_LDFLAGS="" C_INCLUDE_PATH=/home/longda/work/repo/LocalAI/sources/go-llama LIBRARY_PATH=/home/longda/work/repo/LocalAI/sources/go-llama \
go build -ldflags "-X "github.com/go-skynet/LocalAI/internal.Version=v2.9.0-40-gad6fd7a" -X "github.com/go-skynet/LocalAI/internal.Commit=ad6fd7a9914cbdfee19f7ac2eb235e5f420546aa"" -tags "" -o backend-assets/grpc/llama ./backend/go/llm/llama/
# github.com/go-skynet/go-llama.cpp
binding.cpp: In function ‘void llama_binding_free_model(void*)’:
binding.cpp:809:5: warning: possible problem detected in invocation of ‘operator delete’ [-Wdelete-incomplete]
  809 |     delete ctx->model;
      |     ^~~~~~~~~~~~~~~~~
binding.cpp:809:17: warning: invalid use of incomplete type ‘struct llama_model’
  809 |     delete ctx->model;
      |            ~~~~~^~~~~
In file included from sources/go-llama/llama.cpp/common/common.h:5,
                 from binding.cpp:1:
sources/go-llama/llama.cpp/llama.h:60:12: note: forward declaration of ‘struct llama_model’
   60 |     struct llama_model;
      |            ^~~~~~~~~~~
binding.cpp:809:5: note: neither the destructor nor the class-specific ‘operator delete’ will be called, even if they are declared when the class is defined
  809 |     delete ctx->model;
      |     ^~~~~~~~~~~~~~~~~
# github.com/go-skynet/go-llama.cpp
sources/go-llama/llama.go:372:13: undefined: min

To Reproduce

Expected behavior

Logs

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions