Skip to content
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

llama : add xcframework build script #11996

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
66f7717
llama : add xcframework build script
danbev Feb 20, 2025
760be75
squash! llama : add xcframework build script
danbev Feb 21, 2025
c2f1f71
ci : updated build.yml to use build-xcframework.sh
danbev Feb 21, 2025
6340203
llama : remove Package.swift
danbev Feb 21, 2025
9f5018d
llama.swiftui : remove llama.cpp (source dir ref) from project.pbxproj
danbev Feb 21, 2025
c5306fc
ci : add FRAMEWORK_FOLDER_PATH to xcodebuild command
danbev Feb 21, 2025
9b0a7d1
llama : remove Sources and spm-headers directories
danbev Feb 21, 2025
69ef02d
llama : use static libraries for xcframework build
danbev Feb 23, 2025
afe2087
llama : add support for macOS in xcframework
danbev Feb 24, 2025
c28da71
llama : add support for visionOS in xcframework
danbev Feb 25, 2025
ecf1f8f
llama : rename output directory to build-apple
danbev Feb 25, 2025
cc9b517
llama : change build directory to build-apple
danbev Feb 25, 2025
b4137c1
llama : add required tools check in build-xcframework.sh
danbev Feb 25, 2025
907eb66
ci : add xcframework build to github releases
danbev Feb 25, 2025
14d48be
llama : add Metal and Foundation frameworks to the xcframework
danbev Feb 25, 2025
5cecc8a
llama : set GGML_NATIVE=OFF and add -mcpu=apple-a12
danbev Feb 26, 2025
0f681e4
llama : suppress warnings
danbev Feb 26, 2025
db04712
llama : update IOS_MIN_OS_VERSION to 16.4 and MACOS_MIN_OS_VERSION to…
danbev Feb 26, 2025
03d36cd
llama : add gguf.h to xcframework build
danbev Feb 26, 2025
a54efe2
llama : remove apple-a12 flag for ios-sim and ios-device builds
danbev Feb 26, 2025
bd5ff80
llama : update cmake version requirement/message [no ci]
danbev Feb 27, 2025
ba54a23
llama : update structure of XCFramework to meet App Store requirements
danbev Feb 27, 2025
aa2cdcc
llama : update llama.swiftui project [no ci]
danbev Feb 27, 2025
036b1ef
llama : make static libraries, then collect into single dylib
danbev Mar 1, 2025
d6a967b
llama : fix framework bundle structures for all archs
danbev Mar 2, 2025
c3ef9d4
llama : fix editorconfig checker error [no ci]
danbev Mar 2, 2025
758fce3
examples : restore project.pbxproj and add llama.xcframework [no ci]
danbev Mar 2, 2025
2441f3b
llama : add tvos build support to xcframework
danbev Mar 3, 2025
da0ea36
scripts : add apple app validation scripts
danbev Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,36 @@ jobs:
-DLLAMA_BUILD_SERVER=OFF \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
sudo cmake --install build --config Release

- name: xcodebuild for swift package
id: xcodebuild
run: |
xcodebuild -scheme llama-Package -destination "${{ matrix.destination }}"
./build-xcframework.sh

- name: Determine tag name
id: tag
shell: bash
run: |
BUILD_NUMBER="$(git rev-list --count HEAD)"
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
else
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
fi

- name: Pack artifacts
id: pack_artifacts
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
run: |
zip -r llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework

- name: Upload artifacts
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
uses: actions/upload-artifact@v4
with:
path: llama-${{ steps.tag.outputs.name }}-xcframework.zip

windows-msys2:
runs-on: windows-latest
Expand Down Expand Up @@ -1328,15 +1352,14 @@ jobs:
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
sudo cmake --install build --config Release

- name: xcodebuild for swift package
id: xcodebuild
run: |
xcodebuild -scheme llama-Package -destination 'generic/platform=iOS'
./build-xcframework.sh

- name: Build Xcode project
run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build

android-build:
runs-on: ubuntu-latest
Expand Down
19 changes: 0 additions & 19 deletions Package.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/llama/llama.h

This file was deleted.

5 changes: 0 additions & 5 deletions Sources/llama/module.modulemap

This file was deleted.

Loading
Loading