Repository navigation
Bug: Can't build LLAMA_CURL=ON to embed curl on windows x64 build. #9937
Description
What happened?
When I build the following:
cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=ON
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.20348.
-- OpenMP found
-- Using llamafile
-- CUDA found
-- Using CUDA architectures: 52;61;70;75
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM:
-- x86 detected
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-
3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindCURL.cmake:196 (find_package_handle_standard_args)
common/CMakeLists.txt:81 (find_package)
-- Configuring incomplete, errors occurred!
Name and Version
version: 3928 (66c2c93)
built with MSVC 19.41.34123.0 for x64
What operating system are you seeing the problem on?
Windows
Relevant log output
the following envars are set:
CURL_INCLUDE_DIR=C:\Tools\Curl\curl-8.10.1_5-win64-mingw\include
CURL_LIBRARY=C:\Tools\Curl\curl-8.10.1_5-win64-mingw\lib
Directory of C:\Tools\Curl\curl-8.10.1_5-win64-mingw\include
17/10/2024 10:20 <DIR> .
17/10/2024 10:20 <DIR> ..
17/10/2024 10:20 <DIR> brotli
17/10/2024 10:20 <DIR> curl
17/10/2024 10:20 5,792 libpsl.h
17/10/2024 10:20 60,665 libssh2.h
17/10/2024 10:20 4,942 libssh2_publickey.h
17/10/2024 10:20 17,369 libssh2_sftp.h
17/10/2024 10:20 <DIR> nghttp2
17/10/2024 10:20 <DIR> nghttp3
17/10/2024 10:20 <DIR> ngtcp2
17/10/2024 10:20 <DIR> openssl
17/10/2024 10:20 16,546 zconf.h
17/10/2024 10:20 26,433 zdict.h
17/10/2024 10:20 96,829 zlib.h
17/10/2024 10:20 175,838 zstd.h
17/10/2024 10:20 4,532 zstd_errors.h
Directory of C:\Tools\Curl\curl-8.10.1_5-win64-mingw\lib
17/10/2024 10:20 <DIR> .
17/10/2024 10:20 <DIR> ..
17/10/2024 10:20 134,498 libbrotlicommon.a
17/10/2024 10:20 56,790 libbrotlidec.a
17/10/2024 10:20 3,329,616 libcrypto.a
17/10/2024 10:20 1,662,308 libcurl.a
17/10/2024 10:20 16,226 libcurl.dll.a
17/10/2024 10:20 301,336 libnghttp2.a
17/10/2024 10:20 249,706 libnghttp3.a
17/10/2024 10:20 454,518 libngtcp2.a
17/10/2024 10:20 41,116 libngtcp2_crypto_quictls.a
17/10/2024 10:20 68,354 libpsl.a
17/10/2024 10:20 443,048 libssh2.a
17/10/2024 10:20 680,946 libssl.a
17/10/2024 10:20 123,878 libz.a
17/10/2024 10:20 845,984 libzstd.a
Activity
github-actions commentedon Dec 2, 2024
This issue was closed because it has been inactive for 14 days since being marked as stale.
gumaerc commentedon Feb 3, 2025
I can confirm this is an issue for me as well. I tried locally building CURL in Windows with the newest and older versions. Setting
CURL_LIBRARYandCURL_INCLUDE_DIRin my environment did not work. I read that you can use the-DCURL_LIBRARYand-DCURL_INCLUDE_DIRarguments to specify them at the command line and tried that, but the latest Windows release of CURL that you download from them does not include the proper .lib file.So, I went and downloaded the source and compiled it. I switched to the
winbuilddirectory and rannmake /f Makefile.vc mode=staticand it compiled the library. I pointed the llama.cpp build at the output, and I got a bunch of errors that look similar to this:randaller commentedon May 1, 2025
To build llama.cpp with curl using MSVC:
Enter llama.cpp git directory and:
and then build as usual, just adding paths:
Do not forget to copy \llama.cpp\vcpkg\installed\x64-windows\bin\ libcurl.dll and zlib1.dll to a \llama.cpp folder.
subbu124 commentedon May 16, 2025
randeller : i tried your way on my laptop with no gpu, all compiled, but cli.exe or server.exe, are not working, nothing happens after command, it shifts to console without doing anything. anythoughts? actually i am not trying to build with curl, but it is giving curl error, so i tried your method, it compiled but facing above issue
randaller commentedon May 17, 2025
Did you removed -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON parameters? I am compiling for cuda and just forgot to remove from example. Also check if libcurl and zlib dlls lays in llama-cli.exe folder. For my cuda build parameters there also should be three cudart/cublas libraries, may be this causes error.