ggerganov / llama.cpp

LLM inference in C/C++
MIT License
67.24k stars 9.66k forks source link

Bug: symbols conflict with whisper.cpp #9267

Closed thewh1teagle closed 5 days ago

thewh1teagle commented 2 months ago

What happened?

I'm trying to use llama.cpp alongside whisper.cpp in Rust but I can't link the libraries because they link the same ggml symbols.

llama-cpp-2 and whisper-rs

Name and Version

8f1d81a0b6f50b9bad72db0b6fcd299ad9ecd48c https://github.com/ggerganov/whisper.cpp/commit/c96906d84dd6a1c40ea797ad542df3a0c47307a3

What operating system are you seeing the problem on?

Windows

Relevant log output

b\\rustlib\\etc\\libstd.natvis"
  = note: libllama_cpp_sys_2-1131e8f6e28c8598.rlib(ggml-backend.obj) : error LNK2005: ggml_backend_buft_name already defined in libwhisper_rs_sys-f2fa5877d4809bf3.rlib(ggml-backend.obj)
          libllama_cpp_sys_2-1131e8f6e28c8598.rlib(ggml-backend.obj) : error LNK2005: ggml_backend_buft_alloc_buffer already defined in libwhisper_rs_sys-f2fa5877d4809bf3.rlib(ggml-backend.obj)

Is there a known solution for that? maybe adding prefix to the symbols? can it be configured at compile time per each library with cmake?

thewh1teagle commented 2 months ago

Does ggml version of llama.cpp synced with whisper.cpp so I can link ggml once? Seems like ggml is not submodule here

ggerganov commented 1 month ago

The source code of the ggml library is synced regularly between whisper.cpp and llama.cpp

mjsmith707 commented 1 month ago

I see the same with my own project. It would be good if both codebases shared the same ggml as a submodule as already mentioned. I went to manually merge in the libllama ggml stuff into libwhisper but there's enough differences as to be annoying.

github-actions[bot] commented 5 days ago

This issue was closed because it has been inactive for 14 days since being marked as stale.