tfwillems / HipSTR

Genotype and phase short tandem repeats using Illumina whole-genome sequencing data
GNU General Public License v2.0
94 stars 31 forks source link

ERROR cram_io from htslib: include bzlib.h #63

Closed inti closed 5 years ago

inti commented 5 years ago

Hi I am getting the following error. I am installing using a anaconda environment. I tried installing samtools and htslib with anaconda and it works fine. Any guide on how to solve this. Thanks in advance!

g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/base_quality.o -c src/base_quality.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/error.o -c src/error.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/region.o -c src/region.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/stringops.o -c src/stringops.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/zalgorithm.o -c src/zalgorithm.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/alignment_filters.o -c src/alignment_filters.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/extract_indels.o -c src/extract_indels.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/mathops.o -c src/mathops.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/pcr_duplicates.o -c src/pcr_duplicates.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/bam_io.o -c src/bam_io.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/hipstr_main.o -c src/hipstr_main.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/bam_processor.o -c src/bam_processor.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/stutter_model.o -c src/stutter_model.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/snp_phasing_quality.o -c src/snp_phasing_quality.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/snp_tree.o -c src/snp_tree.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/em_stutter_genotyper.o -c src/em_stutter_genotyper.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/seq_stutter_genotyper.o -c src/seq_stutter_genotyper.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/snp_bam_processor.o -c src/snp_bam_processor.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/genotyper_bam_processor.o -c src/genotyper_bam_processor.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/vcf_input.o -c src/vcf_input.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/read_pooler.o -c src/read_pooler.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/version.o -c src/version.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/haplotype_tracker.o -c src/haplotype_tracker.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/pedigree.o -c src/pedigree.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/vcf_reader.o -c src/vcf_reader.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/genotyper.o -c src/genotyper.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/directed_graph.o -c src/directed_graph.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/debruijn_graph.o -c src/debruijn_graph.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/fasta_reader.o -c src/fasta_reader.cpp
g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/vcf_writer.o -c src/vcf_writer.cpp
cd lib/htslib && /home/ipedroso/anaconda2/envs/hipstr/bin/make
make[1]: Entering directory '/home/ipedroso/app/HipSTR/lib/htslib'
gcc -g -Wall -O2 -I.  -c -o cram/cram_io.o cram/cram_io.c
cram/cram_io.c:57:19: fatal error: bzlib.h: No such file or directory
 #include <bzlib.h>
                   ^
compilation terminated.
make[1]: *** [Makefile:121: cram/cram_io.o] Error 1
make[1]: Leaving directory '/home/ipedroso/app/HipSTR/lib/htslib'
make: *** [Makefile:118: lib/htslib/libhts.a] Error 2
tfwillems commented 5 years ago

Are you on a linux server? If so, does installing the following solve your problem:

sudo apt-get install libbz2-dev

inti commented 5 years ago

I do not have apt-get, I will se how I can get it install on my system. If you have experience/advice please let me know.

Cheers

$uname -a
Linux darwin 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$lsb_release -rd

Description:    CentOS Linux release 7.3.1611 (Core)
Release:    7.3.1611```
tfwillems commented 5 years ago

Try this instead: sudo yum install zlib-devel bzip2-devel

inti commented 5 years ago

OK, sys admin has done that. now it says

g++ -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread  -Ilib -Ilib/htslib -o src/vcf_writer.o -c src/vcf_writer.cpp
cd lib/htslib && make
make[1]: Entering directory `/home/ipedroso/app/HipSTR/lib/htslib'
gcc -g -Wall -O2 -I.  -c -o cram/cram_io.o cram/cram_io.c
cram/cram_io.c:61:18: fatal error: lzma.h: No such file or directory
 #include <lzma.h>
                  ^
compilation terminated.
make[1]: *** [cram/cram_io.o] Error 1
make[1]: Leaving directory `/home/ipedroso/app/HipSTR/lib/htslib'
make: *** [lib/htslib/libhts.a] Error 2

Do you know if it is related to the same libraries or do we need another lib?

Cheers

tfwillems commented 5 years ago

It's another library that htslib requires. You can install them as follows: yum install lzma-devel xz-devel

inti commented 5 years ago

That did it. Thanks for the help