LoginSignup
1
0

More than 3 years have passed since last update.

iOS libtorch をソースからビルドするメモ

Posted at

背景

libtorch 1.8 になり, FFT モジュールとかついたので音声処理とか libtorch で完結できてよいので iOS で動かしたい.

オフィシャルでは Cocoapods での例を提示していますが...

  • XCode の設定, Cmake でやっている(Cocoapods だと xcodeproj ファイルとが無いと pod install できない)
  • Cocoapod でインストールとかめんどい...

のでソースからビルドします.

手順

iOS ビルド用のスクリプトが用意されていますので, それを叩くだけです.

$ git clone https://github.com/pytorch/pytorch
$ cd pytorch
# (お好みで branch/tag をチェックアウト)
$ git submodule update --init --recursive
$ ./scripts/build_ios.sh

でいけます!

M1 macmini では 12 分ほどでビルドが終わりました.

あとはビルドできたファイルをよろしく自前プロジェクトにコピーするなどして利用しましょう.

TODO

  • CI ビルドサーバか Cocoapods のダウンロード URL を探して iOS prebuilt パッケージを wget なりでぺろっと落とす方法を見つける
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0