Repository navigation
cmake : enable curl by default - #12761
Conversation
|
I have no idea how to make the For windows build, I'll have a look to see how we can setup libcurl without copying the same code everywhere. |
| # TODO: avoid copying this code block from common/CMakeLists.txt | ||
| set(LLAMA_RUN_EXTRA_LIBS "") | ||
| if (LLAMA_CURL) | ||
| find_package(CURL REQUIRED) | ||
| target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL) | ||
| include_directories(${CURL_INCLUDE_DIRS}) | ||
| find_library(CURL_LIBRARY curl REQUIRED) | ||
| set(LLAMA_RUN_EXTRA_LIBS ${LLAMA_RUN_EXTRA_LIBS} ${CURL_LIBRARY}) | ||
| endif () |
There was a problem hiding this comment.
@ericcurtin FYI, seems like llama-run was not linked against curl on windows, which will result in compilation error (cannot find curl/curl.h header). I made this quick fix which should work for now.
By default, only libcommon is linked against curl.
There was a problem hiding this comment.
Thanks @ngxson FWIW we are moving away from using llama-run in RamaLama, I wrote a kinda client server thing that automatically terminates both processes on completion instead (the experience is similar to llama-run but better). I was starting to dislike the duplication of efforts in llama-run and llama-server. So I want to try and consolidate on llama-server.
It's a neat tool to test llama-server with all kinds of models, I'm almost ready to push the full version of it to main in RamaLama.
I'll still be happy to look at PRs around llama-run, etc. but it probably won't be actively used in RamaLama anymore at least.
|
@ggerganov This should be ready for review. Btw, I think it will be more convenient to statically link libcurl on windows as curl is not installed at system level. I can give a try in a follow-up PR. |
| # utils, programs, examples and tests | ||
| # | ||
|
|
||
| if (NOT LLAMA_BUILD_EXAMPLES OR NOT LLAMA_BUILD_COMMON) |
There was a problem hiding this comment.
| if (NOT LLAMA_BUILD_EXAMPLES OR NOT LLAMA_BUILD_COMMON) | |
| if (NOT LLAMA_BUILD_EXAMPLES AND NOT LLAMA_BUILD_COMMON) |
Also add a CMake log message when this branch is executed.
There was a problem hiding this comment.
On second thought, I think this condition should be just if NOT LLAMA_BUILD_COMMON, because we cannot build (most of the) examples without libcommon
|
Would the Windows binaries in the releases now have curl support after this change? |
| gcc-14-riscv64-linux-gnu \ | ||
| g++-14-riscv64-linux-gnu | ||
| g++-14-riscv64-linux-gnu \ | ||
| libcurl4-openssl-dev |
There was a problem hiding this comment.
Does this work?
| libcurl4-openssl-dev | |
| libcurl4-openssl-dev:riscv64 |
There was a problem hiding this comment.
Thanks, it works. I tested on my fork: https://github.com/ngxson/llama.cpp/actions/runs/14295363304/job/40061820312
Yeah that's a good question, I thought that we always copy the |
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
ggml-org/llama.cpp#12761, not noticed until now because older commit of llama.cpp was cached by Android Studio
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
* cmake : enable curl by default * no curl if no examples * fix build * fix build-linux-cross * add windows-setup-curl * fix * shell * fix path * fix windows-latest-cmake* * run: include_directories * LLAMA_RUN_EXTRA_LIBS * sycl: no llama_curl * no test-arg-parser on windows * clarification * try riscv64 / arm64 * windows: include libcurl inside release binary * add msg * fix mac / ios / android build * will this fix xcode? * try clearing the cache * add bunch of licenses * revert clear cache * fix xcode * fix xcode (2) * fix typo
When curl was first added to the project, we decided to leave it disabled by default because there was no guarantee that the target system has
libcurlinstalled.But lot of things changed since then, curl now become part of the overall UX of llama.cpp examples. Most of the pre-built version (including own docker images and release binary) have it enabled, so I think it's now a good time to turn it on by default.