安装Bio :: DB :: Sam perl模块 [英] Installing Bio::DB::Sam perl module

查看:594
本文介绍了安装Bio :: DB :: Sam perl模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的家中安装一个perl模块 Bio::DB::Sam 远程服务器上的目录.

I am trying to install a perl module Bio::DB::Sam on my home directory on a remote server.

我下载了模块,提取了文件,然后运行:

I downloaded the module, extracted the files, and ran:

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'

接下来,当我尝试运行时:

Next when I try to run:

./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".

I did google the possible solutions and tried a couple, but they didn't work, e.g. --enable-shared OR export CXXFLAGS="$CXXFLAGS -fPIC".

我已经在我的主目录中安装了Bioperl.

I have already have Bioperl installed on my home directory.

任何帮助将不胜感激.

欢呼

推荐答案

这是一个脚本,它将获取SAMtools源并进行编译,然后获取并编译Perl绑定.

Here is a script that will fetch the SAMtools source and compile it, then fetch and compile the Perl bindings.

wget http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2
tar xjf samtools-0.1.18.tar.bz2 && cd samtools-0.1.18
make CFLAGS=-fPIC
export SAMTOOLS=`pwd`
cpanm Bio::DB::Sam

您可能会看到的部分问题是,SAMtools项目最近进行了一些重大的代码重组(这自然使使用外部语言绑定变得困难).

Part of the problem you were likely seeing is that the SAMtools project has recently undergone some major code reorganization (and this has naturally made it difficult to work with external language bindings).

这篇关于安装Bio :: DB :: Sam perl模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆