Closed noporpoise closed 10 years ago
Hi Isaac,
Did you run configure && make && make install
on sparsehash? You need to point --with-sparsehash to the directory that you installed to.
Jared
Hi Jared,
It looks like sparsehash installed into /usr/local/include/sparsehash
, but running ./configure --with-sparsehash=/usr/local/include/sparsehash
gives me the same error.
Isaac
Hi Isaac,
In this case I think giving the root directory (--with-sparsehash=/usr/local
) should work.
Jared
Hi Jared,
Thank you for the quick reply - that seems to work. Now I'm hitting an issue with linking to bamtools:
./configure --with-sparsehash=/usr/local --with-bamtools=/usr/local
...
Making all in SGA
g++ -Wall -Wextra -Wno-unknown-pragmas -O3 -pthread -fopenmp -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib/bamtools -L/usr/local/lib/bamtools -L/opt/local/lib -o sga sga-sga.o sga-index.o sga-overlap.o sga-assemble.o sga-correct.o sga-oview.o sga-preprocess.o sga-rmdup.o sga-merge.o sga-subgraph.o sga-scaffold.o sga-scaffold2fasta.o sga-connect.o sga-walk.o sga-filter.o sga-kmer-count.o sga-stats.o sga-fm-merge.o sga-gmap.o sga-filterBAM.o sga-cluster.o sga-gen-ssa.o sga-bwt2fa.o sga-graph-diff.o sga-graph-concordance.o sga-gapfill.o sga-preqc.o sga-variant-detectability.o sga-rewrite-evidence-bam.o sga-somatic-variant-filters.o sga-haplotype-filter.o sga-OverlapCommon.o ../Scaffold/libscaffold.a ../GraphDiff/libgraphdiff.a ../StringGraph/libstringgraph.a ../Concurrency/libconcurrency.a ../Algorithm/libalgorithm.a ../SuffixTools/libsuffixtools.a ../Bigraph/libbigraph.a ../Util/libutil.a ../SQG/libsqg.a ../Thirdparty/libthirdparty.a -lz -lbamtools
Undefined symbols for architecture x86_64:
"BamTools::BamReader::Open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
connectMain(int, char**) in sga-connect.o
filterBAMMain(int, char**) in sga-filterBAM.o
rewriteEvidenceBAMMain(int, char**) in sga-rewrite-evidence-bam.o
somaticVariantFiltersMain(int, char**) in sga-somatic-variant-filters.o
"BamTools::BamWriter::Open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, BamTools::SamHeader const&, std::vector<BamTools::RefData, std::allocator<BamTools::RefData> > const&)", referenced from:
GraphCompareAggregateResults::GraphCompareAggregateResults(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ReadTable const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libgraphdiff.a(libgraphdiff_a-GraphCompare.o)
GraphCompareAggregateResults::GraphCompareAggregateResults(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ReadTable const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libgraphdiff.a(libgraphdiff_a-GraphCompare.o)
"BamTools::BamWriter::Open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<BamTools::RefData, std::allocator<BamTools::RefData> > const&)", referenced from:
filterBAMMain(int, char**) in sga-filterBAM.o
rewriteEvidenceBAMMain(int, char**) in sga-rewrite-evidence-bam.o
"BamTools::SamHeader::SamHeader(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
GraphCompareAggregateResults::GraphCompareAggregateResults(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ReadTable const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libgraphdiff.a(libgraphdiff_a-GraphCompare.o)
GraphCompareAggregateResults::GraphCompareAggregateResults(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ReadTable const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libgraphdiff.a(libgraphdiff_a-GraphCompare.o)
"BamTools::BamAlignment::SetErrorString(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
getErrorRate(BamTools::BamAlignment&) in sga-filterBAM.o
"BamTools::BamAlignment::FindTag(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char*&, unsigned int const&, unsigned int&) const", referenced from:
getErrorRate(BamTools::BamAlignment&) in sga-filterBAM.o
"BamTools::BamReader::GetReferenceID(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
getVariantCoverage(BamTools::BamReader*, VCFRecord const&, ReadTable const*) in sga-somatic-variant-filters.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [sga] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
If I look in /usr/local/
bamtools is installed:
isaac$ ls /usr/local/lib/bamtools/
libbamtools.2.3.0.dylib libbamtools.a libbamtools.dylib
Thanks for the help, Isaac
The link flag is being set correctly (-L/usr/local/lib/bamtools
) so I don't know why its not linking. On my OSX laptop I've installed bamtools using homebrew which goes into /usr/local/lib
. This builds correctly.
What version of g++
are you using? It appears to support OpenMP, which I didn't know was available on OS X.
isaac$ g++ --version
g++ (MacPorts gcc48 4.8.2_2) 4.8.2
Hmm. I'm reading some reports of link errors in OSX 10.9 caused by a change to the C++ standard library implementation. Are you on 10.9?
On Tue, Aug 5, 2014 at 7:42 PM, Isaac Turner notifications@github.com wrote:
isaac$ g++ --version g++ (MacPorts gcc48 4.8.2_2) 4.8.2
— Reply to this email directly or view it on GitHub https://github.com/jts/sga/issues/77#issuecomment-51275635.
Yes, I'm on Mac OS X 10.9.4
Thanks. Was bamtools compiled with the same version of gcc? Can you run otool -hv -arch all /usr/local/lib/bamtools/libbamtools.a
?
isaac$ lipo -info /usr/local/lib/bamtools/libbamtools.a
input file /usr/local/lib/bamtools/libbamtools.a is not a fat file
Non-fat file: /usr/local/lib/bamtools/libbamtools.a is architecture: x86_64
Fixed! Bamtools cmake
was choosing a different compiler. Setting compilers with:
export CC=/opt/local/bin/gcc
export CXX=/opt/local/bin/g++
before compiling Bamtools fixed the issue when linking SGA.
Many thanks Jared.
Isaac
Aha! Very glad to hear it.
A note for others using a mac: I had to add the following to ~/.profile
export DYLD_LIBRARY_PATH=/usr/local/lib/bamtools:${DYLD_LIBRARY_PATH}
Otherwise sga
fails with the error:
dyld: Library not loaded: libbamtools.2.3.0.dylib
Referenced from: /Users/isaac/bioinf/sga/src/./SGA/sga
Reason: image not found
Trace/BPT trap: 5
When running
./configure --with-sparsehash=<...>
I get the message:configure: error: google sparse hash library is required
.