Discussion:
[Gmod-gbrowse] Trouble compiling Bio-SamTools under Fedora 22
Sam Hokin
2015-10-29 20:49:46 UTC
Permalink
Hiya folks. My GBrowse broke recently, and there seems to be a problem with a new version of perl after I upgraded to Fedora 22.
Here's the line in the web server error log:
---
[23690] FastCGI initializing and loading default data sources...
[23690] Loading AGPv3
Can't load '/usr/local/lib64/perl5/auto/Bio/DB/Sam/Sam.so' for module Bio::DB::Sam: libperl.so.5.18: cannot open shared object file:
No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193.
at (eval 42) line 1.
Compilation failed in require at (eval 42) line 1.
---
OK, so that seems to indicate that libperl.so.5.18 is hardcoded somewhere. I'm on libperl.so.5.20.3 now. So, let's recompile
Bio::DB::Sam using a freshly compiled samtools-1.2...
---
[root]# perl Build.PL
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: /usr/local/src/samtools-1.2/

Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-SamTools' version '1.41'
[***@biogrinder Bio-SamTools-1.41]# ./Build
Building Bio-SamTools
gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c
-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1: some warnings being treated as errors
error building c_bin/bam2bedgraph.o from 'c_bin/bam2bedgraph.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
---
Hrm. Seems to be a Werror mistake. How about I change -Wformat=0 to just -Wformat in Build.PL and _build/build_params and try again?
---
[root]# vi Build.PL
[root]# vi _build/build_params
[root]# perl Build.PL
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: /usr/local/src/samtools-1.2/

Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-SamTools' version '1.41'

[root]# ./Build
Building Bio-SamTools
gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT
-D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -DXS_VERSION="1.41" -DVERSION="1.41" -fPIC -D_IOLIB=2
-D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o lib/Bio/DB/Sam.o
lib/Bio/DB/Sam.c
lib/Bio/DB/Sam.xs:29:19: fatal error: khash.h: No such file or directory
compilation terminated.
error building lib/Bio/DB/Sam.o from 'lib/Bio/DB/Sam.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
---

Hrm. khash.h is missing. At this point I'm getting frustrated so I thought I'd ask the list for tips. Much appreciated if you have
any! This is with Bio-SamTools-1.41.

------------------------------------------------------------------------------
Timothy Parnell
2015-10-29 21:26:15 UTC
Permalink
Grab the older samtools v 0.1.19 from SourceForge, compile with -fPIC support, and point the perl Build.PL at that. The Bio::DB::Sam perl adaptor is currently incompatible with recent samtools 1.x versions. I believe someone has a partially working version in a fork on GitHub for the current samtools library (work in progress). I don’t believe you’ll miss anything using the older version of the samtools library.


> On Oct 29, 2015, at 2:49 PM, Sam Hokin <***@carnegiescience.edu> wrote:
>
> Hiya folks. My GBrowse broke recently, and there seems to be a problem with a new version of perl after I upgraded to Fedora 22.
> Here's the line in the web server error log:
> ---
> [23690] FastCGI initializing and loading default data sources...
> [23690] Loading AGPv3
> Can't load '/usr/local/lib64/perl5/auto/Bio/DB/Sam/Sam.so' for module Bio::DB::Sam: libperl.so.5.18: cannot open shared object file:
> No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193.
> at (eval 42) line 1.
> Compilation failed in require at (eval 42) line 1.
> ---
> OK, so that seems to indicate that libperl.so.5.18 is hardcoded somewhere. I'm on libperl.so.5.20.3 now. So, let's recompile
> Bio::DB::Sam using a freshly compiled samtools-1.2...
> ---
> [root]# perl Build.PL
> 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: /usr/local/src/samtools-1.2/
>
> Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
> Created MYMETA.yml and MYMETA.json
> Creating new 'Build' script for 'Bio-SamTools' version '1.41'
> [***@biogrinder Bio-SamTools-1.41]# ./Build
> Building Bio-SamTools
> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c
> -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
> --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
> cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
> cc1: some warnings being treated as errors
> error building c_bin/bam2bedgraph.o from 'c_bin/bam2bedgraph.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
> ---
> Hrm. Seems to be a Werror mistake. How about I change -Wformat=0 to just -Wformat in Build.PL and _build/build_params and try again?
> ---
> [root]# vi Build.PL
> [root]# vi _build/build_params
> [root]# perl Build.PL
> 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: /usr/local/src/samtools-1.2/
>
> Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
> Created MYMETA.yml and MYMETA.json
> Creating new 'Build' script for 'Bio-SamTools' version '1.41'
>
> [root]# ./Build
> Building Bio-SamTools
> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT
> -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
> -grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -DXS_VERSION="1.41" -DVERSION="1.41" -fPIC -D_IOLIB=2
> -D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o lib/Bio/DB/Sam.o
> lib/Bio/DB/Sam.c
> lib/Bio/DB/Sam.xs:29:19: fatal error: khash.h: No such file or directory
> compilation terminated.
> error building lib/Bio/DB/Sam.o from 'lib/Bio/DB/Sam.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
> ---
>
> Hrm. khash.h is missing. At this point I'm getting frustrated so I thought I'd ask the list for tips. Much appreciated if you have
> any! This is with Bio-SamTools-1.41.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-gbrowse mailing list
> Gmod-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

------------------------------------------------------------------------------
Fields, Christopher J
2015-10-29 23:01:32 UTC
Permalink
Yeah, I have a fork that works with samtools v1.x (requires htslib too). It's a little hacky and needs to be cleaned up, but tests passed fine.

Chris

Sent from my iPhone

> On Oct 29, 2015, at 5:26 PM, Timothy Parnell <***@hci.utah.edu> wrote:
>
> Grab the older samtools v 0.1.19 from SourceForge, compile with -fPIC support, and point the perl Build.PL at that. The Bio::DB::Sam perl adaptor is currently incompatible with recent samtools 1.x versions. I believe someone has a partially working version in a fork on GitHub for the current samtools library (work in progress). I don’t believe you’ll miss anything using the older version of the samtools library.
>
>
>> On Oct 29, 2015, at 2:49 PM, Sam Hokin <***@carnegiescience.edu> wrote:
>>
>> Hiya folks. My GBrowse broke recently, and there seems to be a problem with a new version of perl after I upgraded to Fedora 22.
>> Here's the line in the web server error log:
>> ---
>> [23690] FastCGI initializing and loading default data sources...
>> [23690] Loading AGPv3
>> Can't load '/usr/local/lib64/perl5/auto/Bio/DB/Sam/Sam.so' for module Bio::DB::Sam: libperl.so.5.18: cannot open shared object file:
>> No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193.
>> at (eval 42) line 1.
>> Compilation failed in require at (eval 42) line 1.
>> ---
>> OK, so that seems to indicate that libperl.so.5.18 is hardcoded somewhere. I'm on libperl.so.5.20.3 now. So, let's recompile
>> Bio::DB::Sam using a freshly compiled samtools-1.2...
>> ---
>> [root]# perl Build.PL
>> 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: /usr/local/src/samtools-1.2/
>>
>> Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
>> Created MYMETA.yml and MYMETA.json
>> Creating new 'Build' script for 'Bio-SamTools' version '1.41'
>> [***@biogrinder Bio-SamTools-1.41]# ./Build
>> Building Bio-SamTools
>> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c
>> -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
>> -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
>> --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
>> cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
>> cc1: some warnings being treated as errors
>> error building c_bin/bam2bedgraph.o from 'c_bin/bam2bedgraph.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
>> ---
>> Hrm. Seems to be a Werror mistake. How about I change -Wformat=0 to just -Wformat in Build.PL and _build/build_params and try again?
>> ---
>> [root]# vi Build.PL
>> [root]# vi _build/build_params
>> [root]# perl Build.PL
>> 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: /usr/local/src/samtools-1.2/
>>
>> Found /usr/local/src/samtools-1.2//bam.h and /usr/local/src/samtools-1.2//libbam.a.
>> Created MYMETA.yml and MYMETA.json
>> Creating new 'Build' script for 'Bio-SamTools' version '1.41'
>>
>> [root]# ./Build
>> Building Bio-SamTools
>> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT
>> -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
>> -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
>> -grecord-gcc-switches -m64 -mtune=generic -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
>> gcc -I/usr/local/src/samtools-1.2/ -Ic_bin -I/usr/lib64/perl5/CORE -DXS_VERSION="1.41" -DVERSION="1.41" -fPIC -D_IOLIB=2
>> -D_FILE_OFFSET_BITS=64 -Wformat -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector
>> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
>> -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -o lib/Bio/DB/Sam.o
>> lib/Bio/DB/Sam.c
>> lib/Bio/DB/Sam.xs:29:19: fatal error: khash.h: No such file or directory
>> compilation terminated.
>> error building lib/Bio/DB/Sam.o from 'lib/Bio/DB/Sam.c' at /usr/share/perl5/vendor_perl/ExtUtils/CBuilder/Base.pm line 172.
>> ---
>>
>> Hrm. khash.h is missing. At this point I'm getting frustrated so I thought I'd ask the list for tips. Much appreciated if you have
>> any! This is with Bio-SamTools-1.41.
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Gmod-gbrowse mailing list
>> Gmod-***@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-gbrowse mailing list
> Gmod-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

------------------------------------------------------------------------------
Loading...