Question: Vcftools Makefile: Undefined Reference To 'Gzbuffer'
0
gravatar for jarrod
5.8 years ago by
jarrod0
jarrod0 wrote:

I'm trying to install vcftools, for which the Makefile (in the cpp directory) reads as follows:

# Compiler
CPP = g++
# Output executable
EXECUTABLE = vcftools
# Flag used to turn on compilation of PCA routines
ifndef VCFTOOLS_PCA
        VCFTOOLS_PCA = 0
endif
# Compiler flags
CPPFLAGS = -O2 -Wall -Wextra -D_FILE_OFFSET_BITS=64
#CPPFLAGS = -g 
# Included libraries (zlib)
#LIB = -lz 
LIB = -lz -I/usr/local/include/ -L/usr/local/lib/


OBJS = vcftools.o vcf_file.o vcf_entry.o \
                vcf_entry_getters.o vcf_entry_setters.o \
                vcf_file_filters.o vcf_file_output.o \
                vcf_file_format_convert.o \
                vcf_file_diff.o parameters.o \
                vcf_file_index.o \
                output_log.o

I have not been able to get this Makefile to run correctly, but instead get an error that reads:

vcf_file.cpp:(.text+0xe72): undefined reference to `gzbuffer'
collect2: ld returned 1 exit status
make[1]: *** [vcftools] Error 1
make[1]: Leaving directory `/home/Public/Packages/vcftools_0.1.10/cpp'
/bin/sh: 2: cd: can't cd to perl
make: *** [install] Error 2

I think part of the problem is that there is an error related to my zlib installation path (and see a related question already posted). However, I've tried to change the -I and -L paths to match my zlib installation (as suggested) and haven't had any luck (there are a lot of folders that seem to contain zlib files and may be trying the wrong folders).

Further, by searching through other forums related to this program (here), it seems that I may need zlib1g-dev. zlib1g-dev is on my computer (it shows up in my ubuntu software center), but doesn't show up when I enter:

root@root:/home/Public/Packages/vcftools_0.1.10/cpp# whereis zlib1g-dev
zlib1g-dev:
root@root:/home/Public/Packages/vcftools_0.1.10/cpp# which zlib1g-dev

I've considered removing and re-installing zlib, but it looks like several programs are dependent on it. When trying to run an install or remove, I get the following message:

sudo apt-get install zlib-devel

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package zlib-devel

I'm not sure if the problem lies in where zlib is installed on my computer, an error in the installation, or something else entirely over my head. Any suggestions would be greatly appreciated. Thank you.

vcftools • 3.3k views
ADD COMMENTlink modified 5.8 years ago by lh331k • written 5.8 years ago by jarrod0
2

You were correct in the way that you were looking for the package (on a Debian machine), but then tried to install a package that doesn't exist (well, it does in the RHEL repos but it does not look like that applies in your case). Just try to install "zlib1g-dev" and see what happens. Or, you could update with "apt-get update" or install from source.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by SES8.1k
3
gravatar for lh3
5.8 years ago by
lh331k
United States
lh331k wrote:

You need at least zlib-1.2.3.5, released on Jan 8, 2010.

ADD COMMENTlink written 5.8 years ago by lh331k

thanks, I'm not sure if it is what you suggested or another change I made, but I'm getting a different error (though it has advanced beyond the previous point, which is a plus).

I changed the code to read:

# Included libraries (zlib)
#LIB = -lz 
 LIB = -lz -I/usr/include/ -L/home/Public/Packages/zlib-1.2.7/

now, when running:

root@root:/home/Public/Packages/vcftools_0.1.10# make

i get the following

make[1]: Entering directory `/home/Public/Packages/vcftools_0.1.10/cpp'
make[1]: `vcftools' is up to date.
make[1]: Leaving directory `/home/Public/Packages/vcftools_0.1.10/cpp'
make[1]: Entering directory `/home/Public/Packages/vcftools_0.1.10/perl'
cp: cannot stat `/home/Public/Packages/vcftools_0.1.10/perl/fill-rsIDs': No such file or directory
cp: cannot stat `/home/Public/Packages/vcftools_0.1.10/perl/vcf-filter': No such file or directory
make[1]: Leaving directory `/home/Public/Packages/vcftools_0.1.10/perl'

I feel like this may still be related to an issue with zlib, though it's getting stuck at trying to copy files in the perl folder. Thanks for the quick response!!!

PS: just a quick note--zlib was installed on this machine in August 2012, so I'm assuming version 1.2.7 has been on here the entire time. not sure if that changes anything.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by jarrod0
3

This looks like a bug that hasn't been fixed in the makefile of the latest stable release. Check out the developmental version from subversion and that error will go away. Alternatively, you could probably just ignore those messages but personally I'd check out the latest code to be certain.

ADD REPLYlink written 5.8 years ago by SES8.1k

Thanks for the reply. You're correct, it was a bug. It turns out fill-rsIDs and vcf-filter have been replaced by another pm (vcf-annotate; source). I just created two files, named them fill-rsIDs and vcf-filter, and placed it in the /home/Public/Packages/vcftools_0.1.10/perl/ directory. It seemed to do the trick.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by jarrod0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1735 users visited in the last hour