Cannot Build Bio-Samtools
0
0
Entering edit mode
9.2 years ago
ali • 0

BioPerl is installed

samtools 0.1.9 is used using -fPIC flags (I was getting R_X_86_64_32 err). In fact I've tried adding the -fPIC flag and then tried using the flags in the samTools 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?

perl samtools bioperl • 4.2k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

I would, but I have no idea how.

ADD REPLY
0
Entering edit mode
$ 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 REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Try commenting out line 10.

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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:

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

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

Traffic: 1960 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6