ログイン 概要 よくある質問

データを解析する際にPerlとEnsembl APIを組み合わせて使用してみたいと考えております。システム構成としまして
Macbook pro (SnowLeopard)
Perl 5.13.9 (perlbrewでインストール済み)
bioperl 1.6.1インストール済み
MySQL5.5.8(64bit)をインストール済み(必要ないかもしれませんが)
DBI はcpanでインストール済み
まではうまくインストールができているようで、MySQLも起動できます。
次に必要となる DBD:mysql をcpanを用いまして、インストールしたいとと思うのですがエラーがでました。
そこで、DBD-mysql-4.018をソースでダウンロードして、makeするとやはり、cpanのときと同様に

Argument "6.57_05" isn't numeric in numeric ge (>=) at Makefile.PL line 350, <pipe> line 138.
Using DBI 1.616 (for perl 5.013009 on darwin-2level) installed in /Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/site_perl/5.13.9/darwin-2level/auto/DBI/
Writing Makefile for DBD::mysql
Writing MYMETA.yml
---:DBD-mysql-4.0181 ---$ sudo make
Skip blib/lib/DBD/mysql.pm (unchanged)
Skip blib/lib/DBD/mysql/GetInfo.pm (unchanged)
Skip blib/lib/DBD/mysql/INSTALL.pod (unchanged)
Skip blib/lib/Bundle/DBD/mysql.pm (unchanged)
cc -c -I/Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/site_perl/5.13.9/darwin-2level/auto/DBI -I/usr/local/mysql/include -Os -g -fno-common
>-fno-strict-aliasing -arch x86_64 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector
>-I/usr/local/include -I/opt/local/include -O3 -DVERSION="4.018" -DXS_VERSION="4.018"
>"-I/Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/5.13.9/darwin-2level/CORE" dbdimp.c
dbdimp.c: In function 'mysql_db_FETCH_attrib':
dbdimp.c:2447: error: 'sv_undef' undeclared (first use in this function)
dbdimp.c:2447: error: (Each undeclared identifier is reported only once
dbdimp.c:2447: error: for each function it appears in.)
dbdimp.c: In function 'mysql_st_internal_execute41':
dbdimp.c:3298: warning: format '%d' expects type 'int', but argument 3 has type 'my_ulonglong'
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3517: warning: format '%d' expects type 'int', but argument 5 has type 'long unsigned int'
dbdimp.c:3521: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
dbdimp.c: In function 'mysql_st_fetch':
dbdimp.c:3738: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
dbdimp.c:3780: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'struct MYSQL_RES '
dbdimp.c:3782: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'unsigned int'
dbdimp.c: In function 'mysql_st_FETCH_attrib':
dbdimp.c:4365: warning: format '%d' expects type 'int', but argument 3 has type 'my_ulonglong'
dbdimp.c: In function 'mysql_bind_ph':
dbdimp.c:4571: warning: format '%d' expects type 'int', but argument 3 has type 'IV'
dbdimp.c:4583: warning: format '%d' expects type 'int', but argument 3 has type 'IV'
dbdimp.c:4595: warning: format '%d' expects type 'int', but argument 3 has type 'IV'
dbdimp.c:4609: warning: format '%d' expects type 'int', but argument 3 has type 'IV'
dbdimp.c:4630: warning: format '%d' expects type 'int', but argument 5 has type 'IV'
make:
** [dbdimp.o] Error 1

と表示され、インストールできません。インターネットの情報を頼りにマニュアルで

 #ifndef sv_undef
 #define sv_undef PL_sv_undef
 #endif
として、無理矢理インストールを進めたあと、 サンプルプログラムの

use warnings;
use Bio::EnsEMBL::Registry;

my $registry ='Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous' );

my $slice_adaptor = $registry->get_adaptor( 'Human', 'Core', 'Slice' );
my $slice = $slice_adaptor->fetch_by_region('chromosome', '12','1000000','1000050');
my $coord_sys = $slice->coord_system()->name();
my $seq_region = $slice->seq_region_name();
my $start = $slice->start();
my $end = $slice->end();
my $strand = $slice->strand();
my $seq = $slice->seq(); print "Slice:$coord_sys $seq_region $start-$end($strand)¥n$seq¥n";

を実行しますと

Can't load '/Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/site_perl/5.13.9/darwin-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/site_perl/5.13.9/darwin-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.16.dylib
Referenced from: /Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/site_perl/5.13.9/darwin-2level/auto/DBD/mysql/mysql.bundle
Reason: image not found at /Users/---/perl5/perlbrew/perls/perl-5.13.9/lib/5.13.9/darwin-2level/DynaLoader.pm line 200.
at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/StatementHandle.pm line 48
Compilation failed in require at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/StatementHandle.pm line 48.
BEGIN failed--compilation aborted at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/StatementHandle.pm line 48.
Compilation failed in require at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 68.
BEGIN failed--compilation aborted at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBConnection.pm line 68.
Compilation failed in require at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 59.
BEGIN failed--compilation aborted at /Users/---/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 59.
Compilation failed in require at /Users/---/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 123.
BEGIN failed--compilation aborted at /Users/---/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 123.
Compilation failed in require at splice.pl line 3.
BEGIN failed--compilation aborted at splice.pl line 3.

とエラーが出て実行できません。いちおうbioperlはもっと古いバージョンが必要と言うことになっておりますが、ubuntuでは 同様な手続きで Ensembl API が利用できております。いずれにしましても、とりあえずはDBD::mysqlがインストールできない ところが困っているところですので直接はbioperl以前の問題ではと考えております。mySQLを32bit版に変更しても同様です。

どなたか、MacでこのAPIを使用されておられる方がおられましたら、アドバイスをいただきたいと思います。 ぜひ、よろしくお願いします。

質問日 Jan 22 '11 at 15:30

gatapishi's gravatar image

gatapishi
714711

edited Jan 26 '11 at 20:08

エラーメッセージは正確にコピー&ペーストして提示するほうが回答が得られる可能性がたかまります。質問を再編集してみてください。

このAPIは使っていないのですがエラーを見る限りでは、" Library not loaded: libmysqlclient.16.dylib" とのことなので、libmysqlclient.16.dylib がロードできていないようですね。libmysqlclient や DBD:mysql のインストールについて確認してみる必要がありますね。

(Jan 24 '11 at 17:14) mn3 ♦♦ mn3's gravatar image

コメントありがとうございます。 エラーを全部入力させていただきました。 いろいろ試行錯誤してみてますが、解決に至ってません・・

(Jan 26 '11 at 20:09) gatapishi gatapishi's gravatar image
1

環境変数DYLD_FALLBACK_LIBRARY_PATHに、libmysqlclient.16.dylib の実体がいる場所を指定しても駄目でしょうか?

(bash) export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/ (tcsh) setenv DYLD_FALLBACK_LIBRARY_PATH /usr/local/mysql/lib/

(Jan 28 '11 at 17:33) mya_ ♦ mya_'s gravatar image
1

教えていただきましたとおり、libmysqlclient.16.dylibの場所をfindで検索しましたところ、
/opt/local/lib/mysql5/mysql/libmysqlclient.16.dylib
/opt/local/var/macports/software/mysql5/5.1.53_0/opt/local/lib/mysql5/mysql/libmysqlclient.16.dylib
/usr/local/mysql-5.5.8-osx10.6-x86_64/lib/libmysqlclient.16.dylib
に存在しました。DYLD_FALLBACK_LIBRARY_PATHでそのうちの一つ
/usr/local/mysql(mysql-5.5.8-osx10.6-x86_64)/lib
を指定しましたところ、うまく実行できるようになりました。
さっそく、いろいろ利用させていただこうと思います。
ありがとうございました。

(Jan 29 '11 at 13:35) gatapishi gatapishi's gravatar image

libmysqlclient.16.dylib
が存在するパスを
DYLD_FALLBACK_LIBRARY_PATH
で指定することでうまくいきました。
どうもありがとうございました。

回答日 Jan 29 '11 at 13:38

gatapishi's gravatar image

gatapishi
714711

1

実行可能状態になって良かったです。 環境変数"DYLD_FALLBACK_LIBRARY_PATH"は、他のプログラムが使っている場合もあるので恒久的に使う時は

export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_FALLBACK_LIBRARY_PATH

のようにPATHを付加する形で運用した方がベターです。 また、DBD::mysqlがインストールできない根本的な問題は、このperlモジュールがアップデートされるのを待つほか無いようです。

DBD::mysqlに限らず古い仕様のモジュールに「sv-undef」が使われている場合、 perl 5.13.2以前であれば「increasing backwards compatibility」機能が使えたようですが、5.13.9だと機能が外されてしまった様子です。 (⇒Perl 5.13.3+ MAY BREAK COMPILED DRIVERS )

(Jan 31 '11 at 18:25) mya_ ♦ mya_'s gravatar image
1

perl 5.13.2以前であれば、以下の手順でコンパイルが通るケースもあるようです(でした)。

perl Makefile.PL POLLUTE=1
----
※CPAN shell なら
o conf
#で、makepl_argに何か指定しているならメモっておく※(内容1)とする。
o conf makepl_arg POLLUTE=1
# で、POLLUTEモードを有効にする記述を付加する。(内容1)があれば、それも再度加えておく
o conf commit
# で、内容を反映させる
(Jan 31 '11 at 18:25) mya_ ♦ mya_'s gravatar image

詳細なコメントをありがとうございます。勉強になります。Perlもバージョンによって随分違うようですね。バージョンの違いまでは把握しきれませんです・・・・

(Feb 02 '11 at 02:21) gatapishi gatapishi's gravatar image

自分の場合はどうやったか記憶が定かではないですが、 多分、MySQLの何かのファイルが、Macだとubuntuなどとは別のところに置かれているのが原因かと思います(経験的に)。

CPAN経由でなく、DBD::mysqlのソースを落としてきてインストールしてみてはどうでしょう。

それでもうまくいかないなら、 「DBD::mysql Mac」などでググると、perl Makefile.PL するときにいくつかオプション指定している先例が見つかるだろうので それを見ながらトライしてもよいかと思います。

回答日 Jan 25 '11 at 10:06

thecla's gravatar image

thecla
11632

コメントどうもありがとうございます。 ネット上にも苦労されている方から、同じマックでcpanで普通に入っている方までいろいろです。バージョンにもよるのかもしれません。ソースを落としてきてインストールしましたがうまくいかず、前バージョンを試してみてもうまくいきませんでした。とりあえず Linux上ですすめるしかなさそうです。

(Jan 26 '11 at 20:12) gatapishi gatapishi's gravatar image
あなたの回答
プレビューをトグルする

この質問をフォローする

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

回答

回答とコメント

タグ:

×4
×2
×1
×1

質問日: Jan 22 '11 at 15:30

閲覧数: 12,705 回

最終更新日: Feb 02 '11 at 02:21

powered by OSQA