Vcftools Makefile: Undefined Reference To 'Gzbuffer'
1
0
Entering edit mode
11.3 years ago
jarrod • 0

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 • 5.8k views
ADD COMMENT
2
Entering edit mode

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 REPLY
3
Entering edit mode
11.3 years ago
lh3 33k

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

ADD COMMENT
0
Entering edit mode

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 REPLY
3
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1998 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6