Question: Cannot Build Bio-Samtools
0
gravatar for ali
4.3 years ago by
ali0
Canada
ali0 wrote:

BioPerl is installed

Samtools 0.1.9 is used using "-fPIC" flags ( I was getting R_X_86_64_32 err). Infact I've tried adding the "-fPIC" flag and then tried using the flags in the SamTools Readme(http://cpansearch.perl.org/src/LDS/Bio-SamTools-1.41/README) but I get the same error.

Environment Variable is set:

echo $SAMTOOLS
/export/home/yusuf/samtools

Downloaded Bio-SamTools-1.[36-41] I've tried all versions between 1.36 and 1.41, same error.

But I always have the same problem.

perl Build.PL 
Found /export/home/yusuf/samtools/bam.h and /export/home/yusuf/samtools/libbam.a.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-SamTools' version '1.41'

[yusuf@host Bio-SamTools-1.41]$ ./Build 
Building Bio-SamTools
cc -shared -O2 -L/usr/local/lib -fstack-protector -o blib/arch/auto/Bio/DB/Sam/Sam.so lib/Bio/DB/Sam.o c_bin/bam2bedgraph.o -L/export/home/yusuf/samtools -lbam -lpthread -lz
/usr/bin/ld: /usr/local/lib/libbam.a(bgzf.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/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 /export/home/yusuf/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.1/ExtUtils/CBuilder/Base.pm line 323.

 

For some reason is is stuck on using libbam in /usr/local/lib and not the one I have built as set in my ENV variable. It detects that it is there in my build folder, but never uses it. As such, I cannot build the perl module.

Any suggestions?

samtools bioperl perl • 2.5k views
ADD COMMENTlink written 4.3 years ago by ali0

Have you tried just editing Build to remove /usr/local/lib? The linker is finding that first, so that's what it's using.

ADD REPLYlink written 4.3 years ago by Devon Ryan90k

I would, but I have no idea how. 

ADD REPLYlink written 4.3 years ago by ali0
$ gedit Build.PL

and comment appropriate lines. For help with which lines, please paste the file in a GitHub gist and share the link here.

ADD REPLYlink written 4.3 years ago by RamRS21k

gist: gist.github.com/yusuf-a/3c9e63dc8062204dab92

ADD REPLYlink modified 4.3 years ago by RamRS21k • written 4.3 years ago by ali0

Try commenting out line 10.

ADD REPLYlink written 4.3 years ago by RamRS21k

that just breaks

Global symbol "$sam_include" requires explicit package name at Build.PL line 18.
Global symbol "$sam_lib" requires explicit package name at Build.PL line 18.
Global symbol "$sam_include" requires explicit package name at Build.PL line 40.
Global symbol "$sam_lib" requires explicit package name at Build.PL line 41.
Execution of Build.PL aborted due to compilation errors.
ADD REPLYlink written 4.3 years ago by ali0

Hmmm, I was mistaken about the problem - this bug has already been addressed. Let's check out the next step then.

The problem seems to be with the cc step, which should be in the Makefile. Can you paste the Makefile in a gist as well please?

Also, you might wanna change this:

system "cd c_bin; \$make INCLUDES=-I$sam_include LIBPATH=-L$sam_lib";

to:

system "cd c_bin; CPPFLAGS=\"-I$sam_include\"; LDFLAGS=\"-L$sam_lib\" \$make";

and try once.

ADD REPLYlink written 4.3 years ago by RamRS21k

breaks

Found /export/home/yusuf/samtools/bam.h and /export/home/yusuf/samtools/libbam.a.
String found where operator expected at /export/home/yusuf/Bio-SamTools-1.39/_build/lib/MyModuleBuilder.pm line 9, near "samtools"; LDFLAGS=""
String found where operator expected at /export/home/yusuf/Bio-SamTools-1.39/_build/lib/MyModuleBuilder.pm line 9, near "samtools" $make""
syntax error at /export/home/yusuf/Bio-SamTools-1.39/_build/lib/MyModuleBuilder.pm line 9, near "samtools"; LDFLAGS=""
Compilation failed in require at (eval 15) line 2.
BEGIN failed--compilation aborted at (eval 15) line 2.

 

gist: gist.github.com/yusuf-a/da87e2468b0f3280f31d

edit: switched to 1.39 because everyone else I know got that working. Not 1.41

ADD REPLYlink modified 4.3 years ago by RamRS21k • written 4.3 years ago by ali0

Hi, this gist doesn't seem to be the Makefile. Could you check again please? Thank you!

ADD REPLYlink written 4.3 years ago by RamRS21k

gist.github.com/yusuf-a/c54c12257452f0ab2c73

ADD REPLYlink modified 4.3 years ago • written 4.3 years ago by ali0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1881 users visited in the last hour