Github で開発ローカル → リモートリポジトリ → 本番ローカルに反映させる手順

リモートリポジトリの作成

GitHub のサイトでリポジトリを作成し、git@github.com:〜 か https://github.com/〜 の接続先を取得します。

開発用ローカルリポジトリの作成

GitHub リポジトリにしたいディレクトリへ移動して下記を実行します。

ローカルのディレクトリを GitHub リポジトリとして登録、参照するリモートリポジトリを登録します。

% git init
% git remote add origin https://github.com/ユーザー名/リポジトリ名.git

開発ローカル → リモートリポジトリ

ファイルをローカルリポジトリのステージングに反映、ファイルの状態をコミット、そしてリモートリポジトリに push しています。

% git add .
% git commit -m "Create project."
% git push -u origin master

リモートリポジトリ → 本番ローカル

Git がインストールされている本番環境のルートディレクトリで下記を行います。(初回のみ)

$ git init
$ git remote add origin https://github.com/ユーザー名/リポジトリ名.git

そして pull でリモートリポジトリの更新を本番環境へ反映します。

$ git pull origin master

【ログ】Ubuntu 20.04: sudo bin/install-mecab-ipadic-neologd

  • 実行コマンド:sudo bin/install-mecab-ipadic-neologd
  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04
$ sudo bin/install-mecab-ipadic-neologd
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : Check the existance of libraries
[install-mecab-ipadic-NEologd] :     find => ok
[install-mecab-ipadic-NEologd] :     sort => ok
[install-mecab-ipadic-NEologd] :     head => ok
[install-mecab-ipadic-NEologd] :     cut => ok
[install-mecab-ipadic-NEologd] :     egrep => ok
[install-mecab-ipadic-NEologd] :     mecab => ok
[install-mecab-ipadic-NEologd] :     mecab-config => ok
[install-mecab-ipadic-NEologd] :     make => ok
[install-mecab-ipadic-NEologd] :     curl => ok
[install-mecab-ipadic-NEologd] :     sed => ok
[install-mecab-ipadic-NEologd] :     cat => ok
[install-mecab-ipadic-NEologd] :     diff => ok
[install-mecab-ipadic-NEologd] :     tar => ok
[install-mecab-ipadic-NEologd] :     unxz => ok
[install-mecab-ipadic-NEologd] :     xargs => ok
[install-mecab-ipadic-NEologd] :     grep => ok
[install-mecab-ipadic-NEologd] :     iconv => ok
[install-mecab-ipadic-NEologd] :     patch => ok
[install-mecab-ipadic-NEologd] :     which => ok
[install-mecab-ipadic-NEologd] :     file => ok
[install-mecab-ipadic-NEologd] :     openssl => ok
[install-mecab-ipadic-NEologd] :     awk => ok
[install-mecab-ipadic-NEologd] : You should execute the following command if you want to install newest version of mecab-ipadic-NEologd

    $ bin/install-mecab-ipadic-neologd -n


[install-mecab-ipadic-NEologd] : mecab-ipadic-NEologd will be install to /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd

[install-mecab-ipadic-NEologd] : Make mecab-ipadic-NEologd
[make-mecab-ipadic-NEologd] : Start..
[make-mecab-ipadic-NEologd] : Check local seed directory
[make-mecab-ipadic-NEologd] : Check local seed file
[make-mecab-ipadic-NEologd] : Check local build directory
[make-mecab-ipadic-NEologd] : create /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../build
[make-mecab-ipadic-NEologd] : Download original mecab-ipadic file
[make-mecab-ipadic-NEologd] : Try to access to https://ja.osdn.net
[make-mecab-ipadic-NEologd] : Try to download from https://ja.osdn.net/frs/g_redir.php?m=kent&f=mecab%2Fmecab-ipadic%2F2.7.0-20070801%2Fmecab-ipadic-2.7.0-20070801.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 11.6M  100 11.6M    0     0  2906k      0  0:00:04  0:00:04 --:--:-- 3815k
Hash value of /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801.tar.gz matched
[make-mecab-ipadic-NEologd] : Decompress original mecab-ipadic file
mecab-ipadic-2.7.0-20070801/
mecab-ipadic-2.7.0-20070801/README
mecab-ipadic-2.7.0-20070801/AUTHORS
mecab-ipadic-2.7.0-20070801/COPYING
mecab-ipadic-2.7.0-20070801/ChangeLog
mecab-ipadic-2.7.0-20070801/INSTALL
mecab-ipadic-2.7.0-20070801/Makefile.am
mecab-ipadic-2.7.0-20070801/Makefile.in
mecab-ipadic-2.7.0-20070801/NEWS
mecab-ipadic-2.7.0-20070801/aclocal.m4
mecab-ipadic-2.7.0-20070801/config.guess
mecab-ipadic-2.7.0-20070801/config.sub
mecab-ipadic-2.7.0-20070801/configure
mecab-ipadic-2.7.0-20070801/configure.in
mecab-ipadic-2.7.0-20070801/install-sh
mecab-ipadic-2.7.0-20070801/missing
mecab-ipadic-2.7.0-20070801/mkinstalldirs
mecab-ipadic-2.7.0-20070801/Adj.csv
mecab-ipadic-2.7.0-20070801/Adnominal.csv
mecab-ipadic-2.7.0-20070801/Adverb.csv
mecab-ipadic-2.7.0-20070801/Auxil.csv
mecab-ipadic-2.7.0-20070801/Conjunction.csv
mecab-ipadic-2.7.0-20070801/Filler.csv
mecab-ipadic-2.7.0-20070801/Interjection.csv
mecab-ipadic-2.7.0-20070801/Noun.adjv.csv
mecab-ipadic-2.7.0-20070801/Noun.adverbal.csv
mecab-ipadic-2.7.0-20070801/Noun.csv
mecab-ipadic-2.7.0-20070801/Noun.demonst.csv
mecab-ipadic-2.7.0-20070801/Noun.nai.csv
mecab-ipadic-2.7.0-20070801/Noun.name.csv
mecab-ipadic-2.7.0-20070801/Noun.number.csv
mecab-ipadic-2.7.0-20070801/Noun.org.csv
mecab-ipadic-2.7.0-20070801/Noun.others.csv
mecab-ipadic-2.7.0-20070801/Noun.place.csv
mecab-ipadic-2.7.0-20070801/Noun.proper.csv
mecab-ipadic-2.7.0-20070801/Noun.verbal.csv
mecab-ipadic-2.7.0-20070801/Others.csv
mecab-ipadic-2.7.0-20070801/Postp-col.csv
mecab-ipadic-2.7.0-20070801/Postp.csv
mecab-ipadic-2.7.0-20070801/Prefix.csv
mecab-ipadic-2.7.0-20070801/Suffix.csv
mecab-ipadic-2.7.0-20070801/Symbol.csv
mecab-ipadic-2.7.0-20070801/Verb.csv
mecab-ipadic-2.7.0-20070801/char.def
mecab-ipadic-2.7.0-20070801/feature.def
mecab-ipadic-2.7.0-20070801/left-id.def
mecab-ipadic-2.7.0-20070801/matrix.def
mecab-ipadic-2.7.0-20070801/pos-id.def
mecab-ipadic-2.7.0-20070801/rewrite.def
mecab-ipadic-2.7.0-20070801/right-id.def
mecab-ipadic-2.7.0-20070801/unk.def
mecab-ipadic-2.7.0-20070801/dicrc
mecab-ipadic-2.7.0-20070801/RESULT
[make-mecab-ipadic-NEologd] : Configure custom system dictionary on /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801-neologd-20200910
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for a BSD-compatible install... /usr/bin/install -c
checking for mecab-config... /usr/bin/mecab-config
configure: creating ./config.status
config.status: creating Makefile
[make-mecab-ipadic-NEologd] : Encode the character encoding of system dictionary resources from EUC_JP to UTF-8
./../../libexec/iconv_euc_to_utf8.sh ./Noun.adjv.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Adj.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.org.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.number.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Symbol.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Auxil.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Prefix.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.place.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.verbal.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.proper.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Postp-col.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Suffix.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.demonst.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.nai.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Others.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Interjection.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Conjunction.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Verb.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Adverb.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.name.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Filler.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.adverbal.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Postp.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Noun.others.csv 
./../../libexec/iconv_euc_to_utf8.sh ./Adnominal.csv 
rm ./Noun.adjv.csv 
rm ./Adj.csv 
rm ./Noun.org.csv 
rm ./Noun.number.csv 
rm ./Symbol.csv 
rm ./Auxil.csv 
rm ./Prefix.csv 
rm ./Noun.place.csv 
rm ./Noun.verbal.csv 
rm ./Noun.proper.csv 
rm ./Postp-col.csv 
rm ./Suffix.csv 
rm ./Noun.demonst.csv 
rm ./Noun.nai.csv 
rm ./Others.csv 
rm ./Noun.csv 
rm ./Interjection.csv 
rm ./Conjunction.csv 
rm ./Verb.csv 
rm ./Adverb.csv 
rm ./Noun.name.csv 
rm ./Filler.csv 
rm ./Noun.adverbal.csv 
rm ./Postp.csv 
rm ./Noun.others.csv 
rm ./Adnominal.csv 
./../../libexec/iconv_euc_to_utf8.sh ./rewrite.def 
./../../libexec/iconv_euc_to_utf8.sh ./char.def 
./../../libexec/iconv_euc_to_utf8.sh ./unk.def 
./../../libexec/iconv_euc_to_utf8.sh ./matrix.def 
./../../libexec/iconv_euc_to_utf8.sh ./pos-id.def 
./../../libexec/iconv_euc_to_utf8.sh ./right-id.def 
./../../libexec/iconv_euc_to_utf8.sh ./feature.def 
./../../libexec/iconv_euc_to_utf8.sh ./left-id.def 
rm ./rewrite.def 
rm ./char.def 
rm ./unk.def 
rm ./matrix.def 
rm ./pos-id.def 
rm ./right-id.def 
rm ./feature.def 
rm ./left-id.def 
mv ./Symbol.csv.utf8 ./Symbol.csv 
mv ./Noun.adjv.csv.utf8 ./Noun.adjv.csv 
mv ./Adj.csv.utf8 ./Adj.csv 
mv ./right-id.def.utf8 ./right-id.def 
mv ./Noun.others.csv.utf8 ./Noun.others.csv 
mv ./Interjection.csv.utf8 ./Interjection.csv 
mv ./char.def.utf8 ./char.def 
mv ./Noun.place.csv.utf8 ./Noun.place.csv 
mv ./Noun.number.csv.utf8 ./Noun.number.csv 
mv ./Noun.org.csv.utf8 ./Noun.org.csv 
mv ./Suffix.csv.utf8 ./Suffix.csv 
mv ./Noun.adverbal.csv.utf8 ./Noun.adverbal.csv 
mv ./Noun.csv.utf8 ./Noun.csv 
mv ./rewrite.def.utf8 ./rewrite.def 
mv ./Noun.nai.csv.utf8 ./Noun.nai.csv 
mv ./pos-id.def.utf8 ./pos-id.def 
mv ./Verb.csv.utf8 ./Verb.csv 
mv ./Others.csv.utf8 ./Others.csv 
mv ./Prefix.csv.utf8 ./Prefix.csv 
mv ./Noun.proper.csv.utf8 ./Noun.proper.csv 
mv ./Noun.verbal.csv.utf8 ./Noun.verbal.csv 
mv ./matrix.def.utf8 ./matrix.def 
mv ./unk.def.utf8 ./unk.def 
mv ./Postp.csv.utf8 ./Postp.csv 
mv ./feature.def.utf8 ./feature.def 
mv ./Conjunction.csv.utf8 ./Conjunction.csv 
mv ./Adverb.csv.utf8 ./Adverb.csv 
mv ./left-id.def.utf8 ./left-id.def 
mv ./Auxil.csv.utf8 ./Auxil.csv 
mv ./Filler.csv.utf8 ./Filler.csv 
mv ./Noun.name.csv.utf8 ./Noun.name.csv 
mv ./Postp-col.csv.utf8 ./Postp-col.csv 
mv ./Adnominal.csv.utf8 ./Adnominal.csv 
mv ./Noun.demonst.csv.utf8 ./Noun.demonst.csv 
[make-mecab-ipadic-NEologd] : Fix yomigana field of IPA dictionary
patching file Noun.csv
patching file Noun.place.csv
patching file Verb.csv
patching file Noun.verbal.csv
patching file Noun.name.csv
patching file Noun.adverbal.csv
patching file Noun.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.others.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Noun.verbal.csv
patching file Prefix.csv
patching file Suffix.csv
patching file Noun.proper.csv
patching file Noun.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Noun.verbal.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Suffix.csv
patching file Noun.demonst.csv
patching file Noun.csv
patching file Noun.name.csv
[make-mecab-ipadic-NEologd] : Copy user dictionary resource
[make-mecab-ipadic-NEologd] : Install adverb entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-adverb-dict-seed.20150623.csv.xz
[make-mecab-ipadic-NEologd] : Install interjection entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-interjection-dict-seed.20170216.csv.xz
[make-mecab-ipadic-NEologd] : Install noun orthographic variant entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-common-noun-ortho-variant-dict-seed.20170228.csv.xz
[make-mecab-ipadic-NEologd] : Install noun orthographic variant entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-proper-noun-ortho-variant-dict-seed.20161110.csv.xz
[make-mecab-ipadic-NEologd] : Install entries of orthographic variant of a noun used as verb form using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-noun-sahen-conn-ortho-variant-dict-seed.20160323.csv.xz
[make-mecab-ipadic-NEologd] : Install frequent adjective orthographic variant entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-std-dict-seed.20151126.csv.xz
[make-mecab-ipadic-NEologd] : Not install /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-exp-dict-seed.20151126.csv.xz
[make-mecab-ipadic-NEologd] :     When you install neologd-adjective-exp-dict-seed.20151126.csv.xz, please set --install_adjective_exp option

[make-mecab-ipadic-NEologd] : Install adjective verb orthographic variant entries using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-verb-dict-seed.20160324.csv.xz
[make-mecab-ipadic-NEologd] : Not install /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-date-time-infreq-dict-seed.20190415.csv.xz
[make-mecab-ipadic-NEologd] :     When you install neologd-date-time-infreq-dict-seed.20190415.csv.xz, please set --install_infreq_datetime option

[make-mecab-ipadic-NEologd] : Not install /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-quantity-infreq-dict-seed.20190415.csv.xz
[make-mecab-ipadic-NEologd] :     When you install neologd-quantity-infreq-dict-seed.20190415.csv.xz, please set --install_infreq_quantity option

[make-mecab-ipadic-NEologd] : Install entries of ill formed words using /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../seed/neologd-ill-formed-words-dict-seed.20170127.csv.xz
[make-mecab-ipadic-NEologd] : Re-Index system dictionary
reading ./unk.def ... 40
emitting double-array: 100% |###########################################| 
./model.def is not found. skipped.
reading ./neologd-adjective-verb-dict-seed.20160324.csv ... 20268
reading ./neologd-proper-noun-ortho-variant-dict-seed.20161110.csv ... 138379
reading ./neologd-ill-formed-words-dict-seed.20170127.csv ... 60616
reading ./neologd-common-noun-ortho-variant-dict-seed.20170228.csv ... 152869
reading ./neologd-adjective-std-dict-seed.20151126.csv ... 507812
reading ./Noun.adjv.csv ... 3328
reading ./mecab-user-dict-seed.20200910.csv ... 3224584
reading ./Adj.csv ... 27210
reading ./Noun.org.csv ... 17149
reading ./Noun.number.csv ... 42
reading ./Symbol.csv ... 208
reading ./Auxil.csv ... 199
reading ./Prefix.csv ... 224
reading ./neologd-noun-sahen-conn-ortho-variant-dict-seed.20160323.csv ... 26058
reading ./neologd-adverb-dict-seed.20150623.csv ... 139792
reading ./Noun.place.csv ... 73194
reading ./Noun.verbal.csv ... 12150
reading ./neologd-interjection-dict-seed.20170216.csv ... 4701
reading ./Noun.proper.csv ... 27493
reading ./Postp-col.csv ... 91
reading ./Suffix.csv ... 1448
reading ./Noun.demonst.csv ... 120
reading ./Noun.nai.csv ... 42
reading ./Others.csv ... 2
reading ./Noun.csv ... 60734
reading ./Interjection.csv ... 252
reading ./Conjunction.csv ... 171
reading ./Verb.csv ... 130750
reading ./Adverb.csv ... 3032
reading ./Noun.name.csv ... 34215
reading ./Filler.csv ... 19
reading ./Noun.adverbal.csv ... 808
reading ./Postp.csv ... 146
reading ./Noun.others.csv ... 153
reading ./Adnominal.csv ... 135
emitting double-array: 100% |###########################################| 
reading ./matrix.def ... 1316x1316
emitting matrix      : 100% |###########################################| 

done!
[make-mecab-ipadic-NEologd] : Make custom system dictionary on /var/lib/mecab/dic/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801-neologd-20200910
make: Nothing to be done for 'all'.
[make-mecab-ipadic-NEologd] : Finish..
[install-mecab-ipadic-NEologd] : Get results of tokenize test
[test-mecab-ipadic-NEologd] : Start..
[test-mecab-ipadic-NEologd] : Replace timestamp from 'git clone' date to 'git commit' date
[test-mecab-ipadic-NEologd] : Get buzz phrases
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 31977    0 31977    0     0   208k      0 --:--:-- --:--:-- --:--:--  208k
[test-mecab-ipadic-NEologd] : Get difference between default system dictionary and mecab-ipadic-NEologd
[test-mecab-ipadic-NEologd] : Something wrong. You shouldn't install mecab-ipadic-NEologd yet.
[test-mecab-ipadic-NEologd] : Finish..

[install-mecab-ipadic-NEologd] : Please check the list of differences in the upper part.

[install-mecab-ipadic-NEologd] : Do you want to install mecab-ipadic-NEologd? Type yes or no.
yes
[install-mecab-ipadic-NEologd] : OK. Let's install mecab-ipadic-NEologd.
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : /usr/lib/x86_64-linux-gnu/mecab/dic isn't current user's directory
[install-mecab-ipadic-NEologd] : Sudo make install to /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
make[1]: Entering directory '/var/lib/mecab/dic/mecab-ipadic-neologd/build/mecab-ipadic-2.7.0-20070801-neologd-20200910'
make[1]: Nothing to be done for 'install-exec-am'.
/bin/bash ./mkinstalldirs /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
mkdir /usr/lib/x86_64-linux-gnu/mecab
mkdir /usr/lib/x86_64-linux-gnu/mecab/dic
mkdir /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
 /usr/bin/install -c -m 644 ./matrix.bin /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/matrix.bin
 /usr/bin/install -c -m 644 ./char.bin /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/char.bin
 /usr/bin/install -c -m 644 ./sys.dic /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/sys.dic
 /usr/bin/install -c -m 644 ./unk.dic /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/unk.dic
 /usr/bin/install -c -m 644 ./left-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/left-id.def
 /usr/bin/install -c -m 644 ./right-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/right-id.def
 /usr/bin/install -c -m 644 ./rewrite.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/rewrite.def
 /usr/bin/install -c -m 644 ./pos-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/pos-id.def
 /usr/bin/install -c -m 644 ./dicrc /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/dicrc
make[1]: Leaving directory '/var/lib/mecab/dic/mecab-ipadic-neologd/build/mecab-ipadic-2.7.0-20070801-neologd-20200910'

[install-mecab-ipadic-NEologd] : Install completed.
[install-mecab-ipadic-NEologd] : When you use MeCab, you can set '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd' as a value of '-d' option of MeCab.
[install-mecab-ipadic-NEologd] : Usage of mecab-ipadic-NEologd is here.
Usage:
    $ mecab -d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd ...

[install-mecab-ipadic-NEologd] : Finish..
[install-mecab-ipadic-NEologd] : Finish..
$ 

【Ubuntu】Python の CaboCha をインストールして形態素解析を行う

Ubuntu 20.04 で CaboCha を使える様にした時の手順を記録しておきます。

  1. MeCab のインストール
  2. mecab-ipadic-neologd のインストール
  3. CRF++ のインストール
  4. CaboCha のインストール
  5. Pythonへのバインディング

まだインストールしていなければ build-essential をインストールします。

$ sudo apt install build-essential

1. MeCab のインストール

$ sudo apt install mecab
$ sudo apt install libmecab-dev
$ sudo apt install mecab-ipadic

この時点でコマンド「mecab」を実行して何か文章を入力すると MeCab が形態素解析をしてくれます。

$ mecab
今日はいい天気ですね。
今日	名詞,副詞可能,*,*,*,*,今日,キョウ,キョー
は	助詞,係助詞,*,*,*,*,は,ハ,ワ
いい	形容詞,自立,*,*,形容詞・イイ,基本形,いい,イイ,イイ
天気	名詞,一般,*,*,*,*,天気,テンキ,テンキ
です	助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
ね	助詞,終助詞,*,*,*,*,ね,ネ,ネ
。	記号,句点,*,*,*,*,。,。,。

2. mecab-ipadic-neologd のインストール

新語に対応した NEologd 辞書(mecab-ipadic-neologd)をインストールします。

$ cd /var/lib/mecab/dic
$ sudo git clone https://github.com/neologd/mecab-ipadic-neologd.git
$ cd mecab-ipadic-neologd
$ sudo bin/install-mecab-ipadic-neologd

「/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd」にインストールされたので、MeCab 実行時に「-d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd」を渡してあげると mecab-ipadic-neologd を辞書として使うことができます。

$ mecab -d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
霜降り明星が好きです。
霜降り明星	名詞,固有名詞,人名,一般,*,*,霜降り明星,シモフリミョウジョウ,シモフリミョウジョー
が	助詞,格助詞,一般,*,*,*,が,ガ,ガ
好き	名詞,形容動詞語幹,*,*,*,*,好き,スキ,スキ
です	助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
。	記号,句点,*,*,*,*,。,。,。
EOS

上では「霜降り明星」が一つの名詞として認識されていますが、デフォルトの辞書だと下記の様に「霜降り」と「明星」が別々の言葉として認識されています。

$ mecab
霜降り明星が好きです。
霜降り	名詞,一般,*,*,*,*,霜降り,シモフリ,シモフリ
明星	名詞,一般,*,*,*,*,明星,ミョウジョウ,ミョージョー
が	助詞,格助詞,一般,*,*,*,が,ガ,ガ
好き	名詞,形容動詞語幹,*,*,*,*,好き,スキ,スキ
です	助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
。	記号,句点,*,*,*,*,。,。,。
EOS

3. CRF++ のインストール

CRF++-0.58.tar.gz

$ cd
$ wget "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ" -O CRF++-0.58.tar.gz
$ tar zxvf CRF++-0.58.tar.gz
$ cd CRF++-0.58
$ ./configure
$ sudo ldconfig
$ rm CRF++-0.58.tar.gz

4. CaboCha のインストール

cabocha-0.68.tar.bz2 をダウンロードします。Google Drive に配置されているので少し複雑です。

$ FILE_ID=0B4y35FiV1wh7SDd1Q1dUQkZQaUU
$ FILE_NAME=cabocha-0.69.tar.bz2
$ curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
$ CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"  
$ curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o ${FILE_NAME}

cabocha-0.68.tar.bz2 を解凍、インストールしていきます。

$ bzip2 -dc cabocha-0.69.tar.bz2 | tar xvf -
$ cd cabocha-0.69
$ ./configure --with-mecab-config=`which mecab-config` --with-charset=UTF8
$ make
$ make check
$ sudo make install
$ sudo ldconfig

先程の MeCab を同じ様に、コマンド「cabocha」を実行して何か文章を入力すると CaboCha が係り受けを出してくれます。

$ cabocha
今日はいい天気ですね。
      今日は---D
          いい-D
    天気ですね。
EOS

5. Pythonへのバインディング

Python の仮想環境を立ち上げた状態で下記を実行します。

$ cd python
$ python setup.py install
$ pip install mecab-python3

下記の通り Python で CaboCha が使える様になりました。

>>> import CaboCha
>>> sentence = '霜降り明星(しもふりみょうじょう)は、2018年『M-1グランプリ』14代目王者。'
>>> c = CaboCha.Parser('-d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd')
>>> print(c.parseToString(sentence))
        霜降り明星-----D      
              (しも-D |      
                  ふり-D      
      みょうじょう)は、-----D
                    2018年-D |
           『M-1グランプリ』-D
                  14代目王者。
EOS

【ログ】Ubuntu 20.04: sudo python setup.py install(cabocha-0.69 の configure, make, make check, make install 実行後)

  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04sadf
$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
copying CaboCha.py -> build/lib.linux-x86_64-3.9
running build_ext
building '_CaboCha' extension
creating build/temp.linux-x86_64-3.9
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/var/www/meatthezoo.org/chikapedia/html/dj_proj/include -I/usr/include/python3.9 -c CaboCha_wrap.cxx -o build/temp.linux-x86_64-3.9/CaboCha_wrap.o
In file included from /usr/include/string.h:495,
                 from /usr/include/python3.9/Python.h:30,
                 from CaboCha_wrap.cxx:154:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’ at CaboCha_wrap.cxx:5972:22,
    inlined from ‘PyObject* PyInit__CaboCha()’ at CaboCha_wrap.cxx:6070:25:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying 10 bytes from a string of the same length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: no library file corresponding to '-L/usr/lib/x86_64inux-gnu' found (skipping)
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.9/CaboCha_wrap.o -L/usr/local/lib -lcabocha -lcrfpp -lmecab -lmecab -lstdc++ -o build/lib.linux-x86_64-3.9/_CaboCha.cpython-39-x86_64-linux-gnu.so
running install_lib
copying build/lib.linux-x86_64-3.9/CaboCha.py -> /var/www/meatthezoo.org/chikapedia/html/dj_proj/lib/python3.9/site-packages
copying build/lib.linux-x86_64-3.9/_CaboCha.cpython-39-x86_64-linux-gnu.so -> /var/www/meatthezoo.org/chikapedia/html/dj_proj/lib/python3.9/site-packages
byte-compiling /var/www/meatthezoo.org/chikapedia/html/dj_proj/lib/python3.9/site-packages/CaboCha.py to CaboCha.cpython-39.pyc
running install_egg_info
Writing /var/www/meatthezoo.org/chikapedia/html/dj_proj/lib/python3.9/site-packages/cabocha_python-0.69.egg-info
$ 

【ログ】Ubuntu 20.04: cabocha-0.69 ./configure, make, make check, make install

  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04

実行コマンド:./configure

$ ./configure --with-mecab-config=`which mecab-config` --with-charset=UTF8
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc needs -traditional... no
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for library containing strerror... none required
checking for ld used by gcc... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether byte ordering is bigendian... no
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for sys/stat.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/types.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for sys/types.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for off_t... yes
checking for size_t... yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of size_t... 8
checking for size_t... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for getenv... yes
checking for opendir... yes
checking for snprintf... yes
using /usr/bin/mecab-config for mecab-config
checking whether iconv supports EUC-JP-MS and CP932... checking for main in -lstdc++... yes
checking for crfpp_new in -lcrfpp... yes
checking for mecab_new in -lmecab... yes
checking if g++ supports stl <vector> (required)... yes
checking if g++ supports stl <list> (required)... yes
checking if g++ supports stl <map> (required)... yes
checking if g++ supports stl <set> (required)... yes
checking if g++ supports stl <queue> (required)... yes
checking if g++ supports stl <functional> (required)... yes
checking if g++ supports stl <algorithm> (required)... yes
checking if g++ supports stl <string> (required)... yes
checking if g++ supports stl <iostream> (required)... yes
checking if g++ supports stl <strstream> (required)... yes
checking if g++ supports stl <fstream> (required)... yes
checking if g++ supports template <class T> (required)... yes
checking if g++ supports const_cast<> (required)... yes
checking if g++ supports static_cast<> (required)... yes
checking if g++ supports dynamic_cast<> (required)... yes
checking if g++ supports reinterpret_cast<> (required)... yes
checking if g++ supports exception handler (required)... yes
checking if g++ supports namespaces (required) ... yes
checking if g++ supports __thread (optional)... yes
checking if g++ environment provides all required features... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/Makefile.msvc
config.status: creating model/Makefile
config.status: creating man/Makefile
config.status: creating swig/version.h
config.status: creating cabocha-config
config.status: creating cabocharc
config.status: creating cabocha.iss
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands
$

実行コマンド:make

$ make
make  all-recursive
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69'
Making all in src
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/src'
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o chunk_learner.lo chunk_learner.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c chunk_learner.cpp  -fPIC -DPIC -o .libs/chunk_learner.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c chunk_learner.cpp -o chunk_learner.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o chunker.lo chunker.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c chunker.cpp  -fPIC -DPIC -o .libs/chunker.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c chunker.cpp -o chunker.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o dep.lo dep.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c dep.cpp  -fPIC -DPIC -o .libs/dep.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c dep.cpp -o dep.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o dep_learner.lo dep_learner.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c dep_learner.cpp  -fPIC -DPIC -o .libs/dep_learner.o
In file included from dep_learner.cpp:17:
param.h:30:13: warning: 'Target {anonymous}::lexical_cast(Source) [with Target = std::__cxx11::basic_string<char>; Source = std::__cxx11::basic_string<char>]' defined but not used [-Wunused-function]
   30 | std::string lexical_cast<std::string, std::string>(std::string arg) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c dep_learner.cpp -o dep_learner.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o eval.lo eval.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c eval.cpp  -fPIC -DPIC -o .libs/eval.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c eval.cpp -o eval.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o learner.lo learner.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c learner.cpp  -fPIC -DPIC -o .libs/learner.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c learner.cpp -o learner.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o libcabocha.lo libcabocha.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c libcabocha.cpp  -fPIC -DPIC -o .libs/libcabocha.o
In file included from libcabocha.cpp:18:
param.h:30:13: warning: 'Target {anonymous}::lexical_cast(Source) [with Target = std::__cxx11::basic_string<char>; Source = std::__cxx11::basic_string<char>]' defined but not used [-Wunused-function]
   30 | std::string lexical_cast<std::string, std::string>(std::string arg) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c libcabocha.cpp -o libcabocha.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o morph.lo morph.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c morph.cpp  -fPIC -DPIC -o .libs/morph.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c morph.cpp -o morph.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o ne.lo ne.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c ne.cpp  -fPIC -DPIC -o .libs/ne.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c ne.cpp -o ne.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o normalizer.lo normalizer.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c normalizer.cpp  -fPIC -DPIC -o .libs/normalizer.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c normalizer.cpp -o normalizer.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o param.lo param.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c param.cpp  -fPIC -DPIC -o .libs/param.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c param.cpp -o param.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o parser.lo parser.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c parser.cpp  -fPIC -DPIC -o .libs/parser.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c parser.cpp -o parser.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o selector.lo selector.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c selector.cpp  -fPIC -DPIC -o .libs/selector.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c selector.cpp -o selector.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o tree_allocator.lo tree_allocator.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c tree_allocator.cpp  -fPIC -DPIC -o .libs/tree_allocator.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c tree_allocator.cpp -o tree_allocator.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o string_buffer.lo string_buffer.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c string_buffer.cpp  -fPIC -DPIC -o .libs/string_buffer.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c string_buffer.cpp -o string_buffer.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o svm.lo svm.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c svm.cpp  -fPIC -DPIC -o .libs/svm.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c svm.cpp -o svm.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o svm_learn.lo svm_learn.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c svm_learn.cpp  -fPIC -DPIC -o .libs/svm_learn.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c svm_learn.cpp -o svm_learn.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o tree.lo tree.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c tree.cpp  -fPIC -DPIC -o .libs/tree.o
In file included from string_buffer.h:11,
                 from tree.cpp:14:
utils.h: In instantiation of 'size_t CaboCha::tokenizeCSV(char*, Iterator, size_t) [with Iterator = char**; size_t = long unsigned int]':
tree.cpp:480:57:   required from here
utils.h:127:10: warning: variable 'inquote' set but not used [-Wunused-but-set-variable]
  127 |     bool inquote = false;
      |          ^~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c tree.cpp -o tree.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o ucs.lo ucs.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c ucs.cpp  -fPIC -DPIC -o .libs/ucs.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c ucs.cpp -o ucs.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o utils.lo utils.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c utils.cpp  -fPIC -DPIC -o .libs/utils.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET=\"IPA\" -DCABOCHA_DEFAULT_CHARSET=\"UTF8\" -DMODEL_VERSION=102 -DCABOCHA_DEFAULT_RC=\"/usr/local/etc/cabocharc\" -O3 -Wno-deprecated -Wall -c utils.cpp -o utils.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -O3 -Wno-deprecated -Wall -no-undefined -version-info 5:0:0  -o libcabocha.la -rpath /usr/local/lib chunk_learner.lo chunker.lo dep.lo dep_learner.lo eval.lo learner.lo libcabocha.lo morph.lo ne.lo normalizer.lo param.lo parser.lo selector.lo tree_allocator.lo string_buffer.lo svm.lo svm_learn.lo tree.lo ucs.lo utils.lo  -lcrfpp -lmecab  -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++ 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o  .libs/chunk_learner.o .libs/chunker.o .libs/dep.o .libs/dep_learner.o .libs/eval.o .libs/learner.o .libs/libcabocha.o .libs/morph.o .libs/ne.o .libs/normalizer.o .libs/param.o .libs/parser.o .libs/selector.o .libs/tree_allocator.o .libs/string_buffer.o .libs/svm.o .libs/svm_learn.o .libs/tree.o .libs/ucs.o .libs/utils.o   -lcrfpp -L/usr/lib/x86_64-linux-gnu -lmecab -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o  -O3   -Wl,-soname -Wl,libcabocha.so.5 -o .libs/libcabocha.so.5.0.0
libtool: link: (cd ".libs" && rm -f "libcabocha.so.5" && ln -s "libcabocha.so.5.0.0" "libcabocha.so.5")
libtool: link: (cd ".libs" && rm -f "libcabocha.so" && ln -s "libcabocha.so.5.0.0" "libcabocha.so")
libtool: link: ar cru .libs/libcabocha.a  chunk_learner.o chunker.o dep.o dep_learner.o eval.o learner.o libcabocha.o morph.o ne.o normalizer.o param.o parser.o selector.o tree_allocator.o string_buffer.o svm.o svm_learn.o tree.o ucs.o utils.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libcabocha.a
libtool: link: ( cd ".libs" && rm -f "libcabocha.la" && ln -s "../libcabocha.la" "libcabocha.la" )
g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o cabocha.o cabocha.cpp
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -O3 -Wno-deprecated -Wall   -o cabocha cabocha.o libcabocha.la -lcrfpp -lmecab  -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++ 
libtool: link: g++ -O3 -Wno-deprecated -Wall -o .libs/cabocha cabocha.o  ./.libs/libcabocha.so -lcrfpp -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o cabocha-model-index.o cabocha-model-index.cpp
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -O3 -Wno-deprecated -Wall   -o cabocha-model-index cabocha-model-index.o libcabocha.la -lcrfpp -lmecab  -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++ 
libtool: link: g++ -O3 -Wno-deprecated -Wall -o .libs/cabocha-model-index cabocha-model-index.o  ./.libs/libcabocha.so -lcrfpp -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o cabocha-learn.o cabocha-learn.cpp
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -O3 -Wno-deprecated -Wall   -o cabocha-learn cabocha-learn.o libcabocha.la -lcrfpp -lmecab  -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++ 
libtool: link: g++ -O3 -Wno-deprecated -Wall -o .libs/cabocha-learn cabocha-learn.o  ./.libs/libcabocha.so -lcrfpp -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
g++ -DHAVE_CONFIG_H -I. -I.. -DCABOCHA_DEFAULT_POSSET="\"IPA"\" -DCABOCHA_DEFAULT_CHARSET="\"UTF8"\" -DMODEL_VERSION=102  -DCABOCHA_DEFAULT_RC="\"/usr/local/etc/cabocharc\""    -O3 -Wno-deprecated -Wall -c -o cabocha-system-eval.o cabocha-system-eval.cpp
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -O3 -Wno-deprecated -Wall   -o cabocha-system-eval cabocha-system-eval.o libcabocha.la -lcrfpp -lmecab  -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++ 
libtool: link: g++ -O3 -Wno-deprecated -Wall -o .libs/cabocha-system-eval cabocha-system-eval.o  ./.libs/libcabocha.so -lcrfpp -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/src'
Making all in model
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/model'
../src/cabocha-model-index -f UTF8 -t UTF8 chunk.ipa.txt chunk.ipa.model
../src/cabocha-model-index -f UTF8 -t UTF8 chunk.juman.txt chunk.juman.model
../src/cabocha-model-index -f UTF8 -t UTF8 chunk.unidic.txt chunk.unidic.model
../src/cabocha-model-index -f UTF8 -t UTF8 dep.ipa.txt dep.ipa.model
emitting dic    : 100% |###########################################| 
emitting trie   : 100% |###########################################| 

double array size : 2340864
trie         size : 22100992
feature size      : 122541
freq feature size : 3000
minsup            : 2
bias              : 113308
sigma             : 0.0001
normalize factor  : 1.98193e-07
Done!
15.19 s

../src/cabocha-model-index -f UTF8 -t UTF8 dep.juman.txt dep.juman.model
emitting dic    : 100% |###########################################| 
emitting trie   : 100% |###########################################| 

double array size : 2892800
trie         size : 22047744
feature size      : 149674
freq feature size : 3000
minsup            : 2
bias              : 78200
sigma             : 0.0001
normalize factor  : 2.27711e-07
Done!
14.92 s

../src/cabocha-model-index -f UTF8 -t UTF8 dep.unidic.txt dep.unidic.model
emitting dic    : 100% |###########################################| 
emitting trie   : 100% |###########################################| 

double array size : 2159616
trie         size : 19891200
feature size      : 121120
freq feature size : 3000
minsup            : 2
bias              : 92412
sigma             : 0.0001
normalize factor  : 2.27189e-07
Done!
13.85 s

../src/cabocha-model-index -f UTF8 -t UTF8 ne.ipa.txt ne.ipa.model
../src/cabocha-model-index -f UTF8 -t UTF8 ne.juman.txt ne.juman.model
../src/cabocha-model-index -f UTF8 -t UTF8 ne.unidic.txt ne.unidic.model
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/model'
Making all in man
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/man'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/man'
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69'
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69'

実行コマンド:make check

$ make check
Making check in src
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/src'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/src'
Making check in model
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/model'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/model'
Making check in man
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/man'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/man'
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69'
$

実行コマンド:sudo make install

$ sudo make install
Making install in src
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/src'
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/src'
 /usr/bin/mkdir -p '/usr/local/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libcabocha.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libcabocha.so.5.0.0 /usr/local/lib/libcabocha.so.5.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libcabocha.so.5.0.0 libcabocha.so.5 || { rm -f libcabocha.so.5 && ln -s libcabocha.so.5.0.0 libcabocha.so.5; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libcabocha.so.5.0.0 libcabocha.so || { rm -f libcabocha.so && ln -s libcabocha.so.5.0.0 libcabocha.so; }; })
libtool: install: /usr/bin/install -c .libs/libcabocha.lai /usr/local/lib/libcabocha.la
libtool: install: /usr/bin/install -c .libs/libcabocha.a /usr/local/lib/libcabocha.a
libtool: install: chmod 644 /usr/local/lib/libcabocha.a
libtool: install: ranlib /usr/local/lib/libcabocha.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/usr/local/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c cabocha '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/cabocha /usr/local/bin/cabocha
 /usr/bin/mkdir -p '/usr/local/libexec/cabocha'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c cabocha-model-index cabocha-learn cabocha-system-eval '/usr/local/libexec/cabocha'
libtool: install: /usr/bin/install -c .libs/cabocha-model-index /usr/local/libexec/cabocha/cabocha-model-index
libtool: install: /usr/bin/install -c .libs/cabocha-learn /usr/local/libexec/cabocha/cabocha-learn
libtool: install: /usr/bin/install -c .libs/cabocha-system-eval /usr/local/libexec/cabocha/cabocha-system-eval
 /usr/bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 cabocha.h '/usr/local/include'
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/src'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/src'
Making install in model
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/model'
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/model'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/lib/cabocha/model'
 /usr/bin/install -c -m 644 chunk.ipa.model chunk.juman.model chunk.unidic.model dep.ipa.model dep.juman.model dep.unidic.model ne.ipa.model ne.juman.model ne.unidic.model '/usr/local/lib/cabocha/model'
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/model'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/model'
Making install in man
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69/man'
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69/man'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 cabocha.1 '/usr/local/share/man/man1'
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69/man'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69/man'
make[1]: Entering directory '/home/vpsadmin/cabocha-0.69'
make[2]: Entering directory '/home/vpsadmin/cabocha-0.69'
 /usr/bin/mkdir -p '/usr/local/bin'
 /usr/bin/install -c cabocha-config '/usr/local/bin'
 /usr/bin/mkdir -p '/usr/local/etc'
 /usr/bin/install -c -m 644 cabocharc '/usr/local/etc'
make[2]: Leaving directory '/home/vpsadmin/cabocha-0.69'
make[1]: Leaving directory '/home/vpsadmin/cabocha-0.69'
$ 

【ログ】Ubuntu 20.04: CRF++-0.58 ./configure, make, make install

  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04

実行コマンド:./configure

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc needs -traditional... no
checking whether make sets $(MAKE)... (cached) yes
checking for library containing strerror... none required
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) no
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for sys/stat.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for sys/types.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for size_t... yes
checking for pow in -lm... yes
checking for exp in -lm... yes
checking for log in -lm... yes
checking for pthread_create in -lpthread... yes
checking for pthread_join in -lpthread... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether make is GNU Make... yes
checking if g++ supports stl <string> (required)... yes
checking if g++ supports stl <vector> (required)... yes
checking if g++ supports stl <map> (required)... yes
checking if g++ supports stl <set> (required)... yes
checking if g++ supports stl <iostream> (required)... yes
checking if g++ supports stl <fstream> (required)... yes
checking if g++ supports stl <sstream> (required)... yes
checking if g++ supports stl <stdexcept> (required)... yes
checking if g++ supports template <class T> (required)... yes
checking if g++ supports const_cast<> (required)... yes
checking if g++ supports static_cast<> (required)... yes
checking if g++ supports dynamic_cast<> (required)... yes
checking if g++ supports exception handler (required)... yes
checking if g++ supports namespaces (required) ... yes
checking if g++ supports __thread (optional)... yes
checking if g++ supports _SC_NPROCESSORS_CONF (optional)... yes
checking if g++ environment provides all required features... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.msvc
config.status: creating swig/version.h
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
$ 

実行コマンド:make

$ make
make  all-am
make[1]: Entering directory '/home/vpsadmin/CRF++-0.58'
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o libcrfpp.lo libcrfpp.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c libcrfpp.cpp  -fPIC -DPIC -o .libs/libcrfpp.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c libcrfpp.cpp -o libcrfpp.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o lbfgs.lo lbfgs.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c lbfgs.cpp  -fPIC -DPIC -o .libs/lbfgs.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c lbfgs.cpp -o lbfgs.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o param.lo param.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c param.cpp  -fPIC -DPIC -o .libs/param.o
In file included from /usr/include/string.h:495,
                 from /usr/include/c++/9/cstring:42,
                 from scoped_ptr.h:11,
                 from param.h:15,
                 from param.cpp:10:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'bool CRFPP::Param::open(const char*, const CRFPP::Option*)' at param.cpp:196:15:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 8192 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c param.cpp -o param.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o encoder.lo encoder.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c encoder.cpp  -fPIC -DPIC -o .libs/encoder.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c encoder.cpp -o encoder.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o feature.lo feature.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature.cpp  -fPIC -DPIC -o .libs/feature.o
In file included from tagger.h:14,
                 from feature.cpp:12:
param.h:34:13: warning: 'Target CRFPP::{anonymous}::lexical_cast(Source) [with Target = std::__cxx11::basic_string<char>; Source = std::__cxx11::basic_string<char>]' defined but not used [-Wunused-function]
   34 | std::string lexical_cast<std::string, std::string>(std::string arg) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature.cpp -o feature.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o feature_cache.lo feature_cache.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature_cache.cpp  -fPIC -DPIC -o .libs/feature_cache.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature_cache.cpp -o feature_cache.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o feature_index.lo feature_index.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature_index.cpp  -fPIC -DPIC -o .libs/feature_index.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c feature_index.cpp -o feature_index.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o node.lo node.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c node.cpp  -fPIC -DPIC -o .libs/node.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c node.cpp -o node.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o path.lo path.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c path.cpp  -fPIC -DPIC -o .libs/path.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c path.cpp -o path.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o tagger.lo tagger.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c tagger.cpp  -fPIC -DPIC -o .libs/tagger.o
In file included from /usr/include/string.h:495,
                 from /usr/include/c++/9/cstring:42,
                 from stream_wrapper.h:13,
                 from tagger.cpp:14:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'virtual const char* CRFPP::TaggerImpl::toString(char*, size_t)' at tagger.cpp:731:15:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tagger.cpp: In member function 'virtual const char* CRFPP::TaggerImpl::toString(char*, size_t)':
tagger.cpp:730:40: note: length computed here
  730 |   const size_t l = std::min(std::strlen(p), len);
      |                             ~~~~~~~~~~~^~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c tagger.cpp -o tagger.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CXX   --mode=link g++  -O3 -Wall   -o libcrfpp.la -rpath /usr/local/lib libcrfpp.lo lbfgs.lo param.lo encoder.lo feature.lo feature_cache.lo feature_index.lo node.lo path.lo tagger.lo  -lpthread -lpthread -lm -lm -lm 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o  .libs/libcrfpp.o .libs/lbfgs.o .libs/param.o .libs/encoder.o .libs/feature.o .libs/feature_cache.o .libs/feature_index.o .libs/node.o .libs/path.o .libs/tagger.o   -lpthread -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o  -O3   -Wl,-soname -Wl,libcrfpp.so.0 -o .libs/libcrfpp.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libcrfpp.so.0" && ln -s "libcrfpp.so.0.0.0" "libcrfpp.so.0")
libtool: link: (cd ".libs" && rm -f "libcrfpp.so" && ln -s "libcrfpp.so.0.0.0" "libcrfpp.so")
libtool: link: ar cru .libs/libcrfpp.a  libcrfpp.o lbfgs.o param.o encoder.o feature.o feature_cache.o feature_index.o node.o path.o tagger.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libcrfpp.a
libtool: link: ( cd ".libs" && rm -f "libcrfpp.la" && ln -s "../libcrfpp.la" "libcrfpp.la" )
g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o crf_learn.o crf_learn.cpp
/bin/bash ./libtool --tag=CXX   --mode=link g++  -O3 -Wall   -o crf_learn crf_learn.o libcrfpp.la -lpthread -lpthread -lm -lm -lm 
libtool: link: g++ -O3 -Wall -o .libs/crf_learn crf_learn.o  ./.libs/libcrfpp.so -lpthread -lm
g++ -DHAVE_CONFIG_H -I.     -O3 -Wall -c -o crf_test.o crf_test.cpp
/bin/bash ./libtool --tag=CXX   --mode=link g++  -O3 -Wall   -o crf_test crf_test.o libcrfpp.la  -lpthread -lpthread -lm -lm -lm 
libtool: link: g++ -O3 -Wall -o .libs/crf_test crf_test.o  ./.libs/libcrfpp.so -lpthread -lm
make[1]: Leaving directory '/home/vpsadmin/CRF++-0.58'
$

実行コマンド:sudo make install

$ sudo make install
[sudo] password for vpsadmin: 
make[1]: Entering directory '/home/vpsadmin/CRF++-0.58'
test -z "/usr/local/lib" || /usr/bin/mkdir -p "/usr/local/lib"
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libcrfpp.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libcrfpp.so.0.0.0 /usr/local/lib/libcrfpp.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libcrfpp.so.0.0.0 libcrfpp.so.0 || { rm -f libcrfpp.so.0 && ln -s libcrfpp.so.0.0.0 libcrfpp.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libcrfpp.so.0.0.0 libcrfpp.so || { rm -f libcrfpp.so && ln -s libcrfpp.so.0.0.0 libcrfpp.so; }; })
libtool: install: /usr/bin/install -c .libs/libcrfpp.lai /usr/local/lib/libcrfpp.la
libtool: install: /usr/bin/install -c .libs/libcrfpp.a /usr/local/lib/libcrfpp.a
libtool: install: chmod 644 /usr/local/lib/libcrfpp.a
libtool: install: ranlib /usr/local/lib/libcrfpp.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/bin" || /usr/bin/mkdir -p "/usr/local/bin"
  /bin/bash ./libtool   --mode=install /usr/bin/install -c crf_learn crf_test '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/crf_learn /usr/local/bin/crf_learn
libtool: install: /usr/bin/install -c .libs/crf_test /usr/local/bin/crf_test
test -z "/usr/local/include" || /usr/bin/mkdir -p "/usr/local/include"
 /usr/bin/install -c -m 644 crfpp.h '/usr/local/include'
make[1]: Leaving directory '/home/vpsadmin/CRF++-0.58'
$

【ログ】Ubuntu 20.04: sudo apt install mecab-ipadic

  • 実行コマンド:sudo apt install mecab-ipadic
  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04
$ sudo apt install mecab-ipadic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mecab-ipadic is already the newest version (2.7.0-20070801+main-2.1).
mecab-ipadic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
$ 

【ログ】Ubuntu 20.04: sudo apt install libmecab-dev

  • 実行コマンド:sudo apt install libmecab-dev
  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04
$ sudo apt install libmecab-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libmecab-dev
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 285 kB of archives.
After this operation, 3112 kB of additional disk space will be used.
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libmecab-dev amd64 0.996-10build1 [285 kB]
Fetched 285 kB in 0s (1618 kB/s)    
Selecting previously unselected package libmecab-dev.
(Reading database ... 152963 files and directories currently installed.)
Preparing to unpack .../libmecab-dev_0.996-10build1_amd64.deb ...
Unpacking libmecab-dev (0.996-10build1) ...
Setting up libmecab-dev (0.996-10build1) ...
Processing triggers for man-db (2.9.1-1) ...
$ 

【ログ】Ubuntu 20.04: sudo apt install mecab

  • 実行コマンド:sudo apt install mecab
  • 実行日:2021/06/06
  • 実行環境:Ubuntu 20.04
$ sudo apt install mecab
[sudo] password for vpsadmin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  mecab
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 132 kB of archives.
After this operation, 948 kB of additional disk space will be used.
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/universe amd64 mecab amd64 0.996-10build1 [132 kB]
Fetched 132 kB in 1s (92.6 kB/s)        
Selecting previously unselected package mecab.
(Reading database ... 152892 files and directories currently installed.)
Preparing to unpack .../mecab_0.996-10build1_amd64.deb ...
Unpacking mecab (0.996-10build1) ...
Setting up mecab (0.996-10build1) ...
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################| 
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix      : 100% |###########################################| 

done!
Processing triggers for man-db (2.9.1-1) ...
$ 

【Django】Nginx + Gunicorn でサブドメインを設定する方法

「example.com」というドメイン名ですでに運用しているところに追加で「sub.example.com」も使いたいという想定で書きます。

また、Django の処理には Gunicorn を使っています。

  1. ネームサーバーでサブドメインの設定をする
  2. サブドメイン用のディレクトリを作る
  3. 仮想環境と Django プロジェクトを作成する
  4. Gunicorn をインストールする
  5. UNIX ドメインソケットを設定する
  6. Nginx の設定ファイルにサブドメインの処理を追記する
  7. とりあえず図にしてみた

1. ネームサーバーでサブドメインの設定をする

ネームサーバーでサブドメインを登録します。

フィールド
エントリ名sub
種別別名 (CNAME)
@
DNSチェックする
TTLの設定なし

さくらインターネットを使っている場合は会員メニュー > ドメイン > ゾーン表示の画面で登録できます。

2. サブドメイン用のディレクトリを作る

任意の場所にサイトをホストするためのディレクトリを作成します。

例えば「example.com」というディレクトリの配下にさらにサブドメイン用に「sub」ディレクトリ、その配下に「html」と作る場合は下記の様な形。

$ cd var/www/example.com
$ mkdir sub
$ cd sub
$ mkdir html

ディレクトリの管理者を変更します。

$ sudo chown -R $USER:$USER /var/www/example.com/sub/html/

注意

一度上記の管理者の変更を飛ばした際、後で Django の「python manage.py startapp アプリ名」を実行した時に「ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?」というエラーが出ました。

「pip install django」を実行した際に django モジュールが仮想環境内に上手くインストールされなかったことが原因です。

3. 仮想環境と Django プロジェクトを作成する

Python の仮想環境を作成、起動します。

$ cd var/www/example.com/sub/html/
$ python3.9 -m venv dj_proj_venv
$ cd dj_proj_venv
$ source bin/activate

Django を pip install し、プロジェクトとアプリケーションを作成します。

注)ローカルPCで開発したものを Git で本番環境にクローンする様な場合はこのステップは不要です。

(dj_proj_venv) $ pip install django
(dj_proj_venv) $ django-admin startproject dj_proj
(dj_proj_venv) $ cd dj_proj
(dj_proj_venv) $ python manage.py startapp dj_app

settings.py の INSTALLED_APPS にアプリケーションを追記します。

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'dj_app.apps.DjAppConfig', # 追記分
]

settings.py の ALLOWED_HOSTS にサブドメインを含むドメインを記述します。

ALLOWED_HOSTS = ['sub.example.com']

4. Gunicorn をインストールする

Gunicorn をインストールします。

$ pip install gunicorn

5. UNIX ドメインソケットを設定する

そして Nginx と Gunicorn の接続に Unix ソケットを使える様、Linux サーバーの Systemd という機能で設定します。

.socket ファイルの作成

サブドメイン用に「example_sub.socket」というファイルを作成します。

# example_sub.socket
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/example_sub.sock
[Install]
WantedBy=sockets.target
項目メモ
Descriptionログ出力の際などに使われる
ListenStreamリクエストを待ち受けるポートの指定。
Nginx 設定ファイルの pass_proxy で指定するものと同じ。
WantedBysockets.target

.service ファイルの作成

サブドメイン用に「example_sub.service」というファイルを作成します。

上記の「example_sub.socket」へ送られてきたリクエストの引き渡し先を定義します。

# example_sub.service
[Unit]
Description=gunicorn daemon
Requires=example_sub.socket
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/var/www/example.com/sub/html/dj_proj_venv/dj_proj
ExecStart=/var/www/example.com/sub/html/dj_proj_venv/bin/gunicorn --workers 3 --bind unix:/run/sample_django.sock dj_proj.wsgi:application
[Install]
WantedBy=multi-user.target
項目メモ
Descriptionログ出力の際などに使われる
Requires対応する .socket ファイル
Afterユニットが開始する順序 (ユニットの起動する順番) を設定。
After で指定したユニットがアクティブになると、このユニットを開始する。
User
Group
WorkingDirectorymanage.py があるディレクトリのフルパス?
ExecStartsystemctl start した時に実行するコマンド。
「$ gunicorn [OPTIONS] [WSGI_APP]」のフォーマットで記述。
上記ファイルでは venv 内の gunicorn のフルパスを指定し、オプションとして --workers と --bind を指定した上で Django の wsgi を実行している。
--workers:worker プロセスの数
--bind:bind 対象のサーバーソケット(.sock)。gunicorn のデフォルトは 127.0.0.1:8000
WantedBy大抵 multi-user.target で大丈夫

socket の待ち受けを開始します。

$ systemctl start example_sub.socket
$ systemctl start example_sub.service

6. Nginx の設定ファイルにサブドメインの処理を追記する

「sub.example.com」と「example.com」の処理が記述されています。

それぞれの proxy_pass の記述を見るとわかりますが、「sub.example.com」へのリクエストの場合は example_sub.sock のソケット、「example.com」へのリクエストの場合は example.sock のソケットへ処理が回されます。

server {
        listen 80;
        listen [::]:80;

        server_name sub.example.com;

        root /var/www/example.com/sub/html;
        index index.html;

        location / {
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_pass http://unix:/run/example_sub.sock;
        }

        location /static {
                alias /var/www/example.com/sub/html/static;
        }

}

server {
        listen 80;
        listen [::]:80;

        server_name example.com;

        root /var/www/example.com/html;
        index index.html;

        location / {
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_pass http://unix:/run/example.sock;
        }

        location /static {
                alias /var/www/example.com/html/static;
        }

}
ファイル内の概念解説
listenリクエストを受け入れる IP アドレスやポートの指定。
UNIX ドメインソケットのパスでも可。
server_nameリクエストを受け入れるサーバー名(ドメイン名)の指定。
複数のサーバー名をスペース区切りで設定可。
proxy_set_headerプロキシサーバーへ送るリクエストヘッダーの各フィールドの追加や書き換え。
$proxy_add_x_forwarded_forクライアントからのリクエストヘッダーの X-Forwarded-For フィールドに $remote_addr が追加されたもの。
クライアントからのリクエストヘッダーに X-Forwarded-For が無かった場合は $remote_addr と同じ。
$schemeリクエストスキーム。http か https。
proxy_passプロキシサーバーの指定。Gunicorn につなげるための UNIX ソケットを指定。
参照 Nginx Documentation

7. とりあえず図にしてみた

自分の理解のためにいろんなケースを図にしてみました。

1 つのアプリを Gunicorn のデフォルトポートで実行する場合

まずは一番シンプルな形。サブドメインとかなく、一つのドメインで一つのアプリを公開する形。

Gunicorn のデフォルトの bind 先は 127.0.0.1:8000 だそうなので、そこに対して Nginx から proxy_pass した場合です。

Django + Nginx + Gunicorn での設定

1 つのアプリを UNIX ドメインソケットで実行する場合

UNIX ドメインソケットの方が処理が速いということで(?)大半の記事で UNIX ドメインソケットを使用しているっぽいです。なので自分もこの方法を取っています。

この場合、当記事にも書いてある様に Systemd の .socket ファイルと .service ファイルを作成する必要があります。たぶん。実は必須ではないのかも。わかりません。

Django + Nginx + Gunicorn での設定

2 つのアプリを別々の UNIX ドメインソケットで実行する場合

複数のアプリをサブドメインで分けるという事でこの記事で紹介した方法がこちらです。

別々のソケットを用意し、そこに各サブドメインから proxy_pass で繋いであげれば OK です。

Django + Nginx + Gunicorn での設定

2 つのアプリを別々のポートで実行する場合

ただ、上記が出来るならそもそも UNIX ドメインソケットを使わなくても localhost(127.0.0.1)のポートを分ければ良いんじゃないかと思いました。自分では実際に試してませんが多分いける気がします。

Django + Nginx + Gunicorn での設定