-
Notifications
You must be signed in to change notification settings - Fork 12.2k
cmake : enable curl by default #12761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6080f6e
cmake : enable curl by default
ngxson 6455796
no curl if no examples
ngxson 2cc893b
fix build
ngxson 793074c
fix build-linux-cross
ngxson 2238e70
add windows-setup-curl
ngxson 707f2b9
fix
ngxson 79509cc
shell
ngxson 21c423e
fix path
ngxson 9bf42cd
fix windows-latest-cmake*
ngxson a8a7ed9
run: include_directories
ngxson a963705
LLAMA_RUN_EXTRA_LIBS
ngxson 04eddb8
sycl: no llama_curl
ngxson 64faafc
no test-arg-parser on windows
ngxson 1c1c2c7
clarification
ngxson aec8b46
try riscv64 / arm64
ngxson 26166a4
windows: include libcurl inside release binary
ngxson 533e0dc
add msg
ngxson 43a7eec
fix mac / ios / android build
ngxson c45a9c4
will this fix xcode?
ngxson fef3248
try clearing the cache
ngxson 02257b7
add bunch of licenses
ngxson b5aafd6
revert clear cache
ngxson ca0f7c4
fix xcode
ngxson 40fe8f2
fix xcode (2)
ngxson d926a54
fix typo
ngxson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Windows - Setup CURL' | ||
description: 'Composite action, to be reused in other workflow' | ||
inputs: | ||
curl_version: | ||
description: 'CURL version' | ||
required: false | ||
default: '8.6.0_6' | ||
outputs: | ||
curl_path: | ||
description: "Path to the downloaded libcurl" | ||
value: ${{ steps.get_libcurl.outputs.curl_path }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: libCURL | ||
id: get_libcurl | ||
shell: powershell | ||
env: | ||
CURL_VERSION: ${{ inputs.curl_version }} | ||
run: | | ||
curl.exe -o $env:RUNNER_TEMP/curl.zip -L "https://curl.se/windows/dl-${env:CURL_VERSION}/curl-${env:CURL_VERSION}-win64-mingw.zip" | ||
mkdir $env:RUNNER_TEMP/libcurl | ||
tar.exe -xvf $env:RUNNER_TEMP/curl.zip --strip-components=1 -C $env:RUNNER_TEMP/libcurl | ||
echo "curl_path=$env:RUNNER_TEMP/libcurl" >> $env:GITHUB_OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ jobs: | |
continue-on-error: true | ||
run: | | ||
brew update | ||
brew install curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -62,7 +63,6 @@ jobs: | |
cmake -B build \ | ||
-DCMAKE_BUILD_RPATH="@loader_path" \ | ||
-DLLAMA_FATAL_WARNINGS=ON \ | ||
-DLLAMA_CURL=ON \ | ||
-DGGML_METAL_USE_BF16=ON \ | ||
-DGGML_METAL_EMBED_LIBRARY=ON \ | ||
-DGGML_RPC=ON | ||
|
@@ -123,6 +123,7 @@ jobs: | |
continue-on-error: true | ||
run: | | ||
brew update | ||
brew install curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -133,7 +134,6 @@ jobs: | |
cmake -B build \ | ||
-DCMAKE_BUILD_RPATH="@loader_path" \ | ||
-DLLAMA_FATAL_WARNINGS=ON \ | ||
-DLLAMA_CURL=ON \ | ||
-DGGML_METAL=OFF \ | ||
-DGGML_RPC=ON | ||
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) | ||
|
@@ -207,7 +207,6 @@ jobs: | |
run: | | ||
cmake -B build \ | ||
-DLLAMA_FATAL_WARNINGS=ON \ | ||
-DLLAMA_CURL=ON \ | ||
-DGGML_RPC=ON | ||
cmake --build build --config Release -j $(nproc) | ||
|
||
|
@@ -281,7 +280,7 @@ jobs: | |
id: depends | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install build-essential | ||
sudo apt-get install build-essential libcurl4-openssl-dev | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -322,7 +321,7 @@ jobs: | |
id: depends | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install build-essential | ||
sudo apt-get install build-essential libcurl4-openssl-dev | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -360,7 +359,7 @@ jobs: | |
id: depends | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install build-essential | ||
sudo apt-get install build-essential libcurl4-openssl-dev | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -397,7 +396,7 @@ jobs: | |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | ||
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list | ||
sudo apt-get update -y | ||
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk | ||
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev | ||
|
||
- name: Build | ||
id: cmake_build | ||
|
@@ -454,7 +453,7 @@ jobs: | |
id: depends | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev | ||
sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
|
@@ -530,7 +529,7 @@ jobs: | |
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install intel-oneapi-compiler-dpcpp-cpp | ||
sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev | ||
|
||
- name: install oneAPI MKL library | ||
shell: bash | ||
|
@@ -578,7 +577,7 @@ jobs: | |
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install intel-oneapi-compiler-dpcpp-cpp | ||
sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev | ||
|
||
- name: install oneAPI MKL library | ||
shell: bash | ||
|
@@ -899,10 +898,17 @@ jobs: | |
-DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release" | ||
cmake --build build-arm64-release --target install --config release | ||
|
||
- name: libCURL | ||
id: get_libcurl | ||
uses: ./.github/actions/windows-setup-curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
env: | ||
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | ||
run: | | ||
cmake -S . -B build ${{ matrix.defines }} | ||
cmake -S . -B build ${{ matrix.defines }} ` | ||
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include" | ||
cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} | ||
|
||
- name: Add libopenblas.dll | ||
|
@@ -990,7 +996,7 @@ jobs: | |
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
apt update | ||
apt install -y cmake build-essential ninja-build libgomp1 git | ||
apt install -y cmake build-essential ninja-build libgomp1 git libcurl4-openssl-dev | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
|
@@ -1092,16 +1098,23 @@ jobs: | |
run: | | ||
choco install ninja | ||
|
||
- name: libCURL | ||
id: get_libcurl | ||
uses: ./.github/actions/windows-setup-curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
shell: cmd | ||
env: | ||
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | ||
run: | | ||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
cmake -S . -B build -G "Ninja Multi-Config" ^ | ||
-DLLAMA_BUILD_SERVER=ON ^ | ||
-DGGML_NATIVE=OFF ^ | ||
-DGGML_CUDA=ON ^ | ||
-DGGML_RPC=ON | ||
-DGGML_RPC=ON ^ | ||
-DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include" | ||
set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1 | ||
cmake --build build --config Release -j %NINJA_JOBS% -t ggml | ||
cmake --build build --config Release | ||
|
@@ -1177,6 +1190,8 @@ jobs: | |
run: | | ||
scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL | ||
|
||
# TODO: add libcurl support ; we will also need to modify win-build-sycl.bat to accept user-specified args | ||
|
||
- name: Build | ||
id: cmake_build | ||
run: examples/sycl/win-build-sycl.bat | ||
|
@@ -1262,8 +1277,14 @@ jobs: | |
key: ${{ github.job }} | ||
evict-old-files: 1d | ||
|
||
- name: libCURL | ||
id: get_libcurl | ||
uses: ./.github/actions/windows-setup-curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
env: | ||
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | ||
run: | | ||
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path) | ||
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}" | ||
|
@@ -1274,9 +1295,11 @@ jobs: | |
-DCMAKE_BUILD_TYPE=Release ` | ||
-DGGML_HIP=ON ` | ||
-DGGML_HIP_ROCWMMA_FATTN=ON ` | ||
-DGGML_RPC=ON | ||
-DGGML_RPC=ON ` | ||
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include" | ||
cmake --build build -j ${env:NUMBER_OF_PROCESSORS} | ||
|
||
# TODO: reuse windows-latest-cmake-hip instead of duplicating this job | ||
windows-latest-cmake-hip-release: | ||
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} | ||
runs-on: windows-latest | ||
|
@@ -1318,8 +1341,14 @@ jobs: | |
run: | | ||
& 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version | ||
|
||
- name: libCURL | ||
id: get_libcurl | ||
uses: ./.github/actions/windows-setup-curl | ||
|
||
- name: Build | ||
id: cmake_build | ||
env: | ||
CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | ||
run: | | ||
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path) | ||
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}" | ||
|
@@ -1331,7 +1360,8 @@ jobs: | |
-DAMDGPU_TARGETS=${{ matrix.gpu_target }} ` | ||
-DGGML_HIP_ROCWMMA_FATTN=ON ` | ||
-DGGML_HIP=ON ` | ||
-DGGML_RPC=ON | ||
-DGGML_RPC=ON ` | ||
-DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include" | ||
cmake --build build -j ${env:NUMBER_OF_PROCESSORS} | ||
md "build\bin\rocblas\library\" | ||
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\" | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it works. I tested on my fork: https://github.com/ngxson/llama.cpp/actions/runs/14295363304/job/40061820312