Skip Menu |

This queue is for tickets about the Bio-DB-HTS CPAN distribution.

Report information
The Basics
Id: 111279
Status: resolved
Priority: 0/
Queue: Bio-DB-HTS

People
Owner: RISHIDEV [...] cpan.org
Requestors: par.larsson [...] umu.se
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
Hi Par Thanks for bringing this up. There is a TROUBLESHOOTING section to the README file which mentions this. https://metacpan.org/source/RISHIDEV/Bio-DB-HTS-1.04/README (I've put the relevant contents below). The Build framework is inherited from Bio-Samtools which this module was based on and it looks like this is a gcc flag not used on newer modules using Perl XS - I'll have a look at seeing if the -fPIC requirement can be removed. Regards Rishi 1. When building this module, you get an error like the following: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC To fix this, edit the Makefile in the Samtools distribution by adding "-fPIC" to the CFLAGS line. While you're at it, you may also wish to get rid of a bunch of unused variable warnings that appears under recent versions of gcc. The modified CFLAGS will look like this CFLAGS= -g -Wall -Wno-unused -Wno-unused-result -O2 -fPIC #-m64 #-arch ppc Then do "make clean; make" in the Samtools directory to recompile the library. After this you should be able to build this module without errors.
Hi Par On further investigation the -fPIC flag is required for the Perl XS module to operate and so htslib needs to be compiled with -fPIC flag as described in the README, or use perl INSTALL.pl with the script in the repo which will download and compile htslib with the correct options. This does not install htslib to the system, but the LD_LIBRARY_PATH can be set to point to the downloaded htslib location. Regards Rishi
Subject: RE: [rt.cpan.org #111279] compile issue
Date: Wed, 20 Jan 2016 09:13:45 +0000
To: "bug-Bio-DB-HTS [...] rt.cpan.org" <bug-Bio-DB-HTS [...] rt.cpan.org>
From: Pär Larsson <par.larsson [...] umu.se>
Many thanks! //Pär Show quoted text
-----Original Message----- From: Rishi Nag via RT [mailto:bug-Bio-DB-HTS@rt.cpan.org] Sent: den 20 januari 2016 10:12 To: Pär Larsson <par.larsson@umu.se> Subject: [rt.cpan.org #111279] compile issue <URL: https://rt.cpan.org/Ticket/Display.html?id=111279 > Hi Par On further investigation the -fPIC flag is required for the Perl XS module to operate and so htslib needs to be compiled with -fPIC flag as described in the README, or use perl INSTALL.pl with the script in the repo which will download and compile htslib with the correct options. This does not install htslib to the system, but the LD_LIBRARY_PATH can be set to point to the downloaded htslib location. Regards Rishi