refine runtimes persist + c# linux build

cmake-exportbuild
mvenditto 1 year ago committed by AT
parent 4b7b9975c5
commit 9eb50cc115

@ -328,14 +328,14 @@ jobs:
name: Build Libraries name: Build Libraries
command: | command: |
cd gpt4all-backend cd gpt4all-backend
mkdir linux-x64 mkdir -p runtimes/linux-x64
cd linux-x64 cd runtimes/linux-x64
cmake .. cmake ..
cmake --build . --parallel --config Release cmake --build . --parallel --config Release
- persist_to_workspace: - persist_to_workspace:
root: gpt4all-backend root: gpt4all-backend
paths: paths:
- linux-x64/*.so - runtimes/linux-x64/*.so
build-bindings-backend-macos: build-bindings-backend-macos:
macos: macos:
@ -355,14 +355,14 @@ jobs:
name: Build Libraries name: Build Libraries
command: | command: |
cd gpt4all-backend cd gpt4all-backend
mkdir osx-x64 mkdir -p runtimes/osx-x64
cd osx-x64 cd runtimes/osx-x64
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --build . --parallel --config Release cmake --build . --parallel --config Release
- persist_to_workspace: - persist_to_workspace:
root: gpt4all-backend root: gpt4all-backend
paths: paths:
- osx-x64/*.dylib - runtimes/osx-x64/*.dylib
build-bindings-backend-windows: build-bindings-backend-windows:
executor: executor:
@ -390,8 +390,8 @@ jobs:
$Env:Path += ";$MinGwBin" $Env:Path += ";$MinGwBin"
$Env:Path += ";C:\Program Files\CMake\bin" $Env:Path += ";C:\Program Files\CMake\bin"
cd gpt4all-backend cd gpt4all-backend
mkdir win-x64 mkdir runtimes/win-x64
cd win-x64 cd runtimes/win-x64
cmake -G "MinGW Makefiles" .. && cmake -G "MinGW Makefiles" .. &&
cmake --build . --parallel --config Release cmake --build . --parallel --config Release
cp "$MinGWBin\libgcc*.dll" . cp "$MinGWBin\libgcc*.dll" .
@ -401,7 +401,7 @@ jobs:
- persist_to_workspace: - persist_to_workspace:
root: gpt4all-backend root: gpt4all-backend
paths: paths:
- win-x64/*.dll - runtimes/win-x64/*.dll
build-bindings-backend-windows-msvc: build-bindings-backend-windows-msvc:
machine: machine:
@ -424,15 +424,15 @@ jobs:
command: | command: |
$Env:Path += ";C:\Program Files\CMake\bin" $Env:Path += ";C:\Program Files\CMake\bin"
cd gpt4all-backend cd gpt4all-backend
mkdir win-x64_msvc mkdir runtimes/win-x64_msvc
cd win-x64_msvc cd runtimes/win-x64_msvc
cmake -G "Visual Studio 17 2022" -A X64 .. cmake -G "Visual Studio 17 2022" -A X64 ..
cmake --build . --parallel --config Release cmake --build . --parallel --config Release
cp bin/Release/*.dll . cp bin/Release/*.dll .
- persist_to_workspace: - persist_to_workspace:
root: gpt4all-backend root: gpt4all-backend
paths: paths:
- win-x64_msvc/*.dll - runtimes/win-x64_msvc/*.dll
build-bindings-backend-debug: build-bindings-backend-debug:
docker: docker:
@ -444,7 +444,7 @@ jobs:
- run: - run:
name: TEST - list libraries name: TEST - list libraries
command: | command: |
ls -R /tmp/workspace ls -R /tmp/workspace/runtimes
build-csharp-linux: build-csharp-linux:
docker: docker:
@ -454,24 +454,14 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- gpt4all-csharp-nuget-packages-nix - gpt4all-csharp-nuget-packages-nix
- attach_workspace:
at: /tmp/workspace
- run: - run:
name: Install dependencies name: "Prepare Native Libs"
command: |
apt-get update
apt-get install -y cmake build-essential
- run:
name: Build C library
command: | command: |
git submodule init
git submodule update --recursive
cd gpt4all-bindings/csharp cd gpt4all-bindings/csharp
BASE_DIR="runtimes/linux-x64" mkdir -p runtimes/linux-x64/native
NATIVE_DIR="$BASE_DIR/native" cp /tmp/workspace/runtimes/linux-x64/*.so runtimes/linux-x64/native/
BUILD_DIR="$BASE_DIR/build"
mkdir -p "$NATIVE_DIR" "$BUILD_DIR"
cmake -S ../../gpt4all-backend -B "$BUILD_DIR"
cmake --build "$BUILD_DIR" -j --config Release
cp "$BUILD_DIR"/*.so "$NATIVE_DIR"
- run: - run:
name: "Install project dependencies" name: "Install project dependencies"
command: | command: |

Loading…
Cancel
Save