LoginSignup
7
3

More than 5 years have passed since last update.

Mac に SentencePiece をインストール

Last updated at Posted at 2017-04-09

Mac に SentencePiece を入れる際にちょっとした工夫が必要だったのでメモとして記します。

ビルドに必要なものを入れる

brew install autoconf automake libtool protobuf

autogen.shを書き換える

perl -i -pe 's/libtoolize/glibtoolize/' autogen.sh

Homebrew の libtool では libtoolize が glibtoolize となっているので書き換えます。

まとめるとこうなります

brew install autoconf automake libtool protobuf

pushd .
git clone --depth=1 https://github.com/google/sentencepiece.git /tmp/
cd /tmp/sentencepiece
perl -i -pe 's/libtoolize/glibtoolize/' autogen.sh
./autogen.sh
./configure
make
make check
sudo make install
popd

rm -rf /tmp/sentencepiece

一発で入れたいときはこれ

curl -L https://gist.githubusercontent.com/ikegami-yukino/a71956799866b77e53b553fbd1ca4431/raw/c4e1b6a7efb63db4bf5f1b8800cb2250ee83cc95/install_sentencepiece_on_mac.sh | bash
7
3
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
7
3