Skip to content

Commit

Permalink
add support for other architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
AmSmart committed May 29, 2024
1 parent 9a68785 commit fd7311d
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ jobs:

compile-android:
name: Compile (Android)
strategy:
fail-fast: true
matrix:
include:
- build: 'x86'
defines: '-DANDROID_ABI=x86'
- build: 'x86_64'
defines: '-DANDROID_ABI=x64'
- build: 'arm64-v8a'
defines: '-DANDROID_ABI=arm64-v8a'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand All @@ -329,22 +339,22 @@ jobs:
- name: Build
id: cmake_build
env:
CMAKE_FLAGS: '-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23'
CMAKE_FLAGS: '-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-23'
run: |
mkdir build
cd build
cmake .. ${{ env.COMMON_DEFINE }} ${{ env.CMAKE_FLAGS }}
cmake .. ${{ env.COMMON_DEFINE }} ${{ env.CMAKE_FLAGS }} ${{ matrix.defines }}
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
- name: Upload Llama
uses: actions/upload-artifact@v4
with:
path: ./build/libllama.so
name: llama-bin-android-arm64.so
name: llama-bin-android-${{ matrix.build }}.so
- name: Upload Llava
uses: actions/upload-artifact@v4
with:
path: ./build/examples/llava/libllava_shared.so
name: llava-bin-android-arm64.so
name: llava-bin-android-${{ matrix.build }}.so


build-deps:
Expand Down Expand Up @@ -419,8 +429,14 @@ jobs:
cp artifacts/llama-bin-linux-clblast-x64.so/libllama.so deps/clblast/
cp artifacts/llava-bin-linux-clblast-x64.so/libllava_shared.so deps/clblast/libllava_shared.so
cp artifacts/llama-bin-android-arm64.so/libllama.so deps/android-arm64/libllama.so
cp artifacts/llava-bin-android-arm64.so/libllava_shared.so deps/android-arm64/libllava_shared.so
cp artifacts/llama-bin-android-x86.so/libllama.so deps/android-x86/libllama.so
cp artifacts/llava-bin-android-x86.so/libllava_shared.so deps/android-x86/libllava_shared.so
cp artifacts/llama-bin-android-x86_64.so/libllama.so deps/android-x86_64/libllama.so
cp artifacts/llava-bin-android-x86_64.so/libllava_shared.so deps/android-x86_64/libllava_shared.so
cp artifacts/llama-bin-android-arm64-v8a.so/libllama.so deps/android-arm64-v8a/libllama.so
cp artifacts/llava-bin-android-arm64-v8a.so/libllava_shared.so deps/android-arm64-v8a/libllava_shared.so
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit fd7311d

Please sign in to comment.