Discussion:
[Samtools-help] Compile error on SAMtools
Cole, Wendell
2010-04-14 17:28:57 UTC
Permalink
Good Day,

I currently compiled samtools-0.1.7a on a Linux box running CentOS 5. I'm having trouble trying to run a samtool's command after I finished compiling the application to see if it is running correctly. I'm getting the error below:

samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)

samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)

samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)
samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)
samtools: relocation error: samtools: symbol gzopen64, version ZLIB_1.2.3.3 not defined in file libz.so.1 with link time reference

Before running the make command I ran export CFLAGS="-g -O2 -Wall -static" first. I've also, installed the lasted version of zlib-1.2.4, however I'm still getting this error. Please advice on how to resolve this problem.


Wendell Cole
UNIX System Administrator
Medical Information Technology | UM-Miller School of Medicine
1051 NW 14th Street, R-26, Dominion Parking Garage #165, Miami FL 33136
Email: ***@med.miami.edu<mailto:***@med.miami.edu>
John Marshall
2010-04-14 21:14:55 UTC
Permalink
Post by Cole, Wendell
I currently compiled samtools-0.1.7a on a Linux box running CentOS 5.
[...]
Post by Cole, Wendell
samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)
samtools: relocation error: samtools: symbol gzopen64, version
ZLIB_1.2.3.3 not defined in file libz.so.1 with link time reference
As you probably know, these messages are from the dynamic linker, and
indicate that you're trying to run samtools against a libz that is too
dissimilar from the one that you compiled it against. If you're running
it on the same machine that you compiled it on, this is rather surprising.
Post by Cole, Wendell
I've also, installed the lasted version of zlib-1.2.4, however I'm
still getting this error. Please advice on how to resolve this problem.
So it would be useful to know just which zlib this is being compiled and
linked against, and which it's being run against.

What does "ldd -v samtools" output? Is there any symbol versioning on zlib?

Which zlib.h is being included? (Add -H to the compilation of eg
bam_import.c to see this.) Which libz.a/.so is being linked against?
(Add -Wl,-Map,mapfile to the linking of samtools to see this, and grep
mapfile for "libz" and "gzopen".)

What packages do those zlib.h and libz.a/.so files come from?
Cole, Wendell
2010-04-15 12:31:14 UTC
Permalink
John,

Thanks for the quick response. This application is very new to me so I'm learning as I go. Before using the steps that you sent I was told by another co-worker to start from scratch and try to recompile SAMtools. I removed the zlib-1.2.4 library and recompiled SAMtools. However, now I'm getting a different error that refers to ./libbam.a library.

./libbam.a(bam_import.o): In function `__bam_get_lines':
/mihg/analysis/src/samtools-0.1.7a/bam_import.c:76: undefined reference to `gzopen64'
./libbam.a(bam_import.o): In function `sam_open':
/mihg/analysis/src/samtools-0.1.7a/bam_import.c:422: undefined reference to `gzopen64'
./libbam.a(bam_import.o): In function `sam_header_read2':
/mihg/analysis/src/samtools-0.1.7a/bam_import.c:126: undefined reference to `gzopen64'
collect2: ld returned 1 exit status
make[1]: *** [samtools] Error 1
make[1]: Leaving directory `/k/analysis/src/samtools-0.1.7a'
make: *** [all-recur] Error 1
[***@mendel1 samtools-0.1.7a]#

So as of now SAMtools is unable to compile altogether after removing the zlib-1.2.4 library.

The current zlib that is installed on the server is zlib-1.2.3-3
[***@mendel1 samtools-0.1.7a]# rpm -qa |grep zlib
zlib-devel-1.2.3-3
zlib-1.2.3-3
zlib-1.2.3-3
zlib-devel-1.2.3-3

Wendell Cole
UNIX System Administrator
Medical Information Technology | UM-Miller School of Medicine
1051 NW 14th Street, R-26, Dominion Parking Garage #165, Miami FL 33136
Email: ***@med.miami.edu


-----Original Message-----
From: John Marshall [mailto:***@sanger.ac.uk]
Sent: Wednesday, April 14, 2010 5:15 PM
To: Cole, Wendell
Cc: samtools-***@lists.sourceforge.net
Subject: Re: [Samtools-help] Compile error on SAMtools
Post by Cole, Wendell
I currently compiled samtools-0.1.7a on a Linux box running CentOS 5.
[...]
Post by Cole, Wendell
samtools: /usr/lib64/libz.so.1: no version information available (required by samtools)
samtools: relocation error: samtools: symbol gzopen64, version
ZLIB_1.2.3.3 not defined in file libz.so.1 with link time reference
As you probably know, these messages are from the dynamic linker, and
indicate that you're trying to run samtools against a libz that is too
dissimilar from the one that you compiled it against. If you're running
it on the same machine that you compiled it on, this is rather surprising.
Post by Cole, Wendell
I've also, installed the lasted version of zlib-1.2.4, however I'm
still getting this error. Please advice on how to resolve this problem.
So it would be useful to know just which zlib this is being compiled and
linked against, and which it's being run against.

What does "ldd -v samtools" output? Is there any symbol versioning on zlib?

Which zlib.h is being included? (Add -H to the compilation of eg
bam_import.c to see this.) Which libz.a/.so is being linked against?
(Add -Wl,-Map,mapfile to the linking of samtools to see this, and grep
mapfile for "libz" and "gzopen".)

What packages do those zlib.h and libz.a/.so files come from?
John Marshall
2010-04-15 13:19:01 UTC
Permalink
Post by Cole, Wendell
/mihg/analysis/src/samtools-0.1.7a/bam_import.c:126: undefined
reference to `gzopen64'
So as of now SAMtools is unable to compile altogether after removing
the zlib-1.2.4 library.
Did you remove just the library, or did you remove everything that was
installed when you installed zlib-1.2.4?

Because the gzopen64() etc functions were added in zlib 1.2.3.3 or
thereabouts. So assuming Centos's zlib-1.2.3-3 is fairly vanilla
1.2.3 [1], the likely reason for these errors is that your compilation
is still getting the 1.2.4 header file.

Those -H and -Map suggestions will be informative.

You might also try compiling the current samtools from subversion
rather than November's 0.1.7[a] release; in particular with this change:

http://samtools.svn.sourceforge.net/viewvc/samtools/trunk/samtools/Makefile?r1=518&r2=519

...though that's only likely to make any difference with a static libz.

Also, apologies for misspelling your name in my previous reply.

John

[1] The "-3" is the RPM release number, of course; unless Centos are
being very misleading, this zlib is based on 1.2.3 -- not 1.2.3.3,
despite appearances.
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
Loading...