Open2

諸ツールのインストール備忘録

schnellschnell

M1 Mac

juman++

wget "https://github.com/ku-nlp/jumanpp/releases/download/v2.0.0-rc3/jumanpp-2.0.0-rc3.tar.xz"
tar xvJf jumanpp-2.0.0-rc3.tar.xz

cd jumanpp-2.0.0-rc3
mkdir bld && cd bld

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Users/ユーザー名/nlp/opt/jumanpp

このままmakeコマンドを実行しビルドを行うとエラーが発生するのでソースコードを書き換える。libs/backward.hppの2267,2268行付近を以下のように改変する。

libs/backward.hpp
// #elif defined(__aarch64__)
//     error_addr = reinterpret_cast<void*>(uctx->uc_mcontext.pc);
#elif defined(__aarch64__)
    #if defined(__APPLE__)
      error_addr = reinterpret_cast<void *>(uctx->uc_mcontext->__ss.__pc);
    #else
      error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.pc);
    #endif

また, libs/catch.hppを最新にする。

curl -LO https://github.com/catchorg/Catch2/releases/download/v2.13.8/catch.hpp
mv catch.hpp ../libs/

改変後makeを実行しビルドを行う

make -j $(getconf _NPROCESSORS_ONLN)
make install

knp

brew install libtool automake autoconf
# glibtoolizeとしてインストールされるのでリンクを貼る
ln -s /opt/homebrew/bin/glibtoolize /opt/homebrew/bin/libtoolize

git clone -b fix_for_macos https://github.com/ku-nlp/knp.git
cd knp
./autogen.sh
wget http://lotus.kuee.kyoto-u.ac.jp/nl-resource/knp/dict/latest/knp-dict-latest-bin.zip
unzip knp-dict-latest-bin.zip
rm -f knp-dict-latest-bin.zip
ln -s `pwd`/dict-bin/* dict/
ln -s `pwd`/dict-bin/auto/* dict/auto/
ln -s `pwd`/dict-bin/distsim/* dict/distsim/
ln -s `pwd`/dict-bin/ebcf/* dict/ebcf/

# フラグを指定してwarningを無理やり消す
./configure CFLAGS=-w --prefix==/Users/ユーザー名/nlp/opt/knp
make -j $(getconf _NPROCESSORS_ONLN)
make install