Skip to content

Commit c2437b8

Browse files
committed
add curl dev dependency
1 parent 2b447ec commit c2437b8

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
100100
libssl3 \
101101
libffi8 \
102102
libcurl4 \
103+
libcurl4-openssl-dev \
103104
libopenblas0 \
104105
# GPU acceleration support
105106
libvulkan1 \

backend/llama_manager.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,23 @@ def set_flag(flag: str, value: bool):
935935
set_flag("GGML_LTO", build_config.enable_lto)
936936
set_flag("GGML_NATIVE", build_config.enable_native)
937937

938+
# Disable CURL if not available (llama.cpp requires it by default, but we can disable it)
939+
# Try to detect if CURL dev headers are available
940+
try:
941+
result = subprocess.run(
942+
["pkg-config", "--exists", "libcurl"],
943+
capture_output=True,
944+
timeout=2
945+
)
946+
if result.returncode != 0:
947+
# CURL not found, disable it
948+
set_flag("LLAMA_CURL", False)
949+
logger.warning("CURL development headers not found, disabling LLAMA_CURL")
950+
except (FileNotFoundError, subprocess.TimeoutExpired):
951+
# pkg-config not available or timeout, try to disable CURL to avoid build failure
952+
set_flag("LLAMA_CURL", False)
953+
logger.warning("Could not check for CURL, disabling LLAMA_CURL to avoid build failure")
954+
938955
# Add custom CMake args if provided
939956
if build_config.custom_cmake_args:
940957
import shlex

0 commit comments

Comments
 (0)