【发布时间】:2014-08-28 19:03:16
【问题描述】:
我正在尝试在远程服务器上的主目录上安装 perl 模块 Bio::DB::Sam。
我下载了模块,提取了文件,然后运行:
perl Build.pl prefix=~/local
接下来会发生什么:
This module requires samtools 0.1.10 or higher (samtools.sourceforge.net).
Please enter the location of the bam.h and compiled libbam.a files: **/some_places/samtools-0.1.19**
Found /some_places/samtools-0.1.19/bam.h and /some_places/samtools-0.1.19/libbam.a.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-SamTools' version '1.39'
接下来当我尝试运行时:
./Build
这是我得到的:
Building Bio-SamTools
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o blib/arch/auto/Bio/DB/Sam/Sam.so lib/Bio/DB/Sam.o c_bin/bam2bedgraph.o -L/some_places/samtools-0.1.19 -lbam -lpthread -lz
/usr/bin/ld: /some_places/samtools-0.1.19/libbam.a(bgzf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/some_places/samtools-0.1.19/libbam.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error building blib/arch/auto/Bio/DB/Sam/Sam.so from lib/Bio/DB/Sam.o c_bin/bam2bedgraph.o at ~/perl5/lib/perl5/ExtUtils/CBuilder/Base.pm line 323.
我确实在谷歌上搜索了可能的解决方案并尝试了几个,但它们都不起作用,例如--enable-shared OR export CXXFLAGS="$CXXFLAGS -fPIC".
我已经在我的主目录中安装了 Bioperl。
任何帮助将不胜感激。
干杯
【问题讨论】:
-
您是否已通过电子邮件向 samtools 的作者寻求帮助?
-
不,我还没有。目前,我正在尝试使用 -fPIC 重新编译我们这边的 samtools 版本,看看在安装 Bio::DB::Sam 时是否仍然遇到同样的问题。
-
根据我的经验,这很常见。您需要在 samtools 目录中
make clean,然后编辑 samtools dist 中的 Makefile 以将“-fPIC”添加到 CFLAGS。之后,您可以尝试构建 Bio-SamTools。 -
我这样做了,但我开始收到不同的错误,这些错误显然来自 samtools 和 Bio::DB::Sam 版本中的不同。我已经下载了最新版本的 samtools,显然 Bio::DB::Sam 不再支持了。在新的 samtools bam.h 库中有一些函数被注释掉了。我打算下载并安装旧版本的 samtools,并尝试将 Bio::DB::Sam 链接到旧版本的 samtools,并将在此处发布结果。
标签: perl module installation bioinformatics bioperl