Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2024-02-20 10:22:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-02-20 10:22:02 +0800
Commit
5f075d0fceaf7f38d3e799db13040d36dde44eff
5f075d0f
1 parent
3d2c7fad
Support MinSizeRel and RelWithDebInfo build on Windows. (#586)
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
50 行增加
和
36 行删除
.github/workflows/windows-x64-debug.yaml
.github/workflows/windows-x86-debug.yaml
CMakeLists.txt
cmake/onnxruntime-win-x64-static-debug.cmake
cmake/onnxruntime-win-x86-static-debug.cmake
cmake/onnxruntime.cmake
.github/workflows/windows-x64-debug.yaml
查看文件 @
5f075d0
...
...
@@ -40,13 +40,14 @@ concurrency:
jobs
:
windows_x64_debug
:
name
:
Windows x64
debug
name
:
Windows x64
${{ matrix.build_type }}
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
[
windows-latest
]
shared_lib
:
[
OFF
]
build_type
:
[
Debug
,
MinSizeRel
,
RelWithDebInfo
]
steps
:
-
uses
:
actions/checkout@v4
...
...
@@ -58,21 +59,21 @@ jobs:
run
:
|
mkdir build
cd build
cmake -A x64 -D CMAKE_BUILD_TYPE=
Debug
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
cmake -A x64 -D CMAKE_BUILD_TYPE=
${{ matrix.build_type }}
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
-
name
:
Build sherpa-onnx for windows
shell
:
bash
run
:
|
cd build
cmake --build . --config Debug -- -m:2
cmake --build . --config Debug --target install -- -m:2
cmake --build . --config ${{ matrix.build_type }} -- -m:2
cmake --build . --config ${{ matrix.build_type }} --target install -- -m:2
ls -lh ./bin/
Debug
/sherpa-onnx.exe
ls -lh ./bin/
${{ matrix.build_type }}
/sherpa-onnx.exe
-
name
:
Test online CTC
shell
:
bash
run
:
|
export PATH=$PWD/build/bin/
Debug
:$PATH
export PATH=$PWD/build/bin/
${{ matrix.build_type }}
:$PATH
export EXE=sherpa-onnx.exe
.github/scripts/test-online-ctc.sh
...
...
.github/workflows/windows-x86-debug.yaml
查看文件 @
5f075d0
...
...
@@ -40,13 +40,14 @@ concurrency:
jobs
:
windows_x86_debug
:
name
:
Windows x86
debug
name
:
Windows x86
${{ matrix.build_type }}
runs-on
:
${{ matrix.os }}
strategy
:
fail-fast
:
false
matrix
:
os
:
[
windows-latest
]
shared_lib
:
[
OFF
]
build_type
:
[
Debug
,
MinSizeRel
,
RelWithDebInfo
]
steps
:
-
uses
:
actions/checkout@v4
...
...
@@ -58,21 +59,21 @@ jobs:
run
:
|
mkdir build
cd build
cmake -A Win32 -D CMAKE_BUILD_TYPE=
Debug
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -D CMAKE_INSTALL_PREFIX=./install ..
cmake -A Win32 -D CMAKE_BUILD_TYPE=
${{ matrix.build_type }}
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -D CMAKE_INSTALL_PREFIX=./install ..
-
name
:
Build sherpa-onnx for windows
shell
:
bash
run
:
|
cd build
cmake --build . --config Debug -- -m:2
cmake --build . --config Debug --target install -- -m:2
cmake --build . --config ${{ matrix.build_type }} -- -m:2
cmake --build . --config ${{ matrix.build_type }} --target install -- -m:2
ls -lh ./bin/
Debug
/sherpa-onnx.exe
ls -lh ./bin/
${{ matrix.build_type }}
/sherpa-onnx.exe
-
name
:
Test online CTC
shell
:
bash
run
:
|
export PATH=$PWD/build/bin/
Debug
:$PATH
export PATH=$PWD/build/bin/
${{ matrix.build_type }}
:$PATH
export EXE=sherpa-onnx.exe
.github/scripts/test-online-ctc.sh
...
...
CMakeLists.txt
查看文件 @
5f075d0
...
...
@@ -86,6 +86,8 @@ if(NOT BUILD_SHARED_LIBS AND MSVC)
$<$<CONFIG:>:/MT>
#---------|
$<$<CONFIG:Debug>:/MTd>
#---|-- Statically link the runtime libraries
$<$<CONFIG:Release>:/MT>
#--|
$<$<CONFIG:RelWithDebInfo>:/MT>
$<$<CONFIG:MinSizeRel>:/MT>
)
endif
()
endif
()
...
...
cmake/onnxruntime-win-x64-static-debug.cmake
查看文件 @
5f075d0
...
...
@@ -15,22 +15,26 @@ if(BUILD_SHARED_LIBS)
message
(
FATAL_ERROR
"This file is for building static libraries. BUILD_SHARED_LIBS:
${
BUILD_SHARED_LIBS
}
"
)
endif
()
if
(
NOT CMAKE_BUILD_TYPE STREQUAL Debug
)
message
(
FATAL_ERROR
"This file is for building a debug version on Windows x64"
)
set
(
onnxruntime_URL
"https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.0/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2"
)
set
(
onnxruntime_URL2
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2"
)
if
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
set
(
onnxruntime_HASH
"SHA256=daef674f160044cf9f4c27d615eaa032f93c4ed6b8d2753bb91b4b37ba40349f"
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo
)
set
(
onnxruntime_HASH
"SHA256=3b580429702e6f471b0899f4f1eede68c0c394aa01cd00376562c2a2e8224d72"
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL MinSizeRel
)
set
(
onnxruntime_HASH
"SHA256=2777b1a01355b94760388eb48dbf9900f5decf2a0bd358418806138a687db6f0"
)
else
()
message
(
FATAL_ERROR
"This file is for building a debug version on Windows x64. Given
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
set
(
onnxruntime_URL
"https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.0/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2"
)
set
(
onnxruntime_URL2
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2"
)
set
(
onnxruntime_HASH
"SHA256=6010bbab913cee3f11c421aeff9d173980623da6e72e88078396839a26d65c98"
)
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set
(
possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2
${
CMAKE_SOURCE_DIR
}
/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2
${
CMAKE_BINARY_DIR
}
/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2
/tmp/onnxruntime-win-x64-static_lib-debug-1.17.0.tar.bz2
$ENV{HOME}/Downloads/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
${
CMAKE_SOURCE_DIR
}
/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
${
CMAKE_BINARY_DIR
}
/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
/tmp/onnxruntime-win-x64-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
)
foreach
(
f IN LISTS possible_file_locations
)
...
...
cmake/onnxruntime-win-x86-static-debug.cmake
查看文件 @
5f075d0
...
...
@@ -15,22 +15,27 @@ if(BUILD_SHARED_LIBS)
message
(
FATAL_ERROR
"This file is for building static libraries. BUILD_SHARED_LIBS:
${
BUILD_SHARED_LIBS
}
"
)
endif
()
if
(
NOT CMAKE_BUILD_TYPE STREQUAL Debug
)
message
(
FATAL_ERROR
"This file is for building a debug version on Windows x86"
)
endif
()
set
(
onnxruntime_URL
"https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.0/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2"
)
set
(
onnxruntime_URL2
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2"
)
set
(
onnxruntime_HASH
"SHA256=aa18677dd45338a90fc1bc14c86fe1e8a21f63913d40b3644924f5b24654218e"
)
set
(
onnxruntime_URL
"https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.0/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2"
)
set
(
onnxruntime_URL2
"https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2"
)
if
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
set
(
onnxruntime_HASH
"SHA256=7ebf676b4cae50ae4c203ca54ae2341d7c7aeae66a965a85610b254d24effee3"
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo
)
set
(
onnxruntime_HASH
"SHA256=bcb1dd68643baf011dc519f938c61b90556f354c6e6ce801e3f08a350d51b689"
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL MinSizeRel
)
set
(
onnxruntime_HASH
"SHA256=a73a42cbff851b1ee2ec037dd3f4254978516252bc353a7ce86d12030ba73dec"
)
else
()
message
(
FATAL_ERROR
"This file is for building a debug version on Windows x86. Given
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
# If you don't have access to the Internet,
# please download onnxruntime to one of the following locations.
# You can add more if you want.
set
(
possible_file_locations
$ENV{HOME}/Downloads/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2
${
CMAKE_SOURCE_DIR
}
/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2
${
CMAKE_BINARY_DIR
}
/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2
/tmp/onnxruntime-win-x86-static_lib-debug-1.17.0.tar.bz2
$ENV{HOME}/Downloads/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
${
CMAKE_SOURCE_DIR
}
/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
${
CMAKE_BINARY_DIR
}
/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
/tmp/onnxruntime-win-x86-static_lib-
${
CMAKE_BUILD_TYPE
}
-1.17.0.tar.bz2
)
foreach
(
f IN LISTS possible_file_locations
)
...
...
cmake/onnxruntime.cmake
查看文件 @
5f075d0
...
...
@@ -71,10 +71,10 @@ function(download_onnxruntime)
else
()
if
(
CMAKE_BUILD_TYPE STREQUAL Release
)
include
(
onnxruntime-win-x86-static
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL Debug
OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel
)
include
(
onnxruntime-win-x86-static-debug
)
else
()
message
(
STATUS
"Support only CMAKE_BUILD_TYPE Release or Debug
. Given:
${
CMAKE_BUILD_TYPE
}
"
)
message
(
FATAL_ERROR
"Support only CMAKE_BUILD_TYPE being Release, Debug, RelWithDebInfo, or MinSizeRel
. Given:
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
endif
()
...
...
@@ -85,6 +85,7 @@ function(download_onnxruntime)
# for 64-bit windows
if
(
BUILD_SHARED_LIBS
)
message
(
STATUS
"Use dynamic onnxruntime libraries"
)
if
(
SHERPA_ONNX_ENABLE_GPU
)
include
(
onnxruntime-win-x64-gpu
)
else
()
...
...
@@ -95,10 +96,10 @@ function(download_onnxruntime)
message
(
STATUS
"Use static onnxruntime libraries"
)
if
(
CMAKE_BUILD_TYPE STREQUAL Release
)
include
(
onnxruntime-win-x64-static
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
elseif
(
CMAKE_BUILD_TYPE STREQUAL Debug
OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel
)
include
(
onnxruntime-win-x64-static-debug
)
else
()
message
(
STATUS
"Support only CMAKE_BUILD_TYPE Release or Debug
. Given:
${
CMAKE_BUILD_TYPE
}
"
)
message
(
FATAL_ERROR
"Support only CMAKE_BUILD_TYPE being Release, Debug, RelWithDebInfo, or MinSizeRel
. Given:
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
endif
()
endif
()
...
...
请
注册
或
登录
后发表评论