Subject: | compile issue |
Date: | Mon, 18 Jan 2016 17:02:17 +0000 |
To: | "bug-Bio-DB-HTS [...] rt.cpan.org" <bug-Bio-DB-HTS [...] rt.cpan.org> |
From: | Pär Larsson <par.larsson [...] umu.se> |
Hi,
I'm having difficulties installing Bio::DB::HTS. Running "sudo cpan install Bio::DB::HTS" gives me the following error message (despite a work-around):
Found /usr/local/include/htslib/hts.h and /usr/local/include/htslib/libhts.a
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-DB-HTS' version '1.04'
RISHIDEV/Bio-DB-HTS-1.04.tar.gz
/usr/bin/perl Build.PL -- OK
Running Build for R/RI/RISHIDEV/Bio-DB-HTS-1.04.tar.gz
Building Bio-DB-HTS
gcc -I/usr/local/include/htslib -I/usr/lib64/perl5/CORE -DVERSION="1.04" -DXS_VERSION="1.04" -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o lib/Bio/DB/HTS/Faidx.o lib/Bio/DB/HTS/Faidx.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Bio/DB/HTS/Faidx/Faidx.bs')
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro -o blib/arch/auto/Bio/DB/HTS/Faidx/Faidx.so lib/Bio/DB/HTS/Faidx.o -L/usr/local/include/htslib -lhts -lpthread -lz
/bin/ld: /usr/local/include/htslib/libhts.a(faidx.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/include/htslib/libhts.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
error building blib/arch/auto/Bio/DB/HTS/Faidx/Faidx.so from lib/Bio/DB/HTS/Faidx.o at /usr/local/share/perl5/ExtUtils/CBuilder/Base.pm line 321.
RISHIDEV/Bio-DB-HTS-1.04.tar.gz
./Build -- NOT OK
When HTSlib is installed, headers are placed in /usr/local/include/htslib/ and the libhts.a goes into into /usr/local/lib . So entering a path to a dir that contains both requires linking or copying, which I did above. But it does still not work. Not sure what's going on here. Must libhts.a be recompiled using -fpic ?
Further instructions would be greatly appreciated (or a bug fix).
System used is centos 7.2, perl 5.16 .
Kind regards,
Pär Larsson
Umeå, Sweden