cmake: fix cli build when LLAMA_BUILD_SERVER=OFF#18670
cmake: fix cli build when LLAMA_BUILD_SERVER=OFF#18670ngxson merged 1 commit intoggml-org:masterfrom
Conversation
|
You can skip building llama-cli when build_server is disabled. I prefer that simple fix. You won't use cli for binding anyway |
We don't need I have tested setting |
|
Have you read my suggestion above? |
e89a2e2 to
3c2e276
Compare
Ah okay. I read it, but misunderstood it. Sorry about that. 😅 I implemented your suggestion now. |
The Problem
The problem is that building with
-DLLAMA_BUILD_SERVER=OFFdoes not work, sincellama-clinow depends onserver-context(since #17824).To reproduce the issue on current latest master (commit 5642667):
It will produce the following error:
This build error is what has prevented utilityai/llama-cpp-rs from bumping the llama.cpp version for the past month.
The Fix
I fixed this by moving theif (LLAMA_BUILD_SERVER)conditional fromtools/CMakeLists.txtinto the part oftools/server/CMakeLists.txtthat builds the actual server executable. So now ifLLAMA_BUILD_SERVERisOFF, it will still build the server shared libs (whichllama-clidepend on), but not the server executable itself.I fixed this by moving the
clitarget into theLLAMA_BUILD_SERVERconditional.If
LLAMA_BUILD_TOOLS=ONandLLAMA_BUILD_SERVER=OFF, it will not build cli or server, but it will build the rest.I have run the
ci/run.shtesting suite to confirm that everything works as before.AI Disclosure
The code changes in this PR were all made and verified by human hands and eyes, but LLM assistance was used for identifying the problem and suggesting several solutions (one of which is this solution).