mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-18 08:44:57 +02:00
cleanup, fix native build for arm (+28 squashed commit)
Squashed commit: [d1f6a4154] bundle library [947ab84b7] undo [0f9aba8d8] test [e9ac93873] test [920438202] test [1c6d98804] Revert "quick test" This reverts commitacf8ec8940. [acf8ec894] quick test [6a9937233] undo [5a263a5bd] test [ddfd82bca] test [0b30e45da] test [c3bfece55] messed up [2a4b37fe0] Revert "test" This reverts commit80a1fcaeaf. [80a1fcaea] test [e2aa7d944] test [264d80200] test [f5b123173] undo [1ffacc484] test [63c0be926] undo [510e0377e] ofast try fix [4ac199b20] try fix sigill [1bc987ba2] try fix illegal instruction [7697252b1] edit [f87087b28] check gcc ver [e9dfe2cef] try using qemu to do the pyinstaller [b411192db] revert [25b5301e5] try using qemu to do the pyinstaller [58038cddc] try using qemu to do the pyinstaller
This commit is contained in:
@@ -3,7 +3,6 @@ name: Koboldcpp Linux ARM64
|
||||
on: workflow_dispatch
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
NOAVX2: 1
|
||||
|
||||
jobs:
|
||||
linux-arm:
|
||||
@@ -15,35 +14,68 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.head_ref || github.ref_name }}
|
||||
|
||||
- name: Build Dependencies
|
||||
id: depends1
|
||||
- name: Install Dependencies
|
||||
id: depends
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3 python3-pip python3-dev build-essential \
|
||||
sudo apt-get install -y python3-tk python3-pip python3-dev build-essential \
|
||||
libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev \
|
||||
crossbuild-essential-arm64 qemu qemu-user qemu-user-static \
|
||||
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
crossbuild-essential-arm64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
|
||||
- name: Python Dependencies
|
||||
id: depends2
|
||||
- name: Install New GCC for Cross-Compilation
|
||||
run: |
|
||||
pip install customtkinter pyinstaller tk
|
||||
|
||||
- name: Build with ARM NEON Support
|
||||
id: build_binary
|
||||
run: |
|
||||
# Enable cross-compilation for ARM
|
||||
export QEMU_LD_PREFIX=/usr/aarch64-linux-gnu
|
||||
export CC=aarch64-linux-gnu-gcc
|
||||
export CXX=aarch64-linux-gnu-g++
|
||||
sudo apt-get install -y software-properties-common
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-12 g++-12 gcc-12-aarch64-linux-gnu g++-12-aarch64-linux-gnu
|
||||
export CC=/usr/bin/aarch64-linux-gnu-gcc-12
|
||||
export CXX=/usr/bin/aarch64-linux-gnu-g++-12
|
||||
export AR=aarch64-linux-gnu-ar
|
||||
export UNAME_M=aarch64
|
||||
export UNAME_S=Linux
|
||||
|
||||
export PATH=/usr/bin:$PATH
|
||||
make LLAMA_PORTABLE=1
|
||||
chmod +x './create_ver_file.sh'
|
||||
. create_ver_file.sh
|
||||
pyinstaller --noconfirm --onefile --collect-all customtkinter --collect-all psutil --add-data './koboldcpp_default.so:.' --add-data './kcpp_adapters:./kcpp_adapters' --add-data './koboldcpp.py:.' --add-data './klite.embd:.' --add-data './kcpp_docs.embd:.' --add-data './kcpp_sdui.embd:.' --add-data './taesd.embd:.' --add-data './taesd_xl.embd:.' --add-data './rwkv_vocab.embd:.' --add-data './rwkv_world_vocab.embd:.' --version-file './version.txt' --clean --console koboldcpp.py -n "koboldcpp-linux-arm64"
|
||||
mkdir -p dist
|
||||
cp './koboldcpp_default.so' dist
|
||||
ls
|
||||
|
||||
- name: Install QEMU
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static binfmt-support
|
||||
|
||||
- name: Setup QEMU for ARM64
|
||||
run: |
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
|
||||
- name: Build ARM64 PyInstaller
|
||||
run: |
|
||||
docker run --rm \
|
||||
--platform linux/arm64 \
|
||||
-v "${PWD}:/src" \
|
||||
python:3.9-slim \
|
||||
/bin/bash -c "
|
||||
apt-get update && apt-get install -y build-essential && \
|
||||
apt-get update && apt-get install -y gcc-12 g++-12 && \
|
||||
export LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12:$LD_LIBRARY_PATH && \
|
||||
pip install customtkinter pyinstaller tk && \
|
||||
cd /src && \
|
||||
pyinstaller --noconfirm --onefile --collect-all customtkinter --collect-all psutil \
|
||||
--add-data './koboldcpp_default.so:.' \
|
||||
--add-data './kcpp_adapters:./kcpp_adapters' \
|
||||
--add-data './koboldcpp.py:.' \
|
||||
--add-data './klite.embd:.' \
|
||||
--add-data './kcpp_docs.embd:.' \
|
||||
--add-data './kcpp_sdui.embd:.' \
|
||||
--add-data './taesd.embd:.' \
|
||||
--add-data './taesd_xl.embd:.' \
|
||||
--add-data './rwkv_vocab.embd:.' \
|
||||
--add-data './rwkv_world_vocab.embd:.' \
|
||||
--version-file './version.txt' \
|
||||
--clean --console koboldcpp.py -n 'koboldcpp-linux-arm64'
|
||||
"
|
||||
|
||||
- name: Save artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -3,7 +3,6 @@ name: Koboldcpp Mac
|
||||
on: workflow_dispatch
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
NOAVX2: 1
|
||||
|
||||
jobs:
|
||||
osx:
|
||||
|
||||
Reference in New Issue
Block a user