samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
682 stars 240 forks source link

bcftools installation #716

Closed Moohbear2 closed 7 years ago

Moohbear2 commented 7 years ago

Hello,

I'm trying to install the samtool suite on a ubuntu machine. I installed htslib and samtools from the cloned git repo without issues, but bcftools is giving me an error. I did

autoheader
autoconf
./configure --prefix=/usr/local
make
gcc -rdynamic -pthread   -o bcftools main.o vcfindex.o tabix.o vcfstats.o vcfisec.o vcfmerge.o vcfquery.o vcffilter.o filter.o vcfsom.o vcfnorm.o vcfgtcheck.o vcfview.o vcfannotate.o vcfroh.o vcfconcat.o vcfcall.o mcall.o vcmp.o gvcf.o reheader.o convert.o vcfconvert.o tsv2vcf.o vcfcnv.o HMM.o vcfplugin.o consensus.o ploidy.o bin.o hclust.o version.o regidx.o smpl_ilist.o csq.o vcfbuf.o mpileup.o bam2bcf.o bam2bcf_indel.o bam_sample.o vcfsort.o ccall.o em.o prob1.o kmin.o  -lhts -lm -lz -ldl -ldl
vcfindex.o: In function `main_vcfindex':
/home/toto/bcftools/vcfindex.c:220: undefined reference to `bcf_index_build3'
vcfstats.o: In function `_indel_ctx_insert':
/home/toto/bcftools/vcfstats.c:245: undefined reference to `hts_realloc_or_die'
vcfstats.o: In function `init_iaf':
/home/toto/bcftools/vcfstats.c:597: undefined reference to `hts_realloc_or_die'
vcfstats.o: In function `do_indel_stats':
/home/toto/bcftools/vcfstats.c:678: undefined reference to `hts_realloc_or_die'
vcfstats.o: In function `main_vcfstats':
/home/toto/bcftools/vcfstats.c:1705: undefined reference to `bcf_sr_set_threads'
vcfmerge.o: In function `merge_headers':
/home/toto/bcftools/vcfmerge.c:498: undefined reference to `bcf_hdr_merge'
vcfmerge.o: In function `merge_alleles':
/home/toto/bcftools/vcfmerge.c:623: undefined reference to `hts_realloc_or_die'
vcfmerge.o: In function `maux_expand1':
/home/toto/bcftools/vcfmerge.c:733: undefined reference to `hts_realloc_or_die'
vcfmerge.o: In function `merge_chrom2qual':
/home/toto/bcftools/vcfmerge.c:888: undefined reference to `hts_realloc_or_die'
vcfmerge.o: In function `merge_filter':
/home/toto/bcftools/vcfmerge.c:945: undefined reference to `hts_realloc_or_die'
vcfmerge.o: In function `merge_AGR_info_tag':
/home/toto/bcftools/vcfmerge.c:1049: undefined reference to `hts_realloc_or_die'
vcfmerge.o:/home/toto/bcftools/vcfmerge.c:408: more undefined references to `hts_realloc_or_die' follow
vcfmerge.o: In function `main_vcfmerge':
/home/toto/bcftools/vcfmerge.c:2484: undefined reference to `bcf_sr_set_threads'
vcffilter.o: In function `buffered_filters':
/home/toto/bcftools/vcffilter.c:287: undefined reference to `hts_realloc_or_die'
filter.o: In function `filters_set_format_float':
/home/toto/bcftools/filter.c:624: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:647: undefined reference to `hts_realloc_or_die'
filter.o: In function `filters_set_format_int':
/home/toto/bcftools/filter.c:560: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:583: undefined reference to `hts_realloc_or_die'
filter.o:/home/toto/bcftools/filter.c:1067: more undefined references to `hts_realloc_or_die' follow
filter.o: In function `bcf_format_gt':
/usr/local/include/htslib/vcf.h:917: undefined reference to `hts_log'
filter.o: In function `filter_init':
/home/toto/bcftools/filter.c:1867: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:1894: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:1873: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:1884: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/filter.c:2019: undefined reference to `hts_realloc_or_die'
filter.o:/home/toto/bcftools/filter.c:1524: more undefined references to `hts_realloc_or_die' follow
vcfnorm.o: In function `merge_biallelics_to_multiallelic':
/home/toto/bcftools/vcfnorm.c:1391: undefined reference to `bcf_add_id'
/home/toto/bcftools/vcfnorm.c:1393: undefined reference to `hts_realloc_or_die'
vcfnorm.o: In function `merge_format_numeric':
/home/toto/bcftools/vcfnorm.c:1231: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfnorm.c:1231: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfnorm.c:1231: undefined reference to `hts_realloc_or_die'
vcfnorm.o: In function `merge_format_string':
/home/toto/bcftools/vcfnorm.c:1276: undefined reference to `hts_realloc_or_die'
vcfnorm.o:/home/toto/bcftools/vcfnorm.c:1232: more undefined references to `hts_realloc_or_die' follow
vcfnorm.o: In function `main_vcfnorm':
/home/toto/bcftools/vcfnorm.c:1885: undefined reference to `bcf_sr_set_threads'
vcfgtcheck.o: In function `fake_PLs':
/home/toto/bcftools/vcfgtcheck.c:308: undefined reference to `hts_realloc_or_die'
vcfview.o: In function `subset_vcf':
/home/toto/bcftools/vcfview.c:335: undefined reference to `hts_realloc_or_die'
vcfview.o: In function `main_vcfview':
/home/toto/bcftools/vcfview.c:736: undefined reference to `bcf_sr_set_threads'
vcfannotate.o: In function `setter_ARinfo_real':
/home/toto/bcftools/vcfannotate.c:593: undefined reference to `hts_realloc_or_die'
vcfannotate.o: In function `setter_ARinfo_int32':
/home/toto/bcftools/vcfannotate.c:513: undefined reference to `hts_realloc_or_die'
vcfannotate.o: In function `setter_info_int':
/home/toto/bcftools/vcfannotate.c:545: undefined reference to `hts_realloc_or_die'
vcfannotate.o: In function `setter_info_real':
/home/toto/bcftools/vcfannotate.c:625: undefined reference to `hts_realloc_or_die'
vcfannotate.o: In function `vcf_setter_format_gt':
/home/toto/bcftools/vcfannotate.c:804: undefined reference to `hts_realloc_or_die'
vcfannotate.o:/home/toto/bcftools/vcfannotate.c:771: more undefined references to `hts_realloc_or_die' follow
vcfannotate.o: In function `main_vcfannotate':
/home/toto/bcftools/vcfannotate.c:1998: undefined reference to `bcf_sr_set_threads'
vcfannotate.o: In function `buffer_annot_lines':
/home/toto/bcftools/vcfannotate.c:1745: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfannotate.c:1766: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfannotate.c:1729: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfannotate.c:1738: undefined reference to `hts_realloc_or_die'
/home/toto/bcftools/vcfannotate.c:1758: undefined reference to `hts_realloc_or_die'
vcfannotate.o: In function `setter_id':
/home/toto/bcftools/vcfannotate.c:441: undefined reference to `bcf_add_id'
vcfannotate.o: In function `vcf_setter_id':
/home/toto/bcftools/vcfannotate.c:453: undefined reference to `bcf_add_id'
vcfroh.o: In function `load_genmap':
/home/toto/bcftools/vcfroh.c:376: undefined reference to `hts_realloc_or_die'
vcfroh.o: In function `process_line':
/home/toto/bcftools/vcfroh.c:933: undefined reference to `hts_realloc_or_die'
vcfroh.o: In function `main_vcfroh':
/home/toto/bcftools/vcfroh.c:1202: undefined reference to `bcf_sr_set_threads'
vcfconcat.o: In function `init_data':
/home/toto/bcftools/vcfconcat.c:78: undefined reference to `bcf_hdr_merge'
vcfconcat.o: In function `phased_push':
/home/toto/bcftools/vcfconcat.c:385: undefined reference to `hts_realloc_or_die'
vcfconcat.o: In function `naive_concat':
/home/toto/bcftools/vcfconcat.c:647: undefined reference to `hts_realloc_or_die'
vcfcall.o: In function `add_sample':
/home/toto/bcftools/vcfcall.c:110: undefined reference to `hts_realloc_or_die'
vcfcall.o: In function `parse_ped_samples':
/home/toto/bcftools/vcfcall.c:225: undefined reference to `hts_realloc_or_die'
mcall.o: In function `estimate_qsum':
/home/toto/bcftools/mcall.c:446: undefined reference to `hts_realloc_or_die'
mcall.o:/home/toto/bcftools/mcall.c:1395: more undefined references to `hts_realloc_or_die' follow
reheader.o: In function `reheader_bcf':
/home/toto/bcftools/reheader.c:374: undefined reference to `bcf_hdr_format'
convert.o: In function `bcf_format_gt':
/usr/local/include/htslib/vcf.h:917: undefined reference to `hts_log'
convert.o: In function `process_tbcsq':
/home/toto/bcftools/convert.c:376: undefined reference to `hts_realloc_or_die'
convert.o: In function `init_format_iupac':
/home/toto/bcftools/convert.c:448: undefined reference to `hts_realloc_or_die'
convert.o: In function `process_qual':
/home/toto/bcftools/convert.c:145: undefined reference to `kputd'
convert.o: In function `process_format':
/home/toto/bcftools/convert.c:282: undefined reference to `kputd'
convert.o: In function `process_info':
/home/toto/bcftools/convert.c:235: undefined reference to `kputd'
vcfconvert.o: In function `open_vcf':
/home/toto/bcftools/vcfconvert.c:85: undefined reference to `bcf_sr_set_threads'
vcfconvert.o: In function `vcf_to_haplegendsample':
/home/toto/bcftools/vcfconvert.c:899: undefined reference to `bgzf_thread_pool'
vcfconvert.o: In function `vcf_to_hapsample':
/home/toto/bcftools/vcfconvert.c:1049: undefined reference to `bgzf_thread_pool'
vcfcnv.o: In function `update_sample_args':
/home/toto/bcftools/vcfcnv.c:820: undefined reference to `hts_realloc_or_die'
vcfcnv.o: In function `cnv_next_line':
/home/toto/bcftools/vcfcnv.c:1166: undefined reference to `hts_realloc_or_die'
vcfplugin.o: In function `list_plugins':
/home/toto/bcftools/vcfplugin.c:382: undefined reference to `hts_realloc_or_die'
ploidy.o: In function `ploidy_parse':
/home/toto/bcftools/ploidy.c:97: undefined reference to `hts_realloc_or_die'
ploidy.o: In function `ploidy_add_sex':
/home/toto/bcftools/ploidy.c:252: undefined reference to `hts_realloc_or_die'
hclust.o:/home/toto/bcftools/hclust.c:240: more undefined references to `hts_realloc_or_die' follow
mpileup.o: In function `mplp_func':
/home/toto/bcftools/mpileup.c:233: undefined reference to `sam_prob_realn'
/home/toto/bcftools/mpileup.c:235: undefined reference to `sam_cap_mapq'
mpileup.o: In function `mpileup':
/home/toto/bcftools/mpileup.c:614: undefined reference to `bam_mplp_constructor'
/home/toto/bcftools/mpileup.c:642: undefined reference to `bam_mplp_reset'
bam2bcf.o: In function `bcf_call_init':
/home/toto/bcftools/bam2bcf.c:51: undefined reference to `errmod_init'
bam2bcf.o: In function `bcf_call_destroy':
/home/toto/bcftools/bam2bcf.c:71: undefined reference to `errmod_destroy'
bam2bcf.o: In function `bcf_call_glfgen':
/home/toto/bcftools/bam2bcf.c:249: undefined reference to `errmod_cal'
bam2bcf_indel.o: In function `ks_shuffle_uint32_t':
/home/toto/bcftools/bam2bcf_indel.c:35: undefined reference to `hts_drand48'
bam2bcf_indel.o: In function `bcf_call_gap_prep':
/home/toto/bcftools/bam2bcf_indel.c:346: undefined reference to `probaln_glocal'
/home/toto/bcftools/bam2bcf_indel.c:352: undefined reference to `probaln_glocal'
vcfsort.o: In function `buf_push':
/home/toto/bcftools/vcfsort.c:109: undefined reference to `hts_realloc_or_die'
ccall.o: In function `ccall':
/home/toto/bcftools/ccall.c:324: undefined reference to `hts_realloc_or_die'
collect2: error: ld returned 1 exit status
Makefile:138: recipe for target 'bcftools' failed
make: *** [bcftools] Error 1

gcc is up-to-date as far as I can tell. Any idea? Thanks!

jkbonfield commented 7 years ago

This is most likely a mismatch between htslib header files and library version.

hts_realloc_or_die is used in the hts_expand macro, since commit 677d9b0a (Dec 2016). If you compile using hts.h since then your code will get dependencies on the hts_realloc_or_die function. The same commit also added this function to hts.c, so it should be in the htslib library.

If however you have htslib installed on your system somewhere already, possibly earlier in your library search path, then you can get the scenario of compiling using headers from one release and linking against the library from another earlier one.

(The bcftools configure script perhaps should check for this scenario, and be explicit about library paths.)

Moohbear2 commented 7 years ago

I did install htslib first indeed. I managed to solve the problem by using checkinstall instead of make install.