はじめに
お出かけ用マシン の作業環境を構築している中で,MySQL に mroonga プラグインを入れる作業の際に少々つまづいたので,そのメモ.
MySQL と groonga
こんな感じです:
% mysql -V mysql Ver 14.14 Distrib 5.5.24, for osx10.7 (i386) using readline 5.1 % groonga --version groonga 2.0.3 [darwin11.4.2,x86_64,utf8,match-escalation-threshold=0,nfkc,zlib,lzo,kqueue] configure options: < '--prefix=/usr/local/Cellar/groonga/2.0.3' '--with-zlib' 'CC=/usr/bin/clang' 'CFLAGS=-Os -w -pipe -march=native -Qunused-arguments' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-Os -w -pipe -march=native -Qunused-arguments'> |
どちらも Homebrew 経由でインストールしたものです.
mroonga を手動でビルドしてみる
% curl -LO "https://github.com/downloads/mroonga/mroonga/mroonga-2.03.tar.gz" % tar zxvf mroonga-2.03.tar.gz % cd mroonga-2.03 % ./configure \ --prefix=$HOME/local \ --with-mysql-source=/path/to/src/of/mysql-5.5.24 \ --with-mysql-config=/usr/local/bin/mysql_config \ --disable-document % make ... libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/path/to/src/of/mysql-5.5.24/include -I/path/to/src/of/mysql-5.5.24/sql -I/path/to/src/of/mysql-5.5.24/include -I/path/to/src/of/mysql-5.5.24/regex -I/path/to/src/of/mysql-5.5.24 -I/usr/local/Cellar/mysql/5.5.24/include -I/usr/local/Cellar/groonga/2.0.3/include/groonga -I.. -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing -Wno-deprecated -Werror -fno-implicit-templates -fno-exceptions -fno-rtti -felide-constructors -MT mrn_index_table_name.lo -MD -MP -MF .deps/mrn_index_table_name.Tpo -c mrn_index_table_name.cpp -fno-common -DPIC -o .libs/mrn_index_table_name.o In file included from ../mrn_mysql.h:52, from mrn_index_table_name.cpp:21: /path/to/src/of/mysql-5.5.24/include/probes_mysql.h:24:33: error: probes_mysql_dtrace.h: No such file or directory make[2]: *** [mrn_index_table_name.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 |
失敗しました.
該当箇所を覗いてみる
probes_mysql_dtrace.h
なるファイルが見つからない,とのことなので,さがしてみます.
% cd /path/to/src/of/mysql-5.5.24 % find . -name probes_mysql_dtrace.h % find . -name \*dtrace\*.h ./include/probes_mysql_nodtrace.h |
確かに存在していないようです.(probes_mysql_nodtrace.h
なるファイルはあるようです.)
次に,エラーの出た include/probes_mysql.h
の該当箇所を見てみます:
23 24 25 26 27 | #if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) #include "probes_mysql_dtrace.h" #else #include "probes_mysql_nodtrace.h" #endif |
HAVE_DTRACE
,DISABLE_DTRACE
がどのあたりで定義(?)されているかまったくわかっていませんが,この部分で前者の分岐が選択され,存在しないものをインクルードしようとしてエラー,という感じですかね.
アドホックに解決してみる
先の箇所における「分岐」を無効にしてしまう,つまり,存在する probes_mysql_nodtrace.h
を必ずインクルードするようにしてしまうことで,エラーを回避します:
--- include/probes_mysql.h.orig 2012-06-14 02:04:39.000000000 +0900 +++ include/probes_mysql.h 2012-06-14 06:54:34.000000000 +0900 @@ -20,10 +20,6 @@ #include <my_global.h> -#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) -#include "probes_mysql_dtrace.h" -#else #include "probes_mysql_nodtrace.h" -#endif #endif /* PROBES_MYSQL_H */ |
これでビルドできるようになりました!
おわりに
以上, MySQL-5.5.24 + mroonga-2.03 でのビルドに失敗して,アドホックな解決を試みた感じのメモでした.
こちらもあわせてどうぞ
最近の閲覧数
- None Found