This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BCFTools install vcfmerge.o error

Hello

I am trying to make from source and install BCFTools (latest version) I get [Makefile:138: vcfmerge.o] Error 1

I already installed successfully HTSLib with -DVCF_ALLOW_INT64

git clone https://gith

ub.com/samtools/bcftools.git
    cd bcftools
    autoheader && autoconf && ./configure --enable-libgsl --enable-perl-filters --with-htslib=/usr/local/lib/pkgconfig/
    make

> /home/jaime/dev/cgat-flow/conda-install/envs/cgat/bin/x86_64-conda-linux-gnu-cc
> -Wall -march=ntorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/ja/envs/cgat/include -I. -I/usr/local/lib/pkgconfig//include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -iw/conda-install/envs/cgat/include  -c -o vcfmerge.o vcfmerge.c vcfmerge.c: In function 'merge_chrom2qual': vcfmerge.c:1088:22:
> warning: implicit declaration of function 'bcf_has_variant_type'; did
> you Wimplicit-function-declaration]  1088 |                 if (
> bcf_has_variant_type(line,j,VCF_REF) && line->d.allele[j][0]=='<'
>       |                      ^~~~~~~~~~~~~~~~~~~~
>       |                      bcf_get_variant_type vcfmerge.c: At top level: vcfmerge.c:2919:18: error: 'VCF_INS' undeclared here (not in a
> function); did you mean 'VCF_BN  2919 |     ins_mask   = VCF_INS<<1,
>       |                  ^~~~~~~
>       |                  VCF_BND vcfmerge.c:2920:18: error: 'VCF_DEL' undeclared here (not in a function); did you mean 'VCF_IN  2920 |    
> del_mask   = VCF_DEL<<1,
>       |                  ^~~~~~~
>       |                  VCF_INDEL vcfmerge.c: In function 'maux_update_alleles': vcfmerge.c:3000:58: error: 'VCF_ANY' undeclared
> (first use in this function); did you mean 'VC  3000 |             int
> var_type = bcf_has_variant_type(line, k, VCF_ANY);
>       |                                                          ^~~~~~~
>       |                                                          VCF_BND vcfmerge.c:3000:58: note: each undeclared identifier is
> reported only once for each function i vcfmerge.c: In function
> 'can_merge': vcfmerge.c:3085:32: warning: implicit declaration of
> function 'bcf_has_variant_types'; did
> you[-Wimplicit-function-declaration]  3085 |                 int
> var_type = bcf_has_variant_types(line, VCF_ANY, bcf_match_overlap)
>       |                                ^~~~~~~~~~~~~~~~~~~~~
>       |                                bcf_get_variant_types vcfmerge.c:3085:60: error: 'VCF_ANY' undeclared (first use in this
> function); did you mean 'VC  3085 |                 int var_type =
> bcf_has_variant_types(line, VCF_ANY, bcf_match_overlap)
>       |                                                            ^~~~~~~
>       |                                                            VCF_BND vcfmerge.c:3085:69: error: 'bcf_match_overlap' undeclared
> (first use in this function)  3085 |                 int var_type =
> bcf_has_variant_types(line, VCF_ANY, bcf_match_overlap)
>       |                                                                     ^~~~~~~~~~~~~~~~~ make: *** [Makefile:138: vcfmerge.o] Error 1

The reason why I am not using the conda bcftools is because to solve this issue (https://github.com/samtools/bcftools/issues/1961) when annotating a VCF file I need to use the HTSLib with -DVCF_ALLOW_INT64.

vcfmerge.o bcftools

1 answer

your error comes from the fact that your using a out-of-date htslib:

 --with-htslib=/usr/local/lib/pkgconfig/

instead of using the git "develop" branch, use the release: https://github.com/samtools/bcftools/releases/tag/1.19 which contains everything including htslib

Log in to answer this question.