Skip to content

Commit

Permalink
added windows arm64 libs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok committed Jan 10, 2025
1 parent 840ac76 commit 4e22d11
Show file tree
Hide file tree
Showing 41 changed files with 173 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ body:
- Web (WASM)
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Windows (x86_64, arm64)
- Raspberry Pi
- ARM Cortex-M
validations:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -123,7 +123,8 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]
make_file: "Unix Makefiles"
include:
- machine: rpi3-32
platform: raspberry-pi
Expand All @@ -140,14 +141,18 @@ jobs:
- machine: rpi5-64
platform: raspberry-pi
arch: cortex-a76-aarch64
- machine: pv-windows-arm64
platfrom: windows
arch: arm64
make_file: "MinGW Makefiles"

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Create build directory
run: cmake -B ./build
run: cmake -G "${{ matrix.make_file }}" -B ./build

- name: Build filedemo
run: cmake --build ./build --target porcupine_demo_file
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-32, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-32, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/java-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,24 @@ jobs:
- name: Machine state after
working-directory: resources/scripts
run: bash machine-state.sh

perf-windows-arm64:
runs-on: ${{ matrix.machine }}

strategy:
fail-fast: false
matrix:
machine: [pv-windows-arm64]
include:
- machine: pv-windws-arm64
num_test_iterations: 50
performance_threshold_sec: 0.5

steps:
- uses: actions/checkout@v3

- name: Build
run: ./gradlew assemble

- name: Test
run: ./gradlew test --info --tests PorcupinePerformanceTest -DpvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" -DnumTestIterations="${{matrix.num_test_iterations}}" -DperformanceThresholdSec="${{matrix.performance_threshold_sec}}"
2 changes: 1 addition & 1 deletion .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand All @@ -50,11 +58,19 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/nodejs-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,27 @@ jobs:
- name: Machine state after
working-directory: resources/scripts
run: bash machine-state.sh

performance-windows-arm64:
runs-on: ${{ matrix.machine }}

strategy:
fail-fast: false
matrix:
machine: [pv-windows-arm64]
include:
- machine: pv-windows-arm64
num_test_iterations: 50
performance_threshold_sec: 0.5

steps:
- uses: actions/checkout@v3

- name: Pre-build dependencies
run: npm install --global yarn

- name: Install dependencies
run: yarn install

- name: Test
run: yarn test test/perf.test.ts --access_key=${{secrets.PV_VALID_ACCESS_KEY}} --num_test_iterations=${{matrix.num_test_iterations}} --performance_threshold_sec=${{matrix.performance_threshold_sec}}
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ jobs:
- name: Pre-build dependencies
run: python -m pip install --upgrade pip

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: pip install -r requirements.txt

Expand All @@ -50,11 +58,19 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: pip3 install -r requirements.txt

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/python-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,21 @@ jobs:
- name: Machine state after
working-directory: resources/scripts
run: bash machine-state.sh

perf-windows-arm64:
runs-on: ${{ matrix.machine }}

strategy:
fail-fast: false
matrix:
machine: [pv-windows-arm64]
include:
- machine: pv-windows-arm64
num_test_iterations: 50
performance_threshold_sec: 0.5

steps:
- uses: actions/checkout@v3

- name: Test
run: python3 test_porcupine_perf.py ${{secrets.PV_VALID_ACCESS_KEY}} ${{matrix.num_test_iterations}} ${{matrix.performance_threshold_sec}}
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, pv-windows-arm64]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ applications. It is
- Raspberry Pi (Zero, 3, 4, 5)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- scalable. It can detect multiple always-listening voice commands with no added runtime footprint.
- self-service. Developers can train custom wake word models using [Picovoice Console](https://console.picovoice.ai/).

Expand Down
12 changes: 11 additions & 1 deletion binding/dotnet/Porcupine/Porcupine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netcoreapp3.0;netstandard2.0</TargetFrameworks>
<Version>3.0.4</Version>
<Version>3.0.5</Version>
<Authors>Picovoice</Authors>
<Company />
<Product>Porcupine Wake Word Engine</Product>
Expand Down Expand Up @@ -58,6 +58,16 @@
<Link>lib\windows\amd64\libpv_porcupine.dll</Link>
<Visible>false</Visible>
</Content>
<Content Include="..\..\..\lib\windows\arm64\libpv_porcupine.dll">
<PackagePath>
build/netcoreapp3.0/lib/windows/arm64/libpv_porcupine.dll;
build/net6.0/lib/windows/arm64/libpv_porcupine.dll;
build/net8.0/lib/windows/arm64/libpv_porcupine.dll;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\windows\arm64\libpv_porcupine.dll</Link>
<Visible>false</Visible>
</Content>
<Content Include="..\..\..\lib\linux\x86_64\libpv_porcupine.so">
<PackagePath>
build/netstandard2.0/libpv_porcupine.so;
Expand Down
4 changes: 4 additions & 0 deletions binding/dotnet/Porcupine/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public static string PvLibraryPath(string libName)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/amd64/{libName}.dll");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && _arch == Architecture.Arm64)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/arm64/{libName}.dll");
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && _arch == Architecture.X64)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/x86_64/{libName}.dylib");
Expand Down
4 changes: 2 additions & 2 deletions binding/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Porcupine is:

Platform compatible with .NET Framework 4.6.1+:

- Windows (x86_64)
- Windows (x86_64, arm64)

Platforms compatible with .NET Core 2.0+:

- Linux (x86_64)
- macOS (x86_64)
- Windows (x86_64)
- Windows (x86_64, arm64)

Platforms compatible with .NET Core 3.0+:

Expand Down
2 changes: 1 addition & 1 deletion binding/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To learn more about Porcupine, see the [product](https://picovoice.ai/products/p

- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Windows (x86_64, arm64)
- Raspberry Pi 3 (32 and 64 bit), Raspberry Pi 4 (32 and 64 bit), Raspberry Pi 5 (32 and 64 bit)

## Installation
Expand Down
7 changes: 5 additions & 2 deletions binding/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '3.0.3'
PUBLISH_VERSION = '3.0.4'
PUBLISH_ARTIFACT_ID = 'porcupine-java'
}

Expand Down Expand Up @@ -124,7 +124,10 @@ task copyMacLib(type: Copy) {
into "${outputDir}/porcupine/lib/java/mac/"
}
task copyWindowsLib(type: Copy) {
from('../../lib/java/windows/amd64/pv_porcupine_jni.dll') into "${outputDir}/porcupine/lib/java/windows/amd64/"
from('../../lib/java/windows/')
include('amd64/pv_porcupine_jni.dll',
'arm64/pv_porcupine_jni.dll')
into "${outputDir}/porcupine/lib/java/windows/"
}
task copyRPiLib(type: Copy) {
from('../../lib/java/raspberry-pi/')
Expand Down
2 changes: 1 addition & 1 deletion binding/java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 5 additions & 1 deletion binding/java/src/ai/picovoice/porcupine/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ private static String getArchitecture() throws RuntimeException {
} else if (ENVIRONMENT_NAME.equals("windows")) {
if (isX86_64) {
return "amd64";
} else if (isArm) {
return "arm64";
}
} else if (ENVIRONMENT_NAME.equals("linux")) {
if (isX86_64) {
Expand Down Expand Up @@ -242,7 +244,9 @@ public static String getPackagedLibraryPath() {
switch (ENVIRONMENT_NAME) {
case "windows":
return RESOURCE_DIRECTORY
.resolve("lib/java/windows/amd64/pv_porcupine_jni.dll")
.resolve("lib/java/windows")
.resolve(ARCHITECTURE)
.resolve("pv_porcupine_jni.dll")
.toString();
case "mac":
return RESOURCE_DIRECTORY.resolve("lib/java/mac")
Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Unlike the built-in keywords, custom PPN files generated with the Picovoice Cons

This binding is for running Porcupine on **Node.js 16+** on the following platforms:

- Windows (x86_64)
- Windows (x86_64, arm64)
- Linux (x86_64)
- macOS (x86_64, arm64)
- Raspberry Pi (3, 4, 5)
Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/porcupine-node",
"version": "3.0.4",
"version": "3.0.5",
"description": "Picovoice Porcupine Node.js binding",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
Loading

0 comments on commit 4e22d11

Please sign in to comment.