Open Neato-Nick opened 10 months ago
I see the README says to use the latest release of samtools. I did that (samtools 1.18) and get a different error. I got the above by using samtools 1.9, which I found worked from a thread from a few years ago https://github.com/abyzovlab/CNVnator/issues/180
Here's the error using samtools 1.18
(base) [ncauldro@node1324 src]$ make LIBS="-lcrypto"
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.18 -Isamtools/htslib-1.18/htslib -c cnvnator.cpp -o obj/cnvnator.o
In file included from cnvnator.cpp:14:0:
AliParser.hh:18:3: error: ‘samfile_t’ does not name a type
samfile_t *file;
^
AliParser.hh:19:3: error: ‘bam_index_t’ does not name a type
bam_index_t *index;
^
AliParser.hh: In member function ‘std::string AliParser::getQueryName()’:
AliParser.hh:98:69: error: ‘bam1_qname’ was not declared in this scope
inline string getQueryName() { return (record) ? bam1_qname(record) : ""; }
^
make: *** [obj/cnvnator.o] Error 1
Hi, could you check that your file sam.h in samtools contains description of the following types: samfile_t bam_index_t bam1_t
Mayo Clinic, 200 1st street SW, Harwick 7-91 Rochester, MN 55905 www.abyzovlab.org http://www.abyzovlab.orgtel: +1-(507)-538-0978
Hi, I checked that header file in samtools/htslib 1.18 and found: samfile_t - NOT described bam_index_t - NOT described bam1_t - is described
in the file CNVnator_v0.4.1/src/samtools/htslib-1.18/htslib/sam.h
(samtools dir is symlinked from my install dir of samtools 1.18)
With samtools 1.9 I get this error. It's much cleaner than the stack I posted in OP for some reason. I chose v1.9 here because it was the "current release" at the time the current version of cnvnator was released.
$ source /path/to/root/6.10/bin/thisroot.sh
$ samtools/samtools --version
samtools 1.9
Using htslib 1.9
Copyright (C) 2018 Genome Research Ltd.
$
$ # Compile with all defaults
$ make
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
/usr/bin/ld: samtools/htslib-1.9/libhts.a(hfile_s3.o): undefined reference to symbol 'HMAC@@libcrypto.so.10'
//usr/lib64/libcrypto.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
$
$ # libcrypto error, modified configuration as per cnvnator readme
$ make LIBS="-lcrypto"
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lcrypto -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
$
$ # try compile without multi-threading
$ make LIBS="-lcrypto" OMP=no
Compiling with NO parallel support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lcrypto -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
obj/HisMaker.o: In function `calcLevelsInner(double const*, double const*, bool const*, int, int, double*, double const*, double const*) [clone ._omp_fn.0]':
HisMaker.cpp:(.text+0x2bb): undefined reference to `omp_get_num_threads'
HisMaker.cpp:(.text+0x2c3): undefined reference to `omp_get_thread_num'
HisMaker.cpp:(.text+0x577): undefined reference to `GOMP_barrier'
obj/HisMaker.o: In function `calcLevelsInner(double const*, double const*, bool const*, int, int, double*, double const*, double const*)':
HisMaker.cpp:(.text+0x9293): undefined reference to `GOMP_parallel_start'
HisMaker.cpp:(.text+0x92a5): undefined reference to `GOMP_parallel_end'
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
If compiling with no OMP support there should be no error about OMP related functions. Please try:
make clean make
Mayo Clinic, 200 1st street SW, Harwick 7-91 Rochester, MN 55905 www.abyzovlab.org http://www.abyzovlab.orgtel: +1-(507)-538-0978
Just tried a few combos preceded by make clean
and did not have luck. Looks like the error could be stemming from root
. What versions are compatible?
(base) [ncauldro@node1317 src]$ make clean
Compiling with parallel (OpenMP) support
rm -fr obj cnvnator
(base) [ncauldro@node1317 src]$ make
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c cnvnator.cpp -o obj/cnvnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c EXOnator.cpp -o obj/EXOnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c IO.cpp -o obj/IO.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Visualizer.cpp -o obj/Visualizer.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c HisMaker.cpp -o obj/HisMaker.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c AliParser.cpp -o obj/AliParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c FastaParser.cpp -o obj/FastaParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c VcfParser.cpp -o obj/VcfParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genotyper.cpp -o obj/Genotyper.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Interval.cpp -o obj/Interval.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genome.cpp -o obj/Genome.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
/usr/bin/ld: samtools/htslib-1.9/libhts.a(hfile_s3.o): undefined reference to symbol 'HMAC@@libcrypto.so.10'
//usr/lib64/libcrypto.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
(base) [ncauldro@node1317 src]$ make clean
Compiling with parallel (OpenMP) support
rm -fr obj cnvnator
(base) [ncauldro@node1317 src]$ make LIBS="-lcrypto"
Compiling with parallel (OpenMP) support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c cnvnator.cpp -o obj/cnvnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c EXOnator.cpp -o obj/EXOnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c IO.cpp -o obj/IO.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Visualizer.cpp -o obj/Visualizer.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c HisMaker.cpp -o obj/HisMaker.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c AliParser.cpp -o obj/AliParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c FastaParser.cpp -o obj/FastaParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c VcfParser.cpp -o obj/VcfParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genotyper.cpp -o obj/Genotyper.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Interval.cpp -o obj/Interval.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genome.cpp -o obj/Genome.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -fopenmp -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lcrypto -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
(base) [ncauldro@node1317 src]$ make clean
Compiling with parallel (OpenMP) support
rm -fr obj cnvnator
(base) [ncauldro@node1317 src]$ make LIBS="-lcrypto" OMP=no
Compiling with NO parallel support
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c cnvnator.cpp -o obj/cnvnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c EXOnator.cpp -o obj/EXOnator.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c IO.cpp -o obj/IO.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Visualizer.cpp -o obj/Visualizer.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c HisMaker.cpp -o obj/HisMaker.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c AliParser.cpp -o obj/AliParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c FastaParser.cpp -o obj/FastaParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c VcfParser.cpp -o obj/VcfParser.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genotyper.cpp -o obj/Genotyper.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Interval.cpp -o obj/Interval.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -I/gpfs/runtime/opt/root/6.10/include -Isamtools -Isamtools/htslib-1.9 -Isamtools/htslib-1.9/htslib -c Genome.cpp -o obj/Genome.o
g++ -O3 -std=c++11 -lpthread -DCNVNATOR_VERSION=\"v0.4.1\" -o cnvnator obj/cnvnator.o obj/EXOnator.o obj/IO.o obj/Visualizer.o obj/HisMaker.o obj/AliParser.o obj/FastaParser.o obj/VcfParser.o obj/Genotyper.o obj/Interval.o obj/Genome.o samtools/libbam.a samtools/htslib-1.9/libhts.a -lcrypto -lz -lbz2 -lcurl -llzma -lreadline -L/gpfs/runtime/opt/root/6.10/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/gpfs/runtime/opt/root/6.10/lib/libCore.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
collect2: error: ld returned 1 exit status
make: *** [cnvnator] Error 1
I got the same sam_file error for version 1.9 and 1.16 of samtools/htslib:
AliParser.hh:18:3: error: ?samfile_t? does not name a type; did you mean ?samFile??
The version 1.18 of htslib also doesn't have definition for samfile_t
, but still samFile
: https://github.com/samtools/htslib/blob/1.18/htslib/sam.h
Hello, looks like samtools has evolved. My local installation is running with samtools 1.12
Mayo Clinic, 200 1st street SW, Harwick 7-91 Rochester, MN 55905 www.abyzovlab.org http://www.abyzovlab.orgtel: +1-(507)-538-0978
I was able to install cnvnator (commit ae7f64f3e0155f9ee461e32933676e643e1ebfd7, PR #260 ) with samtools 1.12. Thanks.
Hi, I've gotten various compilation issues as I've tried various installs of root, htslib, and samtools available on my HPC. Exactly which versions are required for install?
I've tried samtools 1.9 and 1.13. In both cases, I linked the samtools src dir that also contained an htslib* sub-dir contained libhts.a. I'm using root 6.10 and have run thisroot.sh.
echo $ROOTSYS
indicated this worked. I've tried gcc 4.94, 8.3, and 12.3.1.Lastly, here is my OS info:
When I compile, I get this error
Following https://github.com/abyzovlab/CNVnator/issues/15#issuecomment-371223865 I edited the Makefile with -lpthread and I got a new error. It's the same whether or not I compile with OMP
First with just
make
I got errors related to libcrypto:So I did the alternate compilation suggested: