Skip to content

Commit bd3f59f

Browse files
authored
cmake : enable curl by default (#12761)
* 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
1 parent 52b3d71 commit bd3f59f

22 files changed

+209
-49
lines changed

.devops/cpu.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ WORKDIR /app
1414
COPY . .
1515

1616
RUN if [ "$TARGETARCH" = "amd64" ]; then \
17-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
17+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
1818
elif [ "$TARGETARCH" = "arm64" ]; then \
19-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
19+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
2020
else \
2121
echo "Unsupported architecture"; \
2222
exit 1; \

.devops/cuda.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COPY . .
2121
RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
2222
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
2323
fi && \
24-
cmake -B build -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
24+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CUDA=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
2525
cmake --build build --config Release -j$(nproc)
2626

2727
RUN mkdir -p /app/lib && \

.devops/intel.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
1717
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
1818
fi && \
1919
echo "Building with dynamic libs" && \
20-
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
20+
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
2121
cmake --build build --config Release -j$(nproc)
2222

2323
RUN mkdir -p /app/lib && \

.devops/musa.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ COPY . .
3535
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
3636
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
3737
fi && \
38-
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
38+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
3939
cmake --build build --config Release -j$(nproc)
4040

4141
RUN mkdir -p /app/lib && \

.devops/rocm.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ WORKDIR /app
4040
COPY . .
4141

4242
RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
43-
cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=$ROCM_DOCKER_ARCH -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON \
43+
cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=$ROCM_DOCKER_ARCH -DCMAKE_BUILD_TYPE=Release \
4444
&& cmake --build build --config Release -j$(nproc)
4545

4646
RUN mkdir -p /app/lib \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Windows - Setup CURL'
2+
description: 'Composite action, to be reused in other workflow'
3+
inputs:
4+
curl_version:
5+
description: 'CURL version'
6+
required: false
7+
default: '8.6.0_6'
8+
outputs:
9+
curl_path:
10+
description: "Path to the downloaded libcurl"
11+
value: ${{ steps.get_libcurl.outputs.curl_path }}
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: libCURL
17+
id: get_libcurl
18+
shell: powershell
19+
env:
20+
CURL_VERSION: ${{ inputs.curl_version }}
21+
run: |
22+
curl.exe -o $env:RUNNER_TEMP/curl.zip -L "https://curl.se/windows/dl-${env:CURL_VERSION}/curl-${env:CURL_VERSION}-win64-mingw.zip"
23+
mkdir $env:RUNNER_TEMP/libcurl
24+
tar.exe -xvf $env:RUNNER_TEMP/curl.zip --strip-components=1 -C $env:RUNNER_TEMP/libcurl
25+
echo "curl_path=$env:RUNNER_TEMP/libcurl" >> $env:GITHUB_OUTPUT

.github/workflows/bench.yml.disabled

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ jobs:
104104
cmake -B build \
105105
-DGGML_NATIVE=OFF \
106106
-DLLAMA_BUILD_SERVER=ON \
107-
-DLLAMA_CURL=ON \
108107
-DLLAMA_CUBLAS=ON \
109108
-DCUDAToolkit_ROOT=/usr/local/cuda \
110109
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \

.github/workflows/build-linux-cross.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
sudo apt-get install -y --no-install-recommends \
2020
build-essential \
2121
gcc-14-riscv64-linux-gnu \
22-
g++-14-riscv64-linux-gnu
22+
g++-14-riscv64-linux-gnu \
23+
libcurl4-openssl-dev:riscv64
2324
2425
- name: Build
2526
run: |
@@ -59,7 +60,8 @@ jobs:
5960
glslc \
6061
gcc-14-riscv64-linux-gnu \
6162
g++-14-riscv64-linux-gnu \
62-
libvulkan-dev:riscv64
63+
libvulkan-dev:riscv64 \
64+
libcurl4-openssl-dev:riscv64
6365
6466
- name: Build
6567
run: |
@@ -99,7 +101,8 @@ jobs:
99101
build-essential \
100102
glslc \
101103
crossbuild-essential-arm64 \
102-
libvulkan-dev:arm64
104+
libvulkan-dev:arm64 \
105+
libcurl4-openssl-dev:arm64
103106
104107
- name: Build
105108
run: |

0 commit comments

Comments
 (0)