LoginSignup
0
1

More than 1 year has passed since last update.

M1 Macでjuman++をインストールする(2022)

Last updated at Posted at 2022-02-09

M1 Mac環境でjuman++をインストールしたらめっちゃ詰まったのでログを残します。

基本手順

基本的にはこちらの記事にあるように、以下でインストールできます。

wget http://lotus.kuee.kyoto-u.ac.jp/nl-resource/jumanpp/jumanpp-1.02.tar.xz
tar xJvf jumanpp-1.02.tar.xz
cd jumanpp-1.02
./configure
make
sudo make install

詰まったところ

"Error: cannot find available Boost library."

Boostが無いと怒られます。

checking for boostlib >= 1.57... configure: We could not detect the boost libraries (version 1.57 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: "Error: cannot find available Boost library."

こちらの記事にあるように、Boostをインストールします。

Boostをダウンロードしたら展開して以下を実行します。

~/Downloads/boost_1_72_0
./bootstrap.sh

コア数を確認します。

system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: MacBook Air
      Model Identifier: MacBookAir10,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)

以下を実行します。

sudo ./b2 install -j9 --prefix=/opt/local

Boost/unordered_map.hpp' file not found

juman++のインストールに戻り、makeを実行すると fatal error: 'boost/program_options.hpp' file not found が出ます。

この記事のとおり、HomebrewでBoostを入れ直します。

brew install boost

PATHも通しておきます。

echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/usr/local/opt/icu4c/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/usr/local/opt/icu4c/include"' >> ~/.zshrc

再度makeするのですが解消しないので、何故かと思ったら、どうやらM1版のBoostではだめなようです。
なので、Intel版のHomebrewをインストールしてそれを使います。

Homebrew Apple M1 / Intel の共存環境を作る

こちらの記事を参照して、Homebrewの共存環境を作ります。
※M1版Homebrewのインストール手順は省略します。

Rosettaがない場合は先に入れておきます。

softwareupdate --install-rosetta --agree-to-license

Intel版Homebrewをインストールします。

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 

PATHを通すために .zshrc に以下を書きます。

eval $(/usr/local/bin/brew shellenv)
eval $(/opt/homebrew/bin/brew shellenv)

juman++をインストールする

改めてjuman++をインストールします。

cd jumanpp-1.02
make
sudo make install

今回は成功しました。

~ jumanpp -v
JUMAN++ 1.02 
0
1
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
0
1