MariaDB v10.0.3とMroonga v4.0.5インストール時にmakeでERRORになった話
MariaDBって
MySQLから派生したRDBMSのひとつ。MySQLのオリジナルコードの作成者であるモンティーさんがオラクル管理の現在のMySQLコードをフォークして始めた。
MySQLに比べて各処理のアーキテクチャがより高速に変更されていたり、Thread_poolや並列レプリケーションなどのRDBMSにしては前衛的な機能が盛り込まれていたりする。
大手ウェブサービスも移行していたり、各LinuxディストリビューションのデータベースもMariaDBに変更していたり、RDBMS界隈でわりとホットな話題。
Mroongaって
MySQL(MariaDBでも)で全文検索を実現するストレージエンジンのひとつ。
全文検索エンジンであるGroongaをベースとしており、MySQLのプラグインとしてインストールできるので設置が容易。
インストール
MariaDBのインストール
tarfileや各種パッケージからインストールする。特につまずくポイントはなし。
https://downloads.mariadb.org/mariadb/10.0.13/
Groonga install
rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm yum makecache yum install -y groonga yum install -y groonga-devel yum install -y groonga-normalizer-mysql
※このときはdevelも必要でした。
Mroongaのインストール
上記のMariaDBを任意のディレクトリに配置するなどしていたので、ソースからビルド。
http://mroonga.org/ja/docs/install/others.html#build-from-source
cd /usr/local/src/ wget http://packages.groonga.org/source/mroonga/mroonga-4.05.tar.gz wget https://downloads.mariadb.org/interstitial/mariadb-10.0.13/source/mariadb-10.0.13.tar.gz/from/http%3A//ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb tar xvzf mroonga-4.05.tar.gz tar zxvf mariadb-10.0.13.tar.gz cd mroonga-4.05 ./configure \ --with-mysql-source=/usr/local/src/mariadb-10.0.13 \ --with-mysql-config=/MARIA/product/bin/mysql_config
- --with-mysql-source:インストール対象のソースのパスを記載。今回は先ほどダウンロードしたMariaDB。
- --with-mysql-config:実際にインストールされたバイナリーディレクトリにあるmysql_configファイル。
そんで、make。
make
このとき以下のようなエラーが出た。
/usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:29:57: error: pcre.h: No such file or directory In file included from /usr/local/src/mariadb-10.0.13/sql/item.h:3745, from /usr/local/src/mariadb-10.0.13/sql/sql_lex.h:26, from /usr/local/src/mariadb-10.0.13/sql/sql_class.h:474, from ../mrn_mysql.h:51, from mrn_path_mapper.cpp:30: /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1494: error: ISO C++ forbids declaration of 'pcre' with no type /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1494: error: expected ';' before '*' token /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h: In constructor 'Regexp_processor_pcre::Regexp_processor_pcre()': /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1510: error: class 'Regexp_processor_pcre' does not have any field named 'm_pcre' /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h: In member function 'void Regexp_processor_pcre::init(const CHARSET_INFO*, int, uint)': /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1521: error: 'PCRE_UTF8' was not declared in this scope /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1521: error: 'PCRE_UCP' was not declared in this scope /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1523: error: 'PCRE_CASELESS' was not declared in this scope /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h: In member function 'void Regexp_processor_pcre::cleanup()': /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1559: error: 'm_pcre' was not declared in this scope /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1561: error: 'pcre_free' was not declared in this scope /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h: In member function 'bool Regexp_processor_pcre::is_compiled() const': /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:1566: error: 'm_pcre' was not declared in this scope make[2]: *** [mrn_path_mapper.lo] Error 1 make[2]: Leaving directory `/usr/local/src/mroonga-4.05/lib' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/mroonga-4.05' make: *** [all] Error 2
/usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h:29にて、pcre.hというヘッダファイルが見つからないようだ。
調べてみると、
ls -lh /usr/local/src/mariadb-10.0.13/pcre/pcre.h.in -rw-r--r-- 1 1001 1001 32K Aug 8 18:13 /usr/local/src/mariadb-10.0.13/pcre/pcre.h.in
.in付いてる。
仕方がないので、正しいかどうかは分かりませんが、
vi /usr/local/src/mariadb-10.0.13/sql/item_cmpfunc.h
にて、
#include "pcre.h" /* pcre header file */
を
#include "pcre.h.in" /* pcre header file */
に変更。
make
うまくいった!
あとは、make installして、設定用のSQLを実行するだけ。
make install mysql -u root < /usr/local/share/mroonga/install.sql