Skip to content

Make CURL dependency optional in tools/run/CMakeLists.txt#8

Merged
TheOriginalBytePlayer merged 3 commits intomasterfrom
copilot/fix-build-issues
Jan 1, 2026
Merged

Make CURL dependency optional in tools/run/CMakeLists.txt#8
TheOriginalBytePlayer merged 3 commits intomasterfrom
copilot/fix-build-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 1, 2026

Description

CMake configuration fails on Windows when CURL is unavailable because tools/run/CMakeLists.txt uses find_package(CURL REQUIRED), while common/CMakeLists.txt correctly makes CURL optional with cpp-httplib fallback.

Changes:

  • Remove REQUIRED flag from find_package(CURL) in tools/run/CMakeLists.txt
  • Add fallback logic matching common/CMakeLists.txt: disable CURL when not found, emit warning
  • When CURL unavailable, llama-run uses cpp-httplib via common library (already supported in code)
# Before
if (LLAMA_CURL)
    find_package(CURL REQUIRED)  # Fails entire config if CURL missing
    # ...
endif ()

# After
if (LLAMA_CURL)
    find_package(CURL)  # Optional
    if (NOT CURL_FOUND)
        message(WARNING "Could NOT find CURL. Falling back to cpp-httplib...")
        set(LLAMA_CURL OFF)
    else()
        # ... configure CURL
    endif()
endif ()

The run.cpp implementation already handles both code paths via conditional compilation (#ifdef LLAMA_USE_CURL).

Original prompt

Your "FIX" did not fix my build issues.

C:\Users\kens\source\repos\llama.cpp>git pull origin master
From https://github.com/TheOriginalBytePlayer/llama.cpp

  • branch master -> FETCH_HEAD
    Already up to date.

C:\Users\kens\source\repos\llama.cpp>cmake -B build
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26200.
CMAKE_BUILD_TYPE=
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM:
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- x86 detected
-- Adding CPU backend variant ggml-cpu: /arch:AVX512 GGML_AVX512
-- ggml version: 0.9.5
-- ggml commit: 246f5702
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
CMake Warning at common/CMakeLists.txt:102 (message):
Could NOT find CURL. Falling back to cpp-httplib. Hint: to explicitly
disable CURL, set -DLLAMA_CURL=OFF

CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:227 (message):
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:591 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-4.0/Modules/FindCURL.cmake:211 (find_package_handle_standard_args)
tools/run/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!

C:\Users\kens\source\repos\llama.cpp>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 1, 2026 14:13
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build issues related to missing CURL Make CURL dependency optional in tools/run/CMakeLists.txt Jan 1, 2026
@TheOriginalBytePlayer TheOriginalBytePlayer marked this pull request as ready for review January 1, 2026 21:58
Copilot AI review requested due to automatic review settings January 1, 2026 21:58
@TheOriginalBytePlayer TheOriginalBytePlayer merged commit dd530e8 into master Jan 1, 2026
39 of 72 checks passed
@TheOriginalBytePlayer TheOriginalBytePlayer deleted the copilot/fix-build-issues branch January 1, 2026 22:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the CURL dependency optional in tools/run/CMakeLists.txt to prevent build failures on Windows when CURL is unavailable, matching the fallback behavior already implemented in common/CMakeLists.txt.

  • Removes REQUIRED flag from find_package(CURL) to make CURL optional
  • Adds conditional fallback logic that disables CURL and emits a warning when CURL is not found
  • Ensures llama-run can use cpp-httplib through the common library when CURL is unavailable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants