形態素解析システムMeCab0.95の導入
0.改訂履歴
- 2007.04.25 新規作成
- 2007.06.11 追記
1.はじめに
このドキュメントでは,形態素解析システムであるMeCabの導入手順を説明する. MeCabは茶筅と同じIPA品詞体系の辞書を使っているが,その動作が3〜4倍早いと言われている. インストールの手順としては,MeCab本体,IPA辞書の入手からコンパイル&インストール,PHPへphpize等を利用してのライブラリ追加,PHPでの動作確認を行う.
なお,使用しているOSは,RedHat Linux ES上で稼働している.
2.MeCab本体のインストール
- インストール用のディレクトリを作成する.
[root@apollo root]# mkdir -p /usr/local/srfc/senna [root@apollo root]# cd /usr/local/srfc/senna [root@apollo senna]# |
- モジュールを取得する.
[root@apollo senna]# wget http://downloads.sourceforge.net/mecab/mecab-0.95.tar. gz --15:12:16-- http://downloads.sourceforge.net/mecab/mecab-0.95.tar.gz => `mecab-0.95.tar.gz' Resolving downloads.sourceforge.net... 66.35.250.203 Connecting to downloads.sourceforge.net|66.35.250.203|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://nchc.dl.sourceforge.net/sourceforge/mecab/mecab-0.95.tar.gz [ following] --15:12:16-- http://nchc.dl.sourceforge.net/sourceforge/mecab/mecab-0.95.tar. gz => `mecab-0.95.tar.gz' Resolving nchc.dl.sourceforge.net... 211.79.61.10, 2001:e10:5c00:1::10 Connecting to nchc.dl.sourceforge.net|211.79.61.10|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1,385,805 (1.3M) [application/x-gzip] 100%[========================================================================= ========>] 1,385,805 483.06K/s 15:12:19 (481.49 KB/s) - `mecab-0.95.tar.gz' saved [1385805/1385805] [root@apollo senna]# |
- ファイルを展開する.
[root@apollo senna]# tar xfz mecab-0.95.tar.gz [root@apollo senna]# |
- ディレクトリの中身を確認する.
[root@apollo senna]# cd mecab-0.95 [root@apollo mecab-0.95]# ls -la total 1608 drwxrwxrwx 8 1000 1000 4096 Mar 12 00:44 . drwxr-sr-x 3 root root 4096 Apr 25 15:14 .. -rw-r--r-- 1 1000 1000 28 Jan 29 00:09 AUTHORS -rw-r--r-- 1 1000 1000 1602 Jan 29 22:06 BSD -rw-r--r-- 1 1000 1000 240 Jan 29 00:09 COPYING -rw-r--r-- 1 1000 1000 0 Jan 29 00:09 ChangeLog -rw-r--r-- 1 1000 1000 18009 Jan 29 00:09 GPL -rw-r--r-- 1 1000 1000 7831 Jan 29 00:09 INSTALL -rw-r--r-- 1 1000 1000 26428 Jan 29 00:09 LGPL -rw-r--r-- 1 1000 1000 2701 Mar 12 00:27 Makefile.am -rw-r--r-- 1 1000 1000 16346 Mar 12 00:31 Makefile.in -rw-r--r-- 1 1000 1000 995 Mar 5 09:56 Makefile.train -rw-r--r-- 1 1000 1000 0 Jan 29 00:09 NEWS -rw-r--r-- 1 1000 1000 19 Jan 29 00:09 README -rw-r--r-- 1 1000 1000 274719 Mar 12 00:31 aclocal.m4 -rwxr-xr-x 1 1000 1000 44073 Jun 20 2006 config.guess -rw-r--r-- 1 1000 1000 3694 Jan 29 21:42 config.h.in -rwxr-xr-x 1 1000 1000 32344 Jun 20 2006 config.sub -rwxr-xr-x 1 1000 1000 888916 Mar 12 00:31 configure -rw-r--r-- 1 1000 1000 6531 Mar 7 23:05 configure.in drwxrwxrwx 3 1000 1000 4096 Mar 12 00:44 doc drwxr-xr-x 2 1000 1000 4096 Mar 12 00:44 example -rw-r--r-- 1 1000 1000 5569 Jan 29 00:09 install-sh -rw-r--r-- 1 1000 1000 196719 Jun 20 2006 ltmain.sh drwxrwxrwx 2 1000 1000 4096 Mar 12 00:44 man -rw-r--r-- 1 1000 1000 1624 Jan 29 00:09 mecab-config.in -rwxr-xr-x 1 1000 1000 2855 Jan 31 10:22 mecab.iss.in -rw-r--r-- 1 1000 1000 293 Jan 29 00:09 mecabrc.in -rw-r--r-- 1 1000 1000 10270 Jan 29 00:09 missing -rw-r--r-- 1 1000 1000 1801 Jan 29 00:09 mkinstalldirs drwxrwxrwx 2 1000 1000 4096 Mar 12 00:44 src -rw-r--r-- 1 1000 1000 10 Mar 12 00:32 stamp-h.in drwxr-xr-x 2 1000 1000 4096 Mar 12 00:44 swig drwxrwxrwx 11 1000 1000 4096 Mar 12 00:44 tests [root@apollo mecab-0.95]# |
- configureを行う.
[root@apollo mecab-0.95]# ./configure 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... found checking for working autoconf... found checking for working automake-1.4... found checking for working autoheader... found checking for working makeinfo... found checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... 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 g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking whether gcc needs -traditional... no checking whether make sets $(MAKE)... (cached) yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a sed that does not truncate output... /bin/sed checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all 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 dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking how to run the C++ preprocessor... g++ -E checking for g77... g77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld) 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 configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for g77 option to produce PIC... -fPIC checking if g77 PIC flag -fPIC works... yes checking if g77 static flag -static works... yes checking if g77 supports -c -o file.o... yes checking whether the g77 linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for library containing strerror... none required checking host system type... (cached) i686-pc-linux-gnu checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for shared library run path origin... ./config.rpath: ./config.rpath: No such file or directory done checking for 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 setjmp.h usability... yes checking setjmp.h presence... yes checking for setjmp.h... yes checking for off_t... yes checking for size_t... yes checking for char... yes checking size of char... 1 checking for short... yes checking size of short... 2 checking for int... yes checking size of int... 4 checking for long... yes checking size of long... 4 checking for long long... yes checking size of long long... 8 checking for size_t... (cached) yes checking size of size_t... 4 checking for size_t... (cached) yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for getpagesize... yes checking for working mmap... yes checking for main in -lstdc++... yes checking for pthread_create in -lpthread... yes checking for pthread_join in -lpthread... yes checking for pthread_mutex_lock in -lpthread... yes checking for iconv_open in -liconv... no checking for getenv... yes checking for opendir... yes checking for setjmp... yes checking whether make is GNU Make... 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++ environment provides all required features... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating src/Makefile.msvc config.status: creating man/Makefile config.status: creating doc/Makefile config.status: creating tests/Makefile config.status: creating swig/version.h config.status: creating mecab.iss config.status: creating mecab-config config.status: creating mecabrc config.status: creating config.h config.status: executing default-1 commands config.status: executing default commands [root@apollo mecab-0.95]# |
- configureが成功したようなので,makeを行う.
[root@apollo mecab-0.95]# make make all-recursive make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95' Making all in src make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/src' /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c utils.cpp mkdir .libs g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c utils.cpp -fPIC -DPIC -o . libs/utils.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c utils.cpp -o utils.o >/dev/ null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c eval.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c eval.cpp -fPIC -DPIC -o . libs/eval.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c eval.cpp -o eval.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c iconv_utils.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c iconv_utils.cpp -fPIC -DPIC -o .libs/iconv_utils.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c iconv_utils.cpp -o iconv_ utils.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c dictionary_rewriter.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_rewriter.cpp - fPIC -DPIC -o .libs/dictionary_rewriter.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_rewriter.cpp -o dictionary_rewriter.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c dictionary_generator.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_generator.cpp - fPIC -DPIC -o .libs/dictionary_generator.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_generator.cpp -o dictionary_generator.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c dictionary_compiler.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_compiler.cpp - fPIC -DPIC -o .libs/dictionary_compiler.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary_compiler.cpp -o dictionary_compiler.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c context_id.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c context_id.cpp -fPIC -DPIC - o .libs/context_id.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c context_id.cpp -o context_id. o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c connector.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c connector.cpp -fPIC -DPIC -o .libs/connector.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c connector.cpp -o connector.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c nbest_generator.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c nbest_generator.cpp -fPIC - DPIC -o .libs/nbest_generator.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c nbest_generator.cpp -o nbest_ generator.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c writer.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c writer.cpp -fPIC -DPIC -o . libs/writer.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c writer.cpp -o writer.o >/dev/ null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c string_buffer.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c string_buffer.cpp -fPIC - DPIC -o .libs/string_buffer.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c string_buffer.cpp -o string_ buffer.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c viterbi.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c viterbi.cpp -fPIC -DPIC -o . libs/viterbi.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c viterbi.cpp -o viterbi.o >/ dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c param.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c param.cpp -fPIC -DPIC -o . libs/param.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c param.cpp -o param.o >/dev/ null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c tokenizer.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c tokenizer.cpp -fPIC -DPIC -o .libs/tokenizer.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c tokenizer.cpp -o tokenizer.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c char_property.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c char_property.cpp -fPIC - DPIC -o .libs/char_property.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c char_property.cpp -o char_ property.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c tagger.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c tagger.cpp -fPIC -DPIC -o . libs/tagger.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c tagger.cpp -o tagger.o >/dev/ null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c dictionary.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary.cpp -fPIC -DPIC - o .libs/dictionary.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c dictionary.cpp -o dictionary. o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c feature_index.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c feature_index.cpp -fPIC - DPIC -o .libs/feature_index.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c feature_index.cpp -o feature_ index.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c lbfgs.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c lbfgs.c -fPIC -DPIC -o .libs /lbfgs.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c lbfgs.c -o lbfgs.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c learner_tagger.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c learner_tagger.cpp -fPIC - DPIC -o .libs/learner_tagger.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c learner_tagger.cpp -o learner _tagger.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c learner.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c learner.cpp -fPIC -DPIC -o . libs/learner.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c learner.cpp -o learner.o >/ dev/null 2>&1 /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_ VERSION=102 -DMECAB_DEFAULT_RC="¥"/usr/local/etc/mecabrc¥"" -O3 -Wall - Wno-deprecated -c libmecab.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c libmecab.cpp -fPIC -DPIC -o . libs/libmecab.o g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC=¥"/usr/ local/etc/mecabrc¥" -O3 -Wall -Wno-deprecated -c libmecab.cpp -o libmecab.o >/ dev/null 2>&1 /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o libmecab.la -rpath /usr/local/lib -no-undefined -version-info 1:0:0 utils.lo eval.lo iconv _utils.lo dictionary_rewriter.lo dictionary_generator.lo dictionary_compiler. lo context_id.lo connector.lo nbest_generator.lo writer.lo string_buffer.lo viterbi.lo param.lo tokenizer.lo char_property.lo tagger.lo dictionary.lo feature_index.lo lbfgs.lo learner_tagger.lo learner.lo libmecab.lo -lpthread -lpthread -lpthread -lstdc++ g++ -shared -nostdlib /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/crtbeginS.o .libs/utils.o .libs/eval. o .libs/iconv_utils.o .libs/dictionary_rewriter.o .libs/dictionary_generator.o .libs/dictionary_compiler.o .libs/context_id.o .libs/connector.o .libs/nbest_ generator.o .libs/writer.o .libs/string_buffer.o .libs/viterbi.o .libs/param.o .libs/tokenizer.o .libs/char_property.o .libs/tagger.o .libs/dictionary.o . libs/feature_index.o .libs/lbfgs.o .libs/learner_tagger.o .libs/learner.o . libs/libmecab.o -lpthread -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -L/usr/ lib/gcc-lib/i386-redhat-linux/3.2.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib /gcc-lib/i386-redhat-linux/3.2.3/crtendS.o /usr/lib/gcc-lib/i386-redhat-linux/ 3.2.3/../../../crtn.o -Wl,-soname -Wl,libmecab.so.1 -o .libs/libmecab.so.1.0. 0 (cd .libs && rm -f libmecab.so.1 && ln -s libmecab.so.1.0.0 libmecab.so.1) (cd .libs && rm -f libmecab.so && ln -s libmecab.so.1.0.0 libmecab.so) ar cru .libs/libmecab.a utils.o eval.o iconv_utils.o dictionary_rewriter.o dictionary_generator.o dictionary_compiler.o context_id.o connector.o nbest_ generator.o writer.o string_buffer.o viterbi.o param.o tokenizer.o char_ property.o tagger.o dictionary.o feature_index.o lbfgs.o learner_tagger.o learner.o libmecab.o ranlib .libs/libmecab.a creating libmecab.la (cd .libs && rm -f libmecab.la && ln -s ../libmecab.la libmecab.la) g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab mecab. o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab mecab.o ./.libs/libmecab.so - lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab-dict-index.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab-dict- index mecab-dict-index.o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab-dict-index mecab-dict-index.o ./. libs/libmecab.so -lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab-dict-index g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab-dict-gen.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab-dict- gen mecab-dict-gen.o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab-dict-gen mecab-dict-gen.o ./. libs/libmecab.so -lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab-dict-gen g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab-cost-train.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab-cost- train mecab-cost-train.o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab-cost-train mecab-cost-train.o ./. libs/libmecab.so -lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab-cost-train g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab-system-eval.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab-system -eval mecab-system-eval.o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab-system-eval mecab-system-eval.o . /.libs/libmecab.so -lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab-system-eval g++ -DHAVE_CONFIG_H -I. -I. -I.. -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="¥"/ usr/local/etc/mecabrc¥"" -O3 -Wall -Wno-deprecated -c mecab-test-gen.cpp /bin/sh ../libtool --mode=link g++ -O3 -Wall -Wno-deprecated -o mecab-test- gen mecab-test-gen.o libmecab.la -lpthread -lpthread -lpthread -lstdc++ g++ -O3 -Wall -Wno-deprecated -o .libs/mecab-test-gen mecab-test-gen.o ./. libs/libmecab.so -lpthread -lstdc++ -Wl,--rpath -Wl,/usr/local/lib creating mecab-test-gen make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/src' Making all in man make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/man' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/man' Making all in doc make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/doc' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/doc' Making all in tests make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/tests' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/tests' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95' make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95' [root@apollo mecab-0.95]# |
- makeは成功したように見える.
- その内容をチェックする.
[root@apollo mecab-0.95]# make check Making check in src make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/src' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/src' Making check in man make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/man' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/man' Making check in doc make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/doc' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/doc' Making check in tests make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/tests' make check-TESTS make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/tests' reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 177 emitting double-array: 100% |###########################################| reading ./matrix.def ... 178x178 emitting matrix : 100% |###########################################| done! reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 83 emitting double-array: 100% |###########################################| reading ./matrix.def ... 84x84 emitting matrix : 100% |###########################################| done! reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 450 emitting double-array: 100% |###########################################| reading ./matrix.def ... 1x1 done! reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 162 emitting double-array: 100% |###########################################| reading ./matrix.def ... 3x3 emitting matrix : 100% |###########################################| done! reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 4 emitting double-array: 100% |###########################################| reading ./matrix.def ... 1x1 done! reading ./unk.def ... 11 emitting double-array: 100% |###########################################| reading ./dic.csv ... 1 reading ./matrix.def ... 1x1 done! reading ./unk.def ... 2 emitting double-array: 100% |###########################################| reading ./dic.csv ... 1 reading ./matrix.def ... 1x1 done! PASS: run-dics.sh PASS: run-eval.sh mkdir: cannot create directory `model-ipadic.c1.0.f1.dic': File exists reading seed/unk.def ... 40 emitting double-array: 100% |###########################################| reading seed/dic.csv ... 4335 emitting double-array: 100% |###########################################| reading seed/matrix.def ... 1x1 done! reading seed/dic.csv ... Done! reading seed/unk.def ... 40 reading seed/dic.csv ... 4335 emitting model-ipadic.c1.0.f1.dic/left-id.def/ model-ipadic.c1.0.f1.dic/right- id.def emitting model-ipadic.c1.0.f1.dic/unk.def ... 40 emitting model-ipadic.c1.0.f1.dic/dic.csv ... 4335 emitting matrix : 100% |###########################################| copying seed/char.def to model-ipadic.c1.0.f1.dic/char.def copying seed/rewrite.def to model-ipadic.c1.0.f1.dic/rewrite.def copying seed/dicrc to model-ipadic.c1.0.f1.dic/dicrc done! reading model-ipadic.c1.0.f1.dic/unk.def ... 40 emitting double-array: 100% |###########################################| reading model-ipadic.c1.0.f1.dic/dic.csv ... 4335 emitting double-array: 100% |###########################################| reading model-ipadic.c1.0.f1.dic/matrix.def ... 162x234 emitting matrix : 100% |###########################################| done! precision recall F LEVEL 0: 12.0181(53/441) 11.0647(53/479) 11.5217 LEVEL 1: 10.4308(46/441) 9.6033(46/479) 10.0000 LEVEL 2: 9.9773(44/441) 9.1858(44/479) 9.5652 LEVEL 4: 9.9773(44/441) 9.1858(44/479) 9.5652 reading seed/unk.def ... 40 emitting double-array: 100% |###########################################| reading seed/dic.csv ... 4335 emitting double-array: 100% |###########################################| reading seed/matrix.def ... 1x1 done! reading corpus ... Number of sentences: 34 Number of features: 64108 eta: 0.00100 freq: 1 threads: 1 C(sigma^2): 1.00000 iter=0 err=1.00000 F=0.35771 target=2406.28355 diff=1.00000 iter=1 err=0.97059 F=0.65652 target=1484.25231 diff=0.38318 iter=2 err=0.91176 F=0.79331 target=863.32765 diff=0.41834 iter=3 err=0.85294 F=0.89213 target=596.72480 diff=0.30881 iter=4 err=0.61765 F=0.95467 target=336.30744 diff=0.43641 iter=5 err=0.50000 F=0.96702 target=246.53039 diff=0.26695 iter=6 err=0.35294 F=0.95472 target=188.93963 diff=0.23361 iter=7 err=0.20588 F=0.99106 target=168.62665 diff=0.10751 iter=8 err=0.05882 F=0.99777 target=158.64865 diff=0.05917 iter=9 err=0.08824 F=0.99665 target=154.14530 diff=0.02839 iter=10 err=0.08824 F=0.99665 target=151.94257 diff=0.01429 iter=11 err=0.02941 F=0.99888 target=147.20825 diff=0.03116 iter=12 err=0.00000 F=1.00000 target=147.34956 diff=0.00096 iter=13 err=0.02941 F=0.99888 target=146.32592 diff=0.00695 iter=14 err=0.00000 F=1.00000 target=145.77299 diff=0.00378 iter=15 err=0.02941 F=0.99888 target=145.24641 diff=0.00361 iter=16 err=0.00000 F=1.00000 target=144.96490 diff=0.00194 iter=17 err=0.02941 F=0.99888 target=144.90246 diff=0.00043 iter=18 err=0.00000 F=1.00000 target=144.75959 diff=0.00099 iter=19 err=0.00000 F=1.00000 target=144.71727 diff=0.00029 Done! writing model file ... reading seed/unk.def ... 40 reading seed/dic.csv ... 4335 emitting model-ipadic.c1.0.f1.dic/left-id.def/ model-ipadic.c1.0.f1.dic/right- id.def emitting model-ipadic.c1.0.f1.dic/unk.def ... 40 emitting model-ipadic.c1.0.f1.dic/dic.csv ... 4335 emitting matrix : 100% |###########################################| copying seed/char.def to model-ipadic.c1.0.f1.dic/char.def copying seed/rewrite.def to model-ipadic.c1.0.f1.dic/rewrite.def copying seed/dicrc to model-ipadic.c1.0.f1.dic/dicrc copying seed/feature.def to model-ipadic.c1.0.f1.dic/feature.def done! reading model-ipadic.c1.0.f1.dic/unk.def ... 40 emitting double-array: 100% |###########################################| reading model-ipadic.c1.0.f1.dic/dic.csv ... 4335 emitting double-array: 100% |###########################################| reading model-ipadic.c1.0.f1.dic/matrix.def ... 346x346 emitting matrix : 100% |###########################################| done! precision recall F LEVEL 0: 12.8959(57/442) 11.8998(57/479) 12.3779 LEVEL 1: 12.2172(54/442) 11.2735(54/479) 11.7264 LEVEL 2: 11.7647(52/442) 10.8559(52/479) 11.2921 LEVEL 4: 11.7647(52/442) 10.8559(52/479) 11.2921 PASS: run-cost-train.sh ================== All 3 tests passed ================== make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/tests' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/tests' make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95' [root@apollo mecab-0.95]# |
- テストは完了した模様.
- 引き続きインストールを行う.
[root@apollo mecab-0.95]# make install Making install in src make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/src' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/src' /bin/sh ../mkinstalldirs /usr/local/lib /bin/sh ../libtool --mode=install /usr/bin/install -c libmecab.la /usr/local/ lib/libmecab.la /usr/bin/install -c .libs/libmecab.so.1.0.0 /usr/local/lib/libmecab.so.1.0.0 (cd /usr/local/lib && { ln -s -f libmecab.so.1.0.0 libmecab.so.1 || { rm -f libmecab.so.1 && ln -s libmecab.so.1.0.0 libmecab.so.1; }; }) (cd /usr/local/lib && { ln -s -f libmecab.so.1.0.0 libmecab.so || { rm -f libmecab.so && ln -s libmecab.so.1.0.0 libmecab.so; }; }) /usr/bin/install -c .libs/libmecab.lai /usr/local/lib/libmecab.la /usr/bin/install -c .libs/libmecab.a /usr/local/lib/libmecab.a chmod 644 /usr/local/lib/libmecab.a ranlib /usr/local/lib/libmecab.a PATH="$PATH:/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. ---------------------------------------------------------------------- /bin/sh ../mkinstalldirs /usr/local/bin /bin/sh ../libtool --mode=install /usr/bin/install -c mecab /usr/local/bin/ mecab /usr/bin/install -c .libs/mecab /usr/local/bin/mecab /bin/sh ../mkinstalldirs /usr/local/libexec/mecab mkdir -p -- /usr/local/libexec/mecab /bin/sh ../libtool --mode=install /usr/bin/install -c mecab-dict-index /usr /local/libexec/mecab/mecab-dict-index /usr/bin/install -c .libs/mecab-dict-index /usr/local/libexec/mecab/mecab-dict -index /bin/sh ../libtool --mode=install /usr/bin/install -c mecab-dict-gen /usr/ local/libexec/mecab/mecab-dict-gen /usr/bin/install -c .libs/mecab-dict-gen /usr/local/libexec/mecab/mecab-dict- gen /bin/sh ../libtool --mode=install /usr/bin/install -c mecab-cost-train /usr /local/libexec/mecab/mecab-cost-train /usr/bin/install -c .libs/mecab-cost-train /usr/local/libexec/mecab/mecab-cost -train /bin/sh ../libtool --mode=install /usr/bin/install -c mecab-system-eval / usr/local/libexec/mecab/mecab-system-eval /usr/bin/install -c .libs/mecab-system-eval /usr/local/libexec/mecab/mecab- system-eval /bin/sh ../libtool --mode=install /usr/bin/install -c mecab-test-gen /usr/ local/libexec/mecab/mecab-test-gen /usr/bin/install -c .libs/mecab-test-gen /usr/local/libexec/mecab/mecab-test- gen /bin/sh ../mkinstalldirs /usr/local/include /usr/bin/install -c -m 644 mecab.h /usr/local/include/mecab.h make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/src' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/src' Making install in man make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/man' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/man' make[2]: Nothing to be done for `install-exec-am'. make install-man1 make[3]: Entering directory `/usr/local/srfc/senna/mecab-0.95/man' /bin/sh ../mkinstalldirs /usr/local/share/man/man1 /usr/bin/install -c -m 644 ./mecab.1 /usr/local/share/man/man1/mecab.1 make[3]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/man' make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/man' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/man' Making install in doc make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/doc' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/doc' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/doc' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/doc' Making install in tests make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95/tests' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95/tests' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/tests' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95/tests' make[1]: Entering directory `/usr/local/srfc/senna/mecab-0.95' make[2]: Entering directory `/usr/local/srfc/senna/mecab-0.95' /bin/sh ./mkinstalldirs /usr/local/bin /usr/bin/install -c mecab-config /usr/local/bin/mecab-config /bin/sh ./mkinstalldirs /usr/local/etc /usr/bin/install -c -m 644 ./mecabrc /usr/local/etc/mecabrc make[2]: Leaving directory `/usr/local/srfc/senna/mecab-0.95' make[1]: Leaving directory `/usr/local/srfc/senna/mecab-0.95' [root@apollo mecab-0.95]# |
- /usr/local/bin/mecabにインストールされた模様.
- これで完了.
3.辞書のインストール
- ディレクトリを移動する.
[root@apollo mecab-0.95]# cd .. [root@apollo senna]# |
- モジュールを取得する.
[root@apollo senna]# wget http://downloads.sourceforge.net/mecab/mecab-ipadic-2. 7.0-20060707.tar.gz --15:12:43-- http://downloads.sourceforge.net/mecab/mecab-ipadic-2.7.0-200607 07.tar.gz => `mecab-ipadic-2.7.0-20060707.tar.gz' Resolving downloads.sourceforge.net... 66.35.250.203 Connecting to downloads.sourceforge.net|66.35.250.203|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://nchc.dl.sourceforge.net/sourceforge/mecab/mecab-ipadic-2.7.0- 20060707.tar.gz [following] --15:12:43-- http://nchc.dl.sourceforge.net/sourceforge/mecab/mecab-ipadic-2. 7.0-20060707.tar.gz => `mecab-ipadic-2.7.0-20060707.tar.gz' Resolving nchc.dl.sourceforge.net... 211.79.61.10, 2001:e10:5c00:1::10 Connecting to nchc.dl.sourceforge.net|211.79.61.10|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 12,025,605 (11M) [application/x-gzip] 100%[========================================================================= ========>] 12,025,605 555.70K/s ETA 00:00 15:13:05 (541.83 KB/s) - `mecab-ipadic-2.7.0-20060707.tar.gz' saved [12025605/ 12025605] [root@apollo senna]# |
- アーカイブを展開して中身を確認する.
[root@apollo senna]# tar xfz mecab-ipadic-2.7.0-20060707.tar.gz [root@apollo senna]# cd mecab-ipadic-2.7.0-20060707 [root@apollo mecab-ipadic-2.7.0-20060707]# ls AUTHORS Noun.adjv.csv Postp.csv feature.def Adj.csv Noun.adverbal.csv Prefix.csv install-sh Adnominal.csv Noun.csv README left-id.def Adverb.csv Noun.demonst.csv RESULT matrix.def Auxil.csv Noun.nai.csv Suffix.csv mecab-ipadic.spec.in COPYING Noun.name.csv Symbol.csv missing ChangeLog Noun.number.csv Verb.csv mkinstalldirs Conjunction.csv Noun.org.csv aclocal.m4 pos-id.def Filler.csv Noun.others.csv char.def rewrite.def INSTALL Noun.place.csv config.guess right-id.def Interjection.csv Noun.proper.csv config.sub unk.def Makefile.am Noun.verbal.csv configure Makefile.in Others.csv configure.in NEWS Postp-col.csv dicrc [root@apollo mecab-ipadic-2.7.0-20060707]# |
- configureを行う.
[root@apollo mecab-ipadic-2.7.0-20060707]# ./configure --with-charset=sjis 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... found checking for working autoconf... found checking for working automake-1.4... found checking for working autoheader... found checking for working makeinfo... found checking for a BSD-compatible install... /usr/bin/install -c checking for mecab-config... /usr/local/bin/mecab-config configure: creating ./config.status config.status: creating Makefile config.status: creating mecab-ipadic.spec [root@apollo mecab-ipadic-2.7.0-20060707]# |
- makeを行う.
[root@apollo mecab-ipadic-2.7.0-20060707]# make /usr/local/libexec/mecab/mecab-dict-index -d . -o . -f euc-jp -t sjis reading ./unk.def ... 40 emitting double-array: 100% |###########################################| reading ./Adj.csv ... 26790 reading ./Adnominal.csv ... 135 reading ./Adverb.csv ... 3024 reading ./Auxil.csv ... 199 reading ./Conjunction.csv ... 170 reading ./Filler.csv ... 19 reading ./Interjection.csv ... 252 reading ./Noun.adjv.csv ... 3310 reading ./Noun.adverbal.csv ... 772 reading ./Noun.csv ... 58793 reading ./Noun.demonst.csv ... 115 reading ./Noun.nai.csv ... 42 reading ./Noun.name.csv ... 32174 reading ./Noun.number.csv ... 41 reading ./Noun.org.csv ... 16596 reading ./Noun.others.csv ... 144 reading ./Noun.place.csv ... 67294 reading ./Noun.proper.csv ... 26121 reading ./Noun.verbal.csv ... 12041 reading ./Others.csv ... 2 reading ./Postp-col.csv ... 90 reading ./Postp.csv ... 146 reading ./Prefix.csv ... 206 reading ./Suffix.csv ... 1294 reading ./Symbol.csv ... 198 reading ./Verb.csv ... 128946 emitting double-array: 100% |###########################################| reading ./matrix.def ... 1316x1316 emitting matrix : 100% |###########################################| done! echo To enable dictionary, rewrite /usr/local/etc/mecabrc as ¥"dicrc = /usr/ local/lib/mecab/dic/ipadic¥" To enable dictionary, rewrite /usr/local/etc/mecabrc as "dicrc = /usr/local/ lib/mecab/dic/ipadic" [root@apollo mecab-ipadic-2.7.0-20060707]# |
- もし,makeでエラーが出るようであれば,/sbin/ldconfigを実行する.
- 定義ファイルを確認してみる.
[root@apollo mecab-ipadic-2.7.0-20060707]# ls -la /usr/local/etc/mecabrc -rw-r--r-- 1 root root 295 Apr 25 15:31 /usr/local/etc/mecabrc [root@apollo mecab-ipadic-2.7.0-20060707]# file /usr/local/etc/mecabrc /usr/local/etc/mecabrc: ASCII text [root@apollo mecab-ipadic-2.7.0-20060707]# cat /usr/local/etc/mecabrc ; ; Configuration file of MeCab ; ; $Id: mecabrc.in,v 1.3 2006/05/29 15:36:08 taku-ku Exp $; ; dicdir = /usr/local/lib/mecab/dic/ipadic ; userdic = /home/foo/bar/user.dic ; output-format-type = wakati ; input-buffer-size = 8192 ; node-format = %m\n ; bos-format = %S\n ; eos-format = EOS\n [root@apollo mecab-ipadic-2.7.0-20060707]# |
- 辞書のディレクトリが表示されている.
- makeとインストールを行う.
[root@apollo mecab-ipadic-2.7.0-20060707]# make install make[1]: Entering directory `/usr/local/srfc/senna/mecab-ipadic-2.7.0-20060707 ' make[1]: Nothing to be done for `install-exec-am'. /bin/sh ./mkinstalldirs /usr/local/lib/mecab/dic/ipadic mkdir /usr/local/lib/mecab mkdir /usr/local/lib/mecab/dic mkdir /usr/local/lib/mecab/dic/ipadic /usr/bin/install -c -m 644 ./matrix.bin /usr/local/lib/mecab/dic/ipadic/ matrix.bin /usr/bin/install -c -m 644 ./char.bin /usr/local/lib/mecab/dic/ipadic/char. bin /usr/bin/install -c -m 644 ./sys.dic /usr/local/lib/mecab/dic/ipadic/sys.dic /usr/bin/install -c -m 644 ./unk.dic /usr/local/lib/mecab/dic/ipadic/unk.dic /usr/bin/install -c -m 644 ./left-id.def /usr/local/lib/mecab/dic/ipadic/left -id.def /usr/bin/install -c -m 644 ./right-id.def /usr/local/lib/mecab/dic/ipadic/ right-id.def /usr/bin/install -c -m 644 ./rewrite.def /usr/local/lib/mecab/dic/ipadic/ rewrite.def /usr/bin/install -c -m 644 ./pos-id.def /usr/local/lib/mecab/dic/ipadic/pos- id.def /usr/bin/install -c -m 644 ./dicrc /usr/local/lib/mecab/dic/ipadic/dicrc make[1]: Leaving directory `/usr/local/srfc/senna/mecab-ipadic-2.7.0-20060707' [root@apollo mecab-ipadic-2.7.0-20060707]# |
- 辞書がインストールされたディレクトリを確認する.
[root@apollo mecab-ipadic-2.7.0-20060707]# ls -la /usr/local/lib/mecab/dic/ipadic total 39744 drwxr-xr-x 2 root root 4096 Apr 25 16:20 . drwxr-xr-x 3 root root 4096 Apr 25 16:20 .. -rw-r--r-- 1 root root 262496 Apr 25 16:20 char.bin -rw-r--r-- 1 root root 669 Apr 25 16:20 dicrc -rw-r--r-- 1 root root 55910 Apr 25 16:20 left-id.def -rw-r--r-- 1 root root 3463716 Apr 25 16:20 matrix.bin -rw-r--r-- 1 root root 1477 Apr 25 16:20 pos-id.def -rw-r--r-- 1 root root 6241 Apr 25 16:20 rewrite.def -rw-r--r-- 1 root root 55910 Apr 25 16:20 right-id.def -rw-r--r-- 1 root root 36757611 Apr 25 16:20 sys.dic -rw-r--r-- 1 root root 5409 Apr 25 16:20 unk.dic [root@apollo mecab-ipadic-2.7.0-20060707]# |
- 何かは行っていることが確認できた.
4.mecabを実行してみる
- コマンドラインツールを使って,mecabを実行してみる.
[root@apollo root]# /usr/local/bin/mecab 貴社の記者が汽車で帰社した 貴社 名詞,一般,*,*,*,*,貴社,キシャ,キシャ の 助詞,連体化,*,*,*,*,の,ノ,ノ 記者 名詞,一般,*,*,*,*,記者,キシャ,キシャ が 助詞,格助詞,一般,*,*,*,が,ガ,ガ 汽車 名詞,一般,*,*,*,*,汽車,キシャ,キシャ で 助詞,格助詞,一般,*,*,*,で,デ,デ 帰社 名詞,サ変接続,*,*,*,*,帰社,キシャ,キシャ し 動詞,自立,*,*,サ変・スル,連用形,する,シ,シ た 助動詞,*,*,*,特殊・タ,基本形,た,タ,タ EOS 庭野は庭の二羽の鶏 庭野 名詞,固有名詞,人名,姓,*,*,庭野,ニワノ,ニワノ は 助詞,係助詞,*,*,*,*,は,ハ,ワ 庭 名詞,一般,*,*,*,*,庭,ニワ,ニワ の 助詞,連体化,*,*,*,*,の,ノ,ノ 二 名詞,数,*,*,*,*,二,ニ,ニ 羽 名詞,接尾,助数詞,*,*,*,羽,ワ,ワ の 助詞,連体化,*,*,*,*,の,ノ,ノ 鶏 名詞,一般,*,*,*,*,鶏,ニワトリ,ニワトリ EOS [root@apollo root]# |
- 抜ける時はControl+Dを押下する.
- 解析できている模様.
5.PHP拡張モジュールのインストール
- MeCabをPHPで利用するための拡張モジュールのインストールをインストールする.
- モジュールを入手する.
[root@apollo senna]# wget http://page2.xrea.jp/pub/php_mecab-0.0.3.tgz --12:33:56-- http://page2.xrea.jp/pub/php_mecab-0.0.3.tgz => `php_mecab-0.0.3.tgz' Resolving page2.xrea.jp... 218.216.67.49 Connecting to page2.xrea.jp|218.216.67.49|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 25,470 (25K) [application/x-tar] 100%[========================================================================= ========>] 25,470 --.--K/s 12:33:56 (538.79 KB/s) - `php_mecab-0.0.3.tgz' saved [25470/25470] [root@apollo senna]# |
- アーカイブを展開してモジュールを確認する.
[root@apollo senna]# tar xfz php_mecab-0.0.3.tgz [root@apollo senna]# cd php_mecab-0.0.3 [root@apollo php_mecab-0.0.3]# ls CREDITS LICENSE config.m4 examples mecab.c php_mecab.h tests EXPERIMENTAL README config.w32 manual mecab.dsp php_mecab_private.h [root@apollo php_mecab-0.0.3]# |
- PHPの拡張モジュールをビルドするためのツール,phpizeがインストールされているか調べる.
[root@apollo php_mecab-0.0.3]# locate phpize /usr/local/bin/phpize /usr/local/lib/php/build/phpize.m4 /usr/local/man/man1/phpize.1 /www/system/InstallBin/php-5.2.0/scripts/man1/phpize.1.in /www/system/InstallBin/php-5.2.0/scripts/man1/phpize.1 /www/system/InstallBin/php-5.2.0/scripts/phpize.m4 /www/system/InstallBin/php-5.2.0/scripts/phpize.in /www/system/InstallBin/php-5.2.0/scripts/phpize [root@apollo php_mecab-0.0.3]# phpize -v Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 [root@apollo php_mecab-0.0.3]# |
- これを使うことで,PHPをソースからコンパイルする必要が無くなる.
- 実行する.
[root@apollo php_mecab-0.0.3]# phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 [root@apollo php_mecab-0.0.3]# |
- configureを実行する.
[root@apollo php_mecab-0.0.3]# ./configure --with-php-config=/usr/local/bin/php -config --with-mecab=/usr/local/bin/mecab-config checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... 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 ANSI C... none needed checking whether gcc and cc understand -c and -o together... yes checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for PHP prefix... /usr/local checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php /main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local /include/php/ext -I/usr/local/include/php/ext/date/lib checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug -non-zts-20060613 checking for PHP installed headers prefix... /usr/local/include/php checking for re2c... no configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking for MeCab support... yes, shared checking for MeCab library version... 0.95 checking how to run the C preprocessor... gcc -E 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 mecab.h usability... yes checking mecab.h presence... yes checking for mecab.h... yes checking for mecab_t *... yes checking for mecab_node_t *... yes checking for mecab_path_t *... yes checking for mecab_new2 in -lmecab... yes checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc static flag works... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld) 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... no creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes configure: creating ./config.status config.status: creating config.h [root@apollo php_mecab-0.0.3]# |
- makeを実行する.
[root@apollo php_mecab-0.0.3]# make /bin/sh /usr/local/srfc/senna/php_mecab-0.0.3/libtool --mode=compile gcc -I. -I/usr/local/srfc/senna/php_mecab-0.0.3 -DPHP_ATOM_INC -I/usr/local/srfc/senna /php_mecab-0.0.3/include -I/usr/local/srfc/senna/php_mecab-0.0.3/main -I/usr/ local/srfc/senna/php_mecab-0.0.3 -I/usr/local/include/php -I/usr/local/include /php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/ local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/ include -DHAVE_CONFIG_H -g -O2 -c /usr/local/srfc/senna/php_mecab-0.0.3/ mecab.c -o mecab.lo mkdir .libs gcc -I. -I/usr/local/srfc/senna/php_mecab-0.0.3 -DPHP_ATOM_INC -I/usr/local/ srfc/senna/php_mecab-0.0.3/include -I/usr/local/srfc/senna/php_mecab-0.0.3/ main -I/usr/local/srfc/senna/php_mecab-0.0.3 -I/usr/local/include/php -I/usr/ local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/ Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr /local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/srfc/senna/php_mecab-0.0.3 /mecab.c -fPIC -DPIC -o .libs/mecab.o /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zif_mecab_sparse_ tonode': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:867: warning: assignment discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zif_mecab_nbest_ next_tonode': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:1119: warning: assignment discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zif_mecab_node_ toarray': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:1252: warning: passing arg 4 of `add_assoc_stringl_ex' discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:1253: warning: passing arg 4 of `add_assoc_string_ex' discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zif_mecab_node_get _surface': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:1524: warning: initialization discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zif_mecab_node_get _feature': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:1543: warning: initialization discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c: In function `zim_MeCab_Node___ get': /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:2003: warning: initialization discards qualifiers from pointer target type /usr/local/srfc/senna/php_mecab-0.0.3/mecab.c:2004: warning: initialization discards qualifiers from pointer target type /bin/sh /usr/local/srfc/senna/php_mecab-0.0.3/libtool --mode=link gcc -DPHP_ ATOM_INC -I/usr/local/srfc/senna/php_mecab-0.0.3/include -I/usr/local/srfc/ senna/php_mecab-0.0.3/main -I/usr/local/srfc/senna/php_mecab-0.0.3 -I/usr/ local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/ include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -o mecab.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/ srfc/senna/php_mecab-0.0.3/modules mecab.lo -Wl,-rpath,/usr/local/lib -L/usr/ local/lib -lmecab -lstdc++ gcc -shared .libs/mecab.o -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/ usr/local/lib -L/usr/local/lib /usr/local/lib/libmecab.so -lstdc++ -Wl,-rpath -Wl,/usr/local/lib -Wl,-soname -Wl,mecab.so -o .libs/mecab.so creating mecab.la (cd .libs && rm -f mecab.la && ln -s ../mecab.la mecab.la) /bin/sh /usr/local/srfc/senna/php_mecab-0.0.3/libtool --mode=install cp ./ mecab.la /usr/local/srfc/senna/php_mecab-0.0.3/modules cp ./.libs/mecab.so /usr/local/srfc/senna/php_mecab-0.0.3/modules/mecab.so cp ./.libs/mecab.lai /usr/local/srfc/senna/php_mecab-0.0.3/modules/mecab.la PATH="$PATH:/sbin" ldconfig -n /usr/local/srfc/senna/php_mecab-0.0.3/modules ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/srfc/senna/php_mecab-0.0.3/modules 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. ---------------------------------------------------------------------- Build complete. (It is safe to ignore warnings about tempnam and tmpnam). [root@apollo php_mecab-0.0.3]# |
- ワーニングがでていますなぁ.
- ワーニングなので,かまわずインストール.
[root@apollo php_mecab-0.0.3]# make install Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ [root@apollo php_mecab-0.0.3]# |
- php.iniファイル(/usr/local/lib/php.ini)に,以下のように追加したライブラリへのパスを設定する.
変更前 |
---|
; Directory in which the loadable extensions (modules) reside. ;extension_dir = "./" |
変更後 |
; Directory in which the loadable extensions (modules) reside. ;extension_dir = "./" extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20060613 |
- Apacheを利用している場合は,Apacheを再起動することでPHP.INIの変更内容が反映される.