abyzovlab / CNVnator

a tool for CNV discovery and genotyping from depth-of-coverage by mapped reads
Other
208 stars 65 forks source link

Fail to build CNVnator 0.4 from source on Debian Stretch #145

Closed kalon33 closed 3 years ago

kalon33 commented 5 years ago

Trying to build CNVnator on Debian Stretch, I got this error:

make[1]: Entering directory '/home/nicolas/CNVnator-0.4'
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c cnvnator.cpp -o obj/cnvnator.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c EXOnator.cpp -o obj/EXOnator.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c HisMaker.cpp -o obj/HisMaker.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c AliParser.cpp -o obj/AliParser.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c FastaParser.cpp -o obj/FastaParser.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c VcfParser.cpp -o obj/VcfParser.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c Genotyper.cpp -o obj/Genotyper.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c Interval.cpp -o obj/Interval.o
g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"v0.4\" -fopenmp -I/usr/include -I/usr/include/samtools -I/usr/include/htslib -c Genome.cpp -o obj/Genome.o
In file included from /usr/include/htslib/vcf.h:39:0,
                 from VcfParser.hh:8,
                 from HisMaker.cpp:7:
/usr/include/htslib/hts.h:42:16: error: using typedef-name 'BGZF' after 'struct'
 typedef struct BGZF BGZF;
                ^~~~
In file included from /usr/include/samtools/bam.h:52:0,
                 from /usr/include/samtools/sam.h:4,
                 from AliParser.hh:10,
                 from HisMaker.hh:33,
                 from HisMaker.cpp:2:
/usr/include/samtools/bgzf.h:53:3: note: 'BGZF' has a previous declaration here
 } BGZF;
   ^~~~
In file included from /usr/include/htslib/vcf.h:39:0,
                 from VcfParser.hh:8,
                 from HisMaker.cpp:7:
/usr/include/htslib/hts.h:42:21: error: conflicting declaration 'typedef int BGZF'
 typedef struct BGZF BGZF;
                     ^~~~
In file included from /usr/include/samtools/bam.h:52:0,
                 from /usr/include/samtools/sam.h:4,
                 from AliParser.hh:10,
                 from HisMaker.hh:33,
                 from HisMaker.cpp:2:
/usr/include/samtools/bgzf.h:53:3: note: previous declaration as 'typedef struct BGZF BGZF'
 } BGZF;
   ^~~~
Makefile:53: recipe for target 'obj/HisMaker.o' failed
make[1]: *** [obj/HisMaker.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/nicolas/CNVnator-0.4'

Installed dependencies are samtools, zlib1g-dev, python-pysam, libsnp-sites1-dev, libbam-dev, libhts-dev and ROOT framework.

suvakov commented 5 years ago

Hi, Problem may be related to htslib (part of samtools release). Please try following: 1) download latest samtools release from: https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2 2) extract it and compile with: tar xjf samtools-1.9.tar.bz2 cd samtools-1.9 ./configure make 3) replace "samtools" symbolic link in your CNVnator folder with new samtools-1.9 folder. 4) compile CNVnator