さくらの VPS (Ubuntu 20.04) で Django アプリを作る(2/3)

[ad-disclaimer]

Ubuntu 環境(さくらのVPS )で Django アプリケーションを作るまでに実際に辿ったステップ。こちらの記事の続編です。

今回は実際に Django のプロジェクト・アプリケーションを作って公開するところまで。Web サーバーとして Nginx、アプリケーションサーバーとして Gunicorn の設定も行います。

また、今後同じサーバーで複数の Django プロジェクトを作っても大丈夫な様に設定していきます。

Django + Nginx + Gunicorn での設定

全体はとりあえずこんな感じのイメージです。

  1. サイトをホストするディレクトリの作成
    • ルートディレクトリ作成
    • 管理者の変更
  2. Django を動かす
    • Python 仮想環境作成
    • Django インストール
    • Django プロジェクトと Django アプリケーションを作成
    • settings.py の設定
    • Django の動作確認
  3. Web サーバーの設定(Nginx)
    • Web サーバー: Nginx
    • 設定ファイル(nginx.conf)
  4. アプリケーションサーバーの設定(Gunicorn)
    • アプリケーションサーバー: Gunicorn
    • 仮想環境内で pip install gunicorn
    • systemd .socket ファイル
    • systemd .service ファイル
    • Nginx の設定ファイルでソケットを使用する様設定する
  5. 静的ファイルの設定

1. サイトをホストするディレクトリの作成

サーバー上にサイトホスト用ディレクトリを作成しますが、今後を見越し、複数のドメインを同じサーバー上でホスト出来る様に配慮して作業を進めていきます。

ルートディレクトリ作成

サイトをホストするルートディレクトリを作成します。

Nginx はデフォルトで「/var/www/html」というディレクトリを作っていますが、今回は /var/www/ の配下にドメイン名のディレクトリ、そしてその配下に html というディレクトリを作ります。(イメージ:/var/www/example.com/html)

vpsadmin@xx1-234-56789:/var/www$ sudo mkdir -p example.com
[sudo] password for vpsadmin: 
vpsadmin@xx1-234-56789:/var/www$ ls
html  meatthezoo.org
vpsadmin@xx1-234-56789:/var/www$ cd example.com
vpsadmin@xx1-234-56789:/var/www/example.com$ sudo mkdir -p html

管理者の変更

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

vpsadmin@xx1-234-56789:/var/www$ sudo chown -R $USER:$USER /var/www/example.com/html

2. Django を動かす

Python 仮想環境作成

ルートディレクトリ(/var/www/example.com/html)直下で「python3 -m venv 仮想環境名」を実行しPython の仮想環境を作成します。

$ python3 -m venv djangovenv

Django インストール

仮想環境を起動し、「pip install django」で Django をインストールします。

% cd djangovenv
% source bin/activate
(djangovenv) % pip install django

Django プロジェクトと Django アプリケーションの作成

Django プロジェクトと Django アプリケーションを作成していきます。

(djangovenv) % django-admin startproject djangoprod
(djangovenv) % cd djangoprod
(djangovenv) % python manage.py startapp djangoapp

settings.py の設定

settings.py の ALLOWED_HOSTS にサイトのドメイン名を登録し、INSTALLED_APS にアプリケーションを追加します。

ALLOWED_HOSTS = ['example.com', 'www.example.com']

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

    'djangoapp.apps.DjangoAppConfig' # 追記分
]

Django の動作確認

コマンド「python manage.py runserver 0.0.0.0:8000」を実行し、ブラウザの URL バーに「ドメイン名:8000」と打ち込んでみます。

Django デフォルトのロケットの画面が出たら大丈夫です。ちなみにこの画面は settings.py の DEBUG = True の時だけ表示されます。

Djangoのデフォルトエラーページが DEBUG=Falseだと見れないのはなんでか調べた

今現在、Django の runserver を起動した場合に限り、ポート 8000 でなら Django が動くという状態です。

というわけで Web サーバー(Nginx)をアプリケーションサーバー(Gunicorn)を使って下記を解決していきます。

問題解決方法
URL バーでポート 8000 を指定しないとアクセスできないNginx の設定ファイルで、該当するドメイン名にアクセスされたら Django に繋ぐ様変更する
runserver を起動していないとアクセスできないGunicorn を使う

3. Web サーバーの設定(Nginx)

設定ファイル(nginx.conf)

デフォルトの設定ファイルは「/etc/nginx/nginx.conf」

初めから下記の二行が書いてあればこのファイルはノータッチで良さそうです。

  • include /etc/nginx/conf.d/*.conf;
  • include /etc/nginx/sites-enabled/*;

複数ドメイン対応

一つのサーバーで複数のウェブサイトを運営しようとした場合、一つの IP アドレスに複数のドメイン名が紐づく事になります。

そのため、リクエストされた URL に応じて適切なサイトの情報を返せる様設定していきます。

  1. sites-available ディレクトリにドメイン毎の設定ファイルを置く
  2. 各ドメインの設定ファイルでドメインとルートディレクトリを紐付け
  3. それらファイルのシンボリックリンクを sites-enabled ディレクトリに作成
  4. sites-enabled を nginx.conf 本体に include

設定ファイルの複製と編集

「sites-available」ディレクトリの「default」ファイルを個別サイト用にコピーします。

sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com

コピーした方のファイルを確認します。下の方に Virtual Host のための設定というところがあるのでそちらを使います。上半分は Default Server のための設定なので全てコメントアウトします。

server_name と location / の部分を編集しました。

example.com ファイルの Virtual Host 設定部分
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#

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

        server_name www.example.com;
        return 301 http://example.com$request_uri;
}


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

        server_name example.com;

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

        location / {
                try_files $uri $uri/ =404;
                include proxy_params;
                proxy_pass http://127.0.0.1:8000;
        }
}
ファイル内の概念解説
listenリクエストを受け入れる IP アドレスやポートの指定。
UNIX ドメインソケットのパスでも可。
server_nameリクエストを受け入れるサーバー名(ドメイン名)の指定。
複数のサーバー名をスペース区切りで設定可。
try_filesファイルの存在を指定された順に確認。
$uriリクエストの URI。リダイレクト時など、処理の中で元々のリクエストから書き変わることもある。
include proxy_params/etc/nginx/proxy_params」にプロキシの設定が記載してあるので include。
proxy_passプロキシサーバーの指定。
参照 Nginx Documentation

初めの部分は「www.example.com」へのアクセスを自動的に「example.com」へリダイレクトする設定です。

シンボリックリンクを作成します。

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Nginx を再起動します。

sudo systemctl restart nginx

そして runserver を実行して、反映を確かめます。

python manage.py runserver 0.0.0.0:8000

これで一つ解決です。ポート 8000 を URL に含めなくても Django に飛ぶ様になりました。

次は runserver を起動していないとアクセスできないという部分を、Gunicorn を使って解決します。

問題解決方法
runserver を起動していないとアクセスできないGunicorn を使う

4. アプリケーションサーバーの設定(Gunicorn)

Nginx から飛んできたリクエストを、待ち受けているソケットから Django アプリケーションに伝える様に設定します。

言い方を変えると Nginx からのリクエストを .socket ファイルが受け、.service ファイルを起動し Gunicorn の処理を実行します。

Gunicorn のインストール

仮想環境内で pip install gunicorn を実行します。

pip install gunicorn

.socket と .service の作成

「/etc/systemd/system/」ディレクトリに .socket と .service を作成します。今回はファイル名をそれぞれ「sample_django.socket」、「sample_django.service」としています。

systemd .socket ファイル

Nginx の設定ファイルで指定したポートでリクエストを待ち受け、 リクエストがあったら指定されているサービスに接続を渡します。

# sample_django.socket

[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/sample_django.sock
[Install]
WantedBy=sockets.target
項目メモ
Descriptionログ出力の際などに使われる
ListenStreamポートの指定。Nginx 設定ファイルの pass_proxy で指定
WantedBysockets.target

systemd .service ファイル

サービスの依存関係や実際の実行内容を定義します。

# sample_django.service

[Unit]
Description=gunicorn daemon
Requires=sample_django.socket
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/var/www/example.com/html/djangovenv/djangoprod
ExecStart=/var/www/example.com/html/djangovenv/bin/gunicorn --workers 3 --bind unix:/run/sample_django.sock djangoprod.wsgi:application
[Install]
WantedBy=multi-user.target
項目メモ
Descriptionログ出力の際などに使われる
Requires対応する .socket ファイル
After
User
Group
WorkingDirectorymanage.py があるディレクトリのフルパス?
ExecStartsystemctl start した時に実行するコマンド。
.sock と wsgi を bind。
venv 内の gunicorn のフルパス(?)を指定
WantedBy大抵 multi-user.target で大丈夫

サービスを起動します。

systemctl start sample_django.socket
systemctl start sample_django.service

下記を実行すると Gunicorn のステータスを確認できます。

sudo systemctl status sample_django

Nginx 設定ファイルの変更

Nginx 設定ファイルの proxy_pass の部分を下記の様に変更しました。.socket ファイルの ListenStream で設定したポートを指定しています。

location / {
        try_files $uri $uri/ =404;
        include proxy_params;
        # proxy_pass http://127.0.0.1:8000;
        proxy_pass http://unix:/run/sample_django.sock;
}

Nginx の設定を検証し再起動します。

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl restart nginx

これで runserver を実行しなくても URL を叩けば Django アプリケーションへアクセスできる様になったはずです。

大雑把ですがなんとなく全体像は下記の様なイメージです。

Django + Nginx + Gunicorn での設定

*作業時は何かにつけて「pkill gunicorn」で gunicorn を終わらせた方が良いです。エラーが起きていくらコードを修正しても治らないまま数時間経って、「pkill gunicorn」一発で治ったこともありました。

静的ファイルの設定

実はこの時点では CSS や JavaScript のいわゆる静的ファイルはうまく反映されません。ドメイン名/admin にブラウザでアクセスすると CSS が抜けている状態だと思います。

Django で静的ファイルとうまくやる

本番環境でちゃんと表示される様、settings.py と Nginx の設定ファイルを編集します。

settings.py の編集

settings.py 内では STATICFILES_DIRS と STATIC_ROOT を設定します。

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]
STATIC_ROOT = '/var/www/example.com/html/static'
項目メモ
STATICFILES_DIRScollectstatic が静的ファイルを追加検索する対象のディレクトリ(特定のアプリケーションに属さないものが対象)
STATIC_ROOTcollectstatic 実行時に静的ファイルの集約先となるディレクトリ

collectstatic を実行します。

python manage.py collectstatic

Nginx の設定ファイルの編集

server ディレクティブの中に STATIC_ROOT 指定したパスを追記しました。

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

これでドメイン名/admin を再度確認すると CSS が反映されていると思います。

他の行程へ

▶︎まずは2週間無料でお試し♪さくらのVPS

さくらの VPS (Ubuntu 20.04) で Django アプリを作る(1/3)

[ad-disclaimer]

[ad-disclaimer]

Ubuntu 環境(さくらのVPS )で Django アプリケーションを作るまでに実際に辿ったステップを記録します。

手順がかなり多いので途中あまり詳しく書いていないところもありますがご了承ください。

まずは VPS の契約から Ubuntu OS の設定Python のインストールWeb サーバーのインストールまで。

  1. VPS の契約(さくらの VPS)
  2. 独自ドメインの取得
  3. IP アドレスとドメイン名を紐付け
  4. OS (Ubuntu 20.04) のインストール
  5. Ubuntu の初期設定
    • ssh でサーバーへ接続
    • 非 root ユーザーの作成
    • パッケージリストを最新版へ更新
    • パッケージのアップグレード
    • サーバーの再起動
  6. FTP サーバーのインストール
  7. 開発パッケージのインストール
  8. Python と関連パッケージのインストール
    • 依存関係のインストール
    • Python 3.9 のインストール
    • python3.9-dev のインストール
    • 仮想環境(venv)のインストール
  9. Web サーバー(Nginx)のインストール

ちなみに、僕は初め下記の書籍に沿って Django の全体像を勉強しました。書籍の中では AWS を使ったデプロイにも触れられていますので参考にしてみてください。

動かして学ぶ! Python Django開発入門 (NEXT ONE)

1. VPS の契約(さくらの VPS)

まずは VPS の契約。私は月額 880 円〜の さくらのVPS 1G プランにしました。

公式ページさくらのVPS 1G

さくらの VPS 以外でも大丈夫

とはいうものの、実はさくらの VPS でなくても Ubuntu OS であればこちらの記事の手順で特に問題ないです。

コントロールパネルの見た目やファイアウォールの設定の部分だけは少し違いますが、それは一番初めの部分でそれ以降は OS に依存するので他の VPS でも変わりません。

Django におすすめの OS と VPS を下記の記事で紹介しているのでぜひ参考にしてみてください。

▶︎ Django のおすすめ VPS(仮想専用サーバー)は OS から選ぶべし
▶︎ Ubuntu を手軽に使える VPS おすすめ 7 選

2. 独自ドメインの取得

サイト公開用の独自ドメインを取得します。こちらもさくらのドメインで取得しました。

3. IP アドレスとドメイン名を紐付け

VPS コントロールパネルの「ネームサーバ登録」をクリックします。

遷移先のページで「ドメインリスト」をクリック後、対象のドメインの「ゾーン編集」をクリックし、情報を登録します。

ゾーン情報の設定に関しては下記の記事にもまとめているので参考にしてみてください。

4. OS (Ubuntu 20.04) のインストール

VPS コントロールパネルの「各種設定」そして「OSインストール」をクリックします。

今回は標準 OS の Ubuntu 20.04 をインストールします。

サーバーのファイアウォールを設定する代わりに、さくら VPS のパケットフィルタの機能でポートの開閉を設定しています。

ファイアウォールで設定する場合はパケットフィルタをオフにします。

「インストールを実行する」をクリックし、Ubuntu のインストールを開始します。

先ほどと重複しますが、Ubuntu 以外にも Django におすすめの OS を下記の記事で紹介しているのでもしよければ見てみてください。

▶︎ Django におすすめの OS と VPS の選び方

5. Ubuntu の初期設定

ssh でサーバーへ接続

ターミナルで「ssh 管理ユーザー名@ホスト名」と打ち込み接続します。ホスト名は下記の通りコントロールパネルの「ネットワーク情報」タブで確認できます。

下記の様にコマンド「ssh 管理ユーザー名@ホスト名」を入力します。

% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp

初めて接続する際に下記の様に「The authenticity of host ‘xx1-234-56789.vs.sakura.ne.jp (123.456.78.90)’ can’t be established.」とメッセージが出ることがありますが特に問題ないので yes と打ち込みます。

The authenticity of host 'xx1-234-56789.vs.sakura.ne.jp (123.456.78.90)' can't be established.
ECDSA key fingerprint is XXX123:ABCDEFGHIJKLMNOPQRSTUVWXYZ.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'xx1-234-56789.vs.sakura.ne.jp.123.456.78.90' (ECDSA) to the list of known hosts.
% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp
ubuntu@xx1-234-56789.vs.sakura.ne.jp's password: 

パスワードを入力し無事 ssh で サーバーへログインできました。

% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp
ubuntu@xx1-234-56789.vs.sakura.ne.jp's password: 
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-52-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Apr  9 08:11:04 JST 2021

  System load:  0.0               Processes:             105
  Usage of /:   2.0% of 94.43GB   Users logged in:       0
  Memory usage: 16%               IPv4 address for ens3: 123.456.78.90
  Swap usage:   0%


66 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


SAKURA internet [Virtual Private Server SERVICE]

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@xx1-234-56789:~$ 

3行目に「Welcome to Ubuntu 20.04.1 LTS」と書かれてあります。それ以降の部分はサーバーの容量やアップデートなどの案内事項です。

非 root ユーザーの作成

ログインしたユーザーを root ユーザーへ昇格し、新たな sudo ユーザーを作成します。詳しくは下記の記事を参照してください。

パッケージリストを最新版へ更新

コマンド「sudo apt update」でパッケージリストを最新版に更新します。

ubuntu@xx1-234-56789:~$ sudo apt update
ubuntu@xx1-234-56789:~$ 

パッケージのアップグレード

コマンド「sudo apt upgrade」を実行し、サーバーに元々インストールされているパッケージに対してアップグレードを実施します。

ubuntu@xx1-234-56789:~$ sudo apt upgrade
ubuntu@xx1-234-56789:~$ 

サーバーの再起動

コマンド「sudo reboot」を実行し、サーバーを再起動します。

ubuntu@xx1-234-56789:~$ sudo reboot
Connection to xx1-234-56789.vs.sakura.ne.jp closed by remote host.
Connection to xx1-234-56789.vs.sakura.ne.jp closed.
% 

6. FTP サーバーのインストール

FTP 接続ができる様にしたいので vsftpd をインストールします。コマンド「sudo apt install vsftpd」を実行します。

ubuntu@ik1-437-50827:~$ sudo apt install vsftpd
ubuntu@ik1-437-50827:~$ 

Cyberduck で接続できました。

7. 開発パッケージのインストール

adminvps@xx1-234-56789:~$ sudo apt install build-essential
adminvps@xx1-234-56789:~$ 

8. Python と関連パッケージのインストール

コマンド「python3 -V」で Ubuntu 20.04 にもともと入っている Python のバージョンを確認します。

adminvps@xx1-234-56789:~$ python3 -V
Python 3.8.5
adminvps@xx1-234-56789:~$

Python 3.8.5 が入っていました。この後 Python 3.9 をインストールします。

依存関係のインストール

Python 自体をインストールする前に必要な依存関係をインストールします。コマンド「sudo apt install 〜」で様々なパッケージをインストールします。

adminvps@xx1-234-56789:~$ sudo apt install zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
adminvps@xx1-234-56789:~$ 

Python 3.9 のインストール

依存関係のインストールが完了したら、Python 3.9 をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install python3.9
adminvps@xx1-234-56789:~$ 

python3.9-dev のインストール

adminvps@xx1-234-56789:~$ sudo apt install python3.9-dev
adminvps@xx1-234-56789:~$ 

仮想環境(venv)のインストール

Python の仮想環境である venv をインストールするためコマンド「sudo apt-get install python3.9-venv」を実行します。

adminvps@xx1-234-56789:~$ sudo apt-get install python3.9-venv
adminvps@xx1-234-56789:~$ 

9. Web サーバー(Nginx)のインストール

コマンド「sudo apt install nginx」で Nginx をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install nginx
adminvps@xx1-234-56789:~$ 

ブラウザの URL バーにサーバーの IP アドレスを入れてみて、下記のページが出れば無事インストールされています。

とりあえず VPS に Ubuntu が入りPython と Nginx がインストールされた状態です。

他の行程へ

▶︎まずは2週間無料でお試し♪さくらのVPS

【Django】独自 ID の自動インクリメントが行われていなかった

問題

Django でモデルを扱う際、デフォルトで作成される id ではないプライマリキーで管理をしたかったので、なんとなくネットでささっと見た情報で 「models.AutoField(primary_key=True)」を設定していました。

ただ、データベース上での設定が正しくできていなかった様で自動インクリメントが機能していませんでした。

そのため Django の admin 画面からデータを登録する際、すでに存在する値が id として登録されていました。

ちなみに、models.py では「models.AutoField(primary_key=True)」となっていたもののテーブル上ではカラムがプライマリキーになっていなかったため、エラーにもなっていませんでした。

修正作業

この時点でのテーブルは下記の状態。「id」カラムを修正していきます。

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+-------+
| Field             | Type                     | Null | Key | Default | Extra |
+-------------------+--------------------------+------+-----+---------+-------+
| id                | int(6) unsigned zerofill | NO   |     | 000000  |       |
| product_nm        | varchar(60)              | YES  |     | NULL    |       |
| product_category  | varchar(20)              | YES  |     | NULL    |       |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |       |
| product_url       | text                     | YES  |     | NULL    |       |
| product_image_url | text                     | YES  |     | NULL    |       |
+-------------------+--------------------------+------+-----+---------+-------+

プライマリキーとして設定

既存の値が再度使われてしまうのはおかしいので MySQL 上でプライマリキーを設定。

mysql> alter table ig_mst_brand add primary key (id);

値の重複の解決

admin 画面からレコードを追加すると「1062, “Duplicate entry ‘000000’ for key ‘ig_mst_product.PRIMARY'”」という感じで値の重複が発生。

「000000」を id として使用しようとしているので、おそらく値の自動インクレメントがされていない状態

デフォルト値の設定削除

デフォルト値として「000000」を設定していたのでとりあえずなくしてみます。

mysql> alter table ig_mst_product alter id drop default;

auto_increment の設定

その上で MySQL でカラムに auto_increment を設定しようとしたところ、また値の重複で拒否されました。

mysql> alter table テーブル名 modify カラム名 int(6) unsigned zerofill not null auto_increment;
ERROR 1062 (23000): ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '000001' for key 'テーブル名.PRIMARY'

この時点で id カラムには「000000」〜「000069」まで存在していたにもかかわらず、なぜか「000001」を使おうとして重複エラーが返ってきている状況。

調べてみたところ、既存データの対象のカラムの中に 0 もしくは -1 以下の値が入っているとこのエラーになる様です。既存データで「000000」が存在したのでこれを別の値に変更して再度実行したら成功しました。

mysql> alter table ig_mst_product modify id int(6) unsigned zerofill not null auto_increment;
Query OK, 69 rows affected, 2 warnings (0.04 sec)
Records: 69  Duplicates: 0  Warnings: 2

正しい設定をまとめると…

Id として使用するカラムがデータベース上で下記の条件を満たす必要がある様です。

  • デフォルト値なし
  • プライマリキーとして設定
  • AUTO_INCREMENT を設定
    • 既存データで 0 もしくはそれ以下の値が入っていないことを確認

一応 Before / After も載せておきます。Key, Default, Extra が変わっています。

Before

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+-------+
| Field             | Type                     | Null | Key | Default | Extra |
+-------------------+--------------------------+------+-----+---------+-------+
| id                | int(6) unsigned zerofill | NO   |     | 000000  |       |
| product_nm        | varchar(60)              | YES  |     | NULL    |       |
| product_category  | varchar(20)              | YES  |     | NULL    |       |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |       |
| product_url       | text                     | YES  |     | NULL    |       |
| product_image_url | text                     | YES  |     | NULL    |       |
+-------------------+--------------------------+------+-----+---------+-------+

After

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+----------------+
| Field             | Type                     | Null | Key | Default | Extra          |
+-------------------+--------------------------+------+-----+---------+----------------+
| id                | int(6) unsigned zerofill | NO   | PRI | NULL    | auto_increment |
| product_nm        | varchar(60)              | YES  |     | NULL    |                |
| product_category  | varchar(20)              | YES  |     | NULL    |                |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |                |
| product_url       | text                     | YES  |     | NULL    |                |
| product_image_url | text                     | YES  |     | NULL    |                |
+-------------------+--------------------------+------+-----+---------+----------------+

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.
$