-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rust]C++ unix向けのexampleを修正する #197
Merged
PickledChair
merged 13 commits into
VOICEVOX:rust
from
qwerty2501:feature/example-unix-for-rust
Jul 24, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8b43c0a
C++ unix向けのexampleを修正する
qwerty2501 9967997
CIでのbuildチェックを追加した
qwerty2501 b78538d
deployのfile copyに合わせてコピーするファイル対象を変更した
qwerty2501 3f0f0d0
余分な変数を削除
qwerty2501 7af02c1
消してしまっていた CXX_STANDARDを復活
qwerty2501 dfdf9a9
CIにrust toolchain instlalを追加
qwerty2501 04f45ff
macのexample build patternを一旦コメントアウト
qwerty2501 2fd4103
Update .github/workflows/test.yml
qwerty2501 5e623bb
exampleをダウンロード前提にして実行するように変更
qwerty2501 4f57588
CIのbuildをちゃんと動くように修正
qwerty2501 f20b272
file配置の説明を記載
qwerty2501 6610aa9
rpathの設定がされてればLD_LIBRARY_PATHの設定は不要になったため
qwerty2501 a7b924f
表記揺れの修正
PickledChair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,5 +59,45 @@ jobs: | |
find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0 | ||
find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0 | head -n 1 | xargs -i cp {} target/debug/deps/ | ||
- run: cargo test --all-features | ||
|
||
build-unix-cpp-example: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
artifact_name: osx-x64-cpu-cpp-shared | ||
- os: ubuntu-latest | ||
artifact_name: linux-x64-cpu-cpp-shared | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: build voicevox_core | ||
run: cargo build | ||
- name: 必要なfileをunix用exampleのディレクトリに移動させる | ||
run: | | ||
cp -v target/core.h example/cpp/unix/ | ||
cp -v target/debug/libcore.{so,dylib} example/cpp/unix/ || true | ||
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.so.* example/cpp/unix/ || true | ||
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.*.dylib example/cpp/unix/ || true | ||
|
||
- if: startsWith(matrix.os, 'mac') | ||
uses: jwlawson/[email protected] | ||
- name: Install build dependencies | ||
if: startsWith(matrix.os, 'ubuntu') | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake | ||
- name: Build | ||
shell: bash | ||
run: | | ||
cd example/cpp/unix | ||
cmake -S . -B build | ||
cmake --build build | ||
|
||
env: | ||
CARGO_TERM_COLOR: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# libraries | ||
*.dylib | ||
*.so | ||
*.so.* | ||
core.h | ||
|
||
# OpenJTalk-dictionary's dir | ||
open_jtalk_dic_utf_8-* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onnxruntimeの配置はcmakeで行うようにしてあるので削除
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このexampleはビルド済みcoreをダウンロードして使う想定(coreのビルド環境がなくても良い想定)でした。
なのでこのダウンロード工程と、あとcmakeの変更がいりそうです。
(気づくのが遅れてしまって申し訳ないです。。)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
すっかり失念していました……。確かに元々は C/C++ の開発環境さえあれば試せる感じに作っていました。onnxruntime の自動配置は便利だと思いつつ見ていましたが、ビルド済みcore や onnxruntime をユーザーが取ってくるようにする方が良いかもですね(親切に設計するとしても、プロジェクトのルートにある configure.py を再整備して使ってもらうようにする方が良いかもしれません)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ダウンロードする必要がある旨記載しました
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configure.pyの再整備は賛成です!rust化完了後にissue作りたいですね